@almadar/mobile 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +203 -0
- package/dist/chunk-6RVITGGH.js +167 -0
- package/dist/chunk-6RVITGGH.js.map +1 -0
- package/dist/chunk-7C5JCLLY.js +1125 -0
- package/dist/chunk-7C5JCLLY.js.map +1 -0
- package/dist/chunk-CA6Z3OTE.js +247 -0
- package/dist/chunk-CA6Z3OTE.js.map +1 -0
- package/dist/chunk-CUAWHLEK.js +119 -0
- package/dist/chunk-CUAWHLEK.js.map +1 -0
- package/dist/chunk-DMLYJFYQ.js +816 -0
- package/dist/chunk-DMLYJFYQ.js.map +1 -0
- package/dist/chunk-DY52O4T3.js +795 -0
- package/dist/chunk-DY52O4T3.js.map +1 -0
- package/dist/chunk-LFHVNHVA.js +176 -0
- package/dist/chunk-LFHVNHVA.js.map +1 -0
- package/dist/chunk-MFU7Q7LU.js +206 -0
- package/dist/chunk-MFU7Q7LU.js.map +1 -0
- package/dist/chunk-S2IT7WZT.js +71 -0
- package/dist/chunk-S2IT7WZT.js.map +1 -0
- package/dist/chunk-T77JPOTP.js +11789 -0
- package/dist/chunk-T77JPOTP.js.map +1 -0
- package/dist/chunk-VLUJ7BXN.js +36 -0
- package/dist/chunk-VLUJ7BXN.js.map +1 -0
- package/dist/chunk-YMJZLYLV.js +4086 -0
- package/dist/chunk-YMJZLYLV.js.map +1 -0
- package/dist/chunk-YTVYMEKU.js +7 -0
- package/dist/chunk-YTVYMEKU.js.map +1 -0
- package/dist/components/atoms/Avatar.d.ts +17 -0
- package/dist/components/atoms/Avatar.d.ts.map +1 -0
- package/dist/components/atoms/Badge.d.ts +18 -0
- package/dist/components/atoms/Badge.d.ts.map +1 -0
- package/dist/components/atoms/Button.d.ts +20 -0
- package/dist/components/atoms/Button.d.ts.map +1 -0
- package/dist/components/atoms/Card.d.ts +21 -0
- package/dist/components/atoms/Card.d.ts.map +1 -0
- package/dist/components/atoms/Center.d.ts +14 -0
- package/dist/components/atoms/Center.d.ts.map +1 -0
- package/dist/components/atoms/Checkbox.d.ts +21 -0
- package/dist/components/atoms/Checkbox.d.ts.map +1 -0
- package/dist/components/atoms/ConditionalWrapper.d.ts +34 -0
- package/dist/components/atoms/ConditionalWrapper.d.ts.map +1 -0
- package/dist/components/atoms/Divider.d.ts +11 -0
- package/dist/components/atoms/Divider.d.ts.map +1 -0
- package/dist/components/atoms/Icon.d.ts +11 -0
- package/dist/components/atoms/Icon.d.ts.map +1 -0
- package/dist/components/atoms/Input.d.ts +21 -0
- package/dist/components/atoms/Input.d.ts.map +1 -0
- package/dist/components/atoms/Label.d.ts +12 -0
- package/dist/components/atoms/Label.d.ts.map +1 -0
- package/dist/components/atoms/Overlay.d.ts +16 -0
- package/dist/components/atoms/Overlay.d.ts.map +1 -0
- package/dist/components/atoms/ProgressBar.d.ts +18 -0
- package/dist/components/atoms/ProgressBar.d.ts.map +1 -0
- package/dist/components/atoms/Radio.d.ts +21 -0
- package/dist/components/atoms/Radio.d.ts.map +1 -0
- package/dist/components/atoms/Select.d.ts +27 -0
- package/dist/components/atoms/Select.d.ts.map +1 -0
- package/dist/components/atoms/Spacer.d.ts +20 -0
- package/dist/components/atoms/Spacer.d.ts.map +1 -0
- package/dist/components/atoms/Spinner.d.ts +11 -0
- package/dist/components/atoms/Spinner.d.ts.map +1 -0
- package/dist/components/atoms/Stack.d.ts +45 -0
- package/dist/components/atoms/Stack.d.ts.map +1 -0
- package/dist/components/atoms/Switch.d.ts +21 -0
- package/dist/components/atoms/Switch.d.ts.map +1 -0
- package/dist/components/atoms/Textarea.d.ts +22 -0
- package/dist/components/atoms/Textarea.d.ts.map +1 -0
- package/dist/components/atoms/Typography.d.ts +20 -0
- package/dist/components/atoms/Typography.d.ts.map +1 -0
- package/dist/components/atoms/game/ControlButton.d.ts +30 -0
- package/dist/components/atoms/game/ControlButton.d.ts.map +1 -0
- package/dist/components/atoms/game/HealthBar.d.ts +18 -0
- package/dist/components/atoms/game/HealthBar.d.ts.map +1 -0
- package/dist/components/atoms/game/ScoreDisplay.d.ts +20 -0
- package/dist/components/atoms/game/ScoreDisplay.d.ts.map +1 -0
- package/dist/components/atoms/game/Sprite.d.ts +41 -0
- package/dist/components/atoms/game/Sprite.d.ts.map +1 -0
- package/dist/components/atoms/game/StateIndicator.d.ts +22 -0
- package/dist/components/atoms/game/StateIndicator.d.ts.map +1 -0
- package/dist/components/atoms/game/index.d.ts +11 -0
- package/dist/components/atoms/game/index.d.ts.map +1 -0
- package/dist/components/atoms/index.d.ts +45 -0
- package/dist/components/atoms/index.d.ts.map +1 -0
- package/dist/components/atoms/index.js +69 -0
- package/dist/components/atoms/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +317 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/molecules/Alert.d.ts +22 -0
- package/dist/components/molecules/Alert.d.ts.map +1 -0
- package/dist/components/molecules/Breadcrumb.d.ts +16 -0
- package/dist/components/molecules/Breadcrumb.d.ts.map +1 -0
- package/dist/components/molecules/ButtonGroup.d.ts +23 -0
- package/dist/components/molecules/ButtonGroup.d.ts.map +1 -0
- package/dist/components/molecules/CodeBlock.d.ts +26 -0
- package/dist/components/molecules/CodeBlock.d.ts.map +1 -0
- package/dist/components/molecules/Container.d.ts +20 -0
- package/dist/components/molecules/Container.d.ts.map +1 -0
- package/dist/components/molecules/Drawer.d.ts +11 -0
- package/dist/components/molecules/Drawer.d.ts.map +1 -0
- package/dist/components/molecules/EmptyState.d.ts +7 -0
- package/dist/components/molecules/EmptyState.d.ts.map +1 -0
- package/dist/components/molecules/ErrorBoundary.d.ts +29 -0
- package/dist/components/molecules/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/molecules/ErrorState.d.ts +7 -0
- package/dist/components/molecules/ErrorState.d.ts.map +1 -0
- package/dist/components/molecules/FilterGroup.d.ts +54 -0
- package/dist/components/molecules/FilterGroup.d.ts.map +1 -0
- package/dist/components/molecules/Flex.d.ts +31 -0
- package/dist/components/molecules/Flex.d.ts.map +1 -0
- package/dist/components/molecules/FloatingActionButton.d.ts +33 -0
- package/dist/components/molecules/FloatingActionButton.d.ts.map +1 -0
- package/dist/components/molecules/FormField.d.ts +12 -0
- package/dist/components/molecules/FormField.d.ts.map +1 -0
- package/dist/components/molecules/FormSectionHeader.d.ts +15 -0
- package/dist/components/molecules/FormSectionHeader.d.ts.map +1 -0
- package/dist/components/molecules/Grid.d.ts +24 -0
- package/dist/components/molecules/Grid.d.ts.map +1 -0
- package/dist/components/molecules/InputGroup.d.ts +18 -0
- package/dist/components/molecules/InputGroup.d.ts.map +1 -0
- package/dist/components/molecules/List.d.ts +16 -0
- package/dist/components/molecules/List.d.ts.map +1 -0
- package/dist/components/molecules/LoadingState.d.ts +6 -0
- package/dist/components/molecules/LoadingState.d.ts.map +1 -0
- package/dist/components/molecules/MarkdownContent.d.ts +18 -0
- package/dist/components/molecules/MarkdownContent.d.ts.map +1 -0
- package/dist/components/molecules/Menu.d.ts +19 -0
- package/dist/components/molecules/Menu.d.ts.map +1 -0
- package/dist/components/molecules/Meter.d.ts +58 -0
- package/dist/components/molecules/Meter.d.ts.map +1 -0
- package/dist/components/molecules/Modal.d.ts +22 -0
- package/dist/components/molecules/Modal.d.ts.map +1 -0
- package/dist/components/molecules/Navigation.d.ts +72 -0
- package/dist/components/molecules/Navigation.d.ts.map +1 -0
- package/dist/components/molecules/Pagination.d.ts +30 -0
- package/dist/components/molecules/Pagination.d.ts.map +1 -0
- package/dist/components/molecules/Popover.d.ts +11 -0
- package/dist/components/molecules/Popover.d.ts.map +1 -0
- package/dist/components/molecules/QuizBlock.d.ts +35 -0
- package/dist/components/molecules/QuizBlock.d.ts.map +1 -0
- package/dist/components/molecules/RelationSelect.d.ts +38 -0
- package/dist/components/molecules/RelationSelect.d.ts.map +1 -0
- package/dist/components/molecules/RepeatableFormSection.d.ts +46 -0
- package/dist/components/molecules/RepeatableFormSection.d.ts.map +1 -0
- package/dist/components/molecules/ScaledDiagram.d.ts +41 -0
- package/dist/components/molecules/ScaledDiagram.d.ts.map +1 -0
- package/dist/components/molecules/SearchInput.d.ts +22 -0
- package/dist/components/molecules/SearchInput.d.ts.map +1 -0
- package/dist/components/molecules/SidePanel.d.ts +49 -0
- package/dist/components/molecules/SidePanel.d.ts.map +1 -0
- package/dist/components/molecules/SimpleGrid.d.ts +17 -0
- package/dist/components/molecules/SimpleGrid.d.ts.map +1 -0
- package/dist/components/molecules/Skeleton.d.ts +12 -0
- package/dist/components/molecules/Skeleton.d.ts.map +1 -0
- package/dist/components/molecules/Tabs.d.ts +25 -0
- package/dist/components/molecules/Tabs.d.ts.map +1 -0
- package/dist/components/molecules/Toast.d.ts +18 -0
- package/dist/components/molecules/Toast.d.ts.map +1 -0
- package/dist/components/molecules/Tooltip.d.ts +11 -0
- package/dist/components/molecules/Tooltip.d.ts.map +1 -0
- package/dist/components/molecules/WizardNavigation.d.ts +36 -0
- package/dist/components/molecules/WizardNavigation.d.ts.map +1 -0
- package/dist/components/molecules/WizardProgress.d.ts +26 -0
- package/dist/components/molecules/WizardProgress.d.ts.map +1 -0
- package/dist/components/molecules/game/ActionButtons.d.ts +30 -0
- package/dist/components/molecules/game/ActionButtons.d.ts.map +1 -0
- package/dist/components/molecules/game/DPad.d.ts +19 -0
- package/dist/components/molecules/game/DPad.d.ts.map +1 -0
- package/dist/components/molecules/game/StatBadge.d.ts +26 -0
- package/dist/components/molecules/game/StatBadge.d.ts.map +1 -0
- package/dist/components/molecules/game/index.d.ts +7 -0
- package/dist/components/molecules/game/index.d.ts.map +1 -0
- package/dist/components/molecules/index.d.ts +79 -0
- package/dist/components/molecules/index.d.ts.map +1 -0
- package/dist/components/molecules/index.js +96 -0
- package/dist/components/molecules/index.js.map +1 -0
- package/dist/components/organisms/CardGrid.d.ts +16 -0
- package/dist/components/organisms/CardGrid.d.ts.map +1 -0
- package/dist/components/organisms/Chart.d.ts +26 -0
- package/dist/components/organisms/Chart.d.ts.map +1 -0
- package/dist/components/organisms/CodeViewer.d.ts +29 -0
- package/dist/components/organisms/CodeViewer.d.ts.map +1 -0
- package/dist/components/organisms/ComponentPatterns.d.ts +34 -0
- package/dist/components/organisms/ComponentPatterns.d.ts.map +1 -0
- package/dist/components/organisms/ConfirmDialog.d.ts +46 -0
- package/dist/components/organisms/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/organisms/ContentRenderer.d.ts +37 -0
- package/dist/components/organisms/ContentRenderer.d.ts.map +1 -0
- package/dist/components/organisms/CustomPattern.d.ts +36 -0
- package/dist/components/organisms/CustomPattern.d.ts.map +1 -0
- package/dist/components/organisms/DataTable.d.ts +22 -0
- package/dist/components/organisms/DataTable.d.ts.map +1 -0
- package/dist/components/organisms/DetailPanel.d.ts +17 -0
- package/dist/components/organisms/DetailPanel.d.ts.map +1 -0
- package/dist/components/organisms/DocumentViewer.d.ts +34 -0
- package/dist/components/organisms/DocumentViewer.d.ts.map +1 -0
- package/dist/components/organisms/DrawerSlot.d.ts +38 -0
- package/dist/components/organisms/DrawerSlot.d.ts.map +1 -0
- package/dist/components/organisms/EntityCard.d.ts +11 -0
- package/dist/components/organisms/EntityCard.d.ts.map +1 -0
- package/dist/components/organisms/EntityList.d.ts +17 -0
- package/dist/components/organisms/EntityList.d.ts.map +1 -0
- package/dist/components/organisms/Form.d.ts +49 -0
- package/dist/components/organisms/Form.d.ts.map +1 -0
- package/dist/components/organisms/FormSection.d.ts +9 -0
- package/dist/components/organisms/FormSection.d.ts.map +1 -0
- package/dist/components/organisms/Header.d.ts +24 -0
- package/dist/components/organisms/Header.d.ts.map +1 -0
- package/dist/components/organisms/LayoutPatterns.d.ts +39 -0
- package/dist/components/organisms/LayoutPatterns.d.ts.map +1 -0
- package/dist/components/organisms/MasterDetail.d.ts +39 -0
- package/dist/components/organisms/MasterDetail.d.ts.map +1 -0
- package/dist/components/organisms/MediaGallery.d.ts +35 -0
- package/dist/components/organisms/MediaGallery.d.ts.map +1 -0
- package/dist/components/organisms/ModalSlot.d.ts +35 -0
- package/dist/components/organisms/ModalSlot.d.ts.map +1 -0
- package/dist/components/organisms/PageHeader.d.ts +15 -0
- package/dist/components/organisms/PageHeader.d.ts.map +1 -0
- package/dist/components/organisms/Section.d.ts +52 -0
- package/dist/components/organisms/Section.d.ts.map +1 -0
- package/dist/components/organisms/Sidebar.d.ts +54 -0
- package/dist/components/organisms/Sidebar.d.ts.map +1 -0
- package/dist/components/organisms/SignaturePad.d.ts +44 -0
- package/dist/components/organisms/SignaturePad.d.ts.map +1 -0
- package/dist/components/organisms/Split.d.ts +34 -0
- package/dist/components/organisms/Split.d.ts.map +1 -0
- package/dist/components/organisms/StatCard.d.ts +20 -0
- package/dist/components/organisms/StatCard.d.ts.map +1 -0
- package/dist/components/organisms/StateMachineView.d.ts +41 -0
- package/dist/components/organisms/StateMachineView.d.ts.map +1 -0
- package/dist/components/organisms/Table.d.ts +104 -0
- package/dist/components/organisms/Table.d.ts.map +1 -0
- package/dist/components/organisms/Timeline.d.ts +19 -0
- package/dist/components/organisms/Timeline.d.ts.map +1 -0
- package/dist/components/organisms/ToastSlot.d.ts +30 -0
- package/dist/components/organisms/ToastSlot.d.ts.map +1 -0
- package/dist/components/organisms/UISlotRenderer.d.ts +35 -0
- package/dist/components/organisms/UISlotRenderer.d.ts.map +1 -0
- package/dist/components/organisms/WizardContainer.d.ts +25 -0
- package/dist/components/organisms/WizardContainer.d.ts.map +1 -0
- package/dist/components/organisms/book/BookChapterView.d.ts +26 -0
- package/dist/components/organisms/book/BookChapterView.d.ts.map +1 -0
- package/dist/components/organisms/book/BookCoverPage.d.ts +38 -0
- package/dist/components/organisms/book/BookCoverPage.d.ts.map +1 -0
- package/dist/components/organisms/book/BookNavBar.d.ts +40 -0
- package/dist/components/organisms/book/BookNavBar.d.ts.map +1 -0
- package/dist/components/organisms/book/BookTableOfContents.d.ts +32 -0
- package/dist/components/organisms/book/BookTableOfContents.d.ts.map +1 -0
- package/dist/components/organisms/book/BookViewer.d.ts +36 -0
- package/dist/components/organisms/book/BookViewer.d.ts.map +1 -0
- package/dist/components/organisms/book/index.d.ts +11 -0
- package/dist/components/organisms/book/index.d.ts.map +1 -0
- package/dist/components/organisms/game/BattleBoard.d.ts +38 -0
- package/dist/components/organisms/game/BattleBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/CanvasEffect.d.ts +26 -0
- package/dist/components/organisms/game/CanvasEffect.d.ts.map +1 -0
- package/dist/components/organisms/game/CastleBoard.d.ts +30 -0
- package/dist/components/organisms/game/CastleBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/CombatLog.d.ts +23 -0
- package/dist/components/organisms/game/CombatLog.d.ts.map +1 -0
- package/dist/components/organisms/game/DialogueBox.d.ts +40 -0
- package/dist/components/organisms/game/DialogueBox.d.ts.map +1 -0
- package/dist/components/organisms/game/GameAudioProvider.d.ts +50 -0
- package/dist/components/organisms/game/GameAudioProvider.d.ts.map +1 -0
- package/dist/components/organisms/game/GameAudioToggle.d.ts +18 -0
- package/dist/components/organisms/game/GameAudioToggle.d.ts.map +1 -0
- package/dist/components/organisms/game/GameCanvas3D.d.ts +53 -0
- package/dist/components/organisms/game/GameCanvas3D.d.ts.map +1 -0
- package/dist/components/organisms/game/GameHud.d.ts +40 -0
- package/dist/components/organisms/game/GameHud.d.ts.map +1 -0
- package/dist/components/organisms/game/GameMenu.d.ts +34 -0
- package/dist/components/organisms/game/GameMenu.d.ts.map +1 -0
- package/dist/components/organisms/game/GameOverScreen.d.ts +36 -0
- package/dist/components/organisms/game/GameOverScreen.d.ts.map +1 -0
- package/dist/components/organisms/game/InventoryPanel.d.ts +38 -0
- package/dist/components/organisms/game/InventoryPanel.d.ts.map +1 -0
- package/dist/components/organisms/game/IsometricCanvas.d.ts +54 -0
- package/dist/components/organisms/game/IsometricCanvas.d.ts.map +1 -0
- package/dist/components/organisms/game/TraitSlot.d.ts +29 -0
- package/dist/components/organisms/game/TraitSlot.d.ts.map +1 -0
- package/dist/components/organisms/game/TraitStateViewer.d.ts +28 -0
- package/dist/components/organisms/game/TraitStateViewer.d.ts.map +1 -0
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +30 -0
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/WorldMapBoard.d.ts +40 -0
- package/dist/components/organisms/game/WorldMapBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/index.d.ts +37 -0
- package/dist/components/organisms/game/index.d.ts.map +1 -0
- package/dist/components/organisms/game/physics-sim/SimulationCanvas.d.ts +41 -0
- package/dist/components/organisms/game/physics-sim/SimulationCanvas.d.ts.map +1 -0
- package/dist/components/organisms/game/physics-sim/SimulationControls.d.ts +38 -0
- package/dist/components/organisms/game/physics-sim/SimulationControls.d.ts.map +1 -0
- package/dist/components/organisms/game/physics-sim/SimulationGraph.d.ts +35 -0
- package/dist/components/organisms/game/physics-sim/SimulationGraph.d.ts.map +1 -0
- package/dist/components/organisms/game/physics-sim/index.d.ts +7 -0
- package/dist/components/organisms/game/physics-sim/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +55 -0
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/builder/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/builder/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +56 -0
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/classifier/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/classifier/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +48 -0
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/debugger/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/debugger/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +56 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventLog.d.ts +33 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventLog.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/event-handler/ObjectRulePanel.d.ts +41 -0
- package/dist/components/organisms/game/puzzles/event-handler/ObjectRulePanel.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/event-handler/RuleEditor.d.ts +39 -0
- package/dist/components/organisms/game/puzzles/event-handler/RuleEditor.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/event-handler/index.d.ts +9 -0
- package/dist/components/organisms/game/puzzles/event-handler/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/index.d.ts +49 -0
- package/dist/components/organisms/game/puzzles/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +54 -0
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/negotiator/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/negotiator/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionPalette.d.ts +32 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionPalette.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionTile.d.ts +27 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionTile.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequenceBar.d.ts +31 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequenceBar.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +67 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/sequencer/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/sequencer/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +55 -0
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/simulator/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/simulator/index.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/CodeView.d.ts +40 -0
- package/dist/components/organisms/game/puzzles/state-architect/CodeView.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +78 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateNode.d.ts +29 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateNode.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/TransitionArrow.d.ts +33 -0
- package/dist/components/organisms/game/puzzles/state-architect/TransitionArrow.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/VariablePanel.d.ts +38 -0
- package/dist/components/organisms/game/puzzles/state-architect/VariablePanel.d.ts.map +1 -0
- package/dist/components/organisms/game/puzzles/state-architect/index.d.ts +3 -0
- package/dist/components/organisms/game/puzzles/state-architect/index.d.ts.map +1 -0
- package/dist/components/organisms/index.d.ts +68 -0
- package/dist/components/organisms/index.d.ts.map +1 -0
- package/dist/components/organisms/index.js +168 -0
- package/dist/components/organisms/index.js.map +1 -0
- package/dist/components/organisms/layout/DashboardGrid.d.ts +25 -0
- package/dist/components/organisms/layout/DashboardGrid.d.ts.map +1 -0
- package/dist/components/organisms/layout/SplitPane.d.ts +25 -0
- package/dist/components/organisms/layout/SplitPane.d.ts.map +1 -0
- package/dist/components/organisms/layout/TabbedContainer.d.ts +26 -0
- package/dist/components/organisms/layout/TabbedContainer.d.ts.map +1 -0
- package/dist/components/organisms/layout/index.d.ts +7 -0
- package/dist/components/organisms/layout/index.d.ts.map +1 -0
- package/dist/components/templates/AuthLayout.d.ts +20 -0
- package/dist/components/templates/AuthLayout.d.ts.map +1 -0
- package/dist/components/templates/BattleTemplate.d.ts +31 -0
- package/dist/components/templates/BattleTemplate.d.ts.map +1 -0
- package/dist/components/templates/CastleTemplate.d.ts +32 -0
- package/dist/components/templates/CastleTemplate.d.ts.map +1 -0
- package/dist/components/templates/CounterTemplate.d.ts +32 -0
- package/dist/components/templates/CounterTemplate.d.ts.map +1 -0
- package/dist/components/templates/DashboardLayout.d.ts +20 -0
- package/dist/components/templates/DashboardLayout.d.ts.map +1 -0
- package/dist/components/templates/GameShell.d.ts +29 -0
- package/dist/components/templates/GameShell.d.ts.map +1 -0
- package/dist/components/templates/GameTemplate.d.ts +55 -0
- package/dist/components/templates/GameTemplate.d.ts.map +1 -0
- package/dist/components/templates/WorldMapTemplate.d.ts +35 -0
- package/dist/components/templates/WorldMapTemplate.d.ts.map +1 -0
- package/dist/components/templates/index.d.ts +17 -0
- package/dist/components/templates/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +17 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +34 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useEventBus.d.ts +2 -0
- package/dist/hooks/useEventBus.d.ts.map +1 -0
- package/dist/hooks/useInfiniteScroll.d.ts +32 -0
- package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
- package/dist/hooks/useKeyboard.d.ts +11 -0
- package/dist/hooks/useKeyboard.d.ts.map +1 -0
- package/dist/hooks/useNavigation.d.ts +41 -0
- package/dist/hooks/useNavigation.d.ts.map +1 -0
- package/dist/hooks/usePullToRefresh.d.ts +29 -0
- package/dist/hooks/usePullToRefresh.d.ts.map +1 -0
- package/dist/hooks/useSafeAreaInsets.d.ts +29 -0
- package/dist/hooks/useSafeAreaInsets.d.ts.map +1 -0
- package/dist/hooks/useScrollHeader.d.ts +33 -0
- package/dist/hooks/useScrollHeader.d.ts.map +1 -0
- package/dist/hooks/useThemeStyles.d.ts +26 -0
- package/dist/hooks/useThemeStyles.d.ts.map +1 -0
- package/dist/hooks/useTraitState.d.ts +11 -0
- package/dist/hooks/useTraitState.d.ts.map +1 -0
- package/dist/hooks/useUIEvents.d.ts +2 -0
- package/dist/hooks/useUIEvents.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1264 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/theme.d.ts +13 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/providers/EventBusProvider.d.ts +2 -0
- package/dist/providers/EventBusProvider.d.ts.map +1 -0
- package/dist/providers/ThemeContext.d.ts +91 -0
- package/dist/providers/ThemeContext.d.ts.map +1 -0
- package/dist/providers/ThemeProvider.d.ts +10 -0
- package/dist/providers/ThemeProvider.d.ts.map +1 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +14 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/themes/almadar.d.ts +8 -0
- package/dist/themes/almadar.d.ts.map +1 -0
- package/dist/themes/index.d.ts +90 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/index.js +10 -0
- package/package.json +109 -0
|
@@ -0,0 +1,4086 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ControlButton,
|
|
3
|
+
Label
|
|
4
|
+
} from "./chunk-6RVITGGH.js";
|
|
5
|
+
import {
|
|
6
|
+
EmptyState
|
|
7
|
+
} from "./chunk-DY52O4T3.js";
|
|
8
|
+
import {
|
|
9
|
+
Badge,
|
|
10
|
+
Button,
|
|
11
|
+
Card,
|
|
12
|
+
ErrorState,
|
|
13
|
+
HStack,
|
|
14
|
+
Input,
|
|
15
|
+
LoadingState,
|
|
16
|
+
ProgressBar,
|
|
17
|
+
Select,
|
|
18
|
+
Typography,
|
|
19
|
+
VStack
|
|
20
|
+
} from "./chunk-7C5JCLLY.js";
|
|
21
|
+
import {
|
|
22
|
+
useEventBus
|
|
23
|
+
} from "./chunk-YTVYMEKU.js";
|
|
24
|
+
import {
|
|
25
|
+
useTheme
|
|
26
|
+
} from "./chunk-CUAWHLEK.js";
|
|
27
|
+
|
|
28
|
+
// src/components/molecules/FormField.tsx
|
|
29
|
+
import React from "react";
|
|
30
|
+
import { View, StyleSheet } from "react-native";
|
|
31
|
+
var FormField = ({
|
|
32
|
+
label,
|
|
33
|
+
required,
|
|
34
|
+
error,
|
|
35
|
+
helperText,
|
|
36
|
+
children,
|
|
37
|
+
style
|
|
38
|
+
}) => {
|
|
39
|
+
return /* @__PURE__ */ React.createElement(VStack, { spacing: 6, style: [styles.container, style] }, label && /* @__PURE__ */ React.createElement(View, { style: styles.labelContainer }, /* @__PURE__ */ React.createElement(Typography, { variant: "label" }, label, required && /* @__PURE__ */ React.createElement(Typography, { variant: "label", color: "#ef4444" }, " *"))), children, error ? /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "#ef4444" }, error) : helperText ? /* @__PURE__ */ React.createElement(Typography, { variant: "caption", color: "#6b7280" }, helperText) : null);
|
|
40
|
+
};
|
|
41
|
+
var styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
width: "100%"
|
|
44
|
+
},
|
|
45
|
+
labelContainer: {
|
|
46
|
+
marginBottom: 4
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
FormField.displayName = "FormField";
|
|
50
|
+
|
|
51
|
+
// src/components/molecules/FormSectionHeader.tsx
|
|
52
|
+
import React2 from "react";
|
|
53
|
+
import { View as View2, StyleSheet as StyleSheet2 } from "react-native";
|
|
54
|
+
var FormSectionHeader = ({
|
|
55
|
+
title,
|
|
56
|
+
subtitle,
|
|
57
|
+
style,
|
|
58
|
+
isLoading,
|
|
59
|
+
error
|
|
60
|
+
}) => {
|
|
61
|
+
const theme = useTheme();
|
|
62
|
+
if (isLoading) {
|
|
63
|
+
return /* @__PURE__ */ React2.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React2.createElement(LoadingState, { message: "Loading..." }));
|
|
64
|
+
}
|
|
65
|
+
if (error) {
|
|
66
|
+
return /* @__PURE__ */ React2.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React2.createElement(ErrorState, { message: error.message }));
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ React2.createElement(View2, { style: [styles2.container, style] }, /* @__PURE__ */ React2.createElement(
|
|
69
|
+
Typography,
|
|
70
|
+
{
|
|
71
|
+
variant: "h4",
|
|
72
|
+
style: { color: theme.colors.foreground }
|
|
73
|
+
},
|
|
74
|
+
title
|
|
75
|
+
), subtitle && /* @__PURE__ */ React2.createElement(
|
|
76
|
+
Typography,
|
|
77
|
+
{
|
|
78
|
+
variant: "caption",
|
|
79
|
+
style: [styles2.subtitle, { color: theme.colors["muted-foreground"] }]
|
|
80
|
+
},
|
|
81
|
+
subtitle
|
|
82
|
+
));
|
|
83
|
+
};
|
|
84
|
+
var styles2 = StyleSheet2.create({
|
|
85
|
+
container: {
|
|
86
|
+
marginBottom: 16
|
|
87
|
+
},
|
|
88
|
+
subtitle: {
|
|
89
|
+
marginTop: 4
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
FormSectionHeader.displayName = "FormSectionHeader";
|
|
93
|
+
|
|
94
|
+
// src/components/molecules/InputGroup.tsx
|
|
95
|
+
import React3 from "react";
|
|
96
|
+
import { View as View3, StyleSheet as StyleSheet3 } from "react-native";
|
|
97
|
+
var InputGroup = ({
|
|
98
|
+
label,
|
|
99
|
+
required = false,
|
|
100
|
+
helperText,
|
|
101
|
+
errorMessage,
|
|
102
|
+
children,
|
|
103
|
+
style,
|
|
104
|
+
isLoading,
|
|
105
|
+
error
|
|
106
|
+
}) => {
|
|
107
|
+
const theme = useTheme();
|
|
108
|
+
if (isLoading) {
|
|
109
|
+
return /* @__PURE__ */ React3.createElement(View3, { style: [styles3.container, style] }, /* @__PURE__ */ React3.createElement(LoadingState, { message: "Loading..." }));
|
|
110
|
+
}
|
|
111
|
+
if (error) {
|
|
112
|
+
return /* @__PURE__ */ React3.createElement(View3, { style: [styles3.container, style] }, /* @__PURE__ */ React3.createElement(ErrorState, { message: error.message }));
|
|
113
|
+
}
|
|
114
|
+
const errorText = error?.message || errorMessage;
|
|
115
|
+
return /* @__PURE__ */ React3.createElement(VStack, { spacing: 4, style: [styles3.container, style] }, label && /* @__PURE__ */ React3.createElement(Label, { required }, label), children, errorText ? /* @__PURE__ */ React3.createElement(
|
|
116
|
+
Typography,
|
|
117
|
+
{
|
|
118
|
+
variant: "caption",
|
|
119
|
+
style: { color: theme.colors.error }
|
|
120
|
+
},
|
|
121
|
+
errorText
|
|
122
|
+
) : helperText ? /* @__PURE__ */ React3.createElement(
|
|
123
|
+
Typography,
|
|
124
|
+
{
|
|
125
|
+
variant: "caption",
|
|
126
|
+
style: { color: theme.colors["muted-foreground"] }
|
|
127
|
+
},
|
|
128
|
+
helperText
|
|
129
|
+
) : null);
|
|
130
|
+
};
|
|
131
|
+
var styles3 = StyleSheet3.create({
|
|
132
|
+
container: {
|
|
133
|
+
width: "100%"
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
InputGroup.displayName = "InputGroup";
|
|
137
|
+
|
|
138
|
+
// src/components/molecules/Alert.tsx
|
|
139
|
+
import React4 from "react";
|
|
140
|
+
import {
|
|
141
|
+
View as View4,
|
|
142
|
+
TouchableOpacity,
|
|
143
|
+
StyleSheet as StyleSheet4
|
|
144
|
+
} from "react-native";
|
|
145
|
+
var Alert = ({
|
|
146
|
+
title,
|
|
147
|
+
message,
|
|
148
|
+
variant = "info",
|
|
149
|
+
dismissible = false,
|
|
150
|
+
onDismiss,
|
|
151
|
+
dismissAction,
|
|
152
|
+
style,
|
|
153
|
+
isLoading,
|
|
154
|
+
error,
|
|
155
|
+
actionPayload
|
|
156
|
+
}) => {
|
|
157
|
+
const theme = useTheme();
|
|
158
|
+
const eventBus = useEventBus();
|
|
159
|
+
const handleDismiss = () => {
|
|
160
|
+
if (dismissAction) {
|
|
161
|
+
eventBus.emit(`UI:${dismissAction}`, actionPayload);
|
|
162
|
+
}
|
|
163
|
+
onDismiss?.();
|
|
164
|
+
};
|
|
165
|
+
const variantStyles = {
|
|
166
|
+
info: {
|
|
167
|
+
bg: theme.colors.info,
|
|
168
|
+
border: theme.colors.info,
|
|
169
|
+
icon: "\u2139\uFE0F"
|
|
170
|
+
},
|
|
171
|
+
success: {
|
|
172
|
+
bg: theme.colors.success,
|
|
173
|
+
border: theme.colors.success,
|
|
174
|
+
icon: "\u2713"
|
|
175
|
+
},
|
|
176
|
+
warning: {
|
|
177
|
+
bg: theme.colors.warning,
|
|
178
|
+
border: theme.colors.warning,
|
|
179
|
+
icon: "\u26A0\uFE0F"
|
|
180
|
+
},
|
|
181
|
+
error: {
|
|
182
|
+
bg: theme.colors.error,
|
|
183
|
+
border: theme.colors.error,
|
|
184
|
+
icon: "\u2715"
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const { bg, border } = variantStyles[variant];
|
|
188
|
+
if (isLoading) {
|
|
189
|
+
return /* @__PURE__ */ React4.createElement(View4, { style: [styles4.container, style] }, /* @__PURE__ */ React4.createElement(LoadingState, { message: "Loading..." }));
|
|
190
|
+
}
|
|
191
|
+
if (error) {
|
|
192
|
+
return /* @__PURE__ */ React4.createElement(View4, { style: [styles4.container, style] }, /* @__PURE__ */ React4.createElement(ErrorState, { message: error.message }));
|
|
193
|
+
}
|
|
194
|
+
return /* @__PURE__ */ React4.createElement(
|
|
195
|
+
View4,
|
|
196
|
+
{
|
|
197
|
+
style: [
|
|
198
|
+
styles4.container,
|
|
199
|
+
{
|
|
200
|
+
backgroundColor: bg + "20",
|
|
201
|
+
// 20% opacity
|
|
202
|
+
borderColor: border
|
|
203
|
+
},
|
|
204
|
+
style
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
/* @__PURE__ */ React4.createElement(HStack, { spacing: 12, align: "flex-start" }, /* @__PURE__ */ React4.createElement(View4, { style: [styles4.icon, { backgroundColor: bg }] }, /* @__PURE__ */ React4.createElement(Typography, { variant: "body", style: { color: theme.colors["info-foreground"] } }, variantStyles[variant].icon)), /* @__PURE__ */ React4.createElement(View4, { style: styles4.content }, title && /* @__PURE__ */ React4.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), /* @__PURE__ */ React4.createElement(Typography, { variant: "body", style: { color: theme.colors.foreground } }, message)), dismissible && /* @__PURE__ */ React4.createElement(TouchableOpacity, { onPress: handleDismiss, style: styles4.dismiss }, /* @__PURE__ */ React4.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u2715")))
|
|
208
|
+
);
|
|
209
|
+
};
|
|
210
|
+
var styles4 = StyleSheet4.create({
|
|
211
|
+
container: {
|
|
212
|
+
borderRadius: 8,
|
|
213
|
+
borderWidth: 1,
|
|
214
|
+
padding: 12
|
|
215
|
+
},
|
|
216
|
+
icon: {
|
|
217
|
+
width: 32,
|
|
218
|
+
height: 32,
|
|
219
|
+
borderRadius: 16,
|
|
220
|
+
alignItems: "center",
|
|
221
|
+
justifyContent: "center"
|
|
222
|
+
},
|
|
223
|
+
content: {
|
|
224
|
+
flex: 1
|
|
225
|
+
},
|
|
226
|
+
dismiss: {
|
|
227
|
+
padding: 4
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
Alert.displayName = "Alert";
|
|
231
|
+
|
|
232
|
+
// src/components/molecules/Skeleton.tsx
|
|
233
|
+
import React5, { useEffect } from "react";
|
|
234
|
+
import {
|
|
235
|
+
View as View5,
|
|
236
|
+
StyleSheet as StyleSheet5,
|
|
237
|
+
Animated,
|
|
238
|
+
Easing
|
|
239
|
+
} from "react-native";
|
|
240
|
+
var Skeleton = ({
|
|
241
|
+
width = "100%",
|
|
242
|
+
height = 16,
|
|
243
|
+
borderRadius = 4,
|
|
244
|
+
style
|
|
245
|
+
}) => {
|
|
246
|
+
const theme = useTheme();
|
|
247
|
+
const shimmer = React5.useRef(new Animated.Value(0)).current;
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
const animation = Animated.loop(
|
|
250
|
+
Animated.timing(shimmer, {
|
|
251
|
+
toValue: 1,
|
|
252
|
+
duration: 1500,
|
|
253
|
+
easing: Easing.ease,
|
|
254
|
+
useNativeDriver: true
|
|
255
|
+
})
|
|
256
|
+
);
|
|
257
|
+
animation.start();
|
|
258
|
+
return () => animation.stop();
|
|
259
|
+
}, []);
|
|
260
|
+
const translateX = shimmer.interpolate({
|
|
261
|
+
inputRange: [0, 1],
|
|
262
|
+
outputRange: [-200, 200]
|
|
263
|
+
});
|
|
264
|
+
return /* @__PURE__ */ React5.createElement(
|
|
265
|
+
View5,
|
|
266
|
+
{
|
|
267
|
+
style: [
|
|
268
|
+
styles5.container,
|
|
269
|
+
{
|
|
270
|
+
width,
|
|
271
|
+
height,
|
|
272
|
+
borderRadius,
|
|
273
|
+
backgroundColor: theme.colors.muted
|
|
274
|
+
},
|
|
275
|
+
style
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
/* @__PURE__ */ React5.createElement(
|
|
279
|
+
Animated.View,
|
|
280
|
+
{
|
|
281
|
+
style: [
|
|
282
|
+
styles5.shimmer,
|
|
283
|
+
{
|
|
284
|
+
transform: [{ translateX }]
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
var styles5 = StyleSheet5.create({
|
|
292
|
+
container: {
|
|
293
|
+
overflow: "hidden"
|
|
294
|
+
},
|
|
295
|
+
shimmer: {
|
|
296
|
+
width: "100%",
|
|
297
|
+
height: "100%",
|
|
298
|
+
backgroundColor: "rgba(255, 255, 255, 0.2)"
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
Skeleton.displayName = "Skeleton";
|
|
302
|
+
|
|
303
|
+
// src/components/molecules/SearchInput.tsx
|
|
304
|
+
import React6 from "react";
|
|
305
|
+
import {
|
|
306
|
+
View as View6,
|
|
307
|
+
TextInput,
|
|
308
|
+
TouchableOpacity as TouchableOpacity2,
|
|
309
|
+
StyleSheet as StyleSheet6
|
|
310
|
+
} from "react-native";
|
|
311
|
+
var SearchInput = ({
|
|
312
|
+
value,
|
|
313
|
+
onChange,
|
|
314
|
+
onSubmit,
|
|
315
|
+
placeholder = "Search...",
|
|
316
|
+
autoFocus = false,
|
|
317
|
+
style,
|
|
318
|
+
isLoading,
|
|
319
|
+
error,
|
|
320
|
+
changeEvent,
|
|
321
|
+
submitEvent
|
|
322
|
+
}) => {
|
|
323
|
+
const theme = useTheme();
|
|
324
|
+
const eventBus = useEventBus();
|
|
325
|
+
const handleChangeText = (text) => {
|
|
326
|
+
if (changeEvent) {
|
|
327
|
+
eventBus.emit(`UI:${changeEvent}`, { value: text });
|
|
328
|
+
}
|
|
329
|
+
onChange?.(text);
|
|
330
|
+
};
|
|
331
|
+
const handleSubmit = () => {
|
|
332
|
+
if (submitEvent) {
|
|
333
|
+
eventBus.emit(`UI:${submitEvent}`, { value });
|
|
334
|
+
}
|
|
335
|
+
onSubmit?.();
|
|
336
|
+
};
|
|
337
|
+
const handleClear = () => {
|
|
338
|
+
handleChangeText("");
|
|
339
|
+
};
|
|
340
|
+
if (isLoading) {
|
|
341
|
+
return /* @__PURE__ */ React6.createElement(View6, { style: [styles6.container, style] }, /* @__PURE__ */ React6.createElement(LoadingState, { message: "Loading..." }));
|
|
342
|
+
}
|
|
343
|
+
if (error) {
|
|
344
|
+
return /* @__PURE__ */ React6.createElement(View6, { style: [styles6.container, style] }, /* @__PURE__ */ React6.createElement(ErrorState, { message: error.message }));
|
|
345
|
+
}
|
|
346
|
+
return /* @__PURE__ */ React6.createElement(
|
|
347
|
+
HStack,
|
|
348
|
+
{
|
|
349
|
+
spacing: 8,
|
|
350
|
+
align: "center",
|
|
351
|
+
style: [
|
|
352
|
+
styles6.container,
|
|
353
|
+
{
|
|
354
|
+
backgroundColor: theme.colors.card,
|
|
355
|
+
borderColor: theme.colors.border
|
|
356
|
+
},
|
|
357
|
+
style
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
/* @__PURE__ */ React6.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u{1F50D}"),
|
|
361
|
+
/* @__PURE__ */ React6.createElement(
|
|
362
|
+
TextInput,
|
|
363
|
+
{
|
|
364
|
+
value,
|
|
365
|
+
onChangeText: handleChangeText,
|
|
366
|
+
onSubmitEditing: handleSubmit,
|
|
367
|
+
placeholder,
|
|
368
|
+
placeholderTextColor: theme.colors["muted-foreground"],
|
|
369
|
+
autoFocus,
|
|
370
|
+
returnKeyType: "search",
|
|
371
|
+
style: [
|
|
372
|
+
styles6.input,
|
|
373
|
+
{ color: theme.colors.foreground }
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
value && value.length > 0 && /* @__PURE__ */ React6.createElement(TouchableOpacity2, { onPress: handleClear, style: styles6.clear }, /* @__PURE__ */ React6.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"] } }, "\u2715"))
|
|
378
|
+
);
|
|
379
|
+
};
|
|
380
|
+
var styles6 = StyleSheet6.create({
|
|
381
|
+
container: {
|
|
382
|
+
borderRadius: 8,
|
|
383
|
+
borderWidth: 1,
|
|
384
|
+
paddingHorizontal: 12,
|
|
385
|
+
height: 44
|
|
386
|
+
},
|
|
387
|
+
input: {
|
|
388
|
+
flex: 1,
|
|
389
|
+
fontSize: 16,
|
|
390
|
+
padding: 0
|
|
391
|
+
},
|
|
392
|
+
clear: {
|
|
393
|
+
padding: 4
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
SearchInput.displayName = "SearchInput";
|
|
397
|
+
|
|
398
|
+
// src/components/molecules/Tooltip.tsx
|
|
399
|
+
import React7, { useState, useRef } from "react";
|
|
400
|
+
import {
|
|
401
|
+
View as View7,
|
|
402
|
+
Text,
|
|
403
|
+
StyleSheet as StyleSheet7,
|
|
404
|
+
Modal,
|
|
405
|
+
TouchableOpacity as TouchableOpacity3,
|
|
406
|
+
TouchableWithoutFeedback
|
|
407
|
+
} from "react-native";
|
|
408
|
+
var Tooltip = ({
|
|
409
|
+
content,
|
|
410
|
+
children,
|
|
411
|
+
style
|
|
412
|
+
}) => {
|
|
413
|
+
const theme = useTheme();
|
|
414
|
+
const [visible, setVisible] = useState(false);
|
|
415
|
+
const [position, setPosition] = useState({ x: 0, y: 0, width: 0, height: 0 });
|
|
416
|
+
const triggerRef = useRef(null);
|
|
417
|
+
const showTooltip = () => {
|
|
418
|
+
triggerRef.current?.measure((x, y, width, height, pageX, pageY) => {
|
|
419
|
+
setPosition({ x: pageX, y: pageY, width, height });
|
|
420
|
+
setVisible(true);
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
const hideTooltip = () => {
|
|
424
|
+
setVisible(false);
|
|
425
|
+
};
|
|
426
|
+
const tooltipY = position.y - 40;
|
|
427
|
+
const centerX = position.x + position.width / 2;
|
|
428
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
429
|
+
TouchableOpacity3,
|
|
430
|
+
{
|
|
431
|
+
ref: triggerRef,
|
|
432
|
+
onPressIn: showTooltip,
|
|
433
|
+
onPressOut: hideTooltip,
|
|
434
|
+
style,
|
|
435
|
+
activeOpacity: 1
|
|
436
|
+
},
|
|
437
|
+
children
|
|
438
|
+
), /* @__PURE__ */ React7.createElement(
|
|
439
|
+
Modal,
|
|
440
|
+
{
|
|
441
|
+
visible,
|
|
442
|
+
transparent: true,
|
|
443
|
+
animationType: "fade",
|
|
444
|
+
onRequestClose: hideTooltip
|
|
445
|
+
},
|
|
446
|
+
/* @__PURE__ */ React7.createElement(TouchableWithoutFeedback, { onPress: hideTooltip }, /* @__PURE__ */ React7.createElement(View7, { style: styles7.overlay }, /* @__PURE__ */ React7.createElement(
|
|
447
|
+
View7,
|
|
448
|
+
{
|
|
449
|
+
style: [
|
|
450
|
+
styles7.tooltip,
|
|
451
|
+
{
|
|
452
|
+
backgroundColor: theme.colors.foreground,
|
|
453
|
+
top: tooltipY,
|
|
454
|
+
left: centerX - 60
|
|
455
|
+
}
|
|
456
|
+
]
|
|
457
|
+
},
|
|
458
|
+
/* @__PURE__ */ React7.createElement(Text, { style: [styles7.text, { color: theme.colors.background }] }, content),
|
|
459
|
+
/* @__PURE__ */ React7.createElement(
|
|
460
|
+
View7,
|
|
461
|
+
{
|
|
462
|
+
style: [
|
|
463
|
+
styles7.arrow,
|
|
464
|
+
{ borderTopColor: theme.colors.foreground }
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
)
|
|
468
|
+
)))
|
|
469
|
+
));
|
|
470
|
+
};
|
|
471
|
+
var styles7 = StyleSheet7.create({
|
|
472
|
+
overlay: {
|
|
473
|
+
flex: 1,
|
|
474
|
+
backgroundColor: "transparent"
|
|
475
|
+
},
|
|
476
|
+
tooltip: {
|
|
477
|
+
position: "absolute",
|
|
478
|
+
paddingHorizontal: 12,
|
|
479
|
+
paddingVertical: 8,
|
|
480
|
+
borderRadius: 6,
|
|
481
|
+
minWidth: 120,
|
|
482
|
+
alignItems: "center"
|
|
483
|
+
},
|
|
484
|
+
text: {
|
|
485
|
+
fontSize: 12,
|
|
486
|
+
textAlign: "center"
|
|
487
|
+
},
|
|
488
|
+
arrow: {
|
|
489
|
+
position: "absolute",
|
|
490
|
+
bottom: -8,
|
|
491
|
+
borderLeftWidth: 8,
|
|
492
|
+
borderRightWidth: 8,
|
|
493
|
+
borderTopWidth: 8,
|
|
494
|
+
borderLeftColor: "transparent",
|
|
495
|
+
borderRightColor: "transparent"
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
Tooltip.displayName = "Tooltip";
|
|
499
|
+
|
|
500
|
+
// src/components/molecules/Popover.tsx
|
|
501
|
+
import React8, { useState as useState2, useRef as useRef2 } from "react";
|
|
502
|
+
import {
|
|
503
|
+
View as View8,
|
|
504
|
+
StyleSheet as StyleSheet8,
|
|
505
|
+
Modal as Modal2,
|
|
506
|
+
TouchableOpacity as TouchableOpacity4,
|
|
507
|
+
TouchableWithoutFeedback as TouchableWithoutFeedback2,
|
|
508
|
+
Dimensions
|
|
509
|
+
} from "react-native";
|
|
510
|
+
var Popover = ({
|
|
511
|
+
trigger,
|
|
512
|
+
content,
|
|
513
|
+
style
|
|
514
|
+
}) => {
|
|
515
|
+
const theme = useTheme();
|
|
516
|
+
const [visible, setVisible] = useState2(false);
|
|
517
|
+
const [position, setPosition] = useState2({ x: 0, y: 0, width: 0, height: 0 });
|
|
518
|
+
const triggerRef = useRef2(null);
|
|
519
|
+
const screenHeight = Dimensions.get("window").height;
|
|
520
|
+
const showPopover = () => {
|
|
521
|
+
triggerRef.current?.measure((x, y, width, height, pageX, pageY) => {
|
|
522
|
+
setPosition({ x: pageX, y: pageY, width, height });
|
|
523
|
+
setVisible(true);
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
const hidePopover = () => {
|
|
527
|
+
setVisible(false);
|
|
528
|
+
};
|
|
529
|
+
const popoverY = position.y + position.height + 8;
|
|
530
|
+
const showAbove = popoverY > screenHeight * 0.7;
|
|
531
|
+
const finalY = showAbove ? position.y - 200 : popoverY;
|
|
532
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
533
|
+
TouchableOpacity4,
|
|
534
|
+
{
|
|
535
|
+
ref: triggerRef,
|
|
536
|
+
onPress: showPopover,
|
|
537
|
+
style
|
|
538
|
+
},
|
|
539
|
+
trigger
|
|
540
|
+
), /* @__PURE__ */ React8.createElement(
|
|
541
|
+
Modal2,
|
|
542
|
+
{
|
|
543
|
+
visible,
|
|
544
|
+
transparent: true,
|
|
545
|
+
animationType: "fade",
|
|
546
|
+
onRequestClose: hidePopover
|
|
547
|
+
},
|
|
548
|
+
/* @__PURE__ */ React8.createElement(TouchableWithoutFeedback2, { onPress: hidePopover }, /* @__PURE__ */ React8.createElement(View8, { style: styles8.overlay }, /* @__PURE__ */ React8.createElement(
|
|
549
|
+
View8,
|
|
550
|
+
{
|
|
551
|
+
style: [
|
|
552
|
+
styles8.popover,
|
|
553
|
+
{
|
|
554
|
+
backgroundColor: theme.colors.card,
|
|
555
|
+
borderColor: theme.colors.border,
|
|
556
|
+
top: finalY,
|
|
557
|
+
left: position.x,
|
|
558
|
+
minWidth: position.width
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
},
|
|
562
|
+
showAbove && /* @__PURE__ */ React8.createElement(View8, { style: [styles8.arrowUp, { borderBottomColor: theme.colors.card }] }),
|
|
563
|
+
/* @__PURE__ */ React8.createElement(View8, { style: styles8.content }, content),
|
|
564
|
+
!showAbove && /* @__PURE__ */ React8.createElement(View8, { style: [styles8.arrowDown, { borderTopColor: theme.colors.card }] })
|
|
565
|
+
)))
|
|
566
|
+
));
|
|
567
|
+
};
|
|
568
|
+
var styles8 = StyleSheet8.create({
|
|
569
|
+
overlay: {
|
|
570
|
+
flex: 1,
|
|
571
|
+
backgroundColor: "rgba(0,0,0,0.3)"
|
|
572
|
+
},
|
|
573
|
+
popover: {
|
|
574
|
+
position: "absolute",
|
|
575
|
+
borderRadius: 8,
|
|
576
|
+
borderWidth: 1,
|
|
577
|
+
shadowColor: "#000",
|
|
578
|
+
shadowOffset: { width: 0, height: 2 },
|
|
579
|
+
shadowOpacity: 0.2,
|
|
580
|
+
shadowRadius: 4,
|
|
581
|
+
elevation: 4
|
|
582
|
+
},
|
|
583
|
+
content: {
|
|
584
|
+
padding: 12
|
|
585
|
+
},
|
|
586
|
+
arrowUp: {
|
|
587
|
+
position: "absolute",
|
|
588
|
+
top: -8,
|
|
589
|
+
left: 20,
|
|
590
|
+
borderLeftWidth: 8,
|
|
591
|
+
borderRightWidth: 8,
|
|
592
|
+
borderBottomWidth: 8,
|
|
593
|
+
borderLeftColor: "transparent",
|
|
594
|
+
borderRightColor: "transparent"
|
|
595
|
+
},
|
|
596
|
+
arrowDown: {
|
|
597
|
+
position: "absolute",
|
|
598
|
+
bottom: -8,
|
|
599
|
+
left: 20,
|
|
600
|
+
borderLeftWidth: 8,
|
|
601
|
+
borderRightWidth: 8,
|
|
602
|
+
borderTopWidth: 8,
|
|
603
|
+
borderLeftColor: "transparent",
|
|
604
|
+
borderRightColor: "transparent"
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
Popover.displayName = "Popover";
|
|
608
|
+
|
|
609
|
+
// src/components/molecules/Menu.tsx
|
|
610
|
+
import React9 from "react";
|
|
611
|
+
import {
|
|
612
|
+
View as View9,
|
|
613
|
+
TouchableOpacity as TouchableOpacity5,
|
|
614
|
+
StyleSheet as StyleSheet9,
|
|
615
|
+
Modal as Modal3,
|
|
616
|
+
TouchableWithoutFeedback as TouchableWithoutFeedback3,
|
|
617
|
+
ScrollView
|
|
618
|
+
} from "react-native";
|
|
619
|
+
var Menu = ({
|
|
620
|
+
trigger,
|
|
621
|
+
items,
|
|
622
|
+
style,
|
|
623
|
+
onSelect
|
|
624
|
+
}) => {
|
|
625
|
+
const theme = useTheme();
|
|
626
|
+
const eventBus = useEventBus();
|
|
627
|
+
const [visible, setVisible] = React9.useState(false);
|
|
628
|
+
const triggerRef = React9.useRef(null);
|
|
629
|
+
const [position, setPosition] = React9.useState({ x: 0, y: 0, width: 0 });
|
|
630
|
+
const showMenu = () => {
|
|
631
|
+
triggerRef.current?.measure((x, y, width, height, pageX, pageY) => {
|
|
632
|
+
setPosition({ x: pageX, y: pageY + height + 4, width });
|
|
633
|
+
setVisible(true);
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
const hideMenu = () => {
|
|
637
|
+
setVisible(false);
|
|
638
|
+
};
|
|
639
|
+
const handleSelect = (item) => {
|
|
640
|
+
if (item.disabled) return;
|
|
641
|
+
if (item.action) {
|
|
642
|
+
eventBus.emit(`UI:${item.action}`, { itemId: item.id });
|
|
643
|
+
}
|
|
644
|
+
onSelect?.(item);
|
|
645
|
+
hideMenu();
|
|
646
|
+
};
|
|
647
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
648
|
+
TouchableOpacity5,
|
|
649
|
+
{
|
|
650
|
+
ref: triggerRef,
|
|
651
|
+
onPress: showMenu,
|
|
652
|
+
style
|
|
653
|
+
},
|
|
654
|
+
trigger
|
|
655
|
+
), /* @__PURE__ */ React9.createElement(
|
|
656
|
+
Modal3,
|
|
657
|
+
{
|
|
658
|
+
visible,
|
|
659
|
+
transparent: true,
|
|
660
|
+
animationType: "fade",
|
|
661
|
+
onRequestClose: hideMenu
|
|
662
|
+
},
|
|
663
|
+
/* @__PURE__ */ React9.createElement(TouchableWithoutFeedback3, { onPress: hideMenu }, /* @__PURE__ */ React9.createElement(View9, { style: styles9.overlay }, /* @__PURE__ */ React9.createElement(
|
|
664
|
+
View9,
|
|
665
|
+
{
|
|
666
|
+
style: [
|
|
667
|
+
styles9.menu,
|
|
668
|
+
{
|
|
669
|
+
backgroundColor: theme.colors.card,
|
|
670
|
+
borderColor: theme.colors.border,
|
|
671
|
+
top: position.y,
|
|
672
|
+
left: position.x,
|
|
673
|
+
minWidth: Math.max(position.width, 200)
|
|
674
|
+
}
|
|
675
|
+
]
|
|
676
|
+
},
|
|
677
|
+
/* @__PURE__ */ React9.createElement(ScrollView, null, items.map((item) => /* @__PURE__ */ React9.createElement(
|
|
678
|
+
TouchableOpacity5,
|
|
679
|
+
{
|
|
680
|
+
key: item.id,
|
|
681
|
+
onPress: () => handleSelect(item),
|
|
682
|
+
disabled: item.disabled,
|
|
683
|
+
style: [
|
|
684
|
+
styles9.item,
|
|
685
|
+
{ opacity: item.disabled ? 0.5 : 1 }
|
|
686
|
+
]
|
|
687
|
+
},
|
|
688
|
+
/* @__PURE__ */ React9.createElement(HStack, { spacing: 12, align: "center" }, item.icon, /* @__PURE__ */ React9.createElement(
|
|
689
|
+
Typography,
|
|
690
|
+
{
|
|
691
|
+
variant: "body",
|
|
692
|
+
style: { color: theme.colors.foreground }
|
|
693
|
+
},
|
|
694
|
+
item.label
|
|
695
|
+
))
|
|
696
|
+
)))
|
|
697
|
+
)))
|
|
698
|
+
));
|
|
699
|
+
};
|
|
700
|
+
var styles9 = StyleSheet9.create({
|
|
701
|
+
overlay: {
|
|
702
|
+
flex: 1,
|
|
703
|
+
backgroundColor: "rgba(0,0,0,0.3)"
|
|
704
|
+
},
|
|
705
|
+
menu: {
|
|
706
|
+
position: "absolute",
|
|
707
|
+
borderRadius: 8,
|
|
708
|
+
borderWidth: 1,
|
|
709
|
+
maxHeight: 300,
|
|
710
|
+
shadowColor: "#000",
|
|
711
|
+
shadowOffset: { width: 0, height: 2 },
|
|
712
|
+
shadowOpacity: 0.2,
|
|
713
|
+
shadowRadius: 4,
|
|
714
|
+
elevation: 4
|
|
715
|
+
},
|
|
716
|
+
item: {
|
|
717
|
+
padding: 12,
|
|
718
|
+
borderBottomWidth: 1,
|
|
719
|
+
borderBottomColor: "rgba(0,0,0,0.1)"
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
Menu.displayName = "Menu";
|
|
723
|
+
|
|
724
|
+
// src/components/molecules/Breadcrumb.tsx
|
|
725
|
+
import React10 from "react";
|
|
726
|
+
import {
|
|
727
|
+
TouchableOpacity as TouchableOpacity6,
|
|
728
|
+
ScrollView as ScrollView2,
|
|
729
|
+
StyleSheet as StyleSheet10
|
|
730
|
+
} from "react-native";
|
|
731
|
+
var Breadcrumb = ({
|
|
732
|
+
items,
|
|
733
|
+
style,
|
|
734
|
+
onNavigate
|
|
735
|
+
}) => {
|
|
736
|
+
const theme = useTheme();
|
|
737
|
+
const eventBus = useEventBus();
|
|
738
|
+
const handlePress = (item, index) => {
|
|
739
|
+
if (item.action) {
|
|
740
|
+
eventBus.emit(`UI:${item.action}`, { href: item.href, index });
|
|
741
|
+
}
|
|
742
|
+
onNavigate?.(item, index);
|
|
743
|
+
};
|
|
744
|
+
return /* @__PURE__ */ React10.createElement(
|
|
745
|
+
ScrollView2,
|
|
746
|
+
{
|
|
747
|
+
horizontal: true,
|
|
748
|
+
showsHorizontalScrollIndicator: false,
|
|
749
|
+
style: [styles10.container, style]
|
|
750
|
+
},
|
|
751
|
+
/* @__PURE__ */ React10.createElement(HStack, { spacing: 4, align: "center" }, items.map((item, index) => {
|
|
752
|
+
const isLast = index === items.length - 1;
|
|
753
|
+
return /* @__PURE__ */ React10.createElement(HStack, { key: index, spacing: 4, align: "center" }, index > 0 && /* @__PURE__ */ React10.createElement(
|
|
754
|
+
Typography,
|
|
755
|
+
{
|
|
756
|
+
variant: "caption",
|
|
757
|
+
style: { color: theme.colors["muted-foreground"] }
|
|
758
|
+
},
|
|
759
|
+
"/"
|
|
760
|
+
), isLast ? /* @__PURE__ */ React10.createElement(
|
|
761
|
+
Typography,
|
|
762
|
+
{
|
|
763
|
+
variant: "caption",
|
|
764
|
+
style: { color: theme.colors.foreground, fontWeight: "500" }
|
|
765
|
+
},
|
|
766
|
+
item.label
|
|
767
|
+
) : /* @__PURE__ */ React10.createElement(TouchableOpacity6, { onPress: () => handlePress(item, index) }, /* @__PURE__ */ React10.createElement(
|
|
768
|
+
Typography,
|
|
769
|
+
{
|
|
770
|
+
variant: "caption",
|
|
771
|
+
style: { color: theme.colors.primary }
|
|
772
|
+
},
|
|
773
|
+
item.label
|
|
774
|
+
)));
|
|
775
|
+
}))
|
|
776
|
+
);
|
|
777
|
+
};
|
|
778
|
+
var styles10 = StyleSheet10.create({
|
|
779
|
+
container: {
|
|
780
|
+
maxWidth: "100%"
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
784
|
+
|
|
785
|
+
// src/components/molecules/ButtonGroup.tsx
|
|
786
|
+
import React11 from "react";
|
|
787
|
+
import {
|
|
788
|
+
TouchableOpacity as TouchableOpacity7,
|
|
789
|
+
StyleSheet as StyleSheet11
|
|
790
|
+
} from "react-native";
|
|
791
|
+
var ButtonGroup = ({
|
|
792
|
+
options,
|
|
793
|
+
value,
|
|
794
|
+
onChange,
|
|
795
|
+
style,
|
|
796
|
+
changeEvent
|
|
797
|
+
}) => {
|
|
798
|
+
const theme = useTheme();
|
|
799
|
+
const eventBus = useEventBus();
|
|
800
|
+
const handlePress = (optionValue) => {
|
|
801
|
+
if (changeEvent) {
|
|
802
|
+
eventBus.emit(`UI:${changeEvent}`, { value: optionValue });
|
|
803
|
+
}
|
|
804
|
+
onChange?.(optionValue);
|
|
805
|
+
};
|
|
806
|
+
return /* @__PURE__ */ React11.createElement(HStack, { spacing: 4, style: style ? [styles11.container, style] : styles11.container }, options.map((option) => {
|
|
807
|
+
const isSelected = value === option.value;
|
|
808
|
+
return /* @__PURE__ */ React11.createElement(
|
|
809
|
+
TouchableOpacity7,
|
|
810
|
+
{
|
|
811
|
+
key: option.value,
|
|
812
|
+
onPress: () => handlePress(option.value),
|
|
813
|
+
disabled: option.disabled,
|
|
814
|
+
style: [
|
|
815
|
+
styles11.button,
|
|
816
|
+
{
|
|
817
|
+
backgroundColor: isSelected ? theme.colors.primary : theme.colors.card,
|
|
818
|
+
borderColor: theme.colors.border,
|
|
819
|
+
opacity: option.disabled ? 0.5 : 1
|
|
820
|
+
}
|
|
821
|
+
]
|
|
822
|
+
},
|
|
823
|
+
/* @__PURE__ */ React11.createElement(
|
|
824
|
+
Typography,
|
|
825
|
+
{
|
|
826
|
+
variant: "body",
|
|
827
|
+
style: {
|
|
828
|
+
color: isSelected ? theme.colors["primary-foreground"] : theme.colors.foreground
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
option.label
|
|
832
|
+
)
|
|
833
|
+
);
|
|
834
|
+
}));
|
|
835
|
+
};
|
|
836
|
+
var styles11 = StyleSheet11.create({
|
|
837
|
+
container: {
|
|
838
|
+
flexWrap: "wrap"
|
|
839
|
+
},
|
|
840
|
+
button: {
|
|
841
|
+
paddingHorizontal: 16,
|
|
842
|
+
paddingVertical: 8,
|
|
843
|
+
borderRadius: 8,
|
|
844
|
+
borderWidth: 1
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
848
|
+
|
|
849
|
+
// src/components/molecules/ErrorBoundary.tsx
|
|
850
|
+
import React12 from "react";
|
|
851
|
+
import { View as View10 } from "react-native";
|
|
852
|
+
var ErrorBoundary = class extends React12.Component {
|
|
853
|
+
constructor(props) {
|
|
854
|
+
super(props);
|
|
855
|
+
this.reset = () => {
|
|
856
|
+
this.setState({ error: null });
|
|
857
|
+
};
|
|
858
|
+
this.state = { error: null };
|
|
859
|
+
}
|
|
860
|
+
static getDerivedStateFromError(error) {
|
|
861
|
+
return { error };
|
|
862
|
+
}
|
|
863
|
+
componentDidCatch(error, errorInfo) {
|
|
864
|
+
this.props.onError?.(error, errorInfo);
|
|
865
|
+
}
|
|
866
|
+
render() {
|
|
867
|
+
const { error } = this.state;
|
|
868
|
+
const { children, fallback, style } = this.props;
|
|
869
|
+
if (error) {
|
|
870
|
+
const fallbackContent = this.renderFallback(error, fallback);
|
|
871
|
+
if (style) {
|
|
872
|
+
return /* @__PURE__ */ React12.createElement(View10, { style }, fallbackContent);
|
|
873
|
+
}
|
|
874
|
+
return fallbackContent;
|
|
875
|
+
}
|
|
876
|
+
return children;
|
|
877
|
+
}
|
|
878
|
+
renderFallback(error, fallback) {
|
|
879
|
+
if (typeof fallback === "function") {
|
|
880
|
+
return fallback(error, this.reset);
|
|
881
|
+
}
|
|
882
|
+
if (fallback) {
|
|
883
|
+
return fallback;
|
|
884
|
+
}
|
|
885
|
+
return /* @__PURE__ */ React12.createElement(
|
|
886
|
+
ErrorState,
|
|
887
|
+
{
|
|
888
|
+
message: `Something went wrong: ${error.message}`,
|
|
889
|
+
onRetry: this.reset
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
ErrorBoundary.displayName = "ErrorBoundary";
|
|
895
|
+
|
|
896
|
+
// src/components/molecules/FloatingActionButton.tsx
|
|
897
|
+
import React13, { useState as useState3, useRef as useRef3 } from "react";
|
|
898
|
+
import {
|
|
899
|
+
View as View11,
|
|
900
|
+
TouchableOpacity as TouchableOpacity8,
|
|
901
|
+
Animated as Animated2,
|
|
902
|
+
StyleSheet as StyleSheet12,
|
|
903
|
+
Text as Text2
|
|
904
|
+
} from "react-native";
|
|
905
|
+
var FloatingActionButton = ({
|
|
906
|
+
action,
|
|
907
|
+
actions,
|
|
908
|
+
icon,
|
|
909
|
+
onPress,
|
|
910
|
+
variant = "primary",
|
|
911
|
+
position = "bottom-right",
|
|
912
|
+
style
|
|
913
|
+
}) => {
|
|
914
|
+
const theme = useTheme();
|
|
915
|
+
const eventBus = useEventBus();
|
|
916
|
+
const [isExpanded, setIsExpanded] = useState3(false);
|
|
917
|
+
const animation = useRef3(new Animated2.Value(0)).current;
|
|
918
|
+
const resolvedAction = action ?? (icon ? {
|
|
919
|
+
icon,
|
|
920
|
+
onPress: onPress ?? (() => {
|
|
921
|
+
}),
|
|
922
|
+
variant
|
|
923
|
+
} : void 0);
|
|
924
|
+
const getPositionStyle = () => {
|
|
925
|
+
switch (position) {
|
|
926
|
+
case "bottom-right":
|
|
927
|
+
return { bottom: 24, right: 24 };
|
|
928
|
+
case "bottom-left":
|
|
929
|
+
return { bottom: 24, left: 24 };
|
|
930
|
+
case "bottom-center":
|
|
931
|
+
return { bottom: 24, alignSelf: "center" };
|
|
932
|
+
case "top-right":
|
|
933
|
+
return { top: 24, right: 24 };
|
|
934
|
+
case "top-left":
|
|
935
|
+
return { top: 24, left: 24 };
|
|
936
|
+
case "top-center":
|
|
937
|
+
return { top: 24, alignSelf: "center" };
|
|
938
|
+
default:
|
|
939
|
+
return { bottom: 24, right: 24 };
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
const getVariantColor = (v) => {
|
|
943
|
+
switch (v) {
|
|
944
|
+
case "primary":
|
|
945
|
+
return theme.colors.primary;
|
|
946
|
+
case "secondary":
|
|
947
|
+
return theme.colors.secondary;
|
|
948
|
+
case "success":
|
|
949
|
+
return "#22c55e";
|
|
950
|
+
case "danger":
|
|
951
|
+
return "#ef4444";
|
|
952
|
+
case "warning":
|
|
953
|
+
return "#f59e0b";
|
|
954
|
+
default:
|
|
955
|
+
return theme.colors.primary;
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
const toggleExpanded = () => {
|
|
959
|
+
const newValue = !isExpanded;
|
|
960
|
+
setIsExpanded(newValue);
|
|
961
|
+
Animated2.spring(animation, {
|
|
962
|
+
toValue: newValue ? 1 : 0,
|
|
963
|
+
useNativeDriver: true
|
|
964
|
+
}).start();
|
|
965
|
+
};
|
|
966
|
+
if (resolvedAction && (!actions || actions.length === 0)) {
|
|
967
|
+
return /* @__PURE__ */ React13.createElement(
|
|
968
|
+
TouchableOpacity8,
|
|
969
|
+
{
|
|
970
|
+
onPress: resolvedAction.onPress,
|
|
971
|
+
style: [
|
|
972
|
+
styles12.fab,
|
|
973
|
+
{ backgroundColor: getVariantColor(resolvedAction.variant || "primary") },
|
|
974
|
+
getPositionStyle(),
|
|
975
|
+
style
|
|
976
|
+
],
|
|
977
|
+
accessibilityLabel: resolvedAction.label || "Action"
|
|
978
|
+
},
|
|
979
|
+
/* @__PURE__ */ React13.createElement(Text2, { style: styles12.icon }, resolvedAction.icon || "+")
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
if (actions && actions.length > 0) {
|
|
983
|
+
return /* @__PURE__ */ React13.createElement(View11, { style: [styles12.container, getPositionStyle(), style] }, isExpanded && actions.length > 1 && /* @__PURE__ */ React13.createElement(View11, { style: styles12.actionsContainer }, actions.map((actionItem, index) => {
|
|
984
|
+
const translateY = animation.interpolate({
|
|
985
|
+
inputRange: [0, 1],
|
|
986
|
+
outputRange: [20 * (actions.length - index), 0]
|
|
987
|
+
});
|
|
988
|
+
const opacity = animation.interpolate({
|
|
989
|
+
inputRange: [0, 0.5, 1],
|
|
990
|
+
outputRange: [0, 0, 1]
|
|
991
|
+
});
|
|
992
|
+
return /* @__PURE__ */ React13.createElement(
|
|
993
|
+
Animated2.View,
|
|
994
|
+
{
|
|
995
|
+
key: actionItem.id,
|
|
996
|
+
style: [
|
|
997
|
+
styles12.actionRow,
|
|
998
|
+
{ opacity, transform: [{ translateY }] }
|
|
999
|
+
]
|
|
1000
|
+
},
|
|
1001
|
+
/* @__PURE__ */ React13.createElement(
|
|
1002
|
+
TouchableOpacity8,
|
|
1003
|
+
{
|
|
1004
|
+
onPress: () => {
|
|
1005
|
+
setIsExpanded(false);
|
|
1006
|
+
if (actionItem.event)
|
|
1007
|
+
eventBus.emit(`UI:${actionItem.event}`, {
|
|
1008
|
+
actionId: actionItem.id
|
|
1009
|
+
});
|
|
1010
|
+
actionItem.onPress?.();
|
|
1011
|
+
},
|
|
1012
|
+
style: [
|
|
1013
|
+
styles12.actionButton,
|
|
1014
|
+
{ backgroundColor: getVariantColor(actionItem.variant || "primary") }
|
|
1015
|
+
]
|
|
1016
|
+
},
|
|
1017
|
+
/* @__PURE__ */ React13.createElement(Text2, { style: styles12.icon }, actionItem.icon)
|
|
1018
|
+
),
|
|
1019
|
+
/* @__PURE__ */ React13.createElement(View11, { style: styles12.labelContainer }, /* @__PURE__ */ React13.createElement(Text2, { style: styles12.label }, actionItem.label))
|
|
1020
|
+
);
|
|
1021
|
+
})), /* @__PURE__ */ React13.createElement(
|
|
1022
|
+
TouchableOpacity8,
|
|
1023
|
+
{
|
|
1024
|
+
onPress: () => {
|
|
1025
|
+
if (actions.length === 1) {
|
|
1026
|
+
if (actions[0].event)
|
|
1027
|
+
eventBus.emit(`UI:${actions[0].event}`, {
|
|
1028
|
+
actionId: actions[0].id
|
|
1029
|
+
});
|
|
1030
|
+
actions[0].onPress?.();
|
|
1031
|
+
} else {
|
|
1032
|
+
toggleExpanded();
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
style: [
|
|
1036
|
+
styles12.fab,
|
|
1037
|
+
{
|
|
1038
|
+
backgroundColor: isExpanded ? theme.colors.secondary : theme.colors.primary
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
},
|
|
1042
|
+
/* @__PURE__ */ React13.createElement(
|
|
1043
|
+
Animated2.Text,
|
|
1044
|
+
{
|
|
1045
|
+
style: [
|
|
1046
|
+
styles12.icon,
|
|
1047
|
+
{
|
|
1048
|
+
transform: [
|
|
1049
|
+
{
|
|
1050
|
+
rotate: animation.interpolate({
|
|
1051
|
+
inputRange: [0, 1],
|
|
1052
|
+
outputRange: ["0deg", "45deg"]
|
|
1053
|
+
})
|
|
1054
|
+
}
|
|
1055
|
+
]
|
|
1056
|
+
}
|
|
1057
|
+
]
|
|
1058
|
+
},
|
|
1059
|
+
"+"
|
|
1060
|
+
)
|
|
1061
|
+
));
|
|
1062
|
+
}
|
|
1063
|
+
return null;
|
|
1064
|
+
};
|
|
1065
|
+
var styles12 = StyleSheet12.create({
|
|
1066
|
+
container: {
|
|
1067
|
+
position: "absolute",
|
|
1068
|
+
zIndex: 50,
|
|
1069
|
+
alignItems: "flex-end"
|
|
1070
|
+
},
|
|
1071
|
+
fab: {
|
|
1072
|
+
width: 56,
|
|
1073
|
+
height: 56,
|
|
1074
|
+
borderRadius: 28,
|
|
1075
|
+
justifyContent: "center",
|
|
1076
|
+
alignItems: "center",
|
|
1077
|
+
shadowColor: "#000",
|
|
1078
|
+
shadowOffset: { width: 0, height: 2 },
|
|
1079
|
+
shadowOpacity: 0.25,
|
|
1080
|
+
shadowRadius: 4,
|
|
1081
|
+
elevation: 5
|
|
1082
|
+
},
|
|
1083
|
+
icon: {
|
|
1084
|
+
fontSize: 24,
|
|
1085
|
+
color: "#fff",
|
|
1086
|
+
fontWeight: "300"
|
|
1087
|
+
},
|
|
1088
|
+
actionsContainer: {
|
|
1089
|
+
marginBottom: 12,
|
|
1090
|
+
gap: 8
|
|
1091
|
+
},
|
|
1092
|
+
actionRow: {
|
|
1093
|
+
flexDirection: "row",
|
|
1094
|
+
alignItems: "center",
|
|
1095
|
+
gap: 8
|
|
1096
|
+
},
|
|
1097
|
+
actionButton: {
|
|
1098
|
+
width: 40,
|
|
1099
|
+
height: 40,
|
|
1100
|
+
borderRadius: 20,
|
|
1101
|
+
justifyContent: "center",
|
|
1102
|
+
alignItems: "center"
|
|
1103
|
+
},
|
|
1104
|
+
labelContainer: {
|
|
1105
|
+
backgroundColor: "rgba(0,0,0,0.8)",
|
|
1106
|
+
paddingHorizontal: 8,
|
|
1107
|
+
paddingVertical: 4,
|
|
1108
|
+
borderRadius: 4
|
|
1109
|
+
},
|
|
1110
|
+
label: {
|
|
1111
|
+
color: "#fff",
|
|
1112
|
+
fontSize: 12
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
FloatingActionButton.displayName = "FloatingActionButton";
|
|
1116
|
+
|
|
1117
|
+
// src/components/molecules/Flex.tsx
|
|
1118
|
+
import React14 from "react";
|
|
1119
|
+
import { View as View12 } from "react-native";
|
|
1120
|
+
var gapValues = {
|
|
1121
|
+
none: 0,
|
|
1122
|
+
xs: 4,
|
|
1123
|
+
sm: 8,
|
|
1124
|
+
md: 16,
|
|
1125
|
+
lg: 24,
|
|
1126
|
+
xl: 32,
|
|
1127
|
+
"2xl": 48
|
|
1128
|
+
};
|
|
1129
|
+
var Flex = ({
|
|
1130
|
+
direction = "row",
|
|
1131
|
+
wrap = "nowrap",
|
|
1132
|
+
align = "stretch",
|
|
1133
|
+
justify = "flex-start",
|
|
1134
|
+
gap = "none",
|
|
1135
|
+
grow,
|
|
1136
|
+
shrink,
|
|
1137
|
+
basis,
|
|
1138
|
+
style,
|
|
1139
|
+
children
|
|
1140
|
+
}) => {
|
|
1141
|
+
const flexStyle = {
|
|
1142
|
+
flexDirection: direction,
|
|
1143
|
+
flexWrap: wrap,
|
|
1144
|
+
alignItems: align,
|
|
1145
|
+
justifyContent: justify,
|
|
1146
|
+
gap: gapValues[gap]
|
|
1147
|
+
};
|
|
1148
|
+
if (grow !== void 0) {
|
|
1149
|
+
flexStyle.flexGrow = grow === true ? 1 : grow === false ? 0 : grow;
|
|
1150
|
+
}
|
|
1151
|
+
if (shrink !== void 0) {
|
|
1152
|
+
flexStyle.flexShrink = shrink === true ? 1 : shrink === false ? 0 : shrink;
|
|
1153
|
+
}
|
|
1154
|
+
if (basis !== void 0) {
|
|
1155
|
+
flexStyle.flexBasis = typeof basis === "number" ? basis : void 0;
|
|
1156
|
+
}
|
|
1157
|
+
return /* @__PURE__ */ React14.createElement(View12, { style: [flexStyle, ...style ? [style] : []] }, children);
|
|
1158
|
+
};
|
|
1159
|
+
Flex.displayName = "Flex";
|
|
1160
|
+
|
|
1161
|
+
// src/components/molecules/SimpleGrid.tsx
|
|
1162
|
+
import React15 from "react";
|
|
1163
|
+
import { View as View13 } from "react-native";
|
|
1164
|
+
var gapValues2 = {
|
|
1165
|
+
none: 0,
|
|
1166
|
+
xs: 4,
|
|
1167
|
+
sm: 8,
|
|
1168
|
+
md: 16,
|
|
1169
|
+
lg: 24,
|
|
1170
|
+
xl: 32
|
|
1171
|
+
};
|
|
1172
|
+
var SimpleGrid = ({
|
|
1173
|
+
minChildWidth = 150,
|
|
1174
|
+
cols,
|
|
1175
|
+
gap = "md",
|
|
1176
|
+
style,
|
|
1177
|
+
children
|
|
1178
|
+
}) => {
|
|
1179
|
+
const childrenArray = React15.Children.toArray(children);
|
|
1180
|
+
const gapValue = gapValues2[gap];
|
|
1181
|
+
if (cols) {
|
|
1182
|
+
const rowStyle = {
|
|
1183
|
+
flexDirection: "row",
|
|
1184
|
+
flexWrap: "wrap",
|
|
1185
|
+
gap: gapValue
|
|
1186
|
+
};
|
|
1187
|
+
return /* @__PURE__ */ React15.createElement(View13, { style: [rowStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React15.createElement(View13, { key: index, style: { flex: 1 / cols, padding: gapValue / 2 } }, child)));
|
|
1188
|
+
}
|
|
1189
|
+
const containerStyle = {
|
|
1190
|
+
flexDirection: "row",
|
|
1191
|
+
flexWrap: "wrap",
|
|
1192
|
+
gap: gapValue
|
|
1193
|
+
};
|
|
1194
|
+
const itemStyle = {
|
|
1195
|
+
minWidth: minChildWidth,
|
|
1196
|
+
flex: 1
|
|
1197
|
+
};
|
|
1198
|
+
return /* @__PURE__ */ React15.createElement(View13, { style: [containerStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React15.createElement(View13, { key: index, style: itemStyle }, child)));
|
|
1199
|
+
};
|
|
1200
|
+
SimpleGrid.displayName = "SimpleGrid";
|
|
1201
|
+
|
|
1202
|
+
// src/components/molecules/Container.tsx
|
|
1203
|
+
import React16 from "react";
|
|
1204
|
+
import { View as View14 } from "react-native";
|
|
1205
|
+
var sizeValues = {
|
|
1206
|
+
xs: 320,
|
|
1207
|
+
sm: 640,
|
|
1208
|
+
md: 768,
|
|
1209
|
+
lg: 1024,
|
|
1210
|
+
xl: 1280,
|
|
1211
|
+
"2xl": 1536,
|
|
1212
|
+
full: 99999
|
|
1213
|
+
};
|
|
1214
|
+
var paddingValues = {
|
|
1215
|
+
none: 0,
|
|
1216
|
+
sm: 16,
|
|
1217
|
+
md: 24,
|
|
1218
|
+
lg: 32,
|
|
1219
|
+
xl: 48
|
|
1220
|
+
};
|
|
1221
|
+
var Container = ({
|
|
1222
|
+
size,
|
|
1223
|
+
maxWidth,
|
|
1224
|
+
padding = "md",
|
|
1225
|
+
center = true,
|
|
1226
|
+
style,
|
|
1227
|
+
children
|
|
1228
|
+
}) => {
|
|
1229
|
+
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
1230
|
+
const containerStyle = {
|
|
1231
|
+
width: "100%",
|
|
1232
|
+
maxWidth: sizeValues[resolvedSize],
|
|
1233
|
+
paddingHorizontal: paddingValues[padding],
|
|
1234
|
+
...center && { alignSelf: "center" }
|
|
1235
|
+
};
|
|
1236
|
+
return /* @__PURE__ */ React16.createElement(View14, { style: [containerStyle, ...style ? [style] : []] }, children);
|
|
1237
|
+
};
|
|
1238
|
+
Container.displayName = "Container";
|
|
1239
|
+
|
|
1240
|
+
// src/components/molecules/Grid.tsx
|
|
1241
|
+
import React17 from "react";
|
|
1242
|
+
import { View as View15, FlatList } from "react-native";
|
|
1243
|
+
var gapValues3 = {
|
|
1244
|
+
none: 0,
|
|
1245
|
+
xs: 4,
|
|
1246
|
+
sm: 8,
|
|
1247
|
+
md: 16,
|
|
1248
|
+
lg: 24,
|
|
1249
|
+
xl: 32
|
|
1250
|
+
};
|
|
1251
|
+
function Grid({
|
|
1252
|
+
columns,
|
|
1253
|
+
gap = "md",
|
|
1254
|
+
style,
|
|
1255
|
+
data,
|
|
1256
|
+
renderItem,
|
|
1257
|
+
keyExtractor,
|
|
1258
|
+
children
|
|
1259
|
+
}) {
|
|
1260
|
+
const gapValue = gapValues3[gap];
|
|
1261
|
+
if (data && renderItem) {
|
|
1262
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1263
|
+
FlatList,
|
|
1264
|
+
{
|
|
1265
|
+
data,
|
|
1266
|
+
renderItem,
|
|
1267
|
+
keyExtractor,
|
|
1268
|
+
numColumns: columns,
|
|
1269
|
+
columnWrapperStyle: { gap: gapValue },
|
|
1270
|
+
contentContainerStyle: [
|
|
1271
|
+
{ gap: gapValue },
|
|
1272
|
+
...style ? [style] : []
|
|
1273
|
+
]
|
|
1274
|
+
}
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1277
|
+
const containerStyle = {
|
|
1278
|
+
flexDirection: "row",
|
|
1279
|
+
flexWrap: "wrap",
|
|
1280
|
+
gap: gapValue
|
|
1281
|
+
};
|
|
1282
|
+
const childrenArray = React17.Children.toArray(children);
|
|
1283
|
+
return /* @__PURE__ */ React17.createElement(View15, { style: [containerStyle, ...style ? [style] : []] }, childrenArray.map((child, index) => /* @__PURE__ */ React17.createElement(
|
|
1284
|
+
View15,
|
|
1285
|
+
{
|
|
1286
|
+
key: index,
|
|
1287
|
+
style: {
|
|
1288
|
+
flex: 1 / columns,
|
|
1289
|
+
padding: gapValue / 2
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
child
|
|
1293
|
+
)));
|
|
1294
|
+
}
|
|
1295
|
+
Grid.displayName = "Grid";
|
|
1296
|
+
|
|
1297
|
+
// src/components/molecules/SidePanel.tsx
|
|
1298
|
+
import React18 from "react";
|
|
1299
|
+
import {
|
|
1300
|
+
View as View16,
|
|
1301
|
+
StyleSheet as StyleSheet13,
|
|
1302
|
+
TouchableOpacity as TouchableOpacity9,
|
|
1303
|
+
Animated as Animated3,
|
|
1304
|
+
Dimensions as Dimensions2
|
|
1305
|
+
} from "react-native";
|
|
1306
|
+
var { width: SCREEN_WIDTH } = Dimensions2.get("window");
|
|
1307
|
+
var SidePanel = ({
|
|
1308
|
+
title,
|
|
1309
|
+
children,
|
|
1310
|
+
isOpen,
|
|
1311
|
+
onClose,
|
|
1312
|
+
width = SCREEN_WIDTH * 0.8,
|
|
1313
|
+
position = "right",
|
|
1314
|
+
showOverlay = true,
|
|
1315
|
+
style,
|
|
1316
|
+
isLoading,
|
|
1317
|
+
error,
|
|
1318
|
+
closeEvent
|
|
1319
|
+
}) => {
|
|
1320
|
+
const theme = useTheme();
|
|
1321
|
+
const eventBus = useEventBus();
|
|
1322
|
+
const translateX = React18.useRef(
|
|
1323
|
+
new Animated3.Value(position === "right" ? SCREEN_WIDTH : -SCREEN_WIDTH)
|
|
1324
|
+
).current;
|
|
1325
|
+
React18.useEffect(() => {
|
|
1326
|
+
Animated3.timing(translateX, {
|
|
1327
|
+
toValue: isOpen ? 0 : position === "right" ? width : -width,
|
|
1328
|
+
duration: 300,
|
|
1329
|
+
useNativeDriver: true
|
|
1330
|
+
}).start();
|
|
1331
|
+
}, [isOpen, position, translateX, width]);
|
|
1332
|
+
const handleClose = () => {
|
|
1333
|
+
if (closeEvent) {
|
|
1334
|
+
eventBus.emit(`UI:${closeEvent}`, {});
|
|
1335
|
+
}
|
|
1336
|
+
onClose();
|
|
1337
|
+
};
|
|
1338
|
+
if (!isOpen) return null;
|
|
1339
|
+
return /* @__PURE__ */ React18.createElement(View16, { style: styles13.overlay }, showOverlay && /* @__PURE__ */ React18.createElement(
|
|
1340
|
+
TouchableOpacity9,
|
|
1341
|
+
{
|
|
1342
|
+
style: styles13.backdrop,
|
|
1343
|
+
activeOpacity: 1,
|
|
1344
|
+
onPress: handleClose
|
|
1345
|
+
}
|
|
1346
|
+
), /* @__PURE__ */ React18.createElement(
|
|
1347
|
+
Animated3.View,
|
|
1348
|
+
{
|
|
1349
|
+
style: [
|
|
1350
|
+
styles13.panel,
|
|
1351
|
+
{
|
|
1352
|
+
width,
|
|
1353
|
+
backgroundColor: theme.colors.card,
|
|
1354
|
+
[position]: 0,
|
|
1355
|
+
transform: [{ translateX }],
|
|
1356
|
+
borderLeftColor: theme.colors.border,
|
|
1357
|
+
borderRightColor: theme.colors.border
|
|
1358
|
+
},
|
|
1359
|
+
position === "right" ? styles13.borderLeft : styles13.borderRight,
|
|
1360
|
+
style
|
|
1361
|
+
]
|
|
1362
|
+
},
|
|
1363
|
+
/* @__PURE__ */ React18.createElement(
|
|
1364
|
+
View16,
|
|
1365
|
+
{
|
|
1366
|
+
style: [
|
|
1367
|
+
styles13.header,
|
|
1368
|
+
{
|
|
1369
|
+
borderBottomColor: theme.colors.border,
|
|
1370
|
+
backgroundColor: theme.colors.card
|
|
1371
|
+
}
|
|
1372
|
+
]
|
|
1373
|
+
},
|
|
1374
|
+
/* @__PURE__ */ React18.createElement(Typography, { variant: "h4" }, title),
|
|
1375
|
+
/* @__PURE__ */ React18.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClose }, "\u2715")
|
|
1376
|
+
),
|
|
1377
|
+
/* @__PURE__ */ React18.createElement(VStack, { spacing: 0, style: styles13.content }, isLoading ? /* @__PURE__ */ React18.createElement(LoadingState, null) : error ? /* @__PURE__ */ React18.createElement(ErrorState, { message: error.message, onRetry: handleClose }) : children)
|
|
1378
|
+
));
|
|
1379
|
+
};
|
|
1380
|
+
var styles13 = StyleSheet13.create({
|
|
1381
|
+
overlay: {
|
|
1382
|
+
...StyleSheet13.absoluteFillObject,
|
|
1383
|
+
zIndex: 1e3,
|
|
1384
|
+
flexDirection: "row"
|
|
1385
|
+
},
|
|
1386
|
+
backdrop: {
|
|
1387
|
+
...StyleSheet13.absoluteFillObject,
|
|
1388
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
1389
|
+
},
|
|
1390
|
+
panel: {
|
|
1391
|
+
position: "absolute",
|
|
1392
|
+
top: 0,
|
|
1393
|
+
bottom: 0,
|
|
1394
|
+
shadowColor: "#000",
|
|
1395
|
+
shadowOffset: { width: -2, height: 0 },
|
|
1396
|
+
shadowOpacity: 0.25,
|
|
1397
|
+
shadowRadius: 5,
|
|
1398
|
+
elevation: 5,
|
|
1399
|
+
zIndex: 1001
|
|
1400
|
+
},
|
|
1401
|
+
borderLeft: {
|
|
1402
|
+
borderLeftWidth: 1
|
|
1403
|
+
},
|
|
1404
|
+
borderRight: {
|
|
1405
|
+
borderRightWidth: 1
|
|
1406
|
+
},
|
|
1407
|
+
header: {
|
|
1408
|
+
flexDirection: "row",
|
|
1409
|
+
alignItems: "center",
|
|
1410
|
+
justifyContent: "space-between",
|
|
1411
|
+
padding: 16,
|
|
1412
|
+
borderBottomWidth: 1
|
|
1413
|
+
},
|
|
1414
|
+
content: {
|
|
1415
|
+
flex: 1,
|
|
1416
|
+
padding: 16
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
SidePanel.displayName = "SidePanel";
|
|
1420
|
+
|
|
1421
|
+
// src/components/molecules/Navigation.tsx
|
|
1422
|
+
import React19 from "react";
|
|
1423
|
+
import {
|
|
1424
|
+
View as View17,
|
|
1425
|
+
StyleSheet as StyleSheet14,
|
|
1426
|
+
TouchableOpacity as TouchableOpacity10,
|
|
1427
|
+
ScrollView as ScrollView3
|
|
1428
|
+
} from "react-native";
|
|
1429
|
+
var Navigation = ({
|
|
1430
|
+
items,
|
|
1431
|
+
orientation = "horizontal",
|
|
1432
|
+
style,
|
|
1433
|
+
variant = "default",
|
|
1434
|
+
isLoading,
|
|
1435
|
+
error,
|
|
1436
|
+
changeEvent
|
|
1437
|
+
}) => {
|
|
1438
|
+
const theme = useTheme();
|
|
1439
|
+
const eventBus = useEventBus();
|
|
1440
|
+
const handlePress = (item) => {
|
|
1441
|
+
if (item.disabled) return;
|
|
1442
|
+
if (item.event) {
|
|
1443
|
+
eventBus.emit(`UI:${item.event}`, { itemId: item.id, navigatesTo: item.navigatesTo });
|
|
1444
|
+
}
|
|
1445
|
+
if (changeEvent) {
|
|
1446
|
+
eventBus.emit(`UI:${changeEvent}`, { itemId: item.id, navigatesTo: item.navigatesTo });
|
|
1447
|
+
}
|
|
1448
|
+
item.onPress?.();
|
|
1449
|
+
};
|
|
1450
|
+
const getItemStyle = (isActive) => {
|
|
1451
|
+
switch (variant) {
|
|
1452
|
+
case "pills":
|
|
1453
|
+
return {
|
|
1454
|
+
backgroundColor: isActive ? theme.colors.primary : "transparent",
|
|
1455
|
+
borderRadius: theme.borderRadius.full
|
|
1456
|
+
};
|
|
1457
|
+
case "underlined":
|
|
1458
|
+
return {
|
|
1459
|
+
borderBottomWidth: 2,
|
|
1460
|
+
borderBottomColor: isActive ? theme.colors.primary : "transparent",
|
|
1461
|
+
backgroundColor: "transparent",
|
|
1462
|
+
borderRadius: 0
|
|
1463
|
+
};
|
|
1464
|
+
default:
|
|
1465
|
+
return {
|
|
1466
|
+
backgroundColor: isActive ? theme.colors.card : "transparent",
|
|
1467
|
+
borderRadius: theme.borderRadius.md
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
const getTextColor = (isActive) => {
|
|
1472
|
+
if (variant === "pills" && isActive) {
|
|
1473
|
+
return theme.colors["primary-foreground"];
|
|
1474
|
+
}
|
|
1475
|
+
return isActive ? theme.colors.primary : theme.colors.foreground;
|
|
1476
|
+
};
|
|
1477
|
+
if (isLoading) {
|
|
1478
|
+
return /* @__PURE__ */ React19.createElement(View17, { style: [styles14.container, style] }, /* @__PURE__ */ React19.createElement(LoadingState, { message: "Loading navigation..." }));
|
|
1479
|
+
}
|
|
1480
|
+
if (error) {
|
|
1481
|
+
return /* @__PURE__ */ React19.createElement(View17, { style: [styles14.container, style] }, /* @__PURE__ */ React19.createElement(ErrorState, { message: error.message }));
|
|
1482
|
+
}
|
|
1483
|
+
const renderItem = (item) => {
|
|
1484
|
+
const isActive = item.isActive ?? false;
|
|
1485
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1486
|
+
TouchableOpacity10,
|
|
1487
|
+
{
|
|
1488
|
+
key: item.id,
|
|
1489
|
+
onPress: () => handlePress(item),
|
|
1490
|
+
disabled: item.disabled,
|
|
1491
|
+
style: [
|
|
1492
|
+
styles14.item,
|
|
1493
|
+
getItemStyle(isActive),
|
|
1494
|
+
item.disabled && { opacity: 0.5 }
|
|
1495
|
+
],
|
|
1496
|
+
activeOpacity: 0.7
|
|
1497
|
+
},
|
|
1498
|
+
/* @__PURE__ */ React19.createElement(HStack, { spacing: 8, align: "center" }, item.icon && /* @__PURE__ */ React19.createElement(Typography, { variant: "body", style: { color: getTextColor(isActive) } }, item.icon), /* @__PURE__ */ React19.createElement(Typography, { variant: "body", style: { color: getTextColor(isActive) } }, item.label), item.badge !== void 0 && item.badge > 0 && /* @__PURE__ */ React19.createElement(Badge, { variant: "error", size: "sm" }, item.badge > 99 ? "99+" : item.badge))
|
|
1499
|
+
);
|
|
1500
|
+
};
|
|
1501
|
+
if (orientation === "horizontal") {
|
|
1502
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1503
|
+
ScrollView3,
|
|
1504
|
+
{
|
|
1505
|
+
horizontal: true,
|
|
1506
|
+
showsHorizontalScrollIndicator: false,
|
|
1507
|
+
contentContainerStyle: [styles14.horizontalContainer, style]
|
|
1508
|
+
},
|
|
1509
|
+
items.map(renderItem)
|
|
1510
|
+
);
|
|
1511
|
+
}
|
|
1512
|
+
return /* @__PURE__ */ React19.createElement(VStack, { spacing: 4, style: [styles14.verticalContainer, ...style ? [style] : []] }, items.map(renderItem));
|
|
1513
|
+
};
|
|
1514
|
+
var styles14 = StyleSheet14.create({
|
|
1515
|
+
container: {
|
|
1516
|
+
width: "100%"
|
|
1517
|
+
},
|
|
1518
|
+
horizontalContainer: {
|
|
1519
|
+
flexDirection: "row",
|
|
1520
|
+
paddingVertical: 8,
|
|
1521
|
+
paddingHorizontal: 4
|
|
1522
|
+
},
|
|
1523
|
+
verticalContainer: {
|
|
1524
|
+
width: "100%",
|
|
1525
|
+
padding: 8
|
|
1526
|
+
},
|
|
1527
|
+
item: {
|
|
1528
|
+
paddingVertical: 10,
|
|
1529
|
+
paddingHorizontal: 16,
|
|
1530
|
+
marginHorizontal: 4
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
Navigation.displayName = "Navigation";
|
|
1534
|
+
|
|
1535
|
+
// src/components/molecules/RelationSelect.tsx
|
|
1536
|
+
import React20, { useState as useState4, useMemo } from "react";
|
|
1537
|
+
import {
|
|
1538
|
+
View as View18,
|
|
1539
|
+
TouchableOpacity as TouchableOpacity11,
|
|
1540
|
+
Text as Text3,
|
|
1541
|
+
StyleSheet as StyleSheet15,
|
|
1542
|
+
Modal as Modal4,
|
|
1543
|
+
FlatList as FlatList2,
|
|
1544
|
+
SafeAreaView
|
|
1545
|
+
} from "react-native";
|
|
1546
|
+
var RelationSelect = ({
|
|
1547
|
+
options,
|
|
1548
|
+
value,
|
|
1549
|
+
onChange,
|
|
1550
|
+
placeholder = "Select...",
|
|
1551
|
+
disabled = false,
|
|
1552
|
+
style,
|
|
1553
|
+
textStyle,
|
|
1554
|
+
isLoading,
|
|
1555
|
+
error,
|
|
1556
|
+
entity,
|
|
1557
|
+
multiple = false,
|
|
1558
|
+
searchable = true,
|
|
1559
|
+
maxSelections,
|
|
1560
|
+
changeEvent,
|
|
1561
|
+
searchEvent,
|
|
1562
|
+
actionPayload
|
|
1563
|
+
}) => {
|
|
1564
|
+
const theme = useTheme();
|
|
1565
|
+
const eventBus = useEventBus();
|
|
1566
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1567
|
+
const [searchQuery, setSearchQuery] = useState4("");
|
|
1568
|
+
const selectedValues = useMemo(() => {
|
|
1569
|
+
if (multiple) {
|
|
1570
|
+
return Array.isArray(value) ? value : value ? [value] : [];
|
|
1571
|
+
}
|
|
1572
|
+
return value ? [value] : [];
|
|
1573
|
+
}, [value, multiple]);
|
|
1574
|
+
const selectedOptions = useMemo(() => {
|
|
1575
|
+
return options.filter((opt) => selectedValues.includes(opt.id));
|
|
1576
|
+
}, [options, selectedValues]);
|
|
1577
|
+
const filteredOptions = useMemo(() => {
|
|
1578
|
+
if (!searchQuery.trim()) return options;
|
|
1579
|
+
const query = searchQuery.toLowerCase();
|
|
1580
|
+
return options.filter(
|
|
1581
|
+
(opt) => opt.label.toLowerCase().includes(query) || opt.subtitle?.toLowerCase().includes(query)
|
|
1582
|
+
);
|
|
1583
|
+
}, [options, searchQuery]);
|
|
1584
|
+
const handleSearchChange = (query) => {
|
|
1585
|
+
setSearchQuery(query);
|
|
1586
|
+
if (searchEvent) {
|
|
1587
|
+
eventBus.emit(`UI:${searchEvent}`, { ...actionPayload, query, entity });
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
const handleSelect = (selectedId) => {
|
|
1591
|
+
if (multiple) {
|
|
1592
|
+
const currentValues = selectedValues;
|
|
1593
|
+
let newValues;
|
|
1594
|
+
if (currentValues.includes(selectedId)) {
|
|
1595
|
+
newValues = currentValues.filter((id) => id !== selectedId);
|
|
1596
|
+
} else {
|
|
1597
|
+
if (maxSelections && currentValues.length >= maxSelections) {
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
newValues = [...currentValues, selectedId];
|
|
1601
|
+
}
|
|
1602
|
+
if (changeEvent) {
|
|
1603
|
+
eventBus.emit(`UI:${changeEvent}`, {
|
|
1604
|
+
...actionPayload,
|
|
1605
|
+
value: newValues,
|
|
1606
|
+
entity
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
onChange?.(newValues);
|
|
1610
|
+
} else {
|
|
1611
|
+
if (changeEvent) {
|
|
1612
|
+
eventBus.emit(`UI:${changeEvent}`, {
|
|
1613
|
+
...actionPayload,
|
|
1614
|
+
value: selectedId,
|
|
1615
|
+
entity
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
onChange?.(selectedId);
|
|
1619
|
+
setIsOpen(false);
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
const handleClear = () => {
|
|
1623
|
+
if (multiple) {
|
|
1624
|
+
if (changeEvent) {
|
|
1625
|
+
eventBus.emit(`UI:${changeEvent}`, { ...actionPayload, value: [], entity });
|
|
1626
|
+
}
|
|
1627
|
+
onChange?.([]);
|
|
1628
|
+
} else {
|
|
1629
|
+
if (changeEvent) {
|
|
1630
|
+
eventBus.emit(`UI:${changeEvent}`, { ...actionPayload, value: void 0, entity });
|
|
1631
|
+
}
|
|
1632
|
+
onChange?.("");
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
const handleOpen = () => {
|
|
1636
|
+
if (!disabled && !isLoading) {
|
|
1637
|
+
setSearchQuery("");
|
|
1638
|
+
setIsOpen(true);
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
const handleClose = () => {
|
|
1642
|
+
setIsOpen(false);
|
|
1643
|
+
setSearchQuery("");
|
|
1644
|
+
};
|
|
1645
|
+
const renderOption = ({ item }) => {
|
|
1646
|
+
const isSelected = selectedValues.includes(item.id);
|
|
1647
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1648
|
+
TouchableOpacity11,
|
|
1649
|
+
{
|
|
1650
|
+
style: [
|
|
1651
|
+
styles15.option,
|
|
1652
|
+
{
|
|
1653
|
+
backgroundColor: isSelected ? theme.colors.primary : theme.colors.card,
|
|
1654
|
+
borderBottomColor: theme.colors.border
|
|
1655
|
+
}
|
|
1656
|
+
],
|
|
1657
|
+
onPress: () => handleSelect(item.id)
|
|
1658
|
+
},
|
|
1659
|
+
/* @__PURE__ */ React20.createElement(HStack, { spacing: 12, align: "center" }, item.avatarUri ? /* @__PURE__ */ React20.createElement(
|
|
1660
|
+
View18,
|
|
1661
|
+
{
|
|
1662
|
+
style: [
|
|
1663
|
+
styles15.avatar,
|
|
1664
|
+
{
|
|
1665
|
+
backgroundColor: isSelected ? theme.colors["primary-foreground"] : theme.colors.muted
|
|
1666
|
+
}
|
|
1667
|
+
]
|
|
1668
|
+
},
|
|
1669
|
+
/* @__PURE__ */ React20.createElement(Text3, { style: { fontSize: 20 } }, "\u{1F464}")
|
|
1670
|
+
) : /* @__PURE__ */ React20.createElement(
|
|
1671
|
+
View18,
|
|
1672
|
+
{
|
|
1673
|
+
style: [
|
|
1674
|
+
styles15.avatarPlaceholder,
|
|
1675
|
+
{
|
|
1676
|
+
backgroundColor: isSelected ? theme.colors["primary-foreground"] : theme.colors.muted
|
|
1677
|
+
}
|
|
1678
|
+
]
|
|
1679
|
+
},
|
|
1680
|
+
/* @__PURE__ */ React20.createElement(Text3, { style: { fontSize: 16 } }, item.label.charAt(0).toUpperCase())
|
|
1681
|
+
), /* @__PURE__ */ React20.createElement(VStack, { spacing: 2, style: styles15.optionContent }, /* @__PURE__ */ React20.createElement(
|
|
1682
|
+
Text3,
|
|
1683
|
+
{
|
|
1684
|
+
style: [
|
|
1685
|
+
styles15.optionLabel,
|
|
1686
|
+
{
|
|
1687
|
+
color: isSelected ? theme.colors["primary-foreground"] : theme.colors.foreground
|
|
1688
|
+
},
|
|
1689
|
+
textStyle
|
|
1690
|
+
],
|
|
1691
|
+
numberOfLines: 1
|
|
1692
|
+
},
|
|
1693
|
+
item.label
|
|
1694
|
+
), item.subtitle && /* @__PURE__ */ React20.createElement(
|
|
1695
|
+
Text3,
|
|
1696
|
+
{
|
|
1697
|
+
style: [
|
|
1698
|
+
styles15.optionSubtitle,
|
|
1699
|
+
{
|
|
1700
|
+
color: isSelected ? `${theme.colors["primary-foreground"]}99` : theme.colors["muted-foreground"]
|
|
1701
|
+
}
|
|
1702
|
+
],
|
|
1703
|
+
numberOfLines: 1
|
|
1704
|
+
},
|
|
1705
|
+
item.subtitle
|
|
1706
|
+
)), isSelected && /* @__PURE__ */ React20.createElement(
|
|
1707
|
+
Typography,
|
|
1708
|
+
{
|
|
1709
|
+
variant: "body",
|
|
1710
|
+
style: { color: theme.colors["primary-foreground"] }
|
|
1711
|
+
},
|
|
1712
|
+
"\u2713"
|
|
1713
|
+
)),
|
|
1714
|
+
item.metadata && /* @__PURE__ */ React20.createElement(HStack, { spacing: 8, style: styles15.metadata }, Object.entries(item.metadata).map(([key, val]) => /* @__PURE__ */ React20.createElement(
|
|
1715
|
+
Badge,
|
|
1716
|
+
{
|
|
1717
|
+
key,
|
|
1718
|
+
variant: isSelected ? "secondary" : "default",
|
|
1719
|
+
size: "sm"
|
|
1720
|
+
},
|
|
1721
|
+
val
|
|
1722
|
+
)))
|
|
1723
|
+
);
|
|
1724
|
+
};
|
|
1725
|
+
if (isLoading) {
|
|
1726
|
+
return /* @__PURE__ */ React20.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React20.createElement(LoadingState, { message: "Loading options..." }));
|
|
1727
|
+
}
|
|
1728
|
+
if (error) {
|
|
1729
|
+
return /* @__PURE__ */ React20.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React20.createElement(ErrorState, { message: error.message }));
|
|
1730
|
+
}
|
|
1731
|
+
return /* @__PURE__ */ React20.createElement(View18, { style: [styles15.container, style] }, /* @__PURE__ */ React20.createElement(
|
|
1732
|
+
TouchableOpacity11,
|
|
1733
|
+
{
|
|
1734
|
+
onPress: handleOpen,
|
|
1735
|
+
disabled,
|
|
1736
|
+
activeOpacity: 0.8,
|
|
1737
|
+
style: [
|
|
1738
|
+
styles15.button,
|
|
1739
|
+
{
|
|
1740
|
+
borderColor: theme.colors.border,
|
|
1741
|
+
backgroundColor: theme.colors.card,
|
|
1742
|
+
opacity: disabled ? 0.5 : 1
|
|
1743
|
+
}
|
|
1744
|
+
]
|
|
1745
|
+
},
|
|
1746
|
+
/* @__PURE__ */ React20.createElement(View18, { style: styles15.buttonContent }, selectedOptions.length === 0 ? /* @__PURE__ */ React20.createElement(
|
|
1747
|
+
Text3,
|
|
1748
|
+
{
|
|
1749
|
+
style: [
|
|
1750
|
+
styles15.buttonText,
|
|
1751
|
+
{
|
|
1752
|
+
color: theme.colors["muted-foreground"]
|
|
1753
|
+
},
|
|
1754
|
+
textStyle
|
|
1755
|
+
],
|
|
1756
|
+
numberOfLines: 1
|
|
1757
|
+
},
|
|
1758
|
+
placeholder
|
|
1759
|
+
) : /* @__PURE__ */ React20.createElement(HStack, { spacing: 8, style: styles15.selectedContainer }, selectedOptions.map((opt) => /* @__PURE__ */ React20.createElement(
|
|
1760
|
+
View18,
|
|
1761
|
+
{
|
|
1762
|
+
key: opt.id,
|
|
1763
|
+
style: [
|
|
1764
|
+
styles15.selectedChip,
|
|
1765
|
+
{ backgroundColor: theme.colors.primary }
|
|
1766
|
+
]
|
|
1767
|
+
},
|
|
1768
|
+
/* @__PURE__ */ React20.createElement(
|
|
1769
|
+
Text3,
|
|
1770
|
+
{
|
|
1771
|
+
style: [
|
|
1772
|
+
styles15.selectedChipText,
|
|
1773
|
+
{ color: theme.colors["primary-foreground"] }
|
|
1774
|
+
],
|
|
1775
|
+
numberOfLines: 1
|
|
1776
|
+
},
|
|
1777
|
+
opt.label
|
|
1778
|
+
)
|
|
1779
|
+
)), multiple && maxSelections && /* @__PURE__ */ React20.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, selectedOptions.length, "/", maxSelections))),
|
|
1780
|
+
selectedOptions.length > 0 && !disabled && /* @__PURE__ */ React20.createElement(
|
|
1781
|
+
TouchableOpacity11,
|
|
1782
|
+
{
|
|
1783
|
+
onPress: handleClear,
|
|
1784
|
+
style: styles15.clearButton,
|
|
1785
|
+
hitSlop: { top: 10, bottom: 10, left: 10, right: 10 }
|
|
1786
|
+
},
|
|
1787
|
+
/* @__PURE__ */ React20.createElement(
|
|
1788
|
+
Typography,
|
|
1789
|
+
{
|
|
1790
|
+
variant: "body",
|
|
1791
|
+
style: { color: theme.colors["muted-foreground"] }
|
|
1792
|
+
},
|
|
1793
|
+
"\u2715"
|
|
1794
|
+
)
|
|
1795
|
+
),
|
|
1796
|
+
/* @__PURE__ */ React20.createElement(Text3, { style: [styles15.chevron, { color: theme.colors["muted-foreground"] }] }, "\u25BC")
|
|
1797
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1798
|
+
Modal4,
|
|
1799
|
+
{
|
|
1800
|
+
visible: isOpen,
|
|
1801
|
+
transparent: true,
|
|
1802
|
+
animationType: "slide",
|
|
1803
|
+
onRequestClose: handleClose
|
|
1804
|
+
},
|
|
1805
|
+
/* @__PURE__ */ React20.createElement(
|
|
1806
|
+
SafeAreaView,
|
|
1807
|
+
{
|
|
1808
|
+
style: [styles15.modalContainer, { backgroundColor: theme.colors.background }]
|
|
1809
|
+
},
|
|
1810
|
+
/* @__PURE__ */ React20.createElement(View18, { style: [styles15.modalHeader, { borderBottomColor: theme.colors.border }] }, /* @__PURE__ */ React20.createElement(Button, { variant: "ghost", onPress: handleClose }, "Cancel"), /* @__PURE__ */ React20.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, multiple ? "Select Items" : "Select Item"), /* @__PURE__ */ React20.createElement(Button, { variant: "primary", onPress: handleClose }, "Done")),
|
|
1811
|
+
searchable && /* @__PURE__ */ React20.createElement(View18, { style: styles15.searchContainer }, /* @__PURE__ */ React20.createElement(
|
|
1812
|
+
Input,
|
|
1813
|
+
{
|
|
1814
|
+
value: searchQuery,
|
|
1815
|
+
onChangeText: handleSearchChange,
|
|
1816
|
+
placeholder: "Search...",
|
|
1817
|
+
changeEvent: searchEvent
|
|
1818
|
+
}
|
|
1819
|
+
)),
|
|
1820
|
+
filteredOptions.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "No matching options" }) : /* @__PURE__ */ React20.createElement(
|
|
1821
|
+
FlatList2,
|
|
1822
|
+
{
|
|
1823
|
+
data: filteredOptions,
|
|
1824
|
+
keyExtractor: (item) => item.id,
|
|
1825
|
+
renderItem: renderOption,
|
|
1826
|
+
contentContainerStyle: styles15.listContent
|
|
1827
|
+
}
|
|
1828
|
+
)
|
|
1829
|
+
)
|
|
1830
|
+
));
|
|
1831
|
+
};
|
|
1832
|
+
var styles15 = StyleSheet15.create({
|
|
1833
|
+
container: {
|
|
1834
|
+
width: "100%"
|
|
1835
|
+
},
|
|
1836
|
+
button: {
|
|
1837
|
+
flexDirection: "row",
|
|
1838
|
+
alignItems: "center",
|
|
1839
|
+
borderWidth: 1,
|
|
1840
|
+
borderRadius: 8,
|
|
1841
|
+
paddingHorizontal: 12,
|
|
1842
|
+
paddingVertical: 10,
|
|
1843
|
+
minHeight: 48
|
|
1844
|
+
},
|
|
1845
|
+
buttonContent: {
|
|
1846
|
+
flex: 1
|
|
1847
|
+
},
|
|
1848
|
+
buttonText: {
|
|
1849
|
+
fontSize: 16
|
|
1850
|
+
},
|
|
1851
|
+
selectedContainer: {
|
|
1852
|
+
flexWrap: "wrap",
|
|
1853
|
+
flex: 1
|
|
1854
|
+
},
|
|
1855
|
+
selectedChip: {
|
|
1856
|
+
paddingHorizontal: 10,
|
|
1857
|
+
paddingVertical: 4,
|
|
1858
|
+
borderRadius: 16
|
|
1859
|
+
},
|
|
1860
|
+
selectedChipText: {
|
|
1861
|
+
fontSize: 14,
|
|
1862
|
+
fontWeight: "500"
|
|
1863
|
+
},
|
|
1864
|
+
clearButton: {
|
|
1865
|
+
padding: 4,
|
|
1866
|
+
marginRight: 8
|
|
1867
|
+
},
|
|
1868
|
+
chevron: {
|
|
1869
|
+
fontSize: 12
|
|
1870
|
+
},
|
|
1871
|
+
modalContainer: {
|
|
1872
|
+
flex: 1
|
|
1873
|
+
},
|
|
1874
|
+
modalHeader: {
|
|
1875
|
+
flexDirection: "row",
|
|
1876
|
+
justifyContent: "space-between",
|
|
1877
|
+
alignItems: "center",
|
|
1878
|
+
paddingHorizontal: 16,
|
|
1879
|
+
paddingVertical: 12,
|
|
1880
|
+
borderBottomWidth: 1
|
|
1881
|
+
},
|
|
1882
|
+
searchContainer: {
|
|
1883
|
+
padding: 16
|
|
1884
|
+
},
|
|
1885
|
+
listContent: {
|
|
1886
|
+
paddingBottom: 20
|
|
1887
|
+
},
|
|
1888
|
+
option: {
|
|
1889
|
+
padding: 16,
|
|
1890
|
+
borderBottomWidth: 1
|
|
1891
|
+
},
|
|
1892
|
+
optionContent: {
|
|
1893
|
+
flex: 1
|
|
1894
|
+
},
|
|
1895
|
+
optionLabel: {
|
|
1896
|
+
fontSize: 16,
|
|
1897
|
+
fontWeight: "500"
|
|
1898
|
+
},
|
|
1899
|
+
optionSubtitle: {
|
|
1900
|
+
fontSize: 14
|
|
1901
|
+
},
|
|
1902
|
+
avatar: {
|
|
1903
|
+
width: 40,
|
|
1904
|
+
height: 40,
|
|
1905
|
+
borderRadius: 20,
|
|
1906
|
+
justifyContent: "center",
|
|
1907
|
+
alignItems: "center"
|
|
1908
|
+
},
|
|
1909
|
+
avatarPlaceholder: {
|
|
1910
|
+
width: 40,
|
|
1911
|
+
height: 40,
|
|
1912
|
+
borderRadius: 20,
|
|
1913
|
+
justifyContent: "center",
|
|
1914
|
+
alignItems: "center"
|
|
1915
|
+
},
|
|
1916
|
+
metadata: {
|
|
1917
|
+
marginTop: 8,
|
|
1918
|
+
marginLeft: 52
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
RelationSelect.displayName = "RelationSelect";
|
|
1922
|
+
|
|
1923
|
+
// src/components/molecules/FilterGroup.tsx
|
|
1924
|
+
import React21, { useState as useState5, useCallback } from "react";
|
|
1925
|
+
import { View as View19, StyleSheet as StyleSheet16, TouchableOpacity as TouchableOpacity12 } from "react-native";
|
|
1926
|
+
var FilterGroup = ({
|
|
1927
|
+
entity,
|
|
1928
|
+
filters,
|
|
1929
|
+
onFilterChange,
|
|
1930
|
+
onClearAll,
|
|
1931
|
+
style,
|
|
1932
|
+
variant = "default",
|
|
1933
|
+
showIcon = true,
|
|
1934
|
+
query,
|
|
1935
|
+
isLoading: _isLoading
|
|
1936
|
+
}) => {
|
|
1937
|
+
const theme = useTheme();
|
|
1938
|
+
const eventBus = useEventBus();
|
|
1939
|
+
const [selectedValues, setSelectedValues] = useState5(
|
|
1940
|
+
{}
|
|
1941
|
+
);
|
|
1942
|
+
const handleFilterSelect = useCallback(
|
|
1943
|
+
(field, value) => {
|
|
1944
|
+
setSelectedValues((prev) => {
|
|
1945
|
+
if (value === null || value === "" || value === "all") {
|
|
1946
|
+
const next = { ...prev };
|
|
1947
|
+
delete next[field];
|
|
1948
|
+
return next;
|
|
1949
|
+
}
|
|
1950
|
+
return { ...prev, [field]: value };
|
|
1951
|
+
});
|
|
1952
|
+
onFilterChange?.(field, value === "all" ? null : value);
|
|
1953
|
+
eventBus.emit("UI:FILTER", {
|
|
1954
|
+
entity,
|
|
1955
|
+
field,
|
|
1956
|
+
value: value === "all" ? null : value,
|
|
1957
|
+
query
|
|
1958
|
+
});
|
|
1959
|
+
},
|
|
1960
|
+
[onFilterChange, eventBus, entity, query]
|
|
1961
|
+
);
|
|
1962
|
+
const handleClearAll = useCallback(() => {
|
|
1963
|
+
setSelectedValues({});
|
|
1964
|
+
onClearAll?.();
|
|
1965
|
+
eventBus.emit("UI:CLEAR_FILTERS", { entity, query });
|
|
1966
|
+
}, [onClearAll, eventBus, entity, query]);
|
|
1967
|
+
const activeFilterCount = Object.keys(selectedValues).length;
|
|
1968
|
+
const buildSelectOptions = (filter) => {
|
|
1969
|
+
return [
|
|
1970
|
+
{ value: "all", label: "All" },
|
|
1971
|
+
...filter.options?.map((opt) => ({
|
|
1972
|
+
value: opt,
|
|
1973
|
+
label: opt
|
|
1974
|
+
})) || []
|
|
1975
|
+
];
|
|
1976
|
+
};
|
|
1977
|
+
if (variant === "pills") {
|
|
1978
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1979
|
+
HStack,
|
|
1980
|
+
{
|
|
1981
|
+
spacing: 16,
|
|
1982
|
+
align: "center",
|
|
1983
|
+
style: [styles16.pillsContainer, style ?? {}]
|
|
1984
|
+
},
|
|
1985
|
+
showIcon && /* @__PURE__ */ React21.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"),
|
|
1986
|
+
filters.map((filter) => /* @__PURE__ */ React21.createElement(HStack, { key: filter.field, spacing: 8, align: "center" }, /* @__PURE__ */ React21.createElement(
|
|
1987
|
+
Typography,
|
|
1988
|
+
{
|
|
1989
|
+
variant: "caption",
|
|
1990
|
+
color: theme.colors["muted-foreground"]
|
|
1991
|
+
},
|
|
1992
|
+
filter.label,
|
|
1993
|
+
":"
|
|
1994
|
+
), /* @__PURE__ */ React21.createElement(HStack, { spacing: 0, style: styles16.pillGroup }, /* @__PURE__ */ React21.createElement(
|
|
1995
|
+
TouchableOpacity12,
|
|
1996
|
+
{
|
|
1997
|
+
onPress: () => handleFilterSelect(filter.field, null),
|
|
1998
|
+
style: [
|
|
1999
|
+
styles16.pill,
|
|
2000
|
+
{
|
|
2001
|
+
backgroundColor: !selectedValues[filter.field] ? theme.colors.primary : theme.colors.card,
|
|
2002
|
+
borderColor: theme.colors.border
|
|
2003
|
+
}
|
|
2004
|
+
]
|
|
2005
|
+
},
|
|
2006
|
+
/* @__PURE__ */ React21.createElement(
|
|
2007
|
+
Typography,
|
|
2008
|
+
{
|
|
2009
|
+
variant: "caption",
|
|
2010
|
+
style: {
|
|
2011
|
+
color: !selectedValues[filter.field] ? theme.colors["primary-foreground"] : theme.colors["muted-foreground"]
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
"All"
|
|
2015
|
+
)
|
|
2016
|
+
), filter.options?.map((option) => /* @__PURE__ */ React21.createElement(
|
|
2017
|
+
TouchableOpacity12,
|
|
2018
|
+
{
|
|
2019
|
+
key: option,
|
|
2020
|
+
onPress: () => handleFilterSelect(filter.field, option),
|
|
2021
|
+
style: [
|
|
2022
|
+
styles16.pill,
|
|
2023
|
+
styles16.pillWithBorder,
|
|
2024
|
+
{
|
|
2025
|
+
backgroundColor: selectedValues[filter.field] === option ? theme.colors.primary : theme.colors.card,
|
|
2026
|
+
borderColor: theme.colors.border
|
|
2027
|
+
}
|
|
2028
|
+
]
|
|
2029
|
+
},
|
|
2030
|
+
/* @__PURE__ */ React21.createElement(
|
|
2031
|
+
Typography,
|
|
2032
|
+
{
|
|
2033
|
+
variant: "caption",
|
|
2034
|
+
style: {
|
|
2035
|
+
color: selectedValues[filter.field] === option ? theme.colors["primary-foreground"] : theme.colors["muted-foreground"]
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
option
|
|
2039
|
+
)
|
|
2040
|
+
))))),
|
|
2041
|
+
activeFilterCount > 0 && /* @__PURE__ */ React21.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear")
|
|
2042
|
+
);
|
|
2043
|
+
}
|
|
2044
|
+
if (variant === "vertical") {
|
|
2045
|
+
return /* @__PURE__ */ React21.createElement(VStack, { spacing: 16, style: [styles16.verticalContainer, style ?? {}] }, showIcon && /* @__PURE__ */ React21.createElement(HStack, { spacing: 8, align: "center" }, /* @__PURE__ */ React21.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"), /* @__PURE__ */ React21.createElement(
|
|
2046
|
+
Typography,
|
|
2047
|
+
{
|
|
2048
|
+
variant: "label",
|
|
2049
|
+
color: theme.colors["muted-foreground"]
|
|
2050
|
+
},
|
|
2051
|
+
"Filters"
|
|
2052
|
+
)), filters.map((filter) => /* @__PURE__ */ React21.createElement(VStack, { key: filter.field, spacing: 4 }, /* @__PURE__ */ React21.createElement(
|
|
2053
|
+
Typography,
|
|
2054
|
+
{
|
|
2055
|
+
variant: "label",
|
|
2056
|
+
color: theme.colors["muted-foreground"]
|
|
2057
|
+
},
|
|
2058
|
+
filter.label
|
|
2059
|
+
), /* @__PURE__ */ React21.createElement(
|
|
2060
|
+
Select,
|
|
2061
|
+
{
|
|
2062
|
+
value: selectedValues[filter.field] || "all",
|
|
2063
|
+
onChange: (newValue) => handleFilterSelect(filter.field, newValue),
|
|
2064
|
+
options: buildSelectOptions(filter)
|
|
2065
|
+
}
|
|
2066
|
+
))), activeFilterCount > 0 && /* @__PURE__ */ React21.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all"));
|
|
2067
|
+
}
|
|
2068
|
+
if (variant === "compact") {
|
|
2069
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2070
|
+
HStack,
|
|
2071
|
+
{
|
|
2072
|
+
spacing: 12,
|
|
2073
|
+
align: "center",
|
|
2074
|
+
style: [styles16.compactContainer, style ?? {}]
|
|
2075
|
+
},
|
|
2076
|
+
showIcon && /* @__PURE__ */ React21.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"),
|
|
2077
|
+
filters.map((filter) => /* @__PURE__ */ React21.createElement(View19, { key: filter.field, style: styles16.compactSelect }, /* @__PURE__ */ React21.createElement(
|
|
2078
|
+
Select,
|
|
2079
|
+
{
|
|
2080
|
+
value: selectedValues[filter.field] || "all",
|
|
2081
|
+
onChange: (newValue) => handleFilterSelect(filter.field, newValue),
|
|
2082
|
+
options: [
|
|
2083
|
+
{ value: "all", label: `All ${filter.label}` },
|
|
2084
|
+
...filter.options?.map((opt) => ({
|
|
2085
|
+
value: opt,
|
|
2086
|
+
label: opt
|
|
2087
|
+
})) || []
|
|
2088
|
+
]
|
|
2089
|
+
}
|
|
2090
|
+
))),
|
|
2091
|
+
activeFilterCount > 0 && /* @__PURE__ */ React21.createElement(React21.Fragment, null, Object.entries(selectedValues).map(([field, value]) => {
|
|
2092
|
+
const filterDef = filters.find((f) => f.field === field);
|
|
2093
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2094
|
+
TouchableOpacity12,
|
|
2095
|
+
{
|
|
2096
|
+
key: field,
|
|
2097
|
+
onPress: () => handleFilterSelect(field, null)
|
|
2098
|
+
},
|
|
2099
|
+
/* @__PURE__ */ React21.createElement(Badge, { variant: "primary", size: "md" }, filterDef?.label, ": ", value, " \u2715")
|
|
2100
|
+
);
|
|
2101
|
+
}), /* @__PURE__ */ React21.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all"))
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2105
|
+
View19,
|
|
2106
|
+
{
|
|
2107
|
+
style: [
|
|
2108
|
+
styles16.defaultContainer,
|
|
2109
|
+
{
|
|
2110
|
+
backgroundColor: theme.colors.card,
|
|
2111
|
+
borderColor: theme.colors.border
|
|
2112
|
+
},
|
|
2113
|
+
style
|
|
2114
|
+
]
|
|
2115
|
+
},
|
|
2116
|
+
/* @__PURE__ */ React21.createElement(HStack, { spacing: 16, align: "center", style: styles16.defaultContent }, showIcon && /* @__PURE__ */ React21.createElement(HStack, { spacing: 8, align: "center" }, /* @__PURE__ */ React21.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "\u{1F50D}"), /* @__PURE__ */ React21.createElement(
|
|
2117
|
+
Typography,
|
|
2118
|
+
{
|
|
2119
|
+
variant: "label",
|
|
2120
|
+
color: theme.colors["muted-foreground"]
|
|
2121
|
+
},
|
|
2122
|
+
"Filters"
|
|
2123
|
+
)), filters.map((filter) => /* @__PURE__ */ React21.createElement(VStack, { key: filter.field, spacing: 4 }, /* @__PURE__ */ React21.createElement(
|
|
2124
|
+
Typography,
|
|
2125
|
+
{
|
|
2126
|
+
variant: "label",
|
|
2127
|
+
color: theme.colors["muted-foreground"]
|
|
2128
|
+
},
|
|
2129
|
+
filter.label
|
|
2130
|
+
), /* @__PURE__ */ React21.createElement(
|
|
2131
|
+
Select,
|
|
2132
|
+
{
|
|
2133
|
+
value: selectedValues[filter.field] || "all",
|
|
2134
|
+
onChange: (newValue) => handleFilterSelect(filter.field, newValue),
|
|
2135
|
+
options: buildSelectOptions(filter)
|
|
2136
|
+
}
|
|
2137
|
+
))), activeFilterCount > 0 && /* @__PURE__ */ React21.createElement(HStack, { spacing: 12, align: "center", style: styles16.clearSection }, /* @__PURE__ */ React21.createElement(Badge, { variant: "primary", size: "md" }, activeFilterCount, " active"), /* @__PURE__ */ React21.createElement(Button, { variant: "ghost", size: "sm", onPress: handleClearAll }, "Clear all")))
|
|
2138
|
+
);
|
|
2139
|
+
};
|
|
2140
|
+
var styles16 = StyleSheet16.create({
|
|
2141
|
+
pillsContainer: {
|
|
2142
|
+
flexWrap: "wrap"
|
|
2143
|
+
},
|
|
2144
|
+
pillGroup: {
|
|
2145
|
+
borderRadius: 6,
|
|
2146
|
+
overflow: "hidden",
|
|
2147
|
+
borderWidth: 1
|
|
2148
|
+
},
|
|
2149
|
+
pill: {
|
|
2150
|
+
paddingHorizontal: 12,
|
|
2151
|
+
paddingVertical: 6
|
|
2152
|
+
},
|
|
2153
|
+
pillWithBorder: {
|
|
2154
|
+
borderLeftWidth: 1
|
|
2155
|
+
},
|
|
2156
|
+
verticalContainer: {
|
|
2157
|
+
width: "100%"
|
|
2158
|
+
},
|
|
2159
|
+
compactContainer: {
|
|
2160
|
+
flexWrap: "wrap"
|
|
2161
|
+
},
|
|
2162
|
+
compactSelect: {
|
|
2163
|
+
minWidth: 120
|
|
2164
|
+
},
|
|
2165
|
+
defaultContainer: {
|
|
2166
|
+
padding: 16,
|
|
2167
|
+
borderRadius: 8,
|
|
2168
|
+
borderWidth: 1
|
|
2169
|
+
},
|
|
2170
|
+
defaultContent: {
|
|
2171
|
+
flexWrap: "wrap"
|
|
2172
|
+
},
|
|
2173
|
+
clearSection: {
|
|
2174
|
+
marginLeft: "auto"
|
|
2175
|
+
}
|
|
2176
|
+
});
|
|
2177
|
+
FilterGroup.displayName = "FilterGroup";
|
|
2178
|
+
|
|
2179
|
+
// src/components/molecules/Meter.tsx
|
|
2180
|
+
import React22, { useMemo as useMemo2, useCallback as useCallback2 } from "react";
|
|
2181
|
+
import { View as View20, StyleSheet as StyleSheet17, TouchableOpacity as TouchableOpacity13 } from "react-native";
|
|
2182
|
+
var getDefaultThresholds = (theme) => [
|
|
2183
|
+
{ value: 30, color: theme.colors.error },
|
|
2184
|
+
{ value: 70, color: theme.colors.warning },
|
|
2185
|
+
{ value: 100, color: theme.colors.success }
|
|
2186
|
+
];
|
|
2187
|
+
function getColorForValue(value, max, thresholds, theme) {
|
|
2188
|
+
const percentage = value / max * 100;
|
|
2189
|
+
for (const threshold of thresholds) {
|
|
2190
|
+
if (percentage <= threshold.value) {
|
|
2191
|
+
return threshold.color;
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
return thresholds[thresholds.length - 1]?.color ?? theme.colors.primary;
|
|
2195
|
+
}
|
|
2196
|
+
var Meter = ({
|
|
2197
|
+
value,
|
|
2198
|
+
min = 0,
|
|
2199
|
+
max = 100,
|
|
2200
|
+
label,
|
|
2201
|
+
unit,
|
|
2202
|
+
variant = "linear",
|
|
2203
|
+
thresholds: thresholdsProp,
|
|
2204
|
+
segments = 5,
|
|
2205
|
+
showValue = true,
|
|
2206
|
+
actions,
|
|
2207
|
+
entity,
|
|
2208
|
+
isLoading = false,
|
|
2209
|
+
error,
|
|
2210
|
+
style
|
|
2211
|
+
}) => {
|
|
2212
|
+
const theme = useTheme();
|
|
2213
|
+
const eventBus = useEventBus();
|
|
2214
|
+
const thresholds = useMemo2(
|
|
2215
|
+
() => thresholdsProp ?? getDefaultThresholds(theme),
|
|
2216
|
+
[thresholdsProp, theme]
|
|
2217
|
+
);
|
|
2218
|
+
const handleAction = useCallback2(
|
|
2219
|
+
(action) => {
|
|
2220
|
+
if (action.event) {
|
|
2221
|
+
eventBus.emit(`UI:${action.event}`, { value, entity });
|
|
2222
|
+
}
|
|
2223
|
+
if (action.navigatesTo) {
|
|
2224
|
+
eventBus.emit("UI:NAVIGATE", { to: action.navigatesTo });
|
|
2225
|
+
}
|
|
2226
|
+
},
|
|
2227
|
+
[eventBus, value, entity]
|
|
2228
|
+
);
|
|
2229
|
+
const onActionPress = (action) => () => {
|
|
2230
|
+
handleAction(action);
|
|
2231
|
+
};
|
|
2232
|
+
const percentage = useMemo2(() => {
|
|
2233
|
+
const range = max - min;
|
|
2234
|
+
if (range <= 0) return 0;
|
|
2235
|
+
return Math.min(Math.max((value - min) / range * 100, 0), 100);
|
|
2236
|
+
}, [value, min, max]);
|
|
2237
|
+
const activeColor = useMemo2(
|
|
2238
|
+
() => getColorForValue(value, max, thresholds, theme),
|
|
2239
|
+
[value, max, thresholds, theme]
|
|
2240
|
+
);
|
|
2241
|
+
const displayValue = useMemo2(() => {
|
|
2242
|
+
const formatted = Number.isInteger(value) ? value.toString() : value.toFixed(1);
|
|
2243
|
+
return unit ? `${formatted}${unit}` : formatted;
|
|
2244
|
+
}, [value, unit]);
|
|
2245
|
+
if (isLoading) {
|
|
2246
|
+
return /* @__PURE__ */ React22.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React22.createElement(LoadingState, { message: "Loading meter..." }));
|
|
2247
|
+
}
|
|
2248
|
+
if (error) {
|
|
2249
|
+
return /* @__PURE__ */ React22.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React22.createElement(ErrorState, { message: error.message }));
|
|
2250
|
+
}
|
|
2251
|
+
if (variant === "segmented") {
|
|
2252
|
+
const activeSegments = Math.round(percentage / 100 * segments);
|
|
2253
|
+
return /* @__PURE__ */ React22.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React22.createElement(VStack, { spacing: 8 }, (label || showValue) && /* @__PURE__ */ React22.createElement(HStack, { justify: "space-between", align: "center" }, label && /* @__PURE__ */ React22.createElement(
|
|
2254
|
+
Typography,
|
|
2255
|
+
{
|
|
2256
|
+
variant: "caption",
|
|
2257
|
+
color: theme.colors["muted-foreground"]
|
|
2258
|
+
},
|
|
2259
|
+
label
|
|
2260
|
+
), showValue && /* @__PURE__ */ React22.createElement(Typography, { variant: "body", style: { fontWeight: "600" } }, displayValue)), /* @__PURE__ */ React22.createElement(HStack, { spacing: 4, style: styles17.segmentsContainer }, Array.from({ length: segments }).map((_, idx) => {
|
|
2261
|
+
const isActive = idx < activeSegments;
|
|
2262
|
+
const segColor = isActive ? getColorForValue(
|
|
2263
|
+
(idx + 1) / segments * max,
|
|
2264
|
+
max,
|
|
2265
|
+
thresholds,
|
|
2266
|
+
theme
|
|
2267
|
+
) : void 0;
|
|
2268
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2269
|
+
View20,
|
|
2270
|
+
{
|
|
2271
|
+
key: idx,
|
|
2272
|
+
style: [
|
|
2273
|
+
styles17.segment,
|
|
2274
|
+
{
|
|
2275
|
+
backgroundColor: isActive ? segColor : theme.colors.muted
|
|
2276
|
+
}
|
|
2277
|
+
]
|
|
2278
|
+
}
|
|
2279
|
+
);
|
|
2280
|
+
})), thresholds.some((t) => t.label) && /* @__PURE__ */ React22.createElement(HStack, { justify: "space-between", style: styles17.thresholdLabels }, thresholds.map((t, idx) => /* @__PURE__ */ React22.createElement(
|
|
2281
|
+
Typography,
|
|
2282
|
+
{
|
|
2283
|
+
key: idx,
|
|
2284
|
+
variant: "caption",
|
|
2285
|
+
color: theme.colors["muted-foreground"]
|
|
2286
|
+
},
|
|
2287
|
+
t.label || ""
|
|
2288
|
+
))), actions && actions.length > 0 && /* @__PURE__ */ React22.createElement(HStack, { spacing: 8, style: styles17.actionsContainer }, actions.map((action, idx) => /* @__PURE__ */ React22.createElement(TouchableOpacity13, { key: idx, onPress: onActionPress(action) }, /* @__PURE__ */ React22.createElement(
|
|
2289
|
+
Badge,
|
|
2290
|
+
{
|
|
2291
|
+
variant: action.variant ?? "default",
|
|
2292
|
+
size: "sm"
|
|
2293
|
+
},
|
|
2294
|
+
action.label
|
|
2295
|
+
))))));
|
|
2296
|
+
}
|
|
2297
|
+
return /* @__PURE__ */ React22.createElement(Card, { style: [styles17.container, style ?? {}] }, /* @__PURE__ */ React22.createElement(VStack, { spacing: 8 }, (label || showValue) && /* @__PURE__ */ React22.createElement(HStack, { justify: "space-between", align: "center" }, label && /* @__PURE__ */ React22.createElement(
|
|
2298
|
+
Typography,
|
|
2299
|
+
{
|
|
2300
|
+
variant: "caption",
|
|
2301
|
+
color: theme.colors["muted-foreground"]
|
|
2302
|
+
},
|
|
2303
|
+
label
|
|
2304
|
+
), showValue && /* @__PURE__ */ React22.createElement(Typography, { variant: "body", style: { fontWeight: "600" } }, displayValue)), /* @__PURE__ */ React22.createElement(
|
|
2305
|
+
View20,
|
|
2306
|
+
{
|
|
2307
|
+
style: [
|
|
2308
|
+
styles17.track,
|
|
2309
|
+
{
|
|
2310
|
+
backgroundColor: theme.colors.muted
|
|
2311
|
+
}
|
|
2312
|
+
]
|
|
2313
|
+
},
|
|
2314
|
+
/* @__PURE__ */ React22.createElement(
|
|
2315
|
+
View20,
|
|
2316
|
+
{
|
|
2317
|
+
style: [
|
|
2318
|
+
styles17.fill,
|
|
2319
|
+
{
|
|
2320
|
+
width: `${percentage}%`,
|
|
2321
|
+
backgroundColor: activeColor
|
|
2322
|
+
}
|
|
2323
|
+
]
|
|
2324
|
+
}
|
|
2325
|
+
)
|
|
2326
|
+
), /* @__PURE__ */ React22.createElement(HStack, { justify: "space-between", style: styles17.rangeLabels }, /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, min, unit ? ` ${unit}` : ""), /* @__PURE__ */ React22.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, max, unit ? ` ${unit}` : "")), actions && actions.length > 0 && /* @__PURE__ */ React22.createElement(HStack, { spacing: 8, style: styles17.actionsContainer }, actions.map((action, idx) => /* @__PURE__ */ React22.createElement(TouchableOpacity13, { key: idx, onPress: onActionPress(action) }, /* @__PURE__ */ React22.createElement(
|
|
2327
|
+
Badge,
|
|
2328
|
+
{
|
|
2329
|
+
variant: action.variant ?? "default",
|
|
2330
|
+
size: "sm"
|
|
2331
|
+
},
|
|
2332
|
+
action.label
|
|
2333
|
+
))))));
|
|
2334
|
+
};
|
|
2335
|
+
var styles17 = StyleSheet17.create({
|
|
2336
|
+
container: {
|
|
2337
|
+
padding: 16
|
|
2338
|
+
},
|
|
2339
|
+
track: {
|
|
2340
|
+
width: "100%",
|
|
2341
|
+
height: 12,
|
|
2342
|
+
borderRadius: 6,
|
|
2343
|
+
overflow: "hidden"
|
|
2344
|
+
},
|
|
2345
|
+
fill: {
|
|
2346
|
+
height: "100%",
|
|
2347
|
+
borderRadius: 6
|
|
2348
|
+
},
|
|
2349
|
+
segmentsContainer: {
|
|
2350
|
+
width: "100%"
|
|
2351
|
+
},
|
|
2352
|
+
segment: {
|
|
2353
|
+
flex: 1,
|
|
2354
|
+
height: 8,
|
|
2355
|
+
borderRadius: 4
|
|
2356
|
+
},
|
|
2357
|
+
rangeLabels: {
|
|
2358
|
+
width: "100%",
|
|
2359
|
+
marginTop: 4
|
|
2360
|
+
},
|
|
2361
|
+
thresholdLabels: {
|
|
2362
|
+
width: "100%"
|
|
2363
|
+
},
|
|
2364
|
+
actionsContainer: {
|
|
2365
|
+
marginTop: 8
|
|
2366
|
+
}
|
|
2367
|
+
});
|
|
2368
|
+
Meter.displayName = "Meter";
|
|
2369
|
+
|
|
2370
|
+
// src/components/molecules/Pagination.tsx
|
|
2371
|
+
import React23 from "react";
|
|
2372
|
+
import { View as View21, TouchableOpacity as TouchableOpacity14, StyleSheet as StyleSheet18 } from "react-native";
|
|
2373
|
+
var Pagination = ({
|
|
2374
|
+
currentPage,
|
|
2375
|
+
totalPages,
|
|
2376
|
+
onPageChange,
|
|
2377
|
+
style,
|
|
2378
|
+
isLoading,
|
|
2379
|
+
error,
|
|
2380
|
+
changeEvent,
|
|
2381
|
+
maxVisiblePages = 5,
|
|
2382
|
+
showFirstLast = true,
|
|
2383
|
+
prevLabel = "Previous",
|
|
2384
|
+
nextLabel = "Next"
|
|
2385
|
+
}) => {
|
|
2386
|
+
const theme = useTheme();
|
|
2387
|
+
const eventBus = useEventBus();
|
|
2388
|
+
const handlePageChange = (page) => {
|
|
2389
|
+
if (page < 1 || page > totalPages || page === currentPage) {
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2392
|
+
if (changeEvent) {
|
|
2393
|
+
eventBus.emit(`UI:${changeEvent}`, { page, totalPages });
|
|
2394
|
+
}
|
|
2395
|
+
onPageChange?.(page);
|
|
2396
|
+
};
|
|
2397
|
+
if (isLoading) {
|
|
2398
|
+
return /* @__PURE__ */ React23.createElement(View21, { style: [styles18.container, style] }, /* @__PURE__ */ React23.createElement(LoadingState, { message: "Loading pages..." }));
|
|
2399
|
+
}
|
|
2400
|
+
if (error) {
|
|
2401
|
+
return /* @__PURE__ */ React23.createElement(View21, { style: [styles18.container, style] }, /* @__PURE__ */ React23.createElement(ErrorState, { message: error.message }));
|
|
2402
|
+
}
|
|
2403
|
+
if (totalPages <= 1) {
|
|
2404
|
+
return null;
|
|
2405
|
+
}
|
|
2406
|
+
const getVisiblePages = () => {
|
|
2407
|
+
const pages = [];
|
|
2408
|
+
const halfVisible = Math.floor(maxVisiblePages / 2);
|
|
2409
|
+
let startPage = Math.max(1, currentPage - halfVisible);
|
|
2410
|
+
const endPage = Math.min(totalPages, startPage + maxVisiblePages - 1);
|
|
2411
|
+
if (endPage - startPage + 1 < maxVisiblePages) {
|
|
2412
|
+
startPage = Math.max(1, endPage - maxVisiblePages + 1);
|
|
2413
|
+
}
|
|
2414
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
2415
|
+
pages.push(i);
|
|
2416
|
+
}
|
|
2417
|
+
return pages;
|
|
2418
|
+
};
|
|
2419
|
+
const visiblePages = getVisiblePages();
|
|
2420
|
+
const canGoPrev = currentPage > 1;
|
|
2421
|
+
const canGoNext = currentPage < totalPages;
|
|
2422
|
+
return /* @__PURE__ */ React23.createElement(HStack, { spacing: 4, align: "center", justify: "center", style: [styles18.container, style || {}] }, showFirstLast && /* @__PURE__ */ React23.createElement(
|
|
2423
|
+
Button,
|
|
2424
|
+
{
|
|
2425
|
+
variant: "ghost",
|
|
2426
|
+
size: "sm",
|
|
2427
|
+
disabled: !canGoPrev,
|
|
2428
|
+
onPress: () => handlePageChange(1)
|
|
2429
|
+
},
|
|
2430
|
+
"<<"
|
|
2431
|
+
), /* @__PURE__ */ React23.createElement(
|
|
2432
|
+
Button,
|
|
2433
|
+
{
|
|
2434
|
+
variant: "secondary",
|
|
2435
|
+
size: "sm",
|
|
2436
|
+
disabled: !canGoPrev,
|
|
2437
|
+
onPress: () => handlePageChange(currentPage - 1)
|
|
2438
|
+
},
|
|
2439
|
+
prevLabel
|
|
2440
|
+
), visiblePages[0] > 1 && /* @__PURE__ */ React23.createElement(View21, { style: styles18.ellipsis }, /* @__PURE__ */ React23.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, "...")), visiblePages.map((page) => {
|
|
2441
|
+
const isActive = page === currentPage;
|
|
2442
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2443
|
+
TouchableOpacity14,
|
|
2444
|
+
{
|
|
2445
|
+
key: page,
|
|
2446
|
+
onPress: () => handlePageChange(page),
|
|
2447
|
+
style: [
|
|
2448
|
+
styles18.pageButton,
|
|
2449
|
+
{
|
|
2450
|
+
backgroundColor: isActive ? theme.colors.primary : theme.colors.card,
|
|
2451
|
+
borderColor: theme.colors.border
|
|
2452
|
+
}
|
|
2453
|
+
]
|
|
2454
|
+
},
|
|
2455
|
+
/* @__PURE__ */ React23.createElement(
|
|
2456
|
+
Typography,
|
|
2457
|
+
{
|
|
2458
|
+
variant: "body",
|
|
2459
|
+
style: {
|
|
2460
|
+
color: isActive ? theme.colors["primary-foreground"] : theme.colors.foreground
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
page
|
|
2464
|
+
)
|
|
2465
|
+
);
|
|
2466
|
+
}), visiblePages[visiblePages.length - 1] < totalPages && /* @__PURE__ */ React23.createElement(View21, { style: styles18.ellipsis }, /* @__PURE__ */ React23.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, "...")), /* @__PURE__ */ React23.createElement(
|
|
2467
|
+
Button,
|
|
2468
|
+
{
|
|
2469
|
+
variant: "secondary",
|
|
2470
|
+
size: "sm",
|
|
2471
|
+
disabled: !canGoNext,
|
|
2472
|
+
onPress: () => handlePageChange(currentPage + 1)
|
|
2473
|
+
},
|
|
2474
|
+
nextLabel
|
|
2475
|
+
), showFirstLast && /* @__PURE__ */ React23.createElement(
|
|
2476
|
+
Button,
|
|
2477
|
+
{
|
|
2478
|
+
variant: "ghost",
|
|
2479
|
+
size: "sm",
|
|
2480
|
+
disabled: !canGoNext,
|
|
2481
|
+
onPress: () => handlePageChange(totalPages)
|
|
2482
|
+
},
|
|
2483
|
+
">>"
|
|
2484
|
+
));
|
|
2485
|
+
};
|
|
2486
|
+
var styles18 = StyleSheet18.create({
|
|
2487
|
+
container: {
|
|
2488
|
+
flexWrap: "wrap",
|
|
2489
|
+
paddingVertical: 8
|
|
2490
|
+
},
|
|
2491
|
+
pageButton: {
|
|
2492
|
+
minWidth: 36,
|
|
2493
|
+
height: 36,
|
|
2494
|
+
borderRadius: 8,
|
|
2495
|
+
borderWidth: 1,
|
|
2496
|
+
alignItems: "center",
|
|
2497
|
+
justifyContent: "center",
|
|
2498
|
+
paddingHorizontal: 8
|
|
2499
|
+
},
|
|
2500
|
+
ellipsis: {
|
|
2501
|
+
minWidth: 36,
|
|
2502
|
+
height: 36,
|
|
2503
|
+
alignItems: "center",
|
|
2504
|
+
justifyContent: "center"
|
|
2505
|
+
}
|
|
2506
|
+
});
|
|
2507
|
+
Pagination.displayName = "Pagination";
|
|
2508
|
+
|
|
2509
|
+
// src/components/molecules/MarkdownContent.tsx
|
|
2510
|
+
import React24 from "react";
|
|
2511
|
+
import { View as View22, StyleSheet as StyleSheet19 } from "react-native";
|
|
2512
|
+
var parseMarkdown = (content) => {
|
|
2513
|
+
const elements = [];
|
|
2514
|
+
const lines = content.split("\n");
|
|
2515
|
+
let i = 0;
|
|
2516
|
+
while (i < lines.length) {
|
|
2517
|
+
const line = lines[i];
|
|
2518
|
+
const trimmedLine = line.trim();
|
|
2519
|
+
if (trimmedLine === "") {
|
|
2520
|
+
i++;
|
|
2521
|
+
continue;
|
|
2522
|
+
}
|
|
2523
|
+
if (/^(---|___|\*\*\*)$/.test(trimmedLine)) {
|
|
2524
|
+
elements.push({ type: "horizontalRule" });
|
|
2525
|
+
i++;
|
|
2526
|
+
continue;
|
|
2527
|
+
}
|
|
2528
|
+
const headingMatch = trimmedLine.match(/^(#{1,6})\s+(.+)$/);
|
|
2529
|
+
if (headingMatch) {
|
|
2530
|
+
elements.push({
|
|
2531
|
+
type: "heading",
|
|
2532
|
+
level: headingMatch[1].length,
|
|
2533
|
+
content: parseInlineElements(headingMatch[2])
|
|
2534
|
+
});
|
|
2535
|
+
i++;
|
|
2536
|
+
continue;
|
|
2537
|
+
}
|
|
2538
|
+
const codeBlockStart = trimmedLine.match(/^```(\w*)/);
|
|
2539
|
+
if (codeBlockStart) {
|
|
2540
|
+
const language = codeBlockStart[1] || "";
|
|
2541
|
+
const codeLines = [];
|
|
2542
|
+
i++;
|
|
2543
|
+
while (i < lines.length && !lines[i].trim().match(/^```$/)) {
|
|
2544
|
+
codeLines.push(lines[i]);
|
|
2545
|
+
i++;
|
|
2546
|
+
}
|
|
2547
|
+
elements.push({
|
|
2548
|
+
type: "code",
|
|
2549
|
+
language,
|
|
2550
|
+
content: codeLines.join("\n")
|
|
2551
|
+
});
|
|
2552
|
+
i++;
|
|
2553
|
+
continue;
|
|
2554
|
+
}
|
|
2555
|
+
if (trimmedLine.startsWith(">")) {
|
|
2556
|
+
const quoteLines = [];
|
|
2557
|
+
while (i < lines.length && lines[i].trim().startsWith(">")) {
|
|
2558
|
+
quoteLines.push(lines[i].trim().substring(1).trim());
|
|
2559
|
+
i++;
|
|
2560
|
+
}
|
|
2561
|
+
elements.push({
|
|
2562
|
+
type: "blockquote",
|
|
2563
|
+
content: parseInlineElements(quoteLines.join(" "))
|
|
2564
|
+
});
|
|
2565
|
+
continue;
|
|
2566
|
+
}
|
|
2567
|
+
const orderedListMatch = trimmedLine.match(/^(\d+)\.\s+(.+)$/);
|
|
2568
|
+
if (orderedListMatch) {
|
|
2569
|
+
const items = [];
|
|
2570
|
+
while (i < lines.length) {
|
|
2571
|
+
const currentLine = lines[i].trim();
|
|
2572
|
+
const itemMatch = currentLine.match(/^\d+\.\s+(.+)$/);
|
|
2573
|
+
if (itemMatch) {
|
|
2574
|
+
items.push(parseInlineElements(itemMatch[1]));
|
|
2575
|
+
i++;
|
|
2576
|
+
} else if (currentLine === "") {
|
|
2577
|
+
i++;
|
|
2578
|
+
break;
|
|
2579
|
+
} else {
|
|
2580
|
+
break;
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
elements.push({ type: "list", ordered: true, items });
|
|
2584
|
+
continue;
|
|
2585
|
+
}
|
|
2586
|
+
const unorderedListMatch = trimmedLine.match(/^[\*\-\+]\s+(.+)$/);
|
|
2587
|
+
if (unorderedListMatch) {
|
|
2588
|
+
const items = [];
|
|
2589
|
+
while (i < lines.length) {
|
|
2590
|
+
const currentLine = lines[i].trim();
|
|
2591
|
+
const itemMatch = currentLine.match(/^[\*\-\+]\s+(.+)$/);
|
|
2592
|
+
if (itemMatch) {
|
|
2593
|
+
items.push(parseInlineElements(itemMatch[1]));
|
|
2594
|
+
i++;
|
|
2595
|
+
} else if (currentLine === "") {
|
|
2596
|
+
i++;
|
|
2597
|
+
break;
|
|
2598
|
+
} else {
|
|
2599
|
+
break;
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
elements.push({ type: "list", ordered: false, items });
|
|
2603
|
+
continue;
|
|
2604
|
+
}
|
|
2605
|
+
const paragraphLines = [];
|
|
2606
|
+
while (i < lines.length && lines[i].trim() !== "") {
|
|
2607
|
+
paragraphLines.push(lines[i]);
|
|
2608
|
+
i++;
|
|
2609
|
+
}
|
|
2610
|
+
elements.push({
|
|
2611
|
+
type: "paragraph",
|
|
2612
|
+
content: parseInlineElements(paragraphLines.join(" "))
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
return elements;
|
|
2616
|
+
};
|
|
2617
|
+
var parseInlineElements = (text) => {
|
|
2618
|
+
let result = text.replace(/`([^`]+)`/g, "\u300E$1\u300F");
|
|
2619
|
+
result = result.replace(/\*\*([^*]+)\*\*|__([^_]+)__/g, "\u3010$1$2\u3011");
|
|
2620
|
+
result = result.replace(/\*([^*]+)\*|_([^_]+)_/g, "\u3014$1$2\u3015");
|
|
2621
|
+
result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, "\u300E$1\u300F($2)");
|
|
2622
|
+
result = result.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, "[Image: $1]");
|
|
2623
|
+
return result;
|
|
2624
|
+
};
|
|
2625
|
+
var renderInlineContent = (content, theme) => {
|
|
2626
|
+
const parts = [];
|
|
2627
|
+
let remaining = content;
|
|
2628
|
+
let key = 0;
|
|
2629
|
+
const patterns = [
|
|
2630
|
+
{ regex: /『([^』]+)』/g, type: "code" },
|
|
2631
|
+
{ regex: /【([^】]+)】/g, type: "bold" },
|
|
2632
|
+
{ regex: /〔([^〕]+)〕/g, type: "italic" }
|
|
2633
|
+
];
|
|
2634
|
+
while (remaining.length > 0) {
|
|
2635
|
+
let earliestMatch = null;
|
|
2636
|
+
for (const pattern of patterns) {
|
|
2637
|
+
pattern.regex.lastIndex = 0;
|
|
2638
|
+
const match = pattern.regex.exec(remaining);
|
|
2639
|
+
if (match && (earliestMatch === null || match.index < earliestMatch.index)) {
|
|
2640
|
+
earliestMatch = { index: match.index, match, type: pattern.type };
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
if (earliestMatch) {
|
|
2644
|
+
if (earliestMatch.index > 0) {
|
|
2645
|
+
parts.push(
|
|
2646
|
+
/* @__PURE__ */ React24.createElement(Typography, { key: key++, variant: "body" }, remaining.slice(0, earliestMatch.index))
|
|
2647
|
+
);
|
|
2648
|
+
}
|
|
2649
|
+
const content2 = earliestMatch.match[1];
|
|
2650
|
+
switch (earliestMatch.type) {
|
|
2651
|
+
case "code":
|
|
2652
|
+
parts.push(
|
|
2653
|
+
/* @__PURE__ */ React24.createElement(
|
|
2654
|
+
Typography,
|
|
2655
|
+
{
|
|
2656
|
+
key: key++,
|
|
2657
|
+
variant: "body",
|
|
2658
|
+
style: {
|
|
2659
|
+
fontFamily: "monospace",
|
|
2660
|
+
backgroundColor: theme.colors.muted,
|
|
2661
|
+
paddingHorizontal: 4,
|
|
2662
|
+
paddingVertical: 2,
|
|
2663
|
+
borderRadius: 4
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
content2
|
|
2667
|
+
)
|
|
2668
|
+
);
|
|
2669
|
+
break;
|
|
2670
|
+
case "bold":
|
|
2671
|
+
parts.push(
|
|
2672
|
+
/* @__PURE__ */ React24.createElement(
|
|
2673
|
+
Typography,
|
|
2674
|
+
{
|
|
2675
|
+
key: key++,
|
|
2676
|
+
variant: "body",
|
|
2677
|
+
style: { fontWeight: "700" }
|
|
2678
|
+
},
|
|
2679
|
+
content2
|
|
2680
|
+
)
|
|
2681
|
+
);
|
|
2682
|
+
break;
|
|
2683
|
+
case "italic":
|
|
2684
|
+
parts.push(
|
|
2685
|
+
/* @__PURE__ */ React24.createElement(
|
|
2686
|
+
Typography,
|
|
2687
|
+
{
|
|
2688
|
+
key: key++,
|
|
2689
|
+
variant: "body",
|
|
2690
|
+
style: { fontStyle: "italic" }
|
|
2691
|
+
},
|
|
2692
|
+
content2
|
|
2693
|
+
)
|
|
2694
|
+
);
|
|
2695
|
+
break;
|
|
2696
|
+
}
|
|
2697
|
+
remaining = remaining.slice(earliestMatch.index + earliestMatch.match[0].length);
|
|
2698
|
+
} else {
|
|
2699
|
+
parts.push(
|
|
2700
|
+
/* @__PURE__ */ React24.createElement(Typography, { key: key++, variant: "body" }, remaining)
|
|
2701
|
+
);
|
|
2702
|
+
break;
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
return parts;
|
|
2706
|
+
};
|
|
2707
|
+
var MarkdownContent = ({
|
|
2708
|
+
content,
|
|
2709
|
+
style,
|
|
2710
|
+
isLoading,
|
|
2711
|
+
error,
|
|
2712
|
+
padding = "md"
|
|
2713
|
+
}) => {
|
|
2714
|
+
const theme = useTheme();
|
|
2715
|
+
const elements = React24.useMemo(() => parseMarkdown(content), [content]);
|
|
2716
|
+
if (isLoading) {
|
|
2717
|
+
return /* @__PURE__ */ React24.createElement(Card, { style: [styles19.container, style || {}] }, /* @__PURE__ */ React24.createElement(LoadingState, { message: "Loading content..." }));
|
|
2718
|
+
}
|
|
2719
|
+
if (error) {
|
|
2720
|
+
return /* @__PURE__ */ React24.createElement(Card, { style: [styles19.container, style || {}] }, /* @__PURE__ */ React24.createElement(ErrorState, { message: error.message }));
|
|
2721
|
+
}
|
|
2722
|
+
const paddingStyles = {
|
|
2723
|
+
none: { padding: 0 },
|
|
2724
|
+
sm: { padding: 12 },
|
|
2725
|
+
md: { padding: 16 },
|
|
2726
|
+
lg: { padding: 24 }
|
|
2727
|
+
};
|
|
2728
|
+
const renderElement = (element, index) => {
|
|
2729
|
+
switch (element.type) {
|
|
2730
|
+
case "heading":
|
|
2731
|
+
const variantMap = {
|
|
2732
|
+
1: "h1",
|
|
2733
|
+
2: "h2",
|
|
2734
|
+
3: "h3",
|
|
2735
|
+
4: "h4",
|
|
2736
|
+
5: "body",
|
|
2737
|
+
6: "body"
|
|
2738
|
+
};
|
|
2739
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2740
|
+
Typography,
|
|
2741
|
+
{
|
|
2742
|
+
key: index,
|
|
2743
|
+
variant: variantMap[element.level] || "body",
|
|
2744
|
+
style: [
|
|
2745
|
+
styles19.heading,
|
|
2746
|
+
element.level > 2 && { color: theme.colors["muted-foreground"] }
|
|
2747
|
+
]
|
|
2748
|
+
},
|
|
2749
|
+
element.content
|
|
2750
|
+
);
|
|
2751
|
+
case "paragraph":
|
|
2752
|
+
return /* @__PURE__ */ React24.createElement(View22, { key: index, style: styles19.paragraph }, renderInlineContent(element.content, theme));
|
|
2753
|
+
case "code":
|
|
2754
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2755
|
+
View22,
|
|
2756
|
+
{
|
|
2757
|
+
key: index,
|
|
2758
|
+
style: [
|
|
2759
|
+
styles19.codeBlock,
|
|
2760
|
+
{ backgroundColor: theme.colors.muted }
|
|
2761
|
+
]
|
|
2762
|
+
},
|
|
2763
|
+
element.language && /* @__PURE__ */ React24.createElement(
|
|
2764
|
+
Typography,
|
|
2765
|
+
{
|
|
2766
|
+
variant: "caption",
|
|
2767
|
+
style: {
|
|
2768
|
+
color: theme.colors["muted-foreground"],
|
|
2769
|
+
marginBottom: 8,
|
|
2770
|
+
textTransform: "uppercase"
|
|
2771
|
+
}
|
|
2772
|
+
},
|
|
2773
|
+
element.language
|
|
2774
|
+
),
|
|
2775
|
+
/* @__PURE__ */ React24.createElement(
|
|
2776
|
+
Typography,
|
|
2777
|
+
{
|
|
2778
|
+
variant: "body",
|
|
2779
|
+
style: {
|
|
2780
|
+
fontFamily: "monospace",
|
|
2781
|
+
color: theme.colors.foreground
|
|
2782
|
+
}
|
|
2783
|
+
},
|
|
2784
|
+
element.content
|
|
2785
|
+
)
|
|
2786
|
+
);
|
|
2787
|
+
case "blockquote":
|
|
2788
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2789
|
+
View22,
|
|
2790
|
+
{
|
|
2791
|
+
key: index,
|
|
2792
|
+
style: [
|
|
2793
|
+
styles19.blockquote,
|
|
2794
|
+
{
|
|
2795
|
+
borderLeftColor: theme.colors.primary,
|
|
2796
|
+
backgroundColor: theme.colors.muted
|
|
2797
|
+
}
|
|
2798
|
+
]
|
|
2799
|
+
},
|
|
2800
|
+
/* @__PURE__ */ React24.createElement(
|
|
2801
|
+
Typography,
|
|
2802
|
+
{
|
|
2803
|
+
variant: "body",
|
|
2804
|
+
style: { color: theme.colors["muted-foreground"] }
|
|
2805
|
+
},
|
|
2806
|
+
element.content
|
|
2807
|
+
)
|
|
2808
|
+
);
|
|
2809
|
+
case "list":
|
|
2810
|
+
return /* @__PURE__ */ React24.createElement(View22, { key: index, style: styles19.list }, element.items.map((item, itemIndex) => /* @__PURE__ */ React24.createElement(View22, { key: itemIndex, style: styles19.listItem }, /* @__PURE__ */ React24.createElement(
|
|
2811
|
+
Typography,
|
|
2812
|
+
{
|
|
2813
|
+
variant: "body",
|
|
2814
|
+
style: [
|
|
2815
|
+
styles19.listMarker,
|
|
2816
|
+
{ color: theme.colors.primary }
|
|
2817
|
+
]
|
|
2818
|
+
},
|
|
2819
|
+
element.ordered ? `${itemIndex + 1}.` : "\u2022"
|
|
2820
|
+
), /* @__PURE__ */ React24.createElement(View22, { style: styles19.listItemContent }, renderInlineContent(item, theme)))));
|
|
2821
|
+
case "horizontalRule":
|
|
2822
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2823
|
+
View22,
|
|
2824
|
+
{
|
|
2825
|
+
key: index,
|
|
2826
|
+
style: [
|
|
2827
|
+
styles19.horizontalRule,
|
|
2828
|
+
{ backgroundColor: theme.colors.border }
|
|
2829
|
+
]
|
|
2830
|
+
}
|
|
2831
|
+
);
|
|
2832
|
+
default:
|
|
2833
|
+
return null;
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2836
|
+
return /* @__PURE__ */ React24.createElement(Card, { style: [styles19.container, style || {}], padding: "none" }, /* @__PURE__ */ React24.createElement(VStack, { spacing: 12, style: [styles19.content, paddingStyles[padding]] }, elements.map((element, index) => renderElement(element, index))));
|
|
2837
|
+
};
|
|
2838
|
+
var styles19 = StyleSheet19.create({
|
|
2839
|
+
container: {
|
|
2840
|
+
overflow: "hidden"
|
|
2841
|
+
},
|
|
2842
|
+
content: {
|
|
2843
|
+
width: "100%"
|
|
2844
|
+
},
|
|
2845
|
+
heading: {
|
|
2846
|
+
marginTop: 8,
|
|
2847
|
+
marginBottom: 4
|
|
2848
|
+
},
|
|
2849
|
+
paragraph: {
|
|
2850
|
+
marginVertical: 4
|
|
2851
|
+
},
|
|
2852
|
+
codeBlock: {
|
|
2853
|
+
padding: 12,
|
|
2854
|
+
borderRadius: 8,
|
|
2855
|
+
marginVertical: 8
|
|
2856
|
+
},
|
|
2857
|
+
blockquote: {
|
|
2858
|
+
padding: 12,
|
|
2859
|
+
paddingLeft: 16,
|
|
2860
|
+
borderLeftWidth: 4,
|
|
2861
|
+
borderRadius: 4,
|
|
2862
|
+
marginVertical: 8
|
|
2863
|
+
},
|
|
2864
|
+
list: {
|
|
2865
|
+
marginVertical: 8
|
|
2866
|
+
},
|
|
2867
|
+
listItem: {
|
|
2868
|
+
flexDirection: "row",
|
|
2869
|
+
marginVertical: 2
|
|
2870
|
+
},
|
|
2871
|
+
listMarker: {
|
|
2872
|
+
width: 24
|
|
2873
|
+
},
|
|
2874
|
+
listItemContent: {
|
|
2875
|
+
flex: 1
|
|
2876
|
+
},
|
|
2877
|
+
horizontalRule: {
|
|
2878
|
+
height: 1,
|
|
2879
|
+
marginVertical: 16
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2882
|
+
MarkdownContent.displayName = "MarkdownContent";
|
|
2883
|
+
|
|
2884
|
+
// src/components/molecules/WizardNavigation.tsx
|
|
2885
|
+
import React25 from "react";
|
|
2886
|
+
import {
|
|
2887
|
+
View as View23,
|
|
2888
|
+
StyleSheet as StyleSheet20
|
|
2889
|
+
} from "react-native";
|
|
2890
|
+
var WizardNavigation = ({
|
|
2891
|
+
currentStep,
|
|
2892
|
+
totalSteps,
|
|
2893
|
+
onBack,
|
|
2894
|
+
onNext,
|
|
2895
|
+
onCancel,
|
|
2896
|
+
onComplete,
|
|
2897
|
+
canGoBack = true,
|
|
2898
|
+
canGoNext = true,
|
|
2899
|
+
isComplete = false,
|
|
2900
|
+
backLabel = "Back",
|
|
2901
|
+
nextLabel = "Next",
|
|
2902
|
+
cancelLabel = "Cancel",
|
|
2903
|
+
completeLabel = "Complete",
|
|
2904
|
+
customActions,
|
|
2905
|
+
style,
|
|
2906
|
+
isLoading,
|
|
2907
|
+
error,
|
|
2908
|
+
entity,
|
|
2909
|
+
showCancel = true
|
|
2910
|
+
}) => {
|
|
2911
|
+
const eventBus = useEventBus();
|
|
2912
|
+
const isFirstStep = currentStep === 0;
|
|
2913
|
+
const isLastStep = currentStep === totalSteps - 1;
|
|
2914
|
+
const handleBack = () => {
|
|
2915
|
+
if (isFirstStep) {
|
|
2916
|
+
eventBus.emit("UI:WIZARD_CANCEL", { step: currentStep, entity });
|
|
2917
|
+
onCancel?.();
|
|
2918
|
+
} else {
|
|
2919
|
+
eventBus.emit("UI:WIZARD_BACK", { step: currentStep - 1, entity });
|
|
2920
|
+
onBack?.();
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
const handleNext = () => {
|
|
2924
|
+
if (isLastStep || isComplete) {
|
|
2925
|
+
eventBus.emit("UI:WIZARD_COMPLETE", { step: currentStep, entity });
|
|
2926
|
+
onComplete?.();
|
|
2927
|
+
} else {
|
|
2928
|
+
eventBus.emit("UI:WIZARD_NEXT", { step: currentStep + 1, entity });
|
|
2929
|
+
onNext?.();
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
const handleCustomAction = (action) => {
|
|
2933
|
+
if (action.event) {
|
|
2934
|
+
eventBus.emit(`UI:${action.event}`, { step: currentStep, entity });
|
|
2935
|
+
}
|
|
2936
|
+
};
|
|
2937
|
+
if (isLoading) {
|
|
2938
|
+
return /* @__PURE__ */ React25.createElement(View23, { style: [styles20.container, style] }, /* @__PURE__ */ React25.createElement(LoadingState, { message: "Loading..." }));
|
|
2939
|
+
}
|
|
2940
|
+
if (error) {
|
|
2941
|
+
return /* @__PURE__ */ React25.createElement(View23, { style: [styles20.container, style] }, /* @__PURE__ */ React25.createElement(ErrorState, { message: error.message }));
|
|
2942
|
+
}
|
|
2943
|
+
const visibleCustomActions = customActions?.filter((action) => !action.hidden) || [];
|
|
2944
|
+
return /* @__PURE__ */ React25.createElement(HStack, { spacing: 12, justify: "space-between", style: [styles20.container, style] }, /* @__PURE__ */ React25.createElement(HStack, { spacing: 8 }, isFirstStep && showCancel || !isFirstStep ? /* @__PURE__ */ React25.createElement(
|
|
2945
|
+
Button,
|
|
2946
|
+
{
|
|
2947
|
+
variant: "ghost",
|
|
2948
|
+
onPress: handleBack,
|
|
2949
|
+
disabled: isFirstStep && !showCancel ? true : !canGoBack,
|
|
2950
|
+
action: isFirstStep ? "WIZARD_CANCEL" : "WIZARD_BACK"
|
|
2951
|
+
},
|
|
2952
|
+
isFirstStep ? cancelLabel : backLabel
|
|
2953
|
+
) : null, visibleCustomActions.map((action, index) => /* @__PURE__ */ React25.createElement(
|
|
2954
|
+
Button,
|
|
2955
|
+
{
|
|
2956
|
+
key: `${action.label}-${index}`,
|
|
2957
|
+
variant: action.variant || "default",
|
|
2958
|
+
onPress: () => handleCustomAction(action),
|
|
2959
|
+
disabled: action.disabled,
|
|
2960
|
+
action: action.event
|
|
2961
|
+
},
|
|
2962
|
+
action.label
|
|
2963
|
+
))), /* @__PURE__ */ React25.createElement(
|
|
2964
|
+
Button,
|
|
2965
|
+
{
|
|
2966
|
+
variant: "primary",
|
|
2967
|
+
onPress: handleNext,
|
|
2968
|
+
disabled: !canGoNext,
|
|
2969
|
+
action: isLastStep || isComplete ? "WIZARD_COMPLETE" : "WIZARD_NEXT"
|
|
2970
|
+
},
|
|
2971
|
+
isLastStep || isComplete ? completeLabel : nextLabel
|
|
2972
|
+
));
|
|
2973
|
+
};
|
|
2974
|
+
var styles20 = StyleSheet20.create({
|
|
2975
|
+
container: {
|
|
2976
|
+
width: "100%",
|
|
2977
|
+
paddingVertical: 8
|
|
2978
|
+
}
|
|
2979
|
+
});
|
|
2980
|
+
WizardNavigation.displayName = "WizardNavigation";
|
|
2981
|
+
|
|
2982
|
+
// src/components/molecules/WizardProgress.tsx
|
|
2983
|
+
import React26 from "react";
|
|
2984
|
+
import {
|
|
2985
|
+
View as View24,
|
|
2986
|
+
TouchableOpacity as TouchableOpacity15,
|
|
2987
|
+
StyleSheet as StyleSheet21
|
|
2988
|
+
} from "react-native";
|
|
2989
|
+
var WizardProgress = ({
|
|
2990
|
+
steps,
|
|
2991
|
+
currentStep,
|
|
2992
|
+
onStepPress,
|
|
2993
|
+
allowNavigation = true,
|
|
2994
|
+
variant = "dots",
|
|
2995
|
+
showLabels = true,
|
|
2996
|
+
showDescriptions = false,
|
|
2997
|
+
style,
|
|
2998
|
+
isLoading,
|
|
2999
|
+
error,
|
|
3000
|
+
entity
|
|
3001
|
+
}) => {
|
|
3002
|
+
const theme = useTheme();
|
|
3003
|
+
const eventBus = useEventBus();
|
|
3004
|
+
const progress = (currentStep + 1) / steps.length * 100;
|
|
3005
|
+
const handleStepPress = (index) => {
|
|
3006
|
+
if (!allowNavigation) return;
|
|
3007
|
+
if (index > currentStep) return;
|
|
3008
|
+
eventBus.emit("UI:WIZARD_STEP_CHANGE", { step: index, entity });
|
|
3009
|
+
onStepPress?.(index);
|
|
3010
|
+
};
|
|
3011
|
+
const getStepStatus = (index) => {
|
|
3012
|
+
if (index === currentStep) return "active";
|
|
3013
|
+
if (index < currentStep) return "completed";
|
|
3014
|
+
return "pending";
|
|
3015
|
+
};
|
|
3016
|
+
const getStepColor = (status) => {
|
|
3017
|
+
switch (status) {
|
|
3018
|
+
case "completed":
|
|
3019
|
+
return {
|
|
3020
|
+
background: theme.colors.success,
|
|
3021
|
+
text: theme.colors["success-foreground"],
|
|
3022
|
+
border: theme.colors.success
|
|
3023
|
+
};
|
|
3024
|
+
case "active":
|
|
3025
|
+
return {
|
|
3026
|
+
background: theme.colors.primary,
|
|
3027
|
+
text: theme.colors["primary-foreground"],
|
|
3028
|
+
border: theme.colors.primary
|
|
3029
|
+
};
|
|
3030
|
+
case "pending":
|
|
3031
|
+
default:
|
|
3032
|
+
return {
|
|
3033
|
+
background: theme.colors.muted,
|
|
3034
|
+
text: theme.colors["muted-foreground"],
|
|
3035
|
+
border: theme.colors.border
|
|
3036
|
+
};
|
|
3037
|
+
}
|
|
3038
|
+
};
|
|
3039
|
+
if (isLoading) {
|
|
3040
|
+
return /* @__PURE__ */ React26.createElement(View24, { style: [styles21.container, style] }, /* @__PURE__ */ React26.createElement(LoadingState, { message: "Loading..." }));
|
|
3041
|
+
}
|
|
3042
|
+
if (error) {
|
|
3043
|
+
return /* @__PURE__ */ React26.createElement(View24, { style: [styles21.container, style] }, /* @__PURE__ */ React26.createElement(ErrorState, { message: error.message }));
|
|
3044
|
+
}
|
|
3045
|
+
const renderDots = () => /* @__PURE__ */ React26.createElement(HStack, { spacing: 8, justify: "center", style: styles21.dotsContainer }, steps.map((step, index) => {
|
|
3046
|
+
const status = getStepStatus(index);
|
|
3047
|
+
const colors = getStepColor(status);
|
|
3048
|
+
const canPress = allowNavigation && index <= currentStep;
|
|
3049
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3050
|
+
TouchableOpacity15,
|
|
3051
|
+
{
|
|
3052
|
+
key: step.id,
|
|
3053
|
+
onPress: () => handleStepPress(index),
|
|
3054
|
+
disabled: !canPress,
|
|
3055
|
+
style: [
|
|
3056
|
+
styles21.dot,
|
|
3057
|
+
{
|
|
3058
|
+
backgroundColor: colors.background,
|
|
3059
|
+
borderColor: colors.border
|
|
3060
|
+
},
|
|
3061
|
+
canPress && styles21.clickableDot
|
|
3062
|
+
],
|
|
3063
|
+
activeOpacity: 0.8
|
|
3064
|
+
},
|
|
3065
|
+
status === "completed" ? /* @__PURE__ */ React26.createElement(Typography, { variant: "caption", style: { color: colors.text, fontWeight: "700" } }, "\u2713") : /* @__PURE__ */ React26.createElement(View24, { style: [styles21.dotInner, { backgroundColor: colors.background }] })
|
|
3066
|
+
);
|
|
3067
|
+
}));
|
|
3068
|
+
const renderNumbers = () => /* @__PURE__ */ React26.createElement(HStack, { spacing: 12, justify: "center", style: styles21.numbersContainer }, steps.map((step, index) => {
|
|
3069
|
+
const status = getStepStatus(index);
|
|
3070
|
+
const colors = getStepColor(status);
|
|
3071
|
+
const canPress = allowNavigation && index <= currentStep;
|
|
3072
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3073
|
+
TouchableOpacity15,
|
|
3074
|
+
{
|
|
3075
|
+
key: step.id,
|
|
3076
|
+
onPress: () => handleStepPress(index),
|
|
3077
|
+
disabled: !canPress,
|
|
3078
|
+
activeOpacity: 0.8,
|
|
3079
|
+
style: styles21.numberStepContainer
|
|
3080
|
+
},
|
|
3081
|
+
/* @__PURE__ */ React26.createElement(VStack, { align: "center", spacing: 4 }, /* @__PURE__ */ React26.createElement(
|
|
3082
|
+
View24,
|
|
3083
|
+
{
|
|
3084
|
+
style: [
|
|
3085
|
+
styles21.numberCircle,
|
|
3086
|
+
{
|
|
3087
|
+
backgroundColor: colors.background,
|
|
3088
|
+
borderColor: colors.border
|
|
3089
|
+
},
|
|
3090
|
+
canPress && styles21.clickableNumber
|
|
3091
|
+
]
|
|
3092
|
+
},
|
|
3093
|
+
/* @__PURE__ */ React26.createElement(Typography, { variant: "body", style: { color: colors.text, fontWeight: "600" } }, status === "completed" ? "\u2713" : index + 1)
|
|
3094
|
+
), showLabels && /* @__PURE__ */ React26.createElement(
|
|
3095
|
+
Typography,
|
|
3096
|
+
{
|
|
3097
|
+
variant: "caption",
|
|
3098
|
+
style: {
|
|
3099
|
+
color: status === "active" ? theme.colors.foreground : theme.colors["muted-foreground"],
|
|
3100
|
+
fontWeight: status === "active" ? "600" : "400",
|
|
3101
|
+
textAlign: "center",
|
|
3102
|
+
maxWidth: 80
|
|
3103
|
+
},
|
|
3104
|
+
numberOfLines: 1
|
|
3105
|
+
},
|
|
3106
|
+
step.title
|
|
3107
|
+
), showDescriptions && step.description && /* @__PURE__ */ React26.createElement(
|
|
3108
|
+
Typography,
|
|
3109
|
+
{
|
|
3110
|
+
variant: "caption",
|
|
3111
|
+
style: {
|
|
3112
|
+
color: theme.colors["muted-foreground"],
|
|
3113
|
+
fontSize: 10,
|
|
3114
|
+
textAlign: "center",
|
|
3115
|
+
maxWidth: 80
|
|
3116
|
+
},
|
|
3117
|
+
numberOfLines: 1
|
|
3118
|
+
},
|
|
3119
|
+
step.description
|
|
3120
|
+
), step.optional && /* @__PURE__ */ React26.createElement(
|
|
3121
|
+
Typography,
|
|
3122
|
+
{
|
|
3123
|
+
variant: "caption",
|
|
3124
|
+
style: {
|
|
3125
|
+
color: theme.colors["muted-foreground"],
|
|
3126
|
+
fontSize: 10,
|
|
3127
|
+
fontStyle: "italic"
|
|
3128
|
+
}
|
|
3129
|
+
},
|
|
3130
|
+
"(Optional)"
|
|
3131
|
+
))
|
|
3132
|
+
);
|
|
3133
|
+
}));
|
|
3134
|
+
const renderBar = () => /* @__PURE__ */ React26.createElement(VStack, { spacing: 8, style: styles21.barContainer }, /* @__PURE__ */ React26.createElement(ProgressBar, { progress, showLabel: false, size: "md" }), showLabels && /* @__PURE__ */ React26.createElement(HStack, { justify: "space-between" }, /* @__PURE__ */ React26.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, "Step ", currentStep + 1, " of ", steps.length), /* @__PURE__ */ React26.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, Math.round(progress), "%")), showLabels && /* @__PURE__ */ React26.createElement(
|
|
3135
|
+
Typography,
|
|
3136
|
+
{
|
|
3137
|
+
variant: "body",
|
|
3138
|
+
style: { color: theme.colors.foreground, textAlign: "center", marginTop: 4 }
|
|
3139
|
+
},
|
|
3140
|
+
steps[currentStep]?.title
|
|
3141
|
+
), showDescriptions && steps[currentStep]?.description && /* @__PURE__ */ React26.createElement(
|
|
3142
|
+
Typography,
|
|
3143
|
+
{
|
|
3144
|
+
variant: "caption",
|
|
3145
|
+
style: { color: theme.colors["muted-foreground"], textAlign: "center" }
|
|
3146
|
+
},
|
|
3147
|
+
steps[currentStep].description
|
|
3148
|
+
));
|
|
3149
|
+
return /* @__PURE__ */ React26.createElement(View24, { style: [styles21.container, style] }, variant === "dots" && renderDots(), variant === "numbers" && renderNumbers(), variant === "bar" && renderBar());
|
|
3150
|
+
};
|
|
3151
|
+
var styles21 = StyleSheet21.create({
|
|
3152
|
+
container: {
|
|
3153
|
+
width: "100%"
|
|
3154
|
+
},
|
|
3155
|
+
dotsContainer: {
|
|
3156
|
+
paddingVertical: 8
|
|
3157
|
+
},
|
|
3158
|
+
dot: {
|
|
3159
|
+
width: 12,
|
|
3160
|
+
height: 12,
|
|
3161
|
+
borderRadius: 6,
|
|
3162
|
+
borderWidth: 1,
|
|
3163
|
+
alignItems: "center",
|
|
3164
|
+
justifyContent: "center"
|
|
3165
|
+
},
|
|
3166
|
+
dotInner: {
|
|
3167
|
+
width: 8,
|
|
3168
|
+
height: 8,
|
|
3169
|
+
borderRadius: 4
|
|
3170
|
+
},
|
|
3171
|
+
clickableDot: {
|
|
3172
|
+
transform: [{ scale: 1.1 }]
|
|
3173
|
+
},
|
|
3174
|
+
numbersContainer: {
|
|
3175
|
+
paddingVertical: 8,
|
|
3176
|
+
flexWrap: "wrap"
|
|
3177
|
+
},
|
|
3178
|
+
numberStepContainer: {
|
|
3179
|
+
alignItems: "center"
|
|
3180
|
+
},
|
|
3181
|
+
numberCircle: {
|
|
3182
|
+
width: 36,
|
|
3183
|
+
height: 36,
|
|
3184
|
+
borderRadius: 18,
|
|
3185
|
+
borderWidth: 2,
|
|
3186
|
+
alignItems: "center",
|
|
3187
|
+
justifyContent: "center"
|
|
3188
|
+
},
|
|
3189
|
+
clickableNumber: {
|
|
3190
|
+
transform: [{ scale: 1.05 }]
|
|
3191
|
+
},
|
|
3192
|
+
barContainer: {
|
|
3193
|
+
paddingVertical: 8
|
|
3194
|
+
}
|
|
3195
|
+
});
|
|
3196
|
+
WizardProgress.displayName = "WizardProgress";
|
|
3197
|
+
|
|
3198
|
+
// src/components/molecules/QuizBlock.tsx
|
|
3199
|
+
import React27 from "react";
|
|
3200
|
+
import {
|
|
3201
|
+
View as View25,
|
|
3202
|
+
TouchableOpacity as TouchableOpacity16,
|
|
3203
|
+
StyleSheet as StyleSheet22
|
|
3204
|
+
} from "react-native";
|
|
3205
|
+
var QuizBlock = ({
|
|
3206
|
+
question,
|
|
3207
|
+
options,
|
|
3208
|
+
questionNumber,
|
|
3209
|
+
totalQuestions,
|
|
3210
|
+
category,
|
|
3211
|
+
difficulty,
|
|
3212
|
+
allowMultiple = false,
|
|
3213
|
+
showCorrectAnswer = false,
|
|
3214
|
+
selectedValues = [],
|
|
3215
|
+
onSelect,
|
|
3216
|
+
explanation,
|
|
3217
|
+
style,
|
|
3218
|
+
isLoading,
|
|
3219
|
+
error,
|
|
3220
|
+
entity,
|
|
3221
|
+
shuffle = false,
|
|
3222
|
+
showExplanation = false
|
|
3223
|
+
}) => {
|
|
3224
|
+
const theme = useTheme();
|
|
3225
|
+
const eventBus = useEventBus();
|
|
3226
|
+
const [selected, setSelected] = React27.useState(selectedValues);
|
|
3227
|
+
const [isAnswered, setIsAnswered] = React27.useState(false);
|
|
3228
|
+
React27.useEffect(() => {
|
|
3229
|
+
setSelected(selectedValues);
|
|
3230
|
+
}, [selectedValues]);
|
|
3231
|
+
const shuffledOptions = React27.useMemo(() => {
|
|
3232
|
+
if (!shuffle) return options;
|
|
3233
|
+
return [...options].sort(() => Math.random() - 0.5);
|
|
3234
|
+
}, [options, shuffle]);
|
|
3235
|
+
const getDifficultyColor = () => {
|
|
3236
|
+
switch (difficulty) {
|
|
3237
|
+
case "easy":
|
|
3238
|
+
return "success";
|
|
3239
|
+
case "medium":
|
|
3240
|
+
return "warning";
|
|
3241
|
+
case "hard":
|
|
3242
|
+
return "error";
|
|
3243
|
+
default:
|
|
3244
|
+
return "default";
|
|
3245
|
+
}
|
|
3246
|
+
};
|
|
3247
|
+
const getOptionStyle = (option) => {
|
|
3248
|
+
const isSelected = selected.includes(option.value);
|
|
3249
|
+
if (showCorrectAnswer && isAnswered) {
|
|
3250
|
+
if (option.correct) {
|
|
3251
|
+
return {
|
|
3252
|
+
backgroundColor: theme.colors.success,
|
|
3253
|
+
borderColor: theme.colors.success,
|
|
3254
|
+
textColor: theme.colors["success-foreground"]
|
|
3255
|
+
};
|
|
3256
|
+
}
|
|
3257
|
+
if (isSelected && !option.correct) {
|
|
3258
|
+
return {
|
|
3259
|
+
backgroundColor: theme.colors.error,
|
|
3260
|
+
borderColor: theme.colors.error,
|
|
3261
|
+
textColor: theme.colors["error-foreground"]
|
|
3262
|
+
};
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
if (isSelected) {
|
|
3266
|
+
return {
|
|
3267
|
+
backgroundColor: theme.colors.primary,
|
|
3268
|
+
borderColor: theme.colors.primary,
|
|
3269
|
+
textColor: theme.colors["primary-foreground"]
|
|
3270
|
+
};
|
|
3271
|
+
}
|
|
3272
|
+
return {
|
|
3273
|
+
backgroundColor: theme.colors.card,
|
|
3274
|
+
borderColor: theme.colors.border,
|
|
3275
|
+
textColor: theme.colors.foreground
|
|
3276
|
+
};
|
|
3277
|
+
};
|
|
3278
|
+
const handleSelect = (option) => {
|
|
3279
|
+
if (showCorrectAnswer && isAnswered) return;
|
|
3280
|
+
let newSelected;
|
|
3281
|
+
if (allowMultiple) {
|
|
3282
|
+
newSelected = selected.includes(option.value) ? selected.filter((v) => v !== option.value) : [...selected, option.value];
|
|
3283
|
+
} else {
|
|
3284
|
+
newSelected = selected.includes(option.value) ? [] : [option.value];
|
|
3285
|
+
setIsAnswered(true);
|
|
3286
|
+
}
|
|
3287
|
+
setSelected(newSelected);
|
|
3288
|
+
eventBus.emit("UI:QUIZ_ANSWER", {
|
|
3289
|
+
question,
|
|
3290
|
+
selected: newSelected,
|
|
3291
|
+
correct: option.correct,
|
|
3292
|
+
entity
|
|
3293
|
+
});
|
|
3294
|
+
onSelect?.(newSelected);
|
|
3295
|
+
};
|
|
3296
|
+
const isCorrect = selected.length > 0 && selected.every((value) => {
|
|
3297
|
+
const option = options.find((o) => o.value === value);
|
|
3298
|
+
return option?.correct;
|
|
3299
|
+
}) && selected.length === options.filter((o) => o.correct).length;
|
|
3300
|
+
if (isLoading) {
|
|
3301
|
+
return /* @__PURE__ */ React27.createElement(View25, { style: [styles22.container, style] }, /* @__PURE__ */ React27.createElement(LoadingState, { message: "Loading question..." }));
|
|
3302
|
+
}
|
|
3303
|
+
if (error) {
|
|
3304
|
+
return /* @__PURE__ */ React27.createElement(View25, { style: [styles22.container, style] }, /* @__PURE__ */ React27.createElement(ErrorState, { message: error.message }));
|
|
3305
|
+
}
|
|
3306
|
+
return /* @__PURE__ */ React27.createElement(Card, { style: [styles22.container, style], padding: "lg" }, /* @__PURE__ */ React27.createElement(VStack, { spacing: 16 }, /* @__PURE__ */ React27.createElement(HStack, { justify: "space-between", align: "center" }, (questionNumber !== void 0 || category) && /* @__PURE__ */ React27.createElement(HStack, { spacing: 8, align: "center" }, questionNumber !== void 0 && totalQuestions !== void 0 && /* @__PURE__ */ React27.createElement(Badge, { variant: "secondary", size: "sm" }, questionNumber, " / ", totalQuestions), category && /* @__PURE__ */ React27.createElement(Badge, { variant: "default", size: "sm" }, category)), difficulty && /* @__PURE__ */ React27.createElement(Badge, { variant: getDifficultyColor(), size: "sm" }, difficulty)), /* @__PURE__ */ React27.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, question), allowMultiple && /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, "Select all that apply"), /* @__PURE__ */ React27.createElement(VStack, { spacing: 8 }, shuffledOptions.map((option) => {
|
|
3307
|
+
const style2 = getOptionStyle(option);
|
|
3308
|
+
const isSelected = selected.includes(option.value);
|
|
3309
|
+
return /* @__PURE__ */ React27.createElement(
|
|
3310
|
+
TouchableOpacity16,
|
|
3311
|
+
{
|
|
3312
|
+
key: option.id,
|
|
3313
|
+
onPress: () => handleSelect(option),
|
|
3314
|
+
activeOpacity: 0.8,
|
|
3315
|
+
style: [
|
|
3316
|
+
styles22.option,
|
|
3317
|
+
{
|
|
3318
|
+
backgroundColor: style2.backgroundColor,
|
|
3319
|
+
borderColor: style2.borderColor
|
|
3320
|
+
}
|
|
3321
|
+
]
|
|
3322
|
+
},
|
|
3323
|
+
/* @__PURE__ */ React27.createElement(HStack, { spacing: 12, align: "center" }, /* @__PURE__ */ React27.createElement(
|
|
3324
|
+
View25,
|
|
3325
|
+
{
|
|
3326
|
+
style: [
|
|
3327
|
+
styles22.checkbox,
|
|
3328
|
+
{
|
|
3329
|
+
borderColor: isSelected ? style2.textColor : theme.colors.border,
|
|
3330
|
+
backgroundColor: isSelected ? style2.textColor : "transparent"
|
|
3331
|
+
},
|
|
3332
|
+
allowMultiple ? styles22.checkboxSquare : styles22.checkboxCircle
|
|
3333
|
+
]
|
|
3334
|
+
},
|
|
3335
|
+
isSelected && /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: style2.backgroundColor, fontWeight: "700" } }, "\u2713")
|
|
3336
|
+
), /* @__PURE__ */ React27.createElement(Typography, { variant: "body", style: { color: style2.textColor, flex: 1 } }, option.label), showCorrectAnswer && isAnswered && option.correct && /* @__PURE__ */ React27.createElement(Badge, { variant: "success", size: "sm" }, "Correct"))
|
|
3337
|
+
);
|
|
3338
|
+
})), showCorrectAnswer && isAnswered && /* @__PURE__ */ React27.createElement(View25, { style: styles22.resultContainer }, /* @__PURE__ */ React27.createElement(Badge, { variant: isCorrect ? "success" : "error", size: "md" }, isCorrect ? "Correct!" : "Incorrect")), (showExplanation || showCorrectAnswer && isAnswered) && (explanation || options.some((o) => o.explanation && selected.includes(o.value))) && /* @__PURE__ */ React27.createElement(View25, { style: [styles22.explanationContainer, { backgroundColor: theme.colors.muted }] }, /* @__PURE__ */ React27.createElement(Typography, { variant: "caption", style: { color: theme.colors["muted-foreground"] } }, explanation || options.find((o) => o.explanation && selected.includes(o.value))?.explanation))));
|
|
3339
|
+
};
|
|
3340
|
+
var styles22 = StyleSheet22.create({
|
|
3341
|
+
container: {
|
|
3342
|
+
width: "100%"
|
|
3343
|
+
},
|
|
3344
|
+
option: {
|
|
3345
|
+
padding: 16,
|
|
3346
|
+
borderRadius: 8,
|
|
3347
|
+
borderWidth: 1
|
|
3348
|
+
},
|
|
3349
|
+
checkbox: {
|
|
3350
|
+
width: 24,
|
|
3351
|
+
height: 24,
|
|
3352
|
+
borderWidth: 2,
|
|
3353
|
+
alignItems: "center",
|
|
3354
|
+
justifyContent: "center"
|
|
3355
|
+
},
|
|
3356
|
+
checkboxSquare: {
|
|
3357
|
+
borderRadius: 4
|
|
3358
|
+
},
|
|
3359
|
+
checkboxCircle: {
|
|
3360
|
+
borderRadius: 12
|
|
3361
|
+
},
|
|
3362
|
+
resultContainer: {
|
|
3363
|
+
alignItems: "center",
|
|
3364
|
+
paddingVertical: 8
|
|
3365
|
+
},
|
|
3366
|
+
explanationContainer: {
|
|
3367
|
+
padding: 12,
|
|
3368
|
+
borderRadius: 8,
|
|
3369
|
+
marginTop: 8
|
|
3370
|
+
}
|
|
3371
|
+
});
|
|
3372
|
+
QuizBlock.displayName = "QuizBlock";
|
|
3373
|
+
|
|
3374
|
+
// src/components/molecules/game/ActionButtons.tsx
|
|
3375
|
+
import React28, { useState as useState6, useCallback as useCallback3 } from "react";
|
|
3376
|
+
import { View as View26, StyleSheet as StyleSheet23 } from "react-native";
|
|
3377
|
+
var sizeMap = {
|
|
3378
|
+
sm: "sm",
|
|
3379
|
+
md: "md",
|
|
3380
|
+
lg: "lg"
|
|
3381
|
+
};
|
|
3382
|
+
var ActionButtons = ({
|
|
3383
|
+
buttons,
|
|
3384
|
+
onAction,
|
|
3385
|
+
actionEvent,
|
|
3386
|
+
layout = "horizontal",
|
|
3387
|
+
size = "md",
|
|
3388
|
+
style,
|
|
3389
|
+
disabled
|
|
3390
|
+
}) => {
|
|
3391
|
+
const eventBus = useEventBus();
|
|
3392
|
+
const [activeButtons, setActiveButtons] = useState6(/* @__PURE__ */ new Set());
|
|
3393
|
+
const handlePress = useCallback3(
|
|
3394
|
+
(id) => {
|
|
3395
|
+
setActiveButtons((prev) => new Set(prev).add(id));
|
|
3396
|
+
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
3397
|
+
onAction?.(id, true);
|
|
3398
|
+
},
|
|
3399
|
+
[actionEvent, eventBus, onAction]
|
|
3400
|
+
);
|
|
3401
|
+
const handleRelease = useCallback3(
|
|
3402
|
+
(id) => {
|
|
3403
|
+
setActiveButtons((prev) => {
|
|
3404
|
+
const next = new Set(prev);
|
|
3405
|
+
next.delete(id);
|
|
3406
|
+
return next;
|
|
3407
|
+
});
|
|
3408
|
+
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: false });
|
|
3409
|
+
onAction?.(id, false);
|
|
3410
|
+
},
|
|
3411
|
+
[actionEvent, eventBus, onAction]
|
|
3412
|
+
);
|
|
3413
|
+
const buttonSize = sizeMap[size] ?? "md";
|
|
3414
|
+
if (layout === "diamond" && buttons.length === 4) {
|
|
3415
|
+
const [top, right, bottom, left] = buttons;
|
|
3416
|
+
return /* @__PURE__ */ React28.createElement(View26, { style: [styles23.diamondContainer, style] }, /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondEmpty }), /* @__PURE__ */ React28.createElement(
|
|
3417
|
+
ControlButton,
|
|
3418
|
+
{
|
|
3419
|
+
icon: top.icon,
|
|
3420
|
+
label: top.label,
|
|
3421
|
+
size: buttonSize,
|
|
3422
|
+
variant: top.variant,
|
|
3423
|
+
pressed: activeButtons.has(top.id),
|
|
3424
|
+
onPress: () => handlePress(top.id),
|
|
3425
|
+
onRelease: () => handleRelease(top.id),
|
|
3426
|
+
disabled
|
|
3427
|
+
}
|
|
3428
|
+
), /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondEmpty })), /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React28.createElement(
|
|
3429
|
+
ControlButton,
|
|
3430
|
+
{
|
|
3431
|
+
icon: left.icon,
|
|
3432
|
+
label: left.label,
|
|
3433
|
+
size: buttonSize,
|
|
3434
|
+
variant: left.variant,
|
|
3435
|
+
pressed: activeButtons.has(left.id),
|
|
3436
|
+
onPress: () => handlePress(left.id),
|
|
3437
|
+
onRelease: () => handleRelease(left.id),
|
|
3438
|
+
disabled
|
|
3439
|
+
}
|
|
3440
|
+
), /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondCenter }), /* @__PURE__ */ React28.createElement(
|
|
3441
|
+
ControlButton,
|
|
3442
|
+
{
|
|
3443
|
+
icon: right.icon,
|
|
3444
|
+
label: right.label,
|
|
3445
|
+
size: buttonSize,
|
|
3446
|
+
variant: right.variant,
|
|
3447
|
+
pressed: activeButtons.has(right.id),
|
|
3448
|
+
onPress: () => handlePress(right.id),
|
|
3449
|
+
onRelease: () => handleRelease(right.id),
|
|
3450
|
+
disabled
|
|
3451
|
+
}
|
|
3452
|
+
)), /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondRow }, /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondEmpty }), /* @__PURE__ */ React28.createElement(
|
|
3453
|
+
ControlButton,
|
|
3454
|
+
{
|
|
3455
|
+
icon: bottom.icon,
|
|
3456
|
+
label: bottom.label,
|
|
3457
|
+
size: buttonSize,
|
|
3458
|
+
variant: bottom.variant,
|
|
3459
|
+
pressed: activeButtons.has(bottom.id),
|
|
3460
|
+
onPress: () => handlePress(bottom.id),
|
|
3461
|
+
onRelease: () => handleRelease(bottom.id),
|
|
3462
|
+
disabled
|
|
3463
|
+
}
|
|
3464
|
+
), /* @__PURE__ */ React28.createElement(View26, { style: styles23.diamondEmpty })));
|
|
3465
|
+
}
|
|
3466
|
+
const containerStyle = layout === "vertical" ? styles23.verticalContainer : styles23.horizontalContainer;
|
|
3467
|
+
return /* @__PURE__ */ React28.createElement(View26, { style: [containerStyle, style] }, buttons.map((button) => /* @__PURE__ */ React28.createElement(
|
|
3468
|
+
ControlButton,
|
|
3469
|
+
{
|
|
3470
|
+
key: button.id,
|
|
3471
|
+
icon: button.icon,
|
|
3472
|
+
label: button.label,
|
|
3473
|
+
size: buttonSize,
|
|
3474
|
+
variant: button.variant,
|
|
3475
|
+
pressed: activeButtons.has(button.id),
|
|
3476
|
+
onPress: () => handlePress(button.id),
|
|
3477
|
+
onRelease: () => handleRelease(button.id),
|
|
3478
|
+
disabled
|
|
3479
|
+
}
|
|
3480
|
+
)));
|
|
3481
|
+
};
|
|
3482
|
+
var styles23 = StyleSheet23.create({
|
|
3483
|
+
horizontalContainer: {
|
|
3484
|
+
flexDirection: "row",
|
|
3485
|
+
gap: 8
|
|
3486
|
+
},
|
|
3487
|
+
verticalContainer: {
|
|
3488
|
+
flexDirection: "column",
|
|
3489
|
+
gap: 8
|
|
3490
|
+
},
|
|
3491
|
+
diamondContainer: {
|
|
3492
|
+
gap: 4
|
|
3493
|
+
},
|
|
3494
|
+
diamondRow: {
|
|
3495
|
+
flexDirection: "row",
|
|
3496
|
+
justifyContent: "center",
|
|
3497
|
+
alignItems: "center",
|
|
3498
|
+
gap: 4
|
|
3499
|
+
},
|
|
3500
|
+
diamondEmpty: {
|
|
3501
|
+
width: 56,
|
|
3502
|
+
height: 56
|
|
3503
|
+
},
|
|
3504
|
+
diamondCenter: {
|
|
3505
|
+
width: 24,
|
|
3506
|
+
height: 24,
|
|
3507
|
+
borderRadius: 12,
|
|
3508
|
+
backgroundColor: "#374151",
|
|
3509
|
+
borderWidth: 2,
|
|
3510
|
+
borderColor: "#4b5563"
|
|
3511
|
+
}
|
|
3512
|
+
});
|
|
3513
|
+
ActionButtons.displayName = "ActionButtons";
|
|
3514
|
+
|
|
3515
|
+
// src/components/molecules/game/DPad.tsx
|
|
3516
|
+
import React29, { useState as useState7, useCallback as useCallback4 } from "react";
|
|
3517
|
+
import { View as View27, StyleSheet as StyleSheet24 } from "react-native";
|
|
3518
|
+
var sizeMap2 = {
|
|
3519
|
+
sm: { button: "sm", containerWidth: 112 },
|
|
3520
|
+
md: { button: "md", containerWidth: 160 },
|
|
3521
|
+
lg: { button: "lg", containerWidth: 208 }
|
|
3522
|
+
};
|
|
3523
|
+
var arrowIcons = {
|
|
3524
|
+
up: "\u25B2",
|
|
3525
|
+
down: "\u25BC",
|
|
3526
|
+
left: "\u25C0",
|
|
3527
|
+
right: "\u25B6"
|
|
3528
|
+
};
|
|
3529
|
+
var DPad = ({
|
|
3530
|
+
onDirection,
|
|
3531
|
+
directionEvent,
|
|
3532
|
+
size = "md",
|
|
3533
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3534
|
+
includeDiagonals = false,
|
|
3535
|
+
style,
|
|
3536
|
+
disabled
|
|
3537
|
+
}) => {
|
|
3538
|
+
const eventBus = useEventBus();
|
|
3539
|
+
const sizes = sizeMap2[size];
|
|
3540
|
+
const [activeDirections, setActiveDirections] = useState7(/* @__PURE__ */ new Set());
|
|
3541
|
+
const handlePress = useCallback4(
|
|
3542
|
+
(direction) => {
|
|
3543
|
+
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
3544
|
+
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
3545
|
+
onDirection?.(direction, true);
|
|
3546
|
+
},
|
|
3547
|
+
[directionEvent, eventBus, onDirection]
|
|
3548
|
+
);
|
|
3549
|
+
const handleRelease = useCallback4(
|
|
3550
|
+
(direction) => {
|
|
3551
|
+
setActiveDirections((prev) => {
|
|
3552
|
+
const next = new Set(prev);
|
|
3553
|
+
next.delete(direction);
|
|
3554
|
+
return next;
|
|
3555
|
+
});
|
|
3556
|
+
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: false });
|
|
3557
|
+
onDirection?.(direction, false);
|
|
3558
|
+
},
|
|
3559
|
+
[directionEvent, eventBus, onDirection]
|
|
3560
|
+
);
|
|
3561
|
+
const createButton = (direction) => /* @__PURE__ */ React29.createElement(
|
|
3562
|
+
ControlButton,
|
|
3563
|
+
{
|
|
3564
|
+
key: direction,
|
|
3565
|
+
icon: arrowIcons[direction],
|
|
3566
|
+
size: sizes.button,
|
|
3567
|
+
variant: "secondary",
|
|
3568
|
+
pressed: activeDirections.has(direction),
|
|
3569
|
+
onPress: () => handlePress(direction),
|
|
3570
|
+
onRelease: () => handleRelease(direction),
|
|
3571
|
+
disabled
|
|
3572
|
+
}
|
|
3573
|
+
);
|
|
3574
|
+
return /* @__PURE__ */ React29.createElement(View27, { style: [styles24.container, { width: sizes.containerWidth }, style] }, /* @__PURE__ */ React29.createElement(View27, { style: styles24.row }, /* @__PURE__ */ React29.createElement(View27, { style: styles24.empty }), createButton("up"), /* @__PURE__ */ React29.createElement(View27, { style: styles24.empty })), /* @__PURE__ */ React29.createElement(View27, { style: styles24.row }, createButton("left"), /* @__PURE__ */ React29.createElement(View27, { style: styles24.center }, /* @__PURE__ */ React29.createElement(View27, { style: styles24.centerDot })), createButton("right")), /* @__PURE__ */ React29.createElement(View27, { style: styles24.row }, /* @__PURE__ */ React29.createElement(View27, { style: styles24.empty }), createButton("down"), /* @__PURE__ */ React29.createElement(View27, { style: styles24.empty })));
|
|
3575
|
+
};
|
|
3576
|
+
var styles24 = StyleSheet24.create({
|
|
3577
|
+
container: {
|
|
3578
|
+
gap: 4
|
|
3579
|
+
},
|
|
3580
|
+
row: {
|
|
3581
|
+
flexDirection: "row",
|
|
3582
|
+
justifyContent: "center",
|
|
3583
|
+
alignItems: "center",
|
|
3584
|
+
gap: 4
|
|
3585
|
+
},
|
|
3586
|
+
empty: {
|
|
3587
|
+
width: 56,
|
|
3588
|
+
height: 56
|
|
3589
|
+
},
|
|
3590
|
+
center: {
|
|
3591
|
+
width: 56,
|
|
3592
|
+
height: 56,
|
|
3593
|
+
justifyContent: "center",
|
|
3594
|
+
alignItems: "center"
|
|
3595
|
+
},
|
|
3596
|
+
centerDot: {
|
|
3597
|
+
width: 24,
|
|
3598
|
+
height: 24,
|
|
3599
|
+
borderRadius: 12,
|
|
3600
|
+
backgroundColor: "#374151",
|
|
3601
|
+
borderWidth: 2,
|
|
3602
|
+
borderColor: "#4b5563"
|
|
3603
|
+
}
|
|
3604
|
+
});
|
|
3605
|
+
DPad.displayName = "DPad";
|
|
3606
|
+
|
|
3607
|
+
// src/components/molecules/RepeatableFormSection.tsx
|
|
3608
|
+
import React30, { useState as useState8, useCallback as useCallback5 } from "react";
|
|
3609
|
+
import { View as View28, StyleSheet as StyleSheet25 } from "react-native";
|
|
3610
|
+
var RepeatableFormSection = ({
|
|
3611
|
+
style,
|
|
3612
|
+
isLoading,
|
|
3613
|
+
error,
|
|
3614
|
+
entity,
|
|
3615
|
+
title,
|
|
3616
|
+
description,
|
|
3617
|
+
minItems = 0,
|
|
3618
|
+
maxItems = 10,
|
|
3619
|
+
initialItems = [],
|
|
3620
|
+
renderItem,
|
|
3621
|
+
addButtonLabel = "Add Item",
|
|
3622
|
+
removeButtonLabel = "Remove",
|
|
3623
|
+
removeIcon = "\u2715",
|
|
3624
|
+
onChange,
|
|
3625
|
+
addEvent = "REPEATABLE_ADD",
|
|
3626
|
+
removeEvent = "REPEATABLE_REMOVE",
|
|
3627
|
+
updateEvent = "REPEATABLE_UPDATE"
|
|
3628
|
+
}) => {
|
|
3629
|
+
const theme = useTheme();
|
|
3630
|
+
const eventBus = useEventBus();
|
|
3631
|
+
const [items, setItems] = useState8(
|
|
3632
|
+
initialItems.length > 0 ? initialItems : minItems > 0 ? Array.from({ length: minItems }, (_, i) => ({
|
|
3633
|
+
id: `item-${Date.now()}-${i}`,
|
|
3634
|
+
data: {}
|
|
3635
|
+
})) : []
|
|
3636
|
+
);
|
|
3637
|
+
const generateId = useCallback5(() => {
|
|
3638
|
+
return `item-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3639
|
+
}, []);
|
|
3640
|
+
const handleAddItem = useCallback5(() => {
|
|
3641
|
+
if (items.length >= maxItems) {
|
|
3642
|
+
return;
|
|
3643
|
+
}
|
|
3644
|
+
const newItem = {
|
|
3645
|
+
id: generateId(),
|
|
3646
|
+
data: {}
|
|
3647
|
+
};
|
|
3648
|
+
const newItems = [...items, newItem];
|
|
3649
|
+
setItems(newItems);
|
|
3650
|
+
eventBus.emit(`UI:${addEvent}`, {
|
|
3651
|
+
entity,
|
|
3652
|
+
item: newItem,
|
|
3653
|
+
index: newItems.length - 1,
|
|
3654
|
+
totalItems: newItems.length
|
|
3655
|
+
});
|
|
3656
|
+
onChange?.(newItems);
|
|
3657
|
+
}, [items, maxItems, generateId, entity, addEvent, onChange, eventBus]);
|
|
3658
|
+
const handleRemoveItem = useCallback5((index) => {
|
|
3659
|
+
if (items.length <= minItems) {
|
|
3660
|
+
return;
|
|
3661
|
+
}
|
|
3662
|
+
const removedItem = items[index];
|
|
3663
|
+
const newItems = items.filter((_, i) => i !== index);
|
|
3664
|
+
setItems(newItems);
|
|
3665
|
+
eventBus.emit(`UI:${removeEvent}`, {
|
|
3666
|
+
entity,
|
|
3667
|
+
item: removedItem,
|
|
3668
|
+
index,
|
|
3669
|
+
totalItems: newItems.length
|
|
3670
|
+
});
|
|
3671
|
+
onChange?.(newItems);
|
|
3672
|
+
}, [items, minItems, entity, removeEvent, onChange, eventBus]);
|
|
3673
|
+
const handleUpdateItem = useCallback5((index, data) => {
|
|
3674
|
+
const newItems = items.map(
|
|
3675
|
+
(item, i) => i === index ? { ...item, data: { ...item.data, ...data } } : item
|
|
3676
|
+
);
|
|
3677
|
+
setItems(newItems);
|
|
3678
|
+
eventBus.emit(`UI:${updateEvent}`, {
|
|
3679
|
+
entity,
|
|
3680
|
+
item: newItems[index],
|
|
3681
|
+
index,
|
|
3682
|
+
data
|
|
3683
|
+
});
|
|
3684
|
+
onChange?.(newItems);
|
|
3685
|
+
}, [items, entity, updateEvent, onChange, eventBus]);
|
|
3686
|
+
const canAdd = items.length < maxItems;
|
|
3687
|
+
const canRemove = items.length > minItems;
|
|
3688
|
+
if (isLoading) {
|
|
3689
|
+
return /* @__PURE__ */ React30.createElement(View28, { style: { ...styles25.container, ...style || {} } }, /* @__PURE__ */ React30.createElement(LoadingState, { message: "Loading section..." }));
|
|
3690
|
+
}
|
|
3691
|
+
if (error) {
|
|
3692
|
+
return /* @__PURE__ */ React30.createElement(View28, { style: { ...styles25.container, ...style || {} } }, /* @__PURE__ */ React30.createElement(ErrorState, { message: error.message }));
|
|
3693
|
+
}
|
|
3694
|
+
return /* @__PURE__ */ React30.createElement(Card, { style: { ...styles25.container, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React30.createElement(VStack, { spacing: 24 }, (title || description) && /* @__PURE__ */ React30.createElement(VStack, { spacing: 4 }, title && /* @__PURE__ */ React30.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), description && /* @__PURE__ */ React30.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, description)), items.length === 0 ? /* @__PURE__ */ React30.createElement(EmptyState, { message: "No items yet. Click add to create one." }) : /* @__PURE__ */ React30.createElement(VStack, { spacing: 16 }, items.map((item, index) => /* @__PURE__ */ React30.createElement(
|
|
3695
|
+
View28,
|
|
3696
|
+
{
|
|
3697
|
+
key: item.id,
|
|
3698
|
+
style: {
|
|
3699
|
+
...styles25.itemContainer,
|
|
3700
|
+
borderColor: theme.colors.border
|
|
3701
|
+
}
|
|
3702
|
+
},
|
|
3703
|
+
/* @__PURE__ */ React30.createElement(VStack, { spacing: 12 }, /* @__PURE__ */ React30.createElement(HStack, { justify: "space-between", align: "center" }, /* @__PURE__ */ React30.createElement(Typography, { variant: "label", color: theme.colors["muted-foreground"] }, "Item ", index + 1), canRemove && /* @__PURE__ */ React30.createElement(
|
|
3704
|
+
Button,
|
|
3705
|
+
{
|
|
3706
|
+
variant: "ghost",
|
|
3707
|
+
size: "sm",
|
|
3708
|
+
onPress: () => handleRemoveItem(index),
|
|
3709
|
+
action: removeEvent,
|
|
3710
|
+
actionPayload: {
|
|
3711
|
+
entity,
|
|
3712
|
+
itemId: item.id,
|
|
3713
|
+
index
|
|
3714
|
+
}
|
|
3715
|
+
},
|
|
3716
|
+
removeIcon,
|
|
3717
|
+
" ",
|
|
3718
|
+
removeButtonLabel
|
|
3719
|
+
)), renderItem(item, index, {
|
|
3720
|
+
remove: () => handleRemoveItem(index),
|
|
3721
|
+
update: (data) => handleUpdateItem(index, data)
|
|
3722
|
+
}))
|
|
3723
|
+
))), canAdd && /* @__PURE__ */ React30.createElement(
|
|
3724
|
+
Button,
|
|
3725
|
+
{
|
|
3726
|
+
variant: "secondary",
|
|
3727
|
+
onPress: handleAddItem,
|
|
3728
|
+
action: addEvent,
|
|
3729
|
+
actionPayload: {
|
|
3730
|
+
entity,
|
|
3731
|
+
currentCount: items.length
|
|
3732
|
+
}
|
|
3733
|
+
},
|
|
3734
|
+
"+ ",
|
|
3735
|
+
addButtonLabel
|
|
3736
|
+
), /* @__PURE__ */ React30.createElement(
|
|
3737
|
+
Typography,
|
|
3738
|
+
{
|
|
3739
|
+
variant: "caption",
|
|
3740
|
+
color: theme.colors["muted-foreground"],
|
|
3741
|
+
style: { textAlign: "right" }
|
|
3742
|
+
},
|
|
3743
|
+
items.length,
|
|
3744
|
+
" / ",
|
|
3745
|
+
maxItems,
|
|
3746
|
+
" items"
|
|
3747
|
+
)));
|
|
3748
|
+
};
|
|
3749
|
+
var styles25 = StyleSheet25.create({
|
|
3750
|
+
container: {
|
|
3751
|
+
width: "100%"
|
|
3752
|
+
},
|
|
3753
|
+
itemContainer: {
|
|
3754
|
+
borderWidth: 1,
|
|
3755
|
+
borderRadius: 8,
|
|
3756
|
+
padding: 16
|
|
3757
|
+
}
|
|
3758
|
+
});
|
|
3759
|
+
RepeatableFormSection.displayName = "RepeatableFormSection";
|
|
3760
|
+
|
|
3761
|
+
// src/components/molecules/ScaledDiagram.tsx
|
|
3762
|
+
import React31, { useRef as useRef4, useState as useState9, useCallback as useCallback6 } from "react";
|
|
3763
|
+
import {
|
|
3764
|
+
View as View29,
|
|
3765
|
+
StyleSheet as StyleSheet26,
|
|
3766
|
+
Animated as Animated4,
|
|
3767
|
+
PanResponder,
|
|
3768
|
+
Dimensions as Dimensions3,
|
|
3769
|
+
TouchableOpacity as TouchableOpacity17
|
|
3770
|
+
} from "react-native";
|
|
3771
|
+
var { width: SCREEN_WIDTH2 } = Dimensions3.get("window");
|
|
3772
|
+
var ScaledDiagram = ({
|
|
3773
|
+
style,
|
|
3774
|
+
isLoading,
|
|
3775
|
+
error,
|
|
3776
|
+
entity,
|
|
3777
|
+
children,
|
|
3778
|
+
contentWidth = 800,
|
|
3779
|
+
contentHeight = 600,
|
|
3780
|
+
width = SCREEN_WIDTH2 - 32,
|
|
3781
|
+
height = 400,
|
|
3782
|
+
initialScale = 1,
|
|
3783
|
+
minScale = 0.5,
|
|
3784
|
+
maxScale = 3,
|
|
3785
|
+
enablePan = true,
|
|
3786
|
+
enableZoom = true,
|
|
3787
|
+
showControls = true,
|
|
3788
|
+
title,
|
|
3789
|
+
enableDoubleTap = true,
|
|
3790
|
+
eventPrefix = "DIAGRAM"
|
|
3791
|
+
}) => {
|
|
3792
|
+
const theme = useTheme();
|
|
3793
|
+
const eventBus = useEventBus();
|
|
3794
|
+
const scale = useRef4(new Animated4.Value(initialScale)).current;
|
|
3795
|
+
const translateX = useRef4(new Animated4.Value(0)).current;
|
|
3796
|
+
const translateY = useRef4(new Animated4.Value(0)).current;
|
|
3797
|
+
const [currentScale, setCurrentScale] = useState9(initialScale);
|
|
3798
|
+
const lastTranslate = useRef4({ x: 0, y: 0 });
|
|
3799
|
+
const clamp = useCallback6((value, min, max) => {
|
|
3800
|
+
return Math.min(Math.max(value, min), max);
|
|
3801
|
+
}, []);
|
|
3802
|
+
const getBounds = useCallback6((newScale) => {
|
|
3803
|
+
const scaledWidth = contentWidth * newScale;
|
|
3804
|
+
const scaledHeight = contentHeight * newScale;
|
|
3805
|
+
const maxX = Math.max(0, (scaledWidth - width) / 2);
|
|
3806
|
+
const maxY = Math.max(0, (scaledHeight - height) / 2);
|
|
3807
|
+
return { maxX, maxY };
|
|
3808
|
+
}, [contentWidth, contentHeight, width, height]);
|
|
3809
|
+
const handleZoomIn = useCallback6(() => {
|
|
3810
|
+
if (!enableZoom) return;
|
|
3811
|
+
const newScale = clamp(currentScale * 1.25, minScale, maxScale);
|
|
3812
|
+
setCurrentScale(newScale);
|
|
3813
|
+
Animated4.spring(scale, {
|
|
3814
|
+
toValue: newScale,
|
|
3815
|
+
useNativeDriver: true,
|
|
3816
|
+
friction: 8
|
|
3817
|
+
}).start();
|
|
3818
|
+
eventBus.emit(`UI:${eventPrefix}_ZOOM_IN`, {
|
|
3819
|
+
entity,
|
|
3820
|
+
scale: newScale
|
|
3821
|
+
});
|
|
3822
|
+
}, [currentScale, minScale, maxScale, enableZoom, entity, eventPrefix, scale, eventBus, clamp]);
|
|
3823
|
+
const handleZoomOut = useCallback6(() => {
|
|
3824
|
+
if (!enableZoom) return;
|
|
3825
|
+
const newScale = clamp(currentScale / 1.25, minScale, maxScale);
|
|
3826
|
+
setCurrentScale(newScale);
|
|
3827
|
+
if (newScale <= initialScale) {
|
|
3828
|
+
lastTranslate.current = { x: 0, y: 0 };
|
|
3829
|
+
Animated4.parallel([
|
|
3830
|
+
Animated4.spring(translateX, {
|
|
3831
|
+
toValue: 0,
|
|
3832
|
+
useNativeDriver: true,
|
|
3833
|
+
friction: 8
|
|
3834
|
+
}),
|
|
3835
|
+
Animated4.spring(translateY, {
|
|
3836
|
+
toValue: 0,
|
|
3837
|
+
useNativeDriver: true,
|
|
3838
|
+
friction: 8
|
|
3839
|
+
})
|
|
3840
|
+
]).start();
|
|
3841
|
+
}
|
|
3842
|
+
Animated4.spring(scale, {
|
|
3843
|
+
toValue: newScale,
|
|
3844
|
+
useNativeDriver: true,
|
|
3845
|
+
friction: 8
|
|
3846
|
+
}).start();
|
|
3847
|
+
eventBus.emit(`UI:${eventPrefix}_ZOOM_OUT`, {
|
|
3848
|
+
entity,
|
|
3849
|
+
scale: newScale
|
|
3850
|
+
});
|
|
3851
|
+
}, [currentScale, minScale, maxScale, initialScale, enableZoom, entity, eventPrefix, scale, translateX, translateY, eventBus, clamp]);
|
|
3852
|
+
const handleReset = useCallback6(() => {
|
|
3853
|
+
setCurrentScale(initialScale);
|
|
3854
|
+
lastTranslate.current = { x: 0, y: 0 };
|
|
3855
|
+
Animated4.parallel([
|
|
3856
|
+
Animated4.spring(scale, {
|
|
3857
|
+
toValue: initialScale,
|
|
3858
|
+
useNativeDriver: true,
|
|
3859
|
+
friction: 8
|
|
3860
|
+
}),
|
|
3861
|
+
Animated4.spring(translateX, {
|
|
3862
|
+
toValue: 0,
|
|
3863
|
+
useNativeDriver: true,
|
|
3864
|
+
friction: 8
|
|
3865
|
+
}),
|
|
3866
|
+
Animated4.spring(translateY, {
|
|
3867
|
+
toValue: 0,
|
|
3868
|
+
useNativeDriver: true,
|
|
3869
|
+
friction: 8
|
|
3870
|
+
})
|
|
3871
|
+
]).start();
|
|
3872
|
+
eventBus.emit(`UI:${eventPrefix}_RESET`, {
|
|
3873
|
+
entity,
|
|
3874
|
+
scale: initialScale
|
|
3875
|
+
});
|
|
3876
|
+
}, [initialScale, entity, eventPrefix, scale, translateX, translateY, eventBus]);
|
|
3877
|
+
const handleDoubleTap = useCallback6(() => {
|
|
3878
|
+
if (!enableDoubleTap) return;
|
|
3879
|
+
if (currentScale > initialScale) {
|
|
3880
|
+
handleReset();
|
|
3881
|
+
} else {
|
|
3882
|
+
const newScale = clamp(currentScale * 2, minScale, maxScale);
|
|
3883
|
+
setCurrentScale(newScale);
|
|
3884
|
+
Animated4.spring(scale, {
|
|
3885
|
+
toValue: newScale,
|
|
3886
|
+
useNativeDriver: true,
|
|
3887
|
+
friction: 8
|
|
3888
|
+
}).start();
|
|
3889
|
+
}
|
|
3890
|
+
}, [currentScale, initialScale, enableDoubleTap, minScale, maxScale, handleReset, scale, clamp]);
|
|
3891
|
+
const panResponder = useRef4(
|
|
3892
|
+
PanResponder.create({
|
|
3893
|
+
onStartShouldSetPanResponder: () => enablePan,
|
|
3894
|
+
onMoveShouldSetPanResponder: () => enablePan && currentScale > 1,
|
|
3895
|
+
onPanResponderGrant: () => {
|
|
3896
|
+
lastTranslate.current = {
|
|
3897
|
+
x: 0,
|
|
3898
|
+
y: 0
|
|
3899
|
+
};
|
|
3900
|
+
},
|
|
3901
|
+
onPanResponderMove: (_event, gestureState) => {
|
|
3902
|
+
if (!enablePan || currentScale <= 1) return;
|
|
3903
|
+
const { maxX, maxY } = getBounds(currentScale);
|
|
3904
|
+
const newX = clamp(
|
|
3905
|
+
gestureState.dx,
|
|
3906
|
+
-maxX - lastTranslate.current.x,
|
|
3907
|
+
maxX - lastTranslate.current.x
|
|
3908
|
+
);
|
|
3909
|
+
const newY = clamp(
|
|
3910
|
+
gestureState.dy,
|
|
3911
|
+
-maxY - lastTranslate.current.y,
|
|
3912
|
+
maxY - lastTranslate.current.y
|
|
3913
|
+
);
|
|
3914
|
+
translateX.setValue(newX);
|
|
3915
|
+
translateY.setValue(newY);
|
|
3916
|
+
},
|
|
3917
|
+
onPanResponderRelease: (_event, gestureState) => {
|
|
3918
|
+
if (!enablePan || currentScale <= 1) return;
|
|
3919
|
+
const { maxX, maxY } = getBounds(currentScale);
|
|
3920
|
+
lastTranslate.current.x = clamp(
|
|
3921
|
+
lastTranslate.current.x + gestureState.dx,
|
|
3922
|
+
-maxX,
|
|
3923
|
+
maxX
|
|
3924
|
+
);
|
|
3925
|
+
lastTranslate.current.y = clamp(
|
|
3926
|
+
lastTranslate.current.y + gestureState.dy,
|
|
3927
|
+
-maxY,
|
|
3928
|
+
maxY
|
|
3929
|
+
);
|
|
3930
|
+
translateX.setOffset(lastTranslate.current.x);
|
|
3931
|
+
translateX.setValue(0);
|
|
3932
|
+
translateY.setOffset(lastTranslate.current.y);
|
|
3933
|
+
translateY.setValue(0);
|
|
3934
|
+
eventBus.emit(`UI:${eventPrefix}_PAN`, {
|
|
3935
|
+
entity,
|
|
3936
|
+
x: lastTranslate.current.x,
|
|
3937
|
+
y: lastTranslate.current.y,
|
|
3938
|
+
scale: currentScale
|
|
3939
|
+
});
|
|
3940
|
+
}
|
|
3941
|
+
})
|
|
3942
|
+
).current;
|
|
3943
|
+
if (isLoading) {
|
|
3944
|
+
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(LoadingState, { message: "Loading diagram..." }));
|
|
3945
|
+
}
|
|
3946
|
+
if (error) {
|
|
3947
|
+
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(ErrorState, { message: error.message }));
|
|
3948
|
+
}
|
|
3949
|
+
if (!children) {
|
|
3950
|
+
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, height, ...style || {} }, padding: "lg" }, /* @__PURE__ */ React31.createElement(EmptyState, { message: "No diagram content" }));
|
|
3951
|
+
}
|
|
3952
|
+
const animatedStyle = {
|
|
3953
|
+
transform: [
|
|
3954
|
+
{ scale },
|
|
3955
|
+
{ translateX },
|
|
3956
|
+
{ translateY }
|
|
3957
|
+
]
|
|
3958
|
+
};
|
|
3959
|
+
return /* @__PURE__ */ React31.createElement(Card, { style: { ...styles26.container, width, ...style || {} }, padding: "md" }, /* @__PURE__ */ React31.createElement(VStack, { spacing: 12 }, (title || showControls) && /* @__PURE__ */ React31.createElement(HStack, { justify: "space-between", align: "center" }, title && /* @__PURE__ */ React31.createElement(Typography, { variant: "h4", style: { color: theme.colors.foreground } }, title), showControls && /* @__PURE__ */ React31.createElement(HStack, { spacing: 8 }, /* @__PURE__ */ React31.createElement(
|
|
3960
|
+
Button,
|
|
3961
|
+
{
|
|
3962
|
+
variant: "ghost",
|
|
3963
|
+
size: "sm",
|
|
3964
|
+
onPress: handleZoomOut,
|
|
3965
|
+
disabled: !enableZoom || currentScale <= minScale
|
|
3966
|
+
},
|
|
3967
|
+
"\u2212"
|
|
3968
|
+
), /* @__PURE__ */ React31.createElement(Typography, { variant: "body", style: { minWidth: 50, textAlign: "center" } }, Math.round(currentScale * 100), "%"), /* @__PURE__ */ React31.createElement(
|
|
3969
|
+
Button,
|
|
3970
|
+
{
|
|
3971
|
+
variant: "ghost",
|
|
3972
|
+
size: "sm",
|
|
3973
|
+
onPress: handleZoomIn,
|
|
3974
|
+
disabled: !enableZoom || currentScale >= maxScale
|
|
3975
|
+
},
|
|
3976
|
+
"+"
|
|
3977
|
+
), /* @__PURE__ */ React31.createElement(
|
|
3978
|
+
Button,
|
|
3979
|
+
{
|
|
3980
|
+
variant: "ghost",
|
|
3981
|
+
size: "sm",
|
|
3982
|
+
onPress: handleReset
|
|
3983
|
+
},
|
|
3984
|
+
"\u27F2"
|
|
3985
|
+
))), /* @__PURE__ */ React31.createElement(
|
|
3986
|
+
View29,
|
|
3987
|
+
{
|
|
3988
|
+
style: [
|
|
3989
|
+
styles26.diagramContainer,
|
|
3990
|
+
{
|
|
3991
|
+
width,
|
|
3992
|
+
height,
|
|
3993
|
+
backgroundColor: theme.colors.muted
|
|
3994
|
+
}
|
|
3995
|
+
]
|
|
3996
|
+
},
|
|
3997
|
+
/* @__PURE__ */ React31.createElement(
|
|
3998
|
+
TouchableOpacity17,
|
|
3999
|
+
{
|
|
4000
|
+
activeOpacity: 1,
|
|
4001
|
+
onPress: handleDoubleTap,
|
|
4002
|
+
style: styles26.touchable
|
|
4003
|
+
},
|
|
4004
|
+
/* @__PURE__ */ React31.createElement(
|
|
4005
|
+
Animated4.View,
|
|
4006
|
+
{
|
|
4007
|
+
style: [
|
|
4008
|
+
styles26.content,
|
|
4009
|
+
{
|
|
4010
|
+
width: contentWidth,
|
|
4011
|
+
height: contentHeight
|
|
4012
|
+
},
|
|
4013
|
+
animatedStyle
|
|
4014
|
+
],
|
|
4015
|
+
...panResponder.panHandlers
|
|
4016
|
+
},
|
|
4017
|
+
children
|
|
4018
|
+
)
|
|
4019
|
+
)
|
|
4020
|
+
), /* @__PURE__ */ React31.createElement(
|
|
4021
|
+
Typography,
|
|
4022
|
+
{
|
|
4023
|
+
variant: "caption",
|
|
4024
|
+
color: theme.colors["muted-foreground"],
|
|
4025
|
+
style: { textAlign: "center" }
|
|
4026
|
+
},
|
|
4027
|
+
"Scale: ",
|
|
4028
|
+
currentScale.toFixed(2),
|
|
4029
|
+
"x \u2022 Double-tap to ",
|
|
4030
|
+
currentScale > initialScale ? "reset" : "zoom"
|
|
4031
|
+
)));
|
|
4032
|
+
};
|
|
4033
|
+
var styles26 = StyleSheet26.create({
|
|
4034
|
+
container: {
|
|
4035
|
+
overflow: "hidden"
|
|
4036
|
+
},
|
|
4037
|
+
diagramContainer: {
|
|
4038
|
+
overflow: "hidden",
|
|
4039
|
+
borderRadius: 8
|
|
4040
|
+
},
|
|
4041
|
+
touchable: {
|
|
4042
|
+
flex: 1,
|
|
4043
|
+
justifyContent: "center",
|
|
4044
|
+
alignItems: "center"
|
|
4045
|
+
},
|
|
4046
|
+
content: {
|
|
4047
|
+
justifyContent: "center",
|
|
4048
|
+
alignItems: "center"
|
|
4049
|
+
}
|
|
4050
|
+
});
|
|
4051
|
+
ScaledDiagram.displayName = "ScaledDiagram";
|
|
4052
|
+
|
|
4053
|
+
export {
|
|
4054
|
+
FormField,
|
|
4055
|
+
FormSectionHeader,
|
|
4056
|
+
InputGroup,
|
|
4057
|
+
Alert,
|
|
4058
|
+
Skeleton,
|
|
4059
|
+
SearchInput,
|
|
4060
|
+
Tooltip,
|
|
4061
|
+
Popover,
|
|
4062
|
+
Menu,
|
|
4063
|
+
Breadcrumb,
|
|
4064
|
+
ButtonGroup,
|
|
4065
|
+
ErrorBoundary,
|
|
4066
|
+
FloatingActionButton,
|
|
4067
|
+
Flex,
|
|
4068
|
+
SimpleGrid,
|
|
4069
|
+
Container,
|
|
4070
|
+
Grid,
|
|
4071
|
+
SidePanel,
|
|
4072
|
+
Navigation,
|
|
4073
|
+
RelationSelect,
|
|
4074
|
+
FilterGroup,
|
|
4075
|
+
Meter,
|
|
4076
|
+
Pagination,
|
|
4077
|
+
MarkdownContent,
|
|
4078
|
+
WizardNavigation,
|
|
4079
|
+
WizardProgress,
|
|
4080
|
+
QuizBlock,
|
|
4081
|
+
ActionButtons,
|
|
4082
|
+
DPad,
|
|
4083
|
+
RepeatableFormSection,
|
|
4084
|
+
ScaledDiagram
|
|
4085
|
+
};
|
|
4086
|
+
//# sourceMappingURL=chunk-YMJZLYLV.js.map
|