@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
|
@@ -8,10 +8,9 @@ import React, {
|
|
|
8
8
|
useState,
|
|
9
9
|
} from "react";
|
|
10
10
|
import type {
|
|
11
|
-
|
|
11
|
+
FocusEvent,
|
|
12
12
|
ReturnKeyTypeOptions,
|
|
13
13
|
StyleProp,
|
|
14
|
-
TextInputFocusEventData,
|
|
15
14
|
TextInputProps,
|
|
16
15
|
TextStyle,
|
|
17
16
|
} from "react-native";
|
|
@@ -66,6 +65,15 @@ export interface InputTextProps
|
|
|
66
65
|
*/
|
|
67
66
|
readonly assistiveText?: string;
|
|
68
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Controls the visibility of the mini label that appears inside the input
|
|
70
|
+
* when a value is entered. By default, the placeholder text moves up to
|
|
71
|
+
* become a mini label. Set to false to disable this behavior.
|
|
72
|
+
*
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
readonly showMiniLabel?: boolean;
|
|
76
|
+
|
|
69
77
|
/**
|
|
70
78
|
* Determines what keyboard is shown
|
|
71
79
|
*/
|
|
@@ -113,14 +121,12 @@ export interface InputTextProps
|
|
|
113
121
|
* Callback that is called when the text input is focused
|
|
114
122
|
* @param event
|
|
115
123
|
*/
|
|
116
|
-
readonly onFocus?: (
|
|
117
|
-
event?: NativeSyntheticEvent<TextInputFocusEventData>,
|
|
118
|
-
) => void;
|
|
124
|
+
readonly onFocus?: (event?: FocusEvent) => void;
|
|
119
125
|
|
|
120
126
|
/**
|
|
121
127
|
* Callback that is called when the text input is blurred
|
|
122
128
|
*/
|
|
123
|
-
readonly onBlur?: () => void;
|
|
129
|
+
readonly onBlur?: (event?: FocusEvent) => void;
|
|
124
130
|
|
|
125
131
|
/**
|
|
126
132
|
* VoiceOver will read this string when a user selects the associated element
|
|
@@ -248,6 +254,7 @@ function InputTextInternal(
|
|
|
248
254
|
name,
|
|
249
255
|
placeholder,
|
|
250
256
|
assistiveText,
|
|
257
|
+
showMiniLabel = true,
|
|
251
258
|
keyboard,
|
|
252
259
|
value: controlledValue,
|
|
253
260
|
defaultValue,
|
|
@@ -295,7 +302,8 @@ function InputTextInternal(
|
|
|
295
302
|
|
|
296
303
|
const hasValue = internalValue !== "" && internalValue !== undefined;
|
|
297
304
|
const [focused, setFocused] = useState(false);
|
|
298
|
-
const
|
|
305
|
+
const placeholderMode = getPlaceholderMode(showMiniLabel, internalValue);
|
|
306
|
+
const miniLabelActive = placeholderMode === "mini";
|
|
299
307
|
|
|
300
308
|
const textInputRef = useTextInputRef({ ref, onClear: handleClear });
|
|
301
309
|
|
|
@@ -370,7 +378,7 @@ function InputTextInternal(
|
|
|
370
378
|
prefix={prefix}
|
|
371
379
|
suffix={suffix}
|
|
372
380
|
hasValue={hasValue}
|
|
373
|
-
|
|
381
|
+
placeholderMode={placeholderMode}
|
|
374
382
|
assistiveText={assistiveText}
|
|
375
383
|
focused={focused}
|
|
376
384
|
error={error}
|
|
@@ -394,11 +402,14 @@ function InputTextInternal(
|
|
|
394
402
|
style={[
|
|
395
403
|
commonInputStyles.input,
|
|
396
404
|
styles.inputPaddingTop,
|
|
397
|
-
!
|
|
405
|
+
!miniLabelActive && commonInputStyles.inputEmpty,
|
|
398
406
|
disabled && commonInputStyles.inputDisabled,
|
|
399
407
|
multiline && styles.multiLineInput,
|
|
400
408
|
multiline && Platform.OS === "ios" && styles.multilineInputiOS,
|
|
401
|
-
multiline &&
|
|
409
|
+
multiline && miniLabelActive && styles.multiLineInputWithMini,
|
|
410
|
+
multiline &&
|
|
411
|
+
placeholderMode === "hidden" &&
|
|
412
|
+
styles.multilineWithoutMiniLabel,
|
|
402
413
|
styleOverride?.inputText,
|
|
403
414
|
loading && loadingType === "glimmer" && { color: "transparent" },
|
|
404
415
|
]}
|
|
@@ -425,10 +436,10 @@ function InputTextInternal(
|
|
|
425
436
|
setFocused(true);
|
|
426
437
|
onFocus?.(event);
|
|
427
438
|
}}
|
|
428
|
-
onBlur={
|
|
439
|
+
onBlur={event => {
|
|
429
440
|
_name && setFocusedInput("");
|
|
430
441
|
setFocused(false);
|
|
431
|
-
onBlur?.();
|
|
442
|
+
onBlur?.(event);
|
|
432
443
|
field.onBlur();
|
|
433
444
|
trimWhitespace(inputTransform(field.value), updateFormAndState);
|
|
434
445
|
}}
|
|
@@ -513,13 +524,19 @@ function useTextInputRef({ ref, onClear }: UseTextInputRefProps) {
|
|
|
513
524
|
return textInputRef;
|
|
514
525
|
}
|
|
515
526
|
|
|
516
|
-
function
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
setHasMiniLabel(Boolean(internalValue));
|
|
522
|
-
}, [internalValue]);
|
|
527
|
+
function getPlaceholderMode(
|
|
528
|
+
isMiniLabelAllowed: boolean,
|
|
529
|
+
internalValue: string,
|
|
530
|
+
): InputFieldWrapperProps["placeholderMode"] {
|
|
531
|
+
const hasValue = Boolean(internalValue);
|
|
523
532
|
|
|
524
|
-
|
|
533
|
+
if (hasValue) {
|
|
534
|
+
if (isMiniLabelAllowed) {
|
|
535
|
+
return "mini";
|
|
536
|
+
} else {
|
|
537
|
+
return "hidden";
|
|
538
|
+
}
|
|
539
|
+
} else {
|
|
540
|
+
return "normal";
|
|
541
|
+
}
|
|
525
542
|
}
|
|
@@ -11,9 +11,11 @@ import { InputPressable } from "../InputPressable";
|
|
|
11
11
|
import { FormField } from "../FormField";
|
|
12
12
|
import type { InputFieldWrapperProps } from "../InputFieldWrapper";
|
|
13
13
|
import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
|
|
14
|
+
import type { InputPressableProps } from "../InputPressable/InputPressable";
|
|
14
15
|
|
|
15
16
|
interface InputTimeBaseProps
|
|
16
|
-
extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder"
|
|
17
|
+
extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">,
|
|
18
|
+
Pick<InputPressableProps, "showMiniLabel"> {
|
|
17
19
|
/**
|
|
18
20
|
* Defaulted to "always" so user can clear the time whenever there's a value.
|
|
19
21
|
*/
|
|
@@ -97,7 +99,7 @@ function formatInvalidState(
|
|
|
97
99
|
return Boolean(error);
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
export function InputTime(props: InputTimeProps)
|
|
102
|
+
export function InputTime(props: InputTimeProps) {
|
|
101
103
|
if (props.name) {
|
|
102
104
|
return (
|
|
103
105
|
<FormField name={props.name} validations={props.validations}>
|
|
@@ -129,9 +131,10 @@ function InternalInputTime({
|
|
|
129
131
|
value,
|
|
130
132
|
name,
|
|
131
133
|
type = "scheduling",
|
|
134
|
+
showMiniLabel = true,
|
|
132
135
|
onChange,
|
|
133
136
|
showIcon = true,
|
|
134
|
-
}: InputTimeProps)
|
|
137
|
+
}: InputTimeProps) {
|
|
135
138
|
const [showPicker, setShowPicker] = useState(false);
|
|
136
139
|
const { t, formatTime } = useAtlantisI18n();
|
|
137
140
|
const { timeZone, timeFormat } = useAtlantisContext();
|
|
@@ -156,6 +159,7 @@ function InternalInputTime({
|
|
|
156
159
|
return (
|
|
157
160
|
<View style={styles.container}>
|
|
158
161
|
<InputPressable
|
|
162
|
+
showMiniLabel={showMiniLabel}
|
|
159
163
|
clearable={canClearTime}
|
|
160
164
|
disabled={disabled}
|
|
161
165
|
invalid={invalid}
|
package/src/Menu/Menu.tsx
CHANGED
|
@@ -20,11 +20,11 @@ import { useAtlantisContext } from "../AtlantisContext";
|
|
|
20
20
|
import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
|
|
21
21
|
import { useAtlantisTheme } from "../AtlantisThemeContext";
|
|
22
22
|
|
|
23
|
-
export function Menu({ menuOptions, customActivator }: MenuProps)
|
|
23
|
+
export function Menu({ menuOptions, customActivator }: MenuProps) {
|
|
24
24
|
const [open, setOpen] = useState<boolean>(false);
|
|
25
25
|
const [menuPosition, setMenuPosition] = useState<object>();
|
|
26
|
-
const activatorLayout = useRef<LayoutRectangle>();
|
|
27
|
-
const menuButtonRef = useRef<View
|
|
26
|
+
const activatorLayout = useRef<LayoutRectangle>(null);
|
|
27
|
+
const menuButtonRef = useRef<View>(null);
|
|
28
28
|
const screenInfo = useScreenInformation();
|
|
29
29
|
|
|
30
30
|
const { t } = useAtlantisI18n();
|
|
@@ -17,7 +17,7 @@ export function MenuOption({
|
|
|
17
17
|
textTransform = "capitalize",
|
|
18
18
|
onPress,
|
|
19
19
|
setOpen,
|
|
20
|
-
}: MenuOptionInternalProps)
|
|
20
|
+
}: MenuOptionInternalProps) {
|
|
21
21
|
const destructiveColor = "destructive";
|
|
22
22
|
const textVariation = destructive ? destructiveColor : "heading";
|
|
23
23
|
const styles = useStyles();
|
|
@@ -3,7 +3,7 @@ import { Pressable, View } from "react-native";
|
|
|
3
3
|
import { useStyles } from "./Overlay.style";
|
|
4
4
|
import type { OverlayProp } from "../../types";
|
|
5
5
|
|
|
6
|
-
export function Overlay({ setOpen }: OverlayProp)
|
|
6
|
+
export function Overlay({ setOpen }: OverlayProp) {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
|
|
9
9
|
return (
|
package/src/Menu/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
1
2
|
import type { IconColorNames, IconNames } from "@jobber/design";
|
|
2
3
|
import type { TextAlign } from "../Typography";
|
|
3
4
|
|
|
@@ -15,9 +16,14 @@ export interface MenuOptionInternalProps extends MenuOptionProps {
|
|
|
15
16
|
setOpen: (bool: boolean) => void;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
export interface CustomActivatorProps {
|
|
20
|
+
readonly onPress?: () => void;
|
|
21
|
+
readonly onLongPress?: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
export interface MenuProps {
|
|
19
25
|
readonly menuOptions?: MenuOptionProps[];
|
|
20
|
-
readonly customActivator?:
|
|
26
|
+
readonly customActivator?: ReactElement<CustomActivatorProps>;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export interface OverlayProp {
|
|
@@ -65,3 +65,112 @@ describe("with stepped variation", () => {
|
|
|
65
65
|
expect(stepElements).toHaveLength(1);
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
|
+
|
|
69
|
+
describe("ProgressBar (native) - UNSAFE_style", () => {
|
|
70
|
+
it("applies UNSAFE_style.container to the outer wrapper", () => {
|
|
71
|
+
const containerStyle = { padding: 12, backgroundColor: "papayawhip" };
|
|
72
|
+
render(
|
|
73
|
+
<ProgressBar
|
|
74
|
+
total={100}
|
|
75
|
+
current={40}
|
|
76
|
+
UNSAFE_style={{ container: containerStyle }}
|
|
77
|
+
/>,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const progressBar = screen.getByRole("progressbar");
|
|
81
|
+
|
|
82
|
+
expect(progressBar.props.style).toEqual(
|
|
83
|
+
expect.objectContaining(containerStyle),
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("applies UNSAFE_style.progressBarContainer and track in progress variation", () => {
|
|
88
|
+
const progressBarContainer = { height: 22, borderRadius: 10 };
|
|
89
|
+
const track = { backgroundColor: "#eee" };
|
|
90
|
+
|
|
91
|
+
render(
|
|
92
|
+
<ProgressBar
|
|
93
|
+
total={100}
|
|
94
|
+
current={30}
|
|
95
|
+
UNSAFE_style={{
|
|
96
|
+
progressBarContainer,
|
|
97
|
+
track,
|
|
98
|
+
}}
|
|
99
|
+
/>,
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const progressContainer = screen.getByTestId("progressbar-container");
|
|
103
|
+
|
|
104
|
+
expect(progressContainer.props.style).toEqual(
|
|
105
|
+
expect.arrayContaining([expect.objectContaining(progressBarContainer)]),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const trackView = screen.getByTestId("progressbar-track");
|
|
109
|
+
expect(trackView.props.style).toEqual(
|
|
110
|
+
expect.arrayContaining([expect.objectContaining(track)]),
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("applies UNSAFE_style.inProgressFill and fill in progress variation", () => {
|
|
115
|
+
const inProgressFill = { backgroundColor: "#f59e0b" };
|
|
116
|
+
const fill = { backgroundColor: "#10b981" };
|
|
117
|
+
|
|
118
|
+
render(
|
|
119
|
+
<ProgressBar
|
|
120
|
+
total={100}
|
|
121
|
+
current={30}
|
|
122
|
+
inProgress={10}
|
|
123
|
+
UNSAFE_style={{
|
|
124
|
+
inProgressFill,
|
|
125
|
+
fill,
|
|
126
|
+
}}
|
|
127
|
+
/>,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const inProgressView = screen.getByTestId("progressbar-inprogress");
|
|
131
|
+
const fillView = screen.getByTestId("progressbar-fill");
|
|
132
|
+
|
|
133
|
+
expect(inProgressView.props.style).toEqual(
|
|
134
|
+
expect.arrayContaining([expect.objectContaining(inProgressFill)]),
|
|
135
|
+
);
|
|
136
|
+
expect(fillView.props.style).toEqual(
|
|
137
|
+
expect.arrayContaining([expect.objectContaining(fill)]),
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("applies UNSAFE_style.progressBarContainer and step in stepped variation", () => {
|
|
142
|
+
const progressBarContainer = { height: 12 };
|
|
143
|
+
const step = { backgroundColor: "#d1d5db" };
|
|
144
|
+
|
|
145
|
+
render(
|
|
146
|
+
<ProgressBar
|
|
147
|
+
variation="stepped"
|
|
148
|
+
total={4}
|
|
149
|
+
current={2}
|
|
150
|
+
inProgress={1}
|
|
151
|
+
UNSAFE_style={{ progressBarContainer, step }}
|
|
152
|
+
/>,
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const steppedContainer = screen.getByTestId("progressbar-container");
|
|
156
|
+
|
|
157
|
+
expect(steppedContainer.props.style).toEqual(
|
|
158
|
+
expect.arrayContaining([expect.objectContaining(progressBarContainer)]),
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
// Steps are rendered with testIDs depending on state; collect all steps by known IDs
|
|
162
|
+
const stepNodes = [
|
|
163
|
+
...screen.getAllByTestId("progress-step-completed"),
|
|
164
|
+
...screen.getAllByTestId("progress-step-in-progress"),
|
|
165
|
+
...screen.getAllByTestId("progress-step-incomplete"),
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
// At least one step should exist and contain the custom style
|
|
169
|
+
expect(stepNodes.length).toBeGreaterThan(0);
|
|
170
|
+
stepNodes.forEach(node => {
|
|
171
|
+
expect(node.props.style).toEqual(
|
|
172
|
+
expect.arrayContaining([expect.objectContaining(step)]),
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -17,7 +17,8 @@ export function ProgressBar({
|
|
|
17
17
|
header,
|
|
18
18
|
variation = "progress",
|
|
19
19
|
size = "base",
|
|
20
|
-
|
|
20
|
+
UNSAFE_style,
|
|
21
|
+
}: ProgressBarProps) {
|
|
21
22
|
const { t } = useAtlantisI18n();
|
|
22
23
|
const styles = useStyles();
|
|
23
24
|
const { tokens } = useAtlantisTheme();
|
|
@@ -27,6 +28,7 @@ export function ProgressBar({
|
|
|
27
28
|
accessible
|
|
28
29
|
accessibilityRole="progressbar"
|
|
29
30
|
accessibilityLabel={getA11yLabel()}
|
|
31
|
+
style={UNSAFE_style?.container}
|
|
30
32
|
>
|
|
31
33
|
{header}
|
|
32
34
|
{variation === "stepped" ? (
|
|
@@ -38,31 +40,45 @@ export function ProgressBar({
|
|
|
38
40
|
}
|
|
39
41
|
loading={loading}
|
|
40
42
|
inProgress={inProgress}
|
|
43
|
+
UNSAFE_style={UNSAFE_style}
|
|
41
44
|
/>
|
|
42
45
|
) : (
|
|
43
|
-
<View
|
|
46
|
+
<View
|
|
47
|
+
testID="progressbar-container"
|
|
48
|
+
style={[
|
|
49
|
+
styles.progressBarContainer,
|
|
50
|
+
sizeStyles[size],
|
|
51
|
+
UNSAFE_style?.progressBarContainer,
|
|
52
|
+
]}
|
|
53
|
+
>
|
|
44
54
|
<ProgressBarInner
|
|
55
|
+
testID="progressbar-track"
|
|
45
56
|
width={100}
|
|
46
57
|
animationDuration={0}
|
|
47
58
|
color={
|
|
48
59
|
reverseTheme ? undefined : tokens["color-interactive--background"]
|
|
49
60
|
}
|
|
61
|
+
style={UNSAFE_style?.track}
|
|
50
62
|
/>
|
|
51
63
|
{!loading && (
|
|
52
64
|
<>
|
|
53
65
|
{inProgress && inProgress > 0 ? (
|
|
54
66
|
<ProgressBarInner
|
|
67
|
+
testID="progressbar-inprogress"
|
|
55
68
|
width={calculateWidth(total, current + inProgress)}
|
|
56
69
|
color={tokens["color-informative"]}
|
|
57
70
|
animationDuration={800}
|
|
71
|
+
style={UNSAFE_style?.inProgressFill}
|
|
58
72
|
/>
|
|
59
73
|
) : (
|
|
60
74
|
<></>
|
|
61
75
|
)}
|
|
62
76
|
<ProgressBarInner
|
|
77
|
+
testID="progressbar-fill"
|
|
63
78
|
width={calculateWidth(total, current)}
|
|
64
79
|
color={tokens["color-interactive"]}
|
|
65
80
|
animationDuration={600}
|
|
81
|
+
style={UNSAFE_style?.fill}
|
|
66
82
|
/>
|
|
67
83
|
</>
|
|
68
84
|
)}
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
|
|
4
|
-
// import { useTiming } from "utils/reanimated";
|
|
3
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
5
4
|
import { useStyles } from "./ProgressBar.style";
|
|
6
5
|
|
|
7
6
|
interface ProgressBarInnerProps {
|
|
8
7
|
readonly width: number;
|
|
9
8
|
readonly animationDuration?: number;
|
|
10
9
|
readonly color?: string;
|
|
10
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
11
|
+
readonly testID?: string;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function ProgressBarInner({
|
|
14
15
|
width,
|
|
15
|
-
// animationDuration = 0,
|
|
16
16
|
color,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// duration: animationDuration,
|
|
21
|
-
// fromValue: 0,
|
|
22
|
-
// toValue: 1,
|
|
23
|
-
// });
|
|
17
|
+
style,
|
|
18
|
+
testID,
|
|
19
|
+
}: ProgressBarInnerProps) {
|
|
24
20
|
const styles = useStyles();
|
|
25
21
|
|
|
26
22
|
return (
|
|
27
23
|
<View
|
|
24
|
+
testID={testID}
|
|
28
25
|
style={[
|
|
29
26
|
styles.progressBarInner,
|
|
30
27
|
{
|
|
31
28
|
width: `${width}%`,
|
|
32
|
-
// opacity: animatedOpacity,
|
|
33
29
|
...(color && { backgroundColor: color }),
|
|
34
30
|
},
|
|
31
|
+
style,
|
|
35
32
|
]}
|
|
36
33
|
/>
|
|
37
34
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { useStyles } from "./ProgressBar.style";
|
|
4
|
+
import type { ProgressBarUnsafeStyle } from "./types";
|
|
4
5
|
|
|
5
6
|
interface ProgressBarSteppedProps {
|
|
6
7
|
readonly total: number;
|
|
@@ -8,6 +9,7 @@ interface ProgressBarSteppedProps {
|
|
|
8
9
|
readonly color?: string;
|
|
9
10
|
readonly loading?: boolean;
|
|
10
11
|
readonly inProgress?: number;
|
|
12
|
+
readonly UNSAFE_style?: ProgressBarUnsafeStyle;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export function ProgressBarStepped({
|
|
@@ -16,11 +18,19 @@ export function ProgressBarStepped({
|
|
|
16
18
|
color,
|
|
17
19
|
loading,
|
|
18
20
|
inProgress,
|
|
21
|
+
UNSAFE_style,
|
|
19
22
|
}: ProgressBarSteppedProps) {
|
|
20
23
|
const styles = useStyles();
|
|
21
24
|
|
|
22
25
|
return (
|
|
23
|
-
<View
|
|
26
|
+
<View
|
|
27
|
+
testID="progressbar-container"
|
|
28
|
+
style={[
|
|
29
|
+
styles.progressBarContainer,
|
|
30
|
+
{ height: 10 },
|
|
31
|
+
UNSAFE_style?.progressBarContainer,
|
|
32
|
+
]}
|
|
33
|
+
>
|
|
24
34
|
{Array.from({ length: total }).map((_, index) => {
|
|
25
35
|
const step = index + 1;
|
|
26
36
|
const isCompleted = step <= current;
|
|
@@ -39,6 +49,7 @@ export function ProgressBarStepped({
|
|
|
39
49
|
step <= inProgressSteps &&
|
|
40
50
|
styles.inProgressStep,
|
|
41
51
|
lastStep && { marginRight: 0 },
|
|
52
|
+
UNSAFE_style?.step,
|
|
42
53
|
]}
|
|
43
54
|
testID={
|
|
44
55
|
isCompleted
|
|
@@ -18,8 +18,10 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
|
|
|
18
18
|
{
|
|
19
19
|
"height": 16,
|
|
20
20
|
},
|
|
21
|
+
undefined,
|
|
21
22
|
]
|
|
22
23
|
}
|
|
24
|
+
testID="progressbar-container"
|
|
23
25
|
>
|
|
24
26
|
<View
|
|
25
27
|
style={
|
|
@@ -37,8 +39,10 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
|
|
|
37
39
|
"backgroundColor": "hsl(51, 17%, 85%)",
|
|
38
40
|
"width": "100%",
|
|
39
41
|
},
|
|
42
|
+
undefined,
|
|
40
43
|
]
|
|
41
44
|
}
|
|
45
|
+
testID="progressbar-track"
|
|
42
46
|
/>
|
|
43
47
|
<View
|
|
44
48
|
style={
|
|
@@ -56,8 +60,10 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
|
|
|
56
60
|
"backgroundColor": "hsl(207, 79%, 57%)",
|
|
57
61
|
"width": "0%",
|
|
58
62
|
},
|
|
63
|
+
undefined,
|
|
59
64
|
]
|
|
60
65
|
}
|
|
66
|
+
testID="progressbar-inprogress"
|
|
61
67
|
/>
|
|
62
68
|
<View
|
|
63
69
|
style={
|
|
@@ -75,8 +81,10 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
|
|
|
75
81
|
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
76
82
|
"width": "0%",
|
|
77
83
|
},
|
|
84
|
+
undefined,
|
|
78
85
|
]
|
|
79
86
|
}
|
|
87
|
+
testID="progressbar-fill"
|
|
80
88
|
/>
|
|
81
89
|
</View>
|
|
82
90
|
</View>
|
|
@@ -100,8 +108,10 @@ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`
|
|
|
100
108
|
{
|
|
101
109
|
"height": 16,
|
|
102
110
|
},
|
|
111
|
+
undefined,
|
|
103
112
|
]
|
|
104
113
|
}
|
|
114
|
+
testID="progressbar-container"
|
|
105
115
|
>
|
|
106
116
|
<View
|
|
107
117
|
style={
|
|
@@ -119,8 +129,10 @@ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`
|
|
|
119
129
|
"backgroundColor": "hsl(51, 17%, 85%)",
|
|
120
130
|
"width": "100%",
|
|
121
131
|
},
|
|
132
|
+
undefined,
|
|
122
133
|
]
|
|
123
134
|
}
|
|
135
|
+
testID="progressbar-track"
|
|
124
136
|
/>
|
|
125
137
|
<View
|
|
126
138
|
style={
|
|
@@ -138,8 +150,10 @@ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`
|
|
|
138
150
|
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
139
151
|
"width": "50%",
|
|
140
152
|
},
|
|
153
|
+
undefined,
|
|
141
154
|
]
|
|
142
155
|
}
|
|
156
|
+
testID="progressbar-fill"
|
|
143
157
|
/>
|
|
144
158
|
</View>
|
|
145
159
|
</View>
|
package/src/ProgressBar/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
|
|
3
4
|
export interface ProgressBarProps {
|
|
4
5
|
/**
|
|
@@ -44,4 +45,25 @@ export interface ProgressBarProps {
|
|
|
44
45
|
* @default base
|
|
45
46
|
*/
|
|
46
47
|
readonly size?: "smaller" | "small" | "base";
|
|
48
|
+
|
|
49
|
+
/** **Use at your own risk:** Custom style for specific elements. This should only be used as a
|
|
50
|
+
* **last resort**. Using this may result in unexpected side effects.
|
|
51
|
+
* More information in the [Customizing components Guide](https://atlantis.getjobber.com/guides/customizing-components).
|
|
52
|
+
*/
|
|
53
|
+
readonly UNSAFE_style?: ProgressBarUnsafeStyle;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ProgressBarUnsafeStyle {
|
|
57
|
+
/** Styles applied to the outer accessible wrapper (role="progressbar"). */
|
|
58
|
+
container?: StyleProp<ViewStyle>;
|
|
59
|
+
/** Styles applied to the inner bar container (track container) – controls bar height/rounding. */
|
|
60
|
+
progressBarContainer?: StyleProp<ViewStyle>;
|
|
61
|
+
/** Styles applied to each step block in the stepped variation. */
|
|
62
|
+
step?: StyleProp<ViewStyle>;
|
|
63
|
+
/** Track/background bar in 'progress' variation (full-width inner) */
|
|
64
|
+
track?: StyleProp<ViewStyle>;
|
|
65
|
+
/** Filled/completed portion in 'progress' variation */
|
|
66
|
+
fill?: StyleProp<ViewStyle>;
|
|
67
|
+
/** In-progress overlay portion in 'progress' variation */
|
|
68
|
+
inProgressFill?: StyleProp<ViewStyle>;
|
|
47
69
|
}
|
package/src/Select/Select.tsx
CHANGED
|
@@ -110,7 +110,7 @@ export function Select({
|
|
|
110
110
|
accessibilityLabel,
|
|
111
111
|
name,
|
|
112
112
|
testID,
|
|
113
|
-
}: SelectProps)
|
|
113
|
+
}: SelectProps) {
|
|
114
114
|
const { field, error } = useFormController({
|
|
115
115
|
name,
|
|
116
116
|
validations,
|
|
@@ -243,6 +243,6 @@ function getTestID(testID?: string): string {
|
|
|
243
243
|
return "ATL-Select";
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
export function Option({ children }: SelectOption)
|
|
246
|
+
export function Option({ children }: SelectOption) {
|
|
247
247
|
return <>{children}</>;
|
|
248
248
|
}
|
|
@@ -19,7 +19,7 @@ export function SelectDefaultPicker({
|
|
|
19
19
|
children,
|
|
20
20
|
options,
|
|
21
21
|
onChange,
|
|
22
|
-
}: SelectDefaultPickerProps)
|
|
22
|
+
}: SelectDefaultPickerProps) {
|
|
23
23
|
const [show, setShow] = useState(false);
|
|
24
24
|
const { t } = useAtlantisI18n();
|
|
25
25
|
const selectedLanguage = options.find(option => option.isActive);
|
|
@@ -12,7 +12,7 @@ export function SelectDefaultPicker({
|
|
|
12
12
|
options,
|
|
13
13
|
disabled,
|
|
14
14
|
onChange,
|
|
15
|
-
}: SelectDefaultPickerProps)
|
|
15
|
+
}: SelectDefaultPickerProps) {
|
|
16
16
|
const selectedItem = options.find(option => option.isActive);
|
|
17
17
|
const pickerRef = useRef<Picker<string>>(null);
|
|
18
18
|
const { tokens } = useAtlantisTheme();
|
|
@@ -13,10 +13,7 @@ type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> &
|
|
|
13
13
|
* screen-reader is being used to avoid screen-readers from ignoring the press
|
|
14
14
|
* on the MenuView
|
|
15
15
|
*/
|
|
16
|
-
export function SelectPressable({
|
|
17
|
-
children,
|
|
18
|
-
onPress,
|
|
19
|
-
}: SelectPressableProps): JSX.Element {
|
|
16
|
+
export function SelectPressable({ children, onPress }: SelectPressableProps) {
|
|
20
17
|
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
21
18
|
const styles = useStyles();
|
|
22
19
|
if (isScreenReaderEnabled) return <>{children}</>;
|