@startupjs-ui/button 0.1.19 → 0.2.0-alpha.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 +27 -0
- package/index.d.ts +8 -0
- package/index.tsx +18 -4
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.2.0-alpha.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.22...v0.2.0-alpha.0) (2026-03-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* fix and improve accessibility of various components. Add storybook with tests. ([#21](https://github.com/startupjs/startupjs-ui/issues/21)) ([83b6576](https://github.com/startupjs/startupjs-ui/commit/83b65767ed61b24209f71b143ba1c2986170ab58))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.1.22](https://github.com/startupjs/startupjs-ui/compare/v0.1.21...v0.1.22) (2026-03-25)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @startupjs-ui/button
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.1.21](https://github.com/startupjs/startupjs-ui/compare/v0.1.20...v0.1.21) (2026-03-25)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @startupjs-ui/button
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.1.19](https://github.com/startupjs/startupjs-ui/compare/v0.1.18...v0.1.19) (2026-03-17)
|
|
7
34
|
|
|
8
35
|
|
package/index.d.ts
CHANGED
|
@@ -33,6 +33,14 @@ export interface ButtonProps {
|
|
|
33
33
|
hoverStyle?: StyleProp<ViewStyle>;
|
|
34
34
|
/** custom styles for active state */
|
|
35
35
|
activeStyle?: StyleProp<ViewStyle>;
|
|
36
|
+
/** cross-platform accessible name for icon-only or custom-content buttons */
|
|
37
|
+
'aria-label'?: string;
|
|
38
|
+
/** legacy alias for aria-label */
|
|
39
|
+
accessibilityLabel?: string;
|
|
40
|
+
/** accessible hint text */
|
|
41
|
+
accessibilityHint?: string;
|
|
36
42
|
/** onPress handler */
|
|
37
43
|
onPress?: (event: GestureResponderEvent) => void | Promise<void>;
|
|
44
|
+
/** Additional props forwarded to the root pressable */
|
|
45
|
+
[key: string]: any;
|
|
38
46
|
}
|
package/index.tsx
CHANGED
|
@@ -44,8 +44,16 @@ export interface ButtonProps {
|
|
|
44
44
|
hoverStyle?: StyleProp<ViewStyle>
|
|
45
45
|
/** custom styles for active state */
|
|
46
46
|
activeStyle?: StyleProp<ViewStyle>
|
|
47
|
+
/** cross-platform accessible name for icon-only or custom-content buttons */
|
|
48
|
+
'aria-label'?: string
|
|
49
|
+
/** legacy alias for aria-label */
|
|
50
|
+
accessibilityLabel?: string
|
|
51
|
+
/** accessible hint text */
|
|
52
|
+
accessibilityHint?: string
|
|
47
53
|
/** onPress handler */
|
|
48
54
|
onPress?: (event: GestureResponderEvent) => void | Promise<void>
|
|
55
|
+
/** Additional props forwarded to the root pressable */
|
|
56
|
+
[key: string]: any
|
|
49
57
|
}
|
|
50
58
|
function Button ({
|
|
51
59
|
style,
|
|
@@ -77,13 +85,18 @@ function Button ({
|
|
|
77
85
|
let resolved = false
|
|
78
86
|
const promise = onPress(event)
|
|
79
87
|
if (!(promise && promise.then)) return
|
|
80
|
-
promise.then(
|
|
88
|
+
promise.then(
|
|
89
|
+
() => { resolved = true },
|
|
90
|
+
() => { resolved = true }
|
|
91
|
+
)
|
|
81
92
|
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
82
93
|
if (resolved) return
|
|
83
94
|
setAsyncActive(true)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
try {
|
|
96
|
+
await promise
|
|
97
|
+
} finally {
|
|
98
|
+
if (isMountedRef.current) setAsyncActive(false)
|
|
99
|
+
}
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
if (!getColor(color)) console.error('Button component: Color for color property is incorrect. Use colors from Colors')
|
|
@@ -154,6 +167,7 @@ function Button ({
|
|
|
154
167
|
return pug`
|
|
155
168
|
Div.root(
|
|
156
169
|
row
|
|
170
|
+
_webNativeButton
|
|
157
171
|
shape=shape
|
|
158
172
|
style=[rootStyle, style]
|
|
159
173
|
styleName=[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.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.
|
|
12
|
-
"@startupjs-ui/div": "^0.
|
|
13
|
-
"@startupjs-ui/icon": "^0.
|
|
14
|
-
"@startupjs-ui/loader": "^0.
|
|
15
|
-
"@startupjs-ui/span": "^0.
|
|
11
|
+
"@startupjs-ui/core": "^0.2.0-alpha.0",
|
|
12
|
+
"@startupjs-ui/div": "^0.2.0-alpha.0",
|
|
13
|
+
"@startupjs-ui/icon": "^0.2.0-alpha.0",
|
|
14
|
+
"@startupjs-ui/loader": "^0.2.0-alpha.0",
|
|
15
|
+
"@startupjs-ui/span": "^0.2.0-alpha.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "*",
|
|
19
19
|
"react-native": "*",
|
|
20
20
|
"startupjs": "*"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "a428246a18d0e7f77809043c8240253240d11d66"
|
|
23
23
|
}
|