@pagopa/io-app-design-system 5.0.1 → 5.0.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/lib/commonjs/components/accordion/AccordionItem.js +3 -1
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +3 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +7 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +7 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +3 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +3 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +8 -4
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +3 -2
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +12 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/searchInput/SearchInput.js +7 -5
- package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
- package/lib/commonjs/components/tabs/TabNavigation.js +7 -6
- package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js +2 -1
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +1 -2
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +0 -4
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/module/components/accordion/AccordionItem.js +3 -1
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +3 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +7 -1
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +7 -1
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +4 -2
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +4 -2
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +8 -4
- package/lib/module/components/layout/HeaderFirstLevel.js +4 -3
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +13 -2
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/searchInput/SearchInput.js +7 -5
- package/lib/module/components/searchInput/SearchInput.js.map +1 -1
- package/lib/module/components/tabs/TabNavigation.js +7 -6
- package/lib/module/components/tabs/TabNavigation.js.map +1 -1
- package/lib/module/components/typography/H2.js +2 -1
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H3.js +2 -2
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/core/IOStyles.js +0 -4
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabNavigation.d.ts +2 -1
- package/lib/typescript/components/tabs/TabNavigation.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts +5 -3
- package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts +2 -0
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts +0 -2
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +0 -3
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/AccordionItem.tsx +5 -1
- package/src/components/buttons/ButtonLink.tsx +1 -1
- package/src/components/buttons/ButtonOutline.tsx +5 -1
- package/src/components/buttons/ButtonSolid.tsx +5 -1
- package/src/components/buttons/IconButtonContained.tsx +2 -7
- package/src/components/buttons/IconButtonSolid.tsx +2 -2
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +8 -4
- package/src/components/layout/HeaderFirstLevel.tsx +4 -3
- package/src/components/layout/HeaderSecondLevel.tsx +28 -5
- package/src/components/searchInput/SearchInput.tsx +10 -6
- package/src/components/tabs/TabNavigation.tsx +8 -6
- package/src/components/textInput/TextInputValidation.tsx +1 -1
- package/src/components/typography/H2.tsx +11 -4
- package/src/components/typography/H3.tsx +4 -11
- package/src/core/IOStyles.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOStyles.d.ts","sourceRoot":"","sources":["../../../src/core/IOStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EACL,WAAW,EAGX,QAAQ,EACR,cAAc,EACf,MAAM,aAAa,CAAC;AAErB;;GAEG;AAEH,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,WAAW,CAAC;IAE9B,YAAY,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAA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
|
|
100
100
|
</TouchableWithoutFeedback>
|
|
101
101
|
|
|
102
|
-
<Animated.View
|
|
102
|
+
<Animated.View
|
|
103
|
+
style={bodyAnimatedStyle}
|
|
104
|
+
importantForAccessibility={expanded ? "auto" : "no-hide-descendants"}
|
|
105
|
+
>
|
|
103
106
|
<View style={bodyInnerStyle} onLayout={onBodyLayout}>
|
|
104
107
|
{typeof body === "string" ? <Body>{body}</Body> : body}
|
|
105
108
|
</View>
|
|
@@ -108,6 +111,7 @@ export const AccordionItem = ({
|
|
|
108
111
|
{/* This gradient adds a smooth end to the content. If it is missing,
|
|
109
112
|
the content will be cut sharply during the height transition. */}
|
|
110
113
|
<LinearGradient
|
|
114
|
+
accessible={false}
|
|
111
115
|
style={{
|
|
112
116
|
height: accordionBodySpacing,
|
|
113
117
|
position: "absolute",
|
|
@@ -161,7 +161,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
|
|
|
161
161
|
accessible={true}
|
|
162
162
|
disabled={disabled}
|
|
163
163
|
hitSlop={{ top: 14, right: 24, bottom: 14, left: 24 }}
|
|
164
|
-
style={
|
|
164
|
+
style={{ alignSelf: "flex-start" }}
|
|
165
165
|
>
|
|
166
166
|
<Animated.View
|
|
167
167
|
style={[
|
|
@@ -192,7 +192,11 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
|
|
|
192
192
|
onPressOut={onPressOut}
|
|
193
193
|
accessible={true}
|
|
194
194
|
disabled={disabled}
|
|
195
|
-
style={
|
|
195
|
+
style={
|
|
196
|
+
fullWidth
|
|
197
|
+
? { flexShrink: 0, alignSelf: "stretch" }
|
|
198
|
+
: { flexShrink: 1, alignSelf: "auto" }
|
|
199
|
+
}
|
|
196
200
|
>
|
|
197
201
|
<Animated.View
|
|
198
202
|
style={[
|
|
@@ -208,7 +208,11 @@ export const ButtonSolid = forwardRef<View, ButtonSolidProps>(
|
|
|
208
208
|
onPressIn={onPressIn}
|
|
209
209
|
onPressOut={onPressOut}
|
|
210
210
|
disabled={disabled}
|
|
211
|
-
style={
|
|
211
|
+
style={
|
|
212
|
+
fullWidth
|
|
213
|
+
? { flexShrink: 0, alignSelf: "stretch" }
|
|
214
|
+
: { flexShrink: 1, alignSelf: "auto" }
|
|
215
|
+
}
|
|
212
216
|
>
|
|
213
217
|
<Animated.View
|
|
214
218
|
style={[
|
|
@@ -11,12 +11,7 @@ import {
|
|
|
11
11
|
IOIcons,
|
|
12
12
|
IconClassComponent
|
|
13
13
|
} from "../../components/icons";
|
|
14
|
-
import {
|
|
15
|
-
IOButtonStyles,
|
|
16
|
-
IOColors,
|
|
17
|
-
IOIconButtonStyles,
|
|
18
|
-
hexToRgba
|
|
19
|
-
} from "../../core";
|
|
14
|
+
import { IOColors, IOIconButtonStyles, hexToRgba } from "../../core";
|
|
20
15
|
import { useScaleAnimation } from "../../hooks";
|
|
21
16
|
import { WithTestID } from "../../utils/types";
|
|
22
17
|
|
|
@@ -135,7 +130,7 @@ export const IconButtonContained = ({
|
|
|
135
130
|
onPressOut={onPressOut}
|
|
136
131
|
accessible={true}
|
|
137
132
|
disabled={disabled}
|
|
138
|
-
style={
|
|
133
|
+
style={{ alignSelf: "flex-start" }}
|
|
139
134
|
>
|
|
140
135
|
<Animated.View
|
|
141
136
|
style={[
|
|
@@ -5,7 +5,7 @@ import Animated, {
|
|
|
5
5
|
useAnimatedStyle,
|
|
6
6
|
useReducedMotion
|
|
7
7
|
} from "react-native-reanimated";
|
|
8
|
-
import {
|
|
8
|
+
import { IOIconButtonStyles, useIOTheme } from "../../core";
|
|
9
9
|
import { IOColors, hexToRgba } from "../../core/IOColors";
|
|
10
10
|
import { useScaleAnimation } from "../../hooks";
|
|
11
11
|
import { WithTestID } from "../../utils/types";
|
|
@@ -98,7 +98,7 @@ export const IconButtonSolid = ({
|
|
|
98
98
|
onPressOut={onPressOut}
|
|
99
99
|
accessible={true}
|
|
100
100
|
disabled={disabled}
|
|
101
|
-
style={
|
|
101
|
+
style={{ alignSelf: "flex-start" }}
|
|
102
102
|
>
|
|
103
103
|
<Animated.View
|
|
104
104
|
style={[
|
|
@@ -147,7 +147,8 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
|
|
|
147
147
|
onStartShouldSetResponder={[Function]}
|
|
148
148
|
style={
|
|
149
149
|
{
|
|
150
|
-
"alignSelf": "
|
|
150
|
+
"alignSelf": "auto",
|
|
151
|
+
"flexShrink": 1,
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
>
|
|
@@ -264,7 +265,8 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
|
|
|
264
265
|
onStartShouldSetResponder={[Function]}
|
|
265
266
|
style={
|
|
266
267
|
{
|
|
267
|
-
"alignSelf": "
|
|
268
|
+
"alignSelf": "auto",
|
|
269
|
+
"flexShrink": 1,
|
|
268
270
|
}
|
|
269
271
|
}
|
|
270
272
|
>
|
|
@@ -890,7 +892,8 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
|
|
|
890
892
|
onStartShouldSetResponder={[Function]}
|
|
891
893
|
style={
|
|
892
894
|
{
|
|
893
|
-
"alignSelf": "
|
|
895
|
+
"alignSelf": "auto",
|
|
896
|
+
"flexShrink": 1,
|
|
894
897
|
}
|
|
895
898
|
}
|
|
896
899
|
>
|
|
@@ -1007,7 +1010,8 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
1007
1010
|
onStartShouldSetResponder={[Function]}
|
|
1008
1011
|
style={
|
|
1009
1012
|
{
|
|
1010
|
-
"alignSelf": "
|
|
1013
|
+
"alignSelf": "auto",
|
|
1014
|
+
"flexShrink": 1,
|
|
1011
1015
|
}
|
|
1012
1016
|
}
|
|
1013
1017
|
>
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { WithTestID } from "../../utils/types";
|
|
24
24
|
import { IconButton } from "../buttons";
|
|
25
25
|
import { HStack } from "../stack";
|
|
26
|
-
import {
|
|
26
|
+
import { H2 } from "../typography";
|
|
27
27
|
import { HeaderActionProps } from "./common";
|
|
28
28
|
|
|
29
29
|
type HeaderActionsProp =
|
|
@@ -125,14 +125,15 @@ export const HeaderFirstLevel = ({
|
|
|
125
125
|
|
|
126
126
|
<View style={styles.headerInner}>
|
|
127
127
|
<View ref={titleRef} accessible accessibilityRole="header">
|
|
128
|
-
<
|
|
128
|
+
<H2
|
|
129
129
|
weight="Bold"
|
|
130
130
|
style={{ flexShrink: 1 }}
|
|
131
131
|
numberOfLines={1}
|
|
132
132
|
color={theme["textHeading-default"]}
|
|
133
|
+
maxFontSizeMultiplier={1.25}
|
|
133
134
|
>
|
|
134
135
|
{title}
|
|
135
|
-
</
|
|
136
|
+
</H2>
|
|
136
137
|
</View>
|
|
137
138
|
<HStack space={16} style={{ flexShrink: 0 }}>
|
|
138
139
|
{actions.map((action, index) => (
|
|
@@ -13,6 +13,8 @@ import Animated, {
|
|
|
13
13
|
SharedValue,
|
|
14
14
|
interpolate,
|
|
15
15
|
interpolateColor,
|
|
16
|
+
runOnJS,
|
|
17
|
+
useAnimatedReaction,
|
|
16
18
|
useAnimatedStyle,
|
|
17
19
|
useDerivedValue,
|
|
18
20
|
useScrollViewOffset,
|
|
@@ -269,6 +271,31 @@ export const HeaderSecondLevel = ({
|
|
|
269
271
|
: 1
|
|
270
272
|
}));
|
|
271
273
|
|
|
274
|
+
const [importantForAccessibility, setImportantForAccessibility] =
|
|
275
|
+
React.useState<"yes" | "no-hide-descendants">("yes");
|
|
276
|
+
|
|
277
|
+
// Updates accessibility state based on scroll position.
|
|
278
|
+
useAnimatedReaction(
|
|
279
|
+
() =>
|
|
280
|
+
enableDiscreteTransition
|
|
281
|
+
? scrollOffset.value
|
|
282
|
+
: scrollValues?.contentOffsetY.value,
|
|
283
|
+
(currentOffset, previousOffset) => {
|
|
284
|
+
if (currentOffset !== previousOffset) {
|
|
285
|
+
const offsetToCompare = enableDiscreteTransition
|
|
286
|
+
? 0
|
|
287
|
+
: scrollValues?.triggerOffset ?? 0;
|
|
288
|
+
// Sets accessibility to "yes" when scrolled past the threshold, else hides it from screen readers.
|
|
289
|
+
const newValue =
|
|
290
|
+
(currentOffset ?? 0) > offsetToCompare && !ignoreAccessibilityCheck
|
|
291
|
+
? "yes"
|
|
292
|
+
: "no-hide-descendants";
|
|
293
|
+
runOnJS(setImportantForAccessibility)(newValue);
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
[scrollValues, enableDiscreteTransition]
|
|
297
|
+
);
|
|
298
|
+
|
|
272
299
|
return (
|
|
273
300
|
<Animated.View
|
|
274
301
|
accessibilityRole="header"
|
|
@@ -303,11 +330,7 @@ export const HeaderSecondLevel = ({
|
|
|
303
330
|
<View
|
|
304
331
|
ref={titleRef}
|
|
305
332
|
accessibilityElementsHidden={!isTitleAccessible}
|
|
306
|
-
importantForAccessibility={
|
|
307
|
-
isTitleAccessible && !ignoreAccessibilityCheck
|
|
308
|
-
? "yes"
|
|
309
|
-
: "no-hide-descendants"
|
|
310
|
-
}
|
|
333
|
+
importantForAccessibility={importantForAccessibility}
|
|
311
334
|
accessible={isTitleAccessible}
|
|
312
335
|
accessibilityLabel={title}
|
|
313
336
|
accessibilityRole="header"
|
|
@@ -214,7 +214,7 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
214
214
|
: inputWidth;
|
|
215
215
|
};
|
|
216
216
|
|
|
217
|
-
const
|
|
217
|
+
const handleCancel = useCallback(
|
|
218
218
|
(event: GestureResponderEvent) => {
|
|
219
219
|
onChangeText?.("");
|
|
220
220
|
onCancel?.(event);
|
|
@@ -222,7 +222,7 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
222
222
|
[onCancel, onChangeText]
|
|
223
223
|
);
|
|
224
224
|
|
|
225
|
-
const
|
|
225
|
+
const handleClear = useCallback(() => {
|
|
226
226
|
onChangeText?.("");
|
|
227
227
|
searchInputRef.current?.clear();
|
|
228
228
|
}, [onChangeText]);
|
|
@@ -233,7 +233,10 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
233
233
|
);
|
|
234
234
|
|
|
235
235
|
const renderSearchBar = () => (
|
|
236
|
-
<Animated.View
|
|
236
|
+
<Animated.View
|
|
237
|
+
importantForAccessibility={pressable ? "no-hide-descendants" : "auto"}
|
|
238
|
+
style={styles.searchBar}
|
|
239
|
+
>
|
|
237
240
|
<Animated.View
|
|
238
241
|
style={[styles.searchInput, animatedStyle]}
|
|
239
242
|
pointerEvents={pressable ? "none" : "auto"}
|
|
@@ -279,7 +282,7 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
279
282
|
/>
|
|
280
283
|
<AnimatedPressable
|
|
281
284
|
style={[styles.clearButton, clearButtonAnimatedStyle]}
|
|
282
|
-
onPress={
|
|
285
|
+
onPress={handleClear}
|
|
283
286
|
accessibilityLabel={clearAccessibilityLabel}
|
|
284
287
|
accessibilityRole="button"
|
|
285
288
|
hitSlop={16}
|
|
@@ -294,7 +297,7 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
294
297
|
<Pressable
|
|
295
298
|
accessibilityRole="button"
|
|
296
299
|
accessibilityLabel={cancelButtonLabel}
|
|
297
|
-
onPress={
|
|
300
|
+
onPress={handleCancel}
|
|
298
301
|
>
|
|
299
302
|
<IOText
|
|
300
303
|
color={theme["interactiveElem-default"]}
|
|
@@ -316,9 +319,10 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
|
|
|
316
319
|
|
|
317
320
|
return pressable ? (
|
|
318
321
|
<Pressable
|
|
322
|
+
accessible={true}
|
|
319
323
|
accessibilityRole="button"
|
|
320
324
|
accessibilityLabel={placeholder}
|
|
321
|
-
onPress={pressable
|
|
325
|
+
onPress={pressable.onPress}
|
|
322
326
|
>
|
|
323
327
|
{renderSearchBar()}
|
|
324
328
|
</Pressable>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlexStyle, LayoutChangeEvent, StyleSheet, View } from "react-native";
|
|
3
3
|
import { ScrollView } from "react-native-gesture-handler";
|
|
4
|
+
import { IOVisualCostants } from "../../core";
|
|
4
5
|
import { TabItem } from "./TabItem";
|
|
5
6
|
|
|
6
7
|
export type TabNavigationItem = Omit<
|
|
@@ -23,6 +24,7 @@ type TabNavigation = {
|
|
|
23
24
|
onItemPress?: (index: number) => void;
|
|
24
25
|
// Tabs
|
|
25
26
|
children: TabNavigationChildren;
|
|
27
|
+
includeContentMargins?: boolean;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
const itemsJustify: Record<TabAlignment, FlexStyle["justifyContent"]> = {
|
|
@@ -37,7 +39,8 @@ const TabNavigation = ({
|
|
|
37
39
|
selectedIndex,
|
|
38
40
|
tabAlignment = "center",
|
|
39
41
|
onItemPress,
|
|
40
|
-
children
|
|
42
|
+
children,
|
|
43
|
+
includeContentMargins = true
|
|
41
44
|
}: TabNavigation) => {
|
|
42
45
|
const [itemMinWidth, setItemMinWidth] = React.useState<number>(0);
|
|
43
46
|
|
|
@@ -79,8 +82,11 @@ const TabNavigation = ({
|
|
|
79
82
|
centerContent={true}
|
|
80
83
|
showsHorizontalScrollIndicator={false}
|
|
81
84
|
contentContainerStyle={[
|
|
82
|
-
|
|
85
|
+
includeContentMargins
|
|
86
|
+
? { paddingHorizontal: IOVisualCostants.appMarginDefault }
|
|
87
|
+
: {},
|
|
83
88
|
{
|
|
89
|
+
flexGrow: 1,
|
|
84
90
|
justifyContent: itemsJustify[tabAlignment]
|
|
85
91
|
}
|
|
86
92
|
]}
|
|
@@ -91,10 +97,6 @@ const TabNavigation = ({
|
|
|
91
97
|
};
|
|
92
98
|
|
|
93
99
|
const styles = StyleSheet.create({
|
|
94
|
-
container: {
|
|
95
|
-
flexGrow: 1,
|
|
96
|
-
paddingHorizontal: 24
|
|
97
|
-
},
|
|
98
100
|
item: {
|
|
99
101
|
flexGrow: 0,
|
|
100
102
|
flexShrink: 1,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "react";
|
|
9
9
|
import { AccessibilityInfo, View } from "react-native";
|
|
10
10
|
import Animated from "react-native-reanimated";
|
|
11
|
-
import { TextInputValidationRefProps } from "
|
|
11
|
+
import { TextInputValidationRefProps } from "../../utils/types";
|
|
12
12
|
import { useIOTheme } from "../../core";
|
|
13
13
|
import { IOColors } from "../../core/IOColors";
|
|
14
14
|
import {
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
-
import { IOFontSize } from "../../utils/fonts";
|
|
4
|
+
import { IOFontSize, IOFontWeight } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
+
type H2StyleProps = TypographicStyleProps & {
|
|
8
|
+
weight?: Extract<IOFontWeight, "Semibold" | "Bold">;
|
|
9
|
+
};
|
|
10
|
+
|
|
7
11
|
export const h2FontSize: IOFontSize = 26;
|
|
8
12
|
export const h2LineHeight = 34;
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
15
|
* `H2` typographic style
|
|
12
16
|
*/
|
|
13
|
-
export const H2 = forwardRef<View,
|
|
14
|
-
(
|
|
17
|
+
export const H2 = forwardRef<View, H2StyleProps>(
|
|
18
|
+
(
|
|
19
|
+
{ weight: customWeight, color: customColor, ...props },
|
|
20
|
+
ref?: ForwardedRef<View>
|
|
21
|
+
) => {
|
|
15
22
|
const theme = useIOTheme();
|
|
16
23
|
const { newTypefaceEnabled } = useIONewTypeface();
|
|
17
24
|
|
|
@@ -19,7 +26,7 @@ export const H2 = forwardRef<View, TypographicStyleProps>(
|
|
|
19
26
|
...props,
|
|
20
27
|
dynamicTypeRamp: "title1", // iOS only
|
|
21
28
|
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
22
|
-
weight: "Semibold",
|
|
29
|
+
weight: customWeight ?? "Semibold",
|
|
23
30
|
size: h2FontSize,
|
|
24
31
|
lineHeight: h2LineHeight,
|
|
25
32
|
color: customColor ?? theme["textHeading-default"]
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
-
import { IOFontSize
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
type H3StyleProps = TypographicStyleProps & {
|
|
8
|
-
weight?: Extract<IOFontWeight, "Semibold" | "Bold">;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
7
|
/* Common typographic styles */
|
|
12
8
|
export const h3FontSize: IOFontSize = 22;
|
|
13
9
|
export const h3LineHeight = 33;
|
|
@@ -15,11 +11,8 @@ export const h3LineHeight = 33;
|
|
|
15
11
|
/**
|
|
16
12
|
* `H3` typographic style
|
|
17
13
|
*/
|
|
18
|
-
export const H3 = forwardRef<View,
|
|
19
|
-
(
|
|
20
|
-
{ weight: customWeight, color: customColor, ...props },
|
|
21
|
-
ref?: ForwardedRef<View>
|
|
22
|
-
) => {
|
|
14
|
+
export const H3 = forwardRef<View, TypographicStyleProps>(
|
|
15
|
+
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
23
16
|
const theme = useIOTheme();
|
|
24
17
|
const { newTypefaceEnabled } = useIONewTypeface();
|
|
25
18
|
|
|
@@ -27,7 +20,7 @@ export const H3 = forwardRef<View, H3StyleProps>(
|
|
|
27
20
|
...props,
|
|
28
21
|
dynamicTypeRamp: "title2", // iOS only
|
|
29
22
|
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
30
|
-
weight:
|
|
23
|
+
weight: "Semibold",
|
|
31
24
|
size: h3FontSize,
|
|
32
25
|
lineHeight: h3LineHeight,
|
|
33
26
|
color: customColor ?? theme["textHeading-default"]
|