Skip to content

Commit f538bc7

Browse files
authored
Merge pull request #113 from adaptui/webapp
2 parents e90d190 + 788fcf0 commit f538bc7

30 files changed

+666
-431
lines changed

example/ios/Podfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ PODS:
1616
- ExpoModulesCore (1.0.3):
1717
- React-Core
1818
- ReactCommon/turbomodule/core
19+
- EXScreenOrientation (5.0.1):
20+
- ExpoModulesCore
21+
- React-Core
1922
- EXSplashScreen (0.17.5):
2023
- ExpoModulesCore
2124
- React-Core
@@ -375,6 +378,7 @@ DEPENDENCIES:
375378
- Expo (from `../node_modules/expo`)
376379
- ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
377380
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
381+
- EXScreenOrientation (from `../node_modules/expo-screen-orientation/ios`)
378382
- EXSplashScreen (from `../node_modules/expo-splash-screen/ios`)
379383
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
380384
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
@@ -440,6 +444,8 @@ EXTERNAL SOURCES:
440444
:path: "../node_modules/expo-keep-awake/ios"
441445
ExpoModulesCore:
442446
:path: "../node_modules/expo-modules-core"
447+
EXScreenOrientation:
448+
:path: "../node_modules/expo-screen-orientation/ios"
443449
EXSplashScreen:
444450
:path: "../node_modules/expo-splash-screen/ios"
445451
FBLazyVector:
@@ -527,6 +533,7 @@ SPEC CHECKSUMS:
527533
Expo: 36b5f625d36728adbdd1934d4d57182f319ab832
528534
ExpoKeepAwake: 69b59d0a8d2b24de9f82759c39b3821fec030318
529535
ExpoModulesCore: b5d21c8880afda6fb6ee95469f9ac2ec9b98e995
536+
EXScreenOrientation: 07e5aeff07bce09a2b214981e612d87fd7719997
530537
EXSplashScreen: 3e989924f61a8dd07ee4ea584c6ba14be9b51949
531538
FBLazyVector: affa4ba1bfdaac110a789192f4d452b053a86624
532539
FBReactNativeSpec: fe8b5f1429cfe83a8d72dc8ed61dc7704cac8745

example/metro.config.js

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,38 @@ const path = require("path");
22
const exclusionList = require("metro-config/src/defaults/exclusionList");
33
const escape = require("escape-string-regexp");
44
const pak = require("../package.json");
5-
const { getDefaultConfig } = require("@expo/metro-config");
65

76
const root = path.resolve(__dirname, "..");
87

98
const modules = Object.keys({
109
...pak.peerDependencies,
1110
});
1211

13-
module.exports = (async () => {
14-
const config = await getDefaultConfig(__dirname);
15-
const { transformer, resolver } = config;
12+
module.exports = {
13+
projectRoot: __dirname,
14+
watchFolders: [root],
1615

17-
(config.projectRoot = __dirname),
18-
(config.watchFolders = [root]),
19-
// We need to make sure that only one version is loaded for peerDependencies
20-
// So we blacklist them at the root, and alias them to the versions in example's node_modules
21-
(config.resolver = {
22-
...resolver,
23-
blacklistRE: exclusionList(
24-
modules.map(
25-
m =>
26-
new RegExp(`^${escape(path.join(root, "node_modules", m))}\\/.*$`),
27-
),
16+
// We need to make sure that only one version is loaded for peerDependencies
17+
// So we blacklist them at the root, and alias them to the versions in example's node_modules
18+
resolver: {
19+
blacklistRE: exclusionList(
20+
modules.map(
21+
m => new RegExp(`^${escape(path.join(root, "node_modules", m))}\\/.*$`),
2822
),
23+
),
2924

30-
extraNodeModules: modules.reduce((acc, name) => {
31-
acc[name] = path.join(__dirname, "node_modules", name);
32-
return acc;
33-
}, {}),
25+
extraNodeModules: modules.reduce((acc, name) => {
26+
acc[name] = path.join(__dirname, "node_modules", name);
27+
return acc;
28+
}, {}),
29+
},
30+
31+
transformer: {
32+
getTransformOptions: async () => ({
33+
transform: {
34+
experimentalImportSupport: false,
35+
inlineRequires: true,
36+
},
3437
}),
35-
(config.transformer = {
36-
...transformer,
37-
getTransformOptions: async () => ({
38-
transform: {
39-
experimentalImportSupport: false,
40-
inlineRequires: true,
41-
},
42-
}),
43-
});
44-
return config;
45-
})();
38+
},
39+
};

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@react-navigation/drawer": "^6.5.3",
1515
"@react-navigation/native": "^6.0.16",
1616
"expo": "^47.0.0",
17+
"expo-screen-orientation": "^5.0.1",
1718
"expo-splash-screen": "~0.17.5",
1819
"expo-status-bar": "~1.4.2",
1920
"react": "18.1.0",
@@ -26,6 +27,7 @@
2627
"react-native-screens": "~3.18.0",
2728
"react-native-svg": "13.4.0",
2829
"react-native-web": "~0.18.9",
30+
"sharp-cli": "^4.1.0",
2931
"twrnc": "3.4.1"
3032
},
3133
"devDependencies": {

example/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
55
import { AdaptUIProvider, Box } from "@adaptui/react-native-tailwind";
66
import { NavigationContainer } from "@react-navigation/native";
77
import { useFonts } from "expo-font";
8+
import * as ScreenOrientation from "expo-screen-orientation";
89
import * as SplashScreen from "expo-splash-screen";
910
import tailwind from "twrnc";
1011

1112
import AppRoot from "./AppRoot";
1213

14+
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
1315
LogBox.ignoreAllLogs();
1416

1517
const AdaptUIApp = () => {

example/src/modules/feedback/CircularProgressScreen.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,32 @@ export const CircularProgressScreen = () => {
7474
}px]`,
7575
)}
7676
>
77-
<RadioGroup
78-
value={selectedSize}
79-
onChange={(value: string) =>
80-
setSelectedSize(value as CircularProgressSizes)
81-
}
82-
orientation="horizontal"
83-
>
84-
<Group label="Sizes">
77+
<Group label="Sizes">
78+
<RadioGroup
79+
value={selectedSize}
80+
onChange={(value: string) =>
81+
setSelectedSize(value as CircularProgressSizes)
82+
}
83+
orientation="horizontal"
84+
>
8585
<Radio value="sm" label="sm" />
8686
<Radio value="md" label="md" />
8787
<Radio value="lg" label="lg" />
8888
<Radio value="xl" label="xl" />
89-
</Group>
90-
</RadioGroup>
91-
<RadioGroup
92-
value={selectedTheme}
93-
onChange={(value: string) =>
94-
setSelectedTheme(value as CircularProgressTheme)
95-
}
96-
orientation="horizontal"
97-
>
98-
<Group label="Theme" style={tailwind.style("mt-2")}>
89+
</RadioGroup>
90+
</Group>
91+
<Group label="Theme" style={tailwind.style("mt-2")}>
92+
<RadioGroup
93+
value={selectedTheme}
94+
onChange={(value: string) =>
95+
setSelectedTheme(value as CircularProgressTheme)
96+
}
97+
orientation="horizontal"
98+
>
9999
<Radio value="base" label="base" />
100100
<Radio value="primary" label="primary" />
101-
</Group>
102-
</RadioGroup>
101+
</RadioGroup>
102+
</Group>
103103
<Box
104104
style={tailwind.style("flex flex-row justify-start flex-wrap w-full")}
105105
>

example/src/modules/feedback/MeterComponentScreen.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,28 @@ export const MeterComponentScreen = () => {
4848
}px]`,
4949
)}
5050
>
51-
<RadioGroup
52-
value={selectedSize}
53-
onChange={(value: string) => setSelectedSize(value as MeterSizes)}
54-
orientation="horizontal"
55-
>
56-
<Group label="Sizes">
51+
<Group label="Sizes">
52+
<RadioGroup
53+
value={selectedSize}
54+
onChange={(value: string) => setSelectedSize(value as MeterSizes)}
55+
orientation="horizontal"
56+
>
5757
<Radio value="sm" label="sm" />
5858
<Radio value="md" label="md" />
5959
<Radio value="lg" label="lg" />
60-
</Group>
61-
</RadioGroup>
62-
<RadioGroup
63-
value={selectedTheme}
64-
onChange={(value: string) => setSelectedTheme(value as MeterTheme)}
65-
orientation="horizontal"
66-
>
67-
<Group label="Theme" style={tailwind.style("mt-2")}>
60+
</RadioGroup>
61+
</Group>
62+
<Group label="Theme" style={tailwind.style("mt-2")}>
63+
<RadioGroup
64+
value={selectedTheme}
65+
onChange={(value: string) => setSelectedTheme(value as MeterTheme)}
66+
orientation="horizontal"
67+
>
6868
<Radio value="base" label="base" />
6969
<Radio value="primary" label="primary" />
7070
<Radio value="success" label="success" />
71-
</Group>
72-
</RadioGroup>
71+
</RadioGroup>
72+
</Group>
7373
<Box
7474
style={tailwind.style("flex flex-row justify-start flex-wrap w-full")}
7575
>

example/src/modules/feedback/ProgressScreen.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,31 @@ export const ProgressScreen = () => {
7979
}px]`,
8080
)}
8181
>
82-
<RadioGroup
83-
value={selectedSize}
84-
onChange={(value: string) =>
85-
setSelectedSize(value as ProgressBarSizes)
86-
}
87-
orientation="horizontal"
88-
>
89-
<Group label="Sizes">
82+
<Group label="Sizes">
83+
<RadioGroup
84+
value={selectedSize}
85+
onChange={(value: string) =>
86+
setSelectedSize(value as ProgressBarSizes)
87+
}
88+
orientation="horizontal"
89+
>
9090
<Radio value="sm" label="sm" />
9191
<Radio value="md" label="md" />
9292
<Radio value="lg" label="lg" />
93-
</Group>
94-
</RadioGroup>
95-
<RadioGroup
96-
value={selectedTheme}
97-
onChange={(value: string) =>
98-
setSelectedTheme(value as ProgressBarTheme)
99-
}
100-
orientation="horizontal"
101-
>
102-
<Group label="Theme" style={tailwind.style("mt-2")}>
93+
</RadioGroup>
94+
</Group>
95+
<Group label="Theme" style={tailwind.style("mt-2")}>
96+
<RadioGroup
97+
value={selectedTheme}
98+
onChange={(value: string) =>
99+
setSelectedTheme(value as ProgressBarTheme)
100+
}
101+
orientation="horizontal"
102+
>
103103
<Radio value="base" label="base" />
104104
<Radio value="primary" label="primary" />
105-
</Group>
106-
</RadioGroup>
105+
</RadioGroup>
106+
</Group>
107107
<Box
108108
style={tailwind.style("flex flex-row justify-start flex-wrap w-full")}
109109
>

example/src/modules/feedback/SpinnerScreen.tsx

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,47 @@ export const SpinnerScreen = () => {
4343
}px]`,
4444
)}
4545
>
46-
<RadioGroup
47-
value={selectedSize}
48-
onChange={(value: string) => setSelectedSize(value as SpinnerSizes)}
49-
orientation="horizontal"
50-
>
51-
<Group label="Sizes">
46+
<Group label="Sizes">
47+
<RadioGroup
48+
value={selectedSize}
49+
onChange={(value: string) => setSelectedSize(value as SpinnerSizes)}
50+
orientation="horizontal"
51+
>
5252
<Radio value="xs" label="xs" />
5353
<Radio value="sm" label="sm" />
5454
<Radio value="md" label="md" />
5555
<Radio value="lg" label="lg" />
5656
<Radio value="xl" label="xl" />
57-
</Group>
58-
</RadioGroup>
59-
<RadioGroup
60-
value={selectedTheme}
61-
onChange={(value: string) => setSelectedTheme(value as SpinnerTheme)}
62-
orientation="horizontal"
63-
>
64-
<Group label="Theme" style={tailwind.style("mt-2")}>
57+
</RadioGroup>
58+
</Group>
59+
<Group label="Theme" style={tailwind.style("mt-2")}>
60+
<RadioGroup
61+
value={selectedTheme}
62+
onChange={(value: string) =>
63+
setSelectedTheme(value as SpinnerTheme)
64+
}
65+
orientation="horizontal"
66+
style={tailwind.style("flex-wrap")}
67+
>
6568
<Radio value="base" label="base" />
6669
<Radio value="primary" label="primary" />
6770
<Radio value="secondary" label="secondary" />
6871
<Radio value="success" label="success" />
6972
<Radio value="danger" label="danger" />
70-
</Group>
71-
</RadioGroup>
72-
<RadioGroup
73-
value={selectedSpinnerTrackVisibility}
74-
onChange={(value: string) =>
75-
setSelectedSpinnerTrackVisibility(value as SpinnerTrackVisibility)
76-
}
77-
orientation="horizontal"
78-
>
79-
<Group label="Track" style={tailwind.style("mt-2")}>
73+
</RadioGroup>
74+
</Group>
75+
<Group label="Track" style={tailwind.style("mt-2")}>
76+
<RadioGroup
77+
value={selectedSpinnerTrackVisibility}
78+
onChange={(value: string) =>
79+
setSelectedSpinnerTrackVisibility(value as SpinnerTrackVisibility)
80+
}
81+
orientation="horizontal"
82+
>
8083
<Radio value="visible" label="visible" />
8184
<Radio value="transparent" label="transparent" />
82-
</Group>
83-
</RadioGroup>
85+
</RadioGroup>
86+
</Group>
8487
</Box>
8588
</Box>
8689
);

0 commit comments

Comments
 (0)