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,1147 @@
|
|
|
1
|
+
import { BottomSheet, useBottomSheet } from '@/components/ui/bottom-sheet';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import { Icon } from '@/components/ui/icon';
|
|
4
|
+
import { ScrollView } from '@/components/ui/scroll-view';
|
|
5
|
+
import { Text } from '@/components/ui/text';
|
|
6
|
+
import { View } from '@/components/ui/view';
|
|
7
|
+
import { useColor } from '@/hooks/useColor';
|
|
8
|
+
import { BORDER_RADIUS, CORNERS, FONT_SIZE, HEIGHT } from '@/theme/globals';
|
|
9
|
+
import {
|
|
10
|
+
Calendar,
|
|
11
|
+
CalendarClock,
|
|
12
|
+
ChevronDown,
|
|
13
|
+
ChevronLeft,
|
|
14
|
+
ChevronRight,
|
|
15
|
+
Clock,
|
|
16
|
+
CalendarRange,
|
|
17
|
+
ArrowRight,
|
|
18
|
+
} from 'lucide-react-native';
|
|
19
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
20
|
+
import { TextStyle, TouchableOpacity, ViewStyle } from 'react-native';
|
|
21
|
+
|
|
22
|
+
export interface DateRange {
|
|
23
|
+
startDate: Date | null;
|
|
24
|
+
endDate: Date | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Conditional typing based on mode
|
|
28
|
+
interface BaseDatePickerProps {
|
|
29
|
+
label?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
style?: ViewStyle;
|
|
34
|
+
minimumDate?: Date;
|
|
35
|
+
maximumDate?: Date;
|
|
36
|
+
timeFormat?: '12' | '24';
|
|
37
|
+
variant?: 'filled' | 'outline' | 'group';
|
|
38
|
+
labelStyle?: TextStyle;
|
|
39
|
+
errorStyle?: TextStyle;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface DatePickerPropsRange extends BaseDatePickerProps {
|
|
43
|
+
mode: 'range';
|
|
44
|
+
value?: DateRange;
|
|
45
|
+
onChange?: (value: DateRange | undefined) => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface DatePickerPropsDate extends BaseDatePickerProps {
|
|
49
|
+
mode?: 'date' | 'time' | 'datetime';
|
|
50
|
+
value?: Date;
|
|
51
|
+
onChange?: (value: Date | undefined) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type DatePickerProps = DatePickerPropsRange | DatePickerPropsDate;
|
|
55
|
+
|
|
56
|
+
const MONTHS = [
|
|
57
|
+
'January',
|
|
58
|
+
'February',
|
|
59
|
+
'March',
|
|
60
|
+
'April',
|
|
61
|
+
'May',
|
|
62
|
+
'June',
|
|
63
|
+
'July',
|
|
64
|
+
'August',
|
|
65
|
+
'September',
|
|
66
|
+
'October',
|
|
67
|
+
'November',
|
|
68
|
+
'December',
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
72
|
+
|
|
73
|
+
// Generate year range (current year ± 50 years)
|
|
74
|
+
const currentYear = new Date().getFullYear();
|
|
75
|
+
const YEARS = Array.from({ length: 101 }, (_, i) => currentYear - 50 + i);
|
|
76
|
+
|
|
77
|
+
// Type guard to check if value is DateRange
|
|
78
|
+
const isDateRange = (
|
|
79
|
+
value: Date | DateRange | undefined
|
|
80
|
+
): value is DateRange => {
|
|
81
|
+
return (
|
|
82
|
+
value !== undefined &&
|
|
83
|
+
typeof value === 'object' &&
|
|
84
|
+
value !== null &&
|
|
85
|
+
'startDate' in value &&
|
|
86
|
+
'endDate' in value
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export function DatePicker(props: DatePickerProps) {
|
|
91
|
+
const {
|
|
92
|
+
label,
|
|
93
|
+
error,
|
|
94
|
+
placeholder = 'Select date',
|
|
95
|
+
disabled = false,
|
|
96
|
+
style,
|
|
97
|
+
minimumDate,
|
|
98
|
+
maximumDate,
|
|
99
|
+
timeFormat = '24',
|
|
100
|
+
variant = 'filled',
|
|
101
|
+
labelStyle,
|
|
102
|
+
errorStyle,
|
|
103
|
+
} = props;
|
|
104
|
+
|
|
105
|
+
const mode = props.mode || 'date';
|
|
106
|
+
const value = props.value;
|
|
107
|
+
const onChange = props.onChange;
|
|
108
|
+
|
|
109
|
+
const { isVisible, open, close } = useBottomSheet();
|
|
110
|
+
|
|
111
|
+
// Get the current date for navigation, prioritizing single date or range start date
|
|
112
|
+
const getCurrentDate = useCallback(() => {
|
|
113
|
+
if (mode === 'range') {
|
|
114
|
+
const rangeValue = isDateRange(value)
|
|
115
|
+
? value
|
|
116
|
+
: { startDate: null, endDate: null };
|
|
117
|
+
return rangeValue.startDate || new Date();
|
|
118
|
+
}
|
|
119
|
+
return (value as Date) || new Date();
|
|
120
|
+
}, [value, mode]);
|
|
121
|
+
|
|
122
|
+
const [currentDate, setCurrentDate] = useState(() => getCurrentDate());
|
|
123
|
+
const [viewMode, setViewMode] = useState<'date' | 'time' | 'month' | 'year'>(
|
|
124
|
+
'date'
|
|
125
|
+
);
|
|
126
|
+
const [showMonthPicker, setShowMonthPicker] = useState(false);
|
|
127
|
+
const [showYearPicker, setShowYearPicker] = useState(false);
|
|
128
|
+
|
|
129
|
+
// Range selection state for temporary storage during selection
|
|
130
|
+
const [tempRange, setTempRange] = useState<DateRange>(() =>
|
|
131
|
+
mode === 'range' && isDateRange(value)
|
|
132
|
+
? value
|
|
133
|
+
: { startDate: null, endDate: null }
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// Theme colors
|
|
137
|
+
const cardColor = useColor('card');
|
|
138
|
+
const borderColor = useColor('border');
|
|
139
|
+
const primaryColor = useColor('primary');
|
|
140
|
+
const primaryForegroundColor = useColor('primaryForeground');
|
|
141
|
+
const mutedColor = useColor('muted');
|
|
142
|
+
const textMutedColor = useColor('textMuted');
|
|
143
|
+
const mutedForegroundColor = useColor('mutedForeground');
|
|
144
|
+
const textColor = useColor('text');
|
|
145
|
+
const errorColor = useColor('red');
|
|
146
|
+
|
|
147
|
+
const formatDisplayValue = useCallback(() => {
|
|
148
|
+
if (mode === 'range') {
|
|
149
|
+
const rangeValue = isDateRange(value)
|
|
150
|
+
? value
|
|
151
|
+
: { startDate: null, endDate: null };
|
|
152
|
+
|
|
153
|
+
if (!rangeValue.startDate && !rangeValue.endDate) {
|
|
154
|
+
return placeholder;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const startStr = rangeValue.startDate
|
|
158
|
+
? rangeValue.startDate.toLocaleDateString()
|
|
159
|
+
: '';
|
|
160
|
+
const endStr = rangeValue.endDate
|
|
161
|
+
? rangeValue.endDate.toLocaleDateString()
|
|
162
|
+
: '';
|
|
163
|
+
|
|
164
|
+
if (startStr && endStr) {
|
|
165
|
+
return `${startStr} - ${endStr}`;
|
|
166
|
+
} else if (startStr) {
|
|
167
|
+
return `${startStr} - Select end date`;
|
|
168
|
+
} else if (endStr) {
|
|
169
|
+
return `Select start date - ${endStr}`;
|
|
170
|
+
}
|
|
171
|
+
return placeholder;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const dateValue = value as Date;
|
|
175
|
+
if (!dateValue) return placeholder;
|
|
176
|
+
|
|
177
|
+
switch (mode) {
|
|
178
|
+
case 'time':
|
|
179
|
+
if (timeFormat === '12') {
|
|
180
|
+
return dateValue.toLocaleTimeString([], {
|
|
181
|
+
hour: '2-digit',
|
|
182
|
+
minute: '2-digit',
|
|
183
|
+
hour12: true,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return dateValue.toLocaleTimeString([], {
|
|
187
|
+
hour: '2-digit',
|
|
188
|
+
minute: '2-digit',
|
|
189
|
+
hour12: false,
|
|
190
|
+
});
|
|
191
|
+
case 'datetime':
|
|
192
|
+
const timeStr =
|
|
193
|
+
timeFormat === '12'
|
|
194
|
+
? dateValue.toLocaleTimeString([], {
|
|
195
|
+
hour: '2-digit',
|
|
196
|
+
minute: '2-digit',
|
|
197
|
+
hour12: true,
|
|
198
|
+
})
|
|
199
|
+
: dateValue.toLocaleTimeString([], {
|
|
200
|
+
hour: '2-digit',
|
|
201
|
+
minute: '2-digit',
|
|
202
|
+
hour12: false,
|
|
203
|
+
});
|
|
204
|
+
return `${dateValue.toLocaleDateString()} ${timeStr}`;
|
|
205
|
+
default:
|
|
206
|
+
return dateValue.toLocaleDateString();
|
|
207
|
+
}
|
|
208
|
+
}, [value, mode, placeholder, timeFormat]);
|
|
209
|
+
|
|
210
|
+
// Helper function to check if a date is disabled
|
|
211
|
+
const isDateDisabled = useCallback(
|
|
212
|
+
(date: Date) => {
|
|
213
|
+
if (minimumDate && date < minimumDate) return true;
|
|
214
|
+
if (maximumDate && date > maximumDate) return true;
|
|
215
|
+
return false;
|
|
216
|
+
},
|
|
217
|
+
[minimumDate, maximumDate]
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
// Helper function to check if a date is in range
|
|
221
|
+
const isDateInRange = useCallback(
|
|
222
|
+
(date: Date) => {
|
|
223
|
+
if (mode !== 'range' || !tempRange.startDate || !tempRange.endDate) {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Create new date objects to avoid mutation
|
|
228
|
+
const startDate = new Date(tempRange.startDate);
|
|
229
|
+
const endDate = new Date(tempRange.endDate);
|
|
230
|
+
const checkDate = new Date(date);
|
|
231
|
+
|
|
232
|
+
// Normalize dates for comparison (remove time)
|
|
233
|
+
startDate.setHours(0, 0, 0, 0);
|
|
234
|
+
endDate.setHours(0, 0, 0, 0);
|
|
235
|
+
checkDate.setHours(0, 0, 0, 0);
|
|
236
|
+
|
|
237
|
+
return checkDate >= startDate && checkDate <= endDate;
|
|
238
|
+
},
|
|
239
|
+
[mode, tempRange]
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
// Helper function to check if a date is a range endpoint
|
|
243
|
+
const isRangeEndpoint = useCallback(
|
|
244
|
+
(date: Date) => {
|
|
245
|
+
if (mode !== 'range') {
|
|
246
|
+
return { isStart: false, isEnd: false };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const normalizedDate = new Date(date);
|
|
250
|
+
normalizedDate.setHours(0, 0, 0, 0);
|
|
251
|
+
|
|
252
|
+
const isStart =
|
|
253
|
+
tempRange.startDate &&
|
|
254
|
+
new Date(tempRange.startDate).setHours(0, 0, 0, 0) ===
|
|
255
|
+
normalizedDate.getTime();
|
|
256
|
+
const isEnd =
|
|
257
|
+
tempRange.endDate &&
|
|
258
|
+
new Date(tempRange.endDate).setHours(0, 0, 0, 0) ===
|
|
259
|
+
normalizedDate.getTime();
|
|
260
|
+
|
|
261
|
+
return { isStart: !!isStart, isEnd: !!isEnd };
|
|
262
|
+
},
|
|
263
|
+
[mode, tempRange]
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
// Memoized calendar calculations
|
|
267
|
+
const calendarData = useMemo(() => {
|
|
268
|
+
const year = currentDate.getFullYear();
|
|
269
|
+
const month = currentDate.getMonth();
|
|
270
|
+
|
|
271
|
+
// Get first day of month and number of days
|
|
272
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
273
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
274
|
+
|
|
275
|
+
// Create calendar grid with proper positioning
|
|
276
|
+
const weeks: (number | null)[][] = [];
|
|
277
|
+
let currentWeek: (number | null)[] = [];
|
|
278
|
+
|
|
279
|
+
// Fill empty cells for days before month starts
|
|
280
|
+
for (let i = 0; i < firstDay; i++) {
|
|
281
|
+
currentWeek.push(null);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Add days of the month
|
|
285
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
286
|
+
currentWeek.push(day);
|
|
287
|
+
|
|
288
|
+
// If week is complete (7 days) or it's the last day, start a new week
|
|
289
|
+
if (currentWeek.length === 7) {
|
|
290
|
+
weeks.push([...currentWeek]);
|
|
291
|
+
currentWeek = [];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Add the last incomplete week if it exists
|
|
296
|
+
if (currentWeek.length > 0) {
|
|
297
|
+
// Fill remaining cells with null
|
|
298
|
+
while (currentWeek.length < 7) {
|
|
299
|
+
currentWeek.push(null);
|
|
300
|
+
}
|
|
301
|
+
weeks.push(currentWeek);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return { weeks, year, month, daysInMonth };
|
|
305
|
+
}, [currentDate]);
|
|
306
|
+
|
|
307
|
+
const handleRangeSelect = (day: number) => {
|
|
308
|
+
const selectedDate = new Date(
|
|
309
|
+
currentDate.getFullYear(),
|
|
310
|
+
currentDate.getMonth(),
|
|
311
|
+
day
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// Check if date is disabled
|
|
315
|
+
if (isDateDisabled(selectedDate)) return;
|
|
316
|
+
|
|
317
|
+
// If no start date or both dates are selected, start fresh
|
|
318
|
+
if (!tempRange.startDate || (tempRange.startDate && tempRange.endDate)) {
|
|
319
|
+
setTempRange({
|
|
320
|
+
startDate: selectedDate,
|
|
321
|
+
endDate: null,
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
// We have a start date but no end date
|
|
325
|
+
const startDate = tempRange.startDate;
|
|
326
|
+
|
|
327
|
+
if (selectedDate < startDate) {
|
|
328
|
+
// If selected date is before start date, make it the new start date
|
|
329
|
+
setTempRange({
|
|
330
|
+
startDate: selectedDate,
|
|
331
|
+
endDate: null,
|
|
332
|
+
});
|
|
333
|
+
} else {
|
|
334
|
+
// Selected date is after start date, make it the end date
|
|
335
|
+
setTempRange({
|
|
336
|
+
startDate: startDate,
|
|
337
|
+
endDate: selectedDate,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const handleDateSelect = (day: number) => {
|
|
344
|
+
if (mode === 'range') {
|
|
345
|
+
handleRangeSelect(day);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const newDate = new Date(
|
|
350
|
+
currentDate.getFullYear(),
|
|
351
|
+
currentDate.getMonth(),
|
|
352
|
+
day
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
// Check if date is disabled
|
|
356
|
+
if (isDateDisabled(newDate)) return;
|
|
357
|
+
|
|
358
|
+
setCurrentDate(newDate);
|
|
359
|
+
|
|
360
|
+
if (mode === 'date') {
|
|
361
|
+
(onChange as (value: Date | undefined) => void)?.(newDate);
|
|
362
|
+
close();
|
|
363
|
+
} else if (mode === 'datetime') {
|
|
364
|
+
setViewMode('time');
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const handleTimeChange = (hours: number, minutes: number) => {
|
|
369
|
+
const newDate = new Date(currentDate);
|
|
370
|
+
newDate.setHours(hours, minutes, 0, 0);
|
|
371
|
+
setCurrentDate(newDate);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
const navigateMonth = (direction: 'prev' | 'next') => {
|
|
375
|
+
const newDate = new Date(currentDate);
|
|
376
|
+
if (direction === 'prev') {
|
|
377
|
+
newDate.setMonth(newDate.getMonth() - 1);
|
|
378
|
+
} else {
|
|
379
|
+
newDate.setMonth(newDate.getMonth() + 1);
|
|
380
|
+
}
|
|
381
|
+
setCurrentDate(newDate);
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const handleMonthSelect = (monthIndex: number) => {
|
|
385
|
+
const newDate = new Date(currentDate);
|
|
386
|
+
newDate.setMonth(monthIndex);
|
|
387
|
+
setCurrentDate(newDate);
|
|
388
|
+
setShowMonthPicker(false);
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
const handleYearSelect = (year: number) => {
|
|
392
|
+
const newDate = new Date(currentDate);
|
|
393
|
+
newDate.setFullYear(year);
|
|
394
|
+
setCurrentDate(newDate);
|
|
395
|
+
setShowYearPicker(false);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
const handleConfirm = () => {
|
|
399
|
+
if (mode === 'range') {
|
|
400
|
+
(onChange as (value: DateRange | undefined) => void)?.(tempRange);
|
|
401
|
+
} else {
|
|
402
|
+
(onChange as (value: Date | undefined) => void)?.(currentDate);
|
|
403
|
+
}
|
|
404
|
+
close();
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const resetToToday = () => {
|
|
408
|
+
const today = new Date();
|
|
409
|
+
setCurrentDate(today);
|
|
410
|
+
|
|
411
|
+
if (mode === 'range') {
|
|
412
|
+
setTempRange({ startDate: today, endDate: null });
|
|
413
|
+
} else if (mode === 'date') {
|
|
414
|
+
(onChange as (value: Date | undefined) => void)?.(today);
|
|
415
|
+
close();
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const clearSelection = () => {
|
|
420
|
+
if (mode === 'range') {
|
|
421
|
+
setTempRange({ startDate: null, endDate: null });
|
|
422
|
+
(onChange as (value: DateRange | undefined) => void)?.(undefined);
|
|
423
|
+
} else {
|
|
424
|
+
(onChange as (value: Date | undefined) => void)?.(undefined);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
const renderMonthYearHeader = () => (
|
|
429
|
+
<View
|
|
430
|
+
style={{
|
|
431
|
+
flexDirection: 'row',
|
|
432
|
+
justifyContent: 'space-between',
|
|
433
|
+
alignItems: 'center',
|
|
434
|
+
marginBottom: 24,
|
|
435
|
+
paddingHorizontal: 8,
|
|
436
|
+
}}
|
|
437
|
+
>
|
|
438
|
+
<TouchableOpacity
|
|
439
|
+
onPress={() => navigateMonth('prev')}
|
|
440
|
+
style={{
|
|
441
|
+
padding: 10,
|
|
442
|
+
borderRadius: CORNERS,
|
|
443
|
+
backgroundColor: mutedColor,
|
|
444
|
+
}}
|
|
445
|
+
>
|
|
446
|
+
<ChevronLeft size={20} color={textColor} />
|
|
447
|
+
</TouchableOpacity>
|
|
448
|
+
|
|
449
|
+
<View
|
|
450
|
+
style={{
|
|
451
|
+
flex: 1,
|
|
452
|
+
flexDirection: 'row',
|
|
453
|
+
justifyContent: 'center',
|
|
454
|
+
alignItems: 'center',
|
|
455
|
+
gap: 12,
|
|
456
|
+
marginHorizontal: 12,
|
|
457
|
+
}}
|
|
458
|
+
>
|
|
459
|
+
<TouchableOpacity
|
|
460
|
+
onPress={() => setShowMonthPicker(true)}
|
|
461
|
+
style={{
|
|
462
|
+
flex: 1,
|
|
463
|
+
flexDirection: 'row',
|
|
464
|
+
alignItems: 'center',
|
|
465
|
+
justifyContent: 'center',
|
|
466
|
+
paddingHorizontal: 12,
|
|
467
|
+
paddingVertical: 10,
|
|
468
|
+
borderRadius: CORNERS,
|
|
469
|
+
backgroundColor: mutedColor,
|
|
470
|
+
}}
|
|
471
|
+
>
|
|
472
|
+
<Text variant='subtitle' style={{ marginRight: 4 }}>
|
|
473
|
+
{MONTHS[calendarData.month]}
|
|
474
|
+
</Text>
|
|
475
|
+
<ChevronDown size={16} color={textColor} />
|
|
476
|
+
</TouchableOpacity>
|
|
477
|
+
|
|
478
|
+
<TouchableOpacity
|
|
479
|
+
onPress={() => setShowYearPicker(true)}
|
|
480
|
+
style={{
|
|
481
|
+
flex: 1,
|
|
482
|
+
flexDirection: 'row',
|
|
483
|
+
alignItems: 'center',
|
|
484
|
+
justifyContent: 'center',
|
|
485
|
+
paddingHorizontal: 16,
|
|
486
|
+
paddingVertical: 10,
|
|
487
|
+
borderRadius: CORNERS,
|
|
488
|
+
backgroundColor: mutedColor,
|
|
489
|
+
}}
|
|
490
|
+
>
|
|
491
|
+
<Text variant='subtitle' style={{ marginRight: 4 }}>
|
|
492
|
+
{calendarData.year}
|
|
493
|
+
</Text>
|
|
494
|
+
<ChevronDown size={16} color={textColor} />
|
|
495
|
+
</TouchableOpacity>
|
|
496
|
+
</View>
|
|
497
|
+
|
|
498
|
+
<TouchableOpacity
|
|
499
|
+
onPress={() => navigateMonth('next')}
|
|
500
|
+
style={{
|
|
501
|
+
padding: 10,
|
|
502
|
+
borderRadius: CORNERS,
|
|
503
|
+
backgroundColor: mutedColor,
|
|
504
|
+
}}
|
|
505
|
+
>
|
|
506
|
+
<ChevronRight size={20} color={textColor} />
|
|
507
|
+
</TouchableOpacity>
|
|
508
|
+
</View>
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
const renderCalendar = () => (
|
|
512
|
+
<View>
|
|
513
|
+
{renderMonthYearHeader()}
|
|
514
|
+
{/* Day headers */}
|
|
515
|
+
<View
|
|
516
|
+
style={{
|
|
517
|
+
flexDirection: 'row',
|
|
518
|
+
marginBottom: 12,
|
|
519
|
+
paddingHorizontal: 4,
|
|
520
|
+
}}
|
|
521
|
+
>
|
|
522
|
+
{DAYS.map((day) => (
|
|
523
|
+
<View
|
|
524
|
+
key={day}
|
|
525
|
+
style={{
|
|
526
|
+
flex: 1,
|
|
527
|
+
alignItems: 'center',
|
|
528
|
+
}}
|
|
529
|
+
>
|
|
530
|
+
<Text variant='caption' style={{ fontSize: 12, fontWeight: '600' }}>
|
|
531
|
+
{day}
|
|
532
|
+
</Text>
|
|
533
|
+
</View>
|
|
534
|
+
))}
|
|
535
|
+
</View>
|
|
536
|
+
|
|
537
|
+
{/* Calendar grid */}
|
|
538
|
+
<View style={{ paddingHorizontal: 4 }}>
|
|
539
|
+
{calendarData.weeks.map((week, weekIndex) => (
|
|
540
|
+
<View
|
|
541
|
+
key={weekIndex}
|
|
542
|
+
style={{
|
|
543
|
+
flexDirection: 'row',
|
|
544
|
+
marginBottom: 4,
|
|
545
|
+
}}
|
|
546
|
+
>
|
|
547
|
+
{week.map((day, dayIndex) => {
|
|
548
|
+
const dayDate = day
|
|
549
|
+
? new Date(calendarData.year, calendarData.month, day)
|
|
550
|
+
: null;
|
|
551
|
+
|
|
552
|
+
const isSelected =
|
|
553
|
+
day &&
|
|
554
|
+
value &&
|
|
555
|
+
!isDateRange(value) &&
|
|
556
|
+
value.getDate() === day &&
|
|
557
|
+
value.getMonth() === calendarData.month &&
|
|
558
|
+
value.getFullYear() === calendarData.year;
|
|
559
|
+
|
|
560
|
+
const isToday =
|
|
561
|
+
day &&
|
|
562
|
+
new Date().getDate() === day &&
|
|
563
|
+
new Date().getMonth() === calendarData.month &&
|
|
564
|
+
new Date().getFullYear() === calendarData.year;
|
|
565
|
+
|
|
566
|
+
const disabled = dayDate ? isDateDisabled(dayDate) : false;
|
|
567
|
+
|
|
568
|
+
// Range-specific styling
|
|
569
|
+
const inRange = dayDate ? isDateInRange(dayDate) : false;
|
|
570
|
+
const rangeEndpoints = dayDate
|
|
571
|
+
? isRangeEndpoint(dayDate)
|
|
572
|
+
: { isStart: false, isEnd: false };
|
|
573
|
+
|
|
574
|
+
return (
|
|
575
|
+
<View
|
|
576
|
+
key={dayIndex}
|
|
577
|
+
style={[
|
|
578
|
+
{
|
|
579
|
+
flex: 1,
|
|
580
|
+
alignItems: 'center',
|
|
581
|
+
backgroundColor:
|
|
582
|
+
mode === 'range' && inRange
|
|
583
|
+
? primaryColor
|
|
584
|
+
: 'transparent',
|
|
585
|
+
paddingHorizontal: mode === 'range' && inRange ? 0 : 0,
|
|
586
|
+
},
|
|
587
|
+
rangeEndpoints.isStart && {
|
|
588
|
+
borderTopLeftRadius: CORNERS,
|
|
589
|
+
borderBottomLeftRadius: CORNERS,
|
|
590
|
+
},
|
|
591
|
+
rangeEndpoints.isEnd && {
|
|
592
|
+
borderTopRightRadius: CORNERS,
|
|
593
|
+
borderBottomRightRadius: CORNERS,
|
|
594
|
+
},
|
|
595
|
+
]}
|
|
596
|
+
>
|
|
597
|
+
{day ? (
|
|
598
|
+
<TouchableOpacity
|
|
599
|
+
onPress={() => !disabled && handleDateSelect(day)}
|
|
600
|
+
disabled={disabled}
|
|
601
|
+
style={[
|
|
602
|
+
{
|
|
603
|
+
width: 40,
|
|
604
|
+
height: 40,
|
|
605
|
+
borderRadius:
|
|
606
|
+
rangeEndpoints.isStart || rangeEndpoints.isEnd
|
|
607
|
+
? 0
|
|
608
|
+
: CORNERS,
|
|
609
|
+
backgroundColor:
|
|
610
|
+
rangeEndpoints.isStart || rangeEndpoints.isEnd
|
|
611
|
+
? primaryColor
|
|
612
|
+
: inRange
|
|
613
|
+
? primaryColor
|
|
614
|
+
: isSelected
|
|
615
|
+
? primaryColor
|
|
616
|
+
: 'transparent',
|
|
617
|
+
borderWidth:
|
|
618
|
+
isToday && !isSelected && !inRange ? 1 : 0,
|
|
619
|
+
borderColor: primaryColor,
|
|
620
|
+
justifyContent: 'center',
|
|
621
|
+
alignItems: 'center',
|
|
622
|
+
opacity: disabled ? 0.3 : 1,
|
|
623
|
+
},
|
|
624
|
+
rangeEndpoints.isStart && {
|
|
625
|
+
borderTopLeftRadius: CORNERS,
|
|
626
|
+
borderBottomLeftRadius: CORNERS,
|
|
627
|
+
},
|
|
628
|
+
rangeEndpoints.isEnd && {
|
|
629
|
+
borderTopRightRadius: CORNERS,
|
|
630
|
+
borderBottomRightRadius: CORNERS,
|
|
631
|
+
},
|
|
632
|
+
]}
|
|
633
|
+
>
|
|
634
|
+
<Text
|
|
635
|
+
style={{
|
|
636
|
+
color:
|
|
637
|
+
rangeEndpoints.isStart || rangeEndpoints.isEnd
|
|
638
|
+
? primaryForegroundColor
|
|
639
|
+
: inRange
|
|
640
|
+
? primaryForegroundColor
|
|
641
|
+
: isSelected
|
|
642
|
+
? primaryForegroundColor
|
|
643
|
+
: disabled
|
|
644
|
+
? mutedForegroundColor
|
|
645
|
+
: textColor,
|
|
646
|
+
fontWeight:
|
|
647
|
+
rangeEndpoints.isStart ||
|
|
648
|
+
rangeEndpoints.isEnd ||
|
|
649
|
+
isSelected ||
|
|
650
|
+
isToday
|
|
651
|
+
? '600'
|
|
652
|
+
: '400',
|
|
653
|
+
fontSize: FONT_SIZE,
|
|
654
|
+
}}
|
|
655
|
+
>
|
|
656
|
+
{day}
|
|
657
|
+
</Text>
|
|
658
|
+
</TouchableOpacity>
|
|
659
|
+
) : (
|
|
660
|
+
<View style={{ width: 40, height: 40 }} />
|
|
661
|
+
)}
|
|
662
|
+
</View>
|
|
663
|
+
);
|
|
664
|
+
})}
|
|
665
|
+
</View>
|
|
666
|
+
))}
|
|
667
|
+
</View>
|
|
668
|
+
|
|
669
|
+
{/* Range selection info */}
|
|
670
|
+
{mode === 'range' && (
|
|
671
|
+
<View
|
|
672
|
+
style={{
|
|
673
|
+
flexDirection: 'row',
|
|
674
|
+
alignItems: 'center',
|
|
675
|
+
justifyContent: 'space-between',
|
|
676
|
+
marginTop: 16,
|
|
677
|
+
padding: 20,
|
|
678
|
+
paddingHorizontal: 36,
|
|
679
|
+
backgroundColor: mutedColor,
|
|
680
|
+
borderRadius: BORDER_RADIUS,
|
|
681
|
+
}}
|
|
682
|
+
>
|
|
683
|
+
<Text variant='subtitle' style={{ flex: 1 }}>
|
|
684
|
+
{tempRange.startDate
|
|
685
|
+
? `${tempRange.startDate.toLocaleDateString()}`
|
|
686
|
+
: 'Start date'}
|
|
687
|
+
</Text>
|
|
688
|
+
|
|
689
|
+
<View
|
|
690
|
+
style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
|
|
691
|
+
>
|
|
692
|
+
<ArrowRight color={textColor} strokeWidth={3} />
|
|
693
|
+
</View>
|
|
694
|
+
|
|
695
|
+
<Text variant='subtitle' style={{ flex: 1, textAlign: 'right' }}>
|
|
696
|
+
{tempRange.endDate
|
|
697
|
+
? `${tempRange.endDate.toLocaleDateString()}`
|
|
698
|
+
: 'End date'}
|
|
699
|
+
</Text>
|
|
700
|
+
</View>
|
|
701
|
+
)}
|
|
702
|
+
</View>
|
|
703
|
+
);
|
|
704
|
+
|
|
705
|
+
const renderTimePicker = () => {
|
|
706
|
+
const selectedHours = currentDate.getHours();
|
|
707
|
+
const selectedMinutes = currentDate.getMinutes();
|
|
708
|
+
|
|
709
|
+
const isPM = selectedHours >= 12;
|
|
710
|
+
|
|
711
|
+
return (
|
|
712
|
+
<View style={{ height: 300 }}>
|
|
713
|
+
<View
|
|
714
|
+
style={{
|
|
715
|
+
flexDirection: 'row',
|
|
716
|
+
flex: 1,
|
|
717
|
+
gap: 16,
|
|
718
|
+
}}
|
|
719
|
+
>
|
|
720
|
+
{/* Hours */}
|
|
721
|
+
<View style={{ flex: 1 }}>
|
|
722
|
+
<Text
|
|
723
|
+
variant='caption'
|
|
724
|
+
style={{ textAlign: 'center', marginBottom: 12 }}
|
|
725
|
+
>
|
|
726
|
+
Hours
|
|
727
|
+
</Text>
|
|
728
|
+
<ScrollView
|
|
729
|
+
showsVerticalScrollIndicator={false}
|
|
730
|
+
contentContainerStyle={{
|
|
731
|
+
paddingVertical: 20,
|
|
732
|
+
}}
|
|
733
|
+
>
|
|
734
|
+
{Array.from({ length: timeFormat === '12' ? 12 : 24 }, (_, i) =>
|
|
735
|
+
timeFormat === '12' ? (i === 0 ? 12 : i) : i
|
|
736
|
+
).map((hour) => {
|
|
737
|
+
const actualHour =
|
|
738
|
+
timeFormat === '12'
|
|
739
|
+
? hour === 12
|
|
740
|
+
? isPM
|
|
741
|
+
? 12
|
|
742
|
+
: 0
|
|
743
|
+
: isPM
|
|
744
|
+
? hour + 12
|
|
745
|
+
: hour
|
|
746
|
+
: hour;
|
|
747
|
+
|
|
748
|
+
const isSelected = actualHour === selectedHours;
|
|
749
|
+
|
|
750
|
+
return (
|
|
751
|
+
<TouchableOpacity
|
|
752
|
+
key={hour}
|
|
753
|
+
onPress={() =>
|
|
754
|
+
handleTimeChange(actualHour, selectedMinutes)
|
|
755
|
+
}
|
|
756
|
+
style={{
|
|
757
|
+
paddingVertical: 12,
|
|
758
|
+
paddingHorizontal: 16,
|
|
759
|
+
borderRadius: CORNERS,
|
|
760
|
+
backgroundColor: isSelected
|
|
761
|
+
? primaryColor
|
|
762
|
+
: 'transparent',
|
|
763
|
+
marginVertical: 2,
|
|
764
|
+
alignItems: 'center',
|
|
765
|
+
}}
|
|
766
|
+
>
|
|
767
|
+
<Text
|
|
768
|
+
style={{
|
|
769
|
+
color: isSelected ? primaryForegroundColor : textColor,
|
|
770
|
+
fontWeight: isSelected ? '600' : '400',
|
|
771
|
+
fontSize: FONT_SIZE,
|
|
772
|
+
}}
|
|
773
|
+
>
|
|
774
|
+
{hour.toString().padStart(2, '0')}
|
|
775
|
+
</Text>
|
|
776
|
+
</TouchableOpacity>
|
|
777
|
+
);
|
|
778
|
+
})}
|
|
779
|
+
</ScrollView>
|
|
780
|
+
</View>
|
|
781
|
+
|
|
782
|
+
{/* Minutes */}
|
|
783
|
+
<View style={{ flex: 1 }}>
|
|
784
|
+
<Text
|
|
785
|
+
variant='caption'
|
|
786
|
+
style={{ textAlign: 'center', marginBottom: 12 }}
|
|
787
|
+
>
|
|
788
|
+
Minutes
|
|
789
|
+
</Text>
|
|
790
|
+
<ScrollView
|
|
791
|
+
showsVerticalScrollIndicator={false}
|
|
792
|
+
contentContainerStyle={{
|
|
793
|
+
paddingVertical: 20,
|
|
794
|
+
}}
|
|
795
|
+
>
|
|
796
|
+
{Array.from({ length: 12 }, (_, i) => i * 5).map((minute) => (
|
|
797
|
+
<TouchableOpacity
|
|
798
|
+
key={minute}
|
|
799
|
+
onPress={() => handleTimeChange(selectedHours, minute)}
|
|
800
|
+
style={{
|
|
801
|
+
paddingVertical: 12,
|
|
802
|
+
paddingHorizontal: 16,
|
|
803
|
+
borderRadius: CORNERS,
|
|
804
|
+
backgroundColor:
|
|
805
|
+
minute === selectedMinutes ? primaryColor : 'transparent',
|
|
806
|
+
marginVertical: 2,
|
|
807
|
+
alignItems: 'center',
|
|
808
|
+
}}
|
|
809
|
+
>
|
|
810
|
+
<Text
|
|
811
|
+
style={{
|
|
812
|
+
color:
|
|
813
|
+
minute === selectedMinutes
|
|
814
|
+
? primaryForegroundColor
|
|
815
|
+
: textColor,
|
|
816
|
+
fontWeight: minute === selectedMinutes ? '600' : '400',
|
|
817
|
+
fontSize: FONT_SIZE,
|
|
818
|
+
}}
|
|
819
|
+
>
|
|
820
|
+
{minute.toString().padStart(2, '0')}
|
|
821
|
+
</Text>
|
|
822
|
+
</TouchableOpacity>
|
|
823
|
+
))}
|
|
824
|
+
</ScrollView>
|
|
825
|
+
</View>
|
|
826
|
+
|
|
827
|
+
{/* AM/PM picker for 12-hour format */}
|
|
828
|
+
{timeFormat === '12' && (
|
|
829
|
+
<View style={{ flex: 0.5 }}>
|
|
830
|
+
<Text
|
|
831
|
+
variant='caption'
|
|
832
|
+
style={{ textAlign: 'center', marginBottom: 12 }}
|
|
833
|
+
>
|
|
834
|
+
Period
|
|
835
|
+
</Text>
|
|
836
|
+
<View
|
|
837
|
+
style={{
|
|
838
|
+
paddingVertical: 20,
|
|
839
|
+
gap: 8,
|
|
840
|
+
}}
|
|
841
|
+
>
|
|
842
|
+
{['AM', 'PM'].map((period) => {
|
|
843
|
+
const isAM = period === 'AM';
|
|
844
|
+
const isSelected = isAM ? !isPM : isPM;
|
|
845
|
+
|
|
846
|
+
return (
|
|
847
|
+
<TouchableOpacity
|
|
848
|
+
key={period}
|
|
849
|
+
onPress={() => {
|
|
850
|
+
const newHours = isAM
|
|
851
|
+
? selectedHours >= 12
|
|
852
|
+
? selectedHours - 12
|
|
853
|
+
: selectedHours
|
|
854
|
+
: selectedHours < 12
|
|
855
|
+
? selectedHours + 12
|
|
856
|
+
: selectedHours;
|
|
857
|
+
handleTimeChange(newHours, selectedMinutes);
|
|
858
|
+
}}
|
|
859
|
+
style={{
|
|
860
|
+
paddingVertical: 12,
|
|
861
|
+
paddingHorizontal: 16,
|
|
862
|
+
borderRadius: CORNERS,
|
|
863
|
+
backgroundColor: isSelected
|
|
864
|
+
? primaryColor
|
|
865
|
+
: 'transparent',
|
|
866
|
+
alignItems: 'center',
|
|
867
|
+
}}
|
|
868
|
+
>
|
|
869
|
+
<Text
|
|
870
|
+
style={{
|
|
871
|
+
color: isSelected
|
|
872
|
+
? primaryForegroundColor
|
|
873
|
+
: textColor,
|
|
874
|
+
fontWeight: isSelected ? '600' : '400',
|
|
875
|
+
fontSize: FONT_SIZE,
|
|
876
|
+
}}
|
|
877
|
+
>
|
|
878
|
+
{period}
|
|
879
|
+
</Text>
|
|
880
|
+
</TouchableOpacity>
|
|
881
|
+
);
|
|
882
|
+
})}
|
|
883
|
+
</View>
|
|
884
|
+
</View>
|
|
885
|
+
)}
|
|
886
|
+
</View>
|
|
887
|
+
</View>
|
|
888
|
+
);
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
const renderMonthPicker = () => (
|
|
892
|
+
<View style={{ height: 300 }}>
|
|
893
|
+
<ScrollView
|
|
894
|
+
showsVerticalScrollIndicator={false}
|
|
895
|
+
contentContainerStyle={{
|
|
896
|
+
paddingVertical: 20,
|
|
897
|
+
}}
|
|
898
|
+
>
|
|
899
|
+
{MONTHS.map((month, index) => (
|
|
900
|
+
<TouchableOpacity
|
|
901
|
+
key={month}
|
|
902
|
+
onPress={() => handleMonthSelect(index)}
|
|
903
|
+
style={{
|
|
904
|
+
paddingVertical: 16,
|
|
905
|
+
paddingHorizontal: 20,
|
|
906
|
+
borderRadius: CORNERS,
|
|
907
|
+
backgroundColor:
|
|
908
|
+
index === calendarData.month ? primaryColor : 'transparent',
|
|
909
|
+
marginVertical: 2,
|
|
910
|
+
alignItems: 'center',
|
|
911
|
+
}}
|
|
912
|
+
>
|
|
913
|
+
<Text
|
|
914
|
+
style={{
|
|
915
|
+
color:
|
|
916
|
+
index === calendarData.month
|
|
917
|
+
? primaryForegroundColor
|
|
918
|
+
: textColor,
|
|
919
|
+
fontWeight: index === calendarData.month ? '600' : '400',
|
|
920
|
+
fontSize: FONT_SIZE,
|
|
921
|
+
}}
|
|
922
|
+
>
|
|
923
|
+
{month}
|
|
924
|
+
</Text>
|
|
925
|
+
</TouchableOpacity>
|
|
926
|
+
))}
|
|
927
|
+
</ScrollView>
|
|
928
|
+
</View>
|
|
929
|
+
);
|
|
930
|
+
|
|
931
|
+
const renderYearPicker = () => (
|
|
932
|
+
<View style={{ height: 300 }}>
|
|
933
|
+
<ScrollView
|
|
934
|
+
showsVerticalScrollIndicator={false}
|
|
935
|
+
contentContainerStyle={{
|
|
936
|
+
paddingVertical: 20,
|
|
937
|
+
}}
|
|
938
|
+
>
|
|
939
|
+
{YEARS.map((year) => (
|
|
940
|
+
<TouchableOpacity
|
|
941
|
+
key={year}
|
|
942
|
+
onPress={() => handleYearSelect(year)}
|
|
943
|
+
style={{
|
|
944
|
+
paddingVertical: 16,
|
|
945
|
+
paddingHorizontal: 20,
|
|
946
|
+
borderRadius: CORNERS,
|
|
947
|
+
backgroundColor:
|
|
948
|
+
year === calendarData.year ? primaryColor : 'transparent',
|
|
949
|
+
marginVertical: 2,
|
|
950
|
+
alignItems: 'center',
|
|
951
|
+
}}
|
|
952
|
+
>
|
|
953
|
+
<Text
|
|
954
|
+
style={{
|
|
955
|
+
color:
|
|
956
|
+
year === calendarData.year
|
|
957
|
+
? primaryForegroundColor
|
|
958
|
+
: textColor,
|
|
959
|
+
fontWeight: year === calendarData.year ? '600' : '400',
|
|
960
|
+
fontSize: FONT_SIZE,
|
|
961
|
+
}}
|
|
962
|
+
>
|
|
963
|
+
{year}
|
|
964
|
+
</Text>
|
|
965
|
+
</TouchableOpacity>
|
|
966
|
+
))}
|
|
967
|
+
</ScrollView>
|
|
968
|
+
</View>
|
|
969
|
+
);
|
|
970
|
+
|
|
971
|
+
const getBottomSheetContent = () => {
|
|
972
|
+
if (showMonthPicker) return renderMonthPicker();
|
|
973
|
+
if (showYearPicker) return renderYearPicker();
|
|
974
|
+
|
|
975
|
+
if (mode === 'datetime') {
|
|
976
|
+
return viewMode === 'date' ? renderCalendar() : renderTimePicker();
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
if (mode === 'time') return renderTimePicker();
|
|
980
|
+
return renderCalendar();
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
const getBottomSheetTitle = () => {
|
|
984
|
+
if (showMonthPicker) return 'Select Month';
|
|
985
|
+
if (showYearPicker) return 'Select Year';
|
|
986
|
+
|
|
987
|
+
if (mode === 'datetime') {
|
|
988
|
+
return viewMode === 'date' ? 'Select Date' : 'Select Time';
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
if (mode === 'time') return 'Select Time';
|
|
992
|
+
|
|
993
|
+
if (mode === 'range') return 'Select Range';
|
|
994
|
+
|
|
995
|
+
return 'Select Date';
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
const handleOpenPicker = () => {
|
|
999
|
+
setCurrentDate(new Date());
|
|
1000
|
+
setViewMode('date');
|
|
1001
|
+
setShowMonthPicker(false);
|
|
1002
|
+
setShowYearPicker(false);
|
|
1003
|
+
open();
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
const triggerStyle: ViewStyle = {
|
|
1007
|
+
width: '100%',
|
|
1008
|
+
flexDirection: 'row',
|
|
1009
|
+
alignItems: 'center',
|
|
1010
|
+
paddingHorizontal: variant === 'group' ? 0 : 16,
|
|
1011
|
+
borderWidth: variant === 'group' ? 0 : 1,
|
|
1012
|
+
borderColor: variant === 'outline' ? borderColor : cardColor,
|
|
1013
|
+
borderRadius: CORNERS,
|
|
1014
|
+
backgroundColor: variant === 'filled' ? cardColor : 'transparent',
|
|
1015
|
+
minHeight: variant === 'group' ? 'auto' : HEIGHT,
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
return (
|
|
1019
|
+
<>
|
|
1020
|
+
<TouchableOpacity
|
|
1021
|
+
style={[triggerStyle, disabled && { opacity: 0.5 }, style]}
|
|
1022
|
+
onPress={handleOpenPicker}
|
|
1023
|
+
disabled={disabled}
|
|
1024
|
+
>
|
|
1025
|
+
<View
|
|
1026
|
+
style={{
|
|
1027
|
+
flex: 1,
|
|
1028
|
+
flexDirection: 'row',
|
|
1029
|
+
alignItems: 'center',
|
|
1030
|
+
gap: 8,
|
|
1031
|
+
}}
|
|
1032
|
+
>
|
|
1033
|
+
<View
|
|
1034
|
+
style={{
|
|
1035
|
+
width: label ? 120 : 'auto',
|
|
1036
|
+
flexDirection: 'row',
|
|
1037
|
+
alignItems: 'center',
|
|
1038
|
+
gap: 8,
|
|
1039
|
+
}}
|
|
1040
|
+
>
|
|
1041
|
+
{mode === 'time' ? (
|
|
1042
|
+
<Icon name={Clock} size={20} strokeWidth={1} />
|
|
1043
|
+
) : mode === 'datetime' ? (
|
|
1044
|
+
<Icon name={CalendarClock} size={20} strokeWidth={1} />
|
|
1045
|
+
) : mode === 'range' ? (
|
|
1046
|
+
<Icon name={CalendarRange} size={20} strokeWidth={1} />
|
|
1047
|
+
) : (
|
|
1048
|
+
<Icon name={Calendar} size={20} strokeWidth={1} />
|
|
1049
|
+
)}
|
|
1050
|
+
|
|
1051
|
+
{/* Label takes 1/3 of available width when present */}
|
|
1052
|
+
{label && (
|
|
1053
|
+
<View style={{ flex: 1 }}>
|
|
1054
|
+
<Text
|
|
1055
|
+
variant='caption'
|
|
1056
|
+
numberOfLines={1}
|
|
1057
|
+
ellipsizeMode='tail'
|
|
1058
|
+
style={[
|
|
1059
|
+
{
|
|
1060
|
+
color: error ? errorColor : textMutedColor,
|
|
1061
|
+
},
|
|
1062
|
+
labelStyle,
|
|
1063
|
+
]}
|
|
1064
|
+
>
|
|
1065
|
+
{label}
|
|
1066
|
+
</Text>
|
|
1067
|
+
</View>
|
|
1068
|
+
)}
|
|
1069
|
+
</View>
|
|
1070
|
+
|
|
1071
|
+
{/* Text takes 2/3 of available width when label is present, or full width when no label */}
|
|
1072
|
+
<View style={{ flex: 1 }}>
|
|
1073
|
+
<Text
|
|
1074
|
+
numberOfLines={1}
|
|
1075
|
+
ellipsizeMode='tail'
|
|
1076
|
+
style={{
|
|
1077
|
+
color: value ? textColor : textMutedColor,
|
|
1078
|
+
fontSize: FONT_SIZE,
|
|
1079
|
+
}}
|
|
1080
|
+
>
|
|
1081
|
+
{formatDisplayValue()}
|
|
1082
|
+
</Text>
|
|
1083
|
+
</View>
|
|
1084
|
+
</View>
|
|
1085
|
+
</TouchableOpacity>
|
|
1086
|
+
|
|
1087
|
+
<BottomSheet
|
|
1088
|
+
isVisible={isVisible}
|
|
1089
|
+
onClose={() => {
|
|
1090
|
+
close();
|
|
1091
|
+
setShowMonthPicker(false);
|
|
1092
|
+
setShowYearPicker(false);
|
|
1093
|
+
}}
|
|
1094
|
+
title={getBottomSheetTitle()}
|
|
1095
|
+
snapPoints={[0.7]}
|
|
1096
|
+
disablePanGesture={showMonthPicker || showYearPicker}
|
|
1097
|
+
>
|
|
1098
|
+
<View style={{ flex: 1 }}>
|
|
1099
|
+
{getBottomSheetContent()}
|
|
1100
|
+
|
|
1101
|
+
<View
|
|
1102
|
+
style={{
|
|
1103
|
+
flexDirection: 'row',
|
|
1104
|
+
justifyContent: 'space-between',
|
|
1105
|
+
alignItems: 'center',
|
|
1106
|
+
paddingTop: 20,
|
|
1107
|
+
gap: 12,
|
|
1108
|
+
}}
|
|
1109
|
+
>
|
|
1110
|
+
<View
|
|
1111
|
+
style={{
|
|
1112
|
+
flexDirection: 'row',
|
|
1113
|
+
gap: 8,
|
|
1114
|
+
}}
|
|
1115
|
+
>
|
|
1116
|
+
<Button variant='outline' onPress={resetToToday}>
|
|
1117
|
+
Today
|
|
1118
|
+
</Button>
|
|
1119
|
+
|
|
1120
|
+
<Button
|
|
1121
|
+
variant='outline'
|
|
1122
|
+
onPress={() => {
|
|
1123
|
+
close();
|
|
1124
|
+
setShowMonthPicker(false);
|
|
1125
|
+
setShowYearPicker(false);
|
|
1126
|
+
clearSelection();
|
|
1127
|
+
}}
|
|
1128
|
+
>
|
|
1129
|
+
{mode === 'range' ? 'Clear' : 'Cancel'}
|
|
1130
|
+
</Button>
|
|
1131
|
+
</View>
|
|
1132
|
+
|
|
1133
|
+
{mode === 'datetime' && viewMode === 'date' ? (
|
|
1134
|
+
<Button onPress={() => setViewMode('time')} style={{ flex: 1 }}>
|
|
1135
|
+
Next
|
|
1136
|
+
</Button>
|
|
1137
|
+
) : (
|
|
1138
|
+
<Button onPress={handleConfirm} style={{ flex: 1 }}>
|
|
1139
|
+
Done
|
|
1140
|
+
</Button>
|
|
1141
|
+
)}
|
|
1142
|
+
</View>
|
|
1143
|
+
</View>
|
|
1144
|
+
</BottomSheet>
|
|
1145
|
+
</>
|
|
1146
|
+
);
|
|
1147
|
+
}
|