@jobber/components-native 0.84.4-match-mobi-55ef4ec.7 → 0.84.4-match-mobi-540af48.10
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/dist/package.json +26 -15
- package/dist/src/ActionItem/ActionItemGroup.js +1 -1
- package/dist/src/AutoLink/components/Link/Link.js +1 -1
- package/dist/src/Banner/Banner.js +2 -0
- package/dist/src/Banner/components/BannerIcon/BannerIcon.style.js +3 -0
- package/dist/src/BottomSheet/BottomSheet.js +58 -32
- package/dist/src/BottomSheet/BottomSheet.style.js +8 -9
- package/dist/src/BottomSheet/hooks/useBottomSheetBackHandler.js +26 -0
- package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +0 -1
- package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/src/Chip/Chip.js +12 -1
- package/dist/src/Chip/Chip.style.js +1 -1
- package/dist/src/Content/ContentHorizontal.style.js +15 -0
- package/dist/src/Content/ContentSpaceAround.style.js +15 -0
- package/dist/src/Content/ContentVertical.style.js +15 -0
- package/dist/src/ContentOverlay/ContentOverlay.js +5 -7
- package/dist/src/ContentOverlay/UNSAFE_WrappedModalize.js +23 -0
- package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
- package/dist/src/Form/Form.js +5 -2
- package/dist/src/Form/components/FormCache/FormCache.js +1 -0
- package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
- package/dist/src/Form/context/AtlantisFormContext.js +1 -0
- package/dist/src/Form/hooks/useInternalForm.js +6 -3
- package/dist/src/FormatFile/components/MediaView/MediaView.js +22 -5
- package/dist/src/FormatFile/utils/createUseCreateThumbnail.js +1 -1
- package/dist/src/InputCurrency/InputCurrency.js +42 -30
- package/dist/src/InputDate/InputDate.js +2 -2
- package/dist/src/InputEmail/InputEmail.js +12 -4
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +14 -12
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +1 -1
- package/dist/src/InputFieldWrapper/components/Prefix/Prefix.js +5 -2
- package/dist/src/InputFieldWrapper/components/Suffix/Suffix.js +5 -2
- package/dist/src/InputNumber/InputNumber.js +10 -4
- package/dist/src/InputPressable/InputPressable.js +20 -8
- package/dist/src/InputPressable/InputPressable.style.js +3 -0
- package/dist/src/InputSearch/InputSearch.js +1 -1
- package/dist/src/InputText/InputText.js +24 -13
- package/dist/src/InputText/InputText.style.js +4 -0
- package/dist/src/InputTime/InputTime.js +2 -2
- package/dist/src/Menu/Menu.js +2 -2
- package/dist/src/ProgressBar/ProgressBar.js +10 -6
- package/dist/src/ProgressBar/ProgressBarInner.js +3 -12
- package/dist/src/ProgressBar/ProgressBarStepped.js +7 -2
- package/dist/src/Select/Select.style.js +1 -0
- package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
- package/dist/src/StatusLabel/StatusLabel.style.js +2 -2
- package/dist/src/Switch/components/BaseSwitch/BaseSwitch.js +7 -1
- package/dist/src/Typography/Typography.js +16 -5
- package/dist/src/hooks/useAtlantisI18n/locales/en.json +1 -0
- package/dist/src/hooks/useAtlantisI18n/locales/es.json +1 -0
- package/dist/src/hooks/useFormController.js +6 -15
- package/dist/tsconfig.build.json +7 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.json +4 -6
- package/dist/types/src/ActionItem/ActionItem.d.ts +2 -1
- package/dist/types/src/ActionItem/ActionItemGroup.d.ts +2 -1
- package/dist/types/src/ActionItem/components/ActionItemContainer.d.ts +2 -1
- package/dist/types/src/ActionLabel/ActionLabel.d.ts +4 -3
- package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +2 -1
- package/dist/types/src/AutoLink/AutoLink.d.ts +2 -1
- package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +2 -1
- package/dist/types/src/AutoLink/components/Link/Link.d.ts +2 -1
- package/dist/types/src/Banner/Banner.d.ts +2 -1
- package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +2 -1
- package/dist/types/src/Banner/components/BannerIcon/BannerIcon.style.d.ts +3 -0
- package/dist/types/src/Banner/types.d.ts +1 -1
- package/dist/types/src/BottomSheet/BottomSheet.d.ts +7 -3
- package/dist/types/src/BottomSheet/BottomSheet.style.d.ts +7 -14
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +2 -1
- package/dist/types/src/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
- package/dist/types/src/Button/Button.d.ts +2 -1
- package/dist/types/src/Button/components/InternalButtonLoading/InternalButtonLoading.d.ts +1 -1
- package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +4 -3
- package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +3 -2
- package/dist/types/src/Card/Card.d.ts +2 -1
- package/dist/types/src/Card/components/InternalCardHeader.d.ts +2 -1
- package/dist/types/src/Checkbox/Checkbox.d.ts +2 -1
- package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/types/src/Chip/Chip.d.ts +2 -1
- package/dist/types/src/Content/Content.d.ts +3 -2
- package/dist/types/src/Content/ContentHorizontal.style.d.ts +15 -0
- package/dist/types/src/Content/ContentSpaceAround.style.d.ts +15 -0
- package/dist/types/src/Content/ContentVertical.style.d.ts +15 -0
- package/dist/types/src/ContentOverlay/ContentOverlay.d.ts +1 -1
- package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +3 -0
- package/dist/types/src/Disclosure/Disclosure.d.ts +1 -1
- package/dist/types/src/Divider/Divider.d.ts +2 -1
- package/dist/types/src/EmptyState/EmptyState.d.ts +2 -1
- package/dist/types/src/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +2 -1
- package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +2 -1
- package/dist/types/src/ErrorMessageWrapper/context/types.d.ts +1 -1
- package/dist/types/src/Flex/Flex.d.ts +2 -1
- package/dist/types/src/Form/Form.d.ts +2 -1
- package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +3 -2
- package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -2
- package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -3
- package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +2 -1
- package/dist/types/src/Form/components/FormMask/FormMask.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +2 -1
- package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +2 -1
- package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +2 -1
- package/dist/types/src/Form/context/AtlantisFormContext.d.ts +2 -1
- package/dist/types/src/Form/context/types.d.ts +5 -4
- package/dist/types/src/Form/hooks/useFormViewRefs.d.ts +2 -2
- package/dist/types/src/Form/hooks/useInternalForm.d.ts +7 -7
- package/dist/types/src/Form/types.d.ts +13 -7
- package/dist/types/src/FormField/FormField.d.ts +1 -1
- package/dist/types/src/FormatFile/FormatFile.d.ts +2 -1
- package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -1
- package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +2 -1
- package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +3 -2
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
- package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/types/src/Heading/Heading.d.ts +4 -3
- package/dist/types/src/Icon/Icon.d.ts +2 -1
- package/dist/types/src/IconButton/IconButton.d.ts +1 -1
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +2 -1
- package/dist/types/src/InputDate/InputDate.d.ts +4 -2
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +9 -2
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +1 -1
- package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +2 -1
- package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +4 -4
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +4 -4
- package/dist/types/src/InputPressable/InputPressable.d.ts +9 -1
- package/dist/types/src/InputPressable/InputPressable.style.d.ts +3 -0
- package/dist/types/src/InputSearch/InputSearch.d.ts +1 -1
- package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
- package/dist/types/src/InputText/InputText.d.ts +11 -3
- package/dist/types/src/InputText/InputText.style.d.ts +4 -0
- package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
- package/dist/types/src/InputTime/InputTime.d.ts +4 -2
- package/dist/types/src/Menu/Menu.d.ts +2 -1
- package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +2 -1
- package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +2 -1
- package/dist/types/src/Menu/types.d.ts +6 -1
- package/dist/types/src/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +5 -1
- package/dist/types/src/ProgressBar/ProgressBarStepped.d.ts +3 -1
- package/dist/types/src/ProgressBar/types.d.ts +20 -0
- package/dist/types/src/Select/Select.d.ts +3 -2
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +2 -1
- package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +2 -1
- package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +2 -1
- package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +2 -1
- package/dist/types/src/StatusLabel/StatusLabel.d.ts +2 -1
- package/dist/types/src/StatusLabel/StatusLabel.style.d.ts +1 -1
- package/dist/types/src/Switch/Switch.d.ts +2 -1
- package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +2 -1
- package/dist/types/src/Text/Text.d.ts +4 -3
- package/dist/types/src/TextList/TextList.d.ts +2 -1
- package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +2 -1
- package/dist/types/src/Toast/Toast.d.ts +2 -1
- package/dist/types/src/Typography/Typography.d.ts +3 -3
- package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
- package/package.json +26 -15
- package/src/ActionItem/ActionItem.tsx +1 -1
- package/src/ActionItem/ActionItemGroup.tsx +1 -3
- package/src/ActionItem/components/ActionItemContainer.tsx +1 -1
- package/src/ActionLabel/ActionLabel.test.tsx +12 -0
- package/src/ActionLabel/ActionLabel.tsx +3 -3
- package/src/ActionLabel/__snapshots__/ActionLabel.test.tsx.snap +66 -0
- package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
- package/src/AtlantisContext/AtlantisContext.test.tsx +1 -1
- package/src/AtlantisThemeContext/AtlantisThemeContext.test.tsx +5 -5
- package/src/AutoLink/AutoLink.test.tsx +2 -4
- package/src/AutoLink/AutoLink.tsx +1 -1
- package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +1 -1
- package/src/AutoLink/components/Link/Link.tsx +1 -5
- package/src/Banner/Banner.test.tsx +12 -0
- package/src/Banner/Banner.tsx +4 -2
- package/src/Banner/components/BannerIcon/BannerIcon.style.ts +3 -0
- package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
- package/src/Banner/types.ts +1 -1
- package/src/BottomSheet/BottomSheet.stories.tsx +128 -0
- package/src/BottomSheet/BottomSheet.style.ts +7 -14
- package/src/BottomSheet/BottomSheet.test.tsx +34 -39
- package/src/BottomSheet/BottomSheet.tsx +112 -92
- package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
- package/src/BottomSheet/hooks/useBottomSheetBackHandler.test.ts +90 -0
- package/src/BottomSheet/hooks/useBottomSheetBackHandler.ts +41 -0
- package/src/Button/Button.tsx +1 -1
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -2
- package/src/ButtonGroup/ButtonGroup.test.tsx +13 -11
- package/src/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
- package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +2 -2
- package/src/Card/Card.tsx +1 -1
- package/src/Card/components/InternalCardHeader.tsx +1 -1
- package/src/Checkbox/Checkbox.test.tsx +118 -1
- package/src/Checkbox/Checkbox.tsx +2 -2
- package/src/Checkbox/CheckboxGroup.test.tsx +3 -7
- package/src/Checkbox/CheckboxGroup.tsx +2 -2
- package/src/Chip/Chip.style.ts +1 -1
- package/src/Chip/Chip.tsx +20 -2
- package/src/Content/Content.tsx +7 -2
- package/src/Content/ContentHorizontal.style.ts +20 -0
- package/src/Content/ContentSpaceAround.style.ts +20 -0
- package/src/Content/ContentVertical.style.ts +20 -0
- package/src/ContentOverlay/ContentOverlay.test.tsx +34 -27
- package/src/ContentOverlay/ContentOverlay.tsx +7 -7
- package/src/ContentOverlay/UNSAFE_WrappedModalize.tsx +41 -0
- package/src/ContentOverlay/hooks/useKeyboardVisibility.test.ts +7 -7
- package/src/ContentOverlay/hooks/useViewLayoutHeight.test.ts +1 -1
- package/src/Disclosure/Disclosure.tsx +1 -1
- package/src/Divider/Divider.tsx +1 -1
- package/src/EmptyState/EmptyState.test.tsx +29 -42
- package/src/EmptyState/EmptyState.tsx +1 -1
- package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
- package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +3 -5
- package/src/ErrorMessageWrapper/context/types.ts +1 -1
- package/src/Flex/Flex.tsx +2 -2
- package/src/Form/Form.test.tsx +145 -2
- package/src/Form/Form.tsx +8 -1
- package/src/Form/components/FormActionBar/FormActionBar.tsx +3 -3
- package/src/Form/components/FormBody/FormBody.tsx +3 -3
- package/src/Form/components/FormCache/FormCache.tsx +5 -4
- package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
- package/src/Form/components/FormMask/FormMask.tsx +1 -1
- package/src/Form/components/FormMessage/FormMessage.test.tsx +40 -27
- package/src/Form/components/FormMessage/FormMessage.tsx +1 -1
- package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +1 -1
- package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -3
- package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +2 -2
- package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
- package/src/Form/context/AtlantisFormContext.test.tsx +1 -1
- package/src/Form/context/AtlantisFormContext.tsx +1 -0
- package/src/Form/context/types.ts +5 -4
- package/src/Form/hooks/useFormViewRefs.ts +4 -5
- package/src/Form/hooks/useInternalForm.ts +14 -6
- package/src/Form/hooks/useScrollToError/useScrollToError.test.tsx +2 -1
- package/src/Form/types.ts +14 -8
- package/src/FormField/FormField.tsx +1 -1
- package/src/FormatFile/FormatFile.test.tsx +21 -21
- package/src/FormatFile/FormatFile.tsx +3 -3
- package/src/FormatFile/components/ErrorIcon/ErrorIcon.tsx +1 -1
- package/src/FormatFile/components/FileView/FileView.tsx +1 -1
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.test.tsx +14 -14
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +2 -2
- package/src/FormatFile/components/MediaView/MediaView.test.tsx +283 -0
- package/src/FormatFile/components/MediaView/MediaView.tsx +28 -7
- package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -1
- package/src/Glimmer/Glimmer.test.tsx +2 -2
- package/src/Heading/Heading.test.tsx +13 -0
- package/src/Heading/Heading.tsx +3 -3
- package/src/Heading/__snapshots__/Heading.test.tsx.snap +65 -0
- package/src/Icon/Icon.tsx +1 -1
- package/src/Icon/__snapshots__/Icon.test.tsx.snap +7 -0
- package/src/IconButton/IconButton.tsx +1 -1
- package/src/InputCurrency/InputCurrency.tsx +72 -58
- package/src/InputDate/InputDate.tsx +7 -3
- package/src/InputEmail/InputEmail.tsx +15 -8
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +1 -1
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +48 -1
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +39 -29
- package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
- package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +8 -16
- package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +8 -6
- package/src/InputFieldWrapper/components/Suffix/Suffix.test.tsx +2 -4
- package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +8 -6
- package/src/InputNumber/InputNumber.tsx +11 -7
- package/src/InputPassword/InputPassword.tsx +1 -1
- package/src/InputPressable/InputPressable.style.ts +4 -0
- package/src/InputPressable/InputPressable.test.tsx +75 -1
- package/src/InputPressable/InputPressable.tsx +34 -8
- package/src/InputSearch/InputSearch.tsx +2 -1
- package/src/InputSearch/components/FilterButton.tsx +1 -1
- package/src/InputText/InputText.style.ts +5 -0
- package/src/InputText/InputText.test.tsx +190 -1
- package/src/InputText/InputText.tsx +37 -20
- package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
- package/src/InputTime/InputTime.tsx +7 -3
- package/src/Menu/Menu.tsx +3 -3
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
- package/src/Menu/components/Overlay/Overlay.tsx +1 -1
- package/src/Menu/types.ts +7 -1
- package/src/ProgressBar/ProgressBar.test.tsx +109 -0
- package/src/ProgressBar/ProgressBar.tsx +18 -2
- package/src/ProgressBar/ProgressBarInner.tsx +8 -11
- package/src/ProgressBar/ProgressBarStepped.tsx +12 -1
- package/src/ProgressBar/__snapshots__/ProgressBar.test.tsx.snap +14 -0
- package/src/ProgressBar/types.ts +22 -0
- package/src/Select/Select.style.ts +1 -0
- package/src/Select/Select.tsx +2 -2
- package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -1
- package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -1
- package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -1
- package/src/Select/components/SelectPressable/SelectPressable.tsx +1 -4
- package/src/StatusLabel/StatusLabel.style.ts +2 -2
- package/src/StatusLabel/StatusLabel.tsx +1 -1
- package/src/StatusLabel/__snapshots__/StatusLabel.test.tsx.snap +14 -14
- package/src/Switch/Switch.tsx +1 -1
- package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +8 -2
- package/src/Text/Text.test.tsx +10 -0
- package/src/Text/Text.tsx +3 -3
- package/src/Text/__snapshots__/Text.test.tsx.snap +66 -0
- package/src/TextList/TextList.tsx +1 -1
- package/src/ThumbnailList/ThumbnailList.test.tsx +5 -5
- package/src/ThumbnailList/ThumbnailList.tsx +1 -1
- package/src/ThumbnailList/__snapshots__/ThumbnailList.test.tsx.snap +199 -1
- package/src/Toast/Toast.tsx +2 -2
- package/src/Typography/Typography.test.tsx +61 -0
- package/src/Typography/Typography.tsx +25 -9
- package/src/Typography/TypographyGestureDetector.tsx +1 -3
- package/src/Typography/__snapshots__/Typography.test.tsx.snap +222 -0
- package/src/hooks/useAtlantisI18n/locales/en.json +1 -0
- package/src/hooks/useAtlantisI18n/locales/es.json +1 -0
- package/src/hooks/useFormController.ts +7 -14
- package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -41,9 +41,9 @@ export interface TypographyProps<T extends FontFamily> {
|
|
|
41
41
|
readonly size?: TextSize;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Text to display
|
|
44
|
+
* Text to display. Supports nesting text elements.
|
|
45
45
|
*/
|
|
46
|
-
readonly children?:
|
|
46
|
+
readonly children?: React.ReactNode;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* The maximum amount of lines the text can occupy before being truncated with "...".
|
|
@@ -174,7 +174,7 @@ function InternalTypography<T extends FontFamily = "base">({
|
|
|
174
174
|
UNSAFE_style,
|
|
175
175
|
selectable = true,
|
|
176
176
|
onTextLayout,
|
|
177
|
-
}: TypographyProps<T>)
|
|
177
|
+
}: TypographyProps<T>) {
|
|
178
178
|
const styles = useTypographyStyles();
|
|
179
179
|
const sizeAndHeight = getSizeAndHeightStyle(size, styles, lineHeight);
|
|
180
180
|
const style: StyleProp<ViewStyle>[] = [
|
|
@@ -204,7 +204,7 @@ function InternalTypography<T extends FontFamily = "base">({
|
|
|
204
204
|
|
|
205
205
|
const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
|
|
206
206
|
|
|
207
|
-
const
|
|
207
|
+
const content = transformChildren(children, transform);
|
|
208
208
|
const accessibilityProps: AccessibilityProps = hideFromScreenReader
|
|
209
209
|
? {
|
|
210
210
|
accessibilityRole: "none",
|
|
@@ -232,7 +232,7 @@ function InternalTypography<T extends FontFamily = "base">({
|
|
|
232
232
|
selectionColor={tokens["color-brand--highlight"]}
|
|
233
233
|
onTextLayout={onTextLayout}
|
|
234
234
|
>
|
|
235
|
-
{
|
|
235
|
+
{content}
|
|
236
236
|
</Text>
|
|
237
237
|
);
|
|
238
238
|
|
|
@@ -273,19 +273,35 @@ function getFontStyle(
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
function getTransformedText(text
|
|
276
|
+
function getTransformedText(text: string, transform?: TextTransform) {
|
|
277
277
|
switch (transform) {
|
|
278
278
|
case "lowercase":
|
|
279
|
-
return text
|
|
279
|
+
return text.toLocaleLowerCase();
|
|
280
280
|
case "uppercase":
|
|
281
|
-
return text
|
|
281
|
+
return text.toLocaleUpperCase();
|
|
282
282
|
case "capitalize":
|
|
283
|
-
return capitalize(text
|
|
283
|
+
return capitalize(text);
|
|
284
284
|
default:
|
|
285
285
|
return text;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
function transformChildren(
|
|
290
|
+
children: React.ReactNode,
|
|
291
|
+
transform?: TextTransform,
|
|
292
|
+
): React.ReactNode {
|
|
293
|
+
if (children == null || !transform || transform === "none") return children;
|
|
294
|
+
|
|
295
|
+
return React.Children.map(children, child => {
|
|
296
|
+
if (typeof child === "string") {
|
|
297
|
+
return getTransformedText(child, transform);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Keep non-string children (numbers, elements, fragments) unchanged
|
|
301
|
+
return child;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
289
305
|
function getColorStyle(
|
|
290
306
|
styles: ReturnType<typeof useTypographyStyles>,
|
|
291
307
|
color?: TextColor,
|
|
@@ -7,8 +7,6 @@ import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
|
7
7
|
* accidental highlighting of text in Android devices
|
|
8
8
|
* https://github.com/software-mansion/react-native-gesture-handler/issues/1372
|
|
9
9
|
*/
|
|
10
|
-
export function TypographyGestureDetector(
|
|
11
|
-
props: PropsWithChildren<unknown>,
|
|
12
|
-
): JSX.Element {
|
|
10
|
+
export function TypographyGestureDetector(props: PropsWithChildren<unknown>) {
|
|
13
11
|
return <GestureDetector {...props} gesture={Gesture.Native()} />;
|
|
14
12
|
}
|
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`allows child Typography to control its own transform 1`] = `
|
|
4
|
+
<Text
|
|
5
|
+
accessibilityRole="text"
|
|
6
|
+
adjustsFontSizeToFit={false}
|
|
7
|
+
allowFontScaling={true}
|
|
8
|
+
collapsable={false}
|
|
9
|
+
selectable={true}
|
|
10
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
11
|
+
style={
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
"fontFamily": "inter-regular",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"color": "hsl(197, 15%, 43%)",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"textAlign": "left",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"fontSize": 16,
|
|
24
|
+
"lineHeight": 20,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"letterSpacing": 0,
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
>
|
|
32
|
+
BEFORE
|
|
33
|
+
<Text
|
|
34
|
+
accessibilityRole="text"
|
|
35
|
+
adjustsFontSizeToFit={false}
|
|
36
|
+
allowFontScaling={true}
|
|
37
|
+
collapsable={false}
|
|
38
|
+
selectable={true}
|
|
39
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
40
|
+
style={
|
|
41
|
+
[
|
|
42
|
+
{
|
|
43
|
+
"fontFamily": "inter-bold",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"color": "hsl(197, 15%, 43%)",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"textAlign": "left",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"fontSize": 16,
|
|
53
|
+
"lineHeight": 20,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"letterSpacing": 0,
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
>
|
|
61
|
+
inner
|
|
62
|
+
</Text>
|
|
63
|
+
AFTER
|
|
64
|
+
</Text>
|
|
65
|
+
`;
|
|
66
|
+
|
|
3
67
|
exports[`renders text respecting the text direction 1`] = `
|
|
4
68
|
<Text
|
|
5
69
|
accessibilityRole="text"
|
|
@@ -902,6 +966,164 @@ exports[`renders text with white color 1`] = `
|
|
|
902
966
|
</Text>
|
|
903
967
|
`;
|
|
904
968
|
|
|
969
|
+
exports[`supports multi-level nesting across Typography and Text 1`] = `
|
|
970
|
+
<Text
|
|
971
|
+
accessibilityRole="text"
|
|
972
|
+
adjustsFontSizeToFit={false}
|
|
973
|
+
allowFontScaling={true}
|
|
974
|
+
collapsable={false}
|
|
975
|
+
selectable={true}
|
|
976
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
977
|
+
style={
|
|
978
|
+
[
|
|
979
|
+
{
|
|
980
|
+
"fontFamily": "inter-regular",
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"color": "hsl(197, 15%, 43%)",
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"textAlign": "left",
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"fontSize": 16,
|
|
990
|
+
"lineHeight": 20,
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"letterSpacing": 0,
|
|
994
|
+
},
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
>
|
|
998
|
+
LEVEL1
|
|
999
|
+
<Text
|
|
1000
|
+
accessibilityRole="text"
|
|
1001
|
+
adjustsFontSizeToFit={false}
|
|
1002
|
+
allowFontScaling={true}
|
|
1003
|
+
collapsable={false}
|
|
1004
|
+
selectable={true}
|
|
1005
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
1006
|
+
style={
|
|
1007
|
+
[
|
|
1008
|
+
{
|
|
1009
|
+
"fontFamily": "inter-regular",
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
"color": "hsl(197, 15%, 43%)",
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"textAlign": "left",
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"fontSize": 16,
|
|
1019
|
+
"lineHeight": 20,
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"letterSpacing": 0,
|
|
1023
|
+
},
|
|
1024
|
+
]
|
|
1025
|
+
}
|
|
1026
|
+
>
|
|
1027
|
+
and
|
|
1028
|
+
<Text
|
|
1029
|
+
accessibilityRole="text"
|
|
1030
|
+
adjustsFontSizeToFit={false}
|
|
1031
|
+
allowFontScaling={true}
|
|
1032
|
+
collapsable={false}
|
|
1033
|
+
selectable={true}
|
|
1034
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
1035
|
+
style={
|
|
1036
|
+
[
|
|
1037
|
+
{
|
|
1038
|
+
"fontFamily": "inter-regular",
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
"color": "hsl(197, 15%, 43%)",
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"textAlign": "left",
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
"fontSize": 16,
|
|
1048
|
+
"lineHeight": 20,
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
"letterSpacing": 0,
|
|
1052
|
+
},
|
|
1053
|
+
]
|
|
1054
|
+
}
|
|
1055
|
+
>
|
|
1056
|
+
inner
|
|
1057
|
+
</Text>
|
|
1058
|
+
</Text>
|
|
1059
|
+
END
|
|
1060
|
+
</Text>
|
|
1061
|
+
`;
|
|
1062
|
+
|
|
1063
|
+
exports[`supports nested children and applies transform only to string children 1`] = `
|
|
1064
|
+
<Text
|
|
1065
|
+
accessibilityRole="text"
|
|
1066
|
+
adjustsFontSizeToFit={false}
|
|
1067
|
+
allowFontScaling={true}
|
|
1068
|
+
collapsable={false}
|
|
1069
|
+
selectable={true}
|
|
1070
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
1071
|
+
style={
|
|
1072
|
+
[
|
|
1073
|
+
{
|
|
1074
|
+
"fontFamily": "inter-regular",
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
"color": "hsl(197, 15%, 43%)",
|
|
1078
|
+
},
|
|
1079
|
+
{
|
|
1080
|
+
"textAlign": "left",
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"fontSize": 16,
|
|
1084
|
+
"lineHeight": 20,
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
"letterSpacing": 0,
|
|
1088
|
+
},
|
|
1089
|
+
]
|
|
1090
|
+
}
|
|
1091
|
+
>
|
|
1092
|
+
BEFORE
|
|
1093
|
+
<Text
|
|
1094
|
+
accessibilityRole="text"
|
|
1095
|
+
adjustsFontSizeToFit={false}
|
|
1096
|
+
allowFontScaling={true}
|
|
1097
|
+
collapsable={false}
|
|
1098
|
+
selectable={true}
|
|
1099
|
+
selectionColor="hsl(86, 100%, 46%)"
|
|
1100
|
+
style={
|
|
1101
|
+
[
|
|
1102
|
+
{
|
|
1103
|
+
"fontFamily": "inter-bold",
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"color": "hsl(197, 15%, 43%)",
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"textAlign": "left",
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"fontSize": 16,
|
|
1113
|
+
"lineHeight": 20,
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"letterSpacing": 0,
|
|
1117
|
+
},
|
|
1118
|
+
]
|
|
1119
|
+
}
|
|
1120
|
+
>
|
|
1121
|
+
Inner
|
|
1122
|
+
</Text>
|
|
1123
|
+
AFTER
|
|
1124
|
+
</Text>
|
|
1125
|
+
`;
|
|
1126
|
+
|
|
905
1127
|
exports[`underline renders text with dashed underline 1`] = `
|
|
906
1128
|
<Text
|
|
907
1129
|
accessibilityRole="text"
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"goBack": "Go back",
|
|
19
19
|
"InputFieldWrapper.clear": "Clear input",
|
|
20
20
|
"InputPassword.enterPassword": "Enter a password",
|
|
21
|
+
"InputEmail.enterEmail": "Enter a valid email address (email@example.com)",
|
|
21
22
|
"loading": "Loading",
|
|
22
23
|
"menu": "Menu",
|
|
23
24
|
"more": "More",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"goBack": "Volver",
|
|
19
19
|
"InputFieldWrapper.clear": "Borrar",
|
|
20
20
|
"InputPassword.enterPassword": "Escriba una contraseña",
|
|
21
|
+
"InputEmail.enterEmail": "Introduzca una dirección de correo electrónico válida (email@example.com)",
|
|
21
22
|
"loading": "Cargando",
|
|
22
23
|
"menu": "Menú",
|
|
23
24
|
"more": "Más",
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
RegisterOptions,
|
|
5
5
|
UseControllerReturn,
|
|
6
6
|
} from "react-hook-form";
|
|
7
|
-
import { useController, useForm, useFormContext } from "react-hook-form";
|
|
7
|
+
import { get, useController, useForm, useFormContext } from "react-hook-form";
|
|
8
8
|
import { useState } from "react";
|
|
9
9
|
|
|
10
10
|
interface UseFormControllerProps<T> {
|
|
@@ -40,22 +40,15 @@ export function useFormController<T>({
|
|
|
40
40
|
name: fieldName,
|
|
41
41
|
control,
|
|
42
42
|
rules: validations,
|
|
43
|
-
defaultValue: value || undefined,
|
|
43
|
+
defaultValue: typeof value === "boolean" ? value : value || undefined,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
// The naming convention established by react-hook-form for arrays of fields is, for example, "emails.0.description".
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (fieldIdentifiers.length === 3) {
|
|
54
|
-
const [section, item, identifier] = fieldIdentifiers;
|
|
55
|
-
error = errors[section]?.[item]?.[identifier];
|
|
56
|
-
} else {
|
|
57
|
-
error = errors[fieldName];
|
|
58
|
-
}
|
|
47
|
+
// Preserve original behavior: only treat three-part names as nested paths.
|
|
48
|
+
// For anything else, perform a flat lookup to avoid behavioral changes.
|
|
49
|
+
const identifiers = fieldName.split(".");
|
|
50
|
+
const error =
|
|
51
|
+
identifiers.length === 3 ? get(errors, fieldName) : errors[fieldName];
|
|
59
52
|
|
|
60
53
|
return { error, field };
|
|
61
54
|
}
|
|
@@ -12,7 +12,7 @@ export function MockSafeAreaProvider({
|
|
|
12
12
|
frame,
|
|
13
13
|
insets,
|
|
14
14
|
children,
|
|
15
|
-
}: MockSafeAreaProviderProps)
|
|
15
|
+
}: MockSafeAreaProviderProps) {
|
|
16
16
|
const initialFrame: Rect = { x: 0, y: 0, width: 0, height: 0 };
|
|
17
17
|
const initialInsets: EdgeInsets = { bottom: 50, top: 50, left: 0, right: 0 };
|
|
18
18
|
|