@docyrus/rn-assistant 0.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 +477 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js +300 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/commonjs/components/agent-selector/index.js +17 -0
- package/dist/commonjs/components/agent-selector/index.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js +169 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/index.js +17 -0
- package/dist/commonjs/components/assistant-animations/index.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js +809 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/index.js +17 -0
- package/dist/commonjs/components/assistant-screen/index.js.map +1 -0
- package/dist/commonjs/components/index.js +116 -0
- package/dist/commonjs/components/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/index.js +13 -0
- package/dist/commonjs/components/message-parts/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/message-parts.js +209 -0
- package/dist/commonjs/components/message-parts/message-parts.js.map +1 -0
- package/dist/commonjs/components/new-chat/index.js +17 -0
- package/dist/commonjs/components/new-chat/index.js.map +1 -0
- package/dist/commonjs/components/new-chat/new-chat.js +100 -0
- package/dist/commonjs/components/new-chat/new-chat.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js +341 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js +229 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/commonjs/components/prompt-input/index.js +41 -0
- package/dist/commonjs/components/prompt-input/index.js.map +1 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js +288 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js +542 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js +350 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js +260 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/commonjs/components/sessions-list/index.js +17 -0
- package/dist/commonjs/components/sessions-list/index.js.map +1 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js +820 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/commonjs/hooks/index.js +34 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/use-agent-models.js +104 -0
- package/dist/commonjs/hooks/use-agent-models.js.map +1 -0
- package/dist/commonjs/hooks/use-assistant.js +402 -0
- package/dist/commonjs/hooks/use-assistant.js.map +1 -0
- package/dist/commonjs/hooks/use-attachment-picker.js +308 -0
- package/dist/commonjs/hooks/use-attachment-picker.js.map +1 -0
- package/dist/commonjs/hooks/use-voice-recorder.js +217 -0
- package/dist/commonjs/hooks/use-voice-recorder.js.map +1 -0
- package/dist/commonjs/index.js +112 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/theme/assistant-theme.js +105 -0
- package/dist/commonjs/theme/assistant-theme.js.map +1 -0
- package/dist/commonjs/theme/index.js +19 -0
- package/dist/commonjs/theme/index.js.map +1 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/ui/action-sheet.js +348 -0
- package/dist/commonjs/ui/action-sheet.js.map +1 -0
- package/dist/commonjs/ui/alert-dialog.js +134 -0
- package/dist/commonjs/ui/alert-dialog.js.map +1 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js +52 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/commonjs/ui/docyrus-icon.js +298 -0
- package/dist/commonjs/ui/docyrus-icon.js.map +1 -0
- package/dist/commonjs/ui/index.js +34 -0
- package/dist/commonjs/ui/index.js.map +1 -0
- package/dist/commonjs/utils/api-client.js +99 -0
- package/dist/commonjs/utils/api-client.js.map +1 -0
- package/dist/commonjs/utils/default-api-config.js +195 -0
- package/dist/commonjs/utils/default-api-config.js.map +1 -0
- package/dist/commonjs/utils/index.js +39 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/resolve-api-headers.js +16 -0
- package/dist/commonjs/utils/resolve-api-headers.js.map +1 -0
- package/dist/module/components/agent-selector/agent-selector.js +296 -0
- package/dist/module/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/module/components/agent-selector/index.js +4 -0
- package/dist/module/components/agent-selector/index.js.map +1 -0
- package/dist/module/components/assistant-animations/assistant-animations.js +164 -0
- package/dist/module/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/module/components/assistant-animations/index.js +4 -0
- package/dist/module/components/assistant-animations/index.js.map +1 -0
- package/dist/module/components/assistant-screen/assistant-screen.js +801 -0
- package/dist/module/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/module/components/assistant-screen/index.js +4 -0
- package/dist/module/components/assistant-screen/index.js.map +1 -0
- package/dist/module/components/index.js +23 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/message-parts/index.js +4 -0
- package/dist/module/components/message-parts/index.js.map +1 -0
- package/dist/module/components/message-parts/message-parts.js +205 -0
- package/dist/module/components/message-parts/message-parts.js.map +1 -0
- package/dist/module/components/new-chat/index.js +4 -0
- package/dist/module/components/new-chat/index.js.map +1 -0
- package/dist/module/components/new-chat/new-chat.js +96 -0
- package/dist/module/components/new-chat/new-chat.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-picker.js +337 -0
- package/dist/module/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-preview.js +225 -0
- package/dist/module/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/module/components/prompt-input/index.js +15 -0
- package/dist/module/components/prompt-input/index.js.map +1 -0
- package/dist/module/components/prompt-input/prompt-input.js +284 -0
- package/dist/module/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/module/components/prompt-input/provider-selector.js +538 -0
- package/dist/module/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js +346 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/module/components/prompt-input/voice-recorder.js +256 -0
- package/dist/module/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/module/components/sessions-list/index.js +4 -0
- package/dist/module/components/sessions-list/index.js.map +1 -0
- package/dist/module/components/sessions-list/sessions-list.js +816 -0
- package/dist/module/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/module/hooks/index.js +18 -0
- package/dist/module/hooks/index.js.map +1 -0
- package/dist/module/hooks/use-agent-models.js +100 -0
- package/dist/module/hooks/use-agent-models.js.map +1 -0
- package/dist/module/hooks/use-assistant.js +398 -0
- package/dist/module/hooks/use-assistant.js.map +1 -0
- package/dist/module/hooks/use-attachment-picker.js +303 -0
- package/dist/module/hooks/use-attachment-picker.js.map +1 -0
- package/dist/module/hooks/use-voice-recorder.js +214 -0
- package/dist/module/hooks/use-voice-recorder.js.map +1 -0
- package/dist/module/index.js +59 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/theme/assistant-theme.js +100 -0
- package/dist/module/theme/assistant-theme.js.map +1 -0
- package/dist/module/theme/index.js +4 -0
- package/dist/module/theme/index.js.map +1 -0
- package/dist/module/types/index.js +2 -0
- package/dist/module/types/index.js.map +1 -0
- package/dist/module/ui/action-sheet.js +344 -0
- package/dist/module/ui/action-sheet.js.map +1 -0
- package/dist/module/ui/alert-dialog.js +130 -0
- package/dist/module/ui/alert-dialog.js.map +1 -0
- package/dist/module/ui/docyrus-brand-mark.js +48 -0
- package/dist/module/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/module/ui/docyrus-icon.js +294 -0
- package/dist/module/ui/docyrus-icon.js.map +1 -0
- package/dist/module/ui/index.js +7 -0
- package/dist/module/ui/index.js.map +1 -0
- package/dist/module/utils/api-client.js +95 -0
- package/dist/module/utils/api-client.js.map +1 -0
- package/dist/module/utils/default-api-config.js +190 -0
- package/dist/module/utils/default-api-config.js.map +1 -0
- package/dist/module/utils/index.js +12 -0
- package/dist/module/utils/index.js.map +1 -0
- package/dist/module/utils/resolve-api-headers.js +12 -0
- package/dist/module/utils/resolve-api-headers.js.map +1 -0
- package/dist/typescript/commonjs/eslint.config.d.mts +4 -0
- package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts +8 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/index.d.ts +47 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/types/index.d.ts +167 -0
- package/dist/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/dist/typescript/module/eslint.config.d.mts +4 -0
- package/dist/typescript/module/eslint.config.d.mts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +11 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/index.d.ts +8 -0
- package/dist/typescript/module/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/index.d.ts +47 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/index.d.ts +2 -0
- package/dist/typescript/module/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/module/src/types/index.d.ts +167 -0
- package/dist/typescript/module/src/types/index.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/index.d.ts +5 -0
- package/dist/typescript/module/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/module/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/index.d.ts +9 -0
- package/dist/typescript/module/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/package.json +176 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
4
|
+
import { useColorScheme } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const ThemeContext = /*#__PURE__*/createContext(undefined);
|
|
7
|
+
const baseSpacing = {
|
|
8
|
+
0: 0,
|
|
9
|
+
0.5: 2,
|
|
10
|
+
1: 4,
|
|
11
|
+
1.5: 6,
|
|
12
|
+
2: 8,
|
|
13
|
+
2.5: 10,
|
|
14
|
+
3: 12,
|
|
15
|
+
3.5: 14,
|
|
16
|
+
4: 16,
|
|
17
|
+
5: 20,
|
|
18
|
+
6: 24,
|
|
19
|
+
7: 28,
|
|
20
|
+
8: 32
|
|
21
|
+
};
|
|
22
|
+
const baseRadius = {
|
|
23
|
+
sm: 8,
|
|
24
|
+
md: 12,
|
|
25
|
+
lg: 16,
|
|
26
|
+
xl: 20,
|
|
27
|
+
full: 999
|
|
28
|
+
};
|
|
29
|
+
const lightColors = {
|
|
30
|
+
background: '#ffffff',
|
|
31
|
+
foreground: '#111827',
|
|
32
|
+
card: '#f8fafc',
|
|
33
|
+
cardForeground: '#111827',
|
|
34
|
+
muted: '#eef2f7',
|
|
35
|
+
mutedForeground: '#667085',
|
|
36
|
+
border: '#dbe3ee',
|
|
37
|
+
primary: '#dc2626',
|
|
38
|
+
primaryForeground: '#ffffff',
|
|
39
|
+
destructive: '#dc2626',
|
|
40
|
+
destructiveForeground: '#ffffff',
|
|
41
|
+
success: '#16a34a',
|
|
42
|
+
successForeground: '#ffffff',
|
|
43
|
+
warning: '#d97706',
|
|
44
|
+
warningForeground: '#ffffff'
|
|
45
|
+
};
|
|
46
|
+
const darkColors = {
|
|
47
|
+
background: '#0b1220',
|
|
48
|
+
foreground: '#f8fafc',
|
|
49
|
+
card: '#111827',
|
|
50
|
+
cardForeground: '#f8fafc',
|
|
51
|
+
muted: '#1f2937',
|
|
52
|
+
mutedForeground: '#94a3b8',
|
|
53
|
+
border: '#243041',
|
|
54
|
+
primary: '#ef4444',
|
|
55
|
+
primaryForeground: '#ffffff',
|
|
56
|
+
destructive: '#ef4444',
|
|
57
|
+
destructiveForeground: '#ffffff',
|
|
58
|
+
success: '#22c55e',
|
|
59
|
+
successForeground: '#052e16',
|
|
60
|
+
warning: '#f59e0b',
|
|
61
|
+
warningForeground: '#111827'
|
|
62
|
+
};
|
|
63
|
+
function buildTheme(isDark, overrides) {
|
|
64
|
+
return {
|
|
65
|
+
colors: {
|
|
66
|
+
...(isDark ? darkColors : lightColors),
|
|
67
|
+
...overrides?.colors
|
|
68
|
+
},
|
|
69
|
+
spacing: {
|
|
70
|
+
...baseSpacing,
|
|
71
|
+
...overrides?.spacing
|
|
72
|
+
},
|
|
73
|
+
borderRadius: {
|
|
74
|
+
...baseRadius,
|
|
75
|
+
...overrides?.borderRadius
|
|
76
|
+
},
|
|
77
|
+
isDark
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function DocyrusRNAssistantProvider({
|
|
81
|
+
children,
|
|
82
|
+
mode = 'system',
|
|
83
|
+
theme
|
|
84
|
+
}) {
|
|
85
|
+
const value = useMemo(() => ({
|
|
86
|
+
mode,
|
|
87
|
+
overrides: theme
|
|
88
|
+
}), [mode, theme]);
|
|
89
|
+
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
90
|
+
value: value,
|
|
91
|
+
children: children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export function useDocyrusRNAssistantTheme() {
|
|
95
|
+
const systemColorScheme = useColorScheme();
|
|
96
|
+
const context = useContext(ThemeContext);
|
|
97
|
+
const isDark = context?.mode === 'dark' || context?.mode !== 'light' && systemColorScheme === 'dark';
|
|
98
|
+
return useMemo(() => buildTheme(isDark, context?.overrides), [context?.overrides, isDark]);
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=assistant-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","useColorScheme","jsx","_jsx","ThemeContext","undefined","baseSpacing","baseRadius","sm","md","lg","xl","full","lightColors","background","foreground","card","cardForeground","muted","mutedForeground","border","primary","primaryForeground","destructive","destructiveForeground","success","successForeground","warning","warningForeground","darkColors","buildTheme","isDark","overrides","colors","spacing","borderRadius","DocyrusRNAssistantProvider","children","mode","theme","value","Provider","useDocyrusRNAssistantTheme","systemColorScheme","context"],"sourceRoot":"../../../src","sources":["theme/assistant-theme.tsx"],"mappings":";;AAAA,SAEEA,aAAa,EACbC,UAAU,EACVC,OAAO,QACF,OAAO;AAEd,SAASC,cAAc,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAuD9C,MAAMC,YAAY,gBAAGN,aAAa,CAAgCO,SAAS,CAAC;AAE5E,MAAMC,WAAkC,GAAG;EACzC,CAAC,EAAE,CAAC;EACJ,GAAG,EAAE,CAAC;EACN,CAAC,EAAE,CAAC;EACJ,GAAG,EAAE,CAAC;EACN,CAAC,EAAE,CAAC;EACJ,GAAG,EAAE,EAAE;EACP,CAAC,EAAE,EAAE;EACL,GAAG,EAAE,EAAE;EACP,CAAC,EAAE,EAAE;EACL,CAAC,EAAE,EAAE;EACL,CAAC,EAAE,EAAE;EACL,CAAC,EAAE,EAAE;EACL,CAAC,EAAE;AACL,CAAC;AAED,MAAMC,UAAgC,GAAG;EACvCC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,WAAiC,GAAG;EACxCC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,SAAS;EACfC,cAAc,EAAE,SAAS;EACzBC,KAAK,EAAE,SAAS;EAChBC,eAAe,EAAE,SAAS;EAC1BC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,SAAS;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CAACC,YAAY,CAACqC,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAH,QAAA,EACjCA;EAAQ,CACY,CAAC;AAE5B;AAEA,OAAO,SAASK,0BAA0BA,CAAA,EAA4B;EACpE,MAAMC,iBAAiB,GAAG1C,cAAc,CAAC,CAAC;EAC1C,MAAM2C,OAAO,GAAG7C,UAAU,CAACK,YAAY,CAAC;EAExC,MAAM2B,MAAM,GAAGa,OAAO,EAAEN,IAAI,KAAK,MAAM,IACjCM,OAAO,EAAEN,IAAI,KAAK,OAAO,IAAIK,iBAAiB,KAAK,MAAO;EAEhE,OAAO3C,OAAO,CAAC,MAAM8B,UAAU,CAACC,MAAM,EAAEa,OAAO,EAAEZ,SAAS,CAAC,EAAE,CAACY,OAAO,EAAEZ,SAAS,EAAED,MAAM,CAAC,CAAC;AAC5F","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DocyrusRNAssistantProvider","useDocyrusRNAssistantTheme"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA,SACEA,0BAA0B,EAI1BC,0BAA0B,QACrB,sBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, Dimensions, Easing, PanResponder, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { useDocyrusRNAssistantTheme } from "../theme/index.js";
|
|
7
|
+
import { DocyrusIcon } from "./docyrus-icon.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const ratioMap = {
|
|
10
|
+
small: 0.42,
|
|
11
|
+
medium: 0.72,
|
|
12
|
+
large: 1
|
|
13
|
+
};
|
|
14
|
+
function resolveMaxHeight(detent, topInset) {
|
|
15
|
+
const screenHeight = Dimensions.get('window').height;
|
|
16
|
+
const availableHeight = Math.max(screenHeight - Math.max(topInset - 8, 0), 320);
|
|
17
|
+
if (detent === 'fit') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
if (detent === 'large') {
|
|
21
|
+
return availableHeight;
|
|
22
|
+
}
|
|
23
|
+
return Math.round(availableHeight * ratioMap[detent]);
|
|
24
|
+
}
|
|
25
|
+
export function ActionSheet({
|
|
26
|
+
actions = [],
|
|
27
|
+
cancelLabel,
|
|
28
|
+
children,
|
|
29
|
+
closeOnBackdrop = true,
|
|
30
|
+
contentContainerStyle,
|
|
31
|
+
detent = 'fit',
|
|
32
|
+
detents,
|
|
33
|
+
fixedContent,
|
|
34
|
+
message,
|
|
35
|
+
onClose,
|
|
36
|
+
scrollable = true,
|
|
37
|
+
showCancel = false,
|
|
38
|
+
title,
|
|
39
|
+
visible
|
|
40
|
+
}) {
|
|
41
|
+
const theme = useDocyrusRNAssistantTheme();
|
|
42
|
+
const insets = useSafeAreaInsets();
|
|
43
|
+
const resolvedDetent = useMemo(() => detents?.[0] ?? detent, [detent, detents]);
|
|
44
|
+
const maxHeight = resolveMaxHeight(resolvedDetent, insets.top);
|
|
45
|
+
const [isMounted, setIsMounted] = useState(visible);
|
|
46
|
+
const progress = useRef(new Animated.Value(visible ? 1 : 0)).current;
|
|
47
|
+
const dragY = useRef(new Animated.Value(0)).current;
|
|
48
|
+
const sheetTravel = maxHeight ?? Math.round(Dimensions.get('window').height * 0.9);
|
|
49
|
+
const closeThreshold = Math.min(140, Math.max(64, sheetTravel * 0.18));
|
|
50
|
+
const finishClose = useCallback(() => {
|
|
51
|
+
dragY.setValue(0);
|
|
52
|
+
onClose();
|
|
53
|
+
}, [dragY, onClose]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (visible) {
|
|
56
|
+
setIsMounted(true);
|
|
57
|
+
dragY.setValue(0);
|
|
58
|
+
Animated.spring(progress, {
|
|
59
|
+
toValue: 1,
|
|
60
|
+
damping: 24,
|
|
61
|
+
stiffness: 260,
|
|
62
|
+
mass: 0.9,
|
|
63
|
+
useNativeDriver: true
|
|
64
|
+
}).start();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
Animated.timing(progress, {
|
|
68
|
+
toValue: 0,
|
|
69
|
+
duration: 220,
|
|
70
|
+
easing: Easing.out(Easing.cubic),
|
|
71
|
+
useNativeDriver: true
|
|
72
|
+
}).start(({
|
|
73
|
+
finished
|
|
74
|
+
}) => {
|
|
75
|
+
if (finished) {
|
|
76
|
+
setIsMounted(false);
|
|
77
|
+
dragY.setValue(0);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}, [dragY, progress, visible]);
|
|
81
|
+
const requestClose = useCallback(() => {
|
|
82
|
+
Animated.parallel([Animated.timing(progress, {
|
|
83
|
+
toValue: 0,
|
|
84
|
+
duration: 180,
|
|
85
|
+
easing: Easing.out(Easing.cubic),
|
|
86
|
+
useNativeDriver: true
|
|
87
|
+
}), Animated.timing(dragY, {
|
|
88
|
+
toValue: Math.min(closeThreshold, 72),
|
|
89
|
+
duration: 180,
|
|
90
|
+
easing: Easing.out(Easing.cubic),
|
|
91
|
+
useNativeDriver: true
|
|
92
|
+
})]).start(({
|
|
93
|
+
finished
|
|
94
|
+
}) => {
|
|
95
|
+
if (finished) {
|
|
96
|
+
finishClose();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}, [closeThreshold, dragY, finishClose, progress]);
|
|
100
|
+
const panResponder = useMemo(() => PanResponder.create({
|
|
101
|
+
onMoveShouldSetPanResponder: (_, gestureState) => gestureState.dy > 6 && Math.abs(gestureState.dy) > Math.abs(gestureState.dx),
|
|
102
|
+
onPanResponderGrant: () => {
|
|
103
|
+
dragY.stopAnimation();
|
|
104
|
+
},
|
|
105
|
+
onPanResponderMove: (_, gestureState) => {
|
|
106
|
+
dragY.setValue(Math.max(0, gestureState.dy));
|
|
107
|
+
},
|
|
108
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
109
|
+
if (gestureState.dy > closeThreshold || gestureState.vy > 1.15) {
|
|
110
|
+
requestClose();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
Animated.spring(dragY, {
|
|
114
|
+
toValue: 0,
|
|
115
|
+
damping: 22,
|
|
116
|
+
stiffness: 240,
|
|
117
|
+
mass: 0.9,
|
|
118
|
+
useNativeDriver: true
|
|
119
|
+
}).start();
|
|
120
|
+
},
|
|
121
|
+
onPanResponderTerminate: () => {
|
|
122
|
+
Animated.spring(dragY, {
|
|
123
|
+
toValue: 0,
|
|
124
|
+
damping: 22,
|
|
125
|
+
stiffness: 240,
|
|
126
|
+
mass: 0.9,
|
|
127
|
+
useNativeDriver: true
|
|
128
|
+
}).start();
|
|
129
|
+
}
|
|
130
|
+
}), [closeThreshold, dragY, requestClose]);
|
|
131
|
+
const backdropOpacity = progress.interpolate({
|
|
132
|
+
inputRange: [0, 1],
|
|
133
|
+
outputRange: [0, 1]
|
|
134
|
+
});
|
|
135
|
+
const translateY = Animated.add(dragY, progress.interpolate({
|
|
136
|
+
inputRange: [0, 1],
|
|
137
|
+
outputRange: [sheetTravel, 0]
|
|
138
|
+
}));
|
|
139
|
+
if (!isMounted) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
return /*#__PURE__*/_jsx(View, {
|
|
143
|
+
pointerEvents: "box-none",
|
|
144
|
+
style: styles.root,
|
|
145
|
+
children: /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
146
|
+
onPress: closeOnBackdrop ? requestClose : undefined,
|
|
147
|
+
style: [styles.backdrop, {
|
|
148
|
+
opacity: backdropOpacity
|
|
149
|
+
}],
|
|
150
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
151
|
+
style: [styles.sheetFrame, {
|
|
152
|
+
transform: [{
|
|
153
|
+
translateY
|
|
154
|
+
}]
|
|
155
|
+
}],
|
|
156
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
157
|
+
onPress: event => event.stopPropagation(),
|
|
158
|
+
style: [styles.sheet, {
|
|
159
|
+
backgroundColor: theme.colors.card,
|
|
160
|
+
borderColor: theme.colors.border,
|
|
161
|
+
borderTopLeftRadius: theme.borderRadius.xl,
|
|
162
|
+
borderTopRightRadius: theme.borderRadius.xl,
|
|
163
|
+
borderBottomLeftRadius: 0,
|
|
164
|
+
borderBottomRightRadius: 0,
|
|
165
|
+
height: maxHeight,
|
|
166
|
+
maxHeight,
|
|
167
|
+
paddingBottom: insets.bottom
|
|
168
|
+
}],
|
|
169
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
170
|
+
...panResponder.panHandlers,
|
|
171
|
+
style: styles.handleTouchArea,
|
|
172
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
173
|
+
style: [styles.handle, {
|
|
174
|
+
backgroundColor: theme.colors.border
|
|
175
|
+
}]
|
|
176
|
+
})
|
|
177
|
+
}), (title || message) && /*#__PURE__*/_jsxs(View, {
|
|
178
|
+
...panResponder.panHandlers,
|
|
179
|
+
style: styles.header,
|
|
180
|
+
children: [title && /*#__PURE__*/_jsx(Text, {
|
|
181
|
+
style: [styles.title, {
|
|
182
|
+
color: theme.colors.foreground
|
|
183
|
+
}],
|
|
184
|
+
children: title
|
|
185
|
+
}), message && /*#__PURE__*/_jsx(Text, {
|
|
186
|
+
style: [styles.message, {
|
|
187
|
+
color: theme.colors.mutedForeground
|
|
188
|
+
}],
|
|
189
|
+
children: message
|
|
190
|
+
})]
|
|
191
|
+
}), fixedContent, (children || actions.length > 0) && (scrollable ? /*#__PURE__*/_jsxs(ScrollView, {
|
|
192
|
+
bounces: false,
|
|
193
|
+
contentContainerStyle: [styles.content, contentContainerStyle],
|
|
194
|
+
showsVerticalScrollIndicator: false,
|
|
195
|
+
children: [children, actions.map(action => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
196
|
+
activeOpacity: 0.8,
|
|
197
|
+
disabled: action.disabled,
|
|
198
|
+
onPress: () => {
|
|
199
|
+
action.onPress();
|
|
200
|
+
onClose();
|
|
201
|
+
},
|
|
202
|
+
style: [styles.actionRow, {
|
|
203
|
+
backgroundColor: theme.colors.muted,
|
|
204
|
+
borderRadius: theme.borderRadius.lg,
|
|
205
|
+
opacity: action.disabled ? 0.5 : 1
|
|
206
|
+
}],
|
|
207
|
+
children: [action.icon && /*#__PURE__*/_jsx(DocyrusIcon, {
|
|
208
|
+
color: action.destructive ? theme.colors.destructive : theme.colors.primary,
|
|
209
|
+
icon: action.icon,
|
|
210
|
+
size: 18
|
|
211
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
212
|
+
style: [styles.actionLabel, {
|
|
213
|
+
color: action.destructive ? theme.colors.destructive : theme.colors.foreground
|
|
214
|
+
}],
|
|
215
|
+
children: action.label
|
|
216
|
+
})]
|
|
217
|
+
}, action.key))]
|
|
218
|
+
}) : /*#__PURE__*/_jsxs(View, {
|
|
219
|
+
style: [styles.body, contentContainerStyle],
|
|
220
|
+
children: [children, actions.map(action => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
221
|
+
activeOpacity: 0.8,
|
|
222
|
+
disabled: action.disabled,
|
|
223
|
+
onPress: () => {
|
|
224
|
+
action.onPress();
|
|
225
|
+
onClose();
|
|
226
|
+
},
|
|
227
|
+
style: [styles.actionRow, {
|
|
228
|
+
backgroundColor: theme.colors.muted,
|
|
229
|
+
borderRadius: theme.borderRadius.lg,
|
|
230
|
+
opacity: action.disabled ? 0.5 : 1
|
|
231
|
+
}],
|
|
232
|
+
children: [action.icon && /*#__PURE__*/_jsx(DocyrusIcon, {
|
|
233
|
+
color: action.destructive ? theme.colors.destructive : theme.colors.primary,
|
|
234
|
+
icon: action.icon,
|
|
235
|
+
size: 18
|
|
236
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
237
|
+
style: [styles.actionLabel, {
|
|
238
|
+
color: action.destructive ? theme.colors.destructive : theme.colors.foreground
|
|
239
|
+
}],
|
|
240
|
+
children: action.label
|
|
241
|
+
})]
|
|
242
|
+
}, action.key))]
|
|
243
|
+
})), showCancel && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
244
|
+
activeOpacity: 0.8,
|
|
245
|
+
onPress: requestClose,
|
|
246
|
+
style: [styles.cancelButton, {
|
|
247
|
+
backgroundColor: theme.colors.muted,
|
|
248
|
+
borderRadius: theme.borderRadius.lg
|
|
249
|
+
}],
|
|
250
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
251
|
+
style: [styles.cancelText, {
|
|
252
|
+
color: theme.colors.foreground
|
|
253
|
+
}],
|
|
254
|
+
children: cancelLabel ?? 'Cancel'
|
|
255
|
+
})
|
|
256
|
+
})]
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
})
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
263
|
+
const styles = StyleSheet.create({
|
|
264
|
+
actionLabel: {
|
|
265
|
+
fontSize: 15,
|
|
266
|
+
fontWeight: '600'
|
|
267
|
+
},
|
|
268
|
+
actionRow: {
|
|
269
|
+
alignItems: 'center',
|
|
270
|
+
flexDirection: 'row',
|
|
271
|
+
gap: 10,
|
|
272
|
+
paddingHorizontal: 16,
|
|
273
|
+
paddingVertical: 14
|
|
274
|
+
},
|
|
275
|
+
root: {
|
|
276
|
+
...StyleSheet.absoluteFillObject,
|
|
277
|
+
elevation: 1000,
|
|
278
|
+
zIndex: 1000
|
|
279
|
+
},
|
|
280
|
+
backdrop: {
|
|
281
|
+
backgroundColor: 'rgba(15, 23, 42, 0.35)',
|
|
282
|
+
flex: 1,
|
|
283
|
+
justifyContent: 'flex-end',
|
|
284
|
+
paddingHorizontal: 0,
|
|
285
|
+
paddingTop: 0
|
|
286
|
+
},
|
|
287
|
+
sheetFrame: {
|
|
288
|
+
alignSelf: 'stretch'
|
|
289
|
+
},
|
|
290
|
+
body: {
|
|
291
|
+
alignSelf: 'stretch',
|
|
292
|
+
flex: 1,
|
|
293
|
+
gap: 8,
|
|
294
|
+
minHeight: 0
|
|
295
|
+
},
|
|
296
|
+
cancelButton: {
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
justifyContent: 'center',
|
|
299
|
+
marginTop: 12,
|
|
300
|
+
paddingHorizontal: 16,
|
|
301
|
+
paddingVertical: 14
|
|
302
|
+
},
|
|
303
|
+
cancelText: {
|
|
304
|
+
fontSize: 15,
|
|
305
|
+
fontWeight: '600'
|
|
306
|
+
},
|
|
307
|
+
content: {
|
|
308
|
+
flexGrow: 1,
|
|
309
|
+
gap: 8
|
|
310
|
+
},
|
|
311
|
+
handle: {
|
|
312
|
+
alignSelf: 'center',
|
|
313
|
+
borderRadius: 999,
|
|
314
|
+
height: 5,
|
|
315
|
+
marginBottom: 12,
|
|
316
|
+
width: 40
|
|
317
|
+
},
|
|
318
|
+
handleTouchArea: {
|
|
319
|
+
alignItems: 'center',
|
|
320
|
+
paddingBottom: 6,
|
|
321
|
+
paddingTop: 6
|
|
322
|
+
},
|
|
323
|
+
header: {
|
|
324
|
+
gap: 6,
|
|
325
|
+
marginBottom: 12,
|
|
326
|
+
paddingHorizontal: 16
|
|
327
|
+
},
|
|
328
|
+
message: {
|
|
329
|
+
fontSize: 13,
|
|
330
|
+
lineHeight: 18
|
|
331
|
+
},
|
|
332
|
+
sheet: {
|
|
333
|
+
alignSelf: 'stretch',
|
|
334
|
+
borderWidth: 1,
|
|
335
|
+
flexShrink: 1,
|
|
336
|
+
minHeight: 0,
|
|
337
|
+
overflow: 'hidden'
|
|
338
|
+
},
|
|
339
|
+
title: {
|
|
340
|
+
fontSize: 16,
|
|
341
|
+
fontWeight: '700'
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
//# sourceMappingURL=action-sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useEffect","useMemo","useRef","useState","Animated","Dimensions","Easing","PanResponder","Pressable","ScrollView","StyleSheet","Text","TouchableOpacity","View","useSafeAreaInsets","useDocyrusRNAssistantTheme","DocyrusIcon","jsx","_jsx","jsxs","_jsxs","ratioMap","small","medium","large","resolveMaxHeight","detent","topInset","screenHeight","get","height","availableHeight","Math","max","undefined","round","ActionSheet","actions","cancelLabel","children","closeOnBackdrop","contentContainerStyle","detents","fixedContent","message","onClose","scrollable","showCancel","title","visible","theme","insets","resolvedDetent","maxHeight","top","isMounted","setIsMounted","progress","Value","current","dragY","sheetTravel","closeThreshold","min","finishClose","setValue","spring","toValue","damping","stiffness","mass","useNativeDriver","start","timing","duration","easing","out","cubic","finished","requestClose","parallel","panResponder","create","onMoveShouldSetPanResponder","_","gestureState","dy","abs","dx","onPanResponderGrant","stopAnimation","onPanResponderMove","onPanResponderRelease","vy","onPanResponderTerminate","backdropOpacity","interpolate","inputRange","outputRange","translateY","add","pointerEvents","style","styles","root","AnimatedPressable","onPress","backdrop","opacity","sheetFrame","transform","event","stopPropagation","sheet","backgroundColor","colors","card","borderColor","border","borderTopLeftRadius","borderRadius","xl","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","paddingBottom","bottom","panHandlers","handleTouchArea","handle","header","color","foreground","mutedForeground","length","bounces","content","showsVerticalScrollIndicator","map","action","activeOpacity","disabled","actionRow","muted","lg","icon","destructive","primary","size","actionLabel","label","key","body","cancelButton","cancelText","createAnimatedComponent","fontSize","fontWeight","alignItems","flexDirection","gap","paddingHorizontal","paddingVertical","absoluteFillObject","elevation","zIndex","flex","justifyContent","paddingTop","alignSelf","minHeight","marginTop","flexGrow","marginBottom","width","lineHeight","borderWidth","flexShrink","overflow"],"sourceRoot":"../../../src","sources":["ui/action-sheet.tsx"],"mappings":";;AAAA,SACkBA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAC5D,OAAO;AAEd,SACE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ressable, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { useDocyrusRNAssistantTheme } from "../theme/index.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function AlertDialog({
|
|
7
|
+
cancelText,
|
|
8
|
+
confirmText,
|
|
9
|
+
description,
|
|
10
|
+
onCancel,
|
|
11
|
+
onConfirm,
|
|
12
|
+
title,
|
|
13
|
+
variant = 'default',
|
|
14
|
+
visible = false
|
|
15
|
+
}) {
|
|
16
|
+
const theme = useDocyrusRNAssistantTheme();
|
|
17
|
+
const confirmBackground = variant === 'destructive' ? theme.colors.destructive : variant === 'success' ? theme.colors.success : variant === 'warning' ? theme.colors.warning : theme.colors.primary;
|
|
18
|
+
const confirmForeground = variant === 'success' ? theme.colors.successForeground : variant === 'warning' ? theme.colors.warningForeground : theme.colors.primaryForeground;
|
|
19
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
20
|
+
animationType: "fade",
|
|
21
|
+
onRequestClose: onCancel,
|
|
22
|
+
statusBarTranslucent: true,
|
|
23
|
+
transparent: true,
|
|
24
|
+
visible: visible,
|
|
25
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
26
|
+
onPress: onCancel,
|
|
27
|
+
style: styles.backdrop,
|
|
28
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
29
|
+
onPress: event => event.stopPropagation(),
|
|
30
|
+
style: [styles.dialog, {
|
|
31
|
+
backgroundColor: theme.colors.card,
|
|
32
|
+
borderColor: theme.colors.border,
|
|
33
|
+
borderRadius: theme.borderRadius.xl
|
|
34
|
+
}],
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: [styles.title, {
|
|
37
|
+
color: theme.colors.foreground
|
|
38
|
+
}],
|
|
39
|
+
children: title ?? 'Are you sure?'
|
|
40
|
+
}), description && /*#__PURE__*/_jsx(Text, {
|
|
41
|
+
style: [styles.description, {
|
|
42
|
+
color: theme.colors.mutedForeground
|
|
43
|
+
}],
|
|
44
|
+
children: description
|
|
45
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
46
|
+
style: styles.footer,
|
|
47
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
48
|
+
activeOpacity: 0.8,
|
|
49
|
+
onPress: onCancel,
|
|
50
|
+
style: [styles.secondaryButton, {
|
|
51
|
+
backgroundColor: theme.colors.muted,
|
|
52
|
+
borderRadius: theme.borderRadius.lg
|
|
53
|
+
}],
|
|
54
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
55
|
+
style: [styles.secondaryText, {
|
|
56
|
+
color: theme.colors.foreground
|
|
57
|
+
}],
|
|
58
|
+
children: cancelText ?? 'Cancel'
|
|
59
|
+
})
|
|
60
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
61
|
+
activeOpacity: 0.8,
|
|
62
|
+
onPress: onConfirm,
|
|
63
|
+
style: [styles.primaryButton, {
|
|
64
|
+
backgroundColor: confirmBackground,
|
|
65
|
+
borderRadius: theme.borderRadius.lg
|
|
66
|
+
}],
|
|
67
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
68
|
+
style: [styles.primaryText, {
|
|
69
|
+
color: confirmForeground
|
|
70
|
+
}],
|
|
71
|
+
children: confirmText ?? 'Confirm'
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
})]
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
backdrop: {
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
backgroundColor: 'rgba(15, 23, 42, 0.45)',
|
|
83
|
+
flex: 1,
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
padding: 24
|
|
86
|
+
},
|
|
87
|
+
description: {
|
|
88
|
+
fontSize: 14,
|
|
89
|
+
lineHeight: 20,
|
|
90
|
+
marginTop: 8
|
|
91
|
+
},
|
|
92
|
+
dialog: {
|
|
93
|
+
borderWidth: 1,
|
|
94
|
+
padding: 20,
|
|
95
|
+
width: '100%'
|
|
96
|
+
},
|
|
97
|
+
footer: {
|
|
98
|
+
flexDirection: 'row',
|
|
99
|
+
gap: 12,
|
|
100
|
+
justifyContent: 'flex-end',
|
|
101
|
+
marginTop: 20
|
|
102
|
+
},
|
|
103
|
+
primaryButton: {
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
minWidth: 96,
|
|
107
|
+
paddingHorizontal: 16,
|
|
108
|
+
paddingVertical: 12
|
|
109
|
+
},
|
|
110
|
+
primaryText: {
|
|
111
|
+
fontSize: 14,
|
|
112
|
+
fontWeight: '700'
|
|
113
|
+
},
|
|
114
|
+
secondaryButton: {
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
justifyContent: 'center',
|
|
117
|
+
minWidth: 96,
|
|
118
|
+
paddingHorizontal: 16,
|
|
119
|
+
paddingVertical: 12
|
|
120
|
+
},
|
|
121
|
+
secondaryText: {
|
|
122
|
+
fontSize: 14,
|
|
123
|
+
fontWeight: '600'
|
|
124
|
+
},
|
|
125
|
+
title: {
|
|
126
|
+
fontSize: 17,
|
|
127
|
+
fontWeight: '700'
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Modal","Pressable","StyleSheet","Text","TouchableOpacity","View","useDocyrusRNAssistantTheme","jsx","_jsx","jsxs","_jsxs","AlertDialog","cancelText","confirmText","description","onCancel","onConfirm","title","variant","visible","theme","confirmBackground","colors","destructive","success","warning","primary","confirmForeground","successForeground","warningForeground","primaryForeground","animationType","onRequestClose","statusBarTranslucent","transparent","children","onPress","style","styles","backdrop","event","stopPropagation","dialog","backgroundColor","card","borderColor","border","borderRadius","xl","color","foreground","mutedForeground","footer","activeOpacity","secondaryButton","muted","lg","secondaryText","primaryButton","primaryText","create","alignItems","flex","justifyContent","padding","fontSize","lineHeight","marginTop","borderWidth","width","flexDirection","gap","minWidth","paddingHorizontal","paddingVertical","fontWeight"],"sourceRoot":"../../../src","sources":["ui/alert-dialog.tsx"],"mappings":";;AAAA,SACEA,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AAErB,SAASC,0BAA0B,QAAQ,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAatD,OAAO,SAASC,WAAWA,CAAC;EAC1BC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,QAAQ;EACRC,SAAS;EACTC,KAAK;EACLC,OAAO,GAAG,SAAS;EACnBC,OAAO,GAAG;AACM,CAAC,EAAE;EACnB,MAAMC,KAAK,GAAGd,0BAA0B,CAAC,CAAC;EAE1C,MAAMe,iBAAiB,GAAGH,OAAO,KAAK,aAAa,GAAGE,KAAK,CAACE,MAAM,CAACC,WAAW,GAAGL,OAAO,KAAK,SAAS,GAAGE,KAAK,CAACE,MAAM,CAACE,OAAO,GAAGN,OAAO,KAAK,SAAS,GAAGE,KAAK,CAACE,MAAM,CAACG,OAAO,GAAGL,KAAK,CAACE,MAAM,CAACI,OAAO;EAEnM,MAAMC,iBAAiB,GAAGT,OAAO,KAAK,SAAS,GAAGE,KAAK,CAACE,MAAM,CAACM,iBAAiB,GAAGV,OAAO,KAAK,SAAS,GAAGE,KAAK,CAACE,MAAM,CAACO,iBAAiB,GAAGT,KAAK,CAACE,MAAM,CAACQ,iBAAiB;EAE1K,oBACEtB,IAAA,CAACR,KAAK;IACJ+B,aAAa,EAAC,MAAM;IACpBC,cAAc,EAAEjB,QAAS;IACzBkB,oBAAoB;IACpBC,WAAW;IACXf,OAAO,EAAEA,OAAQ;IAAAgB,QAAA,eACjB3B,IAAA,CAACP,SAAS;MAACmC,OAAO,EAAErB,QAAS;MAACsB,KAAK,EAAEC,MAAM,CAACC,QAAS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