kaleido-ui 0.1.52 → 0.1.53

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.
@@ -56,6 +56,7 @@ __export(native_exports, {
56
56
  ThemeProvider: () => import_wdk_uikit_react_native2.ThemeProvider,
57
57
  TransactionItem: () => import_wdk_uikit_react_native2.TransactionItem,
58
58
  TransactionList: () => import_wdk_uikit_react_native2.TransactionList,
59
+ TypingDots: () => TypingDots,
59
60
  colors: () => colors,
60
61
  fontFamily: () => fontFamily,
61
62
  fontWeight: () => fontWeight,
@@ -999,13 +1000,64 @@ function EmptyState({ title, description, icon, action, style, ...rest }) {
999
1000
  ] });
1000
1001
  }
1001
1002
 
1002
- // src/native/components/mode-toggle.tsx
1003
+ // src/native/components/typing-dots.tsx
1004
+ var import_react3 = require("react");
1003
1005
  var import_react_native14 = require("react-native");
1004
1006
  var import_jsx_runtime16 = require("react/jsx-runtime");
1007
+ function TypingDots({ label, color, style }) {
1008
+ const { theme, fontFamily: fontFamily2 } = useKaleidoTheme();
1009
+ const dots = (0, import_react3.useRef)([new import_react_native14.Animated.Value(0), new import_react_native14.Animated.Value(0), new import_react_native14.Animated.Value(0)]).current;
1010
+ (0, import_react3.useEffect)(() => {
1011
+ const make = (v) => import_react_native14.Animated.loop(
1012
+ import_react_native14.Animated.sequence([
1013
+ import_react_native14.Animated.timing(v, { toValue: 1, duration: 420, useNativeDriver: true }),
1014
+ import_react_native14.Animated.timing(v, { toValue: 0, duration: 420, useNativeDriver: true }),
1015
+ import_react_native14.Animated.delay(240)
1016
+ ])
1017
+ );
1018
+ const loops = dots.map(make);
1019
+ const timers = dots.map((_, i) => setTimeout(() => loops[i].start(), i * 160));
1020
+ return () => {
1021
+ timers.forEach(clearTimeout);
1022
+ loops.forEach((l) => l.stop());
1023
+ };
1024
+ }, [dots]);
1025
+ const dotColor = color ?? theme.primary;
1026
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: [styles5.row, style], children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { style: styles5.dotsRow, children: dots.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1028
+ import_react_native14.Animated.View,
1029
+ {
1030
+ style: {
1031
+ width: 7,
1032
+ height: 7,
1033
+ borderRadius: 3.5,
1034
+ marginHorizontal: 2.5,
1035
+ backgroundColor: dotColor,
1036
+ opacity: v.interpolate({ inputRange: [0, 1], outputRange: [0.35, 1] }),
1037
+ transform: [
1038
+ { translateY: v.interpolate({ inputRange: [0, 1], outputRange: [0, -5] }) },
1039
+ { scale: v.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1.1] }) }
1040
+ ]
1041
+ }
1042
+ },
1043
+ i
1044
+ )) }),
1045
+ label ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles5.label, { color: theme.text.secondary, fontFamily: fontFamily2 }], children: label }) : null
1046
+ ] });
1047
+ }
1048
+ var styles5 = import_react_native14.StyleSheet.create({
1049
+ row: { flexDirection: "row", alignItems: "center" },
1050
+ dotsRow: { flexDirection: "row", alignItems: "center", height: 12 },
1051
+ label: { fontSize: 13, marginLeft: 10, fontWeight: "500" }
1052
+ });
1053
+
1054
+ // src/native/components/mode-toggle.tsx
1055
+ var import_react_native15 = require("react-native");
1056
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1005
1057
  function ModeToggle({ icon, size = 40, onToggle }) {
1006
1058
  const { theme, mode, toggleMode } = useKaleidoTheme();
1007
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1008
- import_react_native14.Pressable,
1059
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1060
+ import_react_native15.Pressable,
1009
1061
  {
1010
1062
  accessibilityRole: "switch",
1011
1063
  accessibilityState: { checked: mode === "dark" },
@@ -1025,7 +1077,7 @@ function ModeToggle({ icon, size = 40, onToggle }) {
1025
1077
  justifyContent: "center",
1026
1078
  opacity: pressed ? 0.85 : 1
1027
1079
  }),
1028
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
1080
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.View, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
1029
1081
  }
1030
1082
  );
1031
1083
  }
@@ -1124,6 +1176,7 @@ var transition = {
1124
1176
  ThemeProvider,
1125
1177
  TransactionItem,
1126
1178
  TransactionList,
1179
+ TypingDots,
1127
1180
  colors,
1128
1181
  fontFamily,
1129
1182
  fontWeight,
@@ -370,6 +370,15 @@ interface EmptyStateProps extends ViewProps {
370
370
  }
371
371
  declare function EmptyState({ title, description, icon, action, style, ...rest }: EmptyStateProps): react_jsx_runtime.JSX.Element;
372
372
 
373
+ interface TypingDotsProps {
374
+ /** Optional caption shown next to the dots (e.g. "Thinking on-device…"). */
375
+ label?: string;
376
+ /** Dot color override. Defaults to the brand green (`theme.primary`). */
377
+ color?: string;
378
+ style?: ViewStyle;
379
+ }
380
+ declare function TypingDots({ label, color, style }: TypingDotsProps): react_jsx_runtime.JSX.Element;
381
+
373
382
  interface ModeToggleProps {
374
383
  icon: (mode: ThemeMode, color: string, size: number) => React.ReactNode;
375
384
  size?: number;
@@ -563,4 +572,4 @@ declare const transition: {
563
572
  readonly slow: "300ms ease-out";
564
573
  };
565
574
 
566
- 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, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
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 };
@@ -370,6 +370,15 @@ interface EmptyStateProps extends ViewProps {
370
370
  }
371
371
  declare function EmptyState({ title, description, icon, action, style, ...rest }: EmptyStateProps): react_jsx_runtime.JSX.Element;
372
372
 
373
+ interface TypingDotsProps {
374
+ /** Optional caption shown next to the dots (e.g. "Thinking on-device…"). */
375
+ label?: string;
376
+ /** Dot color override. Defaults to the brand green (`theme.primary`). */
377
+ color?: string;
378
+ style?: ViewStyle;
379
+ }
380
+ declare function TypingDots({ label, color, style }: TypingDotsProps): react_jsx_runtime.JSX.Element;
381
+
373
382
  interface ModeToggleProps {
374
383
  icon: (mode: ThemeMode, color: string, size: number) => React.ReactNode;
375
384
  size?: number;
@@ -563,4 +572,4 @@ declare const transition: {
563
572
  readonly slow: "300ms ease-out";
564
573
  };
565
574
 
566
- 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, colors, fontFamily, fontWeight, kaleidoswapBrandConfig, kaleidoswapTokens, makeTheme, nativeType, radius, shadow, themes, transition, typeScale, useKaleidoTheme };
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 };
@@ -940,12 +940,63 @@ function EmptyState({ title, description, icon, action, style, ...rest }) {
940
940
  ] });
941
941
  }
942
942
 
943
+ // src/native/components/typing-dots.tsx
944
+ import { useEffect, useRef } from "react";
945
+ import { View as View12, Text as Text6, StyleSheet as StyleSheet5, Animated } from "react-native";
946
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
947
+ function TypingDots({ label, color, style }) {
948
+ const { theme, fontFamily: fontFamily2 } = useKaleidoTheme();
949
+ const dots = useRef([new Animated.Value(0), new Animated.Value(0), new Animated.Value(0)]).current;
950
+ useEffect(() => {
951
+ const make = (v) => Animated.loop(
952
+ Animated.sequence([
953
+ Animated.timing(v, { toValue: 1, duration: 420, useNativeDriver: true }),
954
+ Animated.timing(v, { toValue: 0, duration: 420, useNativeDriver: true }),
955
+ Animated.delay(240)
956
+ ])
957
+ );
958
+ const loops = dots.map(make);
959
+ const timers = dots.map((_, i) => setTimeout(() => loops[i].start(), i * 160));
960
+ return () => {
961
+ timers.forEach(clearTimeout);
962
+ loops.forEach((l) => l.stop());
963
+ };
964
+ }, [dots]);
965
+ const dotColor = color ?? theme.primary;
966
+ return /* @__PURE__ */ jsxs8(View12, { style: [styles5.row, style], children: [
967
+ /* @__PURE__ */ jsx16(View12, { style: styles5.dotsRow, children: dots.map((v, i) => /* @__PURE__ */ jsx16(
968
+ Animated.View,
969
+ {
970
+ style: {
971
+ width: 7,
972
+ height: 7,
973
+ borderRadius: 3.5,
974
+ marginHorizontal: 2.5,
975
+ backgroundColor: dotColor,
976
+ opacity: v.interpolate({ inputRange: [0, 1], outputRange: [0.35, 1] }),
977
+ transform: [
978
+ { translateY: v.interpolate({ inputRange: [0, 1], outputRange: [0, -5] }) },
979
+ { scale: v.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1.1] }) }
980
+ ]
981
+ }
982
+ },
983
+ i
984
+ )) }),
985
+ label ? /* @__PURE__ */ jsx16(Text6, { style: [styles5.label, { color: theme.text.secondary, fontFamily: fontFamily2 }], children: label }) : null
986
+ ] });
987
+ }
988
+ var styles5 = StyleSheet5.create({
989
+ row: { flexDirection: "row", alignItems: "center" },
990
+ dotsRow: { flexDirection: "row", alignItems: "center", height: 12 },
991
+ label: { fontSize: 13, marginLeft: 10, fontWeight: "500" }
992
+ });
993
+
943
994
  // src/native/components/mode-toggle.tsx
944
- import { Pressable as Pressable4, View as View12 } from "react-native";
945
- import { jsx as jsx16 } from "react/jsx-runtime";
995
+ import { Pressable as Pressable4, View as View13 } from "react-native";
996
+ import { jsx as jsx17 } from "react/jsx-runtime";
946
997
  function ModeToggle({ icon, size = 40, onToggle }) {
947
998
  const { theme, mode, toggleMode } = useKaleidoTheme();
948
- return /* @__PURE__ */ jsx16(
999
+ return /* @__PURE__ */ jsx17(
949
1000
  Pressable4,
950
1001
  {
951
1002
  accessibilityRole: "switch",
@@ -966,7 +1017,7 @@ function ModeToggle({ icon, size = 40, onToggle }) {
966
1017
  justifyContent: "center",
967
1018
  opacity: pressed ? 0.85 : 1
968
1019
  }),
969
- children: /* @__PURE__ */ jsx16(View12, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
1020
+ children: /* @__PURE__ */ jsx17(View13, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
970
1021
  }
971
1022
  );
972
1023
  }
@@ -1064,6 +1115,7 @@ export {
1064
1115
  ThemeProvider2 as ThemeProvider,
1065
1116
  TransactionItem,
1066
1117
  TransactionList,
1118
+ TypingDots,
1067
1119
  colors,
1068
1120
  fontFamily,
1069
1121
  fontWeight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaleido-ui",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "description": "KaleidoSwap shared UI library — design tokens, web components (Tailwind + Radix), and React Native components extending WDK UI Kit",
5
5
  "license": "MIT",
6
6
  "type": "module",