@q9labsai/chalk-react-native 4.1.17 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -29
- package/android/build.gradle +35 -0
- package/android/compatibility/ModuleApiCompatibility.java +215 -0
- package/android/src/main/AndroidManifest.xml +2 -1
- package/android/src/main/java/ai/q9labs/chalk/reactnative/ChalkSpaceForegroundService.java +105 -31
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkAndroidConnectionServicePackage.kt +2 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkAudioRouteModule.kt +137 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkCallServiceModule.kt +32 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/CommunicationDeviceListener.kt +23 -0
- package/android/src/test/kotlin/ai/q9labs/chalk/compatibility/UnsafeSignatures.kt +29 -0
- package/dist/android/call-service.d.ts +4 -0
- package/dist/android/call-service.d.ts.map +1 -0
- package/dist/avatar/FaceAvatar.d.ts +19 -0
- package/dist/avatar/FaceAvatar.d.ts.map +1 -0
- package/dist/avatar/tile-avatar-size.d.ts +3 -0
- package/dist/avatar/tile-avatar-size.d.ts.map +1 -0
- package/dist/chunk-GYVZSOGQ.js +30 -0
- package/dist/chunk-IHE6EA3T.js +25 -0
- package/dist/chunk-OIBT2FNM.js +1479 -0
- package/dist/client.d.ts +1 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +185 -2
- package/dist/components/EmbeddedWhiteboard.d.ts.map +1 -1
- package/dist/components/native-media-visibility.d.ts +3 -2
- package/dist/components/native-media-visibility.d.ts.map +1 -1
- package/dist/components/useAndroidCallService.d.ts +8 -0
- package/dist/components/useAndroidCallService.d.ts.map +1 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +10 -0
- package/dist/dock/Dock.d.ts +23 -0
- package/dist/dock/Dock.d.ts.map +1 -0
- package/dist/dock/LeaveMenu.d.ts +12 -0
- package/dist/dock/LeaveMenu.d.ts.map +1 -0
- package/dist/dock/MoreSheet.d.ts +17 -0
- package/dist/dock/MoreSheet.d.ts.map +1 -0
- package/dist/dock/ReactionBurst.d.ts +8 -0
- package/dist/dock/ReactionBurst.d.ts.map +1 -0
- package/dist/dock/RoutePicker.d.ts +16 -0
- package/dist/dock/RoutePicker.d.ts.map +1 -0
- package/dist/dock/audio-route.d.ts +25 -0
- package/dist/dock/audio-route.d.ts.map +1 -0
- package/dist/error-YOPTEH5N.wav +0 -0
- package/dist/frame/CallFrame.d.ts +17 -0
- package/dist/frame/CallFrame.d.ts.map +1 -0
- package/dist/frame/Chalk.d.ts +40 -0
- package/dist/frame/Chalk.d.ts.map +1 -0
- package/dist/frame/back-handler.d.ts +6 -0
- package/dist/frame/back-handler.d.ts.map +1 -0
- package/dist/frame/dev-scenario.d.ts +28 -0
- package/dist/frame/dev-scenario.d.ts.map +1 -0
- package/dist/frame/device-layout.d.ts +16 -0
- package/dist/frame/device-layout.d.ts.map +1 -0
- package/dist/frame/measurement.d.ts +28 -0
- package/dist/frame/measurement.d.ts.map +1 -0
- package/dist/frame/portal.d.ts +24 -0
- package/dist/frame/portal.d.ts.map +1 -0
- package/dist/frame/preferences.d.ts +21 -0
- package/dist/frame/preferences.d.ts.map +1 -0
- package/dist/frame/regions.d.ts +25 -0
- package/dist/frame/regions.d.ts.map +1 -0
- package/dist/hand-DFWVXPH2.wav +0 -0
- package/dist/haptics/haptics.d.ts +12 -0
- package/dist/haptics/haptics.d.ts.map +1 -0
- package/dist/header/CallDetailsSheet.d.ts +18 -0
- package/dist/header/CallDetailsSheet.d.ts.map +1 -0
- package/dist/header/Header.d.ts +17 -0
- package/dist/header/Header.d.ts.map +1 -0
- package/dist/header/QrCode.d.ts +6 -0
- package/dist/header/QrCode.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +12 -0
- package/dist/icons/Icon.d.ts.map +1 -0
- package/dist/icons/icon-element.d.ts +24 -0
- package/dist/icons/icon-element.d.ts.map +1 -0
- package/dist/icons/icon-paths.d.ts +530 -0
- package/dist/icons/icon-paths.d.ts.map +1 -0
- package/dist/index.d.ts +6 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2956 -38
- package/dist/join-Z6RL5AHE.wav +0 -0
- package/dist/knock-4VBQSHK4.wav +0 -0
- package/dist/leave-MQLZOWQD.wav +0 -0
- package/dist/limbo/Limbo.d.ts +25 -0
- package/dist/limbo/Limbo.d.ts.map +1 -0
- package/dist/limbo/Veil.d.ts +10 -0
- package/dist/limbo/Veil.d.ts.map +1 -0
- package/dist/media/native-capture-error.d.ts +7 -0
- package/dist/media/native-capture-error.d.ts.map +1 -0
- package/dist/message-6Y6WJGTB.wav +0 -0
- package/dist/motion/MovingFrame.d.ts +36 -0
- package/dist/motion/MovingFrame.d.ts.map +1 -0
- package/dist/motion/motion.d.ts +82 -0
- package/dist/motion/motion.d.ts.map +1 -0
- package/dist/motion/presence.d.ts +6 -0
- package/dist/motion/presence.d.ts.map +1 -0
- package/dist/motion/press.d.ts +15 -0
- package/dist/motion/press.d.ts.map +1 -0
- package/dist/mute-H5SJFXVI.wav +0 -0
- package/dist/primitives/BottomSheet.d.ts +36 -0
- package/dist/primitives/BottomSheet.d.ts.map +1 -0
- package/dist/primitives/ChalkText.d.ts +13 -0
- package/dist/primitives/ChalkText.d.ts.map +1 -0
- package/dist/primitives/CopyButton.d.ts +11 -0
- package/dist/primitives/CopyButton.d.ts.map +1 -0
- package/dist/primitives/IconButton.d.ts +26 -0
- package/dist/primitives/IconButton.d.ts.map +1 -0
- package/dist/primitives/Menu.d.ts +39 -0
- package/dist/primitives/Menu.d.ts.map +1 -0
- package/dist/primitives/NameTag.d.ts +19 -0
- package/dist/primitives/NameTag.d.ts.map +1 -0
- package/dist/primitives/PillButton.d.ts +19 -0
- package/dist/primitives/PillButton.d.ts.map +1 -0
- package/dist/primitives/SegmentedControl.d.ts +17 -0
- package/dist/primitives/SegmentedControl.d.ts.map +1 -0
- package/dist/primitives/SheetGroup.d.ts +24 -0
- package/dist/primitives/SheetGroup.d.ts.map +1 -0
- package/dist/primitives/Switch.d.ts +9 -0
- package/dist/primitives/Switch.d.ts.map +1 -0
- package/dist/primitives/TileShell.d.ts +18 -0
- package/dist/primitives/TileShell.d.ts.map +1 -0
- package/dist/primitives/announce.d.ts +3 -0
- package/dist/primitives/announce.d.ts.map +1 -0
- package/dist/primitives/menu-placement.d.ts +32 -0
- package/dist/primitives/menu-placement.d.ts.map +1 -0
- package/dist/primitives/toast/Toast.d.ts +8 -0
- package/dist/primitives/toast/Toast.d.ts.map +1 -0
- package/dist/primitives/toast/ToastStack.d.ts +18 -0
- package/dist/primitives/toast/ToastStack.d.ts.map +1 -0
- package/dist/primitives/toast/toast-store.d.ts +39 -0
- package/dist/primitives/toast/toast-store.d.ts.map +1 -0
- package/dist/recording-Q4GB77Y4.wav +0 -0
- package/dist/sheets/people-chat/ChatNotices.d.ts +14 -0
- package/dist/sheets/people-chat/ChatNotices.d.ts.map +1 -0
- package/dist/sheets/people-chat/ChatTab.d.ts +6 -0
- package/dist/sheets/people-chat/ChatTab.d.ts.map +1 -0
- package/dist/sheets/people-chat/Composer.d.ts +7 -0
- package/dist/sheets/people-chat/Composer.d.ts.map +1 -0
- package/dist/sheets/people-chat/PeopleChatSheet.d.ts +17 -0
- package/dist/sheets/people-chat/PeopleChatSheet.d.ts.map +1 -0
- package/dist/sheets/people-chat/PeopleTab.d.ts +3 -0
- package/dist/sheets/people-chat/PeopleTab.d.ts.map +1 -0
- package/dist/sheets/people-chat/PhotoViewer.d.ts +19 -0
- package/dist/sheets/people-chat/PhotoViewer.d.ts.map +1 -0
- package/dist/sheets/people-chat/TextField.d.ts +4 -0
- package/dist/sheets/people-chat/TextField.d.ts.map +1 -0
- package/dist/sheets/people-chat/attachments.d.ts +33 -0
- package/dist/sheets/people-chat/attachments.d.ts.map +1 -0
- package/dist/sheets/people-chat/chat-model.d.ts +64 -0
- package/dist/sheets/people-chat/chat-model.d.ts.map +1 -0
- package/dist/sheets/people-chat/people-model.d.ts +43 -0
- package/dist/sheets/people-chat/people-model.d.ts.map +1 -0
- package/dist/sounds/sounds.d.ts +33 -0
- package/dist/sounds/sounds.d.ts.map +1 -0
- package/dist/space-client/create-native-space-client.d.ts +0 -4
- package/dist/space-client/create-native-space-client.d.ts.map +1 -1
- package/dist/space-client/random-uuid.d.ts +7 -0
- package/dist/space-client/random-uuid.d.ts.map +1 -0
- package/dist/stage/ContentTile.d.ts +18 -0
- package/dist/stage/ContentTile.d.ts.map +1 -0
- package/dist/stage/ParticipantTile.d.ts +18 -0
- package/dist/stage/ParticipantTile.d.ts.map +1 -0
- package/dist/stage/Stage.d.ts +14 -0
- package/dist/stage/Stage.d.ts.map +1 -0
- package/dist/stage/TileSheet.d.ts +12 -0
- package/dist/stage/TileSheet.d.ts.map +1 -0
- package/dist/stage/camera.d.ts +7 -0
- package/dist/stage/camera.d.ts.map +1 -0
- package/dist/stage/layout.d.ts +57 -0
- package/dist/stage/layout.d.ts.map +1 -0
- package/dist/stage/space-selector.d.ts +10 -0
- package/dist/stage/space-selector.d.ts.map +1 -0
- package/dist/stage/stage-view.d.ts +23 -0
- package/dist/stage/stage-view.d.ts.map +1 -0
- package/dist/status/CallOverlays.d.ts +17 -0
- package/dist/status/CallOverlays.d.ts.map +1 -0
- package/dist/status/ChalkArrival.d.ts +24 -0
- package/dist/status/ChalkArrival.d.ts.map +1 -0
- package/dist/status/StatusPage.d.ts +14 -0
- package/dist/status/StatusPage.d.ts.map +1 -0
- package/dist/status/call-screen.d.ts +20 -0
- package/dist/status/call-screen.d.ts.map +1 -0
- package/dist/test-VD2KAM4D.wav +0 -0
- package/dist/theme/theme.d.ts +15 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/tokens.d.ts +248 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/toasts/CallEventToasts.d.ts +21 -0
- package/dist/toasts/CallEventToasts.d.ts.map +1 -0
- package/dist/toasts/notices.d.ts +34 -0
- package/dist/toasts/notices.d.ts.map +1 -0
- package/dist/ui/ChalkUI.d.ts +12 -0
- package/dist/ui/ChalkUI.d.ts.map +1 -0
- package/dist/ui.d.ts +25 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +77 -0
- package/dist/unmute-2XR2LICU.wav +0 -0
- package/embedded/chalk-whiteboard/asset-manifest.json +2 -2
- package/embedded/chalk-whiteboard/renderer.js +510 -510
- package/ios/ChalkAudioRouteModule.swift +93 -0
- package/ios/ChalkAudioRouteModuleBridge.m +9 -0
- package/package.json +46 -76
- package/src/android/call-service.ts +19 -0
- package/src/avatar/FaceAvatar.tsx +145 -0
- package/src/avatar/tile-avatar-size.ts +4 -0
- package/src/client.ts +1 -5
- package/src/components/EmbeddedWhiteboard.tsx +14 -71
- package/src/components/native-media-visibility.ts +1 -2
- package/src/components/useAndroidCallService.ts +41 -0
- package/src/dev.ts +9 -0
- package/src/dock/Dock.tsx +95 -0
- package/src/dock/LeaveMenu.tsx +21 -0
- package/src/dock/MoreSheet.tsx +233 -0
- package/src/dock/ReactionBurst.tsx +55 -0
- package/src/dock/RoutePicker.tsx +42 -0
- package/src/dock/audio-route.ts +69 -0
- package/src/frame/CallFrame.tsx +209 -0
- package/src/frame/Chalk.tsx +83 -0
- package/src/frame/back-handler.ts +19 -0
- package/src/frame/dev-scenario.ts +48 -0
- package/src/frame/device-layout.tsx +31 -0
- package/src/frame/measurement.ts +44 -0
- package/src/frame/portal.tsx +107 -0
- package/src/frame/preferences.tsx +48 -0
- package/src/frame/regions.test.ts +38 -0
- package/src/frame/regions.ts +60 -0
- package/src/haptics/haptics.ts +19 -0
- package/src/header/CallDetailsSheet.tsx +139 -0
- package/src/header/Header.tsx +107 -0
- package/src/header/QrCode.tsx +34 -0
- package/src/icons/Icon.tsx +35 -0
- package/src/icons/icon-element.ts +11 -0
- package/src/icons/icon-paths.ts +199 -0
- package/src/index.ts +6 -9
- package/src/limbo/Limbo.tsx +159 -0
- package/src/limbo/Veil.tsx +36 -0
- package/src/media/native-capture-error.test.ts +19 -0
- package/src/media/native-capture-error.ts +13 -0
- package/src/motion/MovingFrame.tsx +101 -0
- package/src/motion/motion.ts +33 -0
- package/src/motion/presence.ts +20 -0
- package/src/motion/press.ts +35 -0
- package/src/primitives/BottomSheet.tsx +211 -0
- package/src/primitives/ChalkText.tsx +23 -0
- package/src/primitives/CopyButton.tsx +78 -0
- package/src/primitives/IconButton.tsx +90 -0
- package/src/primitives/Menu.tsx +212 -0
- package/src/primitives/NameTag.tsx +68 -0
- package/src/primitives/PillButton.tsx +56 -0
- package/src/primitives/SegmentedControl.tsx +55 -0
- package/src/primitives/SheetGroup.tsx +72 -0
- package/src/primitives/Switch.tsx +39 -0
- package/src/primitives/TileShell.tsx +53 -0
- package/src/primitives/announce.ts +7 -0
- package/src/primitives/menu-placement.test.ts +50 -0
- package/src/primitives/menu-placement.ts +43 -0
- package/src/primitives/toast/Toast.tsx +50 -0
- package/src/primitives/toast/ToastStack.tsx +89 -0
- package/src/primitives/toast/toast-store.ts +86 -0
- package/src/sheets/people-chat/ChatNotices.tsx +69 -0
- package/src/sheets/people-chat/ChatTab.tsx +186 -0
- package/src/sheets/people-chat/Composer.tsx +182 -0
- package/src/sheets/people-chat/PeopleChatSheet.tsx +100 -0
- package/src/sheets/people-chat/PeopleTab.tsx +326 -0
- package/src/sheets/people-chat/PhotoViewer.tsx +132 -0
- package/src/sheets/people-chat/TextField.tsx +14 -0
- package/src/sheets/people-chat/attachments.tsx +183 -0
- package/src/sheets/people-chat/chat-model.ts +157 -0
- package/src/sheets/people-chat/people-chat-model.test.ts +98 -0
- package/src/sheets/people-chat/people-model.ts +68 -0
- package/src/sounds/assets/error.wav +0 -0
- package/src/sounds/assets/hand.wav +0 -0
- package/src/sounds/assets/join.wav +0 -0
- package/src/sounds/assets/knock.wav +0 -0
- package/src/sounds/assets/leave.wav +0 -0
- package/src/sounds/assets/message.wav +0 -0
- package/src/sounds/assets/mute.wav +0 -0
- package/src/sounds/assets/recording.wav +0 -0
- package/src/sounds/assets/test.wav +0 -0
- package/src/sounds/assets/unmute.wav +0 -0
- package/src/sounds/assets.d.ts +5 -0
- package/src/sounds/sounds.ts +50 -0
- package/src/space-client/create-native-space-client.ts +20 -181
- package/src/space-client/random-uuid.ts +17 -0
- package/src/space-client/whiteboard-watchdog.test.ts +23 -0
- package/src/stage/ContentTile.tsx +100 -0
- package/src/stage/ParticipantTile.tsx +140 -0
- package/src/stage/Stage.tsx +152 -0
- package/src/stage/TileSheet.tsx +116 -0
- package/src/stage/camera.ts +20 -0
- package/src/stage/layout.test.ts +77 -0
- package/src/stage/layout.ts +226 -0
- package/src/stage/space-selector.ts +31 -0
- package/src/stage/stage-view.tsx +68 -0
- package/src/status/CallOverlays.tsx +47 -0
- package/src/status/ChalkArrival.tsx +53 -0
- package/src/status/StatusPage.tsx +123 -0
- package/src/status/call-screen.test.ts +42 -0
- package/src/status/call-screen.ts +29 -0
- package/src/theme/theme.tsx +28 -0
- package/src/theme/tokens.ts +247 -0
- package/src/toasts/CallEventToasts.tsx +192 -0
- package/src/toasts/notices.test.ts +92 -0
- package/src/toasts/notices.ts +62 -0
- package/src/ui/ChalkUI.tsx +49 -0
- package/src/ui.ts +24 -0
- package/dist/android.d.ts +0 -2
- package/dist/android.d.ts.map +0 -1
- package/dist/android.js +0 -62
- package/dist/chunk-2OS7SSXE.js +0 -552
- package/dist/chunk-5DQ4KBRH.js +0 -690
- package/dist/chunk-ITLUHTVS.js +0 -5271
- package/dist/chunk-JB4LNWVP.js +0 -247
- package/dist/components/Chalk.d.ts +0 -79
- package/dist/components/Chalk.d.ts.map +0 -1
- package/dist/components/ChatMessageList.d.ts +0 -11
- package/dist/components/ChatMessageList.d.ts.map +0 -1
- package/dist/components/Entrance.d.ts +0 -22
- package/dist/components/Entrance.d.ts.map +0 -1
- package/dist/components/EntranceView.android.d.ts +0 -4
- package/dist/components/EntranceView.android.d.ts.map +0 -1
- package/dist/components/EntranceView.d.ts +0 -18
- package/dist/components/EntranceView.d.ts.map +0 -1
- package/dist/components/EntranceView.ios-pad.d.ts +0 -3
- package/dist/components/EntranceView.ios-pad.d.ts.map +0 -1
- package/dist/components/EntranceView.ios-phone.d.ts +0 -3
- package/dist/components/EntranceView.ios-phone.d.ts.map +0 -1
- package/dist/components/EntranceView.macos.d.ts +0 -4
- package/dist/components/EntranceView.macos.d.ts.map +0 -1
- package/dist/components/FaceAvatar.d.ts +0 -16
- package/dist/components/FaceAvatar.d.ts.map +0 -1
- package/dist/components/GradientSurface.d.ts +0 -14
- package/dist/components/GradientSurface.d.ts.map +0 -1
- package/dist/components/MediaView.d.ts +0 -14
- package/dist/components/MediaView.d.ts.map +0 -1
- package/dist/components/ReactionPicker.d.ts +0 -10
- package/dist/components/ReactionPicker.d.ts.map +0 -1
- package/dist/components/SpaceView.android.d.ts +0 -2
- package/dist/components/SpaceView.android.d.ts.map +0 -1
- package/dist/components/SpaceView.d.ts +0 -33
- package/dist/components/SpaceView.d.ts.map +0 -1
- package/dist/components/SpaceView.ios-pad.d.ts +0 -2
- package/dist/components/SpaceView.ios-pad.d.ts.map +0 -1
- package/dist/components/SpaceView.ios-phone.d.ts +0 -2
- package/dist/components/SpaceView.ios-phone.d.ts.map +0 -1
- package/dist/components/SpaceView.macos.d.ts +0 -2
- package/dist/components/SpaceView.macos.d.ts.map +0 -1
- package/dist/components/SpaceView.shared.d.ts +0 -3
- package/dist/components/SpaceView.shared.d.ts.map +0 -1
- package/dist/components/episode-diagnostic-render-observer.d.ts +0 -2
- package/dist/components/episode-diagnostic-render-observer.d.ts.map +0 -1
- package/dist/components/logo/Logo.d.ts +0 -11
- package/dist/components/logo/Logo.d.ts.map +0 -1
- package/dist/components/native-animation-controller.d.ts +0 -7
- package/dist/components/native-animation-controller.d.ts.map +0 -1
- package/dist/components/native-chat.d.ts +0 -8
- package/dist/components/native-chat.d.ts.map +0 -1
- package/dist/components/native-entrance/entrance-controller-store.d.ts +0 -34
- package/dist/components/native-entrance/entrance-controller-store.d.ts.map +0 -1
- package/dist/components/native-entrance/useEntranceController.d.ts +0 -19
- package/dist/components/native-entrance/useEntranceController.d.ts.map +0 -1
- package/dist/components/native-joining-loading-animation.d.ts +0 -9
- package/dist/components/native-joining-loading-animation.d.ts.map +0 -1
- package/dist/components/native-space-view/AppearanceSettings.d.ts +0 -2
- package/dist/components/native-space-view/AppearanceSettings.d.ts.map +0 -1
- package/dist/components/native-space-view/FeedbackSheet.d.ts +0 -12
- package/dist/components/native-space-view/FeedbackSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/ParticipantActionSheet.d.ts +0 -9
- package/dist/components/native-space-view/ParticipantActionSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SettingsSheet.d.ts +0 -7
- package/dist/components/native-space-view/SettingsSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceActionMenu.d.ts +0 -10
- package/dist/components/native-space-view/SpaceActionMenu.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceBottomDock.android.d.ts +0 -4
- package/dist/components/native-space-view/SpaceBottomDock.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceChatAttachment.d.ts +0 -8
- package/dist/components/native-space-view/SpaceChatAttachment.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceChatSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpaceChatSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceGrid.android.d.ts +0 -8
- package/dist/components/native-space-view/SpaceGrid.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceMoreSheet.d.ts +0 -7
- package/dist/components/native-space-view/SpaceMoreSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpacePanelSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpacePanelSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpacePeopleSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpacePeopleSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceStage.android.d.ts +0 -29
- package/dist/components/native-space-view/SpaceStage.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceSurfacePrimitives.d.ts +0 -30
- package/dist/components/native-space-view/SpaceSurfacePrimitives.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceTopBar.android.d.ts +0 -11
- package/dist/components/native-space-view/SpaceTopBar.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceWhiteboardSurface.d.ts +0 -15
- package/dist/components/native-space-view/SpaceWhiteboardSurface.d.ts.map +0 -1
- package/dist/components/native-space-view/diagnostics.d.ts +0 -48
- package/dist/components/native-space-view/diagnostics.d.ts.map +0 -1
- package/dist/components/native-space-view/format-space-duration.d.ts +0 -2
- package/dist/components/native-space-view/format-space-duration.d.ts.map +0 -1
- package/dist/components/native-space-view/native-space-grid-keys.d.ts +0 -3
- package/dist/components/native-space-view/native-space-grid-keys.d.ts.map +0 -1
- package/dist/components/native-space-view/native-space-page-store.d.ts +0 -8
- package/dist/components/native-space-view/native-space-page-store.d.ts.map +0 -1
- package/dist/components/native-space-view/space-chat-attachments.d.ts +0 -15
- package/dist/components/native-space-view/space-chat-attachments.d.ts.map +0 -1
- package/dist/components/native-space-view/space-panel-layout.d.ts +0 -10
- package/dist/components/native-space-view/space-panel-layout.d.ts.map +0 -1
- package/dist/components/native-space-view/space-progressive-surface-helpers.d.ts +0 -16
- package/dist/components/native-space-view/space-progressive-surface-helpers.d.ts.map +0 -1
- package/dist/components/native-space-view/space-progressive-surface-types.d.ts +0 -3
- package/dist/components/native-space-view/space-progressive-surface-types.d.ts.map +0 -1
- package/dist/components/native-space-view/types.d.ts +0 -24
- package/dist/components/native-space-view/types.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewController.contract.d.ts +0 -41
- package/dist/components/native-space-view/useSpaceViewController.contract.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewController.d.ts +0 -156
- package/dist/components/native-space-view/useSpaceViewController.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewDerived.d.ts +0 -12
- package/dist/components/native-space-view/useSpaceViewDerived.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewPanels.d.ts +0 -70
- package/dist/components/native-space-view/useSpaceViewPanels.d.ts.map +0 -1
- package/dist/feedback/native-capture.d.ts +0 -9
- package/dist/feedback/native-capture.d.ts.map +0 -1
- package/dist/feedback/native-evidence.d.ts +0 -3
- package/dist/feedback/native-evidence.d.ts.map +0 -1
- package/dist/hooks/entrance-preview-store.d.ts +0 -16
- package/dist/hooks/entrance-preview-store.d.ts.map +0 -1
- package/dist/hooks/useEntrancePreview.d.ts +0 -7
- package/dist/hooks/useEntrancePreview.d.ts.map +0 -1
- package/dist/hooks/useLayout.d.ts +0 -16
- package/dist/hooks/useLayout.d.ts.map +0 -1
- package/dist/hooks/usePanels.d.ts +0 -12
- package/dist/hooks/usePanels.d.ts.map +0 -1
- package/dist/ios-pad.d.ts +0 -2
- package/dist/ios-pad.d.ts.map +0 -1
- package/dist/ios-pad.js +0 -62
- package/dist/ios-phone.d.ts +0 -2
- package/dist/ios-phone.d.ts.map +0 -1
- package/dist/ios-phone.js +0 -62
- package/dist/ios.d.ts +0 -2
- package/dist/ios.d.ts.map +0 -1
- package/dist/ios.js +0 -62
- package/dist/macos.d.ts +0 -2
- package/dist/macos.d.ts.map +0 -1
- package/dist/macos.js +0 -62
- package/dist/space-client/cloudflare-rtk-native.d.ts +0 -3
- package/dist/space-client/cloudflare-rtk-native.d.ts.map +0 -1
- package/dist/telemetry.d.ts +0 -63
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/ui/appearance.d.ts +0 -246
- package/dist/ui/appearance.d.ts.map +0 -1
- package/dist/ui/appearance.js +0 -14
- package/dist/ui/native-appearance-context.d.ts +0 -15
- package/dist/ui/native-appearance-context.d.ts.map +0 -1
- package/dist/ui/native-theme.d.ts +0 -17
- package/dist/ui/native-theme.d.ts.map +0 -1
- package/dist/ui/native-types.d.ts +0 -38
- package/dist/ui/native-types.d.ts.map +0 -1
- package/dist/ui/participant-avatar.d.ts +0 -21
- package/dist/ui/participant-avatar.d.ts.map +0 -1
- package/dist/ui/theme-tokens.d.ts +0 -25
- package/dist/ui/theme-tokens.d.ts.map +0 -1
- package/dist/ui/theme.d.ts +0 -404
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -8
- package/dist/utils/native-space-layout.d.ts +0 -42
- package/dist/utils/native-space-layout.d.ts.map +0 -1
- package/src/android.ts +0 -1
- package/src/components/Chalk.tsx +0 -363
- package/src/components/ChatMessageList.tsx +0 -209
- package/src/components/Entrance.tsx +0 -42
- package/src/components/EntranceView.android.tsx +0 -274
- package/src/components/EntranceView.ios-pad.tsx +0 -326
- package/src/components/EntranceView.ios-phone.tsx +0 -271
- package/src/components/EntranceView.macos.tsx +0 -278
- package/src/components/EntranceView.tsx +0 -38
- package/src/components/FaceAvatar.tsx +0 -120
- package/src/components/GradientSurface.tsx +0 -23
- package/src/components/MediaView.tsx +0 -76
- package/src/components/ReactionPicker.tsx +0 -98
- package/src/components/SpaceView.android.tsx +0 -1
- package/src/components/SpaceView.ios-pad.tsx +0 -1
- package/src/components/SpaceView.ios-phone.tsx +0 -1
- package/src/components/SpaceView.macos.tsx +0 -1
- package/src/components/SpaceView.shared.tsx +0 -98
- package/src/components/SpaceView.tsx +0 -54
- package/src/components/episode-diagnostic-render-observer.ts +0 -12
- package/src/components/logo/Logo.tsx +0 -309
- package/src/components/native-animation-controller.ts +0 -36
- package/src/components/native-chat.ts +0 -23
- package/src/components/native-entrance/entrance-controller-store.ts +0 -112
- package/src/components/native-entrance/useEntranceController.ts +0 -60
- package/src/components/native-joining-loading-animation.ts +0 -26
- package/src/components/native-space-view/AppearanceSettings.tsx +0 -114
- package/src/components/native-space-view/FeedbackSheet.tsx +0 -296
- package/src/components/native-space-view/ParticipantActionSheet.tsx +0 -99
- package/src/components/native-space-view/SettingsSheet.tsx +0 -164
- package/src/components/native-space-view/SpaceActionMenu.tsx +0 -109
- package/src/components/native-space-view/SpaceBottomDock.android.tsx +0 -115
- package/src/components/native-space-view/SpaceChatAttachment.tsx +0 -105
- package/src/components/native-space-view/SpaceChatSheet.tsx +0 -184
- package/src/components/native-space-view/SpaceGrid.android.tsx +0 -323
- package/src/components/native-space-view/SpaceMoreSheet.tsx +0 -190
- package/src/components/native-space-view/SpacePanelSheet.tsx +0 -45
- package/src/components/native-space-view/SpacePeopleSheet.tsx +0 -116
- package/src/components/native-space-view/SpaceStage.android.tsx +0 -372
- package/src/components/native-space-view/SpaceSurfacePrimitives.tsx +0 -75
- package/src/components/native-space-view/SpaceTopBar.android.tsx +0 -113
- package/src/components/native-space-view/SpaceWhiteboardSurface.tsx +0 -69
- package/src/components/native-space-view/diagnostics.ts +0 -84
- package/src/components/native-space-view/format-space-duration.ts +0 -3
- package/src/components/native-space-view/native-space-grid-keys.ts +0 -6
- package/src/components/native-space-view/native-space-page-store.ts +0 -41
- package/src/components/native-space-view/space-chat-attachments.test.ts +0 -26
- package/src/components/native-space-view/space-chat-attachments.ts +0 -37
- package/src/components/native-space-view/space-panel-layout.ts +0 -10
- package/src/components/native-space-view/space-progressive-surface-helpers.ts +0 -33
- package/src/components/native-space-view/space-progressive-surface-types.ts +0 -3
- package/src/components/native-space-view/types.ts +0 -25
- package/src/components/native-space-view/useSpaceViewController.contract.ts +0 -34
- package/src/components/native-space-view/useSpaceViewController.ts +0 -416
- package/src/components/native-space-view/useSpaceViewDerived.ts +0 -29
- package/src/components/native-space-view/useSpaceViewPanels.ts +0 -170
- package/src/feedback/native-capture.ts +0 -62
- package/src/feedback/native-evidence.ts +0 -37
- package/src/hooks/entrance-preview-store.ts +0 -99
- package/src/hooks/useEntrancePreview.ts +0 -26
- package/src/hooks/useLayout.ts +0 -37
- package/src/hooks/usePanels.ts +0 -30
- package/src/ios-pad.ts +0 -1
- package/src/ios-phone.ts +0 -1
- package/src/ios.ts +0 -1
- package/src/macos.ts +0 -1
- package/src/space-client/cloudflare-rtk-native.ts +0 -104
- package/src/telemetry.ts +0 -234
- package/src/types/hugeicons-direct.d.ts +0 -4
- package/src/types/react-native-safe-area-context.d.ts +0 -8
- package/src/ui/appearance.ts +0 -808
- package/src/ui/native-appearance-context.tsx +0 -74
- package/src/ui/native-theme.tsx +0 -54
- package/src/ui/native-types.ts +0 -40
- package/src/ui/participant-avatar.ts +0 -47
- package/src/ui/theme-tokens.ts +0 -41
- package/src/ui/theme.ts +0 -214
- package/src/utils/native-space-layout.ts +0 -135
|
@@ -0,0 +1,1479 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useMeasuredRef
|
|
3
|
+
} from "./chunk-GYVZSOGQ.js";
|
|
4
|
+
|
|
5
|
+
// src/frame/device-layout.tsx
|
|
6
|
+
import { createContext, useContext, useMemo } from "react";
|
|
7
|
+
import { useWindowDimensions } from "react-native";
|
|
8
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
+
|
|
10
|
+
// src/frame/regions.ts
|
|
11
|
+
function arrangementFor(width, height) {
|
|
12
|
+
return width > height ? "landscape" : "portrait";
|
|
13
|
+
}
|
|
14
|
+
var STAGE_GAP = 8;
|
|
15
|
+
function frameRegions(arrangement, width, height, insets, cardOpen = false) {
|
|
16
|
+
const { top, bottom, left, right } = insets;
|
|
17
|
+
if (arrangement === "portrait") {
|
|
18
|
+
const headerHeight = 52;
|
|
19
|
+
const dockHeight = 52;
|
|
20
|
+
const dockBottom = bottom + 8 + 6;
|
|
21
|
+
const stageTop2 = top + headerHeight;
|
|
22
|
+
return {
|
|
23
|
+
header: { x: left, y: top, width: width - left - right, height: headerHeight },
|
|
24
|
+
stage: { x: left + STAGE_GAP, y: stageTop2, width: width - left - right - 2 * STAGE_GAP, height: height - stageTop2 - (bottom + 8 + dockHeight + 14) - 8 },
|
|
25
|
+
dock: { x: left, y: height - dockBottom - dockHeight, width: width - left - right, height: dockHeight }
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (arrangement === "landscape") {
|
|
29
|
+
const dockHeight = 52;
|
|
30
|
+
const topEdge = top + 8;
|
|
31
|
+
return {
|
|
32
|
+
header: { x: left, y: topEdge, width: width - left - right, height: 44 },
|
|
33
|
+
stage: { x: left + STAGE_GAP, y: topEdge, width: width - left - right - 2 * STAGE_GAP, height: height - topEdge - bottom - 4 },
|
|
34
|
+
dock: { x: left, y: height - (bottom + 6) - dockHeight, width: width - left - right, height: dockHeight }
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const stageTop = top + 60;
|
|
38
|
+
return {
|
|
39
|
+
header: { x: 0, y: top, width, height: 60 },
|
|
40
|
+
stage: { x: 16, y: stageTop, width: width - 32 - (cardOpen ? 352 : 0), height: height - stageTop - (bottom + 16 + 44 + 16) },
|
|
41
|
+
dock: { x: 0, y: height - (bottom + 16) - 44, width, height: 44 }
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/frame/device-layout.tsx
|
|
46
|
+
import { jsx } from "react/jsx-runtime";
|
|
47
|
+
var DeviceLayoutContext = createContext(null);
|
|
48
|
+
function DeviceLayoutProvider({ children }) {
|
|
49
|
+
const { width, height } = useWindowDimensions();
|
|
50
|
+
const insets = useSafeAreaInsets();
|
|
51
|
+
const value = useMemo(() => {
|
|
52
|
+
const arrangement = arrangementFor(width, height);
|
|
53
|
+
return { arrangement, phone: arrangement !== "pad", width, height, insets };
|
|
54
|
+
}, [height, insets, width]);
|
|
55
|
+
return /* @__PURE__ */ jsx(DeviceLayoutContext.Provider, { value, children });
|
|
56
|
+
}
|
|
57
|
+
function useDeviceLayout() {
|
|
58
|
+
const layout = useContext(DeviceLayoutContext);
|
|
59
|
+
if (!layout) throw new Error("Chalk primitives must be rendered inside <Chalk>.");
|
|
60
|
+
return layout;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/theme/tokens.ts
|
|
64
|
+
import { Easing } from "react-native-reanimated";
|
|
65
|
+
var dark = {
|
|
66
|
+
canvas: "#0B0C0E",
|
|
67
|
+
surface: "#151619",
|
|
68
|
+
tile: "#151619",
|
|
69
|
+
raised: "#1D1F23",
|
|
70
|
+
popover: "#1D1F23",
|
|
71
|
+
hover: "#272A2F",
|
|
72
|
+
pressed: "#30333A",
|
|
73
|
+
line: "rgba(255,255,255,0.08)",
|
|
74
|
+
lineStrong: "rgba(255,255,255,0.14)",
|
|
75
|
+
text: "#ECECEE",
|
|
76
|
+
textStrong: "#FFFFFF",
|
|
77
|
+
textSoft: "#C4C6CC",
|
|
78
|
+
textMuted: "#9A9CA3",
|
|
79
|
+
focus: "#ECECEE",
|
|
80
|
+
danger: "#E5484D",
|
|
81
|
+
dangerPressed: "#C93D42",
|
|
82
|
+
dangerText: "#FF6B6B",
|
|
83
|
+
success: "#80B879",
|
|
84
|
+
warning: "#D9B641",
|
|
85
|
+
info: "#55AAC9"
|
|
86
|
+
};
|
|
87
|
+
var light = {
|
|
88
|
+
canvas: "#F3F3F5",
|
|
89
|
+
surface: "#FFFFFF",
|
|
90
|
+
tile: "#E2E2E7",
|
|
91
|
+
raised: "#ECECF0",
|
|
92
|
+
popover: "#FFFFFF",
|
|
93
|
+
hover: "#E1E1E6",
|
|
94
|
+
pressed: "#D3D3D9",
|
|
95
|
+
line: "rgba(0,0,0,0.09)",
|
|
96
|
+
lineStrong: "rgba(0,0,0,0.15)",
|
|
97
|
+
text: "#18181B",
|
|
98
|
+
textStrong: "#000000",
|
|
99
|
+
textSoft: "#3D3E45",
|
|
100
|
+
textMuted: "#5C5D65",
|
|
101
|
+
focus: "#18181B",
|
|
102
|
+
danger: "#D93A3F",
|
|
103
|
+
dangerPressed: "#C93D42",
|
|
104
|
+
dangerText: "#BF272C",
|
|
105
|
+
success: "#2B8A3E",
|
|
106
|
+
warning: "#8A6400",
|
|
107
|
+
info: "#1B70A0"
|
|
108
|
+
};
|
|
109
|
+
var palettes = { dark, light };
|
|
110
|
+
var fixed = {
|
|
111
|
+
overlay: "rgba(12,14,18,0.75)",
|
|
112
|
+
overlayStrong: "rgba(12,14,18,0.82)",
|
|
113
|
+
overlayPressed: "rgba(40,42,48,0.95)",
|
|
114
|
+
overlayText: "#FFFFFF",
|
|
115
|
+
overlayDanger: "#FF6B6B",
|
|
116
|
+
overlayWarning: "#E2BD3A",
|
|
117
|
+
onDanger: "#FFFFFF",
|
|
118
|
+
hand: "#DCB740",
|
|
119
|
+
handText: "#16140C",
|
|
120
|
+
scrim: "rgba(0,0,0,0.55)",
|
|
121
|
+
liveRing: "rgba(255,255,255,0.9)",
|
|
122
|
+
liveRingShade: "rgba(0,0,0,0.35)",
|
|
123
|
+
switchKnob: "#FFFFFF",
|
|
124
|
+
/** QR codes stay black on white in both themes so every camera reads them. */
|
|
125
|
+
qrLight: "#FFFFFF",
|
|
126
|
+
qrDark: "#000000",
|
|
127
|
+
shadow: "#000000",
|
|
128
|
+
transparent: "transparent",
|
|
129
|
+
/** The selected segment of a compact segmented control. */
|
|
130
|
+
segmentShadow: "0px 1px 2px rgba(0,0,0,0.2)"
|
|
131
|
+
};
|
|
132
|
+
var fileKindColors = { pdf: "#C42B2B", doc: "#2F5FB3", xls: "#1E7A46", ppt: "#B8481E", other: "#5C5D65" };
|
|
133
|
+
var chatOverlays = { photoMore: "rgba(0,0,0,0.5)", uploading: "rgba(0,0,0,0.45)", ring: "#FFFFFF" };
|
|
134
|
+
var viewer = {
|
|
135
|
+
backdrop: "rgba(8,8,10,0.94)",
|
|
136
|
+
text: "#ECECEE",
|
|
137
|
+
textMuted: "#A1A2A9",
|
|
138
|
+
button: "rgba(255,255,255,0.08)",
|
|
139
|
+
buttonPressed: "rgba(255,255,255,0.16)"
|
|
140
|
+
};
|
|
141
|
+
var identityColors = ["#315F72", "#5C6650", "#6B5B4F", "#64576B", "#49645D", "#665D42", "#4D5D73", "#6D5158"];
|
|
142
|
+
var elevations = {
|
|
143
|
+
dark: { popover: "0px 12px 32px rgba(0,0,0,0.5)", toast: "0px 8px 24px rgba(0,0,0,0.4)", floatTile: "0px 0px 0px 1px rgba(255,255,255,0.14), 0px 6px 18px rgba(0,0,0,0.5)", ringOnCanvas: false },
|
|
144
|
+
light: { popover: "0px 0px 0px 1px rgba(0,0,0,0.09), 0px 12px 32px rgba(0,0,0,0.12)", toast: "0px 0px 0px 1px rgba(0,0,0,0.09), 0px 12px 32px rgba(0,0,0,0.12)", floatTile: "0px 0px 0px 1px rgba(0,0,0,0.15), 0px 6px 18px rgba(0,0,0,0.5)", ringOnCanvas: true }
|
|
145
|
+
};
|
|
146
|
+
var fontFamilies = {
|
|
147
|
+
400: "Figtree-Regular",
|
|
148
|
+
500: "Figtree-Medium",
|
|
149
|
+
600: "Figtree-SemiBold",
|
|
150
|
+
700: "Figtree-Bold"
|
|
151
|
+
};
|
|
152
|
+
var LINE_HEIGHT = 1.4;
|
|
153
|
+
function textStyle(fontSize, weight) {
|
|
154
|
+
return { fontFamily: fontFamilies[weight], fontSize, lineHeight: fontSize * LINE_HEIGHT };
|
|
155
|
+
}
|
|
156
|
+
var type = {
|
|
157
|
+
statusTitle: textStyle(22, 600),
|
|
158
|
+
limboTitle: textStyle(20, 600),
|
|
159
|
+
progress: textStyle(17, 600),
|
|
160
|
+
sheetTitle: textStyle(16, 600),
|
|
161
|
+
phoneRow: textStyle(16, 400),
|
|
162
|
+
cardTitle: textStyle(15, 600),
|
|
163
|
+
wideButton: textStyle(15, 600),
|
|
164
|
+
body: textStyle(14, 400),
|
|
165
|
+
bodyMedium: textStyle(14, 500),
|
|
166
|
+
bodyStrong: textStyle(14, 600),
|
|
167
|
+
button: textStyle(13, 600),
|
|
168
|
+
meta: textStyle(13, 400),
|
|
169
|
+
label: textStyle(12, 500),
|
|
170
|
+
section: textStyle(12, 600),
|
|
171
|
+
caption: textStyle(11, 600)
|
|
172
|
+
};
|
|
173
|
+
var radii = {
|
|
174
|
+
tag: 6,
|
|
175
|
+
field: 10,
|
|
176
|
+
menuRow: 9,
|
|
177
|
+
menu: 12,
|
|
178
|
+
tile: 12,
|
|
179
|
+
tilePhone: 14,
|
|
180
|
+
card: 16,
|
|
181
|
+
sheet: 24,
|
|
182
|
+
round: 999
|
|
183
|
+
};
|
|
184
|
+
var sizes = {
|
|
185
|
+
control: 44,
|
|
186
|
+
dockPhone: 52,
|
|
187
|
+
headerButton: 40,
|
|
188
|
+
menuRow: 40,
|
|
189
|
+
menuRowPhone: 48,
|
|
190
|
+
toastMinHeight: 48,
|
|
191
|
+
handleWidth: 36,
|
|
192
|
+
handleHeight: 5
|
|
193
|
+
};
|
|
194
|
+
var durations = {
|
|
195
|
+
press: 150,
|
|
196
|
+
chromeFade: 250,
|
|
197
|
+
menu: 180,
|
|
198
|
+
toastIn: 200,
|
|
199
|
+
toastOut: 160,
|
|
200
|
+
card: 200,
|
|
201
|
+
sheet: 240,
|
|
202
|
+
scrim: 200,
|
|
203
|
+
move: 220,
|
|
204
|
+
enter: 220,
|
|
205
|
+
leave: 160,
|
|
206
|
+
copyMorph: 200,
|
|
207
|
+
copyReset: 2e3,
|
|
208
|
+
veil: 300,
|
|
209
|
+
avatarTurn: 300,
|
|
210
|
+
speakingLevel: 90,
|
|
211
|
+
landscapeHide: 4e3,
|
|
212
|
+
toastInfo: 5e3
|
|
213
|
+
};
|
|
214
|
+
var emphasized = Easing.bezier(0.16, 1, 0.3, 1);
|
|
215
|
+
var move = Easing.bezier(0.2, 0.8, 0.2, 1);
|
|
216
|
+
var easeOut = Easing.bezier(0, 0, 0.58, 1);
|
|
217
|
+
var standard = Easing.bezier(0.4, 0, 0.2, 1);
|
|
218
|
+
var easings = { emphasized, move, easeOut, standard, linear: Easing.linear };
|
|
219
|
+
var pressScale = { round: 0.94, pill: 0.97, small: 0.92, big: 0.98 };
|
|
220
|
+
|
|
221
|
+
// src/theme/theme.tsx
|
|
222
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
223
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
224
|
+
var themes = {
|
|
225
|
+
dark: { scheme: "dark", colors: palettes.dark, elevation: elevations.dark },
|
|
226
|
+
light: { scheme: "light", colors: palettes.light, elevation: elevations.light }
|
|
227
|
+
};
|
|
228
|
+
var ThemeContext = createContext2(themes.dark);
|
|
229
|
+
function ThemeProvider({ colorScheme, children }) {
|
|
230
|
+
return /* @__PURE__ */ jsx2(ThemeContext.Provider, { value: themes[colorScheme], children });
|
|
231
|
+
}
|
|
232
|
+
function useTheme() {
|
|
233
|
+
return useContext2(ThemeContext);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/primitives/ChalkText.tsx
|
|
237
|
+
import { Text } from "react-native";
|
|
238
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
239
|
+
function ChalkText({ variant = "body", tone = "text", color, tabular = false, style, ...rest }) {
|
|
240
|
+
const { colors } = useTheme();
|
|
241
|
+
const textStyle2 = [type[variant], { color: color ?? colors[tone] }, tabular ? TABULAR : null, style];
|
|
242
|
+
const ref = useMeasuredRef(rest.testID, textStyle2);
|
|
243
|
+
return /* @__PURE__ */ jsx3(Text, { ...rest, ref, style: textStyle2 });
|
|
244
|
+
}
|
|
245
|
+
var TABULAR = { fontVariant: ["tabular-nums"] };
|
|
246
|
+
|
|
247
|
+
// src/icons/Icon.tsx
|
|
248
|
+
import { memo } from "react";
|
|
249
|
+
import Svg, { Circle, Path, Rect } from "react-native-svg";
|
|
250
|
+
|
|
251
|
+
// src/icons/icon-paths.ts
|
|
252
|
+
var iconElements = {
|
|
253
|
+
mic: [
|
|
254
|
+
{ kind: "rect", x: 9, y: 2, width: 6, height: 12, rx: 3 },
|
|
255
|
+
{ kind: "path", d: "M19 10v1a7 7 0 0 1-14 0v-1M12 18v4" }
|
|
256
|
+
],
|
|
257
|
+
micOff: [{ kind: "path", d: "M2 2l20 20M15 9.3V5a3 3 0 0 0-5.7-1.3M9 9v2a3 3 0 0 0 5.1 2.1M17 17a7 7 0 0 1-12-6v-1M19 10v1a7 7 0 0 1-.1 1.2M12 18v4" }],
|
|
258
|
+
cam: [
|
|
259
|
+
{ kind: "path", d: "M16 10.5l5-3v9l-5-3z" },
|
|
260
|
+
{ kind: "rect", x: 2, y: 6, width: 14, height: 12, rx: 2 }
|
|
261
|
+
],
|
|
262
|
+
camOff: [{ kind: "path", d: "M2 2l20 20M10.7 6H14a2 2 0 0 1 2 2v3.3l1 1 4-2.8v8M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2" }],
|
|
263
|
+
down: [{ kind: "path", d: "M6 9l6 6 6-6" }],
|
|
264
|
+
shield: [{ kind: "path", d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }],
|
|
265
|
+
globe: [
|
|
266
|
+
{ kind: "circle", cx: 12, cy: 12, r: 9 },
|
|
267
|
+
{ kind: "path", d: "M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18" }
|
|
268
|
+
],
|
|
269
|
+
pause: [{ kind: "path", d: "M9 5v14M15 5v14", strokeWidth: 2.5 }],
|
|
270
|
+
shareOff: [
|
|
271
|
+
{ kind: "rect", x: 2, y: 3, width: 20, height: 14, rx: 2 },
|
|
272
|
+
{ kind: "path", d: "M8 21h8M12 17v4M9.5 7.5l5 5M14.5 7.5l-5 5" }
|
|
273
|
+
],
|
|
274
|
+
monitor: [
|
|
275
|
+
{ kind: "rect", x: 2, y: 3, width: 20, height: 14, rx: 2 },
|
|
276
|
+
{ kind: "path", d: "M8 21h8M12 17v4" }
|
|
277
|
+
],
|
|
278
|
+
appwin: [
|
|
279
|
+
{ kind: "rect", x: 3, y: 4, width: 18, height: 16, rx: 2 },
|
|
280
|
+
{ kind: "path", d: "M3 9h18M6.5 6.5h.01M9 6.5h.01" }
|
|
281
|
+
],
|
|
282
|
+
tabi: [
|
|
283
|
+
{ kind: "path", d: "M3 20V7a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v10z" },
|
|
284
|
+
{ kind: "path", d: "M3 11h18" }
|
|
285
|
+
],
|
|
286
|
+
swap: [{ kind: "path", d: "M17 3l4 4-4 4M21 7H9M7 21l-4-4 4-4M3 17h12" }],
|
|
287
|
+
fill: [
|
|
288
|
+
{ kind: "rect", x: 3, y: 5, width: 18, height: 14, rx: 2 },
|
|
289
|
+
{ kind: "path", d: "M7 12h10M7 12l2.5-2.5M7 12l2.5 2.5M17 12l-2.5-2.5M17 12l-2.5 2.5" }
|
|
290
|
+
],
|
|
291
|
+
fit: [
|
|
292
|
+
{ kind: "rect", x: 3, y: 5, width: 18, height: 14, rx: 2 },
|
|
293
|
+
{ kind: "rect", x: 7.5, y: 9, width: 9, height: 6, rx: 1 }
|
|
294
|
+
],
|
|
295
|
+
zoomIn: [
|
|
296
|
+
{ kind: "circle", cx: 11, cy: 11, r: 7 },
|
|
297
|
+
{ kind: "path", d: "M21 21l-4.3-4.3M8 11h6M11 8v6" }
|
|
298
|
+
],
|
|
299
|
+
zoomOut: [
|
|
300
|
+
{ kind: "circle", cx: 11, cy: 11, r: 7 },
|
|
301
|
+
{ kind: "path", d: "M21 21l-4.3-4.3M8 11h6" }
|
|
302
|
+
],
|
|
303
|
+
pip: [
|
|
304
|
+
{ kind: "rect", x: 2, y: 4, width: 20, height: 16, rx: 2 },
|
|
305
|
+
{ kind: "rect", x: 12, y: 12, width: 7, height: 5, rx: 1, fill: "currentColor" }
|
|
306
|
+
],
|
|
307
|
+
undo: [
|
|
308
|
+
{ kind: "path", d: "M9 14L4 9l5-5" },
|
|
309
|
+
{ kind: "path", d: "M4 9h10.5a5.5 5.5 0 0 1 0 11H11" }
|
|
310
|
+
],
|
|
311
|
+
redo: [
|
|
312
|
+
{ kind: "path", d: "M15 14l5-5-5-5" },
|
|
313
|
+
{ kind: "path", d: "M20 9H9.5a5.5 5.5 0 0 0 0 11H13" }
|
|
314
|
+
],
|
|
315
|
+
vol: [
|
|
316
|
+
{ kind: "path", d: "M11 5L6 9H2v6h4l5 4z" },
|
|
317
|
+
{ kind: "path", d: "M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14" }
|
|
318
|
+
],
|
|
319
|
+
qr: [
|
|
320
|
+
{ kind: "rect", x: 3, y: 3, width: 7, height: 7, rx: 1.5 },
|
|
321
|
+
{ kind: "rect", x: 14, y: 3, width: 7, height: 7, rx: 1.5 },
|
|
322
|
+
{ kind: "rect", x: 3, y: 14, width: 7, height: 7, rx: 1.5 },
|
|
323
|
+
{ kind: "path", d: "M14 14h3v3M21 14v.01M14 21h3M21 17v4h-1" }
|
|
324
|
+
],
|
|
325
|
+
up2: [{ kind: "path", d: "M18 15l-6-6-6 6" }],
|
|
326
|
+
right: [{ kind: "path", d: "M9 18l6-6-6-6" }],
|
|
327
|
+
share: [
|
|
328
|
+
{ kind: "rect", x: 2, y: 3, width: 20, height: 14, rx: 2 },
|
|
329
|
+
{ kind: "path", d: "M8 21h8M12 17v4M9 10l3-3 3 3M12 7v6" }
|
|
330
|
+
],
|
|
331
|
+
smile: [
|
|
332
|
+
{ kind: "circle", cx: 12, cy: 12, r: 9 },
|
|
333
|
+
{ kind: "path", d: "M8.5 14.5s1.3 1.8 3.5 1.8 3.5-1.8 3.5-1.8M9 9.5h.01M15 9.5h.01" }
|
|
334
|
+
],
|
|
335
|
+
pen: [
|
|
336
|
+
{ kind: "path", d: "M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5z" },
|
|
337
|
+
{ kind: "path", d: "M15 5l4 4" }
|
|
338
|
+
],
|
|
339
|
+
rec: [
|
|
340
|
+
{ kind: "circle", cx: 12, cy: 12, r: 9 },
|
|
341
|
+
{ kind: "circle", cx: 12, cy: 12, r: 3.5, fill: "currentColor" }
|
|
342
|
+
],
|
|
343
|
+
max: [{ kind: "path", d: "M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3" }],
|
|
344
|
+
min: [{ kind: "path", d: "M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M16 21v-3a2 2 0 0 1 2-2h3" }],
|
|
345
|
+
hang: [
|
|
346
|
+
{
|
|
347
|
+
kind: "path",
|
|
348
|
+
transform: "rotate(135 12 12)",
|
|
349
|
+
d: "M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z"
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
link: [
|
|
353
|
+
{ kind: "path", d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.8 1.7" },
|
|
354
|
+
{ kind: "path", d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7" }
|
|
355
|
+
],
|
|
356
|
+
chat: [{ kind: "path", d: "M7.9 20A9 9 0 1 0 4 16.1L2 22z" }],
|
|
357
|
+
grid: [
|
|
358
|
+
{ kind: "rect", x: 3, y: 3, width: 7.5, height: 7.5, rx: 1.5 },
|
|
359
|
+
{ kind: "rect", x: 13.5, y: 3, width: 7.5, height: 7.5, rx: 1.5 },
|
|
360
|
+
{ kind: "rect", x: 3, y: 13.5, width: 7.5, height: 7.5, rx: 1.5 },
|
|
361
|
+
{ kind: "rect", x: 13.5, y: 13.5, width: 7.5, height: 7.5, rx: 1.5 }
|
|
362
|
+
],
|
|
363
|
+
spot: [
|
|
364
|
+
{ kind: "rect", x: 3, y: 3, width: 18, height: 12.5, rx: 2 },
|
|
365
|
+
{ kind: "path", d: "M4 20.5h3M10.5 20.5h3M17 20.5h3" }
|
|
366
|
+
],
|
|
367
|
+
more: [{ kind: "path", d: "M5 12h.01M12 12h.01M19 12h.01", strokeWidth: 3 }],
|
|
368
|
+
x: [{ kind: "path", d: "M18 6L6 18M6 6l12 12" }],
|
|
369
|
+
clip: [{ kind: "path", d: "M20.5 11.2l-8.4 8.4a5 5 0 0 1-7.1-7.1l8.4-8.4a3.3 3.3 0 0 1 4.7 4.7l-8.4 8.4a1.7 1.7 0 0 1-2.4-2.4l7.7-7.7" }],
|
|
370
|
+
dl: [{ kind: "path", d: "M12 4v11M7 10.5l5 5 5-5M5 20h14" }],
|
|
371
|
+
left: [{ kind: "path", d: "M15 18l-6-6 6-6" }],
|
|
372
|
+
plus: [{ kind: "path", d: "M12 5v14M5 12h14" }],
|
|
373
|
+
alert: [
|
|
374
|
+
{ kind: "circle", cx: 12, cy: 12, r: 9 },
|
|
375
|
+
{ kind: "path", d: "M12 7.5v5.5M12 16.5v.01" }
|
|
376
|
+
],
|
|
377
|
+
lock: [
|
|
378
|
+
{ kind: "rect", x: 5, y: 11, width: 14, height: 9, rx: 2 },
|
|
379
|
+
{ kind: "path", d: "M8 11V8a4 4 0 0 1 8 0v3" }
|
|
380
|
+
],
|
|
381
|
+
clock: [
|
|
382
|
+
{ kind: "circle", cx: 12, cy: 12, r: 9 },
|
|
383
|
+
{ kind: "path", d: "M12 7v5l3 2" }
|
|
384
|
+
],
|
|
385
|
+
img: [
|
|
386
|
+
{ kind: "rect", x: 3, y: 4, width: 18, height: 16, rx: 2.5 },
|
|
387
|
+
{ kind: "circle", cx: 9, cy: 10, r: 1.8 },
|
|
388
|
+
{ kind: "path", d: "M21 15.5l-4.8-4.8L6 20" }
|
|
389
|
+
],
|
|
390
|
+
smileP: [
|
|
391
|
+
{ kind: "path", d: "M20.9 11a9 9 0 1 1-7.9-7.9" },
|
|
392
|
+
{ kind: "path", d: "M8.5 14.5s1.3 1.8 3.5 1.8 3.5-1.8 3.5-1.8M9 9.5h.01M15 9.5h.01M19 2v6M16 5h6" }
|
|
393
|
+
],
|
|
394
|
+
check: [{ kind: "path", d: "M20 6L9 17l-5-5" }],
|
|
395
|
+
hand: [
|
|
396
|
+
{ kind: "path", d: "M18 11V6a2 2 0 0 0-4 0v5M14 10V4a2 2 0 0 0-4 0v6M10 10.5V6a2 2 0 0 0-4 0v8" },
|
|
397
|
+
{ kind: "path", d: "M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.9-6-2.3l-3.6-3.6a2 2 0 0 1 2.8-2.8L7 15" }
|
|
398
|
+
],
|
|
399
|
+
pin: [{ kind: "path", d: "M12 17v5M9 10.8a2 2 0 0 1-1.1 1.8l-1.8.9A2 2 0 0 0 5 15.2V17h14v-1.8a2 2 0 0 0-1.1-1.8l-1.8-.9a2 2 0 0 1-1.1-1.8V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }],
|
|
400
|
+
search: [
|
|
401
|
+
{ kind: "circle", cx: 11, cy: 11, r: 7 },
|
|
402
|
+
{ kind: "path", d: "M21 21l-4.3-4.3" }
|
|
403
|
+
],
|
|
404
|
+
up: [{ kind: "path", d: "M12 19V5M5 12l7-7 7 7" }],
|
|
405
|
+
retry: [
|
|
406
|
+
{ kind: "path", d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" },
|
|
407
|
+
{ kind: "path", d: "M3 3v5h5" }
|
|
408
|
+
],
|
|
409
|
+
home: [{ kind: "path", d: "M3 10.5L12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z" }],
|
|
410
|
+
users: [
|
|
411
|
+
{ kind: "path", d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" },
|
|
412
|
+
{ kind: "circle", cx: 9, cy: 7, r: 4 },
|
|
413
|
+
{ kind: "path", d: "M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8" }
|
|
414
|
+
],
|
|
415
|
+
pointer: [{ kind: "path", d: "M4 4l7 17 2.5-7.5L21 11z" }],
|
|
416
|
+
square: [{ kind: "rect", x: 4, y: 4, width: 16, height: 16, rx: 2 }],
|
|
417
|
+
type: [{ kind: "path", d: "M4 7V4h16v3M9 20h6M12 4v16" }],
|
|
418
|
+
eraser: [{ kind: "path", d: "M7 21l-4.3-4.3a1 1 0 0 1 0-1.4l10-10a1 1 0 0 1 1.4 0l5.6 5.6a1 1 0 0 1 0 1.4L13 21M22 21H7M5 11l9 9" }],
|
|
419
|
+
copy: [
|
|
420
|
+
{ kind: "rect", x: 9, y: 9, width: 12, height: 12, rx: 2 },
|
|
421
|
+
{ kind: "path", d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }
|
|
422
|
+
],
|
|
423
|
+
edit: [
|
|
424
|
+
{ kind: "path", d: "M12 20h9" },
|
|
425
|
+
{ kind: "path", d: "M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z" }
|
|
426
|
+
],
|
|
427
|
+
flip: [
|
|
428
|
+
{ kind: "path", d: "M20 12a8 8 0 0 0-14.3-4.9M4 12a8 8 0 0 0 14.3 4.9" },
|
|
429
|
+
{ kind: "path", d: "M5.2 3.2v4.2h4.2M18.8 20.8v-4.2h-4.2" }
|
|
430
|
+
],
|
|
431
|
+
earpiece: [{ kind: "path", d: "M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z" }],
|
|
432
|
+
buds: [{ kind: "path", d: "M8 3.5A3.5 3.5 0 0 0 4.5 7v1A2.5 2.5 0 0 0 7 10.5h1V20a1.5 1.5 0 0 0 3 0V6.5A3 3 0 0 0 8 3.5zM16 3.5A3.5 3.5 0 0 1 19.5 7v1a2.5 2.5 0 0 1-2.5 2.5h-1V20a1.5 1.5 0 0 1-3 0V6.5a3 3 0 0 1 3-3z" }],
|
|
433
|
+
iosShare: [
|
|
434
|
+
{ kind: "path", d: "M12 3v12M8 7l4-4 4 4" },
|
|
435
|
+
{ kind: "path", d: "M8 10H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2h-2" }
|
|
436
|
+
],
|
|
437
|
+
paste: [
|
|
438
|
+
{ kind: "rect", x: 8, y: 2, width: 8, height: 4, rx: 1 },
|
|
439
|
+
{ kind: "path", d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }
|
|
440
|
+
],
|
|
441
|
+
file: [
|
|
442
|
+
{ kind: "path", d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" },
|
|
443
|
+
{ kind: "path", d: "M14 2v6h6" }
|
|
444
|
+
],
|
|
445
|
+
trash: [{ kind: "path", d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }],
|
|
446
|
+
moon: [{ kind: "path", d: "M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" }]
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// src/icons/Icon.tsx
|
|
450
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
451
|
+
var Icon = memo(function Icon2({ name, color, size = 20, strokeWidth = 1.75 }) {
|
|
452
|
+
return /* @__PURE__ */ jsx4(Svg, { accessibilityElementsHidden: true, fill: "none", height: size, importantForAccessibility: "no-hide-descendants", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth, viewBox: "0 0 24 24", width: size, children: iconElements[name].map((element, index) => renderElement(element, index, color)) });
|
|
453
|
+
});
|
|
454
|
+
function renderElement(element, key, color) {
|
|
455
|
+
const shared = { fill: element.fill === "currentColor" ? color : "none", strokeWidth: element.strokeWidth, transform: element.transform };
|
|
456
|
+
switch (element.kind) {
|
|
457
|
+
case "path":
|
|
458
|
+
return /* @__PURE__ */ jsx4(Path, { ...shared, d: element.d }, key);
|
|
459
|
+
case "rect":
|
|
460
|
+
return /* @__PURE__ */ jsx4(Rect, { ...shared, height: element.height, rx: element.rx, width: element.width, x: element.x, y: element.y }, key);
|
|
461
|
+
case "circle":
|
|
462
|
+
return /* @__PURE__ */ jsx4(Circle, { ...shared, cx: element.cx, cy: element.cy, r: element.r }, key);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// src/motion/press.ts
|
|
467
|
+
import { useCallback } from "react";
|
|
468
|
+
import { useAnimatedStyle, useSharedValue, withTiming as withTiming2 } from "react-native-reanimated";
|
|
469
|
+
|
|
470
|
+
// src/motion/motion.ts
|
|
471
|
+
import { ReduceMotion, useReducedMotion, withTiming } from "react-native-reanimated";
|
|
472
|
+
var timings = {
|
|
473
|
+
press: { duration: durations.press, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
474
|
+
fade: { duration: durations.chromeFade, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
475
|
+
menu: { duration: durations.menu, easing: easings.emphasized, reduceMotion: ReduceMotion.System },
|
|
476
|
+
toastIn: { duration: durations.toastIn, easing: easings.emphasized, reduceMotion: ReduceMotion.System },
|
|
477
|
+
toastOut: { duration: durations.toastOut, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
478
|
+
scrim: { duration: durations.scrim, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
479
|
+
sheet: { duration: durations.sheet, easing: easings.emphasized, reduceMotion: ReduceMotion.System },
|
|
480
|
+
move: { duration: durations.move, easing: easings.move, reduceMotion: ReduceMotion.System },
|
|
481
|
+
enter: { duration: durations.enter, easing: easings.move, reduceMotion: ReduceMotion.System },
|
|
482
|
+
leave: { duration: durations.leave, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
483
|
+
copyMorph: { duration: durations.copyMorph, easing: easings.emphasized, reduceMotion: ReduceMotion.System },
|
|
484
|
+
switch: { duration: durations.press, easing: easings.easeOut, reduceMotion: ReduceMotion.System },
|
|
485
|
+
avatarTurn: { duration: durations.avatarTurn, easing: easings.standard, reduceMotion: ReduceMotion.System },
|
|
486
|
+
level: { duration: durations.speakingLevel, easing: easings.linear, reduceMotion: ReduceMotion.System }
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
// src/motion/press.ts
|
|
490
|
+
function usePressAnimation(family) {
|
|
491
|
+
const down = useSharedValue(0);
|
|
492
|
+
const scale = useSharedValue(1);
|
|
493
|
+
const pressedScale = pressScale[family];
|
|
494
|
+
const onPressIn = useCallback(() => {
|
|
495
|
+
down.value = 1;
|
|
496
|
+
scale.value = withTiming2(pressedScale, timings.press);
|
|
497
|
+
}, [down, pressedScale, scale]);
|
|
498
|
+
const onPressOut = useCallback(() => {
|
|
499
|
+
down.value = 0;
|
|
500
|
+
scale.value = withTiming2(1, timings.press);
|
|
501
|
+
}, [down, scale]);
|
|
502
|
+
const scaleStyle = useAnimatedStyle(() => {
|
|
503
|
+
"worklet";
|
|
504
|
+
return { transform: [{ scale: scale.value }] };
|
|
505
|
+
});
|
|
506
|
+
return { down, onPressIn, onPressOut, scaleStyle };
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// src/primitives/IconButton.tsx
|
|
510
|
+
import { forwardRef, memo as memo2 } from "react";
|
|
511
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
512
|
+
import Animated, { useAnimatedStyle as useAnimatedStyle2 } from "react-native-reanimated";
|
|
513
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
514
|
+
var IconButton = memo2(
|
|
515
|
+
forwardRef(function IconButton2({ icon, accessibilityLabel, onPress, size = 44, tone = "raised", selected = false, off = false, caption, expanded, onCanvas = false, disabled = false, testID }, ref) {
|
|
516
|
+
const { colors, elevation } = useTheme();
|
|
517
|
+
const press = usePressAnimation("round");
|
|
518
|
+
const base = selected ? colors.text : BASE[tone](colors);
|
|
519
|
+
const pressedColor = selected ? colors.text : tone === "danger" ? colors.dangerPressed : colors.pressed;
|
|
520
|
+
const iconColor = selected ? colors.canvas : tone === "danger" ? fixed.onDanger : off ? colors.dangerText : tone === "ghost" ? colors.textMuted : colors.text;
|
|
521
|
+
const ring = onCanvas && elevation.ringOnCanvas && tone !== "danger";
|
|
522
|
+
const { down } = press;
|
|
523
|
+
const roundStyle = [styles.round, { width: size, height: size, borderRadius: size / 2 }, ring ? { boxShadow: `0px 0px 0px 1px ${colors.line}` } : null, disabled ? styles.disabled : null];
|
|
524
|
+
const roundRef = useMeasuredRef(testID, [roundStyle, { backgroundColor: base }]);
|
|
525
|
+
const background = useAnimatedStyle2(() => {
|
|
526
|
+
"worklet";
|
|
527
|
+
return { backgroundColor: down.value ? pressedColor : base };
|
|
528
|
+
});
|
|
529
|
+
return /* @__PURE__ */ jsxs(
|
|
530
|
+
Pressable,
|
|
531
|
+
{
|
|
532
|
+
accessibilityLabel,
|
|
533
|
+
accessibilityRole: "button",
|
|
534
|
+
accessibilityState: { selected, disabled, expanded },
|
|
535
|
+
disabled,
|
|
536
|
+
hitSlop: size < 44 ? (44 - size) / 2 : void 0,
|
|
537
|
+
onPress,
|
|
538
|
+
onPressIn: press.onPressIn,
|
|
539
|
+
onPressOut: press.onPressOut,
|
|
540
|
+
ref,
|
|
541
|
+
testID,
|
|
542
|
+
children: [
|
|
543
|
+
/* @__PURE__ */ jsx5(Animated.View, { ref: roundRef, style: [roundStyle, background, press.scaleStyle], children: /* @__PURE__ */ jsx5(Icon, { color: iconColor, name: icon, size: tone === "ghost" ? 18 : 20 }) }),
|
|
544
|
+
caption ? /* @__PURE__ */ jsx5(View, { pointerEvents: "none", style: styles.captionBox, children: /* @__PURE__ */ jsx5(ChalkText, { numberOfLines: 1, tone: "textMuted", variant: "caption", children: caption }) }) : null
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
);
|
|
548
|
+
})
|
|
549
|
+
);
|
|
550
|
+
var BASE = {
|
|
551
|
+
raised: (colors) => colors.raised,
|
|
552
|
+
surface: (colors) => colors.surface,
|
|
553
|
+
danger: (colors) => colors.danger,
|
|
554
|
+
ghost: () => fixed.transparent
|
|
555
|
+
};
|
|
556
|
+
var styles = StyleSheet.create({
|
|
557
|
+
round: { alignItems: "center", justifyContent: "center" },
|
|
558
|
+
disabled: { opacity: 0.45 },
|
|
559
|
+
// `.rl`: absolutely placed so the dock keeps its height; its bottom sits 17 pt below the button.
|
|
560
|
+
captionBox: { position: "absolute", left: -20, right: -20, bottom: -17, alignItems: "center" }
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
// src/primitives/PillButton.tsx
|
|
564
|
+
import { forwardRef as forwardRef2, memo as memo3 } from "react";
|
|
565
|
+
import { Pressable as Pressable2, StyleSheet as StyleSheet2 } from "react-native";
|
|
566
|
+
import Animated2 from "react-native-reanimated";
|
|
567
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
568
|
+
var HEIGHT = { sm: 32, md: 36, lg: 40, wide: 48, big: 52, inline: 40, card: 44, field: 48 };
|
|
569
|
+
var PADDING = { sm: 12, md: 14, lg: 14, wide: 14, big: 14, inline: 12, card: 14, field: 18 };
|
|
570
|
+
var TEXT = { sm: "button", md: "button", lg: "bodyStrong", wide: "wideButton", big: "sheetTitle", inline: "button", card: "button", field: "button" };
|
|
571
|
+
var ICON = { sm: 18, md: 18, lg: 18, wide: 18, big: 20, inline: 18, card: 18, field: 18 };
|
|
572
|
+
var PillButton = memo3(
|
|
573
|
+
forwardRef2(function PillButton2({ label, onPress, variant = "secondary", size = "md", icon, accessibilityLabel, disabled = false, testID }, ref) {
|
|
574
|
+
const { colors } = useTheme();
|
|
575
|
+
const press = usePressAnimation(size === "big" ? "big" : "pill");
|
|
576
|
+
const background = disabled ? colors.hover : variant === "primary" ? colors.text : variant === "danger" ? colors.danger : size === "big" ? colors.raised : colors.hover;
|
|
577
|
+
const foreground = disabled ? colors.textMuted : variant === "primary" ? colors.canvas : variant === "danger" ? fixed.onDanger : colors.text;
|
|
578
|
+
const full = size === "wide" || size === "big" || size === "card";
|
|
579
|
+
return /* @__PURE__ */ jsx6(Pressable2, { accessibilityLabel, accessibilityRole: "button", accessibilityState: { disabled }, disabled, onPress, onPressIn: press.onPressIn, onPressOut: press.onPressOut, ref, style: full ? styles2.full : null, testID, children: /* @__PURE__ */ jsxs2(Animated2.View, { style: [styles2.pill, { height: HEIGHT[size], paddingHorizontal: PADDING[size], backgroundColor: background }, press.scaleStyle], children: [
|
|
580
|
+
icon ? /* @__PURE__ */ jsx6(Icon, { color: foreground, name: icon, size: ICON[size] }) : null,
|
|
581
|
+
/* @__PURE__ */ jsx6(ChalkText, { color: foreground, numberOfLines: 1, variant: TEXT[size], children: label })
|
|
582
|
+
] }) });
|
|
583
|
+
})
|
|
584
|
+
);
|
|
585
|
+
var styles2 = StyleSheet2.create({
|
|
586
|
+
pill: { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 6, borderRadius: 999 },
|
|
587
|
+
full: { alignSelf: "stretch" }
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// src/primitives/announce.ts
|
|
591
|
+
import { AccessibilityInfo, Platform } from "react-native";
|
|
592
|
+
function announce(message) {
|
|
593
|
+
if (Platform.OS === "ios") AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true });
|
|
594
|
+
else AccessibilityInfo.announceForAccessibility(message);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// src/primitives/toast/ToastStack.tsx
|
|
598
|
+
import { createContext as createContext4, useContext as useContext4, useMemo as useMemo2, useState as useState2, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
599
|
+
import { StyleSheet as StyleSheet4, View as View3 } from "react-native";
|
|
600
|
+
import Animated3, { useReducedMotion as useReducedMotion2, withTiming as withTiming3 } from "react-native-reanimated";
|
|
601
|
+
|
|
602
|
+
// src/frame/portal.tsx
|
|
603
|
+
import { createContext as createContext3, Fragment, useContext as useContext3, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
604
|
+
import { Fragment as Fragment2, jsx as jsx7 } from "react/jsx-runtime";
|
|
605
|
+
function createPortalStore() {
|
|
606
|
+
let layers = { sheets: [], menus: [], toasts: [] };
|
|
607
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
608
|
+
const publish = (layer, next) => {
|
|
609
|
+
layers = { ...layers, [layer]: next };
|
|
610
|
+
for (const listener of listeners) listener();
|
|
611
|
+
};
|
|
612
|
+
return {
|
|
613
|
+
set(layer, key, node) {
|
|
614
|
+
const current = layers[layer];
|
|
615
|
+
const index = current.findIndex((entry) => entry.key === key);
|
|
616
|
+
publish(layer, index < 0 ? [...current, { key, node }] : current.map((entry) => entry.key === key ? { key, node } : entry));
|
|
617
|
+
},
|
|
618
|
+
remove(layer, key) {
|
|
619
|
+
publish(
|
|
620
|
+
layer,
|
|
621
|
+
layers[layer].filter((entry) => entry.key !== key)
|
|
622
|
+
);
|
|
623
|
+
},
|
|
624
|
+
subscribe(listener) {
|
|
625
|
+
listeners.add(listener);
|
|
626
|
+
return () => listeners.delete(listener);
|
|
627
|
+
},
|
|
628
|
+
entries: (layer) => layers[layer]
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
var PortalContext = createContext3(null);
|
|
632
|
+
function PortalProvider({ children }) {
|
|
633
|
+
const [store] = useState(createPortalStore);
|
|
634
|
+
return /* @__PURE__ */ jsx7(PortalContext.Provider, { value: store, children });
|
|
635
|
+
}
|
|
636
|
+
function usePortalStore() {
|
|
637
|
+
const store = useContext3(PortalContext);
|
|
638
|
+
if (!store) throw new Error("Chalk portals must be rendered inside <Chalk>.");
|
|
639
|
+
return store;
|
|
640
|
+
}
|
|
641
|
+
var nextKey = 0;
|
|
642
|
+
function Portal({ layer, children }) {
|
|
643
|
+
const store = usePortalStore();
|
|
644
|
+
const key = useRef(-1);
|
|
645
|
+
if (key.current < 0) key.current = nextKey++;
|
|
646
|
+
useLayoutEffect(() => {
|
|
647
|
+
store.set(layer, key.current, children);
|
|
648
|
+
});
|
|
649
|
+
useLayoutEffect(() => {
|
|
650
|
+
const own = key.current;
|
|
651
|
+
return () => store.remove(layer, own);
|
|
652
|
+
}, [layer, store]);
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
function PortalHost({ layer }) {
|
|
656
|
+
const entries = usePortalEntries(layer);
|
|
657
|
+
return /* @__PURE__ */ jsx7(Fragment2, { children: entries.map((entry) => /* @__PURE__ */ jsx7(Fragment, { children: entry.node }, entry.key)) });
|
|
658
|
+
}
|
|
659
|
+
function usePortalEntries(layer) {
|
|
660
|
+
const store = usePortalStore();
|
|
661
|
+
return useSyncExternalStore(
|
|
662
|
+
store.subscribe,
|
|
663
|
+
() => store.entries(layer),
|
|
664
|
+
() => store.entries(layer)
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
function usePortalCount(layer) {
|
|
668
|
+
const store = usePortalStore();
|
|
669
|
+
return useSyncExternalStore(
|
|
670
|
+
store.subscribe,
|
|
671
|
+
() => store.entries(layer).length,
|
|
672
|
+
() => store.entries(layer).length
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// src/primitives/toast/Toast.tsx
|
|
677
|
+
import { memo as memo4 } from "react";
|
|
678
|
+
import { StyleSheet as StyleSheet3, Text as Text2, View as View2 } from "react-native";
|
|
679
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
680
|
+
var Toast = memo4(function Toast2({ toast, onDismiss }) {
|
|
681
|
+
const { colors, elevation } = useTheme();
|
|
682
|
+
const parts = typeof toast.message === "string" ? [toast.message] : toast.message;
|
|
683
|
+
const testID = toast.testID ?? `toast.${toast.id}`;
|
|
684
|
+
const toastStyle = [styles3.toast, { backgroundColor: colors.popover, borderColor: colors.line, boxShadow: elevation.toast }];
|
|
685
|
+
const ref = useMeasuredRef(testID, toastStyle);
|
|
686
|
+
return /* @__PURE__ */ jsxs3(View2, { accessibilityLiveRegion: toast.kind === "error" ? "assertive" : "polite", accessibilityRole: toast.kind === "error" ? "alert" : "summary", ref, style: toastStyle, testID, children: [
|
|
687
|
+
toast.leading,
|
|
688
|
+
/* @__PURE__ */ jsx8(ChalkText, { numberOfLines: toast.wrap ? void 0 : 1, style: [styles3.message, toast.wrap ? styles3.wrapped : null], children: parts.map(
|
|
689
|
+
(part, index) => typeof part === "string" ? part : /* @__PURE__ */ jsx8(Text2, { style: styles3.strong, children: part.strong }, index)
|
|
690
|
+
) }),
|
|
691
|
+
toast.actions?.map((action) => /* @__PURE__ */ jsx8(PillButton, { label: action.label, onPress: action.onPress, testID: action.testID, variant: action.variant ?? "secondary" }, action.label)),
|
|
692
|
+
toast.dismissible ? /* @__PURE__ */ jsx8(IconButton, { accessibilityLabel: "Dismiss", icon: "x", onPress: onDismiss, size: 36, tone: "ghost" }) : null
|
|
693
|
+
] });
|
|
694
|
+
});
|
|
695
|
+
var styles3 = StyleSheet3.create({
|
|
696
|
+
toast: { flexDirection: "row", alignItems: "center", gap: 10, minHeight: 48, paddingVertical: 6, paddingRight: 6, paddingLeft: 14, borderWidth: 1, borderRadius: 12 },
|
|
697
|
+
message: { flexShrink: 1, marginRight: 4 },
|
|
698
|
+
wrapped: { lineHeight: 14 * 1.35, paddingVertical: 4 },
|
|
699
|
+
strong: { fontFamily: fontFamilies[600] }
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
// src/primitives/toast/toast-store.ts
|
|
703
|
+
var MAX_VISIBLE = 3;
|
|
704
|
+
function messageText(message) {
|
|
705
|
+
return typeof message === "string" ? message : message.map((part) => typeof part === "string" ? part : part.strong).join("");
|
|
706
|
+
}
|
|
707
|
+
function createToastStore() {
|
|
708
|
+
let toasts = [];
|
|
709
|
+
let nextId = 0;
|
|
710
|
+
const timers = /* @__PURE__ */ new Map();
|
|
711
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
712
|
+
const publish = (next) => {
|
|
713
|
+
toasts = next;
|
|
714
|
+
for (const listener of listeners) listener();
|
|
715
|
+
};
|
|
716
|
+
const dismiss = (id) => {
|
|
717
|
+
clearTimeout(timers.get(id));
|
|
718
|
+
timers.delete(id);
|
|
719
|
+
if (toasts.some((toast) => toast.id === id)) publish(toasts.filter((toast) => toast.id !== id));
|
|
720
|
+
};
|
|
721
|
+
return {
|
|
722
|
+
show(input) {
|
|
723
|
+
const toast = { ...input, id: ++nextId, kind: input.kind ?? "info" };
|
|
724
|
+
const kept = toasts.slice(Math.max(0, toasts.length - (MAX_VISIBLE - 1)));
|
|
725
|
+
for (const dropped of toasts.slice(0, toasts.length - kept.length)) dismiss(dropped.id);
|
|
726
|
+
publish([...kept, toast]);
|
|
727
|
+
if (toast.kind === "info")
|
|
728
|
+
timers.set(
|
|
729
|
+
toast.id,
|
|
730
|
+
setTimeout(() => dismiss(toast.id), durations.toastInfo)
|
|
731
|
+
);
|
|
732
|
+
announce(messageText(toast.message));
|
|
733
|
+
return toast.id;
|
|
734
|
+
},
|
|
735
|
+
dismiss,
|
|
736
|
+
clear() {
|
|
737
|
+
for (const toast of toasts) dismiss(toast.id);
|
|
738
|
+
},
|
|
739
|
+
subscribe(listener) {
|
|
740
|
+
listeners.add(listener);
|
|
741
|
+
return () => listeners.delete(listener);
|
|
742
|
+
},
|
|
743
|
+
getSnapshot: () => toasts
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// src/primitives/toast/ToastStack.tsx
|
|
748
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
749
|
+
var ToastContext = createContext4(null);
|
|
750
|
+
var ToastClearanceContext = createContext4(null);
|
|
751
|
+
function ToastProvider({ children }) {
|
|
752
|
+
const [store] = useState2(createToastStore);
|
|
753
|
+
const [bottom, setBottom] = useState2(null);
|
|
754
|
+
const clearance = useMemo2(() => ({ bottom, setBottom }), [bottom]);
|
|
755
|
+
return /* @__PURE__ */ jsx9(ToastContext.Provider, { value: store, children: /* @__PURE__ */ jsx9(ToastClearanceContext.Provider, { value: clearance, children }) });
|
|
756
|
+
}
|
|
757
|
+
function useToasts() {
|
|
758
|
+
const store = useContext4(ToastContext);
|
|
759
|
+
if (!store) throw new Error("useToasts must be used inside <Chalk>.");
|
|
760
|
+
return store;
|
|
761
|
+
}
|
|
762
|
+
function useToastClearance() {
|
|
763
|
+
const clearance = useContext4(ToastClearanceContext);
|
|
764
|
+
if (!clearance) throw new Error("useToastClearance must be used inside <Chalk>.");
|
|
765
|
+
return clearance.setBottom;
|
|
766
|
+
}
|
|
767
|
+
function ToastStack() {
|
|
768
|
+
const store = useContext4(ToastContext);
|
|
769
|
+
const clearance = useContext4(ToastClearanceContext);
|
|
770
|
+
if (!store || !clearance) throw new Error("ToastStack must be inside <Chalk>.");
|
|
771
|
+
const toasts = useSyncExternalStore2(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
772
|
+
const layout = useDeviceLayout();
|
|
773
|
+
const sheetUp = usePortalCount("sheets") > 0;
|
|
774
|
+
const reduceMotion = useReducedMotion2();
|
|
775
|
+
const atTop = layout.phone && sheetUp;
|
|
776
|
+
const offset = layout.arrangement === "pad" ? 88 : layout.arrangement === "landscape" ? 70 : 76;
|
|
777
|
+
const position = atTop ? { top: layout.insets.top + 8, flexDirection: "column-reverse" } : { bottom: layout.insets.bottom + (clearance.bottom ?? offset) };
|
|
778
|
+
return /* @__PURE__ */ jsx9(View3, { pointerEvents: "box-none", style: [styles4.stack, position], testID: "frame.toasts", children: toasts.map((toast) => /* @__PURE__ */ jsx9(Animated3.View, { entering: reduceMotion ? void 0 : toastEntering, exiting: reduceMotion ? void 0 : toastExiting, style: { maxWidth: layout.width - 32 }, children: /* @__PURE__ */ jsx9(Toast, { onDismiss: () => store.dismiss(toast.id), toast }) }, toast.id)) });
|
|
779
|
+
}
|
|
780
|
+
var toastEntering = () => {
|
|
781
|
+
"worklet";
|
|
782
|
+
return {
|
|
783
|
+
initialValues: { opacity: 0, transform: [{ translateY: 8 }] },
|
|
784
|
+
animations: { opacity: withTiming3(1, timings.toastIn), transform: [{ translateY: withTiming3(0, timings.toastIn) }] }
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
var toastExiting = () => {
|
|
788
|
+
"worklet";
|
|
789
|
+
return {
|
|
790
|
+
initialValues: { opacity: 1, transform: [{ translateY: 0 }] },
|
|
791
|
+
animations: { opacity: withTiming3(0, timings.toastOut), transform: [{ translateY: withTiming3(4, timings.toastOut) }] }
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
var styles4 = StyleSheet4.create({
|
|
795
|
+
stack: { position: "absolute", left: 0, right: 0, alignItems: "center", gap: 8 }
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// src/primitives/BottomSheet.tsx
|
|
799
|
+
import { createContext as createContext5, useCallback as useCallback2, useContext as useContext5, useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
|
|
800
|
+
import { AccessibilityInfo as AccessibilityInfo2, findNodeHandle, Pressable as Pressable3, StyleSheet as StyleSheet5, View as View4 } from "react-native";
|
|
801
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
802
|
+
import Animated4, { runOnJS, useAnimatedKeyboard, useAnimatedStyle as useAnimatedStyle3, useReducedMotion as useReducedMotion3, useSharedValue as useSharedValue2, withTiming as withTiming4 } from "react-native-reanimated";
|
|
803
|
+
|
|
804
|
+
// src/frame/back-handler.ts
|
|
805
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
806
|
+
import { BackHandler } from "react-native";
|
|
807
|
+
function useBackHandler(active, onBack) {
|
|
808
|
+
const latest = useRef2(onBack);
|
|
809
|
+
latest.current = onBack;
|
|
810
|
+
useEffect(() => {
|
|
811
|
+
if (!active) return;
|
|
812
|
+
const subscription = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
813
|
+
latest.current();
|
|
814
|
+
return true;
|
|
815
|
+
});
|
|
816
|
+
return () => subscription.remove();
|
|
817
|
+
}, [active]);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// src/haptics/haptics.ts
|
|
821
|
+
import { impactAsync, ImpactFeedbackStyle, NotificationFeedbackType, notificationAsync, selectionAsync } from "expo-haptics";
|
|
822
|
+
var haptics = {
|
|
823
|
+
mute: () => fire(impactAsync(ImpactFeedbackStyle.Light)),
|
|
824
|
+
handRaise: () => fire(impactAsync(ImpactFeedbackStyle.Medium)),
|
|
825
|
+
leave: () => fire(notificationAsync(NotificationFeedbackType.Warning)),
|
|
826
|
+
sheetDetent: () => fire(selectionAsync())
|
|
827
|
+
};
|
|
828
|
+
function fire(feedback) {
|
|
829
|
+
feedback.catch(() => void 0);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
// src/primitives/BottomSheet.tsx
|
|
833
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
834
|
+
var CLOSE_DISTANCE = 80;
|
|
835
|
+
var BOTTOM_PADDING = 10;
|
|
836
|
+
var KEYBOARD_PADDING = 12;
|
|
837
|
+
var SheetDragContext = createContext5(null);
|
|
838
|
+
function BottomSheet({ open, onClose, accessibilityLabel, children, title, heightRatio, inset = 12, variant = "sheet", returnFocusRef, testID }) {
|
|
839
|
+
const { colors } = useTheme();
|
|
840
|
+
const layout = useDeviceLayout();
|
|
841
|
+
const reduceMotion = useReducedMotion3();
|
|
842
|
+
const keyboard = useAnimatedKeyboard();
|
|
843
|
+
const [mounted, setMounted] = useState3(open);
|
|
844
|
+
const height = useSharedValue2(0);
|
|
845
|
+
const offset = useSharedValue2(layout.height);
|
|
846
|
+
const drag = useSharedValue2(0);
|
|
847
|
+
const shown = useSharedValue2(0);
|
|
848
|
+
const titleRef = useRef3(null);
|
|
849
|
+
useBackHandler(open, onClose);
|
|
850
|
+
const show = useCallback2(() => {
|
|
851
|
+
drag.value = 0;
|
|
852
|
+
if (reduceMotion) {
|
|
853
|
+
offset.value = 0;
|
|
854
|
+
shown.value = 1;
|
|
855
|
+
} else {
|
|
856
|
+
offset.value = withTiming4(0, timings.sheet);
|
|
857
|
+
shown.value = withTiming4(1, timings.scrim);
|
|
858
|
+
}
|
|
859
|
+
const node = titleRef.current && findNodeHandle(titleRef.current);
|
|
860
|
+
if (node) setTimeout(() => AccessibilityInfo2.setAccessibilityFocus(node), durations.sheet);
|
|
861
|
+
}, [drag, offset, reduceMotion, shown]);
|
|
862
|
+
const hide = useCallback2(() => {
|
|
863
|
+
if (reduceMotion) {
|
|
864
|
+
shown.value = 0;
|
|
865
|
+
offset.value = height.value || layout.height;
|
|
866
|
+
setMounted(false);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
const finish = (finished) => {
|
|
870
|
+
"worklet";
|
|
871
|
+
if (finished) runOnJS(setMounted)(false);
|
|
872
|
+
};
|
|
873
|
+
shown.value = withTiming4(0, timings.scrim);
|
|
874
|
+
offset.value = withTiming4(height.value || layout.height, timings.sheet, finish);
|
|
875
|
+
}, [height, layout.height, offset, reduceMotion, shown]);
|
|
876
|
+
const wasOpen = useRef3(open);
|
|
877
|
+
useEffect2(() => {
|
|
878
|
+
if (open === wasOpen.current) return;
|
|
879
|
+
wasOpen.current = open;
|
|
880
|
+
if (!open) return hide();
|
|
881
|
+
setMounted(true);
|
|
882
|
+
if (height.value > 0) show();
|
|
883
|
+
}, [height, hide, open, show]);
|
|
884
|
+
const wasMounted = useRef3(mounted);
|
|
885
|
+
useEffect2(() => {
|
|
886
|
+
const closed = wasMounted.current && !mounted;
|
|
887
|
+
wasMounted.current = mounted;
|
|
888
|
+
if (!closed || !returnFocusRef?.current) return;
|
|
889
|
+
const node = findNodeHandle(returnFocusRef.current);
|
|
890
|
+
if (node) AccessibilityInfo2.setAccessibilityFocus(node);
|
|
891
|
+
}, [mounted, returnFocusRef]);
|
|
892
|
+
const onLayout = useCallback2(
|
|
893
|
+
(event) => {
|
|
894
|
+
const first = height.value === 0;
|
|
895
|
+
const measured = event.nativeEvent.layout.height;
|
|
896
|
+
height.value = measured;
|
|
897
|
+
if (!first || !open) return;
|
|
898
|
+
offset.value = reduceMotion ? 0 : measured;
|
|
899
|
+
show();
|
|
900
|
+
},
|
|
901
|
+
[height, offset, open, reduceMotion, show]
|
|
902
|
+
);
|
|
903
|
+
const card = variant === "card";
|
|
904
|
+
const sheetStyle = useAnimatedStyle3(() => {
|
|
905
|
+
"worklet";
|
|
906
|
+
return {
|
|
907
|
+
opacity: reduceMotion ? shown.value : 1,
|
|
908
|
+
paddingBottom: card ? 0 : keyboard.height.value > 0 ? KEYBOARD_PADDING : layout.insets.bottom + BOTTOM_PADDING,
|
|
909
|
+
maxHeight: layout.height - layout.insets.top - 8 - keyboard.height.value,
|
|
910
|
+
transform: [{ translateY: offset.value + drag.value - keyboard.height.value }]
|
|
911
|
+
};
|
|
912
|
+
});
|
|
913
|
+
const scrimStyle = useAnimatedStyle3(() => {
|
|
914
|
+
"worklet";
|
|
915
|
+
return { opacity: shown.value };
|
|
916
|
+
});
|
|
917
|
+
const width = layout.arrangement === "pad" ? 440 : layout.arrangement === "landscape" ? 460 : layout.width;
|
|
918
|
+
const surfaceStyle = [
|
|
919
|
+
styles5.sheet,
|
|
920
|
+
{ backgroundColor: variant === "popover" ? colors.popover : colors.surface, width, left: (layout.width - width) / 2, paddingHorizontal: card ? 0 : inset },
|
|
921
|
+
card ? { borderTopWidth: 1, borderColor: colors.line } : null,
|
|
922
|
+
variant === "popover" ? { borderTopWidth: 1, borderColor: colors.lineStrong } : null,
|
|
923
|
+
heightRatio ? { height: layout.height * heightRatio } : null
|
|
924
|
+
];
|
|
925
|
+
const surfaceRef = useMeasuredRef(testID, surfaceStyle);
|
|
926
|
+
if (!mounted) return null;
|
|
927
|
+
return /* @__PURE__ */ jsxs4(Portal, { layer: "sheets", children: [
|
|
928
|
+
/* @__PURE__ */ jsx10(Animated4.View, { style: [StyleSheet5.absoluteFill, { backgroundColor: fixed.scrim }, scrimStyle], children: /* @__PURE__ */ jsx10(Pressable3, { accessible: false, onPress: onClose, style: StyleSheet5.absoluteFill, testID: testID ? `${testID}.scrim` : void 0 }) }),
|
|
929
|
+
/* @__PURE__ */ jsx10(SheetDragContext.Provider, { value: { drag, close: onClose }, children: /* @__PURE__ */ jsxs4(Animated4.View, { accessibilityLabel, accessibilityViewIsModal: true, onAccessibilityEscape: onClose, onLayout, ref: surfaceRef, style: [surfaceStyle, sheetStyle], testID, children: [
|
|
930
|
+
/* @__PURE__ */ jsxs4(SheetDragRegion, { children: [
|
|
931
|
+
/* @__PURE__ */ jsx10(View4, { accessibilityLabel: title ? void 0 : accessibilityLabel, accessibilityRole: title ? void 0 : "header", accessible: !title, ref: title ? void 0 : titleRef, style: card ? styles5.cardGrabArea : styles5.grabArea, testID: testID ? `${testID}.grabber` : void 0, children: /* @__PURE__ */ jsx10(View4, { style: [styles5.grabber, { backgroundColor: colors.lineStrong }] }) }),
|
|
932
|
+
title ? /* @__PURE__ */ jsx10(View4, { accessibilityRole: "header", accessible: true, ref: titleRef, style: styles5.header, children: /* @__PURE__ */ jsx10(ChalkText, { numberOfLines: 1, variant: "sheetTitle", children: title }) }) : null
|
|
933
|
+
] }),
|
|
934
|
+
children
|
|
935
|
+
] }) })
|
|
936
|
+
] });
|
|
937
|
+
}
|
|
938
|
+
function SheetDragRegion({ children }) {
|
|
939
|
+
const sheet = useContext5(SheetDragContext);
|
|
940
|
+
if (!sheet) throw new Error("SheetDragRegion must be inside a BottomSheet.");
|
|
941
|
+
const { drag, close } = sheet;
|
|
942
|
+
const gesture = Gesture.Pan().activeOffsetY(4).onUpdate((event) => {
|
|
943
|
+
"worklet";
|
|
944
|
+
const next = Math.max(0, event.translationY);
|
|
945
|
+
if (next > CLOSE_DISTANCE !== drag.value > CLOSE_DISTANCE) runOnJS(haptics.sheetDetent)();
|
|
946
|
+
drag.value = next;
|
|
947
|
+
}).onEnd(() => {
|
|
948
|
+
"worklet";
|
|
949
|
+
if (drag.value > CLOSE_DISTANCE) runOnJS(close)();
|
|
950
|
+
else drag.value = withTiming4(0, timings.sheet);
|
|
951
|
+
});
|
|
952
|
+
return /* @__PURE__ */ jsx10(GestureDetector, { gesture, children: /* @__PURE__ */ jsx10(View4, { collapsable: false, children }) });
|
|
953
|
+
}
|
|
954
|
+
var styles5 = StyleSheet5.create({
|
|
955
|
+
sheet: { position: "absolute", bottom: 0, paddingTop: 8, borderTopLeftRadius: radii.sheet, borderTopRightRadius: radii.sheet },
|
|
956
|
+
grabArea: { alignItems: "center", paddingTop: 4, paddingBottom: 12 },
|
|
957
|
+
cardGrabArea: { alignItems: "center" },
|
|
958
|
+
grabber: { width: 36, height: 5, borderRadius: 3 },
|
|
959
|
+
header: { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: 4, paddingHorizontal: 8, paddingBottom: 14 }
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
// src/primitives/Menu.tsx
|
|
963
|
+
import { createContext as createContext6, useCallback as useCallback3, useContext as useContext6, useEffect as useEffect3, useLayoutEffect as useLayoutEffect2, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from "react";
|
|
964
|
+
import { AccessibilityInfo as AccessibilityInfo3, findNodeHandle as findNodeHandle2, Keyboard, Pressable as Pressable4, ScrollView, StyleSheet as StyleSheet6, View as View5 } from "react-native";
|
|
965
|
+
import Animated5, { useAnimatedStyle as useAnimatedStyle4, useReducedMotion as useReducedMotion4, useSharedValue as useSharedValue3, withTiming as withTiming5 } from "react-native-reanimated";
|
|
966
|
+
|
|
967
|
+
// src/primitives/menu-placement.ts
|
|
968
|
+
var GAP = 6;
|
|
969
|
+
var MARGIN = 8;
|
|
970
|
+
function placeMenu(trigger, menu, screen, insets, keyboardHeight = 0) {
|
|
971
|
+
const top = insets.top + MARGIN;
|
|
972
|
+
const bottom = screen.height - Math.max(insets.bottom, keyboardHeight) - MARGIN;
|
|
973
|
+
const left = insets.left + MARGIN;
|
|
974
|
+
const right = screen.width - insets.right - MARGIN;
|
|
975
|
+
const maxHeight = menu.height > bottom - top ? bottom - top : null;
|
|
976
|
+
const height = maxHeight ?? menu.height;
|
|
977
|
+
const roomBelow = bottom - (trigger.y + trigger.height + GAP);
|
|
978
|
+
const roomAbove = trigger.y - GAP - top;
|
|
979
|
+
const below = height <= roomBelow || roomBelow >= roomAbove;
|
|
980
|
+
const y = below ? trigger.y + trigger.height + GAP : trigger.y - GAP - height;
|
|
981
|
+
return {
|
|
982
|
+
x: clamp(trigger.x + trigger.width / 2 - menu.width / 2, left, right - menu.width),
|
|
983
|
+
y: clamp(y, top, bottom - height),
|
|
984
|
+
maxHeight,
|
|
985
|
+
side: below ? "below" : "above"
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
function clamp(value, min, max) {
|
|
989
|
+
return Math.max(min, Math.min(max, value));
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// src/primitives/Menu.tsx
|
|
993
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
994
|
+
var MenuFocusContext = createContext6(null);
|
|
995
|
+
function Menu({ open, onClose, anchorRef, accessibilityLabel, children, minWidth = 250, testID }) {
|
|
996
|
+
const { colors, elevation } = useTheme();
|
|
997
|
+
const layout = useDeviceLayout();
|
|
998
|
+
const reduceMotion = useReducedMotion4();
|
|
999
|
+
const [trigger, setTrigger] = useState4(null);
|
|
1000
|
+
const [placement, setPlacement] = useState4(null);
|
|
1001
|
+
const firstItem = useRef4(null);
|
|
1002
|
+
const keyboardHeight = useKeyboardHeight();
|
|
1003
|
+
const shown = useSharedValue3(0);
|
|
1004
|
+
useBackHandler(open, onClose);
|
|
1005
|
+
useEffect3(() => {
|
|
1006
|
+
if (!open) {
|
|
1007
|
+
firstItem.current = null;
|
|
1008
|
+
setTrigger(null);
|
|
1009
|
+
setPlacement(null);
|
|
1010
|
+
shown.value = 0;
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
anchorRef.current?.measureInWindow((x, y, width, height) => setTrigger({ x, y, width, height }));
|
|
1014
|
+
}, [anchorRef, open, shown]);
|
|
1015
|
+
const viewport = `${layout.width}x${layout.height}`;
|
|
1016
|
+
const openedIn = useRef4(viewport);
|
|
1017
|
+
useEffect3(() => {
|
|
1018
|
+
if (!open) openedIn.current = viewport;
|
|
1019
|
+
else if (viewport !== openedIn.current) onClose();
|
|
1020
|
+
}, [onClose, open, viewport]);
|
|
1021
|
+
const wasOpen = useRef4(open);
|
|
1022
|
+
useEffect3(() => {
|
|
1023
|
+
const closed = wasOpen.current && !open;
|
|
1024
|
+
wasOpen.current = open;
|
|
1025
|
+
if (!closed || !anchorRef.current) return;
|
|
1026
|
+
const node = findNodeHandle2(anchorRef.current);
|
|
1027
|
+
if (node) AccessibilityInfo3.setAccessibilityFocus(node);
|
|
1028
|
+
}, [anchorRef, open]);
|
|
1029
|
+
const onLayout = useCallback3(
|
|
1030
|
+
(event) => {
|
|
1031
|
+
if (!trigger || placement) return;
|
|
1032
|
+
const { width, height } = event.nativeEvent.layout;
|
|
1033
|
+
setPlacement(placeMenu(trigger, { width, height }, layout, layout.insets, keyboardHeight));
|
|
1034
|
+
shown.value = reduceMotion ? 1 : withTiming5(1, timings.menu);
|
|
1035
|
+
},
|
|
1036
|
+
[keyboardHeight, layout, placement, reduceMotion, shown, trigger]
|
|
1037
|
+
);
|
|
1038
|
+
useEffect3(() => {
|
|
1039
|
+
if (!placement || !firstItem.current) return;
|
|
1040
|
+
const node = findNodeHandle2(firstItem.current);
|
|
1041
|
+
if (node) AccessibilityInfo3.setAccessibilityFocus(node);
|
|
1042
|
+
}, [placement]);
|
|
1043
|
+
const surfaceStyle = useAnimatedStyle4(() => {
|
|
1044
|
+
"worklet";
|
|
1045
|
+
return { opacity: shown.value, transform: [{ translateY: reduceMotion ? 0 : (1 - shown.value) * 4 }] };
|
|
1046
|
+
});
|
|
1047
|
+
const focus = useMemo3(
|
|
1048
|
+
() => ({
|
|
1049
|
+
claim: (node) => {
|
|
1050
|
+
firstItem.current ??= node;
|
|
1051
|
+
}
|
|
1052
|
+
}),
|
|
1053
|
+
[]
|
|
1054
|
+
);
|
|
1055
|
+
const surfaceStatic = [styles6.surface, { minWidth, backgroundColor: colors.popover, borderColor: colors.lineStrong, boxShadow: elevation.popover }, placement ? { left: placement.x, top: placement.y, maxHeight: placement.maxHeight ?? void 0 } : styles6.measuring];
|
|
1056
|
+
const surfaceRef = useMeasuredRef(testID, surfaceStatic);
|
|
1057
|
+
if (!open || !trigger) return null;
|
|
1058
|
+
return /* @__PURE__ */ jsxs5(Portal, { layer: "menus", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx11(Pressable4, { accessible: false, onPress: onClose, style: StyleSheet6.absoluteFill, testID: testID ? `${testID}.backdrop` : void 0 }),
|
|
1060
|
+
/* @__PURE__ */ jsx11(Animated5.View, { accessibilityLabel, accessibilityRole: "menu", accessibilityViewIsModal: true, onAccessibilityEscape: onClose, onLayout, ref: surfaceRef, style: [surfaceStatic, surfaceStyle], testID, children: /* @__PURE__ */ jsx11(MenuFocusContext.Provider, { value: focus, children: /* @__PURE__ */ jsx11(ScrollView, { bounces: false, scrollEnabled: placement?.maxHeight != null, children }) }) })
|
|
1061
|
+
] });
|
|
1062
|
+
}
|
|
1063
|
+
function MenuItem({ label, onPress, icon, detail, trailing, checked, danger = false, testID }) {
|
|
1064
|
+
const { colors } = useTheme();
|
|
1065
|
+
const { phone } = useDeviceLayout();
|
|
1066
|
+
const focus = useContext6(MenuFocusContext);
|
|
1067
|
+
const ref = useRef4(null);
|
|
1068
|
+
useLayoutEffect2(() => {
|
|
1069
|
+
if (ref.current) focus?.claim(ref.current);
|
|
1070
|
+
}, [focus]);
|
|
1071
|
+
const tone = danger ? "dangerText" : "text";
|
|
1072
|
+
return /* @__PURE__ */ jsxs5(
|
|
1073
|
+
Pressable4,
|
|
1074
|
+
{
|
|
1075
|
+
accessibilityLabel: trailing ? `${label}, ${trailing}` : label,
|
|
1076
|
+
accessibilityRole: "menuitem",
|
|
1077
|
+
accessibilityState: checked === void 0 ? void 0 : { checked },
|
|
1078
|
+
onPress,
|
|
1079
|
+
ref,
|
|
1080
|
+
style: ({ pressed }) => [styles6.item, { minHeight: phone ? sizes.menuRowPhone : sizes.menuRow }, pressed ? { backgroundColor: colors.hover } : null],
|
|
1081
|
+
testID,
|
|
1082
|
+
children: [
|
|
1083
|
+
checked === void 0 ? null : /* @__PURE__ */ jsx11(View5, { style: styles6.check, children: checked ? /* @__PURE__ */ jsx11(Icon, { color: colors.text, name: "check", size: 18 }) : null }),
|
|
1084
|
+
icon ? /* @__PURE__ */ jsx11(Icon, { color: danger ? colors.dangerText : colors.textMuted, name: icon, size: 18 }) : null,
|
|
1085
|
+
/* @__PURE__ */ jsxs5(View5, { style: styles6.labels, children: [
|
|
1086
|
+
/* @__PURE__ */ jsx11(ChalkText, { numberOfLines: 1, tone, children: label }),
|
|
1087
|
+
detail ? /* @__PURE__ */ jsx11(ChalkText, { tone: "textMuted", variant: "label", children: detail }) : null
|
|
1088
|
+
] }),
|
|
1089
|
+
trailing ? /* @__PURE__ */ jsx11(ChalkText, { tone: "textMuted", variant: "meta", children: trailing }) : null
|
|
1090
|
+
]
|
|
1091
|
+
}
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
function MenuSection({ label }) {
|
|
1095
|
+
return /* @__PURE__ */ jsx11(View5, { accessibilityRole: "header", accessible: true, style: styles6.section, children: /* @__PURE__ */ jsx11(ChalkText, { tone: "textMuted", variant: "section", children: label }) });
|
|
1096
|
+
}
|
|
1097
|
+
function useKeyboardHeight() {
|
|
1098
|
+
const [height, setHeight] = useState4(0);
|
|
1099
|
+
useEffect3(() => {
|
|
1100
|
+
const show = Keyboard.addListener("keyboardDidShow", (event) => setHeight(event.endCoordinates.height));
|
|
1101
|
+
const hide = Keyboard.addListener("keyboardDidHide", () => setHeight(0));
|
|
1102
|
+
return () => {
|
|
1103
|
+
show.remove();
|
|
1104
|
+
hide.remove();
|
|
1105
|
+
};
|
|
1106
|
+
}, []);
|
|
1107
|
+
return height;
|
|
1108
|
+
}
|
|
1109
|
+
var styles6 = StyleSheet6.create({
|
|
1110
|
+
surface: { position: "absolute", padding: 6, borderWidth: 1, borderRadius: radii.menu },
|
|
1111
|
+
measuring: { left: 0, top: 0, opacity: 0 },
|
|
1112
|
+
item: { flexDirection: "row", alignItems: "center", gap: 10, paddingHorizontal: 10, borderRadius: radii.menuRow },
|
|
1113
|
+
check: { width: 18, alignItems: "center" },
|
|
1114
|
+
labels: { flex: 1, minWidth: 0, gap: 2 },
|
|
1115
|
+
section: { paddingTop: 8, paddingHorizontal: 10, paddingBottom: 4 },
|
|
1116
|
+
separator: { height: 1, marginVertical: 6, marginHorizontal: 4 }
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
// src/primitives/SheetGroup.tsx
|
|
1120
|
+
import { Children, Fragment as Fragment3 } from "react";
|
|
1121
|
+
import { Pressable as Pressable5, StyleSheet as StyleSheet7, View as View6 } from "react-native";
|
|
1122
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1123
|
+
function SheetGroup({ children, testID }) {
|
|
1124
|
+
const { colors } = useTheme();
|
|
1125
|
+
const rows = Children.toArray(children);
|
|
1126
|
+
return /* @__PURE__ */ jsx12(View6, { style: [styles7.group, { backgroundColor: colors.raised }], testID, children: rows.map((row, index) => /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
1127
|
+
index > 0 ? /* @__PURE__ */ jsx12(View6, { style: [styles7.divider, { backgroundColor: colors.line }] }) : null,
|
|
1128
|
+
row
|
|
1129
|
+
] }, index)) });
|
|
1130
|
+
}
|
|
1131
|
+
function SheetRow({ label, icon, end, badge, accessibilityLabel = label, onPress, danger = false, testID }) {
|
|
1132
|
+
const { colors } = useTheme();
|
|
1133
|
+
const content = /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1134
|
+
icon ? /* @__PURE__ */ jsx12(Icon, { color: danger ? colors.dangerText : colors.textSoft, name: icon }) : null,
|
|
1135
|
+
/* @__PURE__ */ jsx12(ChalkText, { numberOfLines: 1, style: badge ? styles7.labelShrink : styles7.label, tone: danger ? "dangerText" : "text", variant: "phoneRow", children: label }),
|
|
1136
|
+
badge ? /* @__PURE__ */ jsx12(View6, { style: styles7.badge, children: badge }) : null,
|
|
1137
|
+
end
|
|
1138
|
+
] });
|
|
1139
|
+
if (!onPress) {
|
|
1140
|
+
return /* @__PURE__ */ jsx12(View6, { style: styles7.row, testID, children: content });
|
|
1141
|
+
}
|
|
1142
|
+
return /* @__PURE__ */ jsx12(Pressable5, { accessibilityLabel, accessibilityRole: "button", onPress, style: ({ pressed }) => [styles7.row, pressed ? { backgroundColor: colors.pressed } : null], testID, children: content });
|
|
1143
|
+
}
|
|
1144
|
+
var styles7 = StyleSheet7.create({
|
|
1145
|
+
group: { borderRadius: 16, overflow: "hidden" },
|
|
1146
|
+
divider: { height: 1 },
|
|
1147
|
+
row: { flexDirection: "row", alignItems: "center", gap: 14, minHeight: 52, paddingHorizontal: 16 },
|
|
1148
|
+
label: { flex: 1 },
|
|
1149
|
+
labelShrink: { flexShrink: 1 },
|
|
1150
|
+
badge: { marginLeft: 2, marginRight: "auto" }
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
// src/primitives/SegmentedControl.tsx
|
|
1154
|
+
import { Pressable as Pressable6, StyleSheet as StyleSheet8, View as View7 } from "react-native";
|
|
1155
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1156
|
+
function SegmentedControl({ options, value, onChange, accessibilityLabel, size = "regular", testID }) {
|
|
1157
|
+
const { colors } = useTheme();
|
|
1158
|
+
const compact = size === "compact";
|
|
1159
|
+
const trackStyle = [styles8.track, { backgroundColor: compact ? colors.hover : colors.surface }];
|
|
1160
|
+
const trackRef = useMeasuredRef(testID, trackStyle);
|
|
1161
|
+
return /* @__PURE__ */ jsx13(View7, { accessibilityLabel, accessibilityRole: "radiogroup", ref: trackRef, style: trackStyle, testID, children: options.map((option) => /* @__PURE__ */ jsx13(Segment, { compact, onChange, option, selected: option.value === value }, option.value)) });
|
|
1162
|
+
}
|
|
1163
|
+
function Segment({ option, selected, compact, onChange }) {
|
|
1164
|
+
const { colors } = useTheme();
|
|
1165
|
+
const style = [styles8.segment, { height: compact ? 30 : 38 }, selected ? compact ? [{ backgroundColor: colors.popover }, styles8.lifted] : { backgroundColor: colors.pressed } : null];
|
|
1166
|
+
const ref = useMeasuredRef(option.testID, style);
|
|
1167
|
+
return /* @__PURE__ */ jsx13(Pressable6, { accessibilityLabel: option.label, accessibilityRole: "radio", accessibilityState: { selected, checked: selected }, hitSlop: compact ? 7 : 3, onPress: () => onChange(option.value), ref, style, testID: option.testID, children: /* @__PURE__ */ jsx13(ChalkText, { tone: selected ? "text" : "textMuted", variant: compact ? "button" : "bodyStrong", children: option.label }) });
|
|
1168
|
+
}
|
|
1169
|
+
var styles8 = StyleSheet8.create({
|
|
1170
|
+
track: { flexDirection: "row", padding: 3, borderRadius: 999 },
|
|
1171
|
+
segment: { justifyContent: "center", paddingHorizontal: 14, borderRadius: 999 },
|
|
1172
|
+
lifted: { boxShadow: fixed.segmentShadow }
|
|
1173
|
+
});
|
|
1174
|
+
|
|
1175
|
+
// src/primitives/CopyButton.tsx
|
|
1176
|
+
import { memo as memo5, useCallback as useCallback4, useEffect as useEffect4, useRef as useRef5, useState as useState5 } from "react";
|
|
1177
|
+
import { Pressable as Pressable7, StyleSheet as StyleSheet9 } from "react-native";
|
|
1178
|
+
import Animated6, { useAnimatedStyle as useAnimatedStyle5, useSharedValue as useSharedValue4, withTiming as withTiming6 } from "react-native-reanimated";
|
|
1179
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1180
|
+
var CopyButton = memo5(function CopyButton2({ onCopy, accessibilityLabel, announcement, testID }) {
|
|
1181
|
+
const { colors } = useTheme();
|
|
1182
|
+
const press = usePressAnimation("small");
|
|
1183
|
+
const [copied, setCopied] = useState5(false);
|
|
1184
|
+
const done = useSharedValue4(0);
|
|
1185
|
+
const reset = useRef5(null);
|
|
1186
|
+
useEffect4(() => {
|
|
1187
|
+
done.value = withTiming6(copied ? 1 : 0, timings.copyMorph);
|
|
1188
|
+
}, [copied, done]);
|
|
1189
|
+
useEffect4(() => () => clearReset(reset), []);
|
|
1190
|
+
const copy = useCallback4(async () => {
|
|
1191
|
+
await onCopy();
|
|
1192
|
+
setCopied(true);
|
|
1193
|
+
announce(announcement);
|
|
1194
|
+
clearReset(reset);
|
|
1195
|
+
reset.current = setTimeout(() => setCopied(false), durations.copyReset);
|
|
1196
|
+
}, [announcement, onCopy]);
|
|
1197
|
+
const copyIconStyle = useAnimatedStyle5(() => {
|
|
1198
|
+
"worklet";
|
|
1199
|
+
return { opacity: 1 - done.value, transform: [{ scale: 1 - 0.6 * done.value }, { rotate: `${20 * done.value}deg` }] };
|
|
1200
|
+
});
|
|
1201
|
+
const checkIconStyle = useAnimatedStyle5(() => {
|
|
1202
|
+
"worklet";
|
|
1203
|
+
return { opacity: done.value, transform: [{ scale: 0.4 + 0.6 * done.value }, { rotate: `${-20 * (1 - done.value)}deg` }] };
|
|
1204
|
+
});
|
|
1205
|
+
const { down } = press;
|
|
1206
|
+
const pressed = colors.pressed;
|
|
1207
|
+
const backgroundStyle = useAnimatedStyle5(() => {
|
|
1208
|
+
"worklet";
|
|
1209
|
+
return { backgroundColor: down.value ? pressed : fixed.transparent };
|
|
1210
|
+
});
|
|
1211
|
+
return /* @__PURE__ */ jsx14(Pressable7, { accessibilityLabel, accessibilityRole: "button", hitSlop: 4, onPress: copy, onPressIn: press.onPressIn, onPressOut: press.onPressOut, testID, children: /* @__PURE__ */ jsxs7(Animated6.View, { style: [styles9.button, backgroundStyle, press.scaleStyle], children: [
|
|
1212
|
+
/* @__PURE__ */ jsx14(Animated6.View, { style: [styles9.icon, copyIconStyle], children: /* @__PURE__ */ jsx14(Icon, { color: colors.text, name: "copy", size: 18 }) }),
|
|
1213
|
+
/* @__PURE__ */ jsx14(Animated6.View, { style: [styles9.icon, checkIconStyle], children: /* @__PURE__ */ jsx14(Icon, { color: colors.success, name: "check", size: 18 }) })
|
|
1214
|
+
] }) });
|
|
1215
|
+
});
|
|
1216
|
+
function clearReset(reset) {
|
|
1217
|
+
if (reset.current) clearTimeout(reset.current);
|
|
1218
|
+
reset.current = null;
|
|
1219
|
+
}
|
|
1220
|
+
var styles9 = StyleSheet9.create({
|
|
1221
|
+
button: { width: 36, height: 36, borderRadius: 18, alignItems: "center", justifyContent: "center" },
|
|
1222
|
+
icon: { position: "absolute" }
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
// src/primitives/Switch.tsx
|
|
1226
|
+
import { memo as memo6, useEffect as useEffect5 } from "react";
|
|
1227
|
+
import { Pressable as Pressable8, StyleSheet as StyleSheet10 } from "react-native";
|
|
1228
|
+
import Animated7, { useAnimatedStyle as useAnimatedStyle6, useSharedValue as useSharedValue5, withTiming as withTiming7 } from "react-native-reanimated";
|
|
1229
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1230
|
+
var Switch = memo6(function Switch2({ value, onValueChange, accessibilityLabel, testID }) {
|
|
1231
|
+
const { colors } = useTheme();
|
|
1232
|
+
const on = useSharedValue5(value ? 1 : 0);
|
|
1233
|
+
useEffect5(() => {
|
|
1234
|
+
on.value = withTiming7(value ? 1 : 0, timings.switch);
|
|
1235
|
+
}, [on, value]);
|
|
1236
|
+
const knobStyle = useAnimatedStyle6(() => {
|
|
1237
|
+
"worklet";
|
|
1238
|
+
return { transform: [{ translateX: on.value * 14 }] };
|
|
1239
|
+
});
|
|
1240
|
+
return /* @__PURE__ */ jsx15(Pressable8, { accessibilityLabel, accessibilityRole: "switch", accessibilityState: { checked: value }, hitSlop: 11, onPress: () => onValueChange(!value), testID, children: /* @__PURE__ */ jsx15(Animated7.View, { style: [styles10.track, { backgroundColor: value ? colors.success : colors.pressed }], children: /* @__PURE__ */ jsx15(Animated7.View, { style: [styles10.knob, knobStyle] }) }) });
|
|
1241
|
+
});
|
|
1242
|
+
var styles10 = StyleSheet10.create({
|
|
1243
|
+
track: { width: 36, height: 22, borderRadius: 999 },
|
|
1244
|
+
knob: { position: "absolute", left: 3, top: 3, width: 16, height: 16, borderRadius: 8, backgroundColor: fixed.switchKnob }
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
// src/avatar/FaceAvatar.tsx
|
|
1248
|
+
import { createFacehashScene, getColor, getForegroundColor } from "@q9labsai/facehash";
|
|
1249
|
+
import { memo as memo7, useCallback as useCallback5, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
1250
|
+
import { Platform as Platform2, StyleSheet as StyleSheet11, View as View8 } from "react-native";
|
|
1251
|
+
import Animated8, { cancelAnimation, useAnimatedStyle as useAnimatedStyle7, useReducedMotion as useReducedMotion5, useSharedValue as useSharedValue6, withDelay, withRepeat, withSequence, withTiming as withTiming8 } from "react-native-reanimated";
|
|
1252
|
+
import Svg2, { G, Path as Path2, Text as SvgText } from "react-native-svg";
|
|
1253
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1254
|
+
var INTENSITY = { bold: "dramatic", subtle: "subtle" };
|
|
1255
|
+
var MONO = Platform2.select({ ios: "Menlo", default: "monospace" });
|
|
1256
|
+
var FRONT_HOLD_MS = 1400;
|
|
1257
|
+
var LOOK_INTERVAL_MS = 1800;
|
|
1258
|
+
var LOOK_MS = 700;
|
|
1259
|
+
var BOB = 5;
|
|
1260
|
+
var MOUTH = 0.55;
|
|
1261
|
+
var CLOSED = 0.05;
|
|
1262
|
+
var FaceAvatar = memo7(function FaceAvatar2({ name, size, style = "subtle", level, lookAround = false, testID }) {
|
|
1263
|
+
const reduceMotion = useReducedMotion5();
|
|
1264
|
+
const scene = useMemo4(() => createFacehashScene({ name, colorsLength: identityColors.length, intensity3d: INTENSITY[style] }), [name, style]);
|
|
1265
|
+
const background = getColor(identityColors, scene.data.colorIndex);
|
|
1266
|
+
const foreground = getForegroundColor(background);
|
|
1267
|
+
const geometry = scene.faceGeometry;
|
|
1268
|
+
const box = scene.faceBox;
|
|
1269
|
+
const eyeCenter = box.y + geometry.leftEyeAnchor.y * (box.height / geometry.viewBox.height);
|
|
1270
|
+
const unit = size / 100;
|
|
1271
|
+
const projection = scene.projection;
|
|
1272
|
+
const turned = useSharedValue6(1);
|
|
1273
|
+
const blink = useSharedValue6(1);
|
|
1274
|
+
const lookX = useSharedValue6(0);
|
|
1275
|
+
const lookY = useSharedValue6(0);
|
|
1276
|
+
useEffect6(() => {
|
|
1277
|
+
if (reduceMotion) {
|
|
1278
|
+
blink.value = 1;
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
const { delay, duration } = scene.data.blinkTimings.left;
|
|
1282
|
+
const total = duration * 1e3;
|
|
1283
|
+
const close = { duration: total * 0.04, easing: easings.standard };
|
|
1284
|
+
blink.value = withDelay(delay * 1e3, withRepeat(withSequence(withDelay(total * 0.92, withTiming8(CLOSED, close)), withTiming8(1, close)), -1));
|
|
1285
|
+
return () => cancelAnimation(blink);
|
|
1286
|
+
}, [blink, reduceMotion, scene]);
|
|
1287
|
+
useEffect6(() => {
|
|
1288
|
+
if (!lookAround || reduceMotion) return;
|
|
1289
|
+
const timer = setInterval(() => {
|
|
1290
|
+
if (Math.random() < 0.5 || turned.value < 1) return;
|
|
1291
|
+
lookX.value = withTiming8((Math.random() * 2 - 1) * 6, { duration: LOOK_MS, easing: easings.standard });
|
|
1292
|
+
lookY.value = withTiming8((Math.random() * 2 - 1) * 4, { duration: LOOK_MS, easing: easings.standard });
|
|
1293
|
+
}, LOOK_INTERVAL_MS);
|
|
1294
|
+
return () => clearInterval(timer);
|
|
1295
|
+
}, [lookAround, lookX, lookY, reduceMotion, turned]);
|
|
1296
|
+
const turnToFront = useCallback5(() => {
|
|
1297
|
+
if (reduceMotion) return;
|
|
1298
|
+
turned.value = withSequence(withTiming8(0, timings.avatarTurn), withDelay(FRONT_HOLD_MS, withTiming8(1, timings.avatarTurn)));
|
|
1299
|
+
lookX.value = withTiming8(0, { duration: 250, easing: easings.standard });
|
|
1300
|
+
lookY.value = withTiming8(0, { duration: 250, easing: easings.standard });
|
|
1301
|
+
blink.value = withSequence(withTiming8(CLOSED, { duration: 150, easing: easings.standard }), withTiming8(1, { duration: 150, easing: easings.standard }));
|
|
1302
|
+
}, [blink, lookX, lookY, reduceMotion, turned]);
|
|
1303
|
+
const bobStyle = useAnimatedStyle7(() => {
|
|
1304
|
+
"worklet";
|
|
1305
|
+
return { transform: [{ translateY: level ? -level.value * BOB * unit : 0 }] };
|
|
1306
|
+
});
|
|
1307
|
+
const poseStyle = useAnimatedStyle7(() => {
|
|
1308
|
+
"worklet";
|
|
1309
|
+
const t = turned.value;
|
|
1310
|
+
return {
|
|
1311
|
+
transform: [{ translateX: projection.translateX * unit * t }, { translateY: projection.translateY * unit * t }, { skewX: `${projection.skewX * t}deg` }, { skewY: `${projection.skewY * t}deg` }, { scaleX: 1 + (projection.scaleX - 1) * t }, { scaleY: 1 + (projection.scaleY - 1) * t }]
|
|
1312
|
+
};
|
|
1313
|
+
});
|
|
1314
|
+
const eyesLookStyle = useAnimatedStyle7(() => {
|
|
1315
|
+
"worklet";
|
|
1316
|
+
return { transform: [{ translateX: lookX.value * unit }, { translateY: lookY.value * unit }] };
|
|
1317
|
+
});
|
|
1318
|
+
const mouthLookStyle = useAnimatedStyle7(() => {
|
|
1319
|
+
"worklet";
|
|
1320
|
+
return { transform: [{ translateX: lookX.value / 2 * unit }, { translateY: lookY.value / 2 * unit }] };
|
|
1321
|
+
});
|
|
1322
|
+
const blinkStyle = useAnimatedStyle7(() => {
|
|
1323
|
+
"worklet";
|
|
1324
|
+
return { transform: [{ scaleY: blink.value }] };
|
|
1325
|
+
});
|
|
1326
|
+
const mouthStyle = useAnimatedStyle7(() => {
|
|
1327
|
+
"worklet";
|
|
1328
|
+
return { transform: [{ scaleY: 1 + (level ? level.value : 0) * MOUTH }] };
|
|
1329
|
+
});
|
|
1330
|
+
const faceTransform = `translate(${box.x} ${box.y}) scale(${box.width / geometry.viewBox.width} ${box.height / geometry.viewBox.height})`;
|
|
1331
|
+
return /* @__PURE__ */ jsx16(View8, { onTouchStart: turnToFront, style: [styles11.circle, { width: size, height: size, borderRadius: size / 2, backgroundColor: background }], testID, children: /* @__PURE__ */ jsx16(Animated8.View, { style: [StyleSheet11.absoluteFill, bobStyle], children: /* @__PURE__ */ jsxs8(Animated8.View, { style: [StyleSheet11.absoluteFill, poseStyle], children: [
|
|
1332
|
+
/* @__PURE__ */ jsx16(Animated8.View, { style: [StyleSheet11.absoluteFill, eyesLookStyle], children: /* @__PURE__ */ jsx16(Animated8.View, { style: [StyleSheet11.absoluteFill, { transformOrigin: `50% ${eyeCenter}%` }, blinkStyle], children: /* @__PURE__ */ jsx16(Svg2, { height: size, viewBox: "0 0 100 100", width: size, children: /* @__PURE__ */ jsx16(G, { transform: faceTransform, children: [...geometry.leftEyePaths, ...geometry.rightEyePaths].map((d) => /* @__PURE__ */ jsx16(Path2, { d, fill: foreground }, d)) }) }) }) }),
|
|
1333
|
+
/* @__PURE__ */ jsx16(Animated8.View, { style: [StyleSheet11.absoluteFill, mouthLookStyle], children: /* @__PURE__ */ jsx16(Animated8.View, { style: [StyleSheet11.absoluteFill, styles11.mouthOrigin, mouthStyle], children: /* @__PURE__ */ jsx16(Svg2, { height: size, viewBox: "0 0 100 100", width: size, children: /* @__PURE__ */ jsx16(SvgText, { alignmentBaseline: "middle", fill: foreground, fontFamily: MONO, fontSize: scene.initialLayout.fontSize, fontWeight: "700", textAnchor: "middle", x: scene.initialLayout.x, y: scene.initialLayout.y, children: scene.data.initial }) }) }) })
|
|
1334
|
+
] }) }) });
|
|
1335
|
+
});
|
|
1336
|
+
var styles11 = StyleSheet11.create({
|
|
1337
|
+
circle: { overflow: "hidden" },
|
|
1338
|
+
// The initial sits on y = 70 with a 26-unit font, so its baseline is near y = 79.
|
|
1339
|
+
mouthOrigin: { transformOrigin: "50% 79%" }
|
|
1340
|
+
});
|
|
1341
|
+
|
|
1342
|
+
// src/limbo/Limbo.tsx
|
|
1343
|
+
import { useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
1344
|
+
import { AccessibilityInfo as AccessibilityInfo4, findNodeHandle as findNodeHandle3, StyleSheet as StyleSheet12, View as View9 } from "react-native";
|
|
1345
|
+
import Animated9, { cancelAnimation as cancelAnimation2, Easing as Easing2, useAnimatedStyle as useAnimatedStyle8, useReducedMotion as useReducedMotion6, useSharedValue as useSharedValue7, withRepeat as withRepeat2, withTiming as withTiming9 } from "react-native-reanimated";
|
|
1346
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1347
|
+
function Limbo({ state, callName, recording }) {
|
|
1348
|
+
const { colors } = useTheme();
|
|
1349
|
+
const cardStyle = [styles12.card, { backgroundColor: colors.surface, borderColor: colors.line }];
|
|
1350
|
+
const cardRef = useMeasuredRef("limbo.card", cardStyle);
|
|
1351
|
+
const actionRef = useRef6(null);
|
|
1352
|
+
const consent = recording && (state.kind === "joining" || state.kind === "knocking") ? /* @__PURE__ */ jsx17(Consent, {}) : null;
|
|
1353
|
+
useEffect7(() => {
|
|
1354
|
+
const node = actionRef.current && findNodeHandle3(actionRef.current);
|
|
1355
|
+
if (node) AccessibilityInfo4.setAccessibilityFocus(node);
|
|
1356
|
+
}, [state.kind]);
|
|
1357
|
+
return /* @__PURE__ */ jsx17(View9, { pointerEvents: "box-none", style: styles12.limbo, testID: "frame.limbo", children: /* @__PURE__ */ jsxs9(View9, { accessibilityLiveRegion: state.kind === "refused" ? "assertive" : "polite", accessibilityRole: state.kind === "refused" ? "alert" : "summary", ref: cardRef, style: cardStyle, testID: "limbo.card", children: [
|
|
1358
|
+
state.kind === "joining" ? /* @__PURE__ */ jsx17(Progress, { message: `${state.rejoining ? "Rejoining" : "Joining"} ${callName}\u2026` }) : state.kind === "knocking" ? /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
1359
|
+
/* @__PURE__ */ jsx17(Title, { children: `Asking to join ${callName}` }),
|
|
1360
|
+
/* @__PURE__ */ jsx17(Line, { children: "The host will let you in." }),
|
|
1361
|
+
consent,
|
|
1362
|
+
/* @__PURE__ */ jsx17(View9, { style: styles12.action, children: /* @__PURE__ */ jsx17(PillButton, { label: "Cancel", onPress: state.onCancel, ref: actionRef, testID: "limbo.cancel" }) })
|
|
1363
|
+
] }) : state.kind === "refused" ? /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
1364
|
+
/* @__PURE__ */ jsx17(Title, { children: "The host didn\u2019t let you in" }),
|
|
1365
|
+
/* @__PURE__ */ jsx17(View9, { style: styles12.action, children: /* @__PURE__ */ jsx17(PillButton, { label: "Ask again", onPress: state.onAskAgain, ref: actionRef, testID: "limbo.ask-again", variant: "primary" }) })
|
|
1366
|
+
] }) : state.kind === "reconnecting" ? /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
1367
|
+
/* @__PURE__ */ jsx17(Progress, { message: "Reconnecting\u2026" }),
|
|
1368
|
+
state.queuedMessages > 0 ? /* @__PURE__ */ jsx17(Line, { children: `${state.queuedMessages} message${state.queuedMessages > 1 ? "s" : ""} will send when you\u2019re back` }) : null
|
|
1369
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
1370
|
+
/* @__PURE__ */ jsx17(HoldIcon, {}),
|
|
1371
|
+
/* @__PURE__ */ jsx17(Title, { children: "Your call is on hold" }),
|
|
1372
|
+
/* @__PURE__ */ jsx17(Line, { children: `You\u2019re on a phone call. You\u2019ll be back in ${callName} when it ends.` })
|
|
1373
|
+
] }),
|
|
1374
|
+
state.kind === "joining" ? consent : null
|
|
1375
|
+
] }) });
|
|
1376
|
+
}
|
|
1377
|
+
function Title({ children }) {
|
|
1378
|
+
return /* @__PURE__ */ jsx17(ChalkText, { accessibilityRole: "header", style: styles12.center, testID: "limbo.title", variant: "limboTitle", children });
|
|
1379
|
+
}
|
|
1380
|
+
function Line({ children }) {
|
|
1381
|
+
return /* @__PURE__ */ jsx17(ChalkText, { style: styles12.center, testID: "limbo.line", tone: "textSoft", children });
|
|
1382
|
+
}
|
|
1383
|
+
function Progress({ message }) {
|
|
1384
|
+
return /* @__PURE__ */ jsxs9(View9, { style: styles12.row, children: [
|
|
1385
|
+
/* @__PURE__ */ jsx17(Spinner, {}),
|
|
1386
|
+
/* @__PURE__ */ jsx17(ChalkText, { testID: "limbo.progress", variant: "progress", children: message })
|
|
1387
|
+
] });
|
|
1388
|
+
}
|
|
1389
|
+
function HoldIcon() {
|
|
1390
|
+
const { colors } = useTheme();
|
|
1391
|
+
const style = [styles12.holdIcon, { backgroundColor: colors.raised }];
|
|
1392
|
+
const ref = useMeasuredRef("limbo.hold-icon", style);
|
|
1393
|
+
return /* @__PURE__ */ jsx17(View9, { ref, style, testID: "limbo.hold-icon", children: /* @__PURE__ */ jsx17(Icon, { color: colors.success, name: "earpiece" }) });
|
|
1394
|
+
}
|
|
1395
|
+
function Consent() {
|
|
1396
|
+
const { colors } = useTheme();
|
|
1397
|
+
return /* @__PURE__ */ jsxs9(View9, { style: styles12.consent, testID: "limbo.consent", children: [
|
|
1398
|
+
/* @__PURE__ */ jsx17(Icon, { color: colors.dangerText, name: "rec", size: 14 }),
|
|
1399
|
+
/* @__PURE__ */ jsx17(ChalkText, { tone: "textMuted", variant: "label", style: styles12.consentText, children: "This call is recorded. By joining, you agree to be recorded." })
|
|
1400
|
+
] });
|
|
1401
|
+
}
|
|
1402
|
+
function Spinner() {
|
|
1403
|
+
const { colors } = useTheme();
|
|
1404
|
+
const reduceMotion = useReducedMotion6();
|
|
1405
|
+
const turn = useSharedValue7(0);
|
|
1406
|
+
useEffect7(() => {
|
|
1407
|
+
if (reduceMotion) return;
|
|
1408
|
+
turn.value = withRepeat2(withTiming9(1, { duration: 900, easing: Easing2.linear }), -1);
|
|
1409
|
+
return () => cancelAnimation2(turn);
|
|
1410
|
+
}, [reduceMotion, turn]);
|
|
1411
|
+
const style = useAnimatedStyle8(() => {
|
|
1412
|
+
"worklet";
|
|
1413
|
+
return { transform: [{ rotate: `${turn.value * 360}deg` }] };
|
|
1414
|
+
});
|
|
1415
|
+
return /* @__PURE__ */ jsx17(Animated9.View, { style: [styles12.spinner, { borderColor: colors.lineStrong, borderTopColor: reduceMotion ? colors.textMuted : colors.text }, style] });
|
|
1416
|
+
}
|
|
1417
|
+
var styles12 = StyleSheet12.create({
|
|
1418
|
+
limbo: { ...StyleSheet12.absoluteFillObject, alignItems: "center", justifyContent: "center" },
|
|
1419
|
+
card: { alignItems: "center", gap: 8, maxWidth: "100%", paddingVertical: 22, paddingHorizontal: 28, borderWidth: 1, borderRadius: 16, marginHorizontal: 16 },
|
|
1420
|
+
row: { flexDirection: "row", alignItems: "center", gap: 10 },
|
|
1421
|
+
center: { textAlign: "center" },
|
|
1422
|
+
// `.lmsg .pb` adds 10 pt above the button on top of the card's 8 pt gap.
|
|
1423
|
+
action: { marginTop: 10 },
|
|
1424
|
+
holdIcon: { width: 44, height: 44, borderRadius: 22, alignItems: "center", justifyContent: "center", marginBottom: 4 },
|
|
1425
|
+
consent: { flexDirection: "row", alignItems: "center", gap: 6, marginTop: 4 },
|
|
1426
|
+
// `.consent` is 12 pt at the body weight.
|
|
1427
|
+
consentText: { fontFamily: fontFamilies[400], flexShrink: 1 },
|
|
1428
|
+
spinner: { width: 18, height: 18, borderRadius: 9, borderWidth: 2 }
|
|
1429
|
+
});
|
|
1430
|
+
|
|
1431
|
+
export {
|
|
1432
|
+
STAGE_GAP,
|
|
1433
|
+
frameRegions,
|
|
1434
|
+
DeviceLayoutProvider,
|
|
1435
|
+
useDeviceLayout,
|
|
1436
|
+
PortalProvider,
|
|
1437
|
+
Portal,
|
|
1438
|
+
PortalHost,
|
|
1439
|
+
usePortalCount,
|
|
1440
|
+
fixed,
|
|
1441
|
+
fileKindColors,
|
|
1442
|
+
chatOverlays,
|
|
1443
|
+
viewer,
|
|
1444
|
+
elevations,
|
|
1445
|
+
fontFamilies,
|
|
1446
|
+
type,
|
|
1447
|
+
radii,
|
|
1448
|
+
sizes,
|
|
1449
|
+
durations,
|
|
1450
|
+
easings,
|
|
1451
|
+
pressScale,
|
|
1452
|
+
timings,
|
|
1453
|
+
ThemeProvider,
|
|
1454
|
+
useTheme,
|
|
1455
|
+
ChalkText,
|
|
1456
|
+
Icon,
|
|
1457
|
+
usePressAnimation,
|
|
1458
|
+
IconButton,
|
|
1459
|
+
PillButton,
|
|
1460
|
+
announce,
|
|
1461
|
+
ToastProvider,
|
|
1462
|
+
useToasts,
|
|
1463
|
+
useToastClearance,
|
|
1464
|
+
ToastStack,
|
|
1465
|
+
useBackHandler,
|
|
1466
|
+
haptics,
|
|
1467
|
+
BottomSheet,
|
|
1468
|
+
SheetDragRegion,
|
|
1469
|
+
Menu,
|
|
1470
|
+
MenuItem,
|
|
1471
|
+
MenuSection,
|
|
1472
|
+
SheetGroup,
|
|
1473
|
+
SheetRow,
|
|
1474
|
+
SegmentedControl,
|
|
1475
|
+
CopyButton,
|
|
1476
|
+
Switch,
|
|
1477
|
+
FaceAvatar,
|
|
1478
|
+
Limbo
|
|
1479
|
+
};
|