@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 @@
|
|
|
1
|
+
export * from "./SelectIOSPicker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SelectIOSPicker.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { handlePress, isIOS14AndUp } from "./utils.js";
|
|
4
|
+
import { SelectIOSPicker } from "../SelectIOSPicker/index.js";
|
|
5
|
+
import { SelectPressable } from "../SelectPressable/index.js";
|
|
6
|
+
import { SelectDefaultPicker } from "../SelectDefaultPicker/index.js";
|
|
7
|
+
export function SelectInternalPicker({ children, options, disabled, onChange, }) {
|
|
8
|
+
if (disabled)
|
|
9
|
+
return _jsx(_Fragment, { children: children });
|
|
10
|
+
if (isIOS14AndUp()) {
|
|
11
|
+
return (_jsx(SelectPressable, { children: _jsx(SelectIOSPicker, { options: options, onOptionPress: handlePress(onChange), children: children }) }));
|
|
12
|
+
}
|
|
13
|
+
return (_jsx(SelectDefaultPicker, { options: options, onChange: onChange, children: children }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SelectInternalPicker.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SelectInternalPicker.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SelectInternalPickerProps, SelectOnOptionPressEvent } from "../../types.js";
|
|
2
|
+
export declare function handlePress(onChange: SelectInternalPickerProps["onChange"]): ({ nativeEvent: { event } }: SelectOnOptionPressEvent) => void;
|
|
3
|
+
export declare function isIOS14AndUp(): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
export function handlePress(onChange) {
|
|
3
|
+
return ({ nativeEvent: { event } }) => {
|
|
4
|
+
return onChange(event);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export function isIOS14AndUp() {
|
|
8
|
+
if (Platform.OS === "ios") {
|
|
9
|
+
const majorVersionIOS = parseInt(Platform.Version, 10);
|
|
10
|
+
return majorVersionIOS >= 14;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
export interface SelectItemProps {
|
|
3
|
+
/** The option's value. */
|
|
4
|
+
readonly value: string;
|
|
5
|
+
/** The option's label — rendered as the row text and used as the value label. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
/** Disables selection and greys the label. */
|
|
8
|
+
readonly disabled?: boolean;
|
|
9
|
+
/** Close the dropdown when this option is pressed (default behaviour). */
|
|
10
|
+
readonly closeOnPress?: boolean;
|
|
11
|
+
/** Leading content, before the label — typically a `Select.ItemPrefix`. */
|
|
12
|
+
readonly prefix?: ReactNode;
|
|
13
|
+
/** Trailing content, after the label — typically a `Select.ItemSuffix`. */
|
|
14
|
+
readonly suffix?: ReactNode;
|
|
15
|
+
/** Overrides the default checkmark marker shown on the selected row. */
|
|
16
|
+
readonly indicator?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An option row. Auto-composes the label + a default checkmark from its
|
|
20
|
+
* `value` / `label` / `disabled` props, and places the `prefix` / `suffix` slot
|
|
21
|
+
* content around the label (prefix → label → suffix → marker). `indicator`
|
|
22
|
+
* overrides the default checkmark; `disabled` greys the label and blocks
|
|
23
|
+
* selection.
|
|
24
|
+
*/
|
|
25
|
+
export declare function SelectItem({ value, label, disabled, closeOnPress, prefix, suffix, indicator, }: SelectItemProps): ReactElement;
|
|
26
|
+
export interface SelectItemSlotProps {
|
|
27
|
+
readonly children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/** Styled leading slot — pass to `Select.Item`'s `prefix` prop. */
|
|
30
|
+
export declare function SelectItemPrefix({ children, }: SelectItemSlotProps): ReactElement;
|
|
31
|
+
/** Styled trailing slot — pass to `Select.Item`'s `suffix` prop. */
|
|
32
|
+
export declare function SelectItemSuffix({ children, }: SelectItemSlotProps): ReactElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./SelectItem.style.js";
|
|
5
|
+
import { SelectPrimitive } from "../../primitives/Select/index.js";
|
|
6
|
+
import { Icon } from "../../../Icon.js";
|
|
7
|
+
/**
|
|
8
|
+
* An option row. Auto-composes the label + a default checkmark from its
|
|
9
|
+
* `value` / `label` / `disabled` props, and places the `prefix` / `suffix` slot
|
|
10
|
+
* content around the label (prefix → label → suffix → marker). `indicator`
|
|
11
|
+
* overrides the default checkmark; `disabled` greys the label and blocks
|
|
12
|
+
* selection.
|
|
13
|
+
*/
|
|
14
|
+
export function SelectItem({ value, label, disabled, closeOnPress, prefix, suffix, indicator, }) {
|
|
15
|
+
return (_jsxs(SelectPrimitive.Item, { value: value, label: label, ...(disabled !== undefined && { disabled: disabled }), ...(closeOnPress !== undefined && { closeOnPress: closeOnPress }), children: [prefix, _jsx(SelectPrimitive.ItemText, { ...(disabled !== undefined && { disabled: disabled }) }), suffix, _jsx(SelectPrimitive.ItemIndicator, { children: indicator ?? _jsx(Icon, { name: "checkmark" }) })] }));
|
|
16
|
+
}
|
|
17
|
+
/** Styled leading slot — pass to `Select.Item`'s `prefix` prop. */
|
|
18
|
+
export function SelectItemPrefix({ children, }) {
|
|
19
|
+
const styles = useStyles();
|
|
20
|
+
return _jsx(View, { style: styles.slot, children: children });
|
|
21
|
+
}
|
|
22
|
+
/** Styled trailing slot — pass to `Select.Item`'s `suffix` prop. */
|
|
23
|
+
export function SelectItemSuffix({ children, }) {
|
|
24
|
+
const styles = useStyles();
|
|
25
|
+
return _jsx(View, { style: styles.slot, children: children });
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
export interface SelectLabelProps {
|
|
3
|
+
/**
|
|
4
|
+
* The label content. Its placement (above the trigger vs. inside it) is set by
|
|
5
|
+
* the `labelPlacement` prop on `Select.Root`, not by where this is written.
|
|
6
|
+
*/
|
|
7
|
+
readonly children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The field label. Rather than render in place, it **registers** its `children`
|
|
11
|
+
* (and, when a string, the trigger's accessible name) into `Select.Root`, which
|
|
12
|
+
* renders the content in the slot `labelPlacement` selects. Renders nothing where
|
|
13
|
+
* it is composed. See `Select.guide.md`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function SelectLabel({ children }: SelectLabelProps): null;
|
|
16
|
+
/**
|
|
17
|
+
* Internal renderer for the registered label content, shared by the above slot
|
|
18
|
+
* (`Select.Root`) and the inside slot (`Select.Trigger`). Sizes itself from
|
|
19
|
+
* `labelPlacement` (smaller when `inside`). Hidden from assistive tech — the
|
|
20
|
+
* trigger carries the accessible name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function FieldLabel(): ReactElement | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useLayoutEffect } from "react";
|
|
3
|
+
import { useSelectFieldState } from "./SelectFieldContext.js";
|
|
4
|
+
import { Text } from "../../Text/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* The field label. Rather than render in place, it **registers** its `children`
|
|
7
|
+
* (and, when a string, the trigger's accessible name) into `Select.Root`, which
|
|
8
|
+
* renders the content in the slot `labelPlacement` selects. Renders nothing where
|
|
9
|
+
* it is composed. See `Select.guide.md`.
|
|
10
|
+
*/
|
|
11
|
+
export function SelectLabel({ children }) {
|
|
12
|
+
const { registerLabel, unregisterLabel } = useSelectFieldState();
|
|
13
|
+
useLayoutEffect(() => {
|
|
14
|
+
registerLabel(children, typeof children === "string" ? children : undefined);
|
|
15
|
+
return unregisterLabel;
|
|
16
|
+
}, [children, registerLabel, unregisterLabel]);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Internal renderer for the registered label content, shared by the above slot
|
|
21
|
+
* (`Select.Root`) and the inside slot (`Select.Trigger`). Sizes itself from
|
|
22
|
+
* `labelPlacement` (smaller when `inside`). Hidden from assistive tech — the
|
|
23
|
+
* trigger carries the accessible name.
|
|
24
|
+
*/
|
|
25
|
+
export function FieldLabel() {
|
|
26
|
+
const { labelContent, labelPlacement } = useSelectFieldState();
|
|
27
|
+
if (labelContent == null)
|
|
28
|
+
return null;
|
|
29
|
+
return typeof labelContent === "string" ? (_jsx(Text, { variation: "subdued", ...(labelPlacement === "inside" && { level: "textSupporting" }), maxLines: "single", hideFromScreenReader: true, children: labelContent })) : (_jsx(_Fragment, { children: labelContent }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PressableProps } from "react-native";
|
|
3
|
+
import type { SelectInternalPickerProps } from "../../types.js";
|
|
4
|
+
type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> & Pick<PressableProps, "onPress">;
|
|
5
|
+
/**
|
|
6
|
+
* Switches between Pressable with pressed styling and a fragment when a
|
|
7
|
+
* screen-reader is being used to avoid screen-readers from ignoring the press
|
|
8
|
+
* on the MenuView
|
|
9
|
+
*/
|
|
10
|
+
export declare function SelectPressable({ children, onPress }: SelectPressableProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Keyboard, Pressable } from "react-native";
|
|
4
|
+
import { useStyles } from "./SelectPressable.style.js";
|
|
5
|
+
import { useIsScreenReaderEnabled } from "../../../../useIsScreenReaderEnabled.js";
|
|
6
|
+
/**
|
|
7
|
+
* Switches between Pressable with pressed styling and a fragment when a
|
|
8
|
+
* screen-reader is being used to avoid screen-readers from ignoring the press
|
|
9
|
+
* on the MenuView
|
|
10
|
+
*/
|
|
11
|
+
export function SelectPressable({ children, onPress }) {
|
|
12
|
+
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
13
|
+
const styles = useStyles();
|
|
14
|
+
if (isScreenReaderEnabled)
|
|
15
|
+
return _jsx(_Fragment, { children: children });
|
|
16
|
+
return (_jsx(Pressable, { style: ({ pressed }) => [pressed && styles.pressed], onPressIn: Keyboard.dismiss, onPress: onPress, children: children }));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SelectPressable.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SelectPressable.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, Ref } from "react";
|
|
2
|
+
import type { TriggerRef } from "../../primitives/Select/nativeTypes.js";
|
|
3
|
+
export interface SelectTriggerProps {
|
|
4
|
+
/** Trigger content — typically `Select.Value` (and optionally a label part). */
|
|
5
|
+
readonly children?: ReactNode;
|
|
6
|
+
/** Used verbatim to locate the trigger in end-to-end tests. Defaults to `ATL-Select-Trigger`. */
|
|
7
|
+
readonly testID?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Imperative handle exposing `open()` / `close()`. Stays `null` when the field
|
|
10
|
+
* is `readOnly` (no interactive trigger is mounted).
|
|
11
|
+
*/
|
|
12
|
+
readonly ref?: Ref<TriggerRef>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The styled field trigger: composes the chevron, the resolved `invalid` styling,
|
|
16
|
+
* the accessible name, the inside label placement, and the static `readOnly`
|
|
17
|
+
* presentation over `SelectPrimitive.Trigger`. State comes from `Select.Root`
|
|
18
|
+
* (field context) and the primitive root context.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SelectTrigger({ children, testID, ref, }: SelectTriggerProps): ReactElement;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Keyboard, View } from "react-native";
|
|
4
|
+
import { useRootContext } from "@rn-primitives/select/dist/select";
|
|
5
|
+
import { useStyles } from "./SelectTrigger.style.js";
|
|
6
|
+
import { useSelectFieldState } from "./SelectFieldContext.js";
|
|
7
|
+
import { FieldLabel } from "./SelectLabel.js";
|
|
8
|
+
import { SELECT_TRIGGER_DEFAULT_TEST_ID, SelectPrimitive, } from "../../primitives/Select/index.js";
|
|
9
|
+
import { Icon } from "../../../Icon.js";
|
|
10
|
+
/**
|
|
11
|
+
* The styled field trigger: composes the chevron, the resolved `invalid` styling,
|
|
12
|
+
* the accessible name, the inside label placement, and the static `readOnly`
|
|
13
|
+
* presentation over `SelectPrimitive.Trigger`. State comes from `Select.Root`
|
|
14
|
+
* (field context) and the primitive root context.
|
|
15
|
+
*/
|
|
16
|
+
export function SelectTrigger({ children, testID, ref, }) {
|
|
17
|
+
const styles = useStyles();
|
|
18
|
+
const { invalid, readOnly, accessibilityLabel, labelPlacement, labelContent, } = useSelectFieldState();
|
|
19
|
+
const { open, value, disabled } = useRootContext();
|
|
20
|
+
const isDisabled = disabled ?? false;
|
|
21
|
+
// `disabled` wins over `readOnly`.
|
|
22
|
+
const isReadOnly = !isDisabled && (readOnly ?? false);
|
|
23
|
+
const isInsideLabel = labelPlacement === "inside" && labelContent != null;
|
|
24
|
+
const content = (_jsxs(View, { style: [
|
|
25
|
+
styles.content,
|
|
26
|
+
isInsideLabel ? styles.contentInside : styles.contentWithoutLabel,
|
|
27
|
+
], children: [isInsideLabel && _jsx(FieldLabel, {}), children] }));
|
|
28
|
+
if (isReadOnly) {
|
|
29
|
+
return (_jsx(View, { testID: testID ?? SELECT_TRIGGER_DEFAULT_TEST_ID, accessible: true, ...(accessibilityLabel !== undefined && { accessibilityLabel: accessibilityLabel }), accessibilityValue: value?.label ? { text: value.label } : undefined, style: styles.readOnly, children: content }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs(SelectPrimitive.Trigger, { ...(ref !== undefined && { ref: ref }), ...(testID !== undefined && { testID: testID }), ...(invalid !== undefined && { invalid: invalid }), ...(accessibilityLabel !== undefined && { accessibilityLabel: accessibilityLabel }),
|
|
32
|
+
// Dismiss any open keyboard so it doesn't cover the dropdown (matches the
|
|
33
|
+
// native picker's on-device behaviour; rn-primitives doesn't do this).
|
|
34
|
+
onPressIn: () => Keyboard.dismiss(), children: [content, _jsx(Chevron, { open: open, disabled: isDisabled })] }));
|
|
35
|
+
}
|
|
36
|
+
/** Trailing chevron: tinted `iconSecondary`, greyed when disabled, rotated when open. */
|
|
37
|
+
function Chevron({ open, disabled, }) {
|
|
38
|
+
return (_jsx(View, { style: { transform: [{ rotate: open ? "180deg" : "0deg" }] }, children: _jsx(Icon, { name: "arrowDown", color: disabled ? "disabled" : "iconSecondary" }) }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
content: {
|
|
3
|
+
flex: number;
|
|
4
|
+
justifyContent: "center";
|
|
5
|
+
};
|
|
6
|
+
contentWithoutLabel: {
|
|
7
|
+
flexDirection: "row";
|
|
8
|
+
alignItems: "center";
|
|
9
|
+
};
|
|
10
|
+
contentInside: {
|
|
11
|
+
paddingTop: number;
|
|
12
|
+
};
|
|
13
|
+
readOnly: {
|
|
14
|
+
flexDirection: "row";
|
|
15
|
+
alignItems: "center";
|
|
16
|
+
gap: number;
|
|
17
|
+
minHeight: number;
|
|
18
|
+
paddingLeft: number;
|
|
19
|
+
paddingRight: number;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
borderWidth: number;
|
|
22
|
+
borderColor: string;
|
|
23
|
+
borderRadius: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../../compatTheme.js";
|
|
2
|
+
export const useStyles = buildThemedStyles(tokens => ({
|
|
3
|
+
content: {
|
|
4
|
+
flex: 1,
|
|
5
|
+
justifyContent: "center",
|
|
6
|
+
},
|
|
7
|
+
// Keep the Value's flex horizontal when there is no label to stack above it.
|
|
8
|
+
contentWithoutLabel: {
|
|
9
|
+
flexDirection: "row",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
},
|
|
12
|
+
// Inside-label placement: the Value's flex fills the column vertically and
|
|
13
|
+
// would otherwise pin the label flush to the top. This top inset gives the
|
|
14
|
+
// label the same breathing room as the shared input chrome's mini-label.
|
|
15
|
+
contentInside: {
|
|
16
|
+
paddingTop: tokens["space-small"] - tokens["space-smallest"],
|
|
17
|
+
},
|
|
18
|
+
// Static read-only surface — mirrors the trigger shape with a subtle fill, no chevron.
|
|
19
|
+
readOnly: {
|
|
20
|
+
flexDirection: "row",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
gap: tokens["space-small"],
|
|
23
|
+
minHeight: tokens["space-largest"] + tokens["space-small"],
|
|
24
|
+
paddingLeft: tokens["space-base"],
|
|
25
|
+
paddingRight: tokens["space-small"],
|
|
26
|
+
backgroundColor: tokens["color-surface--background--subtle"],
|
|
27
|
+
borderWidth: tokens["border-base"],
|
|
28
|
+
borderColor: tokens["color-border"],
|
|
29
|
+
borderRadius: tokens["radius-base"],
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// The composable `Select.*` parts are attached as statics on the `Select`
|
|
2
|
+
// function declaration in `Select.tsx` (docgen-visible), not assembled here.
|
|
3
|
+
export { Select, Option } from "./Select.js";
|
|
4
|
+
export { SelectPressable } from "./components/SelectPressable/index.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SelectInternalPickerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Tapping the children opens the picker
|
|
5
|
+
*/
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The list of options that user can choose from
|
|
9
|
+
*/
|
|
10
|
+
readonly options: SelectInternalPickerOption[];
|
|
11
|
+
/**
|
|
12
|
+
* Prevents the menu from opening
|
|
13
|
+
*/
|
|
14
|
+
readonly disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Callback to fire when an option is pressed
|
|
17
|
+
*/
|
|
18
|
+
readonly onChange: (value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface SelectInternalPickerOption {
|
|
21
|
+
/**
|
|
22
|
+
* The value that gets returned whenever the option is selected
|
|
23
|
+
*/
|
|
24
|
+
readonly value: string;
|
|
25
|
+
/**
|
|
26
|
+
* What the user chooses on the UI
|
|
27
|
+
*/
|
|
28
|
+
readonly label: string;
|
|
29
|
+
/**
|
|
30
|
+
* Determines if the option is selected or not
|
|
31
|
+
*/
|
|
32
|
+
readonly isActive?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface SelectOnOptionPressEvent {
|
|
35
|
+
readonly nativeEvent: {
|
|
36
|
+
readonly event: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type StatusType = "success" | "warning" | "critical" | "inactive" | "informative";
|
|
3
|
+
export interface StatusLabelType {
|
|
4
|
+
readonly statusLabel: string;
|
|
5
|
+
readonly statusType?: StatusType;
|
|
6
|
+
}
|
|
7
|
+
interface StatusLabelProps {
|
|
8
|
+
/**
|
|
9
|
+
* Text to display.
|
|
10
|
+
*/
|
|
11
|
+
readonly text: string;
|
|
12
|
+
/**
|
|
13
|
+
* Alignment of text
|
|
14
|
+
*/
|
|
15
|
+
readonly alignment?: "start" | "end";
|
|
16
|
+
/**
|
|
17
|
+
* Status color of the square beside text
|
|
18
|
+
*/
|
|
19
|
+
readonly status?: StatusType;
|
|
20
|
+
}
|
|
21
|
+
export declare function StatusLabel({ text, alignment, status, }: StatusLabelProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { useStyles } from "./StatusLabel.style.js";
|
|
5
|
+
import { Text } from "../Text/index.js";
|
|
6
|
+
import { useLegacyTheme } from "../compatTheme.js";
|
|
7
|
+
export function StatusLabel({ text, alignment = "end", status = "success", }) {
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
return (_jsxs(View, { style: [
|
|
10
|
+
styles.statusLabelRow,
|
|
11
|
+
alignment === "start" && styles.labelTextStartAligned,
|
|
12
|
+
], children: [_jsx(View, { style: styles.statusLabelText, children: _jsx(Text, { align: alignment, level: "textSupporting", variation: "subdued", children: text }) }), _jsx(View, { style: styles.innerPad }), _jsx(StatusLabelIcon, { status: status, styles: styles })] }));
|
|
13
|
+
}
|
|
14
|
+
function StatusLabelIcon({ status, styles }) {
|
|
15
|
+
const { tokens } = useLegacyTheme();
|
|
16
|
+
return (_jsx(View, { testID: `${status}LabelIcon`, style: [
|
|
17
|
+
styles.statusLabelIcon,
|
|
18
|
+
{ backgroundColor: tokens[`color-${status}`] },
|
|
19
|
+
] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
statusLabelRow: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
justifyContent: "flex-end";
|
|
5
|
+
flexWrap: "nowrap";
|
|
6
|
+
};
|
|
7
|
+
statusLabelText: {
|
|
8
|
+
flexShrink: number;
|
|
9
|
+
};
|
|
10
|
+
statusLabelIcon: {
|
|
11
|
+
borderRadius: number;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
marginTop: number;
|
|
16
|
+
};
|
|
17
|
+
labelTextStartAligned: {
|
|
18
|
+
flexDirection: "row-reverse";
|
|
19
|
+
};
|
|
20
|
+
innerPad: {
|
|
21
|
+
width: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { buildThemedStyles } from "../compatTheme.js";
|
|
2
|
+
const statusLabelRadius = 3; // Needs to be hardcoded to 3 as this shouldn't change with the tokens
|
|
3
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
4
|
+
const statusLabelIconDiameter = tokens["space-base"] - tokens["space-smaller"]; //12px
|
|
5
|
+
const indicatorOffset = tokens["space-smallest"] + tokens["space-minuscule"];
|
|
6
|
+
return {
|
|
7
|
+
statusLabelRow: {
|
|
8
|
+
flexDirection: "row",
|
|
9
|
+
justifyContent: "flex-end",
|
|
10
|
+
flexWrap: "nowrap",
|
|
11
|
+
},
|
|
12
|
+
statusLabelText: {
|
|
13
|
+
flexShrink: 1,
|
|
14
|
+
},
|
|
15
|
+
statusLabelIcon: {
|
|
16
|
+
borderRadius: statusLabelRadius,
|
|
17
|
+
backgroundColor: tokens["color-success"],
|
|
18
|
+
width: statusLabelIconDiameter,
|
|
19
|
+
height: statusLabelIconDiameter,
|
|
20
|
+
marginTop: indicatorOffset,
|
|
21
|
+
},
|
|
22
|
+
labelTextStartAligned: {
|
|
23
|
+
flexDirection: "row-reverse",
|
|
24
|
+
},
|
|
25
|
+
innerPad: {
|
|
26
|
+
width: tokens["space-small"],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusLabel } from "./StatusLabel.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { OnTextLayoutEvent, TextAlign, TextVariation, TruncateLength, TypographyProps } from "../Typography/index.js";
|
|
3
|
+
import type { TypographyUnsafeStyle } from "../Typography/Typography.js";
|
|
4
|
+
export interface TextProps extends Pick<TypographyProps<"base">, "maxFontScaleSize" | "selectable"> {
|
|
5
|
+
/**
|
|
6
|
+
* Visual hierarchy of the text
|
|
7
|
+
*/
|
|
8
|
+
readonly level?: TextLevel;
|
|
9
|
+
/**
|
|
10
|
+
* Color variation of text
|
|
11
|
+
*/
|
|
12
|
+
readonly variation?: TextVariation;
|
|
13
|
+
/**
|
|
14
|
+
* Change the appearance of the text
|
|
15
|
+
*/
|
|
16
|
+
readonly emphasis?: "strong" | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Allow text to be resized based on user's device display scale
|
|
19
|
+
*/
|
|
20
|
+
readonly allowFontScaling?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether text should be scaled down to fit based on maxLines prop
|
|
23
|
+
*/
|
|
24
|
+
readonly adjustsFontSizeToFit?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The maximum amount of lines the text can occupy before being truncated with "...".
|
|
27
|
+
* Uses predefined string values that correspond to a doubling scale for the amount of lines.
|
|
28
|
+
*/
|
|
29
|
+
readonly maxLines?: TruncateLength;
|
|
30
|
+
/**
|
|
31
|
+
* Alignment of text
|
|
32
|
+
*/
|
|
33
|
+
readonly align?: TextAlign;
|
|
34
|
+
/**
|
|
35
|
+
* Text to display. Supports nesting text elements.
|
|
36
|
+
*/
|
|
37
|
+
readonly children?: React.ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Reverse theme for better display on dark background
|
|
40
|
+
*/
|
|
41
|
+
readonly reverseTheme?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Have text styled with strike through
|
|
44
|
+
*/
|
|
45
|
+
readonly strikeThrough?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Use italic font style
|
|
48
|
+
*/
|
|
49
|
+
readonly italic?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Underline style to use for the text. The non-solid style is only supported
|
|
52
|
+
* on iOS, as per React Native's Text component's limitations.
|
|
53
|
+
* https://reactnative.dev/docs/text-style-props#textdecorationstyle-ios
|
|
54
|
+
*/
|
|
55
|
+
readonly underline?: "solid" | "dotted";
|
|
56
|
+
/**
|
|
57
|
+
* This will make the text inaccessible to the screen reader.
|
|
58
|
+
* This should be avoided unless there is a good reason.
|
|
59
|
+
* For example this is used in InputText to make it so the label isn't
|
|
60
|
+
* selectable because it is already read from the accessibilityLabel
|
|
61
|
+
* of the TextInput
|
|
62
|
+
*/
|
|
63
|
+
readonly hideFromScreenReader?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* **Use at your own risk:** Custom style for specific elements. This should only be used as a
|
|
66
|
+
* **last resort**. Using this may result in unexpected side effects.
|
|
67
|
+
*/
|
|
68
|
+
readonly UNSAFE_style?: TypographyUnsafeStyle;
|
|
69
|
+
/**
|
|
70
|
+
* Callback that is called when the text is laid out.
|
|
71
|
+
*/
|
|
72
|
+
readonly onTextLayout?: OnTextLayoutEvent;
|
|
73
|
+
}
|
|
74
|
+
export type TextLevel = "text" | "textSupporting";
|
|
75
|
+
export declare const TEXT_MAX_SCALED_FONT_SIZES: Record<TextLevel, number>;
|
|
76
|
+
export declare function Text({ level, variation, emphasis, allowFontScaling, adjustsFontSizeToFit, maxLines, align, children, reverseTheme, strikeThrough, italic, hideFromScreenReader, maxFontScaleSize, UNSAFE_style, underline, selectable, onTextLayout, }: TextProps): React.JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const levelStyles = {
|
|
6
|
+
text: {
|
|
7
|
+
size: "default",
|
|
8
|
+
lineHeight: "base",
|
|
9
|
+
},
|
|
10
|
+
textSupporting: {
|
|
11
|
+
size: "small",
|
|
12
|
+
lineHeight: "tight",
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const MAX_TEXT_FONT_SIZE_SCALE = 50;
|
|
16
|
+
export const TEXT_MAX_SCALED_FONT_SIZES = {
|
|
17
|
+
text: MAX_TEXT_FONT_SIZE_SCALE,
|
|
18
|
+
textSupporting: tokens["typography--fontSize-base"],
|
|
19
|
+
};
|
|
20
|
+
export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, UNSAFE_style, underline, selectable, onTextLayout, }) {
|
|
21
|
+
const accessibilityRole = "text";
|
|
22
|
+
return (_jsx(Typography, { color: variation, ...(UNSAFE_style !== undefined && { UNSAFE_style }), fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], ...(selectable !== undefined && { selectable }), ...(underline !== undefined && { underline }), ...(onTextLayout !== undefined && { onTextLayout }), ...levelStyles[level],
|
|
23
|
+
allowFontScaling,
|
|
24
|
+
...(align !== undefined && { align }),
|
|
25
|
+
adjustsFontSizeToFit,
|
|
26
|
+
accessibilityRole,
|
|
27
|
+
reverseTheme,
|
|
28
|
+
maxLines,
|
|
29
|
+
strikeThrough,
|
|
30
|
+
italic,
|
|
31
|
+
hideFromScreenReader, children: children }));
|
|
32
|
+
}
|
|
33
|
+
function getFontWeight({ level, emphasis, }) {
|
|
34
|
+
if (emphasis === "strong")
|
|
35
|
+
return "semiBold";
|
|
36
|
+
if (level === "textSupporting")
|
|
37
|
+
return "medium";
|
|
38
|
+
return "regular";
|
|
39
|
+
}
|