"use strict";
const __vanilla_filescope__ = require("@vanilla-extract/css/fileScope");
const css = require("@vanilla-extract/css");
const cssUtils = require("@vanilla-extract/css-utils");
const styles_lib_css_capsize_css_cjs = require("./capsize.css.cjs");
const styles_lib_themes_vars_css_cjs = require("../themes/vars.css.cjs");
const styles_lib_css_responsiveStyle_cjs = require("./responsiveStyle.cjs");
const styles_lib_css_colorModeStyle_cjs = require("./colorModeStyle.cjs");
const styles_lib_utils_index_cjs = require("../utils/index.cjs");
__vanilla_filescope__.setFileScope("src/lib/css/typography.css.ts", "braid-design-system");
const fontFamily = css.style({
  fontFamily: styles_lib_themes_vars_css_cjs.vars.fontFamily
}, "fontFamily");
const fontWeight = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.textWeight, styles_lib_utils_index_cjs.mapToProperty("fontWeight"), "fontWeight");
const textSizeTrimmed = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.textSize, ({
  mobile,
  tablet
}, variant) => [styles_lib_css_capsize_css_cjs.createTextStyle({
  fontSize: mobile.fontSize,
  lineHeight: mobile.lineHeight,
  ...mobile.capsizeTrims
}, {
  "@media": {
    [styles_lib_css_responsiveStyle_cjs.breakpointQuery.tablet]: {
      fontSize: tablet.fontSize,
      lineHeight: tablet.lineHeight,
      ...tablet.capsizeTrims
    }
  }
}, `textSize_${variant}`)], "textSizeTrimmed");
const textSizeUntrimmed = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.textSize, ({
  mobile,
  tablet
}) => styles_lib_css_responsiveStyle_cjs.responsiveStyle({
  mobile: {
    fontSize: mobile.fontSize,
    lineHeight: mobile.lineHeight
  },
  tablet: {
    fontSize: tablet.fontSize,
    lineHeight: tablet.lineHeight
  }
}), "textSizeUntrimmed");
const headingWeight = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.headingWeight, styles_lib_utils_index_cjs.mapToProperty("fontWeight"), "headingWeight");
const heading = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.headingLevel, ({
  mobile,
  tablet
}, variant) => [styles_lib_css_capsize_css_cjs.createTextStyle({
  fontSize: mobile.fontSize,
  lineHeight: mobile.lineHeight,
  ...mobile.capsizeTrims
}, {
  "@media": {
    [styles_lib_css_responsiveStyle_cjs.breakpointQuery.tablet]: {
      fontSize: tablet.fontSize,
      lineHeight: tablet.lineHeight,
      ...tablet.capsizeTrims
    }
  }
}, `heading_${variant}`)], "heading");
const textToneVars = css.createThemeContract({
  critical: null,
  caution: null,
  info: null,
  promote: null,
  positive: null,
  brandAccent: null,
  formAccent: null,
  neutral: null,
  secondary: null,
  link: null
});
const lightContextToneVars = css.assignVars(textToneVars, {
  critical: styles_lib_themes_vars_css_cjs.vars.foregroundColor.critical,
  caution: styles_lib_themes_vars_css_cjs.vars.foregroundColor.caution,
  info: styles_lib_themes_vars_css_cjs.vars.foregroundColor.info,
  promote: styles_lib_themes_vars_css_cjs.vars.foregroundColor.promote,
  positive: styles_lib_themes_vars_css_cjs.vars.foregroundColor.positive,
  brandAccent: styles_lib_themes_vars_css_cjs.vars.foregroundColor.brandAccent,
  formAccent: styles_lib_themes_vars_css_cjs.vars.foregroundColor.formAccent,
  neutral: styles_lib_themes_vars_css_cjs.vars.foregroundColor.neutral,
  secondary: styles_lib_themes_vars_css_cjs.vars.foregroundColor.secondary,
  link: styles_lib_themes_vars_css_cjs.vars.foregroundColor.link
});
const darkContextToneVars = css.assignVars(textToneVars, {
  critical: styles_lib_themes_vars_css_cjs.vars.foregroundColor.criticalLight,
  caution: styles_lib_themes_vars_css_cjs.vars.foregroundColor.cautionLight,
  info: styles_lib_themes_vars_css_cjs.vars.foregroundColor.infoLight,
  promote: styles_lib_themes_vars_css_cjs.vars.foregroundColor.promoteLight,
  positive: styles_lib_themes_vars_css_cjs.vars.foregroundColor.positiveLight,
  brandAccent: styles_lib_themes_vars_css_cjs.vars.foregroundColor.brandAccentLight,
  formAccent: styles_lib_themes_vars_css_cjs.vars.foregroundColor.formAccentLight,
  neutral: styles_lib_themes_vars_css_cjs.vars.foregroundColor.neutralInverted,
  secondary: styles_lib_themes_vars_css_cjs.vars.foregroundColor.secondaryInverted,
  link: styles_lib_themes_vars_css_cjs.vars.foregroundColor.linkLight
});
const lightModeTone = css.styleVariants({
  light: styles_lib_css_colorModeStyle_cjs.colorModeStyle({
    lightMode: {
      vars: lightContextToneVars
    }
  }),
  dark: styles_lib_css_colorModeStyle_cjs.colorModeStyle({
    lightMode: {
      vars: darkContextToneVars
    }
  })
}, "lightModeTone");
const darkModeTone = css.styleVariants({
  light: styles_lib_css_colorModeStyle_cjs.colorModeStyle({
    darkMode: {
      vars: lightContextToneVars
    }
  }),
  dark: styles_lib_css_colorModeStyle_cjs.colorModeStyle({
    darkMode: {
      vars: darkContextToneVars
    }
  })
}, "darkModeTone");
const neutralOverrideForBackground = {
  criticalLight: "critical",
  criticalSoft: "critical",
  criticalSoftActive: "critical",
  criticalSoftHover: "critical",
  caution: "caution",
  cautionLight: "caution",
  positiveLight: "positive",
  infoLight: "info",
  promoteLight: "promote"
};
const lightModeNeutralOverride = css.styleVariants(neutralOverrideForBackground, (textTone) => styles_lib_css_colorModeStyle_cjs.colorModeStyle({
  lightMode: {
    vars: {
      [textToneVars.neutral]: textToneVars[textTone]
    }
  }
}), "lightModeNeutralOverride");
const darkModeNeutralOverride = css.styleVariants(neutralOverrideForBackground, (textTone) => styles_lib_css_colorModeStyle_cjs.colorModeStyle({
  darkMode: {
    vars: {
      [textToneVars.neutral]: textToneVars[textTone]
    }
  }
}), "darkModeNeutralOverride");
const tone = css.styleVariants(textToneVars, (toneVar) => ({
  color: toneVar
}), "tone");
const makeTouchableSpacing = (touchableHeight, textHeight) => {
  const space = cssUtils.calc(touchableHeight).subtract(textHeight).divide(2).toString();
  return {
    paddingTop: space,
    paddingBottom: space
  };
};
const touchableText = css.styleVariants(styles_lib_themes_vars_css_cjs.vars.textSize, (textDefinition) => styles_lib_css_responsiveStyle_cjs.responsiveStyle({
  mobile: makeTouchableSpacing(styles_lib_themes_vars_css_cjs.vars.touchableSize, textDefinition.mobile.lineHeight),
  tablet: makeTouchableSpacing(styles_lib_themes_vars_css_cjs.vars.touchableSize, textDefinition.tablet.lineHeight)
}), "touchableText");
__vanilla_filescope__.endFileScope();
exports.darkModeNeutralOverride = darkModeNeutralOverride;
exports.darkModeTone = darkModeTone;
exports.fontFamily = fontFamily;
exports.fontWeight = fontWeight;
exports.heading = heading;
exports.headingWeight = headingWeight;
exports.lightModeNeutralOverride = lightModeNeutralOverride;
exports.lightModeTone = lightModeTone;
exports.textSizeTrimmed = textSizeTrimmed;
exports.textSizeUntrimmed = textSizeUntrimmed;
exports.tone = tone;
exports.touchableText = touchableText;
