UNPKG

@prosperitainova/dumbo-react-native

Version:
316 lines (284 loc) 7.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.overrideFonts = exports.fontScalingActive = exports.SemiBoldFont = exports.RegularFont = exports.MonoRegularFont = exports.LightFont = exports.Legal02 = exports.Legal01 = exports.Label02 = exports.Label01 = exports.HelperText02 = exports.HelperText01 = exports.HeadingCompact02 = exports.HeadingCompact01 = exports.Heading07 = exports.Heading06 = exports.Heading05 = exports.Heading04 = exports.Heading03 = exports.Heading02 = exports.Heading01 = exports.Code02 = exports.Code01 = exports.BodyCompact02 = exports.BodyCompact01 = exports.Body02 = exports.Body01 = void 0; var _reactNative = require("react-native"); /** * This file includes all the exported typography styles. These are auto used by the `Text` component. * You can use them directly for any other text styles. * This repo includes only the fonts used directly. * If you want to use other fonts you can download them and store them in your app and follow same directions on README. */ /** Font weights supported */ /** Declaration of standard Font item */ /** Font override type */ /** * @ignore * The override font definition to store */ let overrideFontDefinition = {}; /** * Override internal font groups. By default Carbon uses Plex. * You can override with your own font family here. You can choose to only override some or all. * You must install the fonts and setup React Native to bundle your custom font family if not using an available system font. * * @param overrides - The font sets the app use internally */ const overrideFonts = overrides => { if (overrides && typeof overrides === 'object') { overrideFontDefinition = overrides; } }; /** * Indicate if font scaling is on * @returns boolean indicating if font scaling is in use */ exports.overrideFonts = overrideFonts; const fontScalingActive = () => { return _reactNative.Dimensions.get('screen').fontScale > 1; }; /** Font light styling */ exports.fontScalingActive = fontScalingActive; const LightFont = () => { return overrideFontDefinition.light || { fontWeight: '300', fontFamily: 'IBMPlexSans-Light' }; }; /** Font regular styling */ exports.LightFont = LightFont; const RegularFont = () => { return overrideFontDefinition.regular || { fontWeight: '400', fontFamily: 'IBMPlexSans-Regular' }; }; /** Font semi-bold styling */ exports.RegularFont = RegularFont; const SemiBoldFont = () => { return overrideFontDefinition.semiBold || { fontWeight: '600', fontFamily: 'IBMPlexSans-SemiBold' }; }; /** Font Mono regular styling */ exports.SemiBoldFont = SemiBoldFont; const MonoRegularFont = () => { return overrideFontDefinition.monoRegular || { fontWeight: '400', fontFamily: 'IBMPlexMono' }; }; /** Code-01 text style (Productive) */ exports.MonoRegularFont = MonoRegularFont; const Code01 = () => { return { fontSize: 12, lineHeight: 16, letterSpacing: 0.32, ...MonoRegularFont() }; }; /** Code-02 text style (Expressive) */ exports.Code01 = Code01; const Code02 = () => { return { fontSize: 14, lineHeight: 20, letterSpacing: 0.32, ...MonoRegularFont() }; }; /** Label-01 text style (Productive) */ exports.Code02 = Code02; const Label01 = () => { return { fontSize: 12, lineHeight: 16, letterSpacing: 0.32, ...RegularFont() }; }; /** Label-02 text style (Expressive) */ exports.Label01 = Label01; const Label02 = () => { return { fontSize: 14, lineHeight: 18, letterSpacing: 0.16, ...RegularFont() }; }; /** Helper-text-01 text style (Productive) */ exports.Label02 = Label02; const HelperText01 = () => { return { fontSize: 12, lineHeight: 16, letterSpacing: 0.32, ...RegularFont() }; }; /** Helper-text-02 text style (Expressive) */ exports.HelperText01 = HelperText01; const HelperText02 = () => { return { fontSize: 14, lineHeight: 18, letterSpacing: 0.16, ...RegularFont() }; }; /** Legal-01 text style (Productive) */ exports.HelperText02 = HelperText02; const Legal01 = () => { return { fontSize: 12, lineHeight: 16, letterSpacing: 0.32, ...RegularFont() }; }; /** Legal-02 text style (Expressive) */ exports.Legal01 = Legal01; const Legal02 = () => { return { fontSize: 14, lineHeight: 18, letterSpacing: 0.16, ...RegularFont() }; }; /** Body-compact-01 text style (Productive) */ exports.Legal02 = Legal02; const BodyCompact01 = () => { return { fontSize: 14, lineHeight: 18, letterSpacing: 0.16, ...RegularFont() }; }; /** Body-compact-02 text style (Expressive) */ exports.BodyCompact01 = BodyCompact01; const BodyCompact02 = () => { return { fontSize: 16, lineHeight: 22, letterSpacing: 0, ...RegularFont() }; }; /** Body-01 text style (Productive) */ exports.BodyCompact02 = BodyCompact02; const Body01 = () => { return { fontSize: 14, lineHeight: 20, letterSpacing: 0.16, ...RegularFont() }; }; /** Body-02 text style (Expressive) */ exports.Body01 = Body01; const Body02 = () => { return { fontSize: 16, lineHeight: 24, letterSpacing: 0, ...RegularFont() }; }; /** Heading-compact-01 text style (Productive) */ exports.Body02 = Body02; const HeadingCompact01 = () => { return { fontSize: 14, lineHeight: 18, letterSpacing: 0.16, ...SemiBoldFont() }; }; /** Heading-compact-02 text style (Expressive) */ exports.HeadingCompact01 = HeadingCompact01; const HeadingCompact02 = () => { return { fontSize: 16, lineHeight: 22, letterSpacing: 0, ...SemiBoldFont() }; }; /** Heading-01 text style (Productive) */ exports.HeadingCompact02 = HeadingCompact02; const Heading01 = () => { return { fontSize: 14, lineHeight: 20, letterSpacing: 0.16, ...SemiBoldFont() }; }; /** Heading-02 text style (Expressive) */ exports.Heading01 = Heading01; const Heading02 = () => { return { fontSize: 16, lineHeight: 24, letterSpacing: 0, ...SemiBoldFont() }; }; /** Heading-03 text style (Productive) */ exports.Heading02 = Heading02; const Heading03 = () => { return { fontSize: 20, lineHeight: 28, letterSpacing: 0, ...RegularFont() }; }; /** Heading-04 text style (Productive) */ exports.Heading03 = Heading03; const Heading04 = () => { return { fontSize: 28, lineHeight: 36, letterSpacing: 0, ...RegularFont() }; }; /** Heading-05 text style (Productive) */ exports.Heading04 = Heading04; const Heading05 = () => { return { fontSize: 32, lineHeight: 40, letterSpacing: 0, ...LightFont() }; }; /** Heading-06 text style (Productive) */ exports.Heading05 = Heading05; const Heading06 = () => { return { fontSize: 42, lineHeight: 50, letterSpacing: 0, ...LightFont() }; }; /** Heading-07 text style (Productive) */ exports.Heading06 = Heading06; const Heading07 = () => { return { fontSize: 54, lineHeight: 64, letterSpacing: 0, ...LightFont() }; }; exports.Heading07 = Heading07; //# sourceMappingURL=typography.js.map