Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
move current text component to TextLegacy
Oleg Isonen19791eb77544
diff --git a/apps/designer/app/auth/login.tsx b/apps/designer/app/auth/login.tsxindex 60f93a3ba0..a6708df5ad 100644--- a/apps/designer/app/auth/login.tsx+++ b/apps/designer/app/auth/login.tsx@@ -6,7 +6,7 @@ import {Card,Flex,Heading,- Text,+ TextLegacy,TextField,} from "@webstudio-is/design-system";import interStyles from "~/shared/font-faces/inter.css";@@ -47,9 +47,9 @@ export const Login = ({ errorMessage }: { errorMessage: string }) => {<Flex direction="column" gap="4" align="center"><Heading size="2">Login</Heading>{errorMessage.length ? (- <Text css={{ textAlign: "center" }} variant="red">+ <TextLegacy css={{ textAlign: "center" }} variant="red">{errorMessage}- </Text>+ </TextLegacy>) : null}<Flex gap="2" direction="column" align="center"><Form action="/auth/github" method="post">diff --git a/apps/designer/app/dashboard/components/card.tsx b/apps/designer/app/dashboard/components/card.tsxindex cd0863cd8b..2637f498c4 100644--- a/apps/designer/app/dashboard/components/card.tsx+++ b/apps/designer/app/dashboard/components/card.tsx@@ -8,7 +8,7 @@ import {TextField,Button,Heading,- Text,+ TextLegacy,} from "@webstudio-is/design-system";type SelectProjectProjectCardProps = {@@ -77,9 +77,9 @@ export const SelectProjectCard = ({</Button></Flex>{errors ? (- <Text variant="red" css={{ marginTop: "$1" }}>+ <TextLegacy variant="red" css={{ marginTop: "$1" }}>{errors}- </Text>+ </TextLegacy>) : null}</Form>) : (diff --git a/apps/designer/app/dashboard/components/header.tsx b/apps/designer/app/dashboard/components/header.tsxindex 379c29bdc6..4fe4d207f4 100644--- a/apps/designer/app/dashboard/components/header.tsx+++ b/apps/designer/app/dashboard/components/header.tsx@@ -6,7 +6,7 @@ import {DropdownMenuContent,DropdownMenuItem,Button,- Text,+ TextLegacy,Flex,} from "@webstudio-is/design-system";import { User } from "@webstudio-is/prisma-client";@@ -45,7 +45,7 @@ export const DashboardHeader = ({ user }: { user: User }) => {</DropdownMenuTrigger><DropdownMenuContent><DropdownMenuItem onSelect={() => navigate("/logout")}>- <Text>Logout</Text>+ <TextLegacy>Logout</TextLegacy></DropdownMenuItem></DropdownMenuContent></DropdownMenu>diff --git a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsxindex 321bcf4ecf..6f7dbb35a5 100644--- a/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx+++ b/apps/designer/app/designer/features/breadcrumbs/breadcrumbs.tsx@@ -1,5 +1,10 @@import { ChevronRightIcon } from "@webstudio-is/icons";-import { Button, Flex, Text, darkTheme } from "@webstudio-is/design-system";+import {+ Button,+ Flex,+ TextLegacy,+ darkTheme,+} from "@webstudio-is/design-system";import { useSelectedInstancePath } from "../../shared/instance/use-selected-instance-path";import { type Publish, type Instance } from "@webstudio-is/react-sdk";import { useSelectedInstanceData } from "~/designer/shared/nano-states";@@ -33,7 +38,7 @@ const Breadcrumb = ({ component, onClick }: BreadcrumbProps) => {);};-const EmptyState = () => <Text size="1">No instance selected</Text>;+const EmptyState = () => <TextLegacy size="1">No instance selected</TextLegacy>;type BreadcrumbsProps = {publish: Publish;diff --git a/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx b/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsxindex ee69b01042..cad6e734a6 100644--- a/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx+++ b/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx@@ -1,7 +1,12 @@import { useState } from "react";import useDebounce from "react-use/lib/useDebounce";import { type Breakpoint, type Publish } from "@webstudio-is/react-sdk";-import { Button, TextField, Flex, Text } from "@webstudio-is/design-system";+import {+ Button,+ TextField,+ Flex,+ TextLegacy,+} from "@webstudio-is/design-system";import { PlusIcon, TrashIcon } from "@webstudio-is/icons";import ObjectId from "bson-objectid";import { useBreakpoints } from "~/shared/nano-states";@@ -102,7 +107,7 @@ export const BreakpointsEditor = ({justify="between"css={{ paddingLeft: "$5", paddingRight: "$3", py: "$1" }}>- <Text>Breakpoints</Text>+ <TextLegacy>Breakpoints</TextLegacy><ButtonghostonClick={() => {diff --git a/apps/designer/app/designer/features/breakpoints/breakpoints.tsx b/apps/designer/app/designer/features/breakpoints/breakpoints.tsxindex 8a4801be85..6b16c783f0 100644--- a/apps/designer/app/designer/features/breakpoints/breakpoints.tsx+++ b/apps/designer/app/designer/features/breakpoints/breakpoints.tsx@@ -12,7 +12,7 @@ import {DropdownMenuArrow,DropdownMenuSeparator,DropdownMenuCheckboxItem,- Text,+ TextLegacy,Flex,} from "@webstudio-is/design-system";import { sort } from "~/shared/breakpoints";@@ -38,17 +38,17 @@ const BreakpointSelectorItem = ({}: BreakpointSelectorItemProps) => {return (<Flex align="center" justify="between" gap="3" css={{ flexGrow: 1 }}>- <Text size="1" css={{ flexGrow: 1, color: "inherit" }}>+ <TextLegacy size="1" css={{ flexGrow: 1, color: "inherit" }}>{breakpoint.label}- </Text>- <Text+ </TextLegacy>+ <TextLegacysize="1"css={{color: "inherit",}}>{breakpoint.minWidth}- </Text>+ </TextLegacy></Flex>);};diff --git a/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsx b/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsxindex 10a434bf34..2b76e154ea 100644--- a/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsx+++ b/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsx@@ -1,5 +1,5 @@import { type Breakpoint } from "@webstudio-is/react-sdk";-import { Button, Flex, Text } from "@webstudio-is/design-system";+import { Button, Flex, TextLegacy } from "@webstudio-is/design-system";type ConfirmationDialogProps = {onAbort: () => void;@@ -14,13 +14,13 @@ export const ConfirmationDialog = ({}: ConfirmationDialogProps) => {return (<Flex gap="2" direction="column" css={{ px: "$5", py: "$2", width: 300 }}>- <Text size="2" css={{ lineHeight: 1.5 }}>+ <TextLegacy size="2" css={{ lineHeight: 1.5 }}>{`Are you sure you want to delete "${breakpoint.label}"?`}- </Text>- <Text size="2" css={{ lineHeight: 1.5 }}>+ </TextLegacy>+ <TextLegacy size="2" css={{ lineHeight: 1.5 }}>{`Deleting a breakpoint will also delete all styles associated with thisbreakpoint.`}- </Text>+ </TextLegacy><Flex justify="end" gap="2"><ButtononClick={() => {diff --git a/apps/designer/app/designer/features/breakpoints/preview.tsx b/apps/designer/app/designer/features/breakpoints/preview.tsxindex 8a706d719d..55698ac6ef 100644--- a/apps/designer/app/designer/features/breakpoints/preview.tsx+++ b/apps/designer/app/designer/features/breakpoints/preview.tsx@@ -1,5 +1,5 @@import { type Breakpoint } from "@webstudio-is/react-sdk";-import { Paragraph, Flex, Text } from "@webstudio-is/design-system";+import { Paragraph, Flex, TextLegacy } from "@webstudio-is/design-system";type PreviewProps = {breakpoint?: Breakpoint;@@ -8,7 +8,7 @@ type PreviewProps = {export const Preview = ({ breakpoint }: PreviewProps) => {return (<Flex css={{ px: "$5", py: "$1" }} gap="1" direction="column">- <Text size="1">CSS Preview</Text>+ <TextLegacy size="1">CSS Preview</TextLegacy><Paragraph css={{ fontSize: "$1" }} variant="gray">{breakpoint === undefined? "No breakpoint selected"diff --git a/apps/designer/app/designer/features/breakpoints/trigger-button.tsx b/apps/designer/app/designer/features/breakpoints/trigger-button.tsxindex 599ce6bf8f..633266a287 100644--- a/apps/designer/app/designer/features/breakpoints/trigger-button.tsx+++ b/apps/designer/app/designer/features/breakpoints/trigger-button.tsx@@ -6,7 +6,7 @@ import {useSelectedBreakpoint,} from "~/designer/shared/nano-states";import { willRender } from "~/designer/shared/breakpoints";-import { Button, Text } from "@webstudio-is/design-system";+import { Button, TextLegacy } from "@webstudio-is/design-system";import {DesktopIcon,LaptopIcon,@@ -49,9 +49,9 @@ export const TriggerButton = forwardRef<aria-label="Show breakpoints">{renderIcon(breakpoint, variant)}- <Text size="1" variant={variant}>+ <TextLegacy size="1" variant={variant}>{`${breakpoint.label} ${canvasWidth}px / ${zoom}%`}- </Text>+ </TextLegacy></Button>);});diff --git a/apps/designer/app/designer/features/breakpoints/width-setting.tsx b/apps/designer/app/designer/features/breakpoints/width-setting.tsxindex 630083f5da..39e86f32fe 100644--- a/apps/designer/app/designer/features/breakpoints/width-setting.tsx+++ b/apps/designer/app/designer/features/breakpoints/width-setting.tsx@@ -3,7 +3,7 @@ import {useCanvasWidth,useSelectedBreakpoint,} from "~/designer/shared/nano-states";-import { Slider, Text, Flex } from "@webstudio-is/design-system";+import { Slider, TextLegacy, Flex } from "@webstudio-is/design-system";import { sort } from "~/shared/breakpoints";import { useBreakpoints, useIsPreviewMode } from "~/shared/nano-states";@@ -51,7 +51,7 @@ export const WidthSetting = () => {return (<Flex css={{ px: "$5", py: "$1" }} gap="1" direction="column">- <Text size="1">Canvas width</Text>+ <TextLegacy size="1">Canvas width</TextLegacy><Flex gap="3" align="center"><Slidermin={min}@@ -61,7 +61,7 @@ export const WidthSetting = () => {setValue(value);}}/>- <Text size="1">{`${value}px`}</Text>+ <TextLegacy size="1">{`${value}px`}</TextLegacy></Flex></Flex>);diff --git a/apps/designer/app/designer/features/breakpoints/zoom-setting.tsx b/apps/designer/app/designer/features/breakpoints/zoom-setting.tsxindex 4c8f456810..9b9f4690f0 100644--- a/apps/designer/app/designer/features/breakpoints/zoom-setting.tsx+++ b/apps/designer/app/designer/features/breakpoints/zoom-setting.tsx@@ -1,5 +1,5 @@import { useZoom } from "~/designer/shared/nano-states";-import { Slider, Text, Flex } from "@webstudio-is/design-system";+import { Slider, TextLegacy, Flex } from "@webstudio-is/design-system";export const minZoom = 10;@@ -7,7 +7,7 @@ export const ZoomSetting = () => {const [value, setValue] = useZoom();return (<Flex css={{ px: "$5", py: "$1" }} gap="1" direction="column">- <Text size="1">Zoom</Text>+ <TextLegacy size="1">Zoom</TextLegacy><Flex gap="3" align="center"><Slidermin={minZoom}@@ -16,7 +16,7 @@ export const ZoomSetting = () => {setValue(value);}}/>- <Text size="1">{value}%</Text>+ <TextLegacy size="1">{value}%</TextLegacy></Flex></Flex>);diff --git a/apps/designer/app/designer/features/inspector/inspector.tsx b/apps/designer/app/designer/features/inspector/inspector.tsxindex 66dd3caf17..951352a409 100644--- a/apps/designer/app/designer/features/inspector/inspector.tsx+++ b/apps/designer/app/designer/features/inspector/inspector.tsx@@ -1,6 +1,6 @@import type { Publish } from "@webstudio-is/react-sdk";import {- Text,+ TextLegacy,Tabs,TabsList,TabsTrigger,@@ -42,14 +42,14 @@ export const Inspector = ({ publish }: InspectorProps) => {<Tabs defaultValue="style" css={{ width: "100%" }}><TabsList><TabsTrigger value="style">- <Text>Style</Text>+ <TextLegacy>Style</TextLegacy></TabsTrigger>{/* @note: events would be part of props */}<TabsTrigger value="props">- <Text>Props</Text>+ <TextLegacy>Props</TextLegacy></TabsTrigger><TabsTrigger value="inspect">- <Text>Inspect</Text>+ <TextLegacy>Inspect</TextLegacy></TabsTrigger></TabsList><TabsContent value="style" css={contentStyle}>diff --git a/apps/designer/app/designer/features/props-panel/control.tsx b/apps/designer/app/designer/features/props-panel/control.tsxindex c6da2f2903..c6f45e3c01 100644--- a/apps/designer/app/designer/features/props-panel/control.tsx+++ b/apps/designer/app/designer/features/props-panel/control.tsx@@ -8,7 +8,7 @@ import {Select,Slider,Switch,- Text,+ TextLegacy,TextField,} from "@webstudio-is/design-system";import { Checkbox } from "@webstudio-is/design-system";@@ -138,8 +138,8 @@ const RangeControl = ({step={step}/><Flex direction="row" justify="between">- <Text size={1}>{min}</Text>- <Text size={1}>{max}</Text>+ <TextLegacy size={1}>{min}</TextLegacy>+ <TextLegacy size={1}>{max}</TextLegacy></Flex></Flex>);diff --git a/apps/designer/app/designer/features/sidebar-left/lib/header.tsx b/apps/designer/app/designer/features/sidebar-left/lib/header.tsxindex 93ec87fb47..d1266ba90f 100644--- a/apps/designer/app/designer/features/sidebar-left/lib/header.tsx+++ b/apps/designer/app/designer/features/sidebar-left/lib/header.tsx@@ -1,4 +1,4 @@-import { Flex, IconButton, Text } from "@webstudio-is/design-system";+import { Flex, IconButton, TextLegacy } from "@webstudio-is/design-system";import { Separator } from "@webstudio-is/design-system";import { Cross1Icon } from "@webstudio-is/icons";@@ -16,9 +16,9 @@ export const Header = ({ title, isClosable = true, onClose }: HeaderProps) => {align="center"justify="between">- <Text size="1" css={{ fontWeight: "bold" }}>+ <TextLegacy size="1" css={{ fontWeight: "bold" }}>{title}- </Text>+ </TextLegacy>{isClosable && (<IconButtononClick={() => onClose?.()}diff --git a/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx b/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsxindex 89b23d305b..c5446148b7 100644--- a/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx+++ b/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx@@ -1,6 +1,6 @@import { type Instance, components } from "@webstudio-is/react-sdk";import { forwardRef, type ElementRef, type ComponentProps } from "react";-import { Flex, Text, styled } from "@webstudio-is/design-system";+import { Flex, TextLegacy, styled } from "@webstudio-is/design-system";const Thumb = styled(Flex, {px: "$1",@@ -41,7 +41,7 @@ export const ComponentThumb = forwardRef<{...rest}><Icon width={30} height={30} />- <Text size="1">{label}</Text>+ <TextLegacy size="1">{label}</TextLegacy></Thumb>);});diff --git a/apps/designer/app/designer/features/style-panel/render-property.tsx b/apps/designer/app/designer/features/style-panel/render-property.tsxindex 0f2c6b62bd..9ed4fc4ed2 100644--- a/apps/designer/app/designer/features/style-panel/render-property.tsx+++ b/apps/designer/app/designer/features/style-panel/render-property.tsx@@ -2,7 +2,7 @@ import {Flex,Grid,Label,- Text,+ TextLegacy,Combobox,ComboboxTextField,ComboboxPopperContent,@@ -72,14 +72,14 @@ const PropertyName = ({ property, label }: PropertyProps) => {const Unit = ({ value }: { value: StyleValue }) => {if (value.type !== "unit" || value.unit === "number") return null;return (- <Text+ <TextLegacycss={{fontSize: "$1",cursor: "default",}}>{value.unit}- </Text>+ </TextLegacy>);};diff --git a/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsx b/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsxindex d84148539a..99177fe8f1 100644--- a/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsx+++ b/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsx@@ -1,4 +1,4 @@-import { Text } from "@webstudio-is/design-system";+import { TextLegacy } from "@webstudio-is/design-system";const isMac =typeof navigator === "object" ? /mac/i.test(navigator.platform) : false;@@ -32,8 +32,8 @@ const format = (value: ShortcutDefinition) => {export const ShortcutHint = ({ value }: { value: ShortcutDefinition }) => {return (- <Text size="1" css={{ letterSpacing: 1.5, color: "inherit" }}>+ <TextLegacy size="1" css={{ letterSpacing: 1.5, color: "inherit" }}>{format(value)}- </Text>+ </TextLegacy>);};diff --git a/apps/designer/app/designer/features/topbar/publish.tsx b/apps/designer/app/designer/features/topbar/publish.tsxindex b9767998cd..b508abd532 100644--- a/apps/designer/app/designer/features/topbar/publish.tsx+++ b/apps/designer/app/designer/features/topbar/publish.tsx@@ -9,7 +9,7 @@ import {PopoverContent,PopoverTrigger,TextField,- Text,+ TextLegacy,Label,Link,useId,@@ -59,7 +59,7 @@ const Content = ({ project }: PublishButtonProps) => {gap: "$0",}}>- <Text+ <TextLegacycss={{whiteSpace: "nowrap",overflow: "hidden",@@ -67,7 +67,7 @@ const Content = ({ project }: PublishButtonProps) => {}}>{`${domain}.${getHost()}`}{" "}- </Text>+ </TextLegacy><ExternalLinkIcon /></Link>)}@@ -77,7 +77,7 @@ const Content = ({ project }: PublishButtonProps) => {<TextField id={id} name="domain" defaultValue={domain} /></Flex>{fetcher.data?.errors !== undefined && (- <Text variant="red">{fetcher.data?.errors}</Text>+ <TextLegacy variant="red">{fetcher.data?.errors}</TextLegacy>)}{fetcher.state === "idle" ? (<Button variant="blue" type="submit">@@ -99,7 +99,7 @@ export const PublishButton = ({ project }: PublishButtonProps) => {<PopoverTrigger asChild aria-label="Publish"><Button ghost css={{ display: "flex", gap: "$1" }}><RocketIcon />- <Text size="1">Publish</Text>+ <TextLegacy size="1">Publish</TextLegacy></Button></PopoverTrigger><Content project={project} />diff --git a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx b/apps/designer/app/designer/shared/inspector/collapsible-section.tsxindex 1af6fb4f73..6c7b053e4f 100644--- a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx+++ b/apps/designer/app/designer/shared/inspector/collapsible-section.tsx@@ -1,5 +1,10 @@import { createValueContainer, useValue } from "react-nano-state";-import { Box, Flex, Text, Collapsible } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ TextLegacy,+ Collapsible,+} from "@webstudio-is/design-system";import { ChevronDownIcon, ChevronRightIcon } from "@webstudio-is/icons";type CollapsibleSectionProps = {@@ -54,9 +59,9 @@ export const CollapsibleSection = ({}}>{isOpenFinal ? <ChevronDownIcon /> : <ChevronRightIcon />}- <Text size="1" css={{ fontWeight: "500", flexGrow: 1 }}>+ <TextLegacy size="1" css={{ fontWeight: "500", flexGrow: 1 }}>{label}- </Text>+ </TextLegacy>{rightSlot}</Flex></Collapsible.Trigger>diff --git a/apps/designer/app/designer/shared/inspector/component-info.tsx b/apps/designer/app/designer/shared/inspector/component-info.tsxindex 421168a928..d7d4b6118b 100644--- a/apps/designer/app/designer/shared/inspector/component-info.tsx+++ b/apps/designer/app/designer/shared/inspector/component-info.tsx@@ -1,5 +1,5 @@import { components } from "@webstudio-is/react-sdk";-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, TextLegacy } from "@webstudio-is/design-system";import type { SelectedInstanceData } from "~/shared/canvas-components";export const ComponentInfo = ({@@ -9,13 +9,15 @@ export const ComponentInfo = ({}) => {return (<Flex justify="between" align="center">- <Text+ <TextLegacycss={{fontSize: "$2",color: "$colors$slate11",fontWeight: "500",}}- >{`Selected: ${components[selectedInstanceData.component].label}`}</Text>+ >{`Selected: ${+ components[selectedInstanceData.component].label+ }`}</TextLegacy></Flex>);};diff --git a/apps/designer/app/designer/shared/tree/tree.tsx b/apps/designer/app/designer/shared/tree/tree.tsxindex 5200890d10..3257e75353 100644--- a/apps/designer/app/designer/shared/tree/tree.tsx+++ b/apps/designer/app/designer/shared/tree/tree.tsx@@ -2,7 +2,7 @@ import { useState, useMemo, useEffect } from "react";import { type Instance, components } from "@webstudio-is/react-sdk";import {Flex,- Text,+ TextLegacy,Collapsible,Button,keyframes,@@ -123,7 +123,7 @@ export const Tree = ({}}><Icon />- <Text size="1">{label}</Text>+ <TextLegacy size="1">{label}</TextLegacy></Button></Flex>{children != null && <CollapsibleContent>{children}</CollapsibleContent>}diff --git a/packages/design-system/src/components/heading.tsx b/packages/design-system/src/components/heading.tsxindex b4ad3a3c46..04f759b806 100644--- a/packages/design-system/src/components/heading.tsx+++ b/packages/design-system/src/components/heading.tsx@@ -1,11 +1,11 @@import React from "react";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";import { VariantProps, CSS } from "../stitches.config";import merge from "lodash.merge";const DEFAULT_TAG = "h1";-type TextSizeVariants = Pick<VariantProps<typeof Text>, "size">;+type TextSizeVariants = Pick<VariantProps<typeof TextLegacy>, "size">;type HeadingSizeVariants = "1" | "2" | "3" | "4";type HeadingVariants = { size?: HeadingSizeVariants } & Omit<VariantProps<typeof Text>,@@ -37,7 +37,7 @@ export const Heading = React.forwardRef<};return (- <Text+ <TextLegacyas={DEFAULT_TAG}{...textProps}ref={forwardedRef}diff --git a/packages/design-system/src/components/label.tsx b/packages/design-system/src/components/label.tsxindex 37cca25602..c49de66678 100644--- a/packages/design-system/src/components/label.tsx+++ b/packages/design-system/src/components/label.tsx@@ -1,8 +1,8 @@import { styled } from "../stitches.config";import * as LabelPrimitive from "@radix-ui/react-label";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";-export const Label = styled(LabelPrimitive.Root, Text, {+export const Label = styled(LabelPrimitive.Root, TextLegacy, {display: "inline-block",verticalAlign: "middle",cursor: "default",diff --git a/packages/design-system/src/components/link.tsx b/packages/design-system/src/components/link.tsxindex 362f95a2b3..625e9f2c38 100644--- a/packages/design-system/src/components/link.tsx+++ b/packages/design-system/src/components/link.tsx@@ -1,5 +1,5 @@import { styled } from "../stitches.config";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";export const Link = styled("a", {alignItems: "center",diff --git a/packages/design-system/src/components/text.tsx b/packages/design-system/src/components/new-text.tsxsimilarity index 99%rename from packages/design-system/src/components/text.tsxrename to packages/design-system/src/components/new-text.tsxindex 3663a0355d..4dcbf52cfb 100644--- a/packages/design-system/src/components/text.tsx+++ b/packages/design-system/src/components/new-text.tsx@@ -1,6 +1,6 @@import { styled } from "../stitches.config";-export const Text = styled("div", {+export const NewText = styled("div", {// ResetlineHeight: "1",margin: "0",diff --git a/packages/design-system/src/components/paragraph.tsx b/packages/design-system/src/components/paragraph.tsxindex 477eb4a520..e04e4ffaa5 100644--- a/packages/design-system/src/components/paragraph.tsx+++ b/packages/design-system/src/components/paragraph.tsx@@ -1,14 +1,14 @@import React from "react";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";import { VariantProps, CSS } from "../stitches.config";import merge from "lodash.merge";const DEFAULT_TAG = "p";-type TextSizeVariants = Pick<VariantProps<typeof Text>, "size">;+type TextSizeVariants = Pick<VariantProps<typeof TextLegacy>, "size">;type ParagraphSizeVariants = "1" | "2";type ParagraphVariants = { size?: ParagraphSizeVariants } & Omit<- VariantProps<typeof Text>,+ VariantProps<typeof TextLegacy>,"size">;type ParagraphProps = React.ComponentProps<typeof DEFAULT_TAG> &@@ -37,7 +37,7 @@ export const Paragraph = React.forwardRef<},};return (- <Text+ <TextLegacyas={DEFAULT_TAG}{...textProps}ref={forwardedRef}diff --git a/packages/design-system/src/components/tabs.tsx b/packages/design-system/src/components/tabs.tsxindex 6845bd1a56..c6628ba12e 100644--- a/packages/design-system/src/components/tabs.tsx+++ b/packages/design-system/src/components/tabs.tsx@@ -1,7 +1,7 @@import React from "react";import { styled, CSS } from "../stitches.config";import * as TabsPrimitive from "@radix-ui/react-tabs";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";export const Tabs = styled(TabsPrimitive.Root, {display: "flex",diff --git a/packages/design-system/src/components/text-legacy.tsx b/packages/design-system/src/components/text-legacy.tsxnew file mode 100644index 0000000000..da7c8c6607--- /dev/null+++ b/packages/design-system/src/components/text-legacy.tsx@@ -0,0 +1,238 @@+import { styled } from "../stitches.config";++export const TextLegacy = styled("div", {+ // Reset+ lineHeight: "1",+ margin: "0",+ fontWeight: 400,+ fontVariantNumeric: "tabular-nums",+ display: "block",+ userSelect: "none",++ variants: {+ size: {+ "1": {+ fontSize: "$1",+ },+ "2": {+ fontSize: "$2",+ },+ "3": {+ fontSize: "$3",+ },+ "4": {+ fontSize: "$4",+ },+ "5": {+ fontSize: "$5",+ letterSpacing: "-.015em",+ },+ "6": {+ fontSize: "$6",+ letterSpacing: "-.016em",+ },+ "7": {+ fontSize: "$7",+ letterSpacing: "-.031em",+ textIndent: "-.005em",+ },+ "8": {+ fontSize: "$8",+ letterSpacing: "-.034em",+ textIndent: "-.018em",+ },+ "9": {+ fontSize: "$9",+ letterSpacing: "-.055em",+ textIndent: "-.025em",+ },+ },+ variant: {+ red: {+ color: "$red11",+ },+ crimson: {+ color: "$crimson11",+ },+ pink: {+ color: "$pink11",+ },+ purple: {+ color: "$purple11",+ },+ violet: {+ color: "$violet11",+ },+ indigo: {+ color: "$indigo11",+ },+ blue: {+ color: "$blue11",+ },+ cyan: {+ color: "$cyan11",+ },+ teal: {+ color: "$teal11",+ },+ green: {+ color: "$green11",+ },+ lime: {+ color: "$lime11",+ },+ yellow: {+ color: "$yellow11",+ },+ orange: {+ color: "$orange11",+ },+ gold: {+ color: "$gold11",+ },+ bronze: {+ color: "$bronze11",+ },+ gray: {+ color: "$slate11",+ },+ contrast: {+ color: "$hiContrast",+ },+ loContrast: {+ color: "$loContrast",+ },+ },+ gradient: {+ true: {+ WebkitBackgroundClip: "text",+ WebkitTextFillColor: "transparent",+ },+ },+ },+ compoundVariants: [+ {+ variant: "red",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $red11, $crimson11)",+ },+ },+ {+ variant: "crimson",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $crimson11, $pink11)",+ },+ },+ {+ variant: "pink",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $pink11, $purple11)",+ },+ },+ {+ variant: "purple",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $purple11, $violet11)",+ },+ },+ {+ variant: "violet",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $violet11, $indigo11)",+ },+ },+ {+ variant: "indigo",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $indigo11, $blue11)",+ },+ },+ {+ variant: "blue",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $blue11, $cyan11)",+ },+ },+ {+ variant: "cyan",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $cyan11, $teal11)",+ },+ },+ {+ variant: "teal",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $teal11, $green11)",+ },+ },+ {+ variant: "green",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $green11, $lime11)",+ },+ },+ {+ variant: "lime",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $lime11, $yellow11)",+ },+ },+ {+ variant: "yellow",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $yellow11, $orange11)",+ },+ },+ {+ variant: "orange",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $orange11, $red11)",+ },+ },+ {+ variant: "gold",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $gold11, $gold9)",+ },+ },+ {+ variant: "bronze",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $bronze11, $bronze9)",+ },+ },+ {+ variant: "gray",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $gray11, $gray12)",+ },+ },+ {+ variant: "contrast",+ gradient: "true",+ css: {+ background: "linear-gradient(to right, $hiContrast, $gray12)",+ },+ },+ ],+ defaultVariants: {+ size: "3",+ variant: "contrast",+ },+});diff --git a/packages/design-system/src/components/tooltip.tsx b/packages/design-system/src/components/tooltip.tsxindex 0cb9d347ee..851b2e0a5c 100644--- a/packages/design-system/src/components/tooltip.tsx+++ b/packages/design-system/src/components/tooltip.tsx@@ -2,7 +2,7 @@ import React, { Ref } from "react";import { styled } from "../stitches.config";import * as TooltipPrimitive from "@radix-ui/react-tooltip";import { Box } from "./box";-import { Text } from "./text";+import { TextLegacy } from "./text-legacy";import type { CSS } from "@webstudio-is/react-sdk";type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> &@@ -71,7 +71,7 @@ export const Tooltip = React.forwardRef(function TooltipWrapper({...props}multiline={multiline}>- <Text+ <TextLegacysize="1"as="p"css={{@@ -80,7 +80,7 @@ export const Tooltip = React.forwardRef(function TooltipWrapper(}}>{content}- </Text>+ </TextLegacy><Box css={{ color: "$transparentExtreme" }}><Arrow offset={5} width={11} height={5} /></Box>diff --git a/packages/design-system/src/index.ts b/packages/design-system/src/index.tsindex 80cce17b23..f10ac1683e 100644--- a/packages/design-system/src/index.ts+++ b/packages/design-system/src/index.ts@@ -33,7 +33,6 @@ export {SidebarTabsList,SidebarTabsTrigger,} from "./components/sidebar-tabs";-export { Text } from "./components/text";export { Card } from "./components/card";export { SimpleToggle } from "./components/simple-toggle";export { ScrollArea } from "./components/scrollbar";@@ -63,3 +62,4 @@ export * from "./components/checkbox";export * from "./components/avatar";export * from "./components/primitives/dnd";export * from "./components/separator";+export * from "./components/text-legacy";