diff --git a/packages/system/src/typography/index.ts b/packages/system/src/typography/index.ts new file mode 100644 index 0000000000..2ad0a54163 --- /dev/null +++ b/packages/system/src/typography/index.ts @@ -0,0 +1,2 @@ +export * from './typography'; +export type { Typography } from './types'; diff --git a/packages/system/src/typography/types.ts b/packages/system/src/typography/types.ts new file mode 100644 index 0000000000..d43dd8f587 --- /dev/null +++ b/packages/system/src/typography/types.ts @@ -0,0 +1,28 @@ +import { colors, fontSizes, lineHeights } from '@gympass/yoga-tokens'; + +type ColorsValues = typeof colors | string; +type FontSizesValues = typeof fontSizes | string | number; +type LineHeightsValues = typeof lineHeights | string | number; +type TextAlignValues = string; + +type Color = { + color?: ColorsValues; + c?: ColorsValues; +}; + +type FontSize = { + fontSize?: FontSizesValues; + fs?: FontSizesValues; +}; + +type LineHeight = { + lineHeight?: LineHeightsValues; + lh?: LineHeightsValues; +}; + +type TextAlign = { + textAlign?: TextAlignValues; + ta?: TextAlignValues; +}; + +export type Typography = Color & FontSize & LineHeight & TextAlign; diff --git a/packages/system/src/typography.test.js b/packages/system/src/typography/typography.test.js similarity index 98% rename from packages/system/src/typography.test.js rename to packages/system/src/typography/typography.test.js index f10d61b584..22a733c3c1 100644 --- a/packages/system/src/typography.test.js +++ b/packages/system/src/typography/typography.test.js @@ -9,7 +9,7 @@ import { textTransform, } from './typography'; -import { fontWeight as fontWeightAndroid } from './font-weight/fontWeight.android'; +import { fontWeight as fontWeightAndroid } from '../font-weight/fontWeight.android'; const fontSizes = [10, 20, 40]; diff --git a/packages/system/src/typography.js b/packages/system/src/typography/typography.ts similarity index 91% rename from packages/system/src/typography.js rename to packages/system/src/typography/typography.ts index 9bd57ee22d..6829a6a6e2 100644 --- a/packages/system/src/typography.js +++ b/packages/system/src/typography/typography.ts @@ -1,13 +1,13 @@ -import { toPx } from './unit'; +import { toPx } from '../unit'; import { getFontSize, getColor, getLineHeight, generator, compose, -} from './theme'; +} from '../theme'; -import { fontWeight } from './font-weight'; +import { fontWeight } from '../font-weight'; const color = props => generator({