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
|
@@ -13,14 +13,166 @@
|
|
|
13
13
|
"description": "The identifier value of the ColorSwatch in a ColorSwatch palette",
|
|
14
14
|
"note": "Must be different than other ColorSwatches in the same group"
|
|
15
15
|
},
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
{
|
|
17
|
+
"name": "color",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The color of the ColorSwatch"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "selected",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Is the initial state is selected"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "animated",
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "Is first render should be animated"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "onPress",
|
|
33
|
+
"type": "(value: string, colorInfo: ColorInfo) => void",
|
|
34
|
+
"description": "Callback from press event"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "index",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"description": "The index of the Swatch if in array"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "style",
|
|
43
|
+
"type": "ViewStyle",
|
|
44
|
+
"description": "Component's style"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "unavailable",
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "Is the initial state is unavailable"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "size",
|
|
53
|
+
"type": "number",
|
|
54
|
+
"description": "Color Swatch size"
|
|
55
|
+
}
|
|
24
56
|
],
|
|
25
|
-
"snippet": [
|
|
57
|
+
"snippet": [
|
|
58
|
+
"<ColorSwatch color={Colors.red30$1} selected={true$2} onPress={() => console.log('pressed')$3}/>"
|
|
59
|
+
],
|
|
60
|
+
"docs": {
|
|
61
|
+
"hero": {
|
|
62
|
+
"title": "ColorSwatch",
|
|
63
|
+
"description": "A swatch is a sample of a color. Swatches behavior is somewhat similar to this of a RadioButton, so only a single swatch can be selected at a given moment. ",
|
|
64
|
+
"type": "hero",
|
|
65
|
+
"layout": "horizontal",
|
|
66
|
+
"content": [
|
|
67
|
+
{
|
|
68
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ColorSwatch/ColorSwatch_cover.png"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"tabs": [
|
|
73
|
+
{
|
|
74
|
+
"title": "Overview",
|
|
75
|
+
"sections": [
|
|
76
|
+
{
|
|
77
|
+
"type": "table",
|
|
78
|
+
"columns": [
|
|
79
|
+
"Style",
|
|
80
|
+
"Default state",
|
|
81
|
+
"Selected",
|
|
82
|
+
"Unavailable"
|
|
83
|
+
],
|
|
84
|
+
"items": [
|
|
85
|
+
{
|
|
86
|
+
"title": "Light color",
|
|
87
|
+
"content": [
|
|
88
|
+
{
|
|
89
|
+
"background": "#E8ECF0",
|
|
90
|
+
"props": {
|
|
91
|
+
"color": "#FFFFFF"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"background": "#E8ECF0",
|
|
96
|
+
"props": {
|
|
97
|
+
"color": "#FFFFFF",
|
|
98
|
+
"selected": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"background": "#E8ECF0",
|
|
103
|
+
"props": {
|
|
104
|
+
"color": "#FFFFFF",
|
|
105
|
+
"unavailable": true
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"title": "Dark color",
|
|
112
|
+
"content": [
|
|
113
|
+
{
|
|
114
|
+
"background": "#E8ECF0",
|
|
115
|
+
"props": {
|
|
116
|
+
"color": "#000000"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"background": "#E8ECF0",
|
|
121
|
+
"props": {
|
|
122
|
+
"color": "#000000",
|
|
123
|
+
"selected": true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"background": "#E8ECF0",
|
|
128
|
+
"props": {
|
|
129
|
+
"color": "#000000",
|
|
130
|
+
"unavailable": true
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"title": "Transparent",
|
|
137
|
+
"content": [
|
|
138
|
+
{
|
|
139
|
+
"background": "#E8ECF0",
|
|
140
|
+
"props": {
|
|
141
|
+
"transparent": true
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"background": "#E8ECF0",
|
|
146
|
+
"props": {
|
|
147
|
+
"transparent": true,
|
|
148
|
+
"selected": true
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"background": "#E8ECF0",
|
|
153
|
+
"props": {
|
|
154
|
+
"transparent": true,
|
|
155
|
+
"unavailable": true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"title": "Swatch Styles and States"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"type": "section",
|
|
165
|
+
"layout": "horizontal",
|
|
166
|
+
"title": "Spec",
|
|
167
|
+
"description": "markdown:Border width 1px.\n\n‘Unavailable’ swatch can be either tappable or “disabled”. ",
|
|
168
|
+
"content": [
|
|
169
|
+
{
|
|
170
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/ColorSwatch/ColorSwatch_spec.png"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
26
178
|
}
|
|
@@ -7,6 +7,7 @@ import { Colors, Typography } from "../../style";
|
|
|
7
7
|
import TouchableOpacity from "../touchableOpacity";
|
|
8
8
|
import View from "../view";
|
|
9
9
|
import { Constants, asBaseComponent } from "../../commons/new";
|
|
10
|
+
import { LogService } from "../../services";
|
|
10
11
|
import { ConnectionStatusBarProps, DEFAULT_PROPS } from "./types";
|
|
11
12
|
export { ConnectionStatusBarProps };
|
|
12
13
|
|
|
@@ -36,7 +37,8 @@ class ConnectionStatusBar extends PureComponent {
|
|
|
36
37
|
if (NetInfo) {
|
|
37
38
|
this.getInitialConnectionState();
|
|
38
39
|
} else {
|
|
39
|
-
|
|
40
|
+
// eslint-disable-next-line max-len
|
|
41
|
+
LogService.error(`RNUILib ConnectionStatusBar component requires installing "@react-native-community/netinfo" dependency`);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
generateStyles() {
|
|
@@ -11,6 +11,7 @@ import Button from "../button";
|
|
|
11
11
|
import ExpandableOverlay from "../../incubator/expandableOverlay";
|
|
12
12
|
import useOldApi from "./useOldApi";
|
|
13
13
|
import { isSameDate, isSameHourAndMinute } from "../../utils/dateUtils";
|
|
14
|
+
import { LogService } from "../../services";
|
|
14
15
|
/*eslint-disable*/
|
|
15
16
|
/**
|
|
16
17
|
* @description: Date and Time Picker Component that wraps RNDateTimePicker for date and time modes.
|
|
@@ -64,7 +65,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
64
65
|
useEffect(() => {
|
|
65
66
|
if (!RNDateTimePicker) {
|
|
66
67
|
// eslint-disable-next-line max-len
|
|
67
|
-
|
|
68
|
+
LogService.error(`RNUILib DateTimePicker component requires installing "@react-native-community/datetimepicker" dependency`);
|
|
68
69
|
}
|
|
69
70
|
}, []);
|
|
70
71
|
useDidUpdate(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// TODO: delete whole file in v8
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { MomentPackage as moment } from "../../optionalDependencies";
|
|
4
|
+
import { LogService } from "../../services";
|
|
4
5
|
|
|
5
6
|
// This file will be deleted in the next major version,
|
|
6
7
|
// duplicating these here will make this less complicated
|
|
@@ -15,7 +16,8 @@ const useOldApi = props => {
|
|
|
15
16
|
} = props;
|
|
16
17
|
useEffect(() => {
|
|
17
18
|
if (!moment && (dateFormat || timeFormat)) {
|
|
18
|
-
|
|
19
|
+
// eslint-disable-next-line max-len
|
|
20
|
+
LogService.error(`RNUILib DateTimePicker component with date/time format requires installing "moment" dependency`);
|
|
19
21
|
}
|
|
20
22
|
}, [dateFormat, timeFormat]);
|
|
21
23
|
const getStringValue = (value, mode) => {
|
|
@@ -2,12 +2,24 @@
|
|
|
2
2
|
"name": "GridList",
|
|
3
3
|
"category": "lists",
|
|
4
4
|
"description": "An auto-generated grid list that calculate item size according to given props",
|
|
5
|
-
"extends": [
|
|
6
|
-
|
|
5
|
+
"extends": [
|
|
6
|
+
"FlatList"
|
|
7
|
+
],
|
|
8
|
+
"extendsLink": [
|
|
9
|
+
"https://reactnative.dev/docs/flatlist"
|
|
10
|
+
],
|
|
7
11
|
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/GridListScreen.tsx",
|
|
8
12
|
"props": [
|
|
9
|
-
{
|
|
10
|
-
|
|
13
|
+
{
|
|
14
|
+
"name": "numColumns",
|
|
15
|
+
"type": "number",
|
|
16
|
+
"description": "Number of items to show in a row (ignored when passing maxItemWidth)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "itemSpacing",
|
|
20
|
+
"type": "number",
|
|
21
|
+
"description": "Spacing between each item"
|
|
22
|
+
},
|
|
11
23
|
{
|
|
12
24
|
"name": "maxItemWidth",
|
|
13
25
|
"type": "number",
|
|
@@ -42,5 +54,83 @@
|
|
|
42
54
|
" itemSpacing={Spacings.s3$4}",
|
|
43
55
|
" listPadding={Spacings.s5$5}",
|
|
44
56
|
"/>"
|
|
45
|
-
]
|
|
57
|
+
],
|
|
58
|
+
"docs": {
|
|
59
|
+
"hero": {
|
|
60
|
+
"title": "GridList",
|
|
61
|
+
"description": "GridList display a collection of GridListItems organized in a repeated grid pattern. \n\nGridList allows users to scan content based on images and compare items within a collection.",
|
|
62
|
+
"type": "hero",
|
|
63
|
+
"layout": "horizontal",
|
|
64
|
+
"content": [
|
|
65
|
+
{
|
|
66
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_cover.png"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"tabs": [
|
|
71
|
+
{
|
|
72
|
+
"title": "Overview",
|
|
73
|
+
"sections": [
|
|
74
|
+
{
|
|
75
|
+
"type": "list",
|
|
76
|
+
"items": [
|
|
77
|
+
{
|
|
78
|
+
"title": "GridList with Avatars",
|
|
79
|
+
"content": [
|
|
80
|
+
{
|
|
81
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_usage_avatars.png"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"title": "GridList with MediaItems",
|
|
87
|
+
"content": [
|
|
88
|
+
{
|
|
89
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_usage_mediaItems.png"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"layout": "horizontal",
|
|
95
|
+
"title": "Usage Examples"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "list",
|
|
99
|
+
"items": [
|
|
100
|
+
{
|
|
101
|
+
"title": "Option 1 - Max Item Width",
|
|
102
|
+
"description": "Set maximum width of a single item, and amount of items in a row will be set automatically according to screen width.
Columns number will be dynamic according to how many items fit the screen.",
|
|
103
|
+
"content": [
|
|
104
|
+
{
|
|
105
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_columns_maxWidth.png"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"title": "Option 2 - Column Number",
|
|
111
|
+
"description": "Set amount of columns, and items width will be automatic according to screen width. Columns number will be fixed.",
|
|
112
|
+
"content": [
|
|
113
|
+
{
|
|
114
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_columns_number.png"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"title": "Columns Options"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "section",
|
|
123
|
+
"layout": "horizontal",
|
|
124
|
+
"title": "Spec",
|
|
125
|
+
"description": "markdown: \n### Spacing between items\nHorizontal gutter by default is minimum S4 and can be modified. \nVertical gutter is equal to horizontal gutter.\n### Last item counter\nOnce grid reaches Max of items, the last item should get an overlay color and number of remaining items. \nThe item content shouldn’t be displayed. \nThis state is available in the MediaItem and Avatar components.",
|
|
126
|
+
"content": [
|
|
127
|
+
{
|
|
128
|
+
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/GridList/gridList_spec.png"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
46
136
|
}
|