@xsolla/xui-typography 0.153.0 → 0.153.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/README.md CHANGED
@@ -38,7 +38,7 @@ export default function QuickStart() {
38
38
  | `noWrap` | `boolean` | `false` | Single-line truncation with ellipsis. |
39
39
  | `marginTop` | `number` | `0` | Top margin in pixels. |
40
40
  | `marginBottom` | `number` | `0` | Bottom margin in pixels. |
41
- | `as` | `ElementType` | - | HTML element to render (web only). |
41
+ | `as` | `ElementType` | Auto-mapped for headings | HTML element to render (web only). Heading variants (h1-h5) automatically render as semantic HTML elements (`<h1>`-`<h5>`). Can be overridden for any variant. |
42
42
  | `productContext` | `"b2c" \| "b2b" \| "paystation" \| "presentation"` | - | Override the product context for this instance only. |
43
43
  | `aria-hidden` | `boolean` | - | Hide from assistive technology. |
44
44
  | `aria-live` | `"polite" \| "assertive" \| "off"` | - | Live-region politeness. |
@@ -170,6 +170,51 @@ export default function ContextOverride() {
170
170
  }
171
171
  ```
172
172
 
173
+ ### Semantic HTML
174
+
175
+ Heading variants automatically render as semantic HTML for accessibility and SEO:
176
+
177
+ ```tsx
178
+ import * as React from 'react';
179
+ import { Typography } from '@xsolla/xui-typography';
180
+
181
+ export default function SemanticHeadings() {
182
+ return (
183
+ <article>
184
+ <Typography variant="h1">Main Article Title</Typography>
185
+ <Typography variant="bodyMdParagraph">
186
+ This is the introduction paragraph.
187
+ </Typography>
188
+
189
+ <Typography variant="h2">Section Title</Typography>
190
+ <Typography variant="bodyMdParagraph">
191
+ This section contains important content.
192
+ </Typography>
193
+
194
+ <Typography variant="h3">Subsection</Typography>
195
+ <Typography variant="bodyMd">Some additional details.</Typography>
196
+ </article>
197
+ );
198
+
199
+ // Renders as:
200
+ // <article>
201
+ // <h1 class="...">Main Article Title</h1>
202
+ // <p class="...">This is the introduction paragraph.</p>
203
+ // <h2 class="...">Section Title</h2>
204
+ // <p class="...">This section contains important content.</p>
205
+ // <h3 class="...">Subsection</h3>
206
+ // <span class="...">Some additional details.</span>
207
+ // </article>
208
+ }
209
+ ```
210
+
211
+ You can override the default element with the `as` prop:
212
+
213
+ ```tsx
214
+ // Render h1 styling as a div instead of h1
215
+ <Typography variant="h1" as="div">Styled as heading but rendered as div</Typography>
216
+ ```
217
+
173
218
  ## Behaviour
174
219
 
175
220
  - Resolved sizes, weights, and line heights come from the active product context. With no override, the provider's `initialProductContext` (defaulting to `b2b`) is used.
@@ -178,6 +223,8 @@ export default function ContextOverride() {
178
223
 
179
224
  ## Accessibility
180
225
 
181
- - Use semantic heading variants (`h1`-`h5`) in document order, and pair `as` with the appropriate HTML tag on web.
226
+ - Heading variants (`h1`-`h5`) automatically render as semantic HTML elements (`<h1>`-`<h5>`) for proper document structure and screen reader navigation.
227
+ - Use heading variants in document order to create a logical heading hierarchy.
228
+ - Body variants render as `<span>` by default; use the `as` prop to render as `<p>` for paragraph text or other semantic elements as needed.
182
229
  - `aria-live` is available for live-region announcements when content updates dynamically.
183
230
  - Avoid using `noWrap` on copy that the user must read in full; prefer wrapping or a tooltip for the truncated value.
package/native/index.js CHANGED
@@ -115,6 +115,16 @@ var getColor = (color, theme) => {
115
115
  return colorMap[color] || color;
116
116
  };
117
117
  var isHeadingVariant = (variant) => variant === "h1" || variant === "h2" || variant === "h3" || variant === "h4" || variant === "h5" || variant === "display";
118
+ var getDefaultElement = (variant) => {
119
+ const elementMap = {
120
+ h1: "h1",
121
+ h2: "h2",
122
+ h3: "h3",
123
+ h4: "h4",
124
+ h5: "h5"
125
+ };
126
+ return elementMap[variant];
127
+ };
118
128
  var bodyMap = {
119
129
  bodyLg: "body-lg",
120
130
  bodyLgAccent: "body-lg",
@@ -399,12 +409,13 @@ var Typography = (0, import_react.forwardRef)(
399
409
  const useResponsiveCSS = isWeb && variantStyles.scaleStep;
400
410
  const responsiveFontSize = useResponsiveCSS ? import_xui_core.cssVar.fontSize(variantStyles.scaleStep) : void 0;
401
411
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
412
+ const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;
402
413
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
403
414
  Text,
404
415
  {
405
416
  ...rest,
406
417
  ref,
407
- as,
418
+ as: resolvedAs,
408
419
  color: colorValue,
409
420
  fontSize: useResponsiveCSS ? void 0 : variantStyles.fontSize,
410
421
  fontWeight: variantStyles.fontWeight,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/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,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,+BAAW,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,eAAe;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,oBAAoB,O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mBAAmB,SAAS,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","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/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 getDefaultElement = (variant: VariantType): string | undefined => {\n const elementMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n };\n return elementMap[variant];\n};\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 const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={resolvedAs}\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,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,G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AAA,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"]}
package/native/index.mjs CHANGED
@@ -97,6 +97,16 @@ var getColor = (color, theme) => {
97
97
  return colorMap[color] || color;
98
98
  };
99
99
  var isHeadingVariant = (variant) => variant === "h1" || variant === "h2" || variant === "h3" || variant === "h4" || variant === "h5" || variant === "display";
100
+ var getDefaultElement = (variant) => {
101
+ const elementMap = {
102
+ h1: "h1",
103
+ h2: "h2",
104
+ h3: "h3",
105
+ h4: "h4",
106
+ h5: "h5"
107
+ };
108
+ return elementMap[variant];
109
+ };
100
110
  var bodyMap = {
101
111
  bodyLg: "body-lg",
102
112
  bodyLgAccent: "body-lg",
@@ -381,12 +391,13 @@ var Typography = forwardRef(
381
391
  const useResponsiveCSS = isWeb && variantStyles.scaleStep;
382
392
  const responsiveFontSize = useResponsiveCSS ? cssVar.fontSize(variantStyles.scaleStep) : void 0;
383
393
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
394
+ const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;
384
395
  return /* @__PURE__ */ jsx2(
385
396
  Text,
386
397
  {
387
398
  ...rest,
388
399
  ref,
389
- as,
400
+ as: resolvedAs,
390
401
  color: colorValue,
391
402
  fontSize: useResponsiveCSS ? void 0 : variantStyles.fontSize,
392
403
  fontWeight: variantStyles.fontWeight,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Typography.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/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;AACr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AAY,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","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/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 getDefaultElement = (variant: VariantType): string | undefined => {\n const elementMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n };\n return elementMap[variant];\n};\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 const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={resolvedAs}\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,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;A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AAI,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,UAAM,aAAa,QAAQ,MAAM,kBAAkB,OAAO,IAAI;AAE9D,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,IAAI;AAAA,QACJ,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.153.0",
3
+ "version": "0.153.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.153.0",
17
- "@xsolla/xui-primitives-core": "0.153.0"
16
+ "@xsolla/xui-core": "0.153.1",
17
+ "@xsolla/xui-primitives-core": "0.153.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -165,6 +165,16 @@ var getColor = (color, theme) => {
165
165
  return colorMap[color] || color;
166
166
  };
167
167
  var isHeadingVariant = (variant) => variant === "h1" || variant === "h2" || variant === "h3" || variant === "h4" || variant === "h5" || variant === "display";
168
+ var getDefaultElement = (variant) => {
169
+ const elementMap = {
170
+ h1: "h1",
171
+ h2: "h2",
172
+ h3: "h3",
173
+ h4: "h4",
174
+ h5: "h5"
175
+ };
176
+ return elementMap[variant];
177
+ };
168
178
  var bodyMap = {
169
179
  bodyLg: "body-lg",
170
180
  bodyLgAccent: "body-lg",
@@ -449,12 +459,13 @@ var Typography = (0, import_react2.forwardRef)(
449
459
  const useResponsiveCSS = isWeb && variantStyles.scaleStep;
450
460
  const responsiveFontSize = useResponsiveCSS ? import_xui_core.cssVar.fontSize(variantStyles.scaleStep) : void 0;
451
461
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
462
+ const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;
452
463
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
453
464
  Text,
454
465
  {
455
466
  ...rest,
456
467
  ref,
457
- as,
468
+ as: resolvedAs,
458
469
  color: colorValue,
459
470
  fontSize: useResponsiveCSS ? void 0 : variantStyles.fontSize,
460
471
  fontWeight: variantStyles.fontWeight,
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Typography.tsx","../../../../foundation/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","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/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,KA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AW,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,SAAS,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","../../../../foundation/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","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/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 getDefaultElement = (variant: VariantType): string | undefined => {\n const elementMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n };\n return elementMap[variant];\n};\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 const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={resolvedAs}\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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EAEJ;AACF;AAEA,WAAW,cAAc;","names":["import_react","React","styled","import_jsx_runtime"]}
package/web/index.mjs CHANGED
@@ -134,6 +134,16 @@ var getColor = (color, theme) => {
134
134
  return colorMap[color] || color;
135
135
  };
136
136
  var isHeadingVariant = (variant) => variant === "h1" || variant === "h2" || variant === "h3" || variant === "h4" || variant === "h5" || variant === "display";
137
+ var getDefaultElement = (variant) => {
138
+ const elementMap = {
139
+ h1: "h1",
140
+ h2: "h2",
141
+ h3: "h3",
142
+ h4: "h4",
143
+ h5: "h5"
144
+ };
145
+ return elementMap[variant];
146
+ };
137
147
  var bodyMap = {
138
148
  bodyLg: "body-lg",
139
149
  bodyLgAccent: "body-lg",
@@ -418,12 +428,13 @@ var Typography = forwardRef(
418
428
  const useResponsiveCSS = isWeb && variantStyles.scaleStep;
419
429
  const responsiveFontSize = useResponsiveCSS ? cssVar.fontSize(variantStyles.scaleStep) : void 0;
420
430
  const responsiveLineHeight = useResponsiveCSS ? getResponsiveLineHeight(variantStyles) : void 0;
431
+ const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;
421
432
  return /* @__PURE__ */ jsx2(
422
433
  Text,
423
434
  {
424
435
  ...rest,
425
436
  ref,
426
- as,
437
+ as: resolvedAs,
427
438
  color: colorValue,
428
439
  fontSize: useResponsiveCSS ? void 0 : variantStyles.fontSize,
429
440
  fontWeight: variantStyles.fontWeight,
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Typography.tsx","../../../../foundation/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","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/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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AAS,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","../../../../foundation/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","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/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 getDefaultElement = (variant: VariantType): string | undefined => {\n const elementMap: Record<string, string> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n };\n return elementMap[variant];\n};\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 const resolvedAs = isWeb ? as || getDefaultElement(variant) : as;\n\n return (\n <Text\n {...rest}\n ref={ref}\n as={resolvedAs}\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,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