react-native-ui-lib 7.39.0-snapshot.6599 → 7.39.0-snapshot.6618
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 +2 -4
- package/scripts/docs/buildDocsCommon.js +90 -32
- package/src/assets/icons/index.js +26 -0
- package/src/assets/images/index.js +5 -0
- package/src/assets/index.js +5 -2
- package/src/commons/Constants.d.ts +0 -1
- package/src/commons/Constants.js +2 -4
- package/src/components/avatar/index.d.ts +19 -8
- package/src/components/avatar/index.js +2 -4
- package/src/components/card/index.js +1 -1
- package/src/components/checkbox/index.js +1 -1
- package/src/components/chip/index.js +1 -1
- package/src/components/chipsInput/index.js +2 -2
- package/src/components/colorPicker/ColorPickerDialogHeader.js +2 -2
- package/src/components/colorPicker/ColorPickerPreview.js +2 -2
- package/src/components/colorPicker/index.js +1 -1
- package/src/components/colorSwatch/index.js +3 -2
- package/src/components/dateTimePicker/index.js +2 -2
- package/src/components/hint/hint.api.json +5 -39
- package/src/components/hint/index.js +3 -2
- package/src/components/icon/index.js +5 -6
- package/src/components/modal/TopBar.js +1 -1
- package/src/components/modal/api/modalTopBar.api.json +1 -1
- package/src/components/overlay/index.js +6 -4
- package/src/components/picker/PickerItem.js +1 -1
- package/src/components/picker/PickerItemsList.js +6 -2
- package/src/components/picker/PickerSelectionStatusBar.d.ts +3 -0
- package/src/components/picker/PickerSelectionStatusBar.js +62 -0
- package/src/components/picker/helpers/useFieldType.js +2 -2
- package/src/components/picker/helpers/usePickerSelection.d.ts +4 -1
- package/src/components/picker/helpers/usePickerSelection.js +16 -3
- package/src/components/picker/index.js +11 -5
- package/src/components/picker/types.d.ts +48 -1
- package/src/components/scrollBar/index.js +2 -2
- package/src/components/stepper/assets/minusSmall.png +0 -0
- package/src/components/stepper/assets/minusSmall@1.5x.png +0 -0
- package/src/components/stepper/assets/minusSmall@2x.png +0 -0
- package/src/components/stepper/assets/minusSmall@3x.png +0 -0
- package/src/components/stepper/assets/minusSmall@4x.png +0 -0
- package/src/components/stepper/assets/plusSmall.png +0 -0
- package/src/components/stepper/assets/plusSmall@1.5x.png +0 -0
- package/src/components/stepper/assets/plusSmall@2x.png +0 -0
- package/src/components/stepper/assets/plusSmall@3x.png +0 -0
- package/src/components/stepper/assets/plusSmall@4x.png +0 -0
- package/src/components/stepper/index.js +8 -3
- package/src/components/test.api.json +32 -0
- package/src/components/textField/ClearButton.js +1 -1
- package/src/components/timeline/timeline.api.json +106 -57
- package/src/components/toast/index.js +1 -1
- package/src/components/wizard/WizardStates.js +4 -3
- package/src/incubator/dialog/useDialogContent.js +1 -1
- package/src/incubator/slider/Thumb.js +1 -8
- package/src/incubator/toast/toast.api.json +7 -63
- package/src/assets/internal/icons/index.js +0 -50
- package/src/assets/internal/icons/index.web.js +0 -50
- package/src/assets/internal/images/index.js +0 -26
- package/src/assets/internal/images/index.web.js +0 -26
- package/src/assets/internal/index.d.ts +0 -4
- package/src/assets/internal/index.js +0 -8
- /package/src/assets/{internal/icons/checkSmall.png → icons/check-small.png} +0 -0
- /package/src/assets/{internal/icons/checkSmall@1.5x.png → icons/check-small@1.5x.png} +0 -0
- /package/src/assets/{internal/icons/checkSmall@2x.png → icons/check-small@2x.png} +0 -0
- /package/src/assets/{internal/icons/checkSmall@3x.png → icons/check-small@3x.png} +0 -0
- /package/src/assets/{internal/icons/checkSmall@4x.png → icons/check-small@4x.png} +0 -0
- /package/src/assets/{internal/icons → icons}/check.png +0 -0
- /package/src/assets/{internal/icons → icons}/check@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/check@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/check@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/check@4x.png +0 -0
- /package/src/assets/{internal/icons → icons}/minusSmall.png +0 -0
- /package/src/assets/{internal/icons → icons}/minusSmall@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/minusSmall@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/minusSmall@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/minusSmall@4x.png +0 -0
- /package/src/assets/{internal/icons → icons}/plusSmall.png +0 -0
- /package/src/assets/{internal/icons → icons}/plusSmall@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/plusSmall@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/plusSmall@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/plusSmall@4x.png +0 -0
- /package/src/assets/{internal/icons → icons}/search.png +0 -0
- /package/src/assets/{internal/icons → icons}/search@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/search@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/search@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/search@4x.png +0 -0
- /package/src/assets/{internal/icons → icons}/x.png +0 -0
- /package/src/assets/{internal/icons → icons}/x@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/x@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xFlat.png +0 -0
- /package/src/assets/{internal/icons → icons}/xFlat@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xFlat@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xFlat@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xFlat@4x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xMedium.png +0 -0
- /package/src/assets/{internal/icons → icons}/xMedium@1.5x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xMedium@2x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xMedium@3x.png +0 -0
- /package/src/assets/{internal/icons → icons}/xMedium@4x.png +0 -0
- /package/src/assets/{internal/images → images}/gradient.png +0 -0
- /package/src/{assets/internal/icons → components/chipsInput/assets}/xSmall.png +0 -0
- /package/src/{assets/internal/icons → components/chipsInput/assets}/xSmall@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/chipsInput/assets}/xSmall@2x.png +0 -0
- /package/src/{assets/internal/icons → components/chipsInput/assets}/xSmall@3x.png +0 -0
- /package/src/{assets/internal/icons → components/chipsInput/assets}/xSmall@4x.png +0 -0
- /package/src/{assets/internal/images/transparentSwatch.png → components/colorSwatch/assets/transparentSwatch/TransparentSwatch.png} +0 -0
- /package/src/{assets/internal/images/transparentSwatch@1.5x.png → components/colorSwatch/assets/transparentSwatch/TransparentSwatch@1.5x.png} +0 -0
- /package/src/{assets/internal/images/transparentSwatch@2x.png → components/colorSwatch/assets/transparentSwatch/TransparentSwatch@2x.png} +0 -0
- /package/src/{assets/internal/images/transparentSwatch@3x.png → components/colorSwatch/assets/transparentSwatch/TransparentSwatch@3x.png} +0 -0
- /package/src/{assets/internal/images/transparentSwatch@4x.png → components/colorSwatch/assets/transparentSwatch/TransparentSwatch@4x.png} +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipMiddle.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipMiddle@1.5x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipMiddle@2x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipMiddle@3x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipMiddle@4x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipSide.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipSide@1.5x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipSide@2x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipSide@3x.png +0 -0
- /package/src/{assets/internal/images → components/hint/assets}/hintTipSide@4x.png +0 -0
- /package/src/{assets/internal/images/gradientOverlayHigh.png → components/overlay/assets/GradientOverlayHigh.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayHigh@1.5x.png → components/overlay/assets/GradientOverlayHigh@1.5x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayHigh@2x.png → components/overlay/assets/GradientOverlayHigh@2x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayHigh@3x.png → components/overlay/assets/GradientOverlayHigh@3x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayHigh@4x.png → components/overlay/assets/GradientOverlayHigh@4x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayLow.png → components/overlay/assets/GradientOverlayLow.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayLow@1.5x.png → components/overlay/assets/GradientOverlayLow@1.5x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayLow@2x.png → components/overlay/assets/GradientOverlayLow@2x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayLow@3x.png → components/overlay/assets/GradientOverlayLow@3x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayLow@4x.png → components/overlay/assets/GradientOverlayLow@4x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayMedium.png → components/overlay/assets/GradientOverlayMedium.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayMedium@1.5x.png → components/overlay/assets/GradientOverlayMedium@1.5x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayMedium@2x.png → components/overlay/assets/GradientOverlayMedium@2x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayMedium@3x.png → components/overlay/assets/GradientOverlayMedium@3x.png} +0 -0
- /package/src/{assets/internal/images/gradientOverlayMedium@4x.png → components/overlay/assets/GradientOverlayMedium@4x.png} +0 -0
- /package/src/{assets/internal/icons/chevronDown.png → components/picker/assets/dropdown.png} +0 -0
- /package/src/{assets/internal/icons/chevronDown@1.5x.png → components/picker/assets/dropdown@1.5x.png} +0 -0
- /package/src/{assets/internal/icons/chevronDown@2x.png → components/picker/assets/dropdown@2x.png} +0 -0
- /package/src/{assets/internal/icons/chevronDown@3x.png → components/picker/assets/dropdown@3x.png} +0 -0
- /package/src/{assets/internal/icons/chevronDown@4x.png → components/picker/assets/dropdown@4x.png} +0 -0
- /package/src/{assets/internal/images → components/scrollBar/assets}/gradientOverlay.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutline.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutline@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutline@2x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutline@3x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutline@4x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutlineSmall.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutlineSmall@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutlineSmall@2x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutlineSmall@3x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/minusOutlineSmall@4x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutline.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutline@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutline@2x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutline@3x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutline@4x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutlineSmall.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutlineSmall@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutlineSmall@2x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutlineSmall@3x.png +0 -0
- /package/src/{assets/internal/icons → components/stepper/assets}/plusOutlineSmall@4x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/checkMarkSmall.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/checkMarkSmall@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/checkMarkSmall@2x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/checkMarkSmall@3x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/checkMarkSmall@4x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/exclamationSmall.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/exclamationSmall@1.5x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/exclamationSmall@2x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/exclamationSmall@3x.png +0 -0
- /package/src/{assets/internal/icons → components/wizard/assets}/exclamationSmall@4x.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ui-lib",
|
|
3
|
-
"version": "7.39.0-snapshot.
|
|
3
|
+
"version": "7.39.0-snapshot.6618",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
@@ -32,15 +32,13 @@
|
|
|
32
32
|
"pre-push": "npm run build:dev && npm run test",
|
|
33
33
|
"docs:deploy": "./scripts/docs/deployDocs.sh",
|
|
34
34
|
"docs:build": "node scripts/docs/buildDocs.js",
|
|
35
|
-
"docs:start": "(cd docuilib && yarn start)",
|
|
36
35
|
"calendar:createMocks": "node scripts/createCalendarMockData.js",
|
|
37
36
|
"snippets:build": "node scripts/generateSnippets.js",
|
|
38
37
|
"release": "node ./scripts/release/release.js",
|
|
39
38
|
"releaseDemo": "./scripts/release/releaseDemo.sh",
|
|
40
39
|
"releaseDocs": "./scripts/release/releaseDocs.sh",
|
|
41
40
|
"releaseEslint": "./scripts/release/releaseEslint.sh",
|
|
42
|
-
"releaseNative": "./scripts/release/releaseNative.sh"
|
|
43
|
-
"updateWebAssets": "node scripts/assets/extractDimensions.js"
|
|
41
|
+
"releaseNative": "./scripts/release/releaseNative.sh"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"babel-plugin-transform-inline-environment-variables": "^0.0.2",
|
|
@@ -7,7 +7,6 @@ const fs = require('fs');
|
|
|
7
7
|
|
|
8
8
|
const COMPONENTS_DOCS_DIR = './docs/components';
|
|
9
9
|
const SERVICES_DOCS_DIR = './docs/services';
|
|
10
|
-
const FOUNDATION_DOCS_DIR = './docs/foundation';
|
|
11
10
|
|
|
12
11
|
const VALID_COMPONENTS_CATEGORIES = [
|
|
13
12
|
'foundation',
|
|
@@ -31,9 +30,6 @@ const VALID_COMPONENTS_CATEGORIES = [
|
|
|
31
30
|
|
|
32
31
|
function buildDocs(apiFolders, componentsPreProcess) {
|
|
33
32
|
let components = readComponentsFromApiFiles(apiFolders);
|
|
34
|
-
|
|
35
|
-
logStatistics(components);
|
|
36
|
-
|
|
37
33
|
components = componentsPreProcess?.(components) ?? components;
|
|
38
34
|
resetDocsDir();
|
|
39
35
|
processComponents(components);
|
|
@@ -88,26 +84,22 @@ function processComponents(components) {
|
|
|
88
84
|
content += `sidebar_label: ${componentName}\n`;
|
|
89
85
|
content += '---\n\n';
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
if (component.docs) {
|
|
88
|
+
content += `import ComponentPage from '@site/src/components/ComponentPage';\n\n`;
|
|
89
|
+
const componentObject = JSON.stringify(component);
|
|
90
|
+
content += `<ComponentPage component={${componentObject}}/>\n`;
|
|
91
|
+
} else {
|
|
92
|
+
content += `${buildOldDocs(component)}\n`;
|
|
93
|
+
}
|
|
94
|
+
|
|
94
95
|
|
|
95
96
|
let dirPath;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
dirPath = `${FOUNDATION_DOCS_DIR}`;
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
default: {
|
|
106
|
-
const componentParentDir =
|
|
107
|
-
componentParentName || isParentComponent ? `/${componentParentName || componentName}` : '';
|
|
108
|
-
dirPath = `${COMPONENTS_DOCS_DIR}/${component.category}${componentParentDir}`;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
97
|
+
if (component.category === 'services') {
|
|
98
|
+
dirPath = `${SERVICES_DOCS_DIR}`;
|
|
99
|
+
} else {
|
|
100
|
+
const componentParentDir =
|
|
101
|
+
componentParentName || isParentComponent ? `/${componentParentName || componentName}` : '';
|
|
102
|
+
dirPath = `${COMPONENTS_DOCS_DIR}/${component.category}${componentParentDir}`;
|
|
111
103
|
}
|
|
112
104
|
|
|
113
105
|
if (!fs.existsSync(dirPath)) {
|
|
@@ -133,20 +125,86 @@ function generateExtendsLink(extendsLink) {
|
|
|
133
125
|
return extendsText;
|
|
134
126
|
}
|
|
135
127
|
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
128
|
+
function buildOldDocs(component) {
|
|
129
|
+
let content = '';
|
|
130
|
+
content += `import UILivePreview from '@site/src/components/UILivePreview';\n\n`;
|
|
131
|
+
|
|
132
|
+
/* General Info */
|
|
133
|
+
content += `${component.description} \n`;
|
|
134
|
+
if (typeof component.example === 'string') {
|
|
135
|
+
content += `[(code example)](${component.example})\n`;
|
|
136
|
+
} else if (Array.isArray(component.example)) {
|
|
137
|
+
content += '(code examples: ';
|
|
138
|
+
component.example.forEach((example, index) => {
|
|
139
|
+
const slashIndex = example.lastIndexOf('/');
|
|
140
|
+
const dotIndex = example.lastIndexOf('.');
|
|
141
|
+
content += `${index > 0 ? ', ' : ''}[${example.slice(slashIndex + 1, dotIndex)}](${example})`;
|
|
142
|
+
});
|
|
143
|
+
content += ')\n';
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (component.extends) {
|
|
147
|
+
let extendsText = component.extends?.join(', ');
|
|
148
|
+
if (component.extendsLink) {
|
|
149
|
+
extendsText = `[${extendsText}](${component.extendsLink})`;
|
|
150
|
+
} else {
|
|
151
|
+
extendsText = _.map(component.extends, generateExtendsLink).join(', ');
|
|
152
|
+
}
|
|
153
|
+
content += ':::info\n';
|
|
154
|
+
content += `This component extends **${extendsText}** props.\n`;
|
|
155
|
+
content += ':::\n';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (component.modifiers) {
|
|
159
|
+
content += ':::tip\n';
|
|
160
|
+
content += `This component support **${component.modifiers?.join(', ')}** modifiers.\n`;
|
|
161
|
+
content += ':::\n';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (component.caution) {
|
|
165
|
+
content += ':::caution\n';
|
|
166
|
+
content += `${component.caution}\n`;
|
|
167
|
+
content += ':::\n';
|
|
168
|
+
}
|
|
141
169
|
|
|
142
|
-
if (
|
|
143
|
-
|
|
170
|
+
if (component.note) {
|
|
171
|
+
content += ':::note\n';
|
|
172
|
+
content += `${component.note}\n`;
|
|
173
|
+
content += ':::\n';
|
|
144
174
|
}
|
|
145
175
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
176
|
+
/* Images */
|
|
177
|
+
content += `<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}>`;
|
|
178
|
+
component.images?.forEach(image => {
|
|
179
|
+
content += `<img style={{maxHeight: '420px'}} src={'${image}'}/>`;
|
|
180
|
+
content += '\n\n';
|
|
181
|
+
});
|
|
182
|
+
content += '</div>\n\n';
|
|
183
|
+
|
|
184
|
+
/* Snippet */
|
|
185
|
+
if (component.snippet) {
|
|
186
|
+
content += `### Usage\n`;
|
|
187
|
+
content += `<UILivePreview code={\`${component.snippet
|
|
188
|
+
?.map(item => _.replace(item, new RegExp(/\$[1-9]/, 'g'), ''))
|
|
189
|
+
.join('\n')
|
|
190
|
+
.toString()}\`}/>\n\n`;
|
|
191
|
+
} else {
|
|
192
|
+
console.warn(`${component.name} does not have a snippet`);
|
|
149
193
|
}
|
|
194
|
+
|
|
195
|
+
/* Props */
|
|
196
|
+
content += '## API\n';
|
|
197
|
+
_.sortBy(component.props, p => p.name)?.forEach(prop => {
|
|
198
|
+
content += `### ${prop.name}\n`;
|
|
199
|
+
if (prop.note) {
|
|
200
|
+
content += `#### ${prop.note}\n`;
|
|
201
|
+
}
|
|
202
|
+
content += `${prop.description}\n`;
|
|
203
|
+
// content += `<span style={{color: 'grey'}}>${_.escape(prop.type)}</span>\n\n`;
|
|
204
|
+
content += `\`${prop.type} \` \n\n`;
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return content;
|
|
150
208
|
}
|
|
151
209
|
|
|
152
210
|
module.exports = {buildDocs};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const icons = {
|
|
2
|
+
get check() {
|
|
3
|
+
return require('./check.png');
|
|
4
|
+
},
|
|
5
|
+
get checkSmall() {
|
|
6
|
+
return require('./check-small.png');
|
|
7
|
+
},
|
|
8
|
+
get minusSmall() {
|
|
9
|
+
return require('./minusSmall.png');
|
|
10
|
+
},
|
|
11
|
+
get plusSmall() {
|
|
12
|
+
return require('./plusSmall.png');
|
|
13
|
+
},
|
|
14
|
+
get search() {
|
|
15
|
+
return require('./search.png');
|
|
16
|
+
},
|
|
17
|
+
get x() {
|
|
18
|
+
return require('./x.png');
|
|
19
|
+
},
|
|
20
|
+
get xMedium() {
|
|
21
|
+
return require('./xMedium.png');
|
|
22
|
+
},
|
|
23
|
+
get xFlat() {
|
|
24
|
+
return require('./xFlat.png');
|
|
25
|
+
}
|
|
26
|
+
};
|
package/src/assets/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Assets } from "./Assets";
|
|
2
2
|
export default new Assets().loadAssetsGroup('', {
|
|
3
|
+
get icons() {
|
|
4
|
+
return require("./icons").icons;
|
|
5
|
+
},
|
|
3
6
|
get emojis() {
|
|
4
7
|
return require("./emojis").emojis;
|
|
5
8
|
},
|
|
6
|
-
get
|
|
7
|
-
return require("./
|
|
9
|
+
get images() {
|
|
10
|
+
return require("./images").images;
|
|
8
11
|
}
|
|
9
12
|
});
|
package/src/commons/Constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Platform, Dimensions, NativeModules, I18nManager, AccessibilityInfo, StatusBar
|
|
1
|
+
import { Platform, Dimensions, NativeModules, I18nManager, AccessibilityInfo, StatusBar } from 'react-native';
|
|
2
2
|
export let orientations = /*#__PURE__*/function (orientations) {
|
|
3
3
|
orientations["PORTRAIT"] = "portrait";
|
|
4
4
|
orientations["LANDSCAPE"] = "landscape";
|
|
@@ -166,9 +166,7 @@ const constants = {
|
|
|
166
166
|
},
|
|
167
167
|
/* Keyboard */
|
|
168
168
|
backspaceKey: 'Backspace',
|
|
169
|
-
enterKey: 'Enter'
|
|
170
|
-
/* Font scale */
|
|
171
|
-
getFontScale: PixelRatio.getFontScale
|
|
169
|
+
enterKey: 'Enter'
|
|
172
170
|
};
|
|
173
171
|
setStatusBarHeight();
|
|
174
172
|
Dimensions.addEventListener('change', updateConstants);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ImagePropsBase, ImageStyle, TextStyle,
|
|
2
|
+
import { StyleProp, ViewStyle, ImagePropsBase, ImageStyle, TextStyle, AccessibilityProps } from 'react-native';
|
|
3
3
|
import { BadgeProps } from '../badge';
|
|
4
4
|
import { ImageProps } from '../image';
|
|
5
5
|
import { AnimatedImageProps } from '../animatedImage';
|
|
@@ -95,7 +95,6 @@ export type AvatarProps = Pick<AccessibilityProps, 'accessibilityLabel'> & Props
|
|
|
95
95
|
* The label color
|
|
96
96
|
*/
|
|
97
97
|
labelColor?: string;
|
|
98
|
-
labelEllipsizeMode?: TextProps['ellipsizeMode'];
|
|
99
98
|
/**
|
|
100
99
|
* ribbon label to display on the avatar
|
|
101
100
|
*/
|
|
@@ -163,14 +162,21 @@ declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "
|
|
|
163
162
|
* Image props object
|
|
164
163
|
*/
|
|
165
164
|
imageProps?: Partial<Omit<import("react-native").ImageProps, "source"> & Pick<import("react-native").ImageBackgroundProps, "imageStyle"> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & import("../..").RecorderProps & {
|
|
165
|
+
/**
|
|
166
|
+
* Avatar colors to be used when useAutoColors is true
|
|
167
|
+
*/
|
|
166
168
|
sourceTransformer?: ((props: any) => import("../image").ImageSourceType) | undefined;
|
|
167
169
|
assetName?: string | undefined;
|
|
168
170
|
assetGroup?: string | undefined;
|
|
169
171
|
tintColor?: string | undefined;
|
|
170
|
-
supportRTL?: boolean | undefined;
|
|
172
|
+
supportRTL?: boolean | undefined; /**
|
|
173
|
+
* Background color for Avatar
|
|
174
|
+
*/
|
|
171
175
|
cover?: boolean | undefined;
|
|
172
176
|
aspectRatio?: number | undefined;
|
|
173
|
-
overlayType?: string | undefined;
|
|
177
|
+
overlayType?: string | undefined; /**
|
|
178
|
+
* Image props object
|
|
179
|
+
*/
|
|
174
180
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
175
181
|
overlayColor?: string | undefined;
|
|
176
182
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
@@ -224,7 +230,6 @@ declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "
|
|
|
224
230
|
* The label color
|
|
225
231
|
*/
|
|
226
232
|
labelColor?: string | undefined;
|
|
227
|
-
labelEllipsizeMode?: TextProps['ellipsizeMode'];
|
|
228
233
|
/**
|
|
229
234
|
* ribbon label to display on the avatar
|
|
230
235
|
*/
|
|
@@ -286,14 +291,21 @@ declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps,
|
|
|
286
291
|
* Image props object
|
|
287
292
|
*/
|
|
288
293
|
imageProps?: Partial<Omit<import("react-native").ImageProps, "source"> & Pick<import("react-native").ImageBackgroundProps, "imageStyle"> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & import("../..").RecorderProps & {
|
|
294
|
+
/**
|
|
295
|
+
* Avatar colors to be used when useAutoColors is true
|
|
296
|
+
*/
|
|
289
297
|
sourceTransformer?: ((props: any) => import("../image").ImageSourceType) | undefined;
|
|
290
298
|
assetName?: string | undefined;
|
|
291
299
|
assetGroup?: string | undefined;
|
|
292
300
|
tintColor?: string | undefined;
|
|
293
|
-
supportRTL?: boolean | undefined;
|
|
301
|
+
supportRTL?: boolean | undefined; /**
|
|
302
|
+
* Background color for Avatar
|
|
303
|
+
*/
|
|
294
304
|
cover?: boolean | undefined;
|
|
295
305
|
aspectRatio?: number | undefined;
|
|
296
|
-
overlayType?: string | undefined;
|
|
306
|
+
overlayType?: string | undefined; /**
|
|
307
|
+
* Image props object
|
|
308
|
+
*/
|
|
297
309
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
298
310
|
overlayColor?: string | undefined;
|
|
299
311
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
@@ -347,7 +359,6 @@ declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps,
|
|
|
347
359
|
* The label color
|
|
348
360
|
*/
|
|
349
361
|
labelColor?: string | undefined;
|
|
350
|
-
labelEllipsizeMode?: "middle" | "head" | "tail" | "clip" | undefined;
|
|
351
362
|
/**
|
|
352
363
|
* ribbon label to display on the avatar
|
|
353
364
|
*/
|
|
@@ -56,7 +56,6 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
56
56
|
useAutoColors,
|
|
57
57
|
autoColorsConfig,
|
|
58
58
|
containerStyle,
|
|
59
|
-
labelEllipsizeMode = 'clip',
|
|
60
59
|
onPress,
|
|
61
60
|
children
|
|
62
61
|
} = themeProps;
|
|
@@ -179,7 +178,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
179
178
|
const Container = onPress ? TouchableOpacity : View;
|
|
180
179
|
return <Container style={_containerStyle} ref={ref} testID={testID} onPress={onPress} accessible={!_isUndefined(onPress)} accessibilityLabel={'Avatar'} accessibilityRole={onPress ? 'button' : 'image'} hitSlop={onPress ? hitTargetPadding : undefined} {...accessibilityProps}>
|
|
181
180
|
<View testID={`${testID}.container`} style={textContainerStyle}>
|
|
182
|
-
{!_isUndefined(text) && <Text numberOfLines={1}
|
|
181
|
+
{!_isUndefined(text) && <Text numberOfLines={1} style={textStyle} testID={`${testID}.label`}>
|
|
183
182
|
{text}
|
|
184
183
|
</Text>}
|
|
185
184
|
</View>
|
|
@@ -195,8 +194,7 @@ const styles = StyleSheet.create({
|
|
|
195
194
|
...StyleSheet.absoluteFillObject,
|
|
196
195
|
alignItems: 'center',
|
|
197
196
|
justifyContent: 'center',
|
|
198
|
-
borderRadius: BorderRadiuses.br100
|
|
199
|
-
overflow: 'hidden'
|
|
197
|
+
borderRadius: BorderRadiuses.br100
|
|
200
198
|
},
|
|
201
199
|
initialsContainerWithInset: {
|
|
202
200
|
top: 1,
|
|
@@ -22,7 +22,7 @@ const DEFAULT_SELECTION_PROPS = {
|
|
|
22
22
|
borderWidth: 2,
|
|
23
23
|
color: Colors.$backgroundPrimaryHeavy,
|
|
24
24
|
indicatorSize: 20,
|
|
25
|
-
icon: Assets.
|
|
25
|
+
icon: Assets.icons.checkSmall,
|
|
26
26
|
iconColor: Colors.$iconDefaultLight,
|
|
27
27
|
hideIndicator: false
|
|
28
28
|
};
|
|
@@ -167,7 +167,7 @@ class Checkbox extends Component {
|
|
|
167
167
|
}]}>
|
|
168
168
|
<AnimatedIcon style={[this.styles.selectedIcon, {
|
|
169
169
|
transform: this.animationStyle.transform
|
|
170
|
-
}]} source={indeterminate ? Assets.
|
|
170
|
+
}]} source={indeterminate ? Assets.icons.minusSmall : selectedIcon || Assets.icons.checkSmall} testID={`${testID}.selected`} tintColor={this.getTintColor()} />
|
|
171
171
|
</Animated.View>}
|
|
172
172
|
</TouchableOpacity>
|
|
173
173
|
);
|
|
@@ -5,8 +5,8 @@ import { StyleSheet } from 'react-native';
|
|
|
5
5
|
import { Constants } from "../../commons/new";
|
|
6
6
|
import { useCombinedRefs, useDidUpdate } from "../../hooks";
|
|
7
7
|
import TextField from "../textField";
|
|
8
|
-
import Assets from "../../assets";
|
|
9
8
|
import Chip from "../chip";
|
|
9
|
+
const removeIcon = require("./assets/xSmall.png");
|
|
10
10
|
export let ChipsInputChangeReason = /*#__PURE__*/function (ChipsInputChangeReason) {
|
|
11
11
|
ChipsInputChangeReason["Added"] = "added";
|
|
12
12
|
ChipsInputChangeReason["Removed"] = "removed";
|
|
@@ -85,7 +85,7 @@ const ChipsInput = forwardRef((props, refToForward) => {
|
|
|
85
85
|
return <Chip key={index} customValue={index}
|
|
86
86
|
// resetSpacings
|
|
87
87
|
// paddingH-s2
|
|
88
|
-
marginR-s2 marginB-s2 dismissIcon={
|
|
88
|
+
marginR-s2 marginB-s2 dismissIcon={removeIcon} recorderTag={'mask'} {...defaultChipProps} {...chip.invalid ? invalidChipProps : undefined} {...chip} onPress={onChipPress} onDismiss={isMarkedForRemoval ? removeMarkedChip : undefined} />;
|
|
89
89
|
};
|
|
90
90
|
const chipList = useMemo(() => {
|
|
91
91
|
return <>
|
|
@@ -16,10 +16,10 @@ const ColorPickerDialogHeader = props => {
|
|
|
16
16
|
onDonePressed
|
|
17
17
|
} = props;
|
|
18
18
|
return <View row spread bg-$backgroundDefault paddingH-20 style={styles.header}>
|
|
19
|
-
<Button link iconSource={Assets.
|
|
19
|
+
<Button link iconSource={Assets.icons.x} iconStyle={{
|
|
20
20
|
tintColor: Colors.$iconDefault
|
|
21
21
|
}} onPress={onDismiss} accessibilityLabel={_get(accessibilityLabels, 'dismissButton')} testID={`${testID}.dialog.cancel`} />
|
|
22
|
-
<Button color={doneButtonColor} disabled={!valid} link iconSource={Assets.
|
|
22
|
+
<Button color={doneButtonColor} disabled={!valid} link iconSource={Assets.icons.check} onPress={onDonePressed} accessibilityLabel={_get(accessibilityLabels, 'doneButton')} testID={`${testID}.dialog.done`} />
|
|
23
23
|
</View>;
|
|
24
24
|
};
|
|
25
25
|
export default ColorPickerDialogHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import { StyleSheet, TextInput, I18nManager } from 'react-native';
|
|
2
|
+
import { StyleSheet, TextInput, PixelRatio, I18nManager } from 'react-native';
|
|
3
3
|
import { Colors, Typography } from "../../style";
|
|
4
4
|
import { BORDER_RADIUS, getHexString, getTextColor } from "./ColorPickerPresenter";
|
|
5
5
|
import View from "../view";
|
|
@@ -19,7 +19,7 @@ const ColorPickerPreview = props => {
|
|
|
19
19
|
const textInput = useRef(null);
|
|
20
20
|
const hex = getHexString(color);
|
|
21
21
|
const textColor = getTextColor(hex);
|
|
22
|
-
const fontScale =
|
|
22
|
+
const fontScale = PixelRatio.getFontScale();
|
|
23
23
|
const value = Colors.isTransparent(text) ? '000000' : text;
|
|
24
24
|
return <View style={[styles.preview, {
|
|
25
25
|
backgroundColor: hex
|
|
@@ -42,7 +42,7 @@ const ColorPicker = props => {
|
|
|
42
42
|
<View style={[styles.buttonContainer, {
|
|
43
43
|
backgroundColor
|
|
44
44
|
}]}>
|
|
45
|
-
<Button color={Colors.$textDefault} outlineColor={Colors.$textDefault} style={styles.button} round outline iconSource={Assets.
|
|
45
|
+
<Button color={Colors.$textDefault} outlineColor={Colors.$textDefault} style={styles.button} round outline iconSource={Assets.icons.plusSmall} onPress={showDialog} testID={`${testID}-button`} accessibilityLabel={accessibilityLabels?.addButton} />
|
|
46
46
|
</View>
|
|
47
47
|
<ColorPickerDialog {...props} key={initialColor} visible={show} onDismiss={hideDialog} accessibilityLabels={{
|
|
48
48
|
dismissButton: accessibilityLabels?.dismissButton,
|
|
@@ -6,6 +6,7 @@ import { asBaseComponent, Constants } from "../../commons/new";
|
|
|
6
6
|
import View from "../view";
|
|
7
7
|
import TouchableOpacity from "../touchableOpacity";
|
|
8
8
|
import Image from "../image";
|
|
9
|
+
const transparentImage = require("./assets/transparentSwatch/TransparentSwatch.png");
|
|
9
10
|
const DEFAULT_SIZE = Constants.isTablet ? 44 : 36;
|
|
10
11
|
export const SWATCH_MARGIN = 12;
|
|
11
12
|
export const SWATCH_SIZE = DEFAULT_SIZE;
|
|
@@ -140,10 +141,10 @@ class ColorSwatch extends PureComponent {
|
|
|
140
141
|
height: size,
|
|
141
142
|
borderRadius: size / 2
|
|
142
143
|
}, style]} onLayout={this.onLayout} {...this.getAccessibilityInfo()}>
|
|
143
|
-
{Colors.isTransparent(this.color) && <Image source={
|
|
144
|
+
{Colors.isTransparent(this.color) && <Image source={transparentImage} style={this.styles.transparentImage} resizeMode={'cover'} />}
|
|
144
145
|
{unavailable ? <View style={[this.styles.unavailable, {
|
|
145
146
|
backgroundColor: tintColor
|
|
146
|
-
}]} /> : <Animated.Image source={Assets.
|
|
147
|
+
}]} /> : <Animated.Image source={Assets.icons.check} style={{
|
|
147
148
|
tintColor,
|
|
148
149
|
opacity: isSelected,
|
|
149
150
|
transform: [{
|
|
@@ -137,10 +137,10 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
137
137
|
}, [onDonePressed, toggleExpandableOverlay]);
|
|
138
138
|
const renderHeader = () => {
|
|
139
139
|
return <View row spread bg-$backgroundDefault backgroundColor={backgroundColor} paddingH-20 style={[styles.header, headerStyle]} testID={`${testID}.header`}>
|
|
140
|
-
<Button link iconSource={Assets.
|
|
140
|
+
<Button link iconSource={Assets.icons.x} iconStyle={{
|
|
141
141
|
tintColor: Colors.$iconDefault
|
|
142
142
|
}} testID={`${testID}.cancel`} {...cancelButtonProps} onPress={toggleExpandableOverlay} />
|
|
143
|
-
<Button link iconSource={Assets.
|
|
143
|
+
<Button link iconSource={Assets.icons.check} testID={`${testID}.done`} {...confirmButtonProps} onPress={onDonePressed} />
|
|
144
144
|
</View>;
|
|
145
145
|
};
|
|
146
146
|
const renderDateTimePicker = useCallback(() => {
|
|
@@ -159,37 +159,13 @@
|
|
|
159
159
|
],
|
|
160
160
|
"items": [
|
|
161
161
|
{
|
|
162
|
-
"title": "Left"
|
|
163
|
-
"content": [
|
|
164
|
-
{
|
|
165
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_left_top.png"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_left_bottom.png"
|
|
169
|
-
}
|
|
170
|
-
]
|
|
162
|
+
"title": "Left"
|
|
171
163
|
},
|
|
172
164
|
{
|
|
173
|
-
"title": "Center"
|
|
174
|
-
"content": [
|
|
175
|
-
{
|
|
176
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_center_top.png"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_center_bottom.png"
|
|
180
|
-
}
|
|
181
|
-
]
|
|
165
|
+
"title": "Center"
|
|
182
166
|
},
|
|
183
167
|
{
|
|
184
|
-
"title": "Right"
|
|
185
|
-
"content": [
|
|
186
|
-
{
|
|
187
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_right_top.png"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_alignment_right_bottom.png"
|
|
191
|
-
}
|
|
192
|
-
]
|
|
168
|
+
"title": "Right"
|
|
193
169
|
}
|
|
194
170
|
],
|
|
195
171
|
"title": "Alignment",
|
|
@@ -203,20 +179,10 @@
|
|
|
203
179
|
],
|
|
204
180
|
"items": [
|
|
205
181
|
{
|
|
206
|
-
"title": "None"
|
|
207
|
-
"content": [
|
|
208
|
-
{
|
|
209
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_accessories_none.png"
|
|
210
|
-
}
|
|
211
|
-
]
|
|
182
|
+
"title": "None"
|
|
212
183
|
},
|
|
213
184
|
{
|
|
214
|
-
"title": "Icon"
|
|
215
|
-
"content": [
|
|
216
|
-
{
|
|
217
|
-
"value": "https://wixmp-1d257fba8470f1b562a0f5f2.wixmp.com/mads-docs-assets/assets/Components%20Docs/Hint/hint_accessories_icon.png"
|
|
218
|
-
}
|
|
219
|
-
]
|
|
185
|
+
"title": "Icon"
|
|
220
186
|
}
|
|
221
187
|
],
|
|
222
188
|
"title": "Accessories"
|
|
@@ -6,7 +6,6 @@ import View from "../view";
|
|
|
6
6
|
import Image from "../image";
|
|
7
7
|
import Modal from "../modal";
|
|
8
8
|
import TouchableOpacity from "../touchableOpacity";
|
|
9
|
-
import Assets from "../../assets";
|
|
10
9
|
import { HintPositions, HintProps, TargetAlignments } from "./types";
|
|
11
10
|
import useHintVisibility from "./hooks/useHintVisibility";
|
|
12
11
|
import useHintLayout from "./hooks/useHintLayout";
|
|
@@ -15,6 +14,8 @@ import useHintPosition from "./hooks/useHintPosition";
|
|
|
15
14
|
import HintMockChildren from "./HintMockChildren";
|
|
16
15
|
import HintAnchor from "./HintAnchor";
|
|
17
16
|
import HintBubble from "./HintBubble";
|
|
17
|
+
const sideTip = require("./assets/hintTipSide.png");
|
|
18
|
+
const middleTip = require("./assets/hintTipMiddle.png");
|
|
18
19
|
const DEFAULT_COLOR = Colors.$backgroundPrimaryHeavy;
|
|
19
20
|
const DEFAULT_HINT_OFFSET = Spacings.s4;
|
|
20
21
|
const DEFAULT_EDGE_MARGINS = Spacings.s5;
|
|
@@ -124,7 +125,7 @@ const Hint = props => {
|
|
|
124
125
|
}
|
|
125
126
|
};
|
|
126
127
|
const renderHintTip = () => {
|
|
127
|
-
const source = useSideTip ?
|
|
128
|
+
const source = useSideTip ? sideTip : middleTip;
|
|
128
129
|
const flipVertically = position === HintPositions.TOP;
|
|
129
130
|
const flipHorizontally = targetAlignmentOnScreen === TargetAlignments.RIGHT;
|
|
130
131
|
const flipStyle = {
|
|
@@ -12,9 +12,10 @@ import SvgImage from "../svgImage";
|
|
|
12
12
|
* @extendsLink: https://reactnative.dev/docs/image
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
const DEFAULT_WEB_ICON_SIZE = 16;
|
|
15
16
|
const Icon = forwardRef((props, ref) => {
|
|
16
17
|
const {
|
|
17
|
-
size,
|
|
18
|
+
size = Constants.isWeb ? DEFAULT_WEB_ICON_SIZE : undefined,
|
|
18
19
|
tintColor,
|
|
19
20
|
style,
|
|
20
21
|
supportRTL,
|
|
@@ -51,11 +52,9 @@ const Icon = forwardRef((props, ref) => {
|
|
|
51
52
|
}
|
|
52
53
|
return source;
|
|
53
54
|
}, [source, assetGroup, assetName]);
|
|
54
|
-
const renderImage = () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, style]} />;
|
|
58
|
-
};
|
|
55
|
+
const renderImage = () => <Image accessible={false} accessibilityRole={'image'} fsTagName={recorderTag} {...others} ref={ref} source={iconSource} style={[margins, iconSize, shouldFlipRTL && styles.rtlFlipped, !!tintColor && {
|
|
56
|
+
tintColor
|
|
57
|
+
}, style]} />;
|
|
59
58
|
const renderSvg = () => <SvgImage fsTagName={recorderTag} data={source} {...iconSize} {...props} />;
|
|
60
59
|
if (typeof source === 'string' && isBase64ImageContent(source) && Constants.isWeb) {
|
|
61
60
|
return renderImage();
|
|
@@ -21,7 +21,7 @@ class TopBar extends Component {
|
|
|
21
21
|
static displayName = 'Modal.TopBar';
|
|
22
22
|
static defaultProps = {
|
|
23
23
|
doneLabel: 'Save',
|
|
24
|
-
cancelIcon: Assets.
|
|
24
|
+
cancelIcon: Assets.icons.x,
|
|
25
25
|
doneButtonProps: {},
|
|
26
26
|
cancelButtonProps: {},
|
|
27
27
|
includeStatusBar: Constants.isIOS
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"name": "cancelIcon",
|
|
30
30
|
"type": "ImageSource",
|
|
31
31
|
"description": "Cancel action icon",
|
|
32
|
-
"default": "Assets.
|
|
32
|
+
"default": "Assets.icons.x"
|
|
33
33
|
},
|
|
34
34
|
{"name": "onCancel", "type": "(props?: any) => void", "description": "Cancel action callback"},
|
|
35
35
|
{
|