react-native-ui-lib 7.39.0-snapshot.6546 → 7.39.0-snapshot.6550

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.39.0-snapshot.6546",
3
+ "version": "7.39.0-snapshot.6550",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -88,13 +88,9 @@ function processComponents(components) {
88
88
  content += `sidebar_label: ${componentName}\n`;
89
89
  content += '---\n\n';
90
90
 
91
- if (component.docs) {
92
- content += `import ComponentPage from '@site/src/components/ComponentPage';\n\n`;
93
- const componentObject = JSON.stringify(component);
94
- content += `<ComponentPage component={${componentObject}}/>\n`;
95
- } else {
96
- content += `${buildOldDocs(component)}\n`;
97
- }
91
+ content += `import ComponentPage from '@site/src/components/ComponentPage';\n\n`;
92
+ const componentObject = JSON.stringify(component);
93
+ content += `<ComponentPage component={${componentObject}}/>\n`;
98
94
 
99
95
  let dirPath;
100
96
  switch (component.category) {
@@ -153,84 +149,4 @@ function logStatistics(components) {
153
149
  }
154
150
  }
155
151
 
156
- function buildOldDocs(component) {
157
- let content = '';
158
- content += `import UILivePreview from '@site/src/components/UILivePreview';\n\n`;
159
-
160
- /* General Info */
161
- content += `${component.description} \n`;
162
- if (typeof component.example === 'string') {
163
- content += `[(code example)](${component.example})\n`;
164
- } else if (Array.isArray(component.example)) {
165
- content += '(code examples: ';
166
- component.example.forEach((example, index) => {
167
- const slashIndex = example.lastIndexOf('/');
168
- const dotIndex = example.lastIndexOf('.');
169
- content += `${index > 0 ? ', ' : ''}[${example.slice(slashIndex + 1, dotIndex)}](${example})`;
170
- });
171
- content += ')\n';
172
- }
173
-
174
- if (component.extends) {
175
- let extendsText = component.extends?.join(', ');
176
- if (component.extendsLink) {
177
- extendsText = `[${extendsText}](${component.extendsLink})`;
178
- } else {
179
- extendsText = _.map(component.extends, generateExtendsLink).join(', ');
180
- }
181
- content += ':::info\n';
182
- content += `This component extends **${extendsText}** props.\n`;
183
- content += ':::\n';
184
- }
185
-
186
- if (component.modifiers) {
187
- content += ':::tip\n';
188
- content += `This component support **${component.modifiers?.join(', ')}** modifiers.\n`;
189
- content += ':::\n';
190
- }
191
-
192
- if (component.caution) {
193
- content += ':::caution\n';
194
- content += `${component.caution}\n`;
195
- content += ':::\n';
196
- }
197
-
198
- if (component.note) {
199
- content += ':::note\n';
200
- content += `${component.note}\n`;
201
- content += ':::\n';
202
- }
203
-
204
- /* Images */
205
- content += `<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}>`;
206
- component.images?.forEach(image => {
207
- content += `<img style={{maxHeight: '420px'}} src={'${image}'}/>`;
208
- content += '\n\n';
209
- });
210
- content += '</div>\n\n';
211
-
212
- /* Snippet */
213
- if (component.snippet) {
214
- content += `### Usage\n`;
215
- content += `<UILivePreview componentName={"${component.name}"} code={\`${component.snippet
216
- ?.map(item => _.replace(item, new RegExp(/\$[1-9]/, 'g'), ''))
217
- .join('\n')
218
- .toString()}\`}/>\n\n`;
219
- }
220
-
221
- /* Props */
222
- content += '## API\n';
223
- _.sortBy(component.props, p => p.name)?.forEach(prop => {
224
- content += `### ${prop.name}\n`;
225
- if (prop.note) {
226
- content += `#### ${prop.note}\n`;
227
- }
228
- content += `${prop.description}\n`;
229
- // content += `<span style={{color: 'grey'}}>${_.escape(prop.type)}</span>\n\n`;
230
- content += `\`${prop.type} \` \n\n`;
231
- });
232
-
233
- return content;
234
- }
235
-
236
152
  module.exports = {buildDocs};
@@ -102,21 +102,53 @@
102
102
  "title": "Generic",
103
103
  "content": [
104
104
  {
105
+ "component": "Incubator.Toast",
105
106
  "props": {
106
107
  "visible": true,
107
- "message": "Mika Or was saved to contacts."
108
+ "message": "Mika Or was saved to contacts.",
109
+ "preset": "general"
108
110
  }
109
111
  }
110
112
  ]
111
113
  },
112
114
  {
113
- "title": "Success"
115
+ "title": "Success",
116
+ "content": [
117
+ {
118
+ "component": "Incubator.Toast",
119
+ "props": {
120
+ "visible": true,
121
+ "message": "Post published.",
122
+ "preset": "success"
123
+ }
124
+ }
125
+ ]
114
126
  },
115
127
  {
116
- "title": "Validation"
128
+ "title": "Validation",
129
+ "content": [
130
+ {
131
+ "component": "Incubator.Toast",
132
+ "props": {
133
+ "visible": true,
134
+ "message": "Enter a card number.",
135
+ "preset": "failure"
136
+ }
137
+ }
138
+ ]
117
139
  },
118
140
  {
119
- "title": "Offline Error"
141
+ "title": "Offline Error",
142
+ "content": [
143
+ {
144
+ "component": "Incubator.Toast",
145
+ "props": {
146
+ "visible": true,
147
+ "message": "This action is not available offline.",
148
+ "preset": "offline"
149
+ }
150
+ }
151
+ ]
120
152
  }
121
153
  ],
122
154
  "title": "Types"
@@ -126,13 +158,37 @@
126
158
  "columns": ["Prop", "Preview"],
127
159
  "items": [
128
160
  {
129
- "title": "None"
161
+ "title": "None",
162
+ "content": [
163
+ {
164
+ "component": "Incubator.Toast",
165
+ "props": {
166
+ "visible": true,
167
+ "message": "Action completed."
168
+ }
169
+ }
170
+ ]
130
171
  },
131
172
  {
132
- "title": "With action"
173
+ "title": "With action",
174
+ "content": [
175
+ {
176
+ "snippet": "<Incubator.Toast visible message=\"Action completed.\" action={{label: 'Undo', onPress: () => {}}}/>"
177
+ }
178
+ ]
133
179
  },
134
180
  {
135
- "title": "With loader"
181
+ "title": "With loader",
182
+ "content": [
183
+ {
184
+ "component": "Incubator.Toast",
185
+ "props": {
186
+ "visible": true,
187
+ "message": "Action completed.",
188
+ "showLoader": true
189
+ }
190
+ }
191
+ ]
136
192
  }
137
193
  ],
138
194
  "title": "Accessories"