-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
149 additions
and
36 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,78 @@ | ||
import { recipe, RecipeVariants } from "@vanilla-extract/recipes"; | ||
|
||
import { sprinkles } from "~/theme"; | ||
|
||
export const text = recipe({ | ||
base: [sprinkles({ fontFamily: "body" })], | ||
|
||
variants: { | ||
variant: { | ||
body1: sprinkles({ lineHeight: "text" }), | ||
body2: sprinkles({ lineHeight: "text" }), | ||
}, | ||
size: { | ||
small: {}, | ||
medium: {}, | ||
large: {}, | ||
}, | ||
fontWeight: { | ||
light: sprinkles({ fontWeight: "light" }), | ||
regular: sprinkles({ fontWeight: "regular" }), | ||
medium: sprinkles({ fontWeight: "medium" }), | ||
}, | ||
}, | ||
|
||
compoundVariants: [ | ||
{ | ||
variants: { | ||
variant: "body1", | ||
size: "large", | ||
}, | ||
style: sprinkles({ fontSize: 6 }), | ||
}, | ||
{ | ||
variants: { | ||
variant: "body1", | ||
size: "medium", | ||
}, | ||
style: sprinkles({ fontSize: 5 }), | ||
}, | ||
{ | ||
variants: { | ||
variant: "body1", | ||
size: "small", | ||
}, | ||
style: sprinkles({ fontSize: 4 }), | ||
}, | ||
|
||
{ | ||
variants: { | ||
variant: "body2", | ||
size: "large", | ||
}, | ||
style: sprinkles({ fontSize: 4 }), | ||
}, | ||
{ | ||
variants: { | ||
variant: "body2", | ||
size: "medium", | ||
}, | ||
style: sprinkles({ fontSize: 3 }), | ||
}, | ||
{ | ||
variants: { | ||
variant: "body2", | ||
size: "small", | ||
}, | ||
style: sprinkles({ fontSize: 2 }), | ||
}, | ||
], | ||
|
||
defaultVariants: { | ||
variant: "body1", | ||
size: "medium", | ||
fontWeight: "regular", | ||
}, | ||
}); | ||
|
||
export type TextVariants = RecipeVariants<typeof text>; |
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,20 @@ | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
|
||
import { Text } from "./Text"; | ||
|
||
export default { | ||
component: Text, | ||
} as ComponentMeta<typeof Text>; | ||
|
||
const Template: ComponentStory<typeof Text> = (args) => ( | ||
<Text {...args}>Lorem ipsum dolor sit amet</Text> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
color: "neutralTextPrimary", | ||
size: "medium", | ||
variant: "body1", | ||
fontWeight: "regular", | ||
as: "span", | ||
}; |
Oops, something went wrong.