@ornikar/kitt-universal 9.12.2 → 9.13.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 (40) 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/index.d.ts +4 -0
  10. package/dist/definitions/index.d.ts.map +1 -1
  11. package/dist/definitions/themes/default.d.ts +1 -0
  12. package/dist/definitions/themes/default.d.ts.map +1 -1
  13. package/dist/definitions/themes/late-ocean/bottomSheet.d.ts +10 -0
  14. package/dist/definitions/themes/late-ocean/bottomSheet.d.ts.map +1 -0
  15. package/dist/index-browser-all.es.android.js +106 -6
  16. package/dist/index-browser-all.es.android.js.map +1 -1
  17. package/dist/index-browser-all.es.ios.js +106 -6
  18. package/dist/index-browser-all.es.ios.js.map +1 -1
  19. package/dist/index-browser-all.es.js +106 -6
  20. package/dist/index-browser-all.es.js.map +1 -1
  21. package/dist/index-browser-all.es.web.js +46 -4
  22. package/dist/index-browser-all.es.web.js.map +1 -1
  23. package/dist/index-node-14.17.cjs.js +94 -3
  24. package/dist/index-node-14.17.cjs.js.map +1 -1
  25. package/dist/index-node-14.17.cjs.web.js +45 -2
  26. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  27. package/dist/linaria-themes-browser-all.es.android.js +12 -2
  28. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  29. package/dist/linaria-themes-browser-all.es.ios.js +12 -2
  30. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  31. package/dist/linaria-themes-browser-all.es.js +12 -2
  32. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  33. package/dist/linaria-themes-browser-all.es.web.js +12 -2
  34. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  35. package/dist/linaria-themes-node-14.17.cjs.js +12 -2
  36. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  37. package/dist/linaria-themes-node-14.17.cjs.web.js +12 -2
  38. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  39. package/dist/tsbuildinfo +1 -1
  40. 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: {
@@ -2510,8 +2611,6 @@ var fullScreenModal = {
2510
2611
  }
2511
2612
  };
2512
2613
 
2513
- var spacing = 4;
2514
-
2515
2614
  var highlight = {
2516
2615
  borderRadius: {
2517
2616
  base: spacing * 5
@@ -2721,6 +2820,7 @@ var theme = {
2721
2820
  avatar: avatar,
2722
2821
  breakpoints: breakpoints,
2723
2822
  button: button,
2823
+ bottomSheet: bottomSheet,
2724
2824
  card: card,
2725
2825
  choices: choices,
2726
2826
  dialogModal: dialogModal,
@@ -6467,5 +6567,5 @@ function withTheme(WrappedComponent) {
6467
6567
  });
6468
6568
  }
6469
6569
 
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 };
6570
+ 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
6571
  //# sourceMappingURL=index-browser-all.es.ios.js.map