@ornikar/kitt-universal 9.2.0 → 9.3.2
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.
- package/dist/definitions/ModalBehaviour/ModalBehaviour.d.ts +18 -0
- package/dist/definitions/ModalBehaviour/ModalBehaviour.d.ts.map +1 -0
- package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.d.ts +7 -0
- package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.d.ts.map +1 -0
- package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.web.d.ts +4 -0
- package/dist/definitions/ModalBehaviour/ModalBehaviourPortal.web.d.ts.map +1 -0
- package/dist/definitions/ModalBehaviour/OnCloseContext.d.ts +11 -0
- package/dist/definitions/ModalBehaviour/OnCloseContext.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/Body.d.ts +9 -0
- package/dist/definitions/NavigationModal/Body.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/ContentPadding.d.ts +7 -0
- package/dist/definitions/NavigationModal/ContentPadding.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/Footer.d.ts +11 -0
- package/dist/definitions/NavigationModal/Footer.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/Header.d.ts +31 -0
- package/dist/definitions/NavigationModal/Header.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/NavigationModal.d.ts +17 -0
- package/dist/definitions/NavigationModal/NavigationModal.d.ts.map +1 -0
- package/dist/definitions/NavigationModal/NavigationModalContainer.d.ts +8 -0
- package/dist/definitions/NavigationModal/NavigationModalContainer.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +4 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -0
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/navigationModal.d.ts +6 -0
- package/dist/definitions/themes/late-ocean/navigationModal.d.ts.map +1 -0
- package/dist/index-browser-all.es.android.js +333 -47
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.ios.js +333 -47
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +333 -47
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +355 -46
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.js +307 -14
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +1 -0
- package/dist/index-node-14.17.cjs.web.js +319 -14
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.android.js +7 -1
- package/dist/linaria-themes-browser-all.es.android.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.ios.js +7 -1
- package/dist/linaria-themes-browser-all.es.ios.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.js +7 -1
- package/dist/linaria-themes-browser-all.es.js.map +1 -1
- package/dist/linaria-themes-browser-all.es.web.js +7 -1
- package/dist/linaria-themes-browser-all.es.web.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.js +7 -1
- package/dist/linaria-themes-node-14.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js +7 -1
- package/dist/linaria-themes-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/tsbuildinfo +1 -1
- package/package.json +5 -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
|
|
|
@@ -181,7 +182,7 @@ function Typography({
|
|
|
181
182
|
const text = /*#__PURE__*/jsxRuntime.jsx(nativeBase.Text, {
|
|
182
183
|
accessibilityRole: accessibilityRole || undefined,
|
|
183
184
|
fontSize: fontSizeForNativeBase,
|
|
184
|
-
lineHeight: fontSizeForNativeBase,
|
|
185
|
+
lineHeight: hasTypographyAncestor ? undefined : fontSizeForNativeBase,
|
|
185
186
|
fontWeight: isHeader ? `headers.${nonNullableVariant}` : `bodies.${nonNullableVariant}`,
|
|
186
187
|
fontFamily: isHeader ? `headers.${nonNullableVariant}` : `bodies.${nonNullableVariant}`,
|
|
187
188
|
color: color ? `kitt.typography.${color}` : undefined,
|
|
@@ -1421,6 +1422,11 @@ const listItem = {
|
|
|
1421
1422
|
innerMargin: 8
|
|
1422
1423
|
};
|
|
1423
1424
|
|
|
1425
|
+
const navigationModal = {
|
|
1426
|
+
height: 56,
|
|
1427
|
+
padding: 16
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1424
1430
|
const pageLoader = {
|
|
1425
1431
|
size: 60,
|
|
1426
1432
|
strokeWidth: 3,
|
|
@@ -1566,7 +1572,8 @@ const theme = {
|
|
|
1566
1572
|
skeleton,
|
|
1567
1573
|
tag,
|
|
1568
1574
|
tooltip,
|
|
1569
|
-
typography
|
|
1575
|
+
typography,
|
|
1576
|
+
navigationModal
|
|
1570
1577
|
};
|
|
1571
1578
|
|
|
1572
1579
|
function matchWindowSize({
|
|
@@ -2272,7 +2279,7 @@ function TextArea({ ...props
|
|
|
2272
2279
|
});
|
|
2273
2280
|
}
|
|
2274
2281
|
|
|
2275
|
-
const Body = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
2282
|
+
const Body$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
2276
2283
|
displayName: "Body",
|
|
2277
2284
|
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
2278
2285
|
})(["", " background-color:", ";flex:1;"], ({
|
|
@@ -2287,7 +2294,7 @@ const Body = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative
|
|
|
2287
2294
|
function FullScreenModalBody({
|
|
2288
2295
|
children
|
|
2289
2296
|
}) {
|
|
2290
|
-
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
2297
|
+
return /*#__PURE__*/jsxRuntime.jsx(Body$1, {
|
|
2291
2298
|
children: children
|
|
2292
2299
|
});
|
|
2293
2300
|
}
|
|
@@ -2312,7 +2319,7 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
2312
2319
|
return spacing * 6;
|
|
2313
2320
|
}
|
|
2314
2321
|
|
|
2315
|
-
const Header = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
2322
|
+
const Header$1 = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
2316
2323
|
displayName: "Header",
|
|
2317
2324
|
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
2318
2325
|
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
|
|
@@ -2389,7 +2396,7 @@ function FullScreenModalHeader({
|
|
|
2389
2396
|
setRightWidth(event.nativeEvent.layout.width);
|
|
2390
2397
|
};
|
|
2391
2398
|
|
|
2392
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
2399
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Header$1, {
|
|
2393
2400
|
insetTop: top,
|
|
2394
2401
|
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
2395
2402
|
onLayout: e => handleLayoutChange(e, 'left'),
|
|
@@ -2937,7 +2944,7 @@ function ModalFooter({
|
|
|
2937
2944
|
});
|
|
2938
2945
|
}
|
|
2939
2946
|
|
|
2940
|
-
const OnCloseContext = /*#__PURE__*/react.createContext(() => {});
|
|
2947
|
+
const OnCloseContext$1 = /*#__PURE__*/react.createContext(() => {});
|
|
2941
2948
|
|
|
2942
2949
|
const HeaderView = /*#__PURE__*/styled__default(BabelPluginStyledComponentsReactNative.View).withConfig({
|
|
2943
2950
|
displayName: "Header__HeaderView",
|
|
@@ -2971,7 +2978,7 @@ function ModalHeader({
|
|
|
2971
2978
|
right,
|
|
2972
2979
|
children
|
|
2973
2980
|
}) {
|
|
2974
|
-
const onClose = react.useContext(OnCloseContext);
|
|
2981
|
+
const onClose = react.useContext(OnCloseContext$1);
|
|
2975
2982
|
const isIconLeft = !!left;
|
|
2976
2983
|
return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
|
|
2977
2984
|
children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
|
|
@@ -3011,7 +3018,7 @@ function Modal({
|
|
|
3011
3018
|
onEntered,
|
|
3012
3019
|
onExited
|
|
3013
3020
|
}) {
|
|
3014
|
-
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
3021
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext$1.Provider, {
|
|
3015
3022
|
value: onClose,
|
|
3016
3023
|
children: /*#__PURE__*/jsxRuntime.jsx(BabelPluginStyledComponentsReactNative.Modal, {
|
|
3017
3024
|
transparent: true,
|
|
@@ -3034,6 +3041,81 @@ Modal.Header = ModalHeader;
|
|
|
3034
3041
|
Modal.Body = ModalBody;
|
|
3035
3042
|
Modal.Footer = ModalFooter;
|
|
3036
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
|
+
|
|
3037
3119
|
const createKittSpaces = spacing => {
|
|
3038
3120
|
const sizes = {};
|
|
3039
3121
|
|
|
@@ -3042,8 +3124,11 @@ const createKittSpaces = spacing => {
|
|
|
3042
3124
|
}
|
|
3043
3125
|
|
|
3044
3126
|
return sizes;
|
|
3045
|
-
}; //
|
|
3127
|
+
}; // reset native-base to be able to set size / space as a number
|
|
3128
|
+
// https://docs.nativebase.io/next/default-theme#h2-size
|
|
3129
|
+
|
|
3046
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
|
|
3047
3132
|
|
|
3048
3133
|
const createKittNativeBaseCustomTheme = theme => {
|
|
3049
3134
|
const spaces = createKittSpaces(theme.spacing);
|
|
@@ -3057,11 +3142,11 @@ const createKittNativeBaseCustomTheme = theme => {
|
|
|
3057
3142
|
'kitt.borderRadius': theme.card.borderRadius
|
|
3058
3143
|
},
|
|
3059
3144
|
sizes: { ...spaces,
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3145
|
+
...overridenNativeBaseSizeandSpaceScale
|
|
3146
|
+
},
|
|
3147
|
+
space: { ...spaces,
|
|
3148
|
+
...overridenNativeBaseSizeandSpaceScale
|
|
3063
3149
|
},
|
|
3064
|
-
space: spaces,
|
|
3065
3150
|
breakpoints: {
|
|
3066
3151
|
// kitt breakpoints
|
|
3067
3152
|
base: KittBreakpoints.BASE,
|
|
@@ -3183,6 +3268,224 @@ const View = nativeBase.View;
|
|
|
3183
3268
|
const ScrollView = nativeBase.ScrollView;
|
|
3184
3269
|
const Pressable = nativeBase.Pressable;
|
|
3185
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
|
+
|
|
3186
3489
|
function Notification({
|
|
3187
3490
|
type,
|
|
3188
3491
|
children,
|
|
@@ -4191,6 +4494,8 @@ exports.LoaderIcon = LoaderIcon;
|
|
|
4191
4494
|
exports.MatchWindowSize = MatchWindowSize;
|
|
4192
4495
|
exports.Message = Message;
|
|
4193
4496
|
exports.Modal = Modal;
|
|
4497
|
+
exports.ModalBehaviour = ModalBehaviour;
|
|
4498
|
+
exports.NavigationModal = NavigationModal;
|
|
4194
4499
|
exports.Notification = Notification;
|
|
4195
4500
|
exports.Overlay = Overlay;
|
|
4196
4501
|
exports.PageLoader = PageLoader;
|