zero-to-app 2.0.0

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.
Files changed (282) hide show
  1. package/README.md +929 -0
  2. package/dist/brand/brandConfig.d.ts +48 -0
  3. package/dist/brand/brandConfig.d.ts.map +1 -0
  4. package/dist/brand/brandConfig.js +41 -0
  5. package/dist/brand/brandConfig.js.map +1 -0
  6. package/dist/brand/brandContext.d.ts +10 -0
  7. package/dist/brand/brandContext.d.ts.map +1 -0
  8. package/dist/brand/brandContext.js +16 -0
  9. package/dist/brand/brandContext.js.map +1 -0
  10. package/dist/brand/brandTypes.d.ts +54 -0
  11. package/dist/brand/brandTypes.d.ts.map +1 -0
  12. package/dist/brand/brandTypes.js +2 -0
  13. package/dist/brand/brandTypes.js.map +1 -0
  14. package/dist/brand/index.d.ts +4 -0
  15. package/dist/brand/index.d.ts.map +1 -0
  16. package/dist/brand/index.js +5 -0
  17. package/dist/brand/index.js.map +1 -0
  18. package/dist/components/action/ActionRow.d.ts +25 -0
  19. package/dist/components/action/ActionRow.d.ts.map +1 -0
  20. package/dist/components/action/ActionRow.js +66 -0
  21. package/dist/components/action/ActionRow.js.map +1 -0
  22. package/dist/components/action/index.d.ts +2 -0
  23. package/dist/components/action/index.d.ts.map +1 -0
  24. package/dist/components/action/index.js +3 -0
  25. package/dist/components/action/index.js.map +1 -0
  26. package/dist/components/card/Card.d.ts +11 -0
  27. package/dist/components/card/Card.d.ts.map +1 -0
  28. package/dist/components/card/Card.js +32 -0
  29. package/dist/components/card/Card.js.map +1 -0
  30. package/dist/components/card/index.d.ts +2 -0
  31. package/dist/components/card/index.d.ts.map +1 -0
  32. package/dist/components/card/index.js +2 -0
  33. package/dist/components/card/index.js.map +1 -0
  34. package/dist/components/chat/ChatContainer.d.ts +27 -0
  35. package/dist/components/chat/ChatContainer.d.ts.map +1 -0
  36. package/dist/components/chat/ChatContainer.js +52 -0
  37. package/dist/components/chat/ChatContainer.js.map +1 -0
  38. package/dist/components/chat/ChatInput.d.ts +9 -0
  39. package/dist/components/chat/ChatInput.d.ts.map +1 -0
  40. package/dist/components/chat/ChatInput.js +219 -0
  41. package/dist/components/chat/ChatInput.js.map +1 -0
  42. package/dist/components/chat/ChatMessages.d.ts +9 -0
  43. package/dist/components/chat/ChatMessages.d.ts.map +1 -0
  44. package/dist/components/chat/ChatMessages.js +35 -0
  45. package/dist/components/chat/ChatMessages.js.map +1 -0
  46. package/dist/components/chat/EmptyChat.d.ts +18 -0
  47. package/dist/components/chat/EmptyChat.d.ts.map +1 -0
  48. package/dist/components/chat/EmptyChat.js +64 -0
  49. package/dist/components/chat/EmptyChat.js.map +1 -0
  50. package/dist/components/chat/Message.d.ts +8 -0
  51. package/dist/components/chat/Message.d.ts.map +1 -0
  52. package/dist/components/chat/Message.js +47 -0
  53. package/dist/components/chat/Message.js.map +1 -0
  54. package/dist/components/chat/index.d.ts +6 -0
  55. package/dist/components/chat/index.d.ts.map +1 -0
  56. package/dist/components/chat/index.js +7 -0
  57. package/dist/components/chat/index.js.map +1 -0
  58. package/dist/components/chat/types.d.ts +34 -0
  59. package/dist/components/chat/types.d.ts.map +1 -0
  60. package/dist/components/chat/types.js +2 -0
  61. package/dist/components/chat/types.js.map +1 -0
  62. package/dist/components/form/DropDownSelect.d.ts +12 -0
  63. package/dist/components/form/DropDownSelect.d.ts.map +1 -0
  64. package/dist/components/form/DropDownSelect.js +63 -0
  65. package/dist/components/form/DropDownSelect.js.map +1 -0
  66. package/dist/components/form/EmailSubscriptionForm.d.ts +14 -0
  67. package/dist/components/form/EmailSubscriptionForm.d.ts.map +1 -0
  68. package/dist/components/form/EmailSubscriptionForm.js +58 -0
  69. package/dist/components/form/EmailSubscriptionForm.js.map +1 -0
  70. package/dist/components/form/FormErrors.d.ts +7 -0
  71. package/dist/components/form/FormErrors.d.ts.map +1 -0
  72. package/dist/components/form/FormErrors.js +35 -0
  73. package/dist/components/form/FormErrors.js.map +1 -0
  74. package/dist/components/form/FormInput.d.ts +14 -0
  75. package/dist/components/form/FormInput.d.ts.map +1 -0
  76. package/dist/components/form/FormInput.js +35 -0
  77. package/dist/components/form/FormInput.js.map +1 -0
  78. package/dist/components/form/FormSeparator.d.ts +6 -0
  79. package/dist/components/form/FormSeparator.d.ts.map +1 -0
  80. package/dist/components/form/FormSeparator.js +25 -0
  81. package/dist/components/form/FormSeparator.js.map +1 -0
  82. package/dist/components/form/index.d.ts +6 -0
  83. package/dist/components/form/index.d.ts.map +1 -0
  84. package/dist/components/form/index.js +7 -0
  85. package/dist/components/form/index.js.map +1 -0
  86. package/dist/components/index.d.ts +11 -0
  87. package/dist/components/index.d.ts.map +1 -0
  88. package/dist/components/index.js +12 -0
  89. package/dist/components/index.js.map +1 -0
  90. package/dist/components/layout/Footer.d.ts +3 -0
  91. package/dist/components/layout/Footer.d.ts.map +1 -0
  92. package/dist/components/layout/Footer.js +60 -0
  93. package/dist/components/layout/Footer.js.map +1 -0
  94. package/dist/components/layout/MinimalFooter.d.ts +8 -0
  95. package/dist/components/layout/MinimalFooter.d.ts.map +1 -0
  96. package/dist/components/layout/MinimalFooter.js +57 -0
  97. package/dist/components/layout/MinimalFooter.js.map +1 -0
  98. package/dist/components/layout/MobileFooterBar.d.ts +7 -0
  99. package/dist/components/layout/MobileFooterBar.d.ts.map +1 -0
  100. package/dist/components/layout/MobileFooterBar.js +18 -0
  101. package/dist/components/layout/MobileFooterBar.js.map +1 -0
  102. package/dist/components/layout/ParallaxScrollView.d.ts +11 -0
  103. package/dist/components/layout/ParallaxScrollView.d.ts.map +1 -0
  104. package/dist/components/layout/ParallaxScrollView.js +67 -0
  105. package/dist/components/layout/ParallaxScrollView.js.map +1 -0
  106. package/dist/components/layout/WebPageLayout.d.ts +17 -0
  107. package/dist/components/layout/WebPageLayout.d.ts.map +1 -0
  108. package/dist/components/layout/WebPageLayout.js +103 -0
  109. package/dist/components/layout/WebPageLayout.js.map +1 -0
  110. package/dist/components/layout/index.d.ts +6 -0
  111. package/dist/components/layout/index.d.ts.map +1 -0
  112. package/dist/components/layout/index.js +9 -0
  113. package/dist/components/layout/index.js.map +1 -0
  114. package/dist/components/list/List.d.ts +10 -0
  115. package/dist/components/list/List.d.ts.map +1 -0
  116. package/dist/components/list/List.js +18 -0
  117. package/dist/components/list/List.js.map +1 -0
  118. package/dist/components/list/ListButton.d.ts +13 -0
  119. package/dist/components/list/ListButton.d.ts.map +1 -0
  120. package/dist/components/list/ListButton.js +24 -0
  121. package/dist/components/list/ListButton.js.map +1 -0
  122. package/dist/components/list/ListDivider.d.ts +7 -0
  123. package/dist/components/list/ListDivider.d.ts.map +1 -0
  124. package/dist/components/list/ListDivider.js +23 -0
  125. package/dist/components/list/ListDivider.js.map +1 -0
  126. package/dist/components/list/index.d.ts +4 -0
  127. package/dist/components/list/index.d.ts.map +1 -0
  128. package/dist/components/list/index.js +4 -0
  129. package/dist/components/list/index.js.map +1 -0
  130. package/dist/components/media/Carousel.d.ts +18 -0
  131. package/dist/components/media/Carousel.d.ts.map +1 -0
  132. package/dist/components/media/Carousel.js +60 -0
  133. package/dist/components/media/Carousel.js.map +1 -0
  134. package/dist/components/media/FeatureCard.d.ts +9 -0
  135. package/dist/components/media/FeatureCard.d.ts.map +1 -0
  136. package/dist/components/media/FeatureCard.js +68 -0
  137. package/dist/components/media/FeatureCard.js.map +1 -0
  138. package/dist/components/media/HorizontalCarousel.d.ts +17 -0
  139. package/dist/components/media/HorizontalCarousel.d.ts.map +1 -0
  140. package/dist/components/media/HorizontalCarousel.js +60 -0
  141. package/dist/components/media/HorizontalCarousel.js.map +1 -0
  142. package/dist/components/media/ImageCarousel.d.ts +14 -0
  143. package/dist/components/media/ImageCarousel.d.ts.map +1 -0
  144. package/dist/components/media/ImageCarousel.js +21 -0
  145. package/dist/components/media/ImageCarousel.js.map +1 -0
  146. package/dist/components/media/MediaTile.d.ts +30 -0
  147. package/dist/components/media/MediaTile.d.ts.map +1 -0
  148. package/dist/components/media/MediaTile.js +51 -0
  149. package/dist/components/media/MediaTile.js.map +1 -0
  150. package/dist/components/media/SkeletonMediaTile.d.ts +17 -0
  151. package/dist/components/media/SkeletonMediaTile.d.ts.map +1 -0
  152. package/dist/components/media/SkeletonMediaTile.js +67 -0
  153. package/dist/components/media/SkeletonMediaTile.js.map +1 -0
  154. package/dist/components/media/index.d.ts +7 -0
  155. package/dist/components/media/index.d.ts.map +1 -0
  156. package/dist/components/media/index.js +8 -0
  157. package/dist/components/media/index.js.map +1 -0
  158. package/dist/components/navigation/AppbarWeb.d.ts +18 -0
  159. package/dist/components/navigation/AppbarWeb.d.ts.map +1 -0
  160. package/dist/components/navigation/AppbarWeb.js +70 -0
  161. package/dist/components/navigation/AppbarWeb.js.map +1 -0
  162. package/dist/components/navigation/IconButtonGroup.d.ts +7 -0
  163. package/dist/components/navigation/IconButtonGroup.d.ts.map +1 -0
  164. package/dist/components/navigation/IconButtonGroup.js +33 -0
  165. package/dist/components/navigation/IconButtonGroup.js.map +1 -0
  166. package/dist/components/navigation/Logo.d.ts +16 -0
  167. package/dist/components/navigation/Logo.d.ts.map +1 -0
  168. package/dist/components/navigation/Logo.js +64 -0
  169. package/dist/components/navigation/Logo.js.map +1 -0
  170. package/dist/components/navigation/MobileMenuDrawer.d.ts +13 -0
  171. package/dist/components/navigation/MobileMenuDrawer.d.ts.map +1 -0
  172. package/dist/components/navigation/MobileMenuDrawer.js +184 -0
  173. package/dist/components/navigation/MobileMenuDrawer.js.map +1 -0
  174. package/dist/components/navigation/ScreenHeader.d.ts +30 -0
  175. package/dist/components/navigation/ScreenHeader.d.ts.map +1 -0
  176. package/dist/components/navigation/ScreenHeader.js +127 -0
  177. package/dist/components/navigation/ScreenHeader.js.map +1 -0
  178. package/dist/components/navigation/iconUtils.d.ts +24 -0
  179. package/dist/components/navigation/iconUtils.d.ts.map +1 -0
  180. package/dist/components/navigation/iconUtils.js +53 -0
  181. package/dist/components/navigation/iconUtils.js.map +1 -0
  182. package/dist/components/navigation/index.d.ts +6 -0
  183. package/dist/components/navigation/index.d.ts.map +1 -0
  184. package/dist/components/navigation/index.js +7 -0
  185. package/dist/components/navigation/index.js.map +1 -0
  186. package/dist/components/tile/Tile.d.ts +18 -0
  187. package/dist/components/tile/Tile.d.ts.map +1 -0
  188. package/dist/components/tile/Tile.js +41 -0
  189. package/dist/components/tile/Tile.js.map +1 -0
  190. package/dist/components/tile/index.d.ts +2 -0
  191. package/dist/components/tile/index.d.ts.map +1 -0
  192. package/dist/components/tile/index.js +2 -0
  193. package/dist/components/tile/index.js.map +1 -0
  194. package/dist/components/ui/ArrowButton.d.ts +8 -0
  195. package/dist/components/ui/ArrowButton.d.ts.map +1 -0
  196. package/dist/components/ui/ArrowButton.js +30 -0
  197. package/dist/components/ui/ArrowButton.js.map +1 -0
  198. package/dist/components/ui/BlurButton.d.ts +16 -0
  199. package/dist/components/ui/BlurButton.d.ts.map +1 -0
  200. package/dist/components/ui/BlurButton.js +26 -0
  201. package/dist/components/ui/BlurButton.js.map +1 -0
  202. package/dist/components/ui/Button.d.ts +24 -0
  203. package/dist/components/ui/Button.d.ts.map +1 -0
  204. package/dist/components/ui/Button.js +60 -0
  205. package/dist/components/ui/Button.js.map +1 -0
  206. package/dist/components/ui/ErrorBoundary.d.ts +18 -0
  207. package/dist/components/ui/ErrorBoundary.d.ts.map +1 -0
  208. package/dist/components/ui/ErrorBoundary.js +37 -0
  209. package/dist/components/ui/ErrorBoundary.js.map +1 -0
  210. package/dist/components/ui/IconButton.d.ts +13 -0
  211. package/dist/components/ui/IconButton.d.ts.map +1 -0
  212. package/dist/components/ui/IconButton.js +27 -0
  213. package/dist/components/ui/IconButton.js.map +1 -0
  214. package/dist/components/ui/LoadingIndicator.d.ts +6 -0
  215. package/dist/components/ui/LoadingIndicator.d.ts.map +1 -0
  216. package/dist/components/ui/LoadingIndicator.js +15 -0
  217. package/dist/components/ui/LoadingIndicator.js.map +1 -0
  218. package/dist/components/ui/NotificationBadge.d.ts +8 -0
  219. package/dist/components/ui/NotificationBadge.d.ts.map +1 -0
  220. package/dist/components/ui/NotificationBadge.js +24 -0
  221. package/dist/components/ui/NotificationBadge.js.map +1 -0
  222. package/dist/components/ui/SkeletonCard.d.ts +14 -0
  223. package/dist/components/ui/SkeletonCard.d.ts.map +1 -0
  224. package/dist/components/ui/SkeletonCard.js +50 -0
  225. package/dist/components/ui/SkeletonCard.js.map +1 -0
  226. package/dist/components/ui/StyledText.d.ts +17 -0
  227. package/dist/components/ui/StyledText.d.ts.map +1 -0
  228. package/dist/components/ui/StyledText.js +27 -0
  229. package/dist/components/ui/StyledText.js.map +1 -0
  230. package/dist/components/ui/StyledTextInput.d.ts +10 -0
  231. package/dist/components/ui/StyledTextInput.d.ts.map +1 -0
  232. package/dist/components/ui/StyledTextInput.js +62 -0
  233. package/dist/components/ui/StyledTextInput.js.map +1 -0
  234. package/dist/components/ui/TextLink.d.ts +14 -0
  235. package/dist/components/ui/TextLink.d.ts.map +1 -0
  236. package/dist/components/ui/TextLink.js +25 -0
  237. package/dist/components/ui/TextLink.js.map +1 -0
  238. package/dist/components/ui/ToggleIconButton.d.ts +14 -0
  239. package/dist/components/ui/ToggleIconButton.d.ts.map +1 -0
  240. package/dist/components/ui/ToggleIconButton.js +19 -0
  241. package/dist/components/ui/ToggleIconButton.js.map +1 -0
  242. package/dist/components/ui/index.d.ts +13 -0
  243. package/dist/components/ui/index.d.ts.map +1 -0
  244. package/dist/components/ui/index.js +14 -0
  245. package/dist/components/ui/index.js.map +1 -0
  246. package/dist/context/scrollContext.d.ts +8 -0
  247. package/dist/context/scrollContext.d.ts.map +1 -0
  248. package/dist/context/scrollContext.js +16 -0
  249. package/dist/context/scrollContext.js.map +1 -0
  250. package/dist/hooks/index.d.ts +4 -0
  251. package/dist/hooks/index.d.ts.map +1 -0
  252. package/dist/hooks/index.js +5 -0
  253. package/dist/hooks/index.js.map +1 -0
  254. package/dist/hooks/useDimensions.d.ts +31 -0
  255. package/dist/hooks/useDimensions.d.ts.map +1 -0
  256. package/dist/hooks/useDimensions.js +44 -0
  257. package/dist/hooks/useDimensions.js.map +1 -0
  258. package/dist/hooks/useWindowHeight.d.ts +7 -0
  259. package/dist/hooks/useWindowHeight.d.ts.map +1 -0
  260. package/dist/hooks/useWindowHeight.js +10 -0
  261. package/dist/hooks/useWindowHeight.js.map +1 -0
  262. package/dist/hooks/useWindowWidth.d.ts +20 -0
  263. package/dist/hooks/useWindowWidth.d.ts.map +1 -0
  264. package/dist/hooks/useWindowWidth.js +27 -0
  265. package/dist/hooks/useWindowWidth.js.map +1 -0
  266. package/dist/index.d.ts +6 -0
  267. package/dist/index.d.ts.map +1 -0
  268. package/dist/index.js +9 -0
  269. package/dist/index.js.map +1 -0
  270. package/dist/theme/index.d.ts +3 -0
  271. package/dist/theme/index.d.ts.map +1 -0
  272. package/dist/theme/index.js +4 -0
  273. package/dist/theme/index.js.map +1 -0
  274. package/dist/theme/theme.d.ts +15 -0
  275. package/dist/theme/theme.d.ts.map +1 -0
  276. package/dist/theme/theme.js +38 -0
  277. package/dist/theme/theme.js.map +1 -0
  278. package/dist/theme/themeConfig.d.ts +19 -0
  279. package/dist/theme/themeConfig.d.ts.map +1 -0
  280. package/dist/theme/themeConfig.js +43 -0
  281. package/dist/theme/themeConfig.js.map +1 -0
  282. package/package.json +104 -0
@@ -0,0 +1,219 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useState, useEffect, useContext, useRef } from 'react';
3
+ import { View, StyleSheet, Platform, TextInput, ActivityIndicator, } from 'react-native';
4
+ import { IconButton } from '../ui';
5
+ import { useBrand } from '../../brand';
6
+ import { ThemeContext } from '../../theme';
7
+ const PLACEHOLDER_COLOR = '#999999'; // Grey color for placeholder text
8
+ // Web-specific textarea component for reliable auto-resize
9
+ const WebTextarea = ({ value, onChangeText, placeholder, placeholderTextColor, style, onKeyDown, inputHeight, setInputHeight, isSingleLine, maxHeight, isTyping, fontSize, }) => {
10
+ const textareaRef = useRef(null);
11
+ const adjustHeight = React.useCallback(() => {
12
+ if (textareaRef.current) {
13
+ // Reset height to auto to get accurate scrollHeight
14
+ textareaRef.current.style.height = 'auto';
15
+ const scrollHeight = textareaRef.current.scrollHeight;
16
+ const clampedHeight = Math.max(MIN_HEIGHT, Math.min(scrollHeight, maxHeight));
17
+ setInputHeight(clampedHeight);
18
+ textareaRef.current.style.height = `${clampedHeight}px`;
19
+ }
20
+ }, [maxHeight, setInputHeight]);
21
+ // Only adjust height when user is typing (not in initial dummy state)
22
+ useEffect(() => {
23
+ if (isTyping) {
24
+ // Use requestAnimationFrame to ensure DOM is ready
25
+ const rafId = requestAnimationFrame(() => {
26
+ adjustHeight();
27
+ });
28
+ return () => cancelAnimationFrame(rafId);
29
+ }
30
+ }, [value, adjustHeight, isTyping]);
31
+ const handleInput = (e) => {
32
+ onChangeText(e.target.value);
33
+ // Height adjustment happens in useEffect
34
+ };
35
+ const handleKeyDown = (e) => {
36
+ if (onKeyDown) {
37
+ onKeyDown(e);
38
+ }
39
+ };
40
+ // Flatten style array and extract values
41
+ const flattenedStyle = Array.isArray(style)
42
+ ? Object.assign({}, ...style.filter(Boolean))
43
+ : style || {};
44
+ // Extract padding values from flattened style
45
+ const paddingHorizontal = flattenedStyle.paddingHorizontal || flattenedStyle.paddingLeft || 10;
46
+ const paddingVertical = flattenedStyle.paddingVertical || flattenedStyle.paddingTop || 10;
47
+ // Extract color explicitly - it's critical for web
48
+ const textColor = flattenedStyle.color;
49
+ // Set placeholder color via CSS
50
+ useEffect(() => {
51
+ if (textareaRef.current && placeholderTextColor) {
52
+ const textarea = textareaRef.current;
53
+ const styleId = 'chat-input-placeholder-style';
54
+ let styleElement = document.getElementById(styleId);
55
+ if (!styleElement) {
56
+ styleElement = document.createElement('style');
57
+ styleElement.id = styleId;
58
+ document.head.appendChild(styleElement);
59
+ }
60
+ // Use a data attribute to target this specific textarea
61
+ textarea.setAttribute('data-placeholder-color', placeholderTextColor);
62
+ styleElement.textContent = `textarea[data-placeholder-color="${placeholderTextColor}"]::placeholder { color: ${placeholderTextColor} !important; }`;
63
+ }
64
+ }, [placeholderTextColor]);
65
+ return React.createElement('textarea', {
66
+ ref: textareaRef,
67
+ value: value,
68
+ onChange: handleInput,
69
+ onKeyDown: handleKeyDown,
70
+ placeholder: placeholder,
71
+ style: {
72
+ height: `${inputHeight}px`,
73
+ resize: 'none',
74
+ overflow: 'hidden',
75
+ fontFamily: flattenedStyle.fontFamily || 'inherit',
76
+ fontSize: flattenedStyle.fontSize || fontSize,
77
+ lineHeight: flattenedStyle.lineHeight || 'inherit',
78
+ color: textColor || '#000000', // Explicitly set color, don't rely on inherit
79
+ backgroundColor: 'transparent',
80
+ border: 'none',
81
+ outline: 'none',
82
+ paddingLeft: paddingHorizontal,
83
+ paddingRight: paddingHorizontal,
84
+ paddingTop: paddingVertical,
85
+ paddingBottom: paddingVertical,
86
+ margin: 0,
87
+ display: 'inline-block',
88
+ verticalAlign: isSingleLine ? 'middle' : 'top',
89
+ width: '100%',
90
+ boxSizing: 'border-box',
91
+ },
92
+ });
93
+ };
94
+ const MIN_HEIGHT = 40; // One line height
95
+ const DEFAULT_MAX_HEIGHT = 120; // Maximum height (4-5 lines)
96
+ const ChatInput = ({ isLoading, sendMessage, maxHeight = DEFAULT_MAX_HEIGHT }) => {
97
+ const theme = useContext(ThemeContext);
98
+ const brand = useBrand();
99
+ const [message, setMessage] = useState('');
100
+ const [inputHeight, setInputHeight] = useState(MIN_HEIGHT);
101
+ const textInputRef = useRef(null);
102
+ const isSingleLine = inputHeight <= MIN_HEIGHT;
103
+ const isTyping = message.length > 0;
104
+ const borderRadius = isTyping ? brand.borderRadius : 9999;
105
+ const handleChangeText = (text) => {
106
+ setMessage(text);
107
+ };
108
+ const handleSubmit = () => {
109
+ if (!isLoading && message.trim()) {
110
+ sendMessage(message);
111
+ setMessage('');
112
+ setInputHeight(MIN_HEIGHT); // Reset height when message is sent
113
+ }
114
+ };
115
+ // Mobile: Enter sends message
116
+ const handleKeyPress = (e) => {
117
+ if (Platform.OS !== 'web' && e.nativeEvent.key === 'Enter') {
118
+ handleSubmit();
119
+ }
120
+ };
121
+ // Web: Enter sends message, Shift+Enter creates newline
122
+ const handleKeyDown = (e) => {
123
+ if (Platform.OS === 'web' && e.key === 'Enter' && !e.shiftKey) {
124
+ e.preventDefault();
125
+ handleSubmit();
126
+ }
127
+ };
128
+ const handleContentSizeChange = (e) => {
129
+ const { height } = e.nativeEvent.contentSize;
130
+ const clampedHeight = Math.max(MIN_HEIGHT, Math.min(height, maxHeight));
131
+ setInputHeight(clampedHeight);
132
+ };
133
+ // Reset height when message is cleared
134
+ useEffect(() => {
135
+ if (!message) {
136
+ setInputHeight(MIN_HEIGHT);
137
+ }
138
+ }, [message]);
139
+ return (_jsxs(View, { style: [styles.container, { backgroundColor: theme.values.cardBackgroundColor, borderRadius, ...(!theme.values.isDark && { borderColor: theme.values.borderColor, borderWidth: 1 }) }, Platform.OS === 'web' && { maxWidth: 1000 }], children: [_jsxs(View, { style: [
140
+ styles.inputRow,
141
+ {
142
+ backgroundColor: theme.values.cardBackgroundColor,
143
+ borderRadius,
144
+ },
145
+ ], children: [!isTyping && (_jsx(View, { style: styles.leftActionButtons, children: _jsx(IconButton, { onPress: () => { }, iconName: 'plus' }) })), _jsx(View, { style: styles.inputWrapper, children: _jsx(View, { style: styles.inputContainer, children: Platform.OS === 'web' ? (_jsx(WebTextarea, { value: message, onChangeText: handleChangeText, placeholder: isTyping ? undefined : 'Ask anything', placeholderTextColor: PLACEHOLDER_COLOR, onKeyDown: handleKeyDown, inputHeight: inputHeight, setInputHeight: setInputHeight, isSingleLine: isSingleLine, maxHeight: maxHeight, isTyping: isTyping, fontSize: brand.fontSizes.medium, style: [
146
+ styles.textInput,
147
+ {
148
+ color: theme.values.color,
149
+ paddingHorizontal: 10,
150
+ paddingVertical: 10,
151
+ },
152
+ styles.webInput,
153
+ ] })) : (_jsx(TextInput, { ref: textInputRef, value: message, scrollEnabled: inputHeight >= maxHeight, onChangeText: handleChangeText, placeholder: isTyping ? undefined : 'Ask anything', placeholderTextColor: PLACEHOLDER_COLOR, onKeyPress: handleKeyPress, onContentSizeChange: handleContentSizeChange, multiline: true, style: [
154
+ styles.textInput,
155
+ {
156
+ color: theme.values.color,
157
+ textAlignVertical: isSingleLine ? 'center' : 'top',
158
+ maxHeight: maxHeight,
159
+ },
160
+ ] })) }) }), !isTyping && (_jsxs(View, { style: styles.rightActionButtons, children: [_jsx(IconButton, { onPress: () => { }, iconName: 'mic' }), _jsx(View, { style: styles.sendButtonWrapper, children: isLoading ? (_jsx(ActivityIndicator, { size: "small", color: brand.colors.primary })) : (_jsx(IconButton, { onPress: handleSubmit, iconName: 'send', color: '#FFFFFF', backgroundColor: brand.colors.primary })) })] }))] }), isTyping && (_jsxs(View, { style: [styles.actionButtonsRow, { backgroundColor: theme.values.cardBackgroundColor }], children: [_jsx(View, { style: styles.leftActionButtons, children: _jsx(IconButton, { onPress: () => { }, iconName: 'plus' }) }), _jsxs(View, { style: styles.rightActionButtons, children: [_jsx(IconButton, { onPress: () => { }, iconName: 'mic' }), _jsx(View, { style: styles.sendButtonWrapper, children: isLoading ? (_jsx(ActivityIndicator, { size: "small", color: brand.colors.primary })) : (_jsx(IconButton, { onPress: handleSubmit, iconName: 'send', color: '#FFFFFF', backgroundColor: brand.colors.primary })) })] })] }))] }));
161
+ };
162
+ const styles = StyleSheet.create({
163
+ container: {
164
+ width: '100%',
165
+ overflow: 'hidden',
166
+ gap: 20,
167
+ padding: 10,
168
+ },
169
+ inputRow: {
170
+ flexDirection: 'row',
171
+ alignItems: 'center',
172
+ gap: 10,
173
+ },
174
+ actionButtonsRow: {
175
+ flexDirection: 'row',
176
+ alignItems: 'center',
177
+ justifyContent: 'space-between',
178
+ gap: 10,
179
+ },
180
+ leftActionButtons: {
181
+ justifyContent: 'center',
182
+ alignItems: 'center',
183
+ },
184
+ rightActionButtons: {
185
+ flexDirection: 'row',
186
+ alignItems: 'center',
187
+ gap: 8,
188
+ },
189
+ inputWrapper: {
190
+ flex: 1,
191
+ },
192
+ inputContainer: {
193
+ width: '100%',
194
+ ...Platform.select({
195
+ web: {
196
+ overflow: 'scroll',
197
+ scrollbarWidth: 'none',
198
+ },
199
+ }),
200
+ },
201
+ textInput: {
202
+ width: '100%',
203
+ fontSize: 16,
204
+ borderWidth: 0,
205
+ },
206
+ webInput: {
207
+ // @ts-ignore - Web-specific styles
208
+ outlineStyle: 'none',
209
+ WebkitAppearance: 'none',
210
+ MozAppearance: 'none',
211
+ appearance: 'none',
212
+ },
213
+ sendButtonWrapper: {
214
+ justifyContent: 'center',
215
+ alignItems: 'center',
216
+ },
217
+ });
218
+ export default ChatInput;
219
+ //# sourceMappingURL=ChatInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInput.js","sourceRoot":"","sources":["../../../components/chat/ChatInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EACL,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,SAAS,EAIT,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,iBAAiB,GAAG,SAAS,CAAC,CAAC,kCAAkC;AAEvE,2DAA2D;AAC3D,MAAM,WAAW,GAAG,CAAC,EACnB,KAAK,EACL,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,KAAK,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,GAcT,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CA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F,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,EAAE;KACZ;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,EAAE;KACR;IACD,gBAAgB,EAAE;QAChB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;QAC/B,GAAG,EAAE,EAAE;KACR;IACD,iBAAiB,EAAE;QACjB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,kBAAkB,EAAE;QAClB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,GAAG,EAAE,CAAC;KACP;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC;KACR;IACD,cAAc,EAAE;QACd,KAAK,EAAE,MAAM;QACb,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,QAAQ,EAAE,QAAQ;gBAClB,cAAc,EAAE,MAAM;aACvB;SACF,CAAC;KACH;IACD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,mCAAmC;QACnC,YAAY,EAAE,MAAM;QACpB,gBAAgB,EAAE,MAAM;QACxB,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,MAAM;KACnB;IACD,iBAAiB,EAAE;QACjB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ChatMessagesProps } from './types';
3
+ /**
4
+ * ChatMessages - Displays list of chat messages with scroll functionality
5
+ * Pure content component, layout-agnostic
6
+ */
7
+ declare const ChatMessages: ({ messages, scrollViewRef, isLoading, loadingAnimation, }: ChatMessagesProps) => React.JSX.Element;
8
+ export default ChatMessages;
9
+ //# sourceMappingURL=ChatMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessages.d.ts","sourceRoot":"","sources":["../../../components/chat/ChatMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI5C;;;GAGG;AACH,QAAA,MAAM,YAAY,GAAI,2DAKnB,iBAAiB,KAAG,KAAK,CAAC,GAAG,CAAC,OAgEhC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { View, ScrollView, Platform } from 'react-native';
4
+ import Message from './Message';
5
+ import LottieView from 'lottie-react-native';
6
+ import { ErrorBoundary, StyledText } from '../ui';
7
+ /**
8
+ * ChatMessages - Displays list of chat messages with scroll functionality
9
+ * Pure content component, layout-agnostic
10
+ */
11
+ const ChatMessages = ({ messages, scrollViewRef, isLoading, loadingAnimation, }) => {
12
+ const localScrollRef = useRef(null);
13
+ const ref = scrollViewRef || localScrollRef;
14
+ useEffect(() => {
15
+ if (ref.current && messages.length > 0 && typeof ref.current.scrollToEnd === 'function') {
16
+ ref.current.scrollToEnd({ animated: false });
17
+ }
18
+ }, [messages]);
19
+ // Platform-specific adjustments
20
+ const isWeb = Platform.OS === 'web';
21
+ return (_jsxs(ScrollView, { ref: ref, showsHorizontalScrollIndicator: false, contentContainerStyle: {
22
+ paddingTop: 20,
23
+ paddingHorizontal: 20,
24
+ }, showsVerticalScrollIndicator: true, keyboardShouldPersistTaps: "handled", children: [messages.map((message, index) => (_jsx(Message, { text: message.text, isSent: message.isSent }, index))), isLoading && (_jsx(View, { style: { width: 100, height: isWeb ? 50 : 100 }, children: loadingAnimation &&
25
+ typeof loadingAnimation !== 'number' &&
26
+ (typeof loadingAnimation === 'string' ||
27
+ (typeof loadingAnimation === 'object' &&
28
+ loadingAnimation != null &&
29
+ 'uri' in loadingAnimation &&
30
+ typeof loadingAnimation.uri === 'string')) ? (_jsx(ErrorBoundary, { fallback: _jsx(View, { style: { width: 100, height: 100, justifyContent: 'center', alignItems: 'center' }, children: _jsx(StyledText, { fontSize: "sm", color: "#666", children: "Loading..." }) }), onError: (error) => console.error('Lottie animation error:', error), children: _jsx(LottieView, { source: typeof loadingAnimation === 'string'
31
+ ? loadingAnimation
32
+ : { uri: loadingAnimation.uri }, autoPlay: true, loop: true, style: { width: 100, height: 100 } }) })) : (_jsx(View, { style: { width: 100, height: 100, justifyContent: 'center', alignItems: 'center' }, children: _jsx(StyledText, { fontSize: "sm", color: "#666", children: "Loading..." }) })) }))] }));
33
+ };
34
+ export default ChatMessages;
35
+ //# sourceMappingURL=ChatMessages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessages.js","sourceRoot":"","sources":["../../../components/chat/ChatMessages.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,gBAAgB,GACE,EAAqB,EAAE;IACzC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,aAAa,IAAI,cAAc,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE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KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,YACtF,KAAC,UAAU,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,MAAM,2BAAwB,GACzD,EAET,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,YAE1E,KAAC,UAAU,IACT,MAAM,EACJ,OAAO,gBAAgB,KAAK,QAAQ;4BAClC,CAAC,CAAC,gBAAgB;4BAClB,CAAC,CAAC,EAAE,GAAG,EAAG,gBAAoC,CAAC,GAAG,EAAE,EAExD,QAAQ,QACR,IAAI,QACJ,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAClC,GACY,CACjB,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,YACtF,KAAC,UAAU,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,MAAM,2BAAwB,GACzD,CACR,GACI,CACR,IACU,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { ImageSourcePropType } from 'react-native';
3
+ interface EmptyChatProps {
4
+ isLoading: boolean;
5
+ sendMessage: (message: string) => void;
6
+ /**
7
+ * Mascot image. Can be an ImageSourcePropType (require) or string URI.
8
+ */
9
+ mascotImage: ImageSourcePropType | string;
10
+ }
11
+ /**
12
+ * EmptyChat - Pure content component for empty chat state
13
+ * Displays mascot, welcome text, and chat input
14
+ * Layout-agnostic: parent handles WebPageLayout, background, etc.
15
+ */
16
+ declare const EmptyChat: ({ isLoading, sendMessage, mascotImage }: EmptyChatProps) => React.JSX.Element;
17
+ export default EmptyChat;
18
+ //# sourceMappingURL=EmptyChat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyChat.d.ts","sourceRoot":"","sources":["../../../components/chat/EmptyChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAS,mBAAmB,EAA8B,MAAM,cAAc,CAAC;AAatF,UAAU,cAAc;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,WAAW,EAAE,mBAAmB,GAAG,MAAM,CAAC;CAC3C;AAED;;;;GAIG;AACH,QAAA,MAAM,SAAS,GAAI,yCAAyC,cAAc,KAAG,KAAK,CAAC,GAAG,CAAC,OA6DtF,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useContext } from 'react';
3
+ import { Image, StyleSheet, View, Platform } from 'react-native';
4
+ import Animated, { useSharedValue, useAnimatedStyle, withRepeat, withTiming, Easing, } from 'react-native-reanimated';
5
+ import { StyledText } from '../ui';
6
+ import { ThemeContext } from '../../theme';
7
+ import { useDimensions } from '../../hooks';
8
+ import ChatInput from './ChatInput';
9
+ /**
10
+ * EmptyChat - Pure content component for empty chat state
11
+ * Displays mascot, welcome text, and chat input
12
+ * Layout-agnostic: parent handles WebPageLayout, background, etc.
13
+ */
14
+ const EmptyChat = ({ isLoading, sendMessage, mascotImage }) => {
15
+ const theme = useContext(ThemeContext);
16
+ const dimensions = useDimensions();
17
+ // Create shared value for the hover animation
18
+ const translateY = useSharedValue(0);
19
+ // Set up the floating animation
20
+ useEffect(() => {
21
+ translateY.value = withRepeat(withTiming(-15, {
22
+ duration: 1000,
23
+ easing: Easing.inOut(Easing.sin),
24
+ }), -1, // infinite repeat
25
+ true);
26
+ }, [translateY]);
27
+ // Create animated style
28
+ const animatedStyle = useAnimatedStyle(() => {
29
+ return {
30
+ transform: [{ translateY: translateY.value }],
31
+ };
32
+ });
33
+ // Detect mobile web breakpoint
34
+ const isMobileWeb = Platform.OS === 'web' && dimensions.breakpoint === 'small';
35
+ const isWeb = Platform.OS === 'web';
36
+ // Responsive mascot sizing
37
+ const mascotWidth = isMobileWeb ? 100 : 160;
38
+ const mascotHeight = isMobileWeb ? 150 : 240;
39
+ // Responsive container styles
40
+ const containerGap = isMobileWeb ? 24 : (isWeb ? 40 : 20);
41
+ const containerPadding = isMobileWeb ? 16 : 20;
42
+ const containerMinHeight = isMobileWeb ? undefined : (isWeb ? 400 : undefined);
43
+ // Handle image source
44
+ const imageSource = typeof mascotImage === 'string' ? { uri: mascotImage } : mascotImage;
45
+ return (_jsxs(View, { style: [
46
+ styles.container,
47
+ Platform.OS === 'ios' && { paddingBottom: 100 },
48
+ { gap: containerGap, padding: containerPadding },
49
+ containerMinHeight && { minHeight: containerMinHeight },
50
+ ], children: [_jsx(Animated.View, { style: animatedStyle, children: _jsx(Image, { source: imageSource, style: [styles.mascot, { width: mascotWidth, height: mascotHeight }] }) }), _jsx(StyledText, { fontSize: isWeb ? 'lg' : 'md', align: "center", color: theme.values.color, children: "Get personalized recommendations and answers to your nightlife questions." }), _jsx(ChatInput, { isLoading: isLoading, sendMessage: sendMessage })] }));
51
+ };
52
+ export default EmptyChat;
53
+ const styles = StyleSheet.create({
54
+ container: {
55
+ alignItems: 'center',
56
+ justifyContent: 'center',
57
+ width: '100%',
58
+ flex: 1, // Use flex: 1 on all platforms
59
+ },
60
+ mascot: {
61
+ // Size is set dynamically based on breakpoint
62
+ },
63
+ });
64
+ //# sourceMappingURL=EmptyChat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyChat.js","sourceRoot":"","sources":["../../../components/chat/EmptyChat.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,UA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AE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GACpE,GACY,EAChB,KAAC,UAAU,IAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,0FAEtE,EACb,KAAC,SAAS,IAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAI,IACxD,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,CAAC,EAAE,+BAA+B;KACzC;IACD,MAAM,EAAE;IACN,8CAA8C;KAC/C;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface MessageProps {
3
+ text: string;
4
+ isSent: boolean;
5
+ }
6
+ declare const Message: ({ text, isSent }: MessageProps) => React.JSX.Element;
7
+ export default Message;
8
+ //# sourceMappingURL=Message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../components/chat/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,GAAI,kBAAkB,YAAY,KAAG,KAAK,CAAC,GAAG,CAAC,OA+C3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { useMemo } from 'react';
3
+ import { View, StyleSheet } from 'react-native';
4
+ import { ThemeContext } from '../../theme';
5
+ import { useBrand } from '../../brand';
6
+ import { StyledText } from '../ui';
7
+ const Message = ({ text, isSent }) => {
8
+ const theme = React.useContext(ThemeContext);
9
+ const brand = useBrand();
10
+ const styles = useMemo(() => StyleSheet.create({
11
+ messageBubble: {
12
+ padding: 12,
13
+ borderRadius: brand.borderRadius,
14
+ marginVertical: 4,
15
+ maxWidth: '80%',
16
+ flexDirection: 'row',
17
+ alignItems: 'flex-end',
18
+ },
19
+ sentMessage: {
20
+ alignSelf: 'flex-end',
21
+ backgroundColor: brand.colors.primary,
22
+ marginLeft: '20%',
23
+ },
24
+ receivedMessage: {
25
+ alignSelf: 'flex-start',
26
+ backgroundColor: '#e0e0e0',
27
+ marginRight: '20%',
28
+ },
29
+ }), [brand]);
30
+ return (_jsx(View, { style: [
31
+ styles.messageBubble,
32
+ isSent
33
+ ? styles.sentMessage
34
+ : [
35
+ styles.receivedMessage,
36
+ {
37
+ backgroundColor: theme.values.cardBackgroundColor,
38
+ ...(!theme.values.isDark && !isSent && {
39
+ borderWidth: 1,
40
+ borderColor: theme.values.borderColor,
41
+ }),
42
+ },
43
+ ],
44
+ ], children: _jsx(StyledText, { color: isSent ? 'white' : theme.values.color, fontSize: 16, children: text }) }));
45
+ };
46
+ export default Message;
47
+ //# sourceMappingURL=Message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../components/chat/Message.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOnC,MAAM,OAAO,GAAG,CAAC,EA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,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { default as ChatContainer } from './ChatContainer';
2
+ export { default as ChatMessages } from './ChatMessages';
3
+ export { default as EmptyChat } from './EmptyChat';
4
+ export { default as ChatInput } from './ChatInput';
5
+ export * from './types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Export chat components from local files
2
+ export { default as ChatContainer } from './ChatContainer';
3
+ export { default as ChatMessages } from './ChatMessages';
4
+ export { default as EmptyChat } from './EmptyChat';
5
+ export { default as ChatInput } from './ChatInput';
6
+ export * from './types';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../components/chat/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+ import { ImageSourcePropType, ScrollView } from 'react-native';
3
+ export interface ChatPart {
4
+ text: string;
5
+ }
6
+ export interface ChatHistory {
7
+ role: 'user' | 'model';
8
+ parts: ChatPart[];
9
+ }
10
+ export interface ChatResponse {
11
+ candidates: {
12
+ content: {
13
+ parts: ChatPart[];
14
+ };
15
+ }[];
16
+ history: ChatHistory[];
17
+ }
18
+ export interface ChatContainerProps {
19
+ children: ReactNode;
20
+ }
21
+ export interface ChatMessagesProps {
22
+ messages: {
23
+ text: string;
24
+ isSent: boolean;
25
+ }[];
26
+ scrollViewRef: React.RefObject<ScrollView | null>;
27
+ isLoading: boolean;
28
+ /**
29
+ * Optional loading animation source. Can be an ImageSourcePropType (require) or string URI.
30
+ * If not provided, defaults to the default loading animation asset.
31
+ */
32
+ loadingAnimation?: ImageSourcePropType | string;
33
+ }
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../components/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE;QACV,OAAO,EAAE;YACP,KAAK,EAAE,QAAQ,EAAE,CAAC;SACnB,CAAC;KACH,EAAE,CAAC;IACJ,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC9C,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAAC;CACjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../components/chat/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ interface Option {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ interface DropDownSelectProps {
6
+ options: Option[];
7
+ initialValue: string;
8
+ onSelect: (value: string) => void;
9
+ }
10
+ declare const DropDownSelect: ({ options, onSelect, initialValue }: DropDownSelectProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default DropDownSelect;
12
+ //# sourceMappingURL=DropDownSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropDownSelect.d.ts","sourceRoot":"","sources":["../../../components/form/DropDownSelect.tsx"],"names":[],"mappings":"AAgBA,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,QAAA,MAAM,cAAc,GAAI,qCAAqC,mBAAmB,4CA2F/E,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useContext, useState, useMemo } from 'react';
3
+ import { View, Pressable, StyleSheet, } from 'react-native';
4
+ import { StyledText } from '../ui';
5
+ import { useBrand } from '../../brand';
6
+ import Feather from '@expo/vector-icons/Feather';
7
+ import { ThemeContext } from '../../theme';
8
+ import { Card } from '../card';
9
+ import { ListButton } from '../list';
10
+ import { ListDivider } from '../list';
11
+ import { FlashList } from '@shopify/flash-list';
12
+ const DropDownSelect = ({ options, onSelect, initialValue }) => {
13
+ const [selectedValue, setSelectedValue] = useState(initialValue);
14
+ const [isDropdownVisible, setDropdownVisible] = useState(false);
15
+ const [buttonLayout, setButtonLayout] = useState(null);
16
+ const handleOptionSelect = (option) => {
17
+ setSelectedValue(option.label); // Update local state with selected option
18
+ setDropdownVisible(false); // Close the dropdown
19
+ onSelect(option.value); // Notify parent component about the selected value
20
+ };
21
+ // Initialize theme
22
+ const theme = useContext(ThemeContext);
23
+ const brand = useBrand();
24
+ const styles = useMemo(() => StyleSheet.create({
25
+ container: {
26
+ position: 'relative',
27
+ zIndex: 10,
28
+ },
29
+ dropdownButton: {
30
+ flexDirection: 'row',
31
+ justifyContent: 'space-between',
32
+ alignItems: 'center',
33
+ borderWidth: 1,
34
+ padding: 10,
35
+ borderRadius: brand.borderRadius,
36
+ },
37
+ dropdownList: {
38
+ position: 'absolute',
39
+ zIndex: 999, // Ensure dropdown appears above other content
40
+ },
41
+ dropdownItem: {
42
+ padding: 10,
43
+ borderBottomWidth: 1,
44
+ },
45
+ }), [brand]);
46
+ return (_jsxs(View, { style: styles.container, children: [_jsxs(Pressable, { style: [
47
+ styles.dropdownButton,
48
+ {
49
+ borderRadius: brand.borderRadius,
50
+ borderColor: theme.values.borderColor,
51
+ },
52
+ ], onPress: () => setDropdownVisible(!isDropdownVisible), onLayout: (event) => setButtonLayout(event.nativeEvent.layout), children: [_jsx(StyledText, { fontSize: 'sm', uppercase: true, bold: true, children: isDropdownVisible ? '\n' : selectedValue }), _jsx(Feather, { name: "chevron-down", size: 20, color: theme.values.color })] }), isDropdownVisible && buttonLayout && (_jsx(View, { style: [
53
+ styles.dropdownList,
54
+ {
55
+ marginTop: 10,
56
+ top: buttonLayout.y + buttonLayout.height, // Position right below the button
57
+ left: buttonLayout.x, // Align with button's left
58
+ width: buttonLayout.width, // Match the button's width
59
+ },
60
+ ], children: _jsx(Card, { children: _jsx(FlashList, { data: options, keyExtractor: (item) => item.value, renderItem: ({ item }) => (_jsxs(_Fragment, { children: [_jsx(ListButton, { text: item.label, onPress: () => handleOptionSelect(item), uppercase: true }), _jsx(ListDivider, {})] })), estimatedItemSize: 50 }) }) }))] }));
61
+ };
62
+ export default DropDownSelect;
63
+ //# sourceMappingURL=DropDownSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropDownSelect.js","sourceRoot":"","sources":["../../../components/form/DropDownSelect.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EACL,IAAI,EACJ,SAAS,EACT,UAAU,GAEX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,OAAO,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAahD,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAuB,EAAE,EAAE;IAClF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAS,YAAY,CAAC,CAAC;IACzE,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACzE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QA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buttonText?: string;
6
+ successView?: React.ReactNode;
7
+ onSubmit: (email: string) => Promise<{
8
+ success: boolean;
9
+ error?: string;
10
+ }>;
11
+ }
12
+ declare const EmailSubscriptionForm: React.FC<EmailSubscriptionFormProps>;
13
+ export default EmailSubscriptionForm;
14
+ //# sourceMappingURL=EmailSubscriptionForm.d.ts.map