@momo-kits/stepper 0.167.2-beta.1 → 0.168.1-beta.1

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/NumberView.tsx CHANGED
@@ -30,23 +30,20 @@ const NumberView: FC<StepperValueProps> = ({
30
30
  }
31
31
  };
32
32
 
33
- const textColor = disabled
34
- ? theme.colors.text.disable
35
- : theme.colors.text.default;
33
+ const { colors } = theme;
34
+ const textColor = disabled ? colors.text.disable : colors.text.default;
36
35
 
37
- const borderColor = disabled
38
- ? theme.colors.border.disable
39
- : theme.colors.border.default;
36
+ const borderColor = disabled ? colors.border.disable : colors.border.default;
37
+
38
+ const isLarge = size === 'large';
39
+ const isWeb = Platform.OS === 'web';
40
+ const inputWidth = isLarge ? 32 : 28;
41
+ const sizeStyle = {
42
+ height: isLarge ? scaledHeight28 : scaledHeight24,
43
+ ...(isWeb ? { width: inputWidth } : { minWidth: inputWidth }),
44
+ };
40
45
  return (
41
- <View
42
- style={[
43
- styles.numberViewBase,
44
- size === 'large'
45
- ? { height: scaledHeight28, ...(Platform.OS === 'web' ? { width: 32 } : { minWidth: 32 }) }
46
- : { height: scaledHeight24, ...(Platform.OS === 'web' ? { width: 28 } : { minWidth: 28 }) },
47
- { borderColor },
48
- ]}
49
- >
46
+ <View style={[styles.numberViewBase, sizeStyle, { borderColor }]}>
50
47
  <TextInput
51
48
  allowFontScaling={false}
52
49
  editable={editable}
@@ -58,7 +55,7 @@ const NumberView: FC<StepperValueProps> = ({
58
55
  value={formattedNumber(value)}
59
56
  onChangeText={onValueChange}
60
57
  keyboardType={'number-pad'}
61
- selectionColor={theme.colors.primary}
58
+ selectionColor={colors.primary}
62
59
  accessibilityLabel={`${componentId}|input`}
63
60
  accessibilityState={{ disabled }}
64
61
  />
package/StepperButton.tsx CHANGED
@@ -13,12 +13,14 @@ const StepperButton: FC<StepperButtonProps> = ({
13
13
  }) => {
14
14
  const {theme} = useContext(ApplicationContext);
15
15
 
16
+ const colors = theme.colors;
17
+
16
18
  const sizeStyle = size === 'large' ? styles.button : styles.smallButton;
17
- const buttonIcon =
18
- sign === '-' ? '24_navigation_minus_circle' : '24_navigation_plus_circle';
19
- const buttonColor = disabled
20
- ? theme.colors.text.disable
21
- : theme.colors.primary;
19
+ let buttonIcon = '24_navigation_plus_circle';
20
+ if (sign === '-') {
21
+ buttonIcon = '24_navigation_minus_circle';
22
+ }
23
+ const buttonColor = disabled ? colors.text.disable : colors.primary;
22
24
 
23
25
  return (
24
26
  <TouchableOpacity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/stepper",
3
- "version": "0.167.2-beta.1",
3
+ "version": "0.168.1-beta.1",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {