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.
Files changed (38) hide show
  1. package/.eslintrc.js +7 -0
  2. package/package.json +1 -1
  3. package/scripts/docs/buildDocsCommon.js +17 -8
  4. package/src/components/avatar/avatar.api.json +1 -1
  5. package/src/components/avatar/index.d.ts +22 -20
  6. package/src/components/avatar/index.js +2 -1
  7. package/src/components/badge/index.js +10 -1
  8. package/src/components/button/ButtonConstants.d.ts +6 -0
  9. package/src/components/button/ButtonConstants.js +6 -0
  10. package/src/components/button/index.d.ts +18 -5
  11. package/src/components/button/index.js +17 -2
  12. package/src/components/card/index.js +3 -1
  13. package/src/components/checkbox/index.d.ts +1 -0
  14. package/src/components/checkbox/index.js +4 -1
  15. package/src/components/colorPalette/ColorPalette.api.json +103 -10
  16. package/src/components/colorPicker/colorPicker.api.json +107 -4
  17. package/src/components/colorSwatch/colorSwatch.api.json +161 -9
  18. package/src/components/connectionStatusBar/index.js +3 -1
  19. package/src/components/dateTimePicker/index.js +2 -1
  20. package/src/components/dateTimePicker/useOldApi.js +3 -1
  21. package/src/components/gridList/gridList.api.json +95 -5
  22. package/src/components/gridListItem/gridListItem.api.json +325 -19
  23. package/src/components/hint/hint.api.json +177 -19
  24. package/src/components/modal/index.js +3 -1
  25. package/src/components/pieChart/index.js +2 -1
  26. package/src/components/progressBar/progressBar.api.json +154 -5
  27. package/src/components/radioButton/index.js +8 -1
  28. package/src/components/skeletonView/index.js +3 -2
  29. package/src/components/stepper/stepper.api.json +226 -9
  30. package/src/components/svgImage/index.js +2 -1
  31. package/src/components/test.api.json +1 -33
  32. package/src/components/timeline/timeline.api.json +349 -61
  33. package/src/incubator/slider/SliderPresenter.js +11 -4
  34. package/src/incubator/toast/toast.api.json +127 -1
  35. package/src/services/HapticService.js +2 -1
  36. package/src/services/LogService.d.ts +7 -2
  37. package/src/services/LogService.js +5 -0
  38. /package/src/components/pieChart/{PieChart.api.json → pieChart.api.json} +0 -0
@@ -4,10 +4,27 @@
4
4
  "description": "Progress bar",
5
5
  "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ProgressBarScreen.tsx",
6
6
  "props": [
7
- {"name": "progress", "type": "number", "description": "The progress of the bar from 0 to 100", "default": "0"},
8
- {"name": "fullWidth", "type": "boolean", "description": "FullWidth Ui preset"},
9
- {"name": "style", "type": "ViewStyle", "description": "Override container style"},
10
- {"name": "progressColor", "type": "string", "description": "Progress color"},
7
+ {
8
+ "name": "progress",
9
+ "type": "number",
10
+ "description": "The progress of the bar from 0 to 100",
11
+ "default": "0"
12
+ },
13
+ {
14
+ "name": "fullWidth",
15
+ "type": "boolean",
16
+ "description": "FullWidth Ui preset"
17
+ },
18
+ {
19
+ "name": "style",
20
+ "type": "ViewStyle",
21
+ "description": "Override container style"
22
+ },
23
+ {
24
+ "name": "progressColor",
25
+ "type": "string",
26
+ "description": "Progress color"
27
+ },
11
28
  {
12
29
  "name": "customElement",
13
30
  "type": "JSX.Element",
@@ -16,5 +33,137 @@
16
33
  ],
17
34
  "snippet": [
18
35
  "<ProgressBar progress={55$1} progressColor={Colors.red30$2}/>"
19
- ]
36
+ ],
37
+ "docs": {
38
+ "hero": {
39
+ "title": "ProgressBar",
40
+ "description": "ProgressBar is a linear progress indicators, that express the length of a process. It should be used when the process completion rate can be detected. As the completion rate increases, the track fills from 0 to 100%. The ProgressBar can be accompanied by a textual representation of the progress in a percent format.",
41
+ "type": "hero",
42
+ "layout": "horizontal",
43
+ "content": [
44
+ {
45
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_cover.png"
46
+ }
47
+ ]
48
+ },
49
+ "tabs": [
50
+ {
51
+ "title": "Overview",
52
+ "sections": [
53
+ {
54
+ "type": "list",
55
+ "items": [
56
+ {
57
+ "title": "Inline (Default)",
58
+ "description": "Inline Progress Bar attached to a container, such as a card, can indicate the process applies to that particular item.",
59
+ "content": [
60
+ {
61
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_usage_inline.png"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "title": "Full Width",
67
+ "description": "Indicates progress with the screen’s content.",
68
+ "content": [
69
+ {
70
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_usage_fullWidth.png"
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "title": "Animated",
76
+ "description": "In cases where the progress will take about a minute to complete, use an animated progress bar with a stripes pattern ",
77
+ "content": [
78
+ {
79
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_usage_animated.png"
80
+ }
81
+ ]
82
+ }
83
+ ],
84
+ "layout": "horizontal",
85
+ "title": "Usage Examples"
86
+ },
87
+ {
88
+ "type": "table",
89
+ "columns": [
90
+ "Property",
91
+ "Preview"
92
+ ],
93
+ "items": [
94
+ {
95
+ "title": "Default",
96
+ "content": [
97
+ {
98
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_default.png"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "title": "AnimatedStripes",
104
+ "content": [
105
+ {
106
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_AnimatedStripes.png"
107
+ }
108
+ ]
109
+ }
110
+ ],
111
+ "title": "Types"
112
+ },
113
+ {
114
+ "type": "table",
115
+ "columns": [
116
+ "Property",
117
+ "Preview"
118
+ ],
119
+ "items": [
120
+ {
121
+ "title": "Inline (default)",
122
+ "content": [
123
+ {
124
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_default.png"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "title": "FullWidth",
130
+ "content": [
131
+ {
132
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_fullWidth.png"
133
+ }
134
+ ]
135
+ }
136
+ ],
137
+ "title": "Size"
138
+ },
139
+ {
140
+ "type": "section"
141
+ },
142
+ {
143
+ "type": "list",
144
+ "items": [
145
+ {
146
+ "title": "Phone spec",
147
+ "content": [
148
+ {
149
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_spec_phone.png"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "title": "Tablet spec",
155
+ "content": [
156
+ {
157
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ProgressBar/progressBar_spec_tablet.png"
158
+ }
159
+ ]
160
+ }
161
+ ],
162
+ "title": "Spec",
163
+ "layout": "horizontal"
164
+ }
165
+ ]
166
+ }
167
+ ]
168
+ }
20
169
  }
@@ -179,6 +179,13 @@ class RadioButton extends PureComponent {
179
179
  }]} />
180
180
  </View>;
181
181
  }
182
+ getAccessibleHitSlop(size) {
183
+ const verticalPadding = Math.max(0, (48 - size) / 2);
184
+ return {
185
+ top: verticalPadding,
186
+ bottom: verticalPadding
187
+ };
188
+ }
182
189
  render() {
183
190
  const {
184
191
  onPress,
@@ -190,7 +197,7 @@ class RadioButton extends PureComponent {
190
197
  const Container = onPress || onValueChange ? TouchableOpacity : View;
191
198
  return (
192
199
  // @ts-ignore
193
- <Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()}>
200
+ <Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()} hitSlop={this.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
194
201
  {!contentOnLeft && this.renderButton()}
195
202
  {this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
196
203
  {this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
@@ -9,6 +9,7 @@ import { BorderRadiuses, Colors, Dividers, Spacings } from "../../style";
9
9
  import { createShimmerPlaceholder, LinearGradientPackage } from "../../optionalDependencies";
10
10
  import View from "../view";
11
11
  import { Constants } from "../../commons/new";
12
+ import { LogService } from "../../services";
12
13
  const LinearGradient = LinearGradientPackage?.default;
13
14
  let ShimmerPlaceholder;
14
15
  const ANIMATION_DURATION = 400;
@@ -62,9 +63,9 @@ class SkeletonView extends Component {
62
63
  opacity: new Animated.Value(0)
63
64
  };
64
65
  if (_isUndefined(LinearGradientPackage?.default)) {
65
- console.error(`RNUILib SkeletonView's requires installing "react-native-linear-gradient" dependency`);
66
+ LogService.error(`RNUILib SkeletonView's requires installing "react-native-linear-gradient" dependency`);
66
67
  } else if (_isUndefined(createShimmerPlaceholder)) {
67
- console.error(`RNUILib SkeletonView's requires installing "react-native-shimmer-placeholder" dependency`);
68
+ LogService.error(`RNUILib SkeletonView's requires installing "react-native-shimmer-placeholder" dependency`);
68
69
  } else if (ShimmerPlaceholder === undefined) {
69
70
  ShimmerPlaceholder = createShimmerPlaceholder(LinearGradient);
70
71
  }
@@ -5,10 +5,26 @@
5
5
  "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/StepperScreen.tsx",
6
6
  "images": [],
7
7
  "props": [
8
- {"name": "type", "type": "StepperType", "description": "Stepper style type"},
9
- {"name": "value", "type": "number", "description": "Stepper value"},
10
- {"name": "minValue", "type": "number", "description": "Minimum value"},
11
- {"name": "maxValue", "type": "number", "description": "Maximum value"},
8
+ {
9
+ "name": "type",
10
+ "type": "StepperType",
11
+ "description": "Stepper style type"
12
+ },
13
+ {
14
+ "name": "value",
15
+ "type": "number",
16
+ "description": "Stepper value"
17
+ },
18
+ {
19
+ "name": "minValue",
20
+ "type": "number",
21
+ "description": "Minimum value"
22
+ },
23
+ {
24
+ "name": "maxValue",
25
+ "type": "number",
26
+ "description": "Maximum value"
27
+ },
12
28
  {
13
29
  "name": "step",
14
30
  "type": "number",
@@ -20,12 +36,213 @@
20
36
  "type": "(value: number, testID?: string) => void",
21
37
  "description": "Value change callback function"
22
38
  },
23
- {"name": "disabled", "type": "boolean", "description": "Disables interaction with the stepper"},
24
- {"name": "small", "type": "boolean", "description": "Renders a small sized Stepper"},
25
- {"name": "accessibilityLabel", "type": "string", "description": "Component accessibility label"},
26
- {"name": "testID", "type": "string", "description": "Test id for component"}
39
+ {
40
+ "name": "disabled",
41
+ "type": "boolean",
42
+ "description": "Disables interaction with the stepper"
43
+ },
44
+ {
45
+ "name": "small",
46
+ "type": "boolean",
47
+ "description": "Renders a small sized Stepper"
48
+ },
49
+ {
50
+ "name": "accessibilityLabel",
51
+ "type": "string",
52
+ "description": "Component accessibility label"
53
+ },
54
+ {
55
+ "name": "testID",
56
+ "type": "string",
57
+ "description": "Test id for component"
58
+ }
27
59
  ],
28
60
  "snippet": [
29
61
  "<Stepper$1/>"
30
- ]
62
+ ],
63
+ "docs": {
64
+ "hero": {
65
+ "title": "Stepper",
66
+ "description": "The Stepper lets users easily increase or decrease a value by small amounts. Steppers are best used when the user needs to adjust the value by small increments.",
67
+ "type": "hero",
68
+ "layout": "horizontal",
69
+ "content": [
70
+ {
71
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Stepper/Stepper_overview_cover.png"
72
+ }
73
+ ]
74
+ },
75
+ "tabs": [
76
+ {
77
+ "title": "Overview",
78
+ "sections": [
79
+ {
80
+ "type": "section",
81
+ "title": "Usage Examples",
82
+ "content": [
83
+ {
84
+ "value": "https://embed.figma.com/design/xFjvYNkGTmYTGYMLrmz9Ir/Guidelines-to-Docs?node-id=2394-210062&m=dev&embed-host=share&page-selector=false"
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "type": "table",
90
+ "columns": [
91
+ "Style",
92
+ "Preview"
93
+ ],
94
+ "items": [
95
+ {
96
+ "title": "Default",
97
+ "description": "Primarily used in form screens, typically within list items.",
98
+ "content": [
99
+ {
100
+ "props": {
101
+ "value": 1
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "title": "Floating ",
108
+ "description": "Ideal to be used over images, such as when adding multiple items to a cart.",
109
+ "content": [
110
+ {
111
+ "props": {
112
+ "type": "floating",
113
+ "value": 1
114
+ }
115
+ }
116
+ ]
117
+ }
118
+ ],
119
+ "title": "Styles"
120
+ },
121
+ {
122
+ "type": "table",
123
+ "columns": [
124
+ "Size",
125
+ "Preview"
126
+ ],
127
+ "items": [
128
+ {
129
+ "title": "Large",
130
+ "content": [
131
+ {
132
+ "props": {
133
+ "value": 1
134
+ }
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ "title": "Small",
140
+ "content": [
141
+ {
142
+ "props": {
143
+ "small": true,
144
+ "value": 1
145
+ }
146
+ }
147
+ ]
148
+ }
149
+ ],
150
+ "title": "Sizes",
151
+ "description": "Relevant only for the default style."
152
+ },
153
+ {
154
+ "type": "table",
155
+ "columns": [
156
+ "State",
157
+ "Default",
158
+ "Floating"
159
+ ],
160
+ "items": [
161
+ {
162
+ "title": "Active",
163
+ "content": [
164
+ {
165
+ "props": {
166
+ "value": 1
167
+ }
168
+ },
169
+ {
170
+ "props": {
171
+ "value": 1,
172
+ "type": "floating"
173
+ }
174
+ }
175
+ ]
176
+ },
177
+ {
178
+ "title": "Disabled",
179
+ "content": [
180
+ {
181
+ "props": {
182
+ "value": 1,
183
+ "disabled": true
184
+ }
185
+ },
186
+ {
187
+ "props": {
188
+ "value": 1,
189
+ "disabled": true,
190
+ "type": "floating"
191
+ }
192
+ }
193
+ ]
194
+ },
195
+ {
196
+ "title": "Reached min value",
197
+ "content": [
198
+ {
199
+ "props": {
200
+ "value": 0,
201
+ "minValue": 0
202
+ }
203
+ },
204
+ {
205
+ "props": {
206
+ "value": 0,
207
+ "minValue": 0,
208
+ "type": "floating"
209
+ }
210
+ }
211
+ ]
212
+ },
213
+ {
214
+ "title": "Reached max value",
215
+ "content": [
216
+ {
217
+ "props": {
218
+ "value": 99,
219
+ "maxValue": 99
220
+ }
221
+ },
222
+ {
223
+ "props": {
224
+ "value": 99,
225
+ "maxValue": 99,
226
+ "type": "floating"
227
+ }
228
+ }
229
+ ]
230
+ }
231
+ ],
232
+ "title": "States"
233
+ },
234
+ {
235
+ "type": "section",
236
+ "title": "Spec",
237
+ "layout": "horizontal",
238
+ "content": [
239
+ {
240
+ "value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Stepper/Stepper_overview_spec.png"
241
+ }
242
+ ]
243
+ }
244
+ ]
245
+ }
246
+ ]
247
+ }
31
248
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { isSvg, isSvgUri } from "../../utils/imageUtils";
3
3
  import { SvgPackage, SvgCssUri } from "../../optionalDependencies";
4
+ import { LogService } from "../../services";
4
5
  const SvgXml = SvgPackage?.SvgXml;
5
6
  // const SvgProps = SvgPackage?.SvgProps; TODO: not sure how (or if) we can use their props
6
7
 
@@ -14,7 +15,7 @@ function SvgImage(props) {
14
15
  } = props;
15
16
  if (!SvgXml) {
16
17
  // eslint-disable-next-line max-len
17
- console.error(`RNUILib Image "svg" prop requires installing "react-native-svg" and "react-native-svg-transformer" dependencies`);
18
+ LogService.error(`RNUILib Image "svg" prop requires installing "react-native-svg" and "react-native-svg-transformer" dependencies`);
18
19
  return null;
19
20
  }
20
21
  if (isSvgUri(data)) {
@@ -143,7 +143,7 @@
143
143
  "description": "Item #2 Subtitle",
144
144
  "content": [
145
145
  {
146
- "value": "https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Docs/thumbnail-horizontal.png?raw=true"
146
+ "snippet": "<Text text30>This is a code snippet</Text>"
147
147
  }
148
148
  ]
149
149
  },
@@ -285,38 +285,6 @@
285
285
  "description": "html:<h2>Title</h2><p>This is a html content</p><ul><li>item 1</li><li>item 2</li></ul>"
286
286
  }
287
287
  ]
288
- },
289
- {
290
- "title": "Code",
291
- "sections": [
292
- {
293
- "title": "Usage",
294
- "type": "usage"
295
- },
296
- {
297
- "type": "info"
298
- },
299
- {
300
- "type": "tip"
301
- },
302
- {
303
- "type": "banner",
304
- "title": "NOTE",
305
- "description": "This is an interesting information"
306
- },
307
- {
308
- "type": "banner",
309
- "title": "Banner",
310
- "description": "This is some massage to the user",
311
- "color": "pink",
312
- "icon": ""
313
- },
314
- {
315
- "type": "props",
316
- "title": "API",
317
- "description": "This is the list of additional props for the Text component"
318
- }
319
- ]
320
288
  }
321
289
  ]
322
290
  }