@startupjs-ui/link 0.2.0-alpha.2 → 0.2.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/index.tsx +17 -4
  3. package/package.json +6 -6
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.2.0](https://github.com/startupjs/startupjs-ui/compare/v0.1.23...v0.2.0) (2026-05-04)
7
+
8
+
9
+ ### Features
10
+
11
+ * [v0.2] add accessibility features to most components, which also dramatically improves E2E testability ([#22](https://github.com/startupjs/startupjs-ui/issues/22)) ([b563e2f](https://github.com/startupjs/startupjs-ui/commit/b563e2fa498a8a83bd5abc7836d120f6d2381e3f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [0.2.0-alpha.2](https://github.com/startupjs/startupjs-ui/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-04-20)
7
18
 
8
19
  **Note:** Version bump only for package @startupjs-ui/link
package/index.tsx CHANGED
@@ -9,7 +9,7 @@ import Span from '@startupjs-ui/span'
9
9
  import './index.cssx.styl'
10
10
 
11
11
  const isWeb = Platform.OS === 'web'
12
- const EXTERNAL_LINK_REGEXP = /^(https?:\/\/|\/\/)/i
12
+ const EXTERNAL_LINK_REGEXP = /^(https?:\/\/|\/\/|mailto:)/i
13
13
 
14
14
  export default observer(themed('Link', Link))
15
15
 
@@ -103,10 +103,23 @@ function Link ({
103
103
  }
104
104
 
105
105
  if (EXTERNAL_LINK_REGEXP.test(target ?? '')) {
106
- if (isWeb) {
107
- window.open(target, '_blank')
106
+ const url = target ?? ''
107
+ if (/^mailto:/i.test(url)) {
108
+ if (isWeb && typeof document !== 'undefined') {
109
+ const a = document.createElement('a')
110
+ a.href = url
111
+ document.body.appendChild(a)
112
+ a.click()
113
+ document.body.removeChild(a)
114
+ } else {
115
+ Linking.openURL(url)
116
+ }
108
117
  } else {
109
- Linking.openURL(target ?? '')
118
+ if (isWeb) {
119
+ window.open(target, '_blank')
120
+ } else {
121
+ Linking.openURL(target ?? '')
122
+ }
110
123
  }
111
124
  } else {
112
125
  let method
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/link",
3
- "version": "0.2.0-alpha.2",
3
+ "version": "0.2.0",
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.2.0-alpha.2",
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"
11
+ "@startupjs-ui/button": "^0.2.0",
12
+ "@startupjs-ui/core": "^0.2.0",
13
+ "@startupjs-ui/div": "^0.2.0",
14
+ "@startupjs-ui/span": "^0.2.0"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": "*",
18
18
  "react-native": "*",
19
19
  "startupjs": "*"
20
20
  },
21
- "gitHead": "8a6ae7871e4c82f3e24d5911a9df42338e057e7a"
21
+ "gitHead": "0c586b841cba1c9d820542f6eca07470f5ea2659"
22
22
  }