@ledvance/base 1.3.78 → 1.3.79

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.
Files changed (45) hide show
  1. package/localazy.json +4 -1
  2. package/package.json +1 -1
  3. package/src/components/AdvanceCard.tsx +3 -1
  4. package/src/components/Card.tsx +1 -1
  5. package/src/components/Cell.tsx +2 -0
  6. package/src/components/ColorAdjustView.tsx +1 -1
  7. package/src/components/ColorTempAdjustView.tsx +3 -3
  8. package/src/components/DeleteButton.tsx +4 -1
  9. package/src/components/DrawToolView.tsx +1 -0
  10. package/src/components/HybridSwitchView.tsx +3 -0
  11. package/src/components/OptionGroup.tsx +6 -1
  12. package/src/components/OsramFanAdjustView.tsx +93 -0
  13. package/src/components/Page.tsx +5 -1
  14. package/src/components/Popup.tsx +2 -0
  15. package/src/components/Segmented.tsx +3 -0
  16. package/src/components/SocketItem.tsx +9 -1
  17. package/src/components/Stepper.tsx +6 -0
  18. package/src/components/StripAdjustView.tsx +2 -0
  19. package/src/components/Tag.tsx +12 -8
  20. package/src/components/TextButton.tsx +3 -1
  21. package/src/components/TextField.tsx +3 -2
  22. package/src/components/TextFieldStyleButton.tsx +2 -2
  23. package/src/components/UATabs.tsx +3 -0
  24. package/src/components/ldvColorBrightness.tsx +4 -1
  25. package/src/components/ldvColorSlider.tsx +2 -1
  26. package/src/components/ldvPickerView.tsx +4 -0
  27. package/src/components/ldvPresetView.tsx +3 -1
  28. package/src/components/ldvSaturation.tsx +3 -1
  29. package/src/components/ldvSlider.tsx +8 -3
  30. package/src/components/ldvSwitch.tsx +2 -2
  31. package/src/components/ldvTemperatureSlider.tsx +4 -2
  32. package/src/components/ldvTopBar.tsx +3 -1
  33. package/src/components/ldvTopName.tsx +1 -0
  34. package/src/components/rect-color-and-bright-picker/ColourPicker.tsx +2 -0
  35. package/src/components/rect-color-and-bright-picker/RectPicker.tsx +7 -0
  36. package/src/components/rect-color-and-bright-picker/Slider.tsx +3 -1
  37. package/src/components/rect-color-and-bright-picker/WhitePicker.tsx +50 -1
  38. package/src/components/rect-color-and-bright-picker/utils/storage.ts +97 -0
  39. package/src/components/segmentControl.tsx +11 -4
  40. package/src/components/weekSelect.tsx +3 -0
  41. package/src/i18n/strings.ts +116 -32
  42. package/src/utils/interface.ts +1 -1
  43. package/translateKey.txt +4 -1
  44. package/src/components/ShowSelect.d.ts +0 -1
  45. package/src/components/ShowSelect.tsx +0 -159
package/localazy.json CHANGED
@@ -1200,7 +1200,10 @@
1200
1200
  "MATCH:setting_set_passwd",
1201
1201
  "MATCH:camera_user",
1202
1202
  "MATCH:camera_motiondetection",
1203
- "MATCH:camera_motiondetectiondescription"
1203
+ "MATCH:camera_motiondetectiondescription",
1204
+ "MATCH:wifi_repeater_title",
1205
+ "MATCH:wifi_repeater_description",
1206
+ "MATCH:wifi_repeater_group_tips"
1204
1207
  ],
1205
1208
  "replacements": {
1206
1209
  "REGEX:% %1\\$s.*?\\)%": "{0}",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.78",
7
+ "version": "1.3.79",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -53,6 +53,8 @@ const AdvanceCard = (props: AdvanceCardProps) => {
53
53
  onPress={props.onPress}>
54
54
  {!!statusColor && <View style={styles.dotBg}>
55
55
  <View
56
+ accessibilityLabel={"StatusDot"}
57
+ accessibilityHint={statusColor}
56
58
  style={[
57
59
  styles.dot,
58
60
  {backgroundColor: props.data.statusColor},
@@ -61,7 +63,7 @@ const AdvanceCard = (props: AdvanceCardProps) => {
61
63
  {
62
64
  props.children ?
63
65
  props.children :
64
- <View style={styles.titleBg}>
66
+ <View accessibilityLabel='AdvanceCard' accessibilityHint={props.data.title} style={styles.titleBg}>
65
67
  <Text style={{...styles.title, color: props.theme?.global.fontColor}}>{props.data.title}</Text>
66
68
  <Spacer height={cx(8)} />
67
69
  {
@@ -32,7 +32,7 @@ const Card = (props: CardProps) => {
32
32
  },
33
33
  borderRadius: cx(10),
34
34
  }, props.style]}>
35
- <TouchableOpacity disabled={!(!!props.onPress)} onPress={props.onPress} onLongPress={props.onLongPress}>
35
+ <TouchableOpacity accessible={false} disabled={!(!!props.onPress)} onPress={props.onPress} onLongPress={props.onLongPress}>
36
36
  <View style={props.containerStyle}>{props.children}</View>
37
37
  </TouchableOpacity>
38
38
  </View>
@@ -17,6 +17,8 @@ interface CellProps {
17
17
  export default withTheme(function Cell(props: CellProps) {
18
18
  return (
19
19
  <TouchableOpacity
20
+ accessibilityLabel={"Cell"}
21
+ accessibilityHint={props.value}
20
22
  style={[{
21
23
  height: cx(50),
22
24
  paddingHorizontal: cx(24),
@@ -70,7 +70,7 @@ const NewColorPicker = React.memo((props: ColorAdjustViewProps) => {
70
70
  }}>
71
71
  <RectColorAndBrightPicker.ColourPicker
72
72
  value={hsv}
73
- brightOption={{min: scaleUp(minBrightnessValue), minPercent: minBrightness ? minBrightness : 0}}
73
+ brightOption={{min: scaleUp(minBrightnessValue), minPercent: minBrightnessValue ? minBrightnessValue : 0}}
74
74
  onGrant={() => state.moving = true}
75
75
  onMove={handleMove}
76
76
  onRelease={handleComplete}
@@ -92,15 +92,15 @@ const NewColorTempPicker = React.memo((props: ColorTempAdjustViewProps) => {
92
92
  {
93
93
  isSupportTemperature ? <RectColorAndBrightPicker.WhitePicker
94
94
  value={white}
95
- brightOption={{min: scaleUp(minBrightnessValue), minPercent: minBrightness ? minBrightness : 0}}
95
+ brightOption={{min: scaleUp(minBrightnessValue), minPercent: minBrightnessValue ? minBrightnessValue : 0}}
96
96
  onGrant={() => state.moving = true}
97
97
  onMove={handleMove}
98
98
  onRelease={handleComplete}
99
99
  onPress={handleComplete}
100
100
  /> : <RectColorAndBrightPicker.BrightnessSlider
101
101
  value={stateBrightness}
102
- min={minBrightnessValue}
103
- minPercent={minBrightness ? minBrightness : 0}
102
+ min={scaleUp(minBrightnessValue)}
103
+ minPercent={minBrightnessValue ? minBrightnessValue : 0}
104
104
  clickEnabled={true}
105
105
  onGrant={() => state.moving = true}
106
106
  onMove={handleBrightnessMove}
@@ -19,8 +19,11 @@ const DeleteButton = (props: DeleteButtonProps) => {
19
19
  const { text, onPress, style, textStyle, disabled } = props
20
20
  return (
21
21
  <TouchableOpacity
22
+ accessibilityLabel={"DeleteButton"}
23
+ accessibilityHint={text}
24
+ accessibilityState={{disabled}}
22
25
  disabled={disabled}
23
- onPress={onPress}
26
+ onPress={disabled ? undefined : onPress}
24
27
  style={[{
25
28
  width: '100%',
26
29
  height: cx(50),
@@ -250,6 +250,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
250
250
  text={I18n.getLang('auto_scan_system_wifi_confirm')}
251
251
  style={{ width: cx(150), height: cx(40), backgroundColor: ledNumValidator(state.ledNum) ? props.theme?.button.primary : props.theme?.button.disabled }}
252
252
  textStyle={{ fontSize: cx(14) }}
253
+ disabled={!ledNumValidator(state.ledNum)}
253
254
  onPress={() => {
254
255
  if (!ledNumValidator(state.ledNum)) return
255
256
  props.setLedNum(state.ledNum)
@@ -91,6 +91,9 @@ const HybridSwitchView = (props: HybridSwitchViewProps) => {
91
91
  <View style={styles.container}>
92
92
  {props.switchChannels.map((channel, index) => (
93
93
  <TouchableOpacity
94
+ accessibilityLabel={"HybridSwitch"}
95
+ accessibilityHint={`${index}`}
96
+ accessibilityState={{checked: channel}}
94
97
  key={index}
95
98
  activeOpacity={Platform.OS === 'ios' ? 0.5 : 0.9}
96
99
  onPress={() => {
@@ -71,7 +71,12 @@ const OptionGroup = (props: OptionGroupProps) => {
71
71
 
72
72
  const OptionItem = (props: OptionItemProps) => {
73
73
  return (
74
- <TouchableOpacity onPress={() => props.onPress && props.onPress(props.value)}>
74
+ <TouchableOpacity
75
+ accessibilityLabel={"OptionItem"}
76
+ accessibilityHint={props.value}
77
+ accessibilityState={{checked: props.enable}}
78
+ onPress={() => props.onPress && props.onPress(props.value)}
79
+ >
75
80
  <View style={styles.itemRoot}>
76
81
  <View style={styles.itemTextGroup}>
77
82
  <Text style={styles.itemTitle}>{props.title}</Text>
@@ -0,0 +1,93 @@
1
+ import React from "react"
2
+ import { View, Text, TouchableOpacity, Image } from "react-native"
3
+ import LdvSwitch from "./ldvSwitch"
4
+ import I18n from "@i18n"
5
+ import LdvSlider from "./ldvSlider"
6
+ import Spacer from "./Spacer"
7
+ import ThemeType from "config/themeType"
8
+ import { Utils } from "tuya-panel-kit"
9
+ import Popup from "./Popup"
10
+ import res from "@res"
11
+ import Segmented from "./Segmented"
12
+
13
+ const cx = Utils.RatioUtils.convertX
14
+ const { withTheme } = Utils.ThemeUtils
15
+
16
+ interface OsramFanAdjustProps {
17
+ theme?: ThemeType
18
+ hideFanSwitch?: boolean
19
+ fanSwitch: boolean
20
+ setFanSwitch: (v: boolean) => void
21
+ fanSpeed: number
22
+ minSpeed?: number
23
+ maxSpeed?: number
24
+ onFanSpeedChange?: (v: number) => void
25
+ setFanSpeed: (v: number) => void
26
+ fanMode: 'fresh' | 'nature'
27
+ setFanMode: (v: 'fresh' | 'nature') => void
28
+ }
29
+
30
+ const OsramFanAdjustView = (props: OsramFanAdjustProps) => {
31
+ const { hideFanSwitch = false, fanSwitch, setFanSwitch, fanSpeed, onFanSpeedChange, setFanSpeed, minSpeed = 1, maxSpeed = 3, fanMode, setFanMode } = props
32
+ return (
33
+ <View>
34
+ {
35
+ !hideFanSwitch && <LdvSwitch
36
+ title={I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline')}
37
+ enable={fanSwitch}
38
+ setEnable={setFanSwitch}
39
+ />
40
+ }
41
+ {
42
+ fanSwitch && (
43
+ <>
44
+ <LdvSlider
45
+ title={I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_text')}
46
+ subTitleStr={`${fanSpeed}/${maxSpeed}`}
47
+ value={fanSpeed}
48
+ min={minSpeed}
49
+ max={maxSpeed}
50
+ onValueChange={onFanSpeedChange}
51
+ onSlidingComplete={setFanSpeed}
52
+ />
53
+ <Spacer />
54
+ <View style={{ marginHorizontal: cx(16) }}>
55
+ <View style={{ flexDirection: 'row', marginBottom: cx(2), alignItems: 'center' }}>
56
+ <Text style={{ marginRight: cx(5), color: props.theme?.global.fontColor }}>{I18n.getLang('ceiling_fan_tile_uvc_fan_mode')}</Text>
57
+ <TouchableOpacity onPress={() => Popup({
58
+ title: I18n.getLang('ceiling_fan_mode_info_headline'),
59
+ confirmText: I18n.getLang('ceiling_fan_direction_info_button_label'),
60
+ content: <View>
61
+ <Text style={{
62
+ fontWeight: 'bold',
63
+ color: props.theme?.global.fontColor,
64
+ }}>{I18n.getLang('ceiling_fan_mode_info_description_text')}</Text>
65
+ <Spacer />
66
+ <Text style={{ color: props.theme?.global.fontColor }}>{I18n.getLang('ceiling_fan_mode_info_option_1_headline')}</Text>
67
+ <Text style={{ color: props.theme?.global.fontColor }}>{I18n.getLang('ceiling_fan_mode_info_option_1_text')}</Text>
68
+ <Spacer />
69
+ <Text style={{ color: props.theme?.global.fontColor }}>{I18n.getLang('ceiling_fan_mode_info_option_2_headline')}</Text>
70
+ <Text style={{ color: props.theme?.global.fontColor }}>{I18n.getLang('ceiling_fan_mode_info_option_2_text')}</Text>
71
+ </View>,
72
+ })}>
73
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.icon.primary }} source={{ uri: res.ic_info }} />
74
+ </TouchableOpacity>
75
+ </View>
76
+ <Segmented
77
+ options={[
78
+ { label: I18n.getLang('ceiling_fan_tile_uvc_fan_mode_opt_1'), value: 'fresh' },
79
+ { label: I18n.getLang('ceiling_fan_tile_uvc_fan_mode_opt_2'), value: 'nature' },
80
+ ]}
81
+ value={fanMode}
82
+ onChange={setFanMode}
83
+ />
84
+ </View>
85
+ <Spacer />
86
+ </>
87
+ )
88
+ }
89
+ </View>
90
+ )
91
+ }
92
+
93
+ export default withTheme(OsramFanAdjustView)
@@ -70,7 +70,11 @@ const Page = (props: PageProps) => {
70
70
 
71
71
  return (
72
72
  <>
73
- <View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme?.global.background }, props.style]}>
73
+ <View
74
+ accessibilityLabel='Page'
75
+ accessibilityHint={props.headlineText}
76
+ style={[{ flex: 1, position: 'relative', backgroundColor: props.theme?.global.background }, props.style]}
77
+ >
74
78
  <LDVTopBar
75
79
  title={props.backText}
76
80
  onBackPress={
@@ -26,6 +26,8 @@ const InformationPopup = (props: InformationPopupProps) => {
26
26
  }}>{props.title}</Text>
27
27
  </View>
28
28
  <TouchableOpacity
29
+ accessibilityLabel='PopupCloseButton'
30
+ accessibilityHint={props.confirmText}
29
31
  style={{
30
32
  flexDirection: 'column-reverse',
31
33
  alignItems: 'center',
@@ -57,6 +57,9 @@ const Segmented = (props: SegmentedProps) => {
57
57
  <View style={[styles.wrap_container, props.style]}>
58
58
  {props.options && props.options.map((item, idx) => (
59
59
  <TouchableOpacity
60
+ accessibilityLabel={"Segmented"}
61
+ accessibilityHint={item.value}
62
+ accessibilityState={{checked: item.value === props.value}}
60
63
  style={[
61
64
  styles.segmented_item,
62
65
  idx === 0 && styles.segmented_item_first,
@@ -13,6 +13,7 @@ interface SocketItemProps extends PropsWithChildren<ViewProps>{
13
13
  theme?: ThemeType
14
14
  title: string
15
15
  name: string
16
+ placeholder?: string
16
17
  icon?: any
17
18
  disabledEdit?: boolean
18
19
  onNameChange: (value: string) => void
@@ -65,12 +66,19 @@ function SocketItem(props: SocketItemProps) {
65
66
  onValueChange={props.onSwitchChange} />
66
67
  </View>
67
68
  <TouchableOpacity
69
+ accessibilityLabel={"Description"}
70
+ accessibilityHint={props.name}
68
71
  style={styles.nameLine}
69
72
  onPress={() => {
70
73
  if(props.disabledEdit) return
71
74
  Dialog.prompt({
72
75
  title: I18n.getLang('routines_add_edit_name'),
73
76
  value: props.name,
77
+ accessibilityLabel: "DialogInput",
78
+ accessibilityHint: props.name,
79
+ confirmAccessibilityLabel: "DialogConfirm",
80
+ cancelAccessibilityLabel: "DialogCancel",
81
+ placeholder: props.placeholder,
74
82
  cancelText: I18n.getLang('auto_scan_system_cancel'),
75
83
  confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
76
84
  inputWrapperStyle: {backgroundColor: props.theme?.textInput.background, borderRadius: cx(10)},
@@ -83,7 +91,7 @@ function SocketItem(props: SocketItemProps) {
83
91
  },
84
92
  })
85
93
  }}>
86
- <Text style={styles.name}>{props.name}</Text>
94
+ <Text style={styles.name}>{props.name || props.placeholder}</Text>
87
95
  </TouchableOpacity>
88
96
  <Spacer height={cx(16)} />
89
97
  {props.children}
@@ -111,12 +111,16 @@ const Stepper = (props: StepperProps) => {
111
111
  return (
112
112
  <View style={[styles.stepperContainer, props.style]}>
113
113
  <TouchableOpacity
114
+ accessibilityLabel={"StepperMinusButton"}
115
+ accessibilityHint={`${state.value}`}
114
116
  style={[styles.stepperButton, props.buttonStyle]}
115
117
  onPress={() => handlePress(false)}
116
118
  >
117
119
  <Image style={styles.stepperIcon} source={{uri: res.ic_minus}} />
118
120
  </TouchableOpacity>
119
121
  <TextInput
122
+ accessibilityLabel={"StepperInput"}
123
+ accessibilityHint={`${state.value}`}
120
124
  style={[styles.stepperInput, props.inputStyle]}
121
125
  value={state.value.toString()}
122
126
  keyboardType="numeric"
@@ -127,6 +131,8 @@ const Stepper = (props: StepperProps) => {
127
131
  editable={props.editable || props.disabled}
128
132
  />
129
133
  <TouchableOpacity
134
+ accessibilityLabel={"StepperPlusButton"}
135
+ accessibilityHint={`${state.value}`}
130
136
  style={[styles.stepperButton, props.buttonStyle]}
131
137
  onPress={() => handlePress(true)}
132
138
  >
@@ -6,6 +6,7 @@ import Spacer from "./Spacer";
6
6
  import { TabBar, Utils } from "tuya-panel-kit";
7
7
  import { ColorDisk } from "@tuya/tuya-panel-lamp-sdk";
8
8
  import res from "../res";
9
+ import ThemeType from "../config/themeType";
9
10
  const { convertX: cx } = Utils.RatioUtils
10
11
  const { withTheme } = Utils.ThemeUtils
11
12
 
@@ -14,6 +15,7 @@ type TabsNode = {
14
15
  title: string
15
16
  }
16
17
  interface StripAdjustViewProps extends ColorAdjustViewProps, ColorTempAdjustViewProps {
18
+ theme?: ThemeType
17
19
  lampTabs: TabsNode[]
18
20
  activeKey: number | string
19
21
  onActiveKeyChange: (key: number | string) => void
@@ -1,6 +1,6 @@
1
- import {Image, StyleSheet, Text, TouchableOpacity, View, ViewProps} from 'react-native'
1
+ import { Image, StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-native'
2
2
  import React from 'react'
3
- import {Utils} from 'tuya-panel-kit'
3
+ import { Utils } from 'tuya-panel-kit'
4
4
  import res from '../res'
5
5
  import ThemeType from '../config/themeType'
6
6
 
@@ -49,13 +49,17 @@ const Tag = (props: TagProps) => {
49
49
  onPress={() => {
50
50
  props.onCheckedChange(!props.checked)
51
51
  }}>
52
- <View style={[styles.root, props.checked ? styles.checked : styles.uncheck, props.style]}>
53
- <Text style={[styles.text, {marginEnd: cx(props.checked ? 4 : 12)}]}>{props.text}</Text>
52
+ <View
53
+ accessibilityLabel={"Tag"}
54
+ accessibilityHint={props.text}
55
+ accessibilityState={{ checked: props.checked }}
56
+ style={[styles.root, props.checked ? styles.checked : styles.uncheck, props.style]}
57
+ >
58
+ <Text style={[styles.text, { marginEnd: cx(props.checked ? 4 : 12) }]}>
59
+ {props.text}
60
+ </Text>
54
61
  {
55
- props.checked &&
56
- <Image
57
- source={{uri: res.ic_arrows_nav_clear}}
58
- style={styles.icon}/>
62
+ props.checked ? <Image accessibilityLabel='TagClearIcon' source={{ uri: res.ic_arrows_nav_clear }} style={styles.icon} /> : <></>
59
63
  }
60
64
  </View>
61
65
  </TouchableOpacity>
@@ -14,6 +14,8 @@ interface TextButtonProps {
14
14
  export default function TextButton(props: TextButtonProps) {
15
15
  return (
16
16
  <TouchableOpacity
17
+ accessibilityLabel={"TextButton"}
18
+ accessibilityHint={props.text}
17
19
  style={[{
18
20
  justifyContent: 'center',
19
21
  alignItems: 'center',
@@ -29,4 +31,4 @@ export default function TextButton(props: TextButtonProps) {
29
31
  }, props.textStyle]}>{props.text}</Text>
30
32
  </TouchableOpacity>
31
33
  )
32
- }
34
+ }
@@ -70,14 +70,15 @@ const TextField = (props: TextFieldProps) => {
70
70
  <View style={props.style}>
71
71
  <Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
72
72
  <View style={styles.textInputGroup}>
73
- <TextInput{...props} style={styles.textInput} />
73
+ <TextInput {...props} accessibilityLabel={"TextInput"} accessibilityHint={props.value} style={styles.textInput} />
74
74
  {!!props.value && editable &&
75
75
  <TouchableOpacity
76
+ accessibilityLabel={"TextInputClearButton"}
76
77
  style={styles.iconTouchable}
77
78
  onPress={() => {
78
79
  props.onChangeText && props.onChangeText('')
79
80
  }}>
80
- <Image source={{ uri: res.ic_cancel }} style={styles.icon} />
81
+ <Image source={{uri: res.ic_cancel}} style={styles.icon}/>
81
82
  </TouchableOpacity>
82
83
  }
83
84
  <View style={styles.line} />
@@ -67,11 +67,11 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
67
67
  <View style={props.style}>
68
68
  <View style={styles.tipParent}>
69
69
  <Text style={styles.topTip}>{props.placeholder}</Text>
70
- {props.showTipIcon && <TouchableOpacity onPress={props.onTipIconPress}>
70
+ {props.showTipIcon && <TouchableOpacity accessibilityLabel={"TipIcon"} onPress={props.onTipIconPress}>
71
71
  <Image source={{uri: res.ic_info}} style={styles.tipIcon}/>
72
72
  </TouchableOpacity>}
73
73
  </View>
74
- <TouchableOpacity onPress={props.onPress}>
74
+ <TouchableOpacity accessibilityLabel={"TextFieldStyleButton"} accessibilityHint={props.text} onPress={props.onPress}>
75
75
  <View style={styles.textGroup}>
76
76
  <View style={styles.textParent}>
77
77
  <Text style={styles.text}>{props.text}</Text>
@@ -54,6 +54,9 @@ const UATabs = (props: UATabsProps) => {
54
54
  const active = props.active === item.value
55
55
 
56
56
  return <TouchableOpacity
57
+ accessibilityLabel={"UATabs"}
58
+ accessibilityHint={item.value}
59
+ accessibilityState={{checked: active}}
57
60
  key={index}
58
61
  style={{ flex: 1 }}
59
62
  onPress={() => {
@@ -7,6 +7,9 @@ export default function LdvColorBrightness(props) {
7
7
  const renderBrightness = () => {
8
8
  return (
9
9
  <LdvSlider
10
+ accessibilityLabel={"Brightness"}
11
+ accessibilityHint={`${value}`}
12
+ max={100}
10
13
  min={minBrightness}
11
14
  style={props.style}
12
15
  title={I18n.getLang('light_sources_tile_dim_lighting_brightness')}
@@ -16,4 +19,4 @@ export default function LdvColorBrightness(props) {
16
19
  )
17
20
  }
18
21
  return renderBrightness()
19
- }
22
+ }
@@ -96,10 +96,11 @@ const LdvColorSlider = (props: LdvColorSliderProps) => {
96
96
 
97
97
  return (
98
98
  <View style={[styles.container, props.style]}>
99
- <Text style={styles.title}>
99
+ <Text accessibilityLabel={"Color"} accessibilityHint={`${value}`} style={styles.title}>
100
100
  {title}
101
101
  </Text>
102
102
  <Slider.Horizontal
103
+ accessibilityLabel={"ColorSliderHorizontal"}
103
104
  style={{...styles.shadeSlider, width}}
104
105
  styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
105
106
  maximumValue={max}
@@ -55,6 +55,8 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
55
55
  <View key={props.theme?.type} style={[styles.pickerContainer, props.style]}>
56
56
  <View style={styles.picContainer}>
57
57
  <Picker
58
+ accessibilityLabel={"HourPicker"}
59
+ accessibilityHint={hour}
58
60
  itemTextColor='#aeadb5'
59
61
  style={[styles.picker, styles.pickerLeft]}
60
62
  loop={true}
@@ -76,6 +78,8 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
76
78
  </View>
77
79
  <View style={styles.picContainer}>
78
80
  <Picker
81
+ accessibilityLabel={"MinutePicker"}
82
+ accessibilityHint={minute}
79
83
  itemTextColor='#aeadb5'
80
84
  style={[styles.picker, styles.pickerLeft]}
81
85
  loop={true}
@@ -59,6 +59,8 @@ const LdvPresetView = (props) => {
59
59
  <View style={styles.container}>
60
60
  {dataSource.map((item, index) =>
61
61
  <TouchableOpacity
62
+ accessibilityLabel={"PresetNode"}
63
+ accessibilityHint={`${item.color}`}
62
64
  key={index}
63
65
  style={[styles.item, {backgroundColor: item.color}]}
64
66
  onPress={() => {
@@ -84,4 +86,4 @@ const styles = StyleSheet.create({
84
86
  },
85
87
  })
86
88
 
87
- export default LdvPresetView
89
+ export default LdvPresetView
@@ -8,6 +8,8 @@ const LdvSaturation = (props) => {
8
8
  const renderBrightness = () => {
9
9
  return (
10
10
  <LdvSlider
11
+ accessibilityLabel={"Saturation"}
12
+ accessibilityHint={`${value}`}
11
13
  style={props.style}
12
14
  title={I18n.getLang('light_sources_tile_rgb_lighting_saturation')}
13
15
  value={value}
@@ -20,4 +22,4 @@ const LdvSaturation = (props) => {
20
22
  return renderBrightness()
21
23
  }
22
24
 
23
- export default LdvSaturation
25
+ export default LdvSaturation
@@ -1,13 +1,13 @@
1
1
  import {useReactive} from 'ahooks'
2
2
  import React, {useEffect} from 'react'
3
- import {StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native'
3
+ import {AccessibilityProps, StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native'
4
4
  import {Slider, Utils} from 'tuya-panel-kit'
5
5
  import ThemeType from '../config/themeType'
6
6
 
7
7
  const cx = Utils.RatioUtils.convertX
8
8
  const { withTheme } = Utils.ThemeUtils
9
9
 
10
- interface LdvSliderProps {
10
+ interface LdvSliderProps extends AccessibilityProps{
11
11
  theme?: ThemeType
12
12
  title: string,
13
13
  value: number,
@@ -77,7 +77,11 @@ const LdvSlider = (props: LdvSliderProps) => {
77
77
 
78
78
  return (
79
79
  <View style={[styles.container, props.style]}>
80
- <View style={styles.titleBg}>
80
+ <View
81
+ accessibilityLabel={props.accessibilityLabel}
82
+ accessibilityHint={props.accessibilityHint}
83
+ style={styles.titleBg}
84
+ >
81
85
  <Text style={[styles.title, titleStyle]}>
82
86
  {props.title}
83
87
  </Text>
@@ -86,6 +90,7 @@ const LdvSlider = (props: LdvSliderProps) => {
86
90
  </Text>
87
91
  </View>
88
92
  <Slider.Horizontal
93
+ accessibilityLabel={"SliderHorizontal"}
89
94
  style={[styles.slider, sliderStyle]}
90
95
  styles={{thumb: styles.thumb}}
91
96
  maximumValue={mMax}
@@ -23,7 +23,7 @@ interface Prop {
23
23
  const LdvSwitch = (props: Prop) => {
24
24
  const {title, color, colorAlpha = 0, enable, description, titleStyle, setEnable, leftValue, rightValue, showSwitch = true} = props
25
25
  return (
26
- <View style={styles.titleBGView}>
26
+ <View accessibilityLabel={"LdvSwitch"} accessibilityHint={`${color}`} accessibilityState={{checked: enable}} style={styles.titleBGView}>
27
27
  <View style={{flexDirection: 'column', flex: 1}}>
28
28
  <View style={{flexDirection: 'row', alignItems: 'center'}}>
29
29
  <Text style={[styles.title, {color: props.theme?.global.fontColor}, titleStyle]}>{title}</Text>
@@ -33,7 +33,7 @@ const LdvSwitch = (props: Prop) => {
33
33
  </View>
34
34
  {showSwitch && <>
35
35
  {leftValue && <Text style={{color: props.theme?.global.fontColor, marginRight: cx(5)}}>{leftValue}</Text>}
36
- <SwitchButton value={enable} onValueChange={setEnable}/>
36
+ <SwitchButton accessibilityLabel={"SwitchButton"} value={enable} onValueChange={setEnable}/>
37
37
  {rightValue && <Text style={{color: props.theme?.global.fontColor, marginLeft: cx(5)}}>{rightValue}</Text>}
38
38
  </>
39
39
  }
@@ -24,6 +24,7 @@ interface LdvTemperatureSliderProps {
24
24
  style?: StyleProp<ViewStyle> | undefined
25
25
  titleStyle?: StyleProp<TextProps> | undefined
26
26
  subTitleStr?: string | undefined
27
+ accessibilityLabel?: string | undefined
27
28
  }
28
29
 
29
30
  const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
@@ -43,11 +44,12 @@ const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
43
44
  return (
44
45
  <View style={[styles.container, props.style]}>
45
46
  <View style={styles.titleBg}>
46
- <Text style={[styles.title, titleStyle]}>
47
+ <Text accessibilityLabel={"Temperature"} accessibilityHint={`${value}`} style={[styles.title, titleStyle]}>
47
48
  {title}
48
49
  </Text>
49
50
  </View>
50
51
  <Slider.Horizontal
52
+ accessibilityLabel={"TemperatureSliderHorizontal"}
51
53
  style={{...styles.shadeSlider, width}}
52
54
  styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
53
55
  maximumValue={max}
@@ -137,4 +139,4 @@ const styles = StyleSheet.create({
137
139
  },
138
140
  })
139
141
 
140
- export default LdvTemperatureSlider
142
+ export default LdvTemperatureSlider
@@ -29,7 +29,7 @@ const LDVTopBar = (props: TopBarProps) => {
29
29
  marginTop: Platform.OS === 'ios' ? Utils.RatioUtils.statusBarHeight : 0,
30
30
  justifyContent: 'space-between',
31
31
  }}>
32
- <TouchableOpacity onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
32
+ <TouchableOpacity accessibilityLabel={"GoBack"} onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
33
33
  <View
34
34
  style={{
35
35
  flexDirection: 'row',
@@ -52,6 +52,8 @@ const LDVTopBar = (props: TopBarProps) => {
52
52
  </TouchableOpacity>
53
53
  {!!props.rightButtonIcon &&
54
54
  <TouchableOpacity
55
+ accessibilityLabel={"RightButton"}
56
+ accessibilityState={{disabled: props.rightButtonDisabled}}
55
57
  style={{
56
58
  width: cx(44),
57
59
  height: cx(44),
@@ -54,6 +54,7 @@ const LdvTopName = (props: LdvTopNameProps) => {
54
54
  /> || null}
55
55
  </View>}
56
56
  {props.rightIcon && <TouchableOpacity
57
+ accessibilityLabel={"RightIcon"}
57
58
  onPress={props.rightIconClick}>
58
59
  <Image
59
60
  style={{ width: cx(24), height: cx(24), tintColor: props.theme?.global.brand }}
@@ -233,6 +233,8 @@ export default class ColourPicker extends Component<ColourProps, IState> {
233
233
  return (
234
234
  <View style={[{ flex: 1 }, style]}>
235
235
  <RectPicker
236
+ accessibilityLabel={"RectColorPicker"}
237
+ accessibilityHint={`${hue}, ${ Math.round(saturation / 10)}`}
236
238
  coorToValue={this.coorToValue}
237
239
  valueToColor={this.valueToColor}
238
240
  valueToCoor={this.valueToCoor}