@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
|
@@ -192,7 +192,7 @@ function Typography({
|
|
|
192
192
|
const text = /*#__PURE__*/jsxRuntime.jsx(nativeBase.Text, {
|
|
193
193
|
accessibilityRole: accessibilityRole || undefined,
|
|
194
194
|
fontSize: fontSizeForNativeBase,
|
|
195
|
-
lineHeight: fontSizeForNativeBase,
|
|
195
|
+
lineHeight: hasTypographyAncestor ? undefined : fontSizeForNativeBase,
|
|
196
196
|
fontWeight: isHeader ? `headers.${nonNullableVariant}` : `bodies.${nonNullableVariant}`,
|
|
197
197
|
fontFamily: isHeader ? `headers.${nonNullableVariant}` : `bodies.${nonNullableVariant}`,
|
|
198
198
|
color: color ? `kitt.typography.${color}` : undefined,
|
|
@@ -1433,6 +1433,11 @@ const listItem = {
|
|
|
1433
1433
|
innerMargin: 8
|
|
1434
1434
|
};
|
|
1435
1435
|
|
|
1436
|
+
const navigationModal = {
|
|
1437
|
+
height: 56,
|
|
1438
|
+
padding: 16
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1436
1441
|
const pageLoader = {
|
|
1437
1442
|
size: 60,
|
|
1438
1443
|
strokeWidth: 3,
|
|
@@ -1578,7 +1583,8 @@ const theme = {
|
|
|
1578
1583
|
skeleton,
|
|
1579
1584
|
tag,
|
|
1580
1585
|
tooltip,
|
|
1581
|
-
typography
|
|
1586
|
+
typography,
|
|
1587
|
+
navigationModal
|
|
1582
1588
|
};
|
|
1583
1589
|
|
|
1584
1590
|
function matchWindowSize({
|
|
@@ -2247,7 +2253,7 @@ function IconButton({
|
|
|
2247
2253
|
});
|
|
2248
2254
|
}
|
|
2249
2255
|
|
|
2250
|
-
const OnCloseContext = /*#__PURE__*/React.createContext(() => {});
|
|
2256
|
+
const OnCloseContext$1 = /*#__PURE__*/React.createContext(() => {});
|
|
2251
2257
|
|
|
2252
2258
|
const HeaderView = /*#__PURE__*/styled__default.View.withConfig({
|
|
2253
2259
|
displayName: "Header__HeaderView",
|
|
@@ -2281,7 +2287,7 @@ function ModalHeader({
|
|
|
2281
2287
|
right,
|
|
2282
2288
|
children
|
|
2283
2289
|
}) {
|
|
2284
|
-
const onClose = React.useContext(OnCloseContext);
|
|
2290
|
+
const onClose = React.useContext(OnCloseContext$1);
|
|
2285
2291
|
const isIconLeft = !!left;
|
|
2286
2292
|
return /*#__PURE__*/jsxRuntime.jsxs(HeaderView, {
|
|
2287
2293
|
children: [isIconLeft && /*#__PURE__*/jsxRuntime.jsx(LeftIconView, {
|
|
@@ -2321,7 +2327,7 @@ function Modal({
|
|
|
2321
2327
|
onEntered,
|
|
2322
2328
|
onExited
|
|
2323
2329
|
}) {
|
|
2324
|
-
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
2330
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext$1.Provider, {
|
|
2325
2331
|
value: onClose,
|
|
2326
2332
|
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
|
|
2327
2333
|
transparent: true,
|
|
@@ -2886,7 +2892,7 @@ function TextArea({ ...props
|
|
|
2886
2892
|
});
|
|
2887
2893
|
}
|
|
2888
2894
|
|
|
2889
|
-
const Body = /*#__PURE__*/styled__default.View.withConfig({
|
|
2895
|
+
const Body$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2890
2896
|
displayName: "Body",
|
|
2891
2897
|
componentId: "kitt-universal__sc-1ofncfn-0"
|
|
2892
2898
|
})(["", " background-color:", ";flex:1;"], ({
|
|
@@ -2901,7 +2907,7 @@ const Body = /*#__PURE__*/styled__default.View.withConfig({
|
|
|
2901
2907
|
function FullScreenModalBody({
|
|
2902
2908
|
children
|
|
2903
2909
|
}) {
|
|
2904
|
-
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
2910
|
+
return /*#__PURE__*/jsxRuntime.jsx(Body$1, {
|
|
2905
2911
|
children: children
|
|
2906
2912
|
});
|
|
2907
2913
|
}
|
|
@@ -2926,7 +2932,7 @@ function getHeaderHorizontalMediumPadding(spacing) {
|
|
|
2926
2932
|
return spacing * 6;
|
|
2927
2933
|
}
|
|
2928
2934
|
|
|
2929
|
-
const Header = /*#__PURE__*/styled__default.View.withConfig({
|
|
2935
|
+
const Header$1 = /*#__PURE__*/styled__default.View.withConfig({
|
|
2930
2936
|
displayName: "Header",
|
|
2931
2937
|
componentId: "kitt-universal__sc-dfmxi1-1"
|
|
2932
2938
|
})(["", ";border-bottom-color:", ";border-bottom-width:1px;flex-direction:row;align-items:center;"], ({
|
|
@@ -3003,7 +3009,7 @@ function FullScreenModalHeader({
|
|
|
3003
3009
|
setRightWidth(event.nativeEvent.layout.width);
|
|
3004
3010
|
};
|
|
3005
3011
|
|
|
3006
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Header, {
|
|
3012
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Header$1, {
|
|
3007
3013
|
insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
|
|
3008
3014
|
children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
|
|
3009
3015
|
onLayout: e => handleLayoutChange(e, 'left'),
|
|
@@ -3368,6 +3374,69 @@ function Message({
|
|
|
3368
3374
|
});
|
|
3369
3375
|
}
|
|
3370
3376
|
|
|
3377
|
+
function ModalBehaviourPortal({
|
|
3378
|
+
children
|
|
3379
|
+
}) {
|
|
3380
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3381
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3382
|
+
children: children
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
const OnCloseContext = /*#__PURE__*/React.createContext(() => {});
|
|
3387
|
+
function OnCloseProvider({
|
|
3388
|
+
children,
|
|
3389
|
+
onClose
|
|
3390
|
+
}) {
|
|
3391
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseContext.Provider, {
|
|
3392
|
+
value: onClose,
|
|
3393
|
+
children: children
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
function useOnCloseModalBehaviour() {
|
|
3397
|
+
const onClose = React.useContext(OnCloseContext);
|
|
3398
|
+
return onClose;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
function CloseButton({
|
|
3402
|
+
children,
|
|
3403
|
+
onPress
|
|
3404
|
+
}) {
|
|
3405
|
+
const onCloseContextCallback = useOnCloseModalBehaviour();
|
|
3406
|
+
return /*#__PURE__*/React.cloneElement(children, {
|
|
3407
|
+
onPress: () => {
|
|
3408
|
+
if (onPress) onPress();
|
|
3409
|
+
onCloseContextCallback();
|
|
3410
|
+
}
|
|
3411
|
+
});
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
const ModalBehaviourContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3415
|
+
displayName: "ModalBehaviour__ModalBehaviourContainer",
|
|
3416
|
+
componentId: "kitt-universal__sc-tj3606-0"
|
|
3417
|
+
})(["", ""], () => {
|
|
3418
|
+
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
3419
|
+
return styled.css(["position:fixed;top:0;left:0;width:100%;"]);
|
|
3420
|
+
});
|
|
3421
|
+
function ModalBehaviour({
|
|
3422
|
+
children,
|
|
3423
|
+
visible,
|
|
3424
|
+
style,
|
|
3425
|
+
onClose
|
|
3426
|
+
}) {
|
|
3427
|
+
return /*#__PURE__*/jsxRuntime.jsx(OnCloseProvider, {
|
|
3428
|
+
onClose: onClose,
|
|
3429
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ModalBehaviourPortal, {
|
|
3430
|
+
visible: visible,
|
|
3431
|
+
children: visible ? /*#__PURE__*/jsxRuntime.jsx(ModalBehaviourContainer, {
|
|
3432
|
+
style: style,
|
|
3433
|
+
children: children
|
|
3434
|
+
}) : null
|
|
3435
|
+
})
|
|
3436
|
+
});
|
|
3437
|
+
}
|
|
3438
|
+
ModalBehaviour.CloseButton = CloseButton;
|
|
3439
|
+
|
|
3371
3440
|
const createKittSpaces = spacing => {
|
|
3372
3441
|
const sizes = {};
|
|
3373
3442
|
|
|
@@ -3376,8 +3445,11 @@ const createKittSpaces = spacing => {
|
|
|
3376
3445
|
}
|
|
3377
3446
|
|
|
3378
3447
|
return sizes;
|
|
3379
|
-
}; //
|
|
3448
|
+
}; // reset native-base to be able to set size / space as a number
|
|
3449
|
+
// https://docs.nativebase.io/next/default-theme#h2-size
|
|
3450
|
+
|
|
3380
3451
|
|
|
3452
|
+
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
|
|
3381
3453
|
|
|
3382
3454
|
const createKittNativeBaseCustomTheme = theme => {
|
|
3383
3455
|
const spaces = createKittSpaces(theme.spacing);
|
|
@@ -3391,11 +3463,11 @@ const createKittNativeBaseCustomTheme = theme => {
|
|
|
3391
3463
|
'kitt.borderRadius': theme.card.borderRadius
|
|
3392
3464
|
},
|
|
3393
3465
|
sizes: { ...spaces,
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3466
|
+
...overridenNativeBaseSizeandSpaceScale
|
|
3467
|
+
},
|
|
3468
|
+
space: { ...spaces,
|
|
3469
|
+
...overridenNativeBaseSizeandSpaceScale
|
|
3397
3470
|
},
|
|
3398
|
-
space: spaces,
|
|
3399
3471
|
breakpoints: {
|
|
3400
3472
|
// kitt breakpoints
|
|
3401
3473
|
base: KittBreakpoints.BASE,
|
|
@@ -3517,6 +3589,225 @@ const View = nativeBase.View;
|
|
|
3517
3589
|
const ScrollView = nativeBase.ScrollView;
|
|
3518
3590
|
const Pressable = nativeBase.Pressable;
|
|
3519
3591
|
|
|
3592
|
+
const ViewWithPadding = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3593
|
+
displayName: "ContentPadding__ViewWithPadding",
|
|
3594
|
+
componentId: "kitt-universal__sc-1rprqcv-0"
|
|
3595
|
+
})(["padding:", ";"], ({
|
|
3596
|
+
theme
|
|
3597
|
+
}) => `0 ${theme.kitt.navigationModal.padding}px`);
|
|
3598
|
+
function ContentPadding({
|
|
3599
|
+
children,
|
|
3600
|
+
...props
|
|
3601
|
+
}) {
|
|
3602
|
+
return /*#__PURE__*/jsxRuntime.jsx(ViewWithPadding, { ...props,
|
|
3603
|
+
children: children
|
|
3604
|
+
});
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
const StyledViewWithPadding = /*#__PURE__*/styled__default(ContentPadding).withConfig({
|
|
3608
|
+
displayName: "Body__StyledViewWithPadding",
|
|
3609
|
+
componentId: "kitt-universal__sc-oc39vn-0"
|
|
3610
|
+
})(["padding-top:", "px;padding-bottom:", "px;"], ({
|
|
3611
|
+
theme
|
|
3612
|
+
}) => theme.kitt.spacing * 6, ({
|
|
3613
|
+
theme,
|
|
3614
|
+
$insetBottom
|
|
3615
|
+
}) => Math.max(theme.kitt.spacing * 4, $insetBottom));
|
|
3616
|
+
function Body({
|
|
3617
|
+
children,
|
|
3618
|
+
shouldHandleBottomNotch,
|
|
3619
|
+
style,
|
|
3620
|
+
...props
|
|
3621
|
+
}) {
|
|
3622
|
+
const {
|
|
3623
|
+
bottom
|
|
3624
|
+
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
3625
|
+
const insetBottom = shouldHandleBottomNotch ? bottom : 0;
|
|
3626
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledViewWithPadding, { ...props,
|
|
3627
|
+
$insetBottom: insetBottom,
|
|
3628
|
+
style: style,
|
|
3629
|
+
children: children
|
|
3630
|
+
});
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
const FooterContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
|
|
3634
|
+
displayName: "Footer__FooterContainer",
|
|
3635
|
+
componentId: "kitt-universal__sc-1yjprfg-0"
|
|
3636
|
+
})(["padding-top:", "px;padding-bottom:", "px;", ";"], ({
|
|
3637
|
+
theme
|
|
3638
|
+
}) => theme.kitt.spacing * 3, ({
|
|
3639
|
+
theme,
|
|
3640
|
+
$insetBottom
|
|
3641
|
+
}) => Math.max(theme.kitt.spacing * 3, $insetBottom), ({
|
|
3642
|
+
$hasSeparator
|
|
3643
|
+
}) => {
|
|
3644
|
+
if (!$hasSeparator) return undefined;
|
|
3645
|
+
return styled.css(["border-top-width:1px;border-top-color:", ";"], ({
|
|
3646
|
+
theme
|
|
3647
|
+
}) => theme.kitt.colors.separator);
|
|
3648
|
+
});
|
|
3649
|
+
function Footer({
|
|
3650
|
+
shouldHandleBottomNotch = true,
|
|
3651
|
+
hasSeparator = true,
|
|
3652
|
+
children,
|
|
3653
|
+
style
|
|
3654
|
+
}) {
|
|
3655
|
+
const {
|
|
3656
|
+
bottom
|
|
3657
|
+
} = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
3658
|
+
const insetBottom = shouldHandleBottomNotch ? bottom : 0;
|
|
3659
|
+
return /*#__PURE__*/jsxRuntime.jsx(FooterContainer, {
|
|
3660
|
+
$insetBottom: insetBottom,
|
|
3661
|
+
$hasSeparator: hasSeparator,
|
|
3662
|
+
style: style,
|
|
3663
|
+
children: children
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
const HeaderContainer = /*#__PURE__*/styled__default(ContentPadding).withConfig({
|
|
3668
|
+
displayName: "Header__HeaderContainer",
|
|
3669
|
+
componentId: "kitt-universal__sc-1g7sbq-0"
|
|
3670
|
+
})(["height:", "px;width:100%;justify-content:center;background-color:", ";padding-right:", "px;padding-left:", "px;", ";"], ({
|
|
3671
|
+
theme
|
|
3672
|
+
}) => theme.kitt.navigationModal.height, ({
|
|
3673
|
+
theme,
|
|
3674
|
+
$isTransparent
|
|
3675
|
+
}) => {
|
|
3676
|
+
if ($isTransparent) return 'transparent';
|
|
3677
|
+
return theme.kitt.colors.uiBackgroundLight;
|
|
3678
|
+
}, ({
|
|
3679
|
+
theme,
|
|
3680
|
+
$hasRight
|
|
3681
|
+
}) => $hasRight ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
|
|
3682
|
+
theme,
|
|
3683
|
+
$hasLeft
|
|
3684
|
+
}) => $hasLeft ? theme.kitt.spacing * 2 : theme.kitt.navigationModal.padding, ({
|
|
3685
|
+
$hasSeparator
|
|
3686
|
+
}) => {
|
|
3687
|
+
if (!$hasSeparator) return undefined;
|
|
3688
|
+
return styled.css(["border-bottom-width:1px;border-bottom-color:", ";"], ({
|
|
3689
|
+
theme
|
|
3690
|
+
}) => theme.kitt.colors.separator);
|
|
3691
|
+
});
|
|
3692
|
+
const Row = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3693
|
+
displayName: "Header__Row",
|
|
3694
|
+
componentId: "kitt-universal__sc-1g7sbq-1"
|
|
3695
|
+
})(["flex-direction:row;justify-content:", ";align-items:center;"], ({
|
|
3696
|
+
$hasContent,
|
|
3697
|
+
$hasLeft
|
|
3698
|
+
}) => !$hasContent && !$hasLeft ? 'flex-end' : 'space-between');
|
|
3699
|
+
const ButtonContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
3700
|
+
displayName: "Header__ButtonContainer",
|
|
3701
|
+
componentId: "kitt-universal__sc-1g7sbq-2"
|
|
3702
|
+
})(["width:", "px;"], ({
|
|
3703
|
+
theme
|
|
3704
|
+
}) => theme.kitt.iconButton.width);
|
|
3705
|
+
const ChildrenComponent = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3706
|
+
displayName: "Header__ChildrenComponent",
|
|
3707
|
+
componentId: "kitt-universal__sc-1g7sbq-3"
|
|
3708
|
+
})(["flex:1;align-items:center;", ";"], ({
|
|
3709
|
+
theme,
|
|
3710
|
+
$hasLeft,
|
|
3711
|
+
$hasRight
|
|
3712
|
+
}) => {
|
|
3713
|
+
const paddingHorizontal = theme.kitt.spacing * 2;
|
|
3714
|
+
return styled.css(["padding-right:", "px;padding-left:", "px;"], $hasRight ? paddingHorizontal : 0, $hasLeft ? paddingHorizontal : 0);
|
|
3715
|
+
});
|
|
3716
|
+
const HeaderTitle = /*#__PURE__*/styled__default(Typography.Text).withConfig({
|
|
3717
|
+
displayName: "Header__HeaderTitle",
|
|
3718
|
+
componentId: "kitt-universal__sc-1g7sbq-4"
|
|
3719
|
+
})(["flex:1;text-align:", ";", ";"], ({
|
|
3720
|
+
$hasLeft,
|
|
3721
|
+
$hasRight
|
|
3722
|
+
}) => {
|
|
3723
|
+
if (!$hasLeft && $hasRight) return 'left';
|
|
3724
|
+
return 'center';
|
|
3725
|
+
}, ({
|
|
3726
|
+
theme,
|
|
3727
|
+
$hasLeft,
|
|
3728
|
+
$hasRight
|
|
3729
|
+
}) => {
|
|
3730
|
+
const paddingHorizontal = theme.kitt.spacing * 2;
|
|
3731
|
+
return styled.css(["padding-right:", "px;padding-left:", "px;"], $hasRight ? paddingHorizontal : 0, $hasLeft ? paddingHorizontal : 0);
|
|
3732
|
+
});
|
|
3733
|
+
function Header({
|
|
3734
|
+
hasSeparator = true,
|
|
3735
|
+
isTransparent,
|
|
3736
|
+
title,
|
|
3737
|
+
children,
|
|
3738
|
+
right,
|
|
3739
|
+
left,
|
|
3740
|
+
style
|
|
3741
|
+
}) {
|
|
3742
|
+
const sharedProps = {
|
|
3743
|
+
$hasLeft: Boolean(left),
|
|
3744
|
+
$hasRight: Boolean(right)
|
|
3745
|
+
};
|
|
3746
|
+
return /*#__PURE__*/jsxRuntime.jsx(HeaderContainer, {
|
|
3747
|
+
$isTransparent: isTransparent,
|
|
3748
|
+
$hasSeparator: hasSeparator,
|
|
3749
|
+
$hasLeft: Boolean(left),
|
|
3750
|
+
$hasRight: Boolean(right),
|
|
3751
|
+
style: style,
|
|
3752
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Row, {
|
|
3753
|
+
$hasContent: Boolean(title || children),
|
|
3754
|
+
...sharedProps,
|
|
3755
|
+
children: [left ? /*#__PURE__*/jsxRuntime.jsx(ButtonContainer, {
|
|
3756
|
+
children: left
|
|
3757
|
+
}) : null, title ? /*#__PURE__*/jsxRuntime.jsx(HeaderTitle, { ...sharedProps,
|
|
3758
|
+
variant: "bold",
|
|
3759
|
+
children: title
|
|
3760
|
+
}) : null, children ? /*#__PURE__*/jsxRuntime.jsx(ChildrenComponent, { ...sharedProps,
|
|
3761
|
+
children: children
|
|
3762
|
+
}) : null, right || left ? /*#__PURE__*/jsxRuntime.jsx(ButtonContainer, {
|
|
3763
|
+
children: right
|
|
3764
|
+
}) : null]
|
|
3765
|
+
})
|
|
3766
|
+
});
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
const NavigationModalContainer = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3770
|
+
displayName: "NavigationModalContainer",
|
|
3771
|
+
componentId: "kitt-universal__sc-n0bwvk-0"
|
|
3772
|
+
})(["position:relative;background-color:", ";flex:1;", ""], ({
|
|
3773
|
+
theme,
|
|
3774
|
+
$backgroundColor
|
|
3775
|
+
}) => $backgroundColor || theme.kitt.colors.uiBackgroundLight, () => {
|
|
3776
|
+
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
3777
|
+
return styled.css(["min-height:100vh;"]);
|
|
3778
|
+
});
|
|
3779
|
+
|
|
3780
|
+
const ContainerWithoutHeader = /*#__PURE__*/styled__default(reactNative.View).withConfig({
|
|
3781
|
+
displayName: "NavigationModal__ContainerWithoutHeader",
|
|
3782
|
+
componentId: "kitt-universal__sc-ls8t24-0"
|
|
3783
|
+
})(["justify-content:space-between;flex:1;"]);
|
|
3784
|
+
function NavigationModal({
|
|
3785
|
+
body,
|
|
3786
|
+
header,
|
|
3787
|
+
footer,
|
|
3788
|
+
backgroundColor
|
|
3789
|
+
}) {
|
|
3790
|
+
return /*#__PURE__*/jsxRuntime.jsxs(NavigationModalContainer, {
|
|
3791
|
+
$backgroundColor: backgroundColor,
|
|
3792
|
+
children: [header ? /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
3793
|
+
children: header
|
|
3794
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs(ContainerWithoutHeader, {
|
|
3795
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
3796
|
+
bounces: false,
|
|
3797
|
+
contentContainerStyle: {
|
|
3798
|
+
flexGrow: 1,
|
|
3799
|
+
position: 'relative'
|
|
3800
|
+
},
|
|
3801
|
+
children: body
|
|
3802
|
+
}), footer || null]
|
|
3803
|
+
})]
|
|
3804
|
+
});
|
|
3805
|
+
}
|
|
3806
|
+
NavigationModal.Header = Header;
|
|
3807
|
+
NavigationModal.Footer = Footer;
|
|
3808
|
+
NavigationModal.Body = Body;
|
|
3809
|
+
NavigationModal.Padding = ContentPadding;
|
|
3810
|
+
|
|
3520
3811
|
function Notification({
|
|
3521
3812
|
type,
|
|
3522
3813
|
children,
|
|
@@ -4841,6 +5132,8 @@ exports.LoaderIcon = LoaderIcon;
|
|
|
4841
5132
|
exports.MatchWindowSize = MatchWindowSize;
|
|
4842
5133
|
exports.Message = Message;
|
|
4843
5134
|
exports.Modal = Modal;
|
|
5135
|
+
exports.ModalBehaviour = ModalBehaviour;
|
|
5136
|
+
exports.NavigationModal = NavigationModal;
|
|
4844
5137
|
exports.Notification = Notification;
|
|
4845
5138
|
exports.Overlay = Overlay;
|
|
4846
5139
|
exports.PageLoader = PageLoader;
|