@magmamath/students-features 0.6.12 → 0.6.14-rc.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 (226) hide show
  1. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +17 -5
  2. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +148 -41
  4. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js +110 -0
  6. package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
  7. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js +159 -0
  8. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
  9. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
  10. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  11. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  13. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +31 -0
  14. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
  15. package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
  16. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
  17. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
  18. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +44 -0
  19. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
  20. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
  21. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
  22. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
  23. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
  24. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
  25. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
  26. package/dist/commonjs/features/exampleSolution/constants.js +13 -0
  27. package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
  28. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +61 -0
  29. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
  30. package/dist/commonjs/features/exampleSolution/index.js +39 -0
  31. package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
  32. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
  33. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
  34. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +32 -0
  35. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
  36. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +18 -0
  37. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
  38. package/dist/commonjs/features/exampleSolution/types.js +6 -0
  39. package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
  40. package/dist/commonjs/index.js +24 -0
  41. package/dist/commonjs/index.js.map +1 -1
  42. package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
  43. package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
  44. package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
  45. package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
  46. package/dist/commonjs/shared/icons/index.js +204 -0
  47. package/dist/commonjs/shared/icons/index.js.map +1 -0
  48. package/dist/commonjs/shared/translation/localization/ca.json +7 -1
  49. package/dist/commonjs/shared/translation/localization/en.json +8 -2
  50. package/dist/commonjs/shared/translation/localization/gb.json +7 -1
  51. package/dist/commonjs/shared/translation/localization/sct.json +7 -1
  52. package/dist/commonjs/shared/translation/localization/sw.json +7 -1
  53. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +17 -5
  54. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  55. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +147 -41
  56. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
  57. package/dist/module/features/chatbot/components/Alternatives/InputButton.js +102 -0
  58. package/dist/module/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
  59. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js +152 -0
  60. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
  61. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
  62. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  63. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
  64. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  65. package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
  66. package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
  67. package/dist/module/features/exampleSolution/assets/grid.png +0 -0
  68. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
  69. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
  70. package/dist/module/features/exampleSolution/components/LavaIcon.js +36 -0
  71. package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
  72. package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
  73. package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
  74. package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
  75. package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
  76. package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
  77. package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
  78. package/dist/module/features/exampleSolution/constants.js +9 -0
  79. package/dist/module/features/exampleSolution/constants.js.map +1 -0
  80. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +56 -0
  81. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
  82. package/dist/module/features/exampleSolution/index.js +6 -0
  83. package/dist/module/features/exampleSolution/index.js.map +1 -0
  84. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
  85. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
  86. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +27 -0
  87. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
  88. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +13 -0
  89. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
  90. package/dist/module/features/exampleSolution/types.js +4 -0
  91. package/dist/module/features/exampleSolution/types.js.map +1 -0
  92. package/dist/module/index.js +2 -0
  93. package/dist/module/index.js.map +1 -1
  94. package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
  95. package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
  96. package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
  97. package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
  98. package/dist/module/shared/icons/index.js +21 -0
  99. package/dist/module/shared/icons/index.js.map +1 -0
  100. package/dist/module/shared/translation/localization/ca.json +7 -1
  101. package/dist/module/shared/translation/localization/en.json +8 -2
  102. package/dist/module/shared/translation/localization/gb.json +7 -1
  103. package/dist/module/shared/translation/localization/sct.json +7 -1
  104. package/dist/module/shared/translation/localization/sw.json +7 -1
  105. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  106. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
  107. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
  108. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
  109. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
  110. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
  111. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
  112. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  113. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
  114. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
  115. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
  116. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
  117. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
  118. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
  120. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
  121. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
  122. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
  123. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
  124. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
  125. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
  126. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
  127. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
  128. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
  129. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
  130. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
  131. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
  132. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
  133. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
  134. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
  135. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
  136. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
  137. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +26 -0
  138. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
  139. package/dist/typescript/commonjs/index.d.ts +2 -0
  140. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  141. package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
  142. package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
  143. package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
  144. package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
  145. package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
  146. package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
  147. package/dist/typescript/commonjs/shared/translation/constants.d.ts +30 -0
  148. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  149. package/dist/typescript/commonjs/shared/translation/model.d.ts +12 -0
  150. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  151. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  152. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
  153. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
  154. package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
  155. package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
  156. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
  157. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
  158. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  159. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
  160. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
  161. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
  162. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
  163. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
  164. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
  165. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
  166. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
  167. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
  168. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
  169. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
  170. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
  171. package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
  172. package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
  173. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
  174. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
  175. package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
  176. package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
  177. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
  178. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
  179. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
  180. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
  181. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
  182. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
  183. package/dist/typescript/module/features/exampleSolution/types.d.ts +26 -0
  184. package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
  185. package/dist/typescript/module/index.d.ts +2 -0
  186. package/dist/typescript/module/index.d.ts.map +1 -1
  187. package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
  188. package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
  189. package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
  190. package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
  191. package/dist/typescript/module/shared/icons/index.d.ts +19 -0
  192. package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
  193. package/dist/typescript/module/shared/translation/constants.d.ts +30 -0
  194. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  195. package/dist/typescript/module/shared/translation/model.d.ts +12 -0
  196. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  197. package/package.json +6 -2
  198. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +18 -8
  199. package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +146 -35
  200. package/src/features/chatbot/components/Alternatives/InputButton.tsx +101 -0
  201. package/src/features/chatbot/components/Alternatives/InputWithHintRow.tsx +157 -0
  202. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +6 -2
  203. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +1 -1
  204. package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
  205. package/src/features/exampleSolution/assets/grid.png +0 -0
  206. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +71 -0
  207. package/src/features/exampleSolution/components/LavaIcon.tsx +35 -0
  208. package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
  209. package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
  210. package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
  211. package/src/features/exampleSolution/constants.ts +5 -0
  212. package/src/features/exampleSolution/hooks/useExampleSolution.ts +66 -0
  213. package/src/features/exampleSolution/index.ts +3 -0
  214. package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
  215. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +33 -0
  216. package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
  217. package/src/features/exampleSolution/types.ts +26 -0
  218. package/src/index.ts +2 -0
  219. package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
  220. package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
  221. package/src/shared/icons/index.ts +18 -0
  222. package/src/shared/translation/localization/ca.json +7 -1
  223. package/src/shared/translation/localization/en.json +8 -2
  224. package/src/shared/translation/localization/gb.json +7 -1
  225. package/src/shared/translation/localization/sct.json +7 -1
  226. package/src/shared/translation/localization/sw.json +7 -1
@@ -1,13 +1,112 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
- import { Animated, Pressable, StyleSheet } from 'react-native'
3
- import { COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
4
- import { ArrowRightIcon } from '../../../../shared/icons/ArrowRightIcon'
1
+ // import React, { useEffect, useRef, useState } from 'react'
2
+ // import { Animated, Pressable, StyleSheet } from 'react-native'
3
+ // import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
4
+ //
5
+ // type HelpRequestOptionProps = {
6
+ // onPress: () => void
7
+ // message: string
8
+ // disabled: boolean
9
+ // hoverColor?: string
10
+ // }
11
+ //
12
+ // export const HelpRequestOption = ({
13
+ // onPress,
14
+ // message,
15
+ // disabled = false,
16
+ // hoverColor = COLORS.PRIMARY_BLUE,
17
+ // }: HelpRequestOptionProps) => {
18
+ // const [isHovered, setIsHovered] = useState(false)
19
+ // const hoverAnim = useRef(new Animated.Value(0)).current
20
+ //
21
+ // const backgroundColor = hoverAnim.interpolate({
22
+ // inputRange: [0, 1],
23
+ // outputRange: [COLORS.NEUTRAL_1, hoverColor],
24
+ // })
25
+ // const textColor = hoverAnim.interpolate({
26
+ // inputRange: [0, 1],
27
+ // outputRange: [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1],
28
+ // })
29
+ //
30
+ // useEffect(() => {
31
+ // Animated.timing(hoverAnim, {
32
+ // toValue: isHovered ? 1 : 0,
33
+ // duration: 200,
34
+ // useNativeDriver: false,
35
+ // }).start()
36
+ // }, [isHovered, hoverAnim])
37
+ //
38
+ // return (
39
+ // <Pressable
40
+ // onHoverIn={() => setIsHovered(true)}
41
+ // onHoverOut={() => setIsHovered(false)}
42
+ // onPress={onPress}
43
+ // style={styles.button}
44
+ // disabled={disabled}
45
+ // accessibilityState={{ disabled }}
46
+ // accessibilityRole="button"
47
+ // >
48
+ // <Animated.View
49
+ // style={[styles.textWrapper, { backgroundColor, borderColor: isHovered ? backgroundColor: COLORS.PRIMARY_BLUE }]}
50
+ // >
51
+ // <Animated.Text numberOfLines={1} style={[styles.text, { color: textColor }]}>
52
+ // I need a hint
53
+ // </Animated.Text>
54
+ // <ArrowUpIcon color={isHovered ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_10} />
55
+ // </Animated.View>
56
+ // </Pressable>
57
+ // )
58
+ // }
59
+ //
60
+ // const styles = StyleSheet.create({
61
+ // button: {
62
+ // flexDirection: 'row',
63
+ // alignItems: 'flex-end',
64
+ // justifyContent: 'space-between',
65
+ // width: '100%',
66
+ // },
67
+ // text: {
68
+ // fontSize: 18,
69
+ // fontWeight: 400,
70
+ // fontFamily: FONT_FAMILY.buenosAires,
71
+ // color: COLORS.NEUTRAL_10,
72
+ // },
73
+ // textWrapper: {
74
+ // flex: 1,
75
+ // flexDirection: 'row',
76
+ // alignItems: 'center',
77
+ // justifyContent: 'space-between',
78
+ // maxWidth: 163,
79
+ // paddingHorizontal: SPACING[400],
80
+ // paddingVertical: SPACING[200],
81
+ // borderWidth: 1,
82
+ // borderRadius: 48,
83
+ // elevation: 3,
84
+ // shadowColor: '#333',
85
+ // shadowOffset: { width: 0, height: 1 },
86
+ // shadowOpacity: 0.25,
87
+ // shadowRadius: 3,
88
+ // backgroundColor: COLORS.NEUTRAL_1,
89
+ // borderColor: COLORS.PRIMARY_BLUE,
90
+ // },
91
+ // })
92
+
93
+ import React from 'react'
94
+ import { Pressable, StyleSheet } from 'react-native'
95
+ import Animated, {
96
+ useSharedValue,
97
+ withTiming,
98
+ useAnimatedStyle,
99
+ interpolateColor,
100
+ SharedValue,
101
+ } from 'react-native-reanimated'
102
+ import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
5
103
 
6
104
  type HelpRequestOptionProps = {
7
105
  onPress: () => void
8
106
  message: string
9
107
  disabled: boolean
10
108
  hoverColor?: string
109
+ visibleSv: SharedValue<number>
11
110
  }
12
111
 
13
112
  export const HelpRequestOption = ({
@@ -15,44 +114,56 @@ export const HelpRequestOption = ({
15
114
  message,
16
115
  disabled = false,
17
116
  hoverColor = COLORS.PRIMARY_BLUE,
117
+ visibleSv,
18
118
  }: HelpRequestOptionProps) => {
19
- const [isHovered, setIsHovered] = useState(false)
20
- const hoverAnim = useRef(new Animated.Value(0)).current
119
+ const hoverSv = useSharedValue(0)
120
+
121
+ const onHoverIn = () => {
122
+ if (!disabled) hoverSv.value = withTiming(1, { duration: 200 })
123
+ }
124
+ const onHoverOut = () => {
125
+ if (!disabled) hoverSv.value = withTiming(0, { duration: 200 })
126
+ }
127
+
128
+ const animatedWrapperStyle = useAnimatedStyle(() => {
129
+ const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
130
+ const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
21
131
 
22
- const backgroundColor = hoverAnim.interpolate({
23
- inputRange: [0, 1],
24
- outputRange: [COLORS.NEUTRAL_1, hoverColor],
25
- })
26
- const textColor = hoverAnim.interpolate({
27
- inputRange: [0, 1],
28
- outputRange: [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1],
29
- })
132
+ return {
133
+ backgroundColor,
134
+ borderColor,
135
+ }
136
+ }, [hoverSv])
30
137
 
31
- useEffect(() => {
32
- Animated.timing(hoverAnim, {
33
- toValue: isHovered ? 1 : 0,
34
- duration: 200,
35
- useNativeDriver: false,
36
- }).start()
37
- }, [isHovered, hoverAnim])
138
+ const animatedTextStyle = useAnimatedStyle(() => {
139
+ const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
140
+ return { color }
141
+ }, [hoverSv])
142
+
143
+ const animatedVisibilityStyle = useAnimatedStyle(() => {
144
+ return {
145
+ opacity: visibleSv ? visibleSv.value : 1,
146
+ }
147
+ }, [visibleSv])
38
148
 
39
149
  return (
40
150
  <Pressable
41
- onHoverIn={() => setIsHovered(true)}
42
- onHoverOut={() => setIsHovered(false)}
151
+ onHoverIn={onHoverIn}
152
+ onHoverOut={onHoverOut}
43
153
  onPress={onPress}
44
- style={styles.button}
154
+ style={[styles.button, disabled && { cursor: 'auto' }]}
45
155
  disabled={disabled}
46
156
  accessibilityState={{ disabled }}
47
157
  accessibilityRole="button"
48
158
  >
49
- <Animated.View
50
- style={[styles.textWrapper, { backgroundColor, borderColor: backgroundColor }]}
51
- >
52
- <Animated.Text numberOfLines={1} style={[styles.text, { color: textColor }]}>
159
+ <Animated.View style={[styles.textWrapper, animatedWrapperStyle, animatedVisibilityStyle]}>
160
+ <Animated.Text numberOfLines={1} style={[styles.text, animatedTextStyle]}>
53
161
  {message}
54
162
  </Animated.Text>
55
- <ArrowRightIcon color={isHovered ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_10} />
163
+
164
+ <Animated.Text style={animatedTextStyle}>
165
+ <ArrowUpIcon color={'currentColor'} size={16}/>
166
+ </Animated.Text>
56
167
  </Animated.View>
57
168
  </Pressable>
58
169
  )
@@ -61,22 +172,21 @@ export const HelpRequestOption = ({
61
172
  const styles = StyleSheet.create({
62
173
  button: {
63
174
  flexDirection: 'row',
64
- alignItems: 'center',
65
- justifyContent: 'space-between',
66
- width: '100%',
175
+ justifyContent: 'flex-end',
67
176
  },
68
177
  text: {
69
- fontSize: 20,
70
- fontWeight: 400,
178
+ fontSize: 18,
179
+ fontWeight: '400',
71
180
  fontFamily: FONT_FAMILY.buenosAires,
72
181
  color: COLORS.NEUTRAL_10,
182
+
73
183
  },
74
184
  textWrapper: {
75
185
  flex: 1,
76
186
  flexDirection: 'row',
77
187
  alignItems: 'center',
78
188
  justifyContent: 'space-between',
79
- maxWidth: 305,
189
+ minWidth: 163,
80
190
  paddingHorizontal: SPACING[400],
81
191
  paddingVertical: SPACING[200],
82
192
  borderWidth: 1,
@@ -87,5 +197,6 @@ const styles = StyleSheet.create({
87
197
  shadowOpacity: 0.25,
88
198
  shadowRadius: 3,
89
199
  backgroundColor: COLORS.NEUTRAL_1,
200
+ borderColor: COLORS.PRIMARY_BLUE,
90
201
  },
91
202
  })
@@ -0,0 +1,101 @@
1
+ import React from 'react'
2
+ import { Pressable, StyleSheet } from 'react-native'
3
+ import Animated, {
4
+ useSharedValue,
5
+ withTiming,
6
+ useAnimatedStyle,
7
+ interpolateColor,
8
+ } from 'react-native-reanimated'
9
+ import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
10
+
11
+ type HelpRequestOptionProps = {
12
+ onPress: () => void
13
+ disabled: boolean
14
+ hoverColor?: string
15
+ }
16
+
17
+ export const InputButton = ({
18
+ onPress,
19
+ disabled = false,
20
+ hoverColor = COLORS.PRIMARY_BLUE,
21
+ }: HelpRequestOptionProps) => {
22
+ const hoverSv = useSharedValue(0)
23
+
24
+ const onHoverIn = () => {
25
+ if (!disabled) hoverSv.value = withTiming(1, { duration: 200 })
26
+ }
27
+ const onHoverOut = () => {
28
+ if (!disabled) hoverSv.value = withTiming(0, { duration: 200 })
29
+ }
30
+
31
+ // const animatedWrapperStyle = useAnimatedStyle(() => {
32
+ // const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
33
+ // const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
34
+ // const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
35
+ //
36
+ // return {
37
+ // backgroundColor,
38
+ // borderColor,
39
+ // color
40
+ // }
41
+ // }, [hoverSv])
42
+
43
+ const animatedWrapperStyle = useAnimatedStyle(() => {
44
+ const backgroundColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_1, hoverColor])
45
+ const borderColor = interpolateColor(hoverSv.value, [0, 1], [COLORS.PRIMARY_BLUE, hoverColor])
46
+ const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
47
+
48
+ return {
49
+ backgroundColor: disabled ? COLORS.NEUTRAL_2 : backgroundColor, // 👈 dimmed when disabled
50
+ borderColor: disabled ? COLORS.NEUTRAL_5 : borderColor,
51
+ color: disabled ? COLORS.NEUTRAL_5 : color,
52
+ }
53
+ }, [hoverSv, disabled])
54
+
55
+ return (
56
+ <Pressable
57
+ onHoverIn={onHoverIn}
58
+ onHoverOut={onHoverOut}
59
+ onPress={onPress}
60
+ style={[styles.button, disabled && { cursor: 'auto' }]}
61
+ disabled={disabled}
62
+ accessibilityState={{ disabled }}
63
+ accessibilityRole="button"
64
+ >
65
+ <Animated.Text style={[styles.textWrapper, animatedWrapperStyle]}>
66
+ <ArrowUpIcon color={'currentColor'} size={16} />
67
+ </Animated.Text>
68
+ </Pressable>
69
+ )
70
+ }
71
+
72
+ const styles = StyleSheet.create({
73
+ button: {
74
+ flexDirection: 'row',
75
+ justifyContent: 'flex-end',
76
+ },
77
+ text: {
78
+ fontSize: 18,
79
+ fontWeight: '400',
80
+ fontFamily: FONT_FAMILY.buenosAires,
81
+ color: COLORS.NEUTRAL_10,
82
+ backgroundColor: 'purple',
83
+ },
84
+ textWrapper: {
85
+ flex: 1,
86
+ flexDirection: 'row',
87
+ alignItems: 'center',
88
+ justifyContent: 'space-between',
89
+ paddingHorizontal: 13,
90
+ paddingVertical: 12,
91
+ borderWidth: 1,
92
+ borderRadius: 48,
93
+ elevation: 3,
94
+ shadowColor: '#333',
95
+ shadowOffset: { width: 0, height: 1 },
96
+ shadowOpacity: 0.25,
97
+ shadowRadius: 3,
98
+ backgroundColor: COLORS.NEUTRAL_1,
99
+ borderColor: COLORS.PRIMARY_BLUE,
100
+ },
101
+ })
@@ -0,0 +1,157 @@
1
+ import React, { useState } from 'react'
2
+ import { Platform, StyleSheet, TextInput, View } from 'react-native'
3
+ import Animated, {
4
+ useSharedValue,
5
+ withTiming,
6
+ useAnimatedStyle,
7
+ useAnimatedReaction,
8
+ } from 'react-native-reanimated'
9
+ import { COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
10
+ import { HelpRequestOption } from './HelpRequestOption'
11
+ import { InputButton } from './InputButton'
12
+
13
+ const COMPACT_WIDTH = 134
14
+
15
+ type InputWithHintRowProps = {
16
+ onPress: () => void
17
+ message: string
18
+ disabled: boolean
19
+ hoverColor?: string
20
+ }
21
+
22
+ export const InputWithHintRow = ({
23
+ onPress,
24
+ message,
25
+ disabled,
26
+ hoverColor,
27
+ }: InputWithHintRowProps) => {
28
+ const [value, setValue] = useState('')
29
+
30
+ const widthSv = useSharedValue(COMPACT_WIDTH)
31
+ const arrowOpacitySv = useSharedValue(1)
32
+ const hintVisibleSv = useSharedValue(1)
33
+ const valueLengthSv = useSharedValue(0)
34
+
35
+ const shouldDisable = value.trim().length > 0;
36
+
37
+ const animatedInputStyle = useAnimatedStyle(
38
+ () => ({
39
+ width: widthSv.value,
40
+ }),
41
+ [widthSv],
42
+ )
43
+
44
+ const handleChangeText = (text: string) => {
45
+ setValue(text)
46
+ valueLengthSv.value = text.trim().length
47
+ }
48
+
49
+ useAnimatedReaction(
50
+ () => valueLengthSv.value,
51
+ (currentLength) => {
52
+ if (currentLength > 0) {
53
+ widthSv.value = withTiming(305, { duration: 200 })
54
+ arrowOpacitySv.value = withTiming(0, { duration: 200 })
55
+ hintVisibleSv.value = withTiming(0, { duration: 200 })
56
+ } else {
57
+ widthSv.value = withTiming(COMPACT_WIDTH, { duration: 200 })
58
+ arrowOpacitySv.value = withTiming(1, { duration: 200 })
59
+ hintVisibleSv.value = withTiming(1, { duration: 200 })
60
+ }
61
+ },
62
+ [valueLengthSv],
63
+ )
64
+
65
+
66
+ // const handleFocus = () => {
67
+ // widthSv.value = withTiming(305, { duration: 200 }) // expand full width (container limits it)
68
+ // arrowOpacitySv.value = withTiming(0, { duration: 200 })
69
+ // hintVisibleSv.value = withTiming(0, { duration: 200 })
70
+ //
71
+ // // setIsFocused(true)
72
+ // }
73
+ //
74
+ // const handleBlur = () => {
75
+ // if (value.trim().length > 0) return
76
+ // widthSv.value = withTiming(COMPACT_WIDTH, { duration: 200 })
77
+ // arrowOpacitySv.value = withTiming(1, { duration: 200 })
78
+ // hintVisibleSv.value = withTiming(1, { duration: 200 })
79
+ // // setIsFocused(false)
80
+ // }
81
+
82
+ return (
83
+ <View style={styles.container}>
84
+ <Animated.View style={[styles.inputWrapper, animatedInputStyle]}>
85
+ <TextInput
86
+ style={styles.input}
87
+ placeholder="Type..."
88
+ placeholderTextColor={COLORS.NEUTRAL_6}
89
+ value={value}
90
+ onChangeText={handleChangeText}
91
+ // onFocus={handleFocus}
92
+ // onBlur={handleBlur}
93
+ />
94
+ <Animated.View style={[styles.arrowWrapper]}>
95
+ <InputButton
96
+ onPress={() => {
97
+ console.log('Pressed')
98
+ }}
99
+ disabled={value.trim().length < 1}
100
+ />
101
+ </Animated.View>
102
+ </Animated.View>
103
+
104
+ <HelpRequestOption
105
+ visibleSv={hintVisibleSv}
106
+ disabled={disabled || shouldDisable}
107
+ onPress={onPress}
108
+ message={message}
109
+ hoverColor={hoverColor}
110
+ />
111
+ </View>
112
+ )
113
+ }
114
+
115
+ const styles = StyleSheet.create({
116
+ container: {
117
+ position: 'relative', // 👈 allows overlap
118
+ width: '100%',
119
+ alignItems: 'flex-end', // keeps hint button aligned right
120
+ height: 52,
121
+ justifyContent: 'center',
122
+ },
123
+ inputWrapper: {
124
+ position: 'absolute', // 👈 overlap on top
125
+ zIndex: 1,
126
+ right: SPACING[200], // align with hint button
127
+ left: 0,
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ borderWidth: 1,
131
+ borderColor: COLORS.NEUTRAL_5,
132
+ borderRadius: 200,
133
+ backgroundColor: COLORS.NEUTRAL_1,
134
+ paddingHorizontal: SPACING[100],
135
+ paddingVertical: SPACING[100],
136
+ overflow: 'hidden',
137
+ elevation: 3,
138
+ shadowColor: '#333',
139
+ shadowOffset: { width: 0, height: 1 },
140
+ shadowOpacity: 0.25,
141
+ shadowRadius: 3,
142
+ },
143
+ input: {
144
+ flex: 1,
145
+ fontSize: 16,
146
+ minWidth: 60,
147
+ minHeight: 22,
148
+ fontWeight: '400',
149
+ fontFamily: FONT_FAMILY.buenosAires,
150
+ ...(Platform.OS === 'web' && { outlineStyle: 'none' }),
151
+ paddingHorizontal: SPACING[100],
152
+ paddingVertical: SPACING[200],
153
+ },
154
+ arrowWrapper: {
155
+ marginLeft: SPACING[200],
156
+ },
157
+ })
@@ -6,6 +6,7 @@ import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
6
6
  import { ThreeDotsLoader } from '../ThreeDotsLoader/ThreeDotsLoader'
7
7
  import { CONTROLS_COLORS_MAP } from '../../constants'
8
8
  import { ColorScheme } from '../../types/style.types'
9
+ import { LavaIconInGlasses } from '@magmamath/students-features'
9
10
 
10
11
  type MessageLoaderProps = {
11
12
  colorScheme?: ColorScheme
@@ -14,7 +15,7 @@ type MessageLoaderProps = {
14
15
  export const MessageLoader = ({ colorScheme = ColorScheme.Blue }: MessageLoaderProps) => (
15
16
  <View style={styles.container}>
16
17
  <View style={styles.icon}>
17
- <ChatbotIcon width={60} height={80} />
18
+ <LavaIconInGlasses width={60} height={80} />
18
19
  </View>
19
20
  <View style={styles.loader}>
20
21
  <ThreeDotsLoader backgroundColor={CONTROLS_COLORS_MAP[colorScheme].background} />
@@ -27,10 +28,13 @@ const styles = StyleSheet.create({
27
28
  flexDirection: 'row',
28
29
  width: 327,
29
30
  alignItems: 'flex-end',
31
+ paddingLeft:70
30
32
  },
31
33
  icon: {
34
+ position: 'absolute',
35
+ zIndex:1,
32
36
  alignSelf: 'flex-end',
33
- marginRight: 8,
37
+ left: 0
34
38
  },
35
39
  loader: {
36
40
  flex: 1,
@@ -88,7 +88,7 @@ export const ChatbotMessages = ({
88
88
  </View>
89
89
  )}
90
90
 
91
- {!isHelpRequestPending && isOpen && (
91
+ {isOpen && (
92
92
  <Alternatives
93
93
  onPressAlternative={askChatForHelp}
94
94
  hasMessages={messages.length > 1}
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { BaseModal, SPACING } from '@magmamath/react-native-ui'
3
+ import { ExampleSolutionModalContent } from './components/ExampleSolutionModalContent'
4
+ import { ExampleSolutionModalParams } from './types'
5
+
6
+ type ExampleSolutionModalComponentProps = {
7
+ modal: {
8
+ closeModal: () => void
9
+ params: ExampleSolutionModalParams
10
+ }
11
+ }
12
+
13
+ export const ExampleSolutionModal = ({
14
+ modal: { closeModal, params },
15
+ }: ExampleSolutionModalComponentProps) => (
16
+ <BaseModal
17
+ style={{
18
+ container: { paddingHorizontal: SPACING[800] },
19
+ }}
20
+ onClose={closeModal}
21
+ content={
22
+ <ExampleSolutionModalContent
23
+ model={params.model}
24
+ payload={params.payload}
25
+ cacheKey={params.cacheKey}
26
+ />
27
+ }
28
+ />
29
+ )
@@ -0,0 +1,71 @@
1
+ import { StyleSheet, View } from 'react-native'
2
+ import React from 'react'
3
+ import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui'
4
+ import { useUnit } from 'effector-react'
5
+ import { $localization } from '../../../shared/translation'
6
+ import { MessageBlock } from './MessageBlock'
7
+ import { LavaIcon } from './LavaIcon'
8
+ import { ExampleSolutionModalParams } from '../types'
9
+ import { QuestionSection } from './QuestionSection'
10
+ import { SolutionSection } from './SolutionSection'
11
+ import { useExampleSolution } from '../hooks/useExampleSolution'
12
+
13
+ export const ExampleSolutionModalContent = ({
14
+ model,
15
+ payload,
16
+ cacheKey,
17
+ }: ExampleSolutionModalParams) => {
18
+ const { result, status } = useExampleSolution({ model, payload, cacheKey })
19
+ const localization = useUnit($localization)
20
+
21
+ return (
22
+ <View style={styles.container}>
23
+ <Typography align="center" variant={HeadingVariants.H2} style={{ color: COLORS.NEUTRAL_9 }}>
24
+ {localization.exampleSolution.exampleSolution}
25
+ </Typography>
26
+ <View style={styles.content}>
27
+ <QuestionSection status={status} question={result?.question} />
28
+ <SolutionSection status={status} answer={result?.answer} />
29
+ </View>
30
+ <MessageBlock status={status} style={styles.messageBlock} />
31
+ <LavaIcon status={status} style={styles.lavaIconContainer} />
32
+ </View>
33
+ )
34
+ }
35
+
36
+ const styles = StyleSheet.create({
37
+ container: {
38
+ width: 880,
39
+ height: 593,
40
+ },
41
+ content: {
42
+ flex: 1,
43
+ flexDirection: 'row',
44
+ marginTop: SPACING[400],
45
+ gap: SPACING[400],
46
+ },
47
+ solutionContainer: {
48
+ width: 351,
49
+ overflow: 'hidden',
50
+ borderRadius: 8,
51
+ borderWidth: 1,
52
+ borderColor: COLORS.NEUTRAL_5,
53
+ },
54
+ lavaIconContainer: {
55
+ position: 'absolute',
56
+ bottom: -54,
57
+ right: -50,
58
+ },
59
+ loaderContainer: {
60
+ paddingTop: 34,
61
+ position: 'absolute',
62
+ width: '100%',
63
+ height: '100%',
64
+ backgroundColor: COLORS.NEUTRAL_1,
65
+ },
66
+ messageBlock: {
67
+ position: 'absolute',
68
+ right: 38,
69
+ bottom: -22,
70
+ },
71
+ })
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import { ExcitedLavaIcon } from '../../../shared/icons/ExcitedLavaIcon'
3
+ import { LavaIconInGlasses } from '../../../shared/icons'
4
+ import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated'
5
+ import { StyleProp, ViewStyle } from 'react-native'
6
+ import { ExampleSolutionStatuses } from '../constants'
7
+
8
+ const LAVA_ICON_HEIGHT = 112
9
+
10
+ type LavaIconProps = {
11
+ status: ExampleSolutionStatuses
12
+ style?: StyleProp<ViewStyle>
13
+ }
14
+
15
+ export const LavaIcon = ({ status, style }: LavaIconProps) => {
16
+ const opacityAnimation = useAnimatedStyle(() => {
17
+ return {
18
+ opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, { duration: 500 }),
19
+ }
20
+ }, [status])
21
+
22
+ return (
23
+ <>
24
+ <Animated.View style={[style, opacityAnimation]}>
25
+ <LavaIconInGlasses height={112} />
26
+ </Animated.View>
27
+
28
+ {status !== ExampleSolutionStatuses.LOADING && (
29
+ <Animated.View style={style} entering={FadeIn}>
30
+ <ExcitedLavaIcon height={LAVA_ICON_HEIGHT} />
31
+ </Animated.View>
32
+ )}
33
+ </>
34
+ )
35
+ }