@ornikar/kitt-universal 2.3.0 → 2.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.
- package/dist/definitions/Emoji/Emoji.d.ts +8 -0
- package/dist/definitions/Emoji/Emoji.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +6 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveImage.d.ts +13 -0
- package/dist/definitions/primitives/PrimitiveImage.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts +4 -0
- package/dist/definitions/primitives/PrimitiveImage.web.d.ts.map +1 -0
- package/dist/definitions/primitives/PrimitivePressable.d.ts +1 -0
- package/dist/definitions/primitives/PrimitivePressable.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitivePressable.web.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveView.d.ts +1 -0
- package/dist/definitions/primitives/PrimitiveView.d.ts.map +1 -1
- package/dist/definitions/primitives/PrimitiveView.web.d.ts.map +1 -1
- package/dist/definitions/story-components/StoryDecorator.d.ts +3 -3
- package/dist/definitions/story-components/StoryDecorator.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +3 -3
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyEmoji.d.ts +8 -0
- package/dist/definitions/typography/TypographyEmoji.d.ts.map +1 -0
- package/dist/definitions/utils/storybook/decorators/SafeAreaProviderDecorator.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +137 -62
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +137 -62
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +83 -3
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +100 -2
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +84 -0
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -2
|
@@ -2,11 +2,12 @@ import _extends from '@babel/runtime/helpers/extends';
|
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import { UserIcon, EyeIcon, EyeOffIcon, XIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon } from '@ornikar/kitt-icons';
|
|
4
4
|
export * from '@ornikar/kitt-icons';
|
|
5
|
-
import React, { useRef, useEffect, useContext, createContext, useState, forwardRef, Fragment
|
|
6
|
-
import { View, Animated, Easing, Text as Text$1, Image, Pressable, Linking, TextInput,
|
|
5
|
+
import React, { useRef, useEffect, useContext, createContext, useState, useMemo, forwardRef, Fragment } from 'react';
|
|
6
|
+
import { View, Animated, Easing, Text as Text$1, Image, Pressable, Platform, Linking, TextInput, useWindowDimensions, ActivityIndicator, TouchableOpacity, StyleSheet, ScrollView, Modal as Modal$1 } from 'react-native';
|
|
7
7
|
export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
8
8
|
import styled, { useTheme, css, ThemeProvider } from 'styled-components';
|
|
9
9
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import { parse } from 'twemoji-parser';
|
|
10
11
|
import { openBrowserAsync } from 'expo-web-browser';
|
|
11
12
|
import { useSafeAreaInsets, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
12
13
|
import Animated$1, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
|
|
@@ -544,6 +545,45 @@ function Card(_ref6) {
|
|
|
544
545
|
}, children);
|
|
545
546
|
}
|
|
546
547
|
|
|
548
|
+
var PrimitiveImage = Image;
|
|
549
|
+
|
|
550
|
+
var StyledEmoji = /*#__PURE__*/styled(PrimitiveImage).withConfig({
|
|
551
|
+
displayName: "Emoji__StyledEmoji",
|
|
552
|
+
componentId: "kitt-universal__sc-ggl6wj-0"
|
|
553
|
+
})(["width:", "px;height:", "px;"], function (_ref) {
|
|
554
|
+
var size = _ref.size;
|
|
555
|
+
return size;
|
|
556
|
+
}, function (_ref2) {
|
|
557
|
+
var size = _ref2.size;
|
|
558
|
+
return size;
|
|
559
|
+
});
|
|
560
|
+
function Emoji(_ref3) {
|
|
561
|
+
var emoji = _ref3.emoji,
|
|
562
|
+
size = _ref3.size,
|
|
563
|
+
style = _ref3.style,
|
|
564
|
+
className = _ref3.className;
|
|
565
|
+
|
|
566
|
+
var _useMemo = useMemo(function () {
|
|
567
|
+
return parse(emoji, {
|
|
568
|
+
// on native plaforms, you can't display svg as Image
|
|
569
|
+
assetType: Platform.OS === 'web' ? 'svg' : 'png'
|
|
570
|
+
});
|
|
571
|
+
}, [emoji]),
|
|
572
|
+
_useMemo2 = _slicedToArray(_useMemo, 1),
|
|
573
|
+
emojiData = _useMemo2[0];
|
|
574
|
+
|
|
575
|
+
if (!emojiData) return null;
|
|
576
|
+
return /*#__PURE__*/React.createElement(StyledEmoji, {
|
|
577
|
+
size: size,
|
|
578
|
+
accessibilityLabel: emojiData.text,
|
|
579
|
+
source: {
|
|
580
|
+
uri: emojiData.url
|
|
581
|
+
},
|
|
582
|
+
style: style,
|
|
583
|
+
className: className
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
|
|
547
587
|
var defaultOpenLinkBehavior = {
|
|
548
588
|
"native": 'openInModal',
|
|
549
589
|
web: 'targetBlank'
|
|
@@ -2555,6 +2595,46 @@ function Tooltip(_ref) {
|
|
|
2555
2595
|
return /*#__PURE__*/React.createElement(PrimitiveView, null, children);
|
|
2556
2596
|
}
|
|
2557
2597
|
|
|
2598
|
+
var isBody = function (value) {
|
|
2599
|
+
return ['body-large', 'body-medium', 'body', 'body-small', 'body-xsmall'].includes(value);
|
|
2600
|
+
};
|
|
2601
|
+
|
|
2602
|
+
function getDimensions(base, theme) {
|
|
2603
|
+
if (isBody(base)) {
|
|
2604
|
+
return theme.kitt.typography.types.bodies.configs[base];
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
return theme.kitt.typography.types.headers.configs[base];
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
var StyledTypographyEmoji = /*#__PURE__*/styled(Emoji).withConfig({
|
|
2611
|
+
displayName: "TypographyEmoji__StyledTypographyEmoji",
|
|
2612
|
+
componentId: "kitt-universal__sc-1if5guu-0"
|
|
2613
|
+
})(["align-self:center;", ""], function (_ref) {
|
|
2614
|
+
var size = _ref.size;
|
|
2615
|
+
if (Platform.OS !== 'web') return undefined;
|
|
2616
|
+
/* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
|
|
2617
|
+
|
|
2618
|
+
return "\n margin: 0 ".concat(size / 20, "px 0 ").concat(size / 10, "px;\n transform: translateY(").concat(size / 10 * 2, "px);\n ");
|
|
2619
|
+
});
|
|
2620
|
+
function TypographyEmoji(_ref2) {
|
|
2621
|
+
var emoji = _ref2.emoji,
|
|
2622
|
+
_ref2$base = _ref2.base,
|
|
2623
|
+
base = _ref2$base === void 0 ? 'body' : _ref2$base;
|
|
2624
|
+
var theme = /*#__PURE__*/useTheme();
|
|
2625
|
+
var dimensions = getDimensions(base, theme);
|
|
2626
|
+
var fontSize = dimensions.baseAndSmall.fontSize;
|
|
2627
|
+
|
|
2628
|
+
if ((process.env.NODE_ENV !== "production")) {
|
|
2629
|
+
if (!fontSize.endsWith('px')) throw new Error("Unexpected font-size value: ".concat(fontSize));
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
return /*#__PURE__*/React.createElement(StyledTypographyEmoji, {
|
|
2633
|
+
size: parseInt(fontSize.slice(0, -2), 10),
|
|
2634
|
+
emoji: emoji
|
|
2635
|
+
});
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2558
2638
|
var _excluded$1 = ["children", "disabled", "noUnderline", "href", "hrefAttrs", "onPress"];
|
|
2559
2639
|
var StyledLink = /*#__PURE__*/styled(PrimitiveLink).withConfig({
|
|
2560
2640
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -2696,5 +2776,5 @@ function MatchWindowSize(_ref) {
|
|
|
2696
2776
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
2697
2777
|
}
|
|
2698
2778
|
|
|
2699
|
-
export { Avatar, Button, Card, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, PrimitiveLink, PrimitivePressable, PrimitiveScrollView, PrimitiveText, PrimitiveView, Radio, SafeAreaProviderDecorator, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2779
|
+
export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, PrimitiveImage, PrimitiveLink, PrimitivePressable, PrimitiveScrollView, PrimitiveText, PrimitiveView, Radio, SafeAreaProviderDecorator, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
|
|
2700
2780
|
//# sourceMappingURL=index-browser-all.es.js.map
|