@startupjs-ui/menu 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
 
@@ -34,6 +34,12 @@ export interface MenuItemProps extends Omit<ItemProps, 'style' | 'onPress' | 'ic
34
34
  to?: string
35
35
  /** Handler called on item press */
36
36
  onPress?: ItemProps['onPress']
37
+ /** Web accessibility role forwarded to the interactive root */
38
+ role?: ItemProps['role']
39
+ /** Whether the option is selected (for listbox/combobox patterns on web) */
40
+ 'aria-selected'?: boolean
41
+ /** Accessible name when item text is not plain text */
42
+ 'aria-label'?: string
37
43
  }
38
44
 
39
45
  function MenuItem ({
@@ -42,6 +48,9 @@ function MenuItem ({
42
48
  active = false,
43
49
  bold,
44
50
  icon,
51
+ role,
52
+ 'aria-selected': ariaSelected,
53
+ 'aria-label': ariaLabel,
45
54
  ...props
46
55
  }: MenuItemProps): ReactNode {
47
56
  const context = useContext(MenuContext)
@@ -61,9 +70,17 @@ function MenuItem ({
61
70
  color = active ? (activeColor ?? getColor('text-primary')) : (color ?? getColor('text-main'))
62
71
  const borderStyle: StyleProp<ViewStyle> = { backgroundColor: activeColor ?? getColor('border-primary') }
63
72
 
73
+ const optionLabel = ariaLabel ??
74
+ (typeof children === 'string' || typeof children === 'number' ? String(children) : undefined)
75
+
64
76
  return pug`
65
77
  Div
66
- Item(...props)
78
+ Item(
79
+ ...props
80
+ role=role
81
+ aria-label=optionLabel
82
+ aria-selected=ariaSelected
83
+ )
67
84
  if icon && iconPosition === 'left'
68
85
  Item.Left
69
86
  Icon(icon=icon style={ color })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/menu",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,16 +8,16 @@
8
8
  "types": "index.d.ts",
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@startupjs-ui/core": "^0.2.0",
12
- "@startupjs-ui/div": "^0.2.0",
13
- "@startupjs-ui/icon": "^0.2.0",
14
- "@startupjs-ui/item": "^0.2.0",
15
- "@startupjs-ui/span": "^0.2.0"
11
+ "@startupjs-ui/core": "^0.3.0",
12
+ "@startupjs-ui/div": "^0.3.0",
13
+ "@startupjs-ui/icon": "^0.3.0",
14
+ "@startupjs-ui/item": "^0.3.0",
15
+ "@startupjs-ui/span": "^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
  }