@jobber/components-native 0.54.4-JOB-88641.7 → 0.54.4-fix-inline.3
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 +7 -7
- package/dist/src/ActionItem/ActionItem.js +1 -1
- package/dist/src/Banner/Banner.js +2 -3
- package/dist/src/Banner/Banner.style.js +4 -2
- package/dist/src/Button/Button.js +2 -2
- package/dist/src/Button/Button.style.js +2 -2
- package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +3 -0
- package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/src/ButtonGroup/ButtonGroup.style.js +1 -1
- package/dist/src/Card/Card.js +7 -8
- package/dist/src/Disclosure/Disclosure.js +3 -3
- package/dist/src/Glimmer/Glimmer.js +42 -0
- package/dist/src/Glimmer/Glimmer.shape.style.js +16 -0
- package/dist/src/Glimmer/Glimmer.size.style.js +9 -0
- package/dist/src/Glimmer/Glimmer.style.js +20 -0
- package/dist/src/Glimmer/index.js +1 -0
- package/dist/src/InputCurrency/InputCurrency.js +16 -17
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +39 -18
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +38 -1
- package/dist/src/InputText/InputText.js +6 -3
- package/dist/src/Menu/Menu.js +20 -3
- package/dist/src/Menu/Menu.style.js +1 -1
- package/dist/src/Menu/utils.js +2 -7
- package/dist/src/index.js +6 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Banner/Banner.style.d.ts +4 -2
- package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
- package/dist/types/src/ButtonGroup/ButtonGroup.style.d.ts +1 -1
- package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
- package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
- package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
- package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
- package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
- package/dist/types/src/FormField/FormField.d.ts +2 -2
- package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
- package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
- package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
- package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
- package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
- package/dist/types/src/Glimmer/Glimmer.d.ts +31 -0
- package/dist/types/src/Glimmer/Glimmer.shape.style.d.ts +14 -0
- package/dist/types/src/Glimmer/Glimmer.size.style.d.ts +17 -0
- package/dist/types/src/Glimmer/Glimmer.style.d.ts +18 -0
- package/dist/types/src/Glimmer/index.d.ts +1 -0
- package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +19 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +34 -0
- package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
- package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
- package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
- package/dist/types/src/InputText/InputText.d.ts +6 -2
- package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
- package/dist/types/src/Toast/Toast.d.ts +1 -1
- package/dist/types/src/index.d.ts +6 -5
- package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
- package/jestSetup.js +2 -0
- package/package.json +7 -7
- package/src/ActionItem/ActionItem.test.tsx +2 -2
- package/src/ActionItem/ActionItem.tsx +3 -1
- package/src/ActionItem/ActionItemGroup.tsx +1 -0
- package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
- package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
- package/src/Banner/Banner.style.ts +4 -2
- package/src/Banner/Banner.tsx +3 -3
- package/src/BottomSheet/BottomSheet.tsx +3 -3
- package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
- package/src/Button/Button.style.ts +2 -2
- package/src/Button/Button.test.tsx +2 -2
- package/src/Button/Button.tsx +2 -2
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +4 -0
- package/src/ButtonGroup/ButtonGroup.style.ts +1 -1
- package/src/ButtonGroup/ButtonGroup.tsx +1 -0
- package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
- package/src/Card/Card.tsx +31 -32
- package/src/Card/components/InternalCardHeader.tsx +1 -0
- package/src/Checkbox/CheckboxGroup.tsx +12 -2
- package/src/Chip/Chip.tsx +2 -0
- package/src/Content/Content.test.tsx +1 -0
- package/src/Content/Content.tsx +1 -0
- package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
- package/src/Disclosure/Disclosure.tsx +3 -8
- package/src/Disclosure/__snapshots__/Disclosure.test.tsx.snap +18 -24
- package/src/Divider/Divider.tsx +1 -0
- package/src/EmptyState/EmptyState.tsx +2 -2
- package/src/Flex/Flex.styles.tsx +1 -0
- package/src/Flex/Flex.test.tsx +2 -0
- package/src/Form/Form.test.tsx +19 -14
- package/src/Form/components/FormBody/FormBody.tsx +4 -3
- package/src/Form/components/FormCache/FormCache.tsx +5 -4
- package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
- package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
- package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
- package/src/Form/context/AtlantisFormContext.tsx +1 -0
- package/src/Form/hooks/useFormViewRefs.ts +1 -0
- package/src/Form/hooks/useOfflineHandler.ts +1 -0
- package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
- package/src/FormField/FormField.test.tsx +6 -8
- package/src/FormField/FormField.tsx +2 -2
- package/src/FormatFile/FormatFile.tsx +15 -14
- package/src/FormatFile/components/FileView/FileView.tsx +9 -6
- package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
- package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
- package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
- package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
- package/src/Glimmer/Glimmer.shape.style.ts +17 -0
- package/src/Glimmer/Glimmer.size.style.ts +10 -0
- package/src/Glimmer/Glimmer.style.ts +23 -0
- package/src/Glimmer/Glimmer.test.tsx +73 -0
- package/src/Glimmer/Glimmer.tsx +106 -0
- package/src/Glimmer/index.ts +1 -0
- package/src/Icon/Icon.tsx +1 -0
- package/src/Icon/__snapshots__/Icon.test.tsx.snap +89 -24
- package/src/InputCurrency/InputCurrency.tsx +40 -38
- package/src/InputCurrency/utils.ts +9 -0
- package/src/InputDate/InputDate.test.tsx +1 -0
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +46 -1
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +74 -0
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +131 -64
- package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
- package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
- package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
- package/src/InputNumber/InputNumber.tsx +8 -0
- package/src/InputPassword/InputPassword.test.tsx +1 -0
- package/src/InputPassword/InputPassword.tsx +2 -1
- package/src/InputPressable/InputPressable.test.tsx +1 -0
- package/src/InputSearch/InputSearch.tsx +1 -0
- package/src/InputText/InputText.test.tsx +11 -0
- package/src/InputText/InputText.tsx +27 -2
- package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
- package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
- package/src/InputTime/utils/index.ts +1 -0
- package/src/Menu/Menu.style.ts +1 -1
- package/src/Menu/Menu.tsx +23 -2
- package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
- package/src/Menu/utils.ts +3 -7
- package/src/ProgressBar/ProgressBarInner.tsx +1 -0
- package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
- package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
- package/src/StatusLabel/StatusLabel.tsx +1 -1
- package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
- package/src/Text/Text.tsx +1 -0
- package/src/Toast/Toast.tsx +2 -1
- package/src/Typography/Typography.tsx +5 -0
- package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
- package/src/hooks/useFormController.ts +2 -0
- package/src/index.ts +6 -5
- package/src/utils/intl/capitalize.ts +1 -0
- package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.54.4-
|
|
3
|
+
"version": "0.54.4-fix-inline.3+c411f5fe",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"build:clean": "rm -rf ./dist"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jobber/design": "^0.54.
|
|
40
|
-
"@jobber/hooks": "^2.8.
|
|
39
|
+
"@jobber/design": "^0.54.1-fix-inline.3+c411f5fe",
|
|
40
|
+
"@jobber/hooks": "^2.8.4-fix-inline.5+c411f5fe",
|
|
41
41
|
"@react-native-clipboard/clipboard": "^1.11.2",
|
|
42
42
|
"@react-native-picker/picker": "^2.4.10",
|
|
43
43
|
"autolinker": "^4.0.0",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"react-native-modalize": "^2.0.13",
|
|
50
50
|
"react-native-portalize": "^1.0.7",
|
|
51
51
|
"react-native-safe-area-context": "^4.5.2",
|
|
52
|
-
"react-native-svg": "^13.9.0",
|
|
53
52
|
"react-native-toast-message": "^2.1.6",
|
|
54
53
|
"react-native-uuid": "^1.4.9",
|
|
55
54
|
"ts-xor": "^1.1.0"
|
|
@@ -81,8 +80,9 @@
|
|
|
81
80
|
"react-native-modal-datetime-picker": " >=13.0.0",
|
|
82
81
|
"react-native-modalize": "^2.0.13",
|
|
83
82
|
"react-native-portalize": "^1.0.7",
|
|
84
|
-
"react-native-reanimated": "^2.
|
|
85
|
-
"react-native-safe-area-context": "^4.5.2"
|
|
83
|
+
"react-native-reanimated": "^2.0.0 || ^3.0.0",
|
|
84
|
+
"react-native-safe-area-context": "^4.5.2",
|
|
85
|
+
"react-native-svg": ">=12.0.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "c411f5fec260686086b5999611711c886133b5eb"
|
|
88
88
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Pressable, Text as RNText, View } from "react-native";
|
|
3
|
-
import { tokens } from "@jobber/design";
|
|
4
3
|
import { styles } from "./Banner.style";
|
|
5
4
|
import { BannerIcon } from "./components/BannerIcon/BannerIcon";
|
|
6
5
|
import { Content } from "../Content";
|
|
@@ -23,7 +22,7 @@ export function Banner({ action, details, text, type, children, icon, }) {
|
|
|
23
22
|
text && React.createElement(Text, { level: "text" }, text),
|
|
24
23
|
details && React.createElement(TextList, { items: details, level: "text" }),
|
|
25
24
|
action && (React.createElement(RNText, null,
|
|
26
|
-
shouldFlow && React.createElement(Typography,
|
|
25
|
+
shouldFlow && React.createElement(Typography, { color: "subdued" }, " | "),
|
|
27
26
|
React.createElement(ActionLabel, { align: "start" }, action.label))))))))));
|
|
28
27
|
}
|
|
29
28
|
function BannerChildren({ children }) {
|
|
@@ -38,7 +37,7 @@ function WrappingElement({ shouldFlow, children, }) {
|
|
|
38
37
|
if (shouldFlow) {
|
|
39
38
|
return React.createElement(RNText, { testID: "ATL-Banner-RNText" }, children);
|
|
40
39
|
}
|
|
41
|
-
return (React.createElement(View, { testID: "ATL-Banner-View", style:
|
|
40
|
+
return (React.createElement(View, { testID: "ATL-Banner-View", style: styles.contentSpacing }, children));
|
|
42
41
|
}
|
|
43
42
|
function getBannerIcon(type) {
|
|
44
43
|
switch (type) {
|
|
@@ -5,8 +5,7 @@ export const styles = StyleSheet.create({
|
|
|
5
5
|
width: "100%",
|
|
6
6
|
borderColor: tokens["color-border"],
|
|
7
7
|
borderStyle: "solid",
|
|
8
|
-
|
|
9
|
-
borderRadius: tokens["radius-base"],
|
|
8
|
+
borderBottomWidth: tokens["border-base"],
|
|
10
9
|
backgroundColor: tokens["color-surface"],
|
|
11
10
|
},
|
|
12
11
|
bannerContent: {
|
|
@@ -29,4 +28,7 @@ export const styles = StyleSheet.create({
|
|
|
29
28
|
bannerChildrenContent: {
|
|
30
29
|
marginBottom: tokens["space-small"],
|
|
31
30
|
},
|
|
31
|
+
contentSpacing: {
|
|
32
|
+
gap: tokens["space-small"],
|
|
33
|
+
},
|
|
32
34
|
});
|
|
@@ -39,7 +39,7 @@ function getActionLabelVariation(variation, type) {
|
|
|
39
39
|
}
|
|
40
40
|
switch (variation) {
|
|
41
41
|
case "learning":
|
|
42
|
-
return "
|
|
42
|
+
return "subtle";
|
|
43
43
|
case "destructive":
|
|
44
44
|
return "destructive";
|
|
45
45
|
case "cancel":
|
|
@@ -57,7 +57,7 @@ function getIconColorVariation(variation, type, disabled) {
|
|
|
57
57
|
}
|
|
58
58
|
switch (variation) {
|
|
59
59
|
case "learning":
|
|
60
|
-
return "
|
|
60
|
+
return "interactiveSubtle";
|
|
61
61
|
case "destructive":
|
|
62
62
|
return "destructive";
|
|
63
63
|
case "cancel":
|
|
@@ -63,8 +63,8 @@ export const styles = StyleSheet.create({
|
|
|
63
63
|
borderColor: tokens["color-interactive"],
|
|
64
64
|
},
|
|
65
65
|
learning: {
|
|
66
|
-
backgroundColor: tokens["color-
|
|
67
|
-
borderColor: tokens["color-
|
|
66
|
+
backgroundColor: tokens["color-interactive--subtle"],
|
|
67
|
+
borderColor: tokens["color-interactive--subtle"],
|
|
68
68
|
},
|
|
69
69
|
destructive: {
|
|
70
70
|
backgroundColor: tokens["color-destructive"],
|
|
@@ -6,6 +6,9 @@ import { tokens } from "../../../utils/design";
|
|
|
6
6
|
const imageWidth = 96;
|
|
7
7
|
const offset = PixelRatio.roundToNearestPixel(imageWidth / PixelRatio.get());
|
|
8
8
|
const leftOffset = -1 * offset;
|
|
9
|
+
// looks like deprecation for FlatList in reanimated is cascading down to other exports
|
|
10
|
+
// This is not createAnimatedComponent(FlatList), we are fine
|
|
11
|
+
// eslint-disable-next-line import/no-deprecated
|
|
9
12
|
const AnimatedImage = Animated.createAnimatedComponent(ImageBackground);
|
|
10
13
|
function InternalButtonLoadingInternal({ variation, type, }) {
|
|
11
14
|
const translateX = useSharedValue(0);
|
|
@@ -17,7 +17,7 @@ export function ButtonGroup({ children, showCancelInBottomSheet, bottomSheetHead
|
|
|
17
17
|
return (React.createElement(View, { style: styles.button, key: index }, customButton || (React.createElement(Button, { label: label, accessibilityLabel: label, onPress: allowTapWhenOffline ? onPress : handlePress(onPress), type: buttonType, variation: buttonVariation, fullHeight: true, icon: icon, loading: loading, testID: `ButtonGroup-Primary-Action-${index}` }))));
|
|
18
18
|
}),
|
|
19
19
|
secondaryActions.length > 0 && (React.createElement(View, { style: styles.moreButton },
|
|
20
|
-
React.createElement(Button, { icon: "more", accessibilityLabel: t("more"), onPress: handlePress(openBottomSheet), fullHeight: true, testID: "ButtonGroup-Secondary-Action" }))),
|
|
20
|
+
React.createElement(Button, { type: "secondary", icon: "more", accessibilityLabel: t("more"), onPress: handlePress(openBottomSheet), fullHeight: true, testID: "ButtonGroup-Secondary-Action" }))),
|
|
21
21
|
React.createElement(SecondaryActionSheet, { heading: bottomSheetHeading, showCancel: showCancelInBottomSheet, secondaryActionsRef: secondaryActionsRef, actions: secondaryActions.map(secondaryAction => secondaryAction.props), onOpenBottomSheet: onOpenBottomSheet, onCloseBottomSheet: onCloseBottomSheet })));
|
|
22
22
|
function openBottomSheet() {
|
|
23
23
|
var _a;
|
|
@@ -5,11 +5,11 @@ export const styles = StyleSheet.create({
|
|
|
5
5
|
width: "100%",
|
|
6
6
|
flexDirection: "row",
|
|
7
7
|
justifyContent: "flex-end",
|
|
8
|
+
gap: tokens["space-small"],
|
|
8
9
|
},
|
|
9
10
|
button: {
|
|
10
11
|
flexBasis: tokens["space-largest"],
|
|
11
12
|
flexGrow: 1,
|
|
12
|
-
paddingRight: tokens["space-smaller"],
|
|
13
13
|
},
|
|
14
14
|
moreButton: {
|
|
15
15
|
flexBasis: tokens["space-largest"],
|
package/dist/src/Card/Card.js
CHANGED
|
@@ -16,14 +16,13 @@ export function Card({ header, footer, children, reportCardHeight: onCardHeightC
|
|
|
16
16
|
var _a, _b;
|
|
17
17
|
return (React.createElement(ErrorMessageWrapper, { message: error, wrapFor: "card" },
|
|
18
18
|
React.createElement(View, { onLayout: handleLayoutChange, style: [styles.container, getElevationStyle(elevation)], testID: testID },
|
|
19
|
-
header && (React.createElement(
|
|
20
|
-
React.createElement(
|
|
21
|
-
React.createElement(
|
|
22
|
-
|
|
23
|
-
React.createElement(View, { style: styles.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((_b = header.actionItem) === null || _b === void 0 ? void 0 : _b.iconName) && (React.createElement(Icon, { name: header.actionItem.iconName, color: "interactive" })))))),
|
|
19
|
+
header && (React.createElement(InternalCardHeader, { onPress: header.onPress, testID: `${testID}Header`, collapsable: !!children },
|
|
20
|
+
React.createElement(View, { style: styles.headerTitle },
|
|
21
|
+
React.createElement(Typography, { color: "heading", fontFamily: "base", fontWeight: "bold", size: "default", lineHeight: "base", accessibilityRole: "header" }, header.title)),
|
|
22
|
+
React.createElement(View, { style: styles.actionItem },
|
|
23
|
+
!!((_a = header.actionItem) === null || _a === void 0 ? void 0 : _a.label) && (React.createElement(View, { style: styles.actionLabel },
|
|
24
|
+
React.createElement(ActionLabel, { type: "cardTitle" }, header.actionItem.label))),
|
|
25
|
+
((_b = header.actionItem) === null || _b === void 0 ? void 0 : _b.iconName) && (React.createElement(Icon, { name: header.actionItem.iconName, color: "interactive" }))))),
|
|
27
26
|
children,
|
|
28
27
|
footer && (React.createElement(Pressable, { testID: `${testID}Footer`, onPress: footer.onPress, style: ({ pressed }) => [
|
|
29
28
|
styles.footer,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity, View } from "react-native";
|
|
3
3
|
import Reanimated, { Easing, useAnimatedStyle, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
4
4
|
import { EASE_CUBIC_IN_OUT } from "./constants";
|
|
5
5
|
import { styles } from "./Disclosure.style";
|
|
6
6
|
import { tokens } from "../utils/design";
|
|
7
7
|
import { Icon } from "../Icon";
|
|
8
|
-
const ReanimatedView = Reanimated.
|
|
9
|
-
const ReanimatedScrollView = Reanimated.
|
|
8
|
+
const ReanimatedView = Reanimated.View;
|
|
9
|
+
const ReanimatedScrollView = Reanimated.ScrollView;
|
|
10
10
|
export function Disclosure({ content, header, open, onToggle, isEmpty, animationDuration = tokens["timing-slowest"], }) {
|
|
11
11
|
return (React.createElement(View, { style: styles.container },
|
|
12
12
|
React.createElement(DisclosureHeader, Object.assign({}, { header, onToggle, isEmpty, open, animationDuration })),
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Animated, Easing, View } from "react-native";
|
|
3
|
+
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
4
|
+
import { shineWidth, styles } from "./Glimmer.style";
|
|
5
|
+
import { sizeStyles } from "./Glimmer.size.style";
|
|
6
|
+
import { shapeStyles } from "./Glimmer.shape.style";
|
|
7
|
+
import { tokens } from "../utils/design";
|
|
8
|
+
export const GLIMMER_TEST_ID = "ATL-Glimmer";
|
|
9
|
+
export const GLIMMER_SHINE_TEST_ID = "ATL-Glimmer-Shine";
|
|
10
|
+
export function Glimmer({ width, shape = "rectangle", size = "base", timing = "base", }) {
|
|
11
|
+
const leftPosition = useRef(new Animated.Value(-shineWidth)).current;
|
|
12
|
+
const [parentWidth, setParentWidth] = useState(0);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const shine = Animated.loop(Animated.timing(leftPosition, {
|
|
15
|
+
toValue: parentWidth + shineWidth,
|
|
16
|
+
duration: timing === "base"
|
|
17
|
+
? tokens["timing-loading--extended"]
|
|
18
|
+
: tokens["timing-loading"],
|
|
19
|
+
easing: Easing.ease,
|
|
20
|
+
useNativeDriver: true,
|
|
21
|
+
}));
|
|
22
|
+
shine.start();
|
|
23
|
+
return shine.stop;
|
|
24
|
+
}, [parentWidth]);
|
|
25
|
+
return (React.createElement(View, { style: [
|
|
26
|
+
styles.container,
|
|
27
|
+
sizeStyles[size],
|
|
28
|
+
shapeStyles[shape],
|
|
29
|
+
{ width },
|
|
30
|
+
], onLayout: getWidth, testID: GLIMMER_TEST_ID },
|
|
31
|
+
React.createElement(Animated.View, { style: [styles.shine, { transform: [{ translateX: leftPosition }] }], testID: GLIMMER_SHINE_TEST_ID },
|
|
32
|
+
React.createElement(Svg, null,
|
|
33
|
+
React.createElement(Defs, null,
|
|
34
|
+
React.createElement(LinearGradient, { id: "gradientShine", x1: 0, y1: 0.5, x2: 1, y2: 0.5 },
|
|
35
|
+
React.createElement(Stop, { offset: "0%", stopColor: tokens["color-surface--background"] }),
|
|
36
|
+
React.createElement(Stop, { offset: "50%", stopColor: tokens["color-surface"] }),
|
|
37
|
+
React.createElement(Stop, { offset: "100%", stopColor: tokens["color-surface--background"] }))),
|
|
38
|
+
React.createElement(Rect, { fill: "url(#gradientShine)", height: "100%", width: "100%" })))));
|
|
39
|
+
function getWidth(event) {
|
|
40
|
+
setParentWidth(event.nativeEvent.layout.width);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
export const shapeStyles = StyleSheet.create({
|
|
4
|
+
rectangle: {
|
|
5
|
+
width: "100%",
|
|
6
|
+
},
|
|
7
|
+
square: {
|
|
8
|
+
width: "auto",
|
|
9
|
+
aspectRatio: 1 / 1,
|
|
10
|
+
},
|
|
11
|
+
circle: {
|
|
12
|
+
width: "auto",
|
|
13
|
+
aspectRatio: 1 / 1,
|
|
14
|
+
borderRadius: tokens["radius-circle"],
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
export const sizeStyles = StyleSheet.create({
|
|
4
|
+
small: { height: tokens["space-small"] },
|
|
5
|
+
base: { height: tokens["space-base"] },
|
|
6
|
+
large: { height: tokens["space-large"] },
|
|
7
|
+
larger: { height: tokens["space-larger"] },
|
|
8
|
+
largest: { height: tokens["space-largest"] },
|
|
9
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
export const shineWidth = tokens["space-largest"];
|
|
4
|
+
export const styles = StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
backgroundColor: tokens["color-surface--background"],
|
|
7
|
+
overflow: "hidden",
|
|
8
|
+
position: "relative",
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: tokens["space-base"],
|
|
11
|
+
borderRadius: tokens["radius-base"],
|
|
12
|
+
},
|
|
13
|
+
shine: {
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
width: shineWidth,
|
|
18
|
+
height: "100%",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Glimmer";
|
|
@@ -73,21 +73,20 @@ export function InputCurrency(props) {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
const { t } = useAtlantisI18n();
|
|
76
|
-
return (React.createElement(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} }))));
|
|
76
|
+
return (React.createElement(InputText, Object.assign({}, props, { prefix: showCurrencySymbol ? { label: currencySymbol } : undefined, keyboard: getKeyboard(props), value: ((_a = props.value) === null || _a === void 0 ? void 0 : _a.toString()) || displayValue, defaultValue: (_b = props.defaultValue) === null || _b === void 0 ? void 0 : _b.toString(), onChangeText: handleChange, transform: {
|
|
77
|
+
output: val => {
|
|
78
|
+
return val === null || val === void 0 ? void 0 : val.split(floatSeparators.group).join("").replace(floatSeparators.decimal, ".");
|
|
79
|
+
},
|
|
80
|
+
}, validations: Object.assign({ pattern: {
|
|
81
|
+
value: NUMBER_VALIDATION_REGEX,
|
|
82
|
+
message: t("errors.notANumber"),
|
|
83
|
+
} }, props.validations), onBlur: () => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
86
|
+
if (field.value === 0 ||
|
|
87
|
+
field.value === "" ||
|
|
88
|
+
field.value === undefined) {
|
|
89
|
+
setDisplayValue("0");
|
|
90
|
+
}
|
|
91
|
+
} })));
|
|
93
92
|
}
|
|
@@ -6,14 +6,21 @@ import { styles } from "./InputFieldWrapper.style";
|
|
|
6
6
|
import { PrefixIcon, PrefixLabel } from "./components/Prefix/Prefix";
|
|
7
7
|
import { SuffixIcon, SuffixLabel } from "./components/Suffix/Suffix";
|
|
8
8
|
import { ClearAction } from "./components/ClearAction";
|
|
9
|
+
import { Glimmer } from "../Glimmer/Glimmer";
|
|
9
10
|
import { ErrorMessageWrapper } from "../ErrorMessageWrapper";
|
|
10
11
|
import { typographyStyles } from "../Typography";
|
|
11
12
|
import { Text } from "../Text";
|
|
12
|
-
|
|
13
|
+
import { ActivityIndicator } from "../ActivityIndicator";
|
|
14
|
+
export const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers";
|
|
15
|
+
export const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner";
|
|
16
|
+
export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel = false, hasValue = false, error, focused = false, children, onClear, showClearAction = false, styleOverride, toolbar, toolbarVisibility = "while-editing", loading = false, loadingType = "spinner", }) {
|
|
13
17
|
fieldAffixRequiredPropsCheck([prefix, suffix]);
|
|
14
18
|
const handleClear = onClear !== null && onClear !== void 0 ? onClear : noopClear;
|
|
15
19
|
warnIfClearActionWithNoOnClear(onClear, showClearAction);
|
|
16
20
|
const inputInvalid = Boolean(invalid) || Boolean(error);
|
|
21
|
+
const isToolbarVisible = toolbar && (toolbarVisibility === "always" || focused);
|
|
22
|
+
const showLoadingSpinner = loading && loadingType === "spinner";
|
|
23
|
+
const showLoadingGlimmer = loading && loadingType === "glimmer";
|
|
17
24
|
return (React.createElement(ErrorMessageWrapper, { message: getMessage({ invalid, error }) },
|
|
18
25
|
React.createElement(View, { testID: "ATL-InputFieldWrapper", style: [
|
|
19
26
|
styles.container,
|
|
@@ -22,23 +29,37 @@ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveTex
|
|
|
22
29
|
disabled && styles.disabled,
|
|
23
30
|
styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.container,
|
|
24
31
|
] },
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.createElement(View, { style: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
React.createElement(View, { style: styles.field },
|
|
33
|
+
(prefix === null || prefix === void 0 ? void 0 : prefix.icon) && (React.createElement(PrefixIcon, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, inputInvalid: inputInvalid, icon: prefix.icon })),
|
|
34
|
+
React.createElement(View, { style: [styles.inputContainer] },
|
|
35
|
+
React.createElement(View, { style: [
|
|
36
|
+
!!placeholder && styles.label,
|
|
37
|
+
hasMiniLabel && styles.miniLabel,
|
|
38
|
+
disabled && styles.disabled,
|
|
39
|
+
hasMiniLabel &&
|
|
40
|
+
showClearAction &&
|
|
41
|
+
styles.miniLabelShowClearAction,
|
|
42
|
+
], pointerEvents: "none" },
|
|
43
|
+
React.createElement(Placeholder, { placeholder: placeholder, labelVariation: getLabelVariation(error, invalid, disabled), hasMiniLabel: hasMiniLabel, styleOverride: styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.placeholderText })),
|
|
44
|
+
(prefix === null || prefix === void 0 ? void 0 : prefix.label) && hasValue && (React.createElement(PrefixLabel, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, inputInvalid: inputInvalid, label: prefix.label, styleOverride: styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.prefixLabel })),
|
|
45
|
+
children,
|
|
46
|
+
showLoadingGlimmer && (React.createElement(View, { testID: INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID, style: [
|
|
47
|
+
styles.loadingGlimmers,
|
|
48
|
+
hasValue && styles.loadingGlimmersHasValue,
|
|
49
|
+
] },
|
|
50
|
+
React.createElement(Glimmer, { size: "small", width: "80%" }),
|
|
51
|
+
React.createElement(Glimmer, { size: "small" }),
|
|
52
|
+
React.createElement(Glimmer, { size: "small", width: "70%" }))),
|
|
53
|
+
(showClearAction ||
|
|
54
|
+
(suffix === null || suffix === void 0 ? void 0 : suffix.label) ||
|
|
55
|
+
(suffix === null || suffix === void 0 ? void 0 : suffix.icon) ||
|
|
56
|
+
showLoadingSpinner) && (React.createElement(View, { style: styles.inputEndContainer },
|
|
57
|
+
showClearAction && (React.createElement(ClearAction, { hasMarginRight: !!(suffix === null || suffix === void 0 ? void 0 : suffix.icon) || !!(suffix === null || suffix === void 0 ? void 0 : suffix.label), onPress: handleClear })),
|
|
58
|
+
(suffix === null || suffix === void 0 ? void 0 : suffix.label) && hasValue && (React.createElement(SuffixLabel, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, inputInvalid: inputInvalid, label: suffix.label, hasLeftMargin: !showClearAction, styleOverride: styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.suffixLabel })),
|
|
59
|
+
showLoadingSpinner && (React.createElement(View, { style: styles.loadingSpinner },
|
|
60
|
+
React.createElement(ActivityIndicator, { testID: INPUT_FIELD_WRAPPER_SPINNER_TEST_ID }))),
|
|
61
|
+
(suffix === null || suffix === void 0 ? void 0 : suffix.icon) && (React.createElement(SuffixIcon, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, hasLeftMargin: !!(!showClearAction || (suffix === null || suffix === void 0 ? void 0 : suffix.label)), inputInvalid: inputInvalid, icon: suffix.icon, onPress: suffix.onPress })))))),
|
|
62
|
+
isToolbarVisible && React.createElement(View, { style: styles.toolbar }, toolbar)),
|
|
42
63
|
assistiveText && !error && !invalid && (React.createElement(Text, { level: "textSupporting", variation: disabled ? "disabled" : focused ? "interactive" : "subdued" }, assistiveText))));
|
|
43
64
|
}
|
|
44
65
|
function getLabelVariation(error, invalid, disabled) {
|
|
@@ -3,7 +3,16 @@ import { commonInputStyles } from "./CommonInputStyles.style";
|
|
|
3
3
|
import { tokens } from "../utils/design";
|
|
4
4
|
import { typographyStyles } from "../Typography";
|
|
5
5
|
export const styles = StyleSheet.create({
|
|
6
|
-
container: StyleSheet.flatten([
|
|
6
|
+
container: StyleSheet.flatten([
|
|
7
|
+
commonInputStyles.container,
|
|
8
|
+
{
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
},
|
|
11
|
+
]),
|
|
12
|
+
field: {
|
|
13
|
+
flexDirection: "row",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
},
|
|
7
16
|
inputContainer: {
|
|
8
17
|
flexDirection: "row",
|
|
9
18
|
flex: 1,
|
|
@@ -29,6 +38,7 @@ export const styles = StyleSheet.create({
|
|
|
29
38
|
top: 0,
|
|
30
39
|
paddingTop: tokens["space-small"] - tokens["space-smallest"],
|
|
31
40
|
backgroundColor: tokens["color-surface"],
|
|
41
|
+
marginRight: tokens["space-small"],
|
|
32
42
|
maxHeight: (typographyStyles.defaultSize.lineHeight || 0) + tokens["space-smaller"],
|
|
33
43
|
zIndex: 1,
|
|
34
44
|
},
|
|
@@ -78,4 +88,31 @@ export const styles = StyleSheet.create({
|
|
|
78
88
|
flexDirection: "row",
|
|
79
89
|
zIndex: 1,
|
|
80
90
|
},
|
|
91
|
+
toolbar: {
|
|
92
|
+
flexBasis: "100%",
|
|
93
|
+
flexDirection: "row",
|
|
94
|
+
gap: tokens["space-small"],
|
|
95
|
+
paddingBottom: tokens["space-small"],
|
|
96
|
+
},
|
|
97
|
+
loadingSpinner: {
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
paddingRight: tokens["space-small"],
|
|
100
|
+
},
|
|
101
|
+
loadingGlimmers: {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
top: tokens["space-base"],
|
|
104
|
+
bottom: tokens["space-base"],
|
|
105
|
+
left: 0,
|
|
106
|
+
right: 0,
|
|
107
|
+
gap: tokens["space-small"],
|
|
108
|
+
paddingTop: tokens["space-small"],
|
|
109
|
+
paddingRight: tokens["space-large"],
|
|
110
|
+
backgroundColor: tokens["color-surface"],
|
|
111
|
+
overflow: "hidden",
|
|
112
|
+
},
|
|
113
|
+
loadingGlimmersHasValue: {
|
|
114
|
+
top: tokens["space-large"],
|
|
115
|
+
paddingTop: tokens["space-base"] - tokens["space-smaller"],
|
|
116
|
+
bottom: tokens["space-smaller"],
|
|
117
|
+
},
|
|
81
118
|
});
|
|
@@ -9,7 +9,7 @@ import { InputFieldWrapper } from "../InputFieldWrapper";
|
|
|
9
9
|
import { commonInputStyles } from "../InputFieldWrapper/CommonInputStyles.style";
|
|
10
10
|
export const InputText = forwardRef(InputTextInternal);
|
|
11
11
|
// eslint-disable-next-line max-statements
|
|
12
|
-
function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText, keyboard, value: controlledValue, defaultValue, autoFocus, autoComplete = "off", spellCheck, textContentType = "none", validations, onChangeText, onSubmitEditing, onFocus, accessibilityLabel, accessibilityHint, autoCorrect, autoCapitalize, onBlur, multiline = false, prefix, suffix, transform = {}, clearable = multiline ? "never" : "while-editing", testID, secureTextEntry, styleOverride, }, ref) {
|
|
12
|
+
function InputTextInternal({ invalid, disabled, readonly = false, name, placeholder, assistiveText, keyboard, value: controlledValue, defaultValue, autoFocus, autoComplete = "off", spellCheck, textContentType = "none", validations, onChangeText, onSubmitEditing, onFocus, accessibilityLabel, accessibilityHint, autoCorrect, autoCapitalize, onBlur, multiline = false, prefix, suffix, transform = {}, clearable = multiline ? "never" : "while-editing", testID, secureTextEntry, styleOverride, toolbar, toolbarVisibility, loading, loadingType, }, ref) {
|
|
13
13
|
var _a;
|
|
14
14
|
const isAndroid = Platform.OS === "android";
|
|
15
15
|
const isIOS = Platform.OS === "ios";
|
|
@@ -72,7 +72,7 @@ function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText
|
|
|
72
72
|
}
|
|
73
73
|
onFocusNext();
|
|
74
74
|
}
|
|
75
|
-
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, assistiveText: assistiveText, focused: focused, error: error, invalid: invalid, placeholder: placeholder, disabled: disabled, onClear: handleClear, showClearAction: showClear, styleOverride: styleOverride },
|
|
75
|
+
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, assistiveText: assistiveText, focused: focused, error: error, invalid: invalid, placeholder: placeholder, disabled: disabled, onClear: handleClear, showClearAction: showClear, styleOverride: styleOverride, toolbar: toolbar, toolbarVisibility: toolbarVisibility, loading: loading, loadingType: loadingType },
|
|
76
76
|
React.createElement(TextInput, Object.assign({ inputAccessoryViewID: inputAccessoryID || undefined, testID: testID, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, spellCheck: spellCheck, style: [
|
|
77
77
|
commonInputStyles.input,
|
|
78
78
|
styles.inputPaddingTop,
|
|
@@ -82,7 +82,10 @@ function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText
|
|
|
82
82
|
multiline && Platform.OS === "ios" && styles.multilineInputiOS,
|
|
83
83
|
multiline && hasMiniLabel && styles.multiLineInputWithMini,
|
|
84
84
|
styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.inputText,
|
|
85
|
-
|
|
85
|
+
loading && loadingType === "glimmer" && { color: "transparent" },
|
|
86
|
+
],
|
|
87
|
+
// @ts-expect-error - does exist on 0.71 and up https://github.com/facebook/react-native/pull/39281
|
|
88
|
+
readOnly: readonly, editable: !disabled, keyboardType: keyboard, value: inputTransform(internalValue), autoFocus: autoFocus, autoComplete: autoComplete, multiline: multiline, scrollEnabled: false, textContentType: textContentType, onChangeText: handleChangeText, onSubmitEditing: handleOnSubmitEditing, returnKeyType: returnKeyType, blurOnSubmit: shouldBlurOnSubmit, accessibilityLabel: accessibilityLabel || placeholder, accessibilityHint: accessibilityHint, accessibilityState: { busy: loading }, secureTextEntry: secureTextEntry }, androidA11yProps, { onFocus: event => {
|
|
86
89
|
_name && setFocusedInput(_name);
|
|
87
90
|
setFocused(true);
|
|
88
91
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
package/dist/src/Menu/Menu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef, useState } from "react";
|
|
2
|
-
import { Pressable, View, useWindowDimensions, } from "react-native";
|
|
2
|
+
import { Keyboard, Platform, Pressable, View, useWindowDimensions, } from "react-native";
|
|
3
3
|
import { Portal } from "react-native-portalize";
|
|
4
4
|
import { useSafeAreaFrame } from "react-native-safe-area-context";
|
|
5
5
|
import { styles } from "./Menu.style";
|
|
@@ -23,7 +23,7 @@ export function Menu({ menuOptions, customActivator }) {
|
|
|
23
23
|
setMenuPosition(findViewpoint(screenInfo, activatorLayout.current));
|
|
24
24
|
}
|
|
25
25
|
}, [screenInfo, activatorLayout]);
|
|
26
|
-
const
|
|
26
|
+
const openMenu = () => {
|
|
27
27
|
var _a;
|
|
28
28
|
(_a = menuButtonRef.current) === null || _a === void 0 ? void 0 : _a.measureInWindow((x, y, width, height) => {
|
|
29
29
|
activatorLayout.current = {
|
|
@@ -34,9 +34,20 @@ export function Menu({ menuOptions, customActivator }) {
|
|
|
34
34
|
};
|
|
35
35
|
findMenuLayout();
|
|
36
36
|
setOpen(true);
|
|
37
|
-
onPress && onPress();
|
|
38
37
|
});
|
|
39
38
|
};
|
|
39
|
+
const activatorOnPress = (onPress) => {
|
|
40
|
+
onPress && onPress();
|
|
41
|
+
if (Platform.OS === "ios" && Keyboard.isVisible()) {
|
|
42
|
+
// On iOS, the keyboard height causes problems with the menu positioning logic.
|
|
43
|
+
// Wait until the keyboard is fully hidden before we show the menu.
|
|
44
|
+
onKeyboardDidHide(openMenu);
|
|
45
|
+
Keyboard.dismiss();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
openMenu();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
40
51
|
return (React.createElement(React.Fragment, null,
|
|
41
52
|
React.createElement(View, { ref: ref => {
|
|
42
53
|
menuButtonRef.current = ref;
|
|
@@ -64,3 +75,9 @@ function useScreenInformation() {
|
|
|
64
75
|
const { height: windowHeight } = useSafeAreaFrame();
|
|
65
76
|
return { headerHeight, windowWidth, windowHeight };
|
|
66
77
|
}
|
|
78
|
+
function onKeyboardDidHide(callback) {
|
|
79
|
+
const listener = Keyboard.addListener("keyboardDidHide", () => {
|
|
80
|
+
listener.remove();
|
|
81
|
+
callback();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -2,5 +2,5 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { tokens } from "../utils/design";
|
|
3
3
|
const menuWidth = 208;
|
|
4
4
|
export const styles = StyleSheet.create({
|
|
5
|
-
menu: Object.assign({ position: "absolute", backgroundColor: tokens["color-surface"], paddingHorizontal: tokens["space-small"], paddingVertical: tokens["space-small"] + tokens["space-smallest"], borderRadius: tokens["radius-
|
|
5
|
+
menu: Object.assign({ position: "absolute", backgroundColor: tokens["color-surface"], paddingHorizontal: tokens["space-small"], paddingVertical: tokens["space-small"] + tokens["space-smallest"], borderRadius: tokens["radius-base"], width: menuWidth }, tokens["shadow-high"]),
|
|
6
6
|
});
|
package/dist/src/Menu/utils.js
CHANGED
|
@@ -59,12 +59,7 @@ function getLeftPosition(pos, activatorLayout, windowWidth, menuHorizontalPaddin
|
|
|
59
59
|
pos.right = 0;
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
pos.right =
|
|
63
|
-
windowWidth -
|
|
64
|
-
activatorLayout.x -
|
|
65
|
-
activatorLayout.width +
|
|
66
|
-
activatorLayout.width / 2 -
|
|
67
|
-
menuHorizontalPadding;
|
|
62
|
+
pos.right = windowWidth - activatorLayout.x - activatorLayout.width;
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
65
|
function getRightPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth) {
|
|
@@ -79,6 +74,6 @@ function getRightPosition(pos, activatorLayout, windowWidth, menuPadding, menuWi
|
|
|
79
74
|
pos.left = 0;
|
|
80
75
|
}
|
|
81
76
|
else {
|
|
82
|
-
pos.left = activatorLayout.x
|
|
77
|
+
pos.left = activatorLayout.x;
|
|
83
78
|
}
|
|
84
79
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -17,29 +17,30 @@ export * from "./Divider";
|
|
|
17
17
|
export * from "./EmptyState";
|
|
18
18
|
export * from "./ErrorMessageWrapper";
|
|
19
19
|
export * from "./Flex";
|
|
20
|
-
export * from "./FormatFile";
|
|
21
20
|
export * from "./Form";
|
|
21
|
+
export * from "./FormatFile";
|
|
22
22
|
export * from "./FormField";
|
|
23
|
+
export * from "./Glimmer";
|
|
23
24
|
export * from "./Heading";
|
|
24
25
|
export * from "./Icon";
|
|
25
26
|
export * from "./IconButton";
|
|
26
|
-
export * from "./InputFieldWrapper";
|
|
27
27
|
export * from "./InputCurrency";
|
|
28
28
|
export * from "./InputDate";
|
|
29
29
|
export * from "./InputEmail";
|
|
30
|
+
export * from "./InputFieldWrapper";
|
|
30
31
|
export * from "./InputNumber";
|
|
31
32
|
export * from "./InputPassword";
|
|
32
33
|
export * from "./InputPressable";
|
|
33
34
|
export * from "./InputSearch";
|
|
34
|
-
export * from "./InputTime";
|
|
35
35
|
export * from "./InputText";
|
|
36
|
+
export * from "./InputTime";
|
|
36
37
|
export * from "./Menu";
|
|
37
|
-
export * from "./TextList";
|
|
38
|
-
export * from "./ThumbnailList";
|
|
39
38
|
export * from "./ProgressBar";
|
|
40
39
|
export * from "./Select";
|
|
41
40
|
export * from "./StatusLabel";
|
|
42
41
|
export * from "./Switch";
|
|
43
42
|
export * from "./Text";
|
|
43
|
+
export * from "./TextList";
|
|
44
|
+
export * from "./ThumbnailList";
|
|
44
45
|
export * from "./Toast";
|
|
45
46
|
export * from "./Typography";
|