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.

semantic text component ready

Oleg Isonen81bf03e2f1ad
diff --git a/packages/design-system/src/components/text.stories.tsx b/packages/design-system/src/components/text.stories.tsx
new file mode 100644
index 0000000000..36d3399c7a
--- /dev/null
+++ b/packages/design-system/src/components/text.stories.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import { ComponentStory } from "@storybook/react";
+import { Text } from "./text";
+
+export default {
+ component: Text,
+};
+
+export const Regular: ComponentStory<typeof Text> = () => {
+ return <Text>Regular text</Text>;
+};
+
+export const Label: ComponentStory<typeof Text> = () => {
+ return <Text variant="label">Label text</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>;
+};
diff --git a/packages/design-system/src/components/text.tsx b/packages/design-system/src/components/text.tsx
new file mode 100644
index 0000000000..1c0c7e00c7
--- /dev/null
+++ b/packages/design-system/src/components/text.tsx
@@ -0,0 +1,50 @@
+import { styled } from "../stitches.config";
+
+export const Text = styled("div", {
+ // Reset
+ margin: 0,
+ lineHeight: 1,
+ userSelect: "none",
+ fontFamily: "$sans",
+
+ variants: {
+ variant: {
+ regular: {
+ fontWeight: 400,
+ fontSize: 12,
+ letterSpacing: "0.005em",
+ },
+ label: {
+ fontWeight: 500,
+ fontSize: 12,
+ letterSpacing: "0.005em",
+ },
+ tiny: {
+ fontWeight: 400,
+ fontSize: 8,
+ letterSpacing: "0.01em",
+ },
+ title: {
+ fontWeight: 700,
+ fontSize: 12,
+ letterSpacing: "0.01em",
+ },
+ mono: {
+ fontFamily: "$mono",
+ fontWeight: 400,
+ fontSize: 12,
+ textTransform: "uppercase",
+ },
+ unit: {
+ fontWeight: 500,
+ fontSize: 10,
+ lineHeight: 12,
+ textTransform: "uppercase",
+ },
+ },
+ },
+
+ defaultVariants: {
+ variant: "regular",
+ },
+});
diff --git a/packages/design-system/src/index.ts b/packages/design-system/src/index.ts
index f10ac1683e..ce3834398f 100644
--- a/packages/design-system/src/index.ts
+++ b/packages/design-system/src/index.ts
@@ -63,3 +63,4 @@ export * from "./components/avatar";
export * from "./components/primitives/dnd";
export * from "./components/separator";
export * from "./components/text-legacy";
+export * from "./components/text";
diff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.ts
index 170d76ae6c..77097765d0 100644
--- a/packages/design-system/src/stitches.config.ts
+++ b/packages/design-system/src/stitches.config.ts
@@ -207,7 +207,7 @@ export const {
},
fonts: {
sans: "Inter, -apple-system, system-ui, sans-serif",
- mono: "Söhne Mono, menlo, monospace",
+ mono: "Roboto, menlo, monospace",
},
space: {
1: "4px",