@a-little-world/little-world-design-system-native 0.5.1
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/LICENSE.md +175 -0
- package/README.md +160 -0
- package/dist/components/Accordion/Accordion.d.ts +9 -0
- package/dist/components/Accordion/styles.d.ts +50 -0
- package/dist/components/Button/Button.d.ts +12 -0
- package/dist/components/Button/styles.d.ts +31 -0
- package/dist/components/Card/Card.d.ts +10 -0
- package/dist/components/Card/styles.d.ts +22 -0
- package/dist/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/components/Checkbox/styles.d.ts +45 -0
- package/dist/components/Dropdown/Dropdown.d.ts +9 -0
- package/dist/components/Dropdown/styles.d.ts +32 -0
- package/dist/components/Gradient/Gradient.d.ts +9 -0
- package/dist/components/Icon/Icon.d.ts +16 -0
- package/dist/components/Icon/IconGradient.d.ts +4 -0
- package/dist/components/Icon/createIconComponent.d.ts +16 -0
- package/dist/components/Icon/index.d.ts +949 -0
- package/dist/components/Illustrations/Illustration.d.ts +3 -0
- package/dist/components/Illustrations/createIllustrationComponent.d.ts +11 -0
- package/dist/components/Illustrations/index.d.ts +134 -0
- package/dist/components/InputError/InputError.d.ts +5 -0
- package/dist/components/Label/Label.d.ts +12 -0
- package/dist/components/Label/styles.d.ts +9 -0
- package/dist/components/Link/Link.d.ts +17 -0
- package/dist/components/Link/styles.d.ts +12 -0
- package/dist/components/Loading/Loading.d.ts +10 -0
- package/dist/components/Loading/LoadingLogo.d.ts +8 -0
- package/dist/components/Loading/LoadingLogo.styles.d.ts +4 -0
- package/dist/components/Loading/styles.d.ts +4 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/styles.d.ts +51 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +8 -0
- package/dist/components/ProgressBar/styles.d.ts +24 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +15 -0
- package/dist/components/RadioGroup/styles.d.ts +32 -0
- package/dist/components/Separator/Separator.d.ts +8 -0
- package/dist/components/Separator/styles.d.ts +22 -0
- package/dist/components/Tags/Tags.d.ts +11 -0
- package/dist/components/Tags/styles.d.ts +8 -0
- package/dist/components/Text/BaseText.d.ts +9 -0
- package/dist/components/Text/Text.d.ts +7 -0
- package/dist/components/TextInput/TextInput.d.ts +9 -0
- package/dist/components/TextInput/styles.d.ts +54 -0
- package/dist/components/ToolTip/ToolTip.d.ts +12 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.esm.js +2985 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +3148 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +39 -0
- package/dist/theme/index.d.ts +16 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/styles.d.ts +3 -0
- package/dist/utils/createReactNativeSvg.d.ts +4 -0
- package/dist/utils/gradientParser.d.ts +13 -0
- package/dist/utils/parser.d.ts +12 -0
- package/dist/utils/replaceUrlsWithAnchors.d.ts +6 -0
- package/package.json +73 -0
|
@@ -0,0 +1,2985 @@
|
|
|
1
|
+
import React, { useRef as useRef$1, useState as useState$1, useEffect as useEffect$1, forwardRef as forwardRef$1, useMemo as useMemo$1, createContext as createContext$1, useCallback as useCallback$1 } from 'react';
|
|
2
|
+
import { tokens, GradientTypes, GradientVariations, accountIcon, addToChatIcon, appointmentIcon, archiveIcon, arrowLeftIcon, attachmentIcon, bellIcon, calendarIcon, calendarAddIcon, callIncomingIcon, callOutgoingIcon, cameraIcon, checkIcon, checkInChatIcon, chevronDownIcon, chevronLeftIcon, chevronRightIcon, clockIcon, clockBackIcon, clockDashedIcon, closeIcon, copyIcon, dashboardIcon, dotsIcon, downloadIcon, exclamationIcon, eyeClosedIcon, eyeOpenIcon, facebookIcon, fullScreenExitIcon, fullScreenIcon, githubIcon, groupChatIcon, heartIcon, imageIcon, imageSearchIcon, inclusiveIcon, infoIcon, instagramIcon, linkedinIcon, logoutIcon, logoIcon, mailIcon, menuIcon, messageIcon, messageWithQuestionIcon, micIcon, mobileIcon, moonIcon, notesIcon, pencilIcon, phoneIcon, phoneSlashIcon, plusIcon, profileIcon, profileChatIcon, puzzleIcon, questionIcon, sendIcon, shareScreenIcon, settingsIcon, speakerIcon, stackIcon, starIcon, sunIcon, swapIcon, telegramIcon, tickDoubleIcon, tickIcon, tiktokIcon, translatorIcon, trashIcon, twitterIcon, uploadIcon, userDisconnectedIcon, userSearchIcon, videoIcon, webIcon, whatsappIcon, getTextStyle, TextTypes, fontFamilies, LoadingDimensions, LoadingSizes, LoadingType, ButtonAppearance, BUTTON_DIMENSIONS, ButtonVariations, CIRCLE_DIMENSIONS, ButtonSizes, isValidUrl, CardDimensions, InputHeight, confettiIllustration, friendshipIllustration, groupHandsIllustration, keyIllustration, livingRoomIllustration, laptopWithPhoneIllustration, manOnRocketIllustration, matchSearchingIllustration, paperPlaneIllustration, peopleTogetherIllustration, questionMarksIllustration, raisingMoneyIllustration, teacherIllustration, timeFlexibleIllustration, unmatchedIllustration, wavyBlockIllustration, wavyLinesIllustration, womanOnRocketIllustration, brokenChainIllustration, PopoverSizes, calculateProgress, TagSizes, TagAppearance, InputWidth, ThemeVariants, defaultThemeVariant } from '@a-little-world/little-world-design-system-core';
|
|
3
|
+
export { LoadingSizes, LoadingType } from '@a-little-world/little-world-design-system-core';
|
|
4
|
+
import { View, Text as Text$1, StyleSheet, Animated, Easing, Pressable, Linking, ScrollView, TextInput as TextInput$1 } from 'react-native';
|
|
5
|
+
import styled, { useTheme, css, ThemeProvider } from 'styled-components/native';
|
|
6
|
+
import Svg, { Defs, LinearGradient, Stop, Ellipse, Polyline, Polygon, Line, Rect, Circle, ClipPath, G, Path } from 'react-native-svg';
|
|
7
|
+
import { LinearGradient as LinearGradient$1 } from 'expo-linear-gradient';
|
|
8
|
+
import { useNavigation } from '@react-navigation/native';
|
|
9
|
+
import * as AccordionPrimitive from '@rn-primitives/accordion';
|
|
10
|
+
import * as CheckboxPrimitive from '@rn-primitives/checkbox';
|
|
11
|
+
import * as DropdownMenuPrimitive from '@rn-primitives/dropdown-menu';
|
|
12
|
+
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
13
|
+
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
14
|
+
import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
|
|
15
|
+
import * as SeparatorPrimitive from '@rn-primitives/separator';
|
|
16
|
+
|
|
17
|
+
const getCircleStyles = ({
|
|
18
|
+
theme,
|
|
19
|
+
backgroundColor,
|
|
20
|
+
borderColor
|
|
21
|
+
}) => ({
|
|
22
|
+
backgroundColor: backgroundColor || theme.color.surface.secondary,
|
|
23
|
+
borderWidth: 2,
|
|
24
|
+
borderColor: borderColor || theme.color.border.contrast,
|
|
25
|
+
borderRadius: theme.radius.full,
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
padding: theme.spacing.xxsmall
|
|
29
|
+
});
|
|
30
|
+
const getLabelStyles$1 = ({
|
|
31
|
+
top
|
|
32
|
+
}) => ({
|
|
33
|
+
position: 'relative',
|
|
34
|
+
marginTop: top
|
|
35
|
+
});
|
|
36
|
+
const ImageLabel = ({
|
|
37
|
+
children,
|
|
38
|
+
top
|
|
39
|
+
}) => (/*#__PURE__*/React.createElement(Text$1, {
|
|
40
|
+
accessible: true,
|
|
41
|
+
accessibilityLabel: children,
|
|
42
|
+
style: getLabelStyles$1({
|
|
43
|
+
top
|
|
44
|
+
})
|
|
45
|
+
}, children));
|
|
46
|
+
const Icon = ({
|
|
47
|
+
backgroundColor,
|
|
48
|
+
borderColor,
|
|
49
|
+
children,
|
|
50
|
+
circular,
|
|
51
|
+
style,
|
|
52
|
+
label,
|
|
53
|
+
labelVisible,
|
|
54
|
+
labelTop = tokens.spacing.xxlarge
|
|
55
|
+
}) => {
|
|
56
|
+
const theme = useTheme();
|
|
57
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, circular ? (/*#__PURE__*/React.createElement(View, {
|
|
58
|
+
style: [getCircleStyles({
|
|
59
|
+
theme,
|
|
60
|
+
backgroundColor,
|
|
61
|
+
borderColor
|
|
62
|
+
}), style]
|
|
63
|
+
}, children)) : (/*#__PURE__*/React.createElement(View, {
|
|
64
|
+
style: style
|
|
65
|
+
}, children)), labelVisible && (/*#__PURE__*/React.createElement(ImageLabel, {
|
|
66
|
+
top: labelTop
|
|
67
|
+
}, label)));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const IconGradient = ({
|
|
71
|
+
id,
|
|
72
|
+
variation,
|
|
73
|
+
type = GradientTypes.v1
|
|
74
|
+
}) => {
|
|
75
|
+
if (type === GradientTypes.v1) return /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
76
|
+
id: id,
|
|
77
|
+
x1: "0%",
|
|
78
|
+
y1: "0%",
|
|
79
|
+
x2: "100%",
|
|
80
|
+
y2: "100%",
|
|
81
|
+
gradientUnits: "objectBoundingBox"
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Stop, {
|
|
83
|
+
offset: "0%",
|
|
84
|
+
stopColor: GradientVariations[variation][0]
|
|
85
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
86
|
+
offset: "33%",
|
|
87
|
+
stopColor: GradientVariations[variation][0]
|
|
88
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
89
|
+
offset: "100%",
|
|
90
|
+
stopColor: GradientVariations[variation][1]
|
|
91
|
+
})));
|
|
92
|
+
if (type === GradientTypes.v2) return /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
93
|
+
id: id,
|
|
94
|
+
x1: "27.9721",
|
|
95
|
+
y1: "99.877",
|
|
96
|
+
x2: "116.893",
|
|
97
|
+
y2: "99.877",
|
|
98
|
+
gradientUnits: "userSpaceOnUse"
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Stop, {
|
|
100
|
+
stopColor: GradientVariations[variation][0]
|
|
101
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
102
|
+
offset: "1",
|
|
103
|
+
stopColor: GradientVariations[variation][1]
|
|
104
|
+
})));
|
|
105
|
+
if (type === GradientTypes.v3) return /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
106
|
+
id: id,
|
|
107
|
+
x1: "8.6001",
|
|
108
|
+
y1: "94.48",
|
|
109
|
+
x2: "186.19",
|
|
110
|
+
y2: "94.48",
|
|
111
|
+
gradientUnits: "userSpaceOnUse",
|
|
112
|
+
gradientTransform: "matrix(1, 0, 0, 1, 160.535599, 138.286461)"
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Stop, {
|
|
114
|
+
stopColor: GradientVariations[variation][0]
|
|
115
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
116
|
+
offset: "0.18",
|
|
117
|
+
stopColor: GradientVariations[variation][2]
|
|
118
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
119
|
+
offset: "0.55",
|
|
120
|
+
stopColor: GradientVariations[variation][3]
|
|
121
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
122
|
+
offset: "0.83",
|
|
123
|
+
stopColor: GradientVariations[variation][4]
|
|
124
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
125
|
+
offset: "1",
|
|
126
|
+
stopColor: GradientVariations[variation][5]
|
|
127
|
+
})));
|
|
128
|
+
return null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const BLACK_HEX = '#000';
|
|
132
|
+
// Helper function to generate unique keys
|
|
133
|
+
const generateUniqueKey = (element, index) => {
|
|
134
|
+
return `${element.type}-${index}-${Math.random().toString(36).substring(2, 11)}`;
|
|
135
|
+
};
|
|
136
|
+
// Helper function to safely render children, filtering out null values
|
|
137
|
+
const renderChildren = (children, options, parentIndex) => {
|
|
138
|
+
return children.map((child, i) => renderSvgElement(child, options, `${parentIndex}-${i}`)).filter(Boolean); // Filter out null elements and cast to ReactElement[]
|
|
139
|
+
};
|
|
140
|
+
// Renders SVG elements recursively
|
|
141
|
+
const renderSvgElement = (element, options, index) => {
|
|
142
|
+
const {
|
|
143
|
+
gradient,
|
|
144
|
+
gradientId,
|
|
145
|
+
color
|
|
146
|
+
} = options;
|
|
147
|
+
// Get all attributes and override fill for path elements if needed
|
|
148
|
+
const attrs = Object.assign({}, element.attributes);
|
|
149
|
+
// Handle color attributes for SVG elements based on the colorAttribute property
|
|
150
|
+
// If element has color set that isn't #000 - do not override
|
|
151
|
+
if (element.colorAttribute && element.colorAttribute !== 'none') {
|
|
152
|
+
if (attrs[element.colorAttribute] === BLACK_HEX) {
|
|
153
|
+
attrs[element.colorAttribute] = gradient ? `url(#${gradientId})` : color || BLACK_HEX;
|
|
154
|
+
} else {
|
|
155
|
+
attrs[element.colorAttribute] = attrs[element.colorAttribute] || color || BLACK_HEX;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Add unique key attribute
|
|
159
|
+
const key = generateUniqueKey(element, index);
|
|
160
|
+
switch (element.type) {
|
|
161
|
+
case 'path':
|
|
162
|
+
return /*#__PURE__*/React.createElement(Path, Object.assign({
|
|
163
|
+
key: key
|
|
164
|
+
}, attrs));
|
|
165
|
+
case 'g':
|
|
166
|
+
return /*#__PURE__*/React.createElement(G, Object.assign({
|
|
167
|
+
key: key
|
|
168
|
+
}, attrs), renderChildren(element.children, options, index));
|
|
169
|
+
case 'defs':
|
|
170
|
+
return /*#__PURE__*/React.createElement(Defs, Object.assign({
|
|
171
|
+
key: key
|
|
172
|
+
}, attrs), renderChildren(element.children, options, index));
|
|
173
|
+
case 'linearGradient':
|
|
174
|
+
return /*#__PURE__*/React.createElement(LinearGradient, Object.assign({
|
|
175
|
+
key: key
|
|
176
|
+
}, attrs), renderChildren(element.children, options, index));
|
|
177
|
+
case 'stop':
|
|
178
|
+
return /*#__PURE__*/React.createElement(Stop, Object.assign({
|
|
179
|
+
key: key
|
|
180
|
+
}, attrs));
|
|
181
|
+
case 'clipPath':
|
|
182
|
+
return /*#__PURE__*/React.createElement(ClipPath, Object.assign({
|
|
183
|
+
key: key
|
|
184
|
+
}, attrs), renderChildren(element.children, options, index));
|
|
185
|
+
case 'circle':
|
|
186
|
+
return /*#__PURE__*/React.createElement(Circle, Object.assign({
|
|
187
|
+
key: key
|
|
188
|
+
}, attrs));
|
|
189
|
+
case 'rect':
|
|
190
|
+
return /*#__PURE__*/React.createElement(Rect, Object.assign({
|
|
191
|
+
key: key
|
|
192
|
+
}, attrs));
|
|
193
|
+
case 'line':
|
|
194
|
+
return /*#__PURE__*/React.createElement(Line, Object.assign({
|
|
195
|
+
key: key
|
|
196
|
+
}, attrs));
|
|
197
|
+
case 'polygon':
|
|
198
|
+
return /*#__PURE__*/React.createElement(Polygon, Object.assign({
|
|
199
|
+
key: key
|
|
200
|
+
}, attrs));
|
|
201
|
+
case 'polyline':
|
|
202
|
+
return /*#__PURE__*/React.createElement(Polyline, Object.assign({
|
|
203
|
+
key: key
|
|
204
|
+
}, attrs));
|
|
205
|
+
case 'ellipse':
|
|
206
|
+
return /*#__PURE__*/React.createElement(Ellipse, Object.assign({
|
|
207
|
+
key: key
|
|
208
|
+
}, attrs));
|
|
209
|
+
default:
|
|
210
|
+
console.warn(`Unsupported SVG element type: ${element.type}`);
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const createReactNativeSvg = (svgData, options) => {
|
|
215
|
+
const {
|
|
216
|
+
label,
|
|
217
|
+
width,
|
|
218
|
+
height,
|
|
219
|
+
gradient,
|
|
220
|
+
gradientId,
|
|
221
|
+
style
|
|
222
|
+
} = options;
|
|
223
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
224
|
+
key: `${Math.random().toString(36).substring(2, 11)}`,
|
|
225
|
+
style: style
|
|
226
|
+
}, /*#__PURE__*/React.createElement(Svg, {
|
|
227
|
+
accessible: true,
|
|
228
|
+
accessibilityLabel: label,
|
|
229
|
+
width: width,
|
|
230
|
+
height: height,
|
|
231
|
+
viewBox: svgData.viewBox,
|
|
232
|
+
fill: "none"
|
|
233
|
+
}, gradient && (/*#__PURE__*/React.createElement(IconGradient, {
|
|
234
|
+
variation: gradient,
|
|
235
|
+
id: gradientId
|
|
236
|
+
})), svgData.elements.map((element, index) => renderSvgElement(element, options, index))));
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const createIconComponent = ({
|
|
240
|
+
name,
|
|
241
|
+
svgData,
|
|
242
|
+
gradientType
|
|
243
|
+
}) => {
|
|
244
|
+
const Component = ({
|
|
245
|
+
height = 24,
|
|
246
|
+
width = 24,
|
|
247
|
+
style,
|
|
248
|
+
color,
|
|
249
|
+
backgroundColor,
|
|
250
|
+
gradient,
|
|
251
|
+
borderColor,
|
|
252
|
+
circular,
|
|
253
|
+
label,
|
|
254
|
+
labelVisible
|
|
255
|
+
}) => {
|
|
256
|
+
const gradientId = label ? `gradient-${label.replace(/\s/g, '')}` : 'gradient-icon-needs-label';
|
|
257
|
+
const svgOptions = {
|
|
258
|
+
width,
|
|
259
|
+
height,
|
|
260
|
+
style,
|
|
261
|
+
label,
|
|
262
|
+
color,
|
|
263
|
+
gradient,
|
|
264
|
+
gradientId};
|
|
265
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
266
|
+
backgroundColor: backgroundColor,
|
|
267
|
+
borderColor: borderColor,
|
|
268
|
+
circular: circular,
|
|
269
|
+
style: style,
|
|
270
|
+
color: color,
|
|
271
|
+
label: label,
|
|
272
|
+
labelVisible: labelVisible
|
|
273
|
+
}, createReactNativeSvg(svgData, svgOptions));
|
|
274
|
+
};
|
|
275
|
+
Component.displayName = `${name}Icon`;
|
|
276
|
+
return Component;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const AccountIcon = createIconComponent({
|
|
280
|
+
name: 'Account',
|
|
281
|
+
svgData: accountIcon
|
|
282
|
+
});
|
|
283
|
+
const AddToChatIcon = createIconComponent({
|
|
284
|
+
name: 'AddToChat',
|
|
285
|
+
svgData: addToChatIcon
|
|
286
|
+
});
|
|
287
|
+
const AppointmentIcon = createIconComponent({
|
|
288
|
+
name: 'Appointment',
|
|
289
|
+
svgData: appointmentIcon
|
|
290
|
+
});
|
|
291
|
+
const ArchiveIcon = createIconComponent({
|
|
292
|
+
name: 'Archive',
|
|
293
|
+
svgData: archiveIcon
|
|
294
|
+
});
|
|
295
|
+
const ArrowLeftIcon = createIconComponent({
|
|
296
|
+
name: 'ArrowLeft',
|
|
297
|
+
svgData: arrowLeftIcon
|
|
298
|
+
});
|
|
299
|
+
const AttachmentIcon = createIconComponent({
|
|
300
|
+
name: 'Attachment',
|
|
301
|
+
svgData: attachmentIcon,
|
|
302
|
+
gradientType: GradientTypes.v3
|
|
303
|
+
});
|
|
304
|
+
const BellIcon = createIconComponent({
|
|
305
|
+
name: 'Bell',
|
|
306
|
+
svgData: bellIcon,
|
|
307
|
+
gradientType: GradientTypes.v2
|
|
308
|
+
});
|
|
309
|
+
const CalendarIcon = createIconComponent({
|
|
310
|
+
name: 'Calendar',
|
|
311
|
+
svgData: calendarIcon
|
|
312
|
+
});
|
|
313
|
+
const CalendarAddIcon = createIconComponent({
|
|
314
|
+
name: 'CalendarAdd',
|
|
315
|
+
svgData: calendarAddIcon
|
|
316
|
+
});
|
|
317
|
+
const CallIncomingIcon = createIconComponent({
|
|
318
|
+
name: 'CallIncoming',
|
|
319
|
+
svgData: callIncomingIcon
|
|
320
|
+
});
|
|
321
|
+
const CallOutgoingIcon = createIconComponent({
|
|
322
|
+
name: 'CallOutgoing',
|
|
323
|
+
svgData: callOutgoingIcon
|
|
324
|
+
});
|
|
325
|
+
const CameraIcon = createIconComponent({
|
|
326
|
+
name: 'Camera',
|
|
327
|
+
svgData: cameraIcon
|
|
328
|
+
});
|
|
329
|
+
const CheckIcon = createIconComponent({
|
|
330
|
+
name: 'Check',
|
|
331
|
+
svgData: checkIcon,
|
|
332
|
+
gradientType: GradientTypes.v3
|
|
333
|
+
});
|
|
334
|
+
const CheckInChatIcon = createIconComponent({
|
|
335
|
+
name: 'CheckInChat',
|
|
336
|
+
svgData: checkInChatIcon
|
|
337
|
+
});
|
|
338
|
+
const ChevronDownIcon = createIconComponent({
|
|
339
|
+
name: 'ChevronDown',
|
|
340
|
+
svgData: chevronDownIcon,
|
|
341
|
+
gradientType: GradientTypes.v3
|
|
342
|
+
});
|
|
343
|
+
const ChevronLeftIcon = createIconComponent({
|
|
344
|
+
name: 'ChevronLeft',
|
|
345
|
+
svgData: chevronLeftIcon,
|
|
346
|
+
gradientType: GradientTypes.v2
|
|
347
|
+
});
|
|
348
|
+
const ChevronRightIcon = createIconComponent({
|
|
349
|
+
name: 'ChevronRight',
|
|
350
|
+
svgData: chevronRightIcon,
|
|
351
|
+
gradientType: GradientTypes.v2
|
|
352
|
+
});
|
|
353
|
+
const ClockIcon = createIconComponent({
|
|
354
|
+
name: 'Clock',
|
|
355
|
+
svgData: clockIcon
|
|
356
|
+
});
|
|
357
|
+
const ClockBackIcon = createIconComponent({
|
|
358
|
+
name: 'ClockBack',
|
|
359
|
+
svgData: clockBackIcon
|
|
360
|
+
});
|
|
361
|
+
const ClockDashedIcon = createIconComponent({
|
|
362
|
+
name: 'ClockDashed',
|
|
363
|
+
svgData: clockDashedIcon
|
|
364
|
+
});
|
|
365
|
+
const CloseIcon = createIconComponent({
|
|
366
|
+
name: 'Close',
|
|
367
|
+
svgData: closeIcon,
|
|
368
|
+
gradientType: GradientTypes.v2
|
|
369
|
+
});
|
|
370
|
+
const CopyIcon = createIconComponent({
|
|
371
|
+
name: 'Copy',
|
|
372
|
+
svgData: copyIcon
|
|
373
|
+
});
|
|
374
|
+
const DashboardIcon = createIconComponent({
|
|
375
|
+
name: 'Dashboard',
|
|
376
|
+
svgData: dashboardIcon
|
|
377
|
+
});
|
|
378
|
+
const DotsIcon = createIconComponent({
|
|
379
|
+
name: 'Dots',
|
|
380
|
+
svgData: dotsIcon
|
|
381
|
+
});
|
|
382
|
+
const DownloadIcon = createIconComponent({
|
|
383
|
+
name: 'Download',
|
|
384
|
+
svgData: downloadIcon,
|
|
385
|
+
gradientType: GradientTypes.v2
|
|
386
|
+
});
|
|
387
|
+
const ExclamationIcon = createIconComponent({
|
|
388
|
+
name: 'Exclamation',
|
|
389
|
+
svgData: exclamationIcon,
|
|
390
|
+
gradientType: GradientTypes.v2
|
|
391
|
+
});
|
|
392
|
+
const EyeClosedIcon = createIconComponent({
|
|
393
|
+
name: 'EyeClosed',
|
|
394
|
+
svgData: eyeClosedIcon
|
|
395
|
+
});
|
|
396
|
+
const EyeOpenIcon = createIconComponent({
|
|
397
|
+
name: 'EyeOpen',
|
|
398
|
+
svgData: eyeOpenIcon
|
|
399
|
+
});
|
|
400
|
+
const FacebookIcon = createIconComponent({
|
|
401
|
+
name: 'Facebook',
|
|
402
|
+
svgData: facebookIcon
|
|
403
|
+
});
|
|
404
|
+
const FullScreenExitIcon = createIconComponent({
|
|
405
|
+
name: 'FullScreenExit',
|
|
406
|
+
svgData: fullScreenExitIcon
|
|
407
|
+
});
|
|
408
|
+
const FullScreenIcon = createIconComponent({
|
|
409
|
+
name: 'FullScreen',
|
|
410
|
+
svgData: fullScreenIcon,
|
|
411
|
+
gradientType: GradientTypes.v2
|
|
412
|
+
});
|
|
413
|
+
const GithubIcon = createIconComponent({
|
|
414
|
+
name: 'Github',
|
|
415
|
+
svgData: githubIcon
|
|
416
|
+
});
|
|
417
|
+
const GroupChatIcon = createIconComponent({
|
|
418
|
+
name: 'GroupChat',
|
|
419
|
+
svgData: groupChatIcon
|
|
420
|
+
});
|
|
421
|
+
const HeartIcon = createIconComponent({
|
|
422
|
+
name: 'Heart',
|
|
423
|
+
svgData: heartIcon
|
|
424
|
+
});
|
|
425
|
+
const ImageIcon = createIconComponent({
|
|
426
|
+
name: 'Image',
|
|
427
|
+
svgData: imageIcon
|
|
428
|
+
});
|
|
429
|
+
const ImageSearchIcon = createIconComponent({
|
|
430
|
+
name: 'ImageSearch',
|
|
431
|
+
svgData: imageSearchIcon
|
|
432
|
+
});
|
|
433
|
+
const InclusiveIcon = createIconComponent({
|
|
434
|
+
name: 'Inclusive',
|
|
435
|
+
svgData: inclusiveIcon
|
|
436
|
+
});
|
|
437
|
+
const InfoIcon = createIconComponent({
|
|
438
|
+
name: 'Info',
|
|
439
|
+
svgData: infoIcon
|
|
440
|
+
});
|
|
441
|
+
const InstagramIcon = createIconComponent({
|
|
442
|
+
name: 'Instagram',
|
|
443
|
+
svgData: instagramIcon
|
|
444
|
+
});
|
|
445
|
+
const LinkedInIcon = createIconComponent({
|
|
446
|
+
name: 'LinkedIn',
|
|
447
|
+
svgData: linkedinIcon
|
|
448
|
+
});
|
|
449
|
+
const LogoutIcon = createIconComponent({
|
|
450
|
+
name: 'Logout',
|
|
451
|
+
svgData: logoutIcon
|
|
452
|
+
});
|
|
453
|
+
const Logo = createIconComponent({
|
|
454
|
+
name: 'Logo',
|
|
455
|
+
svgData: logoIcon
|
|
456
|
+
});
|
|
457
|
+
const MailIcon = createIconComponent({
|
|
458
|
+
name: 'Mail',
|
|
459
|
+
svgData: mailIcon
|
|
460
|
+
});
|
|
461
|
+
const MenuIcon = createIconComponent({
|
|
462
|
+
name: 'Menu',
|
|
463
|
+
svgData: menuIcon
|
|
464
|
+
});
|
|
465
|
+
const MessageIcon = createIconComponent({
|
|
466
|
+
name: 'Message',
|
|
467
|
+
svgData: messageIcon,
|
|
468
|
+
gradientType: GradientTypes.v3
|
|
469
|
+
});
|
|
470
|
+
const MessageWithQuestionIcon = createIconComponent({
|
|
471
|
+
name: 'MessageWithQuestion',
|
|
472
|
+
svgData: messageWithQuestionIcon,
|
|
473
|
+
gradientType: GradientTypes.v3
|
|
474
|
+
});
|
|
475
|
+
const MicIcon = createIconComponent({
|
|
476
|
+
name: 'Mic',
|
|
477
|
+
svgData: micIcon,
|
|
478
|
+
gradientType: GradientTypes.v2
|
|
479
|
+
});
|
|
480
|
+
const MobileIcon = createIconComponent({
|
|
481
|
+
name: 'Mobile',
|
|
482
|
+
svgData: mobileIcon
|
|
483
|
+
});
|
|
484
|
+
const MoonIcon = createIconComponent({
|
|
485
|
+
name: 'Moon',
|
|
486
|
+
svgData: moonIcon
|
|
487
|
+
});
|
|
488
|
+
const NotesIcon = createIconComponent({
|
|
489
|
+
name: 'Notes',
|
|
490
|
+
svgData: notesIcon
|
|
491
|
+
});
|
|
492
|
+
const PencilIcon = createIconComponent({
|
|
493
|
+
name: 'Pencil',
|
|
494
|
+
svgData: pencilIcon
|
|
495
|
+
});
|
|
496
|
+
const PhoneIcon = createIconComponent({
|
|
497
|
+
name: 'Phone',
|
|
498
|
+
svgData: phoneIcon
|
|
499
|
+
});
|
|
500
|
+
const PhoneSlashIcon = createIconComponent({
|
|
501
|
+
name: 'PhoneSlash',
|
|
502
|
+
svgData: phoneSlashIcon
|
|
503
|
+
});
|
|
504
|
+
const PlusIcon = createIconComponent({
|
|
505
|
+
name: 'Plus',
|
|
506
|
+
svgData: plusIcon
|
|
507
|
+
});
|
|
508
|
+
const ProfileIcon = createIconComponent({
|
|
509
|
+
name: 'Profile',
|
|
510
|
+
svgData: profileIcon
|
|
511
|
+
});
|
|
512
|
+
const ProfileChatIcon = createIconComponent({
|
|
513
|
+
name: 'ProfileChat',
|
|
514
|
+
svgData: profileChatIcon,
|
|
515
|
+
gradientType: GradientTypes.v2
|
|
516
|
+
});
|
|
517
|
+
const PuzzleIcon = createIconComponent({
|
|
518
|
+
name: 'Puzzle',
|
|
519
|
+
svgData: puzzleIcon
|
|
520
|
+
});
|
|
521
|
+
const QuestionIcon = createIconComponent({
|
|
522
|
+
name: 'Question',
|
|
523
|
+
svgData: questionIcon
|
|
524
|
+
});
|
|
525
|
+
const SendIcon = createIconComponent({
|
|
526
|
+
name: 'Send',
|
|
527
|
+
svgData: sendIcon
|
|
528
|
+
});
|
|
529
|
+
const ScreenShareIcon = createIconComponent({
|
|
530
|
+
name: 'ScreenShare',
|
|
531
|
+
svgData: shareScreenIcon
|
|
532
|
+
});
|
|
533
|
+
const SettingsIcon = createIconComponent({
|
|
534
|
+
name: 'Settings',
|
|
535
|
+
svgData: settingsIcon
|
|
536
|
+
});
|
|
537
|
+
const SpeakerIcon = createIconComponent({
|
|
538
|
+
name: 'Speaker',
|
|
539
|
+
svgData: speakerIcon
|
|
540
|
+
});
|
|
541
|
+
const StackIcon = createIconComponent({
|
|
542
|
+
name: 'Stack',
|
|
543
|
+
svgData: stackIcon,
|
|
544
|
+
gradientType: GradientTypes.v2
|
|
545
|
+
});
|
|
546
|
+
const StarIcon = createIconComponent({
|
|
547
|
+
name: 'Star',
|
|
548
|
+
svgData: starIcon
|
|
549
|
+
});
|
|
550
|
+
const SunIcon = createIconComponent({
|
|
551
|
+
name: 'Sun',
|
|
552
|
+
svgData: sunIcon
|
|
553
|
+
});
|
|
554
|
+
const SwapIcon = createIconComponent({
|
|
555
|
+
name: 'Swap',
|
|
556
|
+
svgData: swapIcon,
|
|
557
|
+
gradientType: GradientTypes.v2
|
|
558
|
+
});
|
|
559
|
+
const TelegramIcon = createIconComponent({
|
|
560
|
+
name: 'Telegram',
|
|
561
|
+
svgData: telegramIcon
|
|
562
|
+
});
|
|
563
|
+
const TickDoubleIcon = createIconComponent({
|
|
564
|
+
name: 'TickDouble',
|
|
565
|
+
svgData: tickDoubleIcon
|
|
566
|
+
});
|
|
567
|
+
const TickIcon = createIconComponent({
|
|
568
|
+
name: 'Tick',
|
|
569
|
+
svgData: tickIcon
|
|
570
|
+
});
|
|
571
|
+
const TiktokIcon = createIconComponent({
|
|
572
|
+
name: 'Tiktok',
|
|
573
|
+
svgData: tiktokIcon
|
|
574
|
+
});
|
|
575
|
+
const TranslatorIcon = createIconComponent({
|
|
576
|
+
name: 'Translator',
|
|
577
|
+
svgData: translatorIcon
|
|
578
|
+
});
|
|
579
|
+
const TrashIcon = createIconComponent({
|
|
580
|
+
name: 'Trash',
|
|
581
|
+
svgData: trashIcon
|
|
582
|
+
});
|
|
583
|
+
const TwitterIcon = createIconComponent({
|
|
584
|
+
name: 'Twitter',
|
|
585
|
+
svgData: twitterIcon
|
|
586
|
+
});
|
|
587
|
+
const UploadIcon = createIconComponent({
|
|
588
|
+
name: 'Upload',
|
|
589
|
+
svgData: uploadIcon,
|
|
590
|
+
gradientType: GradientTypes.v2
|
|
591
|
+
});
|
|
592
|
+
const UserDisconnectedIcon = createIconComponent({
|
|
593
|
+
name: 'UserDisconnected',
|
|
594
|
+
svgData: userDisconnectedIcon
|
|
595
|
+
});
|
|
596
|
+
const UserSearchIcon = createIconComponent({
|
|
597
|
+
name: 'UserSearch',
|
|
598
|
+
svgData: userSearchIcon
|
|
599
|
+
});
|
|
600
|
+
const VideoIcon = createIconComponent({
|
|
601
|
+
name: 'Video',
|
|
602
|
+
svgData: videoIcon,
|
|
603
|
+
gradientType: GradientTypes.v3
|
|
604
|
+
});
|
|
605
|
+
const WebIcon = createIconComponent({
|
|
606
|
+
name: 'Web',
|
|
607
|
+
svgData: webIcon
|
|
608
|
+
});
|
|
609
|
+
const WhatsappIcon = createIconComponent({
|
|
610
|
+
name: 'Whatsapp',
|
|
611
|
+
svgData: whatsappIcon
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
/******************************************************************************
|
|
615
|
+
Copyright (c) Microsoft Corporation.
|
|
616
|
+
|
|
617
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
618
|
+
purpose with or without fee is hereby granted.
|
|
619
|
+
|
|
620
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
621
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
622
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
623
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
624
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
625
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
626
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
627
|
+
***************************************************************************** */
|
|
628
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
function __rest(s, e) {
|
|
632
|
+
var t = {};
|
|
633
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
634
|
+
t[p] = s[p];
|
|
635
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
636
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
637
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
638
|
+
t[p[i]] = s[p[i]];
|
|
639
|
+
}
|
|
640
|
+
return t;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
644
|
+
var e = new Error(message);
|
|
645
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const getStyles = ({
|
|
649
|
+
typeStyles,
|
|
650
|
+
bold,
|
|
651
|
+
center,
|
|
652
|
+
color,
|
|
653
|
+
italic,
|
|
654
|
+
theme
|
|
655
|
+
}) => Object.assign({
|
|
656
|
+
textAlign: center ? 'center' : 'auto',
|
|
657
|
+
color: color !== null && color !== void 0 ? color : theme.color.text.primary,
|
|
658
|
+
fontSize: typeStyles.fontSize * 16,
|
|
659
|
+
fontWeight: typeStyles.fontWeight === 'bold' || bold ? 'bold' : 'normal',
|
|
660
|
+
lineHeight: typeStyles.lineHeight ? typeStyles.lineHeight * typeStyles.fontSize * 16 : typeStyles.fontSize * 16 * 1.5,
|
|
661
|
+
fontFamily: typeStyles.styleType === 'body' ? bold ? fontFamilies.SignikaNegativeBold : fontFamilies.SignikaNegative : fontFamilies.WorkSans
|
|
662
|
+
}, italic && {
|
|
663
|
+
fontStyle: 'italic',
|
|
664
|
+
transform: [{
|
|
665
|
+
skewX: '-12deg'
|
|
666
|
+
}]
|
|
667
|
+
});
|
|
668
|
+
const BaseText = ({
|
|
669
|
+
id,
|
|
670
|
+
bold = false,
|
|
671
|
+
center = false,
|
|
672
|
+
children,
|
|
673
|
+
color,
|
|
674
|
+
italic = false,
|
|
675
|
+
style,
|
|
676
|
+
type = TextTypes.Body5
|
|
677
|
+
}) => {
|
|
678
|
+
const theme = useTheme();
|
|
679
|
+
const textStyles = getStyles({
|
|
680
|
+
typeStyles: getTextStyle(type),
|
|
681
|
+
bold,
|
|
682
|
+
italic,
|
|
683
|
+
center,
|
|
684
|
+
color,
|
|
685
|
+
theme
|
|
686
|
+
});
|
|
687
|
+
return /*#__PURE__*/React.createElement(Text$1, {
|
|
688
|
+
id: id,
|
|
689
|
+
style: [textStyles, style]
|
|
690
|
+
}, children);
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
const parseGradientString = gradientString => {
|
|
694
|
+
const colors = gradientString.match(/#[a-fA-F0-9]{6}/g) || [];
|
|
695
|
+
if (colors.length < 2) {
|
|
696
|
+
throw new Error('Gradient must have at least 2 colors');
|
|
697
|
+
}
|
|
698
|
+
// Extract angle if present (this is simplified, adjust for your format)
|
|
699
|
+
const angleMatch = gradientString.match(/(\d+\.?\d*)deg/);
|
|
700
|
+
const angle = angleMatch ? parseFloat(angleMatch[1]) : 0;
|
|
701
|
+
// Convert angle to start/end coordinates
|
|
702
|
+
const radians = (angle - 90) * (Math.PI / 180);
|
|
703
|
+
const start = {
|
|
704
|
+
x: 0.5 - Math.cos(radians) / 2,
|
|
705
|
+
y: 0.5 - Math.sin(radians) / 2
|
|
706
|
+
};
|
|
707
|
+
const end = {
|
|
708
|
+
x: 0.5 + Math.cos(radians) / 2,
|
|
709
|
+
y: 0.5 + Math.sin(radians) / 2
|
|
710
|
+
};
|
|
711
|
+
return {
|
|
712
|
+
colors: colors,
|
|
713
|
+
start,
|
|
714
|
+
end
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
const styles = StyleSheet.create({
|
|
719
|
+
fullSize: {
|
|
720
|
+
position: 'absolute',
|
|
721
|
+
left: 0,
|
|
722
|
+
right: 0,
|
|
723
|
+
top: 0,
|
|
724
|
+
bottom: 0
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
const Gradient = ({
|
|
728
|
+
gradient,
|
|
729
|
+
style,
|
|
730
|
+
children
|
|
731
|
+
}) => {
|
|
732
|
+
const {
|
|
733
|
+
colors,
|
|
734
|
+
start,
|
|
735
|
+
end
|
|
736
|
+
} = parseGradientString(gradient);
|
|
737
|
+
return /*#__PURE__*/React.createElement(LinearGradient$1, {
|
|
738
|
+
colors: colors,
|
|
739
|
+
start: start,
|
|
740
|
+
end: end,
|
|
741
|
+
style: [styles.fullSize, style]
|
|
742
|
+
}, children);
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
const getLoadingContainerStyles = (align, inline, size, type) => ({
|
|
746
|
+
display: 'flex',
|
|
747
|
+
flexDirection: type === LoadingType.Logo ? 'column' : 'row',
|
|
748
|
+
alignItems: 'center',
|
|
749
|
+
justifyContent: align || 'center',
|
|
750
|
+
position: 'relative',
|
|
751
|
+
width: inline ? LoadingDimensions[size || LoadingSizes.Small] : '100%',
|
|
752
|
+
height: '100%',
|
|
753
|
+
minHeight: LoadingDimensions[size || LoadingSizes.Small]
|
|
754
|
+
});
|
|
755
|
+
const getLoadingElementStyles = (color, size) => ({
|
|
756
|
+
position: 'absolute',
|
|
757
|
+
width: LoadingDimensions[size || LoadingSizes.Small],
|
|
758
|
+
height: LoadingDimensions[size || LoadingSizes.Small],
|
|
759
|
+
borderWidth: size === LoadingSizes.Large ? 4 : 2,
|
|
760
|
+
borderColor: color || 'currentColor',
|
|
761
|
+
borderTopColor: 'transparent',
|
|
762
|
+
borderRadius: 9999,
|
|
763
|
+
transform: [{
|
|
764
|
+
rotate: '0deg'
|
|
765
|
+
}]
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
const getLoadingLogoStyles = dimension => {
|
|
769
|
+
return StyleSheet.create({
|
|
770
|
+
container: {
|
|
771
|
+
width: dimension,
|
|
772
|
+
height: dimension
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
const LoadingLogo = ({
|
|
778
|
+
size = LoadingSizes.Small,
|
|
779
|
+
label = 'Loading logo'
|
|
780
|
+
}) => {
|
|
781
|
+
// Double dimensions for mobile screens
|
|
782
|
+
const dimension = LoadingDimensions[size] * 2;
|
|
783
|
+
// Animated values for orange gradient stops
|
|
784
|
+
const orangeStop1Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
785
|
+
const orangeStop2Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
786
|
+
const orangeStop3Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
787
|
+
const orangeStop4Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
788
|
+
// Animated values for blue gradient stops
|
|
789
|
+
const blueStop1Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
790
|
+
const blueStop2Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
791
|
+
const blueStop3Opacity = useRef$1(new Animated.Value(0.25)).current;
|
|
792
|
+
// State for opacity values (updated via animation listeners)
|
|
793
|
+
const [orangeStop1, setOrangeStop1] = useState$1(0.25);
|
|
794
|
+
const [orangeStop2, setOrangeStop2] = useState$1(0.25);
|
|
795
|
+
const [orangeStop3, setOrangeStop3] = useState$1(0.25);
|
|
796
|
+
const [orangeStop4, setOrangeStop4] = useState$1(0.25);
|
|
797
|
+
const [blueStop1, setBlueStop1] = useState$1(0.25);
|
|
798
|
+
const [blueStop2, setBlueStop2] = useState$1(0.25);
|
|
799
|
+
const [blueStop3, setBlueStop3] = useState$1(0.25);
|
|
800
|
+
// Pulse animation (scale from 1 to 1.03 and back)
|
|
801
|
+
const pulseScale = useRef$1(new Animated.Value(1)).current;
|
|
802
|
+
useEffect$1(() => {
|
|
803
|
+
// Create animation for orange gradient stops with staggered delays
|
|
804
|
+
const createOrangeAnimation = (animatedValue, delay) => {
|
|
805
|
+
return Animated.loop(Animated.sequence([Animated.delay(delay), Animated.timing(animatedValue, {
|
|
806
|
+
toValue: 1,
|
|
807
|
+
duration: 2000,
|
|
808
|
+
easing: Easing.inOut(Easing.ease),
|
|
809
|
+
useNativeDriver: false
|
|
810
|
+
}), Animated.timing(animatedValue, {
|
|
811
|
+
toValue: 0.25,
|
|
812
|
+
duration: 2000,
|
|
813
|
+
easing: Easing.inOut(Easing.ease),
|
|
814
|
+
useNativeDriver: false
|
|
815
|
+
})]));
|
|
816
|
+
};
|
|
817
|
+
// Create animation for blue gradient stops with staggered delays
|
|
818
|
+
const createBlueAnimation = (animatedValue, delay) => {
|
|
819
|
+
return Animated.loop(Animated.sequence([Animated.delay(delay), Animated.timing(animatedValue, {
|
|
820
|
+
toValue: 1,
|
|
821
|
+
duration: 2000,
|
|
822
|
+
easing: Easing.inOut(Easing.ease),
|
|
823
|
+
useNativeDriver: false
|
|
824
|
+
}), Animated.timing(animatedValue, {
|
|
825
|
+
toValue: 0.25,
|
|
826
|
+
duration: 2000,
|
|
827
|
+
easing: Easing.inOut(Easing.ease),
|
|
828
|
+
useNativeDriver: false
|
|
829
|
+
})]));
|
|
830
|
+
};
|
|
831
|
+
// Start all animations
|
|
832
|
+
const orangeAnimations = [createOrangeAnimation(orangeStop1Opacity, 0), createOrangeAnimation(orangeStop2Opacity, 200), createOrangeAnimation(orangeStop3Opacity, 400), createOrangeAnimation(orangeStop4Opacity, 600)];
|
|
833
|
+
const blueAnimations = [createBlueAnimation(blueStop1Opacity, 0), createBlueAnimation(blueStop2Opacity, 200), createBlueAnimation(blueStop3Opacity, 400)];
|
|
834
|
+
const allAnimations = [...orangeAnimations, ...blueAnimations];
|
|
835
|
+
// Set up animation listeners to update state
|
|
836
|
+
const listener1 = orangeStop1Opacity.addListener(({
|
|
837
|
+
value
|
|
838
|
+
}) => setOrangeStop1(value));
|
|
839
|
+
const listener2 = orangeStop2Opacity.addListener(({
|
|
840
|
+
value
|
|
841
|
+
}) => setOrangeStop2(value));
|
|
842
|
+
const listener3 = orangeStop3Opacity.addListener(({
|
|
843
|
+
value
|
|
844
|
+
}) => setOrangeStop3(value));
|
|
845
|
+
const listener4 = orangeStop4Opacity.addListener(({
|
|
846
|
+
value
|
|
847
|
+
}) => setOrangeStop4(value));
|
|
848
|
+
const listener5 = blueStop1Opacity.addListener(({
|
|
849
|
+
value
|
|
850
|
+
}) => setBlueStop1(value));
|
|
851
|
+
const listener6 = blueStop2Opacity.addListener(({
|
|
852
|
+
value
|
|
853
|
+
}) => setBlueStop2(value));
|
|
854
|
+
const listener7 = blueStop3Opacity.addListener(({
|
|
855
|
+
value
|
|
856
|
+
}) => setBlueStop3(value));
|
|
857
|
+
allAnimations.forEach(anim => anim.start());
|
|
858
|
+
// Start pulse animation (scale from 1 to 1.03 and back, 3s duration, infinite loop)
|
|
859
|
+
const pulseAnimation = Animated.loop(Animated.sequence([Animated.timing(pulseScale, {
|
|
860
|
+
toValue: 1.03,
|
|
861
|
+
duration: 1500,
|
|
862
|
+
easing: Easing.inOut(Easing.ease),
|
|
863
|
+
useNativeDriver: true
|
|
864
|
+
}), Animated.timing(pulseScale, {
|
|
865
|
+
toValue: 1,
|
|
866
|
+
duration: 1500,
|
|
867
|
+
easing: Easing.inOut(Easing.ease),
|
|
868
|
+
useNativeDriver: true
|
|
869
|
+
})]));
|
|
870
|
+
pulseAnimation.start();
|
|
871
|
+
return () => {
|
|
872
|
+
allAnimations.forEach(anim => anim.stop());
|
|
873
|
+
pulseAnimation.stop();
|
|
874
|
+
orangeStop1Opacity.removeListener(listener1);
|
|
875
|
+
orangeStop2Opacity.removeListener(listener2);
|
|
876
|
+
orangeStop3Opacity.removeListener(listener3);
|
|
877
|
+
orangeStop4Opacity.removeListener(listener4);
|
|
878
|
+
blueStop1Opacity.removeListener(listener5);
|
|
879
|
+
blueStop2Opacity.removeListener(listener6);
|
|
880
|
+
blueStop3Opacity.removeListener(listener7);
|
|
881
|
+
};
|
|
882
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
883
|
+
}, []);
|
|
884
|
+
const styles = getLoadingLogoStyles(dimension);
|
|
885
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
886
|
+
style: [styles.container, {
|
|
887
|
+
transform: [{
|
|
888
|
+
scale: pulseScale
|
|
889
|
+
}]
|
|
890
|
+
}]
|
|
891
|
+
}, /*#__PURE__*/React.createElement(Svg, {
|
|
892
|
+
width: dimension,
|
|
893
|
+
height: dimension,
|
|
894
|
+
viewBox: "-0.01 0 100.38 66.86",
|
|
895
|
+
accessibilityLabel: label,
|
|
896
|
+
accessibilityRole: "image"
|
|
897
|
+
}, /*#__PURE__*/React.createElement(Defs, null, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
898
|
+
id: "loadingOrangeGradient",
|
|
899
|
+
x1: "0",
|
|
900
|
+
y1: "35.21",
|
|
901
|
+
x2: "80",
|
|
902
|
+
y2: "35.21",
|
|
903
|
+
gradientUnits: "userSpaceOnUse"
|
|
904
|
+
}, /*#__PURE__*/React.createElement(Stop, {
|
|
905
|
+
offset: "0",
|
|
906
|
+
stopColor: "#d85509",
|
|
907
|
+
stopOpacity: orangeStop1
|
|
908
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
909
|
+
offset: "0.14",
|
|
910
|
+
stopColor: "#df6510",
|
|
911
|
+
stopOpacity: orangeStop2
|
|
912
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
913
|
+
offset: "0.49",
|
|
914
|
+
stopColor: "#ed861f",
|
|
915
|
+
stopOpacity: orangeStop3
|
|
916
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
917
|
+
offset: "0.67",
|
|
918
|
+
stopColor: "#f39325",
|
|
919
|
+
stopOpacity: orangeStop4
|
|
920
|
+
})), /*#__PURE__*/React.createElement(LinearGradient, {
|
|
921
|
+
id: "loadingBlueGradient",
|
|
922
|
+
x1: "20.41",
|
|
923
|
+
y1: "31.58",
|
|
924
|
+
x2: "100.41",
|
|
925
|
+
y2: "31.58",
|
|
926
|
+
gradientUnits: "userSpaceOnUse"
|
|
927
|
+
}, /*#__PURE__*/React.createElement(Stop, {
|
|
928
|
+
offset: "0.18",
|
|
929
|
+
stopColor: "#36a9e1",
|
|
930
|
+
stopOpacity: blueStop1
|
|
931
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
932
|
+
offset: "0.56",
|
|
933
|
+
stopColor: "#1f8bcc",
|
|
934
|
+
stopOpacity: blueStop2
|
|
935
|
+
}), /*#__PURE__*/React.createElement(Stop, {
|
|
936
|
+
offset: "1",
|
|
937
|
+
stopColor: "#0063af",
|
|
938
|
+
stopOpacity: blueStop3
|
|
939
|
+
}))), /*#__PURE__*/React.createElement(Path, {
|
|
940
|
+
fill: "url(#loadingBlueGradient)",
|
|
941
|
+
d: "M66.69,8.56H50.2a24.68,24.68,0,0,1,9.39,1.85c-.33.32-.65.65-1,1a1.38,1.38,0,0,0-.29,1.72c.17.35.38.68.57,1a8.33,8.33,0,0,0,1.66,1.94A1.61,1.61,0,0,1,61,17.68c-.09.36.12.71-.08,1,0,.06,0,.22.1.33.4.82.74,1,1.65.75a7.1,7.1,0,0,1,2.47-.17,1.76,1.76,0,0,1,1.56,1.05c.1.23.17.46.27.68a1.28,1.28,0,0,0,1.43.9,3,3,0,0,0,2.08-1.09c.25-.31.49-.64.73-1a24.69,24.69,0,0,1,2.5,21,2.7,2.7,0,0,0-.93-.46,1.74,1.74,0,0,1-1-2.71c.06-.1.14-.19.2-.3A1.19,1.19,0,0,0,72,36.37a6.42,6.42,0,0,0-.38-.53,1.24,1.24,0,0,0-2-.17A5.79,5.79,0,0,1,67.35,37c-.93.27-1.87.54-2.81.78a3.77,3.77,0,0,0-1.5.74,1.6,1.6,0,0,1-1.28.44,14.53,14.53,0,0,0-2.09-.23,3.28,3.28,0,0,0-3.29,1.45,2.3,2.3,0,0,1-1.84,1.15l-.22,0a1.23,1.23,0,0,0-.94,1.09,2.67,2.67,0,0,0,1.34,2.8,9.66,9.66,0,0,1,2.51,2.12,4.25,4.25,0,0,1,1.15,1.69c.33,1.14.28,1.77-.62,2.29a10.91,10.91,0,0,0-1.54,1.91A3.1,3.1,0,0,0,56,55.63c.16.58.28,1.17.4,1.75a24.84,24.84,0,0,1-6.2.79H29.8a24.81,24.81,0,1,1,0-49.61h3.92a29.6,29.6,0,0,1,16.48-5H29.8A29.77,29.77,0,0,0,6.94,52.45L4.83,66.86,15,59.22A29.61,29.61,0,0,0,29.8,63.16H50.2A29.79,29.79,0,0,0,66.69,8.56Z"
|
|
942
|
+
}), /*#__PURE__*/React.createElement(Path, {
|
|
943
|
+
fill: "url(#loadingOrangeGradient)",
|
|
944
|
+
d: "M91.65,12.29,93.45,0,84.26,6.89A29.57,29.57,0,0,0,70.61,3.57H50.2a29.79,29.79,0,0,0-16.48,54.6H50.2a24.79,24.79,0,0,1-23-34.09,2.36,2.36,0,0,0,.59.24,8,8,0,0,1,1,.33c0,.1,0,.13,0,.15a.87.87,0,0,0,.32,1.12,1.43,1.43,0,0,1,.31,2,3.33,3.33,0,0,1-.43.67,4.31,4.31,0,0,0-1,3.61,6.84,6.84,0,0,0,.34,1.42A2.43,2.43,0,0,0,29.59,35a2.32,2.32,0,0,0,2.1.06,3.41,3.41,0,0,1,.76-.26,1.15,1.15,0,0,1,1.41.62c.28.48.56,1,.83,1.46a20.21,20.21,0,0,0,2.55,3.91,2.13,2.13,0,0,1,.49,1.33,1.67,1.67,0,0,1-.56,1.14,13,13,0,0,0-1.77,2.23,1.35,1.35,0,0,0,0,1.58c.35.47.8.57,1.52.36A8.92,8.92,0,0,1,38,47.14a12.34,12.34,0,0,0,2.8-.82,3.68,3.68,0,0,0,2.33-2.56,9.66,9.66,0,0,0,.21-2.84c-.06-1-.09-2.09-.11-3.14a.81.81,0,0,1,.22-.52,7.71,7.71,0,0,1,1.26-1.1,6.71,6.71,0,0,0,1.38-1A1.51,1.51,0,0,0,46.61,34c0-.39,0-.78-.09-1.16-.07-.81-.16-1.61-.2-2.41a2.34,2.34,0,0,1,1.31-2.48,1,1,0,0,0,.61-1.12c-.15-1-.28-2-.49-3a14.88,14.88,0,0,1-.38-3,4.85,4.85,0,0,0-.07-.55h-.83c-.62,0-1.23,0-1.84,0-.4,0-.63-.35-.44-.63a3.46,3.46,0,0,0,.4-1.89,1,1,0,0,0-.81-1c-.61,0-1.22,0-1.83.05a8,8,0,0,1-1.09.08,1.47,1.47,0,0,1-.79-.3,6.3,6.3,0,0,1-1.86-2.58,13.63,13.63,0,0,1-.53-1.82s0-.05,0-.09A24.64,24.64,0,0,1,50.2,8.56H70.61a24.81,24.81,0,0,1,0,49.61H66.69a29.61,29.61,0,0,1-16.49,5H70.61a29.78,29.78,0,0,0,21-50.87Z"
|
|
945
|
+
})));
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
const LOADING_RING_ID = 'loadingRing';
|
|
949
|
+
const LOADING_LOGO_ID = 'loadingLogo';
|
|
950
|
+
const Loading = ({
|
|
951
|
+
align,
|
|
952
|
+
style,
|
|
953
|
+
color,
|
|
954
|
+
inline = false,
|
|
955
|
+
size = LoadingSizes.Small,
|
|
956
|
+
type = LoadingType.Ring
|
|
957
|
+
}) => {
|
|
958
|
+
const spinValue = useRef$1(new Animated.Value(0)).current;
|
|
959
|
+
useEffect$1(() => {
|
|
960
|
+
// Only start animation for Ring type
|
|
961
|
+
if (type !== LoadingType.Ring) {
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
const startAnimation = () => {
|
|
965
|
+
Animated.timing(spinValue, {
|
|
966
|
+
toValue: 1,
|
|
967
|
+
duration: 1400,
|
|
968
|
+
easing: Easing.linear,
|
|
969
|
+
useNativeDriver: false
|
|
970
|
+
}).start(() => {
|
|
971
|
+
spinValue.setValue(0);
|
|
972
|
+
startAnimation();
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
startAnimation();
|
|
976
|
+
return () => {
|
|
977
|
+
spinValue.stopAnimation();
|
|
978
|
+
};
|
|
979
|
+
}, [type, spinValue]);
|
|
980
|
+
const spin = spinValue.interpolate({
|
|
981
|
+
inputRange: [0, 1],
|
|
982
|
+
outputRange: ['0deg', '360deg']
|
|
983
|
+
});
|
|
984
|
+
const containerStyle = [getLoadingContainerStyles(align, inline, size, type), style];
|
|
985
|
+
if (type === LoadingType.Logo) {
|
|
986
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
987
|
+
style: containerStyle,
|
|
988
|
+
testID: LOADING_LOGO_ID
|
|
989
|
+
}, /*#__PURE__*/React.createElement(LoadingLogo, {
|
|
990
|
+
size: size,
|
|
991
|
+
label: "Loading"
|
|
992
|
+
}));
|
|
993
|
+
}
|
|
994
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
995
|
+
style: containerStyle,
|
|
996
|
+
testID: LOADING_RING_ID
|
|
997
|
+
}, [0, 1, 2, 3].map(index => (/*#__PURE__*/React.createElement(Animated.View, {
|
|
998
|
+
key: index,
|
|
999
|
+
style: [getLoadingElementStyles(color, size), {
|
|
1000
|
+
transform: [{
|
|
1001
|
+
rotate: spin
|
|
1002
|
+
}]
|
|
1003
|
+
}]
|
|
1004
|
+
}))));
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
const getButtonStyles = ({
|
|
1008
|
+
appearance,
|
|
1009
|
+
color,
|
|
1010
|
+
variation,
|
|
1011
|
+
size,
|
|
1012
|
+
backgroundColor,
|
|
1013
|
+
borderColor,
|
|
1014
|
+
theme
|
|
1015
|
+
}) => {
|
|
1016
|
+
const baseStyles = Object.assign({
|
|
1017
|
+
flexDirection: 'row',
|
|
1018
|
+
alignItems: 'center',
|
|
1019
|
+
justifyContent: 'center',
|
|
1020
|
+
borderRadius: 90
|
|
1021
|
+
}, variation === ButtonVariations.Basic ? {
|
|
1022
|
+
paddingHorizontal: theme.spacing.small,
|
|
1023
|
+
// flex: 1,
|
|
1024
|
+
height: BUTTON_DIMENSIONS[size].height,
|
|
1025
|
+
minWidth: BUTTON_DIMENSIONS[size].minWidth
|
|
1026
|
+
// paddingVertical: BUTTON_DIMENSIONS[size].padding.vertical,
|
|
1027
|
+
} : {});
|
|
1028
|
+
if (variation === ButtonVariations.Circle) {
|
|
1029
|
+
return Object.assign(Object.assign(Object.assign({}, baseStyles), CIRCLE_DIMENSIONS[size]), {
|
|
1030
|
+
borderRadius: theme.radius.half,
|
|
1031
|
+
borderWidth: 1,
|
|
1032
|
+
borderColor: borderColor || backgroundColor || theme.color.border.bold,
|
|
1033
|
+
backgroundColor: backgroundColor || 'transparent'
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
if (variation === ButtonVariations.Icon) {
|
|
1037
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1038
|
+
backgroundColor: backgroundColor || 'transparent',
|
|
1039
|
+
padding: 0
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
if (variation === ButtonVariations.Option) {
|
|
1043
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1044
|
+
backgroundColor: backgroundColor || theme.color.surface.secondary,
|
|
1045
|
+
borderWidth: 1,
|
|
1046
|
+
borderColor: theme.color.border.subtle,
|
|
1047
|
+
borderRadius: 15,
|
|
1048
|
+
padding: theme.spacing.xsmall,
|
|
1049
|
+
gap: theme.spacing.xxxsmall,
|
|
1050
|
+
maxWidth: 144,
|
|
1051
|
+
minHeight: 69
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
if (variation === ButtonVariations.Inline) {
|
|
1055
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1056
|
+
display: 'flex',
|
|
1057
|
+
borderWidth: 0,
|
|
1058
|
+
borderRadius: 0,
|
|
1059
|
+
borderBottomWidth: 1,
|
|
1060
|
+
height: 'auto',
|
|
1061
|
+
width: 'auto',
|
|
1062
|
+
paddingHorizontal: 0,
|
|
1063
|
+
paddingVertical: theme.spacing.xxxxsmall,
|
|
1064
|
+
gap: theme.spacing.xxxsmall,
|
|
1065
|
+
backgroundColor: 'transparent'
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
if (appearance === ButtonAppearance.Primary) {
|
|
1069
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1070
|
+
backgroundColor: backgroundColor || theme.color.surface.primary,
|
|
1071
|
+
borderWidth: 0
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1075
|
+
backgroundColor: theme.color.surface.primary,
|
|
1076
|
+
borderWidth: 2,
|
|
1077
|
+
borderColor: color || theme.color.border.bold
|
|
1078
|
+
});
|
|
1079
|
+
};
|
|
1080
|
+
const gradientStyles = StyleSheet.create({
|
|
1081
|
+
fullSize: {
|
|
1082
|
+
position: 'absolute',
|
|
1083
|
+
left: 0,
|
|
1084
|
+
right: 0,
|
|
1085
|
+
top: 0,
|
|
1086
|
+
bottom: 0
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
const getButtonTextStyles = ({
|
|
1090
|
+
color,
|
|
1091
|
+
variation,
|
|
1092
|
+
appearance,
|
|
1093
|
+
theme
|
|
1094
|
+
}) => {
|
|
1095
|
+
const baseStyles = {
|
|
1096
|
+
color: color || theme.color.text.primary,
|
|
1097
|
+
fontWeight: '700',
|
|
1098
|
+
textAlign: 'center'
|
|
1099
|
+
};
|
|
1100
|
+
if (variation === ButtonVariations.Option) {
|
|
1101
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1102
|
+
color: color || theme.color.text.primary,
|
|
1103
|
+
fontWeight: 'normal'
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
if (variation === ButtonVariations.Basic) {
|
|
1107
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1108
|
+
color: color || appearance === ButtonAppearance.Primary ? theme.color.text.button : theme.color.text.heading
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
return baseStyles;
|
|
1112
|
+
};
|
|
1113
|
+
css`
|
|
1114
|
+
font-family:
|
|
1115
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
1116
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
1117
|
+
background: ${({
|
|
1118
|
+
$backgroundColor,
|
|
1119
|
+
theme
|
|
1120
|
+
}) => $backgroundColor || theme.color.surface.secondary};
|
|
1121
|
+
border: 1px solid ${({
|
|
1122
|
+
theme
|
|
1123
|
+
}) => theme.color.border.subtle};
|
|
1124
|
+
color: ${({
|
|
1125
|
+
$color,
|
|
1126
|
+
theme
|
|
1127
|
+
}) => $color || theme.color.text.primary};
|
|
1128
|
+
border-radius: 15px;
|
|
1129
|
+
font-weight: 700;
|
|
1130
|
+
width: 100%;
|
|
1131
|
+
display: flex;
|
|
1132
|
+
flex-direction: column;
|
|
1133
|
+
flex: 1;
|
|
1134
|
+
padding: ${({
|
|
1135
|
+
theme
|
|
1136
|
+
}) => theme.spacing.xsmall};
|
|
1137
|
+
gap: ${({
|
|
1138
|
+
theme
|
|
1139
|
+
}) => theme.spacing.xxxsmall};
|
|
1140
|
+
max-width: 144px;
|
|
1141
|
+
align-items: center;
|
|
1142
|
+
justify-content: center;
|
|
1143
|
+
font-weight: normal;
|
|
1144
|
+
min-height: 69px;
|
|
1145
|
+
|
|
1146
|
+
&:not(:disabled):hover {
|
|
1147
|
+
filter: brightness(95%);
|
|
1148
|
+
cursor: pointer;
|
|
1149
|
+
box-shadow:
|
|
1150
|
+
0 0 10px 1px rgb(0 0 0 / 11%),
|
|
1151
|
+
0 0 8px 3px rgb(255 255 255 / 15%);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
${({
|
|
1155
|
+
$appearance,
|
|
1156
|
+
$backgroundColor,
|
|
1157
|
+
$color,
|
|
1158
|
+
theme
|
|
1159
|
+
}) => $appearance === ButtonAppearance.Secondary && css`
|
|
1160
|
+
color: ${$color || theme.color.text.button};
|
|
1161
|
+
background: ${$backgroundColor || theme.color.surface.primary};
|
|
1162
|
+
`}
|
|
1163
|
+
`;
|
|
1164
|
+
// svg {
|
|
1165
|
+
// ${ICON_DIMENSIONS}
|
|
1166
|
+
// }
|
|
1167
|
+
// `;
|
|
1168
|
+
// }
|
|
1169
|
+
|
|
1170
|
+
const Button = /*#__PURE__*/React.forwardRef(({
|
|
1171
|
+
appearance = ButtonAppearance.Primary,
|
|
1172
|
+
backgroundColor,
|
|
1173
|
+
borderColor,
|
|
1174
|
+
color,
|
|
1175
|
+
children,
|
|
1176
|
+
disabled,
|
|
1177
|
+
loading,
|
|
1178
|
+
onPress,
|
|
1179
|
+
size = ButtonSizes.Medium,
|
|
1180
|
+
variation = ButtonVariations.Basic,
|
|
1181
|
+
style
|
|
1182
|
+
}, ref) => {
|
|
1183
|
+
const theme = useTheme();
|
|
1184
|
+
const buttonStyles = getButtonStyles({
|
|
1185
|
+
appearance,
|
|
1186
|
+
color,
|
|
1187
|
+
variation,
|
|
1188
|
+
size,
|
|
1189
|
+
backgroundColor,
|
|
1190
|
+
borderColor,
|
|
1191
|
+
theme
|
|
1192
|
+
});
|
|
1193
|
+
const textStyles = getButtonTextStyles({
|
|
1194
|
+
color,
|
|
1195
|
+
variation,
|
|
1196
|
+
appearance,
|
|
1197
|
+
theme
|
|
1198
|
+
});
|
|
1199
|
+
const hasGradient = appearance === ButtonAppearance.Primary && variation === ButtonVariations.Basic;
|
|
1200
|
+
const content = loading ? (/*#__PURE__*/React.createElement(Loading, {
|
|
1201
|
+
color: textStyles.color
|
|
1202
|
+
})) : (/*#__PURE__*/React.createElement(BaseText, {
|
|
1203
|
+
bold: true,
|
|
1204
|
+
style: [textStyles, disabled ? {
|
|
1205
|
+
color: theme.color.text.disabled
|
|
1206
|
+
} : {}]
|
|
1207
|
+
}, children));
|
|
1208
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
1209
|
+
ref: ref,
|
|
1210
|
+
onPress: onPress,
|
|
1211
|
+
disabled: disabled || loading,
|
|
1212
|
+
style: ({
|
|
1213
|
+
pressed
|
|
1214
|
+
}) => [buttonStyles, disabled && {
|
|
1215
|
+
backgroundColor: theme.color.surface.disabled,
|
|
1216
|
+
borderColor: theme.color.border.disabled
|
|
1217
|
+
}, pressed && {
|
|
1218
|
+
opacity: 0.8
|
|
1219
|
+
}, style]
|
|
1220
|
+
}, hasGradient && (/*#__PURE__*/React.createElement(Gradient, {
|
|
1221
|
+
gradient: theme.color.gradient.orange10,
|
|
1222
|
+
style: Object.assign(Object.assign({}, buttonStyles), gradientStyles.fullSize)
|
|
1223
|
+
})), content);
|
|
1224
|
+
});
|
|
1225
|
+
Button.displayName = 'Button';
|
|
1226
|
+
|
|
1227
|
+
const getLinkStyles = ({
|
|
1228
|
+
theme // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1229
|
+
}) => {
|
|
1230
|
+
return StyleSheet.create({
|
|
1231
|
+
container: {
|
|
1232
|
+
alignSelf: 'baseline',
|
|
1233
|
+
margin: 0,
|
|
1234
|
+
padding: 0,
|
|
1235
|
+
display: 'flex',
|
|
1236
|
+
flexDirection: 'row',
|
|
1237
|
+
height: 'auto',
|
|
1238
|
+
minHeight: 0,
|
|
1239
|
+
alignItems: 'baseline',
|
|
1240
|
+
justifyContent: 'flex-start',
|
|
1241
|
+
width: 'auto',
|
|
1242
|
+
minWidth: 0
|
|
1243
|
+
}
|
|
1244
|
+
}).container;
|
|
1245
|
+
};
|
|
1246
|
+
const getLinkTextStyles = ({
|
|
1247
|
+
theme,
|
|
1248
|
+
buttonAppearance,
|
|
1249
|
+
color,
|
|
1250
|
+
textDecoration
|
|
1251
|
+
}) => {
|
|
1252
|
+
return StyleSheet.create({
|
|
1253
|
+
text: Object.assign({
|
|
1254
|
+
color: buttonAppearance === ButtonAppearance.Primary ? theme.color.text.button : color || theme.color.text.link,
|
|
1255
|
+
textDecorationLine: textDecoration ? 'underline' : 'none'
|
|
1256
|
+
}, !buttonAppearance ? {
|
|
1257
|
+
margin: 0,
|
|
1258
|
+
padding: 0,
|
|
1259
|
+
lineHeight: undefined,
|
|
1260
|
+
textAlignVertical: 'auto',
|
|
1261
|
+
flex: undefined,
|
|
1262
|
+
alignSelf: 'baseline'
|
|
1263
|
+
} : {})
|
|
1264
|
+
}).text;
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Link component for React Native
|
|
1269
|
+
* - Uses React Navigation for internal navigation (to)
|
|
1270
|
+
* - Uses Linking API for external links (href)
|
|
1271
|
+
*/
|
|
1272
|
+
const Link = /*#__PURE__*/forwardRef$1((_a, ref) => {
|
|
1273
|
+
var {
|
|
1274
|
+
active,
|
|
1275
|
+
bold,
|
|
1276
|
+
buttonAppearance,
|
|
1277
|
+
buttonSize,
|
|
1278
|
+
children,
|
|
1279
|
+
href,
|
|
1280
|
+
to,
|
|
1281
|
+
params,
|
|
1282
|
+
style,
|
|
1283
|
+
textType,
|
|
1284
|
+
textDecoration = true,
|
|
1285
|
+
onClick
|
|
1286
|
+
} = _a,
|
|
1287
|
+
props = __rest(_a, ["active", "bold", "buttonAppearance", "buttonSize", "children", "href", "to", "params", "style", "textType", "textDecoration", "onClick"]);
|
|
1288
|
+
const theme = useTheme();
|
|
1289
|
+
// Always call useNavigation, but handle the case where it's not available
|
|
1290
|
+
const navigation = useNavigation();
|
|
1291
|
+
const hasGradient = buttonAppearance === ButtonAppearance.Primary;
|
|
1292
|
+
const handlePress = () => {
|
|
1293
|
+
if (onClick) {
|
|
1294
|
+
onClick();
|
|
1295
|
+
}
|
|
1296
|
+
if (href) {
|
|
1297
|
+
// Handle external link
|
|
1298
|
+
Linking.openURL(href).catch(err => {
|
|
1299
|
+
console.error('Failed to open URL:', err);
|
|
1300
|
+
});
|
|
1301
|
+
} else if (to) {
|
|
1302
|
+
// Handle internal navigation
|
|
1303
|
+
try {
|
|
1304
|
+
navigation.navigate(to, params);
|
|
1305
|
+
} catch (_error) {
|
|
1306
|
+
console.warn('Navigation not available. Make sure your Link is inside NavigationContainer.');
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
const linkStyles = buttonAppearance ? getButtonStyles({
|
|
1311
|
+
theme,
|
|
1312
|
+
appearance: buttonAppearance,
|
|
1313
|
+
size: buttonSize || ButtonSizes.Stretch,
|
|
1314
|
+
variation: ButtonVariations.Basic
|
|
1315
|
+
}) : getLinkStyles({
|
|
1316
|
+
theme
|
|
1317
|
+
});
|
|
1318
|
+
return /*#__PURE__*/React.createElement(Pressable, Object.assign({
|
|
1319
|
+
ref: ref,
|
|
1320
|
+
onPress: handlePress,
|
|
1321
|
+
accessibilityRole: "link",
|
|
1322
|
+
style: [linkStyles, style]
|
|
1323
|
+
}, props), hasGradient && (/*#__PURE__*/React.createElement(Gradient, {
|
|
1324
|
+
gradient: theme.color.gradient.orange10,
|
|
1325
|
+
style: Object.assign(Object.assign({}, linkStyles), gradientStyles.fullSize)
|
|
1326
|
+
})), /*#__PURE__*/React.createElement(BaseText, {
|
|
1327
|
+
type: textType || TextTypes.Body5,
|
|
1328
|
+
bold: Boolean(buttonAppearance || bold),
|
|
1329
|
+
style: getLinkTextStyles({
|
|
1330
|
+
theme,
|
|
1331
|
+
buttonAppearance,
|
|
1332
|
+
textDecoration: buttonAppearance ? false : textDecoration
|
|
1333
|
+
})
|
|
1334
|
+
}, children));
|
|
1335
|
+
});
|
|
1336
|
+
|
|
1337
|
+
// Example outputs:
|
|
1338
|
+
/*
|
|
1339
|
+
Input: Check out www.google.com for more info
|
|
1340
|
+
Output: Check out <a href="https://www.google.com" target="_blank">www.google.com</a> for more info
|
|
1341
|
+
|
|
1342
|
+
Input: Visit little-world.io and https://example.com
|
|
1343
|
+
Output: Visit <a href="https://little-world.io" target="_blank">little-world.io</a> and <a href="https://example.com" target="_blank">https://example.com</a>
|
|
1344
|
+
*/
|
|
1345
|
+
const urlPattern = /(?<=^|\s)(?:https?:\/\/)?(?:www\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?:\/[^\s]*)?/g;
|
|
1346
|
+
/**
|
|
1347
|
+
* Replaces all URLs in a text with HTML anchor tags
|
|
1348
|
+
* @param text - The input text containing URLs
|
|
1349
|
+
* @returns The text with URLs replaced with anchor tags
|
|
1350
|
+
*/
|
|
1351
|
+
function replaceUrlsWithAnchors(text) {
|
|
1352
|
+
return text.replace(urlPattern, match => {
|
|
1353
|
+
// Ensure URL has protocol for href
|
|
1354
|
+
try {
|
|
1355
|
+
if (!isValidUrl(match)) return match;
|
|
1356
|
+
const href = match.startsWith('http') ? match : `https://${match}`;
|
|
1357
|
+
return `<a {"target":"_blank", "href":"${href}"}>${match}</a>`;
|
|
1358
|
+
} catch (_a) {
|
|
1359
|
+
return match;
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
const ColorText = styled.Text`
|
|
1365
|
+
color: ${({
|
|
1366
|
+
theme,
|
|
1367
|
+
color
|
|
1368
|
+
}) => color === SupportedColorTags.bold ? 'currentColor' : theme.color.text[color]};
|
|
1369
|
+
|
|
1370
|
+
${({
|
|
1371
|
+
color
|
|
1372
|
+
}) => color === SupportedColorTags.bold || color === SupportedColorTags.highlight ? css`
|
|
1373
|
+
font-weight: bold;
|
|
1374
|
+
font-family: 'SignikaNegativeBold';
|
|
1375
|
+
` : css`
|
|
1376
|
+
font-weight: normal;
|
|
1377
|
+
font-family: 'SignikaNegative';
|
|
1378
|
+
`};
|
|
1379
|
+
`;
|
|
1380
|
+
const ANCHOR_TAG = 'a';
|
|
1381
|
+
const BUTTON_TAG = 'button';
|
|
1382
|
+
var SupportedColorTags;
|
|
1383
|
+
(function (SupportedColorTags) {
|
|
1384
|
+
SupportedColorTags["highlight"] = "highlight";
|
|
1385
|
+
SupportedColorTags["bold"] = "bold";
|
|
1386
|
+
})(SupportedColorTags || (SupportedColorTags = {}));
|
|
1387
|
+
const findTags = text => {
|
|
1388
|
+
const tags = [];
|
|
1389
|
+
const textLength = text.length;
|
|
1390
|
+
let position = 0;
|
|
1391
|
+
while (position < textLength) {
|
|
1392
|
+
const openBracket = text.indexOf('<', position);
|
|
1393
|
+
if (openBracket === -1) break;
|
|
1394
|
+
const closeBracket = text.indexOf('>', openBracket);
|
|
1395
|
+
if (closeBracket === -1) break;
|
|
1396
|
+
// Extract tag content
|
|
1397
|
+
const tagContent = text.substring(openBracket + 1, closeBracket);
|
|
1398
|
+
// Check if it's a valid opening tag (starts with letter)
|
|
1399
|
+
if (/^[a-zA-Z]/.test(tagContent)) {
|
|
1400
|
+
const firstSpace = tagContent.indexOf(' ');
|
|
1401
|
+
const tagName = firstSpace === -1 ? tagContent : tagContent.substring(0, firstSpace);
|
|
1402
|
+
const attributesText = firstSpace === -1 ? '' : tagContent.substring(firstSpace + 1);
|
|
1403
|
+
// Parse attributes safely
|
|
1404
|
+
let attributes = {};
|
|
1405
|
+
if (attributesText.trim()) {
|
|
1406
|
+
try {
|
|
1407
|
+
attributes = JSON.parse(attributesText);
|
|
1408
|
+
} catch (_a) {
|
|
1409
|
+
// Invalid JSON - treat as plain text
|
|
1410
|
+
position = closeBracket + 1;
|
|
1411
|
+
continue;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
// Look for closing tag
|
|
1415
|
+
const closingTag = `</${tagName}>`;
|
|
1416
|
+
const closingTagIndex = text.indexOf(closingTag, closeBracket + 1);
|
|
1417
|
+
if (closingTagIndex !== -1) {
|
|
1418
|
+
// Found complete tag
|
|
1419
|
+
tags.push({
|
|
1420
|
+
start: openBracket,
|
|
1421
|
+
end: closingTagIndex + closingTag.length,
|
|
1422
|
+
tagName,
|
|
1423
|
+
attributes,
|
|
1424
|
+
hasClosingTag: true,
|
|
1425
|
+
contentStart: closeBracket + 1,
|
|
1426
|
+
contentEnd: closingTagIndex
|
|
1427
|
+
});
|
|
1428
|
+
position = closingTagIndex + closingTag.length;
|
|
1429
|
+
} else {
|
|
1430
|
+
// No closing tag - treat as plain text
|
|
1431
|
+
position = closeBracket + 1;
|
|
1432
|
+
}
|
|
1433
|
+
} else {
|
|
1434
|
+
// Not a valid tag - move past it
|
|
1435
|
+
position = closeBracket + 1;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
return tags;
|
|
1439
|
+
};
|
|
1440
|
+
// Unified content parser that handles both onlyLinks and normal modes
|
|
1441
|
+
const parseContent = (content, options) => {
|
|
1442
|
+
const tags = findTags(content);
|
|
1443
|
+
if (tags.length === 0) {
|
|
1444
|
+
return [content];
|
|
1445
|
+
}
|
|
1446
|
+
const components = [];
|
|
1447
|
+
let currentIndex = 0;
|
|
1448
|
+
for (const tag of tags) {
|
|
1449
|
+
// Add text before this tag
|
|
1450
|
+
if (tag.start > currentIndex) {
|
|
1451
|
+
components.push(content.substring(currentIndex, tag.start));
|
|
1452
|
+
}
|
|
1453
|
+
// Extract content between tags
|
|
1454
|
+
const tagContent = content.substring(tag.contentStart, tag.contentEnd);
|
|
1455
|
+
// Process the tag based on type and options
|
|
1456
|
+
if (options.nonInteractive) {
|
|
1457
|
+
// In nonInteractive mode, render all tags as plain text
|
|
1458
|
+
components.push(content.substring(tag.start, tag.end));
|
|
1459
|
+
} else if (tag.tagName === ANCHOR_TAG) {
|
|
1460
|
+
// Always process anchor tags
|
|
1461
|
+
const nestedContent = parseContent(tagContent, options);
|
|
1462
|
+
components.push(tag.attributes.href || tag.attributes.to ? (/*#__PURE__*/React.createElement(Link, Object.assign({
|
|
1463
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`,
|
|
1464
|
+
to: tag.attributes.href || tag.attributes.to
|
|
1465
|
+
}, tag.attributes), nestedContent)) : (/*#__PURE__*/React.createElement(Text$1, {
|
|
1466
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1467
|
+
}, nestedContent)));
|
|
1468
|
+
} else if (options.onlyLinks) {
|
|
1469
|
+
// In onlyLinks mode, treat all non-anchor tags as plain text
|
|
1470
|
+
components.push(content.substring(tag.start, tag.end));
|
|
1471
|
+
} else if (tag.tagName === BUTTON_TAG) {
|
|
1472
|
+
const nestedContent = parseContent(tagContent, options);
|
|
1473
|
+
components.push(/*#__PURE__*/React.createElement(Button, Object.assign({
|
|
1474
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1475
|
+
}, tag.attributes), nestedContent));
|
|
1476
|
+
} else if (Object.values(SupportedColorTags).includes(tag.tagName)) {
|
|
1477
|
+
const nestedContent = parseContent(tagContent, options);
|
|
1478
|
+
components.push(/*#__PURE__*/React.createElement(ColorText, {
|
|
1479
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`,
|
|
1480
|
+
color: SupportedColorTags[tag.tagName]
|
|
1481
|
+
}, nestedContent));
|
|
1482
|
+
} else if (options.customElements) {
|
|
1483
|
+
// Check for custom elements
|
|
1484
|
+
const customElement = options.customElements.find(element => element.tag === tag.tagName);
|
|
1485
|
+
if (customElement) {
|
|
1486
|
+
const nestedContent = parseContent(tagContent, options);
|
|
1487
|
+
components.push(/*#__PURE__*/React.createElement(customElement.Component, Object.assign({
|
|
1488
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1489
|
+
}, tag.attributes, customElement.props), nestedContent));
|
|
1490
|
+
} else {
|
|
1491
|
+
// Unrecognized tag, add as plain text
|
|
1492
|
+
components.push(content.substring(tag.start, tag.end));
|
|
1493
|
+
}
|
|
1494
|
+
} else {
|
|
1495
|
+
// Unrecognized tag, add as plain text
|
|
1496
|
+
components.push(content.substring(tag.start, tag.end));
|
|
1497
|
+
}
|
|
1498
|
+
currentIndex = tag.end;
|
|
1499
|
+
}
|
|
1500
|
+
// Add remaining text after last tag
|
|
1501
|
+
if (currentIndex < content.length) {
|
|
1502
|
+
components.push(content.substring(currentIndex));
|
|
1503
|
+
}
|
|
1504
|
+
return components;
|
|
1505
|
+
};
|
|
1506
|
+
const textParser = (text, options = {}) => {
|
|
1507
|
+
// In nonInteractive mode, don't convert URLs to links
|
|
1508
|
+
const textWithParsedUrls = options.nonInteractive ? text : replaceUrlsWithAnchors(text);
|
|
1509
|
+
// Find all complete tags
|
|
1510
|
+
const tags = findTags(textWithParsedUrls);
|
|
1511
|
+
if (tags.length === 0) {
|
|
1512
|
+
return /*#__PURE__*/React.createElement(Text$1, null, textWithParsedUrls);
|
|
1513
|
+
}
|
|
1514
|
+
const components = [];
|
|
1515
|
+
let currentIndex = 0;
|
|
1516
|
+
for (const tag of tags) {
|
|
1517
|
+
// Add text before this tag
|
|
1518
|
+
if (tag.start > currentIndex) {
|
|
1519
|
+
components.push(textWithParsedUrls.substring(currentIndex, tag.start));
|
|
1520
|
+
}
|
|
1521
|
+
// Extract content between tags
|
|
1522
|
+
const content = textWithParsedUrls.substring(tag.contentStart, tag.contentEnd);
|
|
1523
|
+
// Process the tag based on type
|
|
1524
|
+
if (options.nonInteractive) {
|
|
1525
|
+
// In nonInteractive mode, render all tags as plain text
|
|
1526
|
+
components.push(textWithParsedUrls.substring(tag.start, tag.end));
|
|
1527
|
+
} else if (tag.tagName === ANCHOR_TAG) {
|
|
1528
|
+
// Always process anchor tags (even in onlyLinks mode)
|
|
1529
|
+
const nestedContent = parseContent(content, options);
|
|
1530
|
+
components.push(tag.attributes.href || tag.attributes.to ? (/*#__PURE__*/React.createElement(Link, Object.assign({
|
|
1531
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`,
|
|
1532
|
+
to: tag.attributes.href || tag.attributes.to
|
|
1533
|
+
}, tag.attributes), nestedContent)) : (/*#__PURE__*/React.createElement(Text$1, {
|
|
1534
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1535
|
+
}, nestedContent)));
|
|
1536
|
+
} else if (options.onlyLinks) {
|
|
1537
|
+
// In onlyLinks mode, treat all non-anchor tags as plain text
|
|
1538
|
+
components.push(textWithParsedUrls.substring(tag.start, tag.end));
|
|
1539
|
+
} else if (tag.tagName === BUTTON_TAG) {
|
|
1540
|
+
const nestedContent = parseContent(content, options);
|
|
1541
|
+
components.push(/*#__PURE__*/React.createElement(Button, Object.assign({
|
|
1542
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1543
|
+
}, tag.attributes), nestedContent));
|
|
1544
|
+
} else if (Object.values(SupportedColorTags).includes(tag.tagName)) {
|
|
1545
|
+
const nestedContent = parseContent(content, options);
|
|
1546
|
+
components.push(/*#__PURE__*/React.createElement(ColorText, {
|
|
1547
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`,
|
|
1548
|
+
color: SupportedColorTags[tag.tagName]
|
|
1549
|
+
}, nestedContent));
|
|
1550
|
+
} else if (options.customElements) {
|
|
1551
|
+
// Check for custom elements
|
|
1552
|
+
const customElement = options.customElements.find(element => element.tag === tag.tagName);
|
|
1553
|
+
if (customElement) {
|
|
1554
|
+
const nestedContent = parseContent(content, options);
|
|
1555
|
+
components.push(/*#__PURE__*/React.createElement(customElement.Component, Object.assign({
|
|
1556
|
+
key: `${tag.tagName}-${tag.start}-${tag.end}`
|
|
1557
|
+
}, tag.attributes, customElement.props), nestedContent));
|
|
1558
|
+
} else {
|
|
1559
|
+
// Unrecognized tag, add as plain text
|
|
1560
|
+
components.push(textWithParsedUrls.substring(tag.start, tag.end));
|
|
1561
|
+
}
|
|
1562
|
+
} else {
|
|
1563
|
+
// Unrecognized tag, add as plain text
|
|
1564
|
+
components.push(textWithParsedUrls.substring(tag.start, tag.end));
|
|
1565
|
+
}
|
|
1566
|
+
currentIndex = tag.end;
|
|
1567
|
+
}
|
|
1568
|
+
// Add remaining text after last tag
|
|
1569
|
+
if (currentIndex < textWithParsedUrls.length) {
|
|
1570
|
+
components.push(textWithParsedUrls.substring(currentIndex));
|
|
1571
|
+
}
|
|
1572
|
+
return /*#__PURE__*/React.createElement(Text$1, null, components.map((section, index) => typeof section === 'string' ? (/*#__PURE__*/React.createElement(Text$1, {
|
|
1573
|
+
key: index
|
|
1574
|
+
}, section)) : (/*#__PURE__*/React.cloneElement(section, {
|
|
1575
|
+
key: index
|
|
1576
|
+
}))));
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
const Text = _a => {
|
|
1580
|
+
var {
|
|
1581
|
+
disableParser = false,
|
|
1582
|
+
children
|
|
1583
|
+
} = _a,
|
|
1584
|
+
baseTextProps = __rest(_a, ["disableParser", "children"]);
|
|
1585
|
+
return /*#__PURE__*/React.createElement(BaseText, Object.assign({}, baseTextProps), typeof children === 'string' && !disableParser ? textParser(children) : children);
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1588
|
+
// export const AccordionRoot = styled(Accordion.Root)`
|
|
1589
|
+
// :root {
|
|
1590
|
+
// --radix-accordion-content-width: 100%:
|
|
1591
|
+
// --radix-collapsible-content-width: 100%;
|
|
1592
|
+
// }
|
|
1593
|
+
// `;
|
|
1594
|
+
const getAccordionStyles = ({
|
|
1595
|
+
theme
|
|
1596
|
+
}) => StyleSheet.create({
|
|
1597
|
+
root: {
|
|
1598
|
+
borderWidth: 1,
|
|
1599
|
+
borderRadius: theme.radius.xxsmall,
|
|
1600
|
+
borderColor: theme.color.border.subtle,
|
|
1601
|
+
width: 100
|
|
1602
|
+
},
|
|
1603
|
+
item: {
|
|
1604
|
+
borderBottomWidth: 1,
|
|
1605
|
+
borderColor: theme.color.border.subtle,
|
|
1606
|
+
margin: 0,
|
|
1607
|
+
paddingVertical: theme.spacing.xxsmall,
|
|
1608
|
+
paddingHorizontal: theme.spacing.small,
|
|
1609
|
+
paddingBottom: 0,
|
|
1610
|
+
width: 100
|
|
1611
|
+
},
|
|
1612
|
+
itemLastChild: {
|
|
1613
|
+
borderTopWidth: 0,
|
|
1614
|
+
borderBottomWidth: 0
|
|
1615
|
+
},
|
|
1616
|
+
header: {
|
|
1617
|
+
margin: 0,
|
|
1618
|
+
width: 100
|
|
1619
|
+
},
|
|
1620
|
+
content: {
|
|
1621
|
+
width: 100,
|
|
1622
|
+
backgroundColor: theme.color.surface.secondary,
|
|
1623
|
+
borderRadius: theme.radius.xxsmall,
|
|
1624
|
+
padding: theme.spacing.small,
|
|
1625
|
+
marginBottom: theme.spacing.small
|
|
1626
|
+
},
|
|
1627
|
+
trigger: {
|
|
1628
|
+
display: 'flex',
|
|
1629
|
+
alignItems: 'flex-start',
|
|
1630
|
+
justifyContent: 'space-between',
|
|
1631
|
+
backgroundColor: 'none',
|
|
1632
|
+
paddingVertical: theme.spacing.xxsmall,
|
|
1633
|
+
paddingHorizontal: theme.spacing.small,
|
|
1634
|
+
gap: theme.spacing.small,
|
|
1635
|
+
width: 100,
|
|
1636
|
+
textAlign: 'left'
|
|
1637
|
+
},
|
|
1638
|
+
triggerIcon: {
|
|
1639
|
+
flexShrink: 0,
|
|
1640
|
+
marginTop: 6
|
|
1641
|
+
}
|
|
1642
|
+
});
|
|
1643
|
+
|
|
1644
|
+
const Accordion = ({
|
|
1645
|
+
contentStyle,
|
|
1646
|
+
headerType,
|
|
1647
|
+
headerColor,
|
|
1648
|
+
items,
|
|
1649
|
+
style
|
|
1650
|
+
}) => {
|
|
1651
|
+
const theme = useTheme();
|
|
1652
|
+
const styles = useMemo$1(() => getAccordionStyles({
|
|
1653
|
+
theme
|
|
1654
|
+
}), [theme]);
|
|
1655
|
+
return /*#__PURE__*/React.createElement(AccordionPrimitive.Root, {
|
|
1656
|
+
style: [styles.root, style],
|
|
1657
|
+
type: "single",
|
|
1658
|
+
collapsible: true
|
|
1659
|
+
}, items.map(({
|
|
1660
|
+
content,
|
|
1661
|
+
header
|
|
1662
|
+
}) => (/*#__PURE__*/React.createElement(AccordionPrimitive.Item, {
|
|
1663
|
+
value: header,
|
|
1664
|
+
key: header,
|
|
1665
|
+
style: styles.item
|
|
1666
|
+
}, /*#__PURE__*/React.createElement(AccordionPrimitive.Header, {
|
|
1667
|
+
id: header,
|
|
1668
|
+
style: styles.header
|
|
1669
|
+
}, /*#__PURE__*/React.createElement(AccordionPrimitive.Trigger, {
|
|
1670
|
+
style: styles.trigger
|
|
1671
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
1672
|
+
type: headerType || TextTypes.Body4,
|
|
1673
|
+
color: headerColor
|
|
1674
|
+
}, header), /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
1675
|
+
label: "accordion toggle icon",
|
|
1676
|
+
width: 14,
|
|
1677
|
+
height: 14,
|
|
1678
|
+
color: headerColor,
|
|
1679
|
+
style: styles.triggerIcon
|
|
1680
|
+
}))), /*#__PURE__*/React.createElement(AccordionPrimitive.Content, {
|
|
1681
|
+
style: [styles.content, contentStyle]
|
|
1682
|
+
}, content)))));
|
|
1683
|
+
};
|
|
1684
|
+
|
|
1685
|
+
const getCardStyles = ({
|
|
1686
|
+
borderColor,
|
|
1687
|
+
height,
|
|
1688
|
+
theme,
|
|
1689
|
+
width
|
|
1690
|
+
}) => Object.assign(Object.assign({
|
|
1691
|
+
borderRadius: theme.radius.small,
|
|
1692
|
+
backgroundColor: theme.color.surface.primary,
|
|
1693
|
+
borderWidth: 1,
|
|
1694
|
+
borderColor: borderColor || theme.color.border.subtle,
|
|
1695
|
+
shadowColor: theme.color.text.primary,
|
|
1696
|
+
shadowOffset: {
|
|
1697
|
+
width: 0,
|
|
1698
|
+
height: 1
|
|
1699
|
+
},
|
|
1700
|
+
shadowOpacity: 0.05,
|
|
1701
|
+
shadowRadius: 25,
|
|
1702
|
+
elevation: 2,
|
|
1703
|
+
width: '100%',
|
|
1704
|
+
maxWidth: '100%',
|
|
1705
|
+
maxHeight: '100%',
|
|
1706
|
+
flexDirection: 'column',
|
|
1707
|
+
padding: theme.spacing.small
|
|
1708
|
+
}, width && {
|
|
1709
|
+
width: CardDimensions[width]
|
|
1710
|
+
}), height && {
|
|
1711
|
+
height
|
|
1712
|
+
});
|
|
1713
|
+
const getCardHeaderStyles = ({
|
|
1714
|
+
theme
|
|
1715
|
+
}) => ({
|
|
1716
|
+
marginBottom: theme.spacing.small
|
|
1717
|
+
});
|
|
1718
|
+
const getCardContentStyles = ({
|
|
1719
|
+
align,
|
|
1720
|
+
gap,
|
|
1721
|
+
marginBottom,
|
|
1722
|
+
theme
|
|
1723
|
+
}) => ({
|
|
1724
|
+
flexDirection: 'column',
|
|
1725
|
+
alignItems: align || 'center',
|
|
1726
|
+
gap: gap || theme.spacing.small,
|
|
1727
|
+
marginBottom: marginBottom || theme.spacing.small
|
|
1728
|
+
});
|
|
1729
|
+
const getCardFooterStyles = ({
|
|
1730
|
+
align,
|
|
1731
|
+
theme
|
|
1732
|
+
}) => ({
|
|
1733
|
+
flexDirection: 'row',
|
|
1734
|
+
marginTop: 'auto',
|
|
1735
|
+
width: '100%',
|
|
1736
|
+
gap: theme.spacing.small,
|
|
1737
|
+
justifyContent: align || 'flex-start'
|
|
1738
|
+
});
|
|
1739
|
+
|
|
1740
|
+
const CardHeader = ({
|
|
1741
|
+
children,
|
|
1742
|
+
textColor,
|
|
1743
|
+
textType
|
|
1744
|
+
}) => {
|
|
1745
|
+
const theme = useTheme();
|
|
1746
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
1747
|
+
style: getCardHeaderStyles({
|
|
1748
|
+
theme
|
|
1749
|
+
}),
|
|
1750
|
+
type: textType || TextTypes.Heading4,
|
|
1751
|
+
center: true,
|
|
1752
|
+
color: textColor
|
|
1753
|
+
}, children);
|
|
1754
|
+
};
|
|
1755
|
+
const CardContent = ({
|
|
1756
|
+
children,
|
|
1757
|
+
align,
|
|
1758
|
+
gap,
|
|
1759
|
+
marginBottom
|
|
1760
|
+
}) => {
|
|
1761
|
+
const theme = useTheme();
|
|
1762
|
+
const styles = getCardContentStyles({
|
|
1763
|
+
align,
|
|
1764
|
+
gap: gap,
|
|
1765
|
+
marginBottom: marginBottom,
|
|
1766
|
+
theme
|
|
1767
|
+
});
|
|
1768
|
+
const {
|
|
1769
|
+
flexDirection,
|
|
1770
|
+
alignItems,
|
|
1771
|
+
gap: contentGap,
|
|
1772
|
+
marginBottom: contentMarginBottom
|
|
1773
|
+
} = styles,
|
|
1774
|
+
containerStyle = __rest(styles, ["flexDirection", "alignItems", "gap", "marginBottom"]);
|
|
1775
|
+
return /*#__PURE__*/React.createElement(ScrollView, {
|
|
1776
|
+
style: containerStyle,
|
|
1777
|
+
contentContainerStyle: {
|
|
1778
|
+
flexDirection,
|
|
1779
|
+
alignItems,
|
|
1780
|
+
gap: contentGap,
|
|
1781
|
+
marginBottom: contentMarginBottom
|
|
1782
|
+
}
|
|
1783
|
+
}, children);
|
|
1784
|
+
};
|
|
1785
|
+
const CardFooter = ({
|
|
1786
|
+
children,
|
|
1787
|
+
align
|
|
1788
|
+
}) => {
|
|
1789
|
+
const theme = useTheme();
|
|
1790
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
1791
|
+
style: getCardFooterStyles({
|
|
1792
|
+
align,
|
|
1793
|
+
theme
|
|
1794
|
+
})
|
|
1795
|
+
}, children);
|
|
1796
|
+
};
|
|
1797
|
+
const Card = ({
|
|
1798
|
+
borderColor,
|
|
1799
|
+
children,
|
|
1800
|
+
style,
|
|
1801
|
+
height,
|
|
1802
|
+
width
|
|
1803
|
+
}) => {
|
|
1804
|
+
const theme = useTheme();
|
|
1805
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
1806
|
+
style: [getCardStyles({
|
|
1807
|
+
borderColor,
|
|
1808
|
+
height: height,
|
|
1809
|
+
width,
|
|
1810
|
+
theme
|
|
1811
|
+
}), style]
|
|
1812
|
+
}, children);
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
const ITEM_WIDTH$1 = 16;
|
|
1816
|
+
const getContainerStyles = ({
|
|
1817
|
+
theme
|
|
1818
|
+
}) => StyleSheet.create({
|
|
1819
|
+
container: {
|
|
1820
|
+
display: 'flex',
|
|
1821
|
+
alignItems: 'center',
|
|
1822
|
+
marginVertical: theme.spacing.xxxxsmall,
|
|
1823
|
+
flexDirection: 'row'
|
|
1824
|
+
}
|
|
1825
|
+
});
|
|
1826
|
+
const getCheckboxStyles = ({
|
|
1827
|
+
theme,
|
|
1828
|
+
hasError,
|
|
1829
|
+
color,
|
|
1830
|
+
checked
|
|
1831
|
+
}) => StyleSheet.create({
|
|
1832
|
+
container: {
|
|
1833
|
+
flexDirection: 'row',
|
|
1834
|
+
alignItems: 'flex-start',
|
|
1835
|
+
justifyContent: 'flex-start'
|
|
1836
|
+
},
|
|
1837
|
+
text: {
|
|
1838
|
+
paddingHorizontal: 8
|
|
1839
|
+
},
|
|
1840
|
+
checkbox: Object.assign({
|
|
1841
|
+
height: ITEM_WIDTH$1,
|
|
1842
|
+
width: ITEM_WIDTH$1,
|
|
1843
|
+
borderWidth: 1,
|
|
1844
|
+
flexDirection: 'row',
|
|
1845
|
+
alignItems: 'center',
|
|
1846
|
+
justifyContent: 'center',
|
|
1847
|
+
display: 'flex',
|
|
1848
|
+
borderColor: hasError ? theme.color.border.error : theme.color.border.contrast,
|
|
1849
|
+
backgroundColor: checked ? color : theme.color.surface.primary
|
|
1850
|
+
}, checked && color && {
|
|
1851
|
+
backgroundColor: color,
|
|
1852
|
+
borderColor: color,
|
|
1853
|
+
color: theme.color.text.reversed
|
|
1854
|
+
})
|
|
1855
|
+
});
|
|
1856
|
+
const indicatorStyles = StyleSheet.create({
|
|
1857
|
+
indicator: {
|
|
1858
|
+
display: 'flex',
|
|
1859
|
+
alignItems: 'center',
|
|
1860
|
+
justifyContent: 'center'
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
const getLabelStyles = ({
|
|
1865
|
+
theme,
|
|
1866
|
+
bold,
|
|
1867
|
+
inline,
|
|
1868
|
+
marginBottom
|
|
1869
|
+
}) => {
|
|
1870
|
+
const baseStyles = {
|
|
1871
|
+
display: 'flex',
|
|
1872
|
+
flexDirection: 'row',
|
|
1873
|
+
alignItems: 'center',
|
|
1874
|
+
justifyContent: 'center',
|
|
1875
|
+
gap: theme.spacing.xxxsmall,
|
|
1876
|
+
fontWeight: bold ? 'bold' : 'normal',
|
|
1877
|
+
flexShrink: inline ? 1 : 0,
|
|
1878
|
+
marginBottom: marginBottom ? marginBottom : 0
|
|
1879
|
+
};
|
|
1880
|
+
return baseStyles;
|
|
1881
|
+
};
|
|
1882
|
+
|
|
1883
|
+
const Label = ({
|
|
1884
|
+
children,
|
|
1885
|
+
style,
|
|
1886
|
+
bold,
|
|
1887
|
+
inline,
|
|
1888
|
+
marginBottom,
|
|
1889
|
+
nativeId // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1890
|
+
}) => {
|
|
1891
|
+
const theme = useTheme();
|
|
1892
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
1893
|
+
style: [getLabelStyles({
|
|
1894
|
+
theme,
|
|
1895
|
+
bold,
|
|
1896
|
+
inline,
|
|
1897
|
+
marginBottom
|
|
1898
|
+
}), style]
|
|
1899
|
+
}, children);
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
const Checkbox = _a => {
|
|
1903
|
+
var {
|
|
1904
|
+
checked,
|
|
1905
|
+
color,
|
|
1906
|
+
error,
|
|
1907
|
+
required = true,
|
|
1908
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1909
|
+
inputRef,
|
|
1910
|
+
id,
|
|
1911
|
+
label,
|
|
1912
|
+
onCheckedChange,
|
|
1913
|
+
readOnly,
|
|
1914
|
+
style
|
|
1915
|
+
} = _a,
|
|
1916
|
+
rest = __rest(_a, ["checked", "color", "error", "required", "inputRef", "id", "label", "onCheckedChange", "readOnly", "style"]);
|
|
1917
|
+
const theme = useTheme();
|
|
1918
|
+
const checkboxContainerStyle = useMemo$1(() => getContainerStyles({
|
|
1919
|
+
theme
|
|
1920
|
+
}), [theme]);
|
|
1921
|
+
const checkboxstyles = useMemo$1(() => getCheckboxStyles({
|
|
1922
|
+
theme,
|
|
1923
|
+
hasError: Boolean(error),
|
|
1924
|
+
color,
|
|
1925
|
+
checked
|
|
1926
|
+
}), [theme, error, color, checked]);
|
|
1927
|
+
function handlePress() {
|
|
1928
|
+
onCheckedChange(!checked);
|
|
1929
|
+
}
|
|
1930
|
+
const [checked1, setChecked] = React.useState(false);
|
|
1931
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
1932
|
+
style: checkboxContainerStyle.container
|
|
1933
|
+
}, readOnly ? (/*#__PURE__*/React.createElement(View, {
|
|
1934
|
+
style: checkboxstyles.checkbox
|
|
1935
|
+
}, checked && (/*#__PURE__*/React.createElement(CheckIcon, {
|
|
1936
|
+
label: "check icon",
|
|
1937
|
+
width: 10,
|
|
1938
|
+
height: 10,
|
|
1939
|
+
style: indicatorStyles.indicator
|
|
1940
|
+
})))) : (/*#__PURE__*/React.createElement(CheckboxPrimitive.Root, Object.assign({
|
|
1941
|
+
id: id,
|
|
1942
|
+
style: checkboxstyles.checkbox,
|
|
1943
|
+
onPress: handlePress
|
|
1944
|
+
}, rest, {
|
|
1945
|
+
checked: checked1,
|
|
1946
|
+
onCheckedChange: setChecked
|
|
1947
|
+
}), /*#__PURE__*/React.createElement(CheckboxPrimitive.Indicator, null, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
1948
|
+
label: "check icon",
|
|
1949
|
+
width: 10,
|
|
1950
|
+
height: 10,
|
|
1951
|
+
style: indicatorStyles.indicator
|
|
1952
|
+
})))), /*#__PURE__*/React.createElement(Label, {
|
|
1953
|
+
style: checkboxstyles.text
|
|
1954
|
+
}, label));
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
css`
|
|
1958
|
+
border: 1px solid ${({
|
|
1959
|
+
theme
|
|
1960
|
+
}) => theme.color.border.error};
|
|
1961
|
+
`;
|
|
1962
|
+
const InputError = ({
|
|
1963
|
+
children,
|
|
1964
|
+
top,
|
|
1965
|
+
bottom,
|
|
1966
|
+
right,
|
|
1967
|
+
left,
|
|
1968
|
+
visible = true,
|
|
1969
|
+
textAlign = 'left'
|
|
1970
|
+
}) => {
|
|
1971
|
+
const theme = useTheme();
|
|
1972
|
+
if (!visible) return null;
|
|
1973
|
+
const containerStyle = {
|
|
1974
|
+
position: 'absolute',
|
|
1975
|
+
top: top ? Number(top) : undefined,
|
|
1976
|
+
bottom: bottom ? Number(bottom) : undefined,
|
|
1977
|
+
right: right ? Number(right) : undefined,
|
|
1978
|
+
left: left ? Number(left) : undefined
|
|
1979
|
+
};
|
|
1980
|
+
const textStyle = {
|
|
1981
|
+
color: theme.color.text.error,
|
|
1982
|
+
textAlign
|
|
1983
|
+
};
|
|
1984
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
1985
|
+
style: containerStyle
|
|
1986
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
1987
|
+
style: textStyle
|
|
1988
|
+
}, children));
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
// import { INPUT_ERROR_CSS } from '../InputError/InputError';
|
|
1992
|
+
// import { BODY_5_CSS } from '../Text/styles';
|
|
1993
|
+
const DROPDOWN_MAX_WIDTH = 300;
|
|
1994
|
+
const getDropdownStyles = ({
|
|
1995
|
+
theme,
|
|
1996
|
+
maxWidth,
|
|
1997
|
+
height,
|
|
1998
|
+
hasError // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1999
|
+
}) => StyleSheet.create({
|
|
2000
|
+
wrapper: {
|
|
2001
|
+
position: 'relative',
|
|
2002
|
+
maxWidth: maxWidth || DROPDOWN_MAX_WIDTH,
|
|
2003
|
+
width: '100%'
|
|
2004
|
+
},
|
|
2005
|
+
trigger: {
|
|
2006
|
+
// all: 'unset',
|
|
2007
|
+
// boxSizing: 'border-box',
|
|
2008
|
+
// display: 'inline-flex',
|
|
2009
|
+
alignItems: 'center',
|
|
2010
|
+
justifyContent: 'space-between',
|
|
2011
|
+
paddingVertical: theme.spacing.xxsmall,
|
|
2012
|
+
paddingHorizontal: height === InputHeight.Small ? theme.spacing.small : theme.spacing.xsmall,
|
|
2013
|
+
lineHeight: 1.25,
|
|
2014
|
+
height: height === InputHeight.Small ? 34 : 40,
|
|
2015
|
+
gap: theme.spacing.xsmall,
|
|
2016
|
+
backgroundColor: theme.color.surface.primary,
|
|
2017
|
+
borderRadius: theme.radius.xxxsmall,
|
|
2018
|
+
borderWidth: 2,
|
|
2019
|
+
borderColor: theme.color.border.subtle,
|
|
2020
|
+
width: '100%',
|
|
2021
|
+
color: theme.color.text.secondary,
|
|
2022
|
+
marginBottom: theme.spacing.xxxxsmall
|
|
2023
|
+
},
|
|
2024
|
+
triggerWithError: {
|
|
2025
|
+
// input error styles
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
// export const SelectTrigger = styled(Select.Trigger)<{
|
|
2029
|
+
// $hasError: boolean;
|
|
2030
|
+
// $height?: string;
|
|
2031
|
+
// }>`
|
|
2032
|
+
// > span:first-child,
|
|
2033
|
+
// > span:first-child p {
|
|
2034
|
+
// ${BODY_5_CSS}
|
|
2035
|
+
// white-space: nowrap;
|
|
2036
|
+
// overflow: hidden;
|
|
2037
|
+
// text-overflow: ellipsis;
|
|
2038
|
+
// }
|
|
2039
|
+
// svg {
|
|
2040
|
+
// color: ${({ theme }) => theme.color.text.secondary};
|
|
2041
|
+
// }
|
|
2042
|
+
// &[data-placeholder] {
|
|
2043
|
+
// background-color: ${({ theme }) => theme.color.surface.primary};
|
|
2044
|
+
// color: ${({ theme }) => theme.color.text.tertiary};
|
|
2045
|
+
// svg {
|
|
2046
|
+
// color: ${({ theme }) => theme.color.text.highlight};
|
|
2047
|
+
// }
|
|
2048
|
+
// }
|
|
2049
|
+
// `;
|
|
2050
|
+
// export const SelectValue = styled(Select.Value)`
|
|
2051
|
+
// &[data-placeholder] {
|
|
2052
|
+
// background-color: ${({ theme }) => theme.color.surface.primary};
|
|
2053
|
+
// }
|
|
2054
|
+
// `;
|
|
2055
|
+
// export const SelectContent = styled(Select.Content)`
|
|
2056
|
+
// overflow: hidden;
|
|
2057
|
+
// background-color: ${({ theme }) => theme.color.surface.primary};
|
|
2058
|
+
// border-radius: 6px;
|
|
2059
|
+
// box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35),
|
|
2060
|
+
// 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
|
|
2061
|
+
// z-index: 100;
|
|
2062
|
+
// `;
|
|
2063
|
+
// export const SelectViewport = styled(Select.Viewport)`
|
|
2064
|
+
// padding: ${({ theme }) => theme.spacing.xxsmall} ${({ theme }) => theme.spacing.xxxsmall};
|
|
2065
|
+
// max-height: 200px;
|
|
2066
|
+
// overflow: scroll;
|
|
2067
|
+
// `;
|
|
2068
|
+
// export const SelectIcon = styled(Select.Icon)`
|
|
2069
|
+
// display: flex;
|
|
2070
|
+
// `;
|
|
2071
|
+
// export const SelectItem = styled(Select.Item)`
|
|
2072
|
+
// font-size: 13px;
|
|
2073
|
+
// line-height: 1;
|
|
2074
|
+
// border-radius: 3px;
|
|
2075
|
+
// display: flex;
|
|
2076
|
+
// align-items: center;
|
|
2077
|
+
// height: 25px;
|
|
2078
|
+
// padding: 0 ${({ theme }) => theme.spacing.large} 0 ${({ theme }) => theme.spacing.medium};
|
|
2079
|
+
// position: relative;
|
|
2080
|
+
// user-select: none;
|
|
2081
|
+
// &:disabled {
|
|
2082
|
+
// color: gray;
|
|
2083
|
+
// pointer-events: none;
|
|
2084
|
+
// }
|
|
2085
|
+
// `;
|
|
2086
|
+
// export const SelectItemIndicator = styled(Select.ItemIndicator)`
|
|
2087
|
+
// position: absolute;
|
|
2088
|
+
// left: 0;
|
|
2089
|
+
// width: 25px;
|
|
2090
|
+
// display: inline-flex;
|
|
2091
|
+
// align-items: center;
|
|
2092
|
+
// justify-content: center;
|
|
2093
|
+
// `;
|
|
2094
|
+
|
|
2095
|
+
const ARROW_DOWN_WIDTH = 13;
|
|
2096
|
+
const ARROW_DOWN_HEIGHT = 8;
|
|
2097
|
+
// const isValidValue = (value: string, options: Options) =>
|
|
2098
|
+
// options.some((option: any) => option.value === value);
|
|
2099
|
+
const Option = ({
|
|
2100
|
+
children,
|
|
2101
|
+
value // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2102
|
+
}) => {
|
|
2103
|
+
return /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Item
|
|
2104
|
+
// value={value}
|
|
2105
|
+
, null, /*#__PURE__*/React.createElement(Text, null, children), /*#__PURE__*/React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
2106
|
+
label: "selected item",
|
|
2107
|
+
width: 10
|
|
2108
|
+
})));
|
|
2109
|
+
};
|
|
2110
|
+
const Dropdown = ({
|
|
2111
|
+
ariaLabel,
|
|
2112
|
+
error,
|
|
2113
|
+
cannotError,
|
|
2114
|
+
disabled,
|
|
2115
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2116
|
+
height,
|
|
2117
|
+
inputRef,
|
|
2118
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2119
|
+
label,
|
|
2120
|
+
labelTooltip,
|
|
2121
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2122
|
+
lockedValue,
|
|
2123
|
+
maxWidth,
|
|
2124
|
+
onValueChange,
|
|
2125
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2126
|
+
options,
|
|
2127
|
+
placeholder,
|
|
2128
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2129
|
+
required,
|
|
2130
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2131
|
+
value,
|
|
2132
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2133
|
+
style
|
|
2134
|
+
}) => {
|
|
2135
|
+
const theme = useTheme();
|
|
2136
|
+
const styles = getDropdownStyles({
|
|
2137
|
+
theme,
|
|
2138
|
+
maxWidth: maxWidth,
|
|
2139
|
+
height: height,
|
|
2140
|
+
hasError: Boolean(error)
|
|
2141
|
+
});
|
|
2142
|
+
// const defaultValue =
|
|
2143
|
+
// lockedValue || (value && isValidValue(value, options) ? value : undefined);
|
|
2144
|
+
const canError = !lockedValue && !cannotError;
|
|
2145
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2146
|
+
style: [styles.wrapper, style]
|
|
2147
|
+
}, label && (/*#__PURE__*/React.createElement(Label, {
|
|
2148
|
+
bold: true
|
|
2149
|
+
}, label)), /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Root
|
|
2150
|
+
// disabled={disabled || !!lockedValue}
|
|
2151
|
+
// onValueChange={onValueChange}
|
|
2152
|
+
// required={required}
|
|
2153
|
+
// defaultValue={defaultValue}
|
|
2154
|
+
, null, /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Trigger, {
|
|
2155
|
+
"aria-label": ariaLabel || label
|
|
2156
|
+
}, !lockedValue && (/*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
2157
|
+
width: ARROW_DOWN_WIDTH,
|
|
2158
|
+
height: ARROW_DOWN_HEIGHT,
|
|
2159
|
+
label: "dropdown icon"
|
|
2160
|
+
}))), /*#__PURE__*/React.createElement(DropdownMenuPrimitive.Content, null, options.map(option => (/*#__PURE__*/React.createElement(Option, {
|
|
2161
|
+
key: option.label,
|
|
2162
|
+
value: option.value
|
|
2163
|
+
}, option.label))))), canError && /*#__PURE__*/React.createElement(InputError, {
|
|
2164
|
+
visible: Boolean(error)
|
|
2165
|
+
}, error));
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2168
|
+
const Illustration = ({
|
|
2169
|
+
children,
|
|
2170
|
+
label,
|
|
2171
|
+
labelVisible,
|
|
2172
|
+
labelTop = tokens.spacing.xxlarge
|
|
2173
|
+
}) => (/*#__PURE__*/React.createElement(View, null, children, labelVisible && /*#__PURE__*/React.createElement(ImageLabel, {
|
|
2174
|
+
top: labelTop
|
|
2175
|
+
}, label)));
|
|
2176
|
+
|
|
2177
|
+
const createIllustrationComponent = ({
|
|
2178
|
+
name,
|
|
2179
|
+
svgData
|
|
2180
|
+
}) => {
|
|
2181
|
+
const Component = ({
|
|
2182
|
+
height = 24,
|
|
2183
|
+
width = 24,
|
|
2184
|
+
style,
|
|
2185
|
+
color,
|
|
2186
|
+
label,
|
|
2187
|
+
labelVisible
|
|
2188
|
+
}) => {
|
|
2189
|
+
// Create the transform options for React Native SVG
|
|
2190
|
+
const svgOptions = {
|
|
2191
|
+
width,
|
|
2192
|
+
height,
|
|
2193
|
+
style,
|
|
2194
|
+
color,
|
|
2195
|
+
label
|
|
2196
|
+
};
|
|
2197
|
+
return /*#__PURE__*/React.createElement(Illustration, {
|
|
2198
|
+
label: label,
|
|
2199
|
+
labelVisible: labelVisible
|
|
2200
|
+
}, createReactNativeSvg(svgData, svgOptions));
|
|
2201
|
+
};
|
|
2202
|
+
Component.displayName = `${name}Image`;
|
|
2203
|
+
return Component;
|
|
2204
|
+
};
|
|
2205
|
+
|
|
2206
|
+
const BrokenChainImage = createIllustrationComponent({
|
|
2207
|
+
name: 'BrokenChain',
|
|
2208
|
+
svgData: brokenChainIllustration
|
|
2209
|
+
});
|
|
2210
|
+
const ConfettiImage = createIllustrationComponent({
|
|
2211
|
+
name: 'Confetti',
|
|
2212
|
+
svgData: confettiIllustration
|
|
2213
|
+
});
|
|
2214
|
+
const FriendshipImage = createIllustrationComponent({
|
|
2215
|
+
name: 'Friendship',
|
|
2216
|
+
svgData: friendshipIllustration
|
|
2217
|
+
});
|
|
2218
|
+
const GroupHandsImage = createIllustrationComponent({
|
|
2219
|
+
name: 'GroupHands',
|
|
2220
|
+
svgData: groupHandsIllustration
|
|
2221
|
+
});
|
|
2222
|
+
const KeyImage = createIllustrationComponent({
|
|
2223
|
+
name: 'Key',
|
|
2224
|
+
svgData: keyIllustration
|
|
2225
|
+
});
|
|
2226
|
+
const LivingRoomImage = createIllustrationComponent({
|
|
2227
|
+
name: 'LivingRoom',
|
|
2228
|
+
svgData: livingRoomIllustration
|
|
2229
|
+
});
|
|
2230
|
+
const LaptopWithPhoneImage = createIllustrationComponent({
|
|
2231
|
+
name: 'LaptopWithPhone',
|
|
2232
|
+
svgData: laptopWithPhoneIllustration
|
|
2233
|
+
});
|
|
2234
|
+
const ManOnRocketImage = createIllustrationComponent({
|
|
2235
|
+
name: 'ManOnRocket',
|
|
2236
|
+
svgData: manOnRocketIllustration
|
|
2237
|
+
});
|
|
2238
|
+
const MatchSearchingImage = createIllustrationComponent({
|
|
2239
|
+
name: 'MatchSearching',
|
|
2240
|
+
svgData: matchSearchingIllustration
|
|
2241
|
+
});
|
|
2242
|
+
const PaperPlaneImage = createIllustrationComponent({
|
|
2243
|
+
name: 'PaperPlane',
|
|
2244
|
+
svgData: paperPlaneIllustration
|
|
2245
|
+
});
|
|
2246
|
+
const PeopleTogetherImage = createIllustrationComponent({
|
|
2247
|
+
name: 'PeopleTogether',
|
|
2248
|
+
svgData: peopleTogetherIllustration
|
|
2249
|
+
});
|
|
2250
|
+
const QuestionMarksImage = createIllustrationComponent({
|
|
2251
|
+
name: 'QuestionMarks',
|
|
2252
|
+
svgData: questionMarksIllustration
|
|
2253
|
+
});
|
|
2254
|
+
const RaisingMoneyImage = createIllustrationComponent({
|
|
2255
|
+
name: 'RaisingMoney',
|
|
2256
|
+
svgData: raisingMoneyIllustration
|
|
2257
|
+
});
|
|
2258
|
+
const TeacherImage = createIllustrationComponent({
|
|
2259
|
+
name: 'Teacher',
|
|
2260
|
+
svgData: teacherIllustration
|
|
2261
|
+
});
|
|
2262
|
+
const TimeFlexibleImage = createIllustrationComponent({
|
|
2263
|
+
name: 'TimeFlexible',
|
|
2264
|
+
svgData: timeFlexibleIllustration
|
|
2265
|
+
});
|
|
2266
|
+
const UnmatchedImage = createIllustrationComponent({
|
|
2267
|
+
name: 'Unmatched',
|
|
2268
|
+
svgData: unmatchedIllustration
|
|
2269
|
+
});
|
|
2270
|
+
const WavyBlockImage = createIllustrationComponent({
|
|
2271
|
+
name: 'WavyBlock',
|
|
2272
|
+
svgData: wavyBlockIllustration
|
|
2273
|
+
});
|
|
2274
|
+
const WavyLinesImage = createIllustrationComponent({
|
|
2275
|
+
name: 'WavyLines',
|
|
2276
|
+
svgData: wavyLinesIllustration
|
|
2277
|
+
});
|
|
2278
|
+
const WomanOnRocketImage = createIllustrationComponent({
|
|
2279
|
+
name: 'WomanOnRocket',
|
|
2280
|
+
svgData: womanOnRocketIllustration
|
|
2281
|
+
});
|
|
2282
|
+
|
|
2283
|
+
// import {
|
|
2284
|
+
// slideDownAndFade,
|
|
2285
|
+
// slideLeftAndFade,
|
|
2286
|
+
// slideRightAndFade,
|
|
2287
|
+
// slideUpAndFade,
|
|
2288
|
+
// } from "../../utils/animations";
|
|
2289
|
+
// &[data-state="delayed-open"][data-side="top"] {
|
|
2290
|
+
// animation-name: ${slideDownAndFade};
|
|
2291
|
+
// }
|
|
2292
|
+
// &[data-state="delayed-open"][data-side="right"] {
|
|
2293
|
+
// animation-name: ${slideLeftAndFade};
|
|
2294
|
+
// }
|
|
2295
|
+
// &[data-state="delayed-open"][data-side="bottom"] {
|
|
2296
|
+
// animation-name: ${slideUpAndFade};
|
|
2297
|
+
// }
|
|
2298
|
+
// &[data-state="delayed-open"][data-side="left"] {
|
|
2299
|
+
// animation-name: ${slideRightAndFade};
|
|
2300
|
+
// }
|
|
2301
|
+
// `;
|
|
2302
|
+
const getPopoverContentStyles = ({
|
|
2303
|
+
theme,
|
|
2304
|
+
width,
|
|
2305
|
+
extraPaddingTop,
|
|
2306
|
+
asToolTip
|
|
2307
|
+
}) => StyleSheet.create({
|
|
2308
|
+
content: Object.assign({
|
|
2309
|
+
display: 'flex',
|
|
2310
|
+
flexDirection: 'column',
|
|
2311
|
+
position: 'absolute',
|
|
2312
|
+
zIndex: 9999,
|
|
2313
|
+
borderRadius: theme.radius.xxxsmall,
|
|
2314
|
+
padding: theme.spacing.small,
|
|
2315
|
+
width: width || undefined,
|
|
2316
|
+
maxWidth: PopoverSizes.Large,
|
|
2317
|
+
shadowColor: 'rgba(20, 25, 30, 0.35)',
|
|
2318
|
+
shadowOffset: {
|
|
2319
|
+
width: 0,
|
|
2320
|
+
height: 10
|
|
2321
|
+
},
|
|
2322
|
+
shadowOpacity: 0.35,
|
|
2323
|
+
shadowRadius: 20,
|
|
2324
|
+
elevation: 6,
|
|
2325
|
+
backgroundColor: asToolTip ? theme.color.surface.bold : theme.color.surface.primary,
|
|
2326
|
+
paddingRight: asToolTip ? theme.spacing.medium : theme.spacing.small
|
|
2327
|
+
}, extraPaddingTop && {
|
|
2328
|
+
paddingTop: theme.spacing.medium
|
|
2329
|
+
})
|
|
2330
|
+
});
|
|
2331
|
+
const getPopoverCloseStyles = ({
|
|
2332
|
+
theme,
|
|
2333
|
+
asToolTip
|
|
2334
|
+
}) => StyleSheet.create({
|
|
2335
|
+
close: {
|
|
2336
|
+
position: 'absolute',
|
|
2337
|
+
top: theme.spacing.xsmall,
|
|
2338
|
+
right: theme.spacing.xsmall,
|
|
2339
|
+
width: 12,
|
|
2340
|
+
height: 12,
|
|
2341
|
+
color: asToolTip ? theme.color.text.reversed : theme.color.text.primary
|
|
2342
|
+
}
|
|
2343
|
+
});
|
|
2344
|
+
// export const StyledPopoverContent = styled(PopoverContent)<{
|
|
2345
|
+
// $asToolTip?: boolean;
|
|
2346
|
+
// $extraPaddingTop: boolean;
|
|
2347
|
+
// $width: PopoverSizes;
|
|
2348
|
+
// }>`
|
|
2349
|
+
// ${POPOVER_CONTENT_CSS}
|
|
2350
|
+
// display: flex;
|
|
2351
|
+
// flex-direction: column;
|
|
2352
|
+
// z-index: 1000;
|
|
2353
|
+
// ${({ $width }) =>
|
|
2354
|
+
// $width &&
|
|
2355
|
+
// `
|
|
2356
|
+
// width: ${$width};
|
|
2357
|
+
// `}
|
|
2358
|
+
// ${({ $extraPaddingTop, theme }) =>
|
|
2359
|
+
// $extraPaddingTop &&
|
|
2360
|
+
// `
|
|
2361
|
+
// padding-top: ${theme.spacing.medium};
|
|
2362
|
+
// `}
|
|
2363
|
+
// ${({ $asToolTip, theme }) => css`
|
|
2364
|
+
// background-color: ${$asToolTip
|
|
2365
|
+
// ? theme.color.surface.bold
|
|
2366
|
+
// : theme.color.surface.primary};
|
|
2367
|
+
// color: ${$asToolTip ? theme.color.text.reversed : theme.color.text.primary};
|
|
2368
|
+
// padding-right: ${$asToolTip
|
|
2369
|
+
// ? theme.spacing.medium
|
|
2370
|
+
// : theme.spacing.small};
|
|
2371
|
+
// `}
|
|
2372
|
+
// &[data-state='open'][data-side='top'] {
|
|
2373
|
+
// animation-name: ${slideDownAndFade};
|
|
2374
|
+
// }
|
|
2375
|
+
// &[data-state="open"][data-side="right"] {
|
|
2376
|
+
// animation-name: ${slideLeftAndFade};
|
|
2377
|
+
// }
|
|
2378
|
+
// &[data-state="open"][data-side="bottom"] {
|
|
2379
|
+
// animation-name: ${slideUpAndFade};
|
|
2380
|
+
// }
|
|
2381
|
+
// &[data-state="open"][data-side="left"] {
|
|
2382
|
+
// animation-name: ${slideRightAndFade};
|
|
2383
|
+
// }
|
|
2384
|
+
// `;
|
|
2385
|
+
// export const StyledPopoverClose = styled(PopoverClose)<{
|
|
2386
|
+
// $asToolTip?: boolean;
|
|
2387
|
+
// }>`
|
|
2388
|
+
// position: absolute;
|
|
2389
|
+
// top: ${({ theme }) => theme.spacing.xsmall};
|
|
2390
|
+
// right: ${({ theme }) => theme.spacing.xsmall};
|
|
2391
|
+
// width: 12px !important;
|
|
2392
|
+
// height: 12px !important;
|
|
2393
|
+
// color: ${({ $asToolTip, theme }) =>
|
|
2394
|
+
// $asToolTip ? theme.color.text.reversed : theme.color.text.primary};
|
|
2395
|
+
// `;
|
|
2396
|
+
// export const StyledPopoverArrow = styled(PopoverArrow)<{
|
|
2397
|
+
// $asToolTip?: boolean;
|
|
2398
|
+
// }>`
|
|
2399
|
+
// fill: ${({ $asToolTip, theme }) =>
|
|
2400
|
+
// $asToolTip ? theme.color.surface.bold : theme.color.surface.primary};
|
|
2401
|
+
// `;
|
|
2402
|
+
|
|
2403
|
+
const DEFAULT_SIDE_OFFSET$1 = 0; //px
|
|
2404
|
+
const Popover = ({
|
|
2405
|
+
asToolTip,
|
|
2406
|
+
children,
|
|
2407
|
+
side,
|
|
2408
|
+
sideOffset = DEFAULT_SIDE_OFFSET$1,
|
|
2409
|
+
showCloseButton,
|
|
2410
|
+
trigger,
|
|
2411
|
+
width = PopoverSizes.Small
|
|
2412
|
+
// defaultOpen,
|
|
2413
|
+
// open
|
|
2414
|
+
}) => {
|
|
2415
|
+
const theme = useTheme();
|
|
2416
|
+
const [_isOpen, setIsOpen] = useState$1(false);
|
|
2417
|
+
const contentStyles = useMemo$1(() => getPopoverContentStyles({
|
|
2418
|
+
theme,
|
|
2419
|
+
width,
|
|
2420
|
+
extraPaddingTop: Boolean(!asToolTip && showCloseButton),
|
|
2421
|
+
asToolTip
|
|
2422
|
+
}), [theme, width, showCloseButton, asToolTip]);
|
|
2423
|
+
const closeStyles = useMemo$1(() => getPopoverCloseStyles({
|
|
2424
|
+
theme,
|
|
2425
|
+
asToolTip
|
|
2426
|
+
}), [theme, asToolTip]);
|
|
2427
|
+
return /*#__PURE__*/React.createElement(PopoverPrimitive.Root, {
|
|
2428
|
+
onOpenChange: setIsOpen
|
|
2429
|
+
}, trigger && (/*#__PURE__*/React.createElement(PopoverPrimitive.Trigger, {
|
|
2430
|
+
asChild: true
|
|
2431
|
+
}, trigger)), /*#__PURE__*/React.createElement(PopoverPrimitive.Content, {
|
|
2432
|
+
side: side,
|
|
2433
|
+
sideOffset: sideOffset || DEFAULT_SIDE_OFFSET$1,
|
|
2434
|
+
onFocusOutside: () => setIsOpen(false),
|
|
2435
|
+
style: contentStyles.content
|
|
2436
|
+
}, children, showCloseButton && (/*#__PURE__*/React.createElement(PopoverPrimitive.Close, {
|
|
2437
|
+
asChild: true,
|
|
2438
|
+
style: closeStyles.close,
|
|
2439
|
+
onPress: () => setIsOpen(false)
|
|
2440
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
2441
|
+
variation: ButtonVariations.Icon
|
|
2442
|
+
}, /*#__PURE__*/React.createElement(CloseIcon, {
|
|
2443
|
+
label: "popover close"
|
|
2444
|
+
}))))));
|
|
2445
|
+
};
|
|
2446
|
+
|
|
2447
|
+
const getProgressBarStyles = ({
|
|
2448
|
+
theme
|
|
2449
|
+
}) => StyleSheet.create({
|
|
2450
|
+
wrapper: {
|
|
2451
|
+
flexDirection: 'row',
|
|
2452
|
+
alignItems: 'center',
|
|
2453
|
+
width: '100%',
|
|
2454
|
+
gap: theme.spacing.xxxsmall,
|
|
2455
|
+
display: 'flex'
|
|
2456
|
+
},
|
|
2457
|
+
root: {
|
|
2458
|
+
flex: 1,
|
|
2459
|
+
position: 'relative',
|
|
2460
|
+
overflow: 'hidden',
|
|
2461
|
+
borderRadius: theme.radius.xsmall,
|
|
2462
|
+
backgroundColor: theme.color.surface.secondary,
|
|
2463
|
+
height: 8
|
|
2464
|
+
},
|
|
2465
|
+
indicator: {
|
|
2466
|
+
backgroundColor: theme.color.surface.indicator,
|
|
2467
|
+
height: '100%'
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
|
|
2471
|
+
const ProgressBar = ({
|
|
2472
|
+
style,
|
|
2473
|
+
max,
|
|
2474
|
+
value = 0
|
|
2475
|
+
}) => {
|
|
2476
|
+
const [progress, setProgress] = useState$1(calculateProgress(max, value));
|
|
2477
|
+
const theme = useTheme();
|
|
2478
|
+
const styles = getProgressBarStyles({
|
|
2479
|
+
theme
|
|
2480
|
+
});
|
|
2481
|
+
useEffect$1(() => {
|
|
2482
|
+
setProgress(calculateProgress(max, value));
|
|
2483
|
+
}, [max, value]);
|
|
2484
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2485
|
+
style: [styles.wrapper, style]
|
|
2486
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
2487
|
+
id: "progressBarIndicator",
|
|
2488
|
+
type: TextTypes.Body6,
|
|
2489
|
+
style: {
|
|
2490
|
+
minWidth: 40
|
|
2491
|
+
}
|
|
2492
|
+
}, value, "/", max), /*#__PURE__*/React.createElement(ProgressPrimitive.Root, {
|
|
2493
|
+
"aria-labelledby": "progressBarIndicator",
|
|
2494
|
+
value: value,
|
|
2495
|
+
max: max,
|
|
2496
|
+
style: styles.root
|
|
2497
|
+
}, /*#__PURE__*/React.createElement(ProgressPrimitive.Indicator, {
|
|
2498
|
+
style: [styles.indicator, {
|
|
2499
|
+
transform: `translateX(-${100 - progress}%)`
|
|
2500
|
+
}]
|
|
2501
|
+
})));
|
|
2502
|
+
};
|
|
2503
|
+
|
|
2504
|
+
const ITEM_WIDTH = 13;
|
|
2505
|
+
const getRadioGroupStyles = ({
|
|
2506
|
+
theme
|
|
2507
|
+
}) => StyleSheet.create({
|
|
2508
|
+
root: {
|
|
2509
|
+
display: 'flex',
|
|
2510
|
+
flexDirection: 'column',
|
|
2511
|
+
gap: theme.spacing.xxsmall,
|
|
2512
|
+
alignItems: 'flex-start'
|
|
2513
|
+
},
|
|
2514
|
+
itemContainer: {
|
|
2515
|
+
display: 'flex',
|
|
2516
|
+
alignItems: 'center'
|
|
2517
|
+
},
|
|
2518
|
+
item: {
|
|
2519
|
+
// all: 'unset',
|
|
2520
|
+
backgroundColor: theme.color.surface.primary,
|
|
2521
|
+
borderWidth: 1,
|
|
2522
|
+
borderColor: theme.color.surface.contrast,
|
|
2523
|
+
borderRadius: theme.radius.full,
|
|
2524
|
+
width: ITEM_WIDTH,
|
|
2525
|
+
height: ITEM_WIDTH,
|
|
2526
|
+
marginRight: theme.spacing.xxsmall,
|
|
2527
|
+
boxShadow: '0 0 0 2px #eeb612'
|
|
2528
|
+
},
|
|
2529
|
+
indicator: {
|
|
2530
|
+
display: 'flex',
|
|
2531
|
+
alignItems: 'center',
|
|
2532
|
+
justifyContent: 'center',
|
|
2533
|
+
width: '100%',
|
|
2534
|
+
height: '100%'
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
// export const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
2538
|
+
// &::after {
|
|
2539
|
+
// content: '';
|
|
2540
|
+
// display: block;
|
|
2541
|
+
// width: 9px;
|
|
2542
|
+
// height: 9px;
|
|
2543
|
+
// border-radius: 50%;
|
|
2544
|
+
// background-color: ${({ theme }) => theme.color.text.primary};
|
|
2545
|
+
// }
|
|
2546
|
+
// `;
|
|
2547
|
+
|
|
2548
|
+
const RadioGroup = _a => {
|
|
2549
|
+
var {
|
|
2550
|
+
error,
|
|
2551
|
+
items,
|
|
2552
|
+
label,
|
|
2553
|
+
labelTooltip,
|
|
2554
|
+
inputRef
|
|
2555
|
+
} = _a,
|
|
2556
|
+
rest = __rest(_a, ["error", "items", "label", "labelTooltip", "inputRef"]);
|
|
2557
|
+
const theme = useTheme();
|
|
2558
|
+
const styles = getRadioGroupStyles({
|
|
2559
|
+
theme
|
|
2560
|
+
});
|
|
2561
|
+
return /*#__PURE__*/React.createElement(View, null, label && (/*#__PURE__*/React.createElement(Label, {
|
|
2562
|
+
bold: true
|
|
2563
|
+
}, label)), /*#__PURE__*/React.createElement(RadioGroupPrimitive.Root
|
|
2564
|
+
// ref={inputRef}
|
|
2565
|
+
// value={undefined}
|
|
2566
|
+
// name={label}
|
|
2567
|
+
, Object.assign({}, rest), items === null || items === void 0 ? void 0 : items.map(item => (/*#__PURE__*/React.createElement(View, {
|
|
2568
|
+
key: item.id,
|
|
2569
|
+
style: styles.itemContainer
|
|
2570
|
+
}, /*#__PURE__*/React.createElement(RadioGroupPrimitive.Item, {
|
|
2571
|
+
value: item.value,
|
|
2572
|
+
id: item.id
|
|
2573
|
+
}, /*#__PURE__*/React.createElement(RadioGroupPrimitive.Indicator, {
|
|
2574
|
+
style: styles.indicator
|
|
2575
|
+
})), item.label && /*#__PURE__*/React.createElement(Label, {
|
|
2576
|
+
inline: true
|
|
2577
|
+
}, item.label)))), /*#__PURE__*/React.createElement(InputError, {
|
|
2578
|
+
visible: Boolean(error)
|
|
2579
|
+
}, error)));
|
|
2580
|
+
};
|
|
2581
|
+
|
|
2582
|
+
const getSeparatorStyles = ({
|
|
2583
|
+
theme,
|
|
2584
|
+
background,
|
|
2585
|
+
spacing
|
|
2586
|
+
}) => StyleSheet.create({
|
|
2587
|
+
wrapper: {
|
|
2588
|
+
backgroundColor: background || theme.color.border.contrast,
|
|
2589
|
+
height: 1,
|
|
2590
|
+
width: '100%'
|
|
2591
|
+
},
|
|
2592
|
+
vertical: {
|
|
2593
|
+
height: '100%',
|
|
2594
|
+
width: 1,
|
|
2595
|
+
marginHorizontal: spacing || theme.spacing.medium
|
|
2596
|
+
},
|
|
2597
|
+
horizontal: {
|
|
2598
|
+
height: 1,
|
|
2599
|
+
width: '100%',
|
|
2600
|
+
marginVertical: spacing || theme.spacing.medium
|
|
2601
|
+
}
|
|
2602
|
+
});
|
|
2603
|
+
|
|
2604
|
+
const Separator = ({
|
|
2605
|
+
background,
|
|
2606
|
+
orientation = 'horizontal',
|
|
2607
|
+
spacing,
|
|
2608
|
+
style
|
|
2609
|
+
}) => {
|
|
2610
|
+
const theme = useTheme();
|
|
2611
|
+
const styles = getSeparatorStyles({
|
|
2612
|
+
theme,
|
|
2613
|
+
background,
|
|
2614
|
+
spacing: spacing
|
|
2615
|
+
});
|
|
2616
|
+
return /*#__PURE__*/React.createElement(SeparatorPrimitive.Root, {
|
|
2617
|
+
style: [styles.wrapper, orientation === 'vertical' ? styles.vertical : styles.horizontal, style],
|
|
2618
|
+
orientation: orientation,
|
|
2619
|
+
decorative: true
|
|
2620
|
+
});
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
const getTagStyles = ({
|
|
2624
|
+
theme,
|
|
2625
|
+
size,
|
|
2626
|
+
appearance,
|
|
2627
|
+
color
|
|
2628
|
+
}) => {
|
|
2629
|
+
const baseStyles = {
|
|
2630
|
+
display: 'flex',
|
|
2631
|
+
flexDirection: 'row',
|
|
2632
|
+
alignItems: 'center',
|
|
2633
|
+
justifyContent: 'center',
|
|
2634
|
+
gap: theme.spacing.xxxsmall,
|
|
2635
|
+
backgroundColor: theme.color.surface.primary,
|
|
2636
|
+
borderWidth: 2,
|
|
2637
|
+
borderColor: color,
|
|
2638
|
+
borderRadius: theme.radius.large,
|
|
2639
|
+
minWidth: 30,
|
|
2640
|
+
width: 120,
|
|
2641
|
+
height: size === TagSizes.small ? 32 : 40,
|
|
2642
|
+
paddingHorizontal: theme.spacing.xsmall,
|
|
2643
|
+
paddingVertical: size === TagSizes.small ? theme.spacing.xsmall : theme.spacing.xxsmall
|
|
2644
|
+
};
|
|
2645
|
+
if (appearance === TagAppearance.filled) return Object.assign(Object.assign({}, baseStyles), {
|
|
2646
|
+
backgroundColor: theme.color.surface.accent
|
|
2647
|
+
});
|
|
2648
|
+
return baseStyles;
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
const Tag = ({
|
|
2652
|
+
children,
|
|
2653
|
+
style,
|
|
2654
|
+
size,
|
|
2655
|
+
color,
|
|
2656
|
+
appearance
|
|
2657
|
+
}) => {
|
|
2658
|
+
const theme = useTheme();
|
|
2659
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2660
|
+
style: [getTagStyles({
|
|
2661
|
+
theme,
|
|
2662
|
+
size,
|
|
2663
|
+
appearance,
|
|
2664
|
+
color
|
|
2665
|
+
}), style]
|
|
2666
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
2667
|
+
style: {
|
|
2668
|
+
fontSize: size === TagSizes.small ? 14 : 16
|
|
2669
|
+
}
|
|
2670
|
+
}, children));
|
|
2671
|
+
};
|
|
2672
|
+
function Tags({
|
|
2673
|
+
appearance,
|
|
2674
|
+
bold,
|
|
2675
|
+
color,
|
|
2676
|
+
content,
|
|
2677
|
+
size,
|
|
2678
|
+
style
|
|
2679
|
+
}) {
|
|
2680
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2681
|
+
style: Object.assign({
|
|
2682
|
+
flexDirection: 'row',
|
|
2683
|
+
gap: tokens.spacing.medium,
|
|
2684
|
+
flexWrap: 'wrap'
|
|
2685
|
+
}, style)
|
|
2686
|
+
}, content.map(tag => (/*#__PURE__*/React.createElement(Tag, {
|
|
2687
|
+
key: tag,
|
|
2688
|
+
bold: bold,
|
|
2689
|
+
size: size,
|
|
2690
|
+
color: color,
|
|
2691
|
+
appearance: appearance
|
|
2692
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
2693
|
+
style: {
|
|
2694
|
+
fontSize: size === TagSizes.small ? 14 : 16
|
|
2695
|
+
}
|
|
2696
|
+
}, tag)))));
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
const createStyles = theme => StyleSheet.create({
|
|
2700
|
+
inputWrapper: {
|
|
2701
|
+
display: 'flex',
|
|
2702
|
+
flexDirection: 'column',
|
|
2703
|
+
width: '100%',
|
|
2704
|
+
maxWidth: InputWidth.Large
|
|
2705
|
+
},
|
|
2706
|
+
inputContainer: {
|
|
2707
|
+
position: 'relative',
|
|
2708
|
+
width: '100%'
|
|
2709
|
+
},
|
|
2710
|
+
input: {
|
|
2711
|
+
width: '100%',
|
|
2712
|
+
borderWidth: 2,
|
|
2713
|
+
borderColor: theme.color.border.subtle,
|
|
2714
|
+
borderRadius: 6,
|
|
2715
|
+
padding: theme.spacing.xxsmall,
|
|
2716
|
+
marginBottom: theme.spacing.xxxxsmall,
|
|
2717
|
+
fontSize: 16,
|
|
2718
|
+
// 1rem equivalent
|
|
2719
|
+
lineHeight: 20 // 1.25 equivalent
|
|
2720
|
+
},
|
|
2721
|
+
inputSmall: {
|
|
2722
|
+
padding: 5
|
|
2723
|
+
},
|
|
2724
|
+
inputError: {
|
|
2725
|
+
borderColor: theme.color.border.error
|
|
2726
|
+
},
|
|
2727
|
+
showPasswordToggle: {
|
|
2728
|
+
position: 'absolute',
|
|
2729
|
+
right: theme.spacing.xxsmall,
|
|
2730
|
+
top: theme.spacing.xxsmall
|
|
2731
|
+
}
|
|
2732
|
+
});
|
|
2733
|
+
const InputWrapper = ({
|
|
2734
|
+
children,
|
|
2735
|
+
width = InputWidth.Large,
|
|
2736
|
+
style
|
|
2737
|
+
}) => {
|
|
2738
|
+
const theme = useTheme();
|
|
2739
|
+
const styles = createStyles(theme);
|
|
2740
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2741
|
+
style: [styles.inputWrapper, {
|
|
2742
|
+
maxWidth: width
|
|
2743
|
+
}, style]
|
|
2744
|
+
}, children);
|
|
2745
|
+
};
|
|
2746
|
+
const InputContainer = ({
|
|
2747
|
+
children,
|
|
2748
|
+
style
|
|
2749
|
+
}) => {
|
|
2750
|
+
const theme = useTheme();
|
|
2751
|
+
const styles = createStyles(theme);
|
|
2752
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
2753
|
+
style: [styles.inputContainer, style]
|
|
2754
|
+
}, children);
|
|
2755
|
+
};
|
|
2756
|
+
const Input = _a => {
|
|
2757
|
+
var {
|
|
2758
|
+
hasError,
|
|
2759
|
+
height,
|
|
2760
|
+
style
|
|
2761
|
+
} = _a,
|
|
2762
|
+
props = __rest(_a, ["hasError", "height", "style"]);
|
|
2763
|
+
const theme = useTheme();
|
|
2764
|
+
const styles = createStyles(theme);
|
|
2765
|
+
return /*#__PURE__*/React.createElement(TextInput$1, Object.assign({
|
|
2766
|
+
style: [styles.input, height === InputHeight.Small && styles.inputSmall, hasError && styles.inputError, style]
|
|
2767
|
+
}, props));
|
|
2768
|
+
};
|
|
2769
|
+
// export const TelephoneInput = styled(PhoneInput)<{
|
|
2770
|
+
// $hasError: boolean;
|
|
2771
|
+
// $height?: string;
|
|
2772
|
+
// }>`
|
|
2773
|
+
// > input.form-control {
|
|
2774
|
+
// ${INPUT_CSS}
|
|
2775
|
+
// padding-left: 52px;
|
|
2776
|
+
// ${({ $hasError }) => $hasError && INPUT_ERROR_CSS}
|
|
2777
|
+
// }
|
|
2778
|
+
// .flag-dropdown {
|
|
2779
|
+
// overflow: hidden;
|
|
2780
|
+
// border: 2px solid
|
|
2781
|
+
// ${({ theme, $hasError }) =>
|
|
2782
|
+
// $hasError ? theme.color.border.error : theme.color.border.subtle};
|
|
2783
|
+
// }
|
|
2784
|
+
// .flag-dropdown.open {
|
|
2785
|
+
// overflow: visible;
|
|
2786
|
+
// }
|
|
2787
|
+
// .flag-dropdown,
|
|
2788
|
+
// .flag-dropdown.open {
|
|
2789
|
+
// background: none;
|
|
2790
|
+
// border-radius: 6px 0 0 6px;
|
|
2791
|
+
// }
|
|
2792
|
+
// .react-tel-input .flag-dropdown.open .selected-flag {
|
|
2793
|
+
// background: none;
|
|
2794
|
+
// }
|
|
2795
|
+
// .react-tel-input .selected-flag {
|
|
2796
|
+
// padding: 0 0 0 14px;
|
|
2797
|
+
// scale: 1.3;
|
|
2798
|
+
// width: 51px;
|
|
2799
|
+
// transition: background ease 0.2s;
|
|
2800
|
+
// > .flag {
|
|
2801
|
+
// margin-top: -6px;
|
|
2802
|
+
// }
|
|
2803
|
+
// }
|
|
2804
|
+
// .react-tel-input .selected-flag:focus {
|
|
2805
|
+
// background: none;
|
|
2806
|
+
// }
|
|
2807
|
+
// .flag-dropdown .selected-flag:hover {
|
|
2808
|
+
// background: ${({ theme }) => theme.color.border.subtle};
|
|
2809
|
+
// }
|
|
2810
|
+
// .react-tel-input .flag-dropdown.open .selected-flag {
|
|
2811
|
+
// &:hover {
|
|
2812
|
+
// background: none;
|
|
2813
|
+
// filter: brightness(0.8);
|
|
2814
|
+
// }
|
|
2815
|
+
// }
|
|
2816
|
+
// .react-tel-input .selected-flag,
|
|
2817
|
+
// .react-tel-input .flag-dropdown.open .selected-flag {
|
|
2818
|
+
// border-radius: 8px 0 0 8px;
|
|
2819
|
+
// }
|
|
2820
|
+
// `;
|
|
2821
|
+
const ShowPasswordToggle = _a => {
|
|
2822
|
+
var {
|
|
2823
|
+
children,
|
|
2824
|
+
style
|
|
2825
|
+
} = _a,
|
|
2826
|
+
props = __rest(_a, ["children", "style"]);
|
|
2827
|
+
const theme = useTheme();
|
|
2828
|
+
const styles = createStyles(theme);
|
|
2829
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
2830
|
+
style: [styles.showPasswordToggle, style]
|
|
2831
|
+
}, props), children);
|
|
2832
|
+
};
|
|
2833
|
+
|
|
2834
|
+
const PASSWORD_TOGGLE_ICON_SIZE = 20;
|
|
2835
|
+
const TextInput = _a => {
|
|
2836
|
+
var {
|
|
2837
|
+
error,
|
|
2838
|
+
height,
|
|
2839
|
+
id,
|
|
2840
|
+
inline,
|
|
2841
|
+
inputRef,
|
|
2842
|
+
label,
|
|
2843
|
+
labelTooltip,
|
|
2844
|
+
onChange,
|
|
2845
|
+
onSubmit,
|
|
2846
|
+
type = 'text',
|
|
2847
|
+
width = InputWidth.Large
|
|
2848
|
+
} = _a,
|
|
2849
|
+
inputProps = __rest(_a, ["error", "height", "id", "inline", "inputRef", "label", "labelTooltip", "onChange", "onSubmit", "type", "width"]);
|
|
2850
|
+
const [inputType, setInputType] = React.useState(type);
|
|
2851
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
2852
|
+
// const { defaultValue, value, ...propsWithoutValues } = inputProps;
|
|
2853
|
+
const errorProps = inline ? {
|
|
2854
|
+
bottom: '-16px',
|
|
2855
|
+
right: '0px'
|
|
2856
|
+
} : {};
|
|
2857
|
+
const handlePasswordVisibilityToggle = () => {
|
|
2858
|
+
if (inputType === 'password') {
|
|
2859
|
+
setInputType('text');
|
|
2860
|
+
setShowPassword(true);
|
|
2861
|
+
} else {
|
|
2862
|
+
setInputType('password');
|
|
2863
|
+
setShowPassword(false);
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
const handleKeyPress = async e => {
|
|
2867
|
+
if (onSubmit && e.nativeEvent.key === 'Enter') {
|
|
2868
|
+
await onSubmit();
|
|
2869
|
+
}
|
|
2870
|
+
};
|
|
2871
|
+
return /*#__PURE__*/React.createElement(InputWrapper, {
|
|
2872
|
+
width: width
|
|
2873
|
+
}, label && (/*#__PURE__*/React.createElement(Label, {
|
|
2874
|
+
bold: true,
|
|
2875
|
+
nativeId: id
|
|
2876
|
+
}, label)), /*#__PURE__*/React.createElement(InputContainer, null, /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
2877
|
+
"aria-labelledby": id,
|
|
2878
|
+
hasError: Boolean(error),
|
|
2879
|
+
secureTextEntry: inputType === 'password',
|
|
2880
|
+
id: id,
|
|
2881
|
+
onChange: onChange,
|
|
2882
|
+
onKeyPress: handleKeyPress,
|
|
2883
|
+
height: height
|
|
2884
|
+
}, inputProps)), type === 'password' && (/*#__PURE__*/React.createElement(ShowPasswordToggle, null, /*#__PURE__*/React.createElement(Button, {
|
|
2885
|
+
variation: ButtonVariations.Icon,
|
|
2886
|
+
onPress: handlePasswordVisibilityToggle
|
|
2887
|
+
}, showPassword ? (/*#__PURE__*/React.createElement(EyeClosedIcon, {
|
|
2888
|
+
label: "show password",
|
|
2889
|
+
width: PASSWORD_TOGGLE_ICON_SIZE,
|
|
2890
|
+
height: PASSWORD_TOGGLE_ICON_SIZE
|
|
2891
|
+
})) : (/*#__PURE__*/React.createElement(EyeOpenIcon, {
|
|
2892
|
+
label: "hide password",
|
|
2893
|
+
width: PASSWORD_TOGGLE_ICON_SIZE,
|
|
2894
|
+
height: PASSWORD_TOGGLE_ICON_SIZE
|
|
2895
|
+
})))))), /*#__PURE__*/React.createElement(InputError, Object.assign({
|
|
2896
|
+
visible: Boolean(error),
|
|
2897
|
+
textAlign: width === InputWidth.Large ? 'right' : 'left'
|
|
2898
|
+
}, errorProps), error));
|
|
2899
|
+
};
|
|
2900
|
+
|
|
2901
|
+
const DEFAULT_SIDE_OFFSET = 4; //px
|
|
2902
|
+
const ToolTip = ({
|
|
2903
|
+
// open,
|
|
2904
|
+
side = 'top',
|
|
2905
|
+
sideOffset = DEFAULT_SIDE_OFFSET,
|
|
2906
|
+
trigger,
|
|
2907
|
+
text
|
|
2908
|
+
// ...rest
|
|
2909
|
+
}) => {
|
|
2910
|
+
const theme = useTheme();
|
|
2911
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
2912
|
+
asToolTip: true,
|
|
2913
|
+
// open={open}
|
|
2914
|
+
side: side,
|
|
2915
|
+
sideOffset: sideOffset,
|
|
2916
|
+
showCloseButton: true,
|
|
2917
|
+
trigger: trigger,
|
|
2918
|
+
width: PopoverSizes.Large
|
|
2919
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
2920
|
+
color: theme.color.text.reversed,
|
|
2921
|
+
type: TextTypes.Body5
|
|
2922
|
+
}, text));
|
|
2923
|
+
};
|
|
2924
|
+
|
|
2925
|
+
const lightTheme = Object.assign(Object.assign({}, tokens), {
|
|
2926
|
+
color: tokens.color.theme.light
|
|
2927
|
+
});
|
|
2928
|
+
const darkTheme = Object.assign(Object.assign({}, tokens), {
|
|
2929
|
+
color: tokens.color.theme.dark
|
|
2930
|
+
});
|
|
2931
|
+
const defaultTheme = lightTheme;
|
|
2932
|
+
const themes = {
|
|
2933
|
+
[ThemeVariants.light]: lightTheme,
|
|
2934
|
+
[ThemeVariants.dark]: darkTheme
|
|
2935
|
+
};
|
|
2936
|
+
const themeContext = /*#__PURE__*/createContext$1({
|
|
2937
|
+
toggleMode: () => {},
|
|
2938
|
+
setMode: _mode => {},
|
|
2939
|
+
currentMode: defaultThemeVariant
|
|
2940
|
+
});
|
|
2941
|
+
const {
|
|
2942
|
+
Provider
|
|
2943
|
+
} = themeContext;
|
|
2944
|
+
const CustomThemeProvider = ({
|
|
2945
|
+
children,
|
|
2946
|
+
defaultMode = defaultThemeVariant
|
|
2947
|
+
}) => {
|
|
2948
|
+
const [currentMode, setCurrentMode] = useState$1(defaultMode);
|
|
2949
|
+
const toggleMode = useCallback$1(() => {
|
|
2950
|
+
setCurrentMode(currentMode => currentMode === ThemeVariants.light ? ThemeVariants.dark : ThemeVariants.light);
|
|
2951
|
+
}, []);
|
|
2952
|
+
const setMode = useCallback$1(mode => {
|
|
2953
|
+
setCurrentMode(mode);
|
|
2954
|
+
}, []);
|
|
2955
|
+
const contextValue = useMemo$1(() => ({
|
|
2956
|
+
currentMode,
|
|
2957
|
+
toggleMode,
|
|
2958
|
+
setMode
|
|
2959
|
+
}), [currentMode, toggleMode, setMode]);
|
|
2960
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
2961
|
+
value: contextValue
|
|
2962
|
+
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
2963
|
+
theme: themes[currentMode]
|
|
2964
|
+
}, children));
|
|
2965
|
+
};
|
|
2966
|
+
|
|
2967
|
+
// Force hooks to be accessed through React (Test if still needed)
|
|
2968
|
+
const {
|
|
2969
|
+
useState,
|
|
2970
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2971
|
+
useEffect,
|
|
2972
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2973
|
+
useRef,
|
|
2974
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2975
|
+
useCallback,
|
|
2976
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2977
|
+
useMemo,
|
|
2978
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2979
|
+
createContext,
|
|
2980
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2981
|
+
forwardRef // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2982
|
+
} = React;
|
|
2983
|
+
|
|
2984
|
+
export { Accordion, AccountIcon, AddToChatIcon, AppointmentIcon, ArchiveIcon, ArrowLeftIcon, AttachmentIcon, BellIcon, BrokenChainImage, Button, CalendarAddIcon, CalendarIcon, CallIncomingIcon, CallOutgoingIcon, CameraIcon, Card, CardContent, CardFooter, CardHeader, CheckIcon, CheckInChatIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ClockBackIcon, ClockDashedIcon, ClockIcon, CloseIcon, ConfettiImage, CopyIcon, CustomThemeProvider, DashboardIcon, DotsIcon, DownloadIcon, Dropdown, ExclamationIcon, EyeClosedIcon, EyeOpenIcon, FacebookIcon, FriendshipImage, FullScreenExitIcon, FullScreenIcon, GithubIcon, Gradient, GroupChatIcon, GroupHandsImage, HeartIcon, ImageIcon, ImageSearchIcon, InclusiveIcon, InfoIcon, InstagramIcon, KeyImage, Label, LaptopWithPhoneImage, Link, LinkedInIcon, LivingRoomImage, Loading, LoadingLogo, Logo, LogoutIcon, MailIcon, ManOnRocketImage, MatchSearchingImage, MenuIcon, MessageIcon, MessageWithQuestionIcon, MicIcon, MobileIcon, MoonIcon, NotesIcon, PaperPlaneImage, PencilIcon, PeopleTogetherImage, PhoneIcon, PhoneSlashIcon, PlusIcon, Popover, ProfileChatIcon, ProfileIcon, ProgressBar, PuzzleIcon, QuestionIcon, QuestionMarksImage, RadioGroup, RaisingMoneyImage, ScreenShareIcon, SendIcon, Separator, SettingsIcon, SpeakerIcon, StackIcon, StarIcon, SunIcon, SwapIcon, Tag, Tags, TeacherImage, TelegramIcon, Text, TextInput, TickDoubleIcon, TickIcon, TiktokIcon, TimeFlexibleImage, ToolTip, TranslatorIcon, TrashIcon, TwitterIcon, UnmatchedImage, UploadIcon, UserDisconnectedIcon, UserSearchIcon, VideoIcon, WavyBlockImage, WavyLinesImage, WebIcon, WhatsappIcon, WomanOnRocketImage, darkTheme, defaultTheme, lightTheme, themeContext, themes };
|
|
2985
|
+
//# sourceMappingURL=index.esm.js.map
|