react-native-terra-ui 0.13.1 → 0.13.3

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/module/components/accordion/parts/AccordionContent.js +2 -2
  3. package/lib/module/components/accordion/parts/AccordionContent.js.map +1 -1
  4. package/lib/module/components/accordion/parts/AccordionTrigger.js +4 -4
  5. package/lib/module/components/accordion/parts/AccordionTrigger.js.map +1 -1
  6. package/lib/module/components/avatar/Avatar.js +3 -3
  7. package/lib/module/components/avatar/Avatar.js.map +1 -1
  8. package/lib/module/components/badge/Badge.js +2 -2
  9. package/lib/module/components/badge/Badge.js.map +1 -1
  10. package/lib/module/components/button/Button.js +3 -3
  11. package/lib/module/components/button/Button.js.map +1 -1
  12. package/lib/module/components/chip/Chip.js +2 -2
  13. package/lib/module/components/chip/Chip.js.map +1 -1
  14. package/lib/module/components/empty-state/EmptyState.js +6 -6
  15. package/lib/module/components/empty-state/EmptyState.js.map +1 -1
  16. package/lib/module/components/header/parts/HeaderBar.js +7 -13
  17. package/lib/module/components/header/parts/HeaderBar.js.map +1 -1
  18. package/lib/module/components/header/variants/LargeTitleHeader/index.js +8 -0
  19. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  20. package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js +11 -20
  21. package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js.map +1 -1
  22. package/lib/module/components/header/variants/TitleHeader/index.js +4 -0
  23. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  24. package/lib/module/components/image/Image.js +11 -5
  25. package/lib/module/components/image/Image.js.map +1 -1
  26. package/lib/module/components/image/utils.js +11 -0
  27. package/lib/module/components/image/utils.js.map +1 -0
  28. package/lib/module/components/input/parts/InputField.js +3 -3
  29. package/lib/module/components/input/parts/InputField.js.map +1 -1
  30. package/lib/module/components/surface/Surface.js +1 -1
  31. package/lib/module/components/text/Text.js +30 -8
  32. package/lib/module/components/text/Text.js.map +1 -1
  33. package/lib/module/components/toast/Toast.js +2 -2
  34. package/lib/module/components/toast/Toast.js.map +1 -1
  35. package/lib/module/components/toolbar/Toolbar.js +2 -2
  36. package/lib/module/components/toolbar/Toolbar.js.map +1 -1
  37. package/lib/module/theme/tokens/primitives.js +90 -84
  38. package/lib/module/theme/tokens/primitives.js.map +1 -1
  39. package/lib/typescript/src/components/header/parts/HeaderBar.d.ts +4 -1
  40. package/lib/typescript/src/components/header/parts/HeaderBar.d.ts.map +1 -1
  41. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -1
  42. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  43. package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts +1 -1
  44. package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts.map +1 -1
  45. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +9 -2
  46. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  47. package/lib/typescript/src/components/image/Image.d.ts +3 -3
  48. package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
  49. package/lib/typescript/src/components/image/index.d.ts +1 -1
  50. package/lib/typescript/src/components/image/index.d.ts.map +1 -1
  51. package/lib/typescript/src/components/image/types.d.ts +7 -0
  52. package/lib/typescript/src/components/image/types.d.ts.map +1 -1
  53. package/lib/typescript/src/components/image/utils.d.ts +3 -0
  54. package/lib/typescript/src/components/image/utils.d.ts.map +1 -0
  55. package/lib/typescript/src/components/surface/Surface.d.ts +1 -1
  56. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  57. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  58. package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -1
  59. package/lib/typescript/src/theme/tokens/primitives.d.ts +60 -65
  60. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  61. package/lib/typescript/src/theme/types.d.ts +8 -2
  62. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  63. package/package.json +1 -1
  64. package/src/components/accordion/parts/AccordionContent.tsx +2 -2
  65. package/src/components/accordion/parts/AccordionTrigger.tsx +2 -2
  66. package/src/components/avatar/Avatar.tsx +3 -3
  67. package/src/components/badge/Badge.tsx +2 -2
  68. package/src/components/button/Button.tsx +3 -3
  69. package/src/components/chip/Chip.tsx +2 -2
  70. package/src/components/empty-state/EmptyState.tsx +3 -3
  71. package/src/components/header/parts/HeaderBar.tsx +10 -13
  72. package/src/components/header/variants/LargeTitleHeader/index.tsx +13 -0
  73. package/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.tsx +14 -22
  74. package/src/components/header/variants/TitleHeader/index.tsx +12 -1
  75. package/src/components/image/Image.tsx +7 -4
  76. package/src/components/image/index.ts +1 -1
  77. package/src/components/image/types.ts +8 -0
  78. package/src/components/image/utils.ts +11 -0
  79. package/src/components/input/parts/InputField.tsx +4 -4
  80. package/src/components/surface/Surface.tsx +1 -1
  81. package/src/components/text/Text.tsx +30 -11
  82. package/src/components/toast/Toast.tsx +11 -2
  83. package/src/components/toolbar/Toolbar.tsx +2 -2
  84. package/src/theme/tokens/primitives.ts +90 -84
  85. package/src/theme/types.ts +25 -6
@@ -1,7 +1,15 @@
1
1
  import type { RadiusKey, TerraImageProps } from "#theme/types";
2
2
 
3
+ /** Width-to-height ratio. A number is used as is; `"3:4"` means 3 wide by 4 tall. */
4
+ export type ImageAspect = number | "1:1" | "3:4" | "16:9";
5
+
3
6
  export interface ImageProps extends TerraImageProps {
4
7
  width?: number;
5
8
  height?: number;
9
+ /**
10
+ * Ratio that derives the missing dimension from the one given. Ignored when
11
+ * both `width` and `height` are set.
12
+ */
13
+ aspect?: ImageAspect;
6
14
  radius?: RadiusKey;
7
15
  }
@@ -0,0 +1,11 @@
1
+ import type { ImageAspect } from "./types";
2
+
3
+ const PRESET_RATIOS: Record<Exclude<ImageAspect, number>, number> = {
4
+ "1:1": 1,
5
+ "3:4": 3 / 4,
6
+ "16:9": 16 / 9,
7
+ };
8
+
9
+ export function toAspectRatio(aspect: ImageAspect | undefined) {
10
+ return typeof aspect === "string" ? PRESET_RATIOS[aspect] : aspect;
11
+ }
@@ -9,10 +9,10 @@ import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
9
9
  import type { InputBaseProps, InputSize } from "../types";
10
10
 
11
11
  /** Typographic role of the text, per size. */
12
- const TEXT_VARIANT: Record<InputSize, "body-sm" | "body-md" | "body-lg"> = {
13
- sm: "body-sm",
14
- md: "body-md",
15
- lg: "body-lg",
12
+ const TEXT_VARIANT: Record<InputSize, "subheadline" | "callout" | "body"> = {
13
+ sm: "subheadline",
14
+ md: "callout",
15
+ lg: "body",
16
16
  };
17
17
 
18
18
  /**
@@ -64,7 +64,7 @@ const resolveElevation = (variant: SurfaceVariant, elevation?: ElevationKey): El
64
64
  * @example
65
65
  * ```tsx
66
66
  * <Surface variant="raised" elevation="md" p="4" radius="lg">
67
- * <Text variant="title-sm">Card title</Text>
67
+ * <Text variant="headline">Card title</Text>
68
68
  * </Surface>
69
69
  * ```
70
70
  */
@@ -7,6 +7,7 @@ import type {
7
7
  ColorToken,
8
8
  FontWeightToken,
9
9
  HeadingTextVariant,
10
+ LegacyTextVariant,
10
11
  RoleTextVariant,
11
12
  TextVariant,
12
13
  } from "#theme/types";
@@ -17,22 +18,40 @@ import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
17
18
  export type TextAlign = "left" | "center" | "right" | "justify";
18
19
 
19
20
  const HEADING_VARIANT_ALIAS: Record<HeadingTextVariant, RoleTextVariant> = {
20
- h1: "headline-lg",
21
- h2: "headline-md",
22
- h3: "headline-sm",
23
- h4: "title-lg",
24
- h5: "title-md",
25
- h6: "title-sm",
21
+ h1: "large-title",
22
+ h2: "title-1",
23
+ h3: "title-2",
24
+ h4: "title-3",
25
+ h5: "headline",
26
+ h6: "callout",
26
27
  };
27
28
 
29
+ // Pre-0.14 names, mapped to the nearest role on the iOS-style scale. Only the
30
+ // name is aliased; a legacy variant takes the new role's weight and cap.
31
+ const LEGACY_VARIANT_ALIAS: Record<LegacyTextVariant, RoleTextVariant> = {
32
+ "display-lg": "display",
33
+ "display-md": "display",
34
+ "display-sm": "large-title",
35
+ "headline-lg": "title-1",
36
+ "headline-md": "title-2",
37
+ "headline-sm": "title-2",
38
+ "title-lg": "title-3",
39
+ "title-md": "headline",
40
+ "title-sm": "headline",
41
+ "body-lg": "body",
42
+ "body-md": "body",
43
+ "body-sm": "subheadline",
44
+ caption: "caption-1",
45
+ };
46
+
47
+ const VARIANT_ALIAS: Record<string, RoleTextVariant> = { ...HEADING_VARIANT_ALIAS, ...LEGACY_VARIANT_ALIAS };
48
+
28
49
  function resolveTextVariant(variant: TextVariant): RoleTextVariant {
29
- return variant in HEADING_VARIANT_ALIAS
30
- ? HEADING_VARIANT_ALIAS[variant as HeadingTextVariant]
31
- : (variant as RoleTextVariant);
50
+ return VARIANT_ALIAS[variant] ?? (variant as RoleTextVariant);
32
51
  }
33
52
 
34
53
  export interface TextProps extends RNTextProps {
35
- /** Typographic role. Defaults to `body-md`. */
54
+ /** Typographic role. Defaults to `body`. */
36
55
  variant?: TextVariant;
37
56
  /** Semantic color token (e.g. `text.secondary`, `danger.soft.fg`). */
38
57
  color?: ColorToken;
@@ -53,7 +72,7 @@ export interface TextProps extends RNTextProps {
53
72
  */
54
73
  export const Text = forwardRef<ComponentRef<typeof RNText>, TextProps>(function Text(
55
74
  {
56
- variant = "body-md",
75
+ variant = "body",
57
76
  color,
58
77
  weight,
59
78
  align,
@@ -187,7 +187,7 @@ const ToastTitle = forwardRef<ComponentRef<typeof Text>, ToastTitleProps>(functi
187
187
  export interface ToastDescriptionProps extends TextProps {}
188
188
 
189
189
  const ToastDescription = forwardRef<ComponentRef<typeof Text>, ToastDescriptionProps>(
190
- function ToastDescription({ color, nativeID, variant = "body-sm", ...rest }, ref) {
190
+ function ToastDescription({ color, nativeID, variant = "subheadline", ...rest }, ref) {
191
191
  const { theme } = useUnistyles();
192
192
  const { nativeID: rootNativeID, variant: toastVariant } = useToastContext();
193
193
  const colors = getToastColors(toastVariant, theme);
@@ -362,7 +362,16 @@ export function DefaultToast({
362
362
 
363
363
  return (
364
364
  <ToastRoot id={id} hide={hide} variant={variant} {...rest}>
365
- {shouldRenderIcon ? <Box alignSelf="start">{icon ?? <ToastIcon />}</Box> : null}
365
+ {/*
366
+ With a description the icon stays at the top, beside the title rather
367
+ than the middle of two lines. With a title alone it centres on it: the
368
+ title's line box is taller than the 20pt icon (a font's ascender and
369
+ descender add to the line), so pinning it to the top leaves the icon
370
+ visibly above the text.
371
+ */}
372
+ {shouldRenderIcon ? (
373
+ <Box alignSelf={description ? "start" : "center"}>{icon ?? <ToastIcon />}</Box>
374
+ ) : null}
366
375
  <Box flex={1} gap="0">
367
376
  {label ? <ToastTitle>{label}</ToastTitle> : null}
368
377
  {description ? <ToastDescription>{description}</ToastDescription> : null}
@@ -207,14 +207,14 @@ function renderLabel(children: ReactNode, tint: ColorToken): ReactNode {
207
207
  return Children.map(children, (child) => {
208
208
  if (typeof child === "string") {
209
209
  return child.trim().length > 0 ? (
210
- <Text variant={LABEL_VARIANT} color={tint} weight="bold">
210
+ <Text variant={LABEL_VARIANT} color={tint} weight="medium">
211
211
  {child}
212
212
  </Text>
213
213
  ) : null;
214
214
  }
215
215
  if (typeof child === "number") {
216
216
  return (
217
- <Text variant={LABEL_VARIANT} color={tint} weight="bold">
217
+ <Text variant={LABEL_VARIANT} color={tint} weight="medium">
218
218
  {child}
219
219
  </Text>
220
220
  );
@@ -375,102 +375,108 @@ export const primitives = {
375
375
  // are not physical pixels. Pass them directly to Text without multiplying
376
376
  // by PixelRatio or fontScale (native Text handles accessibility scaling).
377
377
  // Each role pairs fontSize with an absolute lineHeight, not a ratio.
378
- // Line heights use a 4-unit grid; font sizes need not follow that grid.
379
378
  //
380
- // Font size / line height, listed from lg to sm:
381
- // display: 40/48, 36/44, 32/40 — short, prominent hero text.
382
- // headline: 28/36, 24/32, 22/28 — page and section headings.
383
- // title: 20/28, 18/24, 16/24 — card, list, and navigation titles.
384
- // body: 18/28, 16/24, 14/20 — reading text; body-md is Text's default.
385
- // label: 16/20, 14/20, 12/16 — short control labels, not paragraphs.
386
- // caption: 12/16 — brief supplementary text.
387
- // Prefer body sizes for essential information; reserve 12 for compact text.
388
- // These are Terra's custom roles, not native platform text-style presets.
379
+ // Sizes follow the iOS text styles at the Default (Large) Dynamic Type size,
380
+ // and the role names follow iOS too, so `headline` is the 17pt semibold a
381
+ // navigation bar or table cell title uses and `large-title` is the 34pt
382
+ // bold large title. Line heights are the iOS values rounded to an even
383
+ // number. Weights are what UIKit renders in practice (bold titles), not the
384
+ // "Regular" the HIG table lists. Tracking is left to the font: SF carries
385
+ // its own, and a configured custom family can set `letterSpacing` per role.
386
+ //
387
+ // Font size / line height:
388
+ // display: 40/48 — hero text, no iOS equivalent.
389
+ // large-title: 34/40 — iOS Large Title.
390
+ // title-1/2/3: 28/34, 22/28, 20/24 — iOS Title 1, Title 2, Title 3.
391
+ // headline: 17/22 semibold — iOS Headline; compact header bar title.
392
+ // body: 17/22 — iOS Body; Text's default.
393
+ // callout: 16/20 — iOS Callout.
394
+ // subheadline: 15/20 — iOS Subheadline.
395
+ // footnote: 13/18 — iOS Footnote.
396
+ // caption-1/2: 12/16, 11/14 — iOS Caption 1, Caption 2.
397
+ // label-lg/md/sm: 16/20, 15/20, 13/16 medium — control labels; no iOS role.
389
398
  //
390
399
  // maxFontSizeMultiplier limits accessibility enlargement when scaling is
391
- // enabled. The caps below are layout tradeoffs, not accessibility targets.
400
+ // enabled. Reading roles cap at 2 so text still meets WCAG 1.4.4 at the OS's
401
+ // 200% setting. Titles cap at 1.5 (iOS itself scales Large Title to 1.76x at
402
+ // most) and labels at 1.6 because toolbars and chips have fixed heights.
392
403
  // RN uses 0 for no cap; Terra Text also accepts a per-instance override.
393
404
  // Validate wrapping and clipping at large OS text sizes and with custom fonts.
394
- "typography.variants.display-lg.fontSize": 40,
395
- "typography.variants.display-lg.lineHeight": 48,
396
- "typography.variants.display-lg.fontWeight": "bold",
397
- "typography.variants.display-lg.letterSpacing": -1,
398
- "typography.variants.display-lg.maxFontSizeMultiplier": 1.2,
399
- "typography.variants.display-md.fontSize": 36,
400
- "typography.variants.display-md.lineHeight": 44,
401
- "typography.variants.display-md.fontWeight": "bold",
402
- "typography.variants.display-md.letterSpacing": -0.8,
403
- "typography.variants.display-md.maxFontSizeMultiplier": 1.2,
404
- "typography.variants.display-sm.fontSize": 32,
405
- "typography.variants.display-sm.lineHeight": 40,
406
- "typography.variants.display-sm.fontWeight": "bold",
407
- "typography.variants.display-sm.letterSpacing": -0.5,
408
- "typography.variants.display-sm.maxFontSizeMultiplier": 1.2,
409
- "typography.variants.headline-lg.fontSize": 28,
410
- "typography.variants.headline-lg.lineHeight": 36,
411
- "typography.variants.headline-lg.fontWeight": "semibold",
412
- "typography.variants.headline-lg.letterSpacing": -0.3,
413
- "typography.variants.headline-lg.maxFontSizeMultiplier": 1.3,
414
- "typography.variants.headline-md.fontSize": 24,
415
- "typography.variants.headline-md.lineHeight": 32,
416
- "typography.variants.headline-md.fontWeight": "semibold",
417
- "typography.variants.headline-md.letterSpacing": -0.2,
418
- "typography.variants.headline-md.maxFontSizeMultiplier": 1.3,
419
- "typography.variants.headline-sm.fontSize": 22,
420
- "typography.variants.headline-sm.lineHeight": 28,
421
- "typography.variants.headline-sm.fontWeight": "semibold",
422
- "typography.variants.headline-sm.letterSpacing": -0.1,
423
- "typography.variants.headline-sm.maxFontSizeMultiplier": 1.3,
424
- "typography.variants.title-lg.fontSize": 20,
425
- "typography.variants.title-lg.lineHeight": 28,
426
- "typography.variants.title-lg.fontWeight": "semibold",
427
- "typography.variants.title-lg.letterSpacing": 0,
428
- "typography.variants.title-lg.maxFontSizeMultiplier": 1.4,
429
- "typography.variants.title-md.fontSize": 18,
430
- "typography.variants.title-md.lineHeight": 24,
431
- "typography.variants.title-md.fontWeight": "semibold",
432
- "typography.variants.title-md.letterSpacing": 0,
433
- "typography.variants.title-md.maxFontSizeMultiplier": 1.4,
434
- "typography.variants.title-sm.fontSize": 16,
435
- "typography.variants.title-sm.lineHeight": 24,
436
- "typography.variants.title-sm.fontWeight": "semibold",
437
- "typography.variants.title-sm.letterSpacing": 0,
438
- "typography.variants.title-sm.maxFontSizeMultiplier": 1.4,
439
- "typography.variants.body-lg.fontSize": 18,
440
- "typography.variants.body-lg.lineHeight": 28,
441
- "typography.variants.body-lg.fontWeight": "regular",
442
- "typography.variants.body-lg.letterSpacing": 0,
443
- "typography.variants.body-lg.maxFontSizeMultiplier": 1.8,
444
- "typography.variants.body-md.fontSize": 16,
445
- "typography.variants.body-md.lineHeight": 24,
446
- "typography.variants.body-md.fontWeight": "regular",
447
- "typography.variants.body-md.letterSpacing": 0,
448
- "typography.variants.body-md.maxFontSizeMultiplier": 1.8,
449
- "typography.variants.body-sm.fontSize": 14,
450
- "typography.variants.body-sm.lineHeight": 20,
451
- "typography.variants.body-sm.fontWeight": "regular",
452
- "typography.variants.body-sm.letterSpacing": 0,
453
- "typography.variants.body-sm.maxFontSizeMultiplier": 1.8,
405
+ "typography.variants.display.fontSize": 40,
406
+ "typography.variants.display.lineHeight": 48,
407
+ "typography.variants.display.fontWeight": "bold",
408
+ "typography.variants.display.letterSpacing": -0.3,
409
+ "typography.variants.display.maxFontSizeMultiplier": 1.3,
410
+ "typography.variants.large-title.fontSize": 34,
411
+ "typography.variants.large-title.lineHeight": 40,
412
+ "typography.variants.large-title.fontWeight": "bold",
413
+ "typography.variants.large-title.letterSpacing": -0.3,
414
+ "typography.variants.large-title.maxFontSizeMultiplier": 1.5,
415
+ "typography.variants.title-1.fontSize": 28,
416
+ "typography.variants.title-1.lineHeight": 34,
417
+ "typography.variants.title-1.fontWeight": "bold",
418
+ "typography.variants.title-1.letterSpacing": 0,
419
+ "typography.variants.title-1.maxFontSizeMultiplier": 1.5,
420
+ "typography.variants.title-2.fontSize": 22,
421
+ "typography.variants.title-2.lineHeight": 28,
422
+ "typography.variants.title-2.fontWeight": "bold",
423
+ "typography.variants.title-2.letterSpacing": 0,
424
+ "typography.variants.title-2.maxFontSizeMultiplier": 1.5,
425
+ "typography.variants.title-3.fontSize": 20,
426
+ "typography.variants.title-3.lineHeight": 24,
427
+ "typography.variants.title-3.fontWeight": "semibold",
428
+ "typography.variants.title-3.letterSpacing": 0,
429
+ "typography.variants.title-3.maxFontSizeMultiplier": 1.5,
430
+ "typography.variants.headline.fontSize": 17,
431
+ "typography.variants.headline.lineHeight": 22,
432
+ "typography.variants.headline.fontWeight": "semibold",
433
+ "typography.variants.headline.letterSpacing": 0,
434
+ "typography.variants.headline.maxFontSizeMultiplier": 2,
435
+ "typography.variants.body.fontSize": 17,
436
+ "typography.variants.body.lineHeight": 22,
437
+ "typography.variants.body.fontWeight": "regular",
438
+ "typography.variants.body.letterSpacing": 0,
439
+ "typography.variants.body.maxFontSizeMultiplier": 2,
440
+ "typography.variants.callout.fontSize": 16,
441
+ "typography.variants.callout.lineHeight": 20,
442
+ "typography.variants.callout.fontWeight": "regular",
443
+ "typography.variants.callout.letterSpacing": 0,
444
+ "typography.variants.callout.maxFontSizeMultiplier": 2,
445
+ "typography.variants.subheadline.fontSize": 15,
446
+ "typography.variants.subheadline.lineHeight": 20,
447
+ "typography.variants.subheadline.fontWeight": "regular",
448
+ "typography.variants.subheadline.letterSpacing": 0,
449
+ "typography.variants.subheadline.maxFontSizeMultiplier": 2,
450
+ "typography.variants.footnote.fontSize": 13,
451
+ "typography.variants.footnote.lineHeight": 18,
452
+ "typography.variants.footnote.fontWeight": "regular",
453
+ "typography.variants.footnote.letterSpacing": 0,
454
+ "typography.variants.footnote.maxFontSizeMultiplier": 2,
455
+ "typography.variants.caption-1.fontSize": 12,
456
+ "typography.variants.caption-1.lineHeight": 16,
457
+ "typography.variants.caption-1.fontWeight": "regular",
458
+ "typography.variants.caption-1.letterSpacing": 0,
459
+ "typography.variants.caption-1.maxFontSizeMultiplier": 2,
460
+ "typography.variants.caption-2.fontSize": 11,
461
+ "typography.variants.caption-2.lineHeight": 14,
462
+ "typography.variants.caption-2.fontWeight": "regular",
463
+ "typography.variants.caption-2.letterSpacing": 0,
464
+ "typography.variants.caption-2.maxFontSizeMultiplier": 2,
454
465
  "typography.variants.label-lg.fontSize": 16,
455
466
  "typography.variants.label-lg.lineHeight": 20,
456
467
  "typography.variants.label-lg.fontWeight": "medium",
457
- "typography.variants.label-lg.letterSpacing": 0.1,
458
- "typography.variants.label-lg.maxFontSizeMultiplier": 1.5,
459
- "typography.variants.label-md.fontSize": 14,
468
+ "typography.variants.label-lg.letterSpacing": 0,
469
+ "typography.variants.label-lg.maxFontSizeMultiplier": 1.6,
470
+ "typography.variants.label-md.fontSize": 15,
460
471
  "typography.variants.label-md.lineHeight": 20,
461
472
  "typography.variants.label-md.fontWeight": "medium",
462
- "typography.variants.label-md.letterSpacing": 0.1,
463
- "typography.variants.label-md.maxFontSizeMultiplier": 1.5,
464
- "typography.variants.label-sm.fontSize": 12,
473
+ "typography.variants.label-md.letterSpacing": 0,
474
+ "typography.variants.label-md.maxFontSizeMultiplier": 1.6,
475
+ "typography.variants.label-sm.fontSize": 13,
465
476
  "typography.variants.label-sm.lineHeight": 16,
466
477
  "typography.variants.label-sm.fontWeight": "medium",
467
- "typography.variants.label-sm.letterSpacing": 0.2,
468
- "typography.variants.label-sm.maxFontSizeMultiplier": 1.5,
469
- "typography.variants.caption.fontSize": 12,
470
- "typography.variants.caption.lineHeight": 16,
471
- "typography.variants.caption.fontWeight": "regular",
472
- "typography.variants.caption.letterSpacing": 0.2,
473
- "typography.variants.caption.maxFontSizeMultiplier": 2,
478
+ "typography.variants.label-sm.letterSpacing": 0,
479
+ "typography.variants.label-sm.maxFontSizeMultiplier": 1.6,
474
480
 
475
481
  // ── component opacity multipliers ─────────────────────────────────────────────────
476
482
  "opacity.disabled": 0.45,
@@ -64,6 +64,30 @@ export type ElevationScale = Record<ElevationKey, ElevationStyle>;
64
64
  // ─── Typography ──────────────────────────────────────────────────────────────
65
65
 
66
66
  export type RoleTextVariant =
67
+ | "display"
68
+ | "large-title"
69
+ | "title-1"
70
+ | "title-2"
71
+ | "title-3"
72
+ | "headline"
73
+ | "body"
74
+ | "callout"
75
+ | "subheadline"
76
+ | "footnote"
77
+ | "caption-1"
78
+ | "caption-2"
79
+ | "label-lg"
80
+ | "label-md"
81
+ | "label-sm";
82
+
83
+ export type HeadingTextVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
84
+
85
+ /**
86
+ * Pre-0.14 role names. Still accepted by `Text` and resolved onto the iOS-style
87
+ * scale; removed at 1.0. `label-*` kept its name and is not listed here.
88
+ * @deprecated Use the {@link RoleTextVariant} it maps to.
89
+ */
90
+ export type LegacyTextVariant =
67
91
  | "display-lg"
68
92
  | "display-md"
69
93
  | "display-sm"
@@ -76,14 +100,9 @@ export type RoleTextVariant =
76
100
  | "body-lg"
77
101
  | "body-md"
78
102
  | "body-sm"
79
- | "label-lg"
80
- | "label-md"
81
- | "label-sm"
82
103
  | "caption";
83
104
 
84
- export type HeadingTextVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
85
-
86
- export type TextVariant = RoleTextVariant | HeadingTextVariant;
105
+ export type TextVariant = RoleTextVariant | HeadingTextVariant | LegacyTextVariant;
87
106
 
88
107
  export type FontWeightToken = "regular" | "medium" | "semibold" | "bold";
89
108