react-native-terra-ui 0.13.2 → 0.13.4

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 (106) 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/hooks/use-large-title-header.js +8 -1
  17. package/lib/module/components/header/hooks/use-large-title-header.js.map +1 -1
  18. package/lib/module/components/header/parts/HeaderBar.js +7 -13
  19. package/lib/module/components/header/parts/HeaderBar.js.map +1 -1
  20. package/lib/module/components/header/variants/LargeTitleHeader/index.js +8 -0
  21. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  22. package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js +11 -20
  23. package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js.map +1 -1
  24. package/lib/module/components/header/variants/TitleHeader/index.js +4 -0
  25. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  26. package/lib/module/components/image/Image.js +11 -5
  27. package/lib/module/components/image/Image.js.map +1 -1
  28. package/lib/module/components/image/utils.js +11 -0
  29. package/lib/module/components/image/utils.js.map +1 -0
  30. package/lib/module/components/input/parts/InputField.js +3 -3
  31. package/lib/module/components/input/parts/InputField.js.map +1 -1
  32. package/lib/module/components/screen/ScreenContext.js +4 -1
  33. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  34. package/lib/module/components/screen/ScreenList.js +7 -4
  35. package/lib/module/components/screen/ScreenList.js.map +1 -1
  36. package/lib/module/components/screen/ScreenScrollView.js +6 -3
  37. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  38. package/lib/module/components/screen/parts/ScreenHeaderContent.js +5 -1
  39. package/lib/module/components/screen/parts/ScreenHeaderContent.js.map +1 -1
  40. package/lib/module/components/surface/Surface.js +1 -1
  41. package/lib/module/components/text/Text.js +30 -8
  42. package/lib/module/components/text/Text.js.map +1 -1
  43. package/lib/module/components/toast/Toast.js +1 -1
  44. package/lib/module/components/toast/Toast.js.map +1 -1
  45. package/lib/module/components/toolbar/Toolbar.js +2 -2
  46. package/lib/module/components/toolbar/Toolbar.js.map +1 -1
  47. package/lib/module/theme/tokens/primitives.js +90 -84
  48. package/lib/module/theme/tokens/primitives.js.map +1 -1
  49. package/lib/typescript/src/components/header/hooks/use-large-title-header.d.ts.map +1 -1
  50. package/lib/typescript/src/components/header/parts/HeaderBar.d.ts +4 -1
  51. package/lib/typescript/src/components/header/parts/HeaderBar.d.ts.map +1 -1
  52. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -1
  53. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  54. package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts +1 -1
  55. package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts.map +1 -1
  56. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +9 -2
  57. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  58. package/lib/typescript/src/components/image/Image.d.ts +3 -3
  59. package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
  60. package/lib/typescript/src/components/image/index.d.ts +1 -1
  61. package/lib/typescript/src/components/image/index.d.ts.map +1 -1
  62. package/lib/typescript/src/components/image/types.d.ts +7 -0
  63. package/lib/typescript/src/components/image/types.d.ts.map +1 -1
  64. package/lib/typescript/src/components/image/utils.d.ts +3 -0
  65. package/lib/typescript/src/components/image/utils.d.ts.map +1 -0
  66. package/lib/typescript/src/components/screen/ScreenContext.d.ts +8 -0
  67. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  68. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  69. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  70. package/lib/typescript/src/components/screen/parts/ScreenHeaderContent.d.ts +5 -1
  71. package/lib/typescript/src/components/screen/parts/ScreenHeaderContent.d.ts.map +1 -1
  72. package/lib/typescript/src/components/surface/Surface.d.ts +1 -1
  73. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  74. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  75. package/lib/typescript/src/theme/tokens/primitives.d.ts +60 -65
  76. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  77. package/lib/typescript/src/theme/types.d.ts +8 -2
  78. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/src/components/accordion/parts/AccordionContent.tsx +2 -2
  81. package/src/components/accordion/parts/AccordionTrigger.tsx +2 -2
  82. package/src/components/avatar/Avatar.tsx +3 -3
  83. package/src/components/badge/Badge.tsx +2 -2
  84. package/src/components/button/Button.tsx +3 -3
  85. package/src/components/chip/Chip.tsx +2 -2
  86. package/src/components/empty-state/EmptyState.tsx +3 -3
  87. package/src/components/header/hooks/use-large-title-header.ts +7 -1
  88. package/src/components/header/parts/HeaderBar.tsx +10 -13
  89. package/src/components/header/variants/LargeTitleHeader/index.tsx +13 -0
  90. package/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.tsx +14 -22
  91. package/src/components/header/variants/TitleHeader/index.tsx +12 -1
  92. package/src/components/image/Image.tsx +7 -4
  93. package/src/components/image/index.ts +1 -1
  94. package/src/components/image/types.ts +8 -0
  95. package/src/components/image/utils.ts +11 -0
  96. package/src/components/input/parts/InputField.tsx +4 -4
  97. package/src/components/screen/ScreenContext.tsx +12 -0
  98. package/src/components/screen/ScreenList.tsx +14 -3
  99. package/src/components/screen/ScreenScrollView.tsx +12 -2
  100. package/src/components/screen/parts/ScreenHeaderContent.tsx +5 -1
  101. package/src/components/surface/Surface.tsx +1 -1
  102. package/src/components/text/Text.tsx +30 -11
  103. package/src/components/toast/Toast.tsx +1 -1
  104. package/src/components/toolbar/Toolbar.tsx +2 -2
  105. package/src/theme/tokens/primitives.ts +90 -84
  106. package/src/theme/types.ts +25 -6
@@ -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