@bigbinary/neetoui-rn 3.2.0 → 3.3.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/lib/typescript/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/scale.d.ts +5 -18
- package/lib/typescript/src/utils/scale.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +0 -3
- package/src/components/BottomSheet/BottomSheet.tsx +0 -3
- package/src/components/BottomSheetMenu/BottomSheetMenu.tsx +0 -3
- package/src/components/ChatInput/AttachmentsView.tsx +0 -3
- package/src/components/ChatInput/ChatInput.tsx +0 -3
- package/src/components/ChatInput/IconButton.tsx +0 -3
- package/src/components/ChatInput/MentionsInput.tsx +0 -3
- package/src/components/CheckBox/CheckBox.tsx +0 -3
- package/src/components/EmptyView/EmptyView.tsx +0 -3
- package/src/components/Header/Header.tsx +0 -3
- package/src/components/Header/ScreenHeader.tsx +0 -3
- package/src/components/Input/InputFrame.tsx +0 -3
- package/src/components/OnBoarding/OnBoarding.tsx +0 -3
- package/src/components/RadioButton/RadioButton.tsx +0 -3
- package/src/components/SearchBar/SearchBar.tsx +0 -3
- package/src/components/Skeleton/Skeleton.tsx +0 -3
- package/src/components/Toast/Toast.tsx +0 -3
- package/src/index.ts +6 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/scale.ts +18 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AASzE,OAAO,EAAc,KAAK,iBAAiB,EAAE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IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAiBF,QAAA,MAAM,MAAM;;;;;;;;;;;;;;CAeV,CAAC"}
|
|
@@ -27,5 +27,5 @@ export { Typography, type TypographyProps } from "./components/Typography";
|
|
|
27
27
|
export { useDebounce, useNeetoTheme, useRefreshByUser } from "./hooks";
|
|
28
28
|
export { breakpoints, darkTheme, lightTheme, type NeetoTheme, } from "./theme/tokens";
|
|
29
29
|
export { configureNeetoUI, type ConfigureNeetoUIOptions } from "./unistyles";
|
|
30
|
-
export { getShadowStyles, isValidEmail, moderateScale } from "./utils";
|
|
30
|
+
export { getShadowStyles, isValidEmail, moderateScale, scaleFor, } from "./utils";
|
|
31
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,YAAY,EACZ,iCAAiC,EACjC,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAA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E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,QAAQ,GACT,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAalD,eAAO,MAAM,eAAe,GAAI,kBAAa;;;;;;;;;;;;;CAc5C,CAAC;AAEF,eAAO,MAAM,SAAS,eAAkC,CAAC;AAEzD,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,YAOvC,CAAC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
+
/** react-native-size-matters' formula, rounded exactly as v2's did. */
|
|
2
|
+
export declare const moderateScale: (size: number, factor?: number) => number;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* recomputed when the window resizes — rotation, split-screen, foldables,
|
|
5
|
-
* iPad Slide Over.
|
|
6
|
-
*
|
|
7
|
-
* const styles = StyleSheet.create((theme, rt) => {
|
|
8
|
-
* const moderateScale = scaleFor(rt.screen);
|
|
9
|
-
*
|
|
10
|
-
* return { card: { padding: moderateScale(16) } };
|
|
11
|
-
* });
|
|
4
|
+
* Kept for the existing `scaleFor(rt.screen)` call sites; the window it is
|
|
5
|
+
* handed is ignored.
|
|
12
6
|
*/
|
|
13
|
-
export declare const scaleFor: (
|
|
7
|
+
export declare const scaleFor: (_screen: {
|
|
14
8
|
width: number;
|
|
15
9
|
height: number;
|
|
16
10
|
}) => (size: number, factor?: number) => number;
|
|
17
|
-
/**
|
|
18
|
-
* Screen-independent entry point, for sizes computed outside a stylesheet —
|
|
19
|
-
* icon props, measured layouts. Reads the runtime on every call, so it is
|
|
20
|
-
* current whenever the component re-renders, but it cannot subscribe a
|
|
21
|
-
* stylesheet to resizes: use scaleFor inside StyleSheet.create.
|
|
22
|
-
*/
|
|
23
|
-
export declare const moderateScale: (size: number, factor?: number) => number;
|
|
24
11
|
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/utils/scale.ts"],"names":[],"mappings":"AAkBA
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/utils/scale.ts"],"names":[],"mappings":"AAkBA,uEAAuE;AACvE,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,eAAY,WAGrD,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,YAT/B,MAAM,4BAU3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -195,9 +195,6 @@ Alert.show = (params: AlertParams) => {
|
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
const styles = StyleSheet.create((theme, rt) => {
|
|
198
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
199
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
200
|
-
// split-screen and foldables instead of freezing at first render.
|
|
201
198
|
const moderateScale = scaleFor(rt.screen);
|
|
202
199
|
|
|
203
200
|
return {
|
|
@@ -457,9 +457,6 @@ export const BottomSheet = <T,>({
|
|
|
457
457
|
};
|
|
458
458
|
|
|
459
459
|
const styles = StyleSheet.create((theme, rt) => {
|
|
460
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
461
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
462
|
-
// split-screen and foldables instead of freezing at first render.
|
|
463
460
|
const moderateScale = scaleFor(rt.screen);
|
|
464
461
|
|
|
465
462
|
return {
|
|
@@ -105,9 +105,6 @@ export const BottomSheetMenu = ({
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
const styles = StyleSheet.create((theme, rt) => {
|
|
108
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
109
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
110
|
-
// split-screen and foldables instead of freezing at first render.
|
|
111
108
|
const moderateScale = scaleFor(rt.screen);
|
|
112
109
|
|
|
113
110
|
return {
|
|
@@ -55,9 +55,6 @@ export const AttachmentsView = ({
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const styles = StyleSheet.create((theme, rt) => {
|
|
58
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
59
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
60
|
-
// split-screen and foldables instead of freezing at first render.
|
|
61
58
|
const moderateScale = scaleFor(rt.screen);
|
|
62
59
|
|
|
63
60
|
return {
|
|
@@ -356,9 +356,6 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
|
|
356
356
|
ChatInput.displayName = "ChatInput";
|
|
357
357
|
|
|
358
358
|
const styles = StyleSheet.create((theme, rt) => {
|
|
359
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
360
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
361
|
-
// split-screen and foldables instead of freezing at first render.
|
|
362
359
|
const moderateScale = scaleFor(rt.screen);
|
|
363
360
|
|
|
364
361
|
return {
|
|
@@ -41,9 +41,6 @@ export const IconButton = ({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const styles = StyleSheet.create((_theme, rt) => {
|
|
44
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
45
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
46
|
-
// split-screen and foldables instead of freezing at first render.
|
|
47
44
|
const moderateScale = scaleFor(rt.screen);
|
|
48
45
|
|
|
49
46
|
return {
|
|
@@ -99,9 +99,6 @@ export const MentionsInput = ({
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
const styles = StyleSheet.create((theme, rt) => {
|
|
102
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
103
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
104
|
-
// split-screen and foldables instead of freezing at first render.
|
|
105
102
|
const moderateScale = scaleFor(rt.screen);
|
|
106
103
|
|
|
107
104
|
return {
|
|
@@ -65,9 +65,6 @@ export const CheckBox = ({
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const styles = StyleSheet.create((theme, rt) => {
|
|
68
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
69
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
70
|
-
// split-screen and foldables instead of freezing at first render.
|
|
71
68
|
const moderateScale = scaleFor(rt.screen);
|
|
72
69
|
|
|
73
70
|
return {
|
|
@@ -60,9 +60,6 @@ export const EmptyView = ({
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const styles = StyleSheet.create((theme, rt) => {
|
|
63
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
64
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
65
|
-
// split-screen and foldables instead of freezing at first render.
|
|
66
63
|
const moderateScale = scaleFor(rt.screen);
|
|
67
64
|
|
|
68
65
|
return {
|
|
@@ -97,9 +97,6 @@ export const Header = ({
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
const styles = StyleSheet.create((theme, rt) => {
|
|
100
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
101
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
102
|
-
// split-screen and foldables instead of freezing at first render.
|
|
103
100
|
const moderateScale = scaleFor(rt.screen);
|
|
104
101
|
|
|
105
102
|
return {
|
|
@@ -23,9 +23,6 @@ export const ScreenHeader = ({ title, style }: ScreenHeaderProps) => (
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
const styles = StyleSheet.create((_theme, rt) => {
|
|
26
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
27
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
28
|
-
// split-screen and foldables instead of freezing at first render.
|
|
29
26
|
const moderateScale = scaleFor(rt.screen);
|
|
30
27
|
|
|
31
28
|
return {
|
|
@@ -171,9 +171,6 @@ export const InputFrame = ({
|
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
const styles = StyleSheet.create((theme, rt) => {
|
|
174
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
175
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
176
|
-
// split-screen and foldables instead of freezing at first render.
|
|
177
174
|
const moderateScale = scaleFor(rt.screen);
|
|
178
175
|
|
|
179
176
|
return {
|
|
@@ -123,9 +123,6 @@ export const OnBoarding = ({
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const styles = StyleSheet.create((theme, rt) => {
|
|
126
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
127
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
128
|
-
// split-screen and foldables instead of freezing at first render.
|
|
129
126
|
const moderateScale = scaleFor(rt.screen);
|
|
130
127
|
|
|
131
128
|
return {
|
|
@@ -79,9 +79,6 @@ export const RadioButton = ({
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
const styles = StyleSheet.create((theme, rt) => {
|
|
82
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
83
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
84
|
-
// split-screen and foldables instead of freezing at first render.
|
|
85
82
|
const moderateScale = scaleFor(rt.screen);
|
|
86
83
|
|
|
87
84
|
return {
|
|
@@ -98,9 +98,6 @@ export const SearchBar = ({
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const styles = StyleSheet.create((theme, rt) => {
|
|
101
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
102
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
103
|
-
// split-screen and foldables instead of freezing at first render.
|
|
104
101
|
const moderateScale = scaleFor(rt.screen);
|
|
105
102
|
|
|
106
103
|
return {
|
|
@@ -108,9 +108,6 @@ const SkeletonGroup = ({
|
|
|
108
108
|
Skeleton.Group = SkeletonGroup;
|
|
109
109
|
|
|
110
110
|
const styles = StyleSheet.create((theme, rt) => {
|
|
111
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
112
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
113
|
-
// split-screen and foldables instead of freezing at first render.
|
|
114
111
|
const moderateScale = scaleFor(rt.screen);
|
|
115
112
|
|
|
116
113
|
return {
|
|
@@ -127,9 +127,6 @@ Toast.show = (params: ToastShowParams) =>
|
|
|
127
127
|
Toast.hide = () => ToastMessage.hide();
|
|
128
128
|
|
|
129
129
|
const styles = StyleSheet.create((theme, rt) => {
|
|
130
|
-
// Reading rt.screen registers the dependency that has this sheet
|
|
131
|
-
// recomputed on a window resize, so scaled sizes follow rotation,
|
|
132
|
-
// split-screen and foldables instead of freezing at first render.
|
|
133
130
|
const moderateScale = scaleFor(rt.screen);
|
|
134
131
|
|
|
135
132
|
return {
|
package/src/index.ts
CHANGED
|
@@ -70,4 +70,9 @@ export {
|
|
|
70
70
|
type NeetoTheme,
|
|
71
71
|
} from "./theme/tokens";
|
|
72
72
|
export { configureNeetoUI, type ConfigureNeetoUIOptions } from "./unistyles";
|
|
73
|
-
export {
|
|
73
|
+
export {
|
|
74
|
+
getShadowStyles,
|
|
75
|
+
isValidEmail,
|
|
76
|
+
moderateScale,
|
|
77
|
+
scaleFor,
|
|
78
|
+
} from "./utils";
|
package/src/utils/index.ts
CHANGED
package/src/utils/scale.ts
CHANGED
|
@@ -1,43 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dimensions } from "react-native";
|
|
2
2
|
|
|
3
3
|
const GUIDELINE_BASE_WIDTH = 350;
|
|
4
|
+
const TABLET_MIN_SHORT_EDGE = 600;
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Sizes come from the device screen, read once, never from the window: an
|
|
8
|
+
* iPad window resized in Split View or Stage Manager keeps its sizes and only
|
|
9
|
+
* its layout reflows, as platform apps do. The short edge keeps portrait and
|
|
10
|
+
* landscape equal, and tablets get the raw ramp rather than an enlarged phone.
|
|
9
11
|
*/
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
+
const deviceEdge = (() => {
|
|
13
|
+
const { width, height } = Dimensions.get("screen");
|
|
14
|
+
const edge = Math.min(width, height) || GUIDELINE_BASE_WIDTH;
|
|
15
|
+
|
|
16
|
+
return edge >= TABLET_MIN_SHORT_EDGE ? GUIDELINE_BASE_WIDTH : edge;
|
|
17
|
+
})();
|
|
12
18
|
|
|
13
19
|
/** react-native-size-matters' formula, rounded exactly as v2's did. */
|
|
14
|
-
const
|
|
20
|
+
export const moderateScale = (size: number, factor = 0.5) =>
|
|
15
21
|
Math.round(
|
|
16
|
-
size + ((
|
|
22
|
+
size + ((deviceEdge / GUIDELINE_BASE_WIDTH) * size - size) * factor
|
|
17
23
|
);
|
|
18
24
|
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* recomputed when the window resizes — rotation, split-screen, foldables,
|
|
23
|
-
* iPad Slide Over.
|
|
24
|
-
*
|
|
25
|
-
* const styles = StyleSheet.create((theme, rt) => {
|
|
26
|
-
* const moderateScale = scaleFor(rt.screen);
|
|
27
|
-
*
|
|
28
|
-
* return { card: { padding: moderateScale(16) } };
|
|
29
|
-
* });
|
|
30
|
-
*/
|
|
31
|
-
export const scaleFor =
|
|
32
|
-
(screen: { width: number; height: number }) =>
|
|
33
|
-
(size: number, factor = 0.5) =>
|
|
34
|
-
scale(shortDimension(screen), size, factor);
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Screen-independent entry point, for sizes computed outside a stylesheet —
|
|
38
|
-
* icon props, measured layouts. Reads the runtime on every call, so it is
|
|
39
|
-
* current whenever the component re-renders, but it cannot subscribe a
|
|
40
|
-
* stylesheet to resizes: use scaleFor inside StyleSheet.create.
|
|
26
|
+
* Kept for the existing `scaleFor(rt.screen)` call sites; the window it is
|
|
27
|
+
* handed is ignored.
|
|
41
28
|
*/
|
|
42
|
-
export const
|
|
43
|
-
|
|
29
|
+
export const scaleFor = (_screen: { width: number; height: number }) =>
|
|
30
|
+
moderateScale;
|