@jobber/components-native 0.51.5 → 0.51.6-JOB-88274.7
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 +2 -2
- package/dist/src/InputDate/InputDate.js +1 -1
- package/dist/src/InputFieldWrapper/CommonInputStyles.style.js +3 -2
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +2 -5
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +2 -0
- package/dist/src/InputPressable/InputPressable.js +2 -2
- package/dist/src/InputSearch/InputSearch.style.js +0 -2
- package/dist/src/InputTime/InputTime.js +1 -1
- package/dist/src/Select/Select.js +1 -1
- package/dist/src/Select/Select.style.js +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/InputFieldWrapper/CommonInputStyles.style.d.ts +2 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +4 -1
- package/dist/types/src/InputPressable/InputPressable.d.ts +5 -1
- package/dist/types/src/InputSearch/InputSearch.style.d.ts +0 -1
- package/dist/types/src/Select/Select.style.d.ts +5 -1
- package/package.json +2 -2
- package/src/InputDate/InputDate.tsx +1 -0
- package/src/InputFieldWrapper/CommonInputStyles.style.ts +3 -2
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +2 -0
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +1 -3
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +1 -9
- package/src/InputPressable/InputPressable.tsx +7 -1
- package/src/InputSearch/InputSearch.style.ts +0 -2
- package/src/InputTime/InputTime.tsx +1 -0
- package/src/Select/Select.style.ts +3 -0
- package/src/Select/Select.tsx +1 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.6-JOB-88274.7+b7b85ba2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-native-reanimated": "^2.17.0",
|
|
85
85
|
"react-native-safe-area-context": "^4.5.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "b7b85ba202558ffdcb7ecad60cdd1104575e81d3"
|
|
88
88
|
}
|
|
@@ -44,7 +44,7 @@ function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, in
|
|
|
44
44
|
const canClearDate = formattedDate === emptyValueLabel ? "never" : clearable;
|
|
45
45
|
const placeholderLabel = placeholder !== null && placeholder !== void 0 ? placeholder : t("date");
|
|
46
46
|
return (React.createElement(React.Fragment, null,
|
|
47
|
-
React.createElement(InputPressable, { clearable: canClearDate, disabled: disabled, invalid: invalid, placeholder: placeholderLabel, prefix: { icon: "calendar" }, value: formattedDate, onClear: handleClear, onPress: showDatePicker, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint }),
|
|
47
|
+
React.createElement(InputPressable, { focused: showPicker, clearable: canClearDate, disabled: disabled, invalid: invalid, placeholder: placeholderLabel, prefix: { icon: "calendar" }, value: formattedDate, onClear: handleClear, onPress: showDatePicker, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint }),
|
|
48
48
|
React.createElement(DateTimePicker, { testID: "inputDate-datePicker", date: date || undefined, display: display, isVisible: showPicker, maximumDate: maxDate, minimumDate: minDate, mode: "date", confirmTextIOS: t("confirm"), cancelTextIOS: t("cancel"), locale: locale, onCancel: handleCancel, onConfirm: handleConfirm })));
|
|
49
49
|
function showDatePicker() {
|
|
50
50
|
setShowPicker(true);
|
|
@@ -26,8 +26,9 @@ export const commonInputStyles = StyleSheet.create({
|
|
|
26
26
|
flexDirection: "row",
|
|
27
27
|
justifyContent: "space-between",
|
|
28
28
|
width: "100%",
|
|
29
|
-
borderColor: tokens["color-
|
|
29
|
+
borderColor: tokens["color-border"],
|
|
30
30
|
borderStyle: "solid",
|
|
31
|
-
|
|
31
|
+
borderWidth: tokens["border-base"],
|
|
32
|
+
paddingLeft: tokens["space-base"],
|
|
32
33
|
},
|
|
33
34
|
});
|
|
@@ -32,7 +32,7 @@ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveTex
|
|
|
32
32
|
showClearAction &&
|
|
33
33
|
styles.miniLabelShowClearAction,
|
|
34
34
|
], pointerEvents: "none" },
|
|
35
|
-
React.createElement(Placeholder, { placeholder: placeholder, labelVariation: getLabelVariation(error, invalid,
|
|
35
|
+
React.createElement(Placeholder, { placeholder: placeholder, labelVariation: getLabelVariation(error, invalid, disabled), hasMiniLabel: hasMiniLabel, styleOverride: styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.placeholderText })),
|
|
36
36
|
(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 })),
|
|
37
37
|
children,
|
|
38
38
|
(showClearAction || (suffix === null || suffix === void 0 ? void 0 : suffix.label) || (suffix === null || suffix === void 0 ? void 0 : suffix.icon)) && (React.createElement(View, { style: styles.inputEndContainer },
|
|
@@ -41,16 +41,13 @@ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveTex
|
|
|
41
41
|
(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 })))))),
|
|
42
42
|
assistiveText && !error && !invalid && (React.createElement(Text, { level: "textSupporting", variation: disabled ? "disabled" : focused ? "interactive" : "subdued" }, assistiveText))));
|
|
43
43
|
}
|
|
44
|
-
function getLabelVariation(error, invalid,
|
|
44
|
+
function getLabelVariation(error, invalid, disabled) {
|
|
45
45
|
if (invalid || error) {
|
|
46
46
|
return "error";
|
|
47
47
|
}
|
|
48
48
|
else if (disabled) {
|
|
49
49
|
return "disabled";
|
|
50
50
|
}
|
|
51
|
-
else if (focused) {
|
|
52
|
-
return "interactive";
|
|
53
|
-
}
|
|
54
51
|
return "subdued";
|
|
55
52
|
}
|
|
56
53
|
function fieldAffixRequiredPropsCheck(affixPair) {
|
|
@@ -61,10 +61,12 @@ export const styles = StyleSheet.create({
|
|
|
61
61
|
},
|
|
62
62
|
suffixIcon: {
|
|
63
63
|
justifyContent: "center",
|
|
64
|
+
paddingRight: tokens["space-small"],
|
|
64
65
|
},
|
|
65
66
|
suffixLabel: {
|
|
66
67
|
justifyContent: "center",
|
|
67
68
|
paddingTop: tokens["space-minuscule"],
|
|
69
|
+
paddingRight: tokens["space-small"],
|
|
68
70
|
},
|
|
69
71
|
suffixIconMargin: {
|
|
70
72
|
marginLeft: tokens["space-small"] + tokens["space-smaller"],
|
|
@@ -4,7 +4,7 @@ import { useShowClear } from "@jobber/hooks";
|
|
|
4
4
|
import { styles } from "./InputPressable.style";
|
|
5
5
|
import { InputFieldWrapper, commonInputStyles } from "../InputFieldWrapper";
|
|
6
6
|
export const InputPressable = forwardRef(InputPressableInternal);
|
|
7
|
-
export function InputPressableInternal({ value, placeholder, disabled, invalid, error, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable = "never", onClear, }, ref) {
|
|
7
|
+
export function InputPressableInternal({ value, placeholder, disabled, invalid, error, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable = "never", onClear, focused, }, ref) {
|
|
8
8
|
const hasValue = !!value;
|
|
9
9
|
const [hasMiniLabel, setHasMiniLabel] = useState(Boolean(value));
|
|
10
10
|
useEffect(() => {
|
|
@@ -17,7 +17,7 @@ export function InputPressableInternal({ value, placeholder, disabled, invalid,
|
|
|
17
17
|
hasValue,
|
|
18
18
|
disabled,
|
|
19
19
|
});
|
|
20
|
-
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, focused:
|
|
20
|
+
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, focused: focused, error: error, invalid: invalid, placeholder: placeholder, disabled: disabled, showClearAction: showClear, onClear: onClear },
|
|
21
21
|
React.createElement(Pressable, { style: styles.pressable, onPress: onPress, disabled: disabled, accessibilityLabel: accessibilityLabel || placeholder, accessibilityHint: accessibilityHint, accessibilityValue: { text: value } },
|
|
22
22
|
React.createElement(NativeText, { style: [
|
|
23
23
|
commonInputStyles.input,
|
|
@@ -42,7 +42,7 @@ function InternalInputTime({ clearable = "always", disabled, emptyValueLabel, in
|
|
|
42
42
|
}, [dateTime, emptyValueLabel]);
|
|
43
43
|
const canClearTime = formattedTime === emptyValueLabel ? "never" : clearable;
|
|
44
44
|
return (React.createElement(View, { style: styles.container },
|
|
45
|
-
React.createElement(InputPressable, { clearable: canClearTime, disabled: disabled, invalid: invalid, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t("time"), prefix: showIcon ? { icon: "timer" } : undefined, value: formattedTime, onClear: handleClear, onPress: showDatePicker }),
|
|
45
|
+
React.createElement(InputPressable, { clearable: canClearTime, disabled: disabled, invalid: invalid, focused: showPicker, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t("time"), prefix: showIcon ? { icon: "timer" } : undefined, value: formattedTime, onClear: handleClear, onPress: showDatePicker }),
|
|
46
46
|
React.createElement(DateTimePicker, { testID: "inputTime-Picker", minuteInterval: getMinuteInterval(type), date: getInitialPickerDate(dateTime), timeZoneOffsetInMinutes: getTimeZoneOffsetInMinutes(timeZone, dateTime), isVisible: showPicker, mode: "time", onCancel: handleCancel, onConfirm: handleConfirm, is24Hour: is24Hour, locale: is24Hour ? LOCALE_24_HOURS : LOCALE_12_HOURS })));
|
|
47
47
|
function showDatePicker() {
|
|
48
48
|
setShowPicker(true);
|
|
@@ -22,7 +22,7 @@ export function Select({ value, defaultValue, onChange, children, placeholder, l
|
|
|
22
22
|
const valueTextVariation = disabled ? "disabled" : undefined;
|
|
23
23
|
const hasValue = internalValue && (internalValue === null || internalValue === void 0 ? void 0 : internalValue.length) > 0;
|
|
24
24
|
return (React.createElement(InputFieldWrapper, { error: error, invalid: invalid || !!error, hasValue: hasValue, styleOverride: {
|
|
25
|
-
container: {
|
|
25
|
+
container: { paddingLeft: undefined },
|
|
26
26
|
} },
|
|
27
27
|
React.createElement(View, { testID: getTestID(testID), accessible: true, accessibilityLabel: getA11yLabel(), accessibilityValue: { text: getValue() }, accessibilityHint: t("Select.a11yHint"), accessibilityRole: "button", accessibilityState: { disabled: disabled } },
|
|
28
28
|
React.createElement(SelectInternalPicker, { disabled: disabled, options: getOptions(), onChange: handleChange },
|
|
@@ -8,6 +8,8 @@ export const styles = StyleSheet.create({
|
|
|
8
8
|
flexDirection: "column",
|
|
9
9
|
justifyContent: "flex-end",
|
|
10
10
|
minHeight: tokens["space-largest"] + tokens["border-base"],
|
|
11
|
+
marginVertical: 0,
|
|
12
|
+
borderWidth: 0,
|
|
11
13
|
},
|
|
12
14
|
]),
|
|
13
15
|
input: StyleSheet.flatten([
|
|
@@ -18,6 +20,7 @@ export const styles = StyleSheet.create({
|
|
|
18
20
|
paddingBottom: tokens["space-smaller"],
|
|
19
21
|
minHeight: 0,
|
|
20
22
|
minWidth: "100%",
|
|
23
|
+
paddingRight: tokens["space-small"],
|
|
21
24
|
},
|
|
22
25
|
]),
|
|
23
26
|
value: {
|