@ornikar/kitt-universal 9.12.2 → 9.14.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.
Files changed (50) hide show
  1. package/dist/definitions/BottomSheet/BottomSheet.d.ts +16 -0
  2. package/dist/definitions/BottomSheet/BottomSheet.d.ts.map +1 -0
  3. package/dist/definitions/BottomSheet/BottomSheet.web.d.ts +7 -0
  4. package/dist/definitions/BottomSheet/BottomSheet.web.d.ts.map +1 -0
  5. package/dist/definitions/BottomSheet/useBottomSheet.d.ts +4 -0
  6. package/dist/definitions/BottomSheet/useBottomSheet.d.ts.map +1 -0
  7. package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts +15 -0
  8. package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts.map +1 -0
  9. package/dist/definitions/Tag/Tag.d.ts +1 -1
  10. package/dist/definitions/Tag/Tag.d.ts.map +1 -1
  11. package/dist/definitions/index.d.ts +4 -0
  12. package/dist/definitions/index.d.ts.map +1 -1
  13. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +1 -0
  14. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  15. package/dist/definitions/themes/default.d.ts +2 -0
  16. package/dist/definitions/themes/default.d.ts.map +1 -1
  17. package/dist/definitions/themes/late-ocean/bottomSheet.d.ts +10 -0
  18. package/dist/definitions/themes/late-ocean/bottomSheet.d.ts.map +1 -0
  19. package/dist/definitions/themes/late-ocean/tag.d.ts +1 -0
  20. package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -1
  21. package/dist/definitions/themes/late-ocean/typography.d.ts +1 -0
  22. package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -1
  23. package/dist/definitions/typography/Typography.d.ts +1 -1
  24. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  25. package/dist/index-browser-all.es.android.js +125 -7
  26. package/dist/index-browser-all.es.android.js.map +1 -1
  27. package/dist/index-browser-all.es.ios.js +125 -7
  28. package/dist/index-browser-all.es.ios.js.map +1 -1
  29. package/dist/index-browser-all.es.js +125 -7
  30. package/dist/index-browser-all.es.js.map +1 -1
  31. package/dist/index-browser-all.es.web.js +65 -5
  32. package/dist/index-browser-all.es.web.js.map +1 -1
  33. package/dist/index-node-14.17.cjs.js +113 -4
  34. package/dist/index-node-14.17.cjs.js.map +1 -1
  35. package/dist/index-node-14.17.cjs.web.js +64 -3
  36. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  37. package/dist/linaria-themes-browser-all.es.android.js +26 -3
  38. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  39. package/dist/linaria-themes-browser-all.es.ios.js +26 -3
  40. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  41. package/dist/linaria-themes-browser-all.es.js +26 -3
  42. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  43. package/dist/linaria-themes-browser-all.es.web.js +26 -3
  44. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  45. package/dist/linaria-themes-node-14.17.cjs.js +26 -3
  46. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  47. package/dist/linaria-themes-node-14.17.cjs.web.js +26 -3
  48. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  49. package/dist/tsbuildinfo +1 -1
  50. package/package.json +8 -2
@@ -2,8 +2,8 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import { Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, Text as Text$1, View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, Image as Image$1, Input, NativeBaseProvider, extendTheme } from 'native-base';
4
4
  import _extends from '@babel/runtime/helpers/extends';
5
- import React, { forwardRef, useContext, createContext, cloneElement, useRef, useEffect, useState, Children, useMemo, Fragment as Fragment$1 } from 'react';
6
- import { Platform, Animated as Animated$1, Easing, useWindowDimensions, Image, StyleSheet, View as View$2, ScrollView as ScrollView$2, Pressable as Pressable$2, Modal as Modal$1, Linking, Text as Text$2 } from 'react-native';
5
+ import React, { forwardRef, useContext, createContext, cloneElement, useRef, useEffect, useState, useMemo, Children, Fragment as Fragment$1 } from 'react';
6
+ import { Platform, Animated as Animated$1, Easing, useWindowDimensions, Image, View as View$2, StyleSheet, ScrollView as ScrollView$2, Pressable as Pressable$2, Modal as Modal$1, Linking, Text as Text$2 } from 'react-native';
7
7
  export { useWindowDimensions as useWindowSize } from 'react-native';
8
8
  import Animated, { useSharedValue, useAnimatedStyle, interpolateColor, withSpring, useDerivedValue, withTiming, Easing as Easing$1, runOnJS, useAnimatedProps, withDelay, withRepeat, interpolate } from 'react-native-reanimated';
9
9
  import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
@@ -13,11 +13,12 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
13
13
  import _regeneratorRuntime from '@babel/runtime/regenerator';
14
14
  import { ArcIcon, UserIcon, CheckboxMark, XIcon, EyeOffIcon, EyeIcon, InfoIcon, AlertTriangleIcon, CheckIcon, AlertCircleIcon, TooltipArrowIcon } from '@ornikar/kitt-icons';
15
15
  export * from '@ornikar/kitt-icons';
16
+ import { BottomSheetScrollView, BottomSheetView, useBottomSheetDynamicSnapPoints, BottomSheetModal, BottomSheetHandle, BottomSheetBackdrop } from '@gorhom/bottom-sheet';
17
+ import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
16
18
  import { parse } from 'twemoji-parser';
17
19
  import { openBrowserAsync } from 'expo-web-browser';
18
20
  import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker';
19
21
  import { FormattedMessage } from 'react-intl';
20
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
21
22
  import Svg, { Circle as Circle$1 } from 'react-native-svg';
22
23
  import { Picker as Picker$1 } from '@react-native-picker/picker';
23
24
  import { LinearGradient } from 'expo-linear-gradient';
@@ -1044,6 +1045,95 @@ function Avatar(_ref6) {
1044
1045
  });
1045
1046
  }
1046
1047
 
1048
+ var BottomSheetContainerView = /*#__PURE__*/styled(View$2).withConfig({
1049
+ displayName: "BottomSheet__BottomSheetContainerView"
1050
+ })(["padding:", ";"], function (_ref) {
1051
+ var theme = _ref.theme;
1052
+ return "".concat(theme.kitt.bottomSheet.container.padding, "px");
1053
+ });
1054
+
1055
+ function BottomSheetComp(_ref2, ref) {
1056
+ var Content = _ref2.children,
1057
+ _ref2$hasScrollView = _ref2.hasScrollView,
1058
+ hasScrollView = _ref2$hasScrollView === void 0 ? false : _ref2$hasScrollView,
1059
+ _ref2$hasBackdrop = _ref2.hasBackdrop,
1060
+ hasBackdrop = _ref2$hasBackdrop === void 0 ? true : _ref2$hasBackdrop,
1061
+ _ref2$hasHandle = _ref2.hasHandle,
1062
+ hasHandle = _ref2$hasHandle === void 0 ? true : _ref2$hasHandle;
1063
+ var Wrapper = useMemo(function () {
1064
+ return hasScrollView ? BottomSheetScrollView : BottomSheetView;
1065
+ }, [hasScrollView]);
1066
+ var theme = /*#__PURE__*/useTheme();
1067
+ var initialSnapPoints = useMemo(function () {
1068
+ return ['CONTENT_HEIGHT'];
1069
+ }, []);
1070
+
1071
+ var _useBottomSheetDynami = useBottomSheetDynamicSnapPoints(initialSnapPoints),
1072
+ animatedHandleHeight = _useBottomSheetDynami.animatedHandleHeight,
1073
+ animatedSnapPoints = _useBottomSheetDynami.animatedSnapPoints,
1074
+ animatedContentHeight = _useBottomSheetDynami.animatedContentHeight,
1075
+ handleContentLayout = _useBottomSheetDynami.handleContentLayout;
1076
+
1077
+ return /*#__PURE__*/jsx(BottomSheetModal, {
1078
+ ref: ref,
1079
+ enablePanDownToClose: true,
1080
+ snapPoints: animatedSnapPoints,
1081
+ index: 0,
1082
+ handleHeight: animatedHandleHeight,
1083
+ handleIndicatorStyle: {
1084
+ width: 40,
1085
+ height: 4,
1086
+ borderRadius: 4,
1087
+ backgroundColor: theme.kitt.bottomSheet.handle.backgroundColor
1088
+ },
1089
+ handleComponent: function handleComponent(props) {
1090
+ return hasHandle ? /*#__PURE__*/jsx(BottomSheetHandle, _objectSpread({}, props)) : null;
1091
+ },
1092
+ backdropComponent: function backdropComponent(props) {
1093
+ return hasBackdrop ? /*#__PURE__*/jsx(BottomSheetBackdrop, _objectSpread(_objectSpread({}, props), {}, {
1094
+ opacity: 0.25,
1095
+ appearsOnIndex: 0,
1096
+ disappearsOnIndex: -1
1097
+ })) : null;
1098
+ },
1099
+ contentHeight: animatedContentHeight,
1100
+ children: function children(_ref3) {
1101
+ var data = _ref3.data;
1102
+ return /*#__PURE__*/jsx(SafeAreaView, {
1103
+ edges: ['bottom'],
1104
+ onLayout: handleContentLayout,
1105
+ children: /*#__PURE__*/jsx(Wrapper, {
1106
+ children: typeof Content === 'function' ? /*#__PURE__*/jsx(Content, _objectSpread({}, data)) : Content
1107
+ })
1108
+ });
1109
+ }
1110
+ });
1111
+ }
1112
+
1113
+ var BottomSheet = /*#__PURE__*/forwardRef(BottomSheetComp);
1114
+ BottomSheet.View = BottomSheetContainerView;
1115
+
1116
+ function useBottomSheet() {
1117
+ var ref = useRef(null);
1118
+ return ref;
1119
+ }
1120
+
1121
+ function useStaticBottomSheet(Content) {
1122
+ var bottomSheetRef = useRef(null);
1123
+ var BottomSheetMemoized = useMemo(function () {
1124
+ return function (props) {
1125
+ return /*#__PURE__*/jsx(BottomSheet, _objectSpread(_objectSpread({}, props), {}, {
1126
+ ref: bottomSheetRef,
1127
+ children: Content
1128
+ }));
1129
+ };
1130
+ }, [Content]);
1131
+ return {
1132
+ bottomSheetRef: bottomSheetRef,
1133
+ BottomSheet: BottomSheetMemoized
1134
+ };
1135
+ }
1136
+
1047
1137
  var Container$5 = /*#__PURE__*/styled.View.withConfig({
1048
1138
  displayName: "Card__Container"
1049
1139
  })(["background-color:", ";padding:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
@@ -2081,6 +2171,17 @@ var avatar = {
2081
2171
  }
2082
2172
  };
2083
2173
 
2174
+ var spacing = 4;
2175
+
2176
+ var bottomSheet = {
2177
+ container: {
2178
+ padding: spacing * 4
2179
+ },
2180
+ handle: {
2181
+ backgroundColor: lateOceanColorPalette.black200
2182
+ }
2183
+ };
2184
+
2084
2185
  var button = {
2085
2186
  borderRadius: 30,
2086
2187
  borderWidth: {
@@ -2331,7 +2432,8 @@ var typography = {
2331
2432
  'primary-light': colors.primaryLight,
2332
2433
  accent: colors.accent,
2333
2434
  success: colors.success,
2334
- danger: colors.danger
2435
+ danger: colors.danger,
2436
+ warning: colors.warning
2335
2437
  },
2336
2438
  types: {
2337
2439
  headers: {
@@ -2510,8 +2612,6 @@ var fullScreenModal = {
2510
2612
  }
2511
2613
  };
2512
2614
 
2513
- var spacing = 4;
2514
-
2515
2615
  var highlight = {
2516
2616
  borderRadius: {
2517
2617
  base: spacing * 5
@@ -2677,6 +2777,18 @@ var tag = {
2677
2777
  borderWidth: 1,
2678
2778
  borderColor: colors.danger
2679
2779
  }
2780
+ },
2781
+ warn: {
2782
+ fill: {
2783
+ backgroundColor: colors.warning,
2784
+ borderWidth: 0,
2785
+ borderColor: colors.transparent
2786
+ },
2787
+ outline: {
2788
+ backgroundColor: colors.transparent,
2789
+ borderWidth: 1,
2790
+ borderColor: colors.warning
2791
+ }
2680
2792
  }
2681
2793
  };
2682
2794
 
@@ -2721,6 +2833,7 @@ var theme = {
2721
2833
  avatar: avatar,
2722
2834
  breakpoints: breakpoints,
2723
2835
  button: button,
2836
+ bottomSheet: bottomSheet,
2724
2837
  card: card,
2725
2838
  choices: choices,
2726
2839
  dialogModal: dialogModal,
@@ -5903,6 +6016,11 @@ var getLabelColor = function (type, variant) {
5903
6016
  return variant === 'outline' ? 'danger' : 'black';
5904
6017
  }
5905
6018
 
6019
+ case 'warn':
6020
+ {
6021
+ return variant === 'outline' ? 'warning' : 'black';
6022
+ }
6023
+
5906
6024
  case 'primary':
5907
6025
  {
5908
6026
  return 'primary';
@@ -6467,5 +6585,5 @@ function withTheme(WrappedComponent) {
6467
6585
  });
6468
6586
  }
6469
6587
 
6470
- export { Actions, Avatar, Button, Card, Checkbox, ChoicesElements, DatePicker, DialogModal, Emoji, ExternalAppLink, ExternalLink, Flex, FullScreenModal, HStack, Highlight, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpoints, KittBreakpointsMax, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MatchWindowSize, Message, Modal, ModalBehaviour, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, ScrollView, DeprecatedSection as Section, Skeleton, SpinningIcon, Stack, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, View, createChoicesComponent, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor, withTheme };
6588
+ export { Actions, Avatar, BottomSheet, Button, Card, Checkbox, ChoicesElements, DatePicker, DialogModal, Emoji, ExternalAppLink, ExternalLink, Flex, FullScreenModal, HStack, Highlight, Icon, IconButton, InputEmail, InputFeedback, InputField, InputIcon, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpoints, KittBreakpointsMax, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MatchWindowSize, Message, Modal, ModalBehaviour, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, ScrollView, DeprecatedSection as Section, Skeleton, SpinningIcon, Stack, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, View, createChoicesComponent, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useBottomSheet, useKittTheme, useMatchWindowSize, useStaticBottomSheet, useStoryBlockColor, withTheme };
6471
6589
  //# sourceMappingURL=index-browser-all.es.ios.js.map