@zj-dynamics/components-native 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/NOTICE.foundation +21 -0
- package/README.md +20 -2
- package/RulnarComponentsNative.podspec +16 -0
- package/dist/AutoLink.d.ts +9 -0
- package/dist/AutoLink.js +63 -0
- package/dist/BottomSheetKeyboardAwareScrollView.d.ts +12 -0
- package/dist/BottomSheetKeyboardAwareScrollView.js +19 -0
- package/dist/Button.d.ts +37 -0
- package/dist/Button.js +24 -0
- package/dist/Checkbox.d.ts +37 -0
- package/dist/Checkbox.js +73 -0
- package/dist/Content.d.ts +16 -0
- package/dist/Content.js +17 -0
- package/dist/ContentOverlay.d.ts +31 -0
- package/dist/ContentOverlay.js +151 -0
- package/dist/Divider.d.ts +6 -0
- package/dist/Divider.js +20 -0
- package/dist/Flex.d.ts +10 -0
- package/dist/Flex.js +19 -0
- package/dist/Icon.d.ts +11 -0
- package/dist/Icon.js +17 -0
- package/dist/InputCurrency.d.ts +12 -0
- package/dist/InputCurrency.js +57 -0
- package/dist/InputText.d.ts +32 -0
- package/dist/InputText.js +103 -0
- package/dist/NativeTextFields.d.ts +22 -0
- package/dist/NativeTextFields.js +59 -0
- package/dist/Switch.d.ts +17 -0
- package/dist/Switch.js +27 -0
- package/dist/controlledField.d.ts +4 -0
- package/dist/controlledField.js +9 -0
- package/dist/foundationText/ActionItem/ActionItem.d.ts +42 -0
- package/dist/foundationText/ActionItem/ActionItem.js +31 -0
- package/dist/foundationText/ActionItem/ActionItem.style.d.ts +21 -0
- package/dist/foundationText/ActionItem/ActionItem.style.js +24 -0
- package/dist/foundationText/ActionItem/ActionItemGroup.d.ts +12 -0
- package/dist/foundationText/ActionItem/ActionItemGroup.js +18 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.d.ts +10 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.js +17 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.style.d.ts +10 -0
- package/dist/foundationText/ActionItem/components/ActionItemContainer.style.js +13 -0
- package/dist/foundationText/ActionItem/index.d.ts +4 -0
- package/dist/foundationText/ActionItem/index.js +3 -0
- package/dist/foundationText/ActionLabel/ActionLabel.d.ts +28 -0
- package/dist/foundationText/ActionLabel/ActionLabel.js +22 -0
- package/dist/foundationText/ActionLabel/index.d.ts +2 -0
- package/dist/foundationText/ActionLabel/index.js +1 -0
- package/dist/foundationText/ActivityIndicator/ActivityIndicator.d.ts +46 -0
- package/dist/foundationText/ActivityIndicator/ActivityIndicator.js +191 -0
- package/dist/foundationText/ActivityIndicator/index.d.ts +2 -0
- package/dist/foundationText/ActivityIndicator/index.js +1 -0
- package/dist/foundationText/Banner/Banner.d.ts +3 -0
- package/dist/foundationText/Banner/Banner.js +64 -0
- package/dist/foundationText/Banner/Banner.style.d.ts +56 -0
- package/dist/foundationText/Banner/Banner.style.js +59 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.d.ts +8 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.js +9 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.style.d.ts +18 -0
- package/dist/foundationText/Banner/components/BannerIcon/BannerIcon.style.js +21 -0
- package/dist/foundationText/Banner/index.d.ts +2 -0
- package/dist/foundationText/Banner/index.js +1 -0
- package/dist/foundationText/Banner/types.d.ts +63 -0
- package/dist/foundationText/Banner/types.js +1 -0
- package/dist/foundationText/BottomSheet/BottomSheet.d.ts +32 -0
- package/dist/foundationText/BottomSheet/BottomSheet.js +75 -0
- package/dist/foundationText/BottomSheet/BottomSheet.style.d.ts +26 -0
- package/dist/foundationText/BottomSheet/BottomSheet.style.js +30 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +13 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.js +16 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.styles.d.ts +16 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/BottomSheetOption.styles.js +19 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/index.d.ts +2 -0
- package/dist/foundationText/BottomSheet/components/BottomSheetOption/index.js +1 -0
- package/dist/foundationText/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
- package/dist/foundationText/BottomSheet/hooks/useBottomSheetBackHandler.js +25 -0
- package/dist/foundationText/BottomSheet/index.d.ts +4 -0
- package/dist/foundationText/BottomSheet/index.js +2 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.d.ts +30 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.js +25 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.style.d.ts +16 -0
- package/dist/foundationText/ButtonGroup/ButtonGroup.style.js +19 -0
- package/dist/foundationText/ButtonGroup/ButtonGroupAction.d.ts +47 -0
- package/dist/foundationText/ButtonGroup/ButtonGroupAction.js +11 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +14 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.js +15 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/index.d.ts +1 -0
- package/dist/foundationText/ButtonGroup/components/SecondaryActionSheet/index.js +1 -0
- package/dist/foundationText/ButtonGroup/index.d.ts +3 -0
- package/dist/foundationText/ButtonGroup/index.js +2 -0
- package/dist/foundationText/ButtonGroup/types.d.ts +7 -0
- package/dist/foundationText/ButtonGroup/types.js +1 -0
- package/dist/foundationText/ButtonGroup/utils.d.ts +19 -0
- package/dist/foundationText/ButtonGroup/utils.js +41 -0
- package/dist/foundationText/Card/Card.d.ts +41 -0
- package/dist/foundationText/Card/Card.js +26 -0
- package/dist/foundationText/Card/Card.style.d.ts +56 -0
- package/dist/foundationText/Card/Card.style.js +38 -0
- package/dist/foundationText/Card/components/InternalCardHeader.d.ts +10 -0
- package/dist/foundationText/Card/components/InternalCardHeader.js +16 -0
- package/dist/foundationText/Card/components/InternalCardHeader.style.d.ts +14 -0
- package/dist/foundationText/Card/components/InternalCardHeader.style.js +17 -0
- package/dist/foundationText/Card/components/index.d.ts +1 -0
- package/dist/foundationText/Card/components/index.js +1 -0
- package/dist/foundationText/Card/index.d.ts +2 -0
- package/dist/foundationText/Card/index.js +1 -0
- package/dist/foundationText/Chip/Chip.d.ts +45 -0
- package/dist/foundationText/Chip/Chip.js +88 -0
- package/dist/foundationText/Chip/Chip.style.d.ts +27 -0
- package/dist/foundationText/Chip/Chip.style.js +31 -0
- package/dist/foundationText/Chip/index.d.ts +2 -0
- package/dist/foundationText/Chip/index.js +1 -0
- package/dist/foundationText/ComponentSettingsContext/ComponentSettingsContext.d.ts +57 -0
- package/dist/foundationText/ComponentSettingsContext/ComponentSettingsContext.js +26 -0
- package/dist/foundationText/ComponentSettingsContext/index.d.ts +1 -0
- package/dist/foundationText/ComponentSettingsContext/index.js +1 -0
- package/dist/foundationText/Disclosure/Disclosure.d.ts +35 -0
- package/dist/foundationText/Disclosure/Disclosure.js +51 -0
- package/dist/foundationText/Disclosure/Disclosure.style.d.ts +19 -0
- package/dist/foundationText/Disclosure/Disclosure.style.js +22 -0
- package/dist/foundationText/Disclosure/constants.d.ts +1 -0
- package/dist/foundationText/Disclosure/constants.js +1 -0
- package/dist/foundationText/Disclosure/index.d.ts +1 -0
- package/dist/foundationText/Disclosure/index.js +1 -0
- package/dist/foundationText/EmptyState/EmptyState.d.ts +35 -0
- package/dist/foundationText/EmptyState/EmptyState.js +18 -0
- package/dist/foundationText/EmptyState/EmptyState.style.d.ts +6 -0
- package/dist/foundationText/EmptyState/EmptyState.style.js +9 -0
- package/dist/foundationText/EmptyState/index.d.ts +2 -0
- package/dist/foundationText/EmptyState/index.js +1 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +22 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.js +35 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.style.d.ts +29 -0
- package/dist/foundationText/ErrorMessageWrapper/ErrorMessageWrapper.style.js +32 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageContext.d.ts +3 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageContext.js +11 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +7 -0
- package/dist/foundationText/ErrorMessageWrapper/context/ErrorMessageProvider.js +38 -0
- package/dist/foundationText/ErrorMessageWrapper/context/index.d.ts +2 -0
- package/dist/foundationText/ErrorMessageWrapper/context/index.js +2 -0
- package/dist/foundationText/ErrorMessageWrapper/context/types.d.ts +62 -0
- package/dist/foundationText/ErrorMessageWrapper/context/types.js +1 -0
- package/dist/foundationText/ErrorMessageWrapper/index.d.ts +2 -0
- package/dist/foundationText/ErrorMessageWrapper/index.js +2 -0
- package/dist/foundationText/Form/Form.d.ts +4 -0
- package/dist/foundationText/Form/Form.js +142 -0
- package/dist/foundationText/Form/Form.style.d.ts +31 -0
- package/dist/foundationText/Form/Form.style.js +34 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.d.ts +13 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.js +21 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.style.d.ts +15 -0
- package/dist/foundationText/Form/components/FormActionBar/FormActionBar.style.js +11 -0
- package/dist/foundationText/Form/components/FormActionBar/index.d.ts +2 -0
- package/dist/foundationText/Form/components/FormActionBar/index.js +1 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.d.ts +10 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.js +18 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.style.d.ts +24 -0
- package/dist/foundationText/Form/components/FormBody/FormBody.style.js +27 -0
- package/dist/foundationText/Form/components/FormBody/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormBody/index.js +1 -0
- package/dist/foundationText/Form/components/FormCache/FormCache.d.ts +10 -0
- package/dist/foundationText/Form/components/FormCache/FormCache.js +28 -0
- package/dist/foundationText/Form/components/FormErrorBanner/FormErrorBanner.d.ts +3 -0
- package/dist/foundationText/Form/components/FormErrorBanner/FormErrorBanner.js +14 -0
- package/dist/foundationText/Form/components/FormErrorBanner/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormErrorBanner/index.js +1 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.d.ts +2 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.js +9 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.style.d.ts +13 -0
- package/dist/foundationText/Form/components/FormMask/FormMask.style.js +16 -0
- package/dist/foundationText/Form/components/FormMask/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMask/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessage/FormMessage.d.ts +19 -0
- package/dist/foundationText/Form/components/FormMessage/FormMessage.js +49 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +8 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.js +27 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.style.d.ts +20 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.style.js +18 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessage/components/InternalFormMessage/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessage/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessage/index.js +1 -0
- package/dist/foundationText/Form/components/FormMessageBanner/FormMessageBanner.d.ts +7 -0
- package/dist/foundationText/Form/components/FormMessageBanner/FormMessageBanner.js +16 -0
- package/dist/foundationText/Form/components/FormMessageBanner/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormMessageBanner/index.js +1 -0
- package/dist/foundationText/Form/components/FormSaveButton/FormSaveButton.d.ts +3 -0
- package/dist/foundationText/Form/components/FormSaveButton/FormSaveButton.js +55 -0
- package/dist/foundationText/Form/components/FormSaveButton/index.d.ts +1 -0
- package/dist/foundationText/Form/components/FormSaveButton/index.js +1 -0
- package/dist/foundationText/Form/components/IOSKeyboardAwareScrollViewSpacer/IOSKeyboardAwareScrollViewSpacer.d.ts +6 -0
- package/dist/foundationText/Form/components/IOSKeyboardAwareScrollViewSpacer/IOSKeyboardAwareScrollViewSpacer.js +13 -0
- package/dist/foundationText/Form/constants.d.ts +2 -0
- package/dist/foundationText/Form/constants.js +2 -0
- package/dist/foundationText/Form/context/FormContext.d.ts +11 -0
- package/dist/foundationText/Form/context/FormContext.js +16 -0
- package/dist/foundationText/Form/context/index.d.ts +2 -0
- package/dist/foundationText/Form/context/index.js +1 -0
- package/dist/foundationText/Form/context/types.d.ts +26 -0
- package/dist/foundationText/Form/context/types.js +1 -0
- package/dist/foundationText/Form/hooks/useFormViewRefs.d.ts +10 -0
- package/dist/foundationText/Form/hooks/useFormViewRefs.js +13 -0
- package/dist/foundationText/Form/hooks/useInternalForm.d.ts +19 -0
- package/dist/foundationText/Form/hooks/useInternalForm.js +43 -0
- package/dist/foundationText/Form/hooks/useOfflineHandler.d.ts +1 -0
- package/dist/foundationText/Form/hooks/useOfflineHandler.js +23 -0
- package/dist/foundationText/Form/hooks/useSaveButtonPosition.d.ts +12 -0
- package/dist/foundationText/Form/hooks/useSaveButtonPosition.js +25 -0
- package/dist/foundationText/Form/hooks/useScreenInformation.d.ts +8 -0
- package/dist/foundationText/Form/hooks/useScreenInformation.js +15 -0
- package/dist/foundationText/Form/hooks/useScrollToError/index.d.ts +1 -0
- package/dist/foundationText/Form/hooks/useScrollToError/index.js +1 -0
- package/dist/foundationText/Form/hooks/useScrollToError/useScrollToError.d.ts +9 -0
- package/dist/foundationText/Form/hooks/useScrollToError/useScrollToError.js +64 -0
- package/dist/foundationText/Form/index.d.ts +5 -0
- package/dist/foundationText/Form/index.js +4 -0
- package/dist/foundationText/Form/types.d.ts +215 -0
- package/dist/foundationText/Form/types.js +10 -0
- package/dist/foundationText/FormField/FormField.d.ts +24 -0
- package/dist/foundationText/FormField/FormField.js +11 -0
- package/dist/foundationText/FormField/index.d.ts +1 -0
- package/dist/foundationText/FormField/index.js +1 -0
- package/dist/foundationText/FormatFile/FormatFile.d.ts +79 -0
- package/dist/foundationText/FormatFile/FormatFile.js +47 -0
- package/dist/foundationText/FormatFile/FormatFile.style.d.ts +15 -0
- package/dist/foundationText/FormatFile/FormatFile.style.js +19 -0
- package/dist/foundationText/FormatFile/FormatFileThumbnail.d.ts +58 -0
- package/dist/foundationText/FormatFile/FormatFileThumbnail.js +35 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.js +9 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.style.d.ts +8 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/ErrorIcon.style.js +11 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/ErrorIcon/index.js +1 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.d.ts +13 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.js +42 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.style.d.ts +64 -0
- package/dist/foundationText/FormatFile/components/FileView/FileView.style.js +70 -0
- package/dist/foundationText/FormatFile/components/FileView/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/FileView/index.js +1 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +12 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.js +17 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/index.d.ts +2 -0
- package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/index.js +1 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.d.ts +14 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.js +108 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.style.d.ts +25 -0
- package/dist/foundationText/FormatFile/components/MediaView/MediaView.style.js +28 -0
- package/dist/foundationText/FormatFile/components/MediaView/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/MediaView/index.js +1 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.js +30 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.style.d.ts +13 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/ProgressBar.style.js +16 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/index.d.ts +1 -0
- package/dist/foundationText/FormatFile/components/ProgressBar/index.js +1 -0
- package/dist/foundationText/FormatFile/constants.d.ts +35 -0
- package/dist/foundationText/FormatFile/constants.js +74 -0
- package/dist/foundationText/FormatFile/context/FormatFileContext.d.ts +9 -0
- package/dist/foundationText/FormatFile/context/FormatFileContext.js +8 -0
- package/dist/foundationText/FormatFile/context/types.d.ts +9 -0
- package/dist/foundationText/FormatFile/context/types.js +1 -0
- package/dist/foundationText/FormatFile/index.d.ts +8 -0
- package/dist/foundationText/FormatFile/index.js +3 -0
- package/dist/foundationText/FormatFile/types.d.ts +105 -0
- package/dist/foundationText/FormatFile/types.js +8 -0
- package/dist/foundationText/FormatFile/utils/computeA11yLabel.d.ts +9 -0
- package/dist/foundationText/FormatFile/utils/computeA11yLabel.js +11 -0
- package/dist/foundationText/FormatFile/utils/createUseCreateThumbnail.d.ts +6 -0
- package/dist/foundationText/FormatFile/utils/createUseCreateThumbnail.js +27 -0
- package/dist/foundationText/FormatFile/utils/getFileCategory.d.ts +28 -0
- package/dist/foundationText/FormatFile/utils/getFileCategory.js +62 -0
- package/dist/foundationText/FormatFile/utils/index.d.ts +7 -0
- package/dist/foundationText/FormatFile/utils/index.js +6 -0
- package/dist/foundationText/FormatFile/utils/mapFileTypeToIconName.d.ts +17 -0
- package/dist/foundationText/FormatFile/utils/mapFileTypeToIconName.js +30 -0
- package/dist/foundationText/FormatFile/utils/parseFile.d.ts +3 -0
- package/dist/foundationText/FormatFile/utils/parseFile.js +58 -0
- package/dist/foundationText/FormatFile/utils/sanitizeFileName.d.ts +5 -0
- package/dist/foundationText/FormatFile/utils/sanitizeFileName.js +9 -0
- package/dist/foundationText/FormatFile/utils/truncateFileNameForLine.d.ts +24 -0
- package/dist/foundationText/FormatFile/utils/truncateFileNameForLine.js +58 -0
- package/dist/foundationText/Glimmer/Glimmer.d.ts +32 -0
- package/dist/foundationText/Glimmer/Glimmer.js +42 -0
- package/dist/foundationText/Glimmer/Glimmer.shape.style.d.ts +14 -0
- package/dist/foundationText/Glimmer/Glimmer.shape.style.js +17 -0
- package/dist/foundationText/Glimmer/Glimmer.size.style.d.ts +17 -0
- package/dist/foundationText/Glimmer/Glimmer.size.style.js +10 -0
- package/dist/foundationText/Glimmer/Glimmer.style.d.ts +26 -0
- package/dist/foundationText/Glimmer/Glimmer.style.js +30 -0
- package/dist/foundationText/Glimmer/index.d.ts +1 -0
- package/dist/foundationText/Glimmer/index.js +1 -0
- package/dist/foundationText/Heading/Heading.d.ts +38 -0
- package/dist/foundationText/Heading/Heading.js +53 -0
- package/dist/foundationText/Heading/index.d.ts +2 -0
- package/dist/foundationText/Heading/index.js +1 -0
- package/dist/foundationText/IconButton/IconButton.d.ts +35 -0
- package/dist/foundationText/IconButton/IconButton.js +9 -0
- package/dist/foundationText/IconButton/IconButton.style.d.ts +8 -0
- package/dist/foundationText/IconButton/IconButton.style.js +11 -0
- package/dist/foundationText/IconButton/index.d.ts +1 -0
- package/dist/foundationText/IconButton/index.js +1 -0
- package/dist/foundationText/InputCurrency/constants.d.ts +1 -0
- package/dist/foundationText/InputCurrency/constants.js +1 -0
- package/dist/foundationText/InputCurrency/utils.d.ts +9 -0
- package/dist/foundationText/InputCurrency/utils.js +57 -0
- package/dist/foundationText/InputDate/InputDate.d.ts +76 -0
- package/dist/foundationText/InputDate/InputDate.js +70 -0
- package/dist/foundationText/InputDate/index.d.ts +2 -0
- package/dist/foundationText/InputDate/index.js +1 -0
- package/dist/foundationText/InputFieldWrapper/CommonInputStyles.style.d.ts +10 -0
- package/dist/foundationText/InputFieldWrapper/CommonInputStyles.style.js +49 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.d.ts +92 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.js +99 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.style.d.ts +106 -0
- package/dist/foundationText/InputFieldWrapper/InputFieldWrapper.style.js +123 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +10 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.js +11 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.style.d.ts +22 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/ClearAction.style.js +26 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/index.d.ts +1 -0
- package/dist/foundationText/InputFieldWrapper/components/ClearAction/index.js +1 -0
- package/dist/foundationText/InputFieldWrapper/components/Prefix/Prefix.d.ts +22 -0
- package/dist/foundationText/InputFieldWrapper/components/Prefix/Prefix.js +39 -0
- package/dist/foundationText/InputFieldWrapper/components/Suffix/Suffix.d.ts +25 -0
- package/dist/foundationText/InputFieldWrapper/components/Suffix/Suffix.js +40 -0
- package/dist/foundationText/InputFieldWrapper/index.d.ts +4 -0
- package/dist/foundationText/InputFieldWrapper/index.js +3 -0
- package/dist/foundationText/InputPressable/InputPressable.d.ts +91 -0
- package/dist/foundationText/InputPressable/InputPressable.js +42 -0
- package/dist/foundationText/InputPressable/InputPressable.style.d.ts +21 -0
- package/dist/foundationText/InputPressable/InputPressable.style.js +28 -0
- package/dist/foundationText/InputPressable/index.d.ts +2 -0
- package/dist/foundationText/InputPressable/index.js +1 -0
- package/dist/foundationText/InputSearch/components/FilterButton.d.ts +7 -0
- package/dist/foundationText/InputSearch/components/FilterButton.js +10 -0
- package/dist/foundationText/InputText/context/InputAccessoriesContext.d.ts +3 -0
- package/dist/foundationText/InputText/context/InputAccessoriesContext.js +16 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.d.ts +5 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.js +68 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.style.d.ts +17 -0
- package/dist/foundationText/InputText/context/InputAccessoriesProvider.style.js +23 -0
- package/dist/foundationText/InputText/context/index.d.ts +2 -0
- package/dist/foundationText/InputText/context/index.js +2 -0
- package/dist/foundationText/InputText/context/types.d.ts +23 -0
- package/dist/foundationText/InputText/context/types.js +1 -0
- package/dist/foundationText/InputTime/InputTime.d.ts +63 -0
- package/dist/foundationText/InputTime/InputTime.js +76 -0
- package/dist/foundationText/InputTime/InputTime.style.d.ts +6 -0
- package/dist/foundationText/InputTime/InputTime.style.js +7 -0
- package/dist/foundationText/InputTime/index.d.ts +2 -0
- package/dist/foundationText/InputTime/index.js +2 -0
- package/dist/foundationText/InputTime/utils/index.d.ts +11 -0
- package/dist/foundationText/InputTime/utils/index.js +16 -0
- package/dist/foundationText/ProgressBar/ProgressBar.d.ts +6 -0
- package/dist/foundationText/ProgressBar/ProgressBar.js +36 -0
- package/dist/foundationText/ProgressBar/ProgressBar.size.style.d.ts +11 -0
- package/dist/foundationText/ProgressBar/ProgressBar.size.style.js +6 -0
- package/dist/foundationText/ProgressBar/ProgressBar.style.d.ts +34 -0
- package/dist/foundationText/ProgressBar/ProgressBar.style.js +37 -0
- package/dist/foundationText/ProgressBar/ProgressBarInner.d.ts +12 -0
- package/dist/foundationText/ProgressBar/ProgressBarInner.js +25 -0
- package/dist/foundationText/ProgressBar/ProgressBarStepped.d.ts +12 -0
- package/dist/foundationText/ProgressBar/ProgressBarStepped.js +32 -0
- package/dist/foundationText/ProgressBar/index.d.ts +2 -0
- package/dist/foundationText/ProgressBar/index.js +1 -0
- package/dist/foundationText/ProgressBar/types.d.ts +61 -0
- package/dist/foundationText/ProgressBar/types.js +1 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.d.ts +3 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.js +105 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.size.style.d.ts +19 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.size.style.js +15 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.style.d.ts +48 -0
- package/dist/foundationText/ProgressIndicator/ProgressIndicator.style.js +51 -0
- package/dist/foundationText/ProgressIndicator/index.d.ts +2 -0
- package/dist/foundationText/ProgressIndicator/index.js +1 -0
- package/dist/foundationText/ProgressIndicator/types.d.ts +44 -0
- package/dist/foundationText/ProgressIndicator/types.js +1 -0
- package/dist/foundationText/Select/Select.d.ts +92 -0
- package/dist/foundationText/Select/Select.js +102 -0
- package/dist/foundationText/Select/Select.style.d.ts +29 -0
- package/dist/foundationText/Select/Select.style.js +55 -0
- package/dist/foundationText/Select/SelectComposableTypes.d.ts +50 -0
- package/dist/foundationText/Select/SelectComposableTypes.js +1 -0
- package/dist/foundationText/Select/SelectRoot.d.ts +12 -0
- package/dist/foundationText/Select/SelectRoot.js +69 -0
- package/dist/foundationText/Select/SelectRoot.style.d.ts +8 -0
- package/dist/foundationText/Select/SelectRoot.style.js +9 -0
- package/dist/foundationText/Select/components/SelectContent.d.ts +8 -0
- package/dist/foundationText/Select/components/SelectContent.js +34 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.js +22 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.js +15 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.d.ts +30 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.js +29 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectDefaultPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectFieldContext.d.ts +27 -0
- package/dist/foundationText/Select/components/SelectFieldContext.js +10 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/SelectIOSPicker.d.ts +10 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/SelectIOSPicker.js +2 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectIOSPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +3 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/SelectInternalPicker.js +14 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/index.js +1 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/utils.d.ts +3 -0
- package/dist/foundationText/Select/components/SelectInternalPicker/utils.js +13 -0
- package/dist/foundationText/Select/components/SelectItem.d.ts +32 -0
- package/dist/foundationText/Select/components/SelectItem.js +26 -0
- package/dist/foundationText/Select/components/SelectItem.style.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectItem.style.js +6 -0
- package/dist/foundationText/Select/components/SelectLabel.d.ts +22 -0
- package/dist/foundationText/Select/components/SelectLabel.js +30 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.d.ts +11 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.js +17 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.style.d.ts +5 -0
- package/dist/foundationText/Select/components/SelectPressable/SelectPressable.style.js +8 -0
- package/dist/foundationText/Select/components/SelectPressable/index.d.ts +1 -0
- package/dist/foundationText/Select/components/SelectPressable/index.js +1 -0
- package/dist/foundationText/Select/components/SelectTrigger.d.ts +20 -0
- package/dist/foundationText/Select/components/SelectTrigger.js +39 -0
- package/dist/foundationText/Select/components/SelectTrigger.style.d.ts +25 -0
- package/dist/foundationText/Select/components/SelectTrigger.style.js +31 -0
- package/dist/foundationText/Select/index.d.ts +4 -0
- package/dist/foundationText/Select/index.js +4 -0
- package/dist/foundationText/Select/types.d.ts +38 -0
- package/dist/foundationText/Select/types.js +1 -0
- package/dist/foundationText/StatusLabel/StatusLabel.d.ts +22 -0
- package/dist/foundationText/StatusLabel/StatusLabel.js +20 -0
- package/dist/foundationText/StatusLabel/StatusLabel.style.d.ts +23 -0
- package/dist/foundationText/StatusLabel/StatusLabel.style.js +29 -0
- package/dist/foundationText/StatusLabel/index.d.ts +2 -0
- package/dist/foundationText/StatusLabel/index.js +1 -0
- package/dist/foundationText/Text/Text.d.ts +76 -0
- package/dist/foundationText/Text/Text.js +39 -0
- package/dist/foundationText/Text/index.d.ts +2 -0
- package/dist/foundationText/Text/index.js +1 -0
- package/dist/foundationText/TextList/TextList.d.ts +30 -0
- package/dist/foundationText/TextList/TextList.js +11 -0
- package/dist/foundationText/TextList/TextList.style.d.ts +14 -0
- package/dist/foundationText/TextList/TextList.style.js +17 -0
- package/dist/foundationText/TextList/index.d.ts +1 -0
- package/dist/foundationText/TextList/index.js +1 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.d.ts +5 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.js +32 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.style.d.ts +47 -0
- package/dist/foundationText/ThumbnailList/ThumbnailList.style.js +50 -0
- package/dist/foundationText/ThumbnailList/index.d.ts +2 -0
- package/dist/foundationText/ThumbnailList/index.js +2 -0
- package/dist/foundationText/ThumbnailList/types.d.ts +15 -0
- package/dist/foundationText/ThumbnailList/types.js +5 -0
- package/dist/foundationText/Toast/Toast.d.ts +28 -0
- package/dist/foundationText/Toast/Toast.js +64 -0
- package/dist/foundationText/Toast/Toast.styles.d.ts +31 -0
- package/dist/foundationText/Toast/Toast.styles.js +31 -0
- package/dist/foundationText/Toast/index.d.ts +2 -0
- package/dist/foundationText/Toast/index.js +1 -0
- package/dist/foundationText/Typography/Typography.d.ts +126 -0
- package/dist/foundationText/Typography/Typography.js +124 -0
- package/dist/foundationText/Typography/Typography.style.d.ts +16 -0
- package/dist/foundationText/Typography/Typography.style.js +472 -0
- package/dist/foundationText/Typography/TypographyGestureDetector.d.ts +8 -0
- package/dist/foundationText/Typography/TypographyGestureDetector.js +11 -0
- package/dist/foundationText/Typography/index.d.ts +5 -0
- package/dist/foundationText/Typography/index.js +4 -0
- package/dist/foundationText/Typography/webFonts.d.ts +4 -0
- package/dist/foundationText/Typography/webFonts.js +34 -0
- package/dist/foundationText/capitalize.d.ts +1 -0
- package/dist/foundationText/capitalize.js +6 -0
- package/dist/foundationText/compatTheme.d.ts +8 -0
- package/dist/foundationText/compatTheme.js +14 -0
- package/dist/foundationText/dateFormatter.d.ts +6 -0
- package/dist/foundationText/dateFormatter.js +19 -0
- package/dist/foundationText/foundationMessages.d.ts +11 -0
- package/dist/foundationText/foundationMessages.js +24 -0
- package/dist/foundationText/messages-en.d.ts +38 -0
- package/dist/foundationText/messages-en.js +38 -0
- package/dist/foundationText/messages-es.d.ts +38 -0
- package/dist/foundationText/messages-es.js +38 -0
- package/dist/foundationText/primitives/HelperText/HelperText.d.ts +15 -0
- package/dist/foundationText/primitives/HelperText/HelperText.js +11 -0
- package/dist/foundationText/primitives/HelperText/HelperText.style.d.ts +16 -0
- package/dist/foundationText/primitives/HelperText/HelperText.style.js +19 -0
- package/dist/foundationText/primitives/HelperText/index.d.ts +2 -0
- package/dist/foundationText/primitives/HelperText/index.js +1 -0
- package/dist/foundationText/primitives/Portal/index.d.ts +1 -0
- package/dist/foundationText/primitives/Portal/index.js +7 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.d.ts +69 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.js +160 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.style.d.ts +114 -0
- package/dist/foundationText/primitives/Select/SelectPrimitive.style.js +130 -0
- package/dist/foundationText/primitives/Select/index.d.ts +2 -0
- package/dist/foundationText/primitives/Select/index.js +1 -0
- package/dist/foundationText/primitives/Select/nativeTypes.d.ts +84 -0
- package/dist/foundationText/primitives/Select/nativeTypes.js +1 -0
- package/dist/foundationText/primitives/Select/types.d.ts +41 -0
- package/dist/foundationText/primitives/Select/types.js +1 -0
- package/dist/foundationText/primitives/index.d.ts +3 -0
- package/dist/foundationText/primitives/index.js +3 -0
- package/dist/foundationTokens.d.ts +388 -0
- package/dist/foundationTokens.js +26 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +54 -0
- package/dist/legacyTheme.d.ts +18 -0
- package/dist/legacyTheme.js +23 -0
- package/dist/sheetContext.d.ts +3 -0
- package/dist/sheetContext.js +6 -0
- package/dist/theme.d.ts +29 -0
- package/dist/theme.js +42 -0
- package/dist/useFormController.d.ts +11 -0
- package/dist/useFormController.js +15 -0
- package/dist/useIsScreenReaderEnabled.d.ts +1 -0
- package/dist/useIsScreenReaderEnabled.js +21 -0
- package/ios/RulnarPickerManager.m +59 -0
- package/package.json +146 -4
- package/resources/meta.json +85 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DimensionValue } from "react-native";
|
|
3
|
+
import type { CreateThumbnail, File, FileUpload } from "./types.js";
|
|
4
|
+
export interface FormatFileThumbnailProps<T> {
|
|
5
|
+
/**
|
|
6
|
+
* File upload details object. Can be a File or a FileUpload.
|
|
7
|
+
*/
|
|
8
|
+
readonly file: T;
|
|
9
|
+
/**
|
|
10
|
+
* Accessibility label for the thumbnail.
|
|
11
|
+
*/
|
|
12
|
+
readonly accessibilityLabel?: (string) | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Set false to hide all file type iconography, including the video fallback
|
|
15
|
+
* placeholder icon.
|
|
16
|
+
*/
|
|
17
|
+
readonly showFileTypeIndicator?: (boolean) | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* A function to generate a thumbnail for media files.
|
|
20
|
+
*/
|
|
21
|
+
readonly createThumbnail?: (CreateThumbnail) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The dimensions of the thumbnail container.
|
|
24
|
+
*/
|
|
25
|
+
readonly size: {
|
|
26
|
+
readonly width: DimensionValue;
|
|
27
|
+
readonly height: DimensionValue;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A reference to the element in the rendered output.
|
|
31
|
+
*/
|
|
32
|
+
readonly testID?: (string) | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
* A function to be called when the media has loaded.
|
|
36
|
+
* Not to be used for Files
|
|
37
|
+
*/
|
|
38
|
+
readonly onMediaLoadEnd?: (() => void) | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Optional override for the tile's surface colour. Defaults to the
|
|
41
|
+
* themed `color-surface--background` token. Use this when embedding
|
|
42
|
+
* the thumbnail inside surrounding chrome (e.g. a media gallery) so
|
|
43
|
+
* the tile background matches the surrounding container.
|
|
44
|
+
*/
|
|
45
|
+
readonly surfaceColor?: (string) | undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A lightweight, visual-only file thumbnail component.
|
|
49
|
+
*
|
|
50
|
+
* Unlike `FormatFile`, this component does **not** include a `TouchableOpacity`
|
|
51
|
+
* wrapper or a `BottomSheet`. The consumer is responsible for handling press
|
|
52
|
+
* interactions and action sheets externally.
|
|
53
|
+
*
|
|
54
|
+
* This makes it suitable for use inside virtualized lists (e.g. FlashList)
|
|
55
|
+
* where you need a single shared BottomSheet rather than one per item, and
|
|
56
|
+
* where the consumer controls the item dimensions via the `size` prop.
|
|
57
|
+
*/
|
|
58
|
+
export declare function FormatFileThumbnail<T extends File | FileUpload>({ file, accessibilityLabel, showFileTypeIndicator, createThumbnail: createThumbnailProp, size, testID, onMediaLoadEnd, surfaceColor, }: FormatFileThumbnailProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./FormatFile.style.js";
|
|
5
|
+
import { FormatFileContent } from "./FormatFile.js";
|
|
6
|
+
import { StatusCode } from "./types.js";
|
|
7
|
+
import { FormatFileContext } from "./context/FormatFileContext.js";
|
|
8
|
+
import { createUseCreateThumbnail, emptyThumbnail } from "./utils/createUseCreateThumbnail.js";
|
|
9
|
+
import { parseFile } from "./utils/parseFile.js";
|
|
10
|
+
/**
|
|
11
|
+
* A lightweight, visual-only file thumbnail component.
|
|
12
|
+
*
|
|
13
|
+
* Unlike `FormatFile`, this component does **not** include a `TouchableOpacity`
|
|
14
|
+
* wrapper or a `BottomSheet`. The consumer is responsible for handling press
|
|
15
|
+
* interactions and action sheets externally.
|
|
16
|
+
*
|
|
17
|
+
* This makes it suitable for use inside virtualized lists (e.g. FlashList)
|
|
18
|
+
* where you need a single shared BottomSheet rather than one per item, and
|
|
19
|
+
* where the consumer controls the item dimensions via the `size` prop.
|
|
20
|
+
*/
|
|
21
|
+
export function FormatFileThumbnail({ file, accessibilityLabel, showFileTypeIndicator = true, createThumbnail: createThumbnailProp, size, testID, onMediaLoadEnd, surfaceColor, }) {
|
|
22
|
+
const formattedFile = useMemo(() => parseFile(file, showFileTypeIndicator), [file, showFileTypeIndicator]);
|
|
23
|
+
const styles = useStyles();
|
|
24
|
+
const [showOverlay, setShowOverlay] = useState(formattedFile.status !== StatusCode.Completed);
|
|
25
|
+
const createThumbnail = createThumbnailProp ?? emptyThumbnail;
|
|
26
|
+
const { useCreateThumbnail } = createUseCreateThumbnail(createThumbnail);
|
|
27
|
+
return (_jsx(FormatFileContext.Provider, { value: { useCreateThumbnail }, children: _jsx(View, { style: [
|
|
28
|
+
styles.thumbnailContainer,
|
|
29
|
+
// Override marginBottom — spacing between items is a layout concern
|
|
30
|
+
// that belongs to the consumer, not the thumbnail itself.
|
|
31
|
+
{ marginBottom: 0 },
|
|
32
|
+
size && { width: size.width, height: size.height },
|
|
33
|
+
surfaceColor ? { backgroundColor: surfaceColor } : undefined,
|
|
34
|
+
], testID: testID, children: _jsx(FormatFileContent, { accessibilityLabel: accessibilityLabel, file: formattedFile, onUploadComplete: () => setShowOverlay(false), isMedia: !!formattedFile.isMedia, styleInGrid: true, showOverlay: showOverlay, skipContainerStyles: true, onMediaLoadEnd: onMediaLoadEnd, surfaceColor: surfaceColor }) }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./ErrorIcon.style.js";
|
|
5
|
+
import { Icon } from "../../../../Icon.js";
|
|
6
|
+
export function ErrorIcon() {
|
|
7
|
+
const styles = useStyles();
|
|
8
|
+
return (_jsx(View, { testID: "format-file-error-icon", style: styles.circle, children: _jsx(Icon, { name: "alert", color: "critical" }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
circle: {
|
|
5
|
+
width: tokens["space-large"],
|
|
6
|
+
height: tokens["space-large"],
|
|
7
|
+
borderRadius: tokens["radius-circle"],
|
|
8
|
+
backgroundColor: tokens["color-surface"],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorIcon } from "./ErrorIcon.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorIcon } from "./ErrorIcon.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormattedFile } from "../../types.js";
|
|
3
|
+
interface FileViewProps {
|
|
4
|
+
readonly accessibilityLabel?: (string) | undefined;
|
|
5
|
+
readonly showOverlay: boolean;
|
|
6
|
+
readonly showError: boolean;
|
|
7
|
+
readonly file: FormattedFile;
|
|
8
|
+
readonly styleInGrid: boolean;
|
|
9
|
+
readonly onUploadComplete: () => void;
|
|
10
|
+
readonly surfaceColor?: (string) | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, surfaceColor, }: FileViewProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./FileView.style.js";
|
|
5
|
+
import { Icon } from "../../../../Icon.js";
|
|
6
|
+
import { Text } from "../../../Text/index.js";
|
|
7
|
+
import { StatusCode } from "../../types.js";
|
|
8
|
+
import { computeA11yLabel, mapFileTypeToIconName, sanitizeFileName, truncateFileNameForLine, } from "../../utils/index.js";
|
|
9
|
+
import { ProgressBar } from "../ProgressBar/index.js";
|
|
10
|
+
import { ErrorIcon } from "../ErrorIcon/index.js";
|
|
11
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
12
|
+
export function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, surfaceColor, }) {
|
|
13
|
+
const { t } = useComponentMessages();
|
|
14
|
+
const styles = useStyles();
|
|
15
|
+
const a11yLabel = computeA11yLabel({
|
|
16
|
+
accessibilityLabel,
|
|
17
|
+
showOverlay,
|
|
18
|
+
showError,
|
|
19
|
+
t,
|
|
20
|
+
});
|
|
21
|
+
const freezeProgressBar = file.status !== StatusCode.Completed && file.progress >= 0.9;
|
|
22
|
+
return (_jsxs(View, { style: [
|
|
23
|
+
styles.fileBackground,
|
|
24
|
+
styleInGrid ? styles.fileBackgroundGrid : styles.fileBackgroundFlat,
|
|
25
|
+
surfaceColor ? { backgroundColor: surfaceColor } : undefined,
|
|
26
|
+
], accessible: true, accessibilityLabel: a11yLabel, children: [_jsx(View, { style: [
|
|
27
|
+
styles.fileBackground,
|
|
28
|
+
styleInGrid ? styles.fileIconGrid : styles.fileIconFlat,
|
|
29
|
+
], testID: "test-file", children: (styleInGrid || !showError) && file.showFileTypeIndicator && (_jsx(Icon, { size: "large", name: mapFileTypeToIconName({
|
|
30
|
+
fileName: file.name,
|
|
31
|
+
fileType: file.type,
|
|
32
|
+
}) })) }), _jsx(View, { style: [
|
|
33
|
+
showError && styleInGrid ? styles.fileNameError : styles.fileName,
|
|
34
|
+
styleInGrid ? styles.fileNameGrid : styles.fileNameFlat,
|
|
35
|
+
], children: _jsx(Text, { level: "textSupporting", variation: "subdued", maxLines: "single", children: styleInGrid
|
|
36
|
+
? truncateFileNameForLine(sanitizeFileName(file.name))
|
|
37
|
+
: sanitizeFileName(file.name) }) }), !showError && showOverlay && (_jsx(View, { style: [styles.fileBackground, styles.overlay, styles.fileOverlay], testID: "format-file-progress-bar-container", children: _jsx(ProgressBar, { status: file.status, progress: freezeProgressBar ? 0.9 : file.progress, onComplete: onUploadComplete }) })), showError && (_jsx(View, { style: [
|
|
38
|
+
styles.fileBackground,
|
|
39
|
+
styles.overlayError,
|
|
40
|
+
styles.fileOverlay,
|
|
41
|
+
], testID: "format-file-error-container", children: _jsx(View, { style: !styleInGrid ? styles.iconCenter : undefined, children: _jsx(ErrorIcon, {}) }) }))] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
overlay: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
};
|
|
5
|
+
overlayError: {
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
borderWidth: number;
|
|
9
|
+
};
|
|
10
|
+
iconCenter: {
|
|
11
|
+
marginBottom: number;
|
|
12
|
+
};
|
|
13
|
+
fileBackground: {
|
|
14
|
+
width: "100%";
|
|
15
|
+
display: "flex";
|
|
16
|
+
alignItems: "center";
|
|
17
|
+
};
|
|
18
|
+
fileBackgroundGrid: {
|
|
19
|
+
height: "100%";
|
|
20
|
+
};
|
|
21
|
+
fileBackgroundFlat: {
|
|
22
|
+
justifyContent: "center";
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
fileIconGrid: {
|
|
26
|
+
top: number;
|
|
27
|
+
};
|
|
28
|
+
fileIconFlat: {
|
|
29
|
+
top: number;
|
|
30
|
+
};
|
|
31
|
+
fileNameError: {
|
|
32
|
+
alignItems: "center";
|
|
33
|
+
borderTopColor: string;
|
|
34
|
+
borderTopWidth: number;
|
|
35
|
+
width: "100%";
|
|
36
|
+
marginTop: number;
|
|
37
|
+
overflow: "hidden";
|
|
38
|
+
};
|
|
39
|
+
fileName: {
|
|
40
|
+
alignItems: "center";
|
|
41
|
+
borderTopColor: string;
|
|
42
|
+
borderTopWidth: number;
|
|
43
|
+
width: "100%";
|
|
44
|
+
overflow: "hidden";
|
|
45
|
+
};
|
|
46
|
+
fileNameGrid: {
|
|
47
|
+
position: "absolute";
|
|
48
|
+
right: number;
|
|
49
|
+
bottom: number;
|
|
50
|
+
left: number;
|
|
51
|
+
};
|
|
52
|
+
fileNameFlat: {
|
|
53
|
+
top: number;
|
|
54
|
+
};
|
|
55
|
+
fileOverlay: {
|
|
56
|
+
position: "absolute";
|
|
57
|
+
justifyContent: "center";
|
|
58
|
+
right: number;
|
|
59
|
+
bottom: number;
|
|
60
|
+
left: number;
|
|
61
|
+
height: "100%";
|
|
62
|
+
paddingHorizontal: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
overlay: {
|
|
5
|
+
backgroundColor: tokens["color-overlay--dimmed"],
|
|
6
|
+
},
|
|
7
|
+
overlayError: {
|
|
8
|
+
backgroundColor: tokens["color-overlay--dimmed"],
|
|
9
|
+
borderColor: tokens["color-critical"],
|
|
10
|
+
borderWidth: tokens["border-base"],
|
|
11
|
+
},
|
|
12
|
+
iconCenter: {
|
|
13
|
+
marginBottom: tokens["space-large"],
|
|
14
|
+
},
|
|
15
|
+
fileBackground: {
|
|
16
|
+
width: "100%",
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
},
|
|
20
|
+
fileBackgroundGrid: {
|
|
21
|
+
height: "100%",
|
|
22
|
+
},
|
|
23
|
+
fileBackgroundFlat: {
|
|
24
|
+
justifyContent: "center",
|
|
25
|
+
height: tokens["space-extravagant"],
|
|
26
|
+
},
|
|
27
|
+
fileIconGrid: {
|
|
28
|
+
top: tokens["space-small"],
|
|
29
|
+
},
|
|
30
|
+
fileIconFlat: {
|
|
31
|
+
top: tokens["space-smaller"],
|
|
32
|
+
},
|
|
33
|
+
fileNameError: {
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
borderTopColor: tokens["color-border"],
|
|
36
|
+
borderTopWidth: tokens["space-minuscule"],
|
|
37
|
+
width: "100%",
|
|
38
|
+
marginTop: tokens["space-base"],
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
},
|
|
41
|
+
fileName: {
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
borderTopColor: tokens["color-border"],
|
|
44
|
+
borderTopWidth: tokens["space-minuscule"],
|
|
45
|
+
width: "100%",
|
|
46
|
+
// Belt-and-suspenders with `numberOfLines={1}`: on Android the latter
|
|
47
|
+
// does not always enforce single-line layout for URL-shaped strings,
|
|
48
|
+
// so clip any unexpected overflow at the rounded tile border.
|
|
49
|
+
overflow: "hidden",
|
|
50
|
+
},
|
|
51
|
+
fileNameGrid: {
|
|
52
|
+
position: "absolute",
|
|
53
|
+
right: 0,
|
|
54
|
+
bottom: 0,
|
|
55
|
+
left: 0,
|
|
56
|
+
},
|
|
57
|
+
fileNameFlat: {
|
|
58
|
+
top: tokens["space-small"],
|
|
59
|
+
},
|
|
60
|
+
fileOverlay: {
|
|
61
|
+
position: "absolute",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
right: 0,
|
|
64
|
+
bottom: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
height: "100%",
|
|
67
|
+
paddingHorizontal: tokens["space-small"],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileView } from "./FileView.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FileView } from "./FileView.js";
|
package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { BottomSheetRef } from "../../../BottomSheet/BottomSheet.js";
|
|
4
|
+
export type BottomSheetOptionsSuffix = "receipt" | "image" | "file" | "video";
|
|
5
|
+
interface FormatFileBottomSheetProps {
|
|
6
|
+
readonly bottomSheetRef: RefObject<BottomSheetRef | null>;
|
|
7
|
+
readonly onPreviewPress?: (() => void) | undefined;
|
|
8
|
+
readonly onRemovePress?: (() => void) | undefined;
|
|
9
|
+
readonly bottomSheetOptionsSuffix?: (BottomSheetOptionsSuffix) | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare const FormatFileBottomSheet: ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }: FormatFileBottomSheetProps) => React.JSX.Element;
|
|
12
|
+
export {};
|
package/dist/foundationText/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BottomSheet } from "../../../BottomSheet/BottomSheet.js";
|
|
4
|
+
import { BottomSheetOption } from "../../../BottomSheet/components/BottomSheetOption/index.js";
|
|
5
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
6
|
+
export const FormatFileBottomSheet = ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }) => {
|
|
7
|
+
const { t } = useComponentMessages();
|
|
8
|
+
const handlePress = (onPressAction) => {
|
|
9
|
+
onPressAction();
|
|
10
|
+
bottomSheetRef.current?.close();
|
|
11
|
+
};
|
|
12
|
+
return (_jsxs(BottomSheet, { ref: bottomSheetRef, children: [onPreviewPress ? (_jsx(BottomSheetOption, { icon: "eye", text: t("FormatFile.preview", {
|
|
13
|
+
item: bottomSheetOptionsSuffix || "",
|
|
14
|
+
}), onPress: () => handlePress(onPreviewPress) })) : undefined, onRemovePress ? (_jsx(BottomSheetOption, { icon: "trash", destructive: true, text: t("FormatFile.remove", {
|
|
15
|
+
item: bottomSheetOptionsSuffix || "",
|
|
16
|
+
}), onPress: () => handlePress(onRemovePress) })) : undefined] }));
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormatFileBottomSheet } from "./FormatFileBottomSheet.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FormattedFile } from "../../types.js";
|
|
3
|
+
interface MediaViewProps {
|
|
4
|
+
readonly accessibilityLabel?: (string) | undefined;
|
|
5
|
+
readonly showOverlay: boolean;
|
|
6
|
+
readonly showError: boolean;
|
|
7
|
+
readonly file: FormattedFile;
|
|
8
|
+
readonly styleInGrid: boolean;
|
|
9
|
+
readonly onUploadComplete: () => void;
|
|
10
|
+
readonly onLoadEnd?: (() => void) | undefined;
|
|
11
|
+
readonly surfaceColor?: (string) | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, onLoadEnd, surfaceColor, }: MediaViewProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { ImageBackground, View } from "react-native";
|
|
4
|
+
import { useStyles } from "./MediaView.style.js";
|
|
5
|
+
import { StatusCode } from "../../types.js";
|
|
6
|
+
import { computeA11yLabel } from "../../utils/index.js";
|
|
7
|
+
import { ActivityIndicator } from "../../../ActivityIndicator/index.js";
|
|
8
|
+
import { Icon } from "../../../../Icon.js";
|
|
9
|
+
import { ProgressBar } from "../ProgressBar/index.js";
|
|
10
|
+
import { ErrorIcon } from "../ErrorIcon/index.js";
|
|
11
|
+
import { useFormatFileContext } from "../../context/FormatFileContext.js";
|
|
12
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
13
|
+
// eslint-disable-next-line max-statements
|
|
14
|
+
export function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, onLoadEnd, surfaceColor, }) {
|
|
15
|
+
const { t } = useComponentMessages();
|
|
16
|
+
const { useCreateThumbnail } = useFormatFileContext();
|
|
17
|
+
const { thumbnail, error } = useCreateThumbnail(file);
|
|
18
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
19
|
+
const [decodeFailed, setDecodeFailed] = useState(false);
|
|
20
|
+
/**
|
|
21
|
+
* Tracks whether onLoadEnd has fired to prevent race conditions.
|
|
22
|
+
* ImageBackground can fire onLoadEnd before onLoadStart when loading cached images,
|
|
23
|
+
* which would cause isLoading to get stuck at true, showing an infinite spinner.
|
|
24
|
+
*/
|
|
25
|
+
const hasLoadedRef = useRef(false);
|
|
26
|
+
const hasNotifiedLoadEndRef = useRef(false);
|
|
27
|
+
const a11yLabel = computeA11yLabel({
|
|
28
|
+
accessibilityLabel,
|
|
29
|
+
showOverlay,
|
|
30
|
+
showError,
|
|
31
|
+
t,
|
|
32
|
+
});
|
|
33
|
+
const hasError = showError || error, uri = thumbnail || file.thumbnailUrl || file.source, styles = useStyles();
|
|
34
|
+
const handleLoadStart = () => {
|
|
35
|
+
if (!hasLoadedRef.current) {
|
|
36
|
+
setIsLoading(true);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const handleLoadEnd = () => {
|
|
40
|
+
hasLoadedRef.current = true;
|
|
41
|
+
setIsLoading(false);
|
|
42
|
+
};
|
|
43
|
+
const handleMediaLoadEnd = () => {
|
|
44
|
+
handleLoadEnd();
|
|
45
|
+
if (!hasNotifiedLoadEndRef.current) {
|
|
46
|
+
hasNotifiedLoadEndRef.current = true;
|
|
47
|
+
onLoadEnd?.();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
hasLoadedRef.current = false;
|
|
52
|
+
hasNotifiedLoadEndRef.current = false;
|
|
53
|
+
setIsLoading(false);
|
|
54
|
+
setDecodeFailed(false);
|
|
55
|
+
}, [uri]);
|
|
56
|
+
if (isVideo(file.type) && (!uri || decodeFailed)) {
|
|
57
|
+
return (_jsx(VideoPlaceholder, { a11yLabel: a11yLabel, styleInGrid: styleInGrid, surfaceColor: surfaceColor, styles: styles, isLoading: isLoading, showOverlay: showOverlay, hasError: hasError, file: file, onUploadComplete: onUploadComplete }));
|
|
58
|
+
}
|
|
59
|
+
return (_jsx(View, { accessible: true, accessibilityLabel: a11yLabel, style: surfaceColor ? { backgroundColor: surfaceColor } : undefined, children: _jsx(ImageBackground, { style: [
|
|
60
|
+
styles.imageBackground,
|
|
61
|
+
styleInGrid ? styles.imageBackgroundGrid : styles.imageBackgroundFlat,
|
|
62
|
+
], resizeMode: styleInGrid ? "cover" : "contain", source: { uri }, testID: "test-image", onLoadStart: handleLoadStart, onLoadEnd: handleMediaLoadEnd, onError: () => {
|
|
63
|
+
handleMediaLoadEnd();
|
|
64
|
+
setDecodeFailed(true);
|
|
65
|
+
}, children: _jsx(Overlay, { isLoading: isLoading, showOverlay: showOverlay, hasError: hasError, file: file, onUploadComplete: onUploadComplete, styles: styles, styleInGrid: styleInGrid }) }) }));
|
|
66
|
+
}
|
|
67
|
+
function Overlay({ isLoading, showOverlay, hasError, file, onUploadComplete, styles, styleInGrid, }) {
|
|
68
|
+
if (isLoading) {
|
|
69
|
+
return _jsx(ActivityIndicator, { size: styleInGrid ? "small" : "base" });
|
|
70
|
+
}
|
|
71
|
+
if (hasError)
|
|
72
|
+
return _jsx(ErrorOverlay, { styles: styles });
|
|
73
|
+
if (showOverlay) {
|
|
74
|
+
return (_jsx(ProgressOverlay, { status: file.status, progress: file.progress, onUploadComplete: onUploadComplete, styles: styles }));
|
|
75
|
+
}
|
|
76
|
+
if (isVideo(file.type) && file.showFileTypeIndicator) {
|
|
77
|
+
return _jsx(Icon, { name: "video", color: "white" });
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
function ProgressOverlay({ status, progress, onUploadComplete, styles, }) {
|
|
82
|
+
const freezeProgressBar = status !== StatusCode.Completed && progress >= 0.9;
|
|
83
|
+
return (_jsx(View, { style: [styles.imageBackground, styles.overlay], testID: "format-file-progress-bar-container", children: _jsx(ProgressBar, { status: status, progress: freezeProgressBar ? 0.9 : progress, onComplete: onUploadComplete }) }));
|
|
84
|
+
}
|
|
85
|
+
function ErrorOverlay({ styles, }) {
|
|
86
|
+
return (_jsx(View, { style: [styles.imageBackground, styles.overlayError], testID: "format-file-error-container", children: _jsx(ErrorIcon, {}) }));
|
|
87
|
+
}
|
|
88
|
+
function isVideo(fileType = "") {
|
|
89
|
+
return fileType.includes("video");
|
|
90
|
+
}
|
|
91
|
+
function VideoPlaceholder({ a11yLabel, styleInGrid, surfaceColor, styles, isLoading, showOverlay, hasError, file, onUploadComplete, }) {
|
|
92
|
+
return (_jsxs(View, { accessible: true, accessibilityLabel: a11yLabel, style: [
|
|
93
|
+
styles.imageBackground,
|
|
94
|
+
styleInGrid ? styles.imageBackgroundGrid : styles.imageBackgroundFlat,
|
|
95
|
+
surfaceColor ? { backgroundColor: surfaceColor } : undefined,
|
|
96
|
+
], testID: "format-file-video-placeholder", children: [file.showFileTypeIndicator && _jsx(Icon, { name: "videoFile", size: "large" }), _jsx(PlaceholderStatusOverlay, { isLoading: isLoading, showOverlay: showOverlay, hasError: hasError, file: file, onUploadComplete: onUploadComplete, styles: styles, styleInGrid: styleInGrid })] }));
|
|
97
|
+
}
|
|
98
|
+
function PlaceholderStatusOverlay({ isLoading, showOverlay, hasError, file, onUploadComplete, styles, styleInGrid, }) {
|
|
99
|
+
if (isLoading) {
|
|
100
|
+
return _jsx(ActivityIndicator, { size: styleInGrid ? "small" : "base" });
|
|
101
|
+
}
|
|
102
|
+
if (hasError)
|
|
103
|
+
return _jsx(ErrorOverlay, { styles: styles });
|
|
104
|
+
if (showOverlay) {
|
|
105
|
+
return (_jsx(ProgressOverlay, { status: file.status, progress: file.progress, onUploadComplete: onUploadComplete, styles: styles }));
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
imageBackground: {
|
|
3
|
+
width: "100%";
|
|
4
|
+
justifyContent: "center";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
};
|
|
7
|
+
imageBackgroundFlat: {
|
|
8
|
+
aspectRatio: number;
|
|
9
|
+
};
|
|
10
|
+
imageBackgroundGrid: {
|
|
11
|
+
height: "100%";
|
|
12
|
+
};
|
|
13
|
+
overlay: {
|
|
14
|
+
height: "100%";
|
|
15
|
+
backgroundColor: string;
|
|
16
|
+
paddingHorizontal: number;
|
|
17
|
+
};
|
|
18
|
+
overlayError: {
|
|
19
|
+
height: "100%";
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
paddingHorizontal: number;
|
|
22
|
+
borderColor: string;
|
|
23
|
+
borderWidth: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
imageBackground: {
|
|
5
|
+
width: "100%",
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
},
|
|
9
|
+
imageBackgroundFlat: {
|
|
10
|
+
aspectRatio: 375 / 150,
|
|
11
|
+
},
|
|
12
|
+
imageBackgroundGrid: {
|
|
13
|
+
height: "100%",
|
|
14
|
+
},
|
|
15
|
+
overlay: {
|
|
16
|
+
height: "100%",
|
|
17
|
+
backgroundColor: tokens["color-overlay--dimmed"],
|
|
18
|
+
paddingHorizontal: tokens["space-small"],
|
|
19
|
+
},
|
|
20
|
+
overlayError: {
|
|
21
|
+
height: "100%",
|
|
22
|
+
backgroundColor: tokens["color-overlay--dimmed"],
|
|
23
|
+
paddingHorizontal: tokens["space-small"],
|
|
24
|
+
borderColor: tokens["color-critical"],
|
|
25
|
+
borderWidth: tokens["border-base"],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MediaView } from "./MediaView.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MediaView } from "./MediaView.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StatusCode } from "../../types.js";
|
|
3
|
+
interface ProgressBarProps {
|
|
4
|
+
/**
|
|
5
|
+
* Upload progress value from 0 to 1
|
|
6
|
+
*/
|
|
7
|
+
readonly progress: number;
|
|
8
|
+
/**
|
|
9
|
+
* Upload status
|
|
10
|
+
*/
|
|
11
|
+
readonly status: StatusCode;
|
|
12
|
+
/**
|
|
13
|
+
* Function to be called when the progress is finished
|
|
14
|
+
*/
|
|
15
|
+
readonly onComplete?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ProgressBar: ({ progress, status, onComplete, }: ProgressBarProps) => React.JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useRef } from "react";
|
|
3
|
+
import { Animated, View } from "react-native";
|
|
4
|
+
import { useStyles } from "./ProgressBar.style.js";
|
|
5
|
+
import { StatusCode } from "../../types.js";
|
|
6
|
+
export const ProgressBar = ({ progress, status, onComplete, }) => {
|
|
7
|
+
const barWidth = useRef(new Animated.Value(0)).current;
|
|
8
|
+
const progressPercentage = barWidth.interpolate({
|
|
9
|
+
inputRange: [0, 1],
|
|
10
|
+
outputRange: ["0%", `100%`],
|
|
11
|
+
});
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
Animated.timing(barWidth, {
|
|
14
|
+
toValue: progress,
|
|
15
|
+
duration: 500,
|
|
16
|
+
useNativeDriver: false,
|
|
17
|
+
}).start(({ finished }) => {
|
|
18
|
+
if (status === StatusCode.Completed && finished && onComplete) {
|
|
19
|
+
onComplete();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}, [progress, barWidth, onComplete, status]);
|
|
23
|
+
const styles = useStyles();
|
|
24
|
+
return (_jsx(View, { testID: "format-file-progress-bar", style: styles.container, children: _jsx(Animated.View, { testID: "format-file-inner-progress-bar", style: [
|
|
25
|
+
styles.progress,
|
|
26
|
+
{
|
|
27
|
+
width: progressPercentage,
|
|
28
|
+
},
|
|
29
|
+
] }) }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
container: {
|
|
5
|
+
width: "100%",
|
|
6
|
+
height: 8,
|
|
7
|
+
borderRadius: tokens["radius-circle"],
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
backgroundColor: tokens["color-interactive--background"],
|
|
10
|
+
},
|
|
11
|
+
progress: {
|
|
12
|
+
height: "100%",
|
|
13
|
+
backgroundColor: tokens["color-interactive"],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressBar } from "./ProgressBar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressBar } from "./ProgressBar.js";
|