@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
@@ -9,12 +9,13 @@ const Animated = require('react-native-reanimated');
9
9
  const styled = require('styled-components/native');
10
10
  const jsxRuntime = require('react/jsx-runtime');
11
11
  const kittIcons = require('@ornikar/kitt-icons');
12
+ const bottomSheet$1 = require('@gorhom/bottom-sheet');
13
+ const reactNativeSafeAreaContext = require('react-native-safe-area-context');
12
14
  const twemojiParser = require('twemoji-parser');
13
15
  const WebBrowser = require('expo-web-browser');
14
16
  const DateTimePicker = require('@react-native-community/datetimepicker');
15
17
  const reactIntl = require('react-intl');
16
18
  const react = require('@linaria/react');
17
- const reactNativeSafeAreaContext = require('react-native-safe-area-context');
18
19
  const Svg = require('react-native-svg');
19
20
  const picker$1 = require('@react-native-picker/picker');
20
21
  const expoLinearGradient = require('expo-linear-gradient');
@@ -1005,6 +1006,83 @@ function Avatar({
1005
1006
  });
1006
1007
  }
1007
1008
 
1009
+ const BottomSheetContainerView = /*#__PURE__*/styled__default(reactNative.View).withConfig({
1010
+ displayName: "BottomSheet__BottomSheetContainerView",
1011
+ componentId: "kitt-universal__sc-12w4qg8-0"
1012
+ })(["padding:", ";"], ({
1013
+ theme
1014
+ }) => `${theme.kitt.bottomSheet.container.padding}px`);
1015
+
1016
+ function BottomSheetComp({
1017
+ children: Content,
1018
+ hasScrollView = false,
1019
+ hasBackdrop = true,
1020
+ hasHandle = true
1021
+ }, ref) {
1022
+ const Wrapper = React.useMemo(() => hasScrollView ? bottomSheet$1.BottomSheetScrollView : bottomSheet$1.BottomSheetView, [hasScrollView]);
1023
+ const theme = /*#__PURE__*/styled.useTheme();
1024
+ const initialSnapPoints = React.useMemo(() => ['CONTENT_HEIGHT'], []);
1025
+ const {
1026
+ animatedHandleHeight,
1027
+ animatedSnapPoints,
1028
+ animatedContentHeight,
1029
+ handleContentLayout
1030
+ } = bottomSheet$1.useBottomSheetDynamicSnapPoints(initialSnapPoints);
1031
+ return /*#__PURE__*/jsxRuntime.jsx(bottomSheet$1.BottomSheetModal, {
1032
+ ref: ref,
1033
+ enablePanDownToClose: true,
1034
+ snapPoints: animatedSnapPoints,
1035
+ index: 0,
1036
+ handleHeight: animatedHandleHeight,
1037
+ handleIndicatorStyle: {
1038
+ width: 40,
1039
+ height: 4,
1040
+ borderRadius: 4,
1041
+ backgroundColor: theme.kitt.bottomSheet.handle.backgroundColor
1042
+ },
1043
+ handleComponent: props => hasHandle ? /*#__PURE__*/jsxRuntime.jsx(bottomSheet$1.BottomSheetHandle, { ...props
1044
+ }) : null,
1045
+ backdropComponent: props => hasBackdrop ? /*#__PURE__*/jsxRuntime.jsx(bottomSheet$1.BottomSheetBackdrop, { ...props,
1046
+ opacity: 0.25,
1047
+ appearsOnIndex: 0,
1048
+ disappearsOnIndex: -1
1049
+ }) : null,
1050
+ contentHeight: animatedContentHeight,
1051
+ children: ({
1052
+ data
1053
+ }) => /*#__PURE__*/jsxRuntime.jsx(reactNativeSafeAreaContext.SafeAreaView, {
1054
+ edges: ['bottom'],
1055
+ onLayout: handleContentLayout,
1056
+ children: /*#__PURE__*/jsxRuntime.jsx(Wrapper, {
1057
+ children: typeof Content === 'function' ? /*#__PURE__*/jsxRuntime.jsx(Content, { ...data
1058
+ }) : Content
1059
+ })
1060
+ })
1061
+ });
1062
+ }
1063
+
1064
+ const BottomSheet = /*#__PURE__*/React.forwardRef(BottomSheetComp);
1065
+ BottomSheet.View = BottomSheetContainerView;
1066
+
1067
+ function useBottomSheet() {
1068
+ const ref = React.useRef(null);
1069
+ return ref;
1070
+ }
1071
+
1072
+ function useStaticBottomSheet(Content) {
1073
+ const bottomSheetRef = React.useRef(null);
1074
+ const BottomSheetMemoized = React.useMemo(() => function (props) {
1075
+ return /*#__PURE__*/jsxRuntime.jsx(BottomSheet, { ...props,
1076
+ ref: bottomSheetRef,
1077
+ children: Content
1078
+ });
1079
+ }, [Content]);
1080
+ return {
1081
+ bottomSheetRef,
1082
+ BottomSheet: BottomSheetMemoized
1083
+ };
1084
+ }
1085
+
1008
1086
  const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
1009
1087
  displayName: "Card__Container",
1010
1088
  componentId: "kitt-universal__sc-1n9psug-0"
@@ -1977,6 +2055,17 @@ const avatar = {
1977
2055
  }
1978
2056
  };
1979
2057
 
2058
+ const spacing = 4;
2059
+
2060
+ const bottomSheet = {
2061
+ container: {
2062
+ padding: spacing * 4
2063
+ },
2064
+ handle: {
2065
+ backgroundColor: lateOceanColorPalette.black200
2066
+ }
2067
+ };
2068
+
1980
2069
  const button = {
1981
2070
  borderRadius: 30,
1982
2071
  borderWidth: {
@@ -2402,8 +2491,6 @@ const fullScreenModal = {
2402
2491
  }
2403
2492
  };
2404
2493
 
2405
- const spacing = 4;
2406
-
2407
2494
  const highlight = {
2408
2495
  borderRadius: {
2409
2496
  base: spacing * 5
@@ -2613,6 +2700,7 @@ const theme = {
2613
2700
  avatar,
2614
2701
  breakpoints,
2615
2702
  button,
2703
+ bottomSheet,
2616
2704
  card,
2617
2705
  choices,
2618
2706
  dialogModal,
@@ -6276,6 +6364,7 @@ function MatchWindowSize({
6276
6364
  exports.useWindowSize = reactNative.useWindowDimensions;
6277
6365
  exports.Actions = Actions;
6278
6366
  exports.Avatar = Avatar;
6367
+ exports.BottomSheet = BottomSheet;
6279
6368
  exports.Button = Button;
6280
6369
  exports.Card = Card;
6281
6370
  exports.Checkbox = Checkbox;
@@ -6348,8 +6437,10 @@ exports.hex2rgba = hex2rgba;
6348
6437
  exports.matchWindowSize = matchWindowSize;
6349
6438
  exports.styledTextInputMixin = styledTextInputMixin;
6350
6439
  exports.theme = theme;
6440
+ exports.useBottomSheet = useBottomSheet;
6351
6441
  exports.useKittTheme = useKittTheme;
6352
6442
  exports.useMatchWindowSize = useMatchWindowSize;
6443
+ exports.useStaticBottomSheet = useStaticBottomSheet;
6353
6444
  exports.useStoryBlockColor = useStoryBlockColor;
6354
6445
  exports.withTheme = withTheme;
6355
6446
  Object.keys(kittIcons).forEach(function (k) {