Skip to content

Commit

Permalink
feat(packages/ui):make components dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Murat-tunca committed Aug 14, 2023
1 parent 48790f5 commit c0d81d0
Show file tree
Hide file tree
Showing 25 changed files with 81 additions and 106 deletions.
1 change: 1 addition & 0 deletions packages/ui/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export * from "./checkbox";
export * from "./toaster";
export * from "./card";
export * from "./form";
export * from "./typography";
5 changes: 5 additions & 0 deletions packages/ui/components/typography/blockquote.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyBlockquote(props: PropsWithChildren) {
return <blockquote className="mt-6 border-l-2 pl-6 italic">{props.children}</blockquote>;
}
9 changes: 9 additions & 0 deletions packages/ui/components/typography/h1.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { PropsWithChildren } from "react";

export function TypographyH1(props: PropsWithChildren) {
return (
<h1 className="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">
{props.children}
</h1>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export function TypographyH2() {
import { PropsWithChildren } from "react";

export function TypographyH2(props: PropsWithChildren) {
return (
<h2 className="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0">
The People of the Kingdom
{props.children}
</h2>
);
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/h3.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyH3(props: PropsWithChildren) {
return <h3 className="scroll-m-20 text-2xl font-semibold tracking-tight">{props.children}</h3>;
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/h4.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyH4(props: PropsWithChildren) {
return <h4 className="scroll-m-20 text-xl font-semibold tracking-tight">{props.children}</h4>;
}
12 changes: 12 additions & 0 deletions packages/ui/components/typography/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export * from "./h1";
export * from "./h2";
export * from "./h3";
export * from "./h4";
export * from "./inline-code";
export * from "./large";
export * from "./lead";
export * from "./list";
export * from "./muted";
export * from "./p";
export * from "./small";
export * from "./blockquote";
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export function TypographyInlineCode() {
import { PropsWithChildren } from "react";

export function TypographyInlineCode(props: PropsWithChildren) {
return (
<code className="bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold">
@radix-ui/react-alert-dialog
{props.children}
</code>
);
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/large.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyLarge(props: PropsWithChildren) {
return <div className="text-lg font-semibold">{props.children}</div>;
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/lead.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyLead(props: PropsWithChildren) {
return <p className="text-muted-foreground text-xl">{props.children}</p>;
}
11 changes: 11 additions & 0 deletions packages/ui/components/typography/list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { PropsWithChildren } from "react";

export function TypographyList(props: PropsWithChildren) {
return (
<ul className="my-6 ml-6 list-disc [&>li]:mt-2">
<li>{props.children}</li>
<li>{props.children}</li>
<li>{props.children}</li>
</ul>
);
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/muted.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyMuted(props: PropsWithChildren) {
return <p className="text-muted-foreground text-sm">{props.children}</p>;
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/p.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographyP(props: PropsWithChildren) {
return <p className="leading-7 [&:not(:first-child)]:mt-6">{props.children}</p>;
}
5 changes: 5 additions & 0 deletions packages/ui/components/typography/small.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from "react";

export function TypographySmall(props: PropsWithChildren) {
return <small className="text-sm font-medium leading-none">{props.children}</small>;
}
8 changes: 0 additions & 8 deletions packages/ui/typography/blockquote.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions packages/ui/typography/h1.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/typography/h3.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions packages/ui/typography/h4.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/typography/large.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions packages/ui/typography/lead.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions packages/ui/typography/list.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/typography/muted.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions packages/ui/typography/p.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/typography/small.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions packages/ui/typography/table.tsx

This file was deleted.

0 comments on commit c0d81d0

Please sign in to comment.