@gluestack-ui/core 3.0.2 → 3.0.3

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":"AnimatedHeight.d.ts","sourceRoot":"","sources":["../../../../src/accordion/creator/AnimatedHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,QAAA,MAAM,cAAc,GAAI,iCAAqC,GAAG,sBAoD/D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AnimatedHeight.d.ts","sourceRoot":"","sources":["../../../../src/accordion/creator/AnimatedHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,QAAA,MAAM,cAAc,GAAI,iCAAqC,GAAG,sBA2D/D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import React, { useRef, useEffect, useState } from 'react';
2
2
  import { Animated, StyleSheet } from 'react-native';
3
3
  const AnimatedHeight = ({ hide, extraHeight = 0, children }) => {
4
- const [measuredHeight, setMeasuredHeight] = useState(0);
4
+ const [measuredHeight, setMeasuredHeight] = useState(hide ? 0 : null);
5
5
  const opacityValue = useRef(new Animated.Value(hide ? 0 : 1)).current;
6
- const heightValue = useRef(new Animated.Value(hide ? 0 : measuredHeight + extraHeight)).current;
6
+ const heightValue = useRef(new Animated.Value(hide ? 0 : 1)).current;
7
+ const animate = hide || measuredHeight !== null;
7
8
  useEffect(() => {
8
9
  Animated.timing(opacityValue, {
9
10
  toValue: hide ? 0 : 1,
@@ -15,24 +16,28 @@ const AnimatedHeight = ({ hide, extraHeight = 0, children }) => {
15
16
  duration: 200,
16
17
  useNativeDriver: false,
17
18
  }).start();
18
- }, [hide, measuredHeight, extraHeight, heightValue, opacityValue]);
19
+ }, [hide, heightValue, opacityValue]);
19
20
  const animatedHeight = heightValue.interpolate({
20
21
  inputRange: [0, 1],
21
- outputRange: [0, measuredHeight + extraHeight],
22
+ outputRange: [0, (measuredHeight !== null && measuredHeight !== void 0 ? measuredHeight : 0) + extraHeight],
22
23
  });
23
- return (<Animated.View style={[
24
- styles.hidden,
25
- {
26
- height: animatedHeight,
27
- },
28
- ]}>
29
- <Animated.View style={[
30
- StyleSheet.absoluteFill,
31
- styles.autoBottom,
32
- {
33
- opacity: opacityValue,
34
- },
35
- ]} onLayout={(e) => {
24
+ return (<Animated.View style={animate
25
+ ? [
26
+ styles.hidden,
27
+ {
28
+ height: animatedHeight,
29
+ },
30
+ ]
31
+ : undefined}>
32
+ <Animated.View style={animate
33
+ ? [
34
+ StyleSheet.absoluteFill,
35
+ styles.autoBottom,
36
+ {
37
+ opacity: opacityValue,
38
+ },
39
+ ]
40
+ : undefined} onLayout={(e) => {
36
41
  const height = Math.round(e.nativeEvent.layout.height);
37
42
  setMeasuredHeight(height);
38
43
  }}>
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedHeight.jsx","sourceRoot":"","sources":["../../../../src/accordion/creator/AnimatedHeight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,cAAc,GAAG,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAO,EAAE,EAAE;IAClE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACtE,MAAM,WAAW,GAAG,MAAM,CACxB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAA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MAAM,CAAC,CAAC;YACvD,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAEF;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,QAAQ,CAAC,IAAI,CACjB;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC;AAE9B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,MAAM,EAAE,MAAM;KACf;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gluestack-ui/core",
3
3
  "description": "Universal UI components for React Native, Expo, and Next.js",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "main": "./lib/esm/index.js",
6
6
  "module": "./lib/esm/index.js",
7
7
  "types": "./lib/esm/index.d.ts",
@@ -157,7 +157,7 @@
157
157
  }
158
158
  },
159
159
  "dependencies": {
160
- "@gluestack-ui/utils": "^3.0.2",
160
+ "@gluestack-ui/utils": "^3.0.4",
161
161
  "react-native-svg": "^15.12.0"
162
162
  },
163
163
  "peerDependencies": {
package/CHANGELOG.md DELETED
@@ -1,127 +0,0 @@
1
- # @gluestack-ui/core
2
-
3
- ## 3.0.2
4
-
5
- ### Patch Changes
6
-
7
- - chore: re release
8
- - Updated dependencies
9
- - @gluestack-ui/utils@3.0.2
10
-
11
- ## 3.0.0
12
-
13
- ### Patch Changes
14
-
15
- - 292f5a3: chore: test
16
- - 3f65e0b: chore: test
17
- - 948a342: chore: test
18
-
19
- ## 3.0.0-alpha.4
20
-
21
- ### Patch Changes
22
-
23
- - 292f5a3: chore: test
24
-
25
- ## 3.0.0-alpha.3
26
-
27
- ### Patch Changes
28
-
29
- - 948a342: chore: test
30
-
31
- ## 3.0.0
32
-
33
- ### Patch Changes
34
-
35
- - 45eca19: chore: test
36
- - bd5efa7: chore: test
37
- - chore: test
38
-
39
- ## 3.0.0
40
-
41
- ### Patch Changes
42
-
43
- - chore: changed utils dependency to alpha version
44
-
45
- ## 1.2.10
46
-
47
- ### Patch Changes
48
-
49
- - fix image not working with require
50
-
51
- ## 1.2.7
52
-
53
- ### Patch Changes
54
-
55
- - resolved image types
56
-
57
- ## 1.2.7
58
-
59
- ### Patch Changes
60
-
61
- - bd7a48d: chore:test
62
-
63
- ## 1.2.6
64
-
65
- ### Patch Changes
66
-
67
- - added barrel packages
68
- - Updated dependencies
69
- - @gluestack-ui/utils@1.0.20
70
-
71
- ## 1.2.5
72
-
73
- ### Patch Changes
74
-
75
- - created the barrel files
76
- - Updated dependencies
77
- - @gluestack-ui/utils@1.0.19
78
-
79
- ## 1.2.4
80
-
81
- ### Patch Changes
82
-
83
- - add the react native imports
84
-
85
- ## 1.2.3
86
-
87
- ### Patch Changes
88
-
89
- - change node back to bundler
90
-
91
- ## 1.2.2
92
-
93
- ### Patch Changes
94
-
95
- - put type versions back
96
-
97
- ## 1.2.1
98
-
99
- ### Patch Changes
100
-
101
- - change to bundler
102
-
103
- ## 1.1.0
104
-
105
- ### Minor Changes
106
-
107
- ## 1.0.9
108
-
109
- ### Patch Changes
110
-
111
- - fix: added expo/html-elements and react-native-safe-area-context to transpile packages in ui-next-adapter
112
- - Updated dependencies
113
- - @gluestack-ui/utils@0.1.16
114
-
115
- ## 1.0.8
116
-
117
- ### Patch Changes
118
-
119
- - chore: implemented changesets on packages
120
-
121
- ## 1.0.7
122
-
123
- ### Patch Changes
124
-
125
- - feat: implemented changeset on packages
126
- - Updated dependencies
127
- - @gluestack-ui/utils@0.1.15