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
Text fixes (#912)
Roman Pominov0e173ec85e75
diff --git a/.lostpixel/baseline/components-text--label.png b/.lostpixel/baseline/components-deprecated-text--label.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--label.pngrename to .lostpixel/baseline/components-deprecated-text--label.pngdiff --git a/.lostpixel/baseline/components-text--mono.png b/.lostpixel/baseline/components-deprecated-text--mono.pngsimilarity index 75%rename from .lostpixel/baseline/components-text--mono.pngrename to .lostpixel/baseline/components-deprecated-text--mono.pngindex c5122d579f..29e7776c8a 100644Binary files a/.lostpixel/baseline/components-text--mono.png and b/.lostpixel/baseline/components-deprecated-text--mono.png differdiff --git a/.lostpixel/baseline/components-text--regular.png b/.lostpixel/baseline/components-deprecated-text--regular.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--regular.pngrename to .lostpixel/baseline/components-deprecated-text--regular.pngdiff --git a/.lostpixel/baseline/components-text--tiny.png b/.lostpixel/baseline/components-deprecated-text--tiny.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--tiny.pngrename to .lostpixel/baseline/components-deprecated-text--tiny.pngdiff --git a/.lostpixel/baseline/components-text--title.png b/.lostpixel/baseline/components-deprecated-text--title.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--title.pngrename to .lostpixel/baseline/components-deprecated-text--title.pngdiff --git a/.lostpixel/baseline/components-text--truncated.png b/.lostpixel/baseline/components-deprecated-text--truncated.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--truncated.pngrename to .lostpixel/baseline/components-deprecated-text--truncated.pngdiff --git a/.lostpixel/baseline/components-text--unit.png b/.lostpixel/baseline/components-deprecated-text--unit.pngsimilarity index 100%rename from .lostpixel/baseline/components-text--unit.pngrename to .lostpixel/baseline/components-deprecated-text--unit.pngdiff --git a/.lostpixel/baseline/components-text--text.png b/.lostpixel/baseline/components-text--text.pngnew file mode 100644index 0000000000..f991db1202Binary files /dev/null and b/.lostpixel/baseline/components-text--text.png differdiff --git a/.lostpixel/baseline/components-typography--typography.png b/.lostpixel/baseline/components-typography--typography.pngdeleted file mode 100644index f77534cf2a..0000000000Binary files a/.lostpixel/baseline/components-typography--typography.png and /dev/null differdiff --git a/apps/designer/app/auth/login.tsx b/apps/designer/app/auth/login.tsxindex 7c1c9abb6d..847477c497 100644--- a/apps/designer/app/auth/login.tsx+++ b/apps/designer/app/auth/login.tsx@@ -1,7 +1,12 @@import { LinksFunction, MetaFunction } from "@remix-run/node";import { Form, useLoaderData } from "@remix-run/react";import { useState } from "react";-import { Flex, Button, Text, TextField } from "@webstudio-is/design-system";+import {+ Flex,+ Button,+ DeprecatedText2,+ TextField,+} from "@webstudio-is/design-system";// eslint-disable-next-line import/no-internal-modulesimport interFont from "@fontsource/inter/variable.css";import { GithubIcon, CommitIcon, GoogleIcon } from "@webstudio-is/icons";@@ -41,9 +46,9 @@ export const Login = ({ errorMessage }: { errorMessage: string }) => {<Flex direction="column" align="center" gap="3"><Flex direction="column" gap="4">{errorMessage.length ? (- <Text align="center" color="error">+ <DeprecatedText2 align="center" color="error">{errorMessage}- </Text>+ </DeprecatedText2>) : null}<Flex gap="2" direction="column"><Form action={authPath({ provider: "github" })} method="post">diff --git a/apps/designer/app/dashboard/heading.tsx b/apps/designer/app/dashboard/heading.tsxindex eedf06c6d2..1b950d3121 100644--- a/apps/designer/app/dashboard/heading.tsx+++ b/apps/designer/app/dashboard/heading.tsx@@ -18,11 +18,11 @@ const headingStyle = css({fontWeight: 700,},small: {- fontSize: theme.fontSize[5],+ fontSize: theme.deprecatedFontSize[5],fontWeight: 700,},tiny: {- fontSize: theme.fontSize[5],+ fontSize: theme.deprecatedFontSize[5],fontWeight: 400,},},diff --git a/apps/designer/app/dashboard/projects/project-card.tsx b/apps/designer/app/dashboard/projects/project-card.tsxindex 5d6a5a2555..0a10eed54d 100644--- a/apps/designer/app/dashboard/projects/project-card.tsx+++ b/apps/designer/app/dashboard/projects/project-card.tsx@@ -6,7 +6,7 @@ import {IconButton,css,Flex,- Text,+ DeprecatedText2,theme,} from "@webstudio-is/design-system";import { MenuIcon } from "@webstudio-is/icons";@@ -59,7 +59,7 @@ const PublishedLink = ({}) => {const { url } = usePublishedLink({ domain });return (- <Text+ <DeprecatedText2as="a"href={url?.href}target="_blank"@@ -73,7 +73,7 @@ const PublishedLink = ({}}>{url?.host}- </Text>+ </DeprecatedText2>);};@@ -191,13 +191,13 @@ export const ProjectCard = ({className={footerStyle()}><Flex direction="column" justify="around">- <Text variant="title" truncate>+ <DeprecatedText2 variant="title" truncate>{title}- </Text>+ </DeprecatedText2>{isPublished ? (<PublishedLink domain={domain} tabIndex={-1} />) : (- <Text color="hint">Not Published</Text>+ <DeprecatedText2 color="hint">Not Published</DeprecatedText2>)}</Flex><Menudiff --git a/apps/designer/app/dashboard/projects/project-dialogs.tsx b/apps/designer/app/dashboard/projects/project-dialogs.tsxindex 59ff1862f7..0c1a49c0a6 100644--- a/apps/designer/app/dashboard/projects/project-dialogs.tsx+++ b/apps/designer/app/dashboard/projects/project-dialogs.tsx@@ -4,8 +4,8 @@ import {Button,Flex,Label,- Paragraph,- Text,+ DeprecatedParagraph,+ DeprecatedText2,TextField,theme,} from "@webstudio-is/design-system";@@ -63,7 +63,7 @@ const Content = ({>{description && (<DialogDescription asChild>- <Paragraph>{description}</Paragraph>+ <DeprecatedParagraph>{description}</DeprecatedParagraph></DialogDescription>)}<Label>{label}</Label>@@ -77,7 +77,7 @@ const Content = ({}}/><Box css={{ minHeight: theme.spacing["10"] }}>- {errors && <Text color="error">{errors}</Text>}+ {errors && <DeprecatedText2 color="error">{errors}</DeprecatedText2>}</Box></Flex><DialogActions>@@ -259,9 +259,9 @@ export const DeleteProject = ({label={<>Confirm by typing{" "}- <Text as="span" color="error" variant="label">+ <DeprecatedText2 as="span" color="error" variant="label">{title}- </Text>{" "}+ </DeprecatedText2>{" "}below</>}diff --git a/apps/designer/app/dashboard/projects/thumbnail-link.tsx b/apps/designer/app/dashboard/projects/thumbnail-link.tsxindex 1a8737dad6..f7d8ccd8fc 100644--- a/apps/designer/app/dashboard/projects/thumbnail-link.tsx+++ b/apps/designer/app/dashboard/projects/thumbnail-link.tsx@@ -1,17 +1,12 @@-import { css, theme } from "@webstudio-is/design-system";+import { css, theme, textVariants } from "@webstudio-is/design-system";import { forwardRef } from "react";import { Link } from "@remix-run/react";-// @todo use typography from figma tokens-const thumbnailStyle = css({+const thumbnailStyle = css(textVariants.brandThumbnailSmallDefault, {display: "flex",alignItems: "center",alignSelf: "center",minHeight: 0,- fontFamily: theme.fonts.manrope,- fontWeight: 200,- fontSize: 360,- letterSpacing: "-0.05em",background: theme.colors.brandBackgroundProjectCardFront,WebkitBackgroundClip: "text",backgroundClip: "text",@@ -19,7 +14,7 @@ const thumbnailStyle = css({userSelect: "none",outline: "none","&:hover, &:focus": {- fontWeight: 800,+ ...textVariants.brandThumbnailSmallHover,transition: "100ms",},});diff --git a/apps/designer/app/designer/designer.tsx b/apps/designer/app/designer/designer.tsxindex c536ff0a41..e0f95b936a 100644--- a/apps/designer/app/designer/designer.tsx+++ b/apps/designer/app/designer/designer.tsx@@ -10,6 +10,8 @@ import { registerContainers, useDesignerStore } from "~/shared/sync";import { useSyncServer } from "./shared/sync/sync-server";// eslint-disable-next-line import/no-internal-modulesimport interFont from "@fontsource/inter/variable.css";+// eslint-disable-next-line import/no-internal-modules+import robotoMonoFont from "@fontsource/roboto-mono/index.css";import { SidebarLeft } from "./features/sidebar-left";import { Inspector } from "./features/inspector";import { usePages, useProject, useCurrentPageId } from "./shared/nano-states";@@ -38,6 +40,7 @@ registerContainers();export const links = () => {return [{ rel: "stylesheet", href: interFont },+ { rel: "stylesheet", href: robotoMonoFont },{ rel: "stylesheet", href: designerStyles },];};diff --git a/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx b/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsxindex 5b8ff186a0..2cc086fede 100644--- a/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx+++ b/apps/designer/app/designer/features/breakpoints/breakpoints-editor.tsx@@ -3,7 +3,12 @@ import { useDebouncedCallback } from "use-debounce";import ObjectId from "bson-objectid";import store from "immerhin";import type { Breakpoint } from "@webstudio-is/css-data";-import { Button, TextField, Flex, Text } from "@webstudio-is/design-system";+import {+ Button,+ TextField,+ Flex,+ DeprecatedText2,+} from "@webstudio-is/design-system";import { PlusIcon, TrashIcon } from "@webstudio-is/icons";import { breakpointsContainer, useBreakpoints } from "~/shared/nano-states";import { replaceByOrAppendMutable } from "~/shared/array-utils";@@ -118,7 +123,7 @@ export const BreakpointsEditor = ({ onDelete }: BreakpointsEditorProps) => {py: theme.spacing[3],}}>- <Text>Breakpoints</Text>+ <DeprecatedText2>Breakpoints</DeprecatedText2><Buttoncolor="ghost"onClick={() => {diff --git a/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsx b/apps/designer/app/designer/features/breakpoints/confirmation-dialog.tsxindex 175015e23d..bb2e14a4d5 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/css-data";-import { Button, Flex, Paragraph } from "@webstudio-is/design-system";+import { Button, Flex, DeprecatedParagraph } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";type ConfirmationDialogProps = {@@ -19,11 +19,11 @@ export const ConfirmationDialog = ({direction="column"css={{ px: theme.spacing[11], py: theme.spacing[5], width: 300 }}>- <Paragraph>{`Are you sure you want to delete "${breakpoint.label}"?`}</Paragraph>- <Paragraph>+ <DeprecatedParagraph>{`Are you sure you want to delete "${breakpoint.label}"?`}</DeprecatedParagraph>+ <DeprecatedParagraph>{`Deleting a breakpoint will also delete all styles associated with thisbreakpoint.`}- </Paragraph>+ </DeprecatedParagraph><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 0223f051d1..ca46b919be 100644--- a/apps/designer/app/designer/features/breakpoints/preview.tsx+++ b/apps/designer/app/designer/features/breakpoints/preview.tsx@@ -1,5 +1,9 @@import { type Breakpoint } from "@webstudio-is/css-data";-import { Paragraph, Flex, Text } from "@webstudio-is/design-system";+import {+ DeprecatedParagraph,+ Flex,+ DeprecatedText2,+} from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";type PreviewProps = {@@ -20,12 +24,12 @@ export const Preview = ({ breakpoint }: PreviewProps) => {gap="1"direction="column">- <Text>CSS Preview</Text>- <Paragraph color="hint">+ <DeprecatedText2>CSS Preview</DeprecatedText2>+ <DeprecatedParagraph color="hint">{breakpoint === undefined? "No breakpoint selected": `@media (min-width: ${breakpoint.minWidth}px)`}- </Paragraph>+ </DeprecatedParagraph></Flex>);};diff --git a/apps/designer/app/designer/features/breakpoints/trigger-button.tsx b/apps/designer/app/designer/features/breakpoints/trigger-button.tsxindex c483107f70..40269b97b0 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 { DeprecatedButton, Text } from "@webstudio-is/design-system";+import { DeprecatedButton, DeprecatedText2 } from "@webstudio-is/design-system";import {DesktopIcon,LaptopIcon,@@ -52,9 +52,9 @@ export const TriggerButton = forwardRef<aria-label="Show breakpoints">{renderIcon(breakpoint, variant)}- <Text color={variant}>+ <DeprecatedText2 color={variant}>{`${breakpoint.label} ${canvasWidth}px / ${zoom}%`}- </Text>+ </DeprecatedText2></DeprecatedButton>);});diff --git a/apps/designer/app/designer/features/breakpoints/width-setting.tsx b/apps/designer/app/designer/features/breakpoints/width-setting.tsxindex e29c311dc9..af1fbf3361 100644--- a/apps/designer/app/designer/features/breakpoints/width-setting.tsx+++ b/apps/designer/app/designer/features/breakpoints/width-setting.tsx@@ -2,7 +2,7 @@ import {useCanvasWidth,useSelectedBreakpoint,} from "~/designer/shared/nano-states";-import { Text, Flex, Slider } from "@webstudio-is/design-system";+import { DeprecatedText2, Flex, Slider } from "@webstudio-is/design-system";import { useIsPreviewMode } from "~/shared/nano-states";import { useNextBreakpoint } from "./use-next-breakpoint";import { theme } from "@webstudio-is/design-system";@@ -38,7 +38,7 @@ export const WidthSetting = () => {gap="1"direction="column">- <Text>Canvas width</Text>+ <DeprecatedText2>Canvas width</DeprecatedText2><Flex gap="3" align="center"><Slidermin={min}@@ -48,7 +48,7 @@ export const WidthSetting = () => {setCanvasWidth(value);}}/>- <Text>{`${canvasWidth}px`}</Text>+ <DeprecatedText2>{`${canvasWidth}px`}</DeprecatedText2></Flex></Flex>);diff --git a/apps/designer/app/designer/features/breakpoints/zoom-setting.tsx b/apps/designer/app/designer/features/breakpoints/zoom-setting.tsxindex 1ddd189b52..b539286782 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, DeprecatedText2, Flex } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";export const minZoom = 10;@@ -12,7 +12,7 @@ export const ZoomSetting = () => {gap="1"direction="column">- <Text>Zoom</Text>+ <DeprecatedText2>Zoom</DeprecatedText2><Flex gap="3" align="center"><Slidermin={minZoom}@@ -21,7 +21,7 @@ export const ZoomSetting = () => {setValue(value);}}/>- <Text>{value}%</Text>+ <DeprecatedText2>{value}%</DeprecatedText2></Flex></Flex>);diff --git a/apps/designer/app/designer/features/footer/breadcrumbs.tsx b/apps/designer/app/designer/features/footer/breadcrumbs.tsxindex 91f844fbc0..c674025537 100644--- a/apps/designer/app/designer/features/footer/breadcrumbs.tsx+++ b/apps/designer/app/designer/features/footer/breadcrumbs.tsx@@ -1,6 +1,10 @@import { useStore } from "@nanostores/react";import { ChevronRightIcon } from "@webstudio-is/icons";-import { DeprecatedButton, Flex, Text } from "@webstudio-is/design-system";+import {+ DeprecatedButton,+ Flex,+ DeprecatedText2,+} from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";import { selectedInstanceIdStore } from "~/shared/nano-states";import { useSelectedInstancePath } from "~/designer/shared/instance/use-selected-instance-path";@@ -37,7 +41,7 @@ export const Breadcrumbs = () => {<Flex align="center" css={{ height: "100%" }}>{selectedInstancePath.length === 0 ? (<Breadcrumb>- <Text>No instance selected</Text>+ <DeprecatedText2>No instance selected</DeprecatedText2></Breadcrumb>) : (selectedInstancePath.map((instance) => (diff --git a/apps/designer/app/designer/features/inspector/inspector.tsx b/apps/designer/app/designer/features/inspector/inspector.tsxindex 28a70e4cf7..fa705a3a8b 100644--- a/apps/designer/app/designer/features/inspector/inspector.tsx+++ b/apps/designer/app/designer/features/inspector/inspector.tsx@@ -2,13 +2,13 @@ import { useRef } from "react";import { useStore } from "@nanostores/react";import type { Publish } from "~/shared/pubsub";import {- Text,+ DeprecatedText2,Tabs,TabsList,TabsTrigger,TabsContent,Card,- Paragraph,+ DeprecatedParagraph,Box,Flex,EnhancedTooltipProvider,@@ -40,7 +40,9 @@ export const Inspector = ({ publish }: InspectorProps) => {<Cardcss={{ p: theme.spacing[9], mt: theme.spacing[9], width: "100%" }}>- <Paragraph>Select an instance on the canvas</Paragraph>+ <DeprecatedParagraph>+ Select an instance on the canvas+ </DeprecatedParagraph></Card></Box>);@@ -56,14 +58,14 @@ export const Inspector = ({ publish }: InspectorProps) => {<Flex as={Tabs} defaultValue="style" ref={tabsRef}><TabsList><TabsTrigger value="style">- <Text>Style</Text>+ <DeprecatedText2>Style</DeprecatedText2></TabsTrigger>{/* @note: events would be part of props */}<TabsTrigger value="props">- <Text>Props</Text>+ <DeprecatedText2>Props</DeprecatedText2></TabsTrigger><TabsTrigger value="inspect">- <Text>Inspect</Text>+ <DeprecatedText2>Inspect</DeprecatedText2></TabsTrigger></TabsList><TabsContent value="style" css={contentStyle}>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 59b4d04872..ddf4368935 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,7 +1,7 @@import type { Instance } from "@webstudio-is/project-build";import { getComponentMeta } from "@webstudio-is/react-sdk";import { forwardRef, type ElementRef, type ComponentProps } from "react";-import { Flex, Text, styled } from "@webstudio-is/design-system";+import { Flex, DeprecatedText2, styled } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";const Thumb = styled(Flex, {@@ -46,7 +46,7 @@ export const ComponentThumb = forwardRef<{...rest}><meta.Icon width={30} height={30} />- <Text>{meta.label}</Text>+ <DeprecatedText2>{meta.label}</DeprecatedText2></Thumb>);});diff --git a/apps/designer/app/designer/features/style-panel/sections/space/layout.tsx b/apps/designer/app/designer/features/style-panel/sections/space/layout.tsxindex ac5f971523..a96bb75aa0 100644--- a/apps/designer/app/designer/features/style-panel/sections/space/layout.tsx+++ b/apps/designer/app/designer/features/style-panel/sections/space/layout.tsx@@ -177,7 +177,7 @@ const Cell = styled("div", {const Label = styled("div", {color: theme.colors.slate11,textTransform: "uppercase",- fontSize: theme.fontSize[1],+ fontSize: theme.deprecatedFontSize[1],lineHeight: 1,marginTop: 3,marginLeft: 4,diff --git a/apps/designer/app/designer/features/style-panel/sections/space/value-text.tsx b/apps/designer/app/designer/features/style-panel/sections/space/value-text.tsxindex 55dc3f0d79..5f4c0d378d 100644--- a/apps/designer/app/designer/features/style-panel/sections/space/value-text.tsx+++ b/apps/designer/app/designer/features/style-panel/sections/space/value-text.tsx@@ -43,7 +43,7 @@ const Container = styled("span", {const Span = styled("span", {display: "block",- fontSize: theme.fontSize[2],+ fontSize: theme.deprecatedFontSize[2],lineHeight: 1,overflow: "hidden",maxWidth: "100%",@@ -51,7 +51,10 @@ const Span = styled("span", {textOverflow: "ellipsis",variants: {keyword: {- true: { fontSize: theme.fontSize[1], textTransform: "uppercase" },+ true: {+ fontSize: theme.deprecatedFontSize[1],+ textTransform: "uppercase",+ },},},});diff --git a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsxindex c816669509..344568d6ab 100644--- a/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx+++ b/apps/designer/app/designer/features/style-panel/shared/css-value-input/unit-select.tsx@@ -10,7 +10,7 @@ import {SelectContent,TextFieldIconButton,styled,- textStyles,+ deprecatedTextStyles,} from "@webstudio-is/design-system";import { ChevronDownIcon, ChevronUpIcon } from "@webstudio-is/icons";@@ -75,7 +75,7 @@ export const useUnitSelect = ({return [isOpen, select];};-const StyledTrigger = styled(TextFieldIconButton, textStyles, {+const StyledTrigger = styled(TextFieldIconButton, deprecatedTextStyles, {px: 3,});diff --git a/apps/designer/app/designer/features/style-panel/shared/property-name.tsx b/apps/designer/app/designer/features/style-panel/shared/property-name.tsxindex 1c57288a08..adc6d6ed19 100644--- a/apps/designer/app/designer/features/style-panel/shared/property-name.tsx+++ b/apps/designer/app/designer/features/style-panel/shared/property-name.tsx@@ -7,7 +7,7 @@ import {Button,Flex,Box,- Text,+ DeprecatedText2,Label,Tooltip,DeprecatedPopover,@@ -57,10 +57,10 @@ const PropertyPopoverContent = ({(item) => item.id === breakpointId);return (- <Text key={property} color="hint">+ <DeprecatedText2 key={property} color="hint">Resetting will change {property} to cascaded {toValue(value)}{" "}from {breakpoint?.label}- </Text>+ </DeprecatedText2>);}@@ -71,17 +71,17 @@ const PropertyPopoverContent = ({? undefined: utils.tree.findInstanceById(rootInstance, instanceId);return (- <Text key={property} color="hint">+ <DeprecatedText2 key={property} color="hint">Resetting will change {property} to inherited {toValue(value)}{" "}from {instance?.component}- </Text>+ </DeprecatedText2>);}return (- <Text key={property} color="hint">+ <DeprecatedText2 key={property} color="hint">Resetting will change to initial value- </Text>+ </DeprecatedText2>);})}</Box>@@ -100,9 +100,9 @@ const PropertyPopoverContent = ({(item) => item.id === breakpointId);return (- <Text key={property} color="hint">+ <DeprecatedText2 key={property} color="hint">{property} value is cascaded from {breakpoint?.label}- </Text>+ </DeprecatedText2>);}@@ -113,9 +113,9 @@ const PropertyPopoverContent = ({? undefined: utils.tree.findInstanceById(rootInstance, instanceId);return (- <Text key={property} color="hint">+ <DeprecatedText2 key={property} color="hint">{property} value is inherited from {instance?.component}- </Text>+ </DeprecatedText2>);}})}diff --git a/apps/designer/app/designer/features/style-panel/style-panel.tsx b/apps/designer/app/designer/features/style-panel/style-panel.tsxindex 2536c5aee6..c4fd5c7121 100644--- a/apps/designer/app/designer/features/style-panel/style-panel.tsx+++ b/apps/designer/app/designer/features/style-panel/style-panel.tsx@@ -1,6 +1,11 @@import type { Publish } from "~/shared/pubsub";import { willRender } from "~/designer/shared/breakpoints";-import { Box, Card, Paragraph, SearchField } from "@webstudio-is/design-system";+import {+ Box,+ Card,+ DeprecatedParagraph,+ SearchField,+} from "@webstudio-is/design-system";import type { Instance } from "@webstudio-is/project-build";import { useStyleData } from "./shared/use-style-data";import { StyleSettings } from "./style-settings";@@ -39,12 +44,12 @@ export const StylePanel = ({ selectedInstance, publish }: StylePanelProps) => {return (<Box css={{ p: theme.spacing[5] }}><Card css={{ p: theme.spacing[9], mt: theme.spacing[9] }}>- <Paragraph css={{ marginBottom: theme.spacing[5] }}>+ <DeprecatedParagraph css={{ marginBottom: theme.spacing[5] }}>{`Please increase the canvas width.`}- </Paragraph>- <Paragraph>+ </DeprecatedParagraph>+ <DeprecatedParagraph>{`"${breakpoint.label}" breakpoint minimum width is ${breakpoint.minWidth}px.`}- </Paragraph>+ </DeprecatedParagraph></Card></Box>);diff --git a/apps/designer/app/designer/features/style-panel/style-source/style-source-badge.tsx b/apps/designer/app/designer/features/style-panel/style-source/style-source-badge.tsxindex 64d5896d71..761bf1fb70 100644--- a/apps/designer/app/designer/features/style-panel/style-source/style-source-badge.tsx+++ b/apps/designer/app/designer/features/style-panel/style-source/style-source-badge.tsx@@ -1,7 +1,7 @@-import { styled, Text } from "@webstudio-is/design-system";+import { styled, DeprecatedText2 } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";-export const StyleSourceBadge = styled(Text, {+export const StyleSourceBadge = styled(DeprecatedText2, {display: "inline-flex",borderRadius: theme.borderRadius[2],px: theme.spacing[3],diff --git a/apps/designer/app/designer/features/style-panel/style-source/style-source.tsx b/apps/designer/app/designer/features/style-panel/style-source/style-source.tsxindex edb989f966..83b95c6ffa 100644--- a/apps/designer/app/designer/features/style-panel/style-source/style-source.tsx+++ b/apps/designer/app/designer/features/style-panel/style-source/style-source.tsx@@ -5,7 +5,7 @@ import {DropdownMenuItem,DropdownMenuPortal,DropdownMenuTrigger,- Text,+ DeprecatedText2,styled,Box,theme,@@ -284,7 +284,7 @@ const EditableText = ({});return (- <Text+ <DeprecatedText2truncateref={ref}css={{@@ -294,7 +294,7 @@ const EditableText = ({{...handlers}>{label}- </Text>+ </DeprecatedText2>);};diff --git a/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsx b/apps/designer/app/designer/features/topbar/menu/shortcut-hint.tsxindex 2ceb02cf6d..d69a6a72a8 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 { DeprecatedText2 } from "@webstudio-is/design-system";const isMac =typeof navigator === "object" ? /mac/i.test(navigator.platform) : false;@@ -33,5 +33,9 @@ const format = (value: ShortcutDefinition) => {};export const ShortcutHint = ({ value }: { value: ShortcutDefinition }) => {- return <Text css={{ letterSpacing: 1.5 }}>{format(value)}</Text>;+ return (+ <DeprecatedText2 css={{ letterSpacing: 1.5 }}>+ {format(value)}+ </DeprecatedText2>+ );};diff --git a/apps/designer/app/designer/features/topbar/publish.tsx b/apps/designer/app/designer/features/topbar/publish.tsxindex 7616fafdf3..95d1079971 100644--- a/apps/designer/app/designer/features/topbar/publish.tsx+++ b/apps/designer/app/designer/features/topbar/publish.tsx@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";import { useFetcher } from "@remix-run/react";import { ExternalLinkIcon, RocketIcon } from "@webstudio-is/icons";import {- Text,+ DeprecatedText2,Button,DeprecatedButton,Flex,@@ -51,7 +51,9 @@ const Content = ({ project }: PublishButtonProps) => {gap: theme.spacing[0],}}>- <Text truncate>{new URL(getPublishedUrl(domain)).host}</Text>+ <DeprecatedText2 truncate>+ {new URL(getPublishedUrl(domain)).host}+ </DeprecatedText2><ExternalLinkIcon /></Link>)}@@ -61,7 +63,9 @@ const Content = ({ project }: PublishButtonProps) => {<TextField id={id} name="domain" defaultValue={domain} /></Flex>{fetcher.data?.errors !== undefined && (- <Text color="error">{fetcher.data?.errors}</Text>+ <DeprecatedText2 color="error">+ {fetcher.data?.errors}+ </DeprecatedText2>)}<Buttonstate={fetcher.state !== "idle" ? "pending" : "auto"}@@ -85,7 +89,7 @@ export const PublishButton = ({ project }: PublishButtonProps) => {css={{ display: "flex", gap: theme.spacing[3] }}><RocketIcon />- <Text>Publish</Text>+ <DeprecatedText2>Publish</DeprecatedText2></DeprecatedButton></DeprecatedPopoverTrigger><DeprecatedPopoverPortal>diff --git a/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx b/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsxindex f55328549b..a716751f86 100644--- a/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx+++ b/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx@@ -47,7 +47,7 @@ const LabelContainer = styled(alignItems: "center",justifyContent: "center",gap: theme.spacing[3],- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],fontFamily: theme.fonts.sans,lineHeight: 1,minWidth: theme.spacing[13],diff --git a/apps/designer/app/designer/shared/fonts-manager/item-menu.tsx b/apps/designer/app/designer/shared/fonts-manager/item-menu.tsxindex bb7a5dd7df..3fb42d0469 100644--- a/apps/designer/app/designer/shared/fonts-manager/item-menu.tsx+++ b/apps/designer/app/designer/shared/fonts-manager/item-menu.tsx@@ -4,7 +4,7 @@ import {DeprecatedIconButton,DropdownMenuContent,DropdownMenuItem,- Text,+ DeprecatedText2,DropdownMenuPortal,styled,} from "@webstudio-is/design-system";@@ -79,7 +79,7 @@ const ItemMenu = ({onDelete();}}>- <Text>Delete font</Text>+ <DeprecatedText2>Delete font</DeprecatedText2></DropdownMenuItem></DropdownMenuContent></DropdownMenuPortal>diff --git a/apps/designer/app/designer/shared/image-manager/filename.tsx b/apps/designer/app/designer/shared/image-manager/filename.tsxindex 2b15434eee..413d2cb03c 100644--- a/apps/designer/app/designer/shared/image-manager/filename.tsx+++ b/apps/designer/app/designer/shared/image-manager/filename.tsx@@ -1,7 +1,10 @@-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, DeprecatedText2 } from "@webstudio-is/design-system";import type { ComponentProps } from "react";-type FilenameProps = Omit<ComponentProps<typeof Text>, "children"> & {+type FilenameProps = Omit<+ ComponentProps<typeof DeprecatedText2>,+ "children"+> & {children: string;};@@ -11,10 +14,10 @@ export const Filename = ({ children, ...props }: FilenameProps) => {const baseName = children.substr(0, children.length - extension.length - 1);return (<Flex>- <Text truncate {...props}>+ <DeprecatedText2 truncate {...props}>{baseName}- </Text>- <Text {...props}>{extension}</Text>+ </DeprecatedText2>+ <DeprecatedText2 {...props}>{extension}</DeprecatedText2></Flex>);};diff --git a/apps/designer/app/designer/shared/image-manager/image-info.tsx b/apps/designer/app/designer/shared/image-manager/image-info.tsxindex 0d34a4a36d..dd0d61fb1c 100644--- a/apps/designer/app/designer/shared/image-manager/image-info.tsx+++ b/apps/designer/app/designer/shared/image-manager/image-info.tsx@@ -1,4 +1,10 @@-import { Box, Flex, Grid, Text, Button } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ Grid,+ DeprecatedText2,+ Button,+} from "@webstudio-is/design-system";import { getFormattedAspectRatio } from "./utils";import {CloudIcon,@@ -27,7 +33,9 @@ export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {</Box><Flex align="center" css={{ gap: theme.spacing[3] }}><CloudIcon />- <Text variant="label">{prettyBytes(size)}</Text>+ <DeprecatedText2 variant="label">+ {prettyBytes(size)}+ </DeprecatedText2></Flex></Grid></Box>@@ -36,13 +44,15 @@ export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {<Grid columns={2} gap={2} align="center"><Flex align="center" css={{ gap: theme.spacing[3] }}><SizeIcon />- <Text variant="label">+ <DeprecatedText2 variant="label">{meta.width} x {meta.height}- </Text>+ </DeprecatedText2></Flex>{" "}<Flex align="center" css={{ gap: theme.spacing[3] }}><AspectRatioIcon />- <Text variant="label">{getFormattedAspectRatio(meta)}</Text>+ <DeprecatedText2 variant="label">+ {getFormattedAspectRatio(meta)}+ </DeprecatedText2></Flex></Grid></Box>diff --git a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx b/apps/designer/app/designer/shared/inspector/collapsible-section.tsxindex ac7c44d7d9..b2d15bd29a 100644--- a/apps/designer/app/designer/shared/inspector/collapsible-section.tsx+++ b/apps/designer/app/designer/shared/inspector/collapsible-section.tsx@@ -1,6 +1,11 @@import { atom } from "nanostores";import { useStore } from "@nanostores/react";-import { Box, Flex, Text, Collapsible } from "@webstudio-is/design-system";+import {+ Box,+ Flex,+ DeprecatedText2,+ Collapsible,+} from "@webstudio-is/design-system";import { ChevronLeftIcon, ChevronRightIcon } from "@webstudio-is/icons";import { theme } from "@webstudio-is/design-system";@@ -56,7 +61,7 @@ export const CollapsibleSection = ({userSelect: "none",}}>- <Text variant="label">{label}</Text>+ <DeprecatedText2 variant="label">{label}</DeprecatedText2><Flexalign="center"justify="center"diff --git a/apps/designer/app/designer/shared/inspector/component-info.tsx b/apps/designer/app/designer/shared/inspector/component-info.tsxindex 7665940d09..9a4ca5f9c4 100644--- a/apps/designer/app/designer/shared/inspector/component-info.tsx+++ b/apps/designer/app/designer/shared/inspector/component-info.tsx@@ -1,6 +1,6 @@import type { Instance } from "@webstudio-is/project-build";import { getComponentMeta } from "@webstudio-is/react-sdk";-import { Flex, Text } from "@webstudio-is/design-system";+import { Flex, DeprecatedText2 } from "@webstudio-is/design-system";import { theme } from "@webstudio-is/design-system";export const ComponentInfo = ({@@ -10,15 +10,15 @@ export const ComponentInfo = ({}) => {return (<Flex justify="between" align="center">- <Text+ <DeprecatedText2css={{- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],color: theme.colors.slate11,fontWeight: "500",}}>{`Selected: ${getComponentMeta(selectedInstance.component)?.label- }`}</Text>+ }`}</DeprecatedText2></Flex>);};diff --git a/apps/designer/package.json b/apps/designer/package.jsonindex fe43cfab6d..c637c5460d 100644--- a/apps/designer/package.json+++ b/apps/designer/package.json@@ -21,6 +21,7 @@"@floating-ui/dom": "^1.0.6","@fontsource/inter": "^4.5.15","@fontsource/manrope": "^4.5.13",+ "@fontsource/roboto-mono": "^4.5.10","@lexical/link": "^0.6.0","@lexical/react": "^0.6.0","@lexical/selection": "^0.6.0",diff --git a/packages/design-system/bin/transform-figma-tokens.ts b/packages/design-system/bin/transform-figma-tokens.tsindex ac004d4daa..8f5b1e4450 100644--- a/packages/design-system/bin/transform-figma-tokens.ts+++ b/packages/design-system/bin/transform-figma-tokens.ts@@ -9,11 +9,80 @@ const SOURCE_FILE = "./src/__generated__/figma-design-tokens.json";const TMP_OUTPUT_FILE = "./src/__generated__/figma-design-tokens.tmp";const OUTPUT_FILE = "./src/__generated__/figma-design-tokens.ts";-const TreeLeaf = z.object({+// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping+// (hopefully the fonts we use, Figma, Tokens plugin — all follow this convention)+const fontWeightMapping = {+ thin: 100,+ hairline: 100,+ extralight: 200,+ ultralight: 200,+ light: 300,+ normal: 400,+ regular: 400,+ medium: 500,+ semibold: 600,+ demibold: 600,+ bold: 700,+ extrabold: 800,+ ultrabold: 800,+ black: 900,+ heavy: 900,+ extrablack: 950,+ ultrablack: 950,+} as const;++const fontFamilies = {+ Inter:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",+ Manrope: "Manrope Variable, ManropeVariable, Manrope, sans-serif",+ Roboto: "Roboto Mono, RobotoMono, menlo, monospace",+} as const;+const fontFamilyMapping = {+ ...fontFamilies,+ InterVariable: fontFamilies.Inter,+ "Inter Variable": fontFamilies.Inter,+ ManropeVariable: fontFamilies.Manrope,+ "Manrope Variable": fontFamilies.Manrope,+ "Roboto Mono": fontFamilies.Roboto,+} as const;++const TreeLeafSchema = z.object({type: z.string(),value: z.unknown(),});+const FontWeightSchema = z.preprocess(+ (x) => (typeof x === "string" ? x.toLowerCase().replace(/\s+/g, "") : x),+ z.enum(Object.keys(fontWeightMapping) as [keyof typeof fontWeightMapping])+);++const FontFamilySchema = z.string();++const LineHeightSchema = z.union([z.string(), z.number()]);++const FontSizeSchema = z.number();++const LetterSpacingSchema = z.union([z.string(), z.number()]);++const TypographySchema = z.object({+ fontFamily: z.unknown(),+ fontWeight: z.unknown(),+ lineHeight: z.unknown(),+ fontSize: z.unknown(),+ letterSpacing: z.unknown(),+});++const SingleShadowSchema = z.object({+ color: z.string(),+ type: z.enum(["dropShadow", "innerShadow"]),+ x: z.number(),+ y: z.number(),+ blur: z.number(),+ spread: z.number(),+});++const ShadowSchema = z.union([SingleShadowSchema, z.array(SingleShadowSchema)]);+const parse = <Output, Def extends ZodTypeDef, Input>(path: string[],value: unknown,@@ -30,18 +99,9 @@ const parse = <Output, Def extends ZodTypeDef, Input>(return result.data;};-const SingleShadow = z.object({- color: z.string(),- type: z.enum(["dropShadow", "innerShadow"]),- x: z.number(),- y: z.number(),- blur: z.number(),- spread: z.number(),-});-const Shadow = z.union([SingleShadow, z.array(SingleShadow)]);-const printShadow = (path: string[], value: unknown) => {- const shadow = parse(path, value, Shadow);- const printSingle = (shadow: z.infer<typeof SingleShadow>) => {+const printShadow = (path: string[], unparsedValue: unknown) => {+ const shadow = parse(path, unparsedValue, ShadowSchema);+ const printSingle = (shadow: z.infer<typeof SingleShadowSchema>) => {return [shadow.type === "innerShadow" ? "inset" : "",`${shadow.x}px`,@@ -58,51 +118,9 @@ const printShadow = (path: string[], value: unknown) => {: printSingle(shadow);};-// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping-// (hopefully the fonts we use, Figma, Tokens plugin — all follow this convention)-const fontWeightMapping = {- thin: 100,- hairline: 100,- extralight: 200,- ultralight: 200,- light: 300,- normal: 400,- regular: 400,- medium: 500,- semibold: 600,- demibold: 600,- bold: 700,- extrabold: 800,- ultrabold: 800,- black: 900,- heavy: 900,- extrablack: 950,- ultrablack: 950,-} as const;-const fontFamilies = {- Inter: "InterVariable, Inter, -apple-system, system-ui, sans-serif",- Manrope: "ManropeVariable, Manrope, sans-serif",- Roboto: "Roboto, menlo, monospace",-} as const;-const fontFamilyMapping = {- ...fontFamilies,- InterVariable: fontFamilies.Inter,- "Inter Variable": fontFamilies.Inter,- ManropeVariable: fontFamilies.Manrope,- "Manrope Variable": fontFamilies.Manrope,- "Roboto Mono": fontFamilies.Roboto,-};-const Typography = z.object({- fontFamily: z.string(),- fontWeight: z.preprocess(- (x) => (typeof x === "string" ? x.toLowerCase().replace(/\s+/g, "") : x),- z.enum(Object.keys(fontWeightMapping) as [keyof typeof fontWeightMapping])- ),- lineHeight: z.union([z.string(), z.number()]),- fontSize: z.number(),- letterSpacing: z.union([z.string(), z.number()]),-});-const printLineHeight = (path: string[], value: number | string) => {+const printLineHeight = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, LineHeightSchema);+if (typeof value === "number") {return `${value}px`;}@@ -118,7 +136,10 @@ const printLineHeight = (path: string[], value: number | string) => {`Could not parse "${path.join(" > ")} > lineHeight": ${value}`);};-const printLetterSpacing = (path: string[], value: number | string) => {++const printLetterSpacing = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, LetterSpacingSchema);+if (typeof value === "number") {return `${value}px`;}@@ -130,18 +151,43 @@ const printLetterSpacing = (path: string[], value: number | string) => {`Could not parse "${path.join(" > ")} > letterSpacing": ${value}`);};-const printTypography = (path: string[], value: unknown) => {- const typography = parse(path, value, Typography);++const printFontWeight = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, FontWeightSchema);+ return fontWeightMapping[value];+};++const printFontFamily = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, FontFamilySchema);+ return fontFamilyMapping[value] || value;+};++const printFontSize = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, FontSizeSchema);+ return `${value}px`;+};++const printTypography = (path: string[], unparsedValue: unknown) => {+ const value = parse(path, unparsedValue, TypographySchema);return {- fontFamily:- fontFamilyMapping[typography.fontFamily] ?? typography.fontFamily,- fontWeight: fontWeightMapping[typography.fontWeight],- fontSize: `${typography.fontSize}px`,- lineHeight: printLineHeight(path, typography.lineHeight),- letterSpacing: printLetterSpacing(path, typography.letterSpacing),+ fontFamily: printFontFamily(path, value.fontFamily),+ fontWeight: printFontWeight(path, value.fontWeight),+ fontSize: printFontSize(path, value.fontSize),+ lineHeight: printLineHeight(path, value.lineHeight),+ letterSpacing: printLetterSpacing(path, value.letterSpacing),};};+const printerByType = {+ boxShadow: printShadow,+ typography: printTypography,+ letterSpacing: printLetterSpacing,+ lineHeights: printLineHeight,+ fontWeights: printFontWeight,+ fontSizes: printFontSize,+ fontFamilies: printFontFamily,+} as const;+const traverse = (node: unknown,nodePath: string[],@@ -151,7 +197,7 @@ const traverse = (return;}- const asLeaf = TreeLeaf.safeParse(node);+ const asLeaf = TreeLeafSchema.safeParse(node);if (asLeaf.success && asLeaf.data.value !== undefined) {fn(nodePath, asLeaf.data.type, asLeaf.data.value);return;@@ -188,19 +234,10 @@ const main = () => {const record = byType.get(type) ?? {};byType.set(type, record);- let printedValue = value;-- if (type === "boxShadow") {- printedValue = printShadow(path, value);- }-- if (type === "typography") {- printedValue = printTypography(path, value);- }-// no need to check for __proto__ (prototype polution)// because we know pathToName returns a string without "_"- record[pathToName(path, type)] = printedValue;+ record[pathToName(path, type)] =+ type in printerByType ? printerByType[type](path, value) : value;});writeFileSync(diff --git a/packages/design-system/src/__generated__/figma-design-tokens.ts b/packages/design-system/src/__generated__/figma-design-tokens.tsindex d2c9506336..5ef08c939c 100644--- a/packages/design-system/src/__generated__/figma-design-tokens.ts+++ b/packages/design-system/src/__generated__/figma-design-tokens.ts@@ -7,179 +7,190 @@ export const boxShadow = {} as const;export const fontFamilies = {- inter: "Inter",- manrope: "Manrope",- robotoMono: "Roboto Mono",+ inter:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",+ manrope: "Manrope Variable, ManropeVariable, Manrope, sans-serif",+ robotoMono: "Roboto Mono, RobotoMono, menlo, monospace",} as const;export const lineHeights = {- "0": 8,- "1": 10,- "2": 11,- "3": 12,- "4": 16,- "5": 22,- "6": 27,- "7": 39,- "8": 58,- "9": 360,+ "0": "8px",+ "1": "10px",+ "2": "11px",+ "3": "12px",+ "4": "16px",+ "5": "22px",+ "6": "27px",+ "7": "39px",+ "8": "58px",+ "9": "360px",} as const;export const fontWeights = {- inter0: "Regular",- inter1: "Medium",- inter2: "Semi Bold",- inter3: "Bold",- robotoMono4: "Regular",- manrope5: "ExtraLight",- manrope6: "Regular",- manrope7: "Bold",- manrope8: "ExtraBold",+ inter0: 400,+ inter1: 500,+ inter2: 600,+ inter3: 700,+ robotoMono4: 400,+ manrope5: 200,+ manrope6: 400,+ manrope7: 700,+ manrope8: 800,} as const;export const fontSizes = {- fontSize0: 8,- fontSize1: 10,- fontSize2: 12,- fontSize3: 16,- fontSize4: 20,- fontSize5: 32,- fontSize6: 48,- fontSize7: 360,+ fontSize0: "8px",+ fontSize1: "10px",+ fontSize2: "12px",+ fontSize3: "16px",+ fontSize4: "20px",+ fontSize5: "32px",+ fontSize6: "48px",+ fontSize7: "360px",} as const;export const letterSpacing = {- "0": "-5%",- "1": "-2%",- "2": "0%",- "3": "0.5%",- "4": "1%",+ "0": "-0.05em",+ "1": "-0.02em",+ "2": "0em",+ "3": "0.005em",+ "4": "0.01em",} as const;export const paragraphSpacing = { "0": 0 } as const;export const typography = {regular: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 400,fontSize: "12px",lineHeight: "16px",letterSpacing: "0.005em",},labelTitleCase: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "12px",lineHeight: "16px",letterSpacing: "0.005em",},labelSentenceCase: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "12px",lineHeight: "16px",letterSpacing: "0.005em",},title: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 700,fontSize: "12px",lineHeight: "16px",letterSpacing: "0.01em",},small: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 400,fontSize: "10px",lineHeight: "11px",letterSpacing: "0.01em",},tiny: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "8px",lineHeight: "8px",letterSpacing: "0.01em",},unit: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "10px",lineHeight: "12px",letterSpacing: "0em",},mono: {- fontFamily: "Roboto, menlo, monospace",+ fontFamily: "Roboto Mono, RobotoMono, menlo, monospace",fontWeight: 400,fontSize: "12px",lineHeight: "16px",letterSpacing: "0.01em",},bigTitle: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "32px",lineHeight: "39px",letterSpacing: "0.005em",},spaceSectionUnitText: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 600,fontSize: "8px",lineHeight: "8px",letterSpacing: "0.01em",},spaceSectionValueText: {- fontFamily: "InterVariable, Inter, -apple-system, system-ui, sans-serif",+ fontFamily:+ "Inter Variable, InterVariable, Inter, -apple-system, system-ui, sans-serif",fontWeight: 500,fontSize: "10px",lineHeight: "10px",letterSpacing: "0.01em",},brandSectionTitle: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 700,fontSize: "20px",lineHeight: "27px",letterSpacing: "0em",},brandLargeTitle: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 700,fontSize: "48px",lineHeight: "58px",letterSpacing: "-0.02em",},brandRegular: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 400,fontSize: "16px",lineHeight: "22px",letterSpacing: "0em",},brandThumbnailLargeDefault: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 200,fontSize: "360px",lineHeight: "360px",letterSpacing: "-0.05em",},brandThumbnailLargeHover: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 800,fontSize: "360px",lineHeight: "360px",letterSpacing: "-0.05em",},brandThumbnailSmallDefault: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 400,fontSize: "48px",lineHeight: "58px",letterSpacing: "-0.02em",},brandThumbnailSmallHover: {- fontFamily: "ManropeVariable, Manrope, sans-serif",+ fontFamily: "Manrope Variable, ManropeVariable, Manrope, sans-serif",fontWeight: 800,fontSize: "48px",lineHeight: "58px",diff --git a/packages/design-system/src/components/__DEPRECATED__/button.tsx b/packages/design-system/src/components/__DEPRECATED__/button.tsxindex 3aa2e16389..38cae4992c 100644--- a/packages/design-system/src/components/__DEPRECATED__/button.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/button.tsx@@ -28,7 +28,7 @@ export const DeprecatedButton = styled("button", {height: theme.spacing[11],px: theme.spacing[5],fontFamily: theme.fonts.sans,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],fontWeight: 500,fontVariantNumeric: "tabular-nums",@@ -45,19 +45,19 @@ export const DeprecatedButton = styled("button", {borderRadius: theme.borderRadius[4],height: theme.spacing[11],px: theme.spacing[4],- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],},"2": {borderRadius: theme.borderRadius[6],height: theme.spacing[12],px: theme.spacing[9],- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],},"3": {borderRadius: theme.borderRadius[6],height: theme.spacing[17],px: theme.spacing[10],- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],},},variant: {diff --git a/packages/design-system/src/components/__DEPRECATED__/icon-button.tsx b/packages/design-system/src/components/__DEPRECATED__/icon-button.tsxindex ac4e331764..6f91c5b716 100644--- a/packages/design-system/src/components/__DEPRECATED__/icon-button.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/icon-button.tsx@@ -10,7 +10,7 @@ export const DeprecatedIconButton = styled("button", {display: "inline-flex",flexShrink: 0,fontFamily: "inherit",- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],justifyContent: "center",lineHeight: "1",padding: 0,diff --git a/packages/design-system/src/components/__DEPRECATED__/label.tsx b/packages/design-system/src/components/__DEPRECATED__/label.tsxindex fb0d264fe9..8363cc74fd 100644--- a/packages/design-system/src/components/__DEPRECATED__/label.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/label.tsx@@ -1,8 +1,8 @@import { styled } from "../../stitches.config";import * as LabelPrimitive from "@radix-ui/react-label";-import { Text } from "../text";+import { DeprecatedText2 } from "./text2";-export const DeprecatedLabel = styled(LabelPrimitive.Root, Text, {+export const DeprecatedLabel = styled(LabelPrimitive.Root, DeprecatedText2, {display: "inline-block",verticalAlign: "middle",cursor: "default",diff --git a/packages/design-system/src/components/paragraph.tsx b/packages/design-system/src/components/__DEPRECATED__/paragraph.tsxsimilarity index 64%rename from packages/design-system/src/components/paragraph.tsxrename to packages/design-system/src/components/__DEPRECATED__/paragraph.tsxindex 45af7916e8..3c11ef889a 100644--- a/packages/design-system/src/components/paragraph.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/paragraph.tsx@@ -1,17 +1,17 @@import React, { type ComponentProps } from "react";-import { Text } from "./text";+import { DeprecatedText2 } from "./text2";const DEFAULT_TAG = "p";type ParagraphProps = ComponentProps<typeof DEFAULT_TAG> &- ComponentProps<typeof Text>;+ ComponentProps<typeof DeprecatedText2>;-export const Paragraph = React.forwardRef<+export const DeprecatedParagraph = React.forwardRef<React.ElementRef<typeof DEFAULT_TAG>,ParagraphProps>(({ css, ...props }, forwardedRef) => {return (- <Text+ <DeprecatedText2as={DEFAULT_TAG}{...props}ref={forwardedRef}@@ -23,4 +23,4 @@ export const Paragraph = React.forwardRef<);});-Paragraph.displayName = "Paragraph";+DeprecatedParagraph.displayName = "DeprecatedParagraph";diff --git a/packages/design-system/src/components/__DEPRECATED__/popover.tsx b/packages/design-system/src/components/__DEPRECATED__/popover.tsxindex db723f38b4..dbc3b29565 100644--- a/packages/design-system/src/components/__DEPRECATED__/popover.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/popover.tsx@@ -5,7 +5,7 @@ import { Box } from "../box";import { panelStyles } from "../panel";import { Flex } from "../flex";import { DeprecatedIconButton } from "./icon-button";-import { Text } from "../text";+import { DeprecatedText2 } from "./text2";import { Separator } from "../separator";import { styled, CSS } from "../../stitches.config";import { theme } from "../../stitches.config";@@ -76,7 +76,7 @@ export const DeprecatedPopoverHeader = ({ title }: PopoverHeaderProps) => {align="center"justify="between">- <Text variant="title">{title}</Text>+ <DeprecatedText2 variant="title">{title}</DeprecatedText2><DeprecatedPopoverClose asChild><DeprecatedIconButtonsize="2"diff --git a/packages/design-system/src/components/__DEPRECATED__/text.stories.tsx b/packages/design-system/src/components/__DEPRECATED__/text.stories.tsxnew file mode 100644index 0000000000..1eaa0ab690--- /dev/null+++ b/packages/design-system/src/components/__DEPRECATED__/text.stories.tsx@@ -0,0 +1,34 @@+import { ComponentStory } from "@storybook/react";+import { DeprecatedText2 } from "./text2";++export default {+ component: DeprecatedText2,+};++export const Regular: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2>Regular text</DeprecatedText2>;+};++export const Label: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2 variant="label">Label text</DeprecatedText2>;+};++export const Tiny: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2 variant="tiny">Tiny text</DeprecatedText2>;+};+export const Title: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2 variant="title">Title text</DeprecatedText2>;+};+export const Mono: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2 variant="mono">Mono text</DeprecatedText2>;+};+export const Unit: ComponentStory<typeof DeprecatedText2> = () => {+ return <DeprecatedText2 variant="unit">Unit text</DeprecatedText2>;+};+export const Truncated: ComponentStory<typeof DeprecatedText2> = () => {+ return (+ <DeprecatedText2 truncate css={{ width: 200 }}>+ Long long text asdf asdf asdfasdf asdfasdf asdfasdfasdfasf+ </DeprecatedText2>+ );+};diff --git a/packages/design-system/src/components/__DEPRECATED__/text.tsx b/packages/design-system/src/components/__DEPRECATED__/text.tsxindex 00b7233b92..19102d1acd 100644--- a/packages/design-system/src/components/__DEPRECATED__/text.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/text.tsx@@ -13,37 +13,37 @@ export const DeprecatedText = styled("div", {variants: {size: {"1": {- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],},"2": {- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],},"3": {- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],},"4": {- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],},"5": {- fontSize: theme.fontSize[5],+ fontSize: theme.deprecatedFontSize[5],letterSpacing: "-.015em",},"6": {- fontSize: theme.fontSize[6],+ fontSize: theme.deprecatedFontSize[6],letterSpacing: "-.016em",},"7": {- fontSize: theme.fontSize[7],+ fontSize: theme.deprecatedFontSize[7],letterSpacing: "-.031em",textIndent: "-.005em",},"8": {- fontSize: theme.fontSize[8],+ fontSize: theme.deprecatedFontSize[8],letterSpacing: "-.034em",textIndent: "-.018em",},"9": {- fontSize: theme.fontSize[9],+ fontSize: theme.deprecatedFontSize[9],letterSpacing: "-.055em",textIndent: "-.025em",},diff --git a/packages/design-system/src/components/text.tsx b/packages/design-system/src/components/__DEPRECATED__/text2.tsxsimilarity index 77%rename from packages/design-system/src/components/text.tsxrename to packages/design-system/src/components/__DEPRECATED__/text2.tsxindex 80d36b8557..fc166396cf 100644--- a/packages/design-system/src/components/text.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/text2.tsx@@ -1,6 +1,6 @@-import { css, styled, theme } from "../stitches.config";+import { css, styled, theme } from "../../stitches.config";-export const textStyles = css({+export const deprecatedTextStyles = css({// Resetmargin: 0,lineHeight: 1,@@ -10,38 +10,38 @@ export const textStyles = css({variant: {regular: {fontWeight: 400,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],letterSpacing: "0.005em",},label: {fontWeight: 500,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],letterSpacing: "0.005em",},small: {fontWeight: 400,- fontSize: theme.fontSize[2],+ fontSize: theme.deprecatedFontSize[2],letterSpacing: "0.01em",},tiny: {fontWeight: 400,- fontSize: theme.fontSize[1],+ fontSize: theme.deprecatedFontSize[1],letterSpacing: "0.01em",},title: {fontWeight: 700,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],letterSpacing: "0.01em",},mono: {fontFamily: theme.fonts.mono,fontWeight: 400,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],textTransform: "uppercase",},unit: {fontWeight: 500,- fontSize: theme.fontSize[2],+ fontSize: theme.deprecatedFontSize[2],textTransform: "uppercase",},},@@ -96,4 +96,4 @@ export const textStyles = css({/*** For use as a standalone, single-line text element. If you need a multiline element - use Paragraph.*/-export const Text = styled("div", textStyles);+export const DeprecatedText2 = styled("div", deprecatedTextStyles);diff --git a/packages/design-system/src/components/avatar.tsx b/packages/design-system/src/components/avatar.tsxindex 6a2a62a0ea..5530375c37 100644--- a/packages/design-system/src/components/avatar.tsx+++ b/packages/design-system/src/components/avatar.tsx@@ -202,23 +202,23 @@ const StyledAvatarFallback = styled(AvatarPrimitive.Fallback, {variants: {size: {"1": {- fontSize: theme.fontSize[2],+ fontSize: theme.deprecatedFontSize[2],lineHeight: theme.lineHeight[3],},"2": {- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],},"3": {- fontSize: theme.fontSize[6],+ fontSize: theme.deprecatedFontSize[6],},"4": {- fontSize: theme.fontSize[7],+ fontSize: theme.deprecatedFontSize[7],},"5": {- fontSize: theme.fontSize[8],+ fontSize: theme.deprecatedFontSize[8],},"6": {- fontSize: theme.fontSize[9],+ fontSize: theme.deprecatedFontSize[9],},},},diff --git a/packages/design-system/src/components/button.tsx b/packages/design-system/src/components/button.tsxindex 3b29f3f7ad..197325a2f7 100644--- a/packages/design-system/src/components/button.tsx+++ b/packages/design-system/src/components/button.tsx@@ -9,7 +9,7 @@ import {type ComponentProps,type ReactNode,} from "react";-import { typography } from "./typography";+import { textVariants } from "./text";import { styled, theme } from "../stitches.config";const colors = [@@ -105,7 +105,7 @@ const StyledButton = styled("button", {},});-const TextContainer = styled("span", typography.labelTitleCase, {+const TextContainer = styled("span", textVariants.labelTitleCase, {padding: `0 ${theme.spacing[2]}`,});diff --git a/packages/design-system/src/components/dialog.stories.tsx b/packages/design-system/src/components/dialog.stories.tsxindex 94c1c2e5fb..934e42eb84 100644--- a/packages/design-system/src/components/dialog.stories.tsx+++ b/packages/design-system/src/components/dialog.stories.tsx@@ -1,6 +1,6 @@import { Button } from "./button";import { css, theme } from "../stitches.config";-import { typography } from "./typography";+import { textVariants } from "./text";import {Dialog,DialogClose,@@ -18,7 +18,7 @@ const bodyStyles = css({padding: theme.spacing[9],});-const descriptionStyles = css(typography.regular, {+const descriptionStyles = css(textVariants.regular, {marginTop: 0,marginBottom: theme.spacing[9],});diff --git a/packages/design-system/src/components/dialog.tsx b/packages/design-system/src/components/dialog.tsxindex 6c73d600f8..9f6c2978bc 100644--- a/packages/design-system/src/components/dialog.tsx+++ b/packages/design-system/src/components/dialog.tsx@@ -1,6 +1,6 @@import React, { type ReactNode, type ComponentProps, type Ref } from "react";import * as Primitive from "@radix-ui/react-dialog";-import { css, theme, keyframes } from "../stitches.config";+import { css, theme, keyframes, type CSS } from "../stitches.config";import { Title } from "./title";import { floatingPanelStyles, CloseButton, TitleSlot } from "./floating-panel";@@ -17,14 +17,19 @@ export const DialogDescription = Primitive.Description;export const DialogContent = React.forwardRef((- { children, className, ...props }: ComponentProps<typeof Primitive.Content>,+ {+ children,+ className,+ css,+ ...props+ }: ComponentProps<typeof Primitive.Content> & { css?: CSS },forwardedRef: Ref<HTMLDivElement>) => {return (<Primitive.Portal><Primitive.Overlay className={overlayStyles()} /><Primitive.Content- className={contentStyles({ className })}+ className={contentStyles({ className, css })}{...props}ref={forwardedRef}>diff --git a/packages/design-system/src/components/floating-panel-popover.stories.tsx b/packages/design-system/src/components/floating-panel-popover.stories.tsxindex 3397d8ba19..545a747a8a 100644--- a/packages/design-system/src/components/floating-panel-popover.stories.tsx+++ b/packages/design-system/src/components/floating-panel-popover.stories.tsx@@ -1,6 +1,6 @@import { Button } from "./button";import { css, theme } from "../stitches.config";-import { typography } from "./typography";+import { textVariants } from "./text";import {FloatingPanelPopover,FloatingPanelPopoverClose,@@ -17,7 +17,7 @@ const bodyStyles = css({padding: theme.spacing[9],});-const descriptionStyles = css(typography.regular, {+const descriptionStyles = css(textVariants.regular, {marginTop: 0,marginBottom: theme.spacing[9],});diff --git a/packages/design-system/src/components/floating-panel-popover.tsx b/packages/design-system/src/components/floating-panel-popover.tsxindex dc882d9830..8883f6eae1 100644--- a/packages/design-system/src/components/floating-panel-popover.tsx+++ b/packages/design-system/src/components/floating-panel-popover.tsx@@ -1,6 +1,6 @@import React, { type ComponentProps, type Ref, type ReactNode } from "react";import * as Primitive from "@radix-ui/react-popover";-import { css, theme } from "../stitches.config";+import { css, theme, type CSS } from "../stitches.config";import { Title } from "./title";import { floatingPanelStyles, CloseButton, TitleSlot } from "./floating-panel";@@ -13,14 +13,19 @@ const contentStyles = css(floatingPanelStyles, {export const FloatingPanelPopoverContent = React.forwardRef((- { children, className, ...props }: ComponentProps<typeof Primitive.Content>,+ {+ children,+ className,+ css,+ ...props+ }: ComponentProps<typeof Primitive.Content> & { css?: CSS },ref: Ref<HTMLDivElement>) => (<Primitive.Portal><Primitive.ContentsideOffset={4}collisionPadding={4}- className={contentStyles({ className })}+ className={contentStyles({ className, css })}{...props}ref={ref}>diff --git a/packages/design-system/src/components/label.tsx b/packages/design-system/src/components/label.tsxindex bfd3b6fe00..11eec19ce4 100644--- a/packages/design-system/src/components/label.tsx+++ b/packages/design-system/src/components/label.tsx@@ -5,10 +5,10 @@import type { ComponentProps, ReactNode, Ref } from "react";import { forwardRef } from "react";-import { typography } from "../__generated__/figma-design-tokens";+import { textVariants } from "./text";import { styled, theme } from "../stitches.config";-const StyledLabel = styled("label", typography.labelSentenceCase, {+const StyledLabel = styled("label", textVariants.labelSentenceCase, {boxSizing: "border-box",flexShrink: 0,py: theme.spacing[2],diff --git a/packages/design-system/src/components/list.tsx b/packages/design-system/src/components/list.tsxindex 94b5a34230..c72acf9333 100644--- a/packages/design-system/src/components/list.tsx+++ b/packages/design-system/src/components/list.tsx@@ -6,7 +6,7 @@ import {} from "react";import { styled } from "../stitches.config";import { Flex } from "./flex";-import { Text } from "./text";+import { DeprecatedText2 } from "./__DEPRECATED__/text2";import { theme } from "../stitches.config";const ListBase = styled("ul", {@@ -67,13 +67,13 @@ export const ListItem = forwardRef<>{prefix}<Flex css={{ gridColumn: 2 }} align="center">- <Text+ <DeprecatedText2variant="label"truncatecolor={state === "disabled" ? "hint" : "contrast"}>{children}- </Text>+ </DeprecatedText2>{suffix}</Flex></ListItemBase>diff --git a/packages/design-system/src/components/menu.tsx b/packages/design-system/src/components/menu.tsxindex 9628d490c0..248f4062dc 100644--- a/packages/design-system/src/components/menu.tsx+++ b/packages/design-system/src/components/menu.tsx@@ -17,14 +17,14 @@*/import { css, styled, theme } from "../stitches.config";-import { typography } from "./typography";+import { textVariants } from "./text";import {Arrow as BaseDropdownMenuArrow,SubContent,} from "@radix-ui/react-dropdown-menu";import { type ComponentProps } from "react";-export const labelCss = css(typography.title, {+export const labelCss = css(textVariants.title, {color: theme.colors.foregroundMain,mx: theme.spacing[3],padding: theme.spacing[3],@@ -42,7 +42,7 @@ export const itemIndicatorCss = css({});const itemMargin = theme.spacing[3];-export const itemCss = css(typography.labelTitleCase, {+export const itemCss = css(textVariants.labelTitleCase, {outline: "none",cursor: "default",position: "relative",diff --git a/packages/design-system/src/components/popover.stories.tsx b/packages/design-system/src/components/popover.stories.tsxindex d8874b1962..d4a6cfe1ef 100644--- a/packages/design-system/src/components/popover.stories.tsx+++ b/packages/design-system/src/components/popover.stories.tsx@@ -1,5 +1,5 @@import { Button } from "./button";-import { typography } from "./typography";+import { Text } from "./text";import {Popover,PopoverClose,@@ -22,7 +22,7 @@ const PopoverDemo = () => (</PopoverTrigger><PopoverContent><PopoverContentContainer>- <div className={typography.regular()}>Some content</div>+ <Text>Some content</Text></PopoverContentContainer><PopoverSeparator /><PopoverMenuItemContainer>diff --git a/packages/design-system/src/components/popover.tsx b/packages/design-system/src/components/popover.tsxindex 2e596f1534..00460f1fee 100644--- a/packages/design-system/src/components/popover.tsx+++ b/packages/design-system/src/components/popover.tsx@@ -1,6 +1,6 @@import React, { type ComponentProps, type Ref } from "react";import * as Primitive from "@radix-ui/react-popover";-import { css, theme, styled } from "../stitches.config";+import { css, theme, styled, type CSS } from "../stitches.config";import { Separator } from "./separator";export const Popover = Primitive.Root;@@ -39,16 +39,20 @@ export const PopoverContent = React.forwardRef({children,className,+ css,hideArrow,...props- }: ComponentProps<typeof Primitive.Content> & { hideArrow?: boolean },+ }: ComponentProps<typeof Primitive.Content> & {+ hideArrow?: boolean;+ css?: CSS;+ },ref: Ref<HTMLDivElement>) => (<Primitive.Portal><Primitive.ContentsideOffset={4}collisionPadding={4}- className={contentStyles({ className })}+ className={contentStyles({ className, css })}{...props}ref={ref}>diff --git a/packages/design-system/src/components/select.tsx b/packages/design-system/src/components/select.tsxindex 3cf2cb7b9f..16b417e43f 100644--- a/packages/design-system/src/components/select.tsx+++ b/packages/design-system/src/components/select.tsx@@ -28,7 +28,7 @@ const StyledTrigger = styled(SelectPrimitive.Trigger, {boxShadow: `inset 0 0 0 1px ${theme.colors.slate7}`,height: 28, // @todo waiting for the sizing scalepx: theme.spacing[5],- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],"&:focus": {boxShadow: `inset 0px 0px 0px 1px ${theme.colors.blue8}, 0px 0px 0px 1px ${theme.colors.blue8}`,},diff --git a/packages/design-system/src/components/storybook.tsx b/packages/design-system/src/components/storybook.tsxindex dd4e551c21..ee32393a82 100644--- a/packages/design-system/src/components/storybook.tsx+++ b/packages/design-system/src/components/storybook.tsx@@ -4,7 +4,7 @@import { type ReactNode } from "react";import { theme, css } from "../stitches.config";-import { typography } from "./typography";+import { textVariants } from "./text";const sectionStyle = css({marginBottom: theme.spacing[10],@@ -18,7 +18,7 @@ const sectionStyle = css({},},});-const titleStyle = css(typography.title, {+const titleStyle = css(textVariants.title, {marginTop: 0,marginBottom: theme.spacing[5],color: theme.colors.foregroundMain,diff --git a/packages/design-system/src/components/tabs.tsx b/packages/design-system/src/components/tabs.tsxindex 85e80638af..ff8cf1bfa1 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 { DeprecatedText2 } from "./__DEPRECATED__/text2";import { theme } from "../stitches.config";export const Tabs = styled(TabsPrimitive.Root, {@@ -17,7 +17,7 @@ export const TabsTrigger = styled(TabsPrimitive.Trigger, {display: "inline-flex",lineHeight: 1,fontFamily: "inherit",- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],px: theme.spacing[5],userSelect: "none",outline: "none",@@ -28,9 +28,9 @@ export const TabsTrigger = styled(TabsPrimitive.Trigger, {["&:first-child"]: {paddingLeft: theme.spacing[9],},- [`& > ${Text}`]: {+ [`& > ${DeprecatedText2}`]: {color: theme.colors.gray9,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],fontWeight: "500",},"@hover": {@@ -40,7 +40,7 @@ export const TabsTrigger = styled(TabsPrimitive.Trigger, {},'&[data-state="active"]': {- [`& > ${Text}`]: {+ [`& > ${DeprecatedText2}`]: {color: theme.colors.hiContrast,},},diff --git a/packages/design-system/src/components/text-area.tsx b/packages/design-system/src/components/text-area.tsxindex bd3fddf91e..d9e5abbf2d 100644--- a/packages/design-system/src/components/text-area.tsx+++ b/packages/design-system/src/components/text-area.tsx@@ -46,19 +46,19 @@ export const TextArea = styled("textarea", {size: {"1": {borderRadius: theme.borderRadius[4],- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],lineHeight: theme.lineHeight[3],px: theme.spacing[3],},"2": {borderRadius: theme.borderRadius[4],- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],lineHeight: theme.lineHeight[4],px: theme.spacing[3],},"3": {borderRadius: theme.borderRadius[6],- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],lineHeight: "23px",px: theme.spacing[5],},diff --git a/packages/design-system/src/components/text-field.stories.tsx b/packages/design-system/src/components/text-field.stories.tsxindex 203ac23f3d..5d3fb395a5 100644--- a/packages/design-system/src/components/text-field.stories.tsx+++ b/packages/design-system/src/components/text-field.stories.tsx@@ -9,7 +9,7 @@ import { DeprecatedIconButton } from "./__DEPRECATED__/icon-button";import { TextField } from "./text-field";import { Box } from "./box";import { Grid } from "./grid";-import { Text } from "./text";+import { DeprecatedText2 } from "./__DEPRECATED__/text2";import { theme } from "../stitches.config";export default {@@ -125,9 +125,9 @@ export const Layout: ComponentStory<typeof TextField> = () => {}}><Box css={{ background: theme.colors.muted }}>- <Text as="label" htmlFor="field">+ <DeprecatedText2 as="label" htmlFor="field">This is a label- </Text>+ </DeprecatedText2></Box><Box css={{ background: theme.colors.muted }}><TextField@@ -137,9 +137,9 @@ export const Layout: ComponentStory<typeof TextField> = () => {/></Box><Box css={{ background: theme.colors.muted }}>- <Text as="label" htmlFor="field2">+ <DeprecatedText2 as="label" htmlFor="field2">This is a label- </Text>+ </DeprecatedText2></Box><TextFieldid="field2"diff --git a/packages/design-system/src/components/text-field.tsx b/packages/design-system/src/components/text-field.tsxindex 34a22f4d11..26de996356 100644--- a/packages/design-system/src/components/text-field.tsx+++ b/packages/design-system/src/components/text-field.tsx@@ -152,7 +152,7 @@ export const TextFieldContainer = styled("div", {px: theme.spacing[4],borderRadius: theme.borderRadius[4],fontFamily: theme.fonts.sans,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],minHeight: theme.spacing[12],lineHeight: 1,minWidth: 0,diff --git a/packages/design-system/src/components/text.stories.tsx b/packages/design-system/src/components/text.stories.tsxindex 71342a6968..6d7b493ba1 100644--- a/packages/design-system/src/components/text.stories.tsx+++ b/packages/design-system/src/components/text.stories.tsx@@ -1,34 +1,21 @@-import { ComponentStory } from "@storybook/react";-import { Text } from "./text";+import { textVariants, Text } from "./text";+import { StorySection } from "./storybook";-export default {- component: Text,-};+const variants = Object.keys(textVariants) as (keyof typeof textVariants)[];-export const Regular: ComponentStory<typeof Text> = () => {- return <Text>Regular text</Text>;-};--export const Label: ComponentStory<typeof Text> = () => {- return <Text variant="label">Label text</Text>;-};+const Story = () => (+ <>+ {variants.map((variant) => (+ <StorySection withBorder key={variant} title={variant}>+ <Text variant={variant}>+ The quick brown fox jumps over the lazy dog+ </Text>+ </StorySection>+ ))}+ </>+);+export { Story as Text };-export const Tiny: ComponentStory<typeof Text> = () => {- return <Text variant="tiny">Tiny text</Text>;-};-export const Title: ComponentStory<typeof Text> = () => {- return <Text variant="title">Title text</Text>;-};-export const Mono: ComponentStory<typeof Text> = () => {- return <Text variant="mono">Mono text</Text>;-};-export const Unit: ComponentStory<typeof Text> = () => {- return <Text variant="unit">Unit text</Text>;-};-export const Truncated: ComponentStory<typeof Text> = () => {- return (- <Text truncate css={{ width: 200 }}>- Long long text asdf asdf asdfasdf asdfasdf asdfasdfasdfasf- </Text>- );+export default {+ title: "Components/Text",};diff --git a/packages/design-system/src/components/text.ts b/packages/design-system/src/components/text.tsnew file mode 100644index 0000000000..88cec0012f--- /dev/null+++ b/packages/design-system/src/components/text.ts@@ -0,0 +1,42 @@+import { css, theme, styled } from "../stitches.config";+import { typography as textVariants } from "../__generated__/figma-design-tokens";++export { textVariants };++export const textStyles = css({+ margin: 0, // in case it's used with <p>+ variants: {+ variant: textVariants,+ color: {+ main: { color: theme.colors.foregroundMain },+ contrast: { color: theme.colors.foregroundContrastMain },+ subtle: { color: theme.colors.foregroundSubtle },+ disabled: { color: theme.colors.foregroundDisabled },+ destructive: { color: theme.colors.foregroundDestructive },+ },+ align: {+ left: { textAlign: "left" },+ center: { textAlign: "center" },+ right: { textAlign: "right" },+ },+ truncate: {+ true: {+ whiteSpace: "nowrap",+ textOverflow: "ellipsis",+ overflow: "hidden",++ // To make sure text is not clipped vertically+ pt: "0.5em",+ pb: "0.5em",+ mt: "-0.5em",+ mb: "-0.5em",++ flexBasis: 0,+ flexGrow: 1,+ },+ },+ },+ defaultVariants: { variant: "regular" },+});++export const Text = styled("div", textStyles);diff --git a/packages/design-system/src/components/title.tsx b/packages/design-system/src/components/title.tsxindex f296a56408..ee80642e6a 100644--- a/packages/design-system/src/components/title.tsx+++ b/packages/design-system/src/components/title.tsx@@ -5,7 +5,7 @@import { forwardRef, type ReactNode, type Ref } from "react";import { theme, styled, type CSS } from "../stitches.config";-import { typography } from "./typography";+import { textVariants } from "./text";type TitleProps = {children: ReactNode;@@ -14,7 +14,7 @@ type TitleProps = {css?: CSS;};-const Container = styled("div", typography.title, {+const Container = styled("div", textVariants.title, {display: "flex",alignItems: "center",justifyContent: "space-between",diff --git a/packages/design-system/src/components/toast.tsx b/packages/design-system/src/components/toast.tsxindex bcab3884cd..2eba1d6596 100644--- a/packages/design-system/src/components/toast.tsx+++ b/packages/design-system/src/components/toast.tsx@@ -53,7 +53,7 @@ const StyledToast = styled(ToastPrimitive.Root, {alignItems: "center",color: theme.colors.hiContrast,fontWeight: 500,- fontSize: theme.fontSize[3],+ fontSize: theme.deprecatedFontSize[3],background: theme.colors.loContrast,"@media (prefers-reduced-motion: no-preference)": {diff --git a/packages/design-system/src/components/toggle-group.tsx b/packages/design-system/src/components/toggle-group.tsxindex 2b57856c44..69555caef2 100644--- a/packages/design-system/src/components/toggle-group.tsx+++ b/packages/design-system/src/components/toggle-group.tsx@@ -16,7 +16,7 @@ export const ToggleGroupItem = styled(ToggleGroupPrimitive.Item, {color: theme.colors.hiContrast,display: "flex",whiteSpace: "nowrap",- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],lineHeight: 1,alignItems: "center",justifyContent: "center",diff --git a/packages/design-system/src/components/toggle.tsx b/packages/design-system/src/components/toggle.tsxindex fd021d934a..cf8029dd65 100644--- a/packages/design-system/src/components/toggle.tsx+++ b/packages/design-system/src/components/toggle.tsx@@ -11,7 +11,7 @@ export const Toggle = styled(TogglePrimitive.Root, {display: "inline-flex",flexShrink: 0,fontFamily: "inherit",- fontSize: theme.fontSize[4],+ fontSize: theme.deprecatedFontSize[4],justifyContent: "center",lineHeight: "1",outline: "none",diff --git a/packages/design-system/src/components/tooltip.tsx b/packages/design-system/src/components/tooltip.tsxindex 0f28579b06..3325098138 100644--- a/packages/design-system/src/components/tooltip.tsx+++ b/packages/design-system/src/components/tooltip.tsx@@ -2,7 +2,7 @@ import React, { Ref, Fragment, type ComponentProps } from "react";import { styled } from "../stitches.config";import * as TooltipPrimitive from "@radix-ui/react-tooltip";import { Box } from "./box";-import { Paragraph } from "./paragraph";+import { DeprecatedParagraph } from "./__DEPRECATED__/paragraph";import type { CSS } from "../stitches.config";import { theme } from "../stitches.config";@@ -81,7 +81,7 @@ export const Tooltip = React.forwardRef(sideOffset={5}{...props}>- <Paragraph>{content}</Paragraph>+ <DeprecatedParagraph>{content}</DeprecatedParagraph><Box css={{ color: theme.colors.transparentExtreme }}><Arrow offset={5} width={11} height={5} /></Box>diff --git a/packages/design-system/src/components/tree/tree-node.tsx b/packages/design-system/src/components/tree/tree-node.tsxindex e0e2b3685f..d8121c5fdb 100644--- a/packages/design-system/src/components/tree/tree-node.tsx+++ b/packages/design-system/src/components/tree/tree-node.tsx@@ -4,7 +4,7 @@ import { cssVars } from "@webstudio-is/css-vars";import { Box } from "../box";import * as Collapsible from "@radix-ui/react-collapsible";import { Flex } from "../flex";-import { Text } from "../text";+import { DeprecatedText2 } from "../__DEPRECATED__/text2";import { keyframes, styled } from "../../stitches.config";import { theme } from "../../stitches.config";@@ -341,9 +341,9 @@ export const TreeItemLabel = ({}) => (<>{prefix}- <Text truncate css={{ ml: prefix ? theme.spacing[3] : 0 }}>+ <DeprecatedText2 truncate css={{ ml: prefix ? theme.spacing[3] : 0 }}>{children}- </Text>+ </DeprecatedText2></>);diff --git a/packages/design-system/src/components/typography.stories.tsx b/packages/design-system/src/components/typography.stories.tsxdeleted file mode 100644index cdfe0e72a8..0000000000--- a/packages/design-system/src/components/typography.stories.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { typography } from "./typography";-import { StorySection } from "./storybook";--export const Typography = () => (- <>- {Object.entries(typography).map(([key, value]) => (- <StorySection withBorder key={key} title={key}>- <div className={value()}>- The quick brown fox jumps over the lazy dog- </div>- </StorySection>- ))}- </>-);--export default {- title: "Components/Typography",- component: Typography,-};diff --git a/packages/design-system/src/components/typography.ts b/packages/design-system/src/components/typography.tsdeleted file mode 100644index 28f44a1607..0000000000--- a/packages/design-system/src/components/typography.ts+++ /dev/null@@ -1,15 +0,0 @@-import { css } from "../stitches.config";-import { typography as figmaTypography } from "../__generated__/figma-design-tokens";--type TypographyCss = Record<- keyof typeof figmaTypography,- ReturnType<typeof css>->;--const partialTypography: Partial<TypographyCss> = {};-const keys = Object.keys(figmaTypography) as (keyof typeof figmaTypography)[];-for (const key of keys) {- partialTypography[key] = css(figmaTypography[key]);-}--export const typography = partialTypography as TypographyCss;diff --git a/packages/design-system/src/index.ts b/packages/design-system/src/index.tsindex 377caefc0d..8c380395ba 100644--- a/packages/design-system/src/index.ts+++ b/packages/design-system/src/index.ts@@ -3,7 +3,7 @@ export * from "./components/storybook";// Aligned with Figma-export * from "./components/typography";+export * from "./components/text";export * from "./components/title";export * from "./components/separator";export * from "./components/button";@@ -41,7 +41,6 @@ export {EnhancedTooltipProvider,useEnhancedTooltipProps,} from "./components/enhanced-tooltip";-export { Paragraph } from "./components/paragraph";export { Link } from "./components/link";export { Panel } from "./components/panel";export * from "./components/switch";@@ -51,7 +50,6 @@ export * from "./components/checkbox";export * from "./components/avatar";export * from "./components/icon-button-with-menu";export * from "./components/tree";-export * from "./components/text";export * from "./components/list";// No need to align@@ -67,8 +65,10 @@ export * from "./components/primitives/numeric-gesture-control";// Deprecatedexport * from "./components/__DEPRECATED__/text";+export * from "./components/__DEPRECATED__/text2";export { DeprecatedButton } from "./components/__DEPRECATED__/button";export { DeprecatedIconButton } from "./components/__DEPRECATED__/icon-button";export { DeprecatedHeading } from "./components/__DEPRECATED__/heading";export { DeprecatedLabel } from "./components/__DEPRECATED__/label";export * from "./components/__DEPRECATED__/popover";+export * from "./components/__DEPRECATED__/paragraph";diff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.tsindex dd984d5595..ceac24bda7 100644--- a/packages/design-system/src/stitches.config.ts+++ b/packages/design-system/src/stitches.config.ts@@ -117,10 +117,7 @@ import {} from "@radix-ui/colors";import type * as Stitches from "@stitches/react";export type { VariantProps } from "@stitches/react";-import {- color as figmaColors,- boxShadow as figmaShadows,-} from "./__generated__/figma-design-tokens";+import * as figma from "./__generated__/figma-design-tokens";const spacing = {0: "0px",@@ -173,8 +170,6 @@ const {} = createStitches({theme: {colors: {- ...figmaColors,-...gray,...mauve,...slate,@@ -251,17 +246,24 @@ const {background: "$slate1",text: "$slate12",transparentExtreme: "transparent",++ ...figma.color,},fonts: {- sans: "InterVariable, -apple-system, system-ui, sans-serif",- mono: "Roboto, menlo, monospace",- manrope: "ManropeVariable, sans-serif",+ ...figma.fontFamilies,+ sans: figma.fontFamilies.inter,+ mono: figma.fontFamilies.robotoMono,},+ fontSize: figma.fontSizes,+ lineHeight: figma.lineHeights,+ fontWeight: figma.fontWeights,+ letterSpacing: figma.letterSpacing,+opacity: {1: "0.4",},spacing,- fontSize: {+ deprecatedFontSize: {1: "8px",2: "10px",3: "12px",@@ -273,7 +275,7 @@ const {8: "35px",9: "59px",},- lineHeight: {+ deprecatedLineHeight: {1: "8px",2: "12px",3: "16px",@@ -303,7 +305,7 @@ const {easeOutQuart: "cubic-bezier(0.25, 1, 0.5, 1)",easeOut: "cubic-bezier(0.16, 1, 0.3, 1)",},- shadows: figmaShadows,+ shadows: figma.boxShadow,},media: {tablet: "(min-width: 768px)",diff --git a/packages/storybook-config/package.json b/packages/storybook-config/package.jsonindex 615c68c7ed..6f94bb147c 100644--- a/packages/storybook-config/package.json+++ b/packages/storybook-config/package.json@@ -6,7 +6,7 @@"dependencies": {"@fontsource/inter": "^4.5.15","@fontsource/manrope": "^4.5.13",- "@fontsource/roboto": "^4.5.8",+ "@fontsource/roboto-mono": "^4.5.10","@storybook/addon-essentials": "^6.5.14","@storybook/addon-interactions": "^6.5.14","@storybook/addon-links": "^6.5.14",diff --git a/packages/storybook-config/setup-fonts.js b/packages/storybook-config/setup-fonts.jsindex 9fd8313fef..183c6ee65b 100644--- a/packages/storybook-config/setup-fonts.js+++ b/packages/storybook-config/setup-fonts.js@@ -6,4 +6,4 @@// this adds <style> tags to the <head> of the documentrequire("@fontsource/inter/variable.css");require("@fontsource/manrope/variable.css");-require("@fontsource/roboto");+require("@fontsource/roboto-mono");diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex de656f96a9..405f358571 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -46,6 +46,7 @@ importers:'@floating-ui/dom': ^1.0.6'@fontsource/inter': ^4.5.15'@fontsource/manrope': ^4.5.13+ '@fontsource/roboto-mono': ^4.5.10'@jest/globals': ^29.3.1'@lexical/link': ^0.6.0'@lexical/react': ^0.6.0@@ -160,6 +161,7 @@ importers:'@floating-ui/dom': 1.0.6'@fontsource/inter': 4.5.15'@fontsource/manrope': 4.5.13+ '@fontsource/roboto-mono': 4.5.10'@lexical/link': [email protected]'@lexical/react': 0.6.0_p7mvqmjvwf4nexue7sv3sfptum'@lexical/selection': [email protected]@@ -936,7 +938,7 @@ importers:specifiers:'@fontsource/inter': ^4.5.15'@fontsource/manrope': ^4.5.13- '@fontsource/roboto': ^4.5.8+ '@fontsource/roboto-mono': ^4.5.10'@storybook/addon-essentials': ^6.5.14'@storybook/addon-interactions': ^6.5.14'@storybook/addon-links': ^6.5.14@@ -945,7 +947,7 @@ importers:dependencies:'@fontsource/inter': 4.5.15'@fontsource/manrope': 4.5.13- '@fontsource/roboto': 4.5.8+ '@fontsource/roboto-mono': 4.5.10'@storybook/addon-essentials': 6.5.14_giwchv74co2s2fgcqn7wwzn5ie'@storybook/addon-interactions': 6.5.14'@storybook/addon-links': 6.5.14@@ -5466,8 +5468,8 @@ packages:resolution: {integrity: sha512-UFN5DMGBp8nFpwhPQXfpSbsEm4OVISqUKQy+rA+pb1zYGoH+OGN1woKEND8VLx+pC7rY3nrPRCJvSuuOaNdW7Q==}dev: false- /@fontsource/roboto/4.5.8:- resolution: {integrity: sha512-CnD7zLItIzt86q4Sj3kZUiLcBk1dSk81qcqgMGaZe7SQ1P8hFNxhMl5AZthK1zrDM5m74VVhaOpuMGIL4gagaA==}+ /@fontsource/roboto-mono/4.5.10:+ resolution: {integrity: sha512-KrJdmkqz6DszT2wV/bbhXef4r0hV3B0vw2mAqei8A2kRnvq+gcJLmmIeQ94vu9VEXrUQzos5M9lH1TAAXpRphw==}dev: false/@gar/promisify/1.1.3: