kaleido-ui 0.1.53 → 0.1.55
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/dist/native/index.cjs +148 -4
- package/dist/native/index.d.cts +32 -1
- package/dist/native/index.d.ts +32 -1
- package/dist/native/index.js +147 -5
- package/package.json +1 -1
package/dist/native/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(native_exports, {
|
|
|
36
36
|
AssetSelector: () => import_wdk_uikit_react_native2.AssetSelector,
|
|
37
37
|
Balance: () => import_wdk_uikit_react_native2.Balance,
|
|
38
38
|
BalanceCard: () => BalanceCard,
|
|
39
|
+
ChatBubble: () => ChatBubble,
|
|
39
40
|
CryptoAddressInput: () => import_wdk_uikit_react_native2.CryptoAddressInput,
|
|
40
41
|
EmptyState: () => EmptyState,
|
|
41
42
|
KButton: () => KButton,
|
|
@@ -53,6 +54,7 @@ __export(native_exports, {
|
|
|
53
54
|
SectionLabel: () => SectionLabel,
|
|
54
55
|
SeedPhrase: () => import_wdk_uikit_react_native2.SeedPhrase,
|
|
55
56
|
StatusBadge: () => StatusBadge,
|
|
57
|
+
SuggestionTile: () => SuggestionTile,
|
|
56
58
|
ThemeProvider: () => import_wdk_uikit_react_native2.ThemeProvider,
|
|
57
59
|
TransactionItem: () => import_wdk_uikit_react_native2.TransactionItem,
|
|
58
60
|
TransactionList: () => import_wdk_uikit_react_native2.TransactionList,
|
|
@@ -1051,13 +1053,153 @@ var styles5 = import_react_native14.StyleSheet.create({
|
|
|
1051
1053
|
label: { fontSize: 13, marginLeft: 10, fontWeight: "500" }
|
|
1052
1054
|
});
|
|
1053
1055
|
|
|
1054
|
-
// src/native/components/
|
|
1056
|
+
// src/native/components/chat-bubble.tsx
|
|
1057
|
+
var import_react4 = require("react");
|
|
1055
1058
|
var import_react_native15 = require("react-native");
|
|
1056
1059
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1060
|
+
function ChatBubble({
|
|
1061
|
+
role,
|
|
1062
|
+
avatar,
|
|
1063
|
+
time,
|
|
1064
|
+
animateOnMount = true,
|
|
1065
|
+
onLongPress,
|
|
1066
|
+
maxWidth = "78%",
|
|
1067
|
+
style,
|
|
1068
|
+
children
|
|
1069
|
+
}) {
|
|
1070
|
+
const { theme, fontFamily: fontFamily2 } = useKaleidoTheme();
|
|
1071
|
+
const isUser = role === "user";
|
|
1072
|
+
const enter = (0, import_react4.useRef)(new import_react_native15.Animated.Value(animateOnMount ? 0 : 1)).current;
|
|
1073
|
+
(0, import_react4.useEffect)(() => {
|
|
1074
|
+
if (!animateOnMount) return;
|
|
1075
|
+
import_react_native15.Animated.spring(enter, { toValue: 1, tension: 120, friction: 9, useNativeDriver: true }).start();
|
|
1076
|
+
}, [enter, animateOnMount]);
|
|
1077
|
+
const bubble = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1078
|
+
import_react_native15.Pressable,
|
|
1079
|
+
{
|
|
1080
|
+
onLongPress,
|
|
1081
|
+
delayLongPress: 300,
|
|
1082
|
+
style: [
|
|
1083
|
+
styles6.bubble,
|
|
1084
|
+
{ maxWidth },
|
|
1085
|
+
isUser ? { backgroundColor: theme.primary } : {
|
|
1086
|
+
backgroundColor: theme.card,
|
|
1087
|
+
shadowColor: theme.background,
|
|
1088
|
+
shadowOffset: { width: 0, height: 4 },
|
|
1089
|
+
shadowOpacity: 0.3,
|
|
1090
|
+
shadowRadius: 6,
|
|
1091
|
+
elevation: 3
|
|
1092
|
+
},
|
|
1093
|
+
style
|
|
1094
|
+
],
|
|
1095
|
+
children: [
|
|
1096
|
+
children,
|
|
1097
|
+
time ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1098
|
+
import_react_native15.Text,
|
|
1099
|
+
{
|
|
1100
|
+
style: [
|
|
1101
|
+
styles6.time,
|
|
1102
|
+
{
|
|
1103
|
+
color: isUser ? theme.text.onAccent : theme.text.muted,
|
|
1104
|
+
fontFamily: fontFamily2,
|
|
1105
|
+
textAlign: isUser ? "right" : "left"
|
|
1106
|
+
}
|
|
1107
|
+
],
|
|
1108
|
+
children: time
|
|
1109
|
+
}
|
|
1110
|
+
) : null
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1115
|
+
import_react_native15.Animated.View,
|
|
1116
|
+
{
|
|
1117
|
+
style: [
|
|
1118
|
+
styles6.row,
|
|
1119
|
+
{ justifyContent: isUser ? "flex-end" : "flex-start" },
|
|
1120
|
+
{
|
|
1121
|
+
opacity: enter,
|
|
1122
|
+
transform: [
|
|
1123
|
+
{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [14, 0] }) },
|
|
1124
|
+
{ translateX: enter.interpolate({ inputRange: [0, 1], outputRange: [isUser ? 22 : -22, 0] }) },
|
|
1125
|
+
{ scale: enter.interpolate({ inputRange: [0, 1], outputRange: [0.96, 1] }) }
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
],
|
|
1129
|
+
children: [
|
|
1130
|
+
!isUser && avatar,
|
|
1131
|
+
bubble,
|
|
1132
|
+
isUser && avatar
|
|
1133
|
+
]
|
|
1134
|
+
}
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
var styles6 = import_react_native15.StyleSheet.create({
|
|
1138
|
+
row: { flexDirection: "row", alignItems: "flex-end", width: "100%", marginBottom: 16 },
|
|
1139
|
+
bubble: { borderRadius: 24, padding: 16, overflow: "hidden" },
|
|
1140
|
+
time: { fontSize: 12, marginTop: 8, fontWeight: "500" }
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
// src/native/components/suggestion-tile.tsx
|
|
1144
|
+
var import_react_native16 = require("react-native");
|
|
1145
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1146
|
+
function SuggestionTile({ title, subtitle, icon, accent, onPress, style }) {
|
|
1147
|
+
const { theme } = useKaleidoTheme();
|
|
1148
|
+
const chipColor = accent ?? theme.primary;
|
|
1149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1150
|
+
import_react_native16.Pressable,
|
|
1151
|
+
{
|
|
1152
|
+
onPress,
|
|
1153
|
+
accessibilityRole: "button",
|
|
1154
|
+
accessibilityLabel: title,
|
|
1155
|
+
accessibilityHint: subtitle,
|
|
1156
|
+
style: ({ pressed }) => [
|
|
1157
|
+
styles7.card,
|
|
1158
|
+
{
|
|
1159
|
+
backgroundColor: theme.card,
|
|
1160
|
+
borderColor: theme.border.subtle,
|
|
1161
|
+
opacity: pressed ? 0.85 : 1
|
|
1162
|
+
},
|
|
1163
|
+
style
|
|
1164
|
+
],
|
|
1165
|
+
children: [
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native16.View, { style: [styles7.chip, { backgroundColor: chipColor }], children: icon(theme.text.onFill, 18) }),
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native16.View, { style: styles7.textArea, children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(KText, { variant: "caption", weight: "semibold", numberOfLines: 1, children: title }),
|
|
1169
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(KText, { variant: "tiny", tone: "muted", numberOfLines: 2, style: { marginTop: 2 }, children: subtitle }) : null
|
|
1170
|
+
] })
|
|
1171
|
+
]
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
var styles7 = import_react_native16.StyleSheet.create({
|
|
1176
|
+
card: {
|
|
1177
|
+
flex: 1,
|
|
1178
|
+
flexDirection: "row",
|
|
1179
|
+
alignItems: "center",
|
|
1180
|
+
gap: 10,
|
|
1181
|
+
paddingVertical: 12,
|
|
1182
|
+
paddingHorizontal: 12,
|
|
1183
|
+
borderRadius: 16,
|
|
1184
|
+
borderWidth: 1
|
|
1185
|
+
},
|
|
1186
|
+
chip: {
|
|
1187
|
+
width: 36,
|
|
1188
|
+
height: 36,
|
|
1189
|
+
borderRadius: 12,
|
|
1190
|
+
justifyContent: "center",
|
|
1191
|
+
alignItems: "center"
|
|
1192
|
+
},
|
|
1193
|
+
textArea: { flex: 1 }
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1196
|
+
// src/native/components/mode-toggle.tsx
|
|
1197
|
+
var import_react_native17 = require("react-native");
|
|
1198
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1057
1199
|
function ModeToggle({ icon, size = 40, onToggle }) {
|
|
1058
1200
|
const { theme, mode, toggleMode } = useKaleidoTheme();
|
|
1059
|
-
return /* @__PURE__ */ (0,
|
|
1060
|
-
|
|
1201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1202
|
+
import_react_native17.Pressable,
|
|
1061
1203
|
{
|
|
1062
1204
|
accessibilityRole: "switch",
|
|
1063
1205
|
accessibilityState: { checked: mode === "dark" },
|
|
@@ -1077,7 +1219,7 @@ function ModeToggle({ icon, size = 40, onToggle }) {
|
|
|
1077
1219
|
justifyContent: "center",
|
|
1078
1220
|
opacity: pressed ? 0.85 : 1
|
|
1079
1221
|
}),
|
|
1080
|
-
children: /* @__PURE__ */ (0,
|
|
1222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
|
|
1081
1223
|
}
|
|
1082
1224
|
);
|
|
1083
1225
|
}
|
|
@@ -1156,6 +1298,7 @@ var transition = {
|
|
|
1156
1298
|
AssetSelector,
|
|
1157
1299
|
Balance,
|
|
1158
1300
|
BalanceCard,
|
|
1301
|
+
ChatBubble,
|
|
1159
1302
|
CryptoAddressInput,
|
|
1160
1303
|
EmptyState,
|
|
1161
1304
|
KButton,
|
|
@@ -1173,6 +1316,7 @@ var transition = {
|
|
|
1173
1316
|
SectionLabel,
|
|
1174
1317
|
SeedPhrase,
|
|
1175
1318
|
StatusBadge,
|
|
1319
|
+
SuggestionTile,
|
|
1176
1320
|
ThemeProvider,
|
|
1177
1321
|
TransactionItem,
|
|
1178
1322
|
TransactionList,
|
package/dist/native/index.d.cts
CHANGED
|
@@ -379,6 +379,37 @@ interface TypingDotsProps {
|
|
|
379
379
|
}
|
|
380
380
|
declare function TypingDots({ label, color, style }: TypingDotsProps): react_jsx_runtime.JSX.Element;
|
|
381
381
|
|
|
382
|
+
type ChatRole = 'user' | 'assistant';
|
|
383
|
+
interface ChatBubbleProps {
|
|
384
|
+
role: ChatRole;
|
|
385
|
+
/** Consumer-owned avatar node (icon, gradient, image) rendered beside the bubble. */
|
|
386
|
+
avatar?: ReactNode;
|
|
387
|
+
/** Timestamp label rendered at the bubble foot. */
|
|
388
|
+
time?: string;
|
|
389
|
+
/** Run the spring entrance animation on mount (default true). */
|
|
390
|
+
animateOnMount?: boolean;
|
|
391
|
+
onLongPress?: () => void;
|
|
392
|
+
/** Max bubble width relative to the row (default '78%'). */
|
|
393
|
+
maxWidth?: ViewStyle['maxWidth'];
|
|
394
|
+
/** Style applied to the bubble container. */
|
|
395
|
+
style?: ViewStyle;
|
|
396
|
+
/** Message body — consumer renders text / markdown / cards / typing dots. */
|
|
397
|
+
children: ReactNode;
|
|
398
|
+
}
|
|
399
|
+
declare function ChatBubble({ role, avatar, time, animateOnMount, onLongPress, maxWidth, style, children, }: ChatBubbleProps): react_jsx_runtime.JSX.Element;
|
|
400
|
+
|
|
401
|
+
interface SuggestionTileProps {
|
|
402
|
+
title: string;
|
|
403
|
+
subtitle?: string;
|
|
404
|
+
/** Glyph renderer — receives the themed glyph color + size. */
|
|
405
|
+
icon: (color: string, size: number) => ReactNode;
|
|
406
|
+
/** Icon-chip background. Defaults to the brand green. */
|
|
407
|
+
accent?: string;
|
|
408
|
+
onPress?: () => void;
|
|
409
|
+
style?: ViewStyle;
|
|
410
|
+
}
|
|
411
|
+
declare function SuggestionTile({ title, subtitle, icon, accent, onPress, style }: SuggestionTileProps): react_jsx_runtime.JSX.Element;
|
|
412
|
+
|
|
382
413
|
interface ModeToggleProps {
|
|
383
414
|
icon: (mode: ThemeMode, color: string, size: number) => React.ReactNode;
|
|
384
415
|
size?: number;
|
|
@@ -572,4 +603,4 @@ declare const transition: {
|
|
|
572
603
|
readonly slow: "300ms ease-out";
|
|
573
604
|
};
|
|
574
605
|
|
|
575
|
-
export { ActionButton, type ActionButtonProps, AlertBanner, BalanceCard, type BalanceCardProps, EmptyState, type EmptyStateProps, KButton, type KButtonProps, KCard, type KCardProps, KScreen, type KScreenProps, KText, type KTextProps, type KaleidoTheme, KaleidoThemeProvider, KaleidoUIProvider, type KaleidoUIProviderProps, ModeToggle, type ModeToggleProps, type NativeTypeLevel, NetworkBadge, NetworkChip, type NetworkChipProps, type NetworkKey, type NetworkType, QrCode, type QrCodeProps, SectionLabel, StatusBadge, type StatusType, type ThemeMode, TypingDots, type TypingDotsProps, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
|
|
606
|
+
export { ActionButton, type ActionButtonProps, AlertBanner, BalanceCard, type BalanceCardProps, ChatBubble, type ChatBubbleProps, type ChatRole, EmptyState, type EmptyStateProps, KButton, type KButtonProps, KCard, type KCardProps, KScreen, type KScreenProps, KText, type KTextProps, type KaleidoTheme, KaleidoThemeProvider, KaleidoUIProvider, type KaleidoUIProviderProps, ModeToggle, type ModeToggleProps, type NativeTypeLevel, NetworkBadge, NetworkChip, type NetworkChipProps, type NetworkKey, type NetworkType, QrCode, type QrCodeProps, SectionLabel, StatusBadge, type StatusType, SuggestionTile, type SuggestionTileProps, type ThemeMode, TypingDots, type TypingDotsProps, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
|
package/dist/native/index.d.ts
CHANGED
|
@@ -379,6 +379,37 @@ interface TypingDotsProps {
|
|
|
379
379
|
}
|
|
380
380
|
declare function TypingDots({ label, color, style }: TypingDotsProps): react_jsx_runtime.JSX.Element;
|
|
381
381
|
|
|
382
|
+
type ChatRole = 'user' | 'assistant';
|
|
383
|
+
interface ChatBubbleProps {
|
|
384
|
+
role: ChatRole;
|
|
385
|
+
/** Consumer-owned avatar node (icon, gradient, image) rendered beside the bubble. */
|
|
386
|
+
avatar?: ReactNode;
|
|
387
|
+
/** Timestamp label rendered at the bubble foot. */
|
|
388
|
+
time?: string;
|
|
389
|
+
/** Run the spring entrance animation on mount (default true). */
|
|
390
|
+
animateOnMount?: boolean;
|
|
391
|
+
onLongPress?: () => void;
|
|
392
|
+
/** Max bubble width relative to the row (default '78%'). */
|
|
393
|
+
maxWidth?: ViewStyle['maxWidth'];
|
|
394
|
+
/** Style applied to the bubble container. */
|
|
395
|
+
style?: ViewStyle;
|
|
396
|
+
/** Message body — consumer renders text / markdown / cards / typing dots. */
|
|
397
|
+
children: ReactNode;
|
|
398
|
+
}
|
|
399
|
+
declare function ChatBubble({ role, avatar, time, animateOnMount, onLongPress, maxWidth, style, children, }: ChatBubbleProps): react_jsx_runtime.JSX.Element;
|
|
400
|
+
|
|
401
|
+
interface SuggestionTileProps {
|
|
402
|
+
title: string;
|
|
403
|
+
subtitle?: string;
|
|
404
|
+
/** Glyph renderer — receives the themed glyph color + size. */
|
|
405
|
+
icon: (color: string, size: number) => ReactNode;
|
|
406
|
+
/** Icon-chip background. Defaults to the brand green. */
|
|
407
|
+
accent?: string;
|
|
408
|
+
onPress?: () => void;
|
|
409
|
+
style?: ViewStyle;
|
|
410
|
+
}
|
|
411
|
+
declare function SuggestionTile({ title, subtitle, icon, accent, onPress, style }: SuggestionTileProps): react_jsx_runtime.JSX.Element;
|
|
412
|
+
|
|
382
413
|
interface ModeToggleProps {
|
|
383
414
|
icon: (mode: ThemeMode, color: string, size: number) => React.ReactNode;
|
|
384
415
|
size?: number;
|
|
@@ -572,4 +603,4 @@ declare const transition: {
|
|
|
572
603
|
readonly slow: "300ms ease-out";
|
|
573
604
|
};
|
|
574
605
|
|
|
575
|
-
export { ActionButton, type ActionButtonProps, AlertBanner, BalanceCard, type BalanceCardProps, EmptyState, type EmptyStateProps, KButton, type KButtonProps, KCard, type KCardProps, KScreen, type KScreenProps, KText, type KTextProps, type KaleidoTheme, KaleidoThemeProvider, KaleidoUIProvider, type KaleidoUIProviderProps, ModeToggle, type ModeToggleProps, type NativeTypeLevel, NetworkBadge, NetworkChip, type NetworkChipProps, type NetworkKey, type NetworkType, QrCode, type QrCodeProps, SectionLabel, StatusBadge, type StatusType, type ThemeMode, TypingDots, type TypingDotsProps, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
|
|
606
|
+
export { ActionButton, type ActionButtonProps, AlertBanner, BalanceCard, type BalanceCardProps, ChatBubble, type ChatBubbleProps, type ChatRole, EmptyState, type EmptyStateProps, KButton, type KButtonProps, KCard, type KCardProps, KScreen, type KScreenProps, KText, type KTextProps, type KaleidoTheme, KaleidoThemeProvider, KaleidoUIProvider, type KaleidoUIProviderProps, ModeToggle, type ModeToggleProps, type NativeTypeLevel, NetworkBadge, NetworkChip, type NetworkChipProps, type NetworkKey, type NetworkType, QrCode, type QrCodeProps, SectionLabel, StatusBadge, type StatusType, SuggestionTile, type SuggestionTileProps, type ThemeMode, TypingDots, type TypingDotsProps, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
|
package/dist/native/index.js
CHANGED
|
@@ -991,13 +991,153 @@ var styles5 = StyleSheet5.create({
|
|
|
991
991
|
label: { fontSize: 13, marginLeft: 10, fontWeight: "500" }
|
|
992
992
|
});
|
|
993
993
|
|
|
994
|
+
// src/native/components/chat-bubble.tsx
|
|
995
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
996
|
+
import { Text as Text7, StyleSheet as StyleSheet6, Animated as Animated2, Pressable as Pressable4 } from "react-native";
|
|
997
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
998
|
+
function ChatBubble({
|
|
999
|
+
role,
|
|
1000
|
+
avatar,
|
|
1001
|
+
time,
|
|
1002
|
+
animateOnMount = true,
|
|
1003
|
+
onLongPress,
|
|
1004
|
+
maxWidth = "78%",
|
|
1005
|
+
style,
|
|
1006
|
+
children
|
|
1007
|
+
}) {
|
|
1008
|
+
const { theme, fontFamily: fontFamily2 } = useKaleidoTheme();
|
|
1009
|
+
const isUser = role === "user";
|
|
1010
|
+
const enter = useRef2(new Animated2.Value(animateOnMount ? 0 : 1)).current;
|
|
1011
|
+
useEffect2(() => {
|
|
1012
|
+
if (!animateOnMount) return;
|
|
1013
|
+
Animated2.spring(enter, { toValue: 1, tension: 120, friction: 9, useNativeDriver: true }).start();
|
|
1014
|
+
}, [enter, animateOnMount]);
|
|
1015
|
+
const bubble = /* @__PURE__ */ jsxs9(
|
|
1016
|
+
Pressable4,
|
|
1017
|
+
{
|
|
1018
|
+
onLongPress,
|
|
1019
|
+
delayLongPress: 300,
|
|
1020
|
+
style: [
|
|
1021
|
+
styles6.bubble,
|
|
1022
|
+
{ maxWidth },
|
|
1023
|
+
isUser ? { backgroundColor: theme.primary } : {
|
|
1024
|
+
backgroundColor: theme.card,
|
|
1025
|
+
shadowColor: theme.background,
|
|
1026
|
+
shadowOffset: { width: 0, height: 4 },
|
|
1027
|
+
shadowOpacity: 0.3,
|
|
1028
|
+
shadowRadius: 6,
|
|
1029
|
+
elevation: 3
|
|
1030
|
+
},
|
|
1031
|
+
style
|
|
1032
|
+
],
|
|
1033
|
+
children: [
|
|
1034
|
+
children,
|
|
1035
|
+
time ? /* @__PURE__ */ jsx17(
|
|
1036
|
+
Text7,
|
|
1037
|
+
{
|
|
1038
|
+
style: [
|
|
1039
|
+
styles6.time,
|
|
1040
|
+
{
|
|
1041
|
+
color: isUser ? theme.text.onAccent : theme.text.muted,
|
|
1042
|
+
fontFamily: fontFamily2,
|
|
1043
|
+
textAlign: isUser ? "right" : "left"
|
|
1044
|
+
}
|
|
1045
|
+
],
|
|
1046
|
+
children: time
|
|
1047
|
+
}
|
|
1048
|
+
) : null
|
|
1049
|
+
]
|
|
1050
|
+
}
|
|
1051
|
+
);
|
|
1052
|
+
return /* @__PURE__ */ jsxs9(
|
|
1053
|
+
Animated2.View,
|
|
1054
|
+
{
|
|
1055
|
+
style: [
|
|
1056
|
+
styles6.row,
|
|
1057
|
+
{ justifyContent: isUser ? "flex-end" : "flex-start" },
|
|
1058
|
+
{
|
|
1059
|
+
opacity: enter,
|
|
1060
|
+
transform: [
|
|
1061
|
+
{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [14, 0] }) },
|
|
1062
|
+
{ translateX: enter.interpolate({ inputRange: [0, 1], outputRange: [isUser ? 22 : -22, 0] }) },
|
|
1063
|
+
{ scale: enter.interpolate({ inputRange: [0, 1], outputRange: [0.96, 1] }) }
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
],
|
|
1067
|
+
children: [
|
|
1068
|
+
!isUser && avatar,
|
|
1069
|
+
bubble,
|
|
1070
|
+
isUser && avatar
|
|
1071
|
+
]
|
|
1072
|
+
}
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
var styles6 = StyleSheet6.create({
|
|
1076
|
+
row: { flexDirection: "row", alignItems: "flex-end", width: "100%", marginBottom: 16 },
|
|
1077
|
+
bubble: { borderRadius: 24, padding: 16, overflow: "hidden" },
|
|
1078
|
+
time: { fontSize: 12, marginTop: 8, fontWeight: "500" }
|
|
1079
|
+
});
|
|
1080
|
+
|
|
1081
|
+
// src/native/components/suggestion-tile.tsx
|
|
1082
|
+
import { Pressable as Pressable5, View as View14, StyleSheet as StyleSheet7 } from "react-native";
|
|
1083
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1084
|
+
function SuggestionTile({ title, subtitle, icon, accent, onPress, style }) {
|
|
1085
|
+
const { theme } = useKaleidoTheme();
|
|
1086
|
+
const chipColor = accent ?? theme.primary;
|
|
1087
|
+
return /* @__PURE__ */ jsxs10(
|
|
1088
|
+
Pressable5,
|
|
1089
|
+
{
|
|
1090
|
+
onPress,
|
|
1091
|
+
accessibilityRole: "button",
|
|
1092
|
+
accessibilityLabel: title,
|
|
1093
|
+
accessibilityHint: subtitle,
|
|
1094
|
+
style: ({ pressed }) => [
|
|
1095
|
+
styles7.card,
|
|
1096
|
+
{
|
|
1097
|
+
backgroundColor: theme.card,
|
|
1098
|
+
borderColor: theme.border.subtle,
|
|
1099
|
+
opacity: pressed ? 0.85 : 1
|
|
1100
|
+
},
|
|
1101
|
+
style
|
|
1102
|
+
],
|
|
1103
|
+
children: [
|
|
1104
|
+
/* @__PURE__ */ jsx18(View14, { style: [styles7.chip, { backgroundColor: chipColor }], children: icon(theme.text.onFill, 18) }),
|
|
1105
|
+
/* @__PURE__ */ jsxs10(View14, { style: styles7.textArea, children: [
|
|
1106
|
+
/* @__PURE__ */ jsx18(KText, { variant: "caption", weight: "semibold", numberOfLines: 1, children: title }),
|
|
1107
|
+
subtitle ? /* @__PURE__ */ jsx18(KText, { variant: "tiny", tone: "muted", numberOfLines: 2, style: { marginTop: 2 }, children: subtitle }) : null
|
|
1108
|
+
] })
|
|
1109
|
+
]
|
|
1110
|
+
}
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
var styles7 = StyleSheet7.create({
|
|
1114
|
+
card: {
|
|
1115
|
+
flex: 1,
|
|
1116
|
+
flexDirection: "row",
|
|
1117
|
+
alignItems: "center",
|
|
1118
|
+
gap: 10,
|
|
1119
|
+
paddingVertical: 12,
|
|
1120
|
+
paddingHorizontal: 12,
|
|
1121
|
+
borderRadius: 16,
|
|
1122
|
+
borderWidth: 1
|
|
1123
|
+
},
|
|
1124
|
+
chip: {
|
|
1125
|
+
width: 36,
|
|
1126
|
+
height: 36,
|
|
1127
|
+
borderRadius: 12,
|
|
1128
|
+
justifyContent: "center",
|
|
1129
|
+
alignItems: "center"
|
|
1130
|
+
},
|
|
1131
|
+
textArea: { flex: 1 }
|
|
1132
|
+
});
|
|
1133
|
+
|
|
994
1134
|
// src/native/components/mode-toggle.tsx
|
|
995
|
-
import { Pressable as
|
|
996
|
-
import { jsx as
|
|
1135
|
+
import { Pressable as Pressable6, View as View15 } from "react-native";
|
|
1136
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
997
1137
|
function ModeToggle({ icon, size = 40, onToggle }) {
|
|
998
1138
|
const { theme, mode, toggleMode } = useKaleidoTheme();
|
|
999
|
-
return /* @__PURE__ */
|
|
1000
|
-
|
|
1139
|
+
return /* @__PURE__ */ jsx19(
|
|
1140
|
+
Pressable6,
|
|
1001
1141
|
{
|
|
1002
1142
|
accessibilityRole: "switch",
|
|
1003
1143
|
accessibilityState: { checked: mode === "dark" },
|
|
@@ -1017,7 +1157,7 @@ function ModeToggle({ icon, size = 40, onToggle }) {
|
|
|
1017
1157
|
justifyContent: "center",
|
|
1018
1158
|
opacity: pressed ? 0.85 : 1
|
|
1019
1159
|
}),
|
|
1020
|
-
children: /* @__PURE__ */
|
|
1160
|
+
children: /* @__PURE__ */ jsx19(View15, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
|
|
1021
1161
|
}
|
|
1022
1162
|
);
|
|
1023
1163
|
}
|
|
@@ -1095,6 +1235,7 @@ export {
|
|
|
1095
1235
|
AssetSelector,
|
|
1096
1236
|
Balance,
|
|
1097
1237
|
BalanceCard,
|
|
1238
|
+
ChatBubble,
|
|
1098
1239
|
CryptoAddressInput,
|
|
1099
1240
|
EmptyState,
|
|
1100
1241
|
KButton,
|
|
@@ -1112,6 +1253,7 @@ export {
|
|
|
1112
1253
|
SectionLabel,
|
|
1113
1254
|
SeedPhrase,
|
|
1114
1255
|
StatusBadge,
|
|
1256
|
+
SuggestionTile,
|
|
1115
1257
|
ThemeProvider2 as ThemeProvider,
|
|
1116
1258
|
TransactionItem,
|
|
1117
1259
|
TransactionList,
|
package/package.json
CHANGED