-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved base types to tokens library * Typography typescript * removed comment * Uniformed variants type
- Loading branch information
Showing
10 changed files
with
286 additions
and
225 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
This file was deleted.
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
This file was deleted.
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,61 @@ | ||
import { tokens } from '@equinor/eds-tokens' | ||
import type { TypographyTokens } from '@equinor/eds-tokens' | ||
|
||
const { typography, colors: colorsToken } = tokens | ||
const { heading, paragraph } = typography | ||
|
||
const { | ||
interactive: { | ||
primary__resting: { rgba: primary }, | ||
secondary__resting: { rgba: secondary }, | ||
danger__resting: { rgba: danger }, | ||
warning__resting: { rgba: warning }, | ||
success__resting: { rgba: success }, | ||
disabled__text: { rgba: disabled }, | ||
}, | ||
} = colorsToken | ||
|
||
const colors = { | ||
primary, | ||
secondary, | ||
danger, | ||
warning, | ||
success, | ||
disabled, | ||
} | ||
|
||
export type QuickTypographyVariants = | ||
| TypographyTokens['heading'] | ||
| TypographyTokens['paragraph'] | ||
|
||
const quickVariants: QuickTypographyVariants = { | ||
...heading, | ||
...paragraph, | ||
} | ||
|
||
type TypographyVariants = | ||
| keyof TypographyTokens['heading'] | ||
| keyof TypographyTokens['paragraph'] | ||
| keyof TypographyTokens['navigation'] | ||
| keyof TypographyTokens['input'] | ||
| keyof TypographyTokens['ui'] | ||
| keyof TypographyTokens['table'] | ||
|
||
type ColorVariants = | ||
| 'primary' | ||
| 'secondary' | ||
| 'danger' | ||
| 'warning' | ||
| 'success' | ||
| 'disabled' | ||
|
||
type TypographyGroups = keyof typeof typography | ||
|
||
export { | ||
typography, | ||
colors, | ||
quickVariants, | ||
TypographyVariants, | ||
ColorVariants, | ||
TypographyGroups, | ||
} |
Oops, something went wrong.