Skip to content

Commit

Permalink
feat(components): transformed typography into Text component
Browse files Browse the repository at this point in the history
  • Loading branch information
anstapol committed Jan 11, 2025
1 parent 1081536 commit e083065
Show file tree
Hide file tree
Showing 38 changed files with 385 additions and 1,081 deletions.
406 changes: 8 additions & 398 deletions apps/www/__registry__/index.tsx

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions apps/www/content/docs/components/text.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Text
description: Displays a text or a component that looks like a text.
component: true
---

<ComponentPreview
name="text-demo"
className="[&>div.min-h-[350px]]:p-6"
description="A collection of typographic elements."
/>
63 changes: 0 additions & 63 deletions apps/www/content/docs/components/typography.mdx

This file was deleted.

12 changes: 12 additions & 0 deletions apps/www/public/r/styles/default/text-demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "text-demo",
"type": "registry:example",
"files": [
{
"path": "examples/text-demo.tsx",
"content": "import { Text } from \"@/registry/default/ui/text\"\n\nexport default function TextDemo() {\n return (\n <div>\n <Text variant=\"h1\">The Joke Tax Chronicles</Text>\n <Text variant=\"p\">\n Once upon a time, in a far-off land, there was a very lazy king who\n spent all day lounging on his throne. One day, his advisors came to him\n with a problem: the kingdom was running out of money.\n </Text>\n <Text variant=\"h2\">The King's Plan</Text>\n <Text>\n The king thought long and hard, and finally came up with{\" \"}\n <Text href=\"#\" variant=\"a\">\n a brilliant plan\n </Text>\n : he would tax the jokes in the kingdom.\n </Text>\n <Text variant=\"blockquote\">\n \"After all,\" he said, \"everyone enjoys a good joke, so it's only fair\n that they should pay for the privilege.\"\n </Text>\n <Text variant=\"h3\">The Joke Tax</Text>\n <Text>\n The king's subjects were not amused. They grumbled and complained, but\n the king was firm:\n </Text>\n <Text variant=\"ul\">\n <li>1st level of puns: 5 gold coins</li>\n <li>2nd level of jokes: 10 gold coins</li>\n <li>3rd level of one-liners : 20 gold coins</li>\n </Text>\n <Text>\n As a result, people stopped telling jokes, and the kingdom fell into a\n gloom. But there was one person who refused to let the king's\n foolishness get him down: a court jester named Jokester.\n </Text>\n <Text variant=\"h3\">Jokester's Revolt</Text>\n <Text>\n Jokester began sneaking into the castle in the middle of the night and\n leaving jokes all over the place: under the king's pillow, in his soup,\n even in the royal toilet. The king was furious, but he couldn't seem to\n stop Jokester.\n </Text>\n <Text>\n And then, one day, the people of the kingdom discovered that the jokes\n left by Jokester were so funny that they couldn't help but laugh. And\n once they started laughing, they couldn't stop.\n </Text>\n <Text variant=\"h3\">The People's Rebellion</Text>\n <Text>\n The people of the kingdom, feeling uplifted by the laughter, started to\n tell jokes and puns again, and soon the entire kingdom was in on the\n joke.\n </Text>\n <Text>\n The king, seeing how much happier his subjects were, realized the error\n of his ways and repealed the joke tax. Jokester was declared a hero, and\n the kingdom lived happily ever after.\n </Text>\n <Text>\n The moral of the story is: never underestimate the power of a good laugh\n and always be careful of bad ideas.\n </Text>\n </div>\n )\n}\n",
"type": "registry:example",
"target": ""
}
]
}
12 changes: 12 additions & 0 deletions apps/www/public/r/styles/new-york/text-demo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "text-demo",
"type": "registry:example",
"files": [
{
"path": "examples/text-demo.tsx",
"content": "import { Text } from \"@/registry/default/ui/text\"\n\nexport default function TextDemo() {\n return (\n <div>\n <Text variant=\"h1\">The Joke Tax Chronicles</Text>\n <Text variant=\"p\">\n Once upon a time, in a far-off land, there was a very lazy king who\n spent all day lounging on his throne. One day, his advisors came to him\n with a problem: the kingdom was running out of money.\n </Text>\n <Text variant=\"h2\">The King's Plan</Text>\n <Text>\n The king thought long and hard, and finally came up with{\" \"}\n <Text href=\"#\" variant=\"a\">\n a brilliant plan\n </Text>\n : he would tax the jokes in the kingdom.\n </Text>\n <Text variant=\"blockquote\">\n \"After all,\" he said, \"everyone enjoys a good joke, so it's only fair\n that they should pay for the privilege.\"\n </Text>\n <Text variant=\"h3\">The Joke Tax</Text>\n <Text>\n The king's subjects were not amused. They grumbled and complained, but\n the king was firm:\n </Text>\n <Text variant=\"ul\">\n <li>1st level of puns: 5 gold coins</li>\n <li>2nd level of jokes: 10 gold coins</li>\n <li>3rd level of one-liners : 20 gold coins</li>\n </Text>\n <Text>\n As a result, people stopped telling jokes, and the kingdom fell into a\n gloom. But there was one person who refused to let the king's\n foolishness get him down: a court jester named Jokester.\n </Text>\n <Text variant=\"h3\">Jokester's Revolt</Text>\n <Text>\n Jokester began sneaking into the castle in the middle of the night and\n leaving jokes all over the place: under the king's pillow, in his soup,\n even in the royal toilet. The king was furious, but he couldn't seem to\n stop Jokester.\n </Text>\n <Text>\n And then, one day, the people of the kingdom discovered that the jokes\n left by Jokester were so funny that they couldn't help but laugh. And\n once they started laughing, they couldn't stop.\n </Text>\n <Text variant=\"h3\">The People's Rebellion</Text>\n <Text>\n The people of the kingdom, feeling uplifted by the laughter, started to\n tell jokes and puns again, and soon the entire kingdom was in on the\n joke.\n </Text>\n <Text>\n The king, seeing how much happier his subjects were, realized the error\n of his ways and repealed the joke tax. Jokester was declared a hero, and\n the kingdom lived happily ever after.\n </Text>\n <Text>\n The moral of the story is: never underestimate the power of a good laugh\n and always be careful of bad ideas.\n </Text>\n </div>\n )\n}\n",
"type": "registry:example",
"target": ""
}
]
}
68 changes: 68 additions & 0 deletions apps/www/registry/default/examples/text-demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Text } from "@/registry/default/ui/text"

export default function TextDemo() {
return (
<div>
<Text variant="h1">The Joke Tax Chronicles</Text>
<Text variant="p">
Once upon a time, in a far-off land, there was a very lazy king who
spent all day lounging on his throne. One day, his advisors came to him
with a problem: the kingdom was running out of money.
</Text>
<Text variant="h2">The King's Plan</Text>
<Text>
The king thought long and hard, and finally came up with{" "}
<Text href="#" variant="a">
a brilliant plan
</Text>
: he would tax the jokes in the kingdom.
</Text>
<Text variant="blockquote">
"After all," he said, "everyone enjoys a good joke, so it's only fair
that they should pay for the privilege."
</Text>
<Text variant="h3">The Joke Tax</Text>
<Text>
The king's subjects were not amused. They grumbled and complained, but
the king was firm:
</Text>
<Text variant="ul">
<li>1st level of puns: 5 gold coins</li>
<li>2nd level of jokes: 10 gold coins</li>
<li>3rd level of one-liners : 20 gold coins</li>
</Text>
<Text>
As a result, people stopped telling jokes, and the kingdom fell into a
gloom. But there was one person who refused to let the king's
foolishness get him down: a court jester named Jokester.
</Text>
<Text variant="h3">Jokester's Revolt</Text>
<Text>
Jokester began sneaking into the castle in the middle of the night and
leaving jokes all over the place: under the king's pillow, in his soup,
even in the royal toilet. The king was furious, but he couldn't seem to
stop Jokester.
</Text>
<Text>
And then, one day, the people of the kingdom discovered that the jokes
left by Jokester were so funny that they couldn't help but laugh. And
once they started laughing, they couldn't stop.
</Text>
<Text variant="h3">The People's Rebellion</Text>
<Text>
The people of the kingdom, feeling uplifted by the laughter, started to
tell jokes and puns again, and soon the entire kingdom was in on the
joke.
</Text>
<Text>
The king, seeing how much happier his subjects were, realized the error
of his ways and repealed the joke tax. Jokester was declared a hero, and
the kingdom lived happily ever after.
</Text>
<Text>
The moral of the story is: never underestimate the power of a good laugh
and always be careful of bad ideas.
</Text>
</div>
)
}
8 changes: 0 additions & 8 deletions apps/www/registry/default/examples/typography-blockquote.tsx

This file was deleted.

119 changes: 0 additions & 119 deletions apps/www/registry/default/examples/typography-demo.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/www/registry/default/examples/typography-h1.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/www/registry/default/examples/typography-h2.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/www/registry/default/examples/typography-h3.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/www/registry/default/examples/typography-h4.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/www/registry/default/examples/typography-inline-code.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/www/registry/default/examples/typography-large.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions apps/www/registry/default/examples/typography-lead.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/www/registry/default/examples/typography-list.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions apps/www/registry/default/examples/typography-muted.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions apps/www/registry/default/examples/typography-p.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions apps/www/registry/default/examples/typography-small.tsx

This file was deleted.

Loading

0 comments on commit e083065

Please sign in to comment.