@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.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 (376) hide show
  1. package/.claude-flow/data/pending-insights.jsonl +43 -0
  2. package/.claude-flow/sessions/session-1794323376548.json +14 -0
  3. package/CHANGELOG.md +31 -0
  4. package/jest.config.cjs +22 -0
  5. package/lib/assets/home/loop-day.jpg +0 -0
  6. package/lib/assets/home/loop-day.mp4 +0 -0
  7. package/lib/assets/home/loop-time-back.jpg +0 -0
  8. package/lib/assets/home/loop-time-back.mp4 +0 -0
  9. package/lib/assets/home/loop-where.jpg +0 -0
  10. package/lib/assets/home/loop-where.mp4 +0 -0
  11. package/lib/assets/home/reel-gym.jpg +0 -0
  12. package/lib/assets/home/reel-gym.mp4 +0 -0
  13. package/lib/assets/home/reel-internet.jpg +0 -0
  14. package/lib/assets/home/reel-internet.mp4 +0 -0
  15. package/lib/assets/icon.png +0 -0
  16. package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  17. package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
  18. package/lib/assets/lottie/lucy-mark-call.json +1470 -0
  19. package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
  20. package/lib/assets/lottie/lucy-mark-details.json +1735 -0
  21. package/lib/assets/lottie/lucy-mark-email.json +1363 -0
  22. package/lib/assets/lottie/lucy-mark-message.json +1154 -0
  23. package/lib/assets/lottie/lucy-mark-search.json +1067 -0
  24. package/lib/assets/lottie/lucy-mark-think.json +1253 -0
  25. package/lib/assets/lottie/lucy-mark-write.json +1532 -0
  26. package/lib/assets/lottie/time-back.json +16458 -0
  27. package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
  28. package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
  29. package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  30. package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  31. package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  32. package/lib/assets/sounds/hours-back.m4a +0 -0
  33. package/lib/assets/sounds/meet-lucy.m4a +0 -0
  34. package/lib/assets/sounds/power-on.m4a +0 -0
  35. package/lib/assets/sounds/wind-back.m4a +0 -0
  36. package/lib/assets/sounds/youre-in.m4a +0 -0
  37. package/lib/chat/agent.js +358 -0
  38. package/lib/chat/agent.js.map +1 -0
  39. package/lib/chat/appFront.js +32 -0
  40. package/lib/chat/appFront.js.map +1 -0
  41. package/lib/chat/auth.js +370 -0
  42. package/lib/chat/auth.js.map +1 -0
  43. package/lib/chat/chores.js +360 -0
  44. package/lib/chat/chores.js.map +1 -0
  45. package/lib/chat/connectors.js +42 -0
  46. package/lib/chat/connectors.js.map +1 -0
  47. package/lib/chat/jobs.js +223 -0
  48. package/lib/chat/jobs.js.map +1 -0
  49. package/lib/chat/lucyMotion.js +6 -0
  50. package/lib/chat/lucyMotion.js.map +1 -0
  51. package/lib/chat/protocol.js +111 -0
  52. package/lib/chat/protocol.js.map +1 -0
  53. package/lib/chat/results.js +133 -0
  54. package/lib/chat/results.js.map +1 -0
  55. package/lib/chat/store.js +81 -0
  56. package/lib/chat/store.js.map +1 -0
  57. package/lib/chat/useDictation.js +168 -0
  58. package/lib/chat/useDictation.js.map +1 -0
  59. package/lib/chat/useLucyChat.js +451 -0
  60. package/lib/chat/useLucyChat.js.map +1 -0
  61. package/lib/chat/useMyComputer.js +32 -0
  62. package/lib/chat/useMyComputer.js.map +1 -0
  63. package/lib/chat/whereLucyWorks.js +52 -0
  64. package/lib/chat/whereLucyWorks.js.map +1 -0
  65. package/lib/chat/workspace.js +124 -0
  66. package/lib/chat/workspace.js.map +1 -0
  67. package/lib/components/AreaShot.js +289 -0
  68. package/lib/components/AreaShot.js.map +1 -0
  69. package/lib/components/Backdrops.js +262 -0
  70. package/lib/components/Backdrops.js.map +1 -0
  71. package/lib/components/BottomSheet.js +61 -0
  72. package/lib/components/BottomSheet.js.map +1 -0
  73. package/lib/components/ChatSheets.js +429 -0
  74. package/lib/components/ChatSheets.js.map +1 -0
  75. package/lib/components/ConnectorLogo.js +91 -0
  76. package/lib/components/ConnectorLogo.js.map +1 -0
  77. package/lib/components/CustomDrawer.js +534 -0
  78. package/lib/components/CustomDrawer.js.map +1 -0
  79. package/lib/components/IdeasPane.js +394 -0
  80. package/lib/components/IdeasPane.js.map +1 -0
  81. package/lib/components/ImessageSheet.js +261 -0
  82. package/lib/components/ImessageSheet.js.map +1 -0
  83. package/lib/components/KeyboardAvoider.js +29 -0
  84. package/lib/components/KeyboardAvoider.js.map +1 -0
  85. package/lib/components/Logo.js +81 -0
  86. package/lib/components/Logo.js.map +1 -0
  87. package/lib/components/LucyWorking.js +67 -0
  88. package/lib/components/LucyWorking.js.map +1 -0
  89. package/lib/components/Markdown.js +260 -0
  90. package/lib/components/Markdown.js.map +1 -0
  91. package/lib/components/Media.js +93 -0
  92. package/lib/components/Media.js.map +1 -0
  93. package/lib/components/MessagesAppIcon.js +23 -0
  94. package/lib/components/MessagesAppIcon.js.map +1 -0
  95. package/lib/components/MicButton.js +71 -0
  96. package/lib/components/MicButton.js.map +1 -0
  97. package/lib/components/ResultCards.js +974 -0
  98. package/lib/components/ResultCards.js.map +1 -0
  99. package/lib/components/SignInPrompt.js +148 -0
  100. package/lib/components/SignInPrompt.js.map +1 -0
  101. package/lib/components/SignedOut.js +38 -0
  102. package/lib/components/SignedOut.js.map +1 -0
  103. package/lib/components/TalkToLucyHero.js +487 -0
  104. package/lib/components/TalkToLucyHero.js.map +1 -0
  105. package/lib/components/TalkToLucySheet.js +182 -0
  106. package/lib/components/TalkToLucySheet.js.map +1 -0
  107. package/lib/components/WhereLucyWorks.js +277 -0
  108. package/lib/components/WhereLucyWorks.js.map +1 -0
  109. package/lib/components/WorkspaceSection.js +271 -0
  110. package/lib/components/WorkspaceSection.js.map +1 -0
  111. package/lib/components/YantraMark.js +13 -0
  112. package/lib/components/YantraMark.js.map +1 -0
  113. package/lib/components/drawerHeader.js +38 -0
  114. package/lib/components/drawerHeader.js.map +1 -0
  115. package/lib/components/lottieInstalled.js +6 -0
  116. package/lib/components/lottieInstalled.js.map +1 -0
  117. package/lib/components/ui.js +550 -0
  118. package/lib/components/ui.js.map +1 -0
  119. package/lib/components/useSignOut.js +7 -0
  120. package/lib/components/useSignOut.js.map +1 -0
  121. package/lib/components/viewport.js +121 -0
  122. package/lib/components/viewport.js.map +1 -0
  123. package/lib/components/voiceDial.js +10 -0
  124. package/lib/components/voiceDial.js.map +1 -0
  125. package/lib/compute.js +157 -0
  126. package/lib/compute.js.map +1 -0
  127. package/lib/config/env-config.js +21 -0
  128. package/lib/config/env-config.js.map +1 -0
  129. package/lib/config/routes.js +15 -0
  130. package/lib/config/routes.js.map +1 -0
  131. package/lib/content.js +25 -0
  132. package/lib/content.js.map +1 -0
  133. package/lib/hooks/keyboardCover.js +39 -0
  134. package/lib/hooks/keyboardCover.js.map +1 -0
  135. package/lib/hooks/useKeyboard.js +121 -0
  136. package/lib/hooks/useKeyboard.js.map +1 -0
  137. package/lib/hooks/useReducedMotion.js +13 -0
  138. package/lib/hooks/useReducedMotion.js.map +1 -0
  139. package/lib/imessage/openMessages.js +25 -0
  140. package/lib/imessage/openMessages.js.map +1 -0
  141. package/lib/imessage/platform.js +12 -0
  142. package/lib/imessage/platform.js.map +1 -0
  143. package/lib/imessage/textLink.js +262 -0
  144. package/lib/imessage/textLink.js.map +1 -0
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -0
  147. package/lib/live/card.js +28 -0
  148. package/lib/live/card.js.map +1 -0
  149. package/lib/live/liveActivity.js +144 -0
  150. package/lib/live/liveActivity.js.map +1 -0
  151. package/lib/module.js +3 -0
  152. package/lib/module.js.map +1 -0
  153. package/lib/offer/BlackFridayOffer.js +378 -0
  154. package/lib/offer/BlackFridayOffer.js.map +1 -0
  155. package/lib/offer/blackFriday.js +78 -0
  156. package/lib/offer/blackFriday.js.map +1 -0
  157. package/lib/offer/parts.js +624 -0
  158. package/lib/offer/parts.js.map +1 -0
  159. package/lib/offer/state.js +63 -0
  160. package/lib/offer/state.js.map +1 -0
  161. package/lib/push/push.js +142 -0
  162. package/lib/push/push.js.map +1 -0
  163. package/lib/push/usePushNotifications.js +39 -0
  164. package/lib/push/usePushNotifications.js.map +1 -0
  165. package/lib/routes.json +175 -0
  166. package/lib/screens/Account/index.js +209 -0
  167. package/lib/screens/Account/index.js.map +1 -0
  168. package/lib/screens/Chat/index.js +710 -0
  169. package/lib/screens/Chat/index.js.map +1 -0
  170. package/lib/screens/Chores/index.js +18 -0
  171. package/lib/screens/Chores/index.js.map +1 -0
  172. package/lib/screens/Connectors/index.js +17 -0
  173. package/lib/screens/Connectors/index.js.map +1 -0
  174. package/lib/screens/History/index.js +380 -0
  175. package/lib/screens/History/index.js.map +1 -0
  176. package/lib/screens/Home/index.js +2711 -0
  177. package/lib/screens/Home/index.js.map +1 -0
  178. package/lib/screens/Home/media.js +25 -0
  179. package/lib/screens/Home/media.js.map +1 -0
  180. package/lib/screens/Welcome/index.js +1066 -0
  181. package/lib/screens/Welcome/index.js.map +1 -0
  182. package/lib/talk/talkToLucy.js +139 -0
  183. package/lib/talk/talkToLucy.js.map +1 -0
  184. package/lib/theme/colors.js +29 -0
  185. package/lib/theme/colors.js.map +1 -0
  186. package/lib/theme/fonts.js +17 -0
  187. package/lib/theme/fonts.js.map +1 -0
  188. package/lib/theme/muse.js +134 -0
  189. package/lib/theme/muse.js.map +1 -0
  190. package/lib/utils/links.js +54 -0
  191. package/lib/utils/links.js.map +1 -0
  192. package/lib/utils/yantraLinks.js +68 -0
  193. package/lib/utils/yantraLinks.js.map +1 -0
  194. package/lib/welcome/flow.js +375 -0
  195. package/lib/welcome/flow.js.map +1 -0
  196. package/lib/welcome/haptics.js +125 -0
  197. package/lib/welcome/haptics.js.map +1 -0
  198. package/lib/welcome/parts.js +1996 -0
  199. package/lib/welcome/parts.js.map +1 -0
  200. package/lib/welcome/powerOn.js +29 -0
  201. package/lib/welcome/powerOn.js.map +1 -0
  202. package/lib/welcome/seen.js +41 -0
  203. package/lib/welcome/seen.js.map +1 -0
  204. package/lib/welcome/sound.js +110 -0
  205. package/lib/welcome/sound.js.map +1 -0
  206. package/package.json +66 -5
  207. package/rollup.config.mjs +42 -0
  208. package/src/.claude-flow/data/pending-insights.jsonl +19 -0
  209. package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
  210. package/src/__tests__/auth.test.ts +94 -0
  211. package/src/__tests__/blackFriday.test.ts +75 -0
  212. package/src/__tests__/cardTokens.test.ts +77 -0
  213. package/src/__tests__/chores.test.ts +179 -0
  214. package/src/__tests__/choresList.test.ts +100 -0
  215. package/src/__tests__/content.test.ts +54 -0
  216. package/src/__tests__/dictation.test.ts +186 -0
  217. package/src/__tests__/haptics.test.ts +202 -0
  218. package/src/__tests__/jobs.test.ts +130 -0
  219. package/src/__tests__/keyboardCover.test.ts +84 -0
  220. package/src/__tests__/liveCard.test.ts +39 -0
  221. package/src/__tests__/lockedPhone.test.ts +355 -0
  222. package/src/__tests__/lucyMotion.test.ts +34 -0
  223. package/src/__tests__/platform.test.ts +32 -0
  224. package/src/__tests__/powerOn.test.ts +62 -0
  225. package/src/__tests__/protocol.test.ts +125 -0
  226. package/src/__tests__/push.test.ts +111 -0
  227. package/src/__tests__/results.test.ts +256 -0
  228. package/src/__tests__/sound.test.ts +248 -0
  229. package/src/__tests__/talkToLucy.test.ts +205 -0
  230. package/src/__tests__/textLink.test.ts +91 -0
  231. package/src/__tests__/voiceDial.test.ts +53 -0
  232. package/src/__tests__/welcomeFlow.test.ts +157 -0
  233. package/src/__tests__/whereLucyWorks.test.ts +81 -0
  234. package/src/__tests__/yantraLinks.test.ts +96 -0
  235. package/src/assets/home/loop-day.jpg +0 -0
  236. package/src/assets/home/loop-day.mp4 +0 -0
  237. package/src/assets/home/loop-time-back.jpg +0 -0
  238. package/src/assets/home/loop-time-back.mp4 +0 -0
  239. package/src/assets/home/loop-where.jpg +0 -0
  240. package/src/assets/home/loop-where.mp4 +0 -0
  241. package/src/assets/home/reel-gym.jpg +0 -0
  242. package/src/assets/home/reel-gym.mp4 +0 -0
  243. package/src/assets/home/reel-internet.jpg +0 -0
  244. package/src/assets/home/reel-internet.mp4 +0 -0
  245. package/src/assets/icon.png +0 -0
  246. package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  247. package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
  248. package/src/assets/lottie/lucy-mark-call.json +1470 -0
  249. package/src/assets/lottie/lucy-mark-connect.json +2552 -0
  250. package/src/assets/lottie/lucy-mark-details.json +1735 -0
  251. package/src/assets/lottie/lucy-mark-email.json +1363 -0
  252. package/src/assets/lottie/lucy-mark-message.json +1154 -0
  253. package/src/assets/lottie/lucy-mark-search.json +1067 -0
  254. package/src/assets/lottie/lucy-mark-think.json +1253 -0
  255. package/src/assets/lottie/lucy-mark-write.json +1532 -0
  256. package/src/assets/lottie/time-back.json +16458 -0
  257. package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
  258. package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
  259. package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  260. package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  261. package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  262. package/src/assets/sounds/hours-back.m4a +0 -0
  263. package/src/assets/sounds/meet-lucy.m4a +0 -0
  264. package/src/assets/sounds/power-on.m4a +0 -0
  265. package/src/assets/sounds/wind-back.m4a +0 -0
  266. package/src/assets/sounds/youre-in.m4a +0 -0
  267. package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
  268. package/src/chat/agent.ts +376 -0
  269. package/src/chat/appFront.ts +39 -0
  270. package/src/chat/auth.ts +433 -0
  271. package/src/chat/chores.ts +394 -0
  272. package/src/chat/connectors.ts +65 -0
  273. package/src/chat/jobs.ts +228 -0
  274. package/src/chat/lucyMotion.ts +33 -0
  275. package/src/chat/protocol.ts +192 -0
  276. package/src/chat/results.ts +224 -0
  277. package/src/chat/store.ts +87 -0
  278. package/src/chat/useDictation.ts +201 -0
  279. package/src/chat/useLucyChat.ts +458 -0
  280. package/src/chat/useMyComputer.ts +41 -0
  281. package/src/chat/whereLucyWorks.ts +97 -0
  282. package/src/chat/workspace.ts +127 -0
  283. package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
  284. package/src/components/AreaShot.tsx +239 -0
  285. package/src/components/Backdrops.tsx +323 -0
  286. package/src/components/BottomSheet.tsx +96 -0
  287. package/src/components/ChatSheets.tsx +565 -0
  288. package/src/components/ConnectorLogo.tsx +116 -0
  289. package/src/components/CustomDrawer.tsx +526 -0
  290. package/src/components/IdeasPane.tsx +318 -0
  291. package/src/components/ImessageSheet.tsx +280 -0
  292. package/src/components/KeyboardAvoider.tsx +45 -0
  293. package/src/components/Logo.tsx +97 -0
  294. package/src/components/LucyWorking.tsx +122 -0
  295. package/src/components/Markdown.tsx +219 -0
  296. package/src/components/Media.tsx +173 -0
  297. package/src/components/MessagesAppIcon.tsx +51 -0
  298. package/src/components/MicButton.tsx +92 -0
  299. package/src/components/ResultCards.tsx +1067 -0
  300. package/src/components/SignInPrompt.tsx +182 -0
  301. package/src/components/SignedOut.tsx +47 -0
  302. package/src/components/TalkToLucyHero.tsx +540 -0
  303. package/src/components/TalkToLucySheet.tsx +208 -0
  304. package/src/components/VoiceOrb.tsx +364 -0
  305. package/src/components/WhereLucyWorks.tsx +261 -0
  306. package/src/components/WorkspaceSection.tsx +307 -0
  307. package/src/components/YantraMark.tsx +30 -0
  308. package/src/components/drawerHeader.tsx +46 -0
  309. package/src/components/kit.tsx +309 -0
  310. package/src/components/lottieInstalled.ts +7 -0
  311. package/src/components/ui.tsx +700 -0
  312. package/src/components/useSignOut.ts +21 -0
  313. package/src/components/viewport.tsx +166 -0
  314. package/src/components/voiceDial.ts +45 -0
  315. package/src/compute.ts +168 -0
  316. package/src/config/env-config.ts +37 -0
  317. package/src/config/routes.ts +28 -0
  318. package/src/content.ts +217 -0
  319. package/src/hooks/keyboardCover.ts +70 -0
  320. package/src/hooks/useKeyboard.ts +135 -0
  321. package/src/hooks/useReducedMotion.ts +19 -0
  322. package/src/imessage/openMessages.ts +53 -0
  323. package/src/imessage/platform.ts +32 -0
  324. package/src/imessage/textLink.ts +307 -0
  325. package/src/index.ts +24 -0
  326. package/src/live/card.ts +62 -0
  327. package/src/live/liveActivity.ts +192 -0
  328. package/src/module.ts +8 -0
  329. package/src/offer/BlackFridayOffer.tsx +394 -0
  330. package/src/offer/blackFriday.ts +109 -0
  331. package/src/offer/parts.tsx +650 -0
  332. package/src/offer/state.ts +78 -0
  333. package/src/push/push.ts +171 -0
  334. package/src/push/usePushNotifications.ts +47 -0
  335. package/src/screens/Account/index.tsx +310 -0
  336. package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
  337. package/src/screens/Chat/index.tsx +891 -0
  338. package/src/screens/Chores/index.tsx +35 -0
  339. package/src/screens/Connectors/index.tsx +35 -0
  340. package/src/screens/History/index.tsx +346 -0
  341. package/src/screens/Home/index.tsx +2773 -0
  342. package/src/screens/Home/media.ts +31 -0
  343. package/src/screens/Welcome/index.tsx +1182 -0
  344. package/src/talk/talkToLucy.ts +187 -0
  345. package/src/theme/colors.ts +38 -0
  346. package/src/theme/fonts.ts +30 -0
  347. package/src/theme/muse.ts +86 -0
  348. package/src/utils/links.ts +84 -0
  349. package/src/utils/yantraLinks.ts +94 -0
  350. package/src/welcome/flow.ts +418 -0
  351. package/src/welcome/haptics.ts +179 -0
  352. package/src/welcome/parts.tsx +2160 -0
  353. package/src/welcome/powerOn.ts +84 -0
  354. package/src/welcome/seen.ts +68 -0
  355. package/src/welcome/sound.ts +173 -0
  356. package/tools/lottie/chat.motion +0 -0
  357. package/tools/lottie/cloud.motion +0 -0
  358. package/tools/lottie/generate.mjs +1209 -0
  359. package/tools/lottie/inter-glyphs.json +4416 -0
  360. package/tools/lottie/lucy-mark-calendar.motion +0 -0
  361. package/tools/lottie/lucy-mark-call.motion +0 -0
  362. package/tools/lottie/lucy-mark-connect.motion +0 -0
  363. package/tools/lottie/lucy-mark-details.motion +0 -0
  364. package/tools/lottie/lucy-mark-email.motion +0 -0
  365. package/tools/lottie/lucy-mark-message.motion +0 -0
  366. package/tools/lottie/lucy-mark-search.motion +0 -0
  367. package/tools/lottie/lucy-mark-think.motion +0 -0
  368. package/tools/lottie/lucy-mark-write.motion +0 -0
  369. package/tools/lottie/mark.json +1 -0
  370. package/tools/lottie/mine-none.motion +0 -0
  371. package/tools/lottie/mine-offline.motion +0 -0
  372. package/tools/lottie/mine-online.motion +0 -0
  373. package/tools/lottie/time-back.mjs +604 -0
  374. package/tools/sounds/render.mjs +730 -0
  375. package/tsconfig.json +17 -0
  376. package/README.md +0 -3
@@ -0,0 +1,62 @@
1
+ /**
2
+ * What a Live Activity card says for one of Lucy's chores (live/liveActivity.ts shows it). Pure, so it is tested
3
+ * without a phone. CardState is the card's ContentState (portable-devices/mobile/targets/lucy-live) and what Yantra's
4
+ * pushes send as `content-state` (that folder's README.md): keep the three the same.
5
+ */
6
+ export type CardKind = 'call' | 'shop' | 'general';
7
+ export type CardPhase = 'working' | 'asking' | 'done' | 'failed';
8
+
9
+ export interface CardState {
10
+ kind: CardKind;
11
+ phase: CardPhase;
12
+ /** The line under the title: what Lucy is doing now, her question, or how it ended. */
13
+ detail: string;
14
+ /** Unix seconds the timer counts from: the call's start on a call, else the chore's. */
15
+ startedAt?: number;
16
+ /** Picks so far, while shopping. */
17
+ count?: number;
18
+ /** Minutes Lucy spent on it, once done. */
19
+ minutesBack?: number;
20
+ }
21
+
22
+ const ASKS_CALL = /\b(call|phone|ring|dial)\b/i;
23
+ const IN_A_CALL = /\b(making a call|calling|on the line|ringing|on hold)\b/i;
24
+ const ASKS_SHOP = /\b(buy|order|shop|shopping|find me|cheapest|price|deal)\b/i;
25
+
26
+ /** The kind of chore, from what was asked or what Lucy says she is doing. A call stays a call. */
27
+ export function cardKind(text: string, current: CardKind = 'general'): CardKind {
28
+ if (current === 'call' || ASKS_CALL.test(text) || IN_A_CALL.test(text)) return 'call';
29
+ if (current === 'shop' || ASKS_SHOP.test(text)) return 'shop';
30
+ return current;
31
+ }
32
+
33
+ /** Whether a status line is the call itself starting: then the card's timer counts from now. */
34
+ export function callStarts(status: string): boolean {
35
+ return IN_A_CALL.test(status);
36
+ }
37
+
38
+ /** The card's title: the chore as asked, on one line. */
39
+ export function cardTitle(prompt: string): string {
40
+ const t = prompt.replace(/\s+/g, ' ').trim();
41
+ if (!t) return 'A chore for Lucy';
42
+ return t.length > 44 ? `${t.slice(0, 43).trimEnd()}…` : t;
43
+ }
44
+
45
+ /** A finished card's line: the first sentence of Lucy's last reply, without its question card or markup. */
46
+ export function cardSummary(reply: string): string {
47
+ const plain = reply
48
+ .replace(/\[ASK_USER\][\s\S]*?(?:\[\/ASK_USER\]|$)/g, '')
49
+ .replace(/```[\s\S]*?(?:```|$)/g, '')
50
+ .replace(/\[\[surface:[^|\]]+\|([^\]]+)\]\]/g, '$1')
51
+ .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
52
+ .replace(/[*_#>`]/g, '')
53
+ .replace(/\s+/g, ' ')
54
+ .trim();
55
+ const first = /^(.+?[.!?])(\s|$)/.exec(plain)?.[1] ?? plain;
56
+ return first.length > 80 ? `${first.slice(0, 79).trimEnd()}…` : first;
57
+ }
58
+
59
+ /** Minutes Lucy spent, at least one. */
60
+ export function minutesSpent(fromSeconds: number, nowSeconds: number): number {
61
+ return Math.max(1, Math.round((nowSeconds - fromSeconds) / 60));
62
+ }
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Lucy's chores on the Lock Screen and in the Dynamic Island (iOS Live Activities). The host app draws them
3
+ * (portable-devices/mobile/targets/lucy-live) and runs them through its LucyLiveActivity module
4
+ * (portable-devices/mobile/modules/lucy-live-activity); this file decides when a card starts, moves and ends, and
5
+ * card.ts what it says. Without the module (Android, web, Expo Go, a build from before it) every call does nothing.
6
+ *
7
+ * A card follows a chore by its id (the chat's chore), so the reply, the answer to Lucy's question and the end all land
8
+ * on the same card. While the app is open the chat stream moves it (chat/useLucyChat.ts). While the app is closed Yantra
9
+ * moves it: each chore's record carries its card's token (cardTokenFor, chat/jobs.ts), and the agent's reports on that
10
+ * record are pushed to the card (adminIde project-mgmt SurfaceJobNotifier; that README.md).
11
+ */
12
+ import AsyncStorage from '@react-native-async-storage/async-storage';
13
+ import { Platform } from 'react-native';
14
+ import { requireOptionalNativeModule } from 'expo-modules-core';
15
+ import { callStarts, cardKind, cardSummary, cardTitle, minutesSpent, type CardState } from './card';
16
+
17
+ interface LucyLiveActivityModule {
18
+ areEnabled(): boolean;
19
+ start(choreId: string, title: string, state: CardState): Promise<string | null>;
20
+ update(choreId: string, state: CardState): Promise<void>;
21
+ end(choreId: string, state: CardState | null, dismissAfterSeconds: number): Promise<void>;
22
+ addListener(event: 'onPushToken', listener: (e: { choreId: string; token: string }) => void): { remove(): void };
23
+ addListener(event: 'onPushToStartToken', listener: (e: { token: string }) => void): { remove(): void };
24
+ }
25
+
26
+ const native = Platform.OS === 'ios' ? requireOptionalNativeModule<LucyLiveActivityModule>('LucyLiveActivity') : null;
27
+
28
+ /** How long a finished card stays on the Lock Screen. */
29
+ const DONE_SHOWN_S = 15 * 60;
30
+ const FAILED_SHOWN_S = 30 * 60;
31
+ /** A chore over this fast was a quick answer, read in the app: its card goes at once (as chores.ts QUICK_ANSWER_MS). */
32
+ const QUICK_S = 20;
33
+
34
+ interface Card {
35
+ title: string;
36
+ state: CardState;
37
+ /** Unix seconds the chore started, and the call within it. */
38
+ began: number;
39
+ callAt?: number;
40
+ }
41
+
42
+ const cards = new Map<string, Card>();
43
+ const nowS = () => Date.now() / 1000;
44
+
45
+ function enabled(): boolean {
46
+ try {
47
+ return Boolean(native?.areEnabled());
48
+ } catch {
49
+ return false;
50
+ }
51
+ }
52
+
53
+ function show(choreId: string, card: Card): void {
54
+ native?.update(choreId, card.state).catch(() => undefined);
55
+ }
56
+
57
+ /** A chore starts: its card goes up. (ActivityKit starts cards only while the app is in front, as it is here.) */
58
+ export function startChoreCard(choreId: string, prompt: string): void {
59
+ if (!native || cards.has(choreId) || !enabled()) return;
60
+ const began = nowS();
61
+ const card: Card = {
62
+ title: cardTitle(prompt),
63
+ began,
64
+ state: { kind: cardKind(prompt), phase: 'working', detail: 'Getting started', startedAt: began },
65
+ };
66
+ cards.set(choreId, card);
67
+ native.start(choreId, card.title, card.state).catch(() => cards.delete(choreId));
68
+ }
69
+
70
+ /** What Lucy says she is doing now. The call starting restarts the timer, so it shows the call's own length. */
71
+ export function choreCardStatus(choreId: string, status: string): void {
72
+ const card = cards.get(choreId);
73
+ const line = status.trim();
74
+ if (!card || !line || line === card.state.detail) return;
75
+ if (card.callAt === undefined && callStarts(line)) card.callAt = nowS();
76
+ card.state = {
77
+ ...card.state,
78
+ kind: cardKind(line, card.state.kind),
79
+ phase: 'working',
80
+ detail: line,
81
+ startedAt: card.callAt ?? card.began,
82
+ };
83
+ show(choreId, card);
84
+ }
85
+
86
+ /** Lucy asks something: the card says so until she has her answer. */
87
+ export function choreCardAsks(choreId: string, question: string): void {
88
+ const card = cards.get(choreId);
89
+ if (!card || card.state.phase === 'asking') return;
90
+ card.state = { ...card.state, phase: 'asking', detail: question };
91
+ show(choreId, card);
92
+ }
93
+
94
+ /** Her answer is in: back to work. */
95
+ export function choreCardResumes(choreId: string): void {
96
+ const card = cards.get(choreId);
97
+ if (!card) return;
98
+ card.state = { ...card.state, phase: 'working', detail: 'Back on it' };
99
+ show(choreId, card);
100
+ }
101
+
102
+ /** The chore ends: done (with the time Lucy spent), failed, or stopped (gone at once). */
103
+ export function endChoreCard(choreId: string, outcome: 'done' | 'failed' | 'stopped', reply = ''): void {
104
+ const card = cards.get(choreId);
105
+ if (!card || !native) return;
106
+ cards.delete(choreId);
107
+ if (outcome === 'stopped') {
108
+ native.end(choreId, null, 0).catch(() => undefined);
109
+ return;
110
+ }
111
+ const now = nowS();
112
+ const state: CardState =
113
+ outcome === 'done'
114
+ ? {
115
+ ...card.state,
116
+ phase: 'done',
117
+ detail: cardSummary(reply) || 'All done',
118
+ minutesBack: minutesSpent(card.began, now),
119
+ }
120
+ : { ...card.state, phase: 'failed', detail: 'Open Clockbook to see what happened' };
121
+ const shown = now - card.began < QUICK_S ? 0 : outcome === 'done' ? DONE_SHOWN_S : FAILED_SHOWN_S;
122
+ native.end(choreId, state, shown).catch(() => undefined);
123
+ }
124
+
125
+ export type CardToken = { kind: 'card'; choreId: string; token: string } | { kind: 'start'; token: string };
126
+
127
+ /**
128
+ * Each card's push token, by chore: Yantra moves the card with it while the app is closed (chat/jobs.ts puts it on the
129
+ * chore's record). Kept on the phone, since a card outlives the app's run (an answer to Lucy's question goes on the
130
+ * card started before), and iOS reports a card's token only when it is started.
131
+ */
132
+ const CARD_TOKENS_KEY = 'clockbook.lucy.cardTokens';
133
+ const MAX_CARD_TOKENS = 30;
134
+ let cardTokens: Map<string, string> | null = null;
135
+ const cardTokenListeners = new Set<(choreId: string, token: string) => void>();
136
+
137
+ async function loadCardTokens(): Promise<Map<string, string>> {
138
+ if (cardTokens) return cardTokens;
139
+ let saved: [string, string][] = [];
140
+ try {
141
+ const raw = await AsyncStorage.getItem(CARD_TOKENS_KEY);
142
+ if (raw) saved = JSON.parse(raw) as [string, string][];
143
+ } catch {
144
+ // none kept
145
+ }
146
+ // A token reported while this was read is newer: it stays.
147
+ cardTokens = new Map([...(Array.isArray(saved) ? saved : []), ...(cardTokens ?? [])]);
148
+ return cardTokens;
149
+ }
150
+
151
+ function keepCardToken(choreId: string, token: string): void {
152
+ const tokens = cardTokens ?? new Map<string, string>();
153
+ cardTokens = tokens;
154
+ tokens.delete(choreId);
155
+ tokens.set(choreId, token);
156
+ while (tokens.size > MAX_CARD_TOKENS) tokens.delete(tokens.keys().next().value as string);
157
+ AsyncStorage.setItem(CARD_TOKENS_KEY, JSON.stringify([...tokens])).catch(() => undefined);
158
+ cardTokenListeners.forEach((l) => l(choreId, token));
159
+ }
160
+
161
+ /** The push token of a chore's card, when it has one. */
162
+ export async function cardTokenFor(choreId: string): Promise<string | undefined> {
163
+ return (await loadCardTokens()).get(choreId);
164
+ }
165
+
166
+ /** Told each time a card reports a (new) token. */
167
+ export function onCardToken(listener: (choreId: string, token: string) => void): () => void {
168
+ cardTokenListeners.add(listener);
169
+ return () => cardTokenListeners.delete(listener);
170
+ }
171
+
172
+ // From the app's start: a card reports its token once, a moment after it goes up.
173
+ native?.addListener('onPushToken', (e: { choreId: string; token: string }) => keepCardToken(e.choreId, e.token));
174
+
175
+ /**
176
+ * The tokens Yantra needs to move cards while the app is closed: one per card (its updates and end) and, from
177
+ * iOS 17.2, one to start a card for a chore begun elsewhere. Card tokens go on each chore's record (chat/jobs.ts);
178
+ * push-to-start tokens have no place on Yantra yet (README.md).
179
+ */
180
+ export function onCardTokens(listener: (token: CardToken) => void): () => void {
181
+ if (!native) return () => undefined;
182
+ const card = native.addListener('onPushToken', (e: { choreId: string; token: string }) =>
183
+ listener({ kind: 'card', choreId: e.choreId, token: e.token }),
184
+ );
185
+ const start = native.addListener('onPushToStartToken', (e: { token: string }) =>
186
+ listener({ kind: 'start', token: e.token }),
187
+ );
188
+ return () => {
189
+ card.remove();
190
+ start.remove();
191
+ };
192
+ }
package/src/module.ts ADDED
@@ -0,0 +1,8 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import { Feature } from '@common-stack/client-react';
3
+ import { filteredRoutes } from './compute';
4
+
5
+ export default new Feature({
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ routeConfig: filteredRoutes as any,
8
+ });
@@ -0,0 +1,394 @@
1
+ /**
2
+ * Black Friday, after sign-in: the page goes black from Home's own clock, the clock strikes midnight (a thud) and the
3
+ * offer writes itself in word by word (a tick each), counting down to Cyber Monday. Claim shows the celebration; Not
4
+ * now folds the black back into the chip Home keeps in its hero. OfferSheet is the same offer, smaller, when that chip
5
+ * is tapped. The pieces are offer/parts.tsx, the words and numbers offer/blackFriday.ts; the design is the Black Friday
6
+ * section of the Clockbook mobile canvas. Under Reduce Motion it fades in and out and nothing travels.
7
+ */
8
+ import React, { useEffect, useRef, useState } from 'react';
9
+ import {
10
+ Animated,
11
+ Easing,
12
+ Modal,
13
+ Pressable,
14
+ StatusBar,
15
+ StyleSheet,
16
+ Text,
17
+ useWindowDimensions,
18
+ View,
19
+ } from 'react-native';
20
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
21
+ import { Ionicons } from '@expo/vector-icons';
22
+ import { BottomSheet } from '../components/BottomSheet';
23
+ import { useReducedMotion } from '../hooks/useReducedMotion';
24
+ import { fonts } from '../theme/fonts';
25
+ import { longDate, WORD_MS, words } from '../welcome/flow';
26
+ import { tap, thud } from '../welcome/haptics';
27
+ import { Burst, GlowButton, Reveal, Words } from '../welcome/parts';
28
+ import { endsAt, offerWords, timeLeft, type Offer } from './blackFriday';
29
+ import { Countdown, CreamButton, Ember, InkLink, ink, MidnightMark, Sparks, useNow } from './parts';
30
+
31
+ export interface Point {
32
+ x: number;
33
+ y: number;
34
+ }
35
+
36
+ const FLOOD_MS = 950;
37
+ const FOLD_MS = 560;
38
+
39
+ export function BlackFridayOffer({
40
+ visible,
41
+ mode,
42
+ offer,
43
+ origin,
44
+ target,
45
+ onClaim,
46
+ onClose,
47
+ }: {
48
+ visible: boolean;
49
+ /** 'offer' after sign-in; 'claimed' when it was claimed from Home's sheet. */
50
+ mode: 'offer' | 'claimed';
51
+ offer: Offer;
52
+ /** Where the black spreads from (Home's clock), and where Not now folds it back into (the chip's place). */
53
+ origin: Point | null;
54
+ target: Point | null;
55
+ onClaim: () => void;
56
+ onClose: () => void;
57
+ }) {
58
+ const { width, height } = useWindowDimensions();
59
+ const insets = useSafeAreaInsets();
60
+ const reduced = useReducedMotion();
61
+ const [mounted, setMounted] = useState(false);
62
+ const [screen, setScreen] = useState<'offer' | 'claimed'>(mode);
63
+ // A new run each time it opens, so its words and reveals play again.
64
+ const [run, setRun] = useState(0);
65
+ const flood = useRef(new Animated.Value(0)).current;
66
+ const fold = useRef(new Animated.Value(0)).current;
67
+ const fade = useRef(new Animated.Value(1)).current;
68
+ const leaving = useRef(false);
69
+ const now = useNow(1000, mounted && screen === 'offer');
70
+ const w = offerWords(offer.discount);
71
+
72
+ useEffect(() => {
73
+ if (!visible) {
74
+ setMounted(false);
75
+ return undefined;
76
+ }
77
+ leaving.current = false;
78
+ setScreen(mode);
79
+ setRun((r) => r + 1);
80
+ setMounted(true);
81
+ fold.setValue(0);
82
+ const opening = reduced
83
+ ? Animated.timing(fade, { toValue: 1, duration: 260, useNativeDriver: true })
84
+ : Animated.timing(flood, {
85
+ toValue: 1,
86
+ duration: FLOOD_MS,
87
+ easing: Easing.bezier(0.7, 0, 0.2, 1),
88
+ useNativeDriver: true,
89
+ });
90
+ flood.setValue(reduced ? 1 : 0);
91
+ fade.setValue(reduced ? 0 : 1);
92
+ opening.start();
93
+ return () => opening.stop();
94
+ }, [visible, mode, reduced, flood, fold, fade]);
95
+
96
+ const o = origin ?? { x: width / 2, y: insets.top + 150 };
97
+ const t = target ?? o;
98
+ // Not now folds into the chip; after claiming, the black goes back into the clock.
99
+ const to = screen === 'claimed' ? o : t;
100
+ const R = Math.hypot(Math.max(o.x, width - o.x), Math.max(o.y, height - o.y)) + 24;
101
+
102
+ const leave = () => {
103
+ if (leaving.current) return;
104
+ leaving.current = true;
105
+ const out = Animated.timing(fade, { toValue: 0, duration: reduced ? 220 : 200, useNativeDriver: true });
106
+ if (reduced) {
107
+ out.start(() => onClose());
108
+ return;
109
+ }
110
+ const ease = Easing.bezier(0.55, 0, 0.35, 1);
111
+ Animated.sequence([
112
+ out,
113
+ Animated.parallel([
114
+ Animated.timing(flood, { toValue: 0, duration: FOLD_MS, easing: ease, useNativeDriver: true }),
115
+ Animated.timing(fold, { toValue: 1, duration: FOLD_MS, easing: ease, useNativeDriver: true }),
116
+ ]),
117
+ ]).start(() => onClose());
118
+ };
119
+
120
+ const claim = () => {
121
+ onClaim();
122
+ setScreen('claimed');
123
+ };
124
+
125
+ const compact = height < 760;
126
+ const markSize = compact ? 84 : 104;
127
+ const top = insets.top + (compact ? 30 : 52);
128
+ // When the black has reached the words; the rest follows the headline.
129
+ const base = reduced ? 0 : FLOOD_MS * 0.55;
130
+ const lineA = base + 560;
131
+ const lineB = lineA + 2 * WORD_MS + 60;
132
+ const after = lineB + 4 * WORD_MS + 200;
133
+
134
+ const offerScreen = (
135
+ <View style={StyleSheet.absoluteFill}>
136
+ <Ember width={width} top={height * 0.5} delay={base + 120} still={reduced} />
137
+ {reduced ? null : <Sparks width={width} height={height} delay={base + 500} />}
138
+ <Reveal delay={base + 420} still={reduced} style={[st.close, { top: insets.top + 6 }]}>
139
+ <Pressable
140
+ onPress={() => {
141
+ tap();
142
+ leave();
143
+ }}
144
+ hitSlop={8}
145
+ accessibilityRole="button"
146
+ accessibilityLabel="Close"
147
+ style={st.closeBtn}
148
+ >
149
+ <Ionicons name="close" size={20} color={ink.text} />
150
+ </Pressable>
151
+ </Reveal>
152
+ <View style={[st.body, { paddingTop: top }]}>
153
+ <MidnightMark size={markSize} delay={base} still={reduced} onStrike={thud} />
154
+ <Reveal delay={base + 380} still={reduced}>
155
+ <Text style={[st.eyebrow, compact && st.eyebrowCompact]}>Black Friday</Text>
156
+ </Reveal>
157
+ <View style={st.title} accessible accessibilityRole="header" accessibilityLabel={w.title.join(' ')}>
158
+ <Words
159
+ words={words(`*${w.title[0]}*`)}
160
+ label={w.title[0]}
161
+ start={lineA}
162
+ still={reduced}
163
+ style={[st.titleText, compact && st.titleCompact]}
164
+ accent={st.titleAccent}
165
+ center
166
+ />
167
+ <Words
168
+ words={words(w.title[1])}
169
+ label={w.title[1]}
170
+ start={lineB}
171
+ still={reduced}
172
+ style={[st.titleText, compact && st.titleCompact]}
173
+ center
174
+ />
175
+ </View>
176
+ <Reveal delay={after} still={reduced}>
177
+ <Text style={st.lead}>{w.lead}</Text>
178
+ </Reveal>
179
+ <Reveal delay={after + 180} still={reduced} style={[st.clockWrap, compact && st.clockCompact]}>
180
+ <Text style={st.caption}>Offer ends in</Text>
181
+ <Countdown left={timeLeft(now, offer.ends)} still={reduced} />
182
+ </Reveal>
183
+ </View>
184
+ <View style={[st.actions, { paddingBottom: insets.bottom + 12 }]}>
185
+ <Reveal delay={after + 360} still={reduced}>
186
+ <GlowButton variant="orange" label={w.claim} onPress={claim} />
187
+ </Reveal>
188
+ <Reveal delay={after + 460} still={reduced}>
189
+ <InkLink label="Not now" onPress={leave} />
190
+ </Reveal>
191
+ <Reveal delay={after + 540} still={reduced}>
192
+ <Text style={st.small}>{`${w.small} Ends ${endsAt(offer.ends)}.`}</Text>
193
+ </Reveal>
194
+ </View>
195
+ </View>
196
+ );
197
+
198
+ const centre = top + 120;
199
+ const claimedScreen = (
200
+ <View style={StyleSheet.absoluteFill}>
201
+ <Ember width={width} top={centre - width * 0.82} still={reduced} />
202
+ <Burst centerY={centre} still={reduced} />
203
+ <View style={[st.claimedMark, { top: centre - 64, left: width / 2 - 64 }]}>
204
+ <MidnightMark size={128} struck still={reduced} />
205
+ </View>
206
+ <Reveal delay={650} still={reduced} style={[st.doneWrap, { top: centre + 150 }]}>
207
+ <Text style={st.doneTitle} accessibilityRole="header">
208
+ {w.claimed}
209
+ </Text>
210
+ </Reveal>
211
+ <Reveal delay={900} still={reduced} style={[st.doneWrap, { top: centre + 206 }]}>
212
+ <Text style={st.doneSub}>{w.claimedSub}</Text>
213
+ </Reveal>
214
+ <View style={[st.actions, { paddingBottom: insets.bottom + 18 }]}>
215
+ <Reveal delay={1150} still={reduced}>
216
+ <CreamButton label="Hand Lucy a chore" onPress={leave} />
217
+ </Reveal>
218
+ </View>
219
+ </View>
220
+ );
221
+
222
+ return (
223
+ <Modal visible={mounted} transparent animationType="none" statusBarTranslucent onRequestClose={leave}>
224
+ <StatusBar barStyle="light-content" />
225
+ <View style={StyleSheet.absoluteFill} accessibilityViewIsModal>
226
+ <Animated.View
227
+ pointerEvents="none"
228
+ style={[
229
+ st.flood,
230
+ {
231
+ left: o.x - R,
232
+ top: o.y - R,
233
+ width: R * 2,
234
+ height: R * 2,
235
+ borderRadius: R,
236
+ opacity: reduced ? fade : 1,
237
+ transform: [
238
+ { translateX: fold.interpolate({ inputRange: [0, 1], outputRange: [0, to.x - o.x] }) },
239
+ { translateY: fold.interpolate({ inputRange: [0, 1], outputRange: [0, to.y - o.y] }) },
240
+ { scale: flood.interpolate({ inputRange: [0, 1], outputRange: [0.002, 1] }) },
241
+ ],
242
+ },
243
+ ]}
244
+ />
245
+ <Animated.View key={run} style={[StyleSheet.absoluteFill, { opacity: fade }]}>
246
+ {screen === 'offer' ? offerScreen : claimedScreen}
247
+ </Animated.View>
248
+ </View>
249
+ </Modal>
250
+ );
251
+ }
252
+
253
+ /** The offer again, smaller, from Home's chip: the same Ink, over the page. */
254
+ export function OfferSheet({
255
+ visible,
256
+ offer,
257
+ onClaim,
258
+ onClose,
259
+ }: {
260
+ visible: boolean;
261
+ offer: Offer;
262
+ onClaim: () => void;
263
+ onClose: () => void;
264
+ }) {
265
+ const insets = useSafeAreaInsets();
266
+ const reduced = useReducedMotion();
267
+ const now = useNow(1000, visible);
268
+ const w = offerWords(offer.discount);
269
+ return (
270
+ <BottomSheet
271
+ visible={visible}
272
+ onClose={onClose}
273
+ style={[st.sheet, { marginBottom: Math.max(insets.bottom, 8) }]}
274
+ >
275
+ <View style={st.grab} />
276
+ <View style={st.sheetHead}>
277
+ <MidnightMark size={44} struck still={reduced} />
278
+ <View style={st.sheetHeadText}>
279
+ <Text style={st.sheetKicker}>Black Friday</Text>
280
+ <Text style={st.sheetWhen}>{`Ends ${longDate(offer.ends)}`}</Text>
281
+ </View>
282
+ <Pressable
283
+ onPress={() => {
284
+ tap();
285
+ onClose();
286
+ }}
287
+ hitSlop={8}
288
+ accessibilityRole="button"
289
+ accessibilityLabel="Close"
290
+ style={st.closeBtn}
291
+ >
292
+ <Ionicons name="close" size={18} color={ink.text} />
293
+ </Pressable>
294
+ </View>
295
+ <Text style={st.sheetTitle} accessibilityRole="header">
296
+ <Text style={st.titleAccent}>{w.title[0]}</Text>
297
+ {`\n${w.title[1]}`}
298
+ </Text>
299
+ <View style={st.sheetClock}>
300
+ <Countdown left={timeLeft(now, offer.ends)} small still={reduced} />
301
+ </View>
302
+ <GlowButton variant="orange" label={w.claim} onPress={onClaim} />
303
+ <InkLink label="Not now" onPress={onClose} />
304
+ <Text style={st.small}>{w.small}</Text>
305
+ </BottomSheet>
306
+ );
307
+ }
308
+
309
+ const st = StyleSheet.create({
310
+ flood: { position: 'absolute', backgroundColor: ink.bg },
311
+ close: { position: 'absolute', right: 16, zIndex: 2 },
312
+ closeBtn: {
313
+ width: 40,
314
+ height: 40,
315
+ borderRadius: 20,
316
+ backgroundColor: 'rgba(255,255,255,0.1)',
317
+ alignItems: 'center',
318
+ justifyContent: 'center',
319
+ },
320
+ body: { alignItems: 'center', paddingHorizontal: 28 },
321
+ eyebrow: {
322
+ marginTop: 26,
323
+ fontFamily: fonts.sansSemi,
324
+ fontSize: 12.5,
325
+ letterSpacing: 3,
326
+ color: ink.accent,
327
+ textTransform: 'uppercase',
328
+ },
329
+ eyebrowCompact: { marginTop: 18 },
330
+ title: { marginTop: 12, alignItems: 'center' },
331
+ titleText: { fontFamily: fonts.serif, fontSize: 50, lineHeight: 53, letterSpacing: -0.8, color: ink.text },
332
+ titleCompact: { fontSize: 42, lineHeight: 45 },
333
+ titleAccent: { color: ink.accent },
334
+ lead: {
335
+ marginTop: 16,
336
+ maxWidth: 320,
337
+ fontFamily: fonts.sans,
338
+ fontSize: 16,
339
+ lineHeight: 23,
340
+ color: ink.text2,
341
+ textAlign: 'center',
342
+ },
343
+ clockWrap: { marginTop: 26, alignItems: 'center', rowGap: 12 },
344
+ clockCompact: { marginTop: 18 },
345
+ caption: { fontFamily: fonts.sansMedium, fontSize: 12.5, letterSpacing: 0.5, color: ink.muted },
346
+ actions: { position: 'absolute', left: 24, right: 24, bottom: 0, rowGap: 4 },
347
+ small: {
348
+ marginTop: 2,
349
+ fontFamily: fonts.sans,
350
+ fontSize: 12,
351
+ lineHeight: 18,
352
+ color: ink.text2,
353
+ textAlign: 'center',
354
+ },
355
+ claimedMark: { position: 'absolute', width: 128, height: 128 },
356
+ doneWrap: { position: 'absolute', left: 32, right: 32 },
357
+ doneTitle: {
358
+ fontFamily: fonts.serif,
359
+ fontSize: 42,
360
+ lineHeight: 46,
361
+ letterSpacing: -0.6,
362
+ color: ink.text,
363
+ textAlign: 'center',
364
+ },
365
+ doneSub: { fontFamily: fonts.sans, fontSize: 16, lineHeight: 23, color: ink.text2, textAlign: 'center' },
366
+ sheet: {
367
+ marginHorizontal: 8,
368
+ borderRadius: 36,
369
+ backgroundColor: ink.surface,
370
+ paddingHorizontal: 20,
371
+ paddingTop: 10,
372
+ paddingBottom: 16,
373
+ },
374
+ grab: { alignSelf: 'center', width: 38, height: 5, borderRadius: 3, backgroundColor: ink.line2, marginBottom: 14 },
375
+ sheetHead: { flexDirection: 'row', alignItems: 'center', columnGap: 12 },
376
+ sheetHeadText: { flex: 1 },
377
+ sheetKicker: {
378
+ fontFamily: fonts.sansSemi,
379
+ fontSize: 12,
380
+ letterSpacing: 2.6,
381
+ color: ink.accent,
382
+ textTransform: 'uppercase',
383
+ },
384
+ sheetWhen: { marginTop: 5, fontFamily: fonts.sansMedium, fontSize: 13.5, color: ink.text2 },
385
+ sheetTitle: {
386
+ marginTop: 18,
387
+ fontFamily: fonts.serif,
388
+ fontSize: 38,
389
+ lineHeight: 41,
390
+ letterSpacing: -0.6,
391
+ color: ink.text,
392
+ },
393
+ sheetClock: { marginTop: 18, marginBottom: 20 },
394
+ });