Skip to content

Commit d3ade66

Browse files
authored
Merge pull request #1822 from gluestack/patch
Patch
2 parents c6cbd01 + f86ada7 commit d3ade66

File tree

644 files changed

+81653
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

644 files changed

+81653
-40
lines changed

.vscode/settings.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"prettier.ignorePath": ".prettierignore",
1818
// If true, puts the `>` of a multi-line jsx element at the end of the last line instead of being alone on the next line
1919
"editor.wordWrap": "on",
20-
"cSpell.words": ["gluestack", "themeable"],
21-
"cSpell.enableFiletypes": ["mdx"]
20+
"cSpell.words": ["Actionsheet", "gluestack", "nativewind", "themeable"],
21+
"cSpell.enableFiletypes": ["mdx"],
22+
"tailwindCSS.experimental.classRegex": [
23+
["tva\\((([^()]*|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
24+
],
25+
"cmake.sourceDirectory": "/Users/vidhikataria/Documents/Projects/gluestack-ui/gluestack-ui/node_modules/expo/node_modules/expo-modules-core/android"
2226
}

example/expo-router-example/app/_layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default function RootLayout() {
4444
if (!loaded) {
4545
return null;
4646
}
47-
4847
return <RootLayoutNav />;
4948
}
5049

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3+
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
node_modules/
2+
.env
3+
.expo/
4+
dist/
5+
npm-debug.*
6+
*.jks
7+
*.p8
8+
*.p12
9+
*.key
10+
*.mobileprovision
11+
*.orig.*
12+
web-build/
13+
lib
14+
15+
# macOS
16+
.DS_Store
17+
18+
#build
19+
storybook-static/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Dotfiles
2+
.babelrc
3+
.eslintignore
4+
.eslintrc.json
5+
.gitattributes
6+
_config.yml
7+
.editorconfig
8+
9+
# Documents
10+
CONTRIBUTING.md
11+
ISSUE_TEMPLATE.txt
12+
img
13+
14+
# Test cases
15+
__tests__
16+
dist/__tests__
17+
18+
# Example
19+
storybook-static/

example/storybook-nativewind/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { getStorybookUI } from '@storybook/react-native';
2+
import './doctools';
3+
import './storybook.requires';
4+
5+
const StorybookUIRoot = getStorybookUI({});
6+
export default StorybookUIRoot;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { extractArgTypes } from '@storybook/react/dist/modern/client/docs/extractArgTypes';
2+
import { addArgTypesEnhancer, addParameters } from '@storybook/react-native';
3+
import { enhanceArgTypes } from '@storybook/docs-tools';
4+
5+
addArgTypesEnhancer(enhanceArgTypes);
6+
addParameters({
7+
docs: {
8+
extractArgTypes,
9+
},
10+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
stories: ['../components/primitives/Button/*.stories.?(ts|tsx|js|jsx)'],
3+
addons: [
4+
'@storybook/addon-ondevice-notes',
5+
'@storybook/addon-ondevice-controls',
6+
'@storybook/addon-ondevice-backgrounds',
7+
'@storybook/addon-ondevice-actions',
8+
],
9+
};
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
2+
import { addParameters } from '@storybook/client-api';
3+
import { GluestackUIProvider, Box, VStack } from '@custom-ui/themed';
4+
import { config } from '@custom-ui/config';
5+
6+
import { useState } from 'react';
7+
8+
export const parameters = {
9+
backgrounds: {
10+
default: 'plain',
11+
values: [
12+
{ name: 'plain', value: 'white' },
13+
{ name: 'warm', value: 'hotpink' },
14+
{ name: 'cool', value: 'deepskyblue' },
15+
],
16+
},
17+
controls: {
18+
matchers: {
19+
color: /(background|color)$/i,
20+
date: /Date$/,
21+
},
22+
},
23+
};
24+
25+
import { useDarkMode } from '../src/hooks/useDarkMode';
26+
import { Platform } from 'react-native';
27+
28+
export const decorators = [
29+
withBackgrounds,
30+
(Story) => {
31+
let value = false;
32+
33+
if (Platform.OS === 'web') {
34+
// eslint-disable-next-line react-hooks/rules-of-hooks
35+
value = useDarkMode();
36+
}
37+
const [isDark] = useState(false);
38+
39+
function getColorMode() {
40+
//@ts-ignore
41+
if (Platform.OS === 'web') {
42+
return value ? 'dark' : 'light';
43+
} else {
44+
return isDark ? 'dark' : 'light';
45+
}
46+
}
47+
return (
48+
<GluestackUIProvider config={config}>
49+
<Box flex={1} p="$10">
50+
<Story />
51+
</Box>
52+
</GluestackUIProvider>
53+
);
54+
},
55+
];
56+
57+
addParameters({
58+
docs: {
59+
container: ({ children, context }) => {
60+
let value = false;
61+
62+
if (Platform.OS === 'web') {
63+
// eslint-disable-next-line react-hooks/rules-of-hooks
64+
value = useDarkMode();
65+
}
66+
const [isDark] = useState(false);
67+
68+
function getColorMode() {
69+
//@ts-ignore
70+
if (Platform.OS === 'web') {
71+
return value ? 'dark' : 'light';
72+
} else {
73+
return isDark ? 'dark' : 'light';
74+
}
75+
}
76+
return (
77+
<DocsContainer context={context}>
78+
<GluestackUIProvider config={config} colorMode={getColorMode()}>
79+
{children}
80+
</GluestackUIProvider>
81+
</DocsContainer>
82+
);
83+
},
84+
},
85+
});

0 commit comments

Comments
 (0)