react-native-terra-ui 0.13.2 → 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.
- package/CHANGELOG.md +6 -0
- package/lib/module/components/accordion/parts/AccordionContent.js +2 -2
- package/lib/module/components/accordion/parts/AccordionContent.js.map +1 -1
- package/lib/module/components/accordion/parts/AccordionTrigger.js +4 -4
- package/lib/module/components/accordion/parts/AccordionTrigger.js.map +1 -1
- package/lib/module/components/avatar/Avatar.js +3 -3
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/badge/Badge.js +2 -2
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/button/Button.js +3 -3
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +2 -2
- package/lib/module/components/chip/Chip.js.map +1 -1
- package/lib/module/components/empty-state/EmptyState.js +6 -6
- package/lib/module/components/empty-state/EmptyState.js.map +1 -1
- package/lib/module/components/header/parts/HeaderBar.js +7 -13
- package/lib/module/components/header/parts/HeaderBar.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +8 -0
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js +11 -20
- package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +4 -0
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/image/Image.js +11 -5
- package/lib/module/components/image/Image.js.map +1 -1
- package/lib/module/components/image/utils.js +11 -0
- package/lib/module/components/image/utils.js.map +1 -0
- package/lib/module/components/input/parts/InputField.js +3 -3
- package/lib/module/components/input/parts/InputField.js.map +1 -1
- package/lib/module/components/surface/Surface.js +1 -1
- package/lib/module/components/text/Text.js +30 -8
- package/lib/module/components/text/Text.js.map +1 -1
- package/lib/module/components/toast/Toast.js +1 -1
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +2 -2
- package/lib/module/components/toolbar/Toolbar.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +90 -84
- package/lib/module/theme/tokens/primitives.js.map +1 -1
- package/lib/typescript/src/components/header/parts/HeaderBar.d.ts +4 -1
- package/lib/typescript/src/components/header/parts/HeaderBar.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +9 -2
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/image/Image.d.ts +3 -3
- package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/image/index.d.ts +1 -1
- package/lib/typescript/src/components/image/index.d.ts.map +1 -1
- package/lib/typescript/src/components/image/types.d.ts +7 -0
- package/lib/typescript/src/components/image/types.d.ts.map +1 -1
- package/lib/typescript/src/components/image/utils.d.ts +3 -0
- package/lib/typescript/src/components/image/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/surface/Surface.d.ts +1 -1
- package/lib/typescript/src/components/text/Text.d.ts +1 -1
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/primitives.d.ts +60 -65
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +8 -2
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/parts/AccordionContent.tsx +2 -2
- package/src/components/accordion/parts/AccordionTrigger.tsx +2 -2
- package/src/components/avatar/Avatar.tsx +3 -3
- package/src/components/badge/Badge.tsx +2 -2
- package/src/components/button/Button.tsx +3 -3
- package/src/components/chip/Chip.tsx +2 -2
- package/src/components/empty-state/EmptyState.tsx +3 -3
- package/src/components/header/parts/HeaderBar.tsx +10 -13
- package/src/components/header/variants/LargeTitleHeader/index.tsx +13 -0
- package/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.tsx +14 -22
- package/src/components/header/variants/TitleHeader/index.tsx +12 -1
- package/src/components/image/Image.tsx +7 -4
- package/src/components/image/index.ts +1 -1
- package/src/components/image/types.ts +8 -0
- package/src/components/image/utils.ts +11 -0
- package/src/components/input/parts/InputField.tsx +4 -4
- package/src/components/surface/Surface.tsx +1 -1
- package/src/components/text/Text.tsx +30 -11
- package/src/components/toast/Toast.tsx +1 -1
- package/src/components/toolbar/Toolbar.tsx +2 -2
- package/src/theme/tokens/primitives.ts +90 -84
- package/src/theme/types.ts +25 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../src/theme/tokens/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoetB,CAAC"}
|
|
@@ -34,9 +34,15 @@ export interface ElevationStyle {
|
|
|
34
34
|
}
|
|
35
35
|
export type ElevationKey = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
36
36
|
export type ElevationScale = Record<ElevationKey, ElevationStyle>;
|
|
37
|
-
export type RoleTextVariant = "display
|
|
37
|
+
export type RoleTextVariant = "display" | "large-title" | "title-1" | "title-2" | "title-3" | "headline" | "body" | "callout" | "subheadline" | "footnote" | "caption-1" | "caption-2" | "label-lg" | "label-md" | "label-sm";
|
|
38
38
|
export type HeadingTextVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Pre-0.14 role names. Still accepted by `Text` and resolved onto the iOS-style
|
|
41
|
+
* scale; removed at 1.0. `label-*` kept its name and is not listed here.
|
|
42
|
+
* @deprecated Use the {@link RoleTextVariant} it maps to.
|
|
43
|
+
*/
|
|
44
|
+
export type LegacyTextVariant = "display-lg" | "display-md" | "display-sm" | "headline-lg" | "headline-md" | "headline-sm" | "title-lg" | "title-md" | "title-sm" | "body-lg" | "body-md" | "body-sm" | "caption";
|
|
45
|
+
export type TextVariant = RoleTextVariant | HeadingTextVariant | LegacyTextVariant;
|
|
40
46
|
export type FontWeightToken = "regular" | "medium" | "semibold" | "bold";
|
|
41
47
|
export interface TypeStyle {
|
|
42
48
|
fontSize: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAA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AAkB,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,QAAQ,GAAG,cAAc,CAAC,CAAC;AAEtF,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -18,14 +18,14 @@ function renderBody(children: ReactNode): ReactNode {
|
|
|
18
18
|
return Children.map(children, (child) => {
|
|
19
19
|
if (typeof child === "string") {
|
|
20
20
|
return child.trim().length > 0 ? (
|
|
21
|
-
<Text variant="body
|
|
21
|
+
<Text variant="body" color="text.secondary">
|
|
22
22
|
{child}
|
|
23
23
|
</Text>
|
|
24
24
|
) : null;
|
|
25
25
|
}
|
|
26
26
|
if (typeof child === "number") {
|
|
27
27
|
return (
|
|
28
|
-
<Text variant="body
|
|
28
|
+
<Text variant="body" color="text.secondary">
|
|
29
29
|
{child}
|
|
30
30
|
</Text>
|
|
31
31
|
);
|
|
@@ -18,14 +18,14 @@ function renderTitle(children: ReactNode): ReactNode {
|
|
|
18
18
|
return Children.map(children, (child) => {
|
|
19
19
|
if (typeof child === "string") {
|
|
20
20
|
return child.trim().length > 0 ? (
|
|
21
|
-
<Text variant="body
|
|
21
|
+
<Text variant="body" weight="regular" style={styles.title}>
|
|
22
22
|
{child}
|
|
23
23
|
</Text>
|
|
24
24
|
) : null;
|
|
25
25
|
}
|
|
26
26
|
if (typeof child === "number") {
|
|
27
27
|
return (
|
|
28
|
-
<Text variant="body
|
|
28
|
+
<Text variant="body" weight="regular" style={styles.title}>
|
|
29
29
|
{child}
|
|
30
30
|
</Text>
|
|
31
31
|
);
|
|
@@ -77,9 +77,9 @@ export function Avatar({
|
|
|
77
77
|
const bg = styles.base.backgroundColor ?? "";
|
|
78
78
|
const fg = styles.base.color ?? "";
|
|
79
79
|
|
|
80
|
-
// Initials follow the theme's
|
|
80
|
+
// Initials follow the theme's medium face so a custom font family reaches
|
|
81
81
|
// the avatar too; the system font takes a numeric weight instead.
|
|
82
|
-
const initialsFont = theme.typography.fonts.
|
|
82
|
+
const initialsFont = theme.typography.fonts.medium;
|
|
83
83
|
const isSystemInitialsFont = initialsFont === SYSTEM_FONT;
|
|
84
84
|
|
|
85
85
|
const fallbackContent =
|
|
@@ -90,7 +90,7 @@ export function Avatar({
|
|
|
90
90
|
style={{
|
|
91
91
|
fontSize: INITIALS_FONT_SIZE[size],
|
|
92
92
|
fontFamily: isSystemInitialsFont ? undefined : initialsFont,
|
|
93
|
-
fontWeight: isSystemInitialsFont ? FONT_WEIGHT_VALUE.
|
|
93
|
+
fontWeight: isSystemInitialsFont ? FONT_WEIGHT_VALUE.medium : undefined,
|
|
94
94
|
color: fg,
|
|
95
95
|
includeFontPadding: false,
|
|
96
96
|
}}
|
|
@@ -114,7 +114,7 @@ const styles = StyleSheet.create((theme) => {
|
|
|
114
114
|
// font takes a numeric `fontWeight` — the same branch `Chip` makes. Inlined
|
|
115
115
|
// rather than extracted: the unistyles Babel plugin rewrites this factory,
|
|
116
116
|
// and an imported function called from inside it is not in scope at runtime.
|
|
117
|
-
const labelFont = theme.typography.fonts.
|
|
117
|
+
const labelFont = theme.typography.fonts.medium;
|
|
118
118
|
const isSystemLabelFont = labelFont === SYSTEM_FONT;
|
|
119
119
|
|
|
120
120
|
return {
|
|
@@ -181,7 +181,7 @@ const styles = StyleSheet.create((theme) => {
|
|
|
181
181
|
textAlign: "center",
|
|
182
182
|
includeFontPadding: false,
|
|
183
183
|
fontFamily: isSystemLabelFont ? undefined : labelFont,
|
|
184
|
-
fontWeight: isSystemLabelFont ? FONT_WEIGHT_VALUE.
|
|
184
|
+
fontWeight: isSystemLabelFont ? FONT_WEIGHT_VALUE.medium : undefined,
|
|
185
185
|
variants: {
|
|
186
186
|
size: {
|
|
187
187
|
sm: {
|
|
@@ -135,9 +135,9 @@ const LABEL_TYPOGRAPHY: Record<
|
|
|
135
135
|
weight?: FontWeightToken;
|
|
136
136
|
}
|
|
137
137
|
> = {
|
|
138
|
-
sm: { variant: "label-md", weight: "
|
|
139
|
-
md: { variant: "label-lg", weight: "
|
|
140
|
-
lg: { variant: "label-lg", weight: "
|
|
138
|
+
sm: { variant: "label-md", weight: "medium" },
|
|
139
|
+
md: { variant: "label-lg", weight: "medium" },
|
|
140
|
+
lg: { variant: "label-lg", weight: "semibold" },
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
const ButtonLabel = ({ children }: { children: ReactNode }) => {
|
|
@@ -284,7 +284,7 @@ const styles = StyleSheet.create((theme) => {
|
|
|
284
284
|
// font takes a numeric `fontWeight` — the same branch `Text` makes. Inlined
|
|
285
285
|
// rather than extracted: the unistyles Babel plugin rewrites this factory,
|
|
286
286
|
// and an imported function called from inside it is not in scope at runtime.
|
|
287
|
-
const labelFont = theme.typography.fonts.
|
|
287
|
+
const labelFont = theme.typography.fonts.medium;
|
|
288
288
|
const isSystemLabelFont = labelFont === SYSTEM_FONT;
|
|
289
289
|
|
|
290
290
|
return {
|
|
@@ -295,7 +295,7 @@ const styles = StyleSheet.create((theme) => {
|
|
|
295
295
|
paddingHorizontal: 2,
|
|
296
296
|
includeFontPadding: false,
|
|
297
297
|
fontFamily: isSystemLabelFont ? undefined : labelFont,
|
|
298
|
-
fontWeight: isSystemLabelFont ? FONT_WEIGHT_VALUE.
|
|
298
|
+
fontWeight: isSystemLabelFont ? FONT_WEIGHT_VALUE.medium : undefined,
|
|
299
299
|
variants: {
|
|
300
300
|
size: {
|
|
301
301
|
sm: {
|
|
@@ -41,9 +41,9 @@ export interface EmptyStateProps extends Omit<ViewProps, "children"> {
|
|
|
41
41
|
// variant below.
|
|
42
42
|
|
|
43
43
|
const TYPOGRAPHY: Record<EmptyStateSize, { title: TextVariant; description: TextVariant }> = {
|
|
44
|
-
sm: { title: "
|
|
45
|
-
md: { title: "title-
|
|
46
|
-
lg: { title: "title-
|
|
44
|
+
sm: { title: "headline", description: "subheadline" },
|
|
45
|
+
md: { title: "title-3", description: "callout" },
|
|
46
|
+
lg: { title: "title-2", description: "body" },
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const ICON_SIZE: Record<EmptyStateSize, number> = {
|
|
@@ -5,8 +5,10 @@ import Animated from "react-native-reanimated";
|
|
|
5
5
|
import { ScrollToTopGuard } from "react-native-screens/experimental";
|
|
6
6
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
7
7
|
|
|
8
|
+
import type { FontWeightToken, TextVariant } from "#theme/types";
|
|
8
9
|
import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
|
|
9
10
|
import { resolveScreenPadding } from "../../../theme/screen-padding";
|
|
11
|
+
import { Text as ThemedText } from "../../text";
|
|
10
12
|
import { Toolbar } from "../../toolbar";
|
|
11
13
|
import { HeaderDismissButton, type HeaderDismissProps } from "../header-buttons";
|
|
12
14
|
import { isCustomTitle, isTextTitle } from "../utils";
|
|
@@ -15,6 +17,8 @@ import { HeaderWindowInsets } from "./HeaderWindowInsets";
|
|
|
15
17
|
|
|
16
18
|
interface HeaderBarProps extends HeaderDismissProps {
|
|
17
19
|
title?: ReactNode;
|
|
20
|
+
titleVariant?: TextVariant;
|
|
21
|
+
titleWeight?: FontWeightToken;
|
|
18
22
|
subtitle?: string;
|
|
19
23
|
leading?: ReactNode;
|
|
20
24
|
trailing?: ReactNode;
|
|
@@ -27,6 +31,8 @@ interface HeaderBarProps extends HeaderDismissProps {
|
|
|
27
31
|
/** Shared compact bar. Only the title and background animate; actions stay interactive. */
|
|
28
32
|
export function HeaderBar({
|
|
29
33
|
title,
|
|
34
|
+
titleVariant = "headline",
|
|
35
|
+
titleWeight,
|
|
30
36
|
subtitle,
|
|
31
37
|
leading,
|
|
32
38
|
trailing,
|
|
@@ -93,13 +99,14 @@ export function HeaderBar({
|
|
|
93
99
|
>
|
|
94
100
|
{isTextTitle(title)
|
|
95
101
|
? String(title).trim().length > 0 && (
|
|
96
|
-
<
|
|
102
|
+
<ThemedText
|
|
103
|
+
variant={titleVariant}
|
|
104
|
+
weight={titleWeight}
|
|
97
105
|
style={styles.title}
|
|
98
106
|
numberOfLines={1}
|
|
99
|
-
maxFontSizeMultiplier={theme.typography.variants["title-md"].maxFontSizeMultiplier}
|
|
100
107
|
>
|
|
101
108
|
{title}
|
|
102
|
-
</
|
|
109
|
+
</ThemedText>
|
|
103
110
|
)
|
|
104
111
|
: title}
|
|
105
112
|
{!!subtitle && (
|
|
@@ -126,9 +133,6 @@ export function HeaderBar({
|
|
|
126
133
|
const styles = StyleSheet.create((theme, runtime) => {
|
|
127
134
|
// Resolved inline: the unistyles Babel plugin rewrites this factory, so an
|
|
128
135
|
// imported helper called from inside it is not in scope at runtime.
|
|
129
|
-
const titleWeight = theme.typography.variants["title-md"].fontWeight;
|
|
130
|
-
const titleFont = theme.typography.fonts[titleWeight];
|
|
131
|
-
const isSystemTitleFont = titleFont === SYSTEM_FONT;
|
|
132
136
|
const subtitleWeight = theme.typography.variants["label-sm"].fontWeight;
|
|
133
137
|
const subtitleFont = theme.typography.fonts[subtitleWeight];
|
|
134
138
|
const isSystemSubtitleFont = subtitleFont === SYSTEM_FONT;
|
|
@@ -196,13 +200,6 @@ const styles = StyleSheet.create((theme, runtime) => {
|
|
|
196
200
|
},
|
|
197
201
|
},
|
|
198
202
|
title: {
|
|
199
|
-
fontSize: theme.typography.variants["title-md"].fontSize,
|
|
200
|
-
lineHeight: theme.typography.variants["title-md"].lineHeight,
|
|
201
|
-
letterSpacing: theme.typography.variants["title-md"].letterSpacing,
|
|
202
|
-
fontFamily: isSystemTitleFont ? undefined : titleFont,
|
|
203
|
-
fontWeight: isSystemTitleFont ? FONT_WEIGHT_VALUE[titleWeight] : undefined,
|
|
204
|
-
includeFontPadding: false,
|
|
205
|
-
color: (theme.color as unknown as Record<string, string | undefined>)["text.primary"] ?? "",
|
|
206
203
|
variants: {
|
|
207
204
|
titleAlignment: {
|
|
208
205
|
center: { textAlign: "center" },
|
|
@@ -2,6 +2,7 @@ import { View } from "react-native";
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet } from "react-native-unistyles";
|
|
4
4
|
|
|
5
|
+
import type { FontWeightToken, TextVariant } from "#theme/types";
|
|
5
6
|
import { Portal } from "../../../portal";
|
|
6
7
|
import { useHeaderBackground } from "../../../screen/parts/ScreenHeaderAppearance";
|
|
7
8
|
import { SCREEN_HEADER_PORTAL_HOST } from "../../../screen/ScreenContext";
|
|
@@ -14,6 +15,10 @@ import type { TitleHeaderProps } from "../TitleHeader";
|
|
|
14
15
|
import { LargeTitleContent } from "./parts/LargeTitleContent";
|
|
15
16
|
|
|
16
17
|
export interface LargeTitleHeaderProps extends TitleHeaderProps {
|
|
18
|
+
/** Typography variant for a text large title. Defaults to `'large-title'`. */
|
|
19
|
+
largeTitleVariant?: TextVariant;
|
|
20
|
+
/** Font weight for a text large title. Defaults to the variant's weight. */
|
|
21
|
+
largeTitleWeight?: FontWeightToken;
|
|
17
22
|
/** Optional small line shown above the large title. */
|
|
18
23
|
overline?: string;
|
|
19
24
|
/** Optional secondary line shown under the large title. */
|
|
@@ -36,6 +41,10 @@ export interface LargeTitleHeaderProps extends TitleHeaderProps {
|
|
|
36
41
|
/** Collapsing header. The expanded title lives in scroll content; the bar and accessory overlay it. */
|
|
37
42
|
export function LargeTitleHeader({
|
|
38
43
|
title,
|
|
44
|
+
titleVariant,
|
|
45
|
+
titleWeight,
|
|
46
|
+
largeTitleVariant,
|
|
47
|
+
largeTitleWeight,
|
|
39
48
|
overline,
|
|
40
49
|
subtitle,
|
|
41
50
|
leadingActions,
|
|
@@ -64,6 +73,8 @@ export function LargeTitleHeader({
|
|
|
64
73
|
<Portal hostName={SCREEN_HEADER_PORTAL_HOST}>
|
|
65
74
|
<LargeTitleContent
|
|
66
75
|
title={title}
|
|
76
|
+
largeTitleVariant={largeTitleVariant}
|
|
77
|
+
largeTitleWeight={largeTitleWeight}
|
|
67
78
|
overline={overline}
|
|
68
79
|
subtitle={subtitle}
|
|
69
80
|
hasAccessoryBelow={layout.isSticky}
|
|
@@ -76,6 +87,8 @@ export function LargeTitleHeader({
|
|
|
76
87
|
<HeaderBar
|
|
77
88
|
{...dismissProps}
|
|
78
89
|
title={title}
|
|
90
|
+
titleVariant={titleVariant}
|
|
91
|
+
titleWeight={titleWeight}
|
|
79
92
|
titleAlignment={titleAlignment}
|
|
80
93
|
color={color}
|
|
81
94
|
surfaceStyle={layout.surfaceStyle}
|
|
@@ -5,17 +5,23 @@ import Animated from "react-native-reanimated";
|
|
|
5
5
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
6
6
|
|
|
7
7
|
import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
|
|
8
|
+
import { Text as ThemedText } from "../../../../text";
|
|
8
9
|
import { isTextTitle } from "../../../utils";
|
|
9
10
|
import type { LargeTitleHeaderProps } from "..";
|
|
10
11
|
|
|
11
12
|
export function LargeTitleContent({
|
|
12
13
|
title,
|
|
14
|
+
largeTitleVariant = "large-title",
|
|
15
|
+
largeTitleWeight,
|
|
13
16
|
overline,
|
|
14
17
|
subtitle,
|
|
15
18
|
hasAccessoryBelow,
|
|
16
19
|
onHeightChange,
|
|
17
20
|
animatedStyle,
|
|
18
|
-
}: Pick<
|
|
21
|
+
}: Pick<
|
|
22
|
+
LargeTitleHeaderProps,
|
|
23
|
+
"title" | "largeTitleVariant" | "largeTitleWeight" | "overline" | "subtitle"
|
|
24
|
+
> & {
|
|
19
25
|
/** Reserve a gap before a sticky accessory below this block. */
|
|
20
26
|
hasAccessoryBelow: boolean;
|
|
21
27
|
/** Reports the large-title block's layout height in dp. */
|
|
@@ -37,19 +43,16 @@ export function LargeTitleContent({
|
|
|
37
43
|
</Text>
|
|
38
44
|
)}
|
|
39
45
|
{isTextTitle(title) ? (
|
|
40
|
-
<
|
|
41
|
-
style={styles.largeTitle}
|
|
42
|
-
maxFontSizeMultiplier={theme.typography.variants["headline-lg"].maxFontSizeMultiplier}
|
|
43
|
-
>
|
|
46
|
+
<ThemedText variant={largeTitleVariant} weight={largeTitleWeight}>
|
|
44
47
|
{title}
|
|
45
|
-
</
|
|
48
|
+
</ThemedText>
|
|
46
49
|
) : (
|
|
47
50
|
title
|
|
48
51
|
)}
|
|
49
52
|
{!!subtitle && (
|
|
50
53
|
<Text
|
|
51
54
|
style={styles.subtitle}
|
|
52
|
-
maxFontSizeMultiplier={theme.typography.variants["body
|
|
55
|
+
maxFontSizeMultiplier={theme.typography.variants["body"].maxFontSizeMultiplier}
|
|
53
56
|
>
|
|
54
57
|
{subtitle}
|
|
55
58
|
</Text>
|
|
@@ -64,10 +67,7 @@ const styles = StyleSheet.create((theme) => {
|
|
|
64
67
|
const overlineWeight = theme.typography.variants["label-sm"].fontWeight;
|
|
65
68
|
const overlineFont = theme.typography.fonts[overlineWeight];
|
|
66
69
|
const isSystemOverlineFont = overlineFont === SYSTEM_FONT;
|
|
67
|
-
const
|
|
68
|
-
const titleFont = theme.typography.fonts[titleWeight];
|
|
69
|
-
const isSystemTitleFont = titleFont === SYSTEM_FONT;
|
|
70
|
-
const subtitleWeight = theme.typography.variants["body-lg"].fontWeight;
|
|
70
|
+
const subtitleWeight = theme.typography.variants["body"].fontWeight;
|
|
71
71
|
const subtitleFont = theme.typography.fonts[subtitleWeight];
|
|
72
72
|
const isSystemSubtitleFont = subtitleFont === SYSTEM_FONT;
|
|
73
73
|
|
|
@@ -86,18 +86,10 @@ const styles = StyleSheet.create((theme) => {
|
|
|
86
86
|
fontWeight: isSystemOverlineFont ? FONT_WEIGHT_VALUE[overlineWeight] : undefined,
|
|
87
87
|
color: (theme.color as unknown as Record<string, string | undefined>)["text.tertiary"] ?? "",
|
|
88
88
|
},
|
|
89
|
-
largeTitle: {
|
|
90
|
-
fontSize: theme.typography.variants["headline-lg"].fontSize,
|
|
91
|
-
lineHeight: theme.typography.variants["headline-lg"].lineHeight,
|
|
92
|
-
letterSpacing: theme.typography.variants["headline-lg"].letterSpacing,
|
|
93
|
-
fontFamily: isSystemTitleFont ? undefined : titleFont,
|
|
94
|
-
fontWeight: isSystemTitleFont ? FONT_WEIGHT_VALUE[titleWeight] : undefined,
|
|
95
|
-
color: (theme.color as unknown as Record<string, string | undefined>)["text.primary"] ?? "",
|
|
96
|
-
},
|
|
97
89
|
subtitle: {
|
|
98
|
-
fontSize: theme.typography.variants["body
|
|
99
|
-
lineHeight: theme.typography.variants["body
|
|
100
|
-
letterSpacing: theme.typography.variants["body
|
|
90
|
+
fontSize: theme.typography.variants["body"].fontSize,
|
|
91
|
+
lineHeight: theme.typography.variants["body"].lineHeight,
|
|
92
|
+
letterSpacing: theme.typography.variants["body"].letterSpacing,
|
|
101
93
|
fontFamily: isSystemSubtitleFont ? undefined : subtitleFont,
|
|
102
94
|
fontWeight: isSystemSubtitleFont ? FONT_WEIGHT_VALUE[subtitleWeight] : undefined,
|
|
103
95
|
color: (theme.color as unknown as Record<string, string | undefined>)["text.tertiary"] ?? "",
|
|
@@ -3,7 +3,7 @@ import { View } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
import { StyleSheet } from "react-native-unistyles";
|
|
5
5
|
|
|
6
|
-
import type { ColorToken } from "#theme/types";
|
|
6
|
+
import type { ColorToken, FontWeightToken, TextVariant } from "#theme/types";
|
|
7
7
|
import { useHeaderBackground } from "../../../screen/parts/ScreenHeaderAppearance";
|
|
8
8
|
import { ScreenContext } from "../../../screen/ScreenContext";
|
|
9
9
|
import type { HeaderDismissProps } from "../../header-buttons";
|
|
@@ -19,6 +19,13 @@ export interface TitleHeaderProps extends HeaderDismissProps {
|
|
|
19
19
|
* the header only places it according to `titleAlignment`.
|
|
20
20
|
*/
|
|
21
21
|
title?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Typography variant for a text title in the compact bar. Defaults to
|
|
24
|
+
* `'headline'`. Ignored when `title` is a custom node.
|
|
25
|
+
*/
|
|
26
|
+
titleVariant?: TextVariant;
|
|
27
|
+
/** Font weight for a text title in the compact bar. Defaults to the variant's weight. */
|
|
28
|
+
titleWeight?: FontWeightToken;
|
|
22
29
|
/** Optional secondary line shown under the title, in the `label-sm` style. */
|
|
23
30
|
subtitle?: string;
|
|
24
31
|
/**
|
|
@@ -58,6 +65,8 @@ export interface TitleHeaderProps extends HeaderDismissProps {
|
|
|
58
65
|
/** Compact header. Screen owns the safe area when present; standalone headers reserve it here. */
|
|
59
66
|
export function TitleHeader({
|
|
60
67
|
title,
|
|
68
|
+
titleVariant,
|
|
69
|
+
titleWeight,
|
|
61
70
|
subtitle,
|
|
62
71
|
leadingActions,
|
|
63
72
|
trailingActions,
|
|
@@ -79,6 +88,8 @@ export function TitleHeader({
|
|
|
79
88
|
<HeaderBar
|
|
80
89
|
{...dismissProps}
|
|
81
90
|
title={title}
|
|
91
|
+
titleVariant={titleVariant}
|
|
92
|
+
titleWeight={titleWeight}
|
|
82
93
|
subtitle={subtitle}
|
|
83
94
|
titleAlignment={titleAlignment}
|
|
84
95
|
color={color}
|
|
@@ -5,6 +5,7 @@ import { StyleSheet } from "react-native-unistyles";
|
|
|
5
5
|
import { getImageComponent } from "#theme/registry";
|
|
6
6
|
import type { RadiusKey } from "#theme/types";
|
|
7
7
|
import type { ImageProps } from "./types";
|
|
8
|
+
import { toAspectRatio } from "./utils";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Renders the image implementation configured via
|
|
@@ -14,8 +15,8 @@ import type { ImageProps } from "./types";
|
|
|
14
15
|
* ```tsx
|
|
15
16
|
* <Image
|
|
16
17
|
* source={{ uri: 'https://example.com/photo.jpg' }}
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* width={320}
|
|
19
|
+
* aspect="16:9"
|
|
19
20
|
* />
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
@@ -23,6 +24,7 @@ export function Image({
|
|
|
23
24
|
contentFit = "cover",
|
|
24
25
|
width,
|
|
25
26
|
height,
|
|
27
|
+
aspect,
|
|
26
28
|
radius = "none",
|
|
27
29
|
style,
|
|
28
30
|
// Defaults to `contentFit` here (rather than leaving it to each backend's
|
|
@@ -34,7 +36,7 @@ export function Image({
|
|
|
34
36
|
const ImageComponent = getImageComponent();
|
|
35
37
|
|
|
36
38
|
return (
|
|
37
|
-
<View style={[styles.container(width, height, radius), style]}>
|
|
39
|
+
<View style={[styles.container(width, height, toAspectRatio(aspect), radius), style]}>
|
|
38
40
|
<ImageComponent
|
|
39
41
|
contentFit={contentFit}
|
|
40
42
|
placeholderContentFit={placeholderContentFit}
|
|
@@ -46,9 +48,10 @@ export function Image({
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
const styles = StyleSheet.create((_theme) => ({
|
|
49
|
-
container: (w: number | undefined, h: number | undefined, r: RadiusKey) => ({
|
|
51
|
+
container: (w: number | undefined, h: number | undefined, ratio: number | undefined, r: RadiusKey) => ({
|
|
50
52
|
...(w ? { width: w } : {}),
|
|
51
53
|
...(h ? { height: h } : {}),
|
|
54
|
+
...(ratio ? { aspectRatio: ratio } : {}),
|
|
52
55
|
borderRadius: _theme.radius[r],
|
|
53
56
|
overflow: "hidden",
|
|
54
57
|
}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Image } from "./Image";
|
|
2
|
-
export type { ImageProps } from "./types";
|
|
2
|
+
export type { ImageAspect, ImageProps } from "./types";
|
|
@@ -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, "
|
|
13
|
-
sm: "
|
|
14
|
-
md: "
|
|
15
|
-
lg: "body
|
|
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="
|
|
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: "
|
|
21
|
-
h2: "
|
|
22
|
-
h3: "
|
|
23
|
-
h4: "title-
|
|
24
|
-
h5: "
|
|
25
|
-
h6: "
|
|
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
|
|
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
|
|
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
|
|
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 = "
|
|
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);
|