@ornikar/kitt-universal 9.1.3 → 9.3.1

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 (63) hide show
  1. package/dist/definitions/ModalBehaviour/ModalBehaviour.d.ts +18 -0
  2. package/dist/definitions/ModalBehaviour/ModalBehaviour.d.ts.map +1 -0
  3. package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.d.ts +7 -0
  4. package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.d.ts.map +1 -0
  5. package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.web.d.ts +4 -0
  6. package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.web.d.ts.map +1 -0
  7. package/dist/definitions/ModalBehaviour/OnCloseContext.d.ts +11 -0
  8. package/dist/definitions/ModalBehaviour/OnCloseContext.d.ts.map +1 -0
  9. package/dist/definitions/NavigationModal/Body.d.ts +9 -0
  10. package/dist/definitions/NavigationModal/Body.d.ts.map +1 -0
  11. package/dist/definitions/NavigationModal/ContentPadding.d.ts +7 -0
  12. package/dist/definitions/NavigationModal/ContentPadding.d.ts.map +1 -0
  13. package/dist/definitions/NavigationModal/Footer.d.ts +11 -0
  14. package/dist/definitions/NavigationModal/Footer.d.ts.map +1 -0
  15. package/dist/definitions/NavigationModal/Header.d.ts +31 -0
  16. package/dist/definitions/NavigationModal/Header.d.ts.map +1 -0
  17. package/dist/definitions/NavigationModal/NavigationModal.d.ts +17 -0
  18. package/dist/definitions/NavigationModal/NavigationModal.d.ts.map +1 -0
  19. package/dist/definitions/NavigationModal/NavigationModalContainer.d.ts +8 -0
  20. package/dist/definitions/NavigationModal/NavigationModalContainer.d.ts.map +1 -0
  21. package/dist/definitions/index.d.ts +6 -0
  22. package/dist/definitions/index.d.ts.map +1 -1
  23. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +3498 -3556
  24. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  25. package/dist/definitions/native-base/acceptable-native-base-props.d.ts +9 -0
  26. package/dist/definitions/native-base/acceptable-native-base-props.d.ts.map +1 -0
  27. package/dist/definitions/native-base/layout.d.ts +23 -0
  28. package/dist/definitions/native-base/layout.d.ts.map +1 -0
  29. package/dist/definitions/native-base/primitives.d.ts +21 -0
  30. package/dist/definitions/native-base/primitives.d.ts.map +1 -0
  31. package/dist/definitions/themes/default.d.ts +1 -0
  32. package/dist/definitions/themes/default.d.ts.map +1 -1
  33. package/dist/definitions/themes/late-ocean/navigationModal.d.ts +6 -0
  34. package/dist/definitions/themes/late-ocean/navigationModal.d.ts.map +1 -0
  35. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  36. package/dist/index-browser-all.es.android.js +378 -70
  37. package/dist/index-browser-all.es.android.js.map +1 -1
  38. package/dist/index-browser-all.es.ios.js +378 -70
  39. package/dist/index-browser-all.es.ios.js.map +1 -1
  40. package/dist/index-browser-all.es.js +378 -70
  41. package/dist/index-browser-all.es.js.map +1 -1
  42. package/dist/index-browser-all.es.web.js +457 -126
  43. package/dist/index-browser-all.es.web.js.map +1 -1
  44. package/dist/index-node-14.17.cjs.js +337 -19
  45. package/dist/index-node-14.17.cjs.js.map +1 -1
  46. package/dist/index-node-14.17.cjs.web.css +1 -0
  47. package/dist/index-node-14.17.cjs.web.js +349 -19
  48. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  49. package/dist/linaria-themes-browser-all.es.android.js +7 -1
  50. package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
  51. package/dist/linaria-themes-browser-all.es.ios.js +7 -1
  52. package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
  53. package/dist/linaria-themes-browser-all.es.js +7 -1
  54. package/dist/linaria-themes-browser-all.es.js.map +1 -1
  55. package/dist/linaria-themes-browser-all.es.web.js +7 -1
  56. package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
  57. package/dist/linaria-themes-node-14.17.cjs.js +7 -1
  58. package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
  59. package/dist/linaria-themes-node-14.17.cjs.web.js +7 -1
  60. package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
  61. package/dist/styles.css +1 -0
  62. package/dist/tsbuildinfo +1 -1
  63. package/package.json +6 -3
@@ -2,6 +2,7 @@
2
2
  .kitt-u_InputTextContainer_i1encr9g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;}.kitt-u_InputTextContainer_i1encr9g > [data-focusvisible-polyfill]{outline:none;}.kitt-u_InputTextContainer_i1encr9g > *::-ms-clear,.kitt-u_InputTextContainer_i1encr9g > *::-ms-reveal{display:none;}.kitt-u_InputTextContainer_i1encr9g,.kitt-u_InputTextContainer_i1encr9g > *{cursor:var(--i1encr9g-0);}.kitt-u_InputTextContainer_i1encr9g > *{-webkit-transition:var(--i1encr9g-1);transition:var(--i1encr9g-1);}.kitt-u_InputTextContainer_i1encr9g:hover > *,.kitt-hover .kitt-u_InputTextContainer_i1encr9g > *{border-color:var(--i1encr9g-2);}.kitt-u_InputTextContainer_i1encr9g:focus > *,.kitt-u_InputTextContainer_i1encr9g > *:focus,.kitt-focus .kitt-u_InputTextContainer_i1encr9g > *{border-color:var(--i1encr9g-3);}
3
3
  .kitt-u_StyledSpinningIconContainer_ssn8o83{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}.kitt-u_StyledSpinningIconContainer_ssn8o83 > svg{-webkit-animation:spin-kitt-u_StyledSpinningIconContainer_ssn8o83 1.1s infinite linear;animation:spin-kitt-u_StyledSpinningIconContainer_ssn8o83 1.1s infinite linear;}@-webkit-keyframes spin-kitt-u_StyledSpinningIconContainer_ssn8o83{0%{-webkit-transform:rotate(-1deg);-ms-transform:rotate(-1deg);transform:rotate(-1deg);}100%{-webkit-transform:rotate(359deg);-ms-transform:rotate(359deg);transform:rotate(359deg);}}@keyframes spin-kitt-u_StyledSpinningIconContainer_ssn8o83{0%{-webkit-transform:rotate(-1deg);-ms-transform:rotate(-1deg);transform:rotate(-1deg);}100%{-webkit-transform:rotate(359deg);-ms-transform:rotate(359deg);transform:rotate(359deg);}}
4
4
  @media (hover:none) and (pointer:coarse){.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (min-width:768px){.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:active,.kitt-active .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > [data-focusvisible-polyfill]{outline:none;}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:focus,.kitt-focus .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > [data-focusvisible-polyfill],.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:active,.kitt-active .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{background-color:var(--p1nlccvg-4);}
5
+ .kitt-u_overflowHidden_otm3u3{overflow:hidden;}
5
6
  .kitt-u_PageLoaderContainer_ptkwz2j{width:var(--ptkwz2j-3);height:var(--ptkwz2j-3);-webkit-transform:scale(-1) rotate(90deg);-ms-transform:scale(-1) rotate(90deg);transform:scale(-1) rotate(90deg);}@-webkit-keyframes PageLoaderInit-kitt-u_PageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:var(--ptkwz2j-0);}100%{stroke-dashoffset:0;}}@keyframes PageLoaderInit-kitt-u_PageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:var(--ptkwz2j-0);}100%{stroke-dashoffset:0;}}@-webkit-keyframes PageLoaderOffset-kitt-u_PageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:var(--ptkwz2j-0);}100%{stroke-dashoffset:var(--ptkwz2j-2);}}@keyframes PageLoaderOffset-kitt-u_PageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:var(--ptkwz2j-0);}100%{stroke-dashoffset:var(--ptkwz2j-2);}}@-webkit-keyframes PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}.kitt-u_PageLoaderContainer_ptkwz2j circle,.kitt-u_PageLoaderContainer_ptkwz2j g{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;}.kitt-u_PageLoaderContainer_ptkwz2j circle{stroke-width:var(--ptkwz2j-5);stroke-dasharray:var(--ptkwz2j-0);stroke-dashoffset:var(--ptkwz2j-0);stroke-linecap:round;}.kitt-u_PageLoaderContainer_ptkwz2j g[data-large-loader='base'] circle{stroke:var(--ptkwz2j-8);-webkit-animation:var(--ptkwz2j-9);animation:var(--ptkwz2j-9);-webkit-animation-name:PageLoaderInit-kitt-u_PageLoaderContainer_ptkwz2j;animation-name:PageLoaderInit-kitt-u_PageLoaderContainer_ptkwz2j;}.kitt-u_PageLoaderContainer_ptkwz2j g[data-large-loader='fill']{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;-webkit-animation:var(--ptkwz2j-10);animation:var(--ptkwz2j-10);-webkit-animation-name:PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j;animation-name:PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j;}.kitt-u_PageLoaderContainer_ptkwz2j g[data-large-loader='fill'] circle{stroke:var(--ptkwz2j-11);-webkit-animation:var(--ptkwz2j-12);animation:var(--ptkwz2j-12);-webkit-animation-name:PageLoaderOffset-kitt-u_PageLoaderContainer_ptkwz2j,PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j;animation-name:PageLoaderOffset-kitt-u_PageLoaderContainer_ptkwz2j,PageLoaderRotation-kitt-u_PageLoaderContainer_ptkwz2j;}
6
7
  .kitt-u_StyledSkeleton_sc3upcl{background-color:var(--sc3upcl-0);position:relative;overflow:hidden;height:100%;width:100%;}@-webkit-keyframes flareTranslate-kitt-u_StyledSkeleton_sc3upcl{from{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);}to{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}@keyframes flareTranslate-kitt-u_StyledSkeleton_sc3upcl{from{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);}to{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}.kitt-u_StyledSkeleton_sc3upcl::after{content:'';position:absolute;width:100%;height:100%;top:0;left:0;background-image:var(--sc3upcl-1);-webkit-animation:var(--sc3upcl-2);animation:var(--sc3upcl-2);-webkit-animation-name:flareTranslate-kitt-u_StyledSkeleton_sc3upcl;animation-name:flareTranslate-kitt-u_StyledSkeleton_sc3upcl;}
7
8
  .kitt-u_EmojiWebWrapper_ej7a4r3 > *{-webkit-transform:translateY(20%);-ms-transform:translateY(20%);transform:translateY(20%);}
@@ -11,6 +11,7 @@ const nativeBase = require('native-base');
11
11
  const react$1 = require('@linaria/react');
12
12
  const twemojiParser = require('twemoji-parser');
13
13
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
14
+ const reactPortal = require('react-portal');
14
15
  const reactDom = require('@floating-ui/react-dom');
15
16
  const addons = require('@storybook/addons');
16
17
 
@@ -170,6 +171,14 @@ function Typography({
170
171
  base: baseOrDefaultToBody
171
172
  });
172
173
 
174
+ if (process.env.NODE_ENV !== 'production') {
175
+ Object.entries(type).forEach(([key, value]) => {
176
+ if (value && isTypeHeader(value) !== isHeader) {
177
+ throw new Error(`Invalid value for "${key}": "${value}" is ${isHeader ? 'not' : ''} an header. Don't mix headers and bodies.`);
178
+ }
179
+ });
180
+ }
181
+
173
182
  const text = /*#__PURE__*/jsxRuntime.jsx(nativeBase.Text, {
174
183
  accessibilityRole: accessibilityRole || undefined,
175
184
  fontSize: fontSizeForNativeBase,
@@ -878,15 +887,15 @@ function ExternalAppLink({
878
887
  const canOpen = await BabelPluginStyledComponentsReactNative.Linking.canOpenURL(href);
879
888
 
880
889
  if (canOpen) {
881
- BabelPluginStyledComponentsReactNative.Linking.openURL(href).catch(err => {
882
- console.error(`An error occurred while opening ${href}`, err);
883
- onOpenAppError?.(`An error occurred while opening ${href}`);
884
- });
885
-
886
890
  if (onPress) {
887
891
  onPress(e);
888
892
  if (e?.defaultPrevented) return;
889
893
  }
894
+
895
+ BabelPluginStyledComponentsReactNative.Linking.openURL(href).catch(err => {
896
+ console.error(`An error occurred while opening ${href}`, err);
897
+ onOpenAppError?.(`An error occurred while opening ${href}`);
898
+ });
890
899
  } else {
891
900
  onOpenAppError?.(`Cannot open url: ${href}`);
892
901
  }
@@ -1413,6 +1422,11 @@ const listItem = {
1413
1422
  innerMargin: 8
1414
1423
  };
1415
1424
 
1425
+ const navigationModal = {
1426
+ height: 56,
1427
+ padding: 16
1428
+ };
1429
+
1416
1430
  const pageLoader = {
1417
1431
  size: 60,
1418
1432
  strokeWidth: 3,
@@ -1558,7 +1572,8 @@ const theme = {
1558
1572
  skeleton,
1559
1573
  tag,
1560
1574
  tooltip,
1561
- typography
1575
+ typography,
1576
+ navigationModal
1562
1577
  };
1563
1578
 
1564
1579
  function matchWindowSize({
@@ -2264,7 +2279,7 @@ function TextArea({ ...props
2264
2279
  });
2265
2280
  }
2266
2281
 
2267
- const Body = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2282
+ const Body$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2268
2283
  displayName: "Body",
2269
2284
  componentId: "kitt-universal__sc-1ofncfn-0"
2270
2285
  })(["", " background-color:", ";flex:1;"], ({
@@ -2279,7 +2294,7 @@ const Body = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative
2279
2294
  function FullScreenModalBody({
2280
2295
  children
2281
2296
  }) {
2282
- return /*#__PURE__*/jsxRuntime.jsx(Body, {
2297
+ return /*#__PURE__*/jsxRuntime.jsx(Body$1, {
2283
2298
  children: children
2284
2299
  });
2285
2300
  }
@@ -2304,7 +2319,7 @@ function getHeaderHorizontalMediumPadding(spacing) {
2304
2319
  return spacing * 6;
2305
2320
  }
2306
2321
 
2307
- const Header = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2322
+ const Header$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2308
2323
  displayName: "Header",
2309
2324
  componentId: "kitt-universal__sc-dfmxi1-1"
2310
2325
  })(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
@@ -2381,7 +2396,7 @@ function FullScreenModalHeader({
2381
2396
  setRightWidth(event.nativeEvent.layout.width);
2382
2397
  };
2383
2398
 
2384
- return /*#__PURE__*/jsxRuntime.jsxs(Header, {
2399
+ return /*#__PURE__*/jsxRuntime.jsxs(Header$1, {
2385
2400
  insetTop: top,
2386
2401
  children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
2387
2402
  onLayout: e => handleLayoutChange(e, 'left'),
@@ -2929,7 +2944,7 @@ function ModalFooter({
2929
2944
  });
2930
2945
  }
2931
2946
 
2932
- const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
2947
+ const OnCloseContext$1 = /*#__PURE__*/react.createContext(() => {});
2933
2948
 
2934
2949
  const HeaderView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
2935
2950
  displayName: "Header__HeaderView",
@@ -2963,7 +2978,7 @@ function ModalHeader({
2963
2978
  right,
2964
2979
  children
2965
2980
  }) {
2966
- const onClose = react.useContext(OnCloseContext);
2981
+ const onClose = react.useContext(OnCloseContext$1);
2967
2982
  const isIconLeft = !!left;
2968
2983
  return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
2969
2984
  children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
@@ -3003,7 +3018,7 @@ function Modal({
3003
3018
  onEntered,
3004
3019
  onExited
3005
3020
  }) {
3006
- return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
3021
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext$1.Provider, {
3007
3022
  value: onClose,
3008
3023
  children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Modal, {
3009
3024
  transparent: true,
@@ -3026,6 +3041,81 @@ Modal.Header = ModalHeader;
3026
3041
  Modal.Body = ModalBody;
3027
3042
  Modal.Footer = ModalFooter;
3028
3043
 
3044
+ const overflowHidden = "kitt-u_overflowHidden_otm3u3";
3045
+
3046
+ function useBlockBodyScroll(isScrollBlocked) {
3047
+ react.useEffect(() => {
3048
+ if (isScrollBlocked) {
3049
+ document.body.classList.add(overflowHidden);
3050
+ } else {
3051
+ document.body.classList.remove(overflowHidden);
3052
+ }
3053
+ }, [isScrollBlocked]);
3054
+ }
3055
+
3056
+ function ModalBehaviourPortal({
3057
+ visible,
3058
+ children
3059
+ }) {
3060
+ useBlockBodyScroll(Boolean(visible));
3061
+ return /*#__PURE__*/jsxRuntime.jsx(reactPortal.Portal, {
3062
+ children: children
3063
+ });
3064
+ }
3065
+
3066
+ const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
3067
+ function OnCloseProvider({
3068
+ children,
3069
+ onClose
3070
+ }) {
3071
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
3072
+ value: onClose,
3073
+ children: children
3074
+ });
3075
+ }
3076
+ function useOnCloseModalBehaviour() {
3077
+ const onClose = react.useContext(OnCloseContext);
3078
+ return onClose;
3079
+ }
3080
+
3081
+ function CloseButton({
3082
+ children,
3083
+ onPress
3084
+ }) {
3085
+ const onCloseContextCallback = useOnCloseModalBehaviour();
3086
+ return /*#__PURE__*/react.cloneElement(children, {
3087
+ onPress: () => {
3088
+ if (onPress) onPress();
3089
+ onCloseContextCallback();
3090
+ }
3091
+ });
3092
+ }
3093
+
3094
+ const ModalBehaviourContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3095
+ displayName: "ModalBehaviour__ModalBehaviourContainer",
3096
+ componentId: "kitt-universal__sc-tj3606-0"
3097
+ })(["", ""], () => {
3098
+ return styled.css(["position:fixed;top:0;left:0;width:100%;"]);
3099
+ });
3100
+ function ModalBehaviour({
3101
+ children,
3102
+ visible,
3103
+ style,
3104
+ onClose
3105
+ }) {
3106
+ return /*#__PURE__*/jsxRuntime.jsx(OnCloseProvider, {
3107
+ onClose: onClose,
3108
+ children: /*#__PURE__*/jsxRuntime.jsx(ModalBehaviourPortal, {
3109
+ visible: visible,
3110
+ children: visible ? /*#__PURE__*/jsxRuntime.jsx(ModalBehaviourContainer, {
3111
+ style: style,
3112
+ children: children
3113
+ }) : null
3114
+ })
3115
+ });
3116
+ }
3117
+ ModalBehaviour.CloseButton = CloseButton;
3118
+
3029
3119
  const createKittSpaces = spacing => {
3030
3120
  const sizes = {};
3031
3121
 
@@ -3034,12 +3124,15 @@ const createKittSpaces = spacing => {
3034
3124
  }
3035
3125
 
3036
3126
  return sizes;
3037
- }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type -- let typescript infer types
3127
+ }; // reset native-base to be able to set size / space as a number
3128
+ // https://docs.nativebase.io/next/default-theme#h2-size
3038
3129
 
3039
3130
 
3131
+ const overridenNativeBaseSizeandSpaceScale = Object.fromEntries([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80, 96, 0.5, 1.5, 2.5, 3.5].map(value => [value, value])); // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type -- let typescript infer types
3132
+
3040
3133
  const createKittNativeBaseCustomTheme = theme => {
3041
3134
  const spaces = createKittSpaces(theme.spacing);
3042
- return nativeBase.extendTheme({
3135
+ const extendedTheme = nativeBase.extendTheme({
3043
3136
  colors: {
3044
3137
  kitt: { ...theme.colors,
3045
3138
  typography: theme.typography.colors
@@ -3049,11 +3142,11 @@ const createKittNativeBaseCustomTheme = theme => {
3049
3142
  'kitt.borderRadius': theme.card.borderRadius
3050
3143
  },
3051
3144
  sizes: { ...spaces,
3052
- // reset native-base to be able to set size as number
3053
- // https://docs.nativebase.io/next/default-theme#h2-size
3054
- ...Object.fromEntries([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 20, 24, 32, 40, 48, 56, 64, 78, 80, 96, 0.5, 1.5, 2.5, 3.5].map(value => [value, value]))
3145
+ ...overridenNativeBaseSizeandSpaceScale
3146
+ },
3147
+ space: { ...spaces,
3148
+ ...overridenNativeBaseSizeandSpaceScale
3055
3149
  },
3056
- space: spaces,
3057
3150
  breakpoints: {
3058
3151
  // kitt breakpoints
3059
3152
  base: KittBreakpoints.BASE,
@@ -3149,6 +3242,9 @@ const createKittNativeBaseCustomTheme = theme => {
3149
3242
  }
3150
3243
  }
3151
3244
  });
3245
+ return { ...extendedTheme,
3246
+ space: extendedTheme.space
3247
+ };
3152
3248
  };
3153
3249
  function KittNativeBaseProvider({
3154
3250
  theme,
@@ -3164,6 +3260,232 @@ function KittNativeBaseProvider({
3164
3260
  });
3165
3261
  }
3166
3262
 
3263
+ const Stack = nativeBase.Stack;
3264
+ const VStack = nativeBase.VStack;
3265
+ const HStack = nativeBase.HStack;
3266
+
3267
+ const View = nativeBase.View;
3268
+ const ScrollView = nativeBase.ScrollView;
3269
+ const Pressable = nativeBase.Pressable;
3270
+
3271
+ const ViewWithPadding = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3272
+ displayName: "ContentPadding__ViewWithPadding",
3273
+ componentId: "kitt-universal__sc-1rprqcv-0"
3274
+ })(["padding:", ";"], ({
3275
+ theme
3276
+ }) => `0 ${theme.kitt.navigationModal.padding}px`);
3277
+ function ContentPadding({
3278
+ children,
3279
+ ...props
3280
+ }) {
3281
+ return /*#__PURE__*/jsxRuntime.jsx(ViewWithPadding, { ...props,
3282
+ children: children
3283
+ });
3284
+ }
3285
+
3286
+ const StyledViewWithPadding = /*#__PURE__*/styled__default(ContentPadding).withConfig({
3287
+ displayName: "Body__StyledViewWithPadding",
3288
+ componentId: "kitt-universal__sc-oc39vn-0"
3289
+ })(["padding-top:", "px;padding-bottom:", "px;"], ({
3290
+ theme
3291
+ }) => theme.kitt.spacing * 6, ({
3292
+ theme,
3293
+ $insetBottom
3294
+ }) => Math.max(theme.kitt.spacing * 4, $insetBottom));
3295
+ function Body({
3296
+ children,
3297
+ shouldHandleBottomNotch,
3298
+ style,
3299
+ ...props
3300
+ }) {
3301
+ const {
3302
+ bottom
3303
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
3304
+ const insetBottom = shouldHandleBottomNotch ? bottom : 0;
3305
+ return /*#__PURE__*/jsxRuntime.jsx(StyledViewWithPadding, { ...props,
3306
+ $insetBottom: insetBottom,
3307
+ style: style,
3308
+ children: children
3309
+ });
3310
+ }
3311
+
3312
+ const FooterContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
3313
+ displayName: "Footer__FooterContainer",
3314
+ componentId: "kitt-universal__sc-1yjprfg-0"
3315
+ })(["padding-top:", "px;padding-bottom:", "px;", ";"], ({
3316
+ theme
3317
+ }) => theme.kitt.spacing * 3, ({
3318
+ theme,
3319
+ $insetBottom
3320
+ }) => Math.max(theme.kitt.spacing * 3, $insetBottom), ({
3321
+ $hasSeparator
3322
+ }) => {
3323
+ if (!$hasSeparator) return undefined;
3324
+ return styled.css(["border-top-width:1px;border-top-color:", ";"], ({
3325
+ theme
3326
+ }) => theme.kitt.colors.separator);
3327
+ });
3328
+ function Footer({
3329
+ shouldHandleBottomNotch = true,
3330
+ hasSeparator = true,
3331
+ children,
3332
+ style
3333
+ }) {
3334
+ const {
3335
+ bottom
3336
+ } = reactNativeSafeAreaContext.useSafeAreaInsets();
3337
+ const insetBottom = shouldHandleBottomNotch ? bottom : 0;
3338
+ return /*#__PURE__*/jsxRuntime.jsx(FooterContainer, {
3339
+ $insetBottom: insetBottom,
3340
+ $hasSeparator: hasSeparator,
3341
+ style: style,
3342
+ children: children
3343
+ });
3344
+ }
3345
+
3346
+ const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
3347
+ displayName: "Header__HeaderContainer",
3348
+ componentId: "kitt-universal__sc-1g7sbq-0"
3349
+ })(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;", ";"], ({
3350
+ theme
3351
+ }) => theme.kitt.navigationModal.height, ({
3352
+ theme,
3353
+ $isTransparent
3354
+ }) => {
3355
+ if ($isTransparent) return 'transparent';
3356
+ return theme.kitt.colors.uiBackgroundLight;
3357
+ }, ({
3358
+ theme,
3359
+ $hasRight
3360
+ }) => $hasRight ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
3361
+ theme,
3362
+ $hasLeft
3363
+ }) => $hasLeft ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
3364
+ $hasSeparator
3365
+ }) => {
3366
+ if (!$hasSeparator) return undefined;
3367
+ return styled.css(["border-bottom-width:1px;border-bottom-color:", ";"], ({
3368
+ theme
3369
+ }) => theme.kitt.colors.separator);
3370
+ });
3371
+ const Row = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3372
+ displayName: "Header__Row",
3373
+ componentId: "kitt-universal__sc-1g7sbq-1"
3374
+ })(["flex-direction:row;justify-content:", ";align-items:center;"], ({
3375
+ $hasContent,
3376
+ $hasLeft
3377
+ }) => !$hasContent && !$hasLeft ? 'flex-end' : 'space-between');
3378
+ const ButtonContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3379
+ displayName: "Header__ButtonContainer",
3380
+ componentId: "kitt-universal__sc-1g7sbq-2"
3381
+ })(["width:", "px;"], ({
3382
+ theme
3383
+ }) => theme.kitt.iconButton.width);
3384
+ const ChildrenComponent = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3385
+ displayName: "Header__ChildrenComponent",
3386
+ componentId: "kitt-universal__sc-1g7sbq-3"
3387
+ })(["flex:1;align-items:center;", ";"], ({
3388
+ theme,
3389
+ $hasLeft,
3390
+ $hasRight
3391
+ }) => {
3392
+ const paddingHorizontal = theme.kitt.spacing * 2;
3393
+ return styled.css(["padding-right:", "px;padding-left:", "px;"], $hasRight ? paddingHorizontal : 0, $hasLeft ? paddingHorizontal : 0);
3394
+ });
3395
+ const HeaderTitle = /*#__PURE__*/styled__default(Typography.Text).withConfig({
3396
+ displayName: "Header__HeaderTitle",
3397
+ componentId: "kitt-universal__sc-1g7sbq-4"
3398
+ })(["flex:1;text-align:", ";", ";"], ({
3399
+ $hasLeft,
3400
+ $hasRight
3401
+ }) => {
3402
+ if (!$hasLeft && $hasRight) return 'left';
3403
+ return 'center';
3404
+ }, ({
3405
+ theme,
3406
+ $hasLeft,
3407
+ $hasRight
3408
+ }) => {
3409
+ const paddingHorizontal = theme.kitt.spacing * 2;
3410
+ return styled.css(["padding-right:", "px;padding-left:", "px;"], $hasRight ? paddingHorizontal : 0, $hasLeft ? paddingHorizontal : 0);
3411
+ });
3412
+ function Header({
3413
+ hasSeparator = true,
3414
+ isTransparent,
3415
+ title,
3416
+ children,
3417
+ right,
3418
+ left,
3419
+ style
3420
+ }) {
3421
+ const sharedProps = {
3422
+ $hasLeft: Boolean(left),
3423
+ $hasRight: Boolean(right)
3424
+ };
3425
+ return /*#__PURE__*/jsxRuntime.jsx(HeaderContainer, {
3426
+ $isTransparent: isTransparent,
3427
+ $hasSeparator: hasSeparator,
3428
+ $hasLeft: Boolean(left),
3429
+ $hasRight: Boolean(right),
3430
+ style: style,
3431
+ children: /*#__PURE__*/jsxRuntime.jsxs(Row, {
3432
+ $hasContent: Boolean(title || children),
3433
+ ...sharedProps,
3434
+ children: [left ? /*#__PURE__*/jsxRuntime.jsx(ButtonContainer, {
3435
+ children: left
3436
+ }) : null, title ? /*#__PURE__*/jsxRuntime.jsx(HeaderTitle, { ...sharedProps,
3437
+ variant: "bold",
3438
+ children: title
3439
+ }) : null, children ? /*#__PURE__*/jsxRuntime.jsx(ChildrenComponent, { ...sharedProps,
3440
+ children: children
3441
+ }) : null, right || left ? /*#__PURE__*/jsxRuntime.jsx(ButtonContainer, {
3442
+ children: right
3443
+ }) : null]
3444
+ })
3445
+ });
3446
+ }
3447
+
3448
+ const NavigationModalContainer = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3449
+ displayName: "NavigationModalContainer",
3450
+ componentId: "kitt-universal__sc-n0bwvk-0"
3451
+ })(["position:relative;background-color:", ";flex:1;", ""], ({
3452
+ theme,
3453
+ $backgroundColor
3454
+ }) => $backgroundColor || theme.kitt.colors.uiBackgroundLight, () => {
3455
+ return styled.css(["min-height:100vh;"]);
3456
+ });
3457
+
3458
+ const ContainerWithoutHeader = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
3459
+ displayName: "NavigationModal__ContainerWithoutHeader",
3460
+ componentId: "kitt-universal__sc-ls8t24-0"
3461
+ })(["justify-content:space-between;flex:1;"]);
3462
+ function NavigationModal({
3463
+ body,
3464
+ header,
3465
+ footer,
3466
+ backgroundColor
3467
+ }) {
3468
+ return /*#__PURE__*/jsxRuntime.jsxs(NavigationModalContainer, {
3469
+ $backgroundColor: backgroundColor,
3470
+ children: [header ? /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.View, {
3471
+ children: header
3472
+ }) : null, /*#__PURE__*/jsxRuntime.jsxs(ContainerWithoutHeader, {
3473
+ children: [/*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.ScrollView, {
3474
+ bounces: false,
3475
+ contentContainerStyle: {
3476
+ flexGrow: 1,
3477
+ position: 'relative'
3478
+ },
3479
+ children: body
3480
+ }), footer || null]
3481
+ })]
3482
+ });
3483
+ }
3484
+ NavigationModal.Header = Header;
3485
+ NavigationModal.Footer = Footer;
3486
+ NavigationModal.Body = Body;
3487
+ NavigationModal.Padding = ContentPadding;
3488
+
3167
3489
  function Notification({
3168
3490
  type,
3169
3491
  children,
@@ -4149,6 +4471,7 @@ exports.ExternalAppLink = ExternalAppLink;
4149
4471
  exports.ExternalLink = ExternalLink;
4150
4472
  exports.Flex = Flex;
4151
4473
  exports.FullScreenModal = FullScreenModal;
4474
+ exports.HStack = HStack;
4152
4475
  exports.Icon = Icon;
4153
4476
  exports.IconButton = IconButton;
4154
4477
  exports.InputEmail = InputEmail;
@@ -4171,14 +4494,19 @@ exports.LoaderIcon = LoaderIcon;
4171
4494
  exports.MatchWindowSize = MatchWindowSize;
4172
4495
  exports.Message = Message;
4173
4496
  exports.Modal = Modal;
4497
+ exports.ModalBehaviour = ModalBehaviour;
4498
+ exports.NavigationModal = NavigationModal;
4174
4499
  exports.Notification = Notification;
4175
4500
  exports.Overlay = Overlay;
4176
4501
  exports.PageLoader = PageLoader;
4177
4502
  exports.Picker = Picker;
4503
+ exports.Pressable = Pressable;
4178
4504
  exports.Radio = Radio;
4505
+ exports.ScrollView = ScrollView;
4179
4506
  exports.Section = DeprecatedSection;
4180
4507
  exports.Skeleton = Skeleton;
4181
4508
  exports.SpinningIcon = SpinningIcon;
4509
+ exports.Stack = Stack;
4182
4510
  exports.Story = Story;
4183
4511
  exports.StoryBlock = StoryBlock;
4184
4512
  exports.StoryContainer = StoryContainer;
@@ -4195,6 +4523,8 @@ exports.Typography = Typography;
4195
4523
  exports.TypographyEmoji = TypographyEmoji;
4196
4524
  exports.TypographyIcon = TypographyIcon;
4197
4525
  exports.TypographyLink = TypographyLink;
4526
+ exports.VStack = VStack;
4527
+ exports.View = View;
4198
4528
  exports.createWindowSizeHelper = createWindowSizeHelper;
4199
4529
  exports.hex2rgba = hex2rgba;
4200
4530
  exports.matchWindowSize = matchWindowSize;