All files / packages/ui/src/themes typography.ts

100% Statements 11/11
100% Branches 7/7
100% Functions 2/2
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 5725x                           25x 107x   25x   26x   27x     29x             25x               25x 102x             25x                  
export const fonts = {
  pompiere: "Pompiere-Regular",
  poppins: "Poppins-Regular",
  poppinsLight: "Poppins-Light",
  poppinsMedium: "Poppins-Medium",
  poppinsSemiBold: "Poppins-SemiBold",
  system: "System",
} as const;
 
/**
 * Get font family based on weight
 * @param weight - Font weight: 400 (Regular), 500 (Medium), 600 (SemiBold)
 * @returns Font family name
 */
export const getFont = (weight: 300 | 400 | 500 | 600 = 400): string => {
  switch (weight) {
    case 300:
      return fonts.poppinsLight;
    case 500:
      return fonts.poppinsMedium;
    case 600:
      return fonts.poppinsSemiBold;
    case 400:
    default:
      return fonts.poppins;
  }
};
 
/**
 * Text styles for Title (using Pompiere)
 */
export const textTitle = {
  fontFamily: fonts.pompiere,
} as const;
 
/**
 * Text styles for Content (using Poppins)
 * @param weight - Font weight: 400 (Regular), 500 (Medium), 600 (SemiBold)
 */
export const textContent = (weight: 300 | 400 | 500 | 600 = 400) =>
  ({
    fontFamily: getFont(weight),
  }) as const;
 
/**
 * Predefined text styles
 */
export const textStyles = {
  title: textTitle,
  content: {
    light: textContent(300),
    regular: textContent(400),
    medium: textContent(500),
    semiBold: textContent(600),
  },
} as const;