@codeimplants/ui-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -0
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.js +2 -0
- package/dist/adapters/supportAdapter.d.ts +87 -0
- package/dist/adapters/supportAdapter.js +99 -0
- package/dist/client.d.ts +55 -0
- package/dist/client.js +229 -0
- package/dist/components/IconLibrary.d.ts +23 -0
- package/dist/components/IconLibrary.js +19 -0
- package/dist/components/RetryIndicator.d.ts +5 -0
- package/dist/components/RetryIndicator.js +208 -0
- package/dist/components/SupportContactCard.d.ts +10 -0
- package/dist/components/SupportContactCard.js +140 -0
- package/dist/components/buttons/PrimaryButton.d.ts +19 -0
- package/dist/components/buttons/PrimaryButton.js +42 -0
- package/dist/components/buttons/SecondaryButton.d.ts +20 -0
- package/dist/components/buttons/SecondaryButton.js +37 -0
- package/dist/components/buttons/index.d.ts +2 -0
- package/dist/components/buttons/index.js +3 -0
- package/dist/components/cards/ContentCard.d.ts +16 -0
- package/dist/components/cards/ContentCard.js +24 -0
- package/dist/components/cards/InfoCard.d.ts +9 -0
- package/dist/components/cards/InfoCard.js +51 -0
- package/dist/components/cards/TipsCard.d.ts +11 -0
- package/dist/components/cards/TipsCard.js +70 -0
- package/dist/components/cards/WarningCard.d.ts +11 -0
- package/dist/components/cards/WarningCard.js +80 -0
- package/dist/components/cards/WhatsNewCard.d.ts +15 -0
- package/dist/components/cards/WhatsNewCard.js +79 -0
- package/dist/components/cards/index.d.ts +5 -0
- package/dist/components/cards/index.js +6 -0
- package/dist/components/feedback/ExpandableSection.d.ts +8 -0
- package/dist/components/feedback/ExpandableSection.js +44 -0
- package/dist/components/feedback/SecurityBanner.d.ts +9 -0
- package/dist/components/feedback/SecurityBanner.js +49 -0
- package/dist/components/feedback/SpeedBadge.d.ts +9 -0
- package/dist/components/feedback/SpeedBadge.js +41 -0
- package/dist/components/feedback/StatusBadge.d.ts +17 -0
- package/dist/components/feedback/StatusBadge.js +20 -0
- package/dist/components/feedback/TopBanner.d.ts +7 -0
- package/dist/components/feedback/TopBanner.js +74 -0
- package/dist/components/feedback/index.d.ts +5 -0
- package/dist/components/feedback/index.js +6 -0
- package/dist/components/icons/AnimatedAlert.d.ts +11 -0
- package/dist/components/icons/AnimatedAlert.js +27 -0
- package/dist/components/icons/AnimatedCalendar.d.ts +7 -0
- package/dist/components/icons/AnimatedCalendar.js +34 -0
- package/dist/components/icons/AnimatedCamera.d.ts +7 -0
- package/dist/components/icons/AnimatedCamera.js +34 -0
- package/dist/components/icons/AnimatedClientError.d.ts +11 -0
- package/dist/components/icons/AnimatedClientError.js +20 -0
- package/dist/components/icons/AnimatedClock.d.ts +7 -0
- package/dist/components/icons/AnimatedClock.js +53 -0
- package/dist/components/icons/AnimatedCrash.d.ts +11 -0
- package/dist/components/icons/AnimatedCrash.js +36 -0
- package/dist/components/icons/AnimatedDocument.d.ts +7 -0
- package/dist/components/icons/AnimatedDocument.js +34 -0
- package/dist/components/icons/AnimatedDownload.d.ts +7 -0
- package/dist/components/icons/AnimatedDownload.js +23 -0
- package/dist/components/icons/AnimatedEmergency.d.ts +11 -0
- package/dist/components/icons/AnimatedEmergency.js +26 -0
- package/dist/components/icons/AnimatedInvalidData.d.ts +11 -0
- package/dist/components/icons/AnimatedInvalidData.js +24 -0
- package/dist/components/icons/AnimatedLightning.d.ts +7 -0
- package/dist/components/icons/AnimatedLightning.js +34 -0
- package/dist/components/icons/AnimatedLocationPin.d.ts +7 -0
- package/dist/components/icons/AnimatedLocationPin.js +34 -0
- package/dist/components/icons/AnimatedPermission.d.ts +11 -0
- package/dist/components/icons/AnimatedPermission.js +21 -0
- package/dist/components/icons/AnimatedPermissionDenied.d.ts +11 -0
- package/dist/components/icons/AnimatedPermissionDenied.js +27 -0
- package/dist/components/icons/AnimatedServerError.d.ts +7 -0
- package/dist/components/icons/AnimatedServerError.js +60 -0
- package/dist/components/icons/AnimatedShield.d.ts +7 -0
- package/dist/components/icons/AnimatedShield.js +34 -0
- package/dist/components/icons/AnimatedSparkle.d.ts +7 -0
- package/dist/components/icons/AnimatedSparkle.js +53 -0
- package/dist/components/icons/AnimatedSpeedGauge.d.ts +7 -0
- package/dist/components/icons/AnimatedSpeedGauge.js +50 -0
- package/dist/components/icons/AnimatedTimeout.d.ts +11 -0
- package/dist/components/icons/AnimatedTimeout.js +27 -0
- package/dist/components/icons/AnimatedWarning.d.ts +7 -0
- package/dist/components/icons/AnimatedWarning.js +50 -0
- package/dist/components/icons/AnimatedWifiOff.d.ts +7 -0
- package/dist/components/icons/AnimatedWifiOff.js +65 -0
- package/dist/components/icons/AnimatedWrench.d.ts +7 -0
- package/dist/components/icons/AnimatedWrench.js +43 -0
- package/dist/components/icons/ClockBadge.d.ts +8 -0
- package/dist/components/icons/ClockBadge.js +28 -0
- package/dist/components/icons/DownloadBadge.d.ts +8 -0
- package/dist/components/icons/DownloadBadge.js +28 -0
- package/dist/components/icons/IconWithBadge.d.ts +12 -0
- package/dist/components/icons/IconWithBadge.js +120 -0
- package/dist/components/icons/SimpleIcons.d.ts +12 -0
- package/dist/components/icons/SimpleIcons.js +8 -0
- package/dist/components/icons/XBadge.d.ts +8 -0
- package/dist/components/icons/XBadge.js +28 -0
- package/dist/components/icons/animated/errors/AnimatedClientError.d.ts +11 -0
- package/dist/components/icons/animated/errors/AnimatedClientError.js +20 -0
- package/dist/components/icons/animated/errors/AnimatedCrash.d.ts +11 -0
- package/dist/components/icons/animated/errors/AnimatedCrash.js +36 -0
- package/dist/components/icons/animated/errors/AnimatedInvalidData.d.ts +11 -0
- package/dist/components/icons/animated/errors/AnimatedInvalidData.js +24 -0
- package/dist/components/icons/animated/errors/AnimatedServerError.d.ts +7 -0
- package/dist/components/icons/animated/errors/AnimatedServerError.js +60 -0
- package/dist/components/icons/animated/errors/index.d.ts +4 -0
- package/dist/components/icons/animated/errors/index.js +5 -0
- package/dist/components/icons/animated/general/AnimatedCalendar.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedCalendar.js +34 -0
- package/dist/components/icons/animated/general/AnimatedCamera.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedCamera.js +34 -0
- package/dist/components/icons/animated/general/AnimatedClock.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedClock.js +53 -0
- package/dist/components/icons/animated/general/AnimatedDocument.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedDocument.js +34 -0
- package/dist/components/icons/animated/general/AnimatedDownload.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedDownload.js +23 -0
- package/dist/components/icons/animated/general/AnimatedLightning.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedLightning.js +34 -0
- package/dist/components/icons/animated/general/AnimatedLocationPin.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedLocationPin.js +34 -0
- package/dist/components/icons/animated/general/AnimatedShield.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedShield.js +34 -0
- package/dist/components/icons/animated/general/AnimatedSparkle.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedSparkle.js +53 -0
- package/dist/components/icons/animated/general/AnimatedWarning.d.ts +7 -0
- package/dist/components/icons/animated/general/AnimatedWarning.js +50 -0
- package/dist/components/icons/animated/general/index.d.ts +10 -0
- package/dist/components/icons/animated/general/index.js +11 -0
- package/dist/components/icons/animated/index.d.ts +5 -0
- package/dist/components/icons/animated/index.js +6 -0
- package/dist/components/icons/animated/maintenance/AnimatedAlert.d.ts +11 -0
- package/dist/components/icons/animated/maintenance/AnimatedAlert.js +27 -0
- package/dist/components/icons/animated/maintenance/AnimatedEmergency.d.ts +11 -0
- package/dist/components/icons/animated/maintenance/AnimatedEmergency.js +26 -0
- package/dist/components/icons/animated/maintenance/AnimatedWrench.d.ts +7 -0
- package/dist/components/icons/animated/maintenance/AnimatedWrench.js +43 -0
- package/dist/components/icons/animated/maintenance/index.d.ts +3 -0
- package/dist/components/icons/animated/maintenance/index.js +4 -0
- package/dist/components/icons/animated/network/AnimatedSpeedGauge.d.ts +7 -0
- package/dist/components/icons/animated/network/AnimatedSpeedGauge.js +50 -0
- package/dist/components/icons/animated/network/AnimatedTimeout.d.ts +11 -0
- package/dist/components/icons/animated/network/AnimatedTimeout.js +27 -0
- package/dist/components/icons/animated/network/AnimatedWifiOff.d.ts +7 -0
- package/dist/components/icons/animated/network/AnimatedWifiOff.js +65 -0
- package/dist/components/icons/animated/network/index.d.ts +3 -0
- package/dist/components/icons/animated/network/index.js +4 -0
- package/dist/components/icons/animated/permissions/AnimatedPermission.d.ts +11 -0
- package/dist/components/icons/animated/permissions/AnimatedPermission.js +21 -0
- package/dist/components/icons/animated/permissions/AnimatedPermissionDenied.d.ts +11 -0
- package/dist/components/icons/animated/permissions/AnimatedPermissionDenied.js +27 -0
- package/dist/components/icons/animated/permissions/index.d.ts +2 -0
- package/dist/components/icons/animated/permissions/index.js +3 -0
- package/dist/components/icons/badges/ClockBadge.d.ts +8 -0
- package/dist/components/icons/badges/ClockBadge.js +28 -0
- package/dist/components/icons/badges/DownloadBadge.d.ts +8 -0
- package/dist/components/icons/badges/DownloadBadge.js +28 -0
- package/dist/components/icons/badges/XBadge.d.ts +8 -0
- package/dist/components/icons/badges/XBadge.js +28 -0
- package/dist/components/icons/badges/index.d.ts +3 -0
- package/dist/components/icons/badges/index.js +4 -0
- package/dist/components/icons/index.d.ts +3 -0
- package/dist/components/icons/index.js +4 -0
- package/dist/components/icons/utilities/AlertTriangleIcon.d.ts +7 -0
- package/dist/components/icons/utilities/AlertTriangleIcon.js +4 -0
- package/dist/components/icons/utilities/CheckCircleIcon.d.ts +7 -0
- package/dist/components/icons/utilities/CheckCircleIcon.js +4 -0
- package/dist/components/icons/utilities/DownloadIcon.d.ts +7 -0
- package/dist/components/icons/utilities/DownloadIcon.js +4 -0
- package/dist/components/icons/utilities/IconWithBadge.d.ts +12 -0
- package/dist/components/icons/utilities/IconWithBadge.js +120 -0
- package/dist/components/icons/utilities/SettingsIcon.d.ts +7 -0
- package/dist/components/icons/utilities/SettingsIcon.js +4 -0
- package/dist/components/icons/utilities/ShieldIcon.d.ts +7 -0
- package/dist/components/icons/utilities/ShieldIcon.js +4 -0
- package/dist/components/icons/utilities/SimpleIcons.d.ts +12 -0
- package/dist/components/icons/utilities/SimpleIcons.js +8 -0
- package/dist/components/icons/utilities/XIcon.d.ts +7 -0
- package/dist/components/icons/utilities/XIcon.js +4 -0
- package/dist/components/icons/utilities/index.d.ts +7 -0
- package/dist/components/icons/utilities/index.js +8 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +10 -0
- package/dist/components/layout/DualButtonLayout.d.ts +14 -0
- package/dist/components/layout/DualButtonLayout.js +73 -0
- package/dist/components/layout/ResponsiveLayout.d.ts +25 -0
- package/dist/components/layout/ResponsiveLayout.js +76 -0
- package/dist/components/layout/SafeAreaWrapper.d.ts +21 -0
- package/dist/components/layout/SafeAreaWrapper.js +45 -0
- package/dist/components/layout/ScreenContainer.d.ts +15 -0
- package/dist/components/layout/ScreenContainer.js +21 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/lists/CheckListItem.d.ts +14 -0
- package/dist/components/lists/CheckListItem.js +40 -0
- package/dist/components/lists/StatusCheckList.d.ts +10 -0
- package/dist/components/lists/StatusCheckList.js +69 -0
- package/dist/components/lists/index.d.ts +2 -0
- package/dist/components/lists/index.js +3 -0
- package/dist/components/shared/CheckListItem.d.ts +14 -0
- package/dist/components/shared/CheckListItem.js +40 -0
- package/dist/components/shared/ConnectionStatus.d.ts +8 -0
- package/dist/components/shared/ConnectionStatus.js +57 -0
- package/dist/components/shared/ContentCard.d.ts +16 -0
- package/dist/components/shared/ContentCard.js +24 -0
- package/dist/components/shared/CountdownTimer.d.ts +9 -0
- package/dist/components/shared/CountdownTimer.js +91 -0
- package/dist/components/shared/DualButtonLayout.d.ts +14 -0
- package/dist/components/shared/DualButtonLayout.js +73 -0
- package/dist/components/shared/ExpandableSection.d.ts +8 -0
- package/dist/components/shared/ExpandableSection.js +44 -0
- package/dist/components/shared/IconWithBadge.d.ts +17 -0
- package/dist/components/shared/IconWithBadge.js +38 -0
- package/dist/components/shared/InfoCard.d.ts +9 -0
- package/dist/components/shared/InfoCard.js +51 -0
- package/dist/components/shared/PrimaryButton.d.ts +19 -0
- package/dist/components/shared/PrimaryButton.js +42 -0
- package/dist/components/shared/ResponsiveLayout.d.ts +25 -0
- package/dist/components/shared/ResponsiveLayout.js +76 -0
- package/dist/components/shared/RetryCounter.d.ts +8 -0
- package/dist/components/shared/RetryCounter.js +17 -0
- package/dist/components/shared/SafeAreaWrapper.d.ts +21 -0
- package/dist/components/shared/SafeAreaWrapper.js +45 -0
- package/dist/components/shared/ScreenContainer.d.ts +15 -0
- package/dist/components/shared/ScreenContainer.js +21 -0
- package/dist/components/shared/SecondaryButton.d.ts +20 -0
- package/dist/components/shared/SecondaryButton.js +37 -0
- package/dist/components/shared/SecurityBanner.d.ts +9 -0
- package/dist/components/shared/SecurityBanner.js +49 -0
- package/dist/components/shared/SpeedBadge.d.ts +9 -0
- package/dist/components/shared/SpeedBadge.js +41 -0
- package/dist/components/shared/StatusBadge.d.ts +17 -0
- package/dist/components/shared/StatusBadge.js +20 -0
- package/dist/components/shared/StatusCheckList.d.ts +10 -0
- package/dist/components/shared/StatusCheckList.js +69 -0
- package/dist/components/shared/SupportButtons.d.ts +9 -0
- package/dist/components/shared/SupportButtons.js +138 -0
- package/dist/components/shared/TipsCard.d.ts +11 -0
- package/dist/components/shared/TipsCard.js +70 -0
- package/dist/components/shared/TopBanner.d.ts +7 -0
- package/dist/components/shared/TopBanner.js +74 -0
- package/dist/components/shared/VersionDisplay.d.ts +14 -0
- package/dist/components/shared/VersionDisplay.js +30 -0
- package/dist/components/shared/WarningCard.d.ts +11 -0
- package/dist/components/shared/WarningCard.js +80 -0
- package/dist/components/shared/WhatsNewCard.d.ts +15 -0
- package/dist/components/shared/WhatsNewCard.js +79 -0
- package/dist/components/status/ConnectionStatus.d.ts +8 -0
- package/dist/components/status/ConnectionStatus.js +57 -0
- package/dist/components/status/VersionDisplay.d.ts +14 -0
- package/dist/components/status/VersionDisplay.js +30 -0
- package/dist/components/status/index.d.ts +2 -0
- package/dist/components/status/index.js +3 -0
- package/dist/components/support/SupportButtons.d.ts +9 -0
- package/dist/components/support/SupportButtons.js +138 -0
- package/dist/components/support/index.d.ts +1 -0
- package/dist/components/support/index.js +2 -0
- package/dist/components/timers/CountdownTimer.d.ts +9 -0
- package/dist/components/timers/CountdownTimer.js +91 -0
- package/dist/components/timers/RetryCounter.d.ts +8 -0
- package/dist/components/timers/RetryCounter.js +17 -0
- package/dist/components/timers/index.d.ts +2 -0
- package/dist/components/timers/index.js +3 -0
- package/dist/components/ui/Button.d.ts +38 -0
- package/dist/components/ui/Button.js +96 -0
- package/dist/components/ui/OfflineBanner.d.ts +15 -0
- package/dist/components/ui/OfflineBanner.js +42 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +103 -0
- package/dist/screens/errors/ApiErrorScreen.d.ts +7 -0
- package/dist/screens/errors/ApiErrorScreen.js +166 -0
- package/dist/screens/errors/ClientErrorScreen.d.ts +9 -0
- package/dist/screens/errors/ClientErrorScreen.js +75 -0
- package/dist/screens/errors/ErrorBoundaryScreen.d.ts +9 -0
- package/dist/screens/errors/ErrorBoundaryScreen.js +43 -0
- package/dist/screens/errors/InvalidResponseScreen.d.ts +9 -0
- package/dist/screens/errors/InvalidResponseScreen.js +47 -0
- package/dist/screens/errors/ServerErrorScreen.d.ts +9 -0
- package/dist/screens/errors/ServerErrorScreen.js +72 -0
- package/dist/screens/errors/index.d.ts +5 -0
- package/dist/screens/errors/index.js +6 -0
- package/dist/screens/index.d.ts +4 -0
- package/dist/screens/index.js +5 -0
- package/dist/screens/network/ApiTimeoutScreen.d.ts +9 -0
- package/dist/screens/network/ApiTimeoutScreen.js +47 -0
- package/dist/screens/network/NetworkOfflineScreen.d.ts +9 -0
- package/dist/screens/network/NetworkOfflineScreen.js +42 -0
- package/dist/screens/network/NetworkSlowConnectionScreen.d.ts +9 -0
- package/dist/screens/network/NetworkSlowConnectionScreen.js +41 -0
- package/dist/screens/network/index.d.ts +3 -0
- package/dist/screens/network/index.js +4 -0
- package/dist/screens/permissions/PermissionDeniedScreen.d.ts +9 -0
- package/dist/screens/permissions/PermissionDeniedScreen.js +92 -0
- package/dist/screens/permissions/PermissionRequestScreen.d.ts +16 -0
- package/dist/screens/permissions/PermissionRequestScreen.js +303 -0
- package/dist/screens/permissions/PermissionScreen.d.ts +9 -0
- package/dist/screens/permissions/PermissionScreen.js +45 -0
- package/dist/screens/permissions/index.d.ts +3 -0
- package/dist/screens/permissions/index.js +4 -0
- package/dist/screens/system/AppUpdateScreen.d.ts +9 -0
- package/dist/screens/system/AppUpdateScreen.js +296 -0
- package/dist/screens/system/EmergencyOutageScreen.d.ts +9 -0
- package/dist/screens/system/EmergencyOutageScreen.js +48 -0
- package/dist/screens/system/ForceUpdateScreen.d.ts +9 -0
- package/dist/screens/system/ForceUpdateScreen.js +49 -0
- package/dist/screens/system/OptionalUpdateScreen.d.ts +9 -0
- package/dist/screens/system/OptionalUpdateScreen.js +47 -0
- package/dist/screens/system/PlannedMaintenanceScreen.d.ts +9 -0
- package/dist/screens/system/PlannedMaintenanceScreen.js +41 -0
- package/dist/screens/system/SecurityUpdateScreen.d.ts +9 -0
- package/dist/screens/system/SecurityUpdateScreen.js +64 -0
- package/dist/screens/system/ServiceUnavailableScreen.d.ts +15 -0
- package/dist/screens/system/ServiceUnavailableScreen.js +53 -0
- package/dist/screens/system/SoftUpdateScreen.d.ts +9 -0
- package/dist/screens/system/SoftUpdateScreen.js +55 -0
- package/dist/screens/system/SystemMaintenanceScreen.d.ts +9 -0
- package/dist/screens/system/SystemMaintenanceScreen.js +228 -0
- package/dist/screens/system/UnplannedOutageScreen.d.ts +9 -0
- package/dist/screens/system/UnplannedOutageScreen.js +42 -0
- package/dist/screens/system/index.d.ts +2 -0
- package/dist/screens/system/index.js +3 -0
- package/dist/screens/system/maintenance/EmergencyOutageScreen.d.ts +9 -0
- package/dist/screens/system/maintenance/EmergencyOutageScreen.js +48 -0
- package/dist/screens/system/maintenance/PlannedMaintenanceScreen.d.ts +9 -0
- package/dist/screens/system/maintenance/PlannedMaintenanceScreen.js +41 -0
- package/dist/screens/system/maintenance/ServiceUnavailableScreen.d.ts +15 -0
- package/dist/screens/system/maintenance/ServiceUnavailableScreen.js +53 -0
- package/dist/screens/system/maintenance/SystemMaintenanceScreen.d.ts +9 -0
- package/dist/screens/system/maintenance/SystemMaintenanceScreen.js +228 -0
- package/dist/screens/system/maintenance/UnplannedOutageScreen.d.ts +9 -0
- package/dist/screens/system/maintenance/UnplannedOutageScreen.js +42 -0
- package/dist/screens/system/maintenance/index.d.ts +5 -0
- package/dist/screens/system/maintenance/index.js +6 -0
- package/dist/screens/system/updates/AppUpdateScreen.d.ts +9 -0
- package/dist/screens/system/updates/AppUpdateScreen.js +296 -0
- package/dist/screens/system/updates/ForceUpdateScreen.d.ts +9 -0
- package/dist/screens/system/updates/ForceUpdateScreen.js +49 -0
- package/dist/screens/system/updates/OptionalUpdateScreen.d.ts +9 -0
- package/dist/screens/system/updates/OptionalUpdateScreen.js +47 -0
- package/dist/screens/system/updates/SecurityUpdateScreen.d.ts +9 -0
- package/dist/screens/system/updates/SecurityUpdateScreen.js +64 -0
- package/dist/screens/system/updates/SoftUpdateScreen.d.ts +9 -0
- package/dist/screens/system/updates/SoftUpdateScreen.js +55 -0
- package/dist/screens/system/updates/index.d.ts +5 -0
- package/dist/screens/system/updates/index.js +6 -0
- package/dist/types/common.d.ts +139 -0
- package/dist/types/common.js +4 -0
- package/dist/types/components.d.ts +52 -0
- package/dist/types/components.js +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +8 -0
- package/dist/types/screens.d.ts +390 -0
- package/dist/types/screens.js +4 -0
- package/dist/types/support.d.ts +16 -0
- package/dist/types/support.js +4 -0
- package/dist/types.d.ts +580 -0
- package/dist/types.js +4 -0
- package/dist/utils/client.d.ts +55 -0
- package/dist/utils/client.js +229 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +72 -0
- package/src/adapters/index.ts +2 -0
- package/src/adapters/supportAdapter.ts +167 -0
- package/src/components/buttons/PrimaryButton.tsx +82 -0
- package/src/components/buttons/SecondaryButton.tsx +81 -0
- package/src/components/buttons/index.ts +3 -0
- package/src/components/cards/ContentCard.tsx +53 -0
- package/src/components/cards/InfoCard.tsx +74 -0
- package/src/components/cards/TipsCard.tsx +106 -0
- package/src/components/cards/WarningCard.tsx +118 -0
- package/src/components/cards/WhatsNewCard.tsx +121 -0
- package/src/components/cards/index.ts +6 -0
- package/src/components/feedback/ExpandableSection.tsx +71 -0
- package/src/components/feedback/SecurityBanner.tsx +74 -0
- package/src/components/feedback/SpeedBadge.tsx +64 -0
- package/src/components/feedback/StatusBadge.tsx +50 -0
- package/src/components/feedback/TopBanner.tsx +104 -0
- package/src/components/feedback/index.ts +6 -0
- package/src/components/icons/animated/errors/AnimatedClientError.tsx +94 -0
- package/src/components/icons/animated/errors/AnimatedCrash.tsx +133 -0
- package/src/components/icons/animated/errors/AnimatedInvalidData.tsx +127 -0
- package/src/components/icons/animated/errors/AnimatedServerError.tsx +85 -0
- package/src/components/icons/animated/errors/index.ts +5 -0
- package/src/components/icons/animated/general/AnimatedCalendar.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedCamera.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedClock.tsx +78 -0
- package/src/components/icons/animated/general/AnimatedDocument.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedDownload.tsx +61 -0
- package/src/components/icons/animated/general/AnimatedLightning.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedLocationPin.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedShield.tsx +54 -0
- package/src/components/icons/animated/general/AnimatedSparkle.tsx +74 -0
- package/src/components/icons/animated/general/AnimatedWarning.tsx +75 -0
- package/src/components/icons/animated/general/index.ts +11 -0
- package/src/components/icons/animated/index.ts +6 -0
- package/src/components/icons/animated/maintenance/AnimatedAlert.tsx +110 -0
- package/src/components/icons/animated/maintenance/AnimatedEmergency.tsx +112 -0
- package/src/components/icons/animated/maintenance/AnimatedWrench.tsx +64 -0
- package/src/components/icons/animated/maintenance/index.ts +4 -0
- package/src/components/icons/animated/network/AnimatedSpeedGauge.tsx +75 -0
- package/src/components/icons/animated/network/AnimatedTimeout.tsx +115 -0
- package/src/components/icons/animated/network/AnimatedWifiOff.tsx +93 -0
- package/src/components/icons/animated/network/index.ts +4 -0
- package/src/components/icons/animated/permissions/AnimatedPermission.tsx +74 -0
- package/src/components/icons/animated/permissions/AnimatedPermissionDenied.tsx +92 -0
- package/src/components/icons/animated/permissions/index.ts +3 -0
- package/src/components/icons/badges/ClockBadge.tsx +49 -0
- package/src/components/icons/badges/DownloadBadge.tsx +49 -0
- package/src/components/icons/badges/XBadge.tsx +49 -0
- package/src/components/icons/badges/index.ts +4 -0
- package/src/components/icons/index.ts +4 -0
- package/src/components/icons/utilities/AlertTriangleIcon.tsx +17 -0
- package/src/components/icons/utilities/CheckCircleIcon.tsx +16 -0
- package/src/components/icons/utilities/DownloadIcon.tsx +17 -0
- package/src/components/icons/utilities/IconWithBadge.tsx +166 -0
- package/src/components/icons/utilities/SettingsIcon.tsx +16 -0
- package/src/components/icons/utilities/ShieldIcon.tsx +15 -0
- package/src/components/icons/utilities/XIcon.tsx +16 -0
- package/src/components/icons/utilities/index.ts +8 -0
- package/src/components/index.ts +10 -0
- package/src/components/layout/DualButtonLayout.tsx +118 -0
- package/src/components/layout/ResponsiveLayout.tsx +118 -0
- package/src/components/layout/SafeAreaWrapper.tsx +72 -0
- package/src/components/layout/ScreenContainer.tsx +53 -0
- package/src/components/layout/index.ts +5 -0
- package/src/components/lists/CheckListItem.tsx +72 -0
- package/src/components/lists/StatusCheckList.tsx +101 -0
- package/src/components/lists/index.ts +3 -0
- package/src/components/status/ConnectionStatus.tsx +90 -0
- package/src/components/status/VersionDisplay.tsx +60 -0
- package/src/components/status/index.ts +3 -0
- package/src/components/support/SupportButtons.tsx +311 -0
- package/src/components/support/index.ts +2 -0
- package/src/components/timers/CountdownTimer.tsx +136 -0
- package/src/components/timers/RetryCounter.tsx +33 -0
- package/src/components/timers/index.ts +3 -0
- package/src/index.ts +125 -0
- package/src/screens/errors/ApiErrorScreen.tsx +276 -0
- package/src/screens/errors/ClientErrorScreen.tsx +135 -0
- package/src/screens/errors/ErrorBoundaryScreen.tsx +98 -0
- package/src/screens/errors/InvalidResponseScreen.tsx +104 -0
- package/src/screens/errors/ServerErrorScreen.tsx +139 -0
- package/src/screens/errors/index.ts +6 -0
- package/src/screens/index.ts +5 -0
- package/src/screens/network/ApiTimeoutScreen.tsx +104 -0
- package/src/screens/network/NetworkOfflineScreen.tsx +92 -0
- package/src/screens/network/NetworkSlowConnectionScreen.tsx +92 -0
- package/src/screens/network/index.ts +4 -0
- package/src/screens/permissions/PermissionDeniedScreen.tsx +176 -0
- package/src/screens/permissions/PermissionRequestScreen.tsx +506 -0
- package/src/screens/permissions/PermissionScreen.tsx +104 -0
- package/src/screens/permissions/index.ts +4 -0
- package/src/screens/system/index.ts +3 -0
- package/src/screens/system/maintenance/EmergencyOutageScreen.tsx +113 -0
- package/src/screens/system/maintenance/PlannedMaintenanceScreen.tsx +98 -0
- package/src/screens/system/maintenance/ServiceUnavailableScreen.tsx +133 -0
- package/src/screens/system/maintenance/SystemMaintenanceScreen.tsx +334 -0
- package/src/screens/system/maintenance/UnplannedOutageScreen.tsx +106 -0
- package/src/screens/system/maintenance/index.ts +6 -0
- package/src/screens/system/updates/AppUpdateScreen.tsx +440 -0
- package/src/screens/system/updates/ForceUpdateScreen.tsx +121 -0
- package/src/screens/system/updates/OptionalUpdateScreen.tsx +120 -0
- package/src/screens/system/updates/SecurityUpdateScreen.tsx +152 -0
- package/src/screens/system/updates/SoftUpdateScreen.tsx +137 -0
- package/src/screens/system/updates/index.ts +6 -0
- package/src/types/common.ts +203 -0
- package/src/types/components.ts +65 -0
- package/src/types/index.ts +9 -0
- package/src/types/reanimated.d.ts +38 -0
- package/src/types/screens.ts +428 -0
- package/src/types/support.ts +23 -0
- package/src/utils/client.ts +273 -0
- package/src/utils/index.ts +2 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Animated } from 'react-native';
|
|
3
|
+
import { ShieldIcon, SettingsIcon, CheckCircleIcon, AlertTriangleIcon } from '../../components/icons/utilities';
|
|
4
|
+
import { getColor, getColorWithOpacity, isWeb } from '../../utils/client';
|
|
5
|
+
import type { PermissionScreenProps, MultiPermissionScreenProps } from '../../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Permission Request Screen Component
|
|
9
|
+
*
|
|
10
|
+
* Fully customizable permission request screen.
|
|
11
|
+
* All content, icons, actions, and reasons are configurable via props.
|
|
12
|
+
*/
|
|
13
|
+
export const PermissionRequestScreen: React.FC<PermissionScreenProps> = ({
|
|
14
|
+
// Permission type (for default config)
|
|
15
|
+
permissionType,
|
|
16
|
+
|
|
17
|
+
// Content customization
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
icon,
|
|
21
|
+
|
|
22
|
+
// Reasons (optional)
|
|
23
|
+
reasons,
|
|
24
|
+
showReasons = true,
|
|
25
|
+
|
|
26
|
+
// Actions
|
|
27
|
+
onAllow,
|
|
28
|
+
onDeny,
|
|
29
|
+
onOpenSettings,
|
|
30
|
+
onSkip,
|
|
31
|
+
|
|
32
|
+
// Button text
|
|
33
|
+
allowButtonText = 'Allow',
|
|
34
|
+
denyButtonText = 'Not Now',
|
|
35
|
+
settingsButtonText = 'Open Settings',
|
|
36
|
+
skipButtonText = 'Skip',
|
|
37
|
+
|
|
38
|
+
// State
|
|
39
|
+
status = 'not_requested',
|
|
40
|
+
isOptional = false,
|
|
41
|
+
|
|
42
|
+
// Styling
|
|
43
|
+
theme,
|
|
44
|
+
}) => {
|
|
45
|
+
// Animation
|
|
46
|
+
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
47
|
+
const scaleAnim = useRef(new Animated.Value(0.9)).current;
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
Animated.parallel([
|
|
51
|
+
Animated.timing(fadeAnim, {
|
|
52
|
+
toValue: 1,
|
|
53
|
+
duration: 300,
|
|
54
|
+
useNativeDriver: true,
|
|
55
|
+
}),
|
|
56
|
+
Animated.spring(scaleAnim, {
|
|
57
|
+
toValue: 1,
|
|
58
|
+
tension: 50,
|
|
59
|
+
friction: 7,
|
|
60
|
+
useNativeDriver: true,
|
|
61
|
+
}),
|
|
62
|
+
]).start();
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
65
|
+
// Get default config based on status and permission
|
|
66
|
+
const getDefaultConfig = () => {
|
|
67
|
+
const successColor = theme?.success || getColor('success');
|
|
68
|
+
const errorColor = theme?.error || getColor('error');
|
|
69
|
+
const primaryColor = theme?.primary || getColor('primary');
|
|
70
|
+
|
|
71
|
+
switch (status) {
|
|
72
|
+
case 'granted':
|
|
73
|
+
return {
|
|
74
|
+
icon: <CheckCircleIcon size={48} color={successColor} />,
|
|
75
|
+
iconBg: getColorWithOpacity(successColor, 0.1),
|
|
76
|
+
title: 'Permission Granted',
|
|
77
|
+
description: `You've granted ${permissionType || 'the requested'} permission.`,
|
|
78
|
+
color: successColor,
|
|
79
|
+
};
|
|
80
|
+
case 'denied':
|
|
81
|
+
case 'blocked':
|
|
82
|
+
return {
|
|
83
|
+
icon: <AlertTriangleIcon size={48} color={errorColor} />,
|
|
84
|
+
iconBg: getColorWithOpacity(errorColor, 0.1),
|
|
85
|
+
title: 'Permission Denied',
|
|
86
|
+
description: `${permissionType || 'This'} permission is required. Please enable it in settings.`,
|
|
87
|
+
color: errorColor,
|
|
88
|
+
};
|
|
89
|
+
default: // not_requested
|
|
90
|
+
return {
|
|
91
|
+
icon: <ShieldIcon size={48} color={primaryColor} />,
|
|
92
|
+
iconBg: getColorWithOpacity(primaryColor, 0.1),
|
|
93
|
+
title: `${permissionType ? permissionType.charAt(0).toUpperCase() + permissionType.slice(1) : 'Permission'} Required`,
|
|
94
|
+
description: `We need ${permissionType || 'this'} permission to provide you with the best experience.`,
|
|
95
|
+
color: primaryColor,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const defaultConfig = getDefaultConfig();
|
|
101
|
+
|
|
102
|
+
// Use custom values or fallback to defaults
|
|
103
|
+
const finalTitle = title || defaultConfig.title;
|
|
104
|
+
const finalDescription = description || defaultConfig.description;
|
|
105
|
+
const finalIcon = icon || defaultConfig.icon;
|
|
106
|
+
const finalColor = defaultConfig.color;
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<View style={[styles.container, theme?.background ? { backgroundColor: theme.background } : undefined]}>
|
|
110
|
+
<ScrollView
|
|
111
|
+
contentContainerStyle={styles.scrollContent}
|
|
112
|
+
showsVerticalScrollIndicator={false}
|
|
113
|
+
>
|
|
114
|
+
<Animated.View
|
|
115
|
+
style={[
|
|
116
|
+
styles.content,
|
|
117
|
+
{
|
|
118
|
+
opacity: fadeAnim,
|
|
119
|
+
transform: [{ scale: scaleAnim }],
|
|
120
|
+
},
|
|
121
|
+
]}
|
|
122
|
+
>
|
|
123
|
+
{/* Icon */}
|
|
124
|
+
<View style={[styles.iconContainer, { backgroundColor: defaultConfig.iconBg }]}>
|
|
125
|
+
{finalIcon}
|
|
126
|
+
</View>
|
|
127
|
+
|
|
128
|
+
{/* Title */}
|
|
129
|
+
<Text style={[styles.title, theme?.textPrimary ? { color: theme.textPrimary } : undefined]}>
|
|
130
|
+
{finalTitle}
|
|
131
|
+
</Text>
|
|
132
|
+
|
|
133
|
+
{/* Description */}
|
|
134
|
+
<Text style={[styles.description, theme?.textSecondary ? { color: theme.textSecondary } : undefined]}>
|
|
135
|
+
{finalDescription}
|
|
136
|
+
</Text>
|
|
137
|
+
|
|
138
|
+
{/* Optional Badge */}
|
|
139
|
+
{isOptional && status === 'not_requested' && (
|
|
140
|
+
<View style={styles.optionalBadge}>
|
|
141
|
+
<Text style={styles.optionalText}>Optional</Text>
|
|
142
|
+
</View>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{/* Reasons (optional) */}
|
|
146
|
+
{showReasons && reasons && reasons.length > 0 && (
|
|
147
|
+
<View style={styles.reasonsContainer}>
|
|
148
|
+
<Text style={styles.reasonsTitle}>Why we need this:</Text>
|
|
149
|
+
{reasons.map((reason, index) => (
|
|
150
|
+
<View key={index} style={styles.reasonItem}>
|
|
151
|
+
<Text style={styles.reasonBullet}>•</Text>
|
|
152
|
+
<Text style={styles.reasonText}>{reason}</Text>
|
|
153
|
+
</View>
|
|
154
|
+
))}
|
|
155
|
+
</View>
|
|
156
|
+
)}
|
|
157
|
+
|
|
158
|
+
{/* Action Buttons */}
|
|
159
|
+
<View style={styles.buttonsContainer}>
|
|
160
|
+
{status === 'not_requested' && onAllow && (
|
|
161
|
+
<TouchableOpacity
|
|
162
|
+
style={[styles.button, styles.primaryButton, { backgroundColor: finalColor }]}
|
|
163
|
+
onPress={onAllow}
|
|
164
|
+
activeOpacity={0.8}
|
|
165
|
+
>
|
|
166
|
+
<Text style={styles.primaryButtonText}>{allowButtonText}</Text>
|
|
167
|
+
</TouchableOpacity>
|
|
168
|
+
)}
|
|
169
|
+
|
|
170
|
+
{(status === 'denied' || status === 'blocked') && onOpenSettings && (
|
|
171
|
+
<TouchableOpacity
|
|
172
|
+
style={[styles.button, styles.primaryButton, { backgroundColor: finalColor }]}
|
|
173
|
+
onPress={onOpenSettings}
|
|
174
|
+
activeOpacity={0.8}
|
|
175
|
+
>
|
|
176
|
+
<SettingsIcon size={20} color="#FFFFFF" />
|
|
177
|
+
<Text style={styles.primaryButtonText}>{settingsButtonText}</Text>
|
|
178
|
+
</TouchableOpacity>
|
|
179
|
+
)}
|
|
180
|
+
|
|
181
|
+
{status === 'not_requested' && (onDeny || onSkip) && (
|
|
182
|
+
<TouchableOpacity
|
|
183
|
+
style={[styles.button, styles.secondaryButton, { borderColor: finalColor }]}
|
|
184
|
+
onPress={onDeny || onSkip}
|
|
185
|
+
activeOpacity={0.8}
|
|
186
|
+
>
|
|
187
|
+
<Text style={[styles.secondaryButtonText, { color: finalColor }]}>
|
|
188
|
+
{isOptional ? skipButtonText : denyButtonText}
|
|
189
|
+
</Text>
|
|
190
|
+
</TouchableOpacity>
|
|
191
|
+
)}
|
|
192
|
+
</View>
|
|
193
|
+
</Animated.View>
|
|
194
|
+
</ScrollView>
|
|
195
|
+
</View>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Multi Permission Request Screen Component
|
|
201
|
+
*
|
|
202
|
+
* Fully customizable multi-permission screen.
|
|
203
|
+
* All content and permissions are configurable via props.
|
|
204
|
+
*/
|
|
205
|
+
export const MultiPermissionRequestScreen: React.FC<MultiPermissionScreenProps> = ({
|
|
206
|
+
// Permissions list
|
|
207
|
+
permissions,
|
|
208
|
+
|
|
209
|
+
// Content
|
|
210
|
+
title = 'Permissions Required',
|
|
211
|
+
description = 'We need the following permissions to provide you with the best experience',
|
|
212
|
+
|
|
213
|
+
// Actions
|
|
214
|
+
onContinue,
|
|
215
|
+
onOpenSettings,
|
|
216
|
+
|
|
217
|
+
// Button text
|
|
218
|
+
continueButtonText = 'Continue',
|
|
219
|
+
settingsButtonText = 'Grant Permissions',
|
|
220
|
+
|
|
221
|
+
// Styling
|
|
222
|
+
theme,
|
|
223
|
+
}) => {
|
|
224
|
+
// Animation
|
|
225
|
+
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
226
|
+
const scaleAnim = useRef(new Animated.Value(0.9)).current;
|
|
227
|
+
|
|
228
|
+
useEffect(() => {
|
|
229
|
+
Animated.parallel([
|
|
230
|
+
Animated.timing(fadeAnim, {
|
|
231
|
+
toValue: 1,
|
|
232
|
+
duration: 300,
|
|
233
|
+
useNativeDriver: true,
|
|
234
|
+
}),
|
|
235
|
+
Animated.spring(scaleAnim, {
|
|
236
|
+
toValue: 1,
|
|
237
|
+
tension: 50,
|
|
238
|
+
friction: 7,
|
|
239
|
+
useNativeDriver: true,
|
|
240
|
+
}),
|
|
241
|
+
]).start();
|
|
242
|
+
}, []);
|
|
243
|
+
|
|
244
|
+
const allGranted = permissions.every(p => p.status === 'granted');
|
|
245
|
+
const hasRequired = permissions.some(p => p.required && p.status !== 'granted');
|
|
246
|
+
|
|
247
|
+
const primaryColor = theme?.primary || getColor('primary');
|
|
248
|
+
const successColor = theme?.success || getColor('success');
|
|
249
|
+
const errorColor = theme?.error || getColor('error');
|
|
250
|
+
const warningColor = theme?.warning || getColor('warning');
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<View style={[styles.container, theme?.background ? { backgroundColor: theme.background } : undefined]}>
|
|
254
|
+
<ScrollView
|
|
255
|
+
contentContainerStyle={styles.scrollContent}
|
|
256
|
+
showsVerticalScrollIndicator={false}
|
|
257
|
+
>
|
|
258
|
+
<Animated.View
|
|
259
|
+
style={[
|
|
260
|
+
styles.content,
|
|
261
|
+
{
|
|
262
|
+
opacity: fadeAnim,
|
|
263
|
+
transform: [{ scale: scaleAnim }],
|
|
264
|
+
},
|
|
265
|
+
]}
|
|
266
|
+
>
|
|
267
|
+
{/* Icon */}
|
|
268
|
+
<View style={[styles.iconContainer, { backgroundColor: getColorWithOpacity(primaryColor, 0.1) }]}>
|
|
269
|
+
<ShieldIcon size={48} color={primaryColor} />
|
|
270
|
+
</View>
|
|
271
|
+
|
|
272
|
+
{/* Title */}
|
|
273
|
+
<Text style={[styles.title, theme?.textPrimary ? { color: theme.textPrimary } : undefined]}>
|
|
274
|
+
{title}
|
|
275
|
+
</Text>
|
|
276
|
+
|
|
277
|
+
{/* Description */}
|
|
278
|
+
<Text style={[styles.description, theme?.textSecondary ? { color: theme.textSecondary } : undefined]}>
|
|
279
|
+
{description}
|
|
280
|
+
</Text>
|
|
281
|
+
|
|
282
|
+
{/* Permissions List */}
|
|
283
|
+
<View style={styles.permissionsList}>
|
|
284
|
+
{permissions.map((perm, index) => (
|
|
285
|
+
<View key={index} style={styles.permissionItem}>
|
|
286
|
+
<View style={styles.permissionInfo}>
|
|
287
|
+
{perm.icon || (
|
|
288
|
+
<Text style={styles.permissionName}>
|
|
289
|
+
{perm.title || (perm.type ? perm.type.charAt(0).toUpperCase() + perm.type.slice(1) : 'Permission')}
|
|
290
|
+
</Text>
|
|
291
|
+
)}
|
|
292
|
+
{perm.description && (
|
|
293
|
+
<Text style={styles.permissionDesc}>{perm.description}</Text>
|
|
294
|
+
)}
|
|
295
|
+
{!perm.required && (
|
|
296
|
+
<Text style={styles.permissionOptional}>Optional</Text>
|
|
297
|
+
)}
|
|
298
|
+
</View>
|
|
299
|
+
<View style={styles.permissionStatus}>
|
|
300
|
+
{perm.status === 'granted' ? (
|
|
301
|
+
<CheckCircleIcon size={24} color={successColor} />
|
|
302
|
+
) : (
|
|
303
|
+
<View style={[styles.permissionBadge, { backgroundColor: perm.required ? getColorWithOpacity(errorColor, 0.1) : getColorWithOpacity(warningColor, 0.1) }]}>
|
|
304
|
+
<Text style={[styles.permissionBadgeText, { color: perm.required ? errorColor : warningColor }]}>
|
|
305
|
+
{perm.status === 'denied' || perm.status === 'blocked' ? 'Denied' : 'Required'}
|
|
306
|
+
</Text>
|
|
307
|
+
</View>
|
|
308
|
+
)}
|
|
309
|
+
</View>
|
|
310
|
+
</View>
|
|
311
|
+
))}
|
|
312
|
+
</View>
|
|
313
|
+
|
|
314
|
+
{/* Action Buttons */}
|
|
315
|
+
<View style={styles.buttonsContainer}>
|
|
316
|
+
{!allGranted && hasRequired && onOpenSettings && (
|
|
317
|
+
<TouchableOpacity
|
|
318
|
+
style={[styles.button, styles.primaryButton, { backgroundColor: primaryColor }]}
|
|
319
|
+
onPress={onOpenSettings}
|
|
320
|
+
activeOpacity={0.8}
|
|
321
|
+
>
|
|
322
|
+
<SettingsIcon size={20} color="#FFFFFF" />
|
|
323
|
+
<Text style={styles.primaryButtonText}>{settingsButtonText}</Text>
|
|
324
|
+
</TouchableOpacity>
|
|
325
|
+
)}
|
|
326
|
+
|
|
327
|
+
{onContinue && !hasRequired && (
|
|
328
|
+
<TouchableOpacity
|
|
329
|
+
style={[styles.button, styles.primaryButton, { backgroundColor: primaryColor }]}
|
|
330
|
+
onPress={onContinue}
|
|
331
|
+
activeOpacity={0.8}
|
|
332
|
+
>
|
|
333
|
+
<Text style={styles.primaryButtonText}>{continueButtonText}</Text>
|
|
334
|
+
</TouchableOpacity>
|
|
335
|
+
)}
|
|
336
|
+
</View>
|
|
337
|
+
</Animated.View>
|
|
338
|
+
</ScrollView>
|
|
339
|
+
</View>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const styles = StyleSheet.create({
|
|
344
|
+
container: {
|
|
345
|
+
flex: 1,
|
|
346
|
+
backgroundColor: '#FFFFFF',
|
|
347
|
+
},
|
|
348
|
+
scrollContent: {
|
|
349
|
+
flexGrow: 1,
|
|
350
|
+
justifyContent: 'center',
|
|
351
|
+
padding: 24,
|
|
352
|
+
},
|
|
353
|
+
content: {
|
|
354
|
+
alignItems: 'center',
|
|
355
|
+
maxWidth: 480,
|
|
356
|
+
width: '100%',
|
|
357
|
+
alignSelf: 'center',
|
|
358
|
+
},
|
|
359
|
+
iconContainer: {
|
|
360
|
+
width: 96,
|
|
361
|
+
height: 96,
|
|
362
|
+
borderRadius: 48,
|
|
363
|
+
justifyContent: 'center',
|
|
364
|
+
alignItems: 'center',
|
|
365
|
+
marginBottom: 24,
|
|
366
|
+
},
|
|
367
|
+
title: {
|
|
368
|
+
fontSize: 24,
|
|
369
|
+
fontWeight: '700',
|
|
370
|
+
color: '#1F2937',
|
|
371
|
+
textAlign: 'center',
|
|
372
|
+
marginBottom: 12,
|
|
373
|
+
},
|
|
374
|
+
description: {
|
|
375
|
+
fontSize: 16,
|
|
376
|
+
color: '#6B7280',
|
|
377
|
+
textAlign: 'center',
|
|
378
|
+
lineHeight: 24,
|
|
379
|
+
marginBottom: 24,
|
|
380
|
+
},
|
|
381
|
+
optionalBadge: {
|
|
382
|
+
paddingHorizontal: 12,
|
|
383
|
+
paddingVertical: 6,
|
|
384
|
+
backgroundColor: '#F3F4F6',
|
|
385
|
+
borderRadius: 12,
|
|
386
|
+
marginBottom: 24,
|
|
387
|
+
},
|
|
388
|
+
optionalText: {
|
|
389
|
+
fontSize: 12,
|
|
390
|
+
fontWeight: '600',
|
|
391
|
+
color: '#6B7280',
|
|
392
|
+
},
|
|
393
|
+
reasonsContainer: {
|
|
394
|
+
width: '100%',
|
|
395
|
+
padding: 16,
|
|
396
|
+
backgroundColor: '#F9FAFB',
|
|
397
|
+
borderRadius: 12,
|
|
398
|
+
marginBottom: 24,
|
|
399
|
+
},
|
|
400
|
+
reasonsTitle: {
|
|
401
|
+
fontSize: 14,
|
|
402
|
+
fontWeight: '600',
|
|
403
|
+
color: '#1F2937',
|
|
404
|
+
marginBottom: 12,
|
|
405
|
+
},
|
|
406
|
+
reasonItem: {
|
|
407
|
+
flexDirection: 'row',
|
|
408
|
+
marginBottom: 8,
|
|
409
|
+
},
|
|
410
|
+
reasonBullet: {
|
|
411
|
+
fontSize: 14,
|
|
412
|
+
color: '#6B7280',
|
|
413
|
+
marginRight: 8,
|
|
414
|
+
},
|
|
415
|
+
reasonText: {
|
|
416
|
+
flex: 1,
|
|
417
|
+
fontSize: 14,
|
|
418
|
+
color: '#6B7280',
|
|
419
|
+
lineHeight: 20,
|
|
420
|
+
},
|
|
421
|
+
buttonsContainer: {
|
|
422
|
+
width: '100%',
|
|
423
|
+
},
|
|
424
|
+
button: {
|
|
425
|
+
flexDirection: 'row',
|
|
426
|
+
alignItems: 'center',
|
|
427
|
+
justifyContent: 'center',
|
|
428
|
+
paddingVertical: 14,
|
|
429
|
+
paddingHorizontal: 32,
|
|
430
|
+
borderRadius: 12,
|
|
431
|
+
width: '100%',
|
|
432
|
+
marginBottom: 12,
|
|
433
|
+
},
|
|
434
|
+
buttonIcon: {
|
|
435
|
+
marginRight: 8,
|
|
436
|
+
},
|
|
437
|
+
primaryButton: {
|
|
438
|
+
...(!isWeb() && {
|
|
439
|
+
shadowColor: '#000',
|
|
440
|
+
shadowOffset: { width: 0, height: 2 },
|
|
441
|
+
shadowOpacity: 0.1,
|
|
442
|
+
shadowRadius: 4,
|
|
443
|
+
elevation: 3,
|
|
444
|
+
}),
|
|
445
|
+
},
|
|
446
|
+
primaryButtonText: {
|
|
447
|
+
fontSize: 16,
|
|
448
|
+
fontWeight: '600',
|
|
449
|
+
color: '#FFFFFF',
|
|
450
|
+
},
|
|
451
|
+
secondaryButton: {
|
|
452
|
+
borderWidth: 2,
|
|
453
|
+
backgroundColor: 'transparent',
|
|
454
|
+
},
|
|
455
|
+
secondaryButtonText: {
|
|
456
|
+
fontSize: 16,
|
|
457
|
+
fontWeight: '600',
|
|
458
|
+
},
|
|
459
|
+
|
|
460
|
+
// Multi Permission
|
|
461
|
+
permissionsList: {
|
|
462
|
+
width: '100%',
|
|
463
|
+
marginBottom: 24,
|
|
464
|
+
},
|
|
465
|
+
permissionItem: {
|
|
466
|
+
flexDirection: 'row',
|
|
467
|
+
alignItems: 'center',
|
|
468
|
+
justifyContent: 'space-between',
|
|
469
|
+
padding: 16,
|
|
470
|
+
backgroundColor: '#F9FAFB',
|
|
471
|
+
borderRadius: 12,
|
|
472
|
+
marginBottom: 12,
|
|
473
|
+
},
|
|
474
|
+
permissionInfo: {
|
|
475
|
+
flex: 1,
|
|
476
|
+
marginRight: 12,
|
|
477
|
+
},
|
|
478
|
+
permissionName: {
|
|
479
|
+
fontSize: 16,
|
|
480
|
+
fontWeight: '600',
|
|
481
|
+
color: '#1F2937',
|
|
482
|
+
marginBottom: 4,
|
|
483
|
+
},
|
|
484
|
+
permissionDesc: {
|
|
485
|
+
fontSize: 14,
|
|
486
|
+
color: '#6B7280',
|
|
487
|
+
lineHeight: 20,
|
|
488
|
+
},
|
|
489
|
+
permissionOptional: {
|
|
490
|
+
fontSize: 12,
|
|
491
|
+
color: '#9CA3AF',
|
|
492
|
+
marginTop: 4,
|
|
493
|
+
},
|
|
494
|
+
permissionStatus: {
|
|
495
|
+
alignItems: 'center',
|
|
496
|
+
},
|
|
497
|
+
permissionBadge: {
|
|
498
|
+
paddingHorizontal: 8,
|
|
499
|
+
paddingVertical: 4,
|
|
500
|
+
borderRadius: 6,
|
|
501
|
+
},
|
|
502
|
+
permissionBadgeText: {
|
|
503
|
+
fontSize: 12,
|
|
504
|
+
fontWeight: '600',
|
|
505
|
+
},
|
|
506
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, StyleSheet, View } from 'react-native';
|
|
3
|
+
import ScreenContainer from '../../components/layout/ScreenContainer';
|
|
4
|
+
import IconWithBadge from '../../components/icons/utilities/IconWithBadge';
|
|
5
|
+
import ContentCard from '../../components/cards/ContentCard';
|
|
6
|
+
import PrimaryButton from '../../components/buttons/PrimaryButton';
|
|
7
|
+
import SecondaryButton from '../../components/buttons/SecondaryButton';
|
|
8
|
+
import AnimatedPermission from '../../components/icons/animated/permissions/AnimatedPermission';
|
|
9
|
+
import { getColor } from '../../utils/client';
|
|
10
|
+
import type { PermissionScreenProps } from '../../types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Permission Request Screen
|
|
14
|
+
*
|
|
15
|
+
* Displayed when requesting a permission from the user.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const PermissionScreen: React.FC<PermissionScreenProps> = ({
|
|
19
|
+
title = 'Permission Required',
|
|
20
|
+
description = 'We need your permission to provide you with the best experience.',
|
|
21
|
+
permissionType = 'location',
|
|
22
|
+
reason,
|
|
23
|
+
onAllow,
|
|
24
|
+
onDeny,
|
|
25
|
+
allowButtonText = 'Allow',
|
|
26
|
+
denyButtonText = 'Not Now',
|
|
27
|
+
support,
|
|
28
|
+
theme,
|
|
29
|
+
primaryColor,
|
|
30
|
+
backgroundColor,
|
|
31
|
+
}) => {
|
|
32
|
+
const infoColor = primaryColor || theme?.primary || getColor('primary');
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<ScreenContainer backgroundColor={backgroundColor || theme?.background}>
|
|
36
|
+
{/* Icon with badge */}
|
|
37
|
+
<IconWithBadge
|
|
38
|
+
icon={<AnimatedPermission size={48} color={infoColor} />}
|
|
39
|
+
iconBackgroundColor="#DBEAFE"
|
|
40
|
+
badge={<Text style={styles.badgeIcon}>🔒</Text>}
|
|
41
|
+
badgeBackgroundColor={infoColor}
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
{/* Title */}
|
|
45
|
+
<Text style={[styles.title, theme?.textPrimary ? { color: theme.textPrimary } : undefined]}>
|
|
46
|
+
{title}
|
|
47
|
+
</Text>
|
|
48
|
+
|
|
49
|
+
{/* Description */}
|
|
50
|
+
<Text style={[styles.description, theme?.textSecondary ? { color: theme.textSecondary } : undefined]}>
|
|
51
|
+
{description}
|
|
52
|
+
</Text>
|
|
53
|
+
|
|
54
|
+
{/* Why we need this card */}
|
|
55
|
+
<ContentCard title="Why we need this permission">
|
|
56
|
+
<Text style={styles.cardText}>
|
|
57
|
+
{reason || `We use your ${permissionType} to show nearby options and provide location-based features.`}
|
|
58
|
+
</Text>
|
|
59
|
+
</ContentCard>
|
|
60
|
+
|
|
61
|
+
{/* Action buttons */}
|
|
62
|
+
{onAllow && (
|
|
63
|
+
<PrimaryButton onPress={onAllow} backgroundColor={infoColor}>
|
|
64
|
+
{allowButtonText}
|
|
65
|
+
</PrimaryButton>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
{onDeny && (
|
|
69
|
+
<SecondaryButton onPress={onDeny}>
|
|
70
|
+
{denyButtonText}
|
|
71
|
+
</SecondaryButton>
|
|
72
|
+
)}
|
|
73
|
+
</ScreenContainer>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
title: {
|
|
79
|
+
fontSize: 24,
|
|
80
|
+
fontWeight: '700',
|
|
81
|
+
color: '#1F2937',
|
|
82
|
+
textAlign: 'center',
|
|
83
|
+
marginBottom: 12,
|
|
84
|
+
lineHeight: 32,
|
|
85
|
+
},
|
|
86
|
+
description: {
|
|
87
|
+
fontSize: 16,
|
|
88
|
+
fontWeight: '400',
|
|
89
|
+
color: '#6B7280',
|
|
90
|
+
textAlign: 'center',
|
|
91
|
+
lineHeight: 24,
|
|
92
|
+
marginBottom: 24,
|
|
93
|
+
},
|
|
94
|
+
cardText: {
|
|
95
|
+
fontSize: 14,
|
|
96
|
+
color: '#6B7280',
|
|
97
|
+
lineHeight: 20,
|
|
98
|
+
},
|
|
99
|
+
badgeIcon: {
|
|
100
|
+
fontSize: 16,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export default PermissionScreen;
|