@zj-dynamics/components-native 0.0.0-stage → 0.1.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 +16 -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,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Pressable, Text as RNText, View } from "react-native";
|
|
4
|
+
import { Icon } from "../../../../Icon.js";
|
|
5
|
+
import { Text } from "../../../Text/index.js";
|
|
6
|
+
import { useTypographyStyles } from "../../../Typography/index.js";
|
|
7
|
+
import { useLegacyTheme } from "../../../compatTheme.js";
|
|
8
|
+
import { useStyles } from "../../InputFieldWrapper.style.js";
|
|
9
|
+
export const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
|
|
10
|
+
export const suffixIconTestId = "ATL-InputFieldWrapper-SuffixIcon";
|
|
11
|
+
export function SuffixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, hasLeftMargin = true, styleOverride, }) {
|
|
12
|
+
const styles = useStyles();
|
|
13
|
+
const typographyStyles = useTypographyStyles();
|
|
14
|
+
return (_jsx(View, { testID: suffixLabelTestId, style: [
|
|
15
|
+
styles.fieldAffix,
|
|
16
|
+
focused && styles.inputFocused,
|
|
17
|
+
inputInvalid && styles.inputInvalid,
|
|
18
|
+
hasLeftMargin && styles.suffixLabelMargin,
|
|
19
|
+
], children: _jsx(View, { style: [
|
|
20
|
+
styles.suffixLabel,
|
|
21
|
+
miniLabelActive && styles.fieldAffixMiniLabel,
|
|
22
|
+
], children: !styleOverride ? (_jsx(Text, { variation: disabled ? "disabled" : "base", children: label })) : (_jsx(RNText, { allowFontScaling: true, style: [
|
|
23
|
+
typographyStyles.baseRegularRegular,
|
|
24
|
+
typographyStyles.base,
|
|
25
|
+
typographyStyles.defaultSize,
|
|
26
|
+
disabled ? typographyStyles.subdued : typographyStyles.base,
|
|
27
|
+
styleOverride,
|
|
28
|
+
], children: label })) }) }));
|
|
29
|
+
}
|
|
30
|
+
export function SuffixIcon({ focused, disabled, inputInvalid, icon, hasLeftMargin = false, onPress, accessibilityLabel, }) {
|
|
31
|
+
const styles = useStyles();
|
|
32
|
+
const { tokens } = useLegacyTheme();
|
|
33
|
+
return (_jsx(View, { testID: suffixIconTestId, style: [
|
|
34
|
+
styles.fieldAffix,
|
|
35
|
+
focused && styles.inputFocused,
|
|
36
|
+
inputInvalid && styles.inputInvalid,
|
|
37
|
+
], children: _jsx(Pressable, { style: [styles.suffixIcon, hasLeftMargin && styles.suffixIconMargin], onPress: onPress, accessibilityLabel: accessibilityLabel, accessibilityRole: onPress ? "button" : undefined, accessibilityState: { disabled }, disabled: disabled, children: _jsx(Icon, { customColor: disabled
|
|
38
|
+
? tokens["color-disabled"]
|
|
39
|
+
: tokens["color-icon--secondary"], name: icon }) }) }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getCommonInputStyles, useCommonInputStyles, commonInputStyles, } from "./CommonInputStyles.style.js";
|
|
2
|
+
export { InputFieldWrapper } from "./InputFieldWrapper.js";
|
|
3
|
+
export type { InputFieldWrapperProps } from "./InputFieldWrapper.js";
|
|
4
|
+
export { ClearAction } from "./components/ClearAction/ClearAction.js";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { IconNames } from "@zj-dynamics/design/native";
|
|
4
|
+
import type { FieldError } from "react-hook-form";
|
|
5
|
+
import { Text as NativeText } from "react-native";
|
|
6
|
+
import type { Clearable } from "@zj-dynamics/hooks/useShowClear";
|
|
7
|
+
import type { XOR } from "ts-xor";
|
|
8
|
+
interface BasicSuffix {
|
|
9
|
+
icon?: IconNames;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
interface InteractiveSuffix {
|
|
13
|
+
icon: IconNames;
|
|
14
|
+
label?: string;
|
|
15
|
+
onPress: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface InputPressableProps {
|
|
18
|
+
/**
|
|
19
|
+
* Current value of the component
|
|
20
|
+
*/
|
|
21
|
+
readonly value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Placeholder item shown until a selection is made
|
|
24
|
+
*/
|
|
25
|
+
readonly placeholder?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Disables input selection
|
|
28
|
+
*/
|
|
29
|
+
readonly disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates if the input is focused
|
|
32
|
+
*/
|
|
33
|
+
readonly focused?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Indicates if there is an validation error
|
|
36
|
+
*/
|
|
37
|
+
readonly error?: FieldError;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates the current selection is invalid
|
|
40
|
+
*/
|
|
41
|
+
readonly invalid?: boolean | string;
|
|
42
|
+
/**
|
|
43
|
+
* Controls the visibility of the mini label that appears inside the input
|
|
44
|
+
* when a value is entered. By default, the placeholder text moves up to
|
|
45
|
+
* become a mini label. Set to false to disable this behavior.
|
|
46
|
+
*
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
readonly showMiniLabel?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Callback that is called when the text input is focused
|
|
52
|
+
* @param event
|
|
53
|
+
*/
|
|
54
|
+
readonly onPress?: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* VoiceOver will read this string when a user selects the element
|
|
57
|
+
*/
|
|
58
|
+
readonly accessibilityLabel?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Helps users understand what will happen when they perform an action
|
|
61
|
+
*/
|
|
62
|
+
readonly accessibilityHint?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Symbol to display before the text input
|
|
65
|
+
*/
|
|
66
|
+
readonly prefix?: {
|
|
67
|
+
icon?: IconNames;
|
|
68
|
+
label?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Symbol to display after the text input
|
|
72
|
+
*/
|
|
73
|
+
readonly suffix?: XOR<BasicSuffix, InteractiveSuffix>;
|
|
74
|
+
/**
|
|
75
|
+
* Add a clear action on the input that clears the value.
|
|
76
|
+
*
|
|
77
|
+
* Since the input value isn't editable (i.e. `InputDateTime`) you can
|
|
78
|
+
* set it to `always`. If you set it to `always` you must also provide an
|
|
79
|
+
* onClear to clear the input's value
|
|
80
|
+
*/
|
|
81
|
+
readonly clearable?: Clearable;
|
|
82
|
+
/**
|
|
83
|
+
* Callback called when the user clicks the ClearAction button. Should clear
|
|
84
|
+
* the value passed. To disallow clearing set the clearable prop to never
|
|
85
|
+
*/
|
|
86
|
+
readonly onClear?: () => void;
|
|
87
|
+
}
|
|
88
|
+
export type InputPressableRef = NativeText;
|
|
89
|
+
export declare const InputPressable: React.ForwardRefExoticComponent<InputPressableProps & React.RefAttributes<NativeText>>;
|
|
90
|
+
export declare function InputPressableInternal({ value, placeholder, disabled, invalid, error, showMiniLabel, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable, onClear, focused, }: InputPressableProps, ref: Ref<InputPressableRef>): React.JSX.Element;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { Text as NativeText, Pressable } from "react-native";
|
|
4
|
+
import { useShowClear } from "@zj-dynamics/hooks/useShowClear";
|
|
5
|
+
import { useStyles } from "./InputPressable.style.js";
|
|
6
|
+
import { InputFieldWrapper, useCommonInputStyles } from "../InputFieldWrapper/index.js";
|
|
7
|
+
export const InputPressable = forwardRef(InputPressableInternal);
|
|
8
|
+
export function InputPressableInternal({ value, placeholder, disabled = false, invalid, error, showMiniLabel = true, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable = "never", onClear, focused = false, }, ref) {
|
|
9
|
+
const hasValue = !!value;
|
|
10
|
+
const placeholderMode = getPlaceholderMode(showMiniLabel, value);
|
|
11
|
+
const showClear = useShowClear({
|
|
12
|
+
clearable,
|
|
13
|
+
multiline: false,
|
|
14
|
+
focused: false,
|
|
15
|
+
hasValue,
|
|
16
|
+
disabled,
|
|
17
|
+
});
|
|
18
|
+
const styles = useStyles();
|
|
19
|
+
const commonInputStyles = useCommonInputStyles();
|
|
20
|
+
return (_jsx(InputFieldWrapper, { ...(prefix !== undefined && { prefix: prefix }), ...(suffix !== undefined && { suffix: suffix }), hasValue: hasValue, placeholderMode: placeholderMode, focused: focused, error: error, invalid: invalid, ...(placeholder !== undefined && { placeholder: placeholder }), disabled: disabled, showClearAction: Boolean(showClear), ...(onClear !== undefined && { onClear: onClear }), children: _jsx(Pressable, { style: styles.pressable, onPress: onPress, disabled: disabled, accessibilityRole: "button", accessibilityState: { disabled }, accessibilityLabel: accessibilityLabel || placeholder, accessibilityHint: accessibilityHint, accessibilityValue: { text: value }, children: _jsx(NativeText, { style: [
|
|
21
|
+
commonInputStyles.input,
|
|
22
|
+
styles.inputPressableStyles,
|
|
23
|
+
placeholderMode === "normal" && commonInputStyles.inputEmpty,
|
|
24
|
+
placeholderMode === "hidden" && styles.withoutMiniLabel,
|
|
25
|
+
disabled && commonInputStyles.inputDisabled,
|
|
26
|
+
(Boolean(invalid) || error) && styles.inputInvalid,
|
|
27
|
+
], testID: "inputPressableText", ref: ref, accessibilityRole: "none", accessible: false, importantForAccessibility: "no-hide-descendants", children: value }) }) }));
|
|
28
|
+
}
|
|
29
|
+
function getPlaceholderMode(isMiniLabelAllowed, internalValue) {
|
|
30
|
+
const hasValue = Boolean(internalValue);
|
|
31
|
+
if (hasValue) {
|
|
32
|
+
if (isMiniLabelAllowed) {
|
|
33
|
+
return "mini";
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return "hidden";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return "normal";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
pressable: {
|
|
3
|
+
flex: number;
|
|
4
|
+
};
|
|
5
|
+
inputPressableStyles: {
|
|
6
|
+
paddingTop: number;
|
|
7
|
+
lineHeight: number | undefined;
|
|
8
|
+
};
|
|
9
|
+
inputEmpty: {
|
|
10
|
+
paddingTop: number;
|
|
11
|
+
};
|
|
12
|
+
inputDisabled: {
|
|
13
|
+
color: import("react-native").ColorValue | undefined;
|
|
14
|
+
};
|
|
15
|
+
inputInvalid: {
|
|
16
|
+
borderColor: string;
|
|
17
|
+
};
|
|
18
|
+
withoutMiniLabel: {
|
|
19
|
+
paddingTop: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
import { getTypographyStyles } from "../Typography/index.js";
|
|
3
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
4
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
5
|
+
return {
|
|
6
|
+
pressable: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
},
|
|
9
|
+
inputPressableStyles: {
|
|
10
|
+
paddingTop: (typographyStyles.defaultSize?.fontSize || 0) +
|
|
11
|
+
tokens["space-small"] +
|
|
12
|
+
tokens["space-smaller"],
|
|
13
|
+
lineHeight: typographyStyles.defaultSize?.lineHeight,
|
|
14
|
+
},
|
|
15
|
+
inputEmpty: {
|
|
16
|
+
paddingTop: 0,
|
|
17
|
+
},
|
|
18
|
+
inputDisabled: {
|
|
19
|
+
color: typographyStyles.disabled?.color,
|
|
20
|
+
},
|
|
21
|
+
inputInvalid: {
|
|
22
|
+
borderColor: tokens["color-critical"],
|
|
23
|
+
},
|
|
24
|
+
withoutMiniLabel: {
|
|
25
|
+
paddingTop: tokens["space-base"] + tokens["space-smallest"],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputPressable } from "./InputPressable.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Keyboard } from "react-native";
|
|
4
|
+
import { IconButton } from "../../IconButton/index.js";
|
|
5
|
+
export function FilterButton({ accessibilityLabel, onClick, }) {
|
|
6
|
+
return (_jsx(IconButton, { onPress: () => {
|
|
7
|
+
onClick();
|
|
8
|
+
Keyboard.dismiss();
|
|
9
|
+
}, name: "filter", accessibilityLabel: accessibilityLabel }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const inputAccessoriesContextDefaultValues = {
|
|
3
|
+
elements: {},
|
|
4
|
+
focusedInput: "",
|
|
5
|
+
canFocusNext: false,
|
|
6
|
+
canFocusPrevious: false,
|
|
7
|
+
register: () => undefined,
|
|
8
|
+
unregister: () => undefined,
|
|
9
|
+
onFocusNext: () => undefined,
|
|
10
|
+
onFocusPrevious: () => undefined,
|
|
11
|
+
setFocusedInput: () => undefined,
|
|
12
|
+
};
|
|
13
|
+
export const InputAccessoriesContext = createContext(inputAccessoriesContextDefaultValues);
|
|
14
|
+
export function useInputAccessoriesContext() {
|
|
15
|
+
return useContext(InputAccessoriesContext);
|
|
16
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useId, useState } from "react";
|
|
3
|
+
import { InputAccessoryView, Keyboard, Platform, Button as RNButton, View, useColorScheme, } from "react-native";
|
|
4
|
+
import { InputAccessoriesContext } from "./InputAccessoriesContext.js";
|
|
5
|
+
import { useStyles } from "./InputAccessoriesProvider.style.js";
|
|
6
|
+
export function InputAccessoriesProvider({ children, }) {
|
|
7
|
+
const inputAccessoryID = "rulnar-input-" + useId();
|
|
8
|
+
const { focusedInput, setFocusedInput, canFocusNext, canFocusPrevious, elements, setElements, previousKey, nextKey, } = useInputAccessoriesProviderState();
|
|
9
|
+
const colorScheme = useColorScheme();
|
|
10
|
+
const styles = useStyles();
|
|
11
|
+
return (_jsxs(InputAccessoriesContext.Provider, { value: {
|
|
12
|
+
elements,
|
|
13
|
+
focusedInput,
|
|
14
|
+
canFocusNext,
|
|
15
|
+
canFocusPrevious,
|
|
16
|
+
inputAccessoryID,
|
|
17
|
+
register,
|
|
18
|
+
unregister,
|
|
19
|
+
onFocusNext,
|
|
20
|
+
onFocusPrevious,
|
|
21
|
+
setFocusedInput,
|
|
22
|
+
}, children: [children, Platform.OS === "ios" && (_jsx(InputAccessoryView, { nativeID: inputAccessoryID, children: _jsx(View, { testID: "ATL-InputAccessory", style: [
|
|
23
|
+
styles.container,
|
|
24
|
+
colorScheme === "dark" ? styles.darkTheme : styles.lightTheme,
|
|
25
|
+
], children: _jsx(RNButton, { onPress: Keyboard.dismiss, title: "Done", testID: "ATL-InputAccessory-Done", color: colorScheme === "dark" ? "white" : undefined }) }) }))] }));
|
|
26
|
+
function register(name, onFocus) {
|
|
27
|
+
elements[name] = onFocus;
|
|
28
|
+
setElements(elements);
|
|
29
|
+
}
|
|
30
|
+
function unregister(name) {
|
|
31
|
+
delete elements[name];
|
|
32
|
+
setElements(elements);
|
|
33
|
+
}
|
|
34
|
+
function onFocusNext() {
|
|
35
|
+
if (nextKey !== undefined)
|
|
36
|
+
elements[nextKey]?.();
|
|
37
|
+
}
|
|
38
|
+
function onFocusPrevious() {
|
|
39
|
+
if (previousKey !== undefined)
|
|
40
|
+
elements[previousKey]?.();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function useInputAccessoriesProviderState() {
|
|
44
|
+
const [focusedInput, setFocusedInput] = useState("");
|
|
45
|
+
const [canFocusNext, setCanFocusNext] = useState(false);
|
|
46
|
+
const [canFocusPrevious, setCanFocusPrevious] = useState(false);
|
|
47
|
+
const [elements, setElements] = useState({});
|
|
48
|
+
const keys = Object.keys(elements);
|
|
49
|
+
const selectedIndex = keys.findIndex(key => key === focusedInput);
|
|
50
|
+
const nextKey = keys[selectedIndex + 1];
|
|
51
|
+
const previousKey = keys[selectedIndex - 1];
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setCanFocusNext(Boolean(nextKey));
|
|
54
|
+
setCanFocusPrevious(Boolean(previousKey));
|
|
55
|
+
}, [previousKey, nextKey]);
|
|
56
|
+
return {
|
|
57
|
+
previousKey,
|
|
58
|
+
nextKey,
|
|
59
|
+
focusedInput,
|
|
60
|
+
setFocusedInput,
|
|
61
|
+
canFocusNext,
|
|
62
|
+
setCanFocusNext,
|
|
63
|
+
canFocusPrevious,
|
|
64
|
+
setCanFocusPrevious,
|
|
65
|
+
elements,
|
|
66
|
+
setElements,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
container: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
justifyContent: "flex-end";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
paddingHorizontal: number;
|
|
7
|
+
borderTopWidth: number;
|
|
8
|
+
borderTopColor: string;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
lightTheme: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
};
|
|
14
|
+
darkTheme: {
|
|
15
|
+
backgroundColor: import("react-native").OpaqueColorValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PlatformColor } from "react-native";
|
|
2
|
+
import { buildThemedStyles } from "../../compatTheme.js";
|
|
3
|
+
const BAR_HEIGHT = 44;
|
|
4
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
5
|
+
return {
|
|
6
|
+
container: {
|
|
7
|
+
flexDirection: "row",
|
|
8
|
+
justifyContent: "flex-end",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
paddingHorizontal: tokens["space-small"],
|
|
11
|
+
borderTopWidth: tokens["space-minuscule"],
|
|
12
|
+
borderTopColor: tokens["color-border"],
|
|
13
|
+
height: BAR_HEIGHT,
|
|
14
|
+
},
|
|
15
|
+
lightTheme: {
|
|
16
|
+
backgroundColor: tokens["color-surface--background"],
|
|
17
|
+
},
|
|
18
|
+
darkTheme: {
|
|
19
|
+
// PlatformColor has to be conditional for Storybook to run without error
|
|
20
|
+
backgroundColor: PlatformColor?.("systemGray3"),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Name = string;
|
|
2
|
+
export interface InputAccessoriesContextProps {
|
|
3
|
+
/**
|
|
4
|
+
* Registered elements.
|
|
5
|
+
*/
|
|
6
|
+
readonly elements: Record<Name, () => void>;
|
|
7
|
+
readonly focusedInput: string;
|
|
8
|
+
readonly canFocusNext: boolean;
|
|
9
|
+
readonly canFocusPrevious: boolean;
|
|
10
|
+
readonly inputAccessoryID?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Registers the element to the context.
|
|
13
|
+
*/
|
|
14
|
+
readonly register: (name: Name, onFocus: () => void) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Un-registers the element from the context.
|
|
17
|
+
*/
|
|
18
|
+
readonly unregister: (name: Name) => void;
|
|
19
|
+
readonly onFocusNext: () => void;
|
|
20
|
+
readonly onFocusPrevious: () => void;
|
|
21
|
+
readonly setFocusedInput: (name: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { UseControllerProps } from "react-hook-form";
|
|
3
|
+
import type { XOR } from "ts-xor";
|
|
4
|
+
import type { Clearable } from "@zj-dynamics/hooks/useShowClear";
|
|
5
|
+
import type { InputFieldWrapperProps } from "../InputFieldWrapper/index.js";
|
|
6
|
+
import type { InputPressableProps } from "../InputPressable/InputPressable.js";
|
|
7
|
+
interface InputTimeBaseProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
|
|
8
|
+
/**
|
|
9
|
+
* Defaulted to "always" so user can clear the time whenever there's a value.
|
|
10
|
+
*/
|
|
11
|
+
readonly clearable?: Extract<Clearable, "always" | "never">;
|
|
12
|
+
/**
|
|
13
|
+
* Add a custom value to display when no time is selected
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
readonly emptyValueLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Adjusts the UX of the time picker based on where you'd use it.
|
|
19
|
+
*
|
|
20
|
+
* - `"granular"` - allows the user to pick a very specific time
|
|
21
|
+
* - `"scheduling"` - only allows user to select between 5 minutes interval.
|
|
22
|
+
* If your design is catered towards "scheduling", you should use this type.
|
|
23
|
+
*
|
|
24
|
+
* @default scheduling
|
|
25
|
+
*/
|
|
26
|
+
readonly type?: "granular" | "scheduling";
|
|
27
|
+
/**
|
|
28
|
+
* Hide or show the timer icon.
|
|
29
|
+
*/
|
|
30
|
+
readonly showIcon?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface InputTimeFormControlled extends InputTimeBaseProps {
|
|
33
|
+
/**
|
|
34
|
+
* Adding a `name` would make this component "Form controlled" and must be
|
|
35
|
+
* nested within a `<Form />` component.
|
|
36
|
+
*
|
|
37
|
+
* Cannot be declared if `value` prop is used.
|
|
38
|
+
*/
|
|
39
|
+
readonly name: string;
|
|
40
|
+
/**
|
|
41
|
+
* Shows an error message below the field and highlights it red when the
|
|
42
|
+
* value is invalid. Only applies when nested within a `<Form />` component.
|
|
43
|
+
*/
|
|
44
|
+
readonly validations?: UseControllerProps["rules"];
|
|
45
|
+
/**
|
|
46
|
+
* The callback that fires whenever a time gets selected.
|
|
47
|
+
*/
|
|
48
|
+
readonly onChange?: (value?: Date | null) => void;
|
|
49
|
+
}
|
|
50
|
+
interface InputTimeDevControlled extends InputTimeBaseProps {
|
|
51
|
+
/**
|
|
52
|
+
* The value shown on the field. This gets automatically formatted to the
|
|
53
|
+
* account's time format.
|
|
54
|
+
*/
|
|
55
|
+
readonly value: Date | string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* The callback that fires whenever a time gets selected.
|
|
58
|
+
*/
|
|
59
|
+
readonly onChange: (value?: Date) => void;
|
|
60
|
+
}
|
|
61
|
+
export type InputTimeProps = XOR<InputTimeFormControlled, InputTimeDevControlled>;
|
|
62
|
+
export declare function InputTime(props: InputTimeProps): React.JSX.Element;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, useState } from "react";
|
|
3
|
+
import DateTimePicker from "react-native-modal-datetime-picker";
|
|
4
|
+
import { Keyboard, View } from "react-native";
|
|
5
|
+
import { styles } from "./InputTime.style.js";
|
|
6
|
+
import { getTimeZoneOffsetInMinutes, roundUpToNearestMinutes } from "./utils/index.js";
|
|
7
|
+
import { useComponentSettings } from "../ComponentSettingsContext/index.js";
|
|
8
|
+
import { InputPressable } from "../InputPressable/index.js";
|
|
9
|
+
import { FormField } from "../FormField/index.js";
|
|
10
|
+
import { useComponentMessages } from "../foundationMessages.js";
|
|
11
|
+
const LOCALE_24_HOURS = "en_GB";
|
|
12
|
+
const LOCALE_12_HOURS = "en_US";
|
|
13
|
+
function formatInvalidState(error, invalid) {
|
|
14
|
+
if (invalid)
|
|
15
|
+
return invalid;
|
|
16
|
+
if (error && error.message) {
|
|
17
|
+
return error.message;
|
|
18
|
+
}
|
|
19
|
+
return Boolean(error);
|
|
20
|
+
}
|
|
21
|
+
export function InputTime(props) {
|
|
22
|
+
if (props.name) {
|
|
23
|
+
return (_jsx(FormField, { name: props.name, ...(props.validations !== undefined && { validations: props.validations }), children: (field, error) => (_jsx(InternalInputTime, { ...props, value: field.value, onChange: (newValue) => {
|
|
24
|
+
field.onChange(newValue);
|
|
25
|
+
field.onBlur();
|
|
26
|
+
props.onChange?.(newValue);
|
|
27
|
+
}, invalid: formatInvalidState(error, props.invalid) })) }));
|
|
28
|
+
}
|
|
29
|
+
return _jsx(InternalInputTime, { ...props, onChange: next => props.onChange?.(next ?? undefined) });
|
|
30
|
+
}
|
|
31
|
+
function InternalInputTime({ clearable = "always", disabled = false, emptyValueLabel, invalid, placeholder, value, name, type = "scheduling", showMiniLabel = true, onChange, showIcon = true, }) {
|
|
32
|
+
const [showPicker, setShowPicker] = useState(false);
|
|
33
|
+
const { t, formatTime } = useComponentMessages();
|
|
34
|
+
const { timeZone, timeFormat } = useComponentSettings();
|
|
35
|
+
const is24Hour = timeFormat === "HH:mm";
|
|
36
|
+
const dateTime = useMemo(() => {
|
|
37
|
+
const parsed = typeof value === "string" ? new Date(value) : value;
|
|
38
|
+
return parsed && !Number.isNaN(parsed.getTime()) ? parsed : undefined;
|
|
39
|
+
}, [value]);
|
|
40
|
+
const formattedTime = dateTime ? formatTime(dateTime) : emptyValueLabel;
|
|
41
|
+
const canClearTime = dateTime ? clearable : "never";
|
|
42
|
+
return (_jsxs(View, { style: styles.container, children: [_jsx(InputPressable, { showMiniLabel: showMiniLabel, clearable: canClearTime, disabled: disabled, ...(invalid !== undefined && { invalid: invalid }), focused: showPicker, placeholder: placeholder ?? t("time"), ...(showIcon && { prefix: { icon: "timer" } }), ...(formattedTime !== undefined && { value: formattedTime }), onClear: handleClear, onPress: showDatePicker }), _jsx(DateTimePicker, { testID: "inputTime-Picker", minuteInterval: getMinuteInterval(type), date: getInitialPickerDate(dateTime), timeZoneName: timeZone, isVisible: showPicker, mode: "time", confirmTextIOS: t("confirm"), cancelTextIOS: t("cancel"), onCancel: handleCancel, onConfirm: handleConfirm, is24Hour: is24Hour, locale: is24Hour ? LOCALE_24_HOURS : LOCALE_12_HOURS })] }));
|
|
43
|
+
function showDatePicker() {
|
|
44
|
+
Keyboard.dismiss();
|
|
45
|
+
setShowPicker(true);
|
|
46
|
+
}
|
|
47
|
+
function handleConfirm(newValue) {
|
|
48
|
+
setShowPicker(false);
|
|
49
|
+
onChange?.(newValue);
|
|
50
|
+
}
|
|
51
|
+
function handleCancel() {
|
|
52
|
+
setShowPicker(false);
|
|
53
|
+
// Call onChange with the current value to trigger form's validation.
|
|
54
|
+
onChange?.(dateTime);
|
|
55
|
+
}
|
|
56
|
+
function handleClear() {
|
|
57
|
+
// Returns null only for Form controlled scenarios due to a limitation of
|
|
58
|
+
// react-hook-form that doesn't allow passing undefined to form values.
|
|
59
|
+
if (name) {
|
|
60
|
+
onChange?.(null);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
onChange?.(undefined);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function getInitialPickerDate(date) {
|
|
68
|
+
if (date)
|
|
69
|
+
return date;
|
|
70
|
+
return roundUpToNearestMinutes(new Date(), 30);
|
|
71
|
+
}
|
|
72
|
+
function getMinuteInterval(type) {
|
|
73
|
+
if (type === "granular")
|
|
74
|
+
return 1;
|
|
75
|
+
return 5;
|
|
76
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type MinutesIncrement = 15 | 30 | 60;
|
|
2
|
+
/**
|
|
3
|
+
* Rounds up the time by increment.
|
|
4
|
+
* - 15 mins - rounds to the next quarter time of `00:15`, `00:30`, `00:45`,
|
|
5
|
+
* and `01:00`
|
|
6
|
+
* - 30 mins - rounds to the next half hour be it `00:30` or `01:00`
|
|
7
|
+
* - 60 mins - rounds to the next hour. I.e., `02:01` gets rounded up
|
|
8
|
+
* to `03:00`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function roundUpToNearestMinutes(date: Date, minutes: MinutesIncrement): Date;
|
|
11
|
+
export declare function getTimeZoneOffsetInMinutes(timeZone: string, date?: Date): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getTimezoneOffset } from "date-fns-tz";
|
|
2
|
+
/**
|
|
3
|
+
* Rounds up the time by increment.
|
|
4
|
+
* - 15 mins - rounds to the next quarter time of `00:15`, `00:30`, `00:45`,
|
|
5
|
+
* and `01:00`
|
|
6
|
+
* - 30 mins - rounds to the next half hour be it `00:30` or `01:00`
|
|
7
|
+
* - 60 mins - rounds to the next hour. I.e., `02:01` gets rounded up
|
|
8
|
+
* to `03:00`.
|
|
9
|
+
*/
|
|
10
|
+
export function roundUpToNearestMinutes(date, minutes) {
|
|
11
|
+
const ms = 1000 * 60 * minutes;
|
|
12
|
+
return new Date(Math.ceil(date.getTime() / ms) * ms);
|
|
13
|
+
}
|
|
14
|
+
export function getTimeZoneOffsetInMinutes(timeZone, date) {
|
|
15
|
+
return getTimezoneOffset(timeZone, date) / 1000 / 60;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ProgressBarProps } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `ProgressIndicator` instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ProgressBar({ loading, total, current, inProgress, reverseTheme, header, variation, size, UNSAFE_style, }: ProgressBarProps): React.JSX.Element;
|