@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,12 +13,13 @@ 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
22
  import { styled as styled$1 } from '@linaria/react';
21
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
22
23
  import Svg, { Circle as Circle$1 } from 'react-native-svg';
23
24
  import { Picker as Picker$1 } from '@react-native-picker/picker';
24
25
  import { LinearGradient } from 'expo-linear-gradient';
@@ -1045,6 +1046,95 @@ function Avatar(_ref6) {
1045
1046
  });
1046
1047
  }
1047
1048
 
1049
+ var BottomSheetContainerView = /*#__PURE__*/styled(View$2).withConfig({
1050
+ displayName: "BottomSheet__BottomSheetContainerView"
1051
+ })(["padding:", ";"], function (_ref) {
1052
+ var theme = _ref.theme;
1053
+ return "".concat(theme.kitt.bottomSheet.container.padding, "px");
1054
+ });
1055
+
1056
+ function BottomSheetComp(_ref2, ref) {
1057
+ var Content = _ref2.children,
1058
+ _ref2$hasScrollView = _ref2.hasScrollView,
1059
+ hasScrollView = _ref2$hasScrollView === void 0 ? false : _ref2$hasScrollView,
1060
+ _ref2$hasBackdrop = _ref2.hasBackdrop,
1061
+ hasBackdrop = _ref2$hasBackdrop === void 0 ? true : _ref2$hasBackdrop,
1062
+ _ref2$hasHandle = _ref2.hasHandle,
1063
+ hasHandle = _ref2$hasHandle === void 0 ? true : _ref2$hasHandle;
1064
+ var Wrapper = useMemo(function () {
1065
+ return hasScrollView ? BottomSheetScrollView : BottomSheetView;
1066
+ }, [hasScrollView]);
1067
+ var theme = /*#__PURE__*/useTheme();
1068
+ var initialSnapPoints = useMemo(function () {
1069
+ return ['CONTENT_HEIGHT'];
1070
+ }, []);
1071
+
1072
+ var _useBottomSheetDynami = useBottomSheetDynamicSnapPoints(initialSnapPoints),
1073
+ animatedHandleHeight = _useBottomSheetDynami.animatedHandleHeight,
1074
+ animatedSnapPoints = _useBottomSheetDynami.animatedSnapPoints,
1075
+ animatedContentHeight = _useBottomSheetDynami.animatedContentHeight,
1076
+ handleContentLayout = _useBottomSheetDynami.handleContentLayout;
1077
+
1078
+ return /*#__PURE__*/jsx(BottomSheetModal, {
1079
+ ref: ref,
1080
+ enablePanDownToClose: true,
1081
+ snapPoints: animatedSnapPoints,
1082
+ index: 0,
1083
+ handleHeight: animatedHandleHeight,
1084
+ handleIndicatorStyle: {
1085
+ width: 40,
1086
+ height: 4,
1087
+ borderRadius: 4,
1088
+ backgroundColor: theme.kitt.bottomSheet.handle.backgroundColor
1089
+ },
1090
+ handleComponent: function handleComponent(props) {
1091
+ return hasHandle ? /*#__PURE__*/jsx(BottomSheetHandle, _objectSpread({}, props)) : null;
1092
+ },
1093
+ backdropComponent: function backdropComponent(props) {
1094
+ return hasBackdrop ? /*#__PURE__*/jsx(BottomSheetBackdrop, _objectSpread(_objectSpread({}, props), {}, {
1095
+ opacity: 0.25,
1096
+ appearsOnIndex: 0,
1097
+ disappearsOnIndex: -1
1098
+ })) : null;
1099
+ },
1100
+ contentHeight: animatedContentHeight,
1101
+ children: function children(_ref3) {
1102
+ var data = _ref3.data;
1103
+ return /*#__PURE__*/jsx(SafeAreaView, {
1104
+ edges: ['bottom'],
1105
+ onLayout: handleContentLayout,
1106
+ children: /*#__PURE__*/jsx(Wrapper, {
1107
+ children: typeof Content === 'function' ? /*#__PURE__*/jsx(Content, _objectSpread({}, data)) : Content
1108
+ })
1109
+ });
1110
+ }
1111
+ });
1112
+ }
1113
+
1114
+ var BottomSheet = /*#__PURE__*/forwardRef(BottomSheetComp);
1115
+ BottomSheet.View = BottomSheetContainerView;
1116
+
1117
+ function useBottomSheet() {
1118
+ var ref = useRef(null);
1119
+ return ref;
1120
+ }
1121
+
1122
+ function useStaticBottomSheet(Content) {
1123
+ var bottomSheetRef = useRef(null);
1124
+ var BottomSheetMemoized = useMemo(function () {
1125
+ return function (props) {
1126
+ return /*#__PURE__*/jsx(BottomSheet, _objectSpread(_objectSpread({}, props), {}, {
1127
+ ref: bottomSheetRef,
1128
+ children: Content
1129
+ }));
1130
+ };
1131
+ }, [Content]);
1132
+ return {
1133
+ bottomSheetRef: bottomSheetRef,
1134
+ BottomSheet: BottomSheetMemoized
1135
+ };
1136
+ }
1137
+
1048
1138
  var Container$5 = /*#__PURE__*/styled.View.withConfig({
1049
1139
  displayName: "Card__Container"
1050
1140
  })(["background-color:", ";padding:", "px;border-radius:", "px;border-width:", "px;border-color:", ";"], function (_ref) {
@@ -2082,6 +2172,17 @@ var avatar = {
2082
2172
  }
2083
2173
  };
2084
2174
 
2175
+ var spacing = 4;
2176
+
2177
+ var bottomSheet = {
2178
+ container: {
2179
+ padding: spacing * 4
2180
+ },
2181
+ handle: {
2182
+ backgroundColor: lateOceanColorPalette.black200
2183
+ }
2184
+ };
2185
+
2085
2186
  var button = {
2086
2187
  borderRadius: 30,
2087
2188
  borderWidth: {
@@ -2332,7 +2433,8 @@ var typography = {
2332
2433
  'primary-light': colors.primaryLight,
2333
2434
  accent: colors.accent,
2334
2435
  success: colors.success,
2335
- danger: colors.danger
2436
+ danger: colors.danger,
2437
+ warning: colors.warning
2336
2438
  },
2337
2439
  types: {
2338
2440
  headers: {
@@ -2511,8 +2613,6 @@ var fullScreenModal = {
2511
2613
  }
2512
2614
  };
2513
2615
 
2514
- var spacing = 4;
2515
-
2516
2616
  var highlight = {
2517
2617
  borderRadius: {
2518
2618
  base: spacing * 5
@@ -2678,6 +2778,18 @@ var tag = {
2678
2778
  borderWidth: 1,
2679
2779
  borderColor: colors.danger
2680
2780
  }
2781
+ },
2782
+ warn: {
2783
+ fill: {
2784
+ backgroundColor: colors.warning,
2785
+ borderWidth: 0,
2786
+ borderColor: colors.transparent
2787
+ },
2788
+ outline: {
2789
+ backgroundColor: colors.transparent,
2790
+ borderWidth: 1,
2791
+ borderColor: colors.warning
2792
+ }
2681
2793
  }
2682
2794
  };
2683
2795
 
@@ -2722,6 +2834,7 @@ var theme = {
2722
2834
  avatar: avatar,
2723
2835
  breakpoints: breakpoints,
2724
2836
  button: button,
2837
+ bottomSheet: bottomSheet,
2725
2838
  card: card,
2726
2839
  choices: choices,
2727
2840
  dialogModal: dialogModal,
@@ -5956,6 +6069,11 @@ var getLabelColor = function (type, variant) {
5956
6069
  return variant === 'outline' ? 'danger' : 'black';
5957
6070
  }
5958
6071
 
6072
+ case 'warn':
6073
+ {
6074
+ return variant === 'outline' ? 'warning' : 'black';
6075
+ }
6076
+
5959
6077
  case 'primary':
5960
6078
  {
5961
6079
  return 'primary';
@@ -6511,5 +6629,5 @@ function MatchWindowSize(_ref) {
6511
6629
  return children;
6512
6630
  }
6513
6631
 
6514
- 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 };
6632
+ 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 };
6515
6633
  //# sourceMappingURL=index-browser-all.es.js.map