jfs-components 0.1.18 → 0.1.23
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 +19 -0
- package/lib/commonjs/components/Card/Card.js +29 -12
- package/lib/commonjs/components/CardFeedback/CardFeedback.js +16 -2
- package/lib/commonjs/components/CardInsight/CardInsight.js +34 -13
- package/lib/commonjs/components/CardProviderInfo/CardProviderInfo.js +23 -3
- package/lib/commonjs/components/CheckboxItem/CheckboxItem.js +31 -8
- package/lib/commonjs/components/ContentSheet/ContentSheet.js +131 -0
- package/lib/commonjs/components/DebitCard/DebitCard.js +23 -3
- package/lib/commonjs/components/HeroSection/HeroSection.js +165 -0
- package/lib/commonjs/components/Image/Image.js +33 -7
- package/lib/commonjs/components/Link/Link.js +115 -0
- package/lib/commonjs/components/ListItem/ListItem.js +16 -1
- package/lib/commonjs/components/MediaCard/MediaCard.js +24 -7
- package/lib/commonjs/components/RechargeCard/RechargeCard.js +34 -13
- package/lib/commonjs/components/TestimonialsCard/TestimonialsCard.js +23 -5
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +53 -43
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/Card/Card.js +31 -14
- package/lib/module/components/CardFeedback/CardFeedback.js +17 -3
- package/lib/module/components/CardInsight/CardInsight.js +36 -15
- package/lib/module/components/CardProviderInfo/CardProviderInfo.js +25 -5
- package/lib/module/components/CheckboxItem/CheckboxItem.js +31 -8
- package/lib/module/components/ContentSheet/ContentSheet.js +126 -0
- package/lib/module/components/DebitCard/DebitCard.js +25 -5
- package/lib/module/components/HeroSection/HeroSection.js +159 -0
- package/lib/module/components/Image/Image.js +34 -7
- package/lib/module/components/Link/Link.js +110 -0
- package/lib/module/components/ListItem/ListItem.js +16 -1
- package/lib/module/components/MediaCard/MediaCard.js +26 -9
- package/lib/module/components/RechargeCard/RechargeCard.js +36 -15
- package/lib/module/components/TestimonialsCard/TestimonialsCard.js +25 -7
- package/lib/module/components/index.js +3 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +53 -43
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/Card/Card.d.ts +10 -1
- package/lib/typescript/src/components/CardFeedback/CardFeedback.d.ts +10 -1
- package/lib/typescript/src/components/CardInsight/CardInsight.d.ts +10 -1
- package/lib/typescript/src/components/CardProviderInfo/CardProviderInfo.d.ts +10 -1
- package/lib/typescript/src/components/CheckboxItem/CheckboxItem.d.ts +26 -3
- package/lib/typescript/src/components/ContentSheet/ContentSheet.d.ts +71 -0
- package/lib/typescript/src/components/DebitCard/DebitCard.d.ts +10 -1
- package/lib/typescript/src/components/HeroSection/HeroSection.d.ts +80 -0
- package/lib/typescript/src/components/Image/Image.d.ts +27 -2
- package/lib/typescript/src/components/Link/Link.d.ts +73 -0
- package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +10 -1
- package/lib/typescript/src/components/RechargeCard/RechargeCard.d.ts +10 -1
- package/lib/typescript/src/components/TestimonialsCard/TestimonialsCard.d.ts +8 -1
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +8 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Card/Card.tsx +46 -15
- package/src/components/CardFeedback/CardFeedback.tsx +29 -4
- package/src/components/CardInsight/CardInsight.tsx +48 -17
- package/src/components/CardProviderInfo/CardProviderInfo.tsx +36 -3
- package/src/components/CheckboxItem/CheckboxItem.tsx +59 -14
- package/src/components/ContentSheet/ContentSheet.tsx +217 -0
- package/src/components/DebitCard/DebitCard.tsx +36 -3
- package/src/components/HeroSection/HeroSection.tsx +231 -0
- package/src/components/Image/Image.tsx +55 -3
- package/src/components/Link/Link.tsx +159 -0
- package/src/components/ListItem/ListItem.tsx +15 -0
- package/src/components/MediaCard/MediaCard.tsx +40 -9
- package/src/components/RechargeCard/RechargeCard.tsx +48 -13
- package/src/components/TestimonialsCard/TestimonialsCard.tsx +37 -6
- package/src/components/index.ts +3 -0
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +53 -43
- package/src/icons/registry.ts +1 -1
|
@@ -2,14 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import { Image as RNImage, View } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* iOS URL cache control (maps to RN's `source.cache`, no-op on Android/web):
|
|
8
|
+
* - `'default'` — use the native platform's default caching.
|
|
9
|
+
* - `'reload'` — ignore any cache, always fetch from the network.
|
|
10
|
+
* - `'force-cache'` — use the cached response regardless of age; fetch
|
|
11
|
+
* only if absent.
|
|
12
|
+
* - `'only-if-cached'` — use the cache only; never hit the network.
|
|
13
|
+
*/
|
|
14
|
+
|
|
5
15
|
import Skeleton from '../../skeleton/Skeleton';
|
|
6
16
|
import { useSkeleton } from '../../skeleton/SkeletonGroup';
|
|
7
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
function normalizeSource(imageSource) {
|
|
18
|
+
function normalizeSource(imageSource, cache) {
|
|
9
19
|
if (imageSource == null) return undefined;
|
|
10
|
-
if (typeof imageSource === 'string')
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
if (typeof imageSource === 'string') {
|
|
21
|
+
return cache ? {
|
|
22
|
+
uri: imageSource,
|
|
23
|
+
cache
|
|
24
|
+
} : {
|
|
25
|
+
uri: imageSource
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// Only remote sources (single object with a `uri`) can carry a cache policy.
|
|
29
|
+
if (cache && !Array.isArray(imageSource) && typeof imageSource === 'object' && 'uri' in imageSource) {
|
|
30
|
+
return {
|
|
31
|
+
...imageSource,
|
|
32
|
+
cache
|
|
33
|
+
};
|
|
34
|
+
}
|
|
13
35
|
return imageSource;
|
|
14
36
|
}
|
|
15
37
|
|
|
@@ -45,9 +67,12 @@ function Image({
|
|
|
45
67
|
accessibilityLabel,
|
|
46
68
|
accessibilityElementsHidden,
|
|
47
69
|
importantForAccessibility,
|
|
48
|
-
loading
|
|
70
|
+
loading,
|
|
71
|
+
cache,
|
|
72
|
+
onLoad,
|
|
73
|
+
onError
|
|
49
74
|
}) {
|
|
50
|
-
const source = useMemo(() => normalizeSource(imageSource), [imageSource]);
|
|
75
|
+
const source = useMemo(() => normalizeSource(imageSource, cache), [imageSource, cache]);
|
|
51
76
|
|
|
52
77
|
// Explicit { width, height } means a "fill an exact box" layout — typically a
|
|
53
78
|
// full-bleed hero/background where the asset is high-res and sharpness
|
|
@@ -104,7 +129,9 @@ function Image({
|
|
|
104
129
|
resizeMethod: effectiveResizeMethod,
|
|
105
130
|
accessibilityLabel: accessibilityLabel,
|
|
106
131
|
accessibilityElementsHidden: accessibilityElementsHidden,
|
|
107
|
-
importantForAccessibility: importantForAccessibility
|
|
132
|
+
importantForAccessibility: importantForAccessibility,
|
|
133
|
+
onLoad: onLoad,
|
|
134
|
+
onError: onError
|
|
108
135
|
});
|
|
109
136
|
}
|
|
110
137
|
export default /*#__PURE__*/React.memo(Image);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import { Text as RNText } from 'react-native';
|
|
5
|
+
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
|
+
import { EMPTY_MODES, resolveTextLayout } from '../../utils/react-utils';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const TEXT_ALIGN_MAP = {
|
|
9
|
+
Left: 'left',
|
|
10
|
+
Center: 'center'
|
|
11
|
+
};
|
|
12
|
+
const DISABLED_OPACITY = 0.4;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Link — an underlined, pressable text primitive.
|
|
16
|
+
*
|
|
17
|
+
* It renders a single React Native `<Text>` (not a `Pressable`), so it flows
|
|
18
|
+
* inline and can be nested inside {@link TextSegment} exactly like a `Text`
|
|
19
|
+
* run — the React Native equivalent of an `<a>` inside a `<p>`. Font family,
|
|
20
|
+
* size, weight, line-height and letter-spacing come from the dedicated `link/*`
|
|
21
|
+
* tokens, while the colour resolves from `text/foreground` (so a link sits on
|
|
22
|
+
* the same colour as the surrounding copy). The label is always underlined.
|
|
23
|
+
*
|
|
24
|
+
* @example Standalone
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Link text="Forgot PIN?" onPress={() => navigation.navigate('ResetPin')} />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example Inline inside TextSegment
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <TextSegment>
|
|
32
|
+
* <Text>By continuing you agree to our </Text>
|
|
33
|
+
* <Link onPress={openTerms}>Terms</Link>
|
|
34
|
+
* <Text>.</Text>
|
|
35
|
+
* </TextSegment>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
function Link({
|
|
39
|
+
text,
|
|
40
|
+
children,
|
|
41
|
+
onPress,
|
|
42
|
+
disabled = false,
|
|
43
|
+
autolayout = 'Fill',
|
|
44
|
+
textAlign = 'Left',
|
|
45
|
+
modes = EMPTY_MODES,
|
|
46
|
+
style,
|
|
47
|
+
numberOfLines,
|
|
48
|
+
disableTruncation,
|
|
49
|
+
singleLine,
|
|
50
|
+
accessibilityLabel,
|
|
51
|
+
accessibilityHint
|
|
52
|
+
}) {
|
|
53
|
+
// Bindings mirror the Figma `Link` node exactly: colour from `text/foreground`
|
|
54
|
+
// (so the link matches the surrounding copy), everything else from the
|
|
55
|
+
// dedicated `link/*` tokens.
|
|
56
|
+
const foreground = getVariableByName('text/foreground', modes) ?? '#000000';
|
|
57
|
+
const fontFamily = getVariableByName('link/fontFamily', modes) ?? 'JioType Var';
|
|
58
|
+
const fontSize = getVariableByName('link/fontSize', modes) ?? 12;
|
|
59
|
+
const fontWeight = getVariableByName('link/fontWeight', modes) ?? 400;
|
|
60
|
+
const lineHeight = getVariableByName('link/lineHeight', modes) ?? 16;
|
|
61
|
+
const letterSpacing = getVariableByName('link/letterSpacing', modes) ?? -0.5;
|
|
62
|
+
const linkStyle = {
|
|
63
|
+
color: foreground,
|
|
64
|
+
fontFamily: fontFamily,
|
|
65
|
+
fontSize: fontSize,
|
|
66
|
+
fontWeight: String(fontWeight),
|
|
67
|
+
lineHeight: lineHeight,
|
|
68
|
+
letterSpacing: letterSpacing,
|
|
69
|
+
textAlign: TEXT_ALIGN_MAP[textAlign],
|
|
70
|
+
textDecorationLine: 'underline',
|
|
71
|
+
alignSelf: autolayout === 'Fill' ? 'stretch' : 'flex-start',
|
|
72
|
+
...(disabled ? {
|
|
73
|
+
opacity: DISABLED_OPACITY
|
|
74
|
+
} : null)
|
|
75
|
+
};
|
|
76
|
+
const content = children !== undefined && children !== null && children !== false ? children : text !== undefined ? text : 'Link';
|
|
77
|
+
const handlePress = useCallback(event => {
|
|
78
|
+
if (disabled) return;
|
|
79
|
+
onPress?.(event);
|
|
80
|
+
}, [disabled, onPress]);
|
|
81
|
+
const {
|
|
82
|
+
style: layoutStyle,
|
|
83
|
+
...truncation
|
|
84
|
+
} = resolveTextLayout({
|
|
85
|
+
disableTruncation,
|
|
86
|
+
singleLine,
|
|
87
|
+
numberOfLines
|
|
88
|
+
});
|
|
89
|
+
const resolvedLabel = accessibilityLabel ?? (typeof content === 'string' ? content : undefined);
|
|
90
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
91
|
+
accessibilityRole: "link",
|
|
92
|
+
accessibilityState: {
|
|
93
|
+
disabled
|
|
94
|
+
},
|
|
95
|
+
...(resolvedLabel !== undefined ? {
|
|
96
|
+
accessibilityLabel: resolvedLabel
|
|
97
|
+
} : null),
|
|
98
|
+
...(accessibilityHint !== undefined ? {
|
|
99
|
+
accessibilityHint
|
|
100
|
+
} : null),
|
|
101
|
+
...(onPress !== undefined ? {
|
|
102
|
+
onPress: handlePress
|
|
103
|
+
} : null),
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
style: [linkStyle, style, layoutStyle],
|
|
106
|
+
...truncation,
|
|
107
|
+
children: content
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
export default /*#__PURE__*/React.memo(Link);
|
|
@@ -57,6 +57,17 @@ function resolveListItemTokens(modes) {
|
|
|
57
57
|
const paddingLeft = getVariableByName('listItem/padding/left', resolvedModes) ?? 0;
|
|
58
58
|
const paddingRight = getVariableByName('listItem/padding/right', resolvedModes) ?? 0;
|
|
59
59
|
const textWrapGap = getVariableByName('listItem/text wrap', resolvedModes) ?? 0;
|
|
60
|
+
|
|
61
|
+
// Container surface — driven by the `List Item Style` collection
|
|
62
|
+
// (Default | Boxed | Minimal) plus `ListItem State`, `Selectable`,
|
|
63
|
+
// `Page type` and `Color Mode`. In the default style these all resolve to a
|
|
64
|
+
// transparent background / no border / 0 radius, so existing usages are
|
|
65
|
+
// visually unchanged; the "Boxed" style paints a filled, rounded, bordered
|
|
66
|
+
// surface.
|
|
67
|
+
const backgroundColor = getVariableByName('listItem/background/color', resolvedModes);
|
|
68
|
+
const borderColor = getVariableByName('listItem/border/color', resolvedModes);
|
|
69
|
+
const borderWidth = getVariableByName('listItem/borderWidth', resolvedModes) ?? 0;
|
|
70
|
+
const borderRadius = getVariableByName('listItem/radius', resolvedModes) ?? 0;
|
|
60
71
|
const titleColor = getVariableByName('listItem/title/color', textModes);
|
|
61
72
|
const titleFontSize = getVariableByName('listItem/title/fontSize', textModes);
|
|
62
73
|
const titleLineHeight = getVariableByName('listItem/title/lineHeight', textModes);
|
|
@@ -74,7 +85,11 @@ function resolveListItemTokens(modes) {
|
|
|
74
85
|
paddingTop: paddingTop,
|
|
75
86
|
paddingBottom: paddingBottom,
|
|
76
87
|
paddingLeft: paddingLeft,
|
|
77
|
-
paddingRight: paddingRight
|
|
88
|
+
paddingRight: paddingRight,
|
|
89
|
+
backgroundColor: backgroundColor,
|
|
90
|
+
borderColor: borderColor,
|
|
91
|
+
borderWidth,
|
|
92
|
+
borderRadius
|
|
78
93
|
},
|
|
79
94
|
horizontalLayoutStyle: {
|
|
80
95
|
flexDirection: 'row',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { createContext, useContext } from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
4
|
+
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import Image from '../Image/Image';
|
|
7
7
|
import GlassFill from '../../utils/GlassFill/GlassFill';
|
|
8
8
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const MediaCardContext = /*#__PURE__*/createContext({});
|
|
11
11
|
/**
|
|
12
12
|
* MediaCard component implementation from Figma node 1241:4140.
|
|
@@ -32,7 +32,10 @@ export function MediaCard({
|
|
|
32
32
|
media,
|
|
33
33
|
children,
|
|
34
34
|
modes = EMPTY_MODES,
|
|
35
|
-
style
|
|
35
|
+
style,
|
|
36
|
+
onPress,
|
|
37
|
+
disabled,
|
|
38
|
+
accessibilityLabel
|
|
36
39
|
}) {
|
|
37
40
|
const radius = parseFloat(getVariableByName('cardMedia/radius', modes));
|
|
38
41
|
const containerStyle = {
|
|
@@ -47,17 +50,31 @@ export function MediaCard({
|
|
|
47
50
|
accessibilityElementsHidden: true,
|
|
48
51
|
importantForAccessibility: "no"
|
|
49
52
|
}) : null);
|
|
53
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
54
|
+
children: [background, children != null ? /*#__PURE__*/_jsx(View, {
|
|
55
|
+
style: StyleSheet.absoluteFill,
|
|
56
|
+
pointerEvents: "box-none",
|
|
57
|
+
children: children
|
|
58
|
+
}) : null]
|
|
59
|
+
});
|
|
50
60
|
return /*#__PURE__*/_jsx(MediaCardContext.Provider, {
|
|
51
61
|
value: {
|
|
52
62
|
modes
|
|
53
63
|
},
|
|
54
|
-
children: /*#__PURE__*/
|
|
64
|
+
children: onPress ? /*#__PURE__*/_jsx(Pressable, {
|
|
65
|
+
style: [containerStyle, style],
|
|
66
|
+
onPress: onPress,
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
accessibilityRole: "button",
|
|
69
|
+
accessibilityLabel: accessibilityLabel,
|
|
70
|
+
accessibilityState: {
|
|
71
|
+
disabled: !!disabled
|
|
72
|
+
},
|
|
73
|
+
children: content
|
|
74
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
55
75
|
style: [containerStyle, style],
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
pointerEvents: "box-none",
|
|
59
|
-
children: children
|
|
60
|
-
}) : null]
|
|
76
|
+
accessibilityLabel: accessibilityLabel,
|
|
77
|
+
children: content
|
|
61
78
|
})
|
|
62
79
|
});
|
|
63
80
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { View, Text } from 'react-native';
|
|
4
|
+
import { View, Text, Pressable } from 'react-native';
|
|
5
5
|
import ButtonGroup from '../ButtonGroup/ButtonGroup';
|
|
6
6
|
import AvatarGroup from '../AvatarGroup/AvatarGroup';
|
|
7
7
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
8
8
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
9
9
|
import MoneyValue from '../MoneyValue/MoneyValue';
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
// Defaults applied to the inner ButtonGroup so the card matches Figma out of
|
|
12
12
|
// the box. They are spread *before* the caller's `modes` so any consumer can
|
|
13
13
|
// override an individual key (e.g. swap the size to "M").
|
|
@@ -36,7 +36,10 @@ export default function RechargeCard({
|
|
|
36
36
|
subscriptionContent,
|
|
37
37
|
actions,
|
|
38
38
|
modes = EMPTY_MODES,
|
|
39
|
-
style
|
|
39
|
+
style,
|
|
40
|
+
onPress,
|
|
41
|
+
disabled,
|
|
42
|
+
accessibilityLabel
|
|
40
43
|
}) {
|
|
41
44
|
// Container Tokens (defaults mirror Figma node 2235:937).
|
|
42
45
|
const backgroundColor = getVariableByName('rechargeCard/background', modes);
|
|
@@ -85,18 +88,18 @@ export default function RechargeCard({
|
|
|
85
88
|
// Pass modes to subscription children (e.g. AvatarGroup)
|
|
86
89
|
// Now encapsulated, so we just pass children to AvatarGroup
|
|
87
90
|
const hasSubscriptions = React.Children.count(subscriptionContent) > 0;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
const containerStyle = {
|
|
92
|
+
backgroundColor,
|
|
93
|
+
paddingHorizontal,
|
|
94
|
+
paddingVertical,
|
|
95
|
+
gap,
|
|
96
|
+
borderRadius: radius,
|
|
97
|
+
borderWidth: strokeWidth,
|
|
98
|
+
borderColor: strokeColor,
|
|
99
|
+
minWidth,
|
|
100
|
+
alignItems: 'flex-start'
|
|
101
|
+
};
|
|
102
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
100
103
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
101
104
|
style: {
|
|
102
105
|
gap: headerGap,
|
|
@@ -212,4 +215,22 @@ export default function RechargeCard({
|
|
|
212
215
|
children: actions
|
|
213
216
|
})]
|
|
214
217
|
});
|
|
218
|
+
if (onPress) {
|
|
219
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
220
|
+
style: [containerStyle, style],
|
|
221
|
+
onPress: onPress,
|
|
222
|
+
disabled: disabled,
|
|
223
|
+
accessibilityRole: "button",
|
|
224
|
+
accessibilityLabel: accessibilityLabel ?? title,
|
|
225
|
+
accessibilityState: {
|
|
226
|
+
disabled: !!disabled
|
|
227
|
+
},
|
|
228
|
+
children: content
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
return /*#__PURE__*/_jsx(View, {
|
|
232
|
+
style: [containerStyle, style],
|
|
233
|
+
accessibilityLabel: accessibilityLabel,
|
|
234
|
+
children: content
|
|
235
|
+
});
|
|
215
236
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { View, Text } from 'react-native';
|
|
4
|
+
import { View, Text, Pressable } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
7
7
|
import Avatar from '../Avatar/Avatar';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
10
10
|
* TestimonialsCard renders a compact, fixed-width card with a circular avatar,
|
|
11
11
|
* a bold title, and a body paragraph. It is typically used inside a horizontal
|
|
@@ -28,7 +28,9 @@ function TestimonialsCard({
|
|
|
28
28
|
modes = EMPTY_MODES,
|
|
29
29
|
style,
|
|
30
30
|
avatarProps,
|
|
31
|
-
accessibilityLabel
|
|
31
|
+
accessibilityLabel,
|
|
32
|
+
onPress,
|
|
33
|
+
disabled
|
|
32
34
|
}) {
|
|
33
35
|
// Container tokens
|
|
34
36
|
const background = getVariableByName('testimonialsCard/background', modes) ?? '#ffffff';
|
|
@@ -84,10 +86,7 @@ function TestimonialsCard({
|
|
|
84
86
|
...(avatarProps?.modes || {})
|
|
85
87
|
};
|
|
86
88
|
const resolvedAccessibilityLabel = accessibilityLabel ?? `Testimonial${title ? ` from ${title}` : ''}${body ? `: ${body}` : ''}`;
|
|
87
|
-
|
|
88
|
-
style: [containerStyle, style],
|
|
89
|
-
accessibilityRole: "text",
|
|
90
|
-
accessibilityLabel: resolvedAccessibilityLabel,
|
|
89
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
91
90
|
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
92
91
|
style: "Image",
|
|
93
92
|
modes: avatarModes,
|
|
@@ -107,6 +106,25 @@ function TestimonialsCard({
|
|
|
107
106
|
})]
|
|
108
107
|
})]
|
|
109
108
|
});
|
|
109
|
+
if (onPress) {
|
|
110
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
111
|
+
style: [containerStyle, style],
|
|
112
|
+
onPress: onPress,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
accessibilityRole: "button",
|
|
115
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
116
|
+
accessibilityState: {
|
|
117
|
+
disabled: !!disabled
|
|
118
|
+
},
|
|
119
|
+
children: content
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return /*#__PURE__*/_jsx(View, {
|
|
123
|
+
style: [containerStyle, style],
|
|
124
|
+
accessibilityRole: "text",
|
|
125
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
126
|
+
children: content
|
|
127
|
+
});
|
|
110
128
|
}
|
|
111
129
|
const textContainerStyle = {
|
|
112
130
|
width: '100%',
|
|
@@ -37,6 +37,7 @@ export { default as FullscreenModal } from './FullscreenModal/FullscreenModal';
|
|
|
37
37
|
export { default as Form } from './Form/Form';
|
|
38
38
|
export { useFormContext } from './Form/Form';
|
|
39
39
|
export { default as FormField } from './FormField/FormField';
|
|
40
|
+
export { default as ContentSheet } from './ContentSheet/ContentSheet';
|
|
40
41
|
export { default as CircularProgressBar } from './CircularProgressBar/CircularProgressBar';
|
|
41
42
|
export { default as CircularProgressBarDoted } from './CircularProgressBarDoted/CircularProgressBarDoted';
|
|
42
43
|
export { default as CircularRating } from './CircularRating/CircularRating';
|
|
@@ -46,6 +47,7 @@ export { default as ComparisonBar } from './ComparisonBar/ComparisonBar';
|
|
|
46
47
|
export { default as AllocationComparisonChart } from './AllocationComparisonChart/AllocationComparisonChart';
|
|
47
48
|
export { default as MonthlyStatusGrid, CalendarGlyph } from './MonthlyStatusGrid/MonthlyStatusGrid';
|
|
48
49
|
export { default as Gauge } from './Gauge/Gauge';
|
|
50
|
+
export { default as HeroSection } from './HeroSection/HeroSection';
|
|
49
51
|
export { default as HoldingsCard } from './HoldingsCard/HoldingsCard';
|
|
50
52
|
export { default as HStack } from './HStack/HStack';
|
|
51
53
|
export { default as Icon } from './Icon/Icon';
|
|
@@ -53,6 +55,7 @@ export { default as IconButton } from './IconButton/IconButton';
|
|
|
53
55
|
export { default as IconCapsule } from './IconCapsule/IconCapsule';
|
|
54
56
|
export { default as Image } from './Image/Image';
|
|
55
57
|
export { default as LazyList } from './LazyList/LazyList';
|
|
58
|
+
export { default as Link } from './Link/Link';
|
|
56
59
|
export { default as LinearMeter } from './LinearMeter/LinearMeter';
|
|
57
60
|
export { default as LinearProgress } from './LinearProgress/LinearProgress';
|
|
58
61
|
export { default as ListGroup } from './ListGroup/ListGroup';
|