@neko-os/ui 0.3.0 → 0.4.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.
@@ -1,3 +1,9 @@
1
- import { TouchableOpacity as RNTouchableOpacity } from "react-native-web";
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/TouchableOpacity.native.js";var _excluded = ["href", "target", "link", "onPress"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { Linking, TouchableOpacity as RNTouchableOpacity } from "react-native-web";import { jsx as _jsx } from "react/jsx-runtime";
2
2
 
3
- export var AbsTouchableOpacity = RNTouchableOpacity;
3
+ export function AbsTouchableOpacity(_ref) {var href = _ref.href,target = _ref.target,link = _ref.link,onPress = _ref.onPress,props = _objectWithoutProperties(_ref, _excluded);
4
+ var handlePress = href ?
5
+ function (e) {onPress == null ? void 0 : onPress(e);Linking.openURL(href);} :
6
+ onPress;
7
+
8
+ return _jsx(RNTouchableOpacity, Object.assign({ onPress: handlePress }, props));
9
+ }
@@ -6,7 +6,7 @@ import { useColors } from "../../theme/ThemeHandler";import { jsx as _jsx } from
6
6
 
7
7
  export function LinkInput(_ref) {var ref = _ref.ref,onPress = _ref.onPress,onClick = _ref.onClick,placeholder = _ref.placeholder,value = _ref.value,disabled = _ref.disabled,props = _objectWithoutProperties(_ref, _excluded);
8
8
  return (
9
- _jsx(Link, { ref: ref, onPress: !props.loading ? onPress || onClick : undefined, flex: true, fullW: true, centerV: true, disabled: disabled, children:
9
+ _jsx(Link, { ref: ref, onPress: !props.loading ? onPress || onClick : undefined, fullW: true, centerV: true, disabled: disabled, children:
10
10
  _jsx(InputWrapper, Object.assign({}, props, { children:
11
11
  _jsx(View, { centerV: true, flex: true, fullW: true, children:
12
12
  _jsx(Text, { color: !!value ? 'text' : 'text_op30', label: value || placeholder, numberOfLines: 1 }) }
@@ -144,7 +144,7 @@ export function Picker(_ref7)
144
144
  Wrapper = Wrapper || (useFlatList ? FlatListPickerWrapper : DefaultPickerWrapper);
145
145
 
146
146
  return (
147
- _jsx(LoadingView, { active: isFirstLoad, replaceChildren: true, children:
147
+ _jsx(LoadingView, { active: isFirstLoad, replaceChildren: true, flex: true, children:
148
148
  _jsx(Wrapper, Object.assign({},
149
149
  rootProps, {
150
150
  valueKey: valueKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neko-os/ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "author": "Christian Storch <ccstorch@gmail.com>",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,3 +1,9 @@
1
- import { TouchableOpacity as RNTouchableOpacity } from 'react-native'
1
+ import { Linking, TouchableOpacity as RNTouchableOpacity } from 'react-native'
2
2
 
3
- export const AbsTouchableOpacity = RNTouchableOpacity
3
+ export function AbsTouchableOpacity({ href, target, link, onPress, ...props }) {
4
+ const handlePress = href
5
+ ? (e) => { onPress?.(e); Linking.openURL(href) }
6
+ : onPress
7
+
8
+ return <RNTouchableOpacity onPress={handlePress} {...props} />
9
+ }
@@ -6,7 +6,7 @@ import { useColors } from '../../theme/ThemeHandler'
6
6
 
7
7
  export function LinkInput({ ref, onPress, onClick, placeholder, value, disabled, ...props }) {
8
8
  return (
9
- <Link ref={ref} onPress={!props.loading ? onPress || onClick : undefined} flex fullW centerV disabled={disabled}>
9
+ <Link ref={ref} onPress={!props.loading ? onPress || onClick : undefined} fullW centerV disabled={disabled}>
10
10
  <InputWrapper {...props}>
11
11
  <View centerV flex fullW>
12
12
  <Text color={!!value ? 'text' : 'text_op30'} label={value || placeholder} numberOfLines={1} />
@@ -144,7 +144,7 @@ export function Picker({
144
144
  Wrapper = Wrapper || (useFlatList ? FlatListPickerWrapper : DefaultPickerWrapper)
145
145
 
146
146
  return (
147
- <LoadingView active={isFirstLoad} replaceChildren>
147
+ <LoadingView active={isFirstLoad} replaceChildren flex>
148
148
  <Wrapper
149
149
  {...rootProps}
150
150
  valueKey={valueKey}