@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,49 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
3
|
+
import { getTypographyStyles } from "../Typography/index.js";
|
|
4
|
+
import { platformTokens as staticTokens } from "../../foundationTokens.js";
|
|
5
|
+
export const createCommonInputTokens = (tokens) => {
|
|
6
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
7
|
+
return {
|
|
8
|
+
input: {
|
|
9
|
+
width: "100%",
|
|
10
|
+
flexShrink: 1,
|
|
11
|
+
flexGrow: 1,
|
|
12
|
+
color: tokens["color-text"],
|
|
13
|
+
fontFamily: typographyStyles.baseRegularRegular?.fontFamily,
|
|
14
|
+
fontSize: typographyStyles.defaultSize?.fontSize,
|
|
15
|
+
letterSpacing: typographyStyles.baseLetterSpacing?.letterSpacing,
|
|
16
|
+
minHeight: tokens["space-largest"] + tokens["space-small"],
|
|
17
|
+
padding: 0,
|
|
18
|
+
},
|
|
19
|
+
inputEmpty: {
|
|
20
|
+
paddingTop: 0,
|
|
21
|
+
},
|
|
22
|
+
inputDisabled: {
|
|
23
|
+
color: typographyStyles.disabled?.color,
|
|
24
|
+
},
|
|
25
|
+
container: {
|
|
26
|
+
paddingLeft: tokens["space-base"],
|
|
27
|
+
marginVertical: tokens["space-smaller"],
|
|
28
|
+
backgroundColor: tokens["color-surface"],
|
|
29
|
+
minHeight: tokens["space-largest"] + tokens["space-small"],
|
|
30
|
+
flexDirection: "row",
|
|
31
|
+
justifyContent: "space-between",
|
|
32
|
+
width: "100%",
|
|
33
|
+
borderColor: tokens["color-border--interactive"],
|
|
34
|
+
borderStyle: "solid",
|
|
35
|
+
borderWidth: tokens["border-base"],
|
|
36
|
+
borderRadius: tokens["radius-base"],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use useCommonInputStyles instead
|
|
42
|
+
*/
|
|
43
|
+
export const commonInputStyles = StyleSheet.create(createCommonInputTokens(staticTokens));
|
|
44
|
+
export const getCommonInputStyles = (tokens) => {
|
|
45
|
+
return createCommonInputTokens(tokens);
|
|
46
|
+
};
|
|
47
|
+
export const useCommonInputStyles = buildThemedStyles(tokens => {
|
|
48
|
+
return getCommonInputStyles(tokens);
|
|
49
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import type { FieldError } from "react-hook-form";
|
|
4
|
+
import type { IconNames } from "@zj-dynamics/design/native";
|
|
5
|
+
export interface InputFieldStyleOverride {
|
|
6
|
+
prefixLabel?: StyleProp<TextStyle>;
|
|
7
|
+
suffixLabel?: StyleProp<TextStyle>;
|
|
8
|
+
container?: StyleProp<ViewStyle>;
|
|
9
|
+
placeholderText?: StyleProp<TextStyle>;
|
|
10
|
+
}
|
|
11
|
+
export interface InputFieldWrapperProps {
|
|
12
|
+
/**
|
|
13
|
+
* Highlights the field red and shows message below (if string) to indicate an error
|
|
14
|
+
*/
|
|
15
|
+
readonly invalid?: boolean | string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Disable the input
|
|
18
|
+
*/
|
|
19
|
+
readonly disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Hint text that goes above the value once the field is filled out
|
|
22
|
+
*/
|
|
23
|
+
readonly placeholder?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Text that goes below the input to help the user understand the input
|
|
26
|
+
*/
|
|
27
|
+
readonly assistiveText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Controls how the placeholder text is displayed.
|
|
30
|
+
* - normal: the placeholder text will be displayed in the normal placeholder position
|
|
31
|
+
* - mini: the placeholder text will float above the input value
|
|
32
|
+
* - hidden: the placeholder text will not be displayed
|
|
33
|
+
* @default "normal"
|
|
34
|
+
*/
|
|
35
|
+
readonly placeholderMode?: "normal" | "mini" | "hidden";
|
|
36
|
+
readonly hasValue?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Symbol to display before the text input
|
|
39
|
+
*/
|
|
40
|
+
readonly prefix?: {
|
|
41
|
+
icon?: IconNames;
|
|
42
|
+
label?: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Symbol to display after the text input
|
|
46
|
+
*/
|
|
47
|
+
readonly suffix?: {
|
|
48
|
+
icon?: IconNames;
|
|
49
|
+
label?: string;
|
|
50
|
+
onPress?: () => void;
|
|
51
|
+
accessibilityLabel?: string;
|
|
52
|
+
};
|
|
53
|
+
readonly error?: FieldError | undefined;
|
|
54
|
+
readonly focused?: boolean;
|
|
55
|
+
readonly children: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Adds the ClearAction that will call the onClear handler when pressed
|
|
58
|
+
*/
|
|
59
|
+
readonly showClearAction?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Callback called when the user clicks the ClearAction button. Should clear the value passed.
|
|
62
|
+
* To disallow clearing set the clearable prop to never
|
|
63
|
+
*/
|
|
64
|
+
readonly onClear?: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* Custom styling to override default style of the input field
|
|
67
|
+
*/
|
|
68
|
+
readonly styleOverride?: InputFieldStyleOverride;
|
|
69
|
+
/**
|
|
70
|
+
* Add a toolbar below the input field for actions like rewriting the text.
|
|
71
|
+
*/
|
|
72
|
+
readonly toolbar?: React.ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Change the behaviour of when the toolbar becomes visible.
|
|
75
|
+
*/
|
|
76
|
+
readonly toolbarVisibility?: "always" | "while-editing";
|
|
77
|
+
/**
|
|
78
|
+
* Show loading indicator.
|
|
79
|
+
*/
|
|
80
|
+
readonly loading?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Change the type of loading indicator to spinner or glimmer.
|
|
83
|
+
*/
|
|
84
|
+
readonly loadingType?: "spinner" | "glimmer";
|
|
85
|
+
/**
|
|
86
|
+
* Whether the input is a multiline input.
|
|
87
|
+
*/
|
|
88
|
+
readonly multiline?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export declare const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers";
|
|
91
|
+
export declare const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner";
|
|
92
|
+
export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, placeholderMode, hasValue, error, focused, children, onClear, showClearAction, styleOverride, toolbar, toolbarVisibility, loading, loadingType, multiline, }: InputFieldWrapperProps): React.JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PixelRatio, Platform, Text as RNText, View } from "react-native";
|
|
4
|
+
import { useStyles } from "./InputFieldWrapper.style.js";
|
|
5
|
+
import { PrefixIcon, PrefixLabel } from "./components/Prefix/Prefix.js";
|
|
6
|
+
import { SuffixIcon, SuffixLabel } from "./components/Suffix/Suffix.js";
|
|
7
|
+
import { ClearAction } from "./components/ClearAction/index.js";
|
|
8
|
+
import { Glimmer } from "../Glimmer/Glimmer.js";
|
|
9
|
+
import { ErrorMessageWrapper } from "../ErrorMessageWrapper/index.js";
|
|
10
|
+
import { useTypographyStyles } from "../Typography/index.js";
|
|
11
|
+
import { Text } from "../Text/index.js";
|
|
12
|
+
import { ActivityIndicator } from "../ActivityIndicator/index.js";
|
|
13
|
+
export const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers";
|
|
14
|
+
export const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner";
|
|
15
|
+
export function InputFieldWrapper({ invalid, disabled = false, placeholder, assistiveText, prefix, suffix, placeholderMode = "normal", hasValue = false, error, focused = false, children, onClear, showClearAction = false, styleOverride, toolbar, toolbarVisibility = "while-editing", loading = false, loadingType = "spinner", multiline = false, }) {
|
|
16
|
+
fieldAffixRequiredPropsCheck([prefix, suffix]);
|
|
17
|
+
const handleClear = onClear ?? noopClear;
|
|
18
|
+
warnIfClearActionWithNoOnClear(onClear, showClearAction);
|
|
19
|
+
const inputInvalid = Boolean(invalid) || Boolean(error);
|
|
20
|
+
const isToolbarVisible = toolbar && (toolbarVisibility === "always" || focused);
|
|
21
|
+
const showLoadingSpinner = loading && loadingType === "spinner";
|
|
22
|
+
const showLoadingGlimmer = loading && loadingType === "glimmer";
|
|
23
|
+
const styles = useStyles();
|
|
24
|
+
const placeholderVisible = placeholderMode !== "hidden";
|
|
25
|
+
const miniLabelActive = placeholderMode === "mini";
|
|
26
|
+
return (_jsxs(ErrorMessageWrapper, { message: getMessage({ invalid, error }), children: [_jsxs(View, { testID: "ATL-InputFieldWrapper", style: [
|
|
27
|
+
styles.container,
|
|
28
|
+
focused && styles.inputFocused,
|
|
29
|
+
(Boolean(invalid) || error) && styles.inputInvalid,
|
|
30
|
+
disabled && styles.disabled,
|
|
31
|
+
styleOverride?.container,
|
|
32
|
+
shouldApplyScrollTrapWorkaround(multiline) && {
|
|
33
|
+
maxWidth: "90%",
|
|
34
|
+
},
|
|
35
|
+
], children: [_jsxs(View, { style: styles.field, children: [prefix?.icon && (_jsx(PrefixIcon, { disabled: disabled, focused: focused, inputInvalid: inputInvalid, icon: prefix.icon })), _jsxs(View, { style: [styles.inputContainer], children: [placeholderVisible && (_jsx(View, { style: [
|
|
36
|
+
!!placeholder && styles.label,
|
|
37
|
+
miniLabelActive && styles.miniLabel,
|
|
38
|
+
disabled && styles.disabled,
|
|
39
|
+
miniLabelActive &&
|
|
40
|
+
showClearAction &&
|
|
41
|
+
styles.miniLabelShowClearAction,
|
|
42
|
+
], pointerEvents: "none", children: _jsx(Placeholder, { placeholder: placeholder, labelVariation: getLabelVariation(error, invalid, disabled), miniLabelActive: miniLabelActive, styleOverride: styleOverride?.placeholderText }) })), prefix?.label && hasValue && (_jsx(PrefixLabel, { disabled: disabled, focused: focused, miniLabelActive: miniLabelActive, inputInvalid: inputInvalid, label: prefix.label, styleOverride: styleOverride?.prefixLabel })), children, showLoadingGlimmer && (_jsxs(View, { testID: INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID, style: [
|
|
43
|
+
styles.loadingGlimmers,
|
|
44
|
+
hasValue && styles.loadingGlimmersHasValue,
|
|
45
|
+
], children: [_jsx(Glimmer, { size: "small", width: "80%" }), _jsx(Glimmer, { size: "small" }), _jsx(Glimmer, { size: "small", width: "70%" })] })), (showClearAction ||
|
|
46
|
+
suffix?.label ||
|
|
47
|
+
suffix?.icon ||
|
|
48
|
+
showLoadingSpinner) && (_jsxs(View, { style: styles.inputEndContainer, children: [showClearAction && (_jsx(ClearAction, { hasMarginRight: !!suffix?.icon || !!suffix?.label, onPress: handleClear })), suffix?.label && hasValue && (_jsx(SuffixLabel, { disabled: disabled, focused: focused, miniLabelActive: miniLabelActive, inputInvalid: inputInvalid, label: suffix.label, hasLeftMargin: !showClearAction, styleOverride: styleOverride?.suffixLabel })), showLoadingSpinner && (_jsx(View, { style: styles.loadingSpinner, children: _jsx(ActivityIndicator, { testID: INPUT_FIELD_WRAPPER_SPINNER_TEST_ID }) })), suffix?.icon && (_jsx(SuffixIcon, { disabled: disabled, focused: focused, hasLeftMargin: !!(!showClearAction || suffix?.label), inputInvalid: inputInvalid, icon: suffix.icon, ...(suffix.onPress && { onPress: suffix.onPress }), ...(suffix.accessibilityLabel !== undefined && { accessibilityLabel: suffix.accessibilityLabel }) }))] }))] })] }), isToolbarVisible && _jsx(View, { style: styles.toolbar, children: toolbar })] }), assistiveText && !error && !invalid && (_jsx(Text, { level: "textSupporting", variation: disabled ? "disabled" : focused ? "interactive" : "subdued", children: assistiveText }))] }));
|
|
49
|
+
}
|
|
50
|
+
function shouldApplyScrollTrapWorkaround(isMultiline) {
|
|
51
|
+
const isCustomFontScale = PixelRatio.getFontScale() !== 1;
|
|
52
|
+
// On iOS, when the OS font scale is not default, it causes multiline inputs to become scroll-trapped
|
|
53
|
+
// which prevents the user from scrolling the parent form view. For now, we're working around this
|
|
54
|
+
// by limiting the width of the input field, thus providing a gap so the user can scroll more easily.
|
|
55
|
+
return isMultiline && Platform.OS === "ios" && isCustomFontScale;
|
|
56
|
+
}
|
|
57
|
+
function getLabelVariation(error, invalid, disabled) {
|
|
58
|
+
if (invalid || error) {
|
|
59
|
+
return "error";
|
|
60
|
+
}
|
|
61
|
+
else if (disabled) {
|
|
62
|
+
return "disabled";
|
|
63
|
+
}
|
|
64
|
+
return "subdued";
|
|
65
|
+
}
|
|
66
|
+
function fieldAffixRequiredPropsCheck(affixPair) {
|
|
67
|
+
affixPair.map(affix => {
|
|
68
|
+
if (typeof affix !== "undefined" && !affix.icon && !affix.label) {
|
|
69
|
+
throw new Error(`One of 'label' or 'icon' is required by the field affix component.`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function warnIfClearActionWithNoOnClear(onClear, showClearAction) {
|
|
74
|
+
if (showClearAction && !onClear && __DEV__) {
|
|
75
|
+
console.warn("Declare an `onClear` prop on your input. You can set `clearable` to never or `showClearAction` to false if you don't need a clearable input");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function noopClear() {
|
|
79
|
+
warnIfClearActionWithNoOnClear(undefined, true);
|
|
80
|
+
}
|
|
81
|
+
function getMessage({ invalid, error, }) {
|
|
82
|
+
const messages = [];
|
|
83
|
+
if (error?.message)
|
|
84
|
+
messages.push(error.message);
|
|
85
|
+
if (invalid && typeof invalid === "string")
|
|
86
|
+
messages.push(invalid);
|
|
87
|
+
return messages.join("\n");
|
|
88
|
+
}
|
|
89
|
+
function Placeholder({ placeholder, styleOverride, labelVariation, miniLabelActive, }) {
|
|
90
|
+
const typographyStyles = useTypographyStyles();
|
|
91
|
+
return (_jsx(_Fragment, { children: !styleOverride ? (_jsx(Text, { hideFromScreenReader: true, maxLines: "single", variation: labelVariation, level: miniLabelActive ? "textSupporting" : "text", children: placeholder })) : (_jsx(RNText, { accessibilityRole: "none", accessible: false, importantForAccessibility: "no-hide-descendants", numberOfLines: 1, style: [
|
|
92
|
+
typographyStyles[labelVariation],
|
|
93
|
+
typographyStyles.baseRegularRegular,
|
|
94
|
+
miniLabelActive
|
|
95
|
+
? typographyStyles.smallSize
|
|
96
|
+
: typographyStyles.defaultSize,
|
|
97
|
+
styleOverride,
|
|
98
|
+
], children: placeholder })) }));
|
|
99
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
container: import("react-native").ViewStyle;
|
|
3
|
+
field: {
|
|
4
|
+
flexDirection: "row";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
};
|
|
7
|
+
inputContainer: {
|
|
8
|
+
flexDirection: "row";
|
|
9
|
+
flex: number;
|
|
10
|
+
justifyContent: "flex-start";
|
|
11
|
+
};
|
|
12
|
+
inputFocused: {
|
|
13
|
+
borderColor: string;
|
|
14
|
+
};
|
|
15
|
+
inputInvalid: {
|
|
16
|
+
borderColor: string;
|
|
17
|
+
};
|
|
18
|
+
label: {
|
|
19
|
+
position: "absolute";
|
|
20
|
+
display: "flex";
|
|
21
|
+
justifyContent: "center";
|
|
22
|
+
top: number;
|
|
23
|
+
right: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
left: number;
|
|
26
|
+
zIndex: number;
|
|
27
|
+
};
|
|
28
|
+
miniLabel: {
|
|
29
|
+
top: number;
|
|
30
|
+
paddingTop: number;
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
marginRight: number;
|
|
33
|
+
maxHeight: number;
|
|
34
|
+
};
|
|
35
|
+
miniLabelShowClearAction: {
|
|
36
|
+
backgroundColor: string;
|
|
37
|
+
};
|
|
38
|
+
disabled: {
|
|
39
|
+
backgroundColor: string;
|
|
40
|
+
};
|
|
41
|
+
fieldAffix: {
|
|
42
|
+
flexDirection: "row";
|
|
43
|
+
};
|
|
44
|
+
fieldAffixMiniLabel: {
|
|
45
|
+
paddingTop: number;
|
|
46
|
+
top: number;
|
|
47
|
+
right: number;
|
|
48
|
+
bottom: number;
|
|
49
|
+
left: number;
|
|
50
|
+
};
|
|
51
|
+
prefixIcon: {
|
|
52
|
+
justifyContent: "center";
|
|
53
|
+
paddingRight: number;
|
|
54
|
+
};
|
|
55
|
+
prefixLabel: {
|
|
56
|
+
justifyContent: "center";
|
|
57
|
+
paddingTop: number;
|
|
58
|
+
paddingRight: number;
|
|
59
|
+
};
|
|
60
|
+
suffixIcon: {
|
|
61
|
+
justifyContent: "center";
|
|
62
|
+
paddingRight: number;
|
|
63
|
+
};
|
|
64
|
+
suffixLabel: {
|
|
65
|
+
justifyContent: "center";
|
|
66
|
+
paddingTop: number;
|
|
67
|
+
paddingRight: number;
|
|
68
|
+
};
|
|
69
|
+
suffixIconMargin: {
|
|
70
|
+
marginLeft: number;
|
|
71
|
+
};
|
|
72
|
+
suffixLabelMargin: {
|
|
73
|
+
marginLeft: number;
|
|
74
|
+
};
|
|
75
|
+
inputEndContainer: {
|
|
76
|
+
flexDirection: "row";
|
|
77
|
+
zIndex: number;
|
|
78
|
+
};
|
|
79
|
+
toolbar: {
|
|
80
|
+
flexBasis: "100%";
|
|
81
|
+
flexDirection: "row";
|
|
82
|
+
gap: number;
|
|
83
|
+
paddingBottom: number;
|
|
84
|
+
};
|
|
85
|
+
loadingSpinner: {
|
|
86
|
+
justifyContent: "center";
|
|
87
|
+
paddingRight: number;
|
|
88
|
+
};
|
|
89
|
+
loadingGlimmers: {
|
|
90
|
+
position: "absolute";
|
|
91
|
+
top: number;
|
|
92
|
+
bottom: number;
|
|
93
|
+
left: number;
|
|
94
|
+
right: number;
|
|
95
|
+
gap: number;
|
|
96
|
+
paddingTop: number;
|
|
97
|
+
paddingRight: number;
|
|
98
|
+
backgroundColor: string;
|
|
99
|
+
overflow: "hidden";
|
|
100
|
+
};
|
|
101
|
+
loadingGlimmersHasValue: {
|
|
102
|
+
top: number;
|
|
103
|
+
paddingTop: number;
|
|
104
|
+
bottom: number;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { getCommonInputStyles } from "./CommonInputStyles.style.js";
|
|
3
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
4
|
+
import { getTypographyStyles } from "../Typography/index.js";
|
|
5
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
6
|
+
const commonInputStyles = getCommonInputStyles(tokens);
|
|
7
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
8
|
+
return {
|
|
9
|
+
container: StyleSheet.flatten([
|
|
10
|
+
commonInputStyles.container,
|
|
11
|
+
{
|
|
12
|
+
flexDirection: "column",
|
|
13
|
+
},
|
|
14
|
+
]),
|
|
15
|
+
field: {
|
|
16
|
+
flexDirection: "row",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
},
|
|
19
|
+
inputContainer: {
|
|
20
|
+
flexDirection: "row",
|
|
21
|
+
flex: 1,
|
|
22
|
+
justifyContent: "flex-start",
|
|
23
|
+
},
|
|
24
|
+
inputFocused: {
|
|
25
|
+
borderColor: tokens["color-interactive"],
|
|
26
|
+
},
|
|
27
|
+
inputInvalid: {
|
|
28
|
+
borderColor: tokens["color-critical"],
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
// for placeholder
|
|
32
|
+
position: "absolute",
|
|
33
|
+
display: "flex",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
top: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
bottom: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
zIndex: 1,
|
|
40
|
+
},
|
|
41
|
+
miniLabel: {
|
|
42
|
+
top: 0,
|
|
43
|
+
paddingTop: tokens["space-small"] - tokens["space-smallest"],
|
|
44
|
+
backgroundColor: tokens["color-surface"],
|
|
45
|
+
marginRight: tokens["space-small"],
|
|
46
|
+
maxHeight: (typographyStyles.defaultSize?.lineHeight || 0) +
|
|
47
|
+
tokens["space-smaller"],
|
|
48
|
+
},
|
|
49
|
+
// Prevents the miniLabel from cutting off the ClearAction button
|
|
50
|
+
miniLabelShowClearAction: {
|
|
51
|
+
backgroundColor: "transparent",
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
backgroundColor: tokens["color-disabled--secondary"],
|
|
55
|
+
},
|
|
56
|
+
fieldAffix: {
|
|
57
|
+
flexDirection: "row",
|
|
58
|
+
},
|
|
59
|
+
fieldAffixMiniLabel: {
|
|
60
|
+
paddingTop: tokens["space-small"] - tokens["space-smallest"],
|
|
61
|
+
// @ts-expect-error tsc-ci
|
|
62
|
+
top: typographyStyles.smallSize.fontSize / 2,
|
|
63
|
+
right: 0,
|
|
64
|
+
bottom: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
},
|
|
67
|
+
prefixIcon: {
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
paddingRight: tokens["space-small"],
|
|
70
|
+
},
|
|
71
|
+
prefixLabel: {
|
|
72
|
+
justifyContent: "center",
|
|
73
|
+
paddingTop: tokens["space-minuscule"],
|
|
74
|
+
paddingRight: tokens["space-minuscule"],
|
|
75
|
+
},
|
|
76
|
+
suffixIcon: {
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
paddingRight: tokens["space-small"],
|
|
79
|
+
},
|
|
80
|
+
suffixLabel: {
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
paddingTop: tokens["space-minuscule"],
|
|
83
|
+
paddingRight: tokens["space-small"],
|
|
84
|
+
},
|
|
85
|
+
suffixIconMargin: {
|
|
86
|
+
marginLeft: tokens["space-small"] + tokens["space-smaller"],
|
|
87
|
+
},
|
|
88
|
+
suffixLabelMargin: {
|
|
89
|
+
marginLeft: tokens["space-smallest"],
|
|
90
|
+
},
|
|
91
|
+
inputEndContainer: {
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
zIndex: 1,
|
|
94
|
+
},
|
|
95
|
+
toolbar: {
|
|
96
|
+
flexBasis: "100%",
|
|
97
|
+
flexDirection: "row",
|
|
98
|
+
gap: tokens["space-small"],
|
|
99
|
+
paddingBottom: tokens["space-small"],
|
|
100
|
+
},
|
|
101
|
+
loadingSpinner: {
|
|
102
|
+
justifyContent: "center",
|
|
103
|
+
paddingRight: tokens["space-small"],
|
|
104
|
+
},
|
|
105
|
+
loadingGlimmers: {
|
|
106
|
+
position: "absolute",
|
|
107
|
+
top: tokens["space-base"],
|
|
108
|
+
bottom: tokens["space-base"],
|
|
109
|
+
left: 0,
|
|
110
|
+
right: 0,
|
|
111
|
+
gap: tokens["space-small"],
|
|
112
|
+
paddingTop: tokens["space-small"],
|
|
113
|
+
paddingRight: tokens["space-large"],
|
|
114
|
+
backgroundColor: tokens["color-surface"],
|
|
115
|
+
overflow: "hidden",
|
|
116
|
+
},
|
|
117
|
+
loadingGlimmersHasValue: {
|
|
118
|
+
top: tokens["space-large"],
|
|
119
|
+
paddingTop: tokens["space-base"] - tokens["space-smaller"],
|
|
120
|
+
bottom: tokens["space-smaller"],
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ClearActionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Press handler
|
|
5
|
+
*/
|
|
6
|
+
readonly onPress: () => void;
|
|
7
|
+
readonly hasMarginRight?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function ClearAction({ onPress, hasMarginRight, }: ClearActionProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { useStyles } from "./ClearAction.style.js";
|
|
5
|
+
import { Icon } from "../../../../Icon.js";
|
|
6
|
+
import { useComponentMessages } from "../../../foundationMessages.js";
|
|
7
|
+
export function ClearAction({ onPress, hasMarginRight = false, }) {
|
|
8
|
+
const { t } = useComponentMessages();
|
|
9
|
+
const styles = useStyles();
|
|
10
|
+
return (_jsx(Pressable, { style: [styles.container, hasMarginRight && styles.addedMargin], onPress: onPress, accessibilityLabel: t("InputFieldWrapper.clear"), children: _jsx(View, { style: styles.circle, children: _jsx(Icon, { size: "small", name: "cross", color: "interactiveSubtle" }) }) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
container: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: "100%";
|
|
5
|
+
flexDirection: "row";
|
|
6
|
+
justifyContent: "center";
|
|
7
|
+
alignItems: "center";
|
|
8
|
+
alignSelf: "center";
|
|
9
|
+
};
|
|
10
|
+
circle: {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
borderRadius: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
flexDirection: "row";
|
|
16
|
+
justifyContent: "center";
|
|
17
|
+
alignItems: "center";
|
|
18
|
+
};
|
|
19
|
+
addedMargin: {
|
|
20
|
+
marginRight: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
3
|
+
const width = tokens["space-smaller"] + tokens["space-larger"];
|
|
4
|
+
return {
|
|
5
|
+
container: {
|
|
6
|
+
width,
|
|
7
|
+
height: "100%",
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
alignSelf: "center",
|
|
12
|
+
},
|
|
13
|
+
circle: {
|
|
14
|
+
backgroundColor: tokens["color-surface--background"],
|
|
15
|
+
borderRadius: tokens["radius-circle"],
|
|
16
|
+
width: tokens["space-large"],
|
|
17
|
+
height: tokens["space-large"],
|
|
18
|
+
flexDirection: "row",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
},
|
|
22
|
+
addedMargin: {
|
|
23
|
+
marginRight: tokens["space-small"],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClearAction } from "./ClearAction.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClearAction } from "./ClearAction.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import type { IconNames } from "@zj-dynamics/design/native";
|
|
4
|
+
export interface PrefixLabelProps {
|
|
5
|
+
readonly focused: boolean;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
readonly miniLabelActive: boolean;
|
|
8
|
+
readonly inputInvalid: boolean;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly styleOverride?: StyleProp<TextStyle>;
|
|
11
|
+
}
|
|
12
|
+
export declare const prefixLabelTestId = "ATL-InputFieldWrapper-PrefixLabel";
|
|
13
|
+
export declare const prefixIconTestId = "ATL-InputFieldWrapper-PrefixIcon";
|
|
14
|
+
export declare function PrefixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, styleOverride, }: PrefixLabelProps): React.JSX.Element;
|
|
15
|
+
export interface PrefixIconProps {
|
|
16
|
+
readonly focused: boolean;
|
|
17
|
+
readonly disabled?: boolean;
|
|
18
|
+
readonly inputInvalid?: boolean;
|
|
19
|
+
readonly icon: IconNames;
|
|
20
|
+
readonly styleOverride?: StyleProp<ViewStyle>;
|
|
21
|
+
}
|
|
22
|
+
export declare function PrefixIcon({ focused, disabled, inputInvalid, icon, }: PrefixIconProps): React.JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text as RNText, View } from "react-native";
|
|
4
|
+
import { Icon } from "../../../../Icon.js";
|
|
5
|
+
import { Text } from "../../../Text/index.js";
|
|
6
|
+
import { useLegacyTheme } from "../../../compatTheme.js";
|
|
7
|
+
import { useTypographyStyles } from "../../../Typography/index.js";
|
|
8
|
+
import { useStyles } from "../../InputFieldWrapper.style.js";
|
|
9
|
+
export const prefixLabelTestId = "ATL-InputFieldWrapper-PrefixLabel";
|
|
10
|
+
export const prefixIconTestId = "ATL-InputFieldWrapper-PrefixIcon";
|
|
11
|
+
export function PrefixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, styleOverride, }) {
|
|
12
|
+
const styles = useStyles();
|
|
13
|
+
const typographyStyles = useTypographyStyles();
|
|
14
|
+
return (_jsx(View, { style: [
|
|
15
|
+
styles.fieldAffix,
|
|
16
|
+
focused && styles.inputFocused,
|
|
17
|
+
inputInvalid && styles.inputInvalid,
|
|
18
|
+
], testID: prefixLabelTestId, children: _jsx(View, { style: [
|
|
19
|
+
styles.prefixLabel,
|
|
20
|
+
miniLabelActive && styles.fieldAffixMiniLabel,
|
|
21
|
+
], children: !styleOverride ? (_jsx(Text, { variation: disabled ? "disabled" : "base", children: label })) : (_jsx(RNText, { allowFontScaling: true, style: [
|
|
22
|
+
typographyStyles.baseRegularRegular,
|
|
23
|
+
typographyStyles.base,
|
|
24
|
+
typographyStyles.defaultSize,
|
|
25
|
+
disabled ? typographyStyles.subdued : typographyStyles.base,
|
|
26
|
+
styleOverride,
|
|
27
|
+
], children: label })) }) }));
|
|
28
|
+
}
|
|
29
|
+
export function PrefixIcon({ focused, disabled, inputInvalid, icon, }) {
|
|
30
|
+
const styles = useStyles();
|
|
31
|
+
const { tokens } = useLegacyTheme();
|
|
32
|
+
return (_jsx(View, { testID: prefixIconTestId, style: [
|
|
33
|
+
styles.fieldAffix,
|
|
34
|
+
focused && styles.inputFocused,
|
|
35
|
+
inputInvalid && styles.inputInvalid,
|
|
36
|
+
], children: _jsx(View, { style: styles.prefixIcon, children: _jsx(Icon, { customColor: disabled
|
|
37
|
+
? tokens["color-disabled"]
|
|
38
|
+
: tokens["color-icon--secondary"], name: icon }) }) }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StyleProp, TextStyle } from "react-native";
|
|
3
|
+
import type { IconNames } from "@zj-dynamics/design/native";
|
|
4
|
+
export interface SuffixLabelProps {
|
|
5
|
+
readonly focused: boolean;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
readonly miniLabelActive: boolean;
|
|
8
|
+
readonly inputInvalid?: boolean;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly hasLeftMargin?: boolean;
|
|
11
|
+
readonly styleOverride?: StyleProp<TextStyle>;
|
|
12
|
+
}
|
|
13
|
+
export declare const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
|
|
14
|
+
export declare const suffixIconTestId = "ATL-InputFieldWrapper-SuffixIcon";
|
|
15
|
+
export declare function SuffixLabel({ focused, disabled, miniLabelActive, inputInvalid, label, hasLeftMargin, styleOverride, }: SuffixLabelProps): React.JSX.Element;
|
|
16
|
+
export interface SuffixIconProps {
|
|
17
|
+
readonly focused: boolean;
|
|
18
|
+
readonly disabled?: boolean;
|
|
19
|
+
readonly inputInvalid?: boolean;
|
|
20
|
+
readonly icon: IconNames;
|
|
21
|
+
readonly hasLeftMargin?: boolean;
|
|
22
|
+
readonly onPress?: () => void;
|
|
23
|
+
readonly accessibilityLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function SuffixIcon({ focused, disabled, inputInvalid, icon, hasLeftMargin, onPress, accessibilityLabel, }: SuffixIconProps): React.JSX.Element;
|