@startupjs-ui/link 0.1.22 → 0.2.0-alpha.1
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 +19 -0
- package/index.tsx +7 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.1](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.0...v0.2.0-alpha.1) (2026-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/link
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.2.0-alpha.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.22...v0.2.0-alpha.0) (2026-03-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* 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))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.1.22](https://github.com/startupjs/startupjs-ui/compare/v0.1.21...v0.1.22) (2026-03-25)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @startupjs-ui/link
|
package/index.tsx
CHANGED
|
@@ -69,7 +69,7 @@ function Link ({
|
|
|
69
69
|
|
|
70
70
|
const isBlock = resolvedDisplay === 'block'
|
|
71
71
|
const Component = isBlock ? Div : Span
|
|
72
|
-
const extraProps: Record<string, any> = {
|
|
72
|
+
const extraProps: Record<string, any> = { role: 'link', onPress: handlePress }
|
|
73
73
|
const {
|
|
74
74
|
navigate: routerNavigate,
|
|
75
75
|
push: routerPush,
|
|
@@ -103,9 +103,11 @@ function Link ({
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (EXTERNAL_LINK_REGEXP.test(target ?? '')) {
|
|
106
|
-
isWeb
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
if (isWeb) {
|
|
107
|
+
window.open(target, '_blank')
|
|
108
|
+
} else {
|
|
109
|
+
Linking.openURL(target ?? '')
|
|
110
|
+
}
|
|
109
111
|
} else {
|
|
110
112
|
let method
|
|
111
113
|
if (push) method = routerPush
|
|
@@ -122,7 +124,7 @@ function Link ({
|
|
|
122
124
|
if ((children as any)?.props?.originalType === Button || (children as any)?.type === Button) {
|
|
123
125
|
return cloneElement(children as any, { style, ...restProps, ...extraProps })
|
|
124
126
|
}
|
|
125
|
-
} catch
|
|
127
|
+
} catch {
|
|
126
128
|
// ignore errors when children contains multiple elements
|
|
127
129
|
}
|
|
128
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/link",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@startupjs-ui/button": "^0.1
|
|
12
|
-
"@startupjs-ui/core": "^0.1
|
|
13
|
-
"@startupjs-ui/div": "^0.1
|
|
14
|
-
"@startupjs-ui/span": "^0.1
|
|
11
|
+
"@startupjs-ui/button": "^0.2.0-alpha.1",
|
|
12
|
+
"@startupjs-ui/core": "^0.2.0-alpha.1",
|
|
13
|
+
"@startupjs-ui/div": "^0.2.0-alpha.1",
|
|
14
|
+
"@startupjs-ui/span": "^0.2.0-alpha.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "*",
|
|
18
18
|
"react-native": "*",
|
|
19
19
|
"startupjs": "*"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "b48004779559b16c96a2a1995dab13b998eafce9"
|
|
22
22
|
}
|