@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,36 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable import/no-deprecated -- This file implements the deprecated
|
|
3
|
+
* ProgressBar component; self-references predate the deprecation. Migrate to
|
|
4
|
+
* ProgressIndicator. */
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { useStyles } from "./ProgressBar.style.js";
|
|
8
|
+
import { ProgressBarInner, calculateWidth } from "./ProgressBarInner.js";
|
|
9
|
+
import { ProgressBarStepped } from "./ProgressBarStepped.js";
|
|
10
|
+
import { sizeStyles } from "./ProgressBar.size.style.js";
|
|
11
|
+
import { useComponentMessages } from "../foundationMessages.js";
|
|
12
|
+
import { useLegacyTheme } from "../compatTheme.js";
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `ProgressIndicator` instead.
|
|
15
|
+
*/
|
|
16
|
+
export function ProgressBar({ loading, total, current, inProgress = 0, reverseTheme = false, header, variation = "progress", size = "base", UNSAFE_style, }) {
|
|
17
|
+
const { t } = useComponentMessages();
|
|
18
|
+
const styles = useStyles();
|
|
19
|
+
const { tokens } = useLegacyTheme();
|
|
20
|
+
return (_jsxs(View, { accessible: true, accessibilityRole: "progressbar", accessibilityLabel: getA11yLabel(), style: UNSAFE_style?.container, children: [header, variation === "stepped" ? (_jsx(ProgressBarStepped, { total: total, current: current, color: reverseTheme ? undefined : tokens["color-interactive--background"], loading: loading, inProgress: inProgress, UNSAFE_style: UNSAFE_style })) : (_jsxs(View, { testID: "progressbar-container", style: [
|
|
21
|
+
styles.progressBarContainer,
|
|
22
|
+
sizeStyles[size],
|
|
23
|
+
UNSAFE_style?.progressBarContainer,
|
|
24
|
+
], children: [_jsx(ProgressBarInner, { testID: "progressbar-track", width: 100, animationDuration: 0, color: reverseTheme ? undefined : tokens["color-interactive--background"], style: UNSAFE_style?.track }), !loading && (_jsxs(_Fragment, { children: [inProgress && inProgress > 0 ? (_jsx(ProgressBarInner, { testID: "progressbar-inprogress", width: calculateWidth(total, current + inProgress), color: tokens["color-informative"], animationDuration: 800, style: UNSAFE_style?.inProgressFill })) : (_jsx(_Fragment, {})), _jsx(ProgressBarInner, { testID: "progressbar-fill", width: calculateWidth(total, current), color: tokens["color-interactive"], animationDuration: 600, style: UNSAFE_style?.fill })] }))] }))] }));
|
|
25
|
+
function getA11yLabel() {
|
|
26
|
+
const a11yLabelValues = {
|
|
27
|
+
current: String(current),
|
|
28
|
+
total: String(total),
|
|
29
|
+
inProgress: String(inProgress),
|
|
30
|
+
};
|
|
31
|
+
if (inProgress) {
|
|
32
|
+
return t("ProgressBar.inProgress", a11yLabelValues);
|
|
33
|
+
}
|
|
34
|
+
return t("ProgressBar.complete", a11yLabelValues);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
progressBarContainer: {
|
|
3
|
+
marginTop: number;
|
|
4
|
+
marginBottom: number;
|
|
5
|
+
position: "relative";
|
|
6
|
+
flexDirection: "row";
|
|
7
|
+
};
|
|
8
|
+
progressBarInner: {
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
width: "100%";
|
|
11
|
+
height: "100%";
|
|
12
|
+
position: "absolute";
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
borderRadius: number;
|
|
16
|
+
};
|
|
17
|
+
progressInner: {
|
|
18
|
+
height: "100%";
|
|
19
|
+
borderRadius: number;
|
|
20
|
+
};
|
|
21
|
+
step: {
|
|
22
|
+
flex: number;
|
|
23
|
+
marginRight: number;
|
|
24
|
+
height: "100%";
|
|
25
|
+
borderRadius: number;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
};
|
|
28
|
+
completedStep: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
};
|
|
31
|
+
inProgressStep: {
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
progressBarContainer: {
|
|
5
|
+
marginTop: tokens["space-small"],
|
|
6
|
+
marginBottom: tokens["space-small"],
|
|
7
|
+
position: "relative",
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
},
|
|
10
|
+
progressBarInner: {
|
|
11
|
+
backgroundColor: "rgba(255,255,255,0.3)",
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "100%",
|
|
14
|
+
position: "absolute",
|
|
15
|
+
left: 0,
|
|
16
|
+
top: 0,
|
|
17
|
+
borderRadius: 100,
|
|
18
|
+
},
|
|
19
|
+
progressInner: {
|
|
20
|
+
height: "100%",
|
|
21
|
+
borderRadius: 100,
|
|
22
|
+
},
|
|
23
|
+
step: {
|
|
24
|
+
flex: 1,
|
|
25
|
+
marginRight: tokens["space-small"],
|
|
26
|
+
height: "100%",
|
|
27
|
+
borderRadius: 100,
|
|
28
|
+
borderColor: "rgba(255,255,255,0.3)",
|
|
29
|
+
},
|
|
30
|
+
completedStep: {
|
|
31
|
+
backgroundColor: tokens["color-interactive"],
|
|
32
|
+
},
|
|
33
|
+
inProgressStep: {
|
|
34
|
+
backgroundColor: tokens["color-informative"],
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface ProgressBarInnerProps {
|
|
4
|
+
readonly width: number;
|
|
5
|
+
readonly animationDuration?: number;
|
|
6
|
+
readonly color?: string | undefined;
|
|
7
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
8
|
+
readonly testID?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ProgressBarInner({ width, color, style, testID, }: ProgressBarInnerProps): React.JSX.Element;
|
|
11
|
+
export declare function calculateWidth(total: number, current: number): number;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./ProgressBar.style.js";
|
|
5
|
+
export function ProgressBarInner({ width, color, style, testID, }) {
|
|
6
|
+
const styles = useStyles();
|
|
7
|
+
return (_jsx(View, { testID: testID, style: [
|
|
8
|
+
styles.progressBarInner,
|
|
9
|
+
{
|
|
10
|
+
width: `${width}%`,
|
|
11
|
+
...(color && { backgroundColor: color }),
|
|
12
|
+
},
|
|
13
|
+
style,
|
|
14
|
+
] }));
|
|
15
|
+
}
|
|
16
|
+
export function calculateWidth(total, current) {
|
|
17
|
+
if (total <= 0)
|
|
18
|
+
return 0;
|
|
19
|
+
if (current >= total)
|
|
20
|
+
return 100;
|
|
21
|
+
const curr = Math.max(0, current);
|
|
22
|
+
if (curr >= total)
|
|
23
|
+
return 100;
|
|
24
|
+
return (curr / total) * 100;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ProgressBarUnsafeStyle } from "./types.js";
|
|
3
|
+
interface ProgressBarSteppedProps {
|
|
4
|
+
readonly total: number;
|
|
5
|
+
readonly current: number;
|
|
6
|
+
readonly color?: string | undefined;
|
|
7
|
+
readonly loading?: boolean | undefined;
|
|
8
|
+
readonly inProgress?: number;
|
|
9
|
+
readonly UNSAFE_style?: ProgressBarUnsafeStyle | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function ProgressBarStepped({ total, current, color, loading, inProgress, UNSAFE_style, }: ProgressBarSteppedProps): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./ProgressBar.style.js";
|
|
5
|
+
export function ProgressBarStepped({ total, current, color, loading, inProgress, UNSAFE_style, }) {
|
|
6
|
+
const styles = useStyles();
|
|
7
|
+
return (_jsx(View, { testID: "progressbar-container", style: [
|
|
8
|
+
styles.progressBarContainer,
|
|
9
|
+
{ height: 10 },
|
|
10
|
+
UNSAFE_style?.progressBarContainer,
|
|
11
|
+
], children: Array.from({ length: total }).map((_, index) => {
|
|
12
|
+
const step = index + 1;
|
|
13
|
+
const isCompleted = step <= current;
|
|
14
|
+
const lastStep = step === total;
|
|
15
|
+
const inProgressSteps = current + (inProgress || 0);
|
|
16
|
+
return (_jsx(View, { style: [
|
|
17
|
+
styles.step,
|
|
18
|
+
{ ...(color && { backgroundColor: color }) },
|
|
19
|
+
!loading && isCompleted && styles.completedStep,
|
|
20
|
+
!loading &&
|
|
21
|
+
!isCompleted &&
|
|
22
|
+
step <= inProgressSteps &&
|
|
23
|
+
styles.inProgressStep,
|
|
24
|
+
lastStep && { marginRight: 0 },
|
|
25
|
+
UNSAFE_style?.step,
|
|
26
|
+
], testID: isCompleted
|
|
27
|
+
? "progress-step-completed"
|
|
28
|
+
: step <= inProgressSteps
|
|
29
|
+
? "progress-step-in-progress"
|
|
30
|
+
: "progress-step-incomplete" }, step));
|
|
31
|
+
}) }));
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressBar } from "./ProgressBar.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `ProgressIndicator` instead.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProgressBarProps {
|
|
7
|
+
/**
|
|
8
|
+
* The total number of items to be completed
|
|
9
|
+
*/
|
|
10
|
+
readonly total: number;
|
|
11
|
+
/**
|
|
12
|
+
* The number of items that are currently completed
|
|
13
|
+
*/
|
|
14
|
+
readonly current: number;
|
|
15
|
+
/**
|
|
16
|
+
* The number of items in progress (not completed, but to be less than the total);
|
|
17
|
+
* not applicable with stepped variation
|
|
18
|
+
*/
|
|
19
|
+
readonly inProgress?: number;
|
|
20
|
+
/**
|
|
21
|
+
* If the progress bar is loading, the progress indicators aren't rendered on the screen
|
|
22
|
+
*/
|
|
23
|
+
readonly loading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If the amountFormatted and totalAmountFormatted text needs to appear more visibile because of the
|
|
26
|
+
* background, for example
|
|
27
|
+
*/
|
|
28
|
+
readonly reverseTheme?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Component to render above the progress bar.
|
|
31
|
+
*/
|
|
32
|
+
readonly header?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Set the variation of the progress bar
|
|
35
|
+
* @default progress
|
|
36
|
+
*/
|
|
37
|
+
readonly variation?: "progress" | "stepped";
|
|
38
|
+
/**
|
|
39
|
+
* Set the size of the progress bar
|
|
40
|
+
* @default base
|
|
41
|
+
*/
|
|
42
|
+
readonly size?: "smaller" | "small" | "base";
|
|
43
|
+
/** **Use at your own risk:** Custom style for specific elements. This should only be used as a
|
|
44
|
+
* **last resort**. Using this may result in unexpected side effects.
|
|
45
|
+
*/
|
|
46
|
+
readonly UNSAFE_style?: ProgressBarUnsafeStyle;
|
|
47
|
+
}
|
|
48
|
+
export interface ProgressBarUnsafeStyle {
|
|
49
|
+
/** Styles applied to the outer accessible wrapper (role="progressbar"). */
|
|
50
|
+
container?: StyleProp<ViewStyle>;
|
|
51
|
+
/** Styles applied to the inner bar container (track container) – controls bar height/rounding. */
|
|
52
|
+
progressBarContainer?: StyleProp<ViewStyle>;
|
|
53
|
+
/** Styles applied to each step block in the stepped variation. */
|
|
54
|
+
step?: StyleProp<ViewStyle>;
|
|
55
|
+
/** Track/background bar in 'progress' variation (full-width inner) */
|
|
56
|
+
track?: StyleProp<ViewStyle>;
|
|
57
|
+
/** Filled/completed portion in 'progress' variation */
|
|
58
|
+
fill?: StyleProp<ViewStyle>;
|
|
59
|
+
/** In-progress overlay portion in 'progress' variation */
|
|
60
|
+
inProgressFill?: StyleProp<ViewStyle>;
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
5
|
+
import { useStyles } from "./ProgressIndicator.style.js";
|
|
6
|
+
import { sizeHeights, sizeStyles } from "./ProgressIndicator.size.style.js";
|
|
7
|
+
import { useComponentMessages } from "../foundationMessages.js";
|
|
8
|
+
import { platformTokens as tokens } from "../../foundationTokens.js";
|
|
9
|
+
export function ProgressIndicator({ value, max = 100, pendingValue = 0, variation = "continuous", size = "base", accessibilityLabel, style, }) {
|
|
10
|
+
const styles = useStyles();
|
|
11
|
+
const { t } = useComponentMessages();
|
|
12
|
+
const label = accessibilityLabel ?? getA11yLabel();
|
|
13
|
+
const radius = sizeHeights[size] / 2;
|
|
14
|
+
return (_jsx(View, { accessible: true, accessibilityRole: "progressbar", accessibilityLabel: label, accessibilityValue: { min: 0, max, now: value, text: label }, style: [
|
|
15
|
+
variation === "stepped" ? styles.stepped : styles.continuous,
|
|
16
|
+
sizeStyles[size],
|
|
17
|
+
// Round the continuous track so its trailing (unfilled) end is pill-
|
|
18
|
+
// shaped like the leading end; `overflow: "hidden"` clips the fill to
|
|
19
|
+
// match. The stepped variation rounds its individual segments instead.
|
|
20
|
+
variation === "continuous" && { borderRadius: radius },
|
|
21
|
+
style,
|
|
22
|
+
], children: variation === "stepped" ? (_jsx(ProgressIndicatorStepped, { value: value, max: max, pendingValue: pendingValue, size: size })) : (_jsx(ProgressIndicatorContinuous, { value: value, max: max, pendingValue: pendingValue, size: size })) }));
|
|
23
|
+
function getA11yLabel() {
|
|
24
|
+
if (pendingValue > 0) {
|
|
25
|
+
return t("ProgressIndicator.ariaLabelPending", {
|
|
26
|
+
value: String(value),
|
|
27
|
+
max: String(max),
|
|
28
|
+
pendingValue: String(pendingValue),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (max === 100) {
|
|
32
|
+
return t("ProgressIndicator.ariaLabelPercent", { value: String(value) });
|
|
33
|
+
}
|
|
34
|
+
return t("ProgressIndicator.ariaLabelRatio", {
|
|
35
|
+
value: String(value),
|
|
36
|
+
max: String(max),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Clamp a raw progress amount to a percentage of `max` in the range 0..100.
|
|
42
|
+
*/
|
|
43
|
+
function toPercent(amount, max) {
|
|
44
|
+
if (max <= 0)
|
|
45
|
+
return 0;
|
|
46
|
+
return Math.min(100, Math.max(0, (amount / max) * 100));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* File-private renderer for `variation="continuous"`. Renders the fill and,
|
|
50
|
+
* when `pendingValue > 0`, a pending band. The outer `ProgressIndicator` shell
|
|
51
|
+
* owns the accessibility contract; this renderer emits presentational children
|
|
52
|
+
* only.
|
|
53
|
+
*/
|
|
54
|
+
function ProgressIndicatorContinuous({ value, max, pendingValue, size, }) {
|
|
55
|
+
const styles = useStyles();
|
|
56
|
+
const radius = sizeHeights[size] / 2;
|
|
57
|
+
const fillPercent = toPercent(value, max);
|
|
58
|
+
const pendingPercent = toPercent(value + pendingValue, max);
|
|
59
|
+
// The width transition is intentionally preserved regardless of the user's
|
|
60
|
+
// reduce-motion preference: the slide between progress values conveys
|
|
61
|
+
// functional progress and is exempt under WCAG 2.3.3 ("Animation from
|
|
62
|
+
// Interactions"). See design.md.
|
|
63
|
+
const fill = useSharedValue(fillPercent);
|
|
64
|
+
const pending = useSharedValue(pendingPercent);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
fill.value = withTiming(fillPercent, {
|
|
67
|
+
duration: tokens["timing-base"],
|
|
68
|
+
easing: Easing.out(Easing.ease),
|
|
69
|
+
});
|
|
70
|
+
}, [fillPercent]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
pending.value = withTiming(pendingPercent, {
|
|
73
|
+
duration: tokens["timing-base"],
|
|
74
|
+
easing: Easing.out(Easing.ease),
|
|
75
|
+
});
|
|
76
|
+
}, [pendingPercent]);
|
|
77
|
+
const fillStyle = useAnimatedStyle(() => ({ width: `${fill.value}%` }));
|
|
78
|
+
const pendingStyle = useAnimatedStyle(() => ({ width: `${pending.value}%` }));
|
|
79
|
+
return (_jsxs(_Fragment, { children: [pendingValue > 0 && (_jsx(Animated.View, { testID: "progressindicator-pending", style: [styles.pending, { borderRadius: radius }, pendingStyle] })), _jsx(Animated.View, { testID: "progressindicator-fill", style: [styles.fill, { borderRadius: radius }, fillStyle] })] }));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* File-private renderer for `variation="stepped"`. Renders `max` presentational
|
|
83
|
+
* segments, each classified filled / pending / empty. No accessibility props on
|
|
84
|
+
* the segments — the outer shell announces once.
|
|
85
|
+
*/
|
|
86
|
+
function ProgressIndicatorStepped({ value, max, pendingValue, size, }) {
|
|
87
|
+
const styles = useStyles();
|
|
88
|
+
const radius = sizeHeights[size] / 2;
|
|
89
|
+
const segmentCount = Math.max(0, Math.floor(max));
|
|
90
|
+
return (_jsx(_Fragment, { children: Array.from({ length: segmentCount }).map((_, index) => {
|
|
91
|
+
const step = index + 1;
|
|
92
|
+
const isFilled = step <= value;
|
|
93
|
+
const isPending = !isFilled && step <= value + pendingValue;
|
|
94
|
+
return (_jsx(View, { testID: isFilled
|
|
95
|
+
? "progressindicator-step-filled"
|
|
96
|
+
: isPending
|
|
97
|
+
? "progressindicator-step-pending"
|
|
98
|
+
: "progressindicator-step-empty", style: [
|
|
99
|
+
styles.segment,
|
|
100
|
+
{ borderRadius: radius },
|
|
101
|
+
isFilled && styles.segmentFilled,
|
|
102
|
+
isPending && styles.segmentPending,
|
|
103
|
+
] }, step));
|
|
104
|
+
}) }));
|
|
105
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProgressIndicatorProps } from "./types.js";
|
|
2
|
+
type Size = NonNullable<ProgressIndicatorProps["size"]>;
|
|
3
|
+
/**
|
|
4
|
+
* Bar heights per size. Matches the web `ProgressIndicator` ladder and today's
|
|
5
|
+
* mobile `ProgressBar` sizing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const sizeHeights: Record<Size, number>;
|
|
8
|
+
export declare const sizeStyles: {
|
|
9
|
+
smaller: {
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
small: {
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
base: {
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* Bar heights per size. Matches the web `ProgressIndicator` ladder and today's
|
|
4
|
+
* mobile `ProgressBar` sizing.
|
|
5
|
+
*/
|
|
6
|
+
export const sizeHeights = {
|
|
7
|
+
smaller: 4,
|
|
8
|
+
small: 8,
|
|
9
|
+
base: 16,
|
|
10
|
+
};
|
|
11
|
+
export const sizeStyles = StyleSheet.create({
|
|
12
|
+
smaller: { height: sizeHeights.smaller },
|
|
13
|
+
small: { height: sizeHeights.small },
|
|
14
|
+
base: { height: sizeHeights.base },
|
|
15
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProgressIndicator
|
|
3
|
+
*
|
|
4
|
+
* Colour tokens mirror the web `ProgressIndicator`: the fill / filled segments
|
|
5
|
+
* use `color-interactive--subtle`; the track / empty segments use
|
|
6
|
+
* `color-surface--active`. The mobile-only pending band / pending segments use
|
|
7
|
+
* `color-informative`, carried forward from today's `ProgressBar` `inProgress`
|
|
8
|
+
* overlay.
|
|
9
|
+
*
|
|
10
|
+
* The bar height is set by the size style; the border radius is derived from
|
|
11
|
+
* that height at render time so the fill and segments stay pill-shaped at every
|
|
12
|
+
* size.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useStyles: () => {
|
|
15
|
+
continuous: {
|
|
16
|
+
width: "100%";
|
|
17
|
+
flexDirection: "row";
|
|
18
|
+
overflow: "hidden";
|
|
19
|
+
backgroundColor: string;
|
|
20
|
+
};
|
|
21
|
+
fill: {
|
|
22
|
+
height: "100%";
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
};
|
|
25
|
+
pending: {
|
|
26
|
+
height: "100%";
|
|
27
|
+
position: "absolute";
|
|
28
|
+
left: number;
|
|
29
|
+
top: number;
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
};
|
|
32
|
+
stepped: {
|
|
33
|
+
width: "100%";
|
|
34
|
+
flexDirection: "row";
|
|
35
|
+
gap: number;
|
|
36
|
+
};
|
|
37
|
+
segment: {
|
|
38
|
+
flex: number;
|
|
39
|
+
height: "100%";
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
};
|
|
42
|
+
segmentFilled: {
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
};
|
|
45
|
+
segmentPending: {
|
|
46
|
+
backgroundColor: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
/**
|
|
3
|
+
* ProgressIndicator
|
|
4
|
+
*
|
|
5
|
+
* Colour tokens mirror the web `ProgressIndicator`: the fill / filled segments
|
|
6
|
+
* use `color-interactive--subtle`; the track / empty segments use
|
|
7
|
+
* `color-surface--active`. The mobile-only pending band / pending segments use
|
|
8
|
+
* `color-informative`, carried forward from today's `ProgressBar` `inProgress`
|
|
9
|
+
* overlay.
|
|
10
|
+
*
|
|
11
|
+
* The bar height is set by the size style; the border radius is derived from
|
|
12
|
+
* that height at render time so the fill and segments stay pill-shaped at every
|
|
13
|
+
* size.
|
|
14
|
+
*/
|
|
15
|
+
export const useStyles = buildThemedStyles(tokens => ({
|
|
16
|
+
/* Continuous: the root IS the track; the fill / pending sit on top. */
|
|
17
|
+
continuous: {
|
|
18
|
+
width: "100%",
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
backgroundColor: tokens["color-surface--active"],
|
|
22
|
+
},
|
|
23
|
+
fill: {
|
|
24
|
+
height: "100%",
|
|
25
|
+
backgroundColor: tokens["color-interactive--subtle"],
|
|
26
|
+
},
|
|
27
|
+
pending: {
|
|
28
|
+
height: "100%",
|
|
29
|
+
position: "absolute",
|
|
30
|
+
left: 0,
|
|
31
|
+
top: 0,
|
|
32
|
+
backgroundColor: tokens["color-informative"],
|
|
33
|
+
},
|
|
34
|
+
/* Stepped: the root IS the flex row; segments are direct children. */
|
|
35
|
+
stepped: {
|
|
36
|
+
width: "100%",
|
|
37
|
+
flexDirection: "row",
|
|
38
|
+
gap: tokens["space-small"],
|
|
39
|
+
},
|
|
40
|
+
segment: {
|
|
41
|
+
flex: 1,
|
|
42
|
+
height: "100%",
|
|
43
|
+
backgroundColor: tokens["color-surface--active"],
|
|
44
|
+
},
|
|
45
|
+
segmentFilled: {
|
|
46
|
+
backgroundColor: tokens["color-interactive--subtle"],
|
|
47
|
+
},
|
|
48
|
+
segmentPending: {
|
|
49
|
+
backgroundColor: tokens["color-informative"],
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressIndicator } from "./ProgressIndicator.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
export interface ProgressIndicatorProps {
|
|
3
|
+
/**
|
|
4
|
+
* Current progress. Expected to be in the range `0..max` inclusive.
|
|
5
|
+
*/
|
|
6
|
+
readonly value: number;
|
|
7
|
+
/**
|
|
8
|
+
* Maximum value.
|
|
9
|
+
* @default 100
|
|
10
|
+
*/
|
|
11
|
+
readonly max?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Additional in-flight progress beyond `value`, measured on the same scale as
|
|
14
|
+
* `value` and `max`. The bar visually fills `value + pendingValue` of `max`,
|
|
15
|
+
* with the `value` portion shown as completed and the `pendingValue` portion
|
|
16
|
+
* shown as pending. Mobile-only; there is no web counterpart.
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
readonly pendingValue?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Set the variation of the progress indicator. `continuous` renders a single
|
|
22
|
+
* fill; `stepped` renders one segment per integer step from `1..max`.
|
|
23
|
+
* @default continuous
|
|
24
|
+
*/
|
|
25
|
+
readonly variation?: "continuous" | "stepped";
|
|
26
|
+
/**
|
|
27
|
+
* Set the size of the progress indicator. Corresponds to bar heights of
|
|
28
|
+
* 4px / 8px / 16px.
|
|
29
|
+
* @default base
|
|
30
|
+
*/
|
|
31
|
+
readonly size?: "smaller" | "small" | "base";
|
|
32
|
+
/**
|
|
33
|
+
* Accessible label override. When omitted, the label is derived via
|
|
34
|
+
* `useComponentMessages`: `"{value}%"` when `max` is `100` (or omitted) and
|
|
35
|
+
* `pendingValue` is `0`; `"{value} / {max}"` when `max` is not `100` and
|
|
36
|
+
* `pendingValue` is `0`; `"{value} of {max}, {pendingValue} pending"` when
|
|
37
|
+
* `pendingValue` is greater than `0`.
|
|
38
|
+
*/
|
|
39
|
+
readonly accessibilityLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom style applied to the root element.
|
|
42
|
+
*/
|
|
43
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|