@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,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useSizeStyles } from "./Glimmer.size.style.js";
|
|
3
|
+
import { useShapeStyles } from "./Glimmer.shape.style.js";
|
|
4
|
+
export type GlimmerShapes = keyof ReturnType<typeof useShapeStyles>;
|
|
5
|
+
export type GlimmerSizes = keyof ReturnType<typeof useSizeStyles>;
|
|
6
|
+
export type GlimmerTimings = "base" | "fast";
|
|
7
|
+
interface GlimmerProps {
|
|
8
|
+
/**
|
|
9
|
+
* Sets the size of the glimmer.
|
|
10
|
+
*/
|
|
11
|
+
readonly shape?: GlimmerShapes;
|
|
12
|
+
/**
|
|
13
|
+
* Sets the shape of the glimmer.
|
|
14
|
+
*
|
|
15
|
+
* If you need a specific width, use the `width` prop.
|
|
16
|
+
*/
|
|
17
|
+
readonly size?: GlimmerSizes;
|
|
18
|
+
/**
|
|
19
|
+
* Control how fast the shine moves from left to right. This is useful when
|
|
20
|
+
* the glimmer is used on smaller spaces.
|
|
21
|
+
*/
|
|
22
|
+
readonly timing?: GlimmerTimings;
|
|
23
|
+
/**
|
|
24
|
+
* Adjust the width of the glimmer in px or % values.
|
|
25
|
+
*/
|
|
26
|
+
readonly width?: number | `${number}%`;
|
|
27
|
+
}
|
|
28
|
+
export declare const GLIMMER_TEST_ID = "ATL-Glimmer";
|
|
29
|
+
export declare const GLIMMER_BACKGROUND_TEST_ID = "ATL-Glimmer-Background";
|
|
30
|
+
export declare const GLIMMER_SHINE_TEST_ID = "ATL-Glimmer-Shine";
|
|
31
|
+
export declare function Glimmer({ width, shape, size, timing, }: GlimmerProps): React.JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Animated, Easing, View } from "react-native";
|
|
4
|
+
import { Svg, Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
5
|
+
import { shineWidth, useStyles } from "./Glimmer.style.js";
|
|
6
|
+
import { useSizeStyles } from "./Glimmer.size.style.js";
|
|
7
|
+
import { useShapeStyles } from "./Glimmer.shape.style.js";
|
|
8
|
+
import { platformTokens as tokens } from "../../foundationTokens.js";
|
|
9
|
+
import { useLegacyTheme } from "../compatTheme.js";
|
|
10
|
+
export const GLIMMER_TEST_ID = "ATL-Glimmer";
|
|
11
|
+
export const GLIMMER_BACKGROUND_TEST_ID = "ATL-Glimmer-Background";
|
|
12
|
+
export const GLIMMER_SHINE_TEST_ID = "ATL-Glimmer-Shine";
|
|
13
|
+
export function Glimmer({ width, shape = "rectangle", size = "base", timing = "base", }) {
|
|
14
|
+
const leftPosition = useRef(new Animated.Value(-shineWidth)).current;
|
|
15
|
+
const [parentWidth, setParentWidth] = useState(0);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const shine = Animated.loop(Animated.timing(leftPosition, {
|
|
18
|
+
toValue: parentWidth + shineWidth,
|
|
19
|
+
duration: timing === "base"
|
|
20
|
+
? tokens["timing-loading--extended"]
|
|
21
|
+
: tokens["timing-loading"],
|
|
22
|
+
easing: Easing.ease,
|
|
23
|
+
useNativeDriver: true,
|
|
24
|
+
}));
|
|
25
|
+
shine.start();
|
|
26
|
+
return shine.stop;
|
|
27
|
+
}, [parentWidth]);
|
|
28
|
+
const styles = useStyles();
|
|
29
|
+
const sizeStyles = useSizeStyles();
|
|
30
|
+
const shapeStyles = useShapeStyles();
|
|
31
|
+
const { effectiveTheme, tokens: themeTokens } = useLegacyTheme();
|
|
32
|
+
const shineOpacity = effectiveTheme === "dark" ? 0.2 : 0.75;
|
|
33
|
+
return (_jsxs(View, { style: [
|
|
34
|
+
styles.container,
|
|
35
|
+
sizeStyles[size],
|
|
36
|
+
shapeStyles[shape],
|
|
37
|
+
{ width },
|
|
38
|
+
], onLayout: getWidth, testID: GLIMMER_TEST_ID, children: [_jsx(View, { style: styles.background, testID: GLIMMER_BACKGROUND_TEST_ID }), _jsx(Animated.View, { style: [styles.shine, { transform: [{ translateX: leftPosition }] }], testID: GLIMMER_SHINE_TEST_ID, children: _jsxs(Svg, { children: [_jsx(Defs, { children: _jsxs(LinearGradient, { id: "gradientShine", x1: 0, y1: 0.5, x2: 1, y2: 0.5, children: [_jsx(Stop, { offset: "0%", stopColor: themeTokens["color-white"], stopOpacity: "0" }), _jsx(Stop, { offset: "50%", stopColor: themeTokens["color-white"], stopOpacity: shineOpacity }), _jsx(Stop, { offset: "100%", stopColor: themeTokens["color-white"], stopOpacity: "0" })] }) }), _jsx(Rect, { fill: "url(#gradientShine)", height: "100%", width: "100%" })] }) })] }));
|
|
39
|
+
function getWidth(event) {
|
|
40
|
+
setParentWidth(event.nativeEvent.layout.width);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
export const useShapeStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
rectangle: {
|
|
5
|
+
width: "100%",
|
|
6
|
+
},
|
|
7
|
+
square: {
|
|
8
|
+
width: "auto",
|
|
9
|
+
aspectRatio: 1 / 1,
|
|
10
|
+
},
|
|
11
|
+
circle: {
|
|
12
|
+
width: "auto",
|
|
13
|
+
aspectRatio: 1 / 1,
|
|
14
|
+
borderRadius: tokens["radius-circle"],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
export const useSizeStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
small: { height: tokens["space-small"] },
|
|
5
|
+
base: { height: tokens["space-base"] },
|
|
6
|
+
large: { height: tokens["space-large"] },
|
|
7
|
+
larger: { height: tokens["space-larger"] },
|
|
8
|
+
largest: { height: tokens["space-largest"] },
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const shineWidth: number;
|
|
2
|
+
export declare const useStyles: () => {
|
|
3
|
+
container: {
|
|
4
|
+
overflow: "hidden";
|
|
5
|
+
position: "relative";
|
|
6
|
+
width: "100%";
|
|
7
|
+
height: number;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
};
|
|
10
|
+
background: {
|
|
11
|
+
position: "absolute";
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
width: "100%";
|
|
15
|
+
height: "100%";
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
opacity: number;
|
|
18
|
+
};
|
|
19
|
+
shine: {
|
|
20
|
+
position: "absolute";
|
|
21
|
+
top: number;
|
|
22
|
+
left: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: "100%";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { platformTokens as staticTokens } from "../../foundationTokens.js";
|
|
2
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
3
|
+
export const shineWidth = staticTokens["space-largest"];
|
|
4
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
5
|
+
return {
|
|
6
|
+
container: {
|
|
7
|
+
overflow: "hidden",
|
|
8
|
+
position: "relative",
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: tokens["space-base"],
|
|
11
|
+
borderRadius: tokens["radius-base"],
|
|
12
|
+
},
|
|
13
|
+
background: {
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
backgroundColor: tokens["color-surface--reverse"],
|
|
20
|
+
opacity: 0.075,
|
|
21
|
+
},
|
|
22
|
+
shine: {
|
|
23
|
+
position: "absolute",
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
width: shineWidth,
|
|
27
|
+
height: "100%",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Glimmer.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Glimmer.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { TextAlign, TextColor, TruncateLength, TypographyProps } from "../Typography/index.js";
|
|
3
|
+
type HeadingColor = Extract<TextColor, "text" | "subdued" | "heading">;
|
|
4
|
+
export type HeadingLevel = "title" | "subtitle" | "heading" | "subHeading";
|
|
5
|
+
interface HeadingProps<T extends HeadingLevel> extends Pick<TypographyProps<"base">, "selectable"> {
|
|
6
|
+
/**
|
|
7
|
+
* Text to display. Supports nesting text elements.
|
|
8
|
+
*/
|
|
9
|
+
readonly children: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The type of heading, e.g., "Title"
|
|
12
|
+
*/
|
|
13
|
+
readonly level?: T;
|
|
14
|
+
/**
|
|
15
|
+
* The text color of heading
|
|
16
|
+
*/
|
|
17
|
+
readonly variation?: HeadingColor;
|
|
18
|
+
/**
|
|
19
|
+
* Uses the reverse variant of the text color for the heading
|
|
20
|
+
*/
|
|
21
|
+
readonly reverseTheme?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Alignment of heading
|
|
24
|
+
*/
|
|
25
|
+
readonly align?: TextAlign;
|
|
26
|
+
/**
|
|
27
|
+
* The maximum amount of lines the text can occupy before being truncated with "...".
|
|
28
|
+
* Uses predefined string values that correspond to a doubling scale for the amount of lines.
|
|
29
|
+
*/
|
|
30
|
+
readonly maxLines?: TruncateLength;
|
|
31
|
+
/**
|
|
32
|
+
* Allow text to be resized based on user's device display scale
|
|
33
|
+
*/
|
|
34
|
+
readonly allowFontScaling?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare const HEADING_MAX_SCALED_FONT_SIZE: Record<HeadingLevel, number>;
|
|
37
|
+
export declare function Heading<T extends HeadingLevel = "heading">({ children, level, variation, reverseTheme, align, maxLines, allowFontScaling, selectable, }: HeadingProps<T>): React.JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
|
+
import { platformTokens as tokens } from "../../foundationTokens.js";
|
|
5
|
+
export const HEADING_MAX_SCALED_FONT_SIZE = {
|
|
6
|
+
subHeading: tokens["typography--fontSize-base"] * 1.375,
|
|
7
|
+
heading: tokens["typography--fontSize-base"] * 1.5,
|
|
8
|
+
subtitle: tokens["typography--fontSize-base"] * 1.5,
|
|
9
|
+
title: tokens["typography--fontSize-base"] * 2.125,
|
|
10
|
+
};
|
|
11
|
+
export function Heading({ children, level, variation = "heading", reverseTheme = false, align, maxLines = "unlimited", allowFontScaling = true, selectable, }) {
|
|
12
|
+
const headingStyle = getHeadingStyle(level, variation);
|
|
13
|
+
const accessibilityRole = "header";
|
|
14
|
+
return (_jsx(Typography, { ...headingStyle,
|
|
15
|
+
accessibilityRole,
|
|
16
|
+
reverseTheme,
|
|
17
|
+
...(align !== undefined && { align }),
|
|
18
|
+
maxLines,
|
|
19
|
+
allowFontScaling, maxFontScaleSize: HEADING_MAX_SCALED_FONT_SIZE[level], ...(selectable !== undefined && { selectable }), children: children }));
|
|
20
|
+
}
|
|
21
|
+
function getHeadingStyle(level = "heading", variation) {
|
|
22
|
+
const headingLevelToStyle = {
|
|
23
|
+
title: {
|
|
24
|
+
fontFamily: "display",
|
|
25
|
+
fontWeight: "extraBold",
|
|
26
|
+
size: "jumbo",
|
|
27
|
+
lineHeight: "jumbo",
|
|
28
|
+
color: variation,
|
|
29
|
+
},
|
|
30
|
+
subtitle: {
|
|
31
|
+
fontFamily: "base",
|
|
32
|
+
fontWeight: "bold",
|
|
33
|
+
size: "largest",
|
|
34
|
+
lineHeight: "largest",
|
|
35
|
+
color: variation,
|
|
36
|
+
},
|
|
37
|
+
heading: {
|
|
38
|
+
fontFamily: "base",
|
|
39
|
+
fontWeight: "bold",
|
|
40
|
+
size: "larger",
|
|
41
|
+
lineHeight: "larger",
|
|
42
|
+
color: variation,
|
|
43
|
+
},
|
|
44
|
+
subHeading: {
|
|
45
|
+
fontFamily: "base",
|
|
46
|
+
fontWeight: "semiBold",
|
|
47
|
+
size: "default",
|
|
48
|
+
lineHeight: "base",
|
|
49
|
+
color: variation,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
return headingLevelToStyle[level];
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Heading, HEADING_MAX_SCALED_FONT_SIZE } from "./Heading.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IconColorNames, IconNames } from "@zj-dynamics/design/native";
|
|
3
|
+
interface IconButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Press handler
|
|
6
|
+
*/
|
|
7
|
+
onPress?(): void;
|
|
8
|
+
/** The icon to show. */
|
|
9
|
+
readonly name: IconNames;
|
|
10
|
+
/**
|
|
11
|
+
* Accessibilty label for the component. It's also used for testing
|
|
12
|
+
*/
|
|
13
|
+
readonly accessibilityLabel: string;
|
|
14
|
+
/**
|
|
15
|
+
* Determines the color of the icon. If not specified, some icons have a default system colour
|
|
16
|
+
* like quotes, jobs, and invoices.
|
|
17
|
+
* Others that don't have a system colour fall back to greyBlue.
|
|
18
|
+
*/
|
|
19
|
+
readonly color?: IconColorNames;
|
|
20
|
+
/**
|
|
21
|
+
* Sets a custom color for the icon. Can be a rgb() or hex value.
|
|
22
|
+
*/
|
|
23
|
+
readonly customColor?: string;
|
|
24
|
+
/**
|
|
25
|
+
* a component that would render over the icon
|
|
26
|
+
* e.g. the number of notifications over the activity feed icon
|
|
27
|
+
*/
|
|
28
|
+
readonly badge?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Used to locate this button in tests
|
|
31
|
+
*/
|
|
32
|
+
readonly testID?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function IconButton({ badge, name, color, customColor, onPress, accessibilityLabel, testID, }: IconButtonProps): React.JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TouchableOpacity } from "react-native";
|
|
4
|
+
import { useStyles } from "./IconButton.style.js";
|
|
5
|
+
import { Icon } from "../../Icon.js";
|
|
6
|
+
export function IconButton({ badge, name, color, customColor, onPress, accessibilityLabel, testID, }) {
|
|
7
|
+
const styles = useStyles();
|
|
8
|
+
return (_jsxs(TouchableOpacity, { onPress: onPress, style: styles.container, accessibilityLabel: accessibilityLabel, accessibilityRole: "button", testID: testID, children: [badge, _jsx(Icon, { name: name, ...(color !== undefined && { color }), ...(customColor !== undefined && { customColor }) })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
return {
|
|
4
|
+
container: {
|
|
5
|
+
width: tokens["space-largest"],
|
|
6
|
+
height: tokens["space-largest"],
|
|
7
|
+
justifyContent: "center",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconButton } from "./IconButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconButton } from "./IconButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_CURRENCY_SYMBOL = "$";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_CURRENCY_SYMBOL = "$";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function countDecimal(value: number): number;
|
|
2
|
+
export declare function limitInputWholeDigits(value: number, maxInputLength: number): number;
|
|
3
|
+
export declare function configureDecimal(decimalCount: number, maxDecimalPlaces: number, transformedValue: string, decimalPlaces: number): number;
|
|
4
|
+
export declare function convertToNumber(value: string): string | number;
|
|
5
|
+
export declare const checkLastChar: (stringValue: string) => boolean;
|
|
6
|
+
export declare const isValidNumber: (numberedValue: string | number | undefined) => boolean;
|
|
7
|
+
export declare const getDecimalNumbers: (value: string, decimalSeparator: string) => string;
|
|
8
|
+
export declare const parseGivenInput: (value: string | undefined, decimalSeparator: string) => [number, string | undefined, string];
|
|
9
|
+
export declare const NUMBER_VALIDATION_REGEX: RegExp;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export function countDecimal(value) {
|
|
2
|
+
const convertedValue = value.toString();
|
|
3
|
+
if (convertedValue.includes(".")) {
|
|
4
|
+
return convertedValue.split(".")[1]?.length ?? 0;
|
|
5
|
+
}
|
|
6
|
+
return 0;
|
|
7
|
+
}
|
|
8
|
+
export function limitInputWholeDigits(value, maxInputLength) {
|
|
9
|
+
let convertedValue = value.toString();
|
|
10
|
+
if (convertedValue.length > maxInputLength) {
|
|
11
|
+
convertedValue = convertedValue.slice(0, maxInputLength);
|
|
12
|
+
return parseFloat(convertedValue);
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
export function configureDecimal(decimalCount, maxDecimalPlaces, transformedValue, decimalPlaces) {
|
|
17
|
+
const targetDecimalPlaces = Math.min(Math.max(decimalCount, decimalPlaces), maxDecimalPlaces);
|
|
18
|
+
const precision = 10 ** targetDecimalPlaces;
|
|
19
|
+
const convertedValue = Math.round(parseFloat(transformedValue) * precision) / precision;
|
|
20
|
+
return convertedValue;
|
|
21
|
+
}
|
|
22
|
+
export function convertToNumber(value) {
|
|
23
|
+
const regexValidation = /^[0-9]*$/;
|
|
24
|
+
if (value?.match?.(regexValidation)) {
|
|
25
|
+
return parseFloat(value);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
export const checkLastChar = (stringValue) => {
|
|
30
|
+
const lastChar = stringValue[stringValue.length - 1];
|
|
31
|
+
return Boolean(Number(stringValue)) && lastChar !== "0" && lastChar !== ".";
|
|
32
|
+
};
|
|
33
|
+
export const isValidNumber = (numberedValue) => {
|
|
34
|
+
return (typeof numberedValue === "number" &&
|
|
35
|
+
!isNaN(numberedValue) &&
|
|
36
|
+
numberedValue !== 0);
|
|
37
|
+
};
|
|
38
|
+
export const getDecimalNumbers = (value, decimalSeparator) => {
|
|
39
|
+
const decimalValue = value.split(".")[1];
|
|
40
|
+
if (!decimalValue) {
|
|
41
|
+
return decimalSeparator;
|
|
42
|
+
}
|
|
43
|
+
return `${decimalSeparator}${decimalValue}`;
|
|
44
|
+
};
|
|
45
|
+
export const parseGivenInput = (value, decimalSeparator) => {
|
|
46
|
+
let decimalCount = 0;
|
|
47
|
+
let decimalNumbers = "";
|
|
48
|
+
let wholeIntegerValue = value;
|
|
49
|
+
if (value?.includes(".")) {
|
|
50
|
+
const splittedValue = value?.split(".");
|
|
51
|
+
decimalCount = splittedValue[1]?.length ?? 0;
|
|
52
|
+
wholeIntegerValue = splittedValue[0];
|
|
53
|
+
decimalNumbers = getDecimalNumbers(value, decimalSeparator);
|
|
54
|
+
}
|
|
55
|
+
return [decimalCount, wholeIntegerValue, decimalNumbers];
|
|
56
|
+
};
|
|
57
|
+
export const NUMBER_VALIDATION_REGEX = /^[-+]?(([0-9]*\.[0-9]+)|([0-9]+)|([0-9]+(\.?[0-9]+)?e[-+]?[0-9]+))$/;
|
|
@@ -0,0 +1,76 @@
|
|
|
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 BaseInputDateProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
|
|
8
|
+
/**
|
|
9
|
+
* Defaulted to "always" so user can clear the dates whenever there's a value.
|
|
10
|
+
*/
|
|
11
|
+
readonly clearable?: Extract<Clearable, "always" | "never">;
|
|
12
|
+
/**
|
|
13
|
+
* This label is shown to the user when there's no selected date.
|
|
14
|
+
*/
|
|
15
|
+
readonly emptyValueLabel?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Maximum date the user can set.
|
|
18
|
+
*/
|
|
19
|
+
readonly maxDate?: Date;
|
|
20
|
+
/**
|
|
21
|
+
* Minimum date the user can set
|
|
22
|
+
*/
|
|
23
|
+
readonly minDate?: Date;
|
|
24
|
+
/**
|
|
25
|
+
* VoiceOver will read this string when a user selects the element
|
|
26
|
+
*/
|
|
27
|
+
readonly accessibilityLabel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Helps users understand what will happen when they perform an action
|
|
30
|
+
*/
|
|
31
|
+
readonly accessibilityHint?: string;
|
|
32
|
+
}
|
|
33
|
+
interface FormControlledInputDate extends BaseInputDateProps {
|
|
34
|
+
/**
|
|
35
|
+
* Adding a `name` would make this component "Form controlled" and must be
|
|
36
|
+
* nested within a `<Form />` component.
|
|
37
|
+
*
|
|
38
|
+
* Cannot be declared if `value` prop is used.
|
|
39
|
+
*/
|
|
40
|
+
readonly name: string;
|
|
41
|
+
/**
|
|
42
|
+
* Shows an error message below the field and highlights it red when the
|
|
43
|
+
* value is invalid. Only applies when nested within a `<Form />` component.
|
|
44
|
+
*
|
|
45
|
+
* You can see **most** of the rules you can pass in
|
|
46
|
+
* [React-hook-form Documentation](https://react-hook-form.com/api/useform/register#options).
|
|
47
|
+
*/
|
|
48
|
+
readonly validations?: UseControllerProps["rules"];
|
|
49
|
+
/**
|
|
50
|
+
* The initial value for the input.
|
|
51
|
+
*/
|
|
52
|
+
readonly defaultValue?: Date;
|
|
53
|
+
/**
|
|
54
|
+
* The callback that fires whenever a date gets selected.
|
|
55
|
+
*/
|
|
56
|
+
readonly onChange?: (value?: Date | null) => void;
|
|
57
|
+
}
|
|
58
|
+
interface DevControlledInputDate extends BaseInputDateProps {
|
|
59
|
+
/**
|
|
60
|
+
* The value shown on the field. This gets automatically formatted to the
|
|
61
|
+
* account's date format.
|
|
62
|
+
*
|
|
63
|
+
* Cannot be declared if `name` prop is used.
|
|
64
|
+
*/
|
|
65
|
+
readonly value: Date | string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The callback that fires whenever a date gets selected.
|
|
68
|
+
*/
|
|
69
|
+
readonly onChange: (value?: Date) => void;
|
|
70
|
+
}
|
|
71
|
+
export type InputDateProps = XOR<FormControlledInputDate, DevControlledInputDate>;
|
|
72
|
+
/**
|
|
73
|
+
* Allow users to select a date using the device date picker.
|
|
74
|
+
*/
|
|
75
|
+
export declare function InputDate(props: InputDateProps): React.JSX.Element;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useComponentSettings } from "../ComponentSettingsContext/index.js";
|
|
3
|
+
import React, { useMemo, useState } from "react";
|
|
4
|
+
import DateTimePicker from "react-native-modal-datetime-picker";
|
|
5
|
+
import { Keyboard, Platform } from "react-native";
|
|
6
|
+
import { FormField } from "../FormField/index.js";
|
|
7
|
+
import { InputPressable } from "../InputPressable/index.js";
|
|
8
|
+
import { useComponentMessages } from "../foundationMessages.js";
|
|
9
|
+
function formatInvalidState(error, invalid) {
|
|
10
|
+
if (invalid)
|
|
11
|
+
return invalid;
|
|
12
|
+
if (error && error.message) {
|
|
13
|
+
return error.message;
|
|
14
|
+
}
|
|
15
|
+
return Boolean(error);
|
|
16
|
+
}
|
|
17
|
+
const display = Platform.OS === "ios" ? "inline" : "default";
|
|
18
|
+
/**
|
|
19
|
+
* Allow users to select a date using the device date picker.
|
|
20
|
+
*/
|
|
21
|
+
export function InputDate(props) {
|
|
22
|
+
if (props.name) {
|
|
23
|
+
return (_jsx(FormField, { name: props.name, ...(props.defaultValue !== undefined && { defaultValue: props.defaultValue }), ...(props.validations !== undefined && { validations: props.validations }), children: ({ value, onChange, onBlur }, error) => (_jsx(InternalInputDate, { ...props, value: value, onChange: (newValue) => {
|
|
24
|
+
onChange(newValue);
|
|
25
|
+
onBlur();
|
|
26
|
+
props.onChange?.(newValue);
|
|
27
|
+
}, invalid: formatInvalidState(error, props.invalid) })) }));
|
|
28
|
+
}
|
|
29
|
+
return _jsx(InternalInputDate, { ...props, onChange: next => props.onChange?.(next ?? undefined) });
|
|
30
|
+
}
|
|
31
|
+
function InternalInputDate({ clearable = "always", disabled = false, emptyValueLabel, invalid, maxDate, minDate, placeholder, value, showMiniLabel = true, name, onChange, accessibilityLabel, accessibilityHint, }) {
|
|
32
|
+
const [showPicker, setShowPicker] = useState(false);
|
|
33
|
+
const { t, locale, formatDate } = useComponentMessages();
|
|
34
|
+
const { timeZone } = useComponentSettings();
|
|
35
|
+
const date = useMemo(() => {
|
|
36
|
+
const parsed = typeof value === "string" ? new Date(value) : value;
|
|
37
|
+
return parsed && !Number.isNaN(parsed.getTime()) ? parsed : undefined;
|
|
38
|
+
}, [value]);
|
|
39
|
+
const formattedDate = useMemo(() => {
|
|
40
|
+
if (date) {
|
|
41
|
+
return formatDate(date);
|
|
42
|
+
}
|
|
43
|
+
return emptyValueLabel;
|
|
44
|
+
}, [date, emptyValueLabel]);
|
|
45
|
+
const canClearDate = date ? clearable : "never";
|
|
46
|
+
const placeholderLabel = placeholder ?? t("date");
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsx(InputPressable, { showMiniLabel: showMiniLabel, focused: showPicker, clearable: canClearDate, disabled: disabled, ...(invalid !== undefined && { invalid: invalid }), placeholder: placeholderLabel, prefix: { icon: "calendar" }, ...(formattedDate !== undefined && { value: formattedDate }), onClear: handleClear, onPress: showDatePicker, ...(accessibilityLabel !== undefined && { accessibilityLabel: accessibilityLabel }), ...(accessibilityHint !== undefined && { accessibilityHint: accessibilityHint }) }), _jsx(DateTimePicker, { testID: "inputDate-datePicker", ...(date != null && { date }), display: display, isVisible: showPicker, ...(maxDate !== undefined && { maximumDate: maxDate }), ...(minDate !== undefined && { minimumDate: minDate }), mode: "date", timeZoneName: timeZone, confirmTextIOS: t("confirm"), cancelTextIOS: t("cancel"), locale: locale, onCancel: handleCancel, onConfirm: handleConfirm })] }));
|
|
48
|
+
function showDatePicker() {
|
|
49
|
+
Keyboard.dismiss();
|
|
50
|
+
setShowPicker(true);
|
|
51
|
+
}
|
|
52
|
+
function handleConfirm(newVal) {
|
|
53
|
+
setShowPicker(false);
|
|
54
|
+
onChange?.(newVal);
|
|
55
|
+
}
|
|
56
|
+
function handleCancel() {
|
|
57
|
+
setShowPicker(false);
|
|
58
|
+
// Ensure a change happens so we trigger the validation of one exists
|
|
59
|
+
onChange?.(date);
|
|
60
|
+
}
|
|
61
|
+
function handleClear() {
|
|
62
|
+
// Returns null only for Form controlled scenarios due to a limitation of react-hook-form that doesn't allow passing undefined to form values.
|
|
63
|
+
if (name) {
|
|
64
|
+
onChange?.(null);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
onChange?.(undefined);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputDate } from "./InputDate.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import type { LegacyThemeContextValue } from "../compatTheme.js";
|
|
3
|
+
import { platformTokens as staticTokens } from "../../foundationTokens.js";
|
|
4
|
+
export declare const createCommonInputTokens: (tokens: LegacyThemeContextValue["tokens"] | typeof staticTokens) => Record<string, ViewStyle | TextStyle>;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use useCommonInputStyles instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const commonInputStyles: Record<string, ViewStyle | TextStyle>;
|
|
9
|
+
export declare const getCommonInputStyles: (tokens: LegacyThemeContextValue["tokens"]) => Record<string, ViewStyle | TextStyle>;
|
|
10
|
+
export declare const useCommonInputStyles: () => Record<string, ViewStyle | TextStyle>;
|