@startupjs-ui/select 0.2.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.3.0](https://github.com/startupjs/startupjs-ui/compare/v0.2.3...v0.3.0) (2026-05-27)
7
+
8
+
9
+ ### Features
10
+
11
+ * [BREAKING] [0.3] improve accessibility props for E2E tests. Support testID everywhere ([#31](https://github.com/startupjs/startupjs-ui/issues/31)) ([882588c](https://github.com/startupjs/startupjs-ui/commit/882588ca37d5e1fd14b5717b5697cf9ed47042e4))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.2.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.23...v0.2.0) (2026-05-04)
7
18
 
8
19
 
package/Wrapper/index.tsx CHANGED
@@ -29,14 +29,10 @@ export interface SelectWrapperProps {
29
29
  showEmptyValue?: boolean
30
30
  /** Label for empty/none option */
31
31
  emptyValueLabel?: string | number
32
- /** Test identifier */
32
+ /** Test identifier passed to wrapper root */
33
33
  testID?: string
34
34
  /** Cross-platform accessible name */
35
35
  'aria-label'?: string
36
- /** Accessible label for the web select overlay */
37
- accessibilityLabel?: string
38
- /** Accessible hint for the web select overlay */
39
- accessibilityHint?: string
40
36
  /** Web-only control id for label association */
41
37
  id?: string
42
38
  /** Web-only labelled-by relationship */
@@ -47,6 +43,8 @@ export interface SelectWrapperProps {
47
43
  'aria-errormessage'?: string
48
44
  /** Web-only invalid state */
49
45
  'aria-invalid'?: boolean
46
+ /** Web-only required state */
47
+ 'aria-required'?: boolean
50
48
  /** Fired when selected value changes */
51
49
  onChange?: (value: any) => void
52
50
  }
@@ -67,18 +65,16 @@ function SelectWrapperWeb ({
67
65
  emptyValueLabel,
68
66
  testID,
69
67
  'aria-label': ariaLabel,
70
- accessibilityLabel,
71
- accessibilityHint,
72
68
  id,
73
69
  'aria-labelledby': ariaLabelledBy,
74
70
  'aria-describedby': ariaDescribedBy,
75
71
  'aria-errormessage': ariaErrorMessage,
76
72
  'aria-invalid': ariaInvalid,
73
+ 'aria-required': ariaRequired,
77
74
  onChange
78
75
  }: SelectWrapperProps): ReactNode {
79
76
  const optionEntries = getOptionEntries(options, showEmptyValue, emptyValueLabel)
80
77
  const selectedKey = getOptionKeyFromValue(value, options, showEmptyValue, emptyValueLabel) ?? PICKER_NULL
81
-
82
78
  function onSelectChange (event: any) {
83
79
  if (onChange) onChange(getValueFromKey(event.target.value, options, showEmptyValue, emptyValueLabel))
84
80
  }
@@ -86,21 +82,28 @@ function SelectWrapperWeb ({
86
82
  return pug`
87
83
  Div.root(style=style testID=testID)
88
84
  = children
89
- if !disabled
90
- select(
91
- id=id
92
- style=STYLES.overlay
93
- value=selectedKey
94
- onChange=onSelectChange
95
- aria-label=ariaLabel ?? accessibilityLabel
96
- aria-labelledby=ariaLabelledBy
97
- aria-describedby=ariaDescribedBy
98
- aria-errormessage=ariaErrorMessage
99
- aria-invalid=ariaInvalid
100
- )
101
- each entry in optionEntries
102
- option(key=entry.key value=entry.key)
103
- = entry.label
85
+ select(
86
+ id=id
87
+ style=STYLES.overlay
88
+ value=selectedKey
89
+ disabled=disabled
90
+ onChange=onSelectChange
91
+ role='combobox'
92
+ aria-haspopup='listbox'
93
+ aria-label=ariaLabel
94
+ aria-labelledby=ariaLabelledBy
95
+ aria-describedby=ariaDescribedBy
96
+ aria-errormessage=ariaErrorMessage
97
+ aria-invalid=ariaInvalid
98
+ aria-required=ariaRequired
99
+ )
100
+ each entry in optionEntries
101
+ option(
102
+ key=entry.key
103
+ value=entry.key
104
+ aria-selected=entry.key === selectedKey
105
+ )
106
+ = entry.label
104
107
  `
105
108
  }
106
109
 
package/index.d.ts CHANGED
@@ -22,14 +22,8 @@ export interface SelectProps extends Omit<UITextInputProps, 'value' | 'onChangeT
22
22
  testID?: string;
23
23
  /** Cross-platform accessible name */
24
24
  'aria-label'?: string;
25
- /** Accessible label forwarded to the web select overlay */
26
- accessibilityLabel?: string;
27
- /** Accessible hint forwarded to the web select overlay */
28
- accessibilityHint?: string;
29
25
  /** Web-only control id forwarded to the native select overlay */
30
26
  id?: string;
31
- /** Native id alias forwarded to the native select overlay */
32
- nativeID?: string;
33
27
  /** Web-only labelled-by relationship */
34
28
  'aria-labelledby'?: string;
35
29
  /** Web-only described-by relationship */
@@ -38,6 +32,8 @@ export interface SelectProps extends Omit<UITextInputProps, 'value' | 'onChangeT
38
32
  'aria-errormessage'?: string;
39
33
  /** Web-only invalid state */
40
34
  'aria-invalid'?: boolean;
35
+ /** Web-only required state */
36
+ 'aria-required'?: boolean;
41
37
  /** Fired when selected value changes */
42
38
  onChange?: (value: any) => void;
43
39
  }
package/index.tsx CHANGED
@@ -24,14 +24,8 @@ export interface SelectProps extends Omit<UITextInputProps, 'value' | 'onChangeT
24
24
  testID?: string
25
25
  /** Cross-platform accessible name */
26
26
  'aria-label'?: string
27
- /** Accessible label forwarded to the web select overlay */
28
- accessibilityLabel?: string
29
- /** Accessible hint forwarded to the web select overlay */
30
- accessibilityHint?: string
31
27
  /** Web-only control id forwarded to the native select overlay */
32
28
  id?: string
33
- /** Native id alias forwarded to the native select overlay */
34
- nativeID?: string
35
29
  /** Web-only labelled-by relationship */
36
30
  'aria-labelledby'?: string
37
31
  /** Web-only described-by relationship */
@@ -40,6 +34,8 @@ export interface SelectProps extends Omit<UITextInputProps, 'value' | 'onChangeT
40
34
  'aria-errormessage'?: string
41
35
  /** Web-only invalid state */
42
36
  'aria-invalid'?: boolean
37
+ /** Web-only required state */
38
+ 'aria-required'?: boolean
43
39
  /** Fired when selected value changes */
44
40
  onChange?: (value: any) => void
45
41
  }
@@ -52,14 +48,12 @@ function Select ({
52
48
  emptyValueLabel,
53
49
  testID,
54
50
  'aria-label': ariaLabel,
55
- accessibilityLabel,
56
- accessibilityHint,
57
51
  id,
58
- nativeID,
59
52
  'aria-labelledby': ariaLabelledBy,
60
53
  'aria-describedby': ariaDescribedBy,
61
54
  'aria-errormessage': ariaErrorMessage,
62
55
  'aria-invalid': ariaInvalid,
56
+ 'aria-required': ariaRequired,
63
57
  onChange,
64
58
  ref,
65
59
  ...props
@@ -78,12 +72,13 @@ function Select ({
78
72
  showEmptyValue=showEmptyValue
79
73
  emptyValueLabel=emptyValueLabel
80
74
  testID=testID
81
- aria-label=ariaLabel ?? accessibilityLabel
82
- id=id || nativeID
75
+ aria-label=ariaLabel
76
+ id=id
83
77
  aria-labelledby=ariaLabelledBy
84
78
  aria-describedby=ariaDescribedBy
85
79
  aria-errormessage=ariaErrorMessage
86
80
  aria-invalid=ariaInvalid
81
+ aria-required=ariaRequired
87
82
  )= children
88
83
  `
89
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/select",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -9,15 +9,15 @@
9
9
  "type": "module",
10
10
  "dependencies": {
11
11
  "@react-native-picker/picker": "^2.11.1",
12
- "@startupjs-ui/core": "^0.2.0",
13
- "@startupjs-ui/div": "^0.2.0",
14
- "@startupjs-ui/span": "^0.2.0",
15
- "@startupjs-ui/text-input": "^0.2.0"
12
+ "@startupjs-ui/core": "^0.3.0",
13
+ "@startupjs-ui/div": "^0.3.0",
14
+ "@startupjs-ui/span": "^0.3.0",
15
+ "@startupjs-ui/text-input": "^0.3.0"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": "*",
19
19
  "react-native": "*",
20
20
  "startupjs": "*"
21
21
  },
22
- "gitHead": "0c586b841cba1c9d820542f6eca07470f5ea2659"
22
+ "gitHead": "8d212b47680af1dfe582f9759b38724b46488e25"
23
23
  }