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
chore: delete deprecated text and icon button component (#3868)
Oleg Isonen989909118895
diff --git a/apps/builder/app/builder/features/style-panel/sections/layout/shared/flex-grid.tsx b/apps/builder/app/builder/features/style-panel/sections/layout/shared/flex-grid.tsxindex 72772af962..d212345f5e 100644--- a/apps/builder/app/builder/features/style-panel/sections/layout/shared/flex-grid.tsx+++ b/apps/builder/app/builder/features/style-panel/sections/layout/shared/flex-grid.tsx@@ -1,10 +1,5 @@import type { CSSProperties } from "react";-import {- Box,- Flex,- Grid,- DeprecatedIconButton,-} from "@webstudio-is/design-system";+import { Box, Flex, Grid, IconButton } from "@webstudio-is/design-system";import { toValue } from "@webstudio-is/css-engine";import { DotIcon } from "@webstudio-is/icons";import type { CreateBatchUpdate } from "../../../shared/use-style-data";@@ -124,7 +119,7 @@ export const FlexGrid = ({gridRow,}}>- <DeprecatedIconButton+ <IconButtontabIndex={-1}css={{width: "100%",@@ -150,7 +145,7 @@ export const FlexGrid = ({>{shouldHideDot({ x, y, justifyContent, alignItems }) ===false && <DotIcon />}- </DeprecatedIconButton>+ </IconButton></Flex>);})}diff --git a/apps/builder/app/builder/shared/fonts-manager/item-menu.tsx b/apps/builder/app/builder/shared/fonts-manager/item-menu.tsxindex bc0f1eb15b..025c290f42 100644--- a/apps/builder/app/builder/shared/fonts-manager/item-menu.tsx+++ b/apps/builder/app/builder/shared/fonts-manager/item-menu.tsx@@ -2,20 +2,20 @@ import { useStore } from "@nanostores/react";import {DropdownMenu,DropdownMenuTrigger,- DeprecatedIconButton,DropdownMenuContent,DropdownMenuItem,Text,DropdownMenuPortal,styled,Tooltip,+ SmallIconButton,} from "@webstudio-is/design-system";import { EllipsesIcon } from "@webstudio-is/icons";import { type FocusEventHandler, useState, useRef, useEffect } from "react";import { theme } from "@webstudio-is/design-system";import { $authPermit } from "~/shared/nano-states";-const MenuButton = styled(DeprecatedIconButton, {+const MenuButton = styled(SmallIconButton, {color: theme.colors.hint,"&:hover, &:focus-visible": {color: theme.colors.hiContrast,@@ -74,9 +74,8 @@ const ItemMenu = ({// Prevent setting the current font to the item.event.stopPropagation();}}- >- <EllipsesIcon />- </MenuButton>+ icon={<EllipsesIcon />}+ /></DropdownMenuTrigger><DropdownMenuPortal><DropdownMenuContent align="start">diff --git a/apps/builder/app/builder/shared/image-manager/filename.tsx b/apps/builder/app/builder/shared/image-manager/filename.tsxindex 42e0c8f8b5..885f583488 100644--- a/apps/builder/app/builder/shared/image-manager/filename.tsx+++ b/apps/builder/app/builder/shared/image-manager/filename.tsx@@ -1,10 +1,7 @@-import { Flex, DeprecatedText2 } from "@webstudio-is/design-system";+import { Flex, Text } from "@webstudio-is/design-system";import type { ComponentProps } from "react";-type FilenameProps = Omit<- ComponentProps<typeof DeprecatedText2>,- "children"-> & {+type FilenameProps = Omit<ComponentProps<typeof Text>, "children"> & {children: string;};@@ -15,10 +12,10 @@ export const Filename = ({ children, ...props }: FilenameProps) => {return (<Flex>- <DeprecatedText2 truncate {...props}>+ <Text truncate {...props}>{baseName}- </DeprecatedText2>- <DeprecatedText2 {...props}>{extension}</DeprecatedText2>+ </Text>+ <Text {...props}>{extension}</Text></Flex>);};diff --git a/apps/builder/app/builder/shared/image-manager/image-info.tsx b/apps/builder/app/builder/shared/image-manager/image-info.tsxindex 499192c5a6..309d842a1f 100644--- a/apps/builder/app/builder/shared/image-manager/image-info.tsx+++ b/apps/builder/app/builder/shared/image-manager/image-info.tsx@@ -5,7 +5,7 @@ import {Box,Flex,Grid,- DeprecatedText2,+ Text,Button,Tooltip,} from "@webstudio-is/design-system";@@ -39,13 +39,11 @@ export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {<Box css={{ p: `${theme.spacing[5]} ${theme.spacing[9]}` }}><Grid columns={2} align="center" gap={2}><Box css={{ width: 100 }}>- <Filename variant="label">{name}</Filename>+ <Filename variant="labelsSentenceCase">{name}</Filename></Box><Flex align="center" css={{ gap: theme.spacing[3] }}><CloudIcon />- <DeprecatedText2 variant="label">- {prettyBytes(size)}- </DeprecatedText2>+ <Text variant="labelsSentenceCase">{prettyBytes(size)}</Text></Flex></Grid></Box>@@ -54,15 +52,15 @@ export const ImageInfo = ({ asset, onDelete }: ImageInfoProps) => {<Grid columns={2} gap={2} align="center"><Flex align="center" css={{ gap: theme.spacing[3] }}><SizeIcon />- <DeprecatedText2 variant="label">+ <Text variant="labelsSentenceCase">{meta.width} x {meta.height}- </DeprecatedText2>+ </Text></Flex>{" "}<Flex align="center" css={{ gap: theme.spacing[3] }}><AspectRatioIcon />- <DeprecatedText2 variant="label">+ <Text variant="labelsSentenceCase">{getFormattedAspectRatio(meta)}- </DeprecatedText2>+ </Text></Flex></Grid></Box>diff --git a/packages/design-system/src/components/__DEPRECATED__/icon-button.tsx b/packages/design-system/src/components/__DEPRECATED__/icon-button.tsxdeleted file mode 100644index 6f91c5b716..0000000000--- a/packages/design-system/src/components/__DEPRECATED__/icon-button.tsx+++ /dev/null@@ -1,74 +0,0 @@-import { styled } from "../../stitches.config";-import { theme } from "../../stitches.config";--export const DeprecatedIconButton = styled("button", {- // Reset- alignItems: "center",- appearance: "none",- borderWidth: "0",- boxSizing: "border-box",- display: "inline-flex",- flexShrink: 0,- fontFamily: "inherit",- fontSize: theme.deprecatedFontSize[4],- justifyContent: "center",- lineHeight: "1",- padding: 0,- textDecoration: "none",- userSelect: "none",- WebkitTapHighlightColor: "transparent",- color: theme.colors.hiContrast,- background: "none",- outline: "2px solid transparent",- outlineOffset: 2,- "&::before, &::after": {- boxSizing: "border-box",- },- "&:hover, &:active": {- backgroundColor: theme.colors.slate6,- outline: "none",- },- "&:focus-visible": {- backgroundColor: theme.colors.slate6,- outline: "none",- border: "2px solid white",- boxShadow: `0px 0px 0px 2px ${theme.colors.blue10}, 0px 0px 0px 2px ${theme.colors.blue10}`,- },- "&:disabled": {- pointerEvents: "none",- backgroundColor: "transparent",- color: theme.colors.slate6,- },-- variants: {- size: {- "1": {- borderRadius: 2,- height: theme.spacing[9],- width: theme.spacing[9],- "&:hover, &:focus-visible": {- background: "none",- border: "none",- },- },- "2": {- borderRadius: theme.borderRadius[4],- height: theme.spacing[13],- width: theme.spacing[13],- },- "3": {- borderRadius: theme.borderRadius[4],- height: theme.spacing[17],- width: theme.spacing[17],- },- "4": {- borderRadius: theme.borderRadius[6],- height: theme.spacing[19],- width: theme.spacing[19],- },- },- },- defaultVariants: {- size: "1",- },-});diff --git a/packages/design-system/src/components/__DEPRECATED__/list.tsx b/packages/design-system/src/components/__DEPRECATED__/list.tsxindex d19d213e71..d74954e30e 100644--- a/packages/design-system/src/components/__DEPRECATED__/list.tsx+++ b/packages/design-system/src/components/__DEPRECATED__/list.tsx@@ -4,7 +4,7 @@ import {forwardRef,type KeyboardEvent,} from "react";-import { DeprecatedText2 } from "./text2";+import { Text } from "../text";import { Flex } from "../flex";import { styled, theme } from "../../stitches.config";@@ -73,14 +73,18 @@ export const DeprecatedListItem = forwardRef<{...props}>{prefix}- <Flex css={{ gridColumn: 2, cursor: "default" }} align="center">- <DeprecatedText2- variant="label"+ <Flex+ css={{ gridColumn: 2, cursor: "default" }}+ align="center"+ justify="between"+ >+ <Text+ variant="labelsSentenceCase"truncate- color={state === "disabled" ? "hint" : "contrast"}+ color={state === "disabled" ? "disabled" : "main"}>{children}- </DeprecatedText2>+ </Text>{suffix}</Flex></ListItemBase>diff --git a/packages/design-system/src/components/__DEPRECATED__/text.stories.tsx b/packages/design-system/src/components/__DEPRECATED__/text.stories.tsxdeleted file mode 100644index d5fed91b29..0000000000--- a/packages/design-system/src/components/__DEPRECATED__/text.stories.tsx+++ /dev/null@@ -1,34 +0,0 @@-import type { StoryFn } from "@storybook/react";-import { DeprecatedText2 } from "./text2";--export default {- component: DeprecatedText2,-};--export const Regular: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2>Regular text</DeprecatedText2>;-};--export const Label: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2 variant="label">Label text</DeprecatedText2>;-};--export const Tiny: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2 variant="tiny">Tiny text</DeprecatedText2>;-};-export const Title: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2 variant="title">Title text</DeprecatedText2>;-};-export const Mono: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2 variant="mono">Mono text</DeprecatedText2>;-};-export const Unit: StoryFn<typeof DeprecatedText2> = () => {- return <DeprecatedText2 variant="unit">Unit text</DeprecatedText2>;-};-export const Truncated: StoryFn<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__/text2.tsx b/packages/design-system/src/components/__DEPRECATED__/text2.tsxdeleted file mode 100644index 4c57017dd8..0000000000--- a/packages/design-system/src/components/__DEPRECATED__/text2.tsx+++ /dev/null@@ -1,99 +0,0 @@-import { css, styled, theme } from "../../stitches.config";--const deprecatedTextStyle = css({- // Reset- margin: 0,- lineHeight: 1,- fontFamily: theme.fonts.sans,-- variants: {- variant: {- regular: {- fontWeight: 400,- fontSize: theme.deprecatedFontSize[3],- letterSpacing: "0.005em",- },- label: {- fontWeight: 500,- fontSize: theme.deprecatedFontSize[3],- letterSpacing: "0.005em",- },- small: {- fontWeight: 400,- fontSize: theme.deprecatedFontSize[2],- letterSpacing: "0.01em",- },- tiny: {- fontWeight: 400,- fontSize: theme.deprecatedFontSize[1],- letterSpacing: "0.01em",- },- title: {- fontWeight: 700,- fontSize: theme.deprecatedFontSize[3],- letterSpacing: "0.01em",- },- mono: {- fontFamily: theme.fonts.mono,- fontWeight: 400,- fontSize: theme.deprecatedFontSize[3],- textTransform: "uppercase",- },- unit: {- fontWeight: 500,- fontSize: theme.deprecatedFontSize[2],- textTransform: "uppercase",- },- },- color: {- contrast: {- color: theme.colors.hiContrast,- },- loContrast: {- color: theme.colors.loContrast,- },- hint: {- color: theme.colors.hint,- },- error: {- color: theme.colors.red10,- },- },- 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",- },-});--/**- * For use as a standalone, single-line text element. If you need a multiline element - use Paragraph.- */-export const DeprecatedText2 = styled("div", deprecatedTextStyle);diff --git a/packages/design-system/src/index.ts b/packages/design-system/src/index.tsindex 031181305f..1708941403 100644--- a/packages/design-system/src/index.ts+++ b/packages/design-system/src/index.ts@@ -84,7 +84,4 @@ export * from "./components/primitives/list";export * from "./components/kbd";// Deprecated--export * from "./components/__DEPRECATED__/text2";-export { DeprecatedIconButton } from "./components/__DEPRECATED__/icon-button";export * from "./components/__DEPRECATED__/list";diff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.tsindex cf4ee0aac2..08ebb5811d 100644--- a/packages/design-system/src/stitches.config.ts+++ b/packages/design-system/src/stitches.config.ts@@ -62,7 +62,6 @@ const { styled, css, getCssText, globalCss, keyframes, config, reset } =slate4: slate.slate4,slate5: slate.slate5,slate7: slate.slate7,- slate6: slate.slate6,slate8: slate.slate8,slate11: slate.slate11,slate12: slate.slate12,@@ -76,7 +75,6 @@ const { styled, css, getCssText, globalCss, keyframes, config, reset } =red4: red.red4,red9: red.red9,red11: red.red11,- red10: red.red10,green3: green.green3,green4: green.green4,green9: green.green9,