@ledvance/base 1.3.28 → 1.3.29

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.28",
7
+ "version": "1.3.29",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -3,7 +3,7 @@ import {
3
3
  DeviceInfo,
4
4
  GestureControlType,
5
5
  NativeProps,
6
- setGestrueControlValues,
6
+ setGestureControlValues,
7
7
  setGroupDevices,
8
8
  setGroupDps,
9
9
  setGroupNativeProps,
@@ -131,7 +131,7 @@ export const addListener = (store) => {
131
131
  })
132
132
 
133
133
  gestrueControlListener = nativeEventEmitter.addListener('LDV_GESTURE_CONTROL_COMMAND', (event: GestureControlType) => {
134
- store.dispatch(setGestrueControlValues(event))
134
+ store.dispatch(setGestureControlValues(event))
135
135
  })
136
136
  }
137
137
 
@@ -77,4 +77,4 @@ const styles = StyleSheet.create({
77
77
  },
78
78
  })
79
79
 
80
- export default React.memo(AdvanceList)
80
+ export default AdvanceList
@@ -181,4 +181,4 @@ const BallDirectionView = (props: BallDirectionProps) => {
181
181
  </View>)
182
182
  }
183
183
 
184
- export default withTheme(BallDirectionView)
184
+ export default withTheme(BallDirectionView) as React.ComponentType<BallDirectionProps>
@@ -38,4 +38,4 @@ const Card = (props: CardProps) => {
38
38
  )
39
39
  }
40
40
 
41
- export default withTheme(Card)
41
+ export default withTheme(Card) as React.ComponentType<CardProps>
@@ -1,70 +1,78 @@
1
- import { IconFont, Utils } from 'tuya-panel-kit'
2
- import { StyleProp, Text, TextStyle, TouchableOpacity, View, ViewStyle } from 'react-native'
1
+ import {IconFont, Utils} from 'tuya-panel-kit'
2
+ import {StyleProp, Text, TextStyle, TouchableOpacity, View, ViewStyle} from 'react-native'
3
3
  import React from 'react'
4
+ import ThemeType from "../config/themeType";
4
5
 
5
6
  const cx = Utils.RatioUtils.convertX
7
+ const {withTheme} = Utils.ThemeUtils
6
8
 
7
9
  interface CellProps {
8
- title: string,
9
- value: string,
10
- onPress: () => void,
11
- style?: StyleProp<ViewStyle>
10
+ theme?: ThemeType
11
+ title: string,
12
+ value: string,
13
+ onPress: () => void,
14
+ style?: StyleProp<ViewStyle>
12
15
  }
13
16
 
14
- export default function Cell(props: CellProps) {
15
- return (
16
- <TouchableOpacity
17
- style={[{
18
- height: cx(50),
19
- paddingHorizontal: cx(24),
20
- justifyContent: 'center',
21
- }, props.style]}
22
- onPress={props.onPress}>
23
- <CellContent title={props.title} value={props.value} />
24
- </TouchableOpacity>
25
- )
26
- }
17
+ export default withTheme(function Cell(props: CellProps) {
18
+ return (
19
+ <TouchableOpacity
20
+ style={[{
21
+ height: cx(50),
22
+ paddingHorizontal: cx(24),
23
+ justifyContent: 'center',
24
+ backgroundColor: props.theme?.card.background,
25
+ }, props.style]}
26
+ onPress={props.onPress}>
27
+ <CellContent title={props.title} value={props.value}/>
28
+ </TouchableOpacity>
29
+ )
30
+ }) as React.ComponentType<CellProps>
27
31
 
28
32
  interface CellContentProps {
29
- title: string
30
- value: string
31
- style?: StyleProp<ViewStyle>
32
- titleStyle?: StyleProp<TextStyle>
33
- valueStyle?: StyleProp<TextStyle>
34
- iconStyle?: { color?: any, size?: number }
33
+ theme?: ThemeType
34
+ title: string
35
+ value: string
36
+ style?: StyleProp<ViewStyle>
37
+ titleStyle?: StyleProp<TextStyle>
38
+ valueStyle?: StyleProp<TextStyle>
39
+ iconStyle?: { color?: any, size?: number }
40
+ }
41
+
42
+ const CellContentBase = (props: CellContentProps) => {
43
+ return (
44
+ <View
45
+ style={[
46
+ {flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center'},
47
+ props.style,
48
+ ]}>
49
+ <Text
50
+ style={[
51
+ {
52
+ fontSize: cx(14),
53
+ color: props.theme?.global.secondFontColor,
54
+ fontFamily: 'helvetica_neue_lt_std_roman',
55
+ },
56
+ props.titleStyle,
57
+ ]}>{props.title}</Text>
58
+ <View style={{flexDirection: 'row', alignItems: 'center'}}>
59
+ <Text style={[
60
+ {
61
+ fontSize: cx(14),
62
+ color: props.theme?.global.secondFontColor,
63
+ fontFamily: 'helvetica_neue_lt_std_roman',
64
+ },
65
+ props.valueStyle,
66
+ ]}>{props.value}</Text>
67
+ <View style={{width: cx(4)}}/>
68
+ <IconFont
69
+ name="arrow"
70
+ color={props.iconStyle?.color || props.theme?.global.secondFontColor}
71
+ size={props.iconStyle?.size || cx(11)}/>
72
+ </View>
73
+ </View>
74
+ )
35
75
  }
76
+ const CellContent = withTheme(CellContentBase) as React.ComponentType<CellContentProps>
36
77
 
37
- export function CellContent(props: CellContentProps) {
38
- return (
39
- <View
40
- style={[
41
- { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' },
42
- props.style,
43
- ]}>
44
- <Text
45
- style={[
46
- {
47
- fontSize: cx(14),
48
- color: '#444',
49
- fontFamily: 'helvetica_neue_lt_std_roman',
50
- },
51
- props.titleStyle,
52
- ]}>{props.title}</Text>
53
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
54
- <Text style={[
55
- {
56
- fontSize: cx(14),
57
- color: '#444',
58
- fontFamily: 'helvetica_neue_lt_std_roman',
59
- },
60
- props.valueStyle,
61
- ]}>{props.value}</Text>
62
- <View style={{ width: cx(4) }} />
63
- <IconFont
64
- name="arrow"
65
- color={props.iconStyle?.color || '#444'}
66
- size={props.iconStyle?.size || cx(11)} />
67
- </View>
68
- </View>
69
- )
70
- }
78
+ export { CellContent };
@@ -125,4 +125,4 @@ const MoodStripAdjustView = (props: MoodStripAdjustViewProps) => {
125
125
  )
126
126
  }
127
127
 
128
- export default withTheme(MoodStripAdjustView)
128
+ export default withTheme(MoodStripAdjustView) as React.ComponentType<MoodStripAdjustViewProps>
@@ -70,7 +70,7 @@ const Page = (props: PageProps) => {
70
70
 
71
71
  return (
72
72
  <>
73
- <View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme?.global.backgroud }, props.style]}>
73
+ <View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme?.global.background }, props.style]}>
74
74
  <LDVTopBar
75
75
  title={props.backText}
76
76
  onBackPress={
@@ -106,4 +106,4 @@ const Page = (props: PageProps) => {
106
106
  )
107
107
  }
108
108
 
109
- export default withTheme(Page)
109
+ export default withTheme(Page) as React.ComponentType<PageProps>
@@ -76,4 +76,4 @@ const Segmented = (props: SegmentedProps) => {
76
76
  )
77
77
  }
78
78
 
79
- export default withTheme(Segmented)
79
+ export default withTheme(Segmented) as React.ComponentType<SegmentedProps>
@@ -54,4 +54,4 @@ const styles = StyleSheet.create({
54
54
  },
55
55
  })
56
56
 
57
- export default withTheme(LdvSwitch)
57
+ export default withTheme(LdvSwitch) as React.ComponentType<Prop>
@@ -74,4 +74,4 @@ const LDVTopBar = (props: TopBarProps) => {
74
74
  )
75
75
  }
76
76
 
77
- export default withTheme(LDVTopBar)
77
+ export default withTheme(LDVTopBar) as React.ComponentType<TopBarProps>
@@ -95,4 +95,4 @@ const WeekSelect = (props) => {
95
95
  </View>)
96
96
  }
97
97
 
98
- export default withTheme(WeekSelect)
98
+ export default withTheme(WeekSelect) as React.ComponentType<any>