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.

refactor: regenerate radix stories (#4256)

Bogdan Chadkinbdb98605895c
diff --git a/packages/sdk-cli/src/generate-stories.ts b/packages/sdk-cli/src/generate-stories.ts
index 7454b6e0b1..8d2db70a8e 100644
--- a/packages/sdk-cli/src/generate-stories.ts
+++ b/packages/sdk-cli/src/generate-stories.ts
@@ -70,7 +70,9 @@ const generateComponentImports = ({
};
const getStoriesImports = ({ hasState }: { hasState: boolean }) =>
- hasState ? `import { useState } from "react";\n` : "";
+ hasState
+ ? `import { useVariableState } from "@webstudio-is/react-sdk/runtime";\n`
+ : "";
const getStoriesExports = (name: string, css: string) => `
export default {
diff --git a/packages/sdk-components-react-radix/src/__generated__/accordion.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/accordion.stories.tsx
index bdb955af35..e02b94c70a 100644
--- a/packages/sdk-components-react-radix/src/__generated__/accordion.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/accordion.stories.tsx
@@ -13,61 +13,65 @@ import {
const Component = () => {
return (
- <Box className="w-box">
- <Accordion collapsible={true} defaultValue={"0"} className="w-accordion">
- <AccordionItem data-ws-index="0" className="w-item w-item-1">
- <AccordionHeader className="w-item-header w-item-header-1">
- <AccordionTrigger className="w-item-trigger w-item-trigger-1">
- <Text className="w-text">{"Is it accessible?"}</Text>
- <Box className="w-box w-icon-container">
+ <Box className={"w-box"}>
+ <Accordion
+ collapsible={true}
+ defaultValue={"0"}
+ className={"w-accordion"}
+ >
+ <AccordionItem data-ws-index="0" className={"w-item w-item-1"}>
+ <AccordionHeader className={"w-item-header w-item-header-1"}>
+ <AccordionTrigger className={"w-item-trigger w-item-trigger-1"}>
+ <Text className={"w-text"}>{"Is it accessible?"}</Text>
+ <Box className={"w-box w-icon-container"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Box>
</AccordionTrigger>
</AccordionHeader>
- <AccordionContent className="w-item-content w-item-content-1">
+ <AccordionContent className={"w-item-content w-item-content-1"}>
{"Yes. It adheres to the WAI-ARIA design pattern."}
</AccordionContent>
</AccordionItem>
- <AccordionItem data-ws-index="1" className="w-item w-item-2">
- <AccordionHeader className="w-item-header w-item-header-2">
- <AccordionTrigger className="w-item-trigger w-item-trigger-2">
- <Text className="w-text">{"Is it styled?"}</Text>
- <Box className="w-box w-icon-container-1">
+ <AccordionItem data-ws-index="1" className={"w-item w-item-2"}>
+ <AccordionHeader className={"w-item-header w-item-header-2"}>
+ <AccordionTrigger className={"w-item-trigger w-item-trigger-2"}>
+ <Text className={"w-text"}>{"Is it styled?"}</Text>
+ <Box className={"w-box w-icon-container-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Box>
</AccordionTrigger>
</AccordionHeader>
- <AccordionContent className="w-item-content w-item-content-2">
+ <AccordionContent className={"w-item-content w-item-content-2"}>
{
"Yes. It comes with default styles that matches the other components' aesthetic."
}
</AccordionContent>
</AccordionItem>
- <AccordionItem data-ws-index="2" className="w-item w-item-3">
- <AccordionHeader className="w-item-header w-item-header-3">
- <AccordionTrigger className="w-item-trigger w-item-trigger-3">
- <Text className="w-text">{"Is it animated?"}</Text>
- <Box className="w-box w-icon-container-2">
+ <AccordionItem data-ws-index="2" className={"w-item w-item-3"}>
+ <AccordionHeader className={"w-item-header w-item-header-3"}>
+ <AccordionTrigger className={"w-item-trigger w-item-trigger-3"}>
+ <Text className={"w-text"}>{"Is it animated?"}</Text>
+ <Box className={"w-box w-icon-container-2"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Box>
</AccordionTrigger>
</AccordionHeader>
- <AccordionContent className="w-item-content w-item-content-3">
+ <AccordionContent className={"w-item-content w-item-content-3"}>
{
"Yes. It's animated by default, but you can disable it if you prefer."
}
@@ -88,12 +92,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/checkbox.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/checkbox.stories.tsx
index ff3f7a692c..b7b7cfdeba 100644
--- a/packages/sdk-components-react-radix/src/__generated__/checkbox.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/checkbox.stories.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useVariableState } from "@webstudio-is/react-sdk/runtime";
import {
Box as Box,
HtmlEmbed as HtmlEmbed,
@@ -11,28 +11,30 @@ import {
} from "../components";
const Component = () => {
- let [checkboxChecked, set$checkboxChecked] = useState<any>(false);
+ let [checkboxChecked, set$checkboxChecked] = useVariableState<any>(false);
return (
- <Box className="w-box">
- <Label className="w-label w-checkbox-field">
+ <Box className={"w-box"}>
+ <Label className={"w-label w-checkbox-field"}>
<Checkbox
checked={checkboxChecked}
onCheckedChange={(checked: any) => {
checkboxChecked = checked;
set$checkboxChecked(checkboxChecked);
}}
- className="w-checkbox w-checkbox-1"
+ className={"w-checkbox w-checkbox-1"}
>
- <CheckboxIndicator className="w-checkbox-indicator w-checkbox-indicator-1">
+ <CheckboxIndicator
+ className={"w-checkbox-indicator w-checkbox-indicator-1"}
+ >
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M11.957 5.043a1 1 0 0 1 0 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.75 8.836l3.793-3.793a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</CheckboxIndicator>
</Checkbox>
- <Text tag={"span"} className="w-text">
+ <Text tag={"span"} className={"w-text"}>
{"Checkbox"}
</Text>
</Label>
@@ -50,12 +52,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/collapsible.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/collapsible.stories.tsx
index f9dffbbdb1..9bf72d882f 100644
--- a/packages/sdk-components-react-radix/src/__generated__/collapsible.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/collapsible.stories.tsx
@@ -11,15 +11,15 @@ import {
const Component = () => {
return (
- <Box className="w-box">
- <Collapsible className="w-collapsible">
+ <Box className={"w-box"}>
+ <Collapsible className={"w-collapsible"}>
<CollapsibleTrigger>
- <Button className="w-button w-button-1">
+ <Button className={"w-button w-button-1"}>
{"Click to toggle content"}
</Button>
</CollapsibleTrigger>
- <CollapsibleContent className="w-collapsible-content">
- <Text className="w-text">{"Collapsible Content"}</Text>
+ <CollapsibleContent className={"w-collapsible-content"}>
+ <Text className={"w-text"}>{"Collapsible Content"}</Text>
</CollapsibleContent>
</Collapsible>
</Box>
@@ -36,12 +36,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/dialog.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/dialog.stories.tsx
index 3e763487bb..32ac6d88fc 100644
--- a/packages/sdk-components-react-radix/src/__generated__/dialog.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/dialog.stories.tsx
@@ -16,28 +16,30 @@ import {
const Component = () => {
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Dialog>
<DialogTrigger>
- <Button className="w-button w-button-1">{"Button"}</Button>
+ <Button className={"w-button w-button-1"}>{"Button"}</Button>
</DialogTrigger>
- <DialogOverlay className="w-dialog-overlay w-dialog-overlay-1">
- <DialogContent className="w-dialog-content w-dialog-content-1">
- <Box className="w-box w-dialog-header">
- <DialogTitle className="w-dialog-title w-dialog-title-1">
+ <DialogOverlay className={"w-dialog-overlay w-dialog-overlay-1"}>
+ <DialogContent className={"w-dialog-content w-dialog-content-1"}>
+ <Box className={"w-box w-dialog-header"}>
+ <DialogTitle className={"w-dialog-title w-dialog-title-1"}>
{"Dialog Title you can edit"}
</DialogTitle>
- <DialogDescription className="w-dialog-description w-dialog-description-1">
+ <DialogDescription
+ className={"w-dialog-description w-dialog-description-1"}
+ >
{"Dialog description text you can edit"}
</DialogDescription>
</Box>
- <Text className="w-text">{"The text you can edit"}</Text>
- <DialogClose className="w-close-button w-close-button-1">
+ <Text className={"w-text"}>{"The text you can edit"}</Text>
+ <DialogClose className={"w-close-button w-close-button-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M13.566 2.434a.8.8 0 0 1 0 1.132L9.13 8l4.435 4.434a.8.8 0 0 1-1.132 1.132L8 9.13l-4.434 4.435a.8.8 0 0 1-1.132-1.132L6.87 8 2.434 3.566a.8.8 0 0 1 1.132-1.132L8 6.87l4.434-4.435a.8.8 0 0 1 1.132 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</DialogClose>
</DialogContent>
@@ -57,12 +59,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/label.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/label.stories.tsx
index 715872f89a..e013f384bb 100644
--- a/packages/sdk-components-react-radix/src/__generated__/label.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/label.stories.tsx
@@ -3,8 +3,8 @@ import { Label as Label } from "../components";
const Component = () => {
return (
- <Box className="w-box">
- <Label className="w-label w-label-1">{"Form Label"}</Label>
+ <Box className={"w-box"}>
+ <Label className={"w-label w-label-1"}>{"Form Label"}</Label>
</Box>
);
};
@@ -19,12 +19,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/navigation-menu.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/navigation-menu.stories.tsx
index 7a13a9d65e..ad21f030e4 100644
--- a/packages/sdk-components-react-radix/src/__generated__/navigation-menu.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/navigation-menu.stories.tsx
@@ -18,65 +18,65 @@ import {
const Component = () => {
return (
- <Box className="w-box">
- <NavigationMenu className="w-navigation-menu w-navigation-menu-1">
- <NavigationMenuList className="w-menu-list w-menu-list-1">
- <NavigationMenuItem data-ws-index="0" className="w-menu-item">
- <NavigationMenuTrigger className="w-menu-trigger">
- <Button className="w-button w-button-1">
- <Text className="w-text">{"About"}</Text>
- <Box className="w-box w-icon-container">
+ <Box className={"w-box"}>
+ <NavigationMenu className={"w-navigation-menu w-navigation-menu-1"}>
+ <NavigationMenuList className={"w-menu-list w-menu-list-1"}>
+ <NavigationMenuItem data-ws-index="0" className={"w-menu-item"}>
+ <NavigationMenuTrigger className={"w-menu-trigger"}>
+ <Button className={"w-button w-button-1"}>
+ <Text className={"w-text"}>{"About"}</Text>
+ <Box className={"w-box w-icon-container"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Box>
</Button>
</NavigationMenuTrigger>
<NavigationMenuContent
data-ws-index="0"
- className="w-menu-content w-menu-content-1"
+ className={"w-menu-content w-menu-content-1"}
>
- <Box className="w-box w-content">
- <Box className="w-box w-box-1">{""}</Box>
- <Box className="w-box w-flex-column">
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <Box className={"w-box w-content"}>
+ <Box className={"w-box w-box-1"}>{""}</Box>
+ <Box className={"w-box w-flex-column"}>
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/sheet"}
- className="w-link w-link-1"
+ className={"w-link w-link-1"}
>
- <Text className="w-text w-text-1">{"Sheet"}</Text>
- <Paragraph className="w-paragraph w-paragraph-1">
+ <Text className={"w-text w-text-1"}>{"Sheet"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-1"}>
{
"Extends the Dialog component to display content that complements the main content of the screen."
}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={
"https://ui.shadcn.com/docs/components/navigation-menu"
}
- className="w-link w-link-2"
+ className={"w-link w-link-2"}
>
- <Text className="w-text w-text-2">
+ <Text className={"w-text w-text-2"}>
{"Navigation Menu"}
</Text>
- <Paragraph className="w-paragraph w-paragraph-2">
+ <Paragraph className={"w-paragraph w-paragraph-2"}>
{"A collection of links for navigating websites."}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/tabs"}
- className="w-link w-link-3"
+ className={"w-link w-link-3"}
>
- <Text className="w-text w-text-3">{"Tabs"}</Text>
- <Paragraph className="w-paragraph w-paragraph-3">
+ <Text className={"w-text w-text-3"}>{"Tabs"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-3"}>
{
"A set of layered sections of content—known as tab panels—that are displayed one at a time."
}
@@ -87,59 +87,59 @@ const Component = () => {
</Box>
</NavigationMenuContent>
</NavigationMenuItem>
- <NavigationMenuItem data-ws-index="1" className="w-menu-item">
- <NavigationMenuTrigger className="w-menu-trigger">
- <Button className="w-button w-button-2">
- <Text className="w-text">{"Components"}</Text>
- <Box className="w-box w-icon-container-1">
+ <NavigationMenuItem data-ws-index="1" className={"w-menu-item"}>
+ <NavigationMenuTrigger className={"w-menu-trigger"}>
+ <Button className={"w-button w-button-2"}>
+ <Text className={"w-text"}>{"Components"}</Text>
+ <Box className={"w-box w-icon-container-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M4.04 6.284a.65.65 0 0 1 .92.001L8 9.335l3.04-3.05a.65.65 0 1 1 .921.918l-3.5 3.512a.65.65 0 0 1-.921 0L4.039 7.203a.65.65 0 0 1 .001-.92Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Box>
</Button>
</NavigationMenuTrigger>
<NavigationMenuContent
data-ws-index="1"
- className="w-menu-content w-menu-content-2"
+ className={"w-menu-content w-menu-content-2"}
>
- <Box className="w-box w-content-1">
- <Box className="w-box w-flex-column-1">
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <Box className={"w-box w-content-1"}>
+ <Box className={"w-box w-flex-column-1"}>
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/accordion"}
- className="w-link w-link-4"
+ className={"w-link w-link-4"}
>
- <Text className="w-text w-text-4">{"Accordion"}</Text>
- <Paragraph className="w-paragraph w-paragraph-4">
+ <Text className={"w-text w-text-4"}>{"Accordion"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-4"}>
{
"A vertically stacked set of interactive headings that each reveal a section of content."
}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/dialog"}
- className="w-link w-link-5"
+ className={"w-link w-link-5"}
>
- <Text className="w-text w-text-5">{"Dialog"}</Text>
- <Paragraph className="w-paragraph w-paragraph-5">
+ <Text className={"w-text w-text-5"}>{"Dialog"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-5"}>
{
"A window overlaid on either the primary window or another dialog window, rendering the content underneath inert."
}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/collapsible"}
- className="w-link w-link-6"
+ className={"w-link w-link-6"}
>
- <Text className="w-text w-text-6">{"Collapsible"}</Text>
- <Paragraph className="w-paragraph w-paragraph-6">
+ <Text className={"w-text w-text-6"}>{"Collapsible"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-6"}>
{
"An interactive component which expands/collapses a panel."
}
@@ -147,40 +147,40 @@ const Component = () => {
</Link>
</NavigationMenuLink>
</Box>
- <Box className="w-box w-flex-column-2">
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <Box className={"w-box w-flex-column-2"}>
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/popover"}
- className="w-link w-link-7"
+ className={"w-link w-link-7"}
>
- <Text className="w-text w-text-7">{"Popover"}</Text>
- <Paragraph className="w-paragraph w-paragraph-7">
+ <Text className={"w-text w-text-7"}>{"Popover"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-7"}>
{
"Displays rich content in a portal, triggered by a button."
}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/tooltip"}
- className="w-link w-link-8"
+ className={"w-link w-link-8"}
>
- <Text className="w-text w-text-8">{"Tooltip"}</Text>
- <Paragraph className="w-paragraph w-paragraph-8">
+ <Text className={"w-text w-text-8"}>{"Tooltip"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-8"}>
{
"A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it."
}
</Paragraph>
</Link>
</NavigationMenuLink>
- <NavigationMenuLink className="w-accessible-link-wrapper">
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
<Link
href={"https://ui.shadcn.com/docs/components/button"}
- className="w-link w-link-9"
+ className={"w-link w-link-9"}
>
- <Text className="w-text w-text-9">{"Button"}</Text>
- <Paragraph className="w-paragraph w-paragraph-9">
+ <Text className={"w-text w-text-9"}>{"Button"}</Text>
+ <Paragraph className={"w-paragraph w-paragraph-9"}>
{
"Displays a button or a component that looks like a button."
}
@@ -191,14 +191,16 @@ const Component = () => {
</Box>
</NavigationMenuContent>
</NavigationMenuItem>
- <NavigationMenuItem data-ws-index="2" className="w-menu-item">
- <NavigationMenuLink className="w-accessible-link-wrapper">
- <Link className="w-link w-link-10">{"Standalone"}</Link>
+ <NavigationMenuItem data-ws-index="2" className={"w-menu-item"}>
+ <NavigationMenuLink className={"w-accessible-link-wrapper"}>
+ <Link className={"w-link w-link-10"}>{"Standalone"}</Link>
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
- <Box className="w-box w-viewport-container">
- <NavigationMenuViewport className="w-menu-viewport w-menu-viewport-1" />
+ <Box className={"w-box w-viewport-container"}>
+ <NavigationMenuViewport
+ className={"w-menu-viewport w-menu-viewport-1"}
+ />
</Box>
</NavigationMenu>
</Box>
@@ -215,12 +217,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/popover.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/popover.stories.tsx
index 8cf9106395..9b97ffc59a 100644
--- a/packages/sdk-components-react-radix/src/__generated__/popover.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/popover.stories.tsx
@@ -11,13 +11,13 @@ import {
const Component = () => {
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Popover>
<PopoverTrigger>
- <Button className="w-button w-button-1">{"Button"}</Button>
+ <Button className={"w-button w-button-1"}>{"Button"}</Button>
</PopoverTrigger>
- <PopoverContent className="w-popover-content w-popover-content-1">
- <Text className="w-text">{"The text you can edit"}</Text>
+ <PopoverContent className={"w-popover-content w-popover-content-1"}>
+ <Text className={"w-text"}>{"The text you can edit"}</Text>
</PopoverContent>
</Popover>
</Box>
@@ -34,12 +34,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/radio-group.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/radio-group.stories.tsx
index b7c7476466..9213d85e80 100644
--- a/packages/sdk-components-react-radix/src/__generated__/radio-group.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/radio-group.stories.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useVariableState } from "@webstudio-is/react-sdk/runtime";
import {
Box as Box,
HtmlEmbed as HtmlEmbed,
@@ -12,64 +12,64 @@ import {
} from "../components";
const Component = () => {
- let [radioGroupValue, set$radioGroupValue] = useState<any>("");
+ let [radioGroupValue, set$radioGroupValue] = useVariableState<any>("");
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<RadioGroup
value={radioGroupValue}
onValueChange={(value: any) => {
radioGroupValue = value;
set$radioGroupValue(radioGroupValue);
}}
- className="w-radio-group w-radio-group-1"
+ className={"w-radio-group w-radio-group-1"}
>
- <Label className="w-label w-label-1">
+ <Label className={"w-label w-label-1"}>
<RadioGroupItem
value={"default"}
- className="w-radio-group-item w-radio-group-item-1"
+ className={"w-radio-group-item w-radio-group-item-1"}
>
- <RadioGroupIndicator className="w-radio-group-indicator">
+ <RadioGroupIndicator className={"w-radio-group-indicator"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M8 5.35a2.65 2.65 0 1 0 0 5.3 2.65 2.65 0 0 0 0-5.3Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</RadioGroupIndicator>
</RadioGroupItem>
- <Text className="w-text">{"Default"}</Text>
+ <Text className={"w-text"}>{"Default"}</Text>
</Label>
- <Label className="w-label w-label-2">
+ <Label className={"w-label w-label-2"}>
<RadioGroupItem
value={"comfortable"}
- className="w-radio-group-item w-radio-group-item-2"
+ className={"w-radio-group-item w-radio-group-item-2"}
>
- <RadioGroupIndicator className="w-radio-group-indicator">
+ <RadioGroupIndicator className={"w-radio-group-indicator"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M8 5.35a2.65 2.65 0 1 0 0 5.3 2.65 2.65 0 0 0 0-5.3Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</RadioGroupIndicator>
</RadioGroupItem>
- <Text className="w-text">{"Comfortable"}</Text>
+ <Text className={"w-text"}>{"Comfortable"}</Text>
</Label>
- <Label className="w-label w-label-3">
+ <Label className={"w-label w-label-3"}>
<RadioGroupItem
value={"compact"}
- className="w-radio-group-item w-radio-group-item-3"
+ className={"w-radio-group-item w-radio-group-item-3"}
>
- <RadioGroupIndicator className="w-radio-group-indicator">
+ <RadioGroupIndicator className={"w-radio-group-indicator"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path d="M8 5.35a2.65 2.65 0 1 0 0 5.3 2.65 2.65 0 0 0 0-5.3Z"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</RadioGroupIndicator>
</RadioGroupItem>
- <Text className="w-text">{"Compact"}</Text>
+ <Text className={"w-text"}>{"Compact"}</Text>
</Label>
</RadioGroup>
</Box>
@@ -86,12 +86,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/select.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/select.stories.tsx
index 4de45aee3f..0797684f3f 100644
--- a/packages/sdk-components-react-radix/src/__generated__/select.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/select.stories.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useVariableState } from "@webstudio-is/react-sdk/runtime";
import {
Box as Box,
HtmlEmbed as HtmlEmbed,
@@ -15,9 +15,9 @@ import {
} from "../components";
const Component = () => {
- let [selectValue, set$selectValue] = useState<any>("");
+ let [selectValue, set$selectValue] = useVariableState<any>("");
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Select
value={selectValue}
onValueChange={(value: any) => {
@@ -25,52 +25,56 @@ const Component = () => {
set$selectValue(selectValue);
}}
>
- <SelectTrigger className="w-select-trigger w-select-trigger-1">
- <SelectValue placeholder={"Theme"} className="w-value" />
+ <SelectTrigger className={"w-select-trigger w-select-trigger-1"}>
+ <SelectValue placeholder={"Theme"} className={"w-value"} />
</SelectTrigger>
- <SelectContent className="w-select-content w-select-content-1">
- <SelectViewport className="w-select-viewport w-select-viewport-1">
+ <SelectContent className={"w-select-content w-select-content-1"}>
+ <SelectViewport className={"w-select-viewport w-select-viewport-1"}>
<SelectItem
value={"light"}
- className="w-select-item w-select-item-1"
+ className={"w-select-item w-select-item-1"}
>
- <SelectItemIndicator className="w-indicator w-indicator-1">
+ <SelectItemIndicator className={"w-indicator w-indicator-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M11.957 5.043a1 1 0 0 1 0 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.75 8.836l3.793-3.793a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</SelectItemIndicator>
- <SelectItemText className="w-item-text">{"Light"}</SelectItemText>
+ <SelectItemText className={"w-item-text"}>
+ {"Light"}
+ </SelectItemText>
</SelectItem>
<SelectItem
value={"dark"}
- className="w-select-item w-select-item-2"
+ className={"w-select-item w-select-item-2"}
>
- <SelectItemIndicator className="w-indicator w-indicator-2">
+ <SelectItemIndicator className={"w-indicator w-indicator-2"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M11.957 5.043a1 1 0 0 1 0 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.75 8.836l3.793-3.793a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</SelectItemIndicator>
- <SelectItemText className="w-item-text">{"Dark"}</SelectItemText>
+ <SelectItemText className={"w-item-text"}>
+ {"Dark"}
+ </SelectItemText>
</SelectItem>
<SelectItem
value={"system"}
- className="w-select-item w-select-item-3"
+ className={"w-select-item w-select-item-3"}
>
- <SelectItemIndicator className="w-indicator w-indicator-3">
+ <SelectItemIndicator className={"w-indicator w-indicator-3"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M11.957 5.043a1 1 0 0 1 0 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.75 8.836l3.793-3.793a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</SelectItemIndicator>
- <SelectItemText className="w-item-text">
+ <SelectItemText className={"w-item-text"}>
{"System"}
</SelectItemText>
</SelectItem>
@@ -91,12 +95,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/sheet.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/sheet.stories.tsx
index c16f04a015..5ca17bf829 100644
--- a/packages/sdk-components-react-radix/src/__generated__/sheet.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/sheet.stories.tsx
@@ -16,37 +16,39 @@ import {
const Component = () => {
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Dialog>
<DialogTrigger>
- <Button className="w-button w-button-1">
+ <Button className={"w-button w-button-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M2 5.998a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Zm0 5.5a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Zm0 5.5a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</Button>
</DialogTrigger>
- <DialogOverlay className="w-dialog-overlay w-sheet-overlay">
- <DialogContent className="w-dialog-content w-sheet-content">
- <Box tag={"nav"} role={"navigation"} className="w-box">
- <Box className="w-box w-sheet-header">
- <DialogTitle className="w-dialog-title w-sheet-title">
+ <DialogOverlay className={"w-dialog-overlay w-sheet-overlay"}>
+ <DialogContent className={"w-dialog-content w-sheet-content"}>
+ <Box tag={"nav"} role={"navigation"} className={"w-box"}>
+ <Box className={"w-box w-sheet-header"}>
+ <DialogTitle className={"w-dialog-title w-sheet-title"}>
{"Sheet Title"}
</DialogTitle>
- <DialogDescription className="w-dialog-description w-sheet-description">
+ <DialogDescription
+ className={"w-dialog-description w-sheet-description"}
+ >
{"Sheet description text you can edit"}
</DialogDescription>
</Box>
- <Text className="w-text">{"The text you can edit"}</Text>
+ <Text className={"w-text"}>{"The text you can edit"}</Text>
</Box>
- <DialogClose className="w-close-button w-close-button-1">
+ <DialogClose className={"w-close-button w-close-button-1"}>
<HtmlEmbed
code={
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" width="100%" height="100%" style="display: block;"><path fill-rule="evenodd" d="M13.566 2.434a.8.8 0 0 1 0 1.132L9.13 8l4.435 4.434a.8.8 0 0 1-1.132 1.132L8 9.13l-4.434 4.435a.8.8 0 0 1-1.132-1.132L6.87 8 2.434 3.566a.8.8 0 0 1 1.132-1.132L8 6.87l4.434-4.435a.8.8 0 0 1 1.132 0Z" clip-rule="evenodd"/></svg>'
}
- className="w-html-embed"
+ className={"w-html-embed"}
/>
</DialogClose>
</DialogContent>
@@ -66,12 +68,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/switch.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/switch.stories.tsx
index eebcbc84be..4b5dd69d80 100644
--- a/packages/sdk-components-react-radix/src/__generated__/switch.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/switch.stories.tsx
@@ -1,20 +1,20 @@
-import { useState } from "react";
+import { useVariableState } from "@webstudio-is/react-sdk/runtime";
import { Box as Box } from "@webstudio-is/sdk-components-react";
import { Switch as Switch, SwitchThumb as SwitchThumb } from "../components";
const Component = () => {
- let [switchChecked, set$switchChecked] = useState<any>(false);
+ let [switchChecked, set$switchChecked] = useVariableState<any>(false);
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Switch
checked={switchChecked}
onCheckedChange={(checked: any) => {
switchChecked = checked;
set$switchChecked(switchChecked);
}}
- className="w-switch w-switch-1"
+ className={"w-switch w-switch-1"}
>
- <SwitchThumb className="w-switch-thumb w-switch-thumb-1" />
+ <SwitchThumb className={"w-switch-thumb w-switch-thumb-1"} />
</Switch>
</Box>
);
@@ -30,12 +30,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/tabs.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/tabs.stories.tsx
index e86d7f6058..c3cf6aa872 100644
--- a/packages/sdk-components-react-radix/src/__generated__/tabs.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/tabs.stories.tsx
@@ -8,31 +8,31 @@ import {
const Component = () => {
return (
- <Box className="w-box">
- <Tabs defaultValue={"0"} className="w-tabs">
- <TabsList className="w-tabs-list w-tabs-list-1">
+ <Box className={"w-box"}>
+ <Tabs defaultValue={"0"} className={"w-tabs"}>
+ <TabsList className={"w-tabs-list w-tabs-list-1"}>
<TabsTrigger
data-ws-index="0"
- className="w-tab-trigger w-tab-trigger-1"
+ className={"w-tab-trigger w-tab-trigger-1"}
>
{"Account"}
</TabsTrigger>
<TabsTrigger
data-ws-index="1"
- className="w-tab-trigger w-tab-trigger-2"
+ className={"w-tab-trigger w-tab-trigger-2"}
>
{"Password"}
</TabsTrigger>
</TabsList>
<TabsContent
data-ws-index="0"
- className="w-tab-content w-tab-content-1"
+ className={"w-tab-content w-tab-content-1"}
>
{"Make changes to your account here."}
</TabsContent>
<TabsContent
data-ws-index="1"
- className="w-tab-content w-tab-content-2"
+ className={"w-tab-content w-tab-content-2"}
>
{"Change your password here."}
</TabsContent>
@@ -51,12 +51,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;
diff --git a/packages/sdk-components-react-radix/src/__generated__/tooltip.stories.tsx b/packages/sdk-components-react-radix/src/__generated__/tooltip.stories.tsx
index 1560a677ac..909eeb269d 100644
--- a/packages/sdk-components-react-radix/src/__generated__/tooltip.stories.tsx
+++ b/packages/sdk-components-react-radix/src/__generated__/tooltip.stories.tsx
@@ -11,13 +11,13 @@ import {
const Component = () => {
return (
- <Box className="w-box">
+ <Box className={"w-box"}>
<Tooltip>
<TooltipTrigger>
- <Button className="w-button w-button-1">{"Button"}</Button>
+ <Button className={"w-button w-button-1"}>{"Button"}</Button>
</TooltipTrigger>
- <TooltipContent className="w-tooltip-content w-tooltip-content-1">
- <Text className="w-text">{"The text you can edit"}</Text>
+ <TooltipContent className={"w-tooltip-content w-tooltip-content-1"}>
+ <Text className={"w-text"}>{"The text you can edit"}</Text>
</TooltipContent>
</Tooltip>
</Box>
@@ -34,12 +34,8 @@ const Story = {
<>
<style>
{`
-html {margin: 0; display: grid; min-height: 100%}
@media all {
:where(body.w-body) {
- font-family: Arial, Roboto, sans-serif;
- font-size: 16px;
- line-height: 1.2;
box-sizing: border-box;
border-top-width: 1px;
border-right-width: 1px;