kynjal-cli 2.0.6
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/LICENSE +21 -0
- package/README.md +145 -0
- package/bin/kynjal.js +27 -0
- package/dist/commands/add.d.ts +11 -0
- package/dist/commands/add.js +295 -0
- package/dist/commands/convex.d.ts +11 -0
- package/dist/commands/convex.js +319 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.js +340 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +6 -0
- package/dist/registry/accordion.d.ts +139 -0
- package/dist/registry/accordion.js +164 -0
- package/dist/registry/accordion.ts +183 -0
- package/dist/registry/action-sheet.d.ts +138 -0
- package/dist/registry/action-sheet.js +164 -0
- package/dist/registry/action-sheet.ts +182 -0
- package/dist/registry/alert-dialog.d.ts +71 -0
- package/dist/registry/alert-dialog.js +88 -0
- package/dist/registry/alert-dialog.ts +97 -0
- package/dist/registry/alert.d.ts +172 -0
- package/dist/registry/alert.js +204 -0
- package/dist/registry/alert.ts +225 -0
- package/dist/registry/audio-player.d.ts +139 -0
- package/dist/registry/audio-player.js +165 -0
- package/dist/registry/audio-player.ts +183 -0
- package/dist/registry/audio-recorder.d.ts +156 -0
- package/dist/registry/audio-recorder.js +184 -0
- package/dist/registry/audio-recorder.ts +203 -0
- package/dist/registry/audio-waveform.d.ts +121 -0
- package/dist/registry/audio-waveform.js +144 -0
- package/dist/registry/audio-waveform.ts +165 -0
- package/dist/registry/avatar.d.ts +139 -0
- package/dist/registry/avatar.js +164 -0
- package/dist/registry/avatar.ts +172 -0
- package/dist/registry/avoid-keyboard.d.ts +128 -0
- package/dist/registry/avoid-keyboard.js +150 -0
- package/dist/registry/avoid-keyboard.ts +165 -0
- package/dist/registry/badge.d.ts +139 -0
- package/dist/registry/badge.js +164 -0
- package/dist/registry/badge.ts +172 -0
- package/dist/registry/bottom-sheet.d.ts +156 -0
- package/dist/registry/bottom-sheet.js +184 -0
- package/dist/registry/bottom-sheet.ts +203 -0
- package/dist/registry/button.d.ts +173 -0
- package/dist/registry/button.js +209 -0
- package/dist/registry/button.ts +230 -0
- package/dist/registry/camera-preview.d.ts +37 -0
- package/dist/registry/camera-preview.js +56 -0
- package/dist/registry/camera-preview.ts +61 -0
- package/dist/registry/camera.d.ts +139 -0
- package/dist/registry/camera.js +168 -0
- package/dist/registry/camera.ts +185 -0
- package/dist/registry/card.d.ts +139 -0
- package/dist/registry/card.js +165 -0
- package/dist/registry/card.ts +173 -0
- package/dist/registry/carousel.d.ts +140 -0
- package/dist/registry/carousel.js +169 -0
- package/dist/registry/carousel.ts +186 -0
- package/dist/registry/charts/area-chart.d.ts +88 -0
- package/dist/registry/charts/area-chart.js +106 -0
- package/dist/registry/charts/area-chart.ts +117 -0
- package/dist/registry/charts/bar-chart.d.ts +71 -0
- package/dist/registry/charts/bar-chart.js +85 -0
- package/dist/registry/charts/bar-chart.ts +94 -0
- package/dist/registry/charts/bubble-chart.d.ts +88 -0
- package/dist/registry/charts/bubble-chart.js +109 -0
- package/dist/registry/charts/bubble-chart.ts +120 -0
- package/dist/registry/charts/candlestick-chart.d.ts +88 -0
- package/dist/registry/charts/candlestick-chart.js +109 -0
- package/dist/registry/charts/candlestick-chart.ts +125 -0
- package/dist/registry/charts/chart-container.d.ts +54 -0
- package/dist/registry/charts/chart-container.js +62 -0
- package/dist/registry/charts/chart-container.ts +71 -0
- package/dist/registry/charts/column-chart.d.ts +88 -0
- package/dist/registry/charts/column-chart.js +106 -0
- package/dist/registry/charts/column-chart.ts +117 -0
- package/dist/registry/charts/doughnut-chart.d.ts +88 -0
- package/dist/registry/charts/doughnut-chart.js +106 -0
- package/dist/registry/charts/doughnut-chart.ts +121 -0
- package/dist/registry/charts/heatmap-chart.d.ts +88 -0
- package/dist/registry/charts/heatmap-chart.js +106 -0
- package/dist/registry/charts/heatmap-chart.ts +117 -0
- package/dist/registry/charts/index.d.ts +1499 -0
- package/dist/registry/charts/index.js +38 -0
- package/dist/registry/charts/index.ts +39 -0
- package/dist/registry/charts/line-chart.d.ts +88 -0
- package/dist/registry/charts/line-chart.js +109 -0
- package/dist/registry/charts/line-chart.ts +120 -0
- package/dist/registry/charts/pie-chart.d.ts +88 -0
- package/dist/registry/charts/pie-chart.js +106 -0
- package/dist/registry/charts/pie-chart.ts +117 -0
- package/dist/registry/charts/polar-area-chart.d.ts +88 -0
- package/dist/registry/charts/polar-area-chart.js +106 -0
- package/dist/registry/charts/polar-area-chart.ts +121 -0
- package/dist/registry/charts/progress-ring-chart.d.ts +88 -0
- package/dist/registry/charts/progress-ring-chart.js +106 -0
- package/dist/registry/charts/progress-ring-chart.ts +121 -0
- package/dist/registry/charts/radar-chart.d.ts +88 -0
- package/dist/registry/charts/radar-chart.js +106 -0
- package/dist/registry/charts/radar-chart.ts +117 -0
- package/dist/registry/charts/radial-bar-chart.d.ts +88 -0
- package/dist/registry/charts/radial-bar-chart.js +106 -0
- package/dist/registry/charts/radial-bar-chart.ts +121 -0
- package/dist/registry/charts/scatter-chart.d.ts +88 -0
- package/dist/registry/charts/scatter-chart.js +106 -0
- package/dist/registry/charts/scatter-chart.ts +117 -0
- package/dist/registry/charts/stacked-area-chart.d.ts +88 -0
- package/dist/registry/charts/stacked-area-chart.js +106 -0
- package/dist/registry/charts/stacked-area-chart.ts +123 -0
- package/dist/registry/charts/stacked-bar-chart.d.ts +88 -0
- package/dist/registry/charts/stacked-bar-chart.js +109 -0
- package/dist/registry/charts/stacked-bar-chart.ts +125 -0
- package/dist/registry/charts/treemap-chart.d.ts +88 -0
- package/dist/registry/charts/treemap-chart.js +106 -0
- package/dist/registry/charts/treemap-chart.ts +117 -0
- package/dist/registry/checkbox.d.ts +122 -0
- package/dist/registry/checkbox.js +145 -0
- package/dist/registry/checkbox.ts +160 -0
- package/dist/registry/collapsible.d.ts +105 -0
- package/dist/registry/collapsible.js +125 -0
- package/dist/registry/collapsible.ts +137 -0
- package/dist/registry/color-picker.d.ts +156 -0
- package/dist/registry/color-picker.js +186 -0
- package/dist/registry/color-picker.ts +205 -0
- package/dist/registry/combobox.d.ts +139 -0
- package/dist/registry/combobox.js +158 -0
- package/dist/registry/combobox.ts +170 -0
- package/dist/registry/date-picker.d.ts +156 -0
- package/dist/registry/date-picker.js +190 -0
- package/dist/registry/date-picker.ts +209 -0
- package/dist/registry/file-picker.d.ts +139 -0
- package/dist/registry/file-picker.js +158 -0
- package/dist/registry/file-picker.ts +175 -0
- package/dist/registry/gallery.d.ts +122 -0
- package/dist/registry/gallery.js +144 -0
- package/dist/registry/gallery.ts +160 -0
- package/dist/registry/hello-wave.d.ts +37 -0
- package/dist/registry/hello-wave.js +44 -0
- package/dist/registry/hello-wave.ts +49 -0
- package/dist/registry/hooks/index.d.ts +60 -0
- package/dist/registry/hooks/index.js +75 -0
- package/dist/registry/hooks/index.ts +80 -0
- package/dist/registry/icon.d.ts +139 -0
- package/dist/registry/icon.js +164 -0
- package/dist/registry/icon.ts +173 -0
- package/dist/registry/image.d.ts +156 -0
- package/dist/registry/image.js +180 -0
- package/dist/registry/image.ts +191 -0
- package/dist/registry/index.d.ts +12 -0
- package/dist/registry/index.js +189 -0
- package/dist/registry/index.ts +209 -0
- package/dist/registry/input-otp.d.ts +155 -0
- package/dist/registry/input-otp.js +178 -0
- package/dist/registry/input-otp.ts +197 -0
- package/dist/registry/input.d.ts +164 -0
- package/dist/registry/input.js +192 -0
- package/dist/registry/input.ts +211 -0
- package/dist/registry/link.d.ts +139 -0
- package/dist/registry/link.js +164 -0
- package/dist/registry/link.ts +181 -0
- package/dist/registry/media-picker.d.ts +145 -0
- package/dist/registry/media-picker.js +175 -0
- package/dist/registry/media-picker.ts +192 -0
- package/dist/registry/mode-toggle.d.ts +37 -0
- package/dist/registry/mode-toggle.js +44 -0
- package/dist/registry/mode-toggle.ts +49 -0
- package/dist/registry/onboarding.d.ts +144 -0
- package/dist/registry/onboarding.js +164 -0
- package/dist/registry/onboarding.ts +181 -0
- package/dist/registry/parallax-scrollview.d.ts +125 -0
- package/dist/registry/parallax-scrollview.js +147 -0
- package/dist/registry/parallax-scrollview.ts +168 -0
- package/dist/registry/picker.d.ts +157 -0
- package/dist/registry/picker.js +178 -0
- package/dist/registry/picker.ts +198 -0
- package/dist/registry/popover.d.ts +139 -0
- package/dist/registry/popover.js +164 -0
- package/dist/registry/popover.ts +181 -0
- package/dist/registry/progress.d.ts +139 -0
- package/dist/registry/progress.js +159 -0
- package/dist/registry/progress.ts +172 -0
- package/dist/registry/radio.d.ts +139 -0
- package/dist/registry/radio.js +164 -0
- package/dist/registry/radio.ts +181 -0
- package/dist/registry/schema/index.d.ts +26 -0
- package/dist/registry/schema/index.js +1 -0
- package/dist/registry/schema/index.ts +28 -0
- package/dist/registry/scroll-view.d.ts +156 -0
- package/dist/registry/scroll-view.js +184 -0
- package/dist/registry/scroll-view.ts +203 -0
- package/dist/registry/searchbar.d.ts +139 -0
- package/dist/registry/searchbar.js +164 -0
- package/dist/registry/searchbar.ts +181 -0
- package/dist/registry/separator.d.ts +105 -0
- package/dist/registry/separator.js +124 -0
- package/dist/registry/separator.ts +130 -0
- package/dist/registry/share.d.ts +156 -0
- package/dist/registry/share.js +183 -0
- package/dist/registry/share.ts +202 -0
- package/dist/registry/sheet.d.ts +107 -0
- package/dist/registry/sheet.js +122 -0
- package/dist/registry/sheet.ts +135 -0
- package/dist/registry/skeleton.d.ts +122 -0
- package/dist/registry/skeleton.js +140 -0
- package/dist/registry/skeleton.ts +155 -0
- package/dist/registry/spinner.d.ts +156 -0
- package/dist/registry/spinner.js +184 -0
- package/dist/registry/spinner.ts +205 -0
- package/dist/registry/switch.d.ts +122 -0
- package/dist/registry/switch.js +139 -0
- package/dist/registry/switch.ts +154 -0
- package/dist/registry/table.d.ts +122 -0
- package/dist/registry/table.js +139 -0
- package/dist/registry/table.ts +154 -0
- package/dist/registry/tabs.d.ts +88 -0
- package/dist/registry/tabs.js +101 -0
- package/dist/registry/tabs.ts +112 -0
- package/dist/registry/text.d.ts +71 -0
- package/dist/registry/text.js +82 -0
- package/dist/registry/text.ts +87 -0
- package/dist/registry/theme/index.d.ts +35 -0
- package/dist/registry/theme/index.js +41 -0
- package/dist/registry/theme/index.ts +43 -0
- package/dist/registry/toast.d.ts +122 -0
- package/dist/registry/toast.js +148 -0
- package/dist/registry/toast.ts +164 -0
- package/dist/registry/toggle.d.ts +173 -0
- package/dist/registry/toggle.js +205 -0
- package/dist/registry/toggle.ts +225 -0
- package/dist/registry/video.d.ts +156 -0
- package/dist/registry/video.js +184 -0
- package/dist/registry/video.ts +203 -0
- package/dist/registry/view.d.ts +37 -0
- package/dist/registry/view.js +44 -0
- package/dist/registry/view.ts +47 -0
- package/dist/templates/components/charts/area-chart.tsx +38 -0
- package/dist/templates/components/charts/bar-chart.tsx +130 -0
- package/dist/templates/components/charts/bubble-chart.tsx +205 -0
- package/dist/templates/components/charts/candlestick-chart.tsx +178 -0
- package/dist/templates/components/charts/chart-container.tsx +47 -0
- package/dist/templates/components/charts/column-chart.tsx +130 -0
- package/dist/templates/components/charts/doughnut-chart.tsx +182 -0
- package/dist/templates/components/charts/heatmap-chart.tsx +253 -0
- package/dist/templates/components/charts/line-chart.tsx +349 -0
- package/dist/templates/components/charts/pie-chart.tsx +172 -0
- package/dist/templates/components/charts/polar-area-chart.tsx +185 -0
- package/dist/templates/components/charts/progress-ring-chart.tsx +161 -0
- package/dist/templates/components/charts/radar-chart.tsx +188 -0
- package/dist/templates/components/charts/radial-bar-chart.tsx +216 -0
- package/dist/templates/components/charts/scatter-chart.tsx +176 -0
- package/dist/templates/components/charts/stacked-area-chart.tsx +289 -0
- package/dist/templates/components/charts/stacked-bar-chart.tsx +311 -0
- package/dist/templates/components/charts/treemap-chart.tsx +273 -0
- package/dist/templates/components/ui/accordion.tsx +175 -0
- package/dist/templates/components/ui/action-sheet.tsx +408 -0
- package/dist/templates/components/ui/alert-dialog.tsx +195 -0
- package/dist/templates/components/ui/alert.tsx +208 -0
- package/dist/templates/components/ui/audio-player.tsx +300 -0
- package/dist/templates/components/ui/audio-recorder.tsx +476 -0
- package/dist/templates/components/ui/audio-waveform.tsx +292 -0
- package/dist/templates/components/ui/avatar.tsx +84 -0
- package/dist/templates/components/ui/avoid-keyboard.tsx +49 -0
- package/dist/templates/components/ui/badge.tsx +88 -0
- package/dist/templates/components/ui/bottom-sheet.tsx +352 -0
- package/dist/templates/components/ui/button.tsx +392 -0
- package/dist/templates/components/ui/camera-preview.tsx +410 -0
- package/dist/templates/components/ui/camera.tsx +1008 -0
- package/dist/templates/components/ui/card.tsx +110 -0
- package/dist/templates/components/ui/carousel.tsx +546 -0
- package/dist/templates/components/ui/checkbox.tsx +82 -0
- package/dist/templates/components/ui/collapsible.tsx +46 -0
- package/dist/templates/components/ui/color-picker.tsx +450 -0
- package/dist/templates/components/ui/combobox.tsx +624 -0
- package/dist/templates/components/ui/date-picker.tsx +1147 -0
- package/dist/templates/components/ui/file-picker.tsx +526 -0
- package/dist/templates/components/ui/gallery.tsx +871 -0
- package/dist/templates/components/ui/hello-wave.tsx +69 -0
- package/dist/templates/components/ui/icon.tsx +34 -0
- package/dist/templates/components/ui/image.tsx +174 -0
- package/dist/templates/components/ui/input-otp.tsx +302 -0
- package/dist/templates/components/ui/input.tsx +607 -0
- package/dist/templates/components/ui/link.tsx +143 -0
- package/dist/templates/components/ui/media-picker.tsx +548 -0
- package/dist/templates/components/ui/mode-toggle.tsx +55 -0
- package/dist/templates/components/ui/onboarding.tsx +357 -0
- package/dist/templates/components/ui/parallax-scrollview.tsx +85 -0
- package/dist/templates/components/ui/picker.tsx +476 -0
- package/dist/templates/components/ui/popover.tsx +450 -0
- package/dist/templates/components/ui/progress.tsx +159 -0
- package/dist/templates/components/ui/radio.tsx +133 -0
- package/dist/templates/components/ui/scroll-view.tsx +14 -0
- package/dist/templates/components/ui/searchbar.tsx +241 -0
- package/dist/templates/components/ui/separator.tsx +30 -0
- package/dist/templates/components/ui/share.tsx +304 -0
- package/dist/templates/components/ui/sheet.tsx +302 -0
- package/dist/templates/components/ui/skeleton.tsx +64 -0
- package/dist/templates/components/ui/spinner.tsx +462 -0
- package/dist/templates/components/ui/switch.tsx +78 -0
- package/dist/templates/components/ui/table.tsx +478 -0
- package/dist/templates/components/ui/tabs.tsx +500 -0
- package/dist/templates/components/ui/text.tsx +86 -0
- package/dist/templates/components/ui/toast.tsx +456 -0
- package/dist/templates/components/ui/toggle.tsx +347 -0
- package/dist/templates/components/ui/video.tsx +555 -0
- package/dist/templates/components/ui/view.tsx +14 -0
- package/dist/templates/demo/accordion/accordion-controlled.tsx +55 -0
- package/dist/templates/demo/accordion/accordion-demo.tsx +38 -0
- package/dist/templates/demo/accordion/accordion-faq.tsx +51 -0
- package/dist/templates/demo/accordion/accordion-multiple.tsx +51 -0
- package/dist/templates/demo/accordion/accordion-non-collapsible.tsx +51 -0
- package/dist/templates/demo/accordion/accordion-single.tsx +45 -0
- package/dist/templates/demo/accordion/accordion-styled.tsx +55 -0
- package/dist/templates/demo/action-sheet/action-sheet-demo.tsx +37 -0
- package/dist/templates/demo/action-sheet/action-sheet-destructive.tsx +44 -0
- package/dist/templates/demo/action-sheet/action-sheet-disabled.tsx +50 -0
- package/dist/templates/demo/action-sheet/action-sheet-hook.tsx +63 -0
- package/dist/templates/demo/action-sheet/action-sheet-icons.tsx +47 -0
- package/dist/templates/demo/action-sheet/action-sheet-long.tsx +105 -0
- package/dist/templates/demo/action-sheet/action-sheet-styled.tsx +52 -0
- package/dist/templates/demo/alert/alert-advanced-demo.tsx +132 -0
- package/dist/templates/demo/alert/alert-confirm-demo.tsx +20 -0
- package/dist/templates/demo/alert/alert-custom-demo.tsx +29 -0
- package/dist/templates/demo/alert/alert-demo.tsx +25 -0
- package/dist/templates/demo/alert/alert-error-demo.tsx +17 -0
- package/dist/templates/demo/alert/alert-success-demo.tsx +19 -0
- package/dist/templates/demo/alert/alert-three-button-demo.tsx +33 -0
- package/dist/templates/demo/alert/alert-visual-demo.tsx +22 -0
- package/dist/templates/demo/alert/alert-visual-destructive-demo.tsx +22 -0
- package/dist/templates/demo/alert-dialog/alert-dialog-custom.tsx +40 -0
- package/dist/templates/demo/alert-dialog/alert-dialog-demo.tsx +28 -0
- package/dist/templates/demo/alert-dialog/alert-dialog-destructive.tsx +30 -0
- package/dist/templates/demo/audio-player/audio-player-autoplay.tsx +22 -0
- package/dist/templates/demo/audio-player/audio-player-demo.tsx +21 -0
- package/dist/templates/demo/audio-player/audio-player-minimal.tsx +17 -0
- package/dist/templates/demo/audio-player/audio-player-music.tsx +158 -0
- package/dist/templates/demo/audio-player/audio-player-progress.tsx +17 -0
- package/dist/templates/demo/audio-player/audio-player-styled.tsx +32 -0
- package/dist/templates/demo/audio-player/audio-player-waveform.tsx +17 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-callbacks.tsx +65 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-cloud.tsx +67 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-demo.tsx +27 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-hq.tsx +24 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-interview.tsx +98 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-minimal.tsx +17 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-styled.tsx +29 -0
- package/dist/templates/demo/audio-recorder/audio-recorder-voice.tsx +18 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-compact.tsx +127 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-demo.tsx +56 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-interactive.tsx +114 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-realtime.tsx +223 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-recording.tsx +100 -0
- package/dist/templates/demo/audio-waveform/audio-waveform-styled.tsx +195 -0
- package/dist/templates/demo/avatar/avatar-bordered.tsx +64 -0
- package/dist/templates/demo/avatar/avatar-demo.tsx +13 -0
- package/dist/templates/demo/avatar/avatar-fallback.tsx +25 -0
- package/dist/templates/demo/avatar/avatar-group.tsx +76 -0
- package/dist/templates/demo/avatar/avatar-sizes.tsx +54 -0
- package/dist/templates/demo/avatar/avatar-status.tsx +76 -0
- package/dist/templates/demo/avatar/avatar-styled.tsx +64 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-chat.tsx +176 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-demo.tsx +37 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-duration.tsx +62 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-form.tsx +175 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-offset.tsx +31 -0
- package/dist/templates/demo/avoid-keyboard/avoid-keyboard-playground.tsx +252 -0
- package/dist/templates/demo/badge/badge-demo.tsx +15 -0
- package/dist/templates/demo/badge/badge-icons.tsx +33 -0
- package/dist/templates/demo/badge/badge-interactive.tsx +81 -0
- package/dist/templates/demo/badge/badge-notifications.tsx +96 -0
- package/dist/templates/demo/badge/badge-sizes.tsx +104 -0
- package/dist/templates/demo/badge/badge-status.tsx +151 -0
- package/dist/templates/demo/badge/badge-styled.tsx +71 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-demo.tsx +31 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-form.tsx +72 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-list.tsx +57 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-menu.tsx +61 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-no-dismiss.tsx +41 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-snap-points.tsx +37 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-styled.tsx +50 -0
- package/dist/templates/demo/bottom-sheet/bottom-sheet-title.tsx +32 -0
- package/dist/templates/demo/button/button-animation.tsx +28 -0
- package/dist/templates/demo/button/button-custom.tsx +52 -0
- package/dist/templates/demo/button/button-demo.tsx +8 -0
- package/dist/templates/demo/button/button-disabled.tsx +21 -0
- package/dist/templates/demo/button/button-icon-only.tsx +26 -0
- package/dist/templates/demo/button/button-loading.tsx +23 -0
- package/dist/templates/demo/button/button-sizes.tsx +19 -0
- package/dist/templates/demo/button/button-variants.tsx +33 -0
- package/dist/templates/demo/button/button-with-icons.tsx +23 -0
- package/dist/templates/demo/camera/camera-custom-controls.tsx +25 -0
- package/dist/templates/demo/camera/camera-demo.tsx +21 -0
- package/dist/templates/demo/camera/camera-picture-only.tsx +17 -0
- package/dist/templates/demo/camera/camera-settings.tsx +29 -0
- package/dist/templates/demo/camera/camera-timer.tsx +22 -0
- package/dist/templates/demo/camera/camera-video.tsx +25 -0
- package/dist/templates/demo/camera/camera-zoom.tsx +21 -0
- package/dist/templates/demo/camera-preview/camera-preview-demo.tsx +5 -0
- package/dist/templates/demo/card/card-demo.tsx +35 -0
- package/dist/templates/demo/card/card-notification.tsx +51 -0
- package/dist/templates/demo/card/card-pricing.tsx +115 -0
- package/dist/templates/demo/card/card-simple.tsx +16 -0
- package/dist/templates/demo/card/card-stats.tsx +33 -0
- package/dist/templates/demo/card/card-with-form.tsx +76 -0
- package/dist/templates/demo/card/card-with-image.tsx +43 -0
- package/dist/templates/demo/carousel/carousel-arrows.tsx +79 -0
- package/dist/templates/demo/carousel/carousel-cards.tsx +146 -0
- package/dist/templates/demo/carousel/carousel-custom-width.tsx +85 -0
- package/dist/templates/demo/carousel/carousel-demo.tsx +57 -0
- package/dist/templates/demo/carousel/carousel-images.tsx +83 -0
- package/dist/templates/demo/carousel/carousel-manual.tsx +215 -0
- package/dist/templates/demo/carousel/carousel-no-indicators.tsx +120 -0
- package/dist/templates/demo/charts/area-chart/area-chart-demo.tsx +33 -0
- package/dist/templates/demo/charts/area-chart/area-chart-interactive.tsx +36 -0
- package/dist/templates/demo/charts/area-chart/area-chart-large.tsx +41 -0
- package/dist/templates/demo/charts/area-chart/area-chart-styled.tsx +51 -0
- package/dist/templates/demo/charts/bar-chart/bar-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/bar-chart/bar-chart-minimal.tsx +26 -0
- package/dist/templates/demo/charts/bar-chart/bar-chart-sample.tsx +30 -0
- package/dist/templates/demo/charts/bubble-chart/bubble-chart-demo.tsx +34 -0
- package/dist/templates/demo/charts/bubble-chart/bubble-chart-minimal.tsx +26 -0
- package/dist/templates/demo/charts/bubble-chart/bubble-chart-sample.tsx +32 -0
- package/dist/templates/demo/charts/bubble-chart/bubble-chart-styled.tsx +39 -0
- package/dist/templates/demo/charts/candlestick-chart/candlestick-chart-demo.tsx +36 -0
- package/dist/templates/demo/charts/candlestick-chart/candlestick-chart-minimal.tsx +31 -0
- package/dist/templates/demo/charts/candlestick-chart/candlestick-chart-sample.tsx +34 -0
- package/dist/templates/demo/charts/candlestick-chart/candlestick-chart-styled.tsx +38 -0
- package/dist/templates/demo/charts/chart-container/chart-container-demo.tsx +30 -0
- package/dist/templates/demo/charts/chart-container/chart-container-styled.tsx +42 -0
- package/dist/templates/demo/charts/column-chart/column-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/column-chart/column-chart-large.tsx +42 -0
- package/dist/templates/demo/charts/column-chart/column-chart-sample.tsx +75 -0
- package/dist/templates/demo/charts/column-chart/column-chart-styled.tsx +37 -0
- package/dist/templates/demo/charts/doughnut-chart/doughnut-chart-demo.tsx +32 -0
- package/dist/templates/demo/charts/doughnut-chart/doughnut-chart-large.tsx +36 -0
- package/dist/templates/demo/charts/doughnut-chart/doughnut-chart-sample.tsx +40 -0
- package/dist/templates/demo/charts/doughnut-chart/doughnut-chart-styled.tsx +35 -0
- package/dist/templates/demo/charts/heatmap-chart/heatmap-chart-demo.tsx +41 -0
- package/dist/templates/demo/charts/heatmap-chart/heatmap-chart-large.tsx +66 -0
- package/dist/templates/demo/charts/heatmap-chart/heatmap-chart-sample.tsx +42 -0
- package/dist/templates/demo/charts/heatmap-chart/heatmap-chart-styled.tsx +43 -0
- package/dist/templates/demo/charts/line-chart/line-chart-demo.tsx +34 -0
- package/dist/templates/demo/charts/line-chart/line-chart-interactive.tsx +35 -0
- package/dist/templates/demo/charts/line-chart/line-chart-minimal.tsx +28 -0
- package/dist/templates/demo/charts/line-chart/line-chart-styled.tsx +51 -0
- package/dist/templates/demo/charts/pie-chart/pie-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/pie-chart/pie-chart-large.tsx +31 -0
- package/dist/templates/demo/charts/pie-chart/pie-chart-sample.tsx +29 -0
- package/dist/templates/demo/charts/pie-chart/pie-chart-styled.tsx +35 -0
- package/dist/templates/demo/charts/polar-area-chart/polar-area-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/polar-area-chart/polar-area-chart-large.tsx +37 -0
- package/dist/templates/demo/charts/polar-area-chart/polar-area-chart-sample.tsx +44 -0
- package/dist/templates/demo/charts/polar-area-chart/polar-area-chart-styled.tsx +37 -0
- package/dist/templates/demo/charts/progress-ring-chart/progress-ring-chart-demo.tsx +25 -0
- package/dist/templates/demo/charts/progress-ring-chart/progress-ring-chart-large.tsx +26 -0
- package/dist/templates/demo/charts/progress-ring-chart/progress-ring-chart-sample.tsx +26 -0
- package/dist/templates/demo/charts/progress-ring-chart/progress-ring-chart-styled.tsx +26 -0
- package/dist/templates/demo/charts/radar-chart/radar-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/radar-chart/radar-chart-large.tsx +36 -0
- package/dist/templates/demo/charts/radar-chart/radar-chart-sample.tsx +31 -0
- package/dist/templates/demo/charts/radar-chart/radar-chart-styled.tsx +41 -0
- package/dist/templates/demo/charts/radial-bar-chart/radial-bar-chart-demo.tsx +29 -0
- package/dist/templates/demo/charts/radial-bar-chart/radial-bar-chart-gradient.tsx +40 -0
- package/dist/templates/demo/charts/radial-bar-chart/radial-bar-chart-large.tsx +32 -0
- package/dist/templates/demo/charts/radial-bar-chart/radial-bar-chart-sample.tsx +37 -0
- package/dist/templates/demo/charts/scatter-chart/scatter-chart-demo.tsx +34 -0
- package/dist/templates/demo/charts/scatter-chart/scatter-chart-large.tsx +39 -0
- package/dist/templates/demo/charts/scatter-chart/scatter-chart-sample.tsx +36 -0
- package/dist/templates/demo/charts/scatter-chart/scatter-chart-styled.tsx +42 -0
- package/dist/templates/demo/charts/stacked-area-chart/stacked-area-chart-demo.tsx +35 -0
- package/dist/templates/demo/charts/stacked-area-chart/stacked-area-chart-large.tsx +63 -0
- package/dist/templates/demo/charts/stacked-area-chart/stacked-area-chart-sample.tsx +36 -0
- package/dist/templates/demo/charts/stacked-area-chart/stacked-area-chart-styled.tsx +44 -0
- package/dist/templates/demo/charts/stacked-bar-chart/stacked-bar-chart-demo.tsx +33 -0
- package/dist/templates/demo/charts/stacked-bar-chart/stacked-bar-chart-horizontal.tsx +35 -0
- package/dist/templates/demo/charts/stacked-bar-chart/stacked-bar-chart-large.tsx +42 -0
- package/dist/templates/demo/charts/stacked-bar-chart/stacked-bar-chart-styled.tsx +43 -0
- package/dist/templates/demo/charts/treemap-chart/treemap-chart-demo.tsx +31 -0
- package/dist/templates/demo/charts/treemap-chart/treemap-chart-large.tsx +41 -0
- package/dist/templates/demo/charts/treemap-chart/treemap-chart-sample.tsx +33 -0
- package/dist/templates/demo/charts/treemap-chart/treemap-chart-styled.tsx +32 -0
- package/dist/templates/demo/checkbox/checkbox-custom-styling.tsx +34 -0
- package/dist/templates/demo/checkbox/checkbox-demo.tsx +14 -0
- package/dist/templates/demo/checkbox/checkbox-group.tsx +44 -0
- package/dist/templates/demo/checkbox/checkbox-states.tsx +37 -0
- package/dist/templates/demo/checkbox/checkbox-with-error.tsx +24 -0
- package/dist/templates/demo/checkbox/checkbox-without-label.tsx +8 -0
- package/dist/templates/demo/collapsible/collapsible-demo.tsx +16 -0
- package/dist/templates/demo/collapsible/collapsible-faq.tsx +45 -0
- package/dist/templates/demo/collapsible/collapsible-multiple.tsx +34 -0
- package/dist/templates/demo/collapsible/collapsible-nested.tsx +39 -0
- package/dist/templates/demo/collapsible/collapsible-with-content.tsx +53 -0
- package/dist/templates/demo/color-picker/color-picker-colors.tsx +36 -0
- package/dist/templates/demo/color-picker/color-picker-demo.tsx +17 -0
- package/dist/templates/demo/color-picker/color-picker-disabled.tsx +15 -0
- package/dist/templates/demo/color-picker/color-picker-labeled.tsx +84 -0
- package/dist/templates/demo/color-picker/color-picker-palette.tsx +54 -0
- package/dist/templates/demo/color-picker/color-picker-sizes.tsx +39 -0
- package/dist/templates/demo/color-picker/color-picker-styled.tsx +52 -0
- package/dist/templates/demo/color-picker/color-swatch-demo.tsx +46 -0
- package/dist/templates/demo/combobox/combobox-demo.tsx +44 -0
- package/dist/templates/demo/combobox/combobox-disabled.tsx +44 -0
- package/dist/templates/demo/combobox/combobox-form.tsx +91 -0
- package/dist/templates/demo/combobox/combobox-groups.tsx +51 -0
- package/dist/templates/demo/combobox/combobox-large.tsx +89 -0
- package/dist/templates/demo/combobox/combobox-multiple.tsx +48 -0
- package/dist/templates/demo/combobox/combobox-search.tsx +67 -0
- package/dist/templates/demo/date-picker/date-picker-constraints.tsx +51 -0
- package/dist/templates/demo/date-picker/date-picker-datetime.tsx +17 -0
- package/dist/templates/demo/date-picker/date-picker-demo.tsx +15 -0
- package/dist/templates/demo/date-picker/date-picker-form.tsx +96 -0
- package/dist/templates/demo/date-picker/date-picker-formats.tsx +39 -0
- package/dist/templates/demo/date-picker/date-picker-range.tsx +16 -0
- package/dist/templates/demo/date-picker/date-picker-time.tsx +30 -0
- package/dist/templates/demo/date-picker/date-picker-variants.tsx +37 -0
- package/dist/templates/demo/file-picker/file-picker-controlled.tsx +134 -0
- package/dist/templates/demo/file-picker/file-picker-demo.tsx +16 -0
- package/dist/templates/demo/file-picker/file-picker-images.tsx +30 -0
- package/dist/templates/demo/file-picker/file-picker-info.tsx +192 -0
- package/dist/templates/demo/file-picker/file-picker-single.tsx +35 -0
- package/dist/templates/demo/file-picker/file-picker-styled.tsx +78 -0
- package/dist/templates/demo/file-picker/file-picker-validation.tsx +61 -0
- package/dist/templates/demo/gallery/gallery-controls.tsx +85 -0
- package/dist/templates/demo/gallery/gallery-demo.tsx +66 -0
- package/dist/templates/demo/gallery/gallery-grid.tsx +109 -0
- package/dist/templates/demo/gallery/gallery-info.tsx +70 -0
- package/dist/templates/demo/gallery/gallery-layouts.tsx +109 -0
- package/dist/templates/demo/gallery/gallery-overlay.tsx +89 -0
- package/dist/templates/demo/hello-wave/hello-wave-demo.tsx +6 -0
- package/dist/templates/demo/icon/icon-colors.tsx +39 -0
- package/dist/templates/demo/icon/icon-demo.tsx +7 -0
- package/dist/templates/demo/icon/icon-grid.tsx +69 -0
- package/dist/templates/demo/icon/icon-interactive.tsx +66 -0
- package/dist/templates/demo/icon/icon-sizes.tsx +23 -0
- package/dist/templates/demo/icon/icon-stroke.tsx +34 -0
- package/dist/templates/demo/icon/icon-themed.tsx +57 -0
- package/dist/templates/demo/image/image-content-fit.tsx +67 -0
- package/dist/templates/demo/image/image-demo.tsx +12 -0
- package/dist/templates/demo/image/image-error.tsx +50 -0
- package/dist/templates/demo/image/image-gallery.tsx +65 -0
- package/dist/templates/demo/image/image-loading.tsx +50 -0
- package/dist/templates/demo/image/image-responsive.tsx +53 -0
- package/dist/templates/demo/image/image-sizes.tsx +54 -0
- package/dist/templates/demo/image/image-variants.tsx +46 -0
- package/dist/templates/demo/input/input-demo.tsx +9 -0
- package/dist/templates/demo/input/input-disabled.tsx +18 -0
- package/dist/templates/demo/input/input-form.tsx +159 -0
- package/dist/templates/demo/input/input-grouped.tsx +28 -0
- package/dist/templates/demo/input/input-icons.tsx +30 -0
- package/dist/templates/demo/input/input-right-components.tsx +65 -0
- package/dist/templates/demo/input/input-validation.tsx +39 -0
- package/dist/templates/demo/input/input-variants.tsx +23 -0
- package/dist/templates/demo/input-otp/input-otp-demo.tsx +17 -0
- package/dist/templates/demo/input-otp/input-otp-disabled.tsx +40 -0
- package/dist/templates/demo/input-otp/input-otp-error.tsx +71 -0
- package/dist/templates/demo/input-otp/input-otp-lengths.tsx +25 -0
- package/dist/templates/demo/input-otp/input-otp-masked.tsx +42 -0
- package/dist/templates/demo/input-otp/input-otp-no-cursor.tsx +39 -0
- package/dist/templates/demo/input-otp/input-otp-separator.tsx +61 -0
- package/dist/templates/demo/input-otp/input-otp-styled.tsx +67 -0
- package/dist/templates/demo/link/link-browser.tsx +36 -0
- package/dist/templates/demo/link/link-buttons.tsx +65 -0
- package/dist/templates/demo/link/link-custom.tsx +42 -0
- package/dist/templates/demo/link/link-demo.tsx +13 -0
- package/dist/templates/demo/link/link-external.tsx +13 -0
- package/dist/templates/demo/link/link-styled.tsx +72 -0
- package/dist/templates/demo/link/link-types.tsx +45 -0
- package/dist/templates/demo/media-picker/media-picker-demo.tsx +16 -0
- package/dist/templates/demo/media-picker/media-picker-gallery.tsx +21 -0
- package/dist/templates/demo/media-picker/media-picker-images.tsx +17 -0
- package/dist/templates/demo/media-picker/media-picker-multiple.tsx +31 -0
- package/dist/templates/demo/media-picker/media-picker-preview.tsx +39 -0
- package/dist/templates/demo/media-picker/media-picker-quality.tsx +62 -0
- package/dist/templates/demo/media-picker/media-picker-videos.tsx +17 -0
- package/dist/templates/demo/mode-toggle/mode-toggle-demo.tsx +6 -0
- package/dist/templates/demo/onboarding/onboarding-custom-buttons.tsx +41 -0
- package/dist/templates/demo/onboarding/onboarding-demo.tsx +114 -0
- package/dist/templates/demo/onboarding/onboarding-hook.tsx +97 -0
- package/dist/templates/demo/onboarding/onboarding-images.tsx +70 -0
- package/dist/templates/demo/onboarding/onboarding-no-skip.tsx +62 -0
- package/dist/templates/demo/onboarding/onboarding-no-swipe.tsx +68 -0
- package/dist/templates/demo/onboarding/onboarding-styled.tsx +70 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-article.tsx +180 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-custom-height.tsx +44 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-demo.tsx +39 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-gradient.tsx +77 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-product.tsx +181 -0
- package/dist/templates/demo/parallax-scrollview/parallax-scrollview-profile.tsx +144 -0
- package/dist/templates/demo/picker/picker-advanced.tsx +82 -0
- package/dist/templates/demo/picker/picker-demo.tsx +22 -0
- package/dist/templates/demo/picker/picker-form.tsx +81 -0
- package/dist/templates/demo/picker/picker-multiple.tsx +26 -0
- package/dist/templates/demo/picker/picker-searchable.tsx +31 -0
- package/dist/templates/demo/picker/picker-sections.tsx +35 -0
- package/dist/templates/demo/picker/picker-styled.tsx +63 -0
- package/dist/templates/demo/picker/picker-variants.tsx +60 -0
- package/dist/templates/demo/popover/popover-alignment.tsx +92 -0
- package/dist/templates/demo/popover/popover-controlled.tsx +53 -0
- package/dist/templates/demo/popover/popover-custom.tsx +79 -0
- package/dist/templates/demo/popover/popover-demo.tsx +39 -0
- package/dist/templates/demo/popover/popover-form.tsx +78 -0
- package/dist/templates/demo/popover/popover-menu.tsx +143 -0
- package/dist/templates/demo/popover/popover-positioning.tsx +62 -0
- package/dist/templates/demo/progress/progress-animated.tsx +71 -0
- package/dist/templates/demo/progress/progress-demo.tsx +6 -0
- package/dist/templates/demo/progress/progress-heights.tsx +35 -0
- package/dist/templates/demo/progress/progress-interactive.tsx +28 -0
- package/dist/templates/demo/progress/progress-labels.tsx +58 -0
- package/dist/templates/demo/progress/progress-media.tsx +120 -0
- package/dist/templates/demo/progress/progress-steps.tsx +137 -0
- package/dist/templates/demo/radio/radio-demo.tsx +18 -0
- package/dist/templates/demo/radio/radio-disabled.tsx +47 -0
- package/dist/templates/demo/radio/radio-form.tsx +82 -0
- package/dist/templates/demo/radio/radio-horizontal.tsx +19 -0
- package/dist/templates/demo/radio/radio-large.tsx +27 -0
- package/dist/templates/demo/radio/radio-single.tsx +36 -0
- package/dist/templates/demo/radio/radio-styled.tsx +77 -0
- package/dist/templates/demo/scroll-view/scroll-view-demo.tsx +37 -0
- package/dist/templates/demo/scroll-view/scroll-view-horizontal.tsx +57 -0
- package/dist/templates/demo/scroll-view/scroll-view-indicators.tsx +91 -0
- package/dist/templates/demo/scroll-view/scroll-view-inset.tsx +116 -0
- package/dist/templates/demo/scroll-view/scroll-view-nested.tsx +85 -0
- package/dist/templates/demo/scroll-view/scroll-view-refresh.tsx +81 -0
- package/dist/templates/demo/scroll-view/scroll-view-styled.tsx +91 -0
- package/dist/templates/demo/scroll-view/scroll-view-vertical.tsx +50 -0
- package/dist/templates/demo/searchbar/searchbar-demo.tsx +19 -0
- package/dist/templates/demo/searchbar/searchbar-icons.tsx +36 -0
- package/dist/templates/demo/searchbar/searchbar-instant.tsx +58 -0
- package/dist/templates/demo/searchbar/searchbar-loading.tsx +28 -0
- package/dist/templates/demo/searchbar/searchbar-no-clear.tsx +20 -0
- package/dist/templates/demo/searchbar/searchbar-styled.tsx +65 -0
- package/dist/templates/demo/searchbar/searchbar-suggestions.tsx +40 -0
- package/dist/templates/demo/separator/separator-colors.tsx +35 -0
- package/dist/templates/demo/separator/separator-demo.tsx +14 -0
- package/dist/templates/demo/separator/separator-spacing.tsx +26 -0
- package/dist/templates/demo/separator/separator-thickness.tsx +30 -0
- package/dist/templates/demo/separator/separator-vertical.tsx +21 -0
- package/dist/templates/demo/share/share-callbacks.tsx +61 -0
- package/dist/templates/demo/share/share-custom-content.tsx +53 -0
- package/dist/templates/demo/share/share-demo.tsx +22 -0
- package/dist/templates/demo/share/share-hook.tsx +71 -0
- package/dist/templates/demo/share/share-icon-only.tsx +42 -0
- package/dist/templates/demo/share/share-sizes.tsx +28 -0
- package/dist/templates/demo/share/share-url-only.tsx +24 -0
- package/dist/templates/demo/share/share-variants.tsx +38 -0
- package/dist/templates/demo/sheet/sheet-demo.tsx +38 -0
- package/dist/templates/demo/sheet/sheet-filter.tsx +191 -0
- package/dist/templates/demo/sheet/sheet-form.tsx +170 -0
- package/dist/templates/demo/sheet/sheet-left.tsx +39 -0
- package/dist/templates/demo/sheet/sheet-navigation.tsx +111 -0
- package/dist/templates/demo/skeleton/skeleton-card.tsx +39 -0
- package/dist/templates/demo/skeleton/skeleton-demo.tsx +6 -0
- package/dist/templates/demo/skeleton/skeleton-list.tsx +34 -0
- package/dist/templates/demo/skeleton/skeleton-profile.tsx +53 -0
- package/dist/templates/demo/skeleton/skeleton-shapes.tsx +44 -0
- package/dist/templates/demo/skeleton/skeleton-sizes.tsx +14 -0
- package/dist/templates/demo/spinner/spinner-colors.tsx +27 -0
- package/dist/templates/demo/spinner/spinner-demo.tsx +6 -0
- package/dist/templates/demo/spinner/spinner-inline.tsx +25 -0
- package/dist/templates/demo/spinner/spinner-labels.tsx +14 -0
- package/dist/templates/demo/spinner/spinner-overlay.tsx +31 -0
- package/dist/templates/demo/spinner/spinner-sizes.tsx +26 -0
- package/dist/templates/demo/spinner/spinner-speeds.tsx +25 -0
- package/dist/templates/demo/spinner/spinner-variants.tsx +27 -0
- package/dist/templates/demo/switch/switch-colors.tsx +33 -0
- package/dist/templates/demo/switch/switch-demo.tsx +14 -0
- package/dist/templates/demo/switch/switch-disabled.tsx +20 -0
- package/dist/templates/demo/switch/switch-error.tsx +24 -0
- package/dist/templates/demo/switch/switch-settings.tsx +42 -0
- package/dist/templates/demo/switch/switch-simple.tsx +8 -0
- package/dist/templates/demo/table/table-custom-cells.tsx +153 -0
- package/dist/templates/demo/table/table-demo.tsx +90 -0
- package/dist/templates/demo/table/table-loading.tsx +84 -0
- package/dist/templates/demo/table/table-pagination.tsx +114 -0
- package/dist/templates/demo/table/table-search.tsx +168 -0
- package/dist/templates/demo/table/table-sortable.tsx +119 -0
- package/dist/templates/demo/tabs/tabs-demo.tsx +85 -0
- package/dist/templates/demo/tabs/tabs-disabled.tsx +61 -0
- package/dist/templates/demo/tabs/tabs-styled.tsx +105 -0
- package/dist/templates/demo/tabs/tabs-vertical.tsx +61 -0
- package/dist/templates/demo/text/text-colors.tsx +40 -0
- package/dist/templates/demo/text/text-demo.tsx +19 -0
- package/dist/templates/demo/text/text-variants.tsx +60 -0
- package/dist/templates/demo/toast/toast-actions.tsx +51 -0
- package/dist/templates/demo/toast/toast-compact.tsx +66 -0
- package/dist/templates/demo/toast/toast-demo.tsx +18 -0
- package/dist/templates/demo/toast/toast-duration.tsx +68 -0
- package/dist/templates/demo/toast/toast-multiple.tsx +65 -0
- package/dist/templates/demo/toast/toast-variants.tsx +45 -0
- package/dist/templates/demo/toggle/toggle-demo.tsx +13 -0
- package/dist/templates/demo/toggle/toggle-disabled.tsx +23 -0
- package/dist/templates/demo/toggle/toggle-group-multiple.tsx +22 -0
- package/dist/templates/demo/toggle/toggle-group-outline.tsx +23 -0
- package/dist/templates/demo/toggle/toggle-group-single.tsx +22 -0
- package/dist/templates/demo/toggle/toggle-group-vertical.tsx +23 -0
- package/dist/templates/demo/toggle/toggle-sizes.tsx +20 -0
- package/dist/templates/demo/toggle/toggle-text.tsx +28 -0
- package/dist/templates/demo/toggle/toggle-variants.tsx +44 -0
- package/dist/templates/demo/video/video-autoplay-loop.tsx +22 -0
- package/dist/templates/demo/video/video-content-fit.tsx +47 -0
- package/dist/templates/demo/video/video-custom-controls.tsx +28 -0
- package/dist/templates/demo/video/video-demo.tsx +20 -0
- package/dist/templates/demo/video/video-gestures.tsx +34 -0
- package/dist/templates/demo/video/video-native-controls.tsx +20 -0
- package/dist/templates/demo/video/video-sources.tsx +39 -0
- package/dist/templates/demo/video/video-subtitles.tsx +29 -0
- package/dist/templates/demo/view/view-demo.tsx +17 -0
- package/dist/templates/hooks/useBottomTabOverflow.ts +6 -0
- package/dist/templates/hooks/useColor.ts +16 -0
- package/dist/templates/hooks/useColorScheme.ts +1 -0
- package/dist/templates/hooks/useColorScheme.web.ts +21 -0
- package/dist/templates/hooks/useKeyboardHeight.ts +131 -0
- package/dist/templates/hooks/useModeToggle.tsx +50 -0
- package/dist/templates/hooks/useThemeColor.ts +21 -0
- package/dist/templates/start/README.md +198 -0
- package/dist/templates/start/app/(tabs)/(home)/_layout.tsx +43 -0
- package/dist/templates/start/app/(tabs)/(home)/index.tsx +96 -0
- package/dist/templates/start/app/(tabs)/_layout.tsx +68 -0
- package/dist/templates/start/app/(tabs)/_layout.web.tsx +48 -0
- package/dist/templates/start/app/(tabs)/search/_layout.tsx +60 -0
- package/dist/templates/start/app/(tabs)/search/index.tsx +44 -0
- package/dist/templates/start/app/(tabs)/settings/_layout.tsx +42 -0
- package/dist/templates/start/app/(tabs)/settings/index.tsx +105 -0
- package/dist/templates/start/app/+not-found.tsx +24 -0
- package/dist/templates/start/app/_layout.tsx +90 -0
- package/dist/templates/start/app/sheet.tsx +1 -0
- package/dist/templates/start/app.json +50 -0
- package/dist/templates/start/assets/images/icon.png +0 -0
- package/dist/templates/start/assets/images/splash.png +0 -0
- package/dist/templates/start/components/sheet.tsx +79 -0
- package/dist/templates/start/components/ui/avoid-keyboard.tsx +49 -0
- package/dist/templates/start/components/ui/button.tsx +392 -0
- package/dist/templates/start/components/ui/card.tsx +110 -0
- package/dist/templates/start/components/ui/icon.tsx +34 -0
- package/dist/templates/start/components/ui/input-otp.tsx +302 -0
- package/dist/templates/start/components/ui/input.tsx +607 -0
- package/dist/templates/start/components/ui/link.tsx +143 -0
- package/dist/templates/start/components/ui/mode-toggle.tsx +55 -0
- package/dist/templates/start/components/ui/scroll-view.tsx +14 -0
- package/dist/templates/start/components/ui/spinner.tsx +462 -0
- package/dist/templates/start/components/ui/tabs.tsx +500 -0
- package/dist/templates/start/components/ui/text.tsx +86 -0
- package/dist/templates/start/components/ui/view.tsx +14 -0
- package/dist/templates/start/eslint.config.js +10 -0
- package/dist/templates/start/hooks/useColor.ts +16 -0
- package/dist/templates/start/hooks/useColorScheme.ts +1 -0
- package/dist/templates/start/hooks/useColorScheme.web.ts +21 -0
- package/dist/templates/start/hooks/useKeyboardHeight.ts +131 -0
- package/dist/templates/start/hooks/useModeToggle.tsx +88 -0
- package/dist/templates/start/package.json +58 -0
- package/dist/templates/start/providers/search-context.tsx +26 -0
- package/dist/templates/start/theme/colors.ts +184 -0
- package/dist/templates/start/theme/globals.ts +4 -0
- package/dist/templates/start/theme/theme-provider.tsx +59 -0
- package/dist/templates/start/tsconfig.json +17 -0
- package/dist/templates/start-convex/README.md +213 -0
- package/dist/templates/start-convex/app/(tabs)/(home)/_layout.tsx +43 -0
- package/dist/templates/start-convex/app/(tabs)/(home)/index.tsx +96 -0
- package/dist/templates/start-convex/app/(tabs)/_layout.tsx +68 -0
- package/dist/templates/start-convex/app/(tabs)/_layout.web.tsx +48 -0
- package/dist/templates/start-convex/app/(tabs)/search/_layout.tsx +60 -0
- package/dist/templates/start-convex/app/(tabs)/search/index.tsx +44 -0
- package/dist/templates/start-convex/app/(tabs)/settings/_layout.tsx +42 -0
- package/dist/templates/start-convex/app/(tabs)/settings/index.tsx +49 -0
- package/dist/templates/start-convex/app/+not-found.tsx +24 -0
- package/dist/templates/start-convex/app/_layout.tsx +136 -0
- package/dist/templates/start-convex/app/sheet.tsx +1 -0
- package/dist/templates/start-convex/app.json +51 -0
- package/dist/templates/start-convex/assets/images/icon.png +0 -0
- package/dist/templates/start-convex/assets/images/splash.png +0 -0
- package/dist/templates/start-convex/components/auth/apple.tsx +60 -0
- package/dist/templates/start-convex/components/auth/auth.tsx +127 -0
- package/dist/templates/start-convex/components/auth/email-otp.tsx +186 -0
- package/dist/templates/start-convex/components/auth/google.tsx +60 -0
- package/dist/templates/start-convex/components/auth/password.tsx +335 -0
- package/dist/templates/start-convex/components/auth/singout.tsx +36 -0
- package/dist/templates/start-convex/components/sheet.tsx +79 -0
- package/dist/templates/start-convex/components/ui/avoid-keyboard.tsx +49 -0
- package/dist/templates/start-convex/components/ui/button.tsx +392 -0
- package/dist/templates/start-convex/components/ui/card.tsx +110 -0
- package/dist/templates/start-convex/components/ui/icon.tsx +34 -0
- package/dist/templates/start-convex/components/ui/input-otp.tsx +302 -0
- package/dist/templates/start-convex/components/ui/input.tsx +607 -0
- package/dist/templates/start-convex/components/ui/link.tsx +143 -0
- package/dist/templates/start-convex/components/ui/mode-toggle.tsx +55 -0
- package/dist/templates/start-convex/components/ui/scroll-view.tsx +14 -0
- package/dist/templates/start-convex/components/ui/spinner.tsx +462 -0
- package/dist/templates/start-convex/components/ui/tabs.tsx +500 -0
- package/dist/templates/start-convex/components/ui/text.tsx +86 -0
- package/dist/templates/start-convex/components/ui/view.tsx +14 -0
- package/dist/templates/start-convex/convex/README.md +90 -0
- package/dist/templates/start-convex/convex/_generated/api.d.ts +61 -0
- package/dist/templates/start-convex/convex/_generated/api.js +23 -0
- package/dist/templates/start-convex/convex/_generated/dataModel.d.ts +60 -0
- package/dist/templates/start-convex/convex/_generated/server.d.ts +143 -0
- package/dist/templates/start-convex/convex/_generated/server.js +93 -0
- package/dist/templates/start-convex/convex/auth.config.ts +8 -0
- package/dist/templates/start-convex/convex/auth.ts +112 -0
- package/dist/templates/start-convex/convex/http.ts +8 -0
- package/dist/templates/start-convex/convex/passwordReset.ts +69 -0
- package/dist/templates/start-convex/convex/resendOTP.ts +60 -0
- package/dist/templates/start-convex/convex/resendPasswordOTP.ts +64 -0
- package/dist/templates/start-convex/convex/router.ts +5 -0
- package/dist/templates/start-convex/convex/schema.ts +23 -0
- package/dist/templates/start-convex/convex/tsconfig.json +25 -0
- package/dist/templates/start-convex/convex/users.ts +111 -0
- package/dist/templates/start-convex/eslint.config.js +10 -0
- package/dist/templates/start-convex/hooks/useColor.ts +16 -0
- package/dist/templates/start-convex/hooks/useColorScheme.ts +1 -0
- package/dist/templates/start-convex/hooks/useColorScheme.web.ts +21 -0
- package/dist/templates/start-convex/hooks/useKeyboardHeight.ts +131 -0
- package/dist/templates/start-convex/hooks/useModeToggle.tsx +88 -0
- package/dist/templates/start-convex/package.json +64 -0
- package/dist/templates/start-convex/providers/search-context.tsx +26 -0
- package/dist/templates/start-convex/theme/colors.ts +184 -0
- package/dist/templates/start-convex/theme/globals.ts +4 -0
- package/dist/templates/start-convex/theme/theme-provider.tsx +59 -0
- package/dist/templates/start-convex/tsconfig.json +17 -0
- package/dist/templates/theme/colors.ts +205 -0
- package/dist/templates/theme/globals.ts +4 -0
- package/dist/templates/theme/theme-provider.tsx +52 -0
- package/dist/utils/dependencies.d.ts +7 -0
- package/dist/utils/dependencies.js +109 -0
- package/dist/utils/filesystem.d.ts +6 -0
- package/dist/utils/filesystem.js +72 -0
- package/dist/utils/git.d.ts +2 -0
- package/dist/utils/git.js +33 -0
- package/dist/utils/logger.d.ts +11 -0
- package/dist/utils/logger.js +43 -0
- package/dist/utils/package-manager.d.ts +8 -0
- package/dist/utils/package-manager.js +128 -0
- package/dist/utils/project-config.d.ts +2 -0
- package/dist/utils/project-config.js +46 -0
- package/dist/utils/registry.d.ts +17 -0
- package/dist/utils/registry.js +181 -0
- package/dist/utils/validation.d.ts +16 -0
- package/dist/utils/validation.js +84 -0
- package/package.json +74 -0
|
@@ -0,0 +1,871 @@
|
|
|
1
|
+
import { Button } from '@/components/ui/button';
|
|
2
|
+
import { Text } from '@/components/ui/text';
|
|
3
|
+
import { useColor } from '@/hooks/useColor';
|
|
4
|
+
import { BORDER_RADIUS } from '@/theme/globals';
|
|
5
|
+
import { Image } from 'expo-image';
|
|
6
|
+
import { Download, Share, X } from 'lucide-react-native';
|
|
7
|
+
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import {
|
|
9
|
+
Dimensions,
|
|
10
|
+
FlatList,
|
|
11
|
+
Modal,
|
|
12
|
+
Pressable,
|
|
13
|
+
ScrollView,
|
|
14
|
+
StyleSheet,
|
|
15
|
+
View,
|
|
16
|
+
} from 'react-native';
|
|
17
|
+
import {
|
|
18
|
+
Gesture,
|
|
19
|
+
GestureDetector,
|
|
20
|
+
GestureHandlerRootView,
|
|
21
|
+
} from 'react-native-gesture-handler';
|
|
22
|
+
import Animated, {
|
|
23
|
+
runOnJS,
|
|
24
|
+
useAnimatedStyle,
|
|
25
|
+
useSharedValue,
|
|
26
|
+
withSpring,
|
|
27
|
+
} from 'react-native-reanimated';
|
|
28
|
+
|
|
29
|
+
const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
|
|
30
|
+
|
|
31
|
+
export interface GalleryItem {
|
|
32
|
+
id: string;
|
|
33
|
+
uri: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
thumbnail?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface GalleryProps {
|
|
40
|
+
items: GalleryItem[];
|
|
41
|
+
columns?: number;
|
|
42
|
+
spacing?: number;
|
|
43
|
+
borderRadius?: number;
|
|
44
|
+
aspectRatio?: number;
|
|
45
|
+
showPages?: boolean;
|
|
46
|
+
showTitles?: boolean;
|
|
47
|
+
showDescriptions?: boolean;
|
|
48
|
+
enableFullscreen?: boolean;
|
|
49
|
+
enableZoom?: boolean;
|
|
50
|
+
enableDownload?: boolean;
|
|
51
|
+
enableShare?: boolean;
|
|
52
|
+
onItemPress?: (item: GalleryItem, index: number) => void;
|
|
53
|
+
onDownload?: (item: GalleryItem) => void;
|
|
54
|
+
onShare?: (item: GalleryItem) => void;
|
|
55
|
+
renderCustomOverlay?: (item: GalleryItem, index: number) => React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const AnimatedImage = Animated.createAnimatedComponent(Image);
|
|
59
|
+
|
|
60
|
+
// Improved zoom hook with better gesture handling
|
|
61
|
+
interface UseImageZoomProps {
|
|
62
|
+
enableZoom: boolean;
|
|
63
|
+
onSetCanSwipe: (canSwipe: boolean) => void;
|
|
64
|
+
shouldReset?: boolean; // Indicates if the current image has changed and zoom should reset
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const useImageZoom = ({
|
|
68
|
+
enableZoom,
|
|
69
|
+
onSetCanSwipe,
|
|
70
|
+
shouldReset = false,
|
|
71
|
+
}: UseImageZoomProps) => {
|
|
72
|
+
// Shared values for animated properties
|
|
73
|
+
const scale = useSharedValue(1);
|
|
74
|
+
const translateX = useSharedValue(0);
|
|
75
|
+
const translateY = useSharedValue(0);
|
|
76
|
+
|
|
77
|
+
// Saved values to store the state at the start of a gesture
|
|
78
|
+
const savedScale = useSharedValue(1);
|
|
79
|
+
const savedTranslateX = useSharedValue(0);
|
|
80
|
+
const savedTranslateY = useSharedValue(0);
|
|
81
|
+
|
|
82
|
+
// Shared value to dynamically enable/disable the pan gesture for dragging
|
|
83
|
+
const panGestureEnabled = useSharedValue(false); // Initially disabled
|
|
84
|
+
|
|
85
|
+
// Minimum and maximum zoom scale
|
|
86
|
+
const minScale = 0.8;
|
|
87
|
+
const maxScale = 4;
|
|
88
|
+
|
|
89
|
+
// Function to reset the image to its initial state (no zoom, no translation)
|
|
90
|
+
const resetZoom = useCallback(() => {
|
|
91
|
+
'worklet'; // Marks this function to run on the UI thread
|
|
92
|
+
scale.value = withSpring(1, { damping: 20, stiffness: 300 });
|
|
93
|
+
translateX.value = withSpring(0, { damping: 20, stiffness: 300 });
|
|
94
|
+
translateY.value = withSpring(0, { damping: 20, stiffness: 300 });
|
|
95
|
+
savedScale.value = 1;
|
|
96
|
+
savedTranslateX.value = 0;
|
|
97
|
+
savedTranslateY.value = 0;
|
|
98
|
+
// Allow the parent FlatList to swipe when the image is reset
|
|
99
|
+
runOnJS(onSetCanSwipe)(true);
|
|
100
|
+
panGestureEnabled.value = false; // Disable pan gesture when reset
|
|
101
|
+
}, [
|
|
102
|
+
scale,
|
|
103
|
+
translateX,
|
|
104
|
+
translateY,
|
|
105
|
+
savedScale,
|
|
106
|
+
savedTranslateX,
|
|
107
|
+
savedTranslateY,
|
|
108
|
+
onSetCanSwipe,
|
|
109
|
+
panGestureEnabled,
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
// Effect to reset zoom when the `shouldReset` prop changes (meaning a new image is selected)
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (shouldReset) {
|
|
115
|
+
resetZoom();
|
|
116
|
+
}
|
|
117
|
+
}, [shouldReset, resetZoom]);
|
|
118
|
+
|
|
119
|
+
// Function to constrain the image translation within its bounds
|
|
120
|
+
const constrainTranslation = useCallback(
|
|
121
|
+
(newScale: number, newTranslateX: number, newTranslateY: number) => {
|
|
122
|
+
'worklet';
|
|
123
|
+
// Calculate maximum allowed translation based on current scale
|
|
124
|
+
const maxTranslateX = Math.max(
|
|
125
|
+
0,
|
|
126
|
+
(screenWidth * newScale - screenWidth) / 2
|
|
127
|
+
);
|
|
128
|
+
const maxTranslateY = Math.max(
|
|
129
|
+
0,
|
|
130
|
+
(screenHeight * newScale - screenHeight) / 2
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
// Constrain the new translation values
|
|
134
|
+
const constrainedX = Math.max(
|
|
135
|
+
-maxTranslateX,
|
|
136
|
+
Math.min(maxTranslateX, newTranslateX)
|
|
137
|
+
);
|
|
138
|
+
const constrainedY = Math.max(
|
|
139
|
+
-maxTranslateY,
|
|
140
|
+
Math.min(maxTranslateY, newTranslateY)
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return { x: constrainedX, y: constrainedY };
|
|
144
|
+
},
|
|
145
|
+
[]
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
// Gesture for double-tapping to zoom in/out
|
|
149
|
+
const doubleTapGesture = Gesture.Tap()
|
|
150
|
+
.numberOfTaps(2)
|
|
151
|
+
.onEnd((event) => {
|
|
152
|
+
if (!enableZoom) return; // Only process if zoom is enabled
|
|
153
|
+
('worklet');
|
|
154
|
+
|
|
155
|
+
// If already zoomed in (beyond a small threshold), reset to original size
|
|
156
|
+
if (scale.value > 1.1) {
|
|
157
|
+
resetZoom(); // This will handle setting panGestureEnabled and canSwipe
|
|
158
|
+
} else {
|
|
159
|
+
// Otherwise, zoom to a target scale (e.g., 2.5x)
|
|
160
|
+
const targetScale = 2.5;
|
|
161
|
+
// Calculate tap position relative to the center of the screen
|
|
162
|
+
const tapX = event.x - screenWidth / 2;
|
|
163
|
+
const tapY = event.y - screenHeight / 2;
|
|
164
|
+
|
|
165
|
+
// Calculate new translation to make the tapped point the new center
|
|
166
|
+
const newTranslateX = (-tapX * (targetScale - 1)) / targetScale;
|
|
167
|
+
const newTranslateY = (-tapY * (targetScale - 1)) / targetScale;
|
|
168
|
+
|
|
169
|
+
// Constrain translation to keep image within bounds
|
|
170
|
+
const constrained = constrainTranslation(
|
|
171
|
+
targetScale,
|
|
172
|
+
newTranslateX,
|
|
173
|
+
newTranslateY
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
// Animate scale and translation
|
|
177
|
+
scale.value = withSpring(targetScale, { damping: 20, stiffness: 300 });
|
|
178
|
+
translateX.value = withSpring(constrained.x, {
|
|
179
|
+
damping: 20,
|
|
180
|
+
stiffness: 300,
|
|
181
|
+
});
|
|
182
|
+
translateY.value = withSpring(constrained.y, {
|
|
183
|
+
damping: 20,
|
|
184
|
+
stiffness: 300,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Save current state
|
|
188
|
+
savedScale.value = targetScale;
|
|
189
|
+
savedTranslateX.value = constrained.x;
|
|
190
|
+
savedTranslateY.value = constrained.y;
|
|
191
|
+
|
|
192
|
+
// Disable parent FlatList swiping as image is now zoomed
|
|
193
|
+
runOnJS(onSetCanSwipe)(false);
|
|
194
|
+
panGestureEnabled.value = true; // Enable pan gesture for dragging zoomed image
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// Gesture for pinching to zoom
|
|
199
|
+
const pinchGesture = Gesture.Pinch()
|
|
200
|
+
.onStart(() => {
|
|
201
|
+
if (!enableZoom) return;
|
|
202
|
+
('worklet');
|
|
203
|
+
// Save current state at the start of the pinch
|
|
204
|
+
savedScale.value = scale.value;
|
|
205
|
+
savedTranslateX.value = translateX.value;
|
|
206
|
+
savedTranslateY.value = translateY.value;
|
|
207
|
+
})
|
|
208
|
+
.onUpdate((event) => {
|
|
209
|
+
if (!enableZoom) return;
|
|
210
|
+
('worklet');
|
|
211
|
+
|
|
212
|
+
// Calculate new scale, clamping it between min and max
|
|
213
|
+
const newScale = Math.max(
|
|
214
|
+
minScale,
|
|
215
|
+
Math.min(maxScale, savedScale.value * event.scale)
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
// Calculate focal point relative to the image center
|
|
219
|
+
const focalX = event.focalX - screenWidth / 2;
|
|
220
|
+
const focalY = event.focalY - screenHeight / 2;
|
|
221
|
+
|
|
222
|
+
// Calculate new translation to keep the focal point in place during zoom
|
|
223
|
+
const scaleDiff = newScale / savedScale.value;
|
|
224
|
+
const newTranslateX = savedTranslateX.value + focalX * (1 - scaleDiff);
|
|
225
|
+
const newTranslateY = savedTranslateY.value + focalY * (1 - scaleDiff);
|
|
226
|
+
|
|
227
|
+
// Constrain translation
|
|
228
|
+
const constrained = constrainTranslation(
|
|
229
|
+
newScale,
|
|
230
|
+
newTranslateX,
|
|
231
|
+
newTranslateY
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
// Apply new scale and translation
|
|
235
|
+
scale.value = newScale;
|
|
236
|
+
translateX.value = constrained.x;
|
|
237
|
+
translateY.value = constrained.y;
|
|
238
|
+
|
|
239
|
+
// Dynamically enable/disable panGestureEnabled and FlatList scrolling based on zoom level
|
|
240
|
+
panGestureEnabled.value = newScale > 1.1;
|
|
241
|
+
runOnJS(onSetCanSwipe)(newScale <= 1.1); // FlatList scrollable if not zoomed
|
|
242
|
+
})
|
|
243
|
+
.onEnd(() => {
|
|
244
|
+
if (!enableZoom) return;
|
|
245
|
+
('worklet');
|
|
246
|
+
|
|
247
|
+
// If zoomed out too much, reset to original size
|
|
248
|
+
if (scale.value < 1) {
|
|
249
|
+
resetZoom(); // This will handle setting panGestureEnabled and canSwipe
|
|
250
|
+
} else {
|
|
251
|
+
// Save current state after pinch ends
|
|
252
|
+
savedScale.value = scale.value;
|
|
253
|
+
savedTranslateX.value = translateX.value;
|
|
254
|
+
savedTranslateY.value = translateY.value;
|
|
255
|
+
// Re-evaluate if panGestureEnabled and FlatList should be able to swipe
|
|
256
|
+
panGestureEnabled.value = scale.value > 1.1;
|
|
257
|
+
runOnJS(onSetCanSwipe)(scale.value <= 1.1);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// Gesture for panning (dragging) the image when zoomed in
|
|
262
|
+
const panGesture = Gesture.Pan()
|
|
263
|
+
.minPointers(1) // This gesture will respond to a single finger
|
|
264
|
+
.maxPointers(1)
|
|
265
|
+
.enabled(panGestureEnabled.value) // Only enabled if panGestureEnabled.value is true
|
|
266
|
+
.onStart(() => {
|
|
267
|
+
'worklet';
|
|
268
|
+
// If this onStart is called, it means the gesture is enabled and recognized.
|
|
269
|
+
savedTranslateX.value = translateX.value;
|
|
270
|
+
savedTranslateY.value = translateY.value;
|
|
271
|
+
runOnJS(onSetCanSwipe)(false); // Disable parent FlatList swipe when dragging zoomed image
|
|
272
|
+
})
|
|
273
|
+
.onUpdate((event) => {
|
|
274
|
+
'worklet';
|
|
275
|
+
// This check is a safeguard, but 'enabled' should prevent this from being called if not zoomed.
|
|
276
|
+
if (!enableZoom || !panGestureEnabled.value) return;
|
|
277
|
+
|
|
278
|
+
// Calculate new translation based on drag
|
|
279
|
+
const newTranslateX = savedTranslateX.value + event.translationX;
|
|
280
|
+
const newTranslateY = savedTranslateY.value + event.translationY;
|
|
281
|
+
|
|
282
|
+
// Constrain translation
|
|
283
|
+
const constrained = constrainTranslation(
|
|
284
|
+
scale.value,
|
|
285
|
+
newTranslateX,
|
|
286
|
+
newTranslateY
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
// Apply new translation
|
|
290
|
+
translateX.value = constrained.x;
|
|
291
|
+
translateY.value = constrained.y;
|
|
292
|
+
})
|
|
293
|
+
.onEnd(() => {
|
|
294
|
+
'worklet';
|
|
295
|
+
savedTranslateX.value = translateX.value;
|
|
296
|
+
savedTranslateY.value = translateY.value;
|
|
297
|
+
// Re-enable FlatList swipe if not zoomed after pan ends
|
|
298
|
+
runOnJS(onSetCanSwipe)(scale.value <= 1.1);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// Compose all gestures:
|
|
302
|
+
// - Race: Double tap takes precedence if detected.
|
|
303
|
+
// - Simultaneous: Pinch and dynamically enabled single-finger pan can happen at the same time.
|
|
304
|
+
const composedGesture = Gesture.Race(
|
|
305
|
+
doubleTapGesture,
|
|
306
|
+
Gesture.Simultaneous(pinchGesture, panGesture)
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
// Animated style for the image based on scale and translation values
|
|
310
|
+
const animatedImageStyle = useAnimatedStyle(() => {
|
|
311
|
+
return {
|
|
312
|
+
transform: [
|
|
313
|
+
{ scale: scale.value },
|
|
314
|
+
{ translateX: translateX.value },
|
|
315
|
+
{ translateY: translateY.value },
|
|
316
|
+
],
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
animatedImageStyle,
|
|
322
|
+
composedGesture,
|
|
323
|
+
resetZoom,
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// Fixed fullscreen image component
|
|
328
|
+
interface FullscreenImageProps {
|
|
329
|
+
item: GalleryItem;
|
|
330
|
+
index: number;
|
|
331
|
+
selectedIndex: number;
|
|
332
|
+
enableZoom: boolean;
|
|
333
|
+
// Callback to inform the parent FlatList whether it should be scrollable
|
|
334
|
+
onSetCanSwipe: (canSwipe: boolean) => void;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const FullscreenImage = memo(
|
|
338
|
+
({
|
|
339
|
+
item,
|
|
340
|
+
index,
|
|
341
|
+
selectedIndex,
|
|
342
|
+
enableZoom,
|
|
343
|
+
onSetCanSwipe,
|
|
344
|
+
}: FullscreenImageProps) => {
|
|
345
|
+
// Determine if this image is the currently selected one to trigger zoom reset
|
|
346
|
+
const shouldReset = index === selectedIndex;
|
|
347
|
+
const backgroundColor = useColor('background');
|
|
348
|
+
const { animatedImageStyle, composedGesture } = useImageZoom({
|
|
349
|
+
enableZoom,
|
|
350
|
+
onSetCanSwipe, // Pass the callback to the hook
|
|
351
|
+
shouldReset,
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
return (
|
|
355
|
+
<View
|
|
356
|
+
style={{
|
|
357
|
+
width: screenWidth,
|
|
358
|
+
height: screenHeight,
|
|
359
|
+
justifyContent: 'center',
|
|
360
|
+
alignItems: 'center',
|
|
361
|
+
backgroundColor,
|
|
362
|
+
}}
|
|
363
|
+
>
|
|
364
|
+
{/* GestureDetector always present if zoom is enabled */}
|
|
365
|
+
{enableZoom ? (
|
|
366
|
+
<GestureDetector gesture={composedGesture}>
|
|
367
|
+
<Animated.View style={styles.imageContainer}>
|
|
368
|
+
<AnimatedImage
|
|
369
|
+
source={{ uri: item.uri }}
|
|
370
|
+
style={[styles.fullscreenImage, animatedImageStyle]}
|
|
371
|
+
contentFit='contain'
|
|
372
|
+
/>
|
|
373
|
+
</Animated.View>
|
|
374
|
+
</GestureDetector>
|
|
375
|
+
) : (
|
|
376
|
+
// If zoom is not enabled, render without GestureDetector
|
|
377
|
+
<Animated.View style={styles.imageContainer}>
|
|
378
|
+
<AnimatedImage
|
|
379
|
+
source={{ uri: item.uri }}
|
|
380
|
+
style={[styles.fullscreenImage, animatedImageStyle]}
|
|
381
|
+
contentFit='contain'
|
|
382
|
+
/>
|
|
383
|
+
</Animated.View>
|
|
384
|
+
)}
|
|
385
|
+
</View>
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
|
|
390
|
+
export function Gallery({
|
|
391
|
+
items,
|
|
392
|
+
columns = 4,
|
|
393
|
+
spacing = 0,
|
|
394
|
+
aspectRatio = 1,
|
|
395
|
+
borderRadius = 0,
|
|
396
|
+
showPages = false,
|
|
397
|
+
showTitles = false,
|
|
398
|
+
showDescriptions = false,
|
|
399
|
+
enableFullscreen = true,
|
|
400
|
+
enableZoom = true,
|
|
401
|
+
enableDownload = false,
|
|
402
|
+
enableShare = false,
|
|
403
|
+
onItemPress,
|
|
404
|
+
onDownload,
|
|
405
|
+
onShare,
|
|
406
|
+
renderCustomOverlay,
|
|
407
|
+
}: GalleryProps) {
|
|
408
|
+
// State for the currently selected image index in fullscreen mode
|
|
409
|
+
const [selectedIndex, setSelectedIndex] = useState<number>(-1);
|
|
410
|
+
// State to control modal visibility
|
|
411
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
412
|
+
// State for the calculated width of the gallery container
|
|
413
|
+
const [containerWidth, setContainerWidth] = useState(screenWidth);
|
|
414
|
+
// State to control whether the fullscreen FlatList can be swiped horizontally
|
|
415
|
+
const [flatListScrollEnabled, setFlatListScrollEnabled] = useState(true);
|
|
416
|
+
|
|
417
|
+
// Refs for the FlatList components
|
|
418
|
+
const fullscreenFlatListRef = useRef<FlatList>(null);
|
|
419
|
+
const thumbnailFlatListRef = useRef<FlatList>(null);
|
|
420
|
+
|
|
421
|
+
// Theme colors using custom hook
|
|
422
|
+
const textColor = useColor('text');
|
|
423
|
+
const primary = useColor('primary');
|
|
424
|
+
const mutedColor = useColor('textMuted');
|
|
425
|
+
const backgroundColor = useColor('background');
|
|
426
|
+
const secondary = useColor('secondary');
|
|
427
|
+
|
|
428
|
+
// Calculate item width for the grid based on container width, columns, and spacing
|
|
429
|
+
const itemWidth = (containerWidth - spacing * (columns - 1)) / columns;
|
|
430
|
+
|
|
431
|
+
// Function to open the fullscreen modal
|
|
432
|
+
const openFullscreen = useCallback(
|
|
433
|
+
(index: number) => {
|
|
434
|
+
if (!enableFullscreen) return; // Only open if fullscreen is enabled
|
|
435
|
+
setSelectedIndex(index);
|
|
436
|
+
setIsModalVisible(true);
|
|
437
|
+
// Initially, allow FlatList scrolling
|
|
438
|
+
setFlatListScrollEnabled(true);
|
|
439
|
+
|
|
440
|
+
// Use setTimeout to ensure the modal is fully rendered before trying to scroll the FlatList
|
|
441
|
+
setTimeout(() => {
|
|
442
|
+
fullscreenFlatListRef.current?.scrollToIndex({
|
|
443
|
+
index,
|
|
444
|
+
animated: false,
|
|
445
|
+
});
|
|
446
|
+
thumbnailFlatListRef.current?.scrollToIndex({
|
|
447
|
+
index,
|
|
448
|
+
animated: false,
|
|
449
|
+
viewPosition: 0.5, // Center the thumbnail
|
|
450
|
+
});
|
|
451
|
+
}, 100);
|
|
452
|
+
},
|
|
453
|
+
[enableFullscreen]
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
// Function to close the fullscreen modal
|
|
457
|
+
const closeFullscreen = useCallback(() => {
|
|
458
|
+
setIsModalVisible(false);
|
|
459
|
+
setSelectedIndex(-1); // Reset selected index
|
|
460
|
+
setFlatListScrollEnabled(true); // Ensure scrolling is re-enabled on close
|
|
461
|
+
}, []);
|
|
462
|
+
|
|
463
|
+
// Handler for pressing a gallery item (thumbnail)
|
|
464
|
+
const handleItemPress = useCallback(
|
|
465
|
+
(item: GalleryItem, index: number) => {
|
|
466
|
+
if (onItemPress) {
|
|
467
|
+
onItemPress(item, index); // Call custom press handler if provided
|
|
468
|
+
} else if (enableFullscreen) {
|
|
469
|
+
openFullscreen(index); // Otherwise, open fullscreen
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
[onItemPress, enableFullscreen, openFullscreen]
|
|
473
|
+
);
|
|
474
|
+
|
|
475
|
+
// Handler for pressing a thumbnail in the fullscreen bottom bar
|
|
476
|
+
const handleThumbnailPress = useCallback((index: number) => {
|
|
477
|
+
setSelectedIndex(index); // Update selected index
|
|
478
|
+
setFlatListScrollEnabled(true); // Always allow swiping when a thumbnail is tapped
|
|
479
|
+
fullscreenFlatListRef.current?.scrollToIndex({
|
|
480
|
+
index,
|
|
481
|
+
animated: true,
|
|
482
|
+
});
|
|
483
|
+
}, []);
|
|
484
|
+
|
|
485
|
+
// Callback for FlatList to detect when viewable items change (for updating selected index)
|
|
486
|
+
const onViewableItemsChanged = useCallback(
|
|
487
|
+
({ viewableItems }: any) => {
|
|
488
|
+
if (viewableItems.length > 0) {
|
|
489
|
+
const newIndex = viewableItems[0].index;
|
|
490
|
+
if (
|
|
491
|
+
newIndex !== selectedIndex &&
|
|
492
|
+
newIndex !== null &&
|
|
493
|
+
newIndex !== undefined
|
|
494
|
+
) {
|
|
495
|
+
setSelectedIndex(newIndex);
|
|
496
|
+
// Sync thumbnail scroll to the newly selected image
|
|
497
|
+
setTimeout(() => {
|
|
498
|
+
thumbnailFlatListRef.current?.scrollToIndex({
|
|
499
|
+
index: newIndex,
|
|
500
|
+
animated: true,
|
|
501
|
+
viewPosition: 0.5, // Center the thumbnail
|
|
502
|
+
});
|
|
503
|
+
}, 100);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
[selectedIndex]
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
// Configuration for viewability of FlatList items
|
|
511
|
+
const viewabilityConfig = {
|
|
512
|
+
itemVisiblePercentThreshold: 50, // An item is "viewable" if 50% of it is visible
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// Helper to get the currently displayed item in fullscreen
|
|
516
|
+
const getCurrentItem = useCallback(() => {
|
|
517
|
+
return selectedIndex >= 0 && selectedIndex < items.length
|
|
518
|
+
? items[selectedIndex]
|
|
519
|
+
: null;
|
|
520
|
+
}, [selectedIndex, items]);
|
|
521
|
+
|
|
522
|
+
// Handler for download button
|
|
523
|
+
const handleDownload = useCallback(() => {
|
|
524
|
+
const currentItem = getCurrentItem();
|
|
525
|
+
if (currentItem && onDownload) {
|
|
526
|
+
onDownload(currentItem);
|
|
527
|
+
}
|
|
528
|
+
}, [getCurrentItem, onDownload]);
|
|
529
|
+
|
|
530
|
+
// Handler for share button
|
|
531
|
+
const handleShare = useCallback(() => {
|
|
532
|
+
const currentItem = getCurrentItem();
|
|
533
|
+
if (currentItem && onShare) {
|
|
534
|
+
onShare(currentItem);
|
|
535
|
+
}
|
|
536
|
+
}, [getCurrentItem, onShare]);
|
|
537
|
+
|
|
538
|
+
// Render function for each item in the grid gallery
|
|
539
|
+
const renderGalleryItem = useCallback(
|
|
540
|
+
({ item, index }: { item: GalleryItem; index: number }) => (
|
|
541
|
+
<Pressable
|
|
542
|
+
key={item.id}
|
|
543
|
+
style={[
|
|
544
|
+
{
|
|
545
|
+
width: itemWidth,
|
|
546
|
+
height: itemWidth * aspectRatio,
|
|
547
|
+
borderRadius,
|
|
548
|
+
},
|
|
549
|
+
]}
|
|
550
|
+
onPress={() => handleItemPress(item, index)}
|
|
551
|
+
>
|
|
552
|
+
<Image
|
|
553
|
+
source={{ uri: item.thumbnail || item.uri }} // Use thumbnail if available, otherwise full URI
|
|
554
|
+
style={[styles.gridImage, { borderRadius }]}
|
|
555
|
+
contentFit='cover'
|
|
556
|
+
transition={200}
|
|
557
|
+
/>
|
|
558
|
+
|
|
559
|
+
{/* Render custom overlay if provided */}
|
|
560
|
+
{renderCustomOverlay && renderCustomOverlay(item, index)}
|
|
561
|
+
|
|
562
|
+
{/* Display title and description if enabled */}
|
|
563
|
+
{(showTitles || showDescriptions) && (
|
|
564
|
+
<View style={[styles.itemInfo]}>
|
|
565
|
+
{showTitles && item.title && (
|
|
566
|
+
<Text
|
|
567
|
+
variant='subtitle'
|
|
568
|
+
numberOfLines={1}
|
|
569
|
+
style={{ color: textColor }}
|
|
570
|
+
>
|
|
571
|
+
{item.title}
|
|
572
|
+
</Text>
|
|
573
|
+
)}
|
|
574
|
+
{showDescriptions && item.description && (
|
|
575
|
+
<Text
|
|
576
|
+
variant='caption'
|
|
577
|
+
numberOfLines={2}
|
|
578
|
+
style={{ color: mutedColor }}
|
|
579
|
+
>
|
|
580
|
+
{item.description}
|
|
581
|
+
</Text>
|
|
582
|
+
)}
|
|
583
|
+
</View>
|
|
584
|
+
)}
|
|
585
|
+
</Pressable>
|
|
586
|
+
),
|
|
587
|
+
[
|
|
588
|
+
itemWidth,
|
|
589
|
+
aspectRatio,
|
|
590
|
+
borderRadius,
|
|
591
|
+
handleItemPress,
|
|
592
|
+
renderCustomOverlay,
|
|
593
|
+
showTitles,
|
|
594
|
+
showDescriptions,
|
|
595
|
+
textColor,
|
|
596
|
+
mutedColor,
|
|
597
|
+
]
|
|
598
|
+
);
|
|
599
|
+
|
|
600
|
+
// Render function for each item in the fullscreen FlatList
|
|
601
|
+
const renderFullscreenItem = useCallback(
|
|
602
|
+
({ item, index }: { item: GalleryItem; index: number }) => (
|
|
603
|
+
<FullscreenImage
|
|
604
|
+
key={`fullscreen-${item.id}`} // Unique key for fullscreen items
|
|
605
|
+
item={item}
|
|
606
|
+
index={index}
|
|
607
|
+
selectedIndex={selectedIndex} // Pass selected index for zoom reset logic
|
|
608
|
+
enableZoom={enableZoom}
|
|
609
|
+
onSetCanSwipe={setFlatListScrollEnabled} // Pass the callback to control parent FlatList's scroll
|
|
610
|
+
/>
|
|
611
|
+
),
|
|
612
|
+
[enableZoom, selectedIndex]
|
|
613
|
+
);
|
|
614
|
+
|
|
615
|
+
// Render controls for the fullscreen modal (top and bottom bars)
|
|
616
|
+
const renderFullscreenControls = () => {
|
|
617
|
+
const currentItem = getCurrentItem();
|
|
618
|
+
|
|
619
|
+
return (
|
|
620
|
+
<View style={styles.fullscreenControls} pointerEvents='box-none'>
|
|
621
|
+
{/* Top controls (share, download, close) */}
|
|
622
|
+
<View style={[styles.topControls, { backgroundColor }]}>
|
|
623
|
+
<View style={styles.topRightControls}>
|
|
624
|
+
{enableDownload && onDownload && (
|
|
625
|
+
<Button size='icon' variant='ghost' onPress={handleDownload}>
|
|
626
|
+
<Download size={24} color={primary} />
|
|
627
|
+
</Button>
|
|
628
|
+
)}
|
|
629
|
+
{enableShare && onShare && (
|
|
630
|
+
<Button size='icon' variant='ghost' onPress={handleShare}>
|
|
631
|
+
<Share size={24} color={primary} />
|
|
632
|
+
</Button>
|
|
633
|
+
)}
|
|
634
|
+
</View>
|
|
635
|
+
|
|
636
|
+
<Button size='icon' variant='ghost' onPress={closeFullscreen}>
|
|
637
|
+
<X size={26} color={primary} />
|
|
638
|
+
</Button>
|
|
639
|
+
</View>
|
|
640
|
+
|
|
641
|
+
{/* Bottom controls (page, title, description, thumbnails) */}
|
|
642
|
+
<View style={[styles.bottomControls, { backgroundColor }]}>
|
|
643
|
+
{showPages && (
|
|
644
|
+
<Text
|
|
645
|
+
variant='caption'
|
|
646
|
+
style={{
|
|
647
|
+
textAlign: 'center',
|
|
648
|
+
marginBottom: 8,
|
|
649
|
+
color: mutedColor,
|
|
650
|
+
}}
|
|
651
|
+
>
|
|
652
|
+
{selectedIndex + 1} of {items.length}
|
|
653
|
+
</Text>
|
|
654
|
+
)}
|
|
655
|
+
|
|
656
|
+
{currentItem?.title && (
|
|
657
|
+
<Text
|
|
658
|
+
variant='subtitle'
|
|
659
|
+
style={{ textAlign: 'center', marginBottom: 8, color: textColor }}
|
|
660
|
+
numberOfLines={1}
|
|
661
|
+
>
|
|
662
|
+
{currentItem.title}
|
|
663
|
+
</Text>
|
|
664
|
+
)}
|
|
665
|
+
|
|
666
|
+
{currentItem?.description && (
|
|
667
|
+
<Text
|
|
668
|
+
variant='caption'
|
|
669
|
+
style={{
|
|
670
|
+
textAlign: 'center',
|
|
671
|
+
marginBottom: 16,
|
|
672
|
+
color: mutedColor,
|
|
673
|
+
}}
|
|
674
|
+
numberOfLines={2}
|
|
675
|
+
>
|
|
676
|
+
{currentItem.description}
|
|
677
|
+
</Text>
|
|
678
|
+
)}
|
|
679
|
+
|
|
680
|
+
{/* Horizontal FlatList for thumbnails */}
|
|
681
|
+
<FlatList
|
|
682
|
+
ref={thumbnailFlatListRef}
|
|
683
|
+
data={items}
|
|
684
|
+
renderItem={({ item, index }) => (
|
|
685
|
+
<Pressable
|
|
686
|
+
style={[
|
|
687
|
+
styles.thumbnailItem,
|
|
688
|
+
selectedIndex === index && {
|
|
689
|
+
borderColor: secondary, // Highlight selected thumbnail
|
|
690
|
+
borderWidth: 2,
|
|
691
|
+
},
|
|
692
|
+
]}
|
|
693
|
+
onPress={() => handleThumbnailPress(index)}
|
|
694
|
+
>
|
|
695
|
+
<Image
|
|
696
|
+
source={{ uri: item.thumbnail || item.uri }}
|
|
697
|
+
style={styles.thumbnailImage}
|
|
698
|
+
contentFit='cover'
|
|
699
|
+
/>
|
|
700
|
+
</Pressable>
|
|
701
|
+
)}
|
|
702
|
+
keyExtractor={(item) => item.id}
|
|
703
|
+
horizontal
|
|
704
|
+
showsHorizontalScrollIndicator={false}
|
|
705
|
+
contentContainerStyle={styles.thumbnailContainer}
|
|
706
|
+
ItemSeparatorComponent={() => <View style={{ width: 8 }} />} // Spacing between thumbnails
|
|
707
|
+
getItemLayout={(data, index) => ({
|
|
708
|
+
length: 48, // Fixed item length for layout calculation
|
|
709
|
+
offset: 56 * index, // Offset for each item (item length + separator width)
|
|
710
|
+
index,
|
|
711
|
+
})}
|
|
712
|
+
/>
|
|
713
|
+
</View>
|
|
714
|
+
</View>
|
|
715
|
+
);
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// Render empty state if no items are provided
|
|
719
|
+
if (items.length === 0) {
|
|
720
|
+
return (
|
|
721
|
+
<View style={[styles.emptyState]}>
|
|
722
|
+
<Text variant='subtitle' style={{ color: mutedColor }}>
|
|
723
|
+
No images to display
|
|
724
|
+
</Text>
|
|
725
|
+
</View>
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
return (
|
|
730
|
+
// GestureHandlerRootView is required for React Native Gesture Handler to work
|
|
731
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
732
|
+
{/* ScrollView for the main gallery grid */}
|
|
733
|
+
<ScrollView
|
|
734
|
+
style={[styles.container, { backgroundColor }]}
|
|
735
|
+
contentContainerStyle={[styles.grid, { gap: spacing }]}
|
|
736
|
+
showsVerticalScrollIndicator={false}
|
|
737
|
+
// Measure the container width on layout to calculate item widths dynamically
|
|
738
|
+
onLayout={(event) => {
|
|
739
|
+
const { width } = event.nativeEvent.layout;
|
|
740
|
+
setContainerWidth(width);
|
|
741
|
+
}}
|
|
742
|
+
>
|
|
743
|
+
{/* Render each gallery item */}
|
|
744
|
+
{items.map((item, index) => renderGalleryItem({ item, index }))}
|
|
745
|
+
</ScrollView>
|
|
746
|
+
|
|
747
|
+
{/* Modal for fullscreen image view */}
|
|
748
|
+
<Modal
|
|
749
|
+
visible={isModalVisible}
|
|
750
|
+
transparent
|
|
751
|
+
animationType='fade'
|
|
752
|
+
onRequestClose={closeFullscreen}
|
|
753
|
+
>
|
|
754
|
+
<View style={{ flex: 1, backgroundColor }}>
|
|
755
|
+
{/* GestureHandlerRootView for gestures within the modal */}
|
|
756
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
757
|
+
{/* FlatList for horizontal swiping of fullscreen images */}
|
|
758
|
+
<FlatList
|
|
759
|
+
ref={fullscreenFlatListRef}
|
|
760
|
+
data={items}
|
|
761
|
+
renderItem={renderFullscreenItem}
|
|
762
|
+
keyExtractor={(item) => item.id}
|
|
763
|
+
horizontal
|
|
764
|
+
pagingEnabled // Enables snap-to-page behavior for horizontal swiping
|
|
765
|
+
showsHorizontalScrollIndicator={false}
|
|
766
|
+
onViewableItemsChanged={onViewableItemsChanged} // Detect when current image changes
|
|
767
|
+
viewabilityConfig={viewabilityConfig}
|
|
768
|
+
getItemLayout={(data, index) => ({
|
|
769
|
+
length: screenWidth, // Each item takes full screen width
|
|
770
|
+
offset: screenWidth * index,
|
|
771
|
+
index,
|
|
772
|
+
})}
|
|
773
|
+
scrollEnabled={flatListScrollEnabled} // Control FlatList scrolling based on zoom state
|
|
774
|
+
removeClippedSubviews={false} // Important for images that are partially off-screen due to zoom
|
|
775
|
+
initialNumToRender={3}
|
|
776
|
+
maxToRenderPerBatch={3}
|
|
777
|
+
windowSize={21}
|
|
778
|
+
/>
|
|
779
|
+
</GestureHandlerRootView>
|
|
780
|
+
{/* Render fullscreen controls overlay */}
|
|
781
|
+
{renderFullscreenControls()}
|
|
782
|
+
</View>
|
|
783
|
+
</Modal>
|
|
784
|
+
</GestureHandlerRootView>
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Stylesheet for the component
|
|
789
|
+
const styles = StyleSheet.create({
|
|
790
|
+
container: {
|
|
791
|
+
flex: 1,
|
|
792
|
+
},
|
|
793
|
+
grid: {
|
|
794
|
+
flexDirection: 'row',
|
|
795
|
+
flexWrap: 'wrap',
|
|
796
|
+
},
|
|
797
|
+
gridImage: {
|
|
798
|
+
flex: 1,
|
|
799
|
+
},
|
|
800
|
+
itemInfo: {
|
|
801
|
+
padding: 8,
|
|
802
|
+
},
|
|
803
|
+
emptyState: {
|
|
804
|
+
flex: 1,
|
|
805
|
+
justifyContent: 'center',
|
|
806
|
+
alignItems: 'center',
|
|
807
|
+
padding: 32,
|
|
808
|
+
borderRadius: BORDER_RADIUS,
|
|
809
|
+
margin: 16,
|
|
810
|
+
},
|
|
811
|
+
imageContainer: {
|
|
812
|
+
flex: 1,
|
|
813
|
+
width: screenWidth,
|
|
814
|
+
height: screenHeight,
|
|
815
|
+
justifyContent: 'center',
|
|
816
|
+
alignItems: 'center',
|
|
817
|
+
},
|
|
818
|
+
fullscreenImage: {
|
|
819
|
+
width: screenWidth,
|
|
820
|
+
height: screenHeight,
|
|
821
|
+
},
|
|
822
|
+
fullscreenControls: {
|
|
823
|
+
position: 'absolute',
|
|
824
|
+
top: 0,
|
|
825
|
+
left: 0,
|
|
826
|
+
right: 0,
|
|
827
|
+
bottom: 0,
|
|
828
|
+
// Ensure controls don't block interaction with the image itself unless explicitly on a button
|
|
829
|
+
pointerEvents: 'box-none',
|
|
830
|
+
},
|
|
831
|
+
topControls: {
|
|
832
|
+
position: 'absolute',
|
|
833
|
+
top: 0,
|
|
834
|
+
left: 0,
|
|
835
|
+
right: 0,
|
|
836
|
+
flexDirection: 'row',
|
|
837
|
+
justifyContent: 'space-between',
|
|
838
|
+
alignItems: 'center',
|
|
839
|
+
paddingTop: 56, // Adjust for safe area (notch, status bar)
|
|
840
|
+
paddingHorizontal: 16,
|
|
841
|
+
paddingBottom: 16,
|
|
842
|
+
},
|
|
843
|
+
topRightControls: {
|
|
844
|
+
gap: 8,
|
|
845
|
+
flexDirection: 'row',
|
|
846
|
+
},
|
|
847
|
+
bottomControls: {
|
|
848
|
+
position: 'absolute',
|
|
849
|
+
bottom: 0,
|
|
850
|
+
left: 0,
|
|
851
|
+
right: 0,
|
|
852
|
+
padding: 16,
|
|
853
|
+
paddingBottom: 46, // Adjust for safe area (home indicator)
|
|
854
|
+
},
|
|
855
|
+
thumbnailContainer: {
|
|
856
|
+
paddingHorizontal: 16,
|
|
857
|
+
alignItems: 'center', // Vertically center thumbnails
|
|
858
|
+
},
|
|
859
|
+
thumbnailItem: {
|
|
860
|
+
width: 40,
|
|
861
|
+
height: 40,
|
|
862
|
+
borderRadius: 8,
|
|
863
|
+
borderWidth: 1,
|
|
864
|
+
overflow: 'hidden',
|
|
865
|
+
borderColor: 'transparent',
|
|
866
|
+
},
|
|
867
|
+
thumbnailImage: {
|
|
868
|
+
width: '100%',
|
|
869
|
+
height: '100%',
|
|
870
|
+
},
|
|
871
|
+
});
|