@admin-layout/gluestack-ui-mobile 12.2.5-alpha.15 → 12.2.5-alpha.18
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 +10 -0
- package/babel.config.cjs +7 -0
- package/jest-react-navigation-setup.js +1 -1
- package/{jest.config.js → jest.config.cjs} +9 -5
- package/lib/components/ErrorBounday.d.ts +9 -1
- package/lib/components/ErrorBounday.js +13 -3
- package/lib/components/ErrorBounday.js.map +1 -1
- package/lib/components/Fallback.d.ts +2 -0
- package/lib/components/Fallback.js +14 -5
- package/lib/components/Fallback.js.map +1 -1
- package/lib/components/__tests__/ErrorBoundary.test.d.ts +1 -0
- package/lib/components/__tests__/ErrorBoundary.test.js +47 -0
- package/lib/components/__tests__/ErrorBoundary.test.js.map +1 -0
- package/lib/tailwind.config.js +0 -3
- package/lib/tailwind.config.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ErrorBounday.tsx +14 -4
- package/src/components/Fallback.tsx +19 -6
- package/src/components/__tests__/ErrorBoundary.test.tsx +56 -0
- package/src/tailwind.config.js +198 -202
- package/babel.config.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [12.2.5-alpha.18](https://github.com/CDEBase/admin-layout/compare/v12.2.5-alpha.17...v12.2.5-alpha.18) (2026-10-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @admin-layout/gluestack-ui-mobile
|
|
9
|
+
|
|
10
|
+
## [12.2.5-alpha.17](https://github.com/CDEBase/admin-layout/compare/v12.2.5-alpha.16...v12.2.5-alpha.17) (2026-10-10)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **gluestack-ui-mobile:** the error screen's button shows and brings the app back ([4d21d32](https://github.com/CDEBase/admin-layout/commit/4d21d32b142d54cc0edd99bb15084b33cf2ab11d))
|
|
15
|
+
|
|
6
16
|
## [12.2.5-alpha.15](https://github.com/CDEBase/admin-layout/compare/v12.2.5-alpha.14...v12.2.5-alpha.15) (2026-10-08)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
package/babel.config.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Jest only (the package builds with tsc). The React Native preset already
|
|
2
|
+
// carries TypeScript, JSX, class properties and CommonJS modules; the
|
|
3
|
+
// hand-listed plugins this used to add clashed with it ("'loose' mode
|
|
4
|
+
// configuration must be the same") and the suite never ran.
|
|
5
|
+
module.exports = {
|
|
6
|
+
presets: ['module:@react-native/babel-preset'],
|
|
7
|
+
};
|
|
@@ -11,4 +11,4 @@ jest.mock('react-native-reanimated', () => {
|
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
|
|
14
|
-
jest.mock('react-native/
|
|
14
|
+
jest.mock('react-native/src/private/animated/NativeAnimatedHelper');
|
|
@@ -10,18 +10,21 @@ const mergeData = merge.recursive(
|
|
|
10
10
|
babelConfig: true,
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
-
name: packageJson.name,
|
|
14
13
|
displayName: packageJson.name,
|
|
15
14
|
testEnvironment: "jsdom",
|
|
16
15
|
preset: "react-native",
|
|
17
16
|
setupFiles: [
|
|
18
17
|
"<rootDir>/jest-react-navigation-setup.js"
|
|
19
18
|
],
|
|
20
|
-
setupFilesAfterEnv: ["
|
|
19
|
+
setupFilesAfterEnv: ["./jest.env.js"],
|
|
20
|
+
// React Native ships Flow + ESM source: compile it with this package's
|
|
21
|
+
// RN preset (babel.config.cjs). The repo-wide transform.js has no Flow
|
|
22
|
+
// support, and node_modules is hoisted to the repo root, so a
|
|
23
|
+
// <rootDir>/node_modules pattern never matched it.
|
|
21
24
|
"transform": {
|
|
22
|
-
"\\.(js|jsx)?$": "
|
|
25
|
+
"\\.(js|jsx)?$": "babel-jest",
|
|
23
26
|
},
|
|
24
|
-
transformIgnorePatterns: ["
|
|
27
|
+
transformIgnorePatterns: ["/node_modules/(?!((jest-)?react-native[^/]*|@react-native[^/]*|@react-navigation|@expo|@common-stack|@cdm-logger|@apollo|@web3-storage)/)"],
|
|
25
28
|
moduleNameMapper: {
|
|
26
29
|
'^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
|
|
27
30
|
// we'll use commonjs version of lodash for tests 👌
|
|
@@ -31,7 +34,8 @@ const mergeData = merge.recursive(
|
|
|
31
34
|
// '@react-navigation': '<rootDir>/__mocks__/@react-navigation.js',
|
|
32
35
|
},
|
|
33
36
|
roots: [
|
|
34
|
-
"src/utils"
|
|
37
|
+
"src/utils",
|
|
38
|
+
"src/components/__tests__"
|
|
35
39
|
],
|
|
36
40
|
},
|
|
37
41
|
);
|
|
@@ -12,7 +12,15 @@ export declare class ErrorBoundary extends React.Component<IErrorBoundryProps, I
|
|
|
12
12
|
hasError: boolean;
|
|
13
13
|
error: Error;
|
|
14
14
|
};
|
|
15
|
-
componentDidCatch(error: Error): void;
|
|
15
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
16
|
+
/**
|
|
17
|
+
* Mount the children again. The app's boundary wraps the navigation
|
|
18
|
+
* container itself, so while the fallback shows there is no navigator to
|
|
19
|
+
* navigate with: "Go to homepage" called navigate on nothing and the app
|
|
20
|
+
* stayed on this screen until it was force-quit. A fresh mount starts the
|
|
21
|
+
* navigator at its initial route.
|
|
22
|
+
*/
|
|
23
|
+
resetError: () => void;
|
|
16
24
|
render(): React.JSX.Element;
|
|
17
25
|
}
|
|
18
26
|
export {};
|
|
@@ -4,17 +4,27 @@ import { logger } from '@cdm-logger/client';
|
|
|
4
4
|
export class ErrorBoundary extends React.Component {
|
|
5
5
|
constructor(props) {
|
|
6
6
|
super(props);
|
|
7
|
+
/**
|
|
8
|
+
* Mount the children again. The app's boundary wraps the navigation
|
|
9
|
+
* container itself, so while the fallback shows there is no navigator to
|
|
10
|
+
* navigate with: "Go to homepage" called navigate on nothing and the app
|
|
11
|
+
* stayed on this screen until it was force-quit. A fresh mount starts the
|
|
12
|
+
* navigator at its initial route.
|
|
13
|
+
*/
|
|
14
|
+
this.resetError = () => {
|
|
15
|
+
this.setState({ hasError: false, error: null });
|
|
16
|
+
};
|
|
7
17
|
this.state = { hasError: false, error: null };
|
|
8
18
|
}
|
|
9
19
|
static getDerivedStateFromError(error) {
|
|
10
20
|
return { hasError: true, error };
|
|
11
21
|
}
|
|
12
|
-
componentDidCatch(error) {
|
|
13
|
-
logger.
|
|
22
|
+
componentDidCatch(error, info) {
|
|
23
|
+
logger.error(error, info?.componentStack ?? '');
|
|
14
24
|
}
|
|
15
25
|
render() {
|
|
16
26
|
if (this.state.hasError) {
|
|
17
|
-
return React.createElement(FallbackComponent, { error: this.state.error });
|
|
27
|
+
return React.createElement(FallbackComponent, { error: this.state.error, resetError: this.resetError });
|
|
18
28
|
}
|
|
19
29
|
return this.props.children;
|
|
20
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBounday.js","sourceRoot":"","sources":["../../src/components/ErrorBounday.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorBounday.js","sourceRoot":"","sources":["../../src/components/ErrorBounday.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAO5C,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiD;IACtF,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QAYjB;;;;;;WAMG;QACH,eAAU,GAAG,GAAG,EAAE;YACd,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC;QApBE,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,IAAqB;QACjD,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAaD,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,oBAAC,iBAAiB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAc,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,GAAI,CAAC;QAChG,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACJ"}
|
|
@@ -3,15 +3,20 @@ import { Button, ButtonText } from '@gluestack-ui/themed';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
5
|
import { SafeAreaView, Text, View } from 'react-native';
|
|
6
|
-
import { useDispatch } from 'react-redux';
|
|
7
6
|
export const FallbackComponent = (props) => {
|
|
8
|
-
const
|
|
7
|
+
const goHome = () => {
|
|
8
|
+
if (props.resetError) {
|
|
9
|
+
props.resetError();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
navigationRef.navigate('MainStack.Layout.Home');
|
|
13
|
+
};
|
|
9
14
|
return (React.createElement(SafeAreaView, { style: styles.container },
|
|
10
15
|
React.createElement(View, { style: styles.content },
|
|
11
16
|
React.createElement(Text, { style: styles.title }, "Oops!"),
|
|
12
17
|
React.createElement(Text, { style: styles.subtitle }, "There's an error"),
|
|
13
18
|
React.createElement(Text, { style: styles.error }, props?.error?.message),
|
|
14
|
-
React.createElement(Button, { style: styles.button, onPress:
|
|
19
|
+
React.createElement(Button, { style: styles.button, onPress: goHome },
|
|
15
20
|
React.createElement(ButtonText, { style: styles.buttonText }, "Go to homepage")))));
|
|
16
21
|
};
|
|
17
22
|
const styles = StyleSheet.create({
|
|
@@ -37,14 +42,18 @@ const styles = StyleSheet.create({
|
|
|
37
42
|
error: {
|
|
38
43
|
paddingVertical: 16,
|
|
39
44
|
},
|
|
45
|
+
// A fixed height with no vertical padding: `padding: 25` inside
|
|
46
|
+
// `height: 40` left the label -10pt and it never showed.
|
|
40
47
|
button: {
|
|
41
48
|
backgroundColor: '#2196f3',
|
|
42
49
|
borderRadius: 50,
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
height: 52,
|
|
51
|
+
paddingVertical: 0,
|
|
52
|
+
paddingHorizontal: 24,
|
|
45
53
|
},
|
|
46
54
|
buttonText: {
|
|
47
55
|
color: '#fff',
|
|
56
|
+
fontSize: 17,
|
|
48
57
|
fontWeight: '600',
|
|
49
58
|
textAlign: 'center',
|
|
50
59
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fallback.js","sourceRoot":"","sources":["../../src/components/Fallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
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S,EAAE;QACP,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KAC3B;IACD,OAAO,EAAE;QACL,gBAAgB,EAAE,EAAE;KACvB;IACD,KAAK,EAAE;QACH,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,aAAa,EAAE,EAAE;QACjB,KAAK,EAAE,MAAM;KAChB;IACD,QAAQ,EAAE;QACN,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,MAAM;KAChB;IACD,KAAK,EAAE;QACH,eAAe,EAAE,EAAE;KACtB;IACD,gEAAgE;IAChE,yDAAyD;IACzD,MAAM,EAAE;QACJ,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;KACxB;IACD,UAAU,EAAE;QACR,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,QAAQ;KACtB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app-wide boundary wraps the navigation container. Live 2026-10-10: a
|
|
3
|
+
* screen threw, the fallback showed, and "Go to homepage" did nothing (its
|
|
4
|
+
* label did not even show) - the app was stuck until it was force-quit.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { Text } from 'react-native';
|
|
8
|
+
import { fireEvent, render } from '@testing-library/react-native';
|
|
9
|
+
import { ErrorBoundary } from '../ErrorBounday';
|
|
10
|
+
const mockNavigate = jest.fn();
|
|
11
|
+
jest.mock('@common-stack/client-react', () => ({
|
|
12
|
+
navigationRef: { navigate: (...a) => mockNavigate(...a) },
|
|
13
|
+
}));
|
|
14
|
+
jest.mock('@cdm-logger/client', () => ({ logger: { error: jest.fn(), debug: jest.fn() } }));
|
|
15
|
+
jest.mock('@gluestack-ui/themed', () => {
|
|
16
|
+
const { Pressable: P, Text: T } = jest.requireActual('react-native');
|
|
17
|
+
return { Button: P, ButtonText: T };
|
|
18
|
+
});
|
|
19
|
+
let crash = true;
|
|
20
|
+
function Screen() {
|
|
21
|
+
if (crash)
|
|
22
|
+
throw new Error("Property 'promoProgress' doesn't exist");
|
|
23
|
+
return React.createElement(Text, null, "Home");
|
|
24
|
+
}
|
|
25
|
+
describe('app error boundary', () => {
|
|
26
|
+
beforeEach(() => {
|
|
27
|
+
crash = true;
|
|
28
|
+
mockNavigate.mockClear();
|
|
29
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
30
|
+
});
|
|
31
|
+
it('shows the error and a labelled way home', () => {
|
|
32
|
+
const { getByText } = render(React.createElement(ErrorBoundary, null,
|
|
33
|
+
React.createElement(Screen, null)));
|
|
34
|
+
expect(getByText("Property 'promoProgress' doesn't exist")).toBeTruthy();
|
|
35
|
+
expect(getByText('Go to homepage')).toBeTruthy();
|
|
36
|
+
});
|
|
37
|
+
it('"Go to homepage" mounts the app again instead of navigating a navigator that is gone', () => {
|
|
38
|
+
const { getByText, queryByText } = render(React.createElement(ErrorBoundary, null,
|
|
39
|
+
React.createElement(Screen, null)));
|
|
40
|
+
crash = false;
|
|
41
|
+
fireEvent.press(getByText('Go to homepage'));
|
|
42
|
+
expect(getByText('Home')).toBeTruthy();
|
|
43
|
+
expect(queryByText("There's an error")).toBeNull();
|
|
44
|
+
expect(mockNavigate).not.toHaveBeenCalled();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=ErrorBoundary.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/ErrorBoundary.test.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,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,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAC/C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CACxB,oBAAC,aAAa;YACV,oBAAC,MAAM,OAAG,CACE,CACnB,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,wCAAwC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACzE,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC5F,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,CACrC,oBAAC,aAAa;YACV,oBAAC,MAAM,OAAG,CACE,CACnB,CAAC;QACF,KAAK,GAAG,KAAK,CAAC;QACd,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACvC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/tailwind.config.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import gluestackPlugin from '@gluestack-ui/nativewind-utils/tailwind-plugin';
|
|
2
|
-
import { createRequire } from 'module';
|
|
3
|
-
var require = createRequire(import.meta.url);
|
|
4
|
-
var module = { exports: {} };
|
|
5
2
|
/** @type {import('tailwindcss').Config} */
|
|
6
3
|
module.exports = {
|
|
7
4
|
darkMode: 'media',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.config.js","sourceRoot":"","sources":["../src/tailwind.config.js"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"tailwind.config.js","sourceRoot":"","sources":["../src/tailwind.config.js"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAE7E,2CAA2C;AAC3C,MAAM,CAAC,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO;IACjB,OAAO,EAAE,CAAC,YAAY,EAAE,mCAAmC,CAAC;IAC5D,OAAO,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvC,QAAQ,EAAE;QACN;YACI,OAAO,EACH,kPAAkP;SACzP;KACJ;IACD,KAAK,EAAE;QACH,MAAM,EAAE;YACJ,MAAM,EAAE;gBACJ,OAAO,EAAE;oBACL,CAAC,EAAE,2CAA2C;oBAC9C,EAAE,EAAE,4CAA4C;oBAChD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;oBAClD,GAAG,EAAE,6CAA6C;iBACrD;gBACD,SAAS,EAAE;oBACP,CAAC,EAAE,6CAA6C;oBAChD,EAAE,EAAE,8CAA8C;oBAClD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;oBACpD,GAAG,EAAE,+CAA+C;o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AAQ,EAAE,oCAAoC;gBAC9C,QAAQ,EAAE,oCAAoC;gBAC9C,QAAQ,EAAE,oCAAoC;aACjD;SACJ;KACJ;IACD,OAAO,EAAE,CAAC,eAAe,CAAC;CAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/gluestack-ui-mobile",
|
|
3
|
-
"version": "12.2.5-alpha.
|
|
3
|
+
"version": "12.2.5-alpha.18",
|
|
4
4
|
"description": "Glustack-ui for mobile component layout",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"typescript": {
|
|
51
51
|
"definition": "lib/index.d.ts"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f90f7ea26f7e26940475da25da249f748b398325"
|
|
54
54
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { FallbackComponent } from './Fallback';
|
|
3
3
|
import { logger } from '@cdm-logger/client';
|
|
4
|
-
import { useDispatch } from 'react-redux';
|
|
5
4
|
|
|
6
5
|
type IErrorBoundryState = { hasError: boolean; error: Error | null };
|
|
7
6
|
type IErrorBoundryProps = {
|
|
@@ -18,13 +17,24 @@ export class ErrorBoundary extends React.Component<IErrorBoundryProps, IErrorBou
|
|
|
18
17
|
return { hasError: true, error };
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
componentDidCatch(error: Error) {
|
|
22
|
-
logger.
|
|
20
|
+
componentDidCatch(error: Error, info: React.ErrorInfo) {
|
|
21
|
+
logger.error(error, info?.componentStack ?? '');
|
|
23
22
|
}
|
|
24
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Mount the children again. The app's boundary wraps the navigation
|
|
26
|
+
* container itself, so while the fallback shows there is no navigator to
|
|
27
|
+
* navigate with: "Go to homepage" called navigate on nothing and the app
|
|
28
|
+
* stayed on this screen until it was force-quit. A fresh mount starts the
|
|
29
|
+
* navigator at its initial route.
|
|
30
|
+
*/
|
|
31
|
+
resetError = () => {
|
|
32
|
+
this.setState({ hasError: false, error: null });
|
|
33
|
+
};
|
|
34
|
+
|
|
25
35
|
render() {
|
|
26
36
|
if (this.state.hasError) {
|
|
27
|
-
return <FallbackComponent error={this.state.error as Error} />;
|
|
37
|
+
return <FallbackComponent error={this.state.error as Error} resetError={this.resetError} />;
|
|
28
38
|
}
|
|
29
39
|
return this.props.children;
|
|
30
40
|
}
|
|
@@ -4,19 +4,28 @@ import * as React from 'react';
|
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
5
|
|
|
6
6
|
import { SafeAreaView, Text, View } from 'react-native';
|
|
7
|
-
import { useDispatch } from 'react-redux';
|
|
8
7
|
|
|
9
|
-
type Props = {
|
|
8
|
+
type Props = {
|
|
9
|
+
error: Error;
|
|
10
|
+
/** From the boundary that caught the error: mounts the app again. */
|
|
11
|
+
resetError?: () => void;
|
|
12
|
+
};
|
|
10
13
|
|
|
11
14
|
export const FallbackComponent = (props: Props) => {
|
|
12
|
-
const
|
|
15
|
+
const goHome = () => {
|
|
16
|
+
if (props.resetError) {
|
|
17
|
+
props.resetError();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
navigationRef.navigate('MainStack.Layout.Home');
|
|
21
|
+
};
|
|
13
22
|
return (
|
|
14
23
|
<SafeAreaView style={styles.container}>
|
|
15
24
|
<View style={styles.content}>
|
|
16
25
|
<Text style={styles.title}>Oops!</Text>
|
|
17
26
|
<Text style={styles.subtitle}>{"There's an error"}</Text>
|
|
18
27
|
<Text style={styles.error}>{props?.error?.message}</Text>
|
|
19
|
-
<Button style={styles.button} onPress={
|
|
28
|
+
<Button style={styles.button} onPress={goHome}>
|
|
20
29
|
<ButtonText style={styles.buttonText}>Go to homepage</ButtonText>
|
|
21
30
|
</Button>
|
|
22
31
|
</View>
|
|
@@ -47,14 +56,18 @@ const styles: any = StyleSheet.create({
|
|
|
47
56
|
error: {
|
|
48
57
|
paddingVertical: 16,
|
|
49
58
|
},
|
|
59
|
+
// A fixed height with no vertical padding: `padding: 25` inside
|
|
60
|
+
// `height: 40` left the label -10pt and it never showed.
|
|
50
61
|
button: {
|
|
51
62
|
backgroundColor: '#2196f3',
|
|
52
63
|
borderRadius: 50,
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
height: 52,
|
|
65
|
+
paddingVertical: 0,
|
|
66
|
+
paddingHorizontal: 24,
|
|
55
67
|
},
|
|
56
68
|
buttonText: {
|
|
57
69
|
color: '#fff',
|
|
70
|
+
fontSize: 17,
|
|
58
71
|
fontWeight: '600',
|
|
59
72
|
textAlign: 'center',
|
|
60
73
|
},
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app-wide boundary wraps the navigation container. Live 2026-10-10: a
|
|
3
|
+
* screen threw, the fallback showed, and "Go to homepage" did nothing (its
|
|
4
|
+
* label did not even show) - the app was stuck until it was force-quit.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { Text } from 'react-native';
|
|
8
|
+
import { fireEvent, render } from '@testing-library/react-native';
|
|
9
|
+
import { ErrorBoundary } from '../ErrorBounday';
|
|
10
|
+
|
|
11
|
+
const mockNavigate = jest.fn();
|
|
12
|
+
jest.mock('@common-stack/client-react', () => ({
|
|
13
|
+
navigationRef: { navigate: (...a: unknown[]) => mockNavigate(...a) },
|
|
14
|
+
}));
|
|
15
|
+
jest.mock('@cdm-logger/client', () => ({ logger: { error: jest.fn(), debug: jest.fn() } }));
|
|
16
|
+
jest.mock('@gluestack-ui/themed', () => {
|
|
17
|
+
const { Pressable: P, Text: T } = jest.requireActual('react-native');
|
|
18
|
+
return { Button: P, ButtonText: T };
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
let crash = true;
|
|
22
|
+
function Screen() {
|
|
23
|
+
if (crash) throw new Error("Property 'promoProgress' doesn't exist");
|
|
24
|
+
return <Text>Home</Text>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('app error boundary', () => {
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
crash = true;
|
|
30
|
+
mockNavigate.mockClear();
|
|
31
|
+
jest.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('shows the error and a labelled way home', () => {
|
|
35
|
+
const { getByText } = render(
|
|
36
|
+
<ErrorBoundary>
|
|
37
|
+
<Screen />
|
|
38
|
+
</ErrorBoundary>,
|
|
39
|
+
);
|
|
40
|
+
expect(getByText("Property 'promoProgress' doesn't exist")).toBeTruthy();
|
|
41
|
+
expect(getByText('Go to homepage')).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('"Go to homepage" mounts the app again instead of navigating a navigator that is gone', () => {
|
|
45
|
+
const { getByText, queryByText } = render(
|
|
46
|
+
<ErrorBoundary>
|
|
47
|
+
<Screen />
|
|
48
|
+
</ErrorBoundary>,
|
|
49
|
+
);
|
|
50
|
+
crash = false;
|
|
51
|
+
fireEvent.press(getByText('Go to homepage'));
|
|
52
|
+
expect(getByText('Home')).toBeTruthy();
|
|
53
|
+
expect(queryByText("There's an error")).toBeNull();
|
|
54
|
+
expect(mockNavigate).not.toHaveBeenCalled();
|
|
55
|
+
});
|
|
56
|
+
});
|
package/src/tailwind.config.js
CHANGED
|
@@ -1,202 +1,198 @@
|
|
|
1
|
-
import gluestackPlugin from '@gluestack-ui/nativewind-utils/tailwind-plugin';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
'
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
'hard-
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
plugins: [gluestackPlugin],
|
|
202
|
-
};
|
|
1
|
+
import gluestackPlugin from '@gluestack-ui/nativewind-utils/tailwind-plugin';
|
|
2
|
+
|
|
3
|
+
/** @type {import('tailwindcss').Config} */
|
|
4
|
+
module.exports = {
|
|
5
|
+
darkMode: 'media',
|
|
6
|
+
content: ['./index.js', './components/**/*.{tsx,jsx,ts,js}'],
|
|
7
|
+
presets: [require('nativewind/preset')],
|
|
8
|
+
safelist: [
|
|
9
|
+
{
|
|
10
|
+
pattern:
|
|
11
|
+
/(bg|border|text|stroke|fill)-(primary|secondary|tertiary|error|success|warning|info|typography|outline|background|indicator)-(0|50|100|200|300|400|500|600|700|800|900|950|white|gray|black|error|warning|muted|success|info|light|dark|primary)/,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
theme: {
|
|
15
|
+
extend: {
|
|
16
|
+
colors: {
|
|
17
|
+
primary: {
|
|
18
|
+
0: 'rgb(var(--color-primary-0)/<alpha-value>)',
|
|
19
|
+
50: 'rgb(var(--color-primary-50)/<alpha-value>)',
|
|
20
|
+
100: 'rgb(var(--color-primary-100)/<alpha-value>)',
|
|
21
|
+
200: 'rgb(var(--color-primary-200)/<alpha-value>)',
|
|
22
|
+
300: 'rgb(var(--color-primary-300)/<alpha-value>)',
|
|
23
|
+
400: 'rgb(var(--color-primary-400)/<alpha-value>)',
|
|
24
|
+
500: 'rgb(var(--color-primary-500)/<alpha-value>)',
|
|
25
|
+
600: 'rgb(var(--color-primary-600)/<alpha-value>)',
|
|
26
|
+
700: 'rgb(var(--color-primary-700)/<alpha-value>)',
|
|
27
|
+
800: 'rgb(var(--color-primary-800)/<alpha-value>)',
|
|
28
|
+
900: 'rgb(var(--color-primary-900)/<alpha-value>)',
|
|
29
|
+
950: 'rgb(var(--color-primary-950)/<alpha-value>)',
|
|
30
|
+
},
|
|
31
|
+
secondary: {
|
|
32
|
+
0: 'rgb(var(--color-secondary-0)/<alpha-value>)',
|
|
33
|
+
50: 'rgb(var(--color-secondary-50)/<alpha-value>)',
|
|
34
|
+
100: 'rgb(var(--color-secondary-100)/<alpha-value>)',
|
|
35
|
+
200: 'rgb(var(--color-secondary-200)/<alpha-value>)',
|
|
36
|
+
300: 'rgb(var(--color-secondary-300)/<alpha-value>)',
|
|
37
|
+
400: 'rgb(var(--color-secondary-400)/<alpha-value>)',
|
|
38
|
+
500: 'rgb(var(--color-secondary-500)/<alpha-value>)',
|
|
39
|
+
600: 'rgb(var(--color-secondary-600)/<alpha-value>)',
|
|
40
|
+
700: 'rgb(var(--color-secondary-700)/<alpha-value>)',
|
|
41
|
+
800: 'rgb(var(--color-secondary-800)/<alpha-value>)',
|
|
42
|
+
900: 'rgb(var(--color-secondary-900)/<alpha-value>)',
|
|
43
|
+
950: 'rgb(var(--color-secondary-950)/<alpha-value>)',
|
|
44
|
+
},
|
|
45
|
+
tertiary: {
|
|
46
|
+
50: 'rgb(var(--color-tertiary-50)/<alpha-value>)',
|
|
47
|
+
100: 'rgb(var(--color-tertiary-100)/<alpha-value>)',
|
|
48
|
+
200: 'rgb(var(--color-tertiary-200)/<alpha-value>)',
|
|
49
|
+
300: 'rgb(var(--color-tertiary-300)/<alpha-value>)',
|
|
50
|
+
400: 'rgb(var(--color-tertiary-400)/<alpha-value>)',
|
|
51
|
+
500: 'rgb(var(--color-tertiary-500)/<alpha-value>)',
|
|
52
|
+
600: 'rgb(var(--color-tertiary-600)/<alpha-value>)',
|
|
53
|
+
700: 'rgb(var(--color-tertiary-700)/<alpha-value>)',
|
|
54
|
+
800: 'rgb(var(--color-tertiary-800)/<alpha-value>)',
|
|
55
|
+
900: 'rgb(var(--color-tertiary-900)/<alpha-value>)',
|
|
56
|
+
950: 'rgb(var(--color-tertiary-950)/<alpha-value>)',
|
|
57
|
+
},
|
|
58
|
+
error: {
|
|
59
|
+
0: 'rgb(var(--color-error-0)/<alpha-value>)',
|
|
60
|
+
50: 'rgb(var(--color-error-50)/<alpha-value>)',
|
|
61
|
+
100: 'rgb(var(--color-error-100)/<alpha-value>)',
|
|
62
|
+
200: 'rgb(var(--color-error-200)/<alpha-value>)',
|
|
63
|
+
300: 'rgb(var(--color-error-300)/<alpha-value>)',
|
|
64
|
+
400: 'rgb(var(--color-error-400)/<alpha-value>)',
|
|
65
|
+
500: 'rgb(var(--color-error-500)/<alpha-value>)',
|
|
66
|
+
600: 'rgb(var(--color-error-600)/<alpha-value>)',
|
|
67
|
+
700: 'rgb(var(--color-error-700)/<alpha-value>)',
|
|
68
|
+
800: 'rgb(var(--color-error-800)/<alpha-value>)',
|
|
69
|
+
900: 'rgb(var(--color-error-900)/<alpha-value>)',
|
|
70
|
+
950: 'rgb(var(--color-error-950)/<alpha-value>)',
|
|
71
|
+
},
|
|
72
|
+
success: {
|
|
73
|
+
0: 'rgb(var(--color-success-0)/<alpha-value>)',
|
|
74
|
+
50: 'rgb(var(--color-success-50)/<alpha-value>)',
|
|
75
|
+
100: 'rgb(var(--color-success-100)/<alpha-value>)',
|
|
76
|
+
200: 'rgb(var(--color-success-200)/<alpha-value>)',
|
|
77
|
+
300: 'rgb(var(--color-success-300)/<alpha-value>)',
|
|
78
|
+
400: 'rgb(var(--color-success-400)/<alpha-value>)',
|
|
79
|
+
500: 'rgb(var(--color-success-500)/<alpha-value>)',
|
|
80
|
+
600: 'rgb(var(--color-success-600)/<alpha-value>)',
|
|
81
|
+
700: 'rgb(var(--color-success-700)/<alpha-value>)',
|
|
82
|
+
800: 'rgb(var(--color-success-800)/<alpha-value>)',
|
|
83
|
+
900: 'rgb(var(--color-success-900)/<alpha-value>)',
|
|
84
|
+
950: 'rgb(var(--color-success-950)/<alpha-value>)',
|
|
85
|
+
},
|
|
86
|
+
warning: {
|
|
87
|
+
0: 'rgb(var(--color-warning-0)/<alpha-value>)',
|
|
88
|
+
50: 'rgb(var(--color-warning-50)/<alpha-value>)',
|
|
89
|
+
100: 'rgb(var(--color-warning-100)/<alpha-value>)',
|
|
90
|
+
200: 'rgb(var(--color-warning-200)/<alpha-value>)',
|
|
91
|
+
300: 'rgb(var(--color-warning-300)/<alpha-value>)',
|
|
92
|
+
400: 'rgb(var(--color-warning-400)/<alpha-value>)',
|
|
93
|
+
500: 'rgb(var(--color-warning-500)/<alpha-value>)',
|
|
94
|
+
600: 'rgb(var(--color-warning-600)/<alpha-value>)',
|
|
95
|
+
700: 'rgb(var(--color-warning-700)/<alpha-value>)',
|
|
96
|
+
800: 'rgb(var(--color-warning-800)/<alpha-value>)',
|
|
97
|
+
900: 'rgb(var(--color-warning-900)/<alpha-value>)',
|
|
98
|
+
950: 'rgb(var(--color-warning-950)/<alpha-value>)',
|
|
99
|
+
},
|
|
100
|
+
info: {
|
|
101
|
+
0: 'rgb(var(--color-info-0)/<alpha-value>)',
|
|
102
|
+
50: 'rgb(var(--color-info-50)/<alpha-value>)',
|
|
103
|
+
100: 'rgb(var(--color-info-100)/<alpha-value>)',
|
|
104
|
+
200: 'rgb(var(--color-info-200)/<alpha-value>)',
|
|
105
|
+
300: 'rgb(var(--color-info-300)/<alpha-value>)',
|
|
106
|
+
400: 'rgb(var(--color-info-400)/<alpha-value>)',
|
|
107
|
+
500: 'rgb(var(--color-info-500)/<alpha-value>)',
|
|
108
|
+
600: 'rgb(var(--color-info-600)/<alpha-value>)',
|
|
109
|
+
700: 'rgb(var(--color-info-700)/<alpha-value>)',
|
|
110
|
+
800: 'rgb(var(--color-info-800)/<alpha-value>)',
|
|
111
|
+
900: 'rgb(var(--color-info-900)/<alpha-value>)',
|
|
112
|
+
950: 'rgb(var(--color-info-950)/<alpha-value>)',
|
|
113
|
+
},
|
|
114
|
+
typography: {
|
|
115
|
+
0: 'rgb(var(--color-typography-0)/<alpha-value>)',
|
|
116
|
+
50: 'rgb(var(--color-typography-50)/<alpha-value>)',
|
|
117
|
+
100: 'rgb(var(--color-typography-100)/<alpha-value>)',
|
|
118
|
+
200: 'rgb(var(--color-typography-200)/<alpha-value>)',
|
|
119
|
+
300: 'rgb(var(--color-typography-300)/<alpha-value>)',
|
|
120
|
+
400: 'rgb(var(--color-typography-400)/<alpha-value>)',
|
|
121
|
+
500: 'rgb(var(--color-typography-500)/<alpha-value>)',
|
|
122
|
+
600: 'rgb(var(--color-typography-600)/<alpha-value>)',
|
|
123
|
+
700: 'rgb(var(--color-typography-700)/<alpha-value>)',
|
|
124
|
+
800: 'rgb(var(--color-typography-800)/<alpha-value>)',
|
|
125
|
+
900: 'rgb(var(--color-typography-900)/<alpha-value>)',
|
|
126
|
+
950: 'rgb(var(--color-typography-950)/<alpha-value>)',
|
|
127
|
+
white: '#FFFFFF',
|
|
128
|
+
gray: '#D4D4D4',
|
|
129
|
+
black: '#181718',
|
|
130
|
+
},
|
|
131
|
+
outline: {
|
|
132
|
+
0: 'rgb(var(--color-outline-0)/<alpha-value>)',
|
|
133
|
+
50: 'rgb(var(--color-outline-50)/<alpha-value>)',
|
|
134
|
+
100: 'rgb(var(--color-outline-100)/<alpha-value>)',
|
|
135
|
+
200: 'rgb(var(--color-outline-200)/<alpha-value>)',
|
|
136
|
+
300: 'rgb(var(--color-outline-300)/<alpha-value>)',
|
|
137
|
+
400: 'rgb(var(--color-outline-400)/<alpha-value>)',
|
|
138
|
+
500: 'rgb(var(--color-outline-500)/<alpha-value>)',
|
|
139
|
+
600: 'rgb(var(--color-outline-600)/<alpha-value>)',
|
|
140
|
+
700: 'rgb(var(--color-outline-700)/<alpha-value>)',
|
|
141
|
+
800: 'rgb(var(--color-outline-800)/<alpha-value>)',
|
|
142
|
+
900: 'rgb(var(--color-outline-900)/<alpha-value>)',
|
|
143
|
+
950: 'rgb(var(--color-outline-950)/<alpha-value>)',
|
|
144
|
+
},
|
|
145
|
+
background: {
|
|
146
|
+
0: 'rgb(var(--color-background-0)/<alpha-value>)',
|
|
147
|
+
50: 'rgb(var(--color-background-50)/<alpha-value>)',
|
|
148
|
+
100: 'rgb(var(--color-background-100)/<alpha-value>)',
|
|
149
|
+
200: 'rgb(var(--color-background-200)/<alpha-value>)',
|
|
150
|
+
300: 'rgb(var(--color-background-300)/<alpha-value>)',
|
|
151
|
+
400: 'rgb(var(--color-background-400)/<alpha-value>)',
|
|
152
|
+
500: 'rgb(var(--color-background-500)/<alpha-value>)',
|
|
153
|
+
600: 'rgb(var(--color-background-600)/<alpha-value>)',
|
|
154
|
+
700: 'rgb(var(--color-background-700)/<alpha-value>)',
|
|
155
|
+
800: 'rgb(var(--color-background-800)/<alpha-value>)',
|
|
156
|
+
900: 'rgb(var(--color-background-900)/<alpha-value>)',
|
|
157
|
+
950: 'rgb(var(--color-background-950)/<alpha-value>)',
|
|
158
|
+
error: 'rgb(var(--color-background-error)/<alpha-value>)',
|
|
159
|
+
warning: 'rgb(var(--color-background-warning)/<alpha-value>)',
|
|
160
|
+
muted: 'rgb(var(--color-background-muted)/<alpha-value>)',
|
|
161
|
+
success: 'rgb(var(--color-background-success)/<alpha-value>)',
|
|
162
|
+
info: 'rgb(var(--color-background-info)/<alpha-value>)',
|
|
163
|
+
light: '#FBFBFB',
|
|
164
|
+
dark: '#181719',
|
|
165
|
+
},
|
|
166
|
+
indicator: {
|
|
167
|
+
primary: 'rgb(var(--color-indicator-primary)/<alpha-value>)',
|
|
168
|
+
info: 'rgb(var(--color-indicator-info)/<alpha-value>)',
|
|
169
|
+
error: 'rgb(var(--color-indicator-error)/<alpha-value>)',
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
fontFamily: {
|
|
173
|
+
heading: undefined,
|
|
174
|
+
body: undefined,
|
|
175
|
+
mono: undefined,
|
|
176
|
+
roboto: ['Roboto', 'sans-serif'],
|
|
177
|
+
},
|
|
178
|
+
fontWeight: {
|
|
179
|
+
extrablack: '950',
|
|
180
|
+
},
|
|
181
|
+
fontSize: {
|
|
182
|
+
'2xs': '10px',
|
|
183
|
+
},
|
|
184
|
+
boxShadow: {
|
|
185
|
+
'hard-1': '-2px 2px 8px 0px rgba(38, 38, 38, 0.20)',
|
|
186
|
+
'hard-2': '0px 3px 10px 0px rgba(38, 38, 38, 0.20)',
|
|
187
|
+
'hard-3': '2px 2px 8px 0px rgba(38, 38, 38, 0.20)',
|
|
188
|
+
'hard-4': '0px -3px 10px 0px rgba(38, 38, 38, 0.20)',
|
|
189
|
+
'hard-5': '0px 2px 10px 0px rgba(38, 38, 38, 0.10)',
|
|
190
|
+
'soft-1': '0px 0px 10px rgba(38, 38, 38, 0.1)',
|
|
191
|
+
'soft-2': '0px 0px 20px rgba(38, 38, 38, 0.2)',
|
|
192
|
+
'soft-3': '0px 0px 30px rgba(38, 38, 38, 0.1)',
|
|
193
|
+
'soft-4': '0px 0px 40px rgba(38, 38, 38, 0.1)',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
plugins: [gluestackPlugin],
|
|
198
|
+
};
|
package/babel.config.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
compact: false,
|
|
3
|
-
presets: [
|
|
4
|
-
"module:metro-react-native-babel-preset",
|
|
5
|
-
'@babel/preset-typescript',
|
|
6
|
-
'@babel/preset-react',
|
|
7
|
-
['@babel/preset-env', { modules: 'commonjs', loose: true }],
|
|
8
|
-
],
|
|
9
|
-
plugins: [
|
|
10
|
-
'@babel/plugin-transform-modules-commonjs',
|
|
11
|
-
'@babel/plugin-transform-destructuring',
|
|
12
|
-
'@babel/plugin-transform-for-of',
|
|
13
|
-
'@babel/plugin-transform-regenerator',
|
|
14
|
-
'@babel/plugin-transform-runtime',
|
|
15
|
-
'@babel/plugin-syntax-dynamic-import',
|
|
16
|
-
'@babel/plugin-transform-flow-strip-types',
|
|
17
|
-
'@babel/plugin-proposal-class-properties',
|
|
18
|
-
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
19
|
-
'@babel/plugin-proposal-object-rest-spread',
|
|
20
|
-
],
|
|
21
|
-
env: {
|
|
22
|
-
production: {
|
|
23
|
-
compact: true,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|