@ruby-native/react 0.10.8 → 0.10.9

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 (2) hide show
  1. package/index.js +19 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -64,6 +64,25 @@ export function NativeMenuItem({ title, href, click, icon, icons, selected }) {
64
64
  return createElement("div", props)
65
65
  }
66
66
 
67
+ export function NativeShareButton({ position = "trailing", title = "Share", icon = "square.and.arrow.up", icons, url }) {
68
+ const resolved = resolveIcon(icon, icons)
69
+ const props = { "data-native-button": true, "data-native-share": "" }
70
+ if (title) props["data-native-title"] = title
71
+ if (resolved) props["data-native-icon"] = resolved
72
+ if (position) props["data-native-position"] = position
73
+ if (url) props["data-native-share-url"] = url
74
+ return createElement("div", props)
75
+ }
76
+
77
+ export function NativeShareMenuItem({ title = "Share", url, icon = "square.and.arrow.up", icons, selected }) {
78
+ const resolved = resolveIcon(icon, icons)
79
+ const props = { "data-native-menu-item": true, "data-native-share": "", "data-native-title": title }
80
+ if (url) props["data-native-share-url"] = url
81
+ if (resolved) props["data-native-icon"] = resolved
82
+ if (selected) props["data-native-selected"] = ""
83
+ return createElement("div", props)
84
+ }
85
+
67
86
  export function NativeFab({ icon, icons, href, click }) {
68
87
  const resolved = resolveIcon(icon, icons)
69
88
  if (!resolved) throw new Error("NativeFab requires `icon` or `icons`")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruby-native/react",
3
- "version": "0.10.8",
3
+ "version": "0.10.9",
4
4
  "description": "React components for Ruby Native",
5
5
  "main": "index.js",
6
6
  "files": ["index.js", "README.md"],