atlas-design-system 1.2.0

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.
Files changed (98) hide show
  1. package/.eslintrc.js +33 -0
  2. package/README.md +5 -0
  3. package/example/README.md +50 -0
  4. package/example/app/_layout.tsx +32 -0
  5. package/example/app/buttonGallery.tsx +49 -0
  6. package/example/app/dateTimeInputGallery.tsx +28 -0
  7. package/example/app/index.tsx +58 -0
  8. package/example/app/selectInputGallery.tsx +45 -0
  9. package/example/app/sheetGallery.tsx +36 -0
  10. package/example/app/switchToggleInputGallery.tsx +28 -0
  11. package/example/app/textGallery.tsx +68 -0
  12. package/example/app/textInputGallery.tsx +28 -0
  13. package/example/app.json +37 -0
  14. package/example/assets/fonts/SpaceMono-Regular.ttf +0 -0
  15. package/example/assets/images/adaptive-icon.png +0 -0
  16. package/example/assets/images/favicon.png +0 -0
  17. package/example/assets/images/icon.png +0 -0
  18. package/example/assets/images/partial-react-logo.png +0 -0
  19. package/example/assets/images/react-logo.png +0 -0
  20. package/example/assets/images/react-logo@2x.png +0 -0
  21. package/example/assets/images/react-logo@3x.png +0 -0
  22. package/example/assets/images/splash.png +0 -0
  23. package/example/babel.config.js +6 -0
  24. package/example/components/Collapsible.tsx +41 -0
  25. package/example/components/ExternalLink.tsx +24 -0
  26. package/example/components/ParallaxScrollView.tsx +76 -0
  27. package/example/components/ThemedText.tsx +60 -0
  28. package/example/components/ThemedView.tsx +14 -0
  29. package/example/components/__tests__/ThemedText-test.tsx +10 -0
  30. package/example/components/__tests__/__snapshots__/ThemedText-test.tsx.snap +24 -0
  31. package/example/components/navigation/TabBarIcon.js +24 -0
  32. package/example/components/navigation/TabBarIcon.tsx +9 -0
  33. package/example/constants/Colors.ts +26 -0
  34. package/example/hooks/useColorScheme.ts +1 -0
  35. package/example/hooks/useThemeColor.ts +22 -0
  36. package/example/ios/.xcode.env +11 -0
  37. package/example/ios/Podfile +58 -0
  38. package/example/ios/Podfile.lock +1603 -0
  39. package/example/ios/Podfile.properties.json +4 -0
  40. package/example/ios/example/AppDelegate.h +7 -0
  41. package/example/ios/example/AppDelegate.mm +62 -0
  42. package/example/ios/example/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
  43. package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
  44. package/example/ios/example/Images.xcassets/Contents.json +6 -0
  45. package/example/ios/example/Images.xcassets/SplashScreen.imageset/Contents.json +21 -0
  46. package/example/ios/example/Images.xcassets/SplashScreen.imageset/image.png +0 -0
  47. package/example/ios/example/Images.xcassets/SplashScreenBackground.imageset/Contents.json +21 -0
  48. package/example/ios/example/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  49. package/example/ios/example/Info.plist +81 -0
  50. package/example/ios/example/PrivacyInfo.xcprivacy +48 -0
  51. package/example/ios/example/SplashScreen.storyboard +51 -0
  52. package/example/ios/example/Supporting/Expo.plist +12 -0
  53. package/example/ios/example/example-Bridging-Header.h +3 -0
  54. package/example/ios/example/example.entitlements +5 -0
  55. package/example/ios/example/main.m +10 -0
  56. package/example/ios/example/noop-file.swift +4 -0
  57. package/example/ios/example.xcodeproj/project.pbxproj +555 -0
  58. package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -0
  59. package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -0
  60. package/example/metro.config.js +34 -0
  61. package/example/package.json +53 -0
  62. package/example/react-native.config.js +9 -0
  63. package/example/scripts/reset-project.js +73 -0
  64. package/example/tsconfig.json +17 -0
  65. package/example/yarn.lock +8571 -0
  66. package/package.json +49 -0
  67. package/src/components/Button/Button.tsx +110 -0
  68. package/src/components/Button/index.ts +2 -0
  69. package/src/components/Button/styles/ButtonStyle.ts +47 -0
  70. package/src/components/DateTimeInput/index.tsx +172 -0
  71. package/src/components/DragHandle/index.tsx +49 -0
  72. package/src/components/MenuItemDescription/MenuItemDescription.tsx +34 -0
  73. package/src/components/MenuItemDescription/index.ts +1 -0
  74. package/src/components/NavigationListRow/index.tsx +68 -0
  75. package/src/components/SelectInput/SelectInput.tsx +191 -0
  76. package/src/components/SelectInput/index.ts +2 -0
  77. package/src/components/SelectInput/types.ts +5 -0
  78. package/src/components/Sheet/index.tsx +189 -0
  79. package/src/components/SwitchToggle/index.tsx +31 -0
  80. package/src/components/Text/Text.tsx +74 -0
  81. package/src/components/Text/index.tsx +2 -0
  82. package/src/components/TextInput/TextInput.tsx +241 -0
  83. package/src/components/TextInput/index.tsx +2 -0
  84. package/src/components/TitleBar/TitleBar.tsx +150 -0
  85. package/src/components/TitleBar/index.ts +2 -0
  86. package/src/components/index.ts +11 -0
  87. package/src/context/index.ts +6 -0
  88. package/src/hooks/index.ts +2 -0
  89. package/src/hooks/useTheme.ts +7 -0
  90. package/src/hooks/useThemedStyle.ts +18 -0
  91. package/src/index.ts +5 -0
  92. package/src/shared/styles/index.ts +33 -0
  93. package/src/themes/AtlasLightTheme.ts +90 -0
  94. package/src/themes/index.ts +1 -0
  95. package/src/types/index.ts +3 -0
  96. package/src/types/theme.ts +45 -0
  97. package/src/types/typography.ts +14 -0
  98. package/tsconfig.json +111 -0
@@ -0,0 +1,60 @@
1
+ import { Text, type TextProps, StyleSheet } from 'react-native';
2
+
3
+ import { useThemeColor } from '@/hooks/useThemeColor';
4
+
5
+ export type ThemedTextProps = TextProps & {
6
+ lightColor?: string;
7
+ darkColor?: string;
8
+ type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link';
9
+ };
10
+
11
+ export function ThemedText({
12
+ style,
13
+ lightColor,
14
+ darkColor,
15
+ type = 'default',
16
+ ...rest
17
+ }: ThemedTextProps) {
18
+ const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text');
19
+
20
+ return (
21
+ <Text
22
+ style={[
23
+ { color },
24
+ type === 'default' ? styles.default : undefined,
25
+ type === 'title' ? styles.title : undefined,
26
+ type === 'defaultSemiBold' ? styles.defaultSemiBold : undefined,
27
+ type === 'subtitle' ? styles.subtitle : undefined,
28
+ type === 'link' ? styles.link : undefined,
29
+ style,
30
+ ]}
31
+ {...rest}
32
+ />
33
+ );
34
+ }
35
+
36
+ const styles = StyleSheet.create({
37
+ default: {
38
+ fontSize: 16,
39
+ lineHeight: 24,
40
+ },
41
+ defaultSemiBold: {
42
+ fontSize: 16,
43
+ lineHeight: 24,
44
+ fontWeight: '600',
45
+ },
46
+ title: {
47
+ fontSize: 32,
48
+ fontWeight: 'bold',
49
+ lineHeight: 32,
50
+ },
51
+ subtitle: {
52
+ fontSize: 20,
53
+ fontWeight: 'bold',
54
+ },
55
+ link: {
56
+ lineHeight: 30,
57
+ fontSize: 16,
58
+ color: '#0a7ea4',
59
+ },
60
+ });
@@ -0,0 +1,14 @@
1
+ import { View, type ViewProps } from 'react-native';
2
+
3
+ import { useThemeColor } from '@/hooks/useThemeColor';
4
+
5
+ export type ThemedViewProps = ViewProps & {
6
+ lightColor?: string;
7
+ darkColor?: string;
8
+ };
9
+
10
+ export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
11
+ const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
12
+
13
+ return <View style={[{ backgroundColor }, style]} {...otherProps} />;
14
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+
4
+ import { ThemedText } from '../ThemedText';
5
+
6
+ it(`renders correctly`, () => {
7
+ const tree = renderer.create(<ThemedText>Snapshot test!</ThemedText>).toJSON();
8
+
9
+ expect(tree).toMatchSnapshot();
10
+ });
@@ -0,0 +1,24 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders correctly 1`] = `
4
+ <Text
5
+ style={
6
+ [
7
+ {
8
+ "color": "#11181C",
9
+ },
10
+ {
11
+ "fontSize": 16,
12
+ "lineHeight": 24,
13
+ },
14
+ undefined,
15
+ undefined,
16
+ undefined,
17
+ undefined,
18
+ undefined,
19
+ ]
20
+ }
21
+ >
22
+ Snapshot test!
23
+ </Text>
24
+ `;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
3
+ var __rest = (this && this.__rest) || function (s, e) {
4
+ var t = {};
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6
+ t[p] = s[p];
7
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
8
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
10
+ t[p[i]] = s[p[i]];
11
+ }
12
+ return t;
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TabBarIcon = void 0;
19
+ var Ionicons_1 = __importDefault(require("@expo/vector-icons/Ionicons"));
20
+ function TabBarIcon(_a) {
21
+ var style = _a.style, rest = __rest(_a, ["style"]);
22
+ return <Ionicons_1.default size={28} style={[{ marginBottom: -3 }, style]} {...rest}/>;
23
+ }
24
+ exports.TabBarIcon = TabBarIcon;
@@ -0,0 +1,9 @@
1
+ // You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
2
+
3
+ import Ionicons from '@expo/vector-icons/Ionicons';
4
+ import { type IconProps } from '@expo/vector-icons/build/createIconSet';
5
+ import { type ComponentProps } from 'react';
6
+
7
+ export function TabBarIcon({ style, ...rest }: IconProps<ComponentProps<typeof Ionicons>['name']>) {
8
+ return <Ionicons size={28} style={[{ marginBottom: -3 }, style]} {...rest} />;
9
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3
+ * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
4
+ */
5
+
6
+ const tintColorLight = '#0a7ea4';
7
+ const tintColorDark = '#fff';
8
+
9
+ export const Colors = {
10
+ light: {
11
+ text: '#11181C',
12
+ background: '#fff',
13
+ tint: tintColorLight,
14
+ icon: '#687076',
15
+ tabIconDefault: '#687076',
16
+ tabIconSelected: tintColorLight,
17
+ },
18
+ dark: {
19
+ text: '#ECEDEE',
20
+ background: '#151718',
21
+ tint: tintColorDark,
22
+ icon: '#9BA1A6',
23
+ tabIconDefault: '#9BA1A6',
24
+ tabIconSelected: tintColorDark,
25
+ },
26
+ };
@@ -0,0 +1 @@
1
+ export { useColorScheme } from 'react-native';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Learn more about light and dark modes:
3
+ * https://docs.expo.dev/guides/color-schemes/
4
+ */
5
+
6
+ import { useColorScheme } from 'react-native';
7
+
8
+ import { Colors } from '@/constants/Colors';
9
+
10
+ export function useThemeColor(
11
+ props: { light?: string; dark?: string },
12
+ colorName: keyof typeof Colors.light & keyof typeof Colors.dark
13
+ ) {
14
+ const theme = useColorScheme() ?? 'light';
15
+ const colorFromProps = props[theme];
16
+
17
+ if (colorFromProps) {
18
+ return colorFromProps;
19
+ } else {
20
+ return Colors[theme][colorName];
21
+ }
22
+ }
@@ -0,0 +1,11 @@
1
+ # This `.xcode.env` file is versioned and is used to source the environment
2
+ # used when running script phases inside Xcode.
3
+ # To customize your local environment, you can create an `.xcode.env.local`
4
+ # file that is not versioned.
5
+
6
+ # NODE_BINARY variable contains the PATH to the node executable.
7
+ #
8
+ # Customize the NODE_BINARY variable here.
9
+ # For example, to use nvm with brew, add the following line
10
+ # . "$(brew --prefix nvm)/nvm.sh" --no-use
11
+ export NODE_BINARY=$(command -v node)
@@ -0,0 +1,58 @@
1
+ require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
2
+ require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
3
+
4
+ require 'json'
5
+ podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
6
+
7
+ ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
8
+ ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
9
+
10
+ platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
11
+ install! 'cocoapods',
12
+ :deterministic_uuids => false
13
+
14
+ prepare_react_native_project!
15
+
16
+ target 'example' do
17
+ use_expo_modules!
18
+ config = use_native_modules!
19
+
20
+ use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
21
+ use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
22
+
23
+ use_react_native!(
24
+ :path => config[:reactNativePath],
25
+ :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
26
+ # An absolute path to your application root.
27
+ :app_path => "#{Pod::Config.instance.installation_root}/..",
28
+ :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
29
+ )
30
+
31
+ post_install do |installer|
32
+ react_native_post_install(
33
+ installer,
34
+ config[:reactNativePath],
35
+ :mac_catalyst_enabled => false,
36
+ :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
37
+ )
38
+
39
+ # This is necessary for Xcode 14, because it signs resource bundles by default
40
+ # when building for devices.
41
+ installer.target_installation_results.pod_target_installation_results
42
+ .each do |pod_name, target_installation_result|
43
+ target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
44
+ resource_bundle_target.build_configurations.each do |config|
45
+ config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ post_integrate do |installer|
52
+ begin
53
+ expo_patch_react_imports!(installer)
54
+ rescue => e
55
+ Pod::UI.warn e
56
+ end
57
+ end
58
+ end