Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

chore: delete deprecated button from the design system (#3862)

Oleg Isonen60fbd341e593
diff --git a/apps/builder/app/builder/features/footer/breadcrumbs.tsx b/apps/builder/app/builder/features/footer/breadcrumbs.tsx
index 9ae31dc17f..e9bcd33e50 100644
--- a/apps/builder/app/builder/features/footer/breadcrumbs.tsx
+++ b/apps/builder/app/builder/features/footer/breadcrumbs.tsx
@@ -1,11 +1,6 @@
import { useStore } from "@nanostores/react";
import { ChevronRightIcon } from "@webstudio-is/icons";
-import {
- theme,
- DeprecatedButton,
- Flex,
- Text,
-} from "@webstudio-is/design-system";
+import { theme, Button, Flex, Text } from "@webstudio-is/design-system";
import {
$instances,
$registeredComponentMetas,
@@ -41,14 +36,9 @@ export const Breadcrumbs = () => {
}
return (
<Fragment key={index}>
- <DeprecatedButton
- ghost
- css={{
- px: theme.spacing[5],
- borderRadius: "100vh",
- height: "100%",
- color: "inherit",
- }}
+ <Button
+ color="dark-ghost"
+ css={{ color: "inherit" }}
key={instance.id}
onClick={() => {
$selectedInstanceSelector.set(
@@ -61,7 +51,7 @@ export const Breadcrumbs = () => {
}}
>
{getInstanceLabel(instance, meta)}
- </DeprecatedButton>
+ </Button>
{index < selectedInstanceSelector.length - 1 ? (
<ChevronRightIcon />
) : null}
diff --git a/apps/builder/app/builder/shared/image-manager/image-info-tigger.tsx b/apps/builder/app/builder/shared/image-manager/image-info-tigger.tsx
index c4e6f973a2..3eb0a12bb8 100644
--- a/apps/builder/app/builder/shared/image-manager/image-info-tigger.tsx
+++ b/apps/builder/app/builder/shared/image-manager/image-info-tigger.tsx
@@ -1,11 +1,11 @@
import { useState } from "react";
import {
- DeprecatedButton,
DeprecatedPopover,
DeprecatedPopoverTrigger,
DeprecatedPopoverContent,
DeprecatedPopoverPortal,
DeprecatedPopoverHeader,
+ SmallIconButton,
} from "@webstudio-is/design-system";
import { GearIcon, gearIconCssVars } from "@webstudio-is/icons";
import type { Asset } from "@webstudio-is/sdk";
@@ -29,8 +29,7 @@ export const ImageInfoTrigger = ({
return (
<DeprecatedPopover open={isInfoOpen} onOpenChange={setInfoOpen}>
<DeprecatedPopoverTrigger asChild>
- <DeprecatedButton
- variant="raw"
+ <SmallIconButton
title="Options"
onClick={() => setInfoOpen(true)}
css={{
@@ -46,9 +45,8 @@ export const ImageInfoTrigger = ({
},
...gearIconCssVars({ fill: theme.colors.loContrast }),
}}
- >
- <GearIcon />
- </DeprecatedButton>
+ icon={<GearIcon />}
+ />
</DeprecatedPopoverTrigger>
<DeprecatedPopoverPortal>
<DeprecatedPopoverContent>
diff --git a/packages/design-system/src/components/__DEPRECATED__/button.stories.tsx b/packages/design-system/src/components/__DEPRECATED__/button.stories.tsx
deleted file mode 100644
index 2e78543ab5..0000000000
--- a/packages/design-system/src/components/__DEPRECATED__/button.stories.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import type { StoryFn } from "@storybook/react";
-import { DeprecatedButton } from "./button";
-
-export default {
- component: DeprecatedButton,
-};
-
-export const Simple: StoryFn<typeof DeprecatedButton> = () => {
- return <DeprecatedButton>Simple</DeprecatedButton>;
-};
diff --git a/packages/design-system/src/components/__DEPRECATED__/button.tsx b/packages/design-system/src/components/__DEPRECATED__/button.tsx
deleted file mode 100644
index 38cae4992c..0000000000
--- a/packages/design-system/src/components/__DEPRECATED__/button.tsx
+++ /dev/null
@@ -1,325 +0,0 @@
-import { styled } from "../../stitches.config";
-import { theme } from "../../stitches.config";
-
-export const DeprecatedButton = styled("button", {
- // Reset
- all: "unset",
- alignItems: "center",
- boxSizing: "border-box",
- border: "none",
- userSelect: "none",
- transition: "all 150ms ease-out",
- "&::before": {
- boxSizing: "border-box",
- },
- "&::after": {
- boxSizing: "border-box",
- },
-
- // Custom reset?
- display: "inline-flex",
- flexShrink: 0,
- justifyContent: "center",
- lineHeight: 1,
- WebkitTapHighlightColor: "rgba(0,0,0,0)",
- minWidth: 0,
-
- // Custom
- height: theme.spacing[11],
- px: theme.spacing[5],
- fontFamily: theme.fonts.sans,
- fontSize: theme.deprecatedFontSize[3],
- fontWeight: 500,
- fontVariantNumeric: "tabular-nums",
-
- "&:disabled": {
- backgroundColor: theme.colors.slate2,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate7}`,
- color: theme.colors.slate8,
- pointerEvents: "none",
- },
-
- variants: {
- size: {
- "1": {
- borderRadius: theme.borderRadius[4],
- height: theme.spacing[11],
- px: theme.spacing[4],
- fontSize: theme.deprecatedFontSize[3],
- },
- "2": {
- borderRadius: theme.borderRadius[6],
- height: theme.spacing[12],
- px: theme.spacing[9],
- fontSize: theme.deprecatedFontSize[4],
- },
- "3": {
- borderRadius: theme.borderRadius[6],
- height: theme.spacing[17],
- px: theme.spacing[10],
- fontSize: theme.deprecatedFontSize[4],
- },
- },
- variant: {
- gray: {
- backgroundColor: theme.colors.loContrast,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate7}`,
- color: theme.colors.hiContrast,
- "@hover": {
- "&:hover": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- },
- },
- "&:active": {
- backgroundColor: theme.colors.slate2,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}, 0 0 0 1px ${theme.colors.slate8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.slate4,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- },
- },
- blue: {
- backgroundColor: theme.colors.blue10,
- color: "white",
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.loContrast,
- color: theme.colors.blue10,
- boxShadow: `inset 0 0 0 1.5px ${theme.colors.blue10}`,
- },
- },
- "&:active": {
- boxShadow: `inset 0 0 0 1.5px ${theme.colors.blue8}`,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1.5px ${theme.colors.blue8}, 0 0 0 1.5px ${theme.colors.blue8}`,
- },
- '&[data-state="open"]': {
- boxShadow: `inset 0 0 0 1.5px ${theme.colors.blue8}`,
- },
- },
- green: {
- backgroundColor: theme.colors.green2,
- boxShadow: `inset 0 0 0 1px ${theme.colors.green7}`,
- color: theme.colors.green11,
- "@hover": {
- "&:hover": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.green8}`,
- },
- },
- "&:active": {
- backgroundColor: theme.colors.green3,
- boxShadow: `inset 0 0 0 1px ${theme.colors.green8}`,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.green8}, 0 0 0 1px ${theme.colors.green8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.green4,
- boxShadow: `inset 0 0 0 1px ${theme.colors.green8}`,
- },
- },
- red: {
- backgroundColor: theme.colors.loContrast,
- boxShadow: `inset 0 0 0 1px ${theme.colors.red10}`,
- color: theme.colors.red10,
- "@hover": {
- "&:hover": {
- background: theme.colors.red10,
- color: theme.colors.loContrast,
- },
- },
- "&:active": {
- backgroundColor: theme.colors.red11,
- color: theme.colors.loContrast,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.red8}, 0 0 0 1px ${theme.colors.red8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.red4,
- boxShadow: `inset 0 0 0 1px ${theme.colors.red8}`,
- },
- },
- transparentWhite: {
- backgroundColor: "hsla(0,100%,100%,.2)",
- color: "white",
- "@hover": {
- "&:hover": {
- backgroundColor: "hsla(0,100%,100%,.25)",
- },
- },
- "&:active": {
- backgroundColor: "hsla(0,100%,100%,.3)",
- },
- "&:focus": {
- boxShadow:
- "inset 0 0 0 1px hsla(0,100%,100%,.35), 0 0 0 1px hsla(0,100%,100%,.35)",
- },
- },
- raw: {
- background: "transparent",
- color: "inherit",
- padding: 0,
- borderRadius: 0,
- height: "auto",
- },
- transparentBlack: {
- backgroundColor: "hsla(0,0%,0%,.2)",
- color: "black",
- "@hover": {
- "&:hover": {
- backgroundColor: "hsla(0,0%,0%,.25)",
- },
- },
- "&:active": {
- backgroundColor: "hsla(0,0%,0%,.3)",
- },
- "&:focus": {
- boxShadow:
- "inset 0 0 0 1px hsla(0,0%,0%,.35), 0 0 0 1px hsla(0,0%,0%,.35)",
- },
- },
- },
- state: {
- active: {
- backgroundColor: theme.colors.slate4,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- color: theme.colors.slate11,
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.slate6,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- },
- },
- "&:active": {
- backgroundColor: theme.colors.slate6,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}, 0 0 0 1px ${theme.colors.slate8}`,
- },
- },
- waiting: {
- backgroundColor: theme.colors.slate4,
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- color: theme.colors.slate9,
- cursor: "wait",
- "&:hover, &:active": {
- color: theme.colors.slate9,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.slate8}`,
- },
- },
- },
- ghost: {
- true: {
- backgroundColor: "transparent",
- boxShadow: "none",
- },
- },
- },
- compoundVariants: [
- {
- variant: "gray",
- ghost: "true",
- css: {
- backgroundColor: "transparent",
- color: theme.colors.hiContrast,
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.slateA3,
- boxShadow: "none",
- },
- },
- "&:active": {
- backgroundColor: theme.colors.slateA4,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.slateA8}, 0 0 0 1px ${theme.colors.slateA8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.slateA4,
- boxShadow: "none",
- },
- },
- },
- {
- variant: "blue",
- ghost: "true",
- css: {
- backgroundColor: "transparent",
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.blueA3,
- boxShadow: "none",
- },
- },
- "&:active": {
- backgroundColor: theme.colors.blueA4,
- },
- "&:focus": {
- boxShadow: `0px 0px 0px 2px ${theme.colors.blue10}, 0px 0px 0px 2px ${theme.colors.blue10}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.blueA4,
- boxShadow: "none",
- },
- },
- },
- {
- variant: "green",
- ghost: "true",
- css: {
- backgroundColor: "transparent",
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.greenA3,
- boxShadow: "none",
- },
- },
- "&:active": {
- backgroundColor: theme.colors.greenA4,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.greenA8}, 0 0 0 1px ${theme.colors.greenA8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.greenA4,
- boxShadow: "none",
- },
- },
- },
- {
- variant: "red",
- ghost: "true",
- css: {
- backgroundColor: "transparent",
- "@hover": {
- "&:hover": {
- backgroundColor: theme.colors.redA3,
- boxShadow: "none",
- },
- },
- "&:active": {
- backgroundColor: theme.colors.redA4,
- },
- "&:focus": {
- boxShadow: `inset 0 0 0 1px ${theme.colors.redA8}, 0 0 0 1px ${theme.colors.redA8}`,
- },
- '&[data-state="open"]': {
- backgroundColor: theme.colors.redA4,
- boxShadow: "none",
- },
- },
- },
- ],
- defaultVariants: {
- size: "1",
- variant: "gray",
- },
-});
diff --git a/packages/design-system/src/index.ts b/packages/design-system/src/index.ts
index 4d9204d1b0..acacec3d53 100644
--- a/packages/design-system/src/index.ts
+++ b/packages/design-system/src/index.ts
@@ -86,7 +86,6 @@ export * from "./components/kbd";
// Deprecated
export * from "./components/__DEPRECATED__/text2";
-export { DeprecatedButton } from "./components/__DEPRECATED__/button";
export { DeprecatedIconButton } from "./components/__DEPRECATED__/icon-button";
export * from "./components/__DEPRECATED__/popover";
export * from "./components/__DEPRECATED__/text-field";