react-native-ui-lib 7.38.1 → 7.39.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.
- package/.eslintrc.js +7 -0
- package/package.json +1 -1
- package/scripts/docs/buildDocsCommon.js +17 -8
- package/src/components/avatar/avatar.api.json +1 -1
- package/src/components/avatar/index.d.ts +22 -20
- package/src/components/avatar/index.js +2 -1
- package/src/components/badge/index.js +10 -1
- package/src/components/button/ButtonConstants.d.ts +6 -0
- package/src/components/button/ButtonConstants.js +6 -0
- package/src/components/button/index.d.ts +18 -5
- package/src/components/button/index.js +17 -2
- package/src/components/card/index.js +3 -1
- package/src/components/checkbox/index.d.ts +1 -0
- package/src/components/checkbox/index.js +4 -1
- package/src/components/colorPalette/ColorPalette.api.json +103 -10
- package/src/components/colorPicker/colorPicker.api.json +107 -4
- package/src/components/colorSwatch/colorSwatch.api.json +161 -9
- package/src/components/connectionStatusBar/index.js +3 -1
- package/src/components/dateTimePicker/index.js +2 -1
- package/src/components/dateTimePicker/useOldApi.js +3 -1
- package/src/components/gridList/gridList.api.json +95 -5
- package/src/components/gridListItem/gridListItem.api.json +325 -19
- package/src/components/hint/hint.api.json +177 -19
- package/src/components/modal/index.js +3 -1
- package/src/components/pieChart/index.js +2 -1
- package/src/components/progressBar/progressBar.api.json +154 -5
- package/src/components/radioButton/index.js +8 -1
- package/src/components/skeletonView/index.js +3 -2
- package/src/components/stepper/stepper.api.json +226 -9
- package/src/components/svgImage/index.js +2 -1
- package/src/components/test.api.json +1 -33
- package/src/components/timeline/timeline.api.json +349 -61
- package/src/incubator/slider/SliderPresenter.js +11 -4
- package/src/incubator/toast/toast.api.json +127 -1
- package/src/services/HapticService.js +2 -1
- package/src/services/LogService.d.ts +7 -2
- package/src/services/LogService.js +5 -0
- /package/src/components/pieChart/{PieChart.api.json → pieChart.api.json} +0 -0
|
@@ -1,61 +1,349 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Timeline",
|
|
3
|
-
"category": "lists",
|
|
4
|
-
"description": "A timeline item to render as part of a timeline list",
|
|
5
|
-
"extends": ["View"],
|
|
6
|
-
"extendsLink": ["https://reactnative.dev/docs/view"],
|
|
7
|
-
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TimelineScreen.tsx",
|
|
8
|
-
"images": [],
|
|
9
|
-
"props": [
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "Timeline",
|
|
3
|
+
"category": "lists",
|
|
4
|
+
"description": "A timeline item to render as part of a timeline list",
|
|
5
|
+
"extends": ["View"],
|
|
6
|
+
"extendsLink": ["https://reactnative.dev/docs/view"],
|
|
7
|
+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TimelineScreen.tsx",
|
|
8
|
+
"images": [],
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "topLine",
|
|
12
|
+
"type": "LineProps",
|
|
13
|
+
"description": "The top line props"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "bottomLine",
|
|
17
|
+
"type": "LineProps",
|
|
18
|
+
"description": "The bottom line props"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "point",
|
|
22
|
+
"type": "PointProps",
|
|
23
|
+
"description": "The point props"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "testID",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The test id for testing"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"snippet": [
|
|
32
|
+
"<Timeline ",
|
|
33
|
+
" topLine={{",
|
|
34
|
+
" state: Timeline.states.ERROR",
|
|
35
|
+
" }$1}",
|
|
36
|
+
" bottomLine={{",
|
|
37
|
+
" type: Timeline.lineTypes.DASHED,",
|
|
38
|
+
" color: Colors.orange40",
|
|
39
|
+
" }$2}",
|
|
40
|
+
" point={{",
|
|
41
|
+
" type: Timeline.pointTypes.OUTLINE,",
|
|
42
|
+
" color: Colors.orange40,",
|
|
43
|
+
" icon: Assets.icons.demo.camera,",
|
|
44
|
+
" anchorRef: alignToTitle ? titleRef : undefined",
|
|
45
|
+
" }$3}",
|
|
46
|
+
">",
|
|
47
|
+
" <View flex centerH paddingH-20>",
|
|
48
|
+
" <Text text70 dark10 ref={titleRef}>",
|
|
49
|
+
" {title}",
|
|
50
|
+
" </Text>",
|
|
51
|
+
" <Text dark40>",
|
|
52
|
+
" {description}",
|
|
53
|
+
" </Text>",
|
|
54
|
+
" </View>",
|
|
55
|
+
"</Timeline>"
|
|
56
|
+
],
|
|
57
|
+
"docs": {
|
|
58
|
+
"hero": {
|
|
59
|
+
"title": "Timeline",
|
|
60
|
+
"description": "markdown:\nThe timeline displays a vertical list of events or steps. \nIt provides the user with a sense of awareness around the progress and the remaining steps.",
|
|
61
|
+
"type": "hero",
|
|
62
|
+
"layout": "horizontal",
|
|
63
|
+
"content": [
|
|
64
|
+
{
|
|
65
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_overview_cover.png"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"tabs": [
|
|
70
|
+
{
|
|
71
|
+
"title": "Overview",
|
|
72
|
+
"sections": [
|
|
73
|
+
{
|
|
74
|
+
"type": "list",
|
|
75
|
+
"items": [
|
|
76
|
+
{
|
|
77
|
+
"title": "Log Timeline",
|
|
78
|
+
"description": "A log of past and future activities or events. The list starts with an empty state, and it keeps on updating and changing.",
|
|
79
|
+
"content": [
|
|
80
|
+
{
|
|
81
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_overview_usageExamples1.png"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"title": "Steps Timeline",
|
|
87
|
+
"description": "A list of suggested steps to take to achieve a certain goal. Users usually need to take action with these steps.The steps are usually decided in advance, meaning that the initial state is not empty.",
|
|
88
|
+
"content": [
|
|
89
|
+
{
|
|
90
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_overview_usageExamples2.png"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"title": "Usage Examples",
|
|
96
|
+
"description": "The timeline displays a vertical list of events or steps. \nIt provides the user with a sense of awareness around the progress and the remaining steps.",
|
|
97
|
+
"layout": "horizontal"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "list",
|
|
101
|
+
"items": [
|
|
102
|
+
{
|
|
103
|
+
"title": "",
|
|
104
|
+
"description": "markdown:\nThe Timeline consists of points and lines, each with different styles and states. These elements can be combined in various ways to suit different product goals. \nPoints create visual breakpoints that make your timeline easier to read, they act as bullet points, representing each step or activity. The icons and colors can be customized. \nLines can either match the state and color of the points or be styled differently or in neutral tokens to emphasize the points.",
|
|
105
|
+
"content": [
|
|
106
|
+
{
|
|
107
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_structure.png"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"title": "Points aligned to center (default)",
|
|
113
|
+
"description": "The timeline points are aligned with the center of the element on the right.",
|
|
114
|
+
"content": [
|
|
115
|
+
{
|
|
116
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_structure_center.png"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"title": "Points aligned to anchor ref",
|
|
122
|
+
"description": "The Timeline can be configured to align its points to one of the elements on the right. In the example, the points are aligned with the titles in the cards.",
|
|
123
|
+
"content": [
|
|
124
|
+
{
|
|
125
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_structure_anchorRef.png"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"layout": "horizontal",
|
|
131
|
+
"title": "Structure"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"type": "table",
|
|
135
|
+
"columns": ["Property", "Preview"],
|
|
136
|
+
"items": [
|
|
137
|
+
{
|
|
138
|
+
"title": "Current",
|
|
139
|
+
"content": [
|
|
140
|
+
{
|
|
141
|
+
"props": {
|
|
142
|
+
"state": "current",
|
|
143
|
+
"point": {
|
|
144
|
+
"type": {
|
|
145
|
+
"type": "bullet"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"bottomLine": {
|
|
149
|
+
"type": {
|
|
150
|
+
"type": "solid"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"props": {
|
|
157
|
+
"point": {
|
|
158
|
+
"type": {
|
|
159
|
+
"type": "bullet",
|
|
160
|
+
"color": "#116DFF"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"description": "state: current"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"title": "Next",
|
|
170
|
+
"content": [
|
|
171
|
+
{
|
|
172
|
+
"props": {
|
|
173
|
+
"state": "next",
|
|
174
|
+
"point": {
|
|
175
|
+
"type": {
|
|
176
|
+
"type": "bullet"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"bottomLine": {
|
|
180
|
+
"type": {
|
|
181
|
+
"type": "solid"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"description": "state: next"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"title": "Error",
|
|
191
|
+
"content": [
|
|
192
|
+
{
|
|
193
|
+
"props": {
|
|
194
|
+
"state": "error",
|
|
195
|
+
"point": {
|
|
196
|
+
"type": {
|
|
197
|
+
"type": "bullet"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"bottomLine": {
|
|
201
|
+
"type": {
|
|
202
|
+
"type": "solid"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"description": "state: error"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"title": "Success",
|
|
212
|
+
"content": [
|
|
213
|
+
{
|
|
214
|
+
"props": {
|
|
215
|
+
"state": "success",
|
|
216
|
+
"point": {
|
|
217
|
+
"type": {
|
|
218
|
+
"type": "bullet"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"bottomLine": {
|
|
222
|
+
"type": {
|
|
223
|
+
"type": "solid"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"description": "state: success"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"title": "States",
|
|
233
|
+
"name": ""
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"type": "table",
|
|
237
|
+
"columns": ["Property", "Preview"],
|
|
238
|
+
"items": [
|
|
239
|
+
{
|
|
240
|
+
"title": "Bullet",
|
|
241
|
+
"description": "type: bullet"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"title": "Circle",
|
|
245
|
+
"description": "type: circle"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"title": "Outline",
|
|
249
|
+
"description": "type: outline"
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"title": "Point",
|
|
253
|
+
"name": "Point Types"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"type": "table",
|
|
257
|
+
"columns": ["Property", "Preview"],
|
|
258
|
+
"items": [
|
|
259
|
+
{
|
|
260
|
+
"title": "Text",
|
|
261
|
+
"content": [
|
|
262
|
+
{
|
|
263
|
+
"props": {
|
|
264
|
+
"state": "current",
|
|
265
|
+
"bottomLine": {
|
|
266
|
+
"type": {
|
|
267
|
+
"type": "solid"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"description": "text: “1”"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"title": "Icon",
|
|
277
|
+
"content": [
|
|
278
|
+
{
|
|
279
|
+
"props": {
|
|
280
|
+
"state": "current",
|
|
281
|
+
"bottomLine": {
|
|
282
|
+
"type": {
|
|
283
|
+
"type": "dashed"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"description": "icon: Assets.icons.general.checkmarkSmall"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"title": "Icon without background",
|
|
293
|
+
"description": "icon: Assets.icons.general.favorite, removeIconBackground: true"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"name": "Point Accessories"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"type": "table",
|
|
300
|
+
"columns": ["Property", "Preview"],
|
|
301
|
+
"items": [
|
|
302
|
+
{
|
|
303
|
+
"title": "Solid",
|
|
304
|
+
"description": "type: solid"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"title": "Dashed",
|
|
308
|
+
"description": "type: dashed"
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"title": "Line",
|
|
312
|
+
"name": "Line Types"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"type": "table",
|
|
316
|
+
"columns": ["Property", "Preview"],
|
|
317
|
+
"items": [
|
|
318
|
+
{
|
|
319
|
+
"title": "Entry",
|
|
320
|
+
"description": "entry: true"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"name": "Line Accessories"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"type": "section",
|
|
327
|
+
"title": "Orientation",
|
|
328
|
+
"description": "markdown:\nThe Timeline can be displayed in either ascending or descending order, depending on the context: \n\n - **Ascending:** Numbers increase as you move forward. \n - **Descending:** Numbers decrease as you move forward.",
|
|
329
|
+
"content": [
|
|
330
|
+
{
|
|
331
|
+
"value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Guidelines-to-Docs?node-id=2325-449060&embed-host=share"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"type": "section",
|
|
337
|
+
"title": "Spec",
|
|
338
|
+
"description": "markdown:\n**Key rules:** \n- Maintain a minimum distance of S2 between the Timeline and the elements on the right. \n- Points can be aligned either to the top or the center of the elements on the right. \n- When points are center-aligned with the elements, set the line length to auto, with a minimum of 20px.",
|
|
339
|
+
"content": [
|
|
340
|
+
{
|
|
341
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Timeline/timeline_spec.png"
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { interpolate } from 'react-native-reanimated';
|
|
2
|
+
import { LogService } from "../../services";
|
|
2
3
|
export function getOffsetForValue(value, span, minimumValue = 0, maximumValue = 1) {
|
|
3
4
|
const range = maximumValue - minimumValue;
|
|
4
5
|
const relativeValue = minimumValue - value;
|
|
@@ -43,15 +44,21 @@ export function validateValues(props) {
|
|
|
43
44
|
initialMaximumValue
|
|
44
45
|
} = props;
|
|
45
46
|
if (minimumValue > maximumValue || useRange && initialMinimumValue && initialMaximumValue && initialMinimumValue > initialMaximumValue) {
|
|
46
|
-
|
|
47
|
+
LogService.forwardError({
|
|
48
|
+
message: 'Your passed values are invalid. Please check if minimum values are not higher than maximum values'
|
|
49
|
+
});
|
|
47
50
|
}
|
|
48
51
|
if (value !== undefined && minimumValue && maximumValue && !inRange(value, minimumValue, maximumValue)) {
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
LogService.forwardError({
|
|
53
|
+
message: `Your passed value (${value}) is invalid.
|
|
54
|
+
Please check that it is in range of the minimum (${minimumValue}) and maximum (${maximumValue}) values`
|
|
55
|
+
});
|
|
51
56
|
}
|
|
52
57
|
if (useRange && initialMinimumValue && initialMaximumValue) {
|
|
53
58
|
if (!inRange(initialMinimumValue, minimumValue, maximumValue) || !inRange(initialMaximumValue, minimumValue, maximumValue)) {
|
|
54
|
-
|
|
59
|
+
LogService.forwardError({
|
|
60
|
+
message: 'Your passed values are invalid. Please check that they are in range of the minimum and maximum values'
|
|
61
|
+
});
|
|
55
62
|
}
|
|
56
63
|
}
|
|
57
64
|
}
|
|
@@ -68,5 +68,131 @@
|
|
|
68
68
|
" autoDismiss={5000$2}",
|
|
69
69
|
" onDismiss={onDismiss$3}",
|
|
70
70
|
">"
|
|
71
|
-
]
|
|
71
|
+
],
|
|
72
|
+
"docs": {
|
|
73
|
+
"hero": {
|
|
74
|
+
"title": "Toast",
|
|
75
|
+
"description": "Toasts give quick feedback or updates without interrupting the user. They’re used for non-critical messages, like success notifications, and disappear on their own. Toasts can include one action, but it shouldn’t be “Dismiss” or “Close.”",
|
|
76
|
+
"type": "hero",
|
|
77
|
+
"layout": "horizontal",
|
|
78
|
+
"content": [
|
|
79
|
+
{
|
|
80
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Toast/toast_cover.png"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"tabs": [
|
|
85
|
+
{
|
|
86
|
+
"title": "Overview",
|
|
87
|
+
"sections": [
|
|
88
|
+
{
|
|
89
|
+
"type": "section",
|
|
90
|
+
"title": "Usage Examples",
|
|
91
|
+
"content": [
|
|
92
|
+
{
|
|
93
|
+
"value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Guidelines-to-Docs?node-id=4419-247566&embed-host=share"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "table",
|
|
99
|
+
"columns": ["Type of message", "Preview"],
|
|
100
|
+
"items": [
|
|
101
|
+
{
|
|
102
|
+
"title": "Generic",
|
|
103
|
+
"content": [
|
|
104
|
+
{
|
|
105
|
+
"props": {
|
|
106
|
+
"visible": true,
|
|
107
|
+
"message": "\"Mika Or\" was saved to contacts."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"title": "Success"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"title": "Validation"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"title": "Offline Error"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"title": "Types"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "table",
|
|
126
|
+
"columns": ["Prop", "Preview"],
|
|
127
|
+
"items": [
|
|
128
|
+
{
|
|
129
|
+
"title": "None"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"title": "With action"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"title": "With loader"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"title": "Accessories"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "section",
|
|
142
|
+
"title": "Timing",
|
|
143
|
+
"description": "markdown:\nToast disappears automatically after 5-10 seconds. The **default** duration depends on text length: [word count / 2] = X secs to disappear \nExamples: \n[15 words / 2] = 7.5 secs\n[2 words / 2] = 1, but 5 secs is minimum >> 5 secs \nWhen using Toasts in your product, keep in mind that the default display time is preset but can be adjusted for messages that need more attention or reading time. However, the duration should never be less than 5 seconds."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"type": "section",
|
|
147
|
+
"layout": "horizontal",
|
|
148
|
+
"title": "Spec",
|
|
149
|
+
"description": "markdown:\n**Positioning**\nThe Toast appears at the bottom of the screen, while keeping a spacing of S4 from the bottom of the screen, or from the bottom bar. \nThe Toast can be placed above CTA’s in order to keep the CTA available for the user. \nToast can be dismissed manually by swiping it down.",
|
|
150
|
+
"content": [
|
|
151
|
+
{
|
|
152
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Toast/toast_spec.png"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "section",
|
|
158
|
+
"title": "Tablet Spec",
|
|
159
|
+
"description": "markdown:\nWhen displaying a Toast on a Tablet, the width of the component adjusts to the content. \n- Min-width: 200px \n- Max-width: 524px",
|
|
160
|
+
"content": [
|
|
161
|
+
{
|
|
162
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Toast/toast_tablet.png"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"title": "UX Guidelines",
|
|
170
|
+
"sections": [
|
|
171
|
+
{
|
|
172
|
+
"type": "list",
|
|
173
|
+
"items": [
|
|
174
|
+
{
|
|
175
|
+
"title": "",
|
|
176
|
+
"content": [
|
|
177
|
+
{
|
|
178
|
+
"value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Guidelines-to-Docs?node-id=4419-247566&embed-host=share"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"title": "",
|
|
184
|
+
"content": [
|
|
185
|
+
{
|
|
186
|
+
"value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Guidelines-to-Docs?node-id=4419-247643&embed-host=share"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"title": "Do’s & Don’ts",
|
|
192
|
+
"description": "markdown:\n**Message Length**\nDo not display long messages in a Toast, keep the Toast message short and focused, yet informative. \nFurther information regarding the phrasing of toast messages can be found in UX Writers - Toast Guidelines."
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
72
198
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HapticFeedbackPackage } from "../optionalDependencies";
|
|
2
|
+
import { LogService } from "./";
|
|
2
3
|
const options = {
|
|
3
4
|
enableVibrateFallback: false,
|
|
4
5
|
ignoreAndroidSystemSettings: false
|
|
@@ -17,7 +18,7 @@ function triggerHaptic(hapticType, componentName) {
|
|
|
17
18
|
if (HapticFeedbackPackage) {
|
|
18
19
|
HapticFeedbackPackage.trigger(hapticType, options);
|
|
19
20
|
} else {
|
|
20
|
-
|
|
21
|
+
LogService.error(`RNUILib ${componentName}'s requires installing "react-native-haptic-feedback" dependency`);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
export default {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
interface BILogger {
|
|
2
2
|
log: (event: any) => void;
|
|
3
3
|
}
|
|
4
|
-
declare class LogService {
|
|
4
|
+
declare class LogService<ErrorInfo extends {
|
|
5
|
+
message: string;
|
|
6
|
+
}> {
|
|
5
7
|
private biLogger;
|
|
6
8
|
injectBILogger: (biLogger: BILogger) => void;
|
|
7
9
|
logBI: (event: any) => void;
|
|
8
10
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
9
11
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
12
|
+
forwardError: (errorInfo: ErrorInfo) => void;
|
|
10
13
|
deprecationWarn: ({ component, oldProp, newProp }: {
|
|
11
14
|
component: string;
|
|
12
15
|
oldProp: string;
|
|
@@ -26,5 +29,7 @@ declare class LogService {
|
|
|
26
29
|
newComponent: string;
|
|
27
30
|
}) => void;
|
|
28
31
|
}
|
|
29
|
-
declare const _default: LogService
|
|
32
|
+
declare const _default: LogService<{
|
|
33
|
+
message: string;
|
|
34
|
+
}>;
|
|
30
35
|
export default _default;
|
|
@@ -12,9 +12,14 @@ class LogService {
|
|
|
12
12
|
};
|
|
13
13
|
error = (message, ...optionalParams) => {
|
|
14
14
|
if (__DEV__) {
|
|
15
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
15
16
|
console.error(message, ...optionalParams);
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
forwardError = errorInfo => {
|
|
20
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
21
|
+
console.error(errorInfo.message);
|
|
22
|
+
};
|
|
18
23
|
deprecationWarn = ({
|
|
19
24
|
component,
|
|
20
25
|
oldProp,
|
|
File without changes
|