@molecule/app-ui-react-native 1.0.9 → 1.0.10
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.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../src/components/Skeleton.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAA;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgD5C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CASA,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAEA,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { useEffect,
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
8
|
import { Animated, View } from 'react-native';
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
10
10
|
/**
|
|
@@ -20,7 +20,9 @@ import { getClassMap } from '@molecule/app-ui';
|
|
|
20
20
|
*/
|
|
21
21
|
export const Skeleton = ({ width, height, circle, animation = 'pulse', className, testId, }) => {
|
|
22
22
|
const cm = getClassMap();
|
|
23
|
-
|
|
23
|
+
// The animated value is created once per mount and kept in state; a ref would
|
|
24
|
+
// have to be read while rendering.
|
|
25
|
+
const [opacity] = useState(() => new Animated.Value(1));
|
|
24
26
|
useEffect(() => {
|
|
25
27
|
if (animation === 'pulse') {
|
|
26
28
|
const pulse = Animated.loop(Animated.sequence([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/components/Toast.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAsE,MAAM,OAAO,CAAA;AAI1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwDtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAGA,CAAA;AASD,UAAU,iBAAiB;IACzB,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,KAAK,MAAM,CAAA;IACvD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,aAAa,CAAA;CACxF,CAuBA,CAAA;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CAW5C"}
|
package/dist/components/Toast.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { createContext, useCallback, useContext, useEffect,
|
|
7
|
+
import { createContext, useCallback, useContext, useEffect, useState } from 'react';
|
|
8
8
|
import { Animated, Pressable, Text, View } from 'react-native';
|
|
9
9
|
import { useTranslation } from '@molecule/app-react';
|
|
10
10
|
import { getClassMap } from '@molecule/app-ui';
|
|
@@ -27,7 +27,9 @@ export const Toast = ({ title, description, status, duration = 5000, dismissible
|
|
|
27
27
|
const classes = cm.cn(cm.toast({
|
|
28
28
|
variant: (status || 'default'),
|
|
29
29
|
}), className);
|
|
30
|
-
|
|
30
|
+
// The animated value is created once per mount and kept in state; a ref would
|
|
31
|
+
// have to be read while rendering.
|
|
32
|
+
const [opacity] = useState(() => new Animated.Value(1));
|
|
31
33
|
useEffect(() => {
|
|
32
34
|
if (duration > 0) {
|
|
33
35
|
const timer = setTimeout(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ui-react-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "React Native UI component implementations for molecule.dev",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-ui-react-native",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@molecule/app-i18n": "1.2.2",
|
|
38
38
|
"@molecule/app-icons": "1.0.4",
|
|
39
|
-
"@molecule/app-react": "4.
|
|
39
|
+
"@molecule/app-react": "4.8.0",
|
|
40
40
|
"@molecule/app-ui": "1.4.0",
|
|
41
41
|
"@types/node": "26.6.5",
|
|
42
42
|
"react": "19.3.1",
|