@bigbinary/neetoui-rn 3.1.5 → 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.
@@ -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,MAAM,wBAAwB,CAAC;AAI5E,KAAK,gBAAgB,GAAG,iBAAiB,CAAC,OAAO,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,SAAS,GACnC,gBAAgB,GAAG;IACjB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;mEAQlB,aAAa;uCA6Db,kBAAkB;CAbpB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAiBF,QAAA,MAAM,MAAM;;;;;;;;;;;;;;CAkBV,CAAC"}
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,MAAM,wBAAwB,CAAC;AAI5E,KAAK,gBAAgB,GAAG,iBAAiB,CAAC,OAAO,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,SAAS,GACnC,gBAAgB,GAAG;IACjB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;mEAQlB,aAAa;uCA6Db,kBAAkB;CAbpB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;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,G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AAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxE,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,4 +1,4 @@
1
- export { moderateScale } from "./scale";
1
+ export { moderateScale, scaleFor } from "./scale";
2
2
  export declare const getShadowStyles: (elevation?: number) => {
3
3
  shadowOffset?: undefined;
4
4
  shadowRadius?: undefined;
@@ -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;AAaxC,eAAO,MAAM,eAAe,GAAI,kBAAa;;;;;;;;;;;;;CAc5C,CAAC;AAEF,eAAO,MAAM,SAAS,eAAkC,CAAC;AAEzD,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,YAOvC,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
- * Scales bound to a given screen. Pass `rt.screen` from a unistyles
3
- * StyleSheet: reading it is what registers the dependency, so the sheet is
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: (screen: {
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;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,GAClB,QAAQ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,MACzC,MAAM,MAAM,EAAE,eAAY,WACkB,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,eAAY,WACM,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "3.1.5",
3
+ "version": "3.3.0",
4
4
  "description": "neeto UI component library for React Native — v3 (Unistyles, TypeScript, New Architecture)",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -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 { getShadowStyles, isValidEmail, moderateScale } from "./utils";
73
+ export {
74
+ getShadowStyles,
75
+ isValidEmail,
76
+ moderateScale,
77
+ scaleFor,
78
+ } from "./utils";
@@ -1,6 +1,6 @@
1
1
  import { Platform } from "react-native";
2
2
 
3
- export { moderateScale } from "./scale";
3
+ export { moderateScale, scaleFor } from "./scale";
4
4
 
5
5
  const shadowRadiusList = [
6
6
  1, 1.41, 2.22, 2.62, 3.84, 4.65, 4.65, 4.65, 5.46, 6.27, 6.68, 7.49, 8.3,
@@ -1,43 +1,30 @@
1
- import { UnistylesRuntime } from "react-native-unistyles";
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
- * The short screen edge, so a size scales the same in portrait and landscape.
7
- * Falls back to the baseline before unistyles has measured (and under the jest
8
- * mock, whose runtime reports 0x0), leaving sizes untouched.
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 shortDimension = ({ width, height }: { width: number; height: number }) =>
11
- Math.min(width, height) || GUIDELINE_BASE_WIDTH;
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 scale = (screenSize: number, size: number, factor: number) =>
20
+ export const moderateScale = (size: number, factor = 0.5) =>
15
21
  Math.round(
16
- size + ((screenSize / GUIDELINE_BASE_WIDTH) * size - size) * factor
22
+ size + ((deviceEdge / GUIDELINE_BASE_WIDTH) * size - size) * factor
17
23
  );
18
24
 
19
25
  /**
20
- * Scales bound to a given screen. Pass `rt.screen` from a unistyles
21
- * StyleSheet: reading it is what registers the dependency, so the sheet is
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 moderateScale = (size: number, factor = 0.5) =>
43
- scale(shortDimension(UnistylesRuntime.screen), size, factor);
29
+ export const scaleFor = (_screen: { width: number; height: number }) =>
30
+ moderateScale;