@xsolla/xui-typography 0.138.0 → 0.138.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/native/index.js CHANGED
@@ -90,12 +90,16 @@ var Text = ({
90
90
  );
91
91
  };
92
92
 
93
+ // ../primitives-native/src/index.tsx
94
+ var isWeb = false;
95
+ var isNative = true;
96
+
93
97
  // src/Typography.tsx
94
98
  var import_xui_core = require("@xsolla/xui-core");
95
99
  var import_jsx_runtime2 = require("react/jsx-runtime");
96
100
  var getColor = (color, theme) => {
97
101
  if (color === "inherit") {
98
- return import_xui_core.isNative ? theme?.colors?.content?.primary : void 0;
102
+ return isNative ? theme?.colors?.content?.primary : void 0;
99
103
  }
100
104
  const colorMap = {
101
105
  primary: theme?.colors?.content?.primary,
@@ -392,7 +396,7 @@ var Typography = (0, import_react.forwardRef)(
392
396
  const colorValue = getColor(color, theme);
393
397
  const contextFonts = productContext ? (0, import_xui_core.getFonts)(productContext) : theme.fonts;
394
398
  const fontFamily = isHeadingVariant(variant) ? contextFonts?.heading : contextFonts?.body;
395
- const useResponsiveCSS = import_xui_core.isWeb && variantStyles.scaleStep;
399
+ const useResponsiveCSS = isWeb && variantStyles.scaleStep;
396
400
  const responsiveFontSize = useResponsiveCSS ? import_xui_core.cssVar.fontSize(variantStyles.scaleStep) : void 0;
397
401
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
398
402
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../primitives-native/src/Text.tsx"],"sourcesContent":["export * from \"./Typography\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n isWeb,\n isNative,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2B;;;ACC3B,0BAKO;AAmEH;AAhEJ,IAAM,UAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAM,oBAAoB,CACxB,UACuB;AACvB,MAAI,UAAU,OAAW,QAAO;AAChC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,SAAS,WAAW,KAAK;AAC/B,SAAO,MAAM,MAAM,IAAI,SAAY;AACrC;AAEO,IAAM,OAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAM;AACJ,MAAI,qBAAqB,aACrB,WAAW,MAAM,GAAG,EAAE,CAAC,EAAE,QAAQ,SAAS,EAAE,EAAE,KAAK,IACnD;AAEJ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;AAAA,IACR,eAAe;AAAA,IACf,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,EAAE,MAAM,QAAI,kCAAiB,EAAE,WAAW,oBAAoB,CAAC;AACrE,UAAM,mBAAmB,qBACrB,qCAAoB,cAAc,IACjC,MAAc;AACnB,UAAM,gBAAgB,iBAAiB,SAAS,gBAAgB;AAChE,UAAM,aAAa,SAAS,OAAO,KAAK;AACxC,UAAM,eAAe,qBACjB,0BAAS,cAAc,IACtB,MAAM;AACX,UAAM,aAAa,iBAAiB,OAAO,IACvC,cAAc,UACd,cAAc;AAElB,UAAM,mBAAmB,yBAAS,cAAc;AAEhD,UAAM,qBAAqB,mBACvB,uBAAO,SAAS,cAAc,SAAU,IACxC;AACJ,UAAM,uBAAuB,mBACzB,wBAAwB,aAAa,IACrC;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["RNText","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/index.tsx"],"sourcesContent":["export * from \"./Typography\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2B;;;ACC3B,0BAKO;AAmEH;AAhEJ,IAAM,UAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAM,oBAAoB,CACxB,UACuB;AACvB,MAAI,UAAU,OAAW,QAAO;AAChC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,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AAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["RNText","import_jsx_runtime"]}
package/native/index.mjs CHANGED
@@ -67,13 +67,15 @@ var Text = ({
67
67
  );
68
68
  };
69
69
 
70
+ // ../primitives-native/src/index.tsx
71
+ var isWeb = false;
72
+ var isNative = true;
73
+
70
74
  // src/Typography.tsx
71
75
  import {
72
76
  useResolvedTheme,
73
77
  getTypographyTokens,
74
78
  getFonts,
75
- isWeb,
76
- isNative,
77
79
  cssVar
78
80
  } from "@xsolla/xui-core";
79
81
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Typography.tsx","../../../primitives-native/src/Text.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n isWeb,\n isNative,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACC3B;AAAA,EACE,QAAQ;AAAA,EAGR;AAAA,OACK;AAmEH;AAhEJ,IAAM,UAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAM,oBAAoB,CACxB,UACuB;AACvB,MAAI,UAAU,OAAW,QAAO;AAChC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,SAAS,WAAW,KAAK;AAC/B,SAAO,MAAM,MAAM,IAAI,SAAY;AACrC;AAEO,IAAM,OAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAM;AACJ,MAAI,qBAAqB,aACrB,WAAW,MAAM,GAAG,EAAE,CAAC,EAAE,QAAQ,SAAS,EAAE,EAAE,KAAK,IACnD;AAEJ,MACE,uBAAuB,gBACvB,uBAAuB,qBACvB,uBAAuB,iBACvB;AACA,yBAAqB;AAAA,EACvB;AAEA,QAAM,gBAAgB,WAAW,QAAQ,SAAS;AAElD,QAAM,YAAuB;AAAA,IAC3B,OAAO,SAAS,eAAe;AAAA,IAC/B,UAAU,OAAO,aAAa,WAAW,WAAW;AAAA,IACpD;AAAA,IACA,YAAY;AAAA,IACZ,oBAAoB,MAAM;AAAA,IAC1B,WAAW,aAAa,eAAe;AAAA,IACvC,YAAY,kBAAkB,cAAc,eAAe,UAAU;AAAA,IACrE,WAAW;AAAA,MACT,eAAe;AAAA,IACjB;AAAA,IACA,cAAc;AAAA,MACZ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AAM,aAAa,iBAAiB,OAAO,IACvC,cAAc,UACd,cAAc;AAElB,UAAM,mBAAmB,SAAS,cAAc;AAEhD,UAAM,qBAAqB,mBACvB,OAAO,SAAS,cAAc,SAAU,IACxC;AACJ,UAAM,uBAAuB,mBACzB,wBAAwB,aAAa,IACrC;AAEJ,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["jsx"]}
1
+ {"version":3,"sources":["../../src/Typography.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/index.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACC3B;AAAA,EACE,QAAQ;AAAA,EAGR;AAAA,OACK;AAmEH;AAhEJ,IAAM,UAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAM,oBAAoB,CACxB,UACuB;AACvB,MAAI,UAAU,OAAW,QAAO;AAChC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,SAAS,WAAW,KAAK;AAC/B,SAAO,MAAM,MAAM,IAAI,SAAY;AACrC;AAEO,IAAM,OAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAM;AACJ,MAAI,qBAAqB,aACrB,WAAW,MAAM,GAAG,EAAE,CAAC,EAAE,QAAQ,SAAS,EAAE,EAAE,KAAK,IACnD;AAEJ,MACE,uBAAuB,gBACvB,uBAAuB,qBACvB,uBAAuB,iBACvB;AACA,yBAAqB;AAAA,EACvB;AAEA,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AAAA,IACf,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,EAAE,MAAM,IAAI,iBAAiB,EAAE,WAAW,oBAAoB,CAAC;AACrE,UAAM,mBAAmB,iBACrB,oBAAoB,cAAc,IACjC,MAAc;AACnB,UAAM,gBAAgB,iBAAiB,SAAS,gBAAgB;AAChE,UAAM,aAAa,SAAS,OAAO,KAAK;AACxC,UAAM,eAAe,iBACjB,SAAS,cAAc,IACtB,MAAM;AACX,UAAM,aAAa,iBAAiB,OAAO,IACvC,cAAc,UACd,cAAc;AAElB,UAAM,mBAAmB,SAAS,cAAc;AAEhD,UAAM,qBAAqB,mBACvB,OAAO,SAAS,cAAc,SAAU,IACxC;AACJ,UAAM,uBAAuB,mBACzB,wBAAwB,aAAa,IACrC;AAEJ,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["jsx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-typography",
3
- "version": "0.138.0",
3
+ "version": "0.138.1",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-core": "0.138.0",
17
- "@xsolla/xui-primitives-core": "0.138.0"
16
+ "@xsolla/xui-core": "0.138.1",
17
+ "@xsolla/xui-primitives-core": "0.138.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -140,12 +140,16 @@ var Text = ({
140
140
  );
141
141
  };
142
142
 
143
+ // ../primitives-web/src/index.tsx
144
+ var isWeb = true;
145
+ var isNative = false;
146
+
143
147
  // src/Typography.tsx
144
148
  var import_xui_core = require("@xsolla/xui-core");
145
149
  var import_jsx_runtime2 = require("react/jsx-runtime");
146
150
  var getColor = (color, theme) => {
147
151
  if (color === "inherit") {
148
- return import_xui_core.isNative ? theme?.colors?.content?.primary : void 0;
152
+ return isNative ? theme?.colors?.content?.primary : void 0;
149
153
  }
150
154
  const colorMap = {
151
155
  primary: theme?.colors?.content?.primary,
@@ -442,7 +446,7 @@ var Typography = (0, import_react2.forwardRef)(
442
446
  const colorValue = getColor(color, theme);
443
447
  const contextFonts = productContext ? (0, import_xui_core.getFonts)(productContext) : theme.fonts;
444
448
  const fontFamily = isHeadingVariant(variant) ? contextFonts?.heading : contextFonts?.body;
445
- const useResponsiveCSS = import_xui_core.isWeb && variantStyles.scaleStep;
449
+ const useResponsiveCSS = isWeb && variantStyles.scaleStep;
446
450
  const responsiveFontSize = useResponsiveCSS ? import_xui_core.cssVar.fontSize(variantStyles.scaleStep) : void 0;
447
451
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
448
452
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../primitives-web/src/filterDOMProps.ts","../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../primitives-web/src/Text.tsx"],"sourcesContent":["export * from \"./Typography\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n isWeb,\n isNative,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;;;ACA3B,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA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,0BAAS,cAAc,IACtB,MAAM;AACX,UAAM,aAAa,iBAAiB,OAAO,IACvC,cAAc,UACd,cAAc;AAElB,UAAM,mBAAmB,yBAAS,cAAc;AAEhD,UAAM,qBAAqB,mBACvB,uBAAO,SAAS,cAAc,SAAU,IACxC;AACJ,UAAM,uBAAuB,mBACzB,wBAAwB,aAAa,IACrC;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["import_react","React","styled","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../primitives-web/src/filterDOMProps.ts","../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/index.tsx"],"sourcesContent":["export * from \"./Typography\";\nexport * from \"./types\";\n","import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA2B;;;ACA3B,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SA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qB,mBACvB,uBAAO,SAAS,cAAc,SAAU,IACxC;AACJ,UAAM,uBAAuB,mBACzB,wBAAwB,aAAa,IACrC;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["import_react","React","styled","import_jsx_runtime"]}
package/web/index.mjs CHANGED
@@ -104,13 +104,15 @@ var Text = ({
104
104
  );
105
105
  };
106
106
 
107
+ // ../primitives-web/src/index.tsx
108
+ var isWeb = true;
109
+ var isNative = false;
110
+
107
111
  // src/Typography.tsx
108
112
  import {
109
113
  useResolvedTheme,
110
114
  getTypographyTokens,
111
115
  getFonts,
112
- isWeb,
113
- isNative,
114
116
  cssVar
115
117
  } from "@xsolla/xui-core";
116
118
  import { jsx as jsx2 } from "react/jsx-runtime";
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Typography.tsx","../../../primitives-web/src/filterDOMProps.ts","../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../primitives-web/src/Text.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n isWeb,\n isNative,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACA3B,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAA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rC;AAEJ,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,UAAU,mBAAmB,SAAY,cAAc;AAAA,QACvD,YAAY,cAAc;AAAA,QAC1B;AAAA,QACA,eAAe,SAAS,IAAI;AAAA,QAC5B,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA,WAAW,UAAU,YAAY,SAAY;AAAA,UAC7C,GAAI,mBACA,EAAE,UAAU,oBAAoB,YAAY,qBAAqB,IACjE,EAAE,YAAY,cAAc,WAAW;AAAA,UAC3C,GAAI,UAAU;AAAA,YACZ,UAAU;AAAA,YACV,cAAc;AAAA,YACd,YAAY;AAAA,UACd;AAAA,UACA,GAAG,KAAK;AAAA,QACV;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":["jsx"]}
1
+ {"version":3,"sources":["../../src/Typography.tsx","../../../primitives-web/src/filterDOMProps.ts","../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/index.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Text, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n getTypographyTokens,\n getFonts,\n cssVar,\n} from \"@xsolla/xui-core\";\nimport type { ColorType, TypographyProps, VariantType } from \"./types\";\n\nconst getColor = (\n color: ColorType | string,\n theme: any\n): string | undefined => {\n if (color === \"inherit\") {\n return isNative ? theme?.colors?.content?.primary : undefined;\n }\n\n const colorMap: Record<string, string> = {\n primary: theme?.colors?.content?.primary,\n secondary: theme?.colors?.content?.secondary,\n tertiary: theme?.colors?.content?.tertiary,\n brand: theme?.colors?.content?.brand?.primary,\n brandSecondary: theme?.colors?.content?.brand?.secondary,\n success: theme?.colors?.content?.success?.primary,\n warning: theme?.colors?.content?.warning?.primary,\n alert: theme?.colors?.content?.alert?.primary,\n neutral: theme?.colors?.content?.neutral?.primary,\n };\n\n return colorMap[color] || color;\n};\n\nconst isHeadingVariant = (variant: VariantType): boolean =>\n variant === \"h1\" ||\n variant === \"h2\" ||\n variant === \"h3\" ||\n variant === \"h4\" ||\n variant === \"h5\" ||\n variant === \"display\";\n\nconst bodyMap: Record<string, string> = {\n bodyLg: \"body-lg\",\n bodyLgAccent: \"body-lg\",\n bodyLgParagraph: \"body-lg\",\n bodyMd: \"body-md\",\n bodyMdAccent: \"body-md\",\n bodyMdParagraph: \"body-md\",\n bodySm: \"body-sm\",\n bodySmAccent: \"body-sm\",\n bodySmParagraph: \"body-sm\",\n bodyXs: \"body-xs\",\n bodyXsAccent: \"body-xs\",\n bodyXsParagraph: \"body-xs\",\n bodyXxs: \"body-xxs\",\n bodyXxsAccent: \"body-xxs\",\n bodyXxsParagraph: \"body-xxs\",\n};\n\nconst headingMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n};\n\nconst getVariantStyles = (variant: VariantType, typographyTokens?: any) => {\n if (typographyTokens) {\n if (headingMap[variant]) {\n const token = typographyTokens.heading[headingMap[variant]];\n if (token) {\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n }\n\n if (variant === \"display\" && typographyTokens.basic?.display) {\n const token = typographyTokens.basic.display;\n return {\n fontSize: token.fontSize,\n fontWeight: String(token.fontWeight),\n lineHeight: token.lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory: token.lineHeightCategory,\n };\n }\n\n const bodyKey = bodyMap[variant];\n if (bodyKey && typographyTokens.basic?.[bodyKey]) {\n const token = typographyTokens.basic[bodyKey];\n let fontWeight = token.fontWeight;\n let lineHeight = token.lineHeight;\n let lineHeightCategory = token.lineHeightCategory;\n let lineHeightScaleStep: string | undefined;\n\n if (variant.includes(\"Accent\") && token.accent) {\n fontWeight = token.accent.fontWeight;\n }\n\n if (variant.includes(\"Paragraph\") && token.paragraph) {\n lineHeight = token.paragraph.lineHeight;\n lineHeightCategory = \"text\";\n lineHeightScaleStep = token.paragraph.lineHeightScaleStep;\n }\n\n return {\n fontSize: token.fontSize,\n fontWeight: String(fontWeight),\n lineHeight,\n scaleStep: token.scaleStep,\n lineHeightCategory,\n lineHeightScaleStep,\n };\n }\n }\n\n switch (variant) {\n case \"h1\":\n return {\n fontSize: 56,\n fontWeight: \"400\",\n lineHeight: \"56px\",\n scaleStep: \"650\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h2\":\n return {\n fontSize: 48,\n fontWeight: \"400\",\n lineHeight: \"48px\",\n scaleStep: \"550\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h3\":\n return {\n fontSize: 32,\n fontWeight: \"400\",\n lineHeight: \"32px\",\n scaleStep: \"350\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h4\":\n return {\n fontSize: 24,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"250\",\n lineHeightCategory: \"display\" as const,\n };\n case \"h5\":\n return {\n fontSize: 20,\n fontWeight: \"600\",\n lineHeight: \"20px\",\n scaleStep: \"200\",\n lineHeightCategory: \"display\" as const,\n };\n case \"display\":\n return {\n fontSize: 64,\n fontWeight: \"400\",\n lineHeight: \"64px\",\n scaleStep: \"750\",\n lineHeightCategory: \"display\" as const,\n };\n case \"bodyLg\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgAccent\":\n return {\n fontSize: 18,\n fontWeight: \"500\",\n lineHeight: \"24px\",\n scaleStep: \"175\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyLgParagraph\":\n return {\n fontSize: 18,\n fontWeight: \"400\",\n lineHeight: \"26px\",\n scaleStep: \"175\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyMd\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdAccent\":\n return {\n fontSize: 16,\n fontWeight: \"500\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyMdParagraph\":\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"22px\",\n scaleStep: \"150\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodySm\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmAccent\":\n return {\n fontSize: 14,\n fontWeight: \"500\",\n lineHeight: \"18px\",\n scaleStep: \"125\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodySmParagraph\":\n return {\n fontSize: 14,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"125\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXs\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsAccent\":\n return {\n fontSize: 12,\n fontWeight: \"500\",\n lineHeight: \"16px\",\n scaleStep: \"100\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXsParagraph\":\n return {\n fontSize: 12,\n fontWeight: \"400\",\n lineHeight: \"18px\",\n scaleStep: \"100\",\n lineHeightCategory: \"text\" as const,\n };\n case \"bodyXxs\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsAccent\":\n return {\n fontSize: 10,\n fontWeight: \"500\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"compact\" as const,\n };\n case \"bodyXxsParagraph\":\n return {\n fontSize: 10,\n fontWeight: \"400\",\n lineHeight: \"14px\",\n scaleStep: \"75\",\n lineHeightCategory: \"text\" as const,\n };\n default:\n return {\n fontSize: 16,\n fontWeight: \"400\",\n lineHeight: \"20px\",\n scaleStep: \"150\",\n lineHeightCategory: \"compact\" as const,\n };\n }\n};\n\nfunction getResponsiveLineHeight(\n styles: ReturnType<typeof getVariantStyles>\n): string | undefined {\n const step = styles.lineHeightScaleStep || styles.scaleStep;\n if (!step) return undefined;\n\n const cat = styles.lineHeightCategory;\n if (cat === \"display\") return cssVar.lhDisplay(step);\n if (cat === \"text\") return cssVar.lhText(step);\n return cssVar.lhCompact(step);\n}\n\nexport const Typography = forwardRef<any, TypographyProps>(\n (\n {\n children,\n align = \"inherit\",\n noWrap = false,\n variant = \"bodyMd\",\n color = \"inherit\",\n marginBottom = 0,\n marginTop = 0,\n as,\n productContext,\n themeMode,\n themeProductContext,\n ...rest\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const typographyTokens = productContext\n ? getTypographyTokens(productContext)\n : (theme as any).typographyTokens;\n const variantStyles = getVariantStyles(variant, typographyTokens);\n const colorValue = getColor(color, theme);\n const contextFonts = productContext\n ? getFonts(productContext)\n : (theme.fonts as Record<string, string>);\n const fontFamily = isHeadingVariant(variant)\n ? contextFonts?.heading\n : contextFonts?.body;\n\n const useResponsiveCSS = isWeb && variantStyles.scaleStep;\n\n const responsiveFontSize = useResponsiveCSS\n ? cssVar.fontSize(variantStyles.scaleStep!)\n : undefined;\n const responsiveLineHeight = useResponsiveCSS\n ? getResponsiveLineHeight(variantStyles)\n : undefined;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={as}\n color={colorValue}\n fontSize={useResponsiveCSS ? undefined : variantStyles.fontSize}\n fontWeight={variantStyles.fontWeight}\n fontFamily={fontFamily}\n numberOfLines={noWrap ? 1 : undefined}\n style={{\n marginTop,\n marginBottom,\n textAlign: align === \"inherit\" ? undefined : align,\n ...(useResponsiveCSS\n ? { fontSize: responsiveFontSize, lineHeight: responsiveLineHeight }\n : { lineHeight: variantStyles.lineHeight }),\n ...(noWrap && {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }),\n ...rest.style,\n }}\n >\n {children}\n </Text>\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACA3B,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;AACxD,QAAM,YAAY,MAAM;AAAA,IACtB,CAAC,EAAE,UAAU,aAAa,GAAG,MAAM,GAAG,QAAQ;AAC5C,YAAM,MAAO,eAA0B;AACvC,YAAM,YAAqC,CAAC;AAC5C,iBAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AACpC,YAAI,kBAAkB,GAAG,GA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