@ornikar/kitt-universal 3.0.0 → 3.0.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.
|
@@ -11,7 +11,6 @@ const twemojiParser = require('twemoji-parser');
|
|
|
11
11
|
const WebBrowser = require('expo-web-browser');
|
|
12
12
|
const reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
13
13
|
const Animated = require('react-native-reanimated');
|
|
14
|
-
const react$1 = require('@linaria/react');
|
|
15
14
|
const DateTimePicker = require('@react-native-community/datetimepicker');
|
|
16
15
|
const reactIntl = require('react-intl');
|
|
17
16
|
const reactNative$1 = require('@floating-ui/react-native');
|
|
@@ -630,7 +629,7 @@ function Emoji({
|
|
|
630
629
|
}) {
|
|
631
630
|
const [emojiData] = react.useMemo(() => twemojiParser.parse(emoji, {
|
|
632
631
|
// on native plaforms, you can't display svg as Image
|
|
633
|
-
assetType: 'svg'
|
|
632
|
+
assetType: reactNative.Platform.OS === 'web' ? 'svg' : 'png'
|
|
634
633
|
}), [emoji]);
|
|
635
634
|
if (!emojiData) return null;
|
|
636
635
|
return /*#__PURE__*/jsxRuntime.jsx(StyledEmoji, {
|
|
@@ -787,11 +786,11 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
|
|
|
787
786
|
})(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, ({
|
|
788
787
|
theme,
|
|
789
788
|
multiline
|
|
790
|
-
}) => !multiline &&
|
|
789
|
+
}) => !multiline && reactNative.Platform.OS === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding, ({
|
|
791
790
|
theme,
|
|
792
791
|
multiline
|
|
793
792
|
}) => {
|
|
794
|
-
if (!multiline &&
|
|
793
|
+
if (!multiline && reactNative.Platform.OS === 'ios') return 0;
|
|
795
794
|
const typeConfigKey = getTypographyTypeConfigKey(theme);
|
|
796
795
|
return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
|
|
797
796
|
}, ({
|
|
@@ -912,10 +911,10 @@ function Label({
|
|
|
912
911
|
}) {
|
|
913
912
|
return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
914
913
|
base: "body",
|
|
915
|
-
children: /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
914
|
+
children: reactNative.Platform.OS === 'web' ? /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
916
915
|
htmlFor: htmlFor,
|
|
917
916
|
children: children
|
|
918
|
-
})
|
|
917
|
+
}) : children
|
|
919
918
|
});
|
|
920
919
|
}
|
|
921
920
|
|
|
@@ -1129,7 +1128,7 @@ function FullScreenModalHeader({
|
|
|
1129
1128
|
};
|
|
1130
1129
|
|
|
1131
1130
|
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
1132
|
-
insetTop: top,
|
|
1131
|
+
insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
|
|
1133
1132
|
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
1134
1133
|
onLayout: e => handleLayoutChange(e, 'left'),
|
|
1135
1134
|
children: left
|
|
@@ -1167,6 +1166,7 @@ function StyleWebWrapper({
|
|
|
1167
1166
|
children,
|
|
1168
1167
|
...props
|
|
1169
1168
|
}) {
|
|
1169
|
+
if (reactNative.Platform.OS !== 'web') return children;
|
|
1170
1170
|
// as or default to div. If as is undefined, T is div but typescript is not sure
|
|
1171
1171
|
return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
|
|
1172
1172
|
children: children
|
|
@@ -1194,7 +1194,7 @@ WrappedComponent) {
|
|
|
1194
1194
|
};
|
|
1195
1195
|
}
|
|
1196
1196
|
|
|
1197
|
-
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/
|
|
1197
|
+
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styledLinaria("div")({
|
|
1198
1198
|
name: "PressableIconButtonWebWrapper",
|
|
1199
1199
|
class: "p1nlccvg",
|
|
1200
1200
|
vars: {
|
|
@@ -1234,6 +1234,11 @@ const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withCon
|
|
|
1234
1234
|
const {
|
|
1235
1235
|
iconButton
|
|
1236
1236
|
} = theme.kitt;
|
|
1237
|
+
|
|
1238
|
+
if (reactNative.Platform.OS !== 'web') {
|
|
1239
|
+
return undefined;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1237
1242
|
const {
|
|
1238
1243
|
transition
|
|
1239
1244
|
} = iconButton;
|
|
@@ -1546,6 +1551,7 @@ ListItem.SideContent = ListItemSideContent;
|
|
|
1546
1551
|
ListItem.SideContainer = ListItemSideContainer;
|
|
1547
1552
|
|
|
1548
1553
|
function getActivityIndicatorSize(size) {
|
|
1554
|
+
if (reactNative.Platform.OS === 'android') return size;
|
|
1549
1555
|
return size < 36 ? 'small' : 'large';
|
|
1550
1556
|
}
|
|
1551
1557
|
|
|
@@ -2172,7 +2178,13 @@ function StoryGridCol({
|
|
|
2172
2178
|
children,
|
|
2173
2179
|
platform = 'all'
|
|
2174
2180
|
}) {
|
|
2175
|
-
|
|
2181
|
+
const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
|
|
2182
|
+
|
|
2183
|
+
if (reactNative.Platform.OS === 'web' && platform === 'native') {
|
|
2184
|
+
return null;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
if (isNative && platform === 'web') {
|
|
2176
2188
|
return null;
|
|
2177
2189
|
}
|
|
2178
2190
|
|
|
@@ -2578,8 +2590,8 @@ const typographyLateOceanTheme = {
|
|
|
2578
2590
|
types: {
|
|
2579
2591
|
headers: {
|
|
2580
2592
|
fontFamily: {
|
|
2581
|
-
regular: 'Moderat',
|
|
2582
|
-
bold: 'Moderat'
|
|
2593
|
+
regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
|
|
2594
|
+
bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
|
|
2583
2595
|
},
|
|
2584
2596
|
fontWeight: 400,
|
|
2585
2597
|
fontStyle: 'normal',
|
|
@@ -2598,8 +2610,8 @@ const typographyLateOceanTheme = {
|
|
|
2598
2610
|
},
|
|
2599
2611
|
bodies: {
|
|
2600
2612
|
fontFamily: {
|
|
2601
|
-
regular: 'Noto Sans',
|
|
2602
|
-
bold: 'Noto Sans'
|
|
2613
|
+
regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
|
|
2614
|
+
bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
|
|
2603
2615
|
},
|
|
2604
2616
|
fontWeight: {
|
|
2605
2617
|
regular: 400,
|
|
@@ -2703,7 +2715,7 @@ function ModalDateTimePicker({
|
|
|
2703
2715
|
testID: "date-picker-native-element",
|
|
2704
2716
|
value: currentValue,
|
|
2705
2717
|
mode: "time",
|
|
2706
|
-
display: 'default',
|
|
2718
|
+
display: reactNative.Platform.OS === 'ios' ? 'spinner' : 'default',
|
|
2707
2719
|
onChange: (_event, date) => setCurrentValue(prev => {
|
|
2708
2720
|
return date || prev;
|
|
2709
2721
|
})
|
|
@@ -2792,14 +2804,21 @@ function TimePicker({
|
|
|
2792
2804
|
base: "body",
|
|
2793
2805
|
color: displayedValue === timePickerPlaceholder ? 'black-light' : 'black',
|
|
2794
2806
|
children: displayedValue
|
|
2795
|
-
}),
|
|
2807
|
+
}), reactNative.Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
|
|
2808
|
+
is24Hour: true,
|
|
2809
|
+
testID: "date-picker-native-element",
|
|
2810
|
+
value: dateTimePickerValue,
|
|
2811
|
+
mode: "time",
|
|
2812
|
+
display: "default",
|
|
2813
|
+
onChange: (_event, date) => handleTimeChange(date)
|
|
2814
|
+
}) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalDateTimePicker, {
|
|
2796
2815
|
title: title,
|
|
2797
2816
|
visible: isTimePickerModalVisible,
|
|
2798
2817
|
value: dateTimePickerValue,
|
|
2799
2818
|
validateButtonLabel: validateButtonLabel,
|
|
2800
2819
|
onChange: handleTimeChange,
|
|
2801
2820
|
onClose: handleModalClose
|
|
2802
|
-
})]
|
|
2821
|
+
}) : null]
|
|
2803
2822
|
});
|
|
2804
2823
|
}
|
|
2805
2824
|
|
|
@@ -2985,7 +3004,9 @@ const StyledTypographyEmoji = /*#__PURE__*/styled__default(Emoji).withConfig({
|
|
|
2985
3004
|
})(["align-self:center;", ""], ({
|
|
2986
3005
|
size
|
|
2987
3006
|
}) => {
|
|
3007
|
+
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
2988
3008
|
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
3009
|
+
|
|
2989
3010
|
return `
|
|
2990
3011
|
margin: 0 ${size / 20}px 0 ${size / 10}px;
|
|
2991
3012
|
transform: translateY(${size / 10 * 2}px);
|
|
@@ -3016,7 +3037,7 @@ function TypographyEmoji({
|
|
|
3016
3037
|
});
|
|
3017
3038
|
}
|
|
3018
3039
|
|
|
3019
|
-
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/
|
|
3040
|
+
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styledLinaria("span")({
|
|
3020
3041
|
name: "TypographyLinkWebWrapper",
|
|
3021
3042
|
class: "tcwz3nt"
|
|
3022
3043
|
}));
|
|
@@ -3028,6 +3049,7 @@ const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
|
|
|
3028
3049
|
}) => $noUnderline ? 'none' : 'underline', ({
|
|
3029
3050
|
$disabled
|
|
3030
3051
|
}) => {
|
|
3052
|
+
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
3031
3053
|
return `
|
|
3032
3054
|
text-decoration-color: inherit;
|
|
3033
3055
|
transition: color 0.2s ease-in-out;
|