@ornikar/kitt-universal 7.6.0 → 7.8.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/dist/definitions/ExternalAppLink/ExternalAppLink.d.ts +31 -0
- package/dist/definitions/ExternalAppLink/ExternalAppLink.d.ts.map +1 -0
- package/dist/definitions/Picker/Picker.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputText.d.ts.map +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts +1 -1
- package/dist/definitions/forms/InputText/InputTextContainer.web.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +2 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +167 -37
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +167 -37
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +167 -37
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +142 -17
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +100 -23
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.js +73 -1
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -848,6 +848,78 @@ function Emoji({
|
|
|
848
848
|
});
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
+
function ExternalAppLink({
|
|
852
|
+
as: Component,
|
|
853
|
+
appScheme,
|
|
854
|
+
appValue,
|
|
855
|
+
onPress,
|
|
856
|
+
onOpenAppError,
|
|
857
|
+
...rest
|
|
858
|
+
}) {
|
|
859
|
+
const href = `${appScheme}:${appValue}`;
|
|
860
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
861
|
+
href: href,
|
|
862
|
+
...rest,
|
|
863
|
+
onPress: async e => {
|
|
864
|
+
try {
|
|
865
|
+
const canOpen = await reactNative.Linking.canOpenURL(href);
|
|
866
|
+
|
|
867
|
+
if (canOpen) {
|
|
868
|
+
reactNative.Linking.openURL(href).catch(err => {
|
|
869
|
+
console.error(`An error occurred while opening ${href}`, err);
|
|
870
|
+
onOpenAppError?.(`An error occurred while opening ${href}`);
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
if (onPress) {
|
|
874
|
+
onPress(e);
|
|
875
|
+
if (e?.defaultPrevented) return;
|
|
876
|
+
}
|
|
877
|
+
} else {
|
|
878
|
+
onOpenAppError?.(`Cannot open url: ${href}`);
|
|
879
|
+
}
|
|
880
|
+
} catch {
|
|
881
|
+
onOpenAppError?.('An error occured with Linkinf.canOpenURL');
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
ExternalAppLink.Sms = function ({
|
|
888
|
+
phoneNumber,
|
|
889
|
+
children,
|
|
890
|
+
...rest
|
|
891
|
+
}) {
|
|
892
|
+
return /*#__PURE__*/jsxRuntime.jsx(ExternalAppLink, { ...rest,
|
|
893
|
+
appScheme: "sms",
|
|
894
|
+
appValue: phoneNumber,
|
|
895
|
+
children: children
|
|
896
|
+
});
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
ExternalAppLink.Tel = function ({
|
|
900
|
+
phoneNumber,
|
|
901
|
+
children,
|
|
902
|
+
...rest
|
|
903
|
+
}) {
|
|
904
|
+
return /*#__PURE__*/jsxRuntime.jsx(ExternalAppLink, { ...rest,
|
|
905
|
+
appScheme: "tel",
|
|
906
|
+
appValue: phoneNumber,
|
|
907
|
+
children: children
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
ExternalAppLink.Mail = function ({
|
|
912
|
+
emailAddress,
|
|
913
|
+
children,
|
|
914
|
+
...rest
|
|
915
|
+
}) {
|
|
916
|
+
return /*#__PURE__*/jsxRuntime.jsx(ExternalAppLink, { ...rest,
|
|
917
|
+
appScheme: "mailto",
|
|
918
|
+
appValue: emailAddress,
|
|
919
|
+
children: children
|
|
920
|
+
});
|
|
921
|
+
};
|
|
922
|
+
|
|
851
923
|
const defaultOpenLinkBehavior = {
|
|
852
924
|
native: 'openInModal',
|
|
853
925
|
web: 'targetBlank'
|
|
@@ -2432,7 +2504,13 @@ const StyledTextInput = /*#__PURE__*/styled__default(reactNative.TextInput).with
|
|
|
2432
2504
|
theme,
|
|
2433
2505
|
multiline
|
|
2434
2506
|
}) => {
|
|
2435
|
-
|
|
2507
|
+
const shouldHandleSingleLineOnIOS = reactNative.Platform.OS === 'ios' && !multiline; // On basic text input, we set the line-height to zero for iOS to fix vertical text alignment
|
|
2508
|
+
// This is a iOS only fix since having 0 as a line-height value breaks text inputs on Android
|
|
2509
|
+
|
|
2510
|
+
if (shouldHandleSingleLineOnIOS) {
|
|
2511
|
+
return 0;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2436
2514
|
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
2437
2515
|
return `${theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight}px`;
|
|
2438
2516
|
}, ({
|
|
@@ -3527,28 +3605,26 @@ function Picker({
|
|
|
3527
3605
|
variant: "bold",
|
|
3528
3606
|
children: title
|
|
3529
3607
|
})
|
|
3530
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
});
|
|
3551
|
-
})
|
|
3608
|
+
}), reactNative.Platform.OS === 'ios' ? /*#__PURE__*/jsxRuntime.jsx(picker$1.Picker, {
|
|
3609
|
+
testID: testID,
|
|
3610
|
+
selectedValue: value,
|
|
3611
|
+
itemStyle: theme.picker.ios.default,
|
|
3612
|
+
onValueChange: itemValue => setValue(itemValue),
|
|
3613
|
+
children: React__default.Children.map(children, child => {
|
|
3614
|
+
const item = child; // iOS Picker doesn't support a custom Item component, we need to override its props manually for the selected one
|
|
3615
|
+
|
|
3616
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
3617
|
+
color: item.props.value === value ? theme.picker.ios.selected.color : undefined
|
|
3618
|
+
});
|
|
3619
|
+
})
|
|
3620
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
3621
|
+
testID: testID,
|
|
3622
|
+
children: React__default.Children.map(children, child => {
|
|
3623
|
+
const item = child;
|
|
3624
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
3625
|
+
onPress: newValue => setValue(newValue),
|
|
3626
|
+
isSelected: item.props.value === value
|
|
3627
|
+
});
|
|
3552
3628
|
})
|
|
3553
3629
|
}), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
|
|
3554
3630
|
children: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
@@ -4525,6 +4601,7 @@ exports.Card = Card;
|
|
|
4525
4601
|
exports.Checkbox = Checkbox;
|
|
4526
4602
|
exports.DatePicker = DatePicker;
|
|
4527
4603
|
exports.Emoji = Emoji;
|
|
4604
|
+
exports.ExternalAppLink = ExternalAppLink;
|
|
4528
4605
|
exports.ExternalLink = ExternalLink;
|
|
4529
4606
|
exports.Flex = Flex;
|
|
4530
4607
|
exports.FullScreenModal = FullScreenModal;
|