-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: component and storybook refinements
- Loading branch information
Showing
12 changed files
with
194 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { BodyText } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof BodyText> = { | ||
title: "Typography/Body", | ||
component: BodyText, | ||
argTypes: { | ||
variant: { | ||
control: "radio", | ||
options: ["small", "medium", "large"], | ||
}, | ||
}, | ||
}; | ||
|
||
type BodyTextStory = StoryObj<typeof meta>; | ||
|
||
export const Large: BodyTextStory = { | ||
args: { | ||
children: "Large quick brown fox jumps over the lazy dog", | ||
variant: "large", | ||
}, | ||
}; | ||
|
||
export const Medium: BodyTextStory = { | ||
args: { | ||
children: "Medium quick brown fox jumps over the lazy dog", | ||
variant: "medium", | ||
}, | ||
}; | ||
|
||
export const Small: BodyTextStory = { | ||
args: { | ||
children: "Small quick brown fox jumps over the lazy dog", | ||
variant: "small", | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { ButtonText } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof ButtonText> = { | ||
title: "Typography/Button", | ||
component: ButtonText, | ||
argTypes: { | ||
variant: { | ||
control: "radio", | ||
options: ["extraSmall", "small"], | ||
}, | ||
}, | ||
}; | ||
|
||
type ButtonTextStory = StoryObj<typeof meta>; | ||
|
||
export const Small: ButtonTextStory = { | ||
args: { | ||
children: "Button text", | ||
variant: "small", | ||
}, | ||
}; | ||
|
||
export const ExtraSmall: ButtonTextStory = { | ||
args: { | ||
children: "Button text", | ||
variant: "extraSmall", | ||
}, | ||
}; | ||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { Headline } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof Headline> = { | ||
title: "Typography/Headline", | ||
component: Headline, | ||
argTypes: { | ||
variant: { | ||
control: "radio", | ||
options: ["small", "medium", "large"], | ||
}, | ||
}, | ||
}; | ||
|
||
type HeadlineStory = StoryObj<typeof meta>; | ||
|
||
export const Large: HeadlineStory = { | ||
args: { | ||
children: "Headline large", | ||
variant: "large", | ||
type: "h1", | ||
}, | ||
}; | ||
|
||
export const Medium: HeadlineStory = { | ||
args: { | ||
children: "Headline medium", | ||
variant: "medium", | ||
type: "h2", | ||
}, | ||
}; | ||
|
||
export const Small: HeadlineStory = { | ||
args: { | ||
children: "Headline small", | ||
variant: "small", | ||
type: "h3", | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { LabelText } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof LabelText> = { | ||
title: "Typography/Label", | ||
component: LabelText, | ||
}; | ||
|
||
type LabelTextStory = StoryObj<typeof meta>; | ||
|
||
export const Default: LabelTextStory = { | ||
args: { | ||
children: "Label text (inter).", | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { Title } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof Title> = { | ||
title: "Typography/Title", | ||
component: Title, | ||
argTypes: { | ||
variant: { | ||
control: "radio", | ||
options: ["medium", "large"], | ||
}, | ||
}, | ||
}; | ||
|
||
type TitleStory = StoryObj<typeof meta>; | ||
|
||
export const Large: TitleStory = { | ||
args: { | ||
children: "Title large", | ||
variant: "large", | ||
}, | ||
}; | ||
|
||
export const Medium: TitleStory = { | ||
args: { | ||
children: "Title medium", | ||
variant: "medium", | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
import { cva, VariantProps } from "class-variance-authority"; | ||
|
||
const TitleVariants = cva( | ||
"k1-font-secondary, k1-font-bold, k1-tracking-tight", | ||
{ | ||
variants: { | ||
variant: { | ||
large: "k1-text-3xl", | ||
medium: "k1-text-2xl", | ||
}, | ||
const TitleVariants = cva("k1-font-secondary k1-font-bold k1-tracking-tight", { | ||
variants: { | ||
variant: { | ||
large: "k1-text-3xl", | ||
medium: "k1-text-2xl", | ||
}, | ||
}, | ||
); | ||
}); | ||
|
||
type Props = { | ||
children: React.ReactNode; | ||
} & VariantProps<typeof TitleVariants>; | ||
|
||
// solve h1,h2,h3 problem ? | ||
|
||
export default function Title({ children, variant }: Props) { | ||
export function Title({ children, variant }: Props) { | ||
return <span className={TitleVariants({ variant })}>{children}</span>; | ||
} | ||
|
||
{ | ||
/* <h1 className="k1-font-secondary k1-text-3xl k1-font-bold k1-tracking-tight"> | ||
Title large | ||
</h1> | ||
<h1 className="k1-font-secondary k1-text-2xl k1-font-bold k1-tracking-tight"> | ||
Title medium | ||
</h1> */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from "./Body"; | ||
export * from "./BodyText"; | ||
export * from "./ButtonText"; | ||
export * from "./Headline"; | ||
export * from "./Label"; | ||
export * from "./LabelText"; | ||
export * from "./Title"; |