jfs-components 0.0.69 → 0.0.71
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 +20 -0
- package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +203 -0
- package/lib/commonjs/components/CardCTA/CardCTA.js +198 -16
- package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +147 -0
- package/lib/commonjs/components/CircularProgressBarDoted/CircularProgressBarDoted.js +258 -0
- package/lib/commonjs/components/CircularRating/CircularRating.js +161 -0
- package/lib/commonjs/components/Gauge/Gauge.js +223 -0
- package/lib/commonjs/components/ListGroup/ListGroup.js +3 -1
- package/lib/commonjs/components/MediaCard/GlassFill.js +62 -0
- package/lib/commonjs/components/MediaCard/GlassFill.web.js +48 -0
- package/lib/commonjs/components/MediaCard/MediaCard.js +28 -31
- package/lib/commonjs/components/Nudge/Nudge.js +179 -87
- package/lib/commonjs/components/index.js +35 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/CardAdvisory/CardAdvisory.js +197 -0
- package/lib/module/components/CardCTA/CardCTA.js +199 -17
- package/lib/module/components/CircularProgressBar/CircularProgressBar.js +141 -0
- package/lib/module/components/CircularProgressBarDoted/CircularProgressBarDoted.js +253 -0
- package/lib/module/components/CircularRating/CircularRating.js +155 -0
- package/lib/module/components/Gauge/Gauge.js +217 -0
- package/lib/module/components/ListGroup/ListGroup.js +3 -1
- package/lib/module/components/MediaCard/GlassFill.js +57 -0
- package/lib/module/components/MediaCard/GlassFill.web.js +43 -0
- package/lib/module/components/MediaCard/MediaCard.js +29 -32
- package/lib/module/components/Nudge/Nudge.js +178 -87
- package/lib/module/components/index.js +5 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +49 -0
- package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +16 -1
- package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +27 -0
- package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +48 -0
- package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +49 -0
- package/lib/typescript/src/components/Gauge/Gauge.d.ts +53 -0
- package/lib/typescript/src/components/MediaCard/GlassFill.d.ts +47 -0
- package/lib/typescript/src/components/MediaCard/GlassFill.web.d.ts +20 -0
- package/lib/typescript/src/components/MediaCard/MediaCard.d.ts +17 -13
- package/lib/typescript/src/components/Nudge/Nudge.d.ts +14 -11
- package/lib/typescript/src/components/index.d.ts +6 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +3 -2
- package/src/components/CardAdvisory/CardAdvisory.tsx +283 -0
- package/src/components/CardCTA/CardCTA.tsx +236 -13
- package/src/components/CircularProgressBar/CircularProgressBar.tsx +190 -0
- package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +357 -0
- package/src/components/CircularRating/CircularRating.tsx +241 -0
- package/src/components/Gauge/Gauge.tsx +303 -0
- package/src/components/ListGroup/ListGroup.tsx +3 -1
- package/src/components/MediaCard/GlassFill.tsx +89 -0
- package/src/components/MediaCard/GlassFill.web.tsx +53 -0
- package/src/components/MediaCard/MediaCard.tsx +29 -48
- package/src/components/Nudge/Nudge.tsx +222 -82
- package/src/components/index.ts +6 -1
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/icons/registry.ts +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const DEFAULT_FALLBACK_DARK = '#1414174a';
|
|
7
|
+
const DEFAULT_FALLBACK_LIGHT = '#ffffff66';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Web counterpart of `GlassFill`.
|
|
11
|
+
*
|
|
12
|
+
* `@react-native-community/blur` does not ship a web implementation, so for
|
|
13
|
+
* the web bundle we render a translucent `View` with `backdrop-filter: blur()`
|
|
14
|
+
* — which is exactly how 0.0.67 and earlier shipped the glass effect on web.
|
|
15
|
+
* Native bundles pick up `GlassFill.tsx` instead via Metro's platform
|
|
16
|
+
* resolver; the web bundle picks up this file.
|
|
17
|
+
*/
|
|
18
|
+
function GlassFill({
|
|
19
|
+
tint = 'dark',
|
|
20
|
+
intensity = 50,
|
|
21
|
+
overlayColor,
|
|
22
|
+
style
|
|
23
|
+
}) {
|
|
24
|
+
// Approximate mapping: intensity 0-100 -> ~0-30px CSS blur. Keeps parity
|
|
25
|
+
// with the native blur strength so the component looks roughly the same
|
|
26
|
+
// across platforms.
|
|
27
|
+
const blurPx = Math.max(0, Math.min(30, Math.round(intensity * 0.3)));
|
|
28
|
+
const tintColor = overlayColor ?? (tint === 'light' ? DEFAULT_FALLBACK_LIGHT : DEFAULT_FALLBACK_DARK);
|
|
29
|
+
return /*#__PURE__*/_jsx(View, {
|
|
30
|
+
style: [StyleSheet.absoluteFill, {
|
|
31
|
+
backgroundColor: tintColor
|
|
32
|
+
},
|
|
33
|
+
// backdrop-filter is a web-only CSS property; ignored by RN
|
|
34
|
+
// on native (we never bundle this file there anyway).
|
|
35
|
+
// @ts-ignore web-only style
|
|
36
|
+
{
|
|
37
|
+
backdropFilter: `blur(${blurPx}px)`,
|
|
38
|
+
WebkitBackdropFilter: `blur(${blurPx}px)`
|
|
39
|
+
}, style],
|
|
40
|
+
pointerEvents: "none"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export default GlassFill;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { createContext, useContext } from 'react';
|
|
4
|
-
import { View, Text, StyleSheet
|
|
5
|
-
import { BlurView } from 'expo-blur';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
6
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
7
6
|
import Image from '../Image/Image';
|
|
7
|
+
import GlassFill from './GlassFill';
|
|
8
8
|
import { EMPTY_MODES } from '../../utils/react-utils';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const MediaCardContext = /*#__PURE__*/createContext({});
|
|
@@ -124,20 +124,24 @@ export function Title({
|
|
|
124
124
|
* Glass Footer — pinned to the bottom of the card, **always** on top of the
|
|
125
125
|
* Header (`zIndex: 2`).
|
|
126
126
|
*
|
|
127
|
-
* Glass implementation
|
|
128
|
-
* - **iOS
|
|
129
|
-
*
|
|
130
|
-
* `
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* - **Web:** `BlurView` on web is implemented as `backdrop-filter: blur()`,
|
|
138
|
-
* which already worked in the previous version. Same component, same API.
|
|
127
|
+
* Glass implementation:
|
|
128
|
+
* - **iOS / Android:** `<GlassFill>` (this folder) wraps
|
|
129
|
+
* `@react-native-community/blur`'s `BlurView`. iOS gets a real
|
|
130
|
+
* `UIVisualEffectView` (live OS blur); Android gets the community
|
|
131
|
+
* `RealtimeBlurView` with a token-driven tinted scrim fallback for
|
|
132
|
+
* devices where realtime blur is unavailable.
|
|
133
|
+
* - **Web:** the platform-extension file `GlassFill.web.tsx` renders a
|
|
134
|
+
* translucent View with `backdrop-filter: blur()` — Metro picks the
|
|
135
|
+
* correct file automatically, so the web bundle never imports the
|
|
136
|
+
* native-only blur module.
|
|
139
137
|
*
|
|
140
|
-
*
|
|
138
|
+
* Why we don't use `expo-blur`: it requires Expo Modules autolinking on the
|
|
139
|
+
* consumer side (`use_expo_modules!` / `ExpoModulesPackage`), which silently
|
|
140
|
+
* breaks bare React Native apps that just install this library and run
|
|
141
|
+
* `pod install`. `@react-native-community/blur` is a regular RN native
|
|
142
|
+
* module — autolinking handles it with no additional setup.
|
|
143
|
+
*
|
|
144
|
+
* Tokens still drive the tint color, blur intensity and inner spacing.
|
|
141
145
|
*/
|
|
142
146
|
export function Footer({
|
|
143
147
|
children,
|
|
@@ -151,10 +155,14 @@ export function Footer({
|
|
|
151
155
|
const paddingVertical = parseFloat(getVariableByName('cardMedia/footer/padding/vertical', modes) || '12');
|
|
152
156
|
|
|
153
157
|
// Figma tokens:
|
|
154
|
-
// blur/minimal/background -> tint laid over the
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
+
// blur/minimal/background -> tint laid over the live blur, also used
|
|
159
|
+
// as the iOS reduced-transparency fallback.
|
|
160
|
+
// blur/minimal -> blur radius (px). The community BlurView
|
|
161
|
+
// uses `blurAmount` (~0-32). `GlassFill`
|
|
162
|
+
// accepts a 0-100 "intensity" (kept compat
|
|
163
|
+
// with the previous expo-blur scale) and
|
|
164
|
+
// maps it internally — here we convert the
|
|
165
|
+
// token's radius to that intensity scale.
|
|
158
166
|
const glassBgColor = getVariableByName('blur/minimal/background', modes) || '#1414174a';
|
|
159
167
|
const blurRadius = parseFloat(getVariableByName('blur/minimal', modes) || '29');
|
|
160
168
|
const intensity = Math.max(0, Math.min(100, Math.round(blurRadius * 1.7)));
|
|
@@ -175,22 +183,11 @@ export function Footer({
|
|
|
175
183
|
zIndex: 2
|
|
176
184
|
}, style],
|
|
177
185
|
pointerEvents: "box-none",
|
|
178
|
-
children: [/*#__PURE__*/_jsx(
|
|
179
|
-
style: StyleSheet.absoluteFill,
|
|
186
|
+
children: [/*#__PURE__*/_jsx(GlassFill, {
|
|
180
187
|
tint: tint,
|
|
181
188
|
intensity: intensity,
|
|
182
|
-
|
|
189
|
+
overlayColor: glassBgColor
|
|
183
190
|
}), /*#__PURE__*/_jsx(View, {
|
|
184
|
-
style: [StyleSheet.absoluteFill, {
|
|
185
|
-
backgroundColor: glassBgColor
|
|
186
|
-
}]
|
|
187
|
-
}), Platform.OS === 'android' ? /*#__PURE__*/_jsx(View, {
|
|
188
|
-
style: [StyleSheet.absoluteFill, {
|
|
189
|
-
backgroundColor: 'rgba(255,255,255,0.03)',
|
|
190
|
-
opacity: 0.6
|
|
191
|
-
}],
|
|
192
|
-
pointerEvents: "none"
|
|
193
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
194
191
|
style: {
|
|
195
192
|
flexDirection: 'row',
|
|
196
193
|
alignItems: 'center',
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import { View, Text } from 'react-native';
|
|
5
5
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver';
|
|
6
6
|
import { useTokens } from '../../design-tokens/JFSThemeProvider';
|
|
7
7
|
import { cloneChildrenWithModes, EMPTY_MODES } from '../../utils/react-utils';
|
|
8
8
|
import Button from '../Button/Button';
|
|
9
|
+
import Icon from '../../icons/Icon';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
buttonSlot,
|
|
17
|
-
startSlot,
|
|
18
|
-
children,
|
|
19
|
-
modes: propModes = EMPTY_MODES,
|
|
20
|
-
style
|
|
21
|
-
}) {
|
|
22
|
-
const {
|
|
23
|
-
modes: globalModes
|
|
24
|
-
} = useTokens();
|
|
25
|
-
const modes = {
|
|
26
|
-
...globalModes,
|
|
27
|
-
...propModes
|
|
28
|
-
};
|
|
11
|
+
function toFontWeight(value, fallback) {
|
|
12
|
+
if (typeof value === 'number') return value.toString();
|
|
13
|
+
if (typeof value === 'string') return value;
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
function resolveNudgeTokens(modes) {
|
|
29
17
|
const background = getVariableByName('nudge/background', modes) || '#f5f5f5';
|
|
30
18
|
const radius = getVariableByName('nudge/radius', modes) || 12;
|
|
31
19
|
const paddingH = getVariableByName('nudge/padding/horizontal', modes) || 12;
|
|
@@ -33,106 +21,209 @@ function Nudge({
|
|
|
33
21
|
const gap = getVariableByName('nudge/gap', modes) || 6;
|
|
34
22
|
const titleColor = getVariableByName('nudge/title/color', modes) || '#0d0d0f';
|
|
35
23
|
const titleFontSize = getVariableByName('nudge/title/fontSize', modes) || 14;
|
|
36
|
-
const titleFontFamily = getVariableByName('nudge/title/fontFamily', modes) || '
|
|
24
|
+
const titleFontFamily = getVariableByName('nudge/title/fontFamily', modes) || 'System';
|
|
37
25
|
const titleLineHeight = getVariableByName('nudge/title/lineHeight', modes) || 15;
|
|
38
|
-
const
|
|
39
|
-
const titleFontWeight = typeof titleFontWeightRaw === 'number' ? titleFontWeightRaw.toString() : titleFontWeightRaw;
|
|
26
|
+
const titleFontWeight = toFontWeight(getVariableByName('nudge/title/fontWeight', modes), '700');
|
|
40
27
|
const bodyColor = getVariableByName('nudge/body/color', modes) || '#1a1c1f';
|
|
41
28
|
const bodyFontSize = getVariableByName('nudge/body/fontSize', modes) || 12;
|
|
42
|
-
const bodyFontFamily = getVariableByName('nudge/body/fontFamily', modes) || '
|
|
29
|
+
const bodyFontFamily = getVariableByName('nudge/body/fontFamily', modes) || 'System';
|
|
43
30
|
const bodyLineHeight = getVariableByName('nudge/body/lineHeight', modes) || 16;
|
|
44
|
-
const
|
|
45
|
-
const bodyFontWeight = typeof bodyFontWeightRaw === 'number' ? bodyFontWeightRaw.toString() : bodyFontWeightRaw;
|
|
31
|
+
const bodyFontWeight = toFontWeight(getVariableByName('nudge/body/fontWeight', modes), '500');
|
|
46
32
|
const textGap = getVariableByName('nudge/text/gap', modes) || 4;
|
|
47
33
|
const contentGap = getVariableByName('nudge/content/gap', modes) || 8;
|
|
48
34
|
const contentMinHeight = getVariableByName('nudge/content/minHeight', modes) || 20;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
const startSlotGap = getVariableByName('nudge/startSlot/gap', modes) || 4;
|
|
36
|
+
return {
|
|
37
|
+
containerBaseStyle: {
|
|
38
|
+
backgroundColor: background,
|
|
39
|
+
borderRadius: radius,
|
|
40
|
+
paddingHorizontal: paddingH,
|
|
41
|
+
paddingVertical: paddingV,
|
|
42
|
+
gap: gap,
|
|
43
|
+
overflow: 'hidden'
|
|
44
|
+
},
|
|
45
|
+
prominentContainerStyle: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
alignItems: 'flex-start'
|
|
48
|
+
},
|
|
49
|
+
compactContainerStyle: {
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
alignItems: 'center'
|
|
52
|
+
},
|
|
53
|
+
detailedContainerStyle: {
|
|
57
54
|
flexDirection: 'column',
|
|
58
55
|
alignItems: 'flex-start'
|
|
59
|
-
}
|
|
56
|
+
},
|
|
57
|
+
contentStyle: {
|
|
58
|
+
flex: 1,
|
|
59
|
+
minWidth: 1,
|
|
60
|
+
minHeight: contentMinHeight,
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
overflow: 'hidden'
|
|
63
|
+
},
|
|
64
|
+
compactOuterContentStyle: {
|
|
65
|
+
flex: 1,
|
|
66
|
+
minWidth: 1,
|
|
67
|
+
alignSelf: 'stretch',
|
|
68
|
+
justifyContent: 'center'
|
|
69
|
+
},
|
|
70
|
+
compactContentWrapStyle: {
|
|
60
71
|
flexDirection: 'row',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
gap: contentGap,
|
|
74
|
+
width: '100%'
|
|
75
|
+
},
|
|
76
|
+
textWrapStyle: {
|
|
77
|
+
gap: textGap,
|
|
78
|
+
alignItems: 'flex-start',
|
|
79
|
+
width: '100%'
|
|
80
|
+
},
|
|
81
|
+
compactTextWrapStyle: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
minWidth: 1,
|
|
61
84
|
alignItems: 'flex-start'
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
},
|
|
86
|
+
headerStyle: {
|
|
87
|
+
flexDirection: 'row',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
gap: gap,
|
|
90
|
+
width: '100%'
|
|
91
|
+
},
|
|
92
|
+
detailSlotStyle: {
|
|
93
|
+
gap: getVariableByName('slot/gap', modes) || 8,
|
|
94
|
+
width: '100%'
|
|
95
|
+
},
|
|
96
|
+
titleTextStyle: {
|
|
97
|
+
color: titleColor,
|
|
98
|
+
fontSize: titleFontSize,
|
|
99
|
+
fontFamily: titleFontFamily,
|
|
100
|
+
lineHeight: titleLineHeight,
|
|
101
|
+
fontWeight: titleFontWeight
|
|
102
|
+
},
|
|
103
|
+
bodyTextStyle: {
|
|
104
|
+
color: bodyColor,
|
|
105
|
+
fontSize: bodyFontSize,
|
|
106
|
+
fontFamily: bodyFontFamily,
|
|
107
|
+
lineHeight: bodyLineHeight,
|
|
108
|
+
fontWeight: bodyFontWeight
|
|
109
|
+
},
|
|
110
|
+
iconColor: getVariableByName('appearance/nudge/icon/color', modes) || '#5d00b5',
|
|
111
|
+
iconSize: getVariableByName('nudge/icon/size', modes) || 20,
|
|
112
|
+
startSlotGap: startSlotGap
|
|
77
113
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
114
|
+
}
|
|
115
|
+
function NudgeImpl({
|
|
116
|
+
type = 'stacked-prominent',
|
|
117
|
+
title = 'Split payment',
|
|
118
|
+
body = 'Split this transaction into installments',
|
|
119
|
+
buttonLabel = 'Button',
|
|
120
|
+
onPressButton,
|
|
121
|
+
buttonSlot,
|
|
122
|
+
startSlot,
|
|
123
|
+
children,
|
|
124
|
+
modes: propModes = EMPTY_MODES,
|
|
125
|
+
style
|
|
126
|
+
}) {
|
|
127
|
+
const {
|
|
128
|
+
modes: globalModes
|
|
129
|
+
} = useTokens();
|
|
130
|
+
const modes = useMemo(() => globalModes === EMPTY_MODES && propModes === EMPTY_MODES ? EMPTY_MODES : {
|
|
131
|
+
...globalModes,
|
|
132
|
+
...propModes
|
|
133
|
+
}, [globalModes, propModes]);
|
|
134
|
+
const tokens = useMemo(() => resolveNudgeTokens(modes), [modes]);
|
|
135
|
+
const startSlotElement = useMemo(() => {
|
|
136
|
+
if (startSlot === null || startSlot === false) return null;
|
|
137
|
+
if (startSlot !== undefined) {
|
|
138
|
+
const processed = cloneChildrenWithModes(React.Children.toArray(startSlot), modes);
|
|
139
|
+
return processed.length === 1 ? processed[0] : processed;
|
|
140
|
+
}
|
|
141
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
142
|
+
name: "ic_ai_sparkle",
|
|
143
|
+
size: tokens.iconSize,
|
|
144
|
+
color: tokens.iconColor,
|
|
145
|
+
accessibilityElementsHidden: true,
|
|
146
|
+
importantForAccessibility: "no"
|
|
147
|
+
});
|
|
148
|
+
}, [startSlot, modes, tokens.iconColor, tokens.iconSize]);
|
|
149
|
+
const startSlotWrapper = startSlotElement ? /*#__PURE__*/_jsx(View, {
|
|
150
|
+
style: {
|
|
151
|
+
gap: tokens.startSlotGap,
|
|
152
|
+
alignItems: 'center'
|
|
153
|
+
},
|
|
154
|
+
children: startSlotElement
|
|
155
|
+
}) : null;
|
|
156
|
+
const processedChildren = useMemo(() => {
|
|
157
|
+
if (!children) return null;
|
|
158
|
+
const processed = cloneChildrenWithModes(React.Children.toArray(children), modes);
|
|
159
|
+
return processed.length === 1 ? processed[0] : processed;
|
|
160
|
+
}, [children, modes]);
|
|
161
|
+
const buttonElement = buttonSlot ? cloneChildrenWithModes(React.Children.toArray(buttonSlot), modes) : /*#__PURE__*/_jsx(Button, {
|
|
162
|
+
label: buttonLabel,
|
|
163
|
+
modes: modes,
|
|
164
|
+
...(onPressButton ? {
|
|
165
|
+
onPress: onPressButton
|
|
166
|
+
} : {})
|
|
167
|
+
});
|
|
168
|
+
if (type === 'stacked-detailed') {
|
|
81
169
|
return /*#__PURE__*/_jsxs(View, {
|
|
82
|
-
style: [
|
|
170
|
+
style: [tokens.containerBaseStyle, tokens.detailedContainerStyle, style],
|
|
83
171
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
84
|
-
style:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
gap: 6,
|
|
88
|
-
width: '100%'
|
|
89
|
-
},
|
|
90
|
-
children: [startSlotElement, /*#__PURE__*/_jsx(Text, {
|
|
91
|
-
style: [titleStyle, {
|
|
172
|
+
style: tokens.headerStyle,
|
|
173
|
+
children: [startSlotWrapper, /*#__PURE__*/_jsx(Text, {
|
|
174
|
+
style: [tokens.titleTextStyle, {
|
|
92
175
|
flex: 1
|
|
93
176
|
}],
|
|
94
177
|
children: title
|
|
95
178
|
})]
|
|
96
|
-
}),
|
|
179
|
+
}), processedChildren ? /*#__PURE__*/_jsx(View, {
|
|
180
|
+
style: tokens.detailSlotStyle,
|
|
181
|
+
children: processedChildren
|
|
182
|
+
}) : null]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
if (type === 'inline-compact') {
|
|
186
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
187
|
+
style: [tokens.containerBaseStyle, tokens.compactContainerStyle, style],
|
|
188
|
+
children: [startSlotWrapper, /*#__PURE__*/_jsx(View, {
|
|
189
|
+
style: tokens.compactOuterContentStyle,
|
|
190
|
+
children: processedChildren || /*#__PURE__*/_jsxs(View, {
|
|
191
|
+
style: tokens.compactContentWrapStyle,
|
|
192
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
193
|
+
style: tokens.compactTextWrapStyle,
|
|
194
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
195
|
+
style: tokens.bodyTextStyle,
|
|
196
|
+
children: body
|
|
197
|
+
})
|
|
198
|
+
}), buttonElement]
|
|
199
|
+
})
|
|
200
|
+
})]
|
|
97
201
|
});
|
|
98
202
|
}
|
|
99
|
-
const
|
|
203
|
+
const prominentContent = /*#__PURE__*/_jsxs(View, {
|
|
100
204
|
style: {
|
|
101
|
-
gap:
|
|
205
|
+
gap: tokens.compactContentWrapStyle.gap,
|
|
102
206
|
alignItems: 'flex-start',
|
|
103
207
|
width: '100%'
|
|
104
208
|
},
|
|
105
209
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
106
|
-
style:
|
|
107
|
-
gap: textGap,
|
|
108
|
-
alignItems: 'flex-start',
|
|
109
|
-
width: '100%'
|
|
110
|
-
},
|
|
210
|
+
style: tokens.textWrapStyle,
|
|
111
211
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
112
|
-
style:
|
|
212
|
+
style: tokens.titleTextStyle,
|
|
113
213
|
children: title
|
|
114
214
|
}), /*#__PURE__*/_jsx(Text, {
|
|
115
|
-
style:
|
|
215
|
+
style: tokens.bodyTextStyle,
|
|
116
216
|
children: body
|
|
117
217
|
})]
|
|
118
|
-
}),
|
|
119
|
-
label: buttonLabel,
|
|
120
|
-
onPress: onPressButton,
|
|
121
|
-
modes: modes
|
|
122
|
-
})]
|
|
218
|
+
}), buttonElement]
|
|
123
219
|
});
|
|
124
220
|
return /*#__PURE__*/_jsxs(View, {
|
|
125
|
-
style: [
|
|
126
|
-
children: [
|
|
127
|
-
style:
|
|
128
|
-
|
|
129
|
-
minWidth: 1,
|
|
130
|
-
minHeight: contentMinHeight,
|
|
131
|
-
justifyContent: 'center',
|
|
132
|
-
overflow: 'hidden'
|
|
133
|
-
},
|
|
134
|
-
children: children ? cloneChildrenWithModes(React.Children.toArray(children), modes) : defaultContent
|
|
221
|
+
style: [tokens.containerBaseStyle, tokens.prominentContainerStyle, style],
|
|
222
|
+
children: [startSlotWrapper, /*#__PURE__*/_jsx(View, {
|
|
223
|
+
style: tokens.contentStyle,
|
|
224
|
+
children: processedChildren || prominentContent
|
|
135
225
|
})]
|
|
136
226
|
});
|
|
137
227
|
}
|
|
228
|
+
const Nudge = /*#__PURE__*/React.memo(NudgeImpl);
|
|
138
229
|
export default Nudge;
|
|
@@ -9,6 +9,7 @@ export { default as BottomNav } from './BottomNav/BottomNav';
|
|
|
9
9
|
export { default as BottomNavItem } from './BottomNavItem/BottomNavItem';
|
|
10
10
|
export { default as Button } from './Button/Button';
|
|
11
11
|
export { default as Card } from './Card/Card';
|
|
12
|
+
export { default as CardAdvisory } from './CardAdvisory/CardAdvisory';
|
|
12
13
|
export { default as Carousel } from './Carousel/Carousel';
|
|
13
14
|
export { default as Checkbox } from './Checkbox/Checkbox';
|
|
14
15
|
export { default as CardFeedback } from './CardFeedback/CardFeedback';
|
|
@@ -21,6 +22,10 @@ export { default as FilterBar } from './FilterBar/FilterBar';
|
|
|
21
22
|
export { default as Form } from './Form/Form';
|
|
22
23
|
export { useFormContext } from './Form/Form';
|
|
23
24
|
export { default as FormField } from './FormField/FormField';
|
|
25
|
+
export { default as CircularProgressBar } from './CircularProgressBar/CircularProgressBar';
|
|
26
|
+
export { default as CircularProgressBarDoted } from './CircularProgressBarDoted/CircularProgressBarDoted';
|
|
27
|
+
export { default as CircularRating } from './CircularRating/CircularRating';
|
|
28
|
+
export { default as Gauge } from './Gauge/Gauge';
|
|
24
29
|
export { default as HoldingsCard } from './HoldingsCard/HoldingsCard';
|
|
25
30
|
export { default as HStack } from './HStack/HStack';
|
|
26
31
|
export { default as IconButton } from './IconButton/IconButton';
|