@ornikar/kitt-universal 25.45.4-canary.1fa8dd864c345808028f3e3165c5c7fcf9bc9e2a.0 → 25.46.1-canary.9950f4eb84cbfcf1d45de4e6c9ad226210c5404f.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.
- package/CHANGELOG.md +14 -2
- package/dist/definitions/BottomSheet/BottomSheet.d.ts +3 -2
- package/dist/definitions/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/definitions/CardModal/CardModal.d.ts +3 -2
- package/dist/definitions/CardModal/CardModal.d.ts.map +1 -1
- package/dist/definitions/FullscreenModal/FullscreenModal.d.ts +3 -2
- package/dist/definitions/FullscreenModal/FullscreenModal.d.ts.map +1 -1
- package/dist/definitions/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +1 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/CurrentBreakpointContext.d.ts +19 -0
- package/dist/definitions/native-base/CurrentBreakpointContext.d.ts.map +1 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/native-base/utils.d.ts +11 -12
- package/dist/definitions/native-base/utils.d.ts.map +1 -1
- package/dist/definitions/utils/windowSize/MatchWindowSize.d.ts +3 -2
- package/dist/definitions/utils/windowSize/MatchWindowSize.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +173 -97
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +173 -97
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +169 -93
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +161 -82
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +170 -95
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +162 -84
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +175 -95
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +166 -85
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/definitions/utils/windowSize/useCurrentBreakpointName.d.ts +0 -3
- package/dist/definitions/utils/windowSize/useCurrentBreakpointName.d.ts.map +0 -1
|
@@ -2688,8 +2688,129 @@ const VStack = nativeBase.VStack;
|
|
|
2688
2688
|
const HStack = nativeBase.HStack;
|
|
2689
2689
|
const Center = nativeBase.Center;
|
|
2690
2690
|
|
|
2691
|
+
const KittBreakpoints = {
|
|
2692
|
+
/**
|
|
2693
|
+
* min-width: 0
|
|
2694
|
+
*/
|
|
2695
|
+
BASE: 0,
|
|
2696
|
+
/**
|
|
2697
|
+
* min-width: 480px
|
|
2698
|
+
*/
|
|
2699
|
+
SMALL: 480,
|
|
2700
|
+
/**
|
|
2701
|
+
* min-width: 768px
|
|
2702
|
+
*/
|
|
2703
|
+
MEDIUM: 768,
|
|
2704
|
+
/**
|
|
2705
|
+
* min-width: 1024px
|
|
2706
|
+
*/
|
|
2707
|
+
LARGE: 1024,
|
|
2708
|
+
/**
|
|
2709
|
+
* min-width: 1280px
|
|
2710
|
+
*/
|
|
2711
|
+
WIDE: 1280
|
|
2712
|
+
};
|
|
2713
|
+
const KittBreakpointsMax = {
|
|
2714
|
+
/**
|
|
2715
|
+
* max-width: 479px
|
|
2716
|
+
*/
|
|
2717
|
+
BASE: KittBreakpoints.SMALL - 1,
|
|
2718
|
+
/**
|
|
2719
|
+
* max-width: 767px
|
|
2720
|
+
*/
|
|
2721
|
+
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
2722
|
+
/**
|
|
2723
|
+
* max-width: 1023px
|
|
2724
|
+
*/
|
|
2725
|
+
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
2726
|
+
/**
|
|
2727
|
+
* max-width: 1279px
|
|
2728
|
+
*/
|
|
2729
|
+
LARGE: KittBreakpoints.WIDE - 1
|
|
2730
|
+
};
|
|
2731
|
+
let KittBreakpointNameEnum = /*#__PURE__*/function (KittBreakpointNameEnum) {
|
|
2732
|
+
KittBreakpointNameEnum["BASE"] = "base";
|
|
2733
|
+
KittBreakpointNameEnum["SMALL"] = "small";
|
|
2734
|
+
KittBreakpointNameEnum["MEDIUM"] = "medium";
|
|
2735
|
+
KittBreakpointNameEnum["LARGE"] = "large";
|
|
2736
|
+
KittBreakpointNameEnum["WIDE"] = "wide";
|
|
2737
|
+
return KittBreakpointNameEnum;
|
|
2738
|
+
}({});
|
|
2739
|
+
|
|
2691
2740
|
// eslint-disable-next-line no-restricted-imports
|
|
2692
|
-
const
|
|
2741
|
+
const CurrentBreakpointContext = /*#__PURE__*/react.createContext(undefined);
|
|
2742
|
+
/**
|
|
2743
|
+
* Provider that uses the native-base breakpoint system to detect the current viewport size and maps it to Kitt's breakpoint names.
|
|
2744
|
+
*/
|
|
2745
|
+
function CurrentBreakpointProvider({
|
|
2746
|
+
children
|
|
2747
|
+
}) {
|
|
2748
|
+
const breakpoint = nativeBase.useBreakpointValue({
|
|
2749
|
+
base: KittBreakpointNameEnum.BASE,
|
|
2750
|
+
small: KittBreakpointNameEnum.SMALL,
|
|
2751
|
+
medium: KittBreakpointNameEnum.MEDIUM,
|
|
2752
|
+
large: KittBreakpointNameEnum.LARGE,
|
|
2753
|
+
wide: KittBreakpointNameEnum.WIDE
|
|
2754
|
+
});
|
|
2755
|
+
const value = react.useMemo(() => ({
|
|
2756
|
+
breakpoint
|
|
2757
|
+
}), [breakpoint]);
|
|
2758
|
+
return /*#__PURE__*/jsxRuntime.jsx(CurrentBreakpointContext.Provider, {
|
|
2759
|
+
value: value,
|
|
2760
|
+
children: children
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
/**
|
|
2765
|
+
* React hook that provides information about the current breakpoint.
|
|
2766
|
+
* Unlike the native-base counterpart, this hook does not trigger a re-render on every viewport size change.
|
|
2767
|
+
*/
|
|
2768
|
+
function useCurrentBreakpointName() {
|
|
2769
|
+
const context = react.useContext(CurrentBreakpointContext);
|
|
2770
|
+
if (context === undefined) {
|
|
2771
|
+
throw new Error('useCurrentBreakpoint must be used within an CurrentBreakpointProvider');
|
|
2772
|
+
}
|
|
2773
|
+
return context;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
/**
|
|
2777
|
+
* Retrieves the appropriate value for the given breakpoint with fallback to smaller breakpoints.
|
|
2778
|
+
* Mimics Native Base's logic.
|
|
2779
|
+
*/
|
|
2780
|
+
function getValueForBreakpoint(breakpoint, {
|
|
2781
|
+
base,
|
|
2782
|
+
small,
|
|
2783
|
+
medium,
|
|
2784
|
+
large,
|
|
2785
|
+
wide
|
|
2786
|
+
}) {
|
|
2787
|
+
switch (breakpoint) {
|
|
2788
|
+
case KittBreakpointNameEnum.WIDE:
|
|
2789
|
+
return wide ?? large ?? medium ?? small ?? base;
|
|
2790
|
+
case KittBreakpointNameEnum.LARGE:
|
|
2791
|
+
return large ?? medium ?? small ?? base;
|
|
2792
|
+
case KittBreakpointNameEnum.MEDIUM:
|
|
2793
|
+
return medium ?? small ?? base;
|
|
2794
|
+
case KittBreakpointNameEnum.SMALL:
|
|
2795
|
+
return small ?? base;
|
|
2796
|
+
case KittBreakpointNameEnum.BASE:
|
|
2797
|
+
default:
|
|
2798
|
+
return base;
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
/**
|
|
2803
|
+
* A hook that returns a value based on the current breakpoint.
|
|
2804
|
+
* Mimics the behavior of Native Base's useBreakpointValue, but uses our custom context for better performance.
|
|
2805
|
+
*/
|
|
2806
|
+
function useBreakpointValue(values) {
|
|
2807
|
+
const {
|
|
2808
|
+
breakpoint
|
|
2809
|
+
} = useCurrentBreakpointName();
|
|
2810
|
+
return react.useMemo(() => {
|
|
2811
|
+
return getValueForBreakpoint(breakpoint, values);
|
|
2812
|
+
}, [breakpoint, values]);
|
|
2813
|
+
}
|
|
2693
2814
|
|
|
2694
2815
|
function createResponsiveStyleFromProp(responsiveBooleanValue, valueIfTrue, valueIfFalse) {
|
|
2695
2816
|
// Handles simple boolean values
|
|
@@ -2805,55 +2926,6 @@ function AnimatedContainer$2({
|
|
|
2805
2926
|
});
|
|
2806
2927
|
}
|
|
2807
2928
|
|
|
2808
|
-
const KittBreakpoints = {
|
|
2809
|
-
/**
|
|
2810
|
-
* min-width: 0
|
|
2811
|
-
*/
|
|
2812
|
-
BASE: 0,
|
|
2813
|
-
/**
|
|
2814
|
-
* min-width: 480px
|
|
2815
|
-
*/
|
|
2816
|
-
SMALL: 480,
|
|
2817
|
-
/**
|
|
2818
|
-
* min-width: 768px
|
|
2819
|
-
*/
|
|
2820
|
-
MEDIUM: 768,
|
|
2821
|
-
/**
|
|
2822
|
-
* min-width: 1024px
|
|
2823
|
-
*/
|
|
2824
|
-
LARGE: 1024,
|
|
2825
|
-
/**
|
|
2826
|
-
* min-width: 1280px
|
|
2827
|
-
*/
|
|
2828
|
-
WIDE: 1280
|
|
2829
|
-
};
|
|
2830
|
-
const KittBreakpointsMax = {
|
|
2831
|
-
/**
|
|
2832
|
-
* max-width: 479px
|
|
2833
|
-
*/
|
|
2834
|
-
BASE: KittBreakpoints.SMALL - 1,
|
|
2835
|
-
/**
|
|
2836
|
-
* max-width: 767px
|
|
2837
|
-
*/
|
|
2838
|
-
SMALL: KittBreakpoints.MEDIUM - 1,
|
|
2839
|
-
/**
|
|
2840
|
-
* max-width: 1023px
|
|
2841
|
-
*/
|
|
2842
|
-
MEDIUM: KittBreakpoints.LARGE - 1,
|
|
2843
|
-
/**
|
|
2844
|
-
* max-width: 1279px
|
|
2845
|
-
*/
|
|
2846
|
-
LARGE: KittBreakpoints.WIDE - 1
|
|
2847
|
-
};
|
|
2848
|
-
let KittBreakpointNameEnum = /*#__PURE__*/function (KittBreakpointNameEnum) {
|
|
2849
|
-
KittBreakpointNameEnum["BASE"] = "base";
|
|
2850
|
-
KittBreakpointNameEnum["SMALL"] = "small";
|
|
2851
|
-
KittBreakpointNameEnum["MEDIUM"] = "medium";
|
|
2852
|
-
KittBreakpointNameEnum["LARGE"] = "large";
|
|
2853
|
-
KittBreakpointNameEnum["WIDE"] = "wide";
|
|
2854
|
-
return KittBreakpointNameEnum;
|
|
2855
|
-
}({});
|
|
2856
|
-
|
|
2857
2929
|
const typographyColors = ['black', 'black-anthracite', 'black-disabled', 'black-light', 'white', 'white-light', 'primary', 'primary-light', 'accent', 'success', 'danger', 'warning'];
|
|
2858
2930
|
|
|
2859
2931
|
function getNBThemeColorFromColorProps(colorName) {
|
|
@@ -4057,6 +4129,9 @@ function CardModal({
|
|
|
4057
4129
|
header,
|
|
4058
4130
|
body,
|
|
4059
4131
|
footer,
|
|
4132
|
+
contentContainer: ContentContainer = ({
|
|
4133
|
+
children: originalChildren
|
|
4134
|
+
}) => originalChildren,
|
|
4060
4135
|
...props
|
|
4061
4136
|
}) {
|
|
4062
4137
|
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
@@ -4069,8 +4144,10 @@ function CardModal({
|
|
|
4069
4144
|
maxHeight: "100%",
|
|
4070
4145
|
maxWidth: maxWidth,
|
|
4071
4146
|
minHeight: "kitt.cardModal.minHeight",
|
|
4072
|
-
children:
|
|
4073
|
-
children:
|
|
4147
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ContentContainer, {
|
|
4148
|
+
children: children || /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4149
|
+
children: [header || null, body || null, footer || null]
|
|
4150
|
+
})
|
|
4074
4151
|
})
|
|
4075
4152
|
});
|
|
4076
4153
|
}
|
|
@@ -7144,25 +7221,30 @@ function FullscreenModal({
|
|
|
7144
7221
|
body,
|
|
7145
7222
|
header,
|
|
7146
7223
|
footer,
|
|
7147
|
-
backgroundColor
|
|
7224
|
+
backgroundColor,
|
|
7225
|
+
contentContainer: ContentContainer = ({
|
|
7226
|
+
children
|
|
7227
|
+
}) => children
|
|
7148
7228
|
}) {
|
|
7149
|
-
return /*#__PURE__*/jsxRuntime.
|
|
7229
|
+
return /*#__PURE__*/jsxRuntime.jsx(FullscreenModalContainer, {
|
|
7150
7230
|
backgroundColor: backgroundColor,
|
|
7151
|
-
children:
|
|
7152
|
-
children: header
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7231
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ContentContainer, {
|
|
7232
|
+
children: [header ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
7233
|
+
children: header
|
|
7234
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs(View, {
|
|
7235
|
+
flexGrow: 1,
|
|
7236
|
+
flexShrink: 1,
|
|
7237
|
+
justifyContent: "space-between",
|
|
7238
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactNative.ScrollView, {
|
|
7239
|
+
bounces: false,
|
|
7240
|
+
contentContainerStyle: {
|
|
7241
|
+
flexGrow: 1,
|
|
7242
|
+
position: 'relative'
|
|
7243
|
+
},
|
|
7244
|
+
children: body
|
|
7245
|
+
}), footer || null]
|
|
7246
|
+
})]
|
|
7247
|
+
})
|
|
7166
7248
|
});
|
|
7167
7249
|
}
|
|
7168
7250
|
FullscreenModal.Header = FullscreenModalHeader;
|
|
@@ -10595,7 +10677,9 @@ function KittNativeBaseProvider({
|
|
|
10595
10677
|
isSSR: isSSR,
|
|
10596
10678
|
children: /*#__PURE__*/jsxRuntime.jsx(KittThemeContext.Provider, {
|
|
10597
10679
|
value: kittInternalTheme,
|
|
10598
|
-
children:
|
|
10680
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CurrentBreakpointProvider, {
|
|
10681
|
+
children: children
|
|
10682
|
+
})
|
|
10599
10683
|
})
|
|
10600
10684
|
});
|
|
10601
10685
|
}
|
|
@@ -12687,21 +12771,15 @@ function MatchWindowSize({
|
|
|
12687
12771
|
}
|
|
12688
12772
|
/**
|
|
12689
12773
|
* Display based on current breakpoint
|
|
12774
|
+
* Mimics the behavior of Native Base's SwitchBreakpoints, but uses our custom context for better performance.
|
|
12690
12775
|
*
|
|
12691
12776
|
* WARNING: Currently not SSR friendly (but could be).
|
|
12692
12777
|
*/
|
|
12693
|
-
function SwitchBreakpoints(
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12698
|
-
return useBreakpointValue({
|
|
12699
|
-
base: KittBreakpointNameEnum.BASE,
|
|
12700
|
-
small: KittBreakpointNameEnum.SMALL,
|
|
12701
|
-
medium: KittBreakpointNameEnum.MEDIUM,
|
|
12702
|
-
large: KittBreakpointNameEnum.LARGE,
|
|
12703
|
-
wide: KittBreakpointNameEnum.WIDE
|
|
12704
|
-
});
|
|
12778
|
+
function SwitchBreakpoints(values) {
|
|
12779
|
+
const {
|
|
12780
|
+
breakpoint
|
|
12781
|
+
} = useCurrentBreakpointName();
|
|
12782
|
+
return getValueForBreakpoint(breakpoint, values);
|
|
12705
12783
|
}
|
|
12706
12784
|
|
|
12707
12785
|
function useStepAnimations({
|
|
@@ -13069,6 +13147,7 @@ exports.View = View;
|
|
|
13069
13147
|
exports.createChoicesComponent = createChoicesComponent;
|
|
13070
13148
|
exports.createResponsiveStyleFromProp = createResponsiveStyleFromProp;
|
|
13071
13149
|
exports.getStaticMapImageUrl = getStaticMapImageUrl;
|
|
13150
|
+
exports.getValueForBreakpoint = getValueForBreakpoint;
|
|
13072
13151
|
exports.hex2rgba = hex2rgba;
|
|
13073
13152
|
exports.matchWindowSize = matchWindowSize;
|
|
13074
13153
|
exports.storyPadding = storyPadding;
|