vueops-storybook 1.1.1

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/index.js +200 -0
  4. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Chromatic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ <p align="center">
2
+ <a href="https://www.chromatic.com/">
3
+ <img alt="Chromatic" src="https://avatars2.githubusercontent.com/u/24584319?s=200&v=4" width="60" />
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">
8
+ Chromatic's Intro to Storybook React Native template
9
+ </h1>
10
+
11
+ This template ships with the main React Native and Storybook configuration files you'll need to get up and running fast.
12
+
13
+ ## πŸš… Quick start
14
+
15
+ 1. **Create the application.**
16
+
17
+ Use [degit](https://github.com/Rich-Harris/degit) to get this template.
18
+
19
+ ```shell
20
+ # Clone the template
21
+ npx degit chromaui/intro-storybook-react-native-template#main taskbox
22
+ ```
23
+
24
+ 1. **Install the dependencies.**
25
+
26
+ Navigate into your new site’s directory and install the necessary dependencies.
27
+
28
+ ```shell
29
+ # Navigate to the directory
30
+ cd taskbox/
31
+
32
+ # Install the dependencies
33
+ yarn
34
+ ```
35
+
36
+ 1. **Open the source code and start editing!**
37
+
38
+ Open the `taskbox` directory in your code editor of choice and building your first component!
39
+
40
+ 1. **Browse your stories!**
41
+
42
+ Run `yarn storybook:ios` for ios or `yarn storybook:android` for android to see your component's stories on your emulator or device.
43
+
44
+ ## πŸ”Ž What's inside?
45
+
46
+ A quick look at the top-level files and directories included with this template.
47
+
48
+ .
49
+ β”œβ”€β”€ .gitignore
50
+ β”œβ”€β”€ LICENSE
51
+ β”œβ”€β”€ README.md
52
+ β”œβ”€β”€ App.jsx
53
+ β”œβ”€β”€ app.config.js
54
+ β”œβ”€β”€ yarn.lock
55
+ β”œβ”€β”€ package.json
56
+ β”œβ”€β”€ babel.config.js
57
+
58
+ 1. **`.gitignore`**: This file tells git which files it should not track or maintain during the development process of your project.
59
+
60
+ 2. **`LICENSE`**: The template is licensed under the MIT licence.
61
+
62
+ 3. **`README.md`**: A text file containing useful reference information about the project.
63
+
64
+ 4. **`App.jsx`**: This is the entry point of your app.
65
+
66
+ 5. **`app.config.js`**: This is the configuration file for Expo that allows you to customize your app.
67
+
68
+ 6. **`yarn.lock`**: This is an automatically generated file based on the exact versions of your npm dependencies that were installed.
69
+
70
+ ## Contribute
71
+
72
+ If you encounter an issue with the template, we encourage you to open an issue in this template's repository.
73
+
74
+ ## Learning Storybook
75
+
76
+ 1. Read our introductory tutorial at [Learn Storybook](https://storybook.js.org/tutorials/intro-to-storybook/react-native/en/get-started/).
77
+ 2. Learn how to transform your component libraries into design systems in our [Design Systems for Developers](https://storybook.js.org/tutorials/design-systems-for-developers/) tutorial.
78
+ 3. See our official documentation at [Storybook](https://storybook.js.org/).
package/dist/index.js ADDED
@@ -0,0 +1,200 @@
1
+ 'use strict';
2
+
3
+ require('react');
4
+ var reactNative = require('react-native');
5
+
6
+ const { width, height } = reactNative.Dimensions.get('window');
7
+ const [shortDimension, longDimension] = width < height ? [width, height] : [height, width];
8
+
9
+ //Default guideline sizes are based on standard ~5" screen mobile device
10
+ const guidelineBaseWidth = 350;
11
+
12
+ const scale = size => shortDimension / guidelineBaseWidth * size;
13
+
14
+ const AppColors = {
15
+ commonTextColor: "#475467",
16
+ primaryBlue: "#3379B7",
17
+ primaryWhite: "#FFFFFF",
18
+ secondaryGrey: "#C9CDD6",
19
+ color12: "rgba(220, 240, 249, 1)"};
20
+ reactNative.StyleSheet.create({
21
+ title3: {
22
+ fontSize: 14,
23
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-SemiBold" : "Inter-SemiBold",
24
+ lineHeight: 18,
25
+ fontWeight: "600"
26
+ },
27
+ title1: {
28
+ fontSize: 18,
29
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-SemiBold" : "Inter-SemiBold",
30
+ lineHeight: 22,
31
+ fontWeight: "800"
32
+ },
33
+ body1Font: {
34
+ fontSize: 16,
35
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-Regular" : "Inter-Regular",
36
+ lineHeight: 22,
37
+ fontWeight: "400"
38
+ },
39
+ body2Font: {
40
+ fontSize: 14,
41
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-Regular" : "Inter-Regular",
42
+ lineHeight: 20,
43
+ fontWeight: "400"
44
+ },
45
+ label2Font: {
46
+ fontSize: 14,
47
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-Bold" : "Inter-Bold",
48
+ lineHeight: 20,
49
+ fontWeight: "700"
50
+ },
51
+ title4: {
52
+ fontSize: 14,
53
+ fontFamily: reactNative.Platform.OS == "ios" ? "Inter-Medium" : "Inter-Medium",
54
+ lineHeight: 18,
55
+ fontWeight: "500"
56
+ }
57
+ });
58
+
59
+ reactNative.StyleSheet.create({
60
+ primaryButton: {
61
+ backgroundColor: AppColors.primaryBlue,
62
+ padding: scale(10),
63
+ borderRadius: scale(5),
64
+ alignItems: "center"
65
+ },
66
+ secondaryButton: {
67
+ borderColor: AppColors.secondaryGrey,
68
+ borderWidth: 1,
69
+ padding: scale(10),
70
+ borderRadius: scale(5),
71
+ alignItems: "center"
72
+ },
73
+ tertiaryButton: {
74
+ backgroundColor: "transparent",
75
+ borderWidth: 1,
76
+ borderColor: AppColors.primaryBlue,
77
+ padding: scale(10),
78
+ borderRadius: scale(5),
79
+ alignItems: "center"
80
+ },
81
+ transparentButton: {
82
+ backgroundColor: "transparent",
83
+ padding: scale(10),
84
+ alignItems: "center"
85
+ }
86
+ });
87
+
88
+ const fontFamily = {
89
+ robotoBold: "Roboto-bold",
90
+ robotoMedium: "Roboto-Medium"
91
+ };
92
+ reactNative.StyleSheet.create({
93
+ commonText: {
94
+ fontWeight: "400",
95
+ fontSize: scale(14),
96
+ lineHeight: scale(14),
97
+ fontFamily: fontFamily.robotoBold,
98
+ color: AppColors.commonTextColor
99
+ },
100
+ primaryText: {
101
+ color: AppColors.primaryWhite,
102
+ alignSelf: "center",
103
+ fontWeight: "600",
104
+ fontSize: scale(16),
105
+ lineHeight: scale(16),
106
+ fontFamily: fontFamily.robotoMedium
107
+ },
108
+ secondaryText: {
109
+ color: AppColors.commonTextColor,
110
+ alignSelf: "center",
111
+ fontWeight: "600",
112
+ fontSize: scale(16),
113
+ lineHeight: 16,
114
+ fontFamily: fontFamily.robotoMedium
115
+ }
116
+ });
117
+
118
+ reactNative.StyleSheet.create({
119
+ button: {
120
+ justifyContent: "center",
121
+ marginHorizontal: "3%",
122
+ paddingVertical: scale(10),
123
+ borderRadius: scale(7),
124
+ alignItems: "center"
125
+ },
126
+ text: {
127
+ color: AppColors.primaryWhite
128
+ },
129
+ buttonView: {
130
+ padding: scale(20)
131
+ },
132
+ borderText: {
133
+ color: AppColors.commonTextColor,
134
+ alignSelf: "center",
135
+ fontWeight: "600",
136
+ fontSize: scale(16),
137
+ lineHeight: scale(16),
138
+ fontFamily: fontFamily.robotoMedium
139
+ },
140
+ buttonText: {
141
+ fontSize: scale(18),
142
+ color: AppColors.primaryWhite
143
+ },
144
+ borderButton: {
145
+ flexDirection: "row",
146
+ justifyContent: "center",
147
+ marginHorizontal: "3%",
148
+ paddingVertical: scale(10),
149
+ borderRadius: scale(7),
150
+ alignItems: "center",
151
+ borderWidth: 1,
152
+ borderColor: AppColors.commonTextColor
153
+ },
154
+ primaryIcon: {
155
+ color: AppColors.primaryWhite
156
+ },
157
+ transparentButton: {
158
+ backgroundColor: "transparent",
159
+ padding: scale(10),
160
+ alignItems: "center"
161
+ },
162
+ disabledButton: {
163
+ backgroundColor: AppColors.color12
164
+ },
165
+ secondaryText: {
166
+ color: AppColors.commonTextColor,
167
+ alignSelf: "center",
168
+ fontWeight: "600",
169
+ fontSize: scale(16),
170
+ lineHeight: scale(16),
171
+ fontFamily: fontFamily.robotoMedium
172
+ },
173
+ primaryText: {
174
+ color: AppColors.primaryWhite,
175
+ alignSelf: "center",
176
+ fontWeight: "600",
177
+ fontSize: scale(16),
178
+ lineHeight: scale(16),
179
+ fontFamily: fontFamily.robotoMedium
180
+ },
181
+ tertiaryText: {
182
+ color: AppColors.primaryBlue
183
+ },
184
+ transparentText: {
185
+ color: AppColors.primaryBlue
186
+ },
187
+ dropdownText: {
188
+ color: AppColors.primaryWhite
189
+ },
190
+ content: {
191
+ flexDirection: "row",
192
+ alignItems: "center"
193
+ },
194
+ icon: {
195
+ marginRight: scale(5)
196
+ }
197
+ });
198
+
199
+ reactNative.Dimensions.get("window").width;
200
+ reactNative.Dimensions.get("window").height;
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "dependencies": {
3
+ "@expo/metro-runtime": "~3.2.3",
4
+ "@expo/vector-icons": "^14.0.3",
5
+ "@rollup/plugin-node-resolve": "^16.0.1",
6
+ "@rollup/plugin-typescript": "^12.1.3",
7
+ "@types/react": "~18.2.79",
8
+ "expo": "~51.0.39",
9
+ "expo-constants": "~16.0.2",
10
+ "react": "18.2.0",
11
+ "react-dom": "18.2.0",
12
+ "react-native": "0.74.5",
13
+ "react-native-device-info": "^14.0.4",
14
+ "react-native-elements": "^3.4.3",
15
+ "react-native-otp-entry": "^1.8.4",
16
+ "react-native-svg-transformer": "^1.5.1",
17
+ "react-native-web": "^0.19.10"
18
+ },
19
+ "devDependencies": {
20
+ "@babel/core": "^7.24.0",
21
+ "@gorhom/bottom-sheet": "^4.6.4",
22
+ "@react-native-async-storage/async-storage": "1.23.1",
23
+ "@react-native-community/datetimepicker": "8.0.1",
24
+ "@react-native-community/slider": "4.5.2",
25
+ "@rollup/plugin-commonjs": "^28.0.6",
26
+ "@rollup/plugin-json": "^6.1.0",
27
+ "@storybook/addon-knobs": "^8.0.1",
28
+ "@storybook/addon-ondevice-actions": "^8.3.5",
29
+ "@storybook/addon-ondevice-controls": "^8.3.5",
30
+ "@storybook/core-events": "^8.6.14",
31
+ "@storybook/react-native": "^8.3.5",
32
+ "@svgr/rollup": "^8.1.0",
33
+ "babel-loader": "^9.1.3",
34
+ "cross-env": "^7.0.3",
35
+ "react-native-gesture-handler": "~2.16.1",
36
+ "react-native-reanimated": "~3.10.1",
37
+ "react-native-safe-area-context": "4.10.5",
38
+ "react-native-svg": "15.2.0",
39
+ "rollup": "^4.44.1",
40
+ "rollup-plugin-esbuild": "^6.2.1",
41
+ "tsconfig-paths-webpack-plugin": "^4.2.0",
42
+ "typescript": "^5.8.3"
43
+ },
44
+ "scripts": {
45
+ "start": "expo start",
46
+ "build": "rollup -c",
47
+ "android": "expo start --android",
48
+ "ios": "expo start --ios",
49
+ "web": "expo start --web",
50
+ "storybook-generate": "sb-rn-get-stories -js",
51
+ "storybook": "cross-env STORYBOOK_ENABLED='true' expo start",
52
+ "storybook:ios": "cross-env STORYBOOK_ENABLED='true' expo start --ios",
53
+ "storybook:android": "cross-env STORYBOOK_ENABLED='true' expo start --android"
54
+ },
55
+ "version": "1.1.1",
56
+ "private": false,
57
+ "name": "vueops-storybook",
58
+ "type": "module",
59
+ "main": "dist/index.js",
60
+ "types": "dist/index.d.ts",
61
+ "files": [
62
+ "dist"
63
+ ]
64
+ }