@app-studio/web 0.1.7 → 0.1.9
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/dist/components/Form/TextArea/TextArea/TextArea.state.d.ts +2 -2
- package/dist/web.cjs.development.js +4054 -151
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +4036 -17
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -1,18 +1,4037 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import 'core-js/modules/es6.object.assign.js';
|
|
2
|
+
import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';
|
|
3
|
+
import { Element, Typography, useTheme, Input, View as View$2 } from 'app-studio';
|
|
4
|
+
export { View } from 'app-studio';
|
|
5
|
+
import { Link as Link$1, Center as Center$1, TextField as TextField$1, View, Text as Text$1, Horizontal as Horizontal$1, Vertical as Vertical$1, Button as Button$1 } from 'src/components';
|
|
6
|
+
import { Label } from './components/Form/Label/Label';
|
|
7
|
+
import { IndeterminateSvg, CheckSvg, ArrowDownSvg as ArrowDownSvg$1, ArrowUpSvg as ArrowUpSvg$1, CloseSvg, ExternalLinkSvg } from './components/Svg';
|
|
8
|
+
import 'core-js/modules/es6.array.map.js';
|
|
9
|
+
import 'core-js/modules/es6.array.filter.js';
|
|
10
|
+
import 'core-js/modules/es6.string.starts-with.js';
|
|
11
|
+
import { FieldContainer, FieldContent, FieldWrapper, FieldLabel, FieldIcons } from './components/Layout/Input';
|
|
12
|
+
import { ArrowDownSvg } from './components/Svg/ArrowDown';
|
|
13
|
+
import { ArrowUpSvg } from './components/Svg/ArrowUp';
|
|
14
|
+
import format from 'date-fns/format';
|
|
15
|
+
import { FieldContainer as FieldContainer$1 } from './components/Layout/Input/FieldContainer/FieldContainer';
|
|
16
|
+
import { FieldContent as FieldContent$1 } from './components/Layout/Input/FieldContent/FieldContent';
|
|
17
|
+
import { FieldLabel as FieldLabel$1 } from './components/Layout/Input/FieldLabel/FieldLabel';
|
|
18
|
+
import { FieldWrapper as FieldWrapper$1 } from './components/Layout/Input/FieldWrapper/FieldWrapper';
|
|
19
|
+
import 'core-js/modules/es6.string.includes.js';
|
|
20
|
+
import 'core-js/modules/es7.array.includes.js';
|
|
21
|
+
import { FieldIcons as FieldIcons$1 } from './components/Layout/Input/FieldIcons/FieldIcons';
|
|
22
|
+
import { View as View$1 } from './components/Layout/View/View';
|
|
23
|
+
import { Link as Link$2 } from 'react-router-dom';
|
|
24
|
+
import { useModalStore } from 'src/store/useModalStore';
|
|
25
|
+
import 'core-js/modules/es6.array.slice.js';
|
|
26
|
+
|
|
27
|
+
var useButtonState = function useButtonState() {
|
|
28
|
+
var _React$useState = React.useState(false),
|
|
29
|
+
isHovered = _React$useState[0],
|
|
30
|
+
setIsHovered = _React$useState[1];
|
|
31
|
+
return {
|
|
32
|
+
isHovered: isHovered,
|
|
33
|
+
setIsHovered: setIsHovered
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
38
|
+
if (source == null) return {};
|
|
39
|
+
var target = {};
|
|
40
|
+
var sourceKeys = Object.keys(source);
|
|
41
|
+
var key, i;
|
|
42
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
43
|
+
key = sourceKeys[i];
|
|
44
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
45
|
+
target[key] = source[key];
|
|
46
|
+
}
|
|
47
|
+
return target;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var ButtonSizes = {
|
|
51
|
+
xs: {
|
|
52
|
+
width: 79,
|
|
53
|
+
paddingTop: 8,
|
|
54
|
+
paddingBottom: 8,
|
|
55
|
+
paddingLeft: 12,
|
|
56
|
+
paddingRight: 12,
|
|
57
|
+
fontWeight: 600,
|
|
58
|
+
fontSize: 'xs',
|
|
59
|
+
lineHeight: 16,
|
|
60
|
+
letterSpacing: 1.25
|
|
61
|
+
},
|
|
62
|
+
sm: {
|
|
63
|
+
width: 128,
|
|
64
|
+
paddingTop: 10,
|
|
65
|
+
paddingBottom: 10,
|
|
66
|
+
paddingLeft: 16,
|
|
67
|
+
paddingRight: 16,
|
|
68
|
+
fontWeight: 600,
|
|
69
|
+
fontSize: 'sm',
|
|
70
|
+
lineHeight: 20,
|
|
71
|
+
letterSpacing: 1.25
|
|
72
|
+
},
|
|
73
|
+
md: {
|
|
74
|
+
width: 144,
|
|
75
|
+
paddingTop: 12,
|
|
76
|
+
paddingBottom: 12,
|
|
77
|
+
paddingLeft: 18,
|
|
78
|
+
paddingRight: 18,
|
|
79
|
+
fontWeight: 600,
|
|
80
|
+
fontSize: 'md',
|
|
81
|
+
lineHeight: 24,
|
|
82
|
+
letterSpacing: 1.25
|
|
83
|
+
},
|
|
84
|
+
lg: {
|
|
85
|
+
width: 178,
|
|
86
|
+
paddingTop: 14,
|
|
87
|
+
paddingBottom: 14,
|
|
88
|
+
paddingLeft: 22,
|
|
89
|
+
paddingRight: 22,
|
|
90
|
+
fontWeight: 600,
|
|
91
|
+
fontSize: 'lg',
|
|
92
|
+
lineHeight: 24,
|
|
93
|
+
letterSpacing: 1.25
|
|
94
|
+
},
|
|
95
|
+
xl: {
|
|
96
|
+
width: 220,
|
|
97
|
+
paddingTop: 16,
|
|
98
|
+
paddingBottom: 16,
|
|
99
|
+
paddingLeft: 26,
|
|
100
|
+
paddingRight: 26,
|
|
101
|
+
fontWeight: 600,
|
|
102
|
+
fontSize: 'xl',
|
|
103
|
+
lineHeight: 24,
|
|
104
|
+
letterSpacing: 1.25
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var ButtonShapes = {
|
|
108
|
+
sharp: 0,
|
|
109
|
+
rounded: 4,
|
|
110
|
+
pillShaped: 24
|
|
111
|
+
};
|
|
112
|
+
var IconSizes = {
|
|
113
|
+
xs: {
|
|
114
|
+
width: 24,
|
|
115
|
+
height: 24,
|
|
116
|
+
padding: 12
|
|
117
|
+
},
|
|
118
|
+
sm: {
|
|
119
|
+
width: 24,
|
|
120
|
+
height: 24,
|
|
121
|
+
padding: 15
|
|
122
|
+
},
|
|
123
|
+
md: {
|
|
124
|
+
width: 36,
|
|
125
|
+
height: 36,
|
|
126
|
+
padding: 15
|
|
127
|
+
},
|
|
128
|
+
lg: {
|
|
129
|
+
width: 36,
|
|
130
|
+
height: 36,
|
|
131
|
+
padding: 18
|
|
132
|
+
},
|
|
133
|
+
xl: {
|
|
134
|
+
width: 36,
|
|
135
|
+
height: 36,
|
|
136
|
+
padding: 24
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
var _excluded = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick"];
|
|
141
|
+
var ButtonView = function ButtonView(_ref) {
|
|
142
|
+
var _props$onClick;
|
|
143
|
+
var icon = _ref.icon,
|
|
144
|
+
shadow = _ref.shadow,
|
|
145
|
+
children = _ref.children,
|
|
146
|
+
ariaLabel = _ref.ariaLabel,
|
|
147
|
+
externalHref = _ref.externalHref,
|
|
148
|
+
_ref$isAuto = _ref.isAuto,
|
|
149
|
+
isAuto = _ref$isAuto === void 0 ? false : _ref$isAuto,
|
|
150
|
+
_ref$isFilled = _ref.isFilled,
|
|
151
|
+
isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
|
|
152
|
+
_ref$isIconRounded = _ref.isIconRounded,
|
|
153
|
+
isIconRounded = _ref$isIconRounded === void 0 ? false : _ref$isIconRounded,
|
|
154
|
+
_ref$isLoading = _ref.isLoading,
|
|
155
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
156
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
157
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
158
|
+
_ref$size = _ref.size,
|
|
159
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
160
|
+
_ref$variant = _ref.variant,
|
|
161
|
+
variant = _ref$variant === void 0 ? 'filled' : _ref$variant,
|
|
162
|
+
_ref$iconPosition = _ref.iconPosition,
|
|
163
|
+
iconPosition = _ref$iconPosition === void 0 ? 'left' : _ref$iconPosition,
|
|
164
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
165
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
166
|
+
_ref$shape = _ref.shape,
|
|
167
|
+
shape = _ref$shape === void 0 ? 'rounded' : _ref$shape,
|
|
168
|
+
_ref$onClick = _ref.onClick,
|
|
169
|
+
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
170
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
171
|
+
var isActive = !(isDisabled || isLoading);
|
|
172
|
+
var defaultNativeProps = {
|
|
173
|
+
disabled: !isActive
|
|
174
|
+
};
|
|
175
|
+
var buttonColor = isActive ? colorScheme : 'theme.disabled';
|
|
176
|
+
var ButtonVariants = {
|
|
177
|
+
filled: {
|
|
178
|
+
backgroundColor: buttonColor,
|
|
179
|
+
color: 'color.white'
|
|
180
|
+
},
|
|
181
|
+
outline: {
|
|
182
|
+
backgroundColor: 'transparent',
|
|
183
|
+
borderWidth: 1,
|
|
184
|
+
borderStyle: 'solid',
|
|
185
|
+
borderColor: colorScheme,
|
|
186
|
+
color: buttonColor
|
|
187
|
+
},
|
|
188
|
+
link: {
|
|
189
|
+
backgroundColor: 'transparent',
|
|
190
|
+
border: 'none',
|
|
191
|
+
color: buttonColor,
|
|
192
|
+
textDecorationLine: 'underline'
|
|
193
|
+
},
|
|
194
|
+
ghost: {
|
|
195
|
+
backgroundColor: 'transparent',
|
|
196
|
+
border: 'none',
|
|
197
|
+
color: buttonColor
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var buttonSizeStyles = ButtonSizes[size];
|
|
201
|
+
var buttonVariant = ButtonVariants[variant];
|
|
202
|
+
var scaleWidth = {
|
|
203
|
+
width: isAuto ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
|
|
204
|
+
};
|
|
205
|
+
var changePadding = {
|
|
206
|
+
padding: isIconRounded ? IconSizes[size].padding : ButtonSizes[size].padding
|
|
207
|
+
};
|
|
208
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, icon && iconPosition === 'left' && !isLoading && icon, children, icon && iconPosition === 'right' && !isLoading && icon);
|
|
209
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
210
|
+
gap: 8,
|
|
211
|
+
as: "button",
|
|
212
|
+
role: "button",
|
|
213
|
+
border: "none",
|
|
214
|
+
color: "color.white",
|
|
215
|
+
display: "flex",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
justifyContent: "center",
|
|
218
|
+
ariaLabel: ariaLabel,
|
|
219
|
+
backgroundColor: buttonColor,
|
|
220
|
+
borderRadius: ButtonShapes[shape],
|
|
221
|
+
onClick: (_props$onClick = props.onClick) != null ? _props$onClick : onClick,
|
|
222
|
+
cursor: isActive ? 'pointer' : 'default'
|
|
223
|
+
}, defaultNativeProps, buttonSizeStyles, buttonVariant, scaleWidth, changePadding, shadow, props), variant === 'link' && externalHref ? /*#__PURE__*/React.createElement(Link$1, {
|
|
224
|
+
href: externalHref,
|
|
225
|
+
textDecorationColor: colorScheme,
|
|
226
|
+
colorScheme: colorScheme,
|
|
227
|
+
isExternal: true
|
|
228
|
+
}, content) : content);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var ButtonComponent = function ButtonComponent(props) {
|
|
232
|
+
var _useButtonState = useButtonState(),
|
|
233
|
+
isHovered = _useButtonState.isHovered,
|
|
234
|
+
setIsHovered = _useButtonState.setIsHovered;
|
|
235
|
+
var handleHover = function handleHover() {
|
|
236
|
+
return setIsHovered(!isHovered);
|
|
237
|
+
};
|
|
238
|
+
return /*#__PURE__*/React.createElement(ButtonView, Object.assign({
|
|
239
|
+
onMouseEnter: handleHover,
|
|
240
|
+
onMouseLeave: handleHover,
|
|
241
|
+
filter: isHovered ? 'brightness(0.85)' : 'brightness(1)'
|
|
242
|
+
}, props));
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Buttons allow us to trigger an event or an action with a single click.
|
|
246
|
+
*/
|
|
247
|
+
var Button = ButtonComponent;
|
|
248
|
+
|
|
249
|
+
var useCheckboxState = function useCheckboxState(_ref) {
|
|
250
|
+
var _ref$defaultIsSelecte = _ref.defaultIsSelected,
|
|
251
|
+
defaultIsSelected = _ref$defaultIsSelecte === void 0 ? false : _ref$defaultIsSelecte;
|
|
252
|
+
var _React$useState = React.useState(false),
|
|
253
|
+
isHovered = _React$useState[0],
|
|
254
|
+
setIsHovered = _React$useState[1];
|
|
255
|
+
var _React$useState2 = React.useState(defaultIsSelected),
|
|
256
|
+
isSelected = _React$useState2[0],
|
|
257
|
+
setIsSelected = _React$useState2[1];
|
|
258
|
+
return {
|
|
259
|
+
isHovered: isHovered,
|
|
260
|
+
setIsHovered: setIsHovered,
|
|
261
|
+
isSelected: isSelected,
|
|
262
|
+
setIsSelected: setIsSelected
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
var Sizes = {
|
|
267
|
+
xs: {
|
|
268
|
+
height: 8,
|
|
269
|
+
width: 8
|
|
270
|
+
},
|
|
271
|
+
sm: {
|
|
272
|
+
height: 12,
|
|
273
|
+
width: 12
|
|
274
|
+
},
|
|
275
|
+
md: {
|
|
276
|
+
height: 18,
|
|
277
|
+
width: 18
|
|
278
|
+
},
|
|
279
|
+
lg: {
|
|
280
|
+
height: 24,
|
|
281
|
+
width: 24
|
|
282
|
+
},
|
|
283
|
+
xl: {
|
|
284
|
+
height: 30,
|
|
285
|
+
width: 30
|
|
286
|
+
},
|
|
287
|
+
'2xl': {
|
|
288
|
+
height: 36,
|
|
289
|
+
width: 36
|
|
290
|
+
},
|
|
291
|
+
'3xl': {
|
|
292
|
+
height: 42,
|
|
293
|
+
width: 42
|
|
294
|
+
},
|
|
295
|
+
'4xl': {
|
|
296
|
+
height: 48,
|
|
297
|
+
width: 48
|
|
298
|
+
},
|
|
299
|
+
'5xl': {
|
|
300
|
+
height: 54,
|
|
301
|
+
width: 54
|
|
302
|
+
},
|
|
303
|
+
'6xl': {
|
|
304
|
+
height: 60,
|
|
305
|
+
width: 60
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
var IconSizes$1 = {
|
|
309
|
+
xs: 6,
|
|
310
|
+
sm: 12,
|
|
311
|
+
md: 18,
|
|
312
|
+
lg: 24,
|
|
313
|
+
xl: 30,
|
|
314
|
+
'2xl': 36,
|
|
315
|
+
'3xl': 42,
|
|
316
|
+
'4xl': 48,
|
|
317
|
+
'5xl': 54,
|
|
318
|
+
'6xl': 60
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
var _excluded$1 = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
|
|
322
|
+
var CheckboxView = function CheckboxView(_ref) {
|
|
323
|
+
var id = _ref.id,
|
|
324
|
+
icon = _ref.icon,
|
|
325
|
+
label = _ref.label,
|
|
326
|
+
isChecked = _ref.isChecked,
|
|
327
|
+
onChange = _ref.onChange,
|
|
328
|
+
onValueChange = _ref.onValueChange,
|
|
329
|
+
_ref$shadow = _ref.shadow,
|
|
330
|
+
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
331
|
+
_ref$size = _ref.size,
|
|
332
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
333
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
334
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
335
|
+
_ref$error = _ref.error,
|
|
336
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
337
|
+
_ref$isSelected = _ref.isSelected,
|
|
338
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
339
|
+
_ref$isHovered = _ref.isHovered,
|
|
340
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
341
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
342
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
343
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
344
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
345
|
+
_ref$isIndeterminate = _ref.isIndeterminate,
|
|
346
|
+
isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate,
|
|
347
|
+
_ref$setIsSelected = _ref.setIsSelected,
|
|
348
|
+
setIsSelected = _ref$setIsSelected === void 0 ? function () {} : _ref$setIsSelected,
|
|
349
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
350
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
351
|
+
_ref$styles = _ref.styles,
|
|
352
|
+
styles = _ref$styles === void 0 ? {
|
|
353
|
+
checkbox: {},
|
|
354
|
+
label: {}
|
|
355
|
+
} : _ref$styles,
|
|
356
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
357
|
+
var handleHover = function handleHover() {
|
|
358
|
+
return setIsHovered(!isHovered);
|
|
359
|
+
};
|
|
360
|
+
var handleChange = function handleChange() {
|
|
361
|
+
if (!isReadOnly && !isDisabled) {
|
|
362
|
+
if (isChecked === undefined) {
|
|
363
|
+
setIsSelected(!isSelected);
|
|
364
|
+
} else {
|
|
365
|
+
if (onChange) onChange(!isChecked);
|
|
366
|
+
if (onValueChange) onValueChange(!isChecked);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
var checkboxStyle = {
|
|
371
|
+
container: Object.assign({
|
|
372
|
+
gap: 10,
|
|
373
|
+
display: 'flex',
|
|
374
|
+
alignItems: 'center',
|
|
375
|
+
height: 'fit-content',
|
|
376
|
+
width: 'fit-content',
|
|
377
|
+
color: error ? 'theme.error' : isDisabled ? 'theme.disabled' : 'color.blueGray.700',
|
|
378
|
+
cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer'
|
|
379
|
+
}, styles['label']),
|
|
380
|
+
checkbox: Object.assign({}, isDisabled ? {
|
|
381
|
+
backgroundColor: 'theme.disabled'
|
|
382
|
+
} : (isChecked || isSelected) && !isIndeterminate || isIndeterminate ? {
|
|
383
|
+
backgroundColor: colorScheme
|
|
384
|
+
} : {
|
|
385
|
+
borderWidth: 2,
|
|
386
|
+
borderColor: error ? 'theme.error' : isHovered ? 'color.gray.500' : 'color.gray.300',
|
|
387
|
+
borderStyle: 'solid'
|
|
388
|
+
}, {
|
|
389
|
+
borderRadius: 3,
|
|
390
|
+
filter: isHovered ? 'brightness(0.9)' : undefined
|
|
391
|
+
}, Sizes[size], shadow, styles['checkbox'])
|
|
392
|
+
};
|
|
393
|
+
return /*#__PURE__*/React.createElement(Label, Object.assign({
|
|
394
|
+
htmlFor: id,
|
|
395
|
+
as: "div",
|
|
396
|
+
onClick: handleChange,
|
|
397
|
+
onMouseEnter: handleHover,
|
|
398
|
+
onMouseLeave: handleHover,
|
|
399
|
+
size: Typography.fontSizes[size]
|
|
400
|
+
}, checkboxStyle.container, props), /*#__PURE__*/React.createElement(Center$1, Object.assign({}, checkboxStyle.checkbox), isIndeterminate ? /*#__PURE__*/React.createElement(IndeterminateSvg, null) : (isChecked || isSelected) && (icon != null ? icon : /*#__PURE__*/React.createElement(CheckSvg, {
|
|
401
|
+
size: IconSizes$1[size]
|
|
402
|
+
}))), label);
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
var CheckboxComponent = function CheckboxComponent(props) {
|
|
406
|
+
var checkboxStates = useCheckboxState(props);
|
|
407
|
+
return /*#__PURE__*/React.createElement(CheckboxView, Object.assign({}, checkboxStates, props));
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* Checkbox allows users to select one or more options from a list of choices.
|
|
411
|
+
*/
|
|
412
|
+
var Checkbox = CheckboxComponent;
|
|
413
|
+
|
|
414
|
+
var countryList = [
|
|
415
|
+
{
|
|
416
|
+
name: "Afghanistan",
|
|
417
|
+
dial_code: "+93",
|
|
418
|
+
emoji: "🇦🇫",
|
|
419
|
+
code: "AF"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "Aland Islands",
|
|
423
|
+
dial_code: "+358",
|
|
424
|
+
emoji: "🇦🇽",
|
|
425
|
+
code: "AX"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "Albania",
|
|
429
|
+
dial_code: "+355",
|
|
430
|
+
emoji: "🇦🇱",
|
|
431
|
+
code: "AL"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: "Algeria",
|
|
435
|
+
dial_code: "+213",
|
|
436
|
+
emoji: "🇩🇿",
|
|
437
|
+
code: "DZ"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "AmericanSamoa",
|
|
441
|
+
dial_code: "+1684",
|
|
442
|
+
emoji: "🇦🇸",
|
|
443
|
+
code: "AS"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: "Andorra",
|
|
447
|
+
dial_code: "+376",
|
|
448
|
+
emoji: "🇦🇩",
|
|
449
|
+
code: "AD"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: "Angola",
|
|
453
|
+
dial_code: "+244",
|
|
454
|
+
emoji: "🇦🇴",
|
|
455
|
+
code: "AO"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: "Anguilla",
|
|
459
|
+
dial_code: "+1264",
|
|
460
|
+
emoji: "🇦🇮",
|
|
461
|
+
code: "AI"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "Antarctica",
|
|
465
|
+
dial_code: "+672",
|
|
466
|
+
emoji: "🇦🇶",
|
|
467
|
+
code: "AQ"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "Antigua and Barbuda",
|
|
471
|
+
dial_code: "+1268",
|
|
472
|
+
emoji: "🇦🇬",
|
|
473
|
+
code: "AG"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: "Argentina",
|
|
477
|
+
dial_code: "+54",
|
|
478
|
+
emoji: "🇦🇷",
|
|
479
|
+
code: "AR"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
name: "Armenia",
|
|
483
|
+
dial_code: "+374",
|
|
484
|
+
emoji: "🇦🇲",
|
|
485
|
+
code: "AM"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "Aruba",
|
|
489
|
+
dial_code: "+297",
|
|
490
|
+
emoji: "🇦🇼",
|
|
491
|
+
code: "AW"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: "Australia",
|
|
495
|
+
dial_code: "+61",
|
|
496
|
+
emoji: "🇦🇺",
|
|
497
|
+
code: "AU"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: "Austria",
|
|
501
|
+
dial_code: "+43",
|
|
502
|
+
emoji: "🇦🇹",
|
|
503
|
+
code: "AT"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: "Azerbaijan",
|
|
507
|
+
dial_code: "+994",
|
|
508
|
+
emoji: "🇦🇿",
|
|
509
|
+
code: "AZ"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: "Bahamas",
|
|
513
|
+
dial_code: "+1242",
|
|
514
|
+
emoji: "🇧🇸",
|
|
515
|
+
code: "BS"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: "Bahrain",
|
|
519
|
+
dial_code: "+973",
|
|
520
|
+
emoji: "🇧🇭",
|
|
521
|
+
code: "BH"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
name: "Bangladesh",
|
|
525
|
+
dial_code: "+880",
|
|
526
|
+
emoji: "🇧🇩",
|
|
527
|
+
code: "BD"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "Barbados",
|
|
531
|
+
dial_code: "+1246",
|
|
532
|
+
emoji: "🇧🇧",
|
|
533
|
+
code: "BB"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "Belarus",
|
|
537
|
+
dial_code: "+375",
|
|
538
|
+
emoji: "🇧🇾",
|
|
539
|
+
code: "BY"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: "Belgium",
|
|
543
|
+
dial_code: "+32",
|
|
544
|
+
emoji: "🇧🇪",
|
|
545
|
+
code: "BE"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: "Belize",
|
|
549
|
+
dial_code: "+501",
|
|
550
|
+
emoji: "🇧🇿",
|
|
551
|
+
code: "BZ"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "Benin",
|
|
555
|
+
dial_code: "+229",
|
|
556
|
+
emoji: "🇧🇯",
|
|
557
|
+
code: "BJ"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
name: "Bermuda",
|
|
561
|
+
dial_code: "+1441",
|
|
562
|
+
emoji: "🇧🇲",
|
|
563
|
+
code: "BM"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: "Bhutan",
|
|
567
|
+
dial_code: "+975",
|
|
568
|
+
emoji: "🇧🇹",
|
|
569
|
+
code: "BT"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "Bolivia, Plurinational State of",
|
|
573
|
+
dial_code: "+591",
|
|
574
|
+
emoji: "🇧🇴",
|
|
575
|
+
code: "BO"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: "Bosnia and Herzegovina",
|
|
579
|
+
dial_code: "+387",
|
|
580
|
+
emoji: "🇧🇦",
|
|
581
|
+
code: "BA"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "Botswana",
|
|
585
|
+
dial_code: "+267",
|
|
586
|
+
emoji: "🇧🇼",
|
|
587
|
+
code: "BW"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "Brazil",
|
|
591
|
+
dial_code: "+55",
|
|
592
|
+
emoji: "🇧🇷",
|
|
593
|
+
code: "BR"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: "British Indian Ocean Territory",
|
|
597
|
+
dial_code: "+246",
|
|
598
|
+
emoji: "🇮🇴",
|
|
599
|
+
code: "IO"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: "Brunei Darussalam",
|
|
603
|
+
dial_code: "+673",
|
|
604
|
+
emoji: "🇧🇳",
|
|
605
|
+
code: "BN"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
name: "Bulgaria",
|
|
609
|
+
dial_code: "+359",
|
|
610
|
+
emoji: "🇧🇬",
|
|
611
|
+
code: "BG"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
name: "Burkina Faso",
|
|
615
|
+
dial_code: "+226",
|
|
616
|
+
emoji: "🇧🇫",
|
|
617
|
+
code: "BF"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "Burundi",
|
|
621
|
+
dial_code: "+257",
|
|
622
|
+
emoji: "🇧🇮",
|
|
623
|
+
code: "BI"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "Cambodia",
|
|
627
|
+
dial_code: "+855",
|
|
628
|
+
emoji: "🇰🇭",
|
|
629
|
+
code: "KH"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: "Cameroon",
|
|
633
|
+
dial_code: "+237",
|
|
634
|
+
emoji: "🇨🇲",
|
|
635
|
+
code: "CM"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
name: "Canada",
|
|
639
|
+
dial_code: "+1",
|
|
640
|
+
emoji: "🇨🇦",
|
|
641
|
+
code: "CA"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
name: "Cape Verde",
|
|
645
|
+
dial_code: "+238",
|
|
646
|
+
emoji: "🇨🇻",
|
|
647
|
+
code: "CV"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
name: "Cayman Islands",
|
|
651
|
+
dial_code: "+345",
|
|
652
|
+
emoji: "🇰🇾",
|
|
653
|
+
code: "KY"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
name: "Central African Republic",
|
|
657
|
+
dial_code: "+236",
|
|
658
|
+
emoji: "🇨🇫",
|
|
659
|
+
code: "CF"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "Chad",
|
|
663
|
+
dial_code: "+235",
|
|
664
|
+
emoji: "🇹🇩",
|
|
665
|
+
code: "TD"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
name: "Chile",
|
|
669
|
+
dial_code: "+56",
|
|
670
|
+
emoji: "🇨🇱",
|
|
671
|
+
code: "CL"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
name: "China",
|
|
675
|
+
dial_code: "+86",
|
|
676
|
+
emoji: "🇨🇳",
|
|
677
|
+
code: "CN"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "Christmas Island",
|
|
681
|
+
dial_code: "+61",
|
|
682
|
+
emoji: "🇨🇽",
|
|
683
|
+
code: "CX"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: "Cocos (Keeling) Islands",
|
|
687
|
+
dial_code: "+61",
|
|
688
|
+
emoji: "🇨🇨",
|
|
689
|
+
code: "CC"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: "Colombia",
|
|
693
|
+
dial_code: "+57",
|
|
694
|
+
emoji: "🇨🇴",
|
|
695
|
+
code: "CO"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
name: "Comoros",
|
|
699
|
+
dial_code: "+269",
|
|
700
|
+
emoji: "🇰🇲",
|
|
701
|
+
code: "KM"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "Congo",
|
|
705
|
+
dial_code: "+242",
|
|
706
|
+
emoji: "🇨🇬",
|
|
707
|
+
code: "CG"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
name: "Congo, The Democratic Republic of the Congo",
|
|
711
|
+
dial_code: "+243",
|
|
712
|
+
emoji: "🇨🇩",
|
|
713
|
+
code: "CD"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: "Cook Islands",
|
|
717
|
+
dial_code: "+682",
|
|
718
|
+
emoji: "🇨🇰",
|
|
719
|
+
code: "CK"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
name: "Costa Rica",
|
|
723
|
+
dial_code: "+506",
|
|
724
|
+
emoji: "🇨🇷",
|
|
725
|
+
code: "CR"
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
name: "Cote d'Ivoire",
|
|
729
|
+
dial_code: "+225",
|
|
730
|
+
emoji: "🇨🇮",
|
|
731
|
+
code: "CI"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
name: "Croatia",
|
|
735
|
+
dial_code: "+385",
|
|
736
|
+
emoji: "🇭🇷",
|
|
737
|
+
code: "HR"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
name: "Cuba",
|
|
741
|
+
dial_code: "+53",
|
|
742
|
+
emoji: "🇨🇺",
|
|
743
|
+
code: "CU"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
name: "Cyprus",
|
|
747
|
+
dial_code: "+357",
|
|
748
|
+
emoji: "🇨🇾",
|
|
749
|
+
code: "CY"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
name: "Czech Republic",
|
|
753
|
+
dial_code: "+420",
|
|
754
|
+
emoji: "🇨🇿",
|
|
755
|
+
code: "CZ"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
name: "Denmark",
|
|
759
|
+
dial_code: "+45",
|
|
760
|
+
emoji: "🇩🇰",
|
|
761
|
+
code: "DK"
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
name: "Djibouti",
|
|
765
|
+
dial_code: "+253",
|
|
766
|
+
emoji: "🇩🇯",
|
|
767
|
+
code: "DJ"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "Dominica",
|
|
771
|
+
dial_code: "+1767",
|
|
772
|
+
emoji: "🇩🇲",
|
|
773
|
+
code: "DM"
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
name: "Dominican Republic",
|
|
777
|
+
dial_code: "+1849",
|
|
778
|
+
emoji: "🇩🇴",
|
|
779
|
+
code: "DO"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "Ecuador",
|
|
783
|
+
dial_code: "+593",
|
|
784
|
+
emoji: "🇪🇨",
|
|
785
|
+
code: "EC"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
name: "Egypt",
|
|
789
|
+
dial_code: "+20",
|
|
790
|
+
emoji: "🇪🇬",
|
|
791
|
+
code: "EG"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
name: "El Salvador",
|
|
795
|
+
dial_code: "+503",
|
|
796
|
+
emoji: "🇸🇻",
|
|
797
|
+
code: "SV"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
name: "Equatorial Guinea",
|
|
801
|
+
dial_code: "+240",
|
|
802
|
+
emoji: "🇬🇶",
|
|
803
|
+
code: "GQ"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
name: "Eritrea",
|
|
807
|
+
dial_code: "+291",
|
|
808
|
+
emoji: "🇪🇷",
|
|
809
|
+
code: "ER"
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
name: "Estonia",
|
|
813
|
+
dial_code: "+372",
|
|
814
|
+
emoji: "🇪🇪",
|
|
815
|
+
code: "EE"
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: "Ethiopia",
|
|
819
|
+
dial_code: "+251",
|
|
820
|
+
emoji: "🇪🇹",
|
|
821
|
+
code: "ET"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: "Falkland Islands (Malvinas)",
|
|
825
|
+
dial_code: "+500",
|
|
826
|
+
emoji: "🇫🇰",
|
|
827
|
+
code: "FK"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
name: "Faroe Islands",
|
|
831
|
+
dial_code: "+298",
|
|
832
|
+
emoji: "🇫🇴",
|
|
833
|
+
code: "FO"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
name: "Fiji",
|
|
837
|
+
dial_code: "+679",
|
|
838
|
+
emoji: "🇫🇯",
|
|
839
|
+
code: "FJ"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
name: "Finland",
|
|
843
|
+
dial_code: "+358",
|
|
844
|
+
emoji: "🇫🇮",
|
|
845
|
+
code: "FI"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
name: "France",
|
|
849
|
+
dial_code: "+33",
|
|
850
|
+
emoji: "🇫🇷",
|
|
851
|
+
code: "FR"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
name: "French Guiana",
|
|
855
|
+
dial_code: "+594",
|
|
856
|
+
emoji: "🇬🇫",
|
|
857
|
+
code: "GF"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
name: "French Polynesia",
|
|
861
|
+
dial_code: "+689",
|
|
862
|
+
emoji: "🇵🇫",
|
|
863
|
+
code: "PF"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
name: "Gabon",
|
|
867
|
+
dial_code: "+241",
|
|
868
|
+
emoji: "🇬🇦",
|
|
869
|
+
code: "GA"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
name: "Gambia",
|
|
873
|
+
dial_code: "+220",
|
|
874
|
+
emoji: "🇬🇲",
|
|
875
|
+
code: "GM"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "Georgia",
|
|
879
|
+
dial_code: "+995",
|
|
880
|
+
emoji: "🇬🇪",
|
|
881
|
+
code: "GE"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
name: "Germany",
|
|
885
|
+
dial_code: "+49",
|
|
886
|
+
emoji: "🇩🇪",
|
|
887
|
+
code: "DE"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
name: "Ghana",
|
|
891
|
+
dial_code: "+233",
|
|
892
|
+
emoji: "🇬🇭",
|
|
893
|
+
code: "GH"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "Gibraltar",
|
|
897
|
+
dial_code: "+350",
|
|
898
|
+
emoji: "🇬🇮",
|
|
899
|
+
code: "GI"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: "Greece",
|
|
903
|
+
dial_code: "+30",
|
|
904
|
+
emoji: "🇬🇷",
|
|
905
|
+
code: "GR"
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
name: "Greenland",
|
|
909
|
+
dial_code: "+299",
|
|
910
|
+
emoji: "🇬🇱",
|
|
911
|
+
code: "GL"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
name: "Grenada",
|
|
915
|
+
dial_code: "+1473",
|
|
916
|
+
emoji: "🇬🇩",
|
|
917
|
+
code: "GD"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
name: "Guadeloupe",
|
|
921
|
+
dial_code: "+590",
|
|
922
|
+
emoji: "🇬🇵",
|
|
923
|
+
code: "GP"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
name: "Guam",
|
|
927
|
+
dial_code: "+1671",
|
|
928
|
+
emoji: "🇬🇺",
|
|
929
|
+
code: "GU"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
name: "Guatemala",
|
|
933
|
+
dial_code: "+502",
|
|
934
|
+
emoji: "🇬🇹",
|
|
935
|
+
code: "GT"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
name: "Guernsey",
|
|
939
|
+
dial_code: "+44",
|
|
940
|
+
emoji: "🇬🇬",
|
|
941
|
+
code: "GG"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
name: "Guinea",
|
|
945
|
+
dial_code: "+224",
|
|
946
|
+
emoji: "🇬🇳",
|
|
947
|
+
code: "GN"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
name: "Guinea-Bissau",
|
|
951
|
+
dial_code: "+245",
|
|
952
|
+
emoji: "🇬🇼",
|
|
953
|
+
code: "GW"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
name: "Guyana",
|
|
957
|
+
dial_code: "+595",
|
|
958
|
+
emoji: "🇬🇾",
|
|
959
|
+
code: "GY"
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
name: "Haiti",
|
|
963
|
+
dial_code: "+509",
|
|
964
|
+
emoji: "🇭🇹",
|
|
965
|
+
code: "HT"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
name: "Holy See (Vatican City State)",
|
|
969
|
+
dial_code: "+379",
|
|
970
|
+
emoji: "🇻🇦",
|
|
971
|
+
code: "VA"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
name: "Honduras",
|
|
975
|
+
dial_code: "+504",
|
|
976
|
+
emoji: "🇭🇳",
|
|
977
|
+
code: "HN"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
name: "Hong Kong",
|
|
981
|
+
dial_code: "+852",
|
|
982
|
+
emoji: "🇭🇰",
|
|
983
|
+
code: "HK"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
name: "Hungary",
|
|
987
|
+
dial_code: "+36",
|
|
988
|
+
emoji: "🇭🇺",
|
|
989
|
+
code: "HU"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
name: "Iceland",
|
|
993
|
+
dial_code: "+354",
|
|
994
|
+
emoji: "🇮🇸",
|
|
995
|
+
code: "IS"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
name: "India",
|
|
999
|
+
dial_code: "+91",
|
|
1000
|
+
emoji: "🇮🇳",
|
|
1001
|
+
code: "IN"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
name: "Indonesia",
|
|
1005
|
+
dial_code: "+62",
|
|
1006
|
+
emoji: "🇮🇩",
|
|
1007
|
+
code: "ID"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
name: "Iran, Islamic Republic of Persian Gulf",
|
|
1011
|
+
dial_code: "+98",
|
|
1012
|
+
emoji: "🇮🇷",
|
|
1013
|
+
code: "IR"
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
name: "Iraq",
|
|
1017
|
+
dial_code: "+964",
|
|
1018
|
+
emoji: "🇮🇷",
|
|
1019
|
+
code: "IQ"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
name: "Ireland",
|
|
1023
|
+
dial_code: "+353",
|
|
1024
|
+
emoji: "🇮🇪",
|
|
1025
|
+
code: "IE"
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
name: "Isle of Man",
|
|
1029
|
+
dial_code: "+44",
|
|
1030
|
+
emoji: "🇮🇲",
|
|
1031
|
+
code: "IM"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
name: "Israel",
|
|
1035
|
+
dial_code: "+972",
|
|
1036
|
+
emoji: "🇮🇱",
|
|
1037
|
+
code: "IL"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
name: "Italy",
|
|
1041
|
+
dial_code: "+39",
|
|
1042
|
+
emoji: "🇮🇹",
|
|
1043
|
+
code: "IT"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "Jamaica",
|
|
1047
|
+
dial_code: "+1876",
|
|
1048
|
+
emoji: "🇯🇲",
|
|
1049
|
+
code: "JM"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
name: "Japan",
|
|
1053
|
+
dial_code: "+81",
|
|
1054
|
+
emoji: "🇯🇵",
|
|
1055
|
+
code: "JP"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
name: "Jersey",
|
|
1059
|
+
dial_code: "+44",
|
|
1060
|
+
emoji: "🇯🇪",
|
|
1061
|
+
code: "JE"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
name: "Jordan",
|
|
1065
|
+
dial_code: "+962",
|
|
1066
|
+
emoji: "🇯🇴",
|
|
1067
|
+
code: "JO"
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
name: "Kazakhstan",
|
|
1071
|
+
dial_code: "+77",
|
|
1072
|
+
emoji: "🇰🇿",
|
|
1073
|
+
code: "KZ"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
name: "Kenya",
|
|
1077
|
+
dial_code: "+254",
|
|
1078
|
+
emoji: "🇰🇪",
|
|
1079
|
+
code: "KE"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
name: "Kiribati",
|
|
1083
|
+
dial_code: "+686",
|
|
1084
|
+
emoji: "🇰🇮",
|
|
1085
|
+
code: "KI"
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
name: "Korea, Democratic People's Republic of Korea",
|
|
1089
|
+
dial_code: "+850",
|
|
1090
|
+
emoji: "🇰🇵",
|
|
1091
|
+
code: "KP"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
name: "Korea, Republic of South Korea",
|
|
1095
|
+
dial_code: "+82",
|
|
1096
|
+
emoji: "🇰🇷",
|
|
1097
|
+
code: "KR"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: "Kuwait",
|
|
1101
|
+
dial_code: "+965",
|
|
1102
|
+
emoji: "🇰🇼",
|
|
1103
|
+
code: "KW"
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
name: "Kyrgyzstan",
|
|
1107
|
+
dial_code: "+996",
|
|
1108
|
+
emoji: "🇰🇬",
|
|
1109
|
+
code: "KG"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
name: "Laos",
|
|
1113
|
+
dial_code: "+856",
|
|
1114
|
+
emoji: "🇱🇦",
|
|
1115
|
+
code: "LA"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: "Latvia",
|
|
1119
|
+
dial_code: "+371",
|
|
1120
|
+
emoji: "🇱🇻",
|
|
1121
|
+
code: "LV"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: "Lebanon",
|
|
1125
|
+
dial_code: "+961",
|
|
1126
|
+
emoji: "🇱🇧",
|
|
1127
|
+
code: "LB"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
name: "Lesotho",
|
|
1131
|
+
dial_code: "+266",
|
|
1132
|
+
emoji: "🇱🇸",
|
|
1133
|
+
code: "LS"
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
name: "Liberia",
|
|
1137
|
+
dial_code: "+231",
|
|
1138
|
+
emoji: "🇱🇷",
|
|
1139
|
+
code: "LR"
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
name: "Libyan Arab Jamahiriya",
|
|
1143
|
+
dial_code: "+218",
|
|
1144
|
+
emoji: "🇱🇾",
|
|
1145
|
+
code: "LY"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
name: "Liechtenstein",
|
|
1149
|
+
dial_code: "+423",
|
|
1150
|
+
emoji: "🇱🇮",
|
|
1151
|
+
code: "LI"
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
name: "Lithuania",
|
|
1155
|
+
dial_code: "+370",
|
|
1156
|
+
emoji: "🇱🇹",
|
|
1157
|
+
code: "LT"
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
name: "Luxembourg",
|
|
1161
|
+
dial_code: "+352",
|
|
1162
|
+
emoji: "🇱🇺",
|
|
1163
|
+
code: "LU"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
name: "Macao",
|
|
1167
|
+
dial_code: "+853",
|
|
1168
|
+
emoji: "🇲🇴",
|
|
1169
|
+
code: "MO"
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
name: "Macedonia",
|
|
1173
|
+
dial_code: "+389",
|
|
1174
|
+
emoji: "🇲🇰",
|
|
1175
|
+
code: "MK"
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: "Madagascar",
|
|
1179
|
+
dial_code: "+261",
|
|
1180
|
+
emoji: "🇲🇬",
|
|
1181
|
+
code: "MG"
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
name: "Malawi",
|
|
1185
|
+
dial_code: "+265",
|
|
1186
|
+
emoji: "🇲🇼",
|
|
1187
|
+
code: "MW"
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
name: "Malaysia",
|
|
1191
|
+
dial_code: "+60",
|
|
1192
|
+
emoji: "🇲🇾",
|
|
1193
|
+
code: "MY"
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
name: "Maldives",
|
|
1197
|
+
dial_code: "+960",
|
|
1198
|
+
emoji: "🇲🇻",
|
|
1199
|
+
code: "MV"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
name: "Mali",
|
|
1203
|
+
dial_code: "+223",
|
|
1204
|
+
emoji: "🇲🇱",
|
|
1205
|
+
code: "ML"
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
name: "Malta",
|
|
1209
|
+
dial_code: "+356",
|
|
1210
|
+
emoji: "🇲🇹",
|
|
1211
|
+
code: "MT"
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
name: "Marshall Islands",
|
|
1215
|
+
dial_code: "+692",
|
|
1216
|
+
emoji: "🇲🇭",
|
|
1217
|
+
code: "MH"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
name: "Martinique",
|
|
1221
|
+
dial_code: "+596",
|
|
1222
|
+
emoji: "🇲🇶",
|
|
1223
|
+
code: "MQ"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
name: "Mauritania",
|
|
1227
|
+
dial_code: "+222",
|
|
1228
|
+
emoji: "🇲🇷",
|
|
1229
|
+
code: "MR"
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
name: "Mauritius",
|
|
1233
|
+
dial_code: "+230",
|
|
1234
|
+
emoji: "🇲🇺",
|
|
1235
|
+
code: "MU"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
name: "Mayotte",
|
|
1239
|
+
dial_code: "+262",
|
|
1240
|
+
emoji: "🇾🇹",
|
|
1241
|
+
code: "YT"
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
name: "Mexico",
|
|
1245
|
+
dial_code: "+52",
|
|
1246
|
+
emoji: "🇲🇽",
|
|
1247
|
+
code: "MX"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
name: "Micronesia, Federated States of Micronesia",
|
|
1251
|
+
dial_code: "+691",
|
|
1252
|
+
emoji: "🇫🇲",
|
|
1253
|
+
code: "FM"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
name: "Moldova",
|
|
1257
|
+
dial_code: "+373",
|
|
1258
|
+
emoji: "🇲🇩",
|
|
1259
|
+
code: "MD"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
name: "Monaco",
|
|
1263
|
+
dial_code: "+377",
|
|
1264
|
+
emoji: "🇲🇨",
|
|
1265
|
+
code: "MC"
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
name: "Mongolia",
|
|
1269
|
+
dial_code: "+976",
|
|
1270
|
+
emoji: "🇲🇳",
|
|
1271
|
+
code: "MN"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
name: "Montenegro",
|
|
1275
|
+
dial_code: "+382",
|
|
1276
|
+
emoji: "🇲🇪",
|
|
1277
|
+
code: "ME"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
name: "Montserrat",
|
|
1281
|
+
dial_code: "+1664",
|
|
1282
|
+
emoji: "🇲🇸",
|
|
1283
|
+
code: "MS"
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
name: "Morocco",
|
|
1287
|
+
dial_code: "+212",
|
|
1288
|
+
emoji: "🇲🇦",
|
|
1289
|
+
code: "MA"
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
name: "Mozambique",
|
|
1293
|
+
dial_code: "+258",
|
|
1294
|
+
emoji: "🇲🇿",
|
|
1295
|
+
code: "MZ"
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
name: "Myanmar",
|
|
1299
|
+
dial_code: "+95",
|
|
1300
|
+
emoji: "🇲🇲",
|
|
1301
|
+
code: "MM"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: "Namibia",
|
|
1305
|
+
emoji: "🇳🇦",
|
|
1306
|
+
dial_code: "+264",
|
|
1307
|
+
code: "NA"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
name: "Nauru",
|
|
1311
|
+
dial_code: "+674",
|
|
1312
|
+
emoji: "🇳🇷",
|
|
1313
|
+
code: "NR"
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
name: "Nepal",
|
|
1317
|
+
dial_code: "+977",
|
|
1318
|
+
emoji: "🇳🇵",
|
|
1319
|
+
code: "NP"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
name: "Netherlands",
|
|
1323
|
+
dial_code: "+31",
|
|
1324
|
+
emoji: "🇳🇱",
|
|
1325
|
+
code: "NL"
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "Netherlands Antilles",
|
|
1329
|
+
dial_code: "+599",
|
|
1330
|
+
emoji: "🇧🇶",
|
|
1331
|
+
code: "AN"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
name: "New Caledonia",
|
|
1335
|
+
dial_code: "+687",
|
|
1336
|
+
emoji: "🇳🇨",
|
|
1337
|
+
code: "NC"
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: "New Zealand",
|
|
1341
|
+
dial_code: "+64",
|
|
1342
|
+
emoji: "🇳🇿",
|
|
1343
|
+
code: "NZ"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
name: "Nicaragua",
|
|
1347
|
+
dial_code: "+505",
|
|
1348
|
+
emoji: "🇳🇮",
|
|
1349
|
+
code: "NI"
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
name: "Niger",
|
|
1353
|
+
dial_code: "+227",
|
|
1354
|
+
emoji: "🇳🇪",
|
|
1355
|
+
code: "NE"
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
name: "Nigeria",
|
|
1359
|
+
dial_code: "+234",
|
|
1360
|
+
emoji: "🇳🇬",
|
|
1361
|
+
code: "NG"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
name: "Niue",
|
|
1365
|
+
dial_code: "+683",
|
|
1366
|
+
emoji: "🇳🇺",
|
|
1367
|
+
code: "NU"
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
name: "Norfolk Island",
|
|
1371
|
+
dial_code: "+672",
|
|
1372
|
+
emoji: "🇳🇫",
|
|
1373
|
+
code: "NF"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
name: "Northern Mariana Islands",
|
|
1377
|
+
dial_code: "+1670",
|
|
1378
|
+
emoji: "🇲🇵",
|
|
1379
|
+
code: "MP"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
name: "Norway",
|
|
1383
|
+
dial_code: "+47",
|
|
1384
|
+
emoji: "🇳🇴",
|
|
1385
|
+
code: "NO"
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
name: "Oman",
|
|
1389
|
+
dial_code: "+968",
|
|
1390
|
+
emoji: "🇴🇲",
|
|
1391
|
+
code: "OM"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
name: "Pakistan",
|
|
1395
|
+
dial_code: "+92",
|
|
1396
|
+
emoji: "🇵🇰",
|
|
1397
|
+
code: "PK"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
name: "Palau",
|
|
1401
|
+
dial_code: "+680",
|
|
1402
|
+
emoji: "🇵🇼",
|
|
1403
|
+
code: "PW"
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
name: "Palestinian Territory, Occupied",
|
|
1407
|
+
dial_code: "+970",
|
|
1408
|
+
emoji: "🇵🇸",
|
|
1409
|
+
code: "PS"
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
name: "Panama",
|
|
1413
|
+
dial_code: "+507",
|
|
1414
|
+
emoji: "🇵🇦",
|
|
1415
|
+
code: "PA"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: "Papua New Guinea",
|
|
1419
|
+
dial_code: "+675",
|
|
1420
|
+
emoji: "🇵🇬",
|
|
1421
|
+
code: "PG"
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
name: "Paraguay",
|
|
1425
|
+
dial_code: "+595",
|
|
1426
|
+
emoji: "🇵🇾",
|
|
1427
|
+
code: "PY"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
name: "Peru",
|
|
1431
|
+
dial_code: "+51",
|
|
1432
|
+
emoji: "🇵🇪",
|
|
1433
|
+
code: "PE"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
name: "Philippines",
|
|
1437
|
+
dial_code: "+63",
|
|
1438
|
+
emoji: "🇵🇭",
|
|
1439
|
+
code: "PH"
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
name: "Pitcairn",
|
|
1443
|
+
dial_code: "+872",
|
|
1444
|
+
emoji: "🇵🇳",
|
|
1445
|
+
code: "PN"
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: "Poland",
|
|
1449
|
+
dial_code: "+48",
|
|
1450
|
+
emoji: "🇵🇱",
|
|
1451
|
+
code: "PL"
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
name: "Portugal",
|
|
1455
|
+
dial_code: "+351",
|
|
1456
|
+
emoji: "🇵🇹",
|
|
1457
|
+
code: "PT"
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
name: "Puerto Rico",
|
|
1461
|
+
dial_code: "+1939",
|
|
1462
|
+
emoji: "🇵🇷",
|
|
1463
|
+
code: "PR"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
name: "Qatar",
|
|
1467
|
+
dial_code: "+974",
|
|
1468
|
+
emoji: "🇶🇦",
|
|
1469
|
+
code: "QA"
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
name: "Romania",
|
|
1473
|
+
dial_code: "+40",
|
|
1474
|
+
emoji: "🇷🇴",
|
|
1475
|
+
code: "RO"
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
name: "Russia",
|
|
1479
|
+
dial_code: "+7",
|
|
1480
|
+
emoji: "🇷🇺",
|
|
1481
|
+
code: "RU"
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
name: "Rwanda",
|
|
1485
|
+
dial_code: "+250",
|
|
1486
|
+
emoji: "🇷🇼",
|
|
1487
|
+
code: "RW"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
name: "Reunion",
|
|
1491
|
+
dial_code: "+262",
|
|
1492
|
+
emoji: "🇷🇪",
|
|
1493
|
+
code: "RE"
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: "Saint Barthelemy",
|
|
1497
|
+
dial_code: "+590",
|
|
1498
|
+
emoji: "🇧🇱",
|
|
1499
|
+
code: "BL"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
name: "Saint Helena, Ascension and Tristan Da Cunha",
|
|
1503
|
+
dial_code: "+290",
|
|
1504
|
+
emoji: "🇸🇭",
|
|
1505
|
+
code: "SH"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
name: "Saint Kitts and Nevis",
|
|
1509
|
+
dial_code: "+1869",
|
|
1510
|
+
emoji: "🇰🇳",
|
|
1511
|
+
code: "KN"
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
name: "Saint Lucia",
|
|
1515
|
+
dial_code: "+1758",
|
|
1516
|
+
emoji: "🇱🇨",
|
|
1517
|
+
code: "LC"
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
name: "Saint Martin",
|
|
1521
|
+
dial_code: "+590",
|
|
1522
|
+
emoji: "🇲🇫",
|
|
1523
|
+
code: "MF"
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
name: "Saint Pierre and Miquelon",
|
|
1527
|
+
dial_code: "+508",
|
|
1528
|
+
emoji: "🇵🇲",
|
|
1529
|
+
code: "PM"
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: "Saint Vincent and the Grenadines",
|
|
1533
|
+
dial_code: "+1784",
|
|
1534
|
+
emoji: "🇻🇨",
|
|
1535
|
+
code: "VC"
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
name: "Samoa",
|
|
1539
|
+
dial_code: "+685",
|
|
1540
|
+
emoji: "🇼🇸",
|
|
1541
|
+
code: "WS"
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
name: "San Marino",
|
|
1545
|
+
dial_code: "+378",
|
|
1546
|
+
emoji: "🇸🇲",
|
|
1547
|
+
code: "SM"
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
name: "Sao Tome and Principe",
|
|
1551
|
+
dial_code: "+239",
|
|
1552
|
+
emoji: "🇸🇹",
|
|
1553
|
+
code: "ST"
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
name: "Saudi Arabia",
|
|
1557
|
+
dial_code: "+966",
|
|
1558
|
+
emoji: "🇸🇦",
|
|
1559
|
+
code: "SA"
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
name: "Senegal",
|
|
1563
|
+
dial_code: "+221",
|
|
1564
|
+
emoji: "🇸🇳",
|
|
1565
|
+
code: "SN"
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
name: "Serbia",
|
|
1569
|
+
dial_code: "+381",
|
|
1570
|
+
emoji: "🇷🇸",
|
|
1571
|
+
code: "RS"
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
name: "Seychelles",
|
|
1575
|
+
dial_code: "+248",
|
|
1576
|
+
emoji: "🇸🇨",
|
|
1577
|
+
code: "SC"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: "Sierra Leone",
|
|
1581
|
+
dial_code: "+232",
|
|
1582
|
+
emoji: "🇸🇱",
|
|
1583
|
+
code: "SL"
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: "Singapore",
|
|
1587
|
+
dial_code: "+65",
|
|
1588
|
+
emoji: "🇸🇬",
|
|
1589
|
+
code: "SG"
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: "Slovakia",
|
|
1593
|
+
dial_code: "+421",
|
|
1594
|
+
emoji: "🇸🇰",
|
|
1595
|
+
code: "SK"
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
name: "Slovenia",
|
|
1599
|
+
dial_code: "+386",
|
|
1600
|
+
emoji: "🇸🇮",
|
|
1601
|
+
code: "SI"
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
name: "Solomon Islands",
|
|
1605
|
+
dial_code: "+677",
|
|
1606
|
+
emoji: "🇸🇧",
|
|
1607
|
+
code: "SB"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
name: "Somalia",
|
|
1611
|
+
dial_code: "+252",
|
|
1612
|
+
emoji: "🇸🇴",
|
|
1613
|
+
code: "SO"
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
name: "South Africa",
|
|
1617
|
+
dial_code: "+27",
|
|
1618
|
+
emoji: "🇿🇦",
|
|
1619
|
+
code: "ZA"
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
name: "South Sudan",
|
|
1623
|
+
dial_code: "+211",
|
|
1624
|
+
emoji: "🇸🇸",
|
|
1625
|
+
code: "SS"
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
name: "South Georgia and the South Sandwich Islands",
|
|
1629
|
+
dial_code: "+500",
|
|
1630
|
+
emoji: "🇬🇸",
|
|
1631
|
+
code: "GS"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
name: "Spain",
|
|
1635
|
+
dial_code: "+34",
|
|
1636
|
+
emoji: "🇪🇸",
|
|
1637
|
+
code: "ES"
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
name: "Sri Lanka",
|
|
1641
|
+
dial_code: "+94",
|
|
1642
|
+
emoji: "🇱🇰",
|
|
1643
|
+
code: "LK"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
name: "Sudan",
|
|
1647
|
+
dial_code: "+249",
|
|
1648
|
+
emoji: "🇸🇩",
|
|
1649
|
+
code: "SD"
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
name: "Suriname",
|
|
1653
|
+
dial_code: "+597",
|
|
1654
|
+
emoji: "🇸🇷",
|
|
1655
|
+
code: "SR"
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
name: "Svalbard and Jan Mayen",
|
|
1659
|
+
dial_code: "+47",
|
|
1660
|
+
emoji: "🇸🇯",
|
|
1661
|
+
code: "SJ"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
name: "Swaziland",
|
|
1665
|
+
dial_code: "+268",
|
|
1666
|
+
emoji: "🇸🇿",
|
|
1667
|
+
code: "SZ"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
name: "Sweden",
|
|
1671
|
+
dial_code: "+46",
|
|
1672
|
+
emoji: "🇸🇪",
|
|
1673
|
+
code: "SE"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
name: "Switzerland",
|
|
1677
|
+
dial_code: "+41",
|
|
1678
|
+
emoji: "🇨🇭",
|
|
1679
|
+
code: "CH"
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
name: "Syrian Arab Republic",
|
|
1683
|
+
dial_code: "+963",
|
|
1684
|
+
emoji: "🇸🇾",
|
|
1685
|
+
code: "SY"
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
name: "Taiwan",
|
|
1689
|
+
dial_code: "+886",
|
|
1690
|
+
emoji: "🇹🇼",
|
|
1691
|
+
code: "TW"
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
name: "Tajikistan",
|
|
1695
|
+
dial_code: "+992",
|
|
1696
|
+
emoji: "🇹🇯",
|
|
1697
|
+
code: "TJ"
|
|
1698
|
+
},
|
|
1699
|
+
{
|
|
1700
|
+
name: "Tanzania, United Republic of Tanzania",
|
|
1701
|
+
dial_code: "+255",
|
|
1702
|
+
emoji: "🇹🇿",
|
|
1703
|
+
code: "TZ"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
name: "Thailand",
|
|
1707
|
+
dial_code: "+66",
|
|
1708
|
+
emoji: "🇹🇭",
|
|
1709
|
+
code: "TH"
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
name: "Timor-Leste",
|
|
1713
|
+
dial_code: "+670",
|
|
1714
|
+
emoji: "🇹🇱",
|
|
1715
|
+
code: "TL"
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
name: "Togo",
|
|
1719
|
+
dial_code: "+228",
|
|
1720
|
+
emoji: "🇹🇬",
|
|
1721
|
+
code: "TG"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
name: "Tokelau",
|
|
1725
|
+
dial_code: "+690",
|
|
1726
|
+
emoji: "🇹🇰",
|
|
1727
|
+
code: "TK"
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
name: "Tonga",
|
|
1731
|
+
dial_code: "+676",
|
|
1732
|
+
emoji: "🇹🇴",
|
|
1733
|
+
code: "TO"
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
name: "Trinidad and Tobago",
|
|
1737
|
+
dial_code: "+1868",
|
|
1738
|
+
emoji: "🇹🇹",
|
|
1739
|
+
code: "TT"
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
name: "Tunisia",
|
|
1743
|
+
dial_code: "+216",
|
|
1744
|
+
emoji: "🇹🇳",
|
|
1745
|
+
code: "TN"
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
name: "Turkey",
|
|
1749
|
+
dial_code: "+90",
|
|
1750
|
+
emoji: "🇹🇷",
|
|
1751
|
+
code: "TR"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
name: "Turkmenistan",
|
|
1755
|
+
dial_code: "+993",
|
|
1756
|
+
emoji: "🇹🇲",
|
|
1757
|
+
code: "TM"
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
name: "Turks and Caicos Islands",
|
|
1761
|
+
dial_code: "+1649",
|
|
1762
|
+
emoji: "🇹🇨",
|
|
1763
|
+
code: "TC"
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
name: "Tuvalu",
|
|
1767
|
+
dial_code: "+688",
|
|
1768
|
+
emoji: "🇹🇻",
|
|
1769
|
+
code: "TV"
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
name: "Uganda",
|
|
1773
|
+
dial_code: "+256",
|
|
1774
|
+
emoji: "🇺🇬",
|
|
1775
|
+
code: "UG"
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
name: "Ukraine",
|
|
1779
|
+
dial_code: "+380",
|
|
1780
|
+
emoji: "🇺🇦",
|
|
1781
|
+
code: "UA"
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
name: "United Arab Emirates",
|
|
1785
|
+
dial_code: "+971",
|
|
1786
|
+
emoji: "🇦🇪",
|
|
1787
|
+
code: "AE"
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
name: "United Kingdom",
|
|
1791
|
+
dial_code: "+44",
|
|
1792
|
+
emoji: "🇬🇧",
|
|
1793
|
+
code: "GB"
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
name: "United States",
|
|
1797
|
+
dial_code: "+1",
|
|
1798
|
+
emoji: "🇺🇸",
|
|
1799
|
+
code: "US"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
name: "Uruguay",
|
|
1803
|
+
dial_code: "+598",
|
|
1804
|
+
emoji: "🇺🇾",
|
|
1805
|
+
code: "UY"
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
name: "Uzbekistan",
|
|
1809
|
+
dial_code: "+998",
|
|
1810
|
+
emoji: "🇺🇿",
|
|
1811
|
+
code: "UZ"
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
name: "Vanuatu",
|
|
1815
|
+
dial_code: "+678",
|
|
1816
|
+
emoji: "🇻🇺",
|
|
1817
|
+
code: "VU"
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
name: "Venezuela, Bolivarian Republic of Venezuela",
|
|
1821
|
+
dial_code: "+58",
|
|
1822
|
+
emoji: "🇻🇪",
|
|
1823
|
+
code: "VE"
|
|
1824
|
+
},
|
|
1825
|
+
{
|
|
1826
|
+
name: "Vietnam",
|
|
1827
|
+
dial_code: "+84",
|
|
1828
|
+
emoji: "🇻🇳",
|
|
1829
|
+
code: "VN"
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
name: "Virgin Islands, British",
|
|
1833
|
+
dial_code: "+1284",
|
|
1834
|
+
emoji: "🇻🇬",
|
|
1835
|
+
code: "VG"
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
name: "Virgin Islands, U.S.",
|
|
1839
|
+
dial_code: "+1340",
|
|
1840
|
+
emoji: "🇻🇮",
|
|
1841
|
+
code: "VI"
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
name: "Wallis and Futuna",
|
|
1845
|
+
dial_code: "+681",
|
|
1846
|
+
emoji: "🇼🇫",
|
|
1847
|
+
code: "WF"
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
name: "Yemen",
|
|
1851
|
+
dial_code: "+967",
|
|
1852
|
+
emoji: "🇾🇪",
|
|
1853
|
+
code: "YE"
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
name: "Zambia",
|
|
1857
|
+
dial_code: "+260",
|
|
1858
|
+
emoji: "🇿🇲",
|
|
1859
|
+
code: "ZM"
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
name: "Zimbabwe",
|
|
1863
|
+
dial_code: "+263",
|
|
1864
|
+
emoji: "🇿🇼",
|
|
1865
|
+
code: "ZW"
|
|
1866
|
+
}
|
|
1867
|
+
];
|
|
1868
|
+
|
|
1869
|
+
var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
1870
|
+
var placeholder = _ref.placeholder;
|
|
1871
|
+
var _React$useState = React.useState(countryList),
|
|
1872
|
+
newOptions = _React$useState[0],
|
|
1873
|
+
setNewOptions = _React$useState[1];
|
|
1874
|
+
var _React$useState2 = React.useState(placeholder != null ? placeholder : countryList[0].name),
|
|
1875
|
+
selected = _React$useState2[0],
|
|
1876
|
+
setSelected = _React$useState2[1];
|
|
1877
|
+
var _React$useState3 = React.useState(true),
|
|
1878
|
+
hide = _React$useState3[0],
|
|
1879
|
+
setHide = _React$useState3[1];
|
|
1880
|
+
var _React$useState4 = React.useState(false),
|
|
1881
|
+
isFocused = _React$useState4[0],
|
|
1882
|
+
setIsFocused = _React$useState4[1];
|
|
1883
|
+
var _React$useState5 = React.useState(false),
|
|
1884
|
+
isHovered = _React$useState5[0],
|
|
1885
|
+
setIsHovered = _React$useState5[1];
|
|
1886
|
+
return {
|
|
1887
|
+
hide: hide,
|
|
1888
|
+
setHide: setHide,
|
|
1889
|
+
newOptions: newOptions,
|
|
1890
|
+
setNewOptions: setNewOptions,
|
|
1891
|
+
isHovered: isHovered,
|
|
1892
|
+
setIsHovered: setIsHovered,
|
|
1893
|
+
isFocused: isFocused,
|
|
1894
|
+
setIsFocused: setIsFocused,
|
|
1895
|
+
selected: selected,
|
|
1896
|
+
setSelected: setSelected
|
|
1897
|
+
};
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1900
|
+
var IconSizes$2 = {
|
|
1901
|
+
xs: 8,
|
|
1902
|
+
sm: 10,
|
|
1903
|
+
md: 12,
|
|
1904
|
+
lg: 14,
|
|
1905
|
+
xl: 16
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
var _excluded$2 = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "colorScheme", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setSelected", "styles"];
|
|
1909
|
+
var CountryList = function CountryList(props) {
|
|
1910
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
1911
|
+
as: "ul"
|
|
1912
|
+
}, props));
|
|
1913
|
+
};
|
|
1914
|
+
var CountrySelector = function CountrySelector(props) {
|
|
1915
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
1916
|
+
type: "country"
|
|
1917
|
+
}, props));
|
|
1918
|
+
};
|
|
1919
|
+
var CountryItem = function CountryItem(props) {
|
|
1920
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
1921
|
+
as: "li"
|
|
1922
|
+
}, props));
|
|
1923
|
+
};
|
|
1924
|
+
var DropDownItem = function DropDownItem(_ref) {
|
|
1925
|
+
var option = _ref.option,
|
|
1926
|
+
_ref$size = _ref.size,
|
|
1927
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
1928
|
+
_ref$callback = _ref.callback,
|
|
1929
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
1930
|
+
_ref$styles = _ref.styles,
|
|
1931
|
+
styles = _ref$styles === void 0 ? {
|
|
1932
|
+
text: {}
|
|
1933
|
+
} : _ref$styles;
|
|
1934
|
+
var _useState = useState(false),
|
|
1935
|
+
isHovered = _useState[0],
|
|
1936
|
+
setIsHovered = _useState[1];
|
|
1937
|
+
var handleOptionClick = function handleOptionClick(event) {
|
|
1938
|
+
event.stopPropagation();
|
|
1939
|
+
callback(option);
|
|
1940
|
+
};
|
|
1941
|
+
var handleHover = function handleHover() {
|
|
1942
|
+
return setIsHovered(!isHovered);
|
|
1943
|
+
};
|
|
1944
|
+
return /*#__PURE__*/React.createElement(CountryItem, Object.assign({
|
|
1945
|
+
margin: 0,
|
|
1946
|
+
role: "DropDownItem",
|
|
1947
|
+
listStyleType: "none",
|
|
1948
|
+
paddingVertical: 6,
|
|
1949
|
+
paddingHorizontal: 12,
|
|
1950
|
+
onMouseEnter: handleHover,
|
|
1951
|
+
onMouseLeave: handleHover,
|
|
1952
|
+
onClick: handleOptionClick,
|
|
1953
|
+
fontSize: Typography.fontSizes[size],
|
|
1954
|
+
backgroundColor: isHovered ? 'trueGray.100' : 'transparent'
|
|
1955
|
+
}, styles['text']), option);
|
|
1956
|
+
};
|
|
1957
|
+
var DropDown = function DropDown(_ref2) {
|
|
1958
|
+
var size = _ref2.size,
|
|
1959
|
+
_ref2$styles = _ref2.styles,
|
|
1960
|
+
styles = _ref2$styles === void 0 ? {
|
|
1961
|
+
dropDown: {}
|
|
1962
|
+
} : _ref2$styles,
|
|
1963
|
+
options = _ref2.options,
|
|
1964
|
+
_ref2$callback = _ref2.callback,
|
|
1965
|
+
callback = _ref2$callback === void 0 ? function () {} : _ref2$callback;
|
|
1966
|
+
var handleCallback = function handleCallback(option) {
|
|
1967
|
+
return callback(option);
|
|
1968
|
+
};
|
|
1969
|
+
return /*#__PURE__*/React.createElement(CountryList, Object.assign({
|
|
1970
|
+
role: "dropDown",
|
|
1971
|
+
margin: 0,
|
|
1972
|
+
padding: 0,
|
|
1973
|
+
top: "100%",
|
|
1974
|
+
width: "100%",
|
|
1975
|
+
display: "flex",
|
|
1976
|
+
zIndex: 1000,
|
|
1977
|
+
overflow: "auto",
|
|
1978
|
+
maxHeight: "300px",
|
|
1979
|
+
borderRadius: 4,
|
|
1980
|
+
position: "absolute",
|
|
1981
|
+
flexDirection: "column",
|
|
1982
|
+
backgroundColor: "white",
|
|
1983
|
+
boxShadow: "rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px"
|
|
1984
|
+
}, styles['dropDown']), options.map(function (option) {
|
|
1985
|
+
return /*#__PURE__*/React.createElement(DropDownItem, Object.assign({
|
|
1986
|
+
key: option.code,
|
|
1987
|
+
size: size,
|
|
1988
|
+
option: option.name,
|
|
1989
|
+
callback: handleCallback
|
|
1990
|
+
}, styles['text']));
|
|
1991
|
+
}));
|
|
1992
|
+
};
|
|
1993
|
+
var CountryPickerView = function CountryPickerView(_ref3) {
|
|
1994
|
+
var id = _ref3.id,
|
|
1995
|
+
name = _ref3.name,
|
|
1996
|
+
label = _ref3.label,
|
|
1997
|
+
selected = _ref3.selected,
|
|
1998
|
+
placeholder = _ref3.placeholder,
|
|
1999
|
+
helperText = _ref3.helperText,
|
|
2000
|
+
_ref3$hide = _ref3.hide,
|
|
2001
|
+
hide = _ref3$hide === void 0 ? false : _ref3$hide,
|
|
2002
|
+
_ref3$error = _ref3.error,
|
|
2003
|
+
error = _ref3$error === void 0 ? false : _ref3$error,
|
|
2004
|
+
_ref3$isHovered = _ref3.isHovered,
|
|
2005
|
+
isHovered = _ref3$isHovered === void 0 ? false : _ref3$isHovered,
|
|
2006
|
+
_ref3$isFocused = _ref3.isFocused,
|
|
2007
|
+
isFocused = _ref3$isFocused === void 0 ? false : _ref3$isFocused,
|
|
2008
|
+
_ref3$isAutoFocus = _ref3.isAutoFocus,
|
|
2009
|
+
isAutoFocus = _ref3$isAutoFocus === void 0 ? false : _ref3$isAutoFocus,
|
|
2010
|
+
_ref3$isDisabled = _ref3.isDisabled,
|
|
2011
|
+
isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled,
|
|
2012
|
+
_ref3$isReadOnly = _ref3.isReadOnly,
|
|
2013
|
+
isReadOnly = _ref3$isReadOnly === void 0 ? false : _ref3$isReadOnly,
|
|
2014
|
+
_ref3$shadow = _ref3.shadow,
|
|
2015
|
+
shadow = _ref3$shadow === void 0 ? {} : _ref3$shadow,
|
|
2016
|
+
_ref3$newOptions = _ref3.newOptions,
|
|
2017
|
+
newOptions = _ref3$newOptions === void 0 ? [] : _ref3$newOptions,
|
|
2018
|
+
_ref3$size = _ref3.size,
|
|
2019
|
+
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
2020
|
+
_ref3$variant = _ref3.variant,
|
|
2021
|
+
variant = _ref3$variant === void 0 ? 'default' : _ref3$variant,
|
|
2022
|
+
_ref3$shape = _ref3.shape,
|
|
2023
|
+
shape = _ref3$shape === void 0 ? 'default' : _ref3$shape,
|
|
2024
|
+
_ref3$colorScheme = _ref3.colorScheme,
|
|
2025
|
+
colorScheme = _ref3$colorScheme === void 0 ? 'theme.primary' : _ref3$colorScheme,
|
|
2026
|
+
onChange = _ref3.onChange,
|
|
2027
|
+
_ref3$onBlur = _ref3.onBlur,
|
|
2028
|
+
onBlur = _ref3$onBlur === void 0 ? function () {} : _ref3$onBlur,
|
|
2029
|
+
_ref3$setHide = _ref3.setHide,
|
|
2030
|
+
setHide = _ref3$setHide === void 0 ? function () {} : _ref3$setHide,
|
|
2031
|
+
_ref3$setNewOptions = _ref3.setNewOptions,
|
|
2032
|
+
setNewOptions = _ref3$setNewOptions === void 0 ? function () {} : _ref3$setNewOptions,
|
|
2033
|
+
_ref3$setIsHovered = _ref3.setIsHovered,
|
|
2034
|
+
setIsHovered = _ref3$setIsHovered === void 0 ? function () {} : _ref3$setIsHovered,
|
|
2035
|
+
_ref3$setIsFocused = _ref3.setIsFocused,
|
|
2036
|
+
setIsFocused = _ref3$setIsFocused === void 0 ? function () {} : _ref3$setIsFocused,
|
|
2037
|
+
_ref3$setSelected = _ref3.setSelected,
|
|
2038
|
+
setSelected = _ref3$setSelected === void 0 ? function () {} : _ref3$setSelected,
|
|
2039
|
+
_ref3$styles = _ref3.styles,
|
|
2040
|
+
styles = _ref3$styles === void 0 ? {
|
|
2041
|
+
text: {},
|
|
2042
|
+
icon: {},
|
|
2043
|
+
label: {},
|
|
2044
|
+
dropDown: {},
|
|
2045
|
+
helperText: {},
|
|
2046
|
+
box: {}
|
|
2047
|
+
} : _ref3$styles,
|
|
2048
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$2);
|
|
2049
|
+
var _useTheme = useTheme(),
|
|
2050
|
+
getColor = _useTheme.getColor;
|
|
2051
|
+
var IconColor = getColor('color.blueGray.700');
|
|
2052
|
+
var handleHover = function handleHover() {
|
|
2053
|
+
return setIsHovered(!isHovered);
|
|
2054
|
+
};
|
|
2055
|
+
var handleFocus = function handleFocus() {
|
|
2056
|
+
return setIsFocused(true);
|
|
2057
|
+
};
|
|
2058
|
+
var handleCallback = function handleCallback(option) {
|
|
2059
|
+
setHide(!hide);
|
|
2060
|
+
setSelected(option);
|
|
2061
|
+
};
|
|
2062
|
+
var handleClick = function handleClick() {
|
|
2063
|
+
if (!isDisabled && !isReadOnly) {
|
|
2064
|
+
setHide(!hide);
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
var handleChange = function handleChange(event) {
|
|
2068
|
+
var selectedCountry = event.target.value;
|
|
2069
|
+
var filteredCountries = countryList.filter(function (country) {
|
|
2070
|
+
return country.name.toLowerCase().startsWith(selectedCountry.toLowerCase());
|
|
2071
|
+
});
|
|
2072
|
+
if (hide) setHide(false);
|
|
2073
|
+
setSelected(event.target.value);
|
|
2074
|
+
setNewOptions(filteredCountries);
|
|
2075
|
+
if (onChange) onChange(event);
|
|
2076
|
+
};
|
|
2077
|
+
var handleBlur = function handleBlur(event) {
|
|
2078
|
+
onBlur(event);
|
|
2079
|
+
setIsFocused(false);
|
|
2080
|
+
};
|
|
2081
|
+
useEffect(function () {
|
|
2082
|
+
if (onChange) onChange(selected); // Call onChange when selectedCountry changes
|
|
2083
|
+
}, [onChange, selected]);
|
|
2084
|
+
var isWithLabel = !!(isFocused && label);
|
|
2085
|
+
var fieldStyles = Object.assign({
|
|
2086
|
+
margin: 0,
|
|
2087
|
+
paddingVerical: 8,
|
|
2088
|
+
paddingHorizonatl: 0,
|
|
2089
|
+
width: '100%',
|
|
2090
|
+
heigth: '100%',
|
|
2091
|
+
border: 'none',
|
|
2092
|
+
on: {
|
|
2093
|
+
focus: {
|
|
2094
|
+
outline: 'none'
|
|
2095
|
+
}
|
|
2096
|
+
},
|
|
2097
|
+
fontSize: Typography.fontSizes[size],
|
|
2098
|
+
backgroundColor: 'transparent',
|
|
2099
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
2100
|
+
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
2101
|
+
}, styles['field']);
|
|
2102
|
+
return /*#__PURE__*/React.createElement(FieldContainer, {
|
|
2103
|
+
helperText: helperText,
|
|
2104
|
+
error: error,
|
|
2105
|
+
styles: styles,
|
|
2106
|
+
onClick: handleClick
|
|
2107
|
+
}, /*#__PURE__*/React.createElement(FieldContent, {
|
|
2108
|
+
label: label,
|
|
2109
|
+
size: size,
|
|
2110
|
+
error: error,
|
|
2111
|
+
shape: shape,
|
|
2112
|
+
styles: styles,
|
|
2113
|
+
shadow: shadow,
|
|
2114
|
+
variant: variant,
|
|
2115
|
+
value: selected,
|
|
2116
|
+
color: colorScheme,
|
|
2117
|
+
isHovered: isHovered,
|
|
2118
|
+
isDisabled: isDisabled,
|
|
2119
|
+
isReadOnly: isReadOnly,
|
|
2120
|
+
isFocused: isFocused,
|
|
2121
|
+
isWithLabel: isWithLabel,
|
|
2122
|
+
colorScheme: colorScheme,
|
|
2123
|
+
onMouseEnter: handleHover,
|
|
2124
|
+
onMouseLeave: handleHover
|
|
2125
|
+
}, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
|
|
2126
|
+
htmlFor: id,
|
|
2127
|
+
color: colorScheme,
|
|
2128
|
+
error: error
|
|
2129
|
+
}, styles), label), /*#__PURE__*/React.createElement(CountrySelector, Object.assign({
|
|
2130
|
+
id: id,
|
|
2131
|
+
name: name,
|
|
2132
|
+
placeholder: placeholder,
|
|
2133
|
+
readOnly: isReadOnly,
|
|
2134
|
+
disabled: isDisabled,
|
|
2135
|
+
autoFocus: isAutoFocus,
|
|
2136
|
+
onBlur: handleBlur,
|
|
2137
|
+
onFocus: handleFocus
|
|
2138
|
+
}, fieldStyles, props, {
|
|
2139
|
+
value: selected,
|
|
2140
|
+
onChange: handleChange
|
|
2141
|
+
}))), /*#__PURE__*/React.createElement(FieldIcons, null, hide ? /*#__PURE__*/React.createElement(ArrowDownSvg, {
|
|
2142
|
+
size: IconSizes$2[size],
|
|
2143
|
+
color: IconColor,
|
|
2144
|
+
style: styles['icon']
|
|
2145
|
+
}) : /*#__PURE__*/React.createElement(ArrowUpSvg, {
|
|
2146
|
+
size: IconSizes$2[size],
|
|
2147
|
+
color: IconColor,
|
|
2148
|
+
style: styles['icon']
|
|
2149
|
+
}))), !hide && /*#__PURE__*/React.createElement(DropDown, {
|
|
2150
|
+
size: size,
|
|
2151
|
+
styles: styles,
|
|
2152
|
+
options: newOptions,
|
|
2153
|
+
callback: handleCallback
|
|
2154
|
+
}));
|
|
2155
|
+
};
|
|
2156
|
+
|
|
2157
|
+
var CountryPickerComponent = function CountryPickerComponent(props) {
|
|
2158
|
+
var countryPickerStates = useCountryPickerState(props);
|
|
2159
|
+
return /*#__PURE__*/React.createElement(CountryPickerView, Object.assign({}, countryPickerStates, props));
|
|
2160
|
+
};
|
|
2161
|
+
/**
|
|
2162
|
+
* Country picker allows users to select a country from a dropdown list or search field.
|
|
2163
|
+
*/
|
|
2164
|
+
var CountryPicker = CountryPickerComponent;
|
|
2165
|
+
|
|
2166
|
+
var useDatePickerState = function useDatePickerState() {
|
|
2167
|
+
var _React$useState = React.useState(false),
|
|
2168
|
+
isHovered = _React$useState[0],
|
|
2169
|
+
setIsHovered = _React$useState[1];
|
|
2170
|
+
var _React$useState2 = React.useState(false),
|
|
2171
|
+
isFocused = _React$useState2[0],
|
|
2172
|
+
setIsFocused = _React$useState2[1];
|
|
2173
|
+
var _React$useState3 = React.useState(format(new Date(), 'yyyy-MM-dd')),
|
|
2174
|
+
date = _React$useState3[0],
|
|
2175
|
+
setDate = _React$useState3[1];
|
|
2176
|
+
return {
|
|
2177
|
+
date: date,
|
|
2178
|
+
setDate: setDate,
|
|
2179
|
+
isHovered: isHovered,
|
|
2180
|
+
setIsHovered: setIsHovered,
|
|
2181
|
+
isFocused: isFocused,
|
|
2182
|
+
setIsFocused: setIsFocused
|
|
2183
|
+
};
|
|
2184
|
+
};
|
|
2185
|
+
|
|
2186
|
+
var _excluded$3 = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "colorScheme", "styles", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
|
|
2187
|
+
var DatePickerContent = function DatePickerContent(props) {
|
|
2188
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
2189
|
+
type: "date"
|
|
2190
|
+
}, props));
|
|
2191
|
+
};
|
|
2192
|
+
var DatePickerView = function DatePickerView(_ref) {
|
|
2193
|
+
var id = _ref.id,
|
|
2194
|
+
name = _ref.name,
|
|
2195
|
+
label = _ref.label,
|
|
2196
|
+
date = _ref.date,
|
|
2197
|
+
helperText = _ref.helperText,
|
|
2198
|
+
_ref$shadow = _ref.shadow,
|
|
2199
|
+
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
2200
|
+
_ref$size = _ref.size,
|
|
2201
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
2202
|
+
_ref$variant = _ref.variant,
|
|
2203
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
2204
|
+
_ref$shape = _ref.shape,
|
|
2205
|
+
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
2206
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
2207
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
2208
|
+
_ref$styles = _ref.styles,
|
|
2209
|
+
styles = _ref$styles === void 0 ? {
|
|
2210
|
+
box: {},
|
|
2211
|
+
label: {},
|
|
2212
|
+
helperText: {},
|
|
2213
|
+
text: {},
|
|
2214
|
+
field: {}
|
|
2215
|
+
} : _ref$styles,
|
|
2216
|
+
_ref$error = _ref.error,
|
|
2217
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
2218
|
+
_ref$isHovered = _ref.isHovered,
|
|
2219
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
2220
|
+
_ref$isFocused = _ref.isFocused,
|
|
2221
|
+
isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
|
|
2222
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
2223
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
2224
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
2225
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
2226
|
+
_ref$setDate = _ref.setDate,
|
|
2227
|
+
setDate = _ref$setDate === void 0 ? function () {} : _ref$setDate,
|
|
2228
|
+
_ref$setIsFocused = _ref.setIsFocused,
|
|
2229
|
+
setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
|
|
2230
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
2231
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
2232
|
+
onChange = _ref.onChange,
|
|
2233
|
+
onChangeText = _ref.onChangeText,
|
|
2234
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
2235
|
+
var isWithLabel = !!(isFocused && label);
|
|
2236
|
+
var handleHover = function handleHover() {
|
|
2237
|
+
return setIsHovered(!isHovered);
|
|
2238
|
+
};
|
|
2239
|
+
var handleFocus = function handleFocus() {
|
|
2240
|
+
return setIsFocused(true);
|
|
2241
|
+
};
|
|
2242
|
+
var handleDateChange = function handleDateChange(event) {
|
|
2243
|
+
if (typeof event === 'string') {
|
|
2244
|
+
setDate(event);
|
|
2245
|
+
if (onChangeText) onChangeText(event);
|
|
2246
|
+
} else {
|
|
2247
|
+
setDate(event.target.value);
|
|
2248
|
+
if (onChange) onChange(event);
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
var fieldStyles = Object.assign({
|
|
2252
|
+
margin: 0,
|
|
2253
|
+
paddingVertical: 8,
|
|
2254
|
+
paddingHorizontal: 0,
|
|
2255
|
+
width: '100%',
|
|
2256
|
+
heigth: '100%',
|
|
2257
|
+
border: 'none',
|
|
2258
|
+
on: {
|
|
2259
|
+
focus: {
|
|
2260
|
+
outline: 'none',
|
|
2261
|
+
backgroundColor: 'transparent'
|
|
2262
|
+
}
|
|
2263
|
+
},
|
|
2264
|
+
fontSize: Typography.fontSizes[size],
|
|
2265
|
+
backgroundColor: 'transparent',
|
|
2266
|
+
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
2267
|
+
cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
|
|
2268
|
+
}, styles['field']);
|
|
2269
|
+
return /*#__PURE__*/React.createElement(FieldContainer$1, {
|
|
2270
|
+
helperText: helperText,
|
|
2271
|
+
error: error,
|
|
2272
|
+
styles: styles
|
|
2273
|
+
}, /*#__PURE__*/React.createElement(FieldContent$1, {
|
|
2274
|
+
label: label,
|
|
2275
|
+
size: size,
|
|
2276
|
+
error: error,
|
|
2277
|
+
shape: shape,
|
|
2278
|
+
styles: styles,
|
|
2279
|
+
shadow: shadow,
|
|
2280
|
+
variant: variant,
|
|
2281
|
+
value: date,
|
|
2282
|
+
color: colorScheme,
|
|
2283
|
+
isHovered: isHovered,
|
|
2284
|
+
isDisabled: isDisabled,
|
|
2285
|
+
isReadOnly: isReadOnly,
|
|
2286
|
+
isFocused: isFocused,
|
|
2287
|
+
isWithLabel: isWithLabel,
|
|
2288
|
+
colorScheme: colorScheme,
|
|
2289
|
+
onMouseEnter: handleHover,
|
|
2290
|
+
onMouseLeave: handleHover
|
|
2291
|
+
}, /*#__PURE__*/React.createElement(FieldWrapper$1, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel$1, Object.assign({
|
|
2292
|
+
htmlFor: id,
|
|
2293
|
+
color: colorScheme,
|
|
2294
|
+
error: error
|
|
2295
|
+
}, styles), label), /*#__PURE__*/React.createElement(DatePickerContent, Object.assign({
|
|
2296
|
+
id: id,
|
|
2297
|
+
name: name,
|
|
2298
|
+
value: date,
|
|
2299
|
+
onFocus: handleFocus,
|
|
2300
|
+
onChange: handleDateChange,
|
|
2301
|
+
disabled: isDisabled,
|
|
2302
|
+
readOnly: isReadOnly
|
|
2303
|
+
}, fieldStyles, onChangeText && {
|
|
2304
|
+
onChangeText: handleDateChange
|
|
2305
|
+
}, props)))));
|
|
2306
|
+
};
|
|
2307
|
+
|
|
2308
|
+
var DatePickerComponent = function DatePickerComponent(props) {
|
|
2309
|
+
var datePickerStates = useDatePickerState();
|
|
2310
|
+
return /*#__PURE__*/React.createElement(DatePickerView, Object.assign({}, datePickerStates, props));
|
|
2311
|
+
};
|
|
2312
|
+
/**
|
|
2313
|
+
* Date picker allows users to select a date from a calendar view.
|
|
2314
|
+
*/
|
|
2315
|
+
var DatePicker = DatePickerComponent;
|
|
2316
|
+
|
|
2317
|
+
var usePasswordState = function usePasswordState() {
|
|
2318
|
+
var _useState = useState(false),
|
|
2319
|
+
isVisible = _useState[0],
|
|
2320
|
+
setIsVisible = _useState[1];
|
|
2321
|
+
return {
|
|
2322
|
+
isVisible: isVisible,
|
|
2323
|
+
setIsVisible: setIsVisible
|
|
2324
|
+
};
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
var _excluded$4 = ["name", "visibleIcon", "hiddenIcon", "isDisabled", "isVisible", "setIsVisible"];
|
|
2328
|
+
var PasswordView = function PasswordView(_ref) {
|
|
2329
|
+
var name = _ref.name,
|
|
2330
|
+
visibleIcon = _ref.visibleIcon,
|
|
2331
|
+
hiddenIcon = _ref.hiddenIcon,
|
|
2332
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
2333
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
2334
|
+
_ref$isVisible = _ref.isVisible,
|
|
2335
|
+
isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
|
|
2336
|
+
_ref$setIsVisible = _ref.setIsVisible,
|
|
2337
|
+
setIsVisible = _ref$setIsVisible === void 0 ? function () {} : _ref$setIsVisible,
|
|
2338
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
2339
|
+
return /*#__PURE__*/React.createElement(TextField$1, Object.assign({
|
|
2340
|
+
name: name,
|
|
2341
|
+
type: isVisible ? 'text' : 'password',
|
|
2342
|
+
rightChild: /*#__PURE__*/React.createElement(View, {
|
|
2343
|
+
onClick: function onClick() {
|
|
2344
|
+
if (!isDisabled) setIsVisible(!isVisible);
|
|
2345
|
+
}
|
|
2346
|
+
}, isVisible ? visibleIcon : hiddenIcon),
|
|
2347
|
+
isClearable: false
|
|
2348
|
+
}, props));
|
|
2349
|
+
};
|
|
2350
|
+
|
|
2351
|
+
var PasswordComponent = function PasswordComponent(props) {
|
|
2352
|
+
var passwordState = usePasswordState();
|
|
2353
|
+
return /*#__PURE__*/React.createElement(PasswordView, Object.assign({}, passwordState, props));
|
|
2354
|
+
};
|
|
2355
|
+
/**
|
|
2356
|
+
* To allow users to securely enter sensitive information
|
|
2357
|
+
*/
|
|
2358
|
+
var Password = PasswordComponent;
|
|
2359
|
+
|
|
2360
|
+
var useSelectState = function useSelectState(_ref) {
|
|
2361
|
+
var placeholder = _ref.placeholder,
|
|
2362
|
+
isMulti = _ref.isMulti,
|
|
2363
|
+
options = _ref.options;
|
|
2364
|
+
var defaultSelected = placeholder ? isMulti ? [] : '' : options[0];
|
|
2365
|
+
var _React$useState = React.useState(true),
|
|
2366
|
+
hide = _React$useState[0],
|
|
2367
|
+
setHide = _React$useState[1];
|
|
2368
|
+
var _React$useState2 = React.useState(false),
|
|
2369
|
+
isHovered = _React$useState2[0],
|
|
2370
|
+
setIsHovered = _React$useState2[1];
|
|
2371
|
+
var _React$useState3 = React.useState(false),
|
|
2372
|
+
isFocused = _React$useState3[0],
|
|
2373
|
+
setIsFocused = _React$useState3[1];
|
|
2374
|
+
var _React$useState4 = React.useState(defaultSelected),
|
|
2375
|
+
selected = _React$useState4[0],
|
|
2376
|
+
setSelected = _React$useState4[1];
|
|
2377
|
+
return {
|
|
2378
|
+
selected: selected,
|
|
2379
|
+
setSelected: setSelected,
|
|
2380
|
+
hide: hide,
|
|
2381
|
+
setHide: setHide,
|
|
2382
|
+
isHovered: isHovered,
|
|
2383
|
+
setIsHovered: setIsHovered,
|
|
2384
|
+
isFocused: isFocused,
|
|
2385
|
+
setIsFocused: setIsFocused
|
|
2386
|
+
};
|
|
2387
|
+
};
|
|
2388
|
+
var useItemState = function useItemState() {
|
|
2389
|
+
var _React$useState5 = React.useState(false),
|
|
2390
|
+
isHovered = _React$useState5[0],
|
|
2391
|
+
setIsHovered = _React$useState5[1];
|
|
2392
|
+
return {
|
|
2393
|
+
isHovered: isHovered,
|
|
2394
|
+
setIsHovered: setIsHovered
|
|
2395
|
+
};
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
var IconSizes$3 = {
|
|
2399
|
+
xs: 8,
|
|
2400
|
+
sm: 10,
|
|
2401
|
+
md: 12,
|
|
2402
|
+
lg: 14,
|
|
2403
|
+
xl: 16
|
|
2404
|
+
};
|
|
2405
|
+
|
|
2406
|
+
var _excluded$5 = ["isHovered", "setIsHovered", "option", "size", "callback"],
|
|
2407
|
+
_excluded2 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
2408
|
+
_excluded3 = ["option", "size", "removeOption"],
|
|
2409
|
+
_excluded4 = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setSelected", "setIsHovered", "setIsFocused"];
|
|
2410
|
+
var Item = function Item(_ref) {
|
|
2411
|
+
var isHovered = _ref.isHovered,
|
|
2412
|
+
setIsHovered = _ref.setIsHovered,
|
|
2413
|
+
option = _ref.option,
|
|
2414
|
+
_ref$size = _ref.size,
|
|
2415
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
2416
|
+
_ref$callback = _ref.callback,
|
|
2417
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
2418
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
2419
|
+
var handleOptionClick = function handleOptionClick(option) {
|
|
2420
|
+
return callback(option);
|
|
2421
|
+
};
|
|
2422
|
+
var handleHover = function handleHover() {
|
|
2423
|
+
return setIsHovered(!isHovered);
|
|
2424
|
+
};
|
|
2425
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
2426
|
+
as: "li",
|
|
2427
|
+
margin: 0,
|
|
2428
|
+
paddingVertical: 8,
|
|
2429
|
+
paddingHorizontal: 12,
|
|
2430
|
+
listStyleType: "none",
|
|
2431
|
+
onMouseEnter: handleHover,
|
|
2432
|
+
onMouseLeave: handleHover,
|
|
2433
|
+
fontSize: Typography.fontSizes[size],
|
|
2434
|
+
onClick: function onClick() {
|
|
2435
|
+
return handleOptionClick(option);
|
|
2436
|
+
},
|
|
2437
|
+
backgroundColor: isHovered ? 'trueGray.100' : 'transparent'
|
|
2438
|
+
}, props), option);
|
|
2439
|
+
};
|
|
2440
|
+
var SelectBox = function SelectBox(_ref2) {
|
|
2441
|
+
var _ref2$size = _ref2.size,
|
|
2442
|
+
size = _ref2$size === void 0 ? 'md' : _ref2$size,
|
|
2443
|
+
_ref2$styles = _ref2.styles,
|
|
2444
|
+
styles = _ref2$styles === void 0 ? {
|
|
2445
|
+
field: {},
|
|
2446
|
+
text: {}
|
|
2447
|
+
} : _ref2$styles,
|
|
2448
|
+
selected = _ref2.selected,
|
|
2449
|
+
isDisabled = _ref2.isDisabled,
|
|
2450
|
+
placeholder = _ref2.placeholder,
|
|
2451
|
+
_ref2$removeOption = _ref2.removeOption,
|
|
2452
|
+
removeOption = _ref2$removeOption === void 0 ? function () {} : _ref2$removeOption;
|
|
2453
|
+
var fieldStyles = Object.assign({
|
|
2454
|
+
margin: 0,
|
|
2455
|
+
width: '95%',
|
|
2456
|
+
heigth: '100%',
|
|
2457
|
+
border: 'none',
|
|
2458
|
+
paddingVertical: 8,
|
|
2459
|
+
paddingHorizontal: 0,
|
|
2460
|
+
fontSize: Typography.fontSizes[size],
|
|
2461
|
+
backgroundColor: 'transparent',
|
|
2462
|
+
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
2463
|
+
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
2464
|
+
}, styles['field'], styles['text']);
|
|
2465
|
+
return /*#__PURE__*/React.createElement(Text$1, Object.assign({}, fieldStyles), (selected === '' || selected && selected.length === 0) && !!placeholder ? placeholder : /*#__PURE__*/React.createElement(React.Fragment, null, typeof selected === 'string' ? selected : selected && selected.length > 0 && /*#__PURE__*/React.createElement(Horizontal$1, {
|
|
2466
|
+
gap: 6
|
|
2467
|
+
}, selected.map(function (option) {
|
|
2468
|
+
return /*#__PURE__*/React.createElement(MultiSelect, {
|
|
2469
|
+
key: option,
|
|
2470
|
+
option: option,
|
|
2471
|
+
removeOption: removeOption
|
|
2472
|
+
});
|
|
2473
|
+
}))));
|
|
2474
|
+
};
|
|
2475
|
+
var HiddenSelect = function HiddenSelect(_ref3) {
|
|
2476
|
+
var id = _ref3.id,
|
|
2477
|
+
name = _ref3.name,
|
|
2478
|
+
selected = _ref3.selected,
|
|
2479
|
+
onChange = _ref3.onChange,
|
|
2480
|
+
_ref3$isMulti = _ref3.isMulti,
|
|
2481
|
+
isMulti = _ref3$isMulti === void 0 ? false : _ref3$isMulti,
|
|
2482
|
+
_ref3$isDisabled = _ref3.isDisabled,
|
|
2483
|
+
isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled,
|
|
2484
|
+
_ref3$isReadOnly = _ref3.isReadOnly,
|
|
2485
|
+
isReadOnly = _ref3$isReadOnly === void 0 ? false : _ref3$isReadOnly,
|
|
2486
|
+
_ref3$options = _ref3.options,
|
|
2487
|
+
options = _ref3$options === void 0 ? [] : _ref3$options,
|
|
2488
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
2489
|
+
var handleChange = function handleChange(event) {
|
|
2490
|
+
if (onChange) onChange(event);
|
|
2491
|
+
};
|
|
2492
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
2493
|
+
id: id,
|
|
2494
|
+
name: name,
|
|
2495
|
+
as: "select",
|
|
2496
|
+
opacity: 0,
|
|
2497
|
+
width: 0,
|
|
2498
|
+
height: 0,
|
|
2499
|
+
position: "absolute",
|
|
2500
|
+
value: selected,
|
|
2501
|
+
disabled: isDisabled,
|
|
2502
|
+
readOnly: isReadOnly,
|
|
2503
|
+
onChange: handleChange,
|
|
2504
|
+
multiple: isMulti
|
|
2505
|
+
}, props), options.map(function (option) {
|
|
2506
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
2507
|
+
key: option,
|
|
2508
|
+
value: option
|
|
2509
|
+
}, option);
|
|
2510
|
+
}));
|
|
2511
|
+
};
|
|
2512
|
+
var DropDown$1 = function DropDown(_ref4) {
|
|
2513
|
+
var size = _ref4.size,
|
|
2514
|
+
_ref4$styles = _ref4.styles,
|
|
2515
|
+
styles = _ref4$styles === void 0 ? {
|
|
2516
|
+
dropDown: {}
|
|
2517
|
+
} : _ref4$styles,
|
|
2518
|
+
options = _ref4.options,
|
|
2519
|
+
_ref4$callback = _ref4.callback,
|
|
2520
|
+
callback = _ref4$callback === void 0 ? function () {} : _ref4$callback;
|
|
2521
|
+
var itemStates = useItemState();
|
|
2522
|
+
var handleCallback = function handleCallback(option) {
|
|
2523
|
+
return callback(option);
|
|
2524
|
+
};
|
|
2525
|
+
var shadow = typeof document !== undefined ? {
|
|
2526
|
+
boxShadow: 'rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px'
|
|
2527
|
+
} : {
|
|
2528
|
+
elevation: 2,
|
|
2529
|
+
shadowColor: 'rgba(0, 0, 0, 0.07)',
|
|
2530
|
+
shadowOffset: {
|
|
2531
|
+
width: 0,
|
|
2532
|
+
height: 1
|
|
2533
|
+
},
|
|
2534
|
+
shadowOpacity: 1,
|
|
2535
|
+
shadowRadius: 1
|
|
2536
|
+
};
|
|
2537
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
2538
|
+
as: "ul",
|
|
2539
|
+
role: "dropdown",
|
|
2540
|
+
top: "100%",
|
|
2541
|
+
width: "100%",
|
|
2542
|
+
display: "flex",
|
|
2543
|
+
zIndex: 1000,
|
|
2544
|
+
overflowY: "auto",
|
|
2545
|
+
marginTop: 5,
|
|
2546
|
+
marginLeft: 0,
|
|
2547
|
+
marginRight: 0,
|
|
2548
|
+
marginBottom: 0,
|
|
2549
|
+
padding: 0,
|
|
2550
|
+
borderRadius: 4,
|
|
2551
|
+
position: "absolute",
|
|
2552
|
+
flexDirection: "column",
|
|
2553
|
+
backgroundColor: "white",
|
|
2554
|
+
justifyContent: "space-evenly"
|
|
2555
|
+
}, shadow, styles['dropDown']), options.map(function (option) {
|
|
2556
|
+
return /*#__PURE__*/React.createElement(Item, Object.assign({
|
|
2557
|
+
key: option,
|
|
2558
|
+
size: size,
|
|
2559
|
+
option: option,
|
|
2560
|
+
callback: handleCallback
|
|
2561
|
+
}, itemStates, styles['text']));
|
|
2562
|
+
}));
|
|
2563
|
+
};
|
|
2564
|
+
var MultiSelect = function MultiSelect(_ref5) {
|
|
2565
|
+
var option = _ref5.option,
|
|
2566
|
+
_ref5$size = _ref5.size,
|
|
2567
|
+
size = _ref5$size === void 0 ? 'md' : _ref5$size,
|
|
2568
|
+
_ref5$removeOption = _ref5.removeOption,
|
|
2569
|
+
removeOption = _ref5$removeOption === void 0 ? function () {} : _ref5$removeOption,
|
|
2570
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded3);
|
|
2571
|
+
var handleClick = function handleClick() {
|
|
2572
|
+
return removeOption(option);
|
|
2573
|
+
};
|
|
2574
|
+
return /*#__PURE__*/React.createElement(Horizontal$1, Object.assign({
|
|
2575
|
+
gap: 10,
|
|
2576
|
+
padding: 6,
|
|
2577
|
+
borderRadius: 4,
|
|
2578
|
+
alignItems: "center",
|
|
2579
|
+
fontSize: Typography.fontSizes[size],
|
|
2580
|
+
backgroundColor: "trueGray.300",
|
|
2581
|
+
onClick: function onClick(event) {
|
|
2582
|
+
return event.stopPropagation();
|
|
2583
|
+
}
|
|
2584
|
+
}, props), /*#__PURE__*/React.createElement(Text$1, {
|
|
2585
|
+
size: size
|
|
2586
|
+
}, option), /*#__PURE__*/React.createElement(CloseSvg, {
|
|
2587
|
+
role: "close-button",
|
|
2588
|
+
color: "inherit",
|
|
2589
|
+
size: IconSizes$3[size],
|
|
2590
|
+
onClick: handleClick
|
|
2591
|
+
}));
|
|
2592
|
+
};
|
|
2593
|
+
var SelectView = function SelectView(_ref6) {
|
|
2594
|
+
var id = _ref6.id,
|
|
2595
|
+
name = _ref6.name,
|
|
2596
|
+
label = _ref6.label,
|
|
2597
|
+
selected = _ref6.selected,
|
|
2598
|
+
placeholder = _ref6.placeholder,
|
|
2599
|
+
helperText = _ref6.helperText,
|
|
2600
|
+
_ref6$hide = _ref6.hide,
|
|
2601
|
+
hide = _ref6$hide === void 0 ? false : _ref6$hide,
|
|
2602
|
+
_ref6$error = _ref6.error,
|
|
2603
|
+
error = _ref6$error === void 0 ? false : _ref6$error,
|
|
2604
|
+
_ref6$isMulti = _ref6.isMulti,
|
|
2605
|
+
isMulti = _ref6$isMulti === void 0 ? false : _ref6$isMulti,
|
|
2606
|
+
_ref6$isFocused = _ref6.isFocused,
|
|
2607
|
+
isFocused = _ref6$isFocused === void 0 ? false : _ref6$isFocused,
|
|
2608
|
+
_ref6$isHovered = _ref6.isHovered,
|
|
2609
|
+
isHovered = _ref6$isHovered === void 0 ? false : _ref6$isHovered,
|
|
2610
|
+
_ref6$isDisabled = _ref6.isDisabled,
|
|
2611
|
+
isDisabled = _ref6$isDisabled === void 0 ? false : _ref6$isDisabled,
|
|
2612
|
+
_ref6$isReadOnly = _ref6.isReadOnly,
|
|
2613
|
+
isReadOnly = _ref6$isReadOnly === void 0 ? false : _ref6$isReadOnly,
|
|
2614
|
+
_ref6$options = _ref6.options,
|
|
2615
|
+
options = _ref6$options === void 0 ? [] : _ref6$options,
|
|
2616
|
+
_ref6$shadow = _ref6.shadow,
|
|
2617
|
+
shadow = _ref6$shadow === void 0 ? {} : _ref6$shadow,
|
|
2618
|
+
_ref6$size = _ref6.size,
|
|
2619
|
+
size = _ref6$size === void 0 ? 'md' : _ref6$size,
|
|
2620
|
+
_ref6$colorScheme = _ref6.colorScheme,
|
|
2621
|
+
colorScheme = _ref6$colorScheme === void 0 ? 'theme.primary' : _ref6$colorScheme,
|
|
2622
|
+
_ref6$shape = _ref6.shape,
|
|
2623
|
+
shape = _ref6$shape === void 0 ? 'default' : _ref6$shape,
|
|
2624
|
+
_ref6$variant = _ref6.variant,
|
|
2625
|
+
variant = _ref6$variant === void 0 ? 'default' : _ref6$variant,
|
|
2626
|
+
_ref6$styles = _ref6.styles,
|
|
2627
|
+
styles = _ref6$styles === void 0 ? {
|
|
2628
|
+
text: {},
|
|
2629
|
+
icon: {},
|
|
2630
|
+
dropDown: {},
|
|
2631
|
+
selectBox: {},
|
|
2632
|
+
label: {},
|
|
2633
|
+
helperText: {}
|
|
2634
|
+
} : _ref6$styles,
|
|
2635
|
+
_ref6$onChange = _ref6.onChange,
|
|
2636
|
+
onChange = _ref6$onChange === void 0 ? function () {} : _ref6$onChange,
|
|
2637
|
+
_ref6$setHide = _ref6.setHide,
|
|
2638
|
+
setHide = _ref6$setHide === void 0 ? function () {} : _ref6$setHide,
|
|
2639
|
+
_ref6$setSelected = _ref6.setSelected,
|
|
2640
|
+
setSelected = _ref6$setSelected === void 0 ? function () {} : _ref6$setSelected,
|
|
2641
|
+
_ref6$setIsHovered = _ref6.setIsHovered,
|
|
2642
|
+
setIsHovered = _ref6$setIsHovered === void 0 ? function () {} : _ref6$setIsHovered,
|
|
2643
|
+
_ref6$setIsFocused = _ref6.setIsFocused,
|
|
2644
|
+
setIsFocused = _ref6$setIsFocused === void 0 ? function () {} : _ref6$setIsFocused,
|
|
2645
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded4);
|
|
2646
|
+
var isWithLabel = !!(isFocused && label);
|
|
2647
|
+
var handleHover = function handleHover() {
|
|
2648
|
+
return setIsHovered(!isHovered);
|
|
2649
|
+
};
|
|
2650
|
+
var handleFocus = function handleFocus() {
|
|
2651
|
+
return setIsFocused(true);
|
|
2652
|
+
};
|
|
2653
|
+
var handleClick = function handleClick(event) {
|
|
2654
|
+
event.stopPropagation();
|
|
2655
|
+
setHide(!hide);
|
|
2656
|
+
setIsFocused(!isFocused);
|
|
2657
|
+
};
|
|
2658
|
+
var handleCallback = useCallback(function (option) {
|
|
2659
|
+
setHide(!hide);
|
|
2660
|
+
if (isMulti && Array.isArray(selected)) {
|
|
2661
|
+
!selected.includes(option) && setSelected([].concat(selected, [option]));
|
|
2662
|
+
} else {
|
|
2663
|
+
setSelected(option);
|
|
2664
|
+
}
|
|
2665
|
+
}, [hide, isMulti, selected]);
|
|
2666
|
+
var handleRemoveOption = function handleRemoveOption(selectedOption) {
|
|
2667
|
+
if (Array.isArray(selected) && selected.includes(selectedOption)) {
|
|
2668
|
+
var newSelected = selected.filter(function (option) {
|
|
2669
|
+
return option !== selectedOption;
|
|
2670
|
+
});
|
|
2671
|
+
setSelected(newSelected.length === 0 ? [] : newSelected);
|
|
2672
|
+
}
|
|
2673
|
+
};
|
|
2674
|
+
return /*#__PURE__*/React.createElement(FieldContainer$1, {
|
|
2675
|
+
role: "SelectBox",
|
|
2676
|
+
helperText: helperText,
|
|
2677
|
+
error: error,
|
|
2678
|
+
styles: styles,
|
|
2679
|
+
onClick: isDisabled || isReadOnly ? function () {} : handleClick
|
|
2680
|
+
}, /*#__PURE__*/React.createElement(FieldContent$1, {
|
|
2681
|
+
label: label,
|
|
2682
|
+
size: size,
|
|
2683
|
+
error: error,
|
|
2684
|
+
shape: shape,
|
|
2685
|
+
styles: styles,
|
|
2686
|
+
shadow: shadow,
|
|
2687
|
+
variant: variant,
|
|
2688
|
+
value: selected,
|
|
2689
|
+
color: colorScheme,
|
|
2690
|
+
isHovered: isHovered,
|
|
2691
|
+
isDisabled: isDisabled,
|
|
2692
|
+
isReadOnly: isReadOnly,
|
|
2693
|
+
isFocused: isFocused,
|
|
2694
|
+
isWithLabel: isWithLabel,
|
|
2695
|
+
colorScheme: colorScheme,
|
|
2696
|
+
onMouseEnter: handleHover,
|
|
2697
|
+
onMouseLeave: handleHover
|
|
2698
|
+
}, /*#__PURE__*/React.createElement(FieldWrapper$1, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel$1, Object.assign({
|
|
2699
|
+
htmlFor: id,
|
|
2700
|
+
color: colorScheme,
|
|
2701
|
+
error: error
|
|
2702
|
+
}, styles), label), /*#__PURE__*/React.createElement(HiddenSelect, Object.assign({
|
|
2703
|
+
id: id,
|
|
2704
|
+
name: name,
|
|
2705
|
+
options: options,
|
|
2706
|
+
onChange: onChange,
|
|
2707
|
+
selected: selected,
|
|
2708
|
+
isDisabled: isDisabled,
|
|
2709
|
+
isReadOnly: isReadOnly,
|
|
2710
|
+
isMulti: isMulti,
|
|
2711
|
+
onFocus: handleFocus
|
|
2712
|
+
}, props)), /*#__PURE__*/React.createElement(SelectBox, {
|
|
2713
|
+
size: size,
|
|
2714
|
+
styles: styles,
|
|
2715
|
+
selected: selected,
|
|
2716
|
+
isDisabled: isDisabled,
|
|
2717
|
+
placeholder: placeholder,
|
|
2718
|
+
removeOption: handleRemoveOption
|
|
2719
|
+
})), /*#__PURE__*/React.createElement(FieldIcons$1, null, !isReadOnly && !isDisabled && /*#__PURE__*/React.createElement(React.Fragment, null, hide ? /*#__PURE__*/React.createElement(ArrowDownSvg$1, {
|
|
2720
|
+
color: "inherit",
|
|
2721
|
+
size: IconSizes$3[size],
|
|
2722
|
+
style: styles.icon
|
|
2723
|
+
}) : /*#__PURE__*/React.createElement(ArrowUpSvg$1, {
|
|
2724
|
+
color: "inherit",
|
|
2725
|
+
size: IconSizes$3[size],
|
|
2726
|
+
style: styles.icon
|
|
2727
|
+
})))), !hide && /*#__PURE__*/React.createElement(DropDown$1, {
|
|
2728
|
+
size: size,
|
|
2729
|
+
styles: styles,
|
|
2730
|
+
options: options,
|
|
2731
|
+
callback: handleCallback
|
|
2732
|
+
}));
|
|
2733
|
+
};
|
|
2734
|
+
|
|
2735
|
+
var SelectComponent = function SelectComponent(props) {
|
|
2736
|
+
var selectStates = useSelectState(props);
|
|
2737
|
+
return /*#__PURE__*/React.createElement(SelectView, Object.assign({}, selectStates, props));
|
|
2738
|
+
};
|
|
2739
|
+
/**
|
|
2740
|
+
* Select provides a dropdown list of options for the user to choose from.
|
|
2741
|
+
*/
|
|
2742
|
+
var Select = SelectComponent;
|
|
2743
|
+
|
|
2744
|
+
var useSwitchState = function useSwitchState(_ref) {
|
|
2745
|
+
var isDisabled = _ref.isDisabled,
|
|
2746
|
+
isChecked = _ref.isChecked;
|
|
2747
|
+
var _React$useState = React.useState(false),
|
|
2748
|
+
isHovered = _React$useState[0],
|
|
2749
|
+
setIsHovered = _React$useState[1];
|
|
2750
|
+
var _React$useState2 = React.useState(isDisabled ? !isDisabled : isChecked),
|
|
2751
|
+
on = _React$useState2[0],
|
|
2752
|
+
setOn = _React$useState2[1];
|
|
2753
|
+
return {
|
|
2754
|
+
isHovered: isHovered,
|
|
2755
|
+
setIsHovered: setIsHovered,
|
|
2756
|
+
on: on,
|
|
2757
|
+
setOn: setOn
|
|
2758
|
+
};
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
var KnobSizes = {
|
|
2762
|
+
xs: {
|
|
2763
|
+
height: 6,
|
|
2764
|
+
width: 6
|
|
2765
|
+
},
|
|
2766
|
+
sm: {
|
|
2767
|
+
height: 9,
|
|
2768
|
+
width: 9
|
|
2769
|
+
},
|
|
2770
|
+
md: {
|
|
2771
|
+
height: 12,
|
|
2772
|
+
width: 12
|
|
2773
|
+
},
|
|
2774
|
+
lg: {
|
|
2775
|
+
height: 15,
|
|
2776
|
+
width: 15
|
|
2777
|
+
},
|
|
2778
|
+
xl: {
|
|
2779
|
+
height: 18,
|
|
2780
|
+
width: 18
|
|
2781
|
+
},
|
|
2782
|
+
'2xl': {
|
|
2783
|
+
height: 21,
|
|
2784
|
+
width: 21
|
|
2785
|
+
},
|
|
2786
|
+
'3xl': {
|
|
2787
|
+
height: 24,
|
|
2788
|
+
width: 24
|
|
2789
|
+
},
|
|
2790
|
+
'4xl': {
|
|
2791
|
+
height: 27,
|
|
2792
|
+
width: 27
|
|
2793
|
+
},
|
|
2794
|
+
'5xl': {
|
|
2795
|
+
height: 30,
|
|
2796
|
+
width: 30
|
|
2797
|
+
},
|
|
2798
|
+
'6xl': {
|
|
2799
|
+
height: 33,
|
|
2800
|
+
width: 33
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
var SliderSizes = {
|
|
2804
|
+
xs: {
|
|
2805
|
+
height: 16,
|
|
2806
|
+
width: 28
|
|
2807
|
+
},
|
|
2808
|
+
sm: {
|
|
2809
|
+
height: 20,
|
|
2810
|
+
width: 36
|
|
2811
|
+
},
|
|
2812
|
+
md: {
|
|
2813
|
+
height: 24,
|
|
2814
|
+
width: 44
|
|
2815
|
+
},
|
|
2816
|
+
lg: {
|
|
2817
|
+
height: 28,
|
|
2818
|
+
width: 52
|
|
2819
|
+
},
|
|
2820
|
+
xl: {
|
|
2821
|
+
height: 32,
|
|
2822
|
+
width: 60
|
|
2823
|
+
},
|
|
2824
|
+
'2xl': {
|
|
2825
|
+
height: 36,
|
|
2826
|
+
width: 68
|
|
2827
|
+
},
|
|
2828
|
+
'3xl': {
|
|
2829
|
+
height: 40,
|
|
2830
|
+
width: 76
|
|
2831
|
+
},
|
|
2832
|
+
'4xl': {
|
|
2833
|
+
height: 44,
|
|
2834
|
+
width: 84
|
|
2835
|
+
},
|
|
2836
|
+
'5xl': {
|
|
2837
|
+
height: 48,
|
|
2838
|
+
width: 92
|
|
2839
|
+
},
|
|
2840
|
+
'6xl': {
|
|
2841
|
+
height: 52,
|
|
2842
|
+
width: 100
|
|
2843
|
+
}
|
|
2844
|
+
};
|
|
2845
|
+
var SliderPadding = {
|
|
2846
|
+
xs: {
|
|
2847
|
+
paddingVertical: 0,
|
|
2848
|
+
paddingHorizontal: 2
|
|
2849
|
+
},
|
|
2850
|
+
sm: {
|
|
2851
|
+
paddingVertical: 0,
|
|
2852
|
+
paddingHorizontal: 3
|
|
2853
|
+
},
|
|
2854
|
+
md: {
|
|
2855
|
+
paddingVertical: 0,
|
|
2856
|
+
paddingHorizontal: 5
|
|
2857
|
+
},
|
|
2858
|
+
lg: {
|
|
2859
|
+
paddingVertical: 0,
|
|
2860
|
+
paddingHorizontal: 6
|
|
2861
|
+
},
|
|
2862
|
+
xl: {
|
|
2863
|
+
paddingVertical: 0,
|
|
2864
|
+
paddingHorizontal: 8
|
|
2865
|
+
},
|
|
2866
|
+
'2xl': {
|
|
2867
|
+
paddingVertical: 0,
|
|
2868
|
+
paddingHorizontal: 9
|
|
2869
|
+
},
|
|
2870
|
+
'3xl': {
|
|
2871
|
+
paddingVertical: 0,
|
|
2872
|
+
paddingHorizontal: 10
|
|
2873
|
+
},
|
|
2874
|
+
'4xl': {
|
|
2875
|
+
paddingVertical: 0,
|
|
2876
|
+
paddingHorizontal: 13
|
|
2877
|
+
},
|
|
2878
|
+
'5xl': {
|
|
2879
|
+
paddingVertical: 0,
|
|
2880
|
+
paddingHorizontal: 15
|
|
2881
|
+
},
|
|
2882
|
+
'6xl': {
|
|
2883
|
+
paddingVertical: 0,
|
|
2884
|
+
paddingHorizontal: 16
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
|
|
2888
|
+
var _excluded$6 = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
|
|
2889
|
+
var SwitchContent = function SwitchContent(props) {
|
|
2890
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
2891
|
+
type: "checkbox"
|
|
2892
|
+
}, props));
|
|
2893
|
+
};
|
|
2894
|
+
var SwitchView = function SwitchView(_ref) {
|
|
2895
|
+
var id = _ref.id,
|
|
2896
|
+
name = _ref.name,
|
|
2897
|
+
inActiveChild = _ref.inActiveChild,
|
|
2898
|
+
activeChild = _ref.activeChild,
|
|
2899
|
+
_ref$shadow = _ref.shadow,
|
|
2900
|
+
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
2901
|
+
_ref$size = _ref.size,
|
|
2902
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
2903
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
2904
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
2905
|
+
_ref$on = _ref.on,
|
|
2906
|
+
on = _ref$on === void 0 ? false : _ref$on,
|
|
2907
|
+
_ref$isHovered = _ref.isHovered,
|
|
2908
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
2909
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
2910
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
2911
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
2912
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
2913
|
+
onChange = _ref.onChange,
|
|
2914
|
+
onValueChange = _ref.onValueChange,
|
|
2915
|
+
_ref$setOn = _ref.setOn,
|
|
2916
|
+
setOn = _ref$setOn === void 0 ? function () {} : _ref$setOn,
|
|
2917
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
2918
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
2919
|
+
_ref$styles = _ref.styles,
|
|
2920
|
+
styles = _ref$styles === void 0 ? {
|
|
2921
|
+
slider: {},
|
|
2922
|
+
circle: {}
|
|
2923
|
+
} : _ref$styles,
|
|
2924
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
2925
|
+
var handleToggle = function handleToggle(event) {
|
|
2926
|
+
if (!isReadOnly) {
|
|
2927
|
+
setOn(!on);
|
|
2928
|
+
if (onChange) onChange(event);
|
|
2929
|
+
}
|
|
2930
|
+
};
|
|
2931
|
+
var handleHover = function handleHover() {
|
|
2932
|
+
return setIsHovered(!isHovered);
|
|
2933
|
+
};
|
|
2934
|
+
return /*#__PURE__*/React.createElement(Label, {
|
|
2935
|
+
htmlFor: id,
|
|
2936
|
+
onMouseEnter: handleHover,
|
|
2937
|
+
onMouseLeave: handleHover
|
|
2938
|
+
}, /*#__PURE__*/React.createElement(SwitchContent, Object.assign({
|
|
2939
|
+
id: id,
|
|
2940
|
+
name: name,
|
|
2941
|
+
opacity: 0,
|
|
2942
|
+
width: 0,
|
|
2943
|
+
height: 0,
|
|
2944
|
+
checked: on,
|
|
2945
|
+
onChange: handleToggle,
|
|
2946
|
+
disabled: isDisabled,
|
|
2947
|
+
readOnly: isReadOnly
|
|
2948
|
+
}, onValueChange && {
|
|
2949
|
+
onValueChange: handleToggle
|
|
2950
|
+
}, props)), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
2951
|
+
display: "flex",
|
|
2952
|
+
cursor: "pointer",
|
|
2953
|
+
alignItems: "center",
|
|
2954
|
+
borderRadius: 24,
|
|
2955
|
+
filter: isHovered && on ? 'brightness(0.9)' : 'brightness(1)',
|
|
2956
|
+
transition: "justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
2957
|
+
backgroundColor: isDisabled ? 'disabled' : on ? colorScheme : 'lightgray',
|
|
2958
|
+
justifyContent: activeChild ? 'space-between' : on ? 'flex-end' : 'flex-start'
|
|
2959
|
+
}, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild && on && /*#__PURE__*/React.createElement(View$1, null, activeChild), /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
2960
|
+
borderRadius: "50%",
|
|
2961
|
+
backgroundColor: "white"
|
|
2962
|
+
}, KnobSizes[size], styles['circle'])), inActiveChild && !on && /*#__PURE__*/React.createElement(View$1, null, inActiveChild)));
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
var SwitchComponent = function SwitchComponent(props) {
|
|
2966
|
+
var switchStates = useSwitchState(props);
|
|
2967
|
+
return /*#__PURE__*/React.createElement(SwitchView, Object.assign({}, switchStates, props));
|
|
2968
|
+
};
|
|
2969
|
+
var Switch = SwitchComponent;
|
|
2970
|
+
|
|
2971
|
+
var useTextAreaState = function useTextAreaState(_ref) {
|
|
2972
|
+
var label = _ref.label,
|
|
2973
|
+
placeholder = _ref.placeholder,
|
|
2974
|
+
defaultValue = _ref.defaultValue,
|
|
2975
|
+
value = _ref.value;
|
|
2976
|
+
var _useState = useState(label != null ? label : placeholder),
|
|
2977
|
+
hint = _useState[0],
|
|
2978
|
+
setHint = _useState[1];
|
|
2979
|
+
var _useState2 = useState(false),
|
|
2980
|
+
isHovered = _useState2[0],
|
|
2981
|
+
setIsHovered = _useState2[1];
|
|
2982
|
+
var _useState3 = useState(value || defaultValue || ''),
|
|
2983
|
+
inputValue = _useState3[0],
|
|
2984
|
+
setInputValue = _useState3[1];
|
|
2985
|
+
var _useState4 = useState(false),
|
|
2986
|
+
isFocused = _useState4[0],
|
|
2987
|
+
setIsFocused = _useState4[1];
|
|
2988
|
+
return {
|
|
2989
|
+
hint: hint,
|
|
2990
|
+
setHint: setHint,
|
|
2991
|
+
isHovered: isHovered,
|
|
2992
|
+
setIsHovered: setIsHovered,
|
|
2993
|
+
inputValue: inputValue,
|
|
2994
|
+
setInputValue: setInputValue,
|
|
2995
|
+
isFocused: isFocused,
|
|
2996
|
+
setIsFocused: setIsFocused
|
|
2997
|
+
};
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
var _excluded$7 = ["id", "name", "hint", "error", "value", "label", "shadow", "inputValue", "helperText", "placeholder", "defaultValue", "size", "shape", "variant", "colorScheme", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "onChangeText", "setHint", "setInputValue", "setIsFocused", "setIsHovered", "styles"];
|
|
3001
|
+
var TextAreaView = function TextAreaView(_ref) {
|
|
3002
|
+
var id = _ref.id,
|
|
3003
|
+
name = _ref.name,
|
|
3004
|
+
hint = _ref.hint,
|
|
3005
|
+
error = _ref.error,
|
|
3006
|
+
label = _ref.label,
|
|
3007
|
+
shadow = _ref.shadow,
|
|
3008
|
+
inputValue = _ref.inputValue,
|
|
3009
|
+
helperText = _ref.helperText,
|
|
3010
|
+
placeholder = _ref.placeholder,
|
|
3011
|
+
_ref$size = _ref.size,
|
|
3012
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
3013
|
+
_ref$shape = _ref.shape,
|
|
3014
|
+
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
3015
|
+
_ref$variant = _ref.variant,
|
|
3016
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
3017
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
3018
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
3019
|
+
_ref$isHovered = _ref.isHovered,
|
|
3020
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
3021
|
+
_ref$isFocused = _ref.isFocused,
|
|
3022
|
+
isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
|
|
3023
|
+
_ref$isEditable = _ref.isEditable,
|
|
3024
|
+
isEditable = _ref$isEditable === void 0 ? false : _ref$isEditable,
|
|
3025
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
3026
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
3027
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
3028
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
3029
|
+
_ref$isAutoFocus = _ref.isAutoFocus,
|
|
3030
|
+
isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
|
|
3031
|
+
_ref$isMultiline = _ref.isMultiline,
|
|
3032
|
+
isMultiline = _ref$isMultiline === void 0 ? false : _ref$isMultiline,
|
|
3033
|
+
_ref$maxRows = _ref.maxRows,
|
|
3034
|
+
maxRows = _ref$maxRows === void 0 ? 3 : _ref$maxRows,
|
|
3035
|
+
_ref$maxCols = _ref.maxCols,
|
|
3036
|
+
maxCols = _ref$maxCols === void 0 ? 30 : _ref$maxCols,
|
|
3037
|
+
_ref$onBlur = _ref.onBlur,
|
|
3038
|
+
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
3039
|
+
onChange = _ref.onChange,
|
|
3040
|
+
onFocus = _ref.onFocus,
|
|
3041
|
+
onChangeText = _ref.onChangeText,
|
|
3042
|
+
_ref$setHint = _ref.setHint,
|
|
3043
|
+
setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
|
|
3044
|
+
_ref$setInputValue = _ref.setInputValue,
|
|
3045
|
+
setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
|
|
3046
|
+
_ref$setIsFocused = _ref.setIsFocused,
|
|
3047
|
+
setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
|
|
3048
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
3049
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3050
|
+
_ref$styles = _ref.styles,
|
|
3051
|
+
styles = _ref$styles === void 0 ? {
|
|
3052
|
+
box: {},
|
|
3053
|
+
text: {},
|
|
3054
|
+
label: {},
|
|
3055
|
+
helperText: {},
|
|
3056
|
+
field: {}
|
|
3057
|
+
} : _ref$styles,
|
|
3058
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3059
|
+
var isWithLabel = !!(isFocused && label);
|
|
3060
|
+
useMemo(function () {
|
|
3061
|
+
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
3062
|
+
}, [inputValue, isFocused, label, placeholder]);
|
|
3063
|
+
var fieldStyles = Object.assign({
|
|
3064
|
+
margin: 0,
|
|
3065
|
+
paddingVertical: 8,
|
|
3066
|
+
paddingHorizontal: 0,
|
|
3067
|
+
width: '100%',
|
|
3068
|
+
heigth: '100%',
|
|
3069
|
+
border: 'none',
|
|
3070
|
+
on: {
|
|
3071
|
+
focus: {
|
|
3072
|
+
outline: 'none'
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
fontSize: Typography.fontSizes[size],
|
|
3076
|
+
backgroundColor: 'transparent',
|
|
3077
|
+
color: isDisabled ? 'trueGray.600' : 'blueGray.700',
|
|
3078
|
+
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
3079
|
+
}, styles['field']);
|
|
3080
|
+
var handleHover = function handleHover() {
|
|
3081
|
+
return setIsHovered(!isHovered);
|
|
3082
|
+
};
|
|
3083
|
+
var handleFocus = function handleFocus() {
|
|
3084
|
+
setIsFocused(true);
|
|
3085
|
+
if (onFocus) onFocus();
|
|
3086
|
+
};
|
|
3087
|
+
var handleBlur = function handleBlur(event) {
|
|
3088
|
+
onBlur(event);
|
|
3089
|
+
setIsFocused(false);
|
|
3090
|
+
};
|
|
3091
|
+
var handleChange = function handleChange(event) {
|
|
3092
|
+
if (typeof event === 'string') {
|
|
3093
|
+
//for ios and android
|
|
3094
|
+
setInputValue(event);
|
|
3095
|
+
if (onChangeText) onChangeText(event);
|
|
3096
|
+
} else {
|
|
3097
|
+
setInputValue(event.target.value);
|
|
3098
|
+
if (onChange) onChange(event);
|
|
3099
|
+
}
|
|
3100
|
+
};
|
|
3101
|
+
return /*#__PURE__*/React.createElement(FieldContainer, {
|
|
3102
|
+
helperText: helperText,
|
|
3103
|
+
error: error,
|
|
3104
|
+
styles: styles
|
|
3105
|
+
}, /*#__PURE__*/React.createElement(FieldContent, {
|
|
3106
|
+
label: label,
|
|
3107
|
+
size: size,
|
|
3108
|
+
error: error,
|
|
3109
|
+
shape: shape,
|
|
3110
|
+
styles: styles,
|
|
3111
|
+
shadow: shadow,
|
|
3112
|
+
variant: variant,
|
|
3113
|
+
value: inputValue,
|
|
3114
|
+
color: colorScheme,
|
|
3115
|
+
isHovered: isHovered,
|
|
3116
|
+
isDisabled: isDisabled,
|
|
3117
|
+
isReadOnly: isReadOnly,
|
|
3118
|
+
isFocused: isFocused,
|
|
3119
|
+
isWithLabel: isWithLabel,
|
|
3120
|
+
colorScheme: colorScheme,
|
|
3121
|
+
onMouseEnter: handleHover,
|
|
3122
|
+
onMouseLeave: handleHover
|
|
3123
|
+
}, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
|
|
3124
|
+
htmlFor: id,
|
|
3125
|
+
color: colorScheme,
|
|
3126
|
+
error: error
|
|
3127
|
+
}, styles), label), /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
3128
|
+
as: "textarea",
|
|
3129
|
+
id: id,
|
|
3130
|
+
name: name,
|
|
3131
|
+
rows: maxRows,
|
|
3132
|
+
cols: maxCols,
|
|
3133
|
+
value: inputValue,
|
|
3134
|
+
readOnly: isReadOnly,
|
|
3135
|
+
disabled: isDisabled,
|
|
3136
|
+
autoFocus: isAutoFocus,
|
|
3137
|
+
editable: isEditable,
|
|
3138
|
+
placeholder: hint,
|
|
3139
|
+
onBlur: handleBlur,
|
|
3140
|
+
onFocus: handleFocus,
|
|
3141
|
+
onChange: handleChange,
|
|
3142
|
+
multiline: isMultiline
|
|
3143
|
+
}, fieldStyles, props, onChangeText && {
|
|
3144
|
+
onChangeText: handleChange
|
|
3145
|
+
})))));
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
var TextAreaComponent = function TextAreaComponent(props) {
|
|
3149
|
+
var textAreaState = useTextAreaState(props);
|
|
3150
|
+
return /*#__PURE__*/React.createElement(TextAreaView, Object.assign({}, textAreaState, props));
|
|
3151
|
+
};
|
|
3152
|
+
/**
|
|
3153
|
+
* Text Area is an component used to create a multi-line input field.
|
|
3154
|
+
*/
|
|
3155
|
+
var TextArea = TextAreaComponent;
|
|
3156
|
+
|
|
3157
|
+
var useTextFieldState = function useTextFieldState(_ref) {
|
|
3158
|
+
var label = _ref.label,
|
|
3159
|
+
placeholder = _ref.placeholder,
|
|
3160
|
+
value = _ref.value;
|
|
3161
|
+
var _useState = useState(label != null ? label : placeholder),
|
|
3162
|
+
hint = _useState[0],
|
|
3163
|
+
setHint = _useState[1];
|
|
3164
|
+
var _useState2 = useState(false),
|
|
3165
|
+
isFocused = _useState2[0],
|
|
3166
|
+
setIsFocused = _useState2[1];
|
|
3167
|
+
var _useState3 = useState(false),
|
|
3168
|
+
isHovered = _useState3[0],
|
|
3169
|
+
setIsHovered = _useState3[1];
|
|
3170
|
+
var _useState4 = useState(value || ''),
|
|
3171
|
+
inputValue = _useState4[0],
|
|
3172
|
+
setInputValue = _useState4[1];
|
|
3173
|
+
return {
|
|
3174
|
+
hint: hint,
|
|
3175
|
+
setHint: setHint,
|
|
3176
|
+
isFocused: isFocused,
|
|
3177
|
+
setIsFocused: setIsFocused,
|
|
3178
|
+
isHovered: isHovered,
|
|
3179
|
+
setIsHovered: setIsHovered,
|
|
3180
|
+
inputValue: inputValue,
|
|
3181
|
+
setInputValue: setInputValue
|
|
3182
|
+
};
|
|
3183
|
+
};
|
|
3184
|
+
|
|
3185
|
+
var _excluded$8 = ["id", "name", "label", "value", "hint", "inputValue", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setInputValue", "onClick", "onFocus", "onBlur"];
|
|
3186
|
+
var TextFieldInput = function TextFieldInput(props) {
|
|
3187
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({
|
|
3188
|
+
type: "text"
|
|
3189
|
+
}, props));
|
|
3190
|
+
};
|
|
3191
|
+
var TextFieldView = function TextFieldView(_ref) {
|
|
3192
|
+
var id = _ref.id,
|
|
3193
|
+
name = _ref.name,
|
|
3194
|
+
label = _ref.label,
|
|
3195
|
+
hint = _ref.hint,
|
|
3196
|
+
inputValue = _ref.inputValue,
|
|
3197
|
+
onChange = _ref.onChange,
|
|
3198
|
+
leftChild = _ref.leftChild,
|
|
3199
|
+
rightChild = _ref.rightChild,
|
|
3200
|
+
helperText = _ref.helperText,
|
|
3201
|
+
placeholder = _ref.placeholder,
|
|
3202
|
+
onChangeText = _ref.onChangeText,
|
|
3203
|
+
_ref$shadow = _ref.shadow,
|
|
3204
|
+
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
3205
|
+
_ref$styles = _ref.styles,
|
|
3206
|
+
styles = _ref$styles === void 0 ? {
|
|
3207
|
+
box: {},
|
|
3208
|
+
field: {},
|
|
3209
|
+
label: {},
|
|
3210
|
+
helperText: {},
|
|
3211
|
+
text: {}
|
|
3212
|
+
} : _ref$styles,
|
|
3213
|
+
_ref$size = _ref.size,
|
|
3214
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3215
|
+
_ref$shape = _ref.shape,
|
|
3216
|
+
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
3217
|
+
_ref$variant = _ref.variant,
|
|
3218
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
3219
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
3220
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
3221
|
+
_ref$error = _ref.error,
|
|
3222
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
3223
|
+
_ref$isFocused = _ref.isFocused,
|
|
3224
|
+
isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
|
|
3225
|
+
_ref$isHovered = _ref.isHovered,
|
|
3226
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
3227
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
3228
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
3229
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
3230
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
3231
|
+
_ref$isClearable = _ref.isClearable,
|
|
3232
|
+
isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
|
|
3233
|
+
_ref$isAutoFocus = _ref.isAutoFocus,
|
|
3234
|
+
isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
|
|
3235
|
+
_ref$setHint = _ref.setHint,
|
|
3236
|
+
setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
|
|
3237
|
+
_ref$setIsFocused = _ref.setIsFocused,
|
|
3238
|
+
setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
|
|
3239
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
3240
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3241
|
+
_ref$setInputValue = _ref.setInputValue,
|
|
3242
|
+
setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
|
|
3243
|
+
onFocus = _ref.onFocus,
|
|
3244
|
+
_ref$onBlur = _ref.onBlur,
|
|
3245
|
+
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
3246
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
3247
|
+
var _useTheme = useTheme(),
|
|
3248
|
+
getColor = _useTheme.getColor;
|
|
3249
|
+
var IconColor = getColor('color.blueGray.700');
|
|
3250
|
+
var isWithLabel = !!(isFocused && label);
|
|
3251
|
+
useMemo(function () {
|
|
3252
|
+
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
3253
|
+
}, [inputValue, isFocused, label, placeholder]);
|
|
3254
|
+
var fieldStyles = Object.assign({
|
|
3255
|
+
margin: 0,
|
|
3256
|
+
paddingVertical: 8,
|
|
3257
|
+
padddingHorizontal: 0,
|
|
3258
|
+
width: '100%',
|
|
3259
|
+
heigth: '100%',
|
|
3260
|
+
border: 'none',
|
|
3261
|
+
on: {
|
|
3262
|
+
focus: {
|
|
3263
|
+
outline: 'none'
|
|
3264
|
+
}
|
|
3265
|
+
},
|
|
3266
|
+
fontSize: Typography.fontSizes[size],
|
|
3267
|
+
backgroundColor: 'transparent',
|
|
3268
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
3269
|
+
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
3270
|
+
}, styles['field']);
|
|
3271
|
+
var handleFocus = function handleFocus() {
|
|
3272
|
+
setIsFocused(true);
|
|
3273
|
+
if (onFocus) onFocus();
|
|
3274
|
+
};
|
|
3275
|
+
var handleHover = function handleHover() {
|
|
3276
|
+
return setIsHovered(!isHovered);
|
|
3277
|
+
};
|
|
3278
|
+
var handleBlur = function handleBlur(event) {
|
|
3279
|
+
onBlur(event);
|
|
3280
|
+
setIsFocused(false);
|
|
3281
|
+
};
|
|
3282
|
+
var handleChange = function handleChange(event) {
|
|
3283
|
+
if (typeof event === 'string') {
|
|
3284
|
+
//for ios and android
|
|
3285
|
+
setInputValue(event);
|
|
3286
|
+
if (onChangeText) onChangeText(event);
|
|
3287
|
+
} else {
|
|
3288
|
+
//Web
|
|
3289
|
+
setInputValue(event.target.value);
|
|
3290
|
+
if (onChange) onChange(event);
|
|
3291
|
+
}
|
|
3292
|
+
};
|
|
3293
|
+
var handleClear = function handleClear() {
|
|
3294
|
+
setInputValue('');
|
|
3295
|
+
//Web
|
|
3296
|
+
if (onChange) {
|
|
3297
|
+
onBlur({
|
|
3298
|
+
target: {
|
|
3299
|
+
name: name
|
|
3300
|
+
}
|
|
3301
|
+
});
|
|
3302
|
+
onChange({
|
|
3303
|
+
target: {
|
|
3304
|
+
name: name,
|
|
3305
|
+
value: ''
|
|
3306
|
+
}
|
|
3307
|
+
});
|
|
3308
|
+
}
|
|
3309
|
+
//for ios and android
|
|
3310
|
+
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
3311
|
+
};
|
|
3312
|
+
return /*#__PURE__*/React.createElement(FieldContainer$1, {
|
|
3313
|
+
helperText: helperText,
|
|
3314
|
+
error: error,
|
|
3315
|
+
styles: styles
|
|
3316
|
+
}, /*#__PURE__*/React.createElement(FieldContent$1, {
|
|
3317
|
+
label: label,
|
|
3318
|
+
size: size,
|
|
3319
|
+
error: error,
|
|
3320
|
+
shape: shape,
|
|
3321
|
+
styles: styles,
|
|
3322
|
+
shadow: shadow,
|
|
3323
|
+
variant: variant,
|
|
3324
|
+
value: inputValue,
|
|
3325
|
+
color: colorScheme,
|
|
3326
|
+
isHovered: isHovered,
|
|
3327
|
+
isDisabled: isDisabled,
|
|
3328
|
+
isReadOnly: isReadOnly,
|
|
3329
|
+
isFocused: isFocused,
|
|
3330
|
+
isWithLabel: isWithLabel,
|
|
3331
|
+
colorScheme: colorScheme,
|
|
3332
|
+
onMouseEnter: handleHover,
|
|
3333
|
+
onMouseLeave: handleHover
|
|
3334
|
+
}, leftChild, /*#__PURE__*/React.createElement(FieldWrapper$1, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel$1, Object.assign({
|
|
3335
|
+
htmlFor: id,
|
|
3336
|
+
color: colorScheme,
|
|
3337
|
+
error: error
|
|
3338
|
+
}, styles), label), /*#__PURE__*/React.createElement(TextFieldInput, Object.assign({
|
|
3339
|
+
id: id,
|
|
3340
|
+
name: name,
|
|
3341
|
+
value: inputValue,
|
|
3342
|
+
readOnly: isReadOnly,
|
|
3343
|
+
disabled: isDisabled,
|
|
3344
|
+
autoFocus: isAutoFocus,
|
|
3345
|
+
placeholder: hint,
|
|
3346
|
+
onFocus: handleFocus,
|
|
3347
|
+
onBlur: handleBlur,
|
|
3348
|
+
autoComplete: "off"
|
|
3349
|
+
}, fieldStyles, props, {
|
|
3350
|
+
onChange: handleChange
|
|
3351
|
+
}, onChangeText && {
|
|
3352
|
+
onChangeText: handleChange
|
|
3353
|
+
}))), (rightChild || isClearable && inputValue) && /*#__PURE__*/React.createElement(FieldIcons$1, null, rightChild && /*#__PURE__*/React.createElement(React.Fragment, null, rightChild), isClearable && inputValue && !isReadOnly && !isDisabled && /*#__PURE__*/React.createElement(CloseSvg, {
|
|
3354
|
+
size: Typography.fontSizes[size],
|
|
3355
|
+
color: IconColor,
|
|
3356
|
+
onClick: handleClear
|
|
3357
|
+
}))));
|
|
3358
|
+
};
|
|
3359
|
+
|
|
3360
|
+
var TextFieldComponent = function TextFieldComponent(props) {
|
|
3361
|
+
var textFieldStates = useTextFieldState(props);
|
|
3362
|
+
return /*#__PURE__*/React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
|
|
3363
|
+
};
|
|
3364
|
+
/**
|
|
3365
|
+
* TextField is used to capture text data from users.
|
|
3366
|
+
*/
|
|
3367
|
+
var TextField = TextFieldComponent;
|
|
3368
|
+
|
|
3369
|
+
var _excluded$9 = ["children", "wrap"];
|
|
3370
|
+
var CenterView = function CenterView(_ref) {
|
|
3371
|
+
var children = _ref.children,
|
|
3372
|
+
wrap = _ref.wrap,
|
|
3373
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
3374
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
3375
|
+
display: "flex",
|
|
3376
|
+
justifyContent: "center",
|
|
3377
|
+
alignItems: "center",
|
|
3378
|
+
flexWrap: wrap
|
|
3379
|
+
}, props), children);
|
|
3380
|
+
};
|
|
3381
|
+
|
|
3382
|
+
/**
|
|
3383
|
+
* The Center component is a React functional component that provides a centered layout for its children using flexbox.
|
|
3384
|
+
*/
|
|
3385
|
+
var CenterComponent = function CenterComponent(props) {
|
|
3386
|
+
return /*#__PURE__*/React.createElement(CenterView, Object.assign({}, props));
|
|
3387
|
+
};
|
|
3388
|
+
var Center = CenterComponent;
|
|
3389
|
+
|
|
3390
|
+
var _excluded$a = ["children", "wrap", "justify", "isReversed"];
|
|
3391
|
+
var HorizontalView = function HorizontalView(_ref) {
|
|
3392
|
+
var children = _ref.children,
|
|
3393
|
+
_ref$wrap = _ref.wrap,
|
|
3394
|
+
wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
|
|
3395
|
+
_ref$justify = _ref.justify,
|
|
3396
|
+
justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
|
|
3397
|
+
_ref$isReversed = _ref.isReversed,
|
|
3398
|
+
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
3399
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
3400
|
+
return /*#__PURE__*/React.createElement(View, Object.assign({
|
|
3401
|
+
display: "flex",
|
|
3402
|
+
flexWrap: wrap,
|
|
3403
|
+
flexDirection: isReversed ? 'row-reverse' : 'row',
|
|
3404
|
+
justifyContent: justify
|
|
3405
|
+
}, props), children);
|
|
3406
|
+
};
|
|
3407
|
+
|
|
3408
|
+
/**
|
|
3409
|
+
* Horizontal layout aligns all the elements in a container on the horizontal axis.
|
|
3410
|
+
*/
|
|
3411
|
+
var HorizontalComponent = function HorizontalComponent(props) {
|
|
3412
|
+
return /*#__PURE__*/React.createElement(HorizontalView, Object.assign({}, props));
|
|
3413
|
+
};
|
|
3414
|
+
var Horizontal = HorizontalComponent;
|
|
3415
|
+
|
|
3416
|
+
var _excluded$b = ["children", "wrap", "justify", "isReversed"];
|
|
3417
|
+
var VerticalView = function VerticalView(_ref) {
|
|
3418
|
+
var children = _ref.children,
|
|
3419
|
+
_ref$wrap = _ref.wrap,
|
|
3420
|
+
wrap = _ref$wrap === void 0 ? 'nowrap' : _ref$wrap,
|
|
3421
|
+
_ref$justify = _ref.justify,
|
|
3422
|
+
justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
|
|
3423
|
+
_ref$isReversed = _ref.isReversed,
|
|
3424
|
+
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
3425
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
3426
|
+
return /*#__PURE__*/React.createElement(View$2, Object.assign({
|
|
3427
|
+
display: "flex",
|
|
3428
|
+
flexWrap: wrap,
|
|
3429
|
+
flexDirection: isReversed ? 'column-reverse' : 'column',
|
|
3430
|
+
justifyContent: justify
|
|
3431
|
+
}, props), children);
|
|
3432
|
+
};
|
|
3433
|
+
|
|
3434
|
+
/**
|
|
3435
|
+
* Vertical layout aligns all the elements in a container on the vertical axis.
|
|
3436
|
+
*/
|
|
3437
|
+
var VerticalComponent = function VerticalComponent(props) {
|
|
3438
|
+
return /*#__PURE__*/React.createElement(VerticalView, Object.assign({}, props));
|
|
3439
|
+
};
|
|
3440
|
+
var Vertical = VerticalComponent;
|
|
3441
|
+
|
|
3442
|
+
var useLinkState = function useLinkState() {
|
|
3443
|
+
var _useState = useState(false),
|
|
3444
|
+
isHovered = _useState[0],
|
|
3445
|
+
setIsHovered = _useState[1];
|
|
3446
|
+
return {
|
|
3447
|
+
isHovered: isHovered,
|
|
3448
|
+
setIsHovered: setIsHovered
|
|
3449
|
+
};
|
|
3450
|
+
};
|
|
3451
|
+
|
|
3452
|
+
var IconSizes$4 = {
|
|
3453
|
+
xs: 12,
|
|
3454
|
+
sm: 14,
|
|
3455
|
+
md: 16,
|
|
3456
|
+
lg: 18,
|
|
3457
|
+
xl: 20,
|
|
3458
|
+
'2xl': 24,
|
|
3459
|
+
'3xl': 30,
|
|
3460
|
+
'4xl': 36,
|
|
3461
|
+
'5xl': 48,
|
|
3462
|
+
'6xl': 64
|
|
3463
|
+
};
|
|
3464
|
+
|
|
3465
|
+
var _excluded$c = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "colorScheme", "styles", "setIsHovered"];
|
|
3466
|
+
var LinkView = function LinkView(_ref) {
|
|
3467
|
+
var children = _ref.children,
|
|
3468
|
+
_ref$href = _ref.href,
|
|
3469
|
+
href = _ref$href === void 0 ? '/' : _ref$href,
|
|
3470
|
+
_ref$iconSize = _ref.iconSize,
|
|
3471
|
+
iconSize = _ref$iconSize === void 0 ? 'sm' : _ref$iconSize,
|
|
3472
|
+
_ref$underline = _ref.underline,
|
|
3473
|
+
underline = _ref$underline === void 0 ? 'default' : _ref$underline,
|
|
3474
|
+
_ref$isHovered = _ref.isHovered,
|
|
3475
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
3476
|
+
_ref$isExternal = _ref.isExternal,
|
|
3477
|
+
isExternal = _ref$isExternal === void 0 ? false : _ref$isExternal,
|
|
3478
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
3479
|
+
colorScheme = _ref$colorScheme === void 0 ? '#0072F5' : _ref$colorScheme,
|
|
3480
|
+
_ref$styles = _ref.styles,
|
|
3481
|
+
styles = _ref$styles === void 0 ? {
|
|
3482
|
+
icon: {},
|
|
3483
|
+
text: {}
|
|
3484
|
+
} : _ref$styles,
|
|
3485
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
3486
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3487
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
3488
|
+
var handleHover = function handleHover() {
|
|
3489
|
+
if (underline === 'hover') setIsHovered(true);
|
|
3490
|
+
};
|
|
3491
|
+
return /*#__PURE__*/React.createElement(Link$2, {
|
|
3492
|
+
to: href,
|
|
3493
|
+
target: isExternal ? '_blank' : '_self'
|
|
3494
|
+
}, /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
3495
|
+
color: colorScheme,
|
|
3496
|
+
onMouseEnter: handleHover,
|
|
3497
|
+
onMouseLeave: handleHover,
|
|
3498
|
+
textDecoration: isHovered || underline === 'underline' ? 'underline !important' : 'none'
|
|
3499
|
+
}, styles.text, props), /*#__PURE__*/React.createElement(Horizontal$1, {
|
|
3500
|
+
gap: 3,
|
|
3501
|
+
alignItems: "center",
|
|
3502
|
+
wrap: "nowrap"
|
|
3503
|
+
}, children, isExternal && /*#__PURE__*/React.createElement(ExternalLinkSvg, {
|
|
3504
|
+
color: colorScheme,
|
|
3505
|
+
size: IconSizes$4[iconSize],
|
|
3506
|
+
style: styles.icon
|
|
3507
|
+
}))));
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
var LinkComponent = function LinkComponent(props) {
|
|
3511
|
+
var linkStates = useLinkState();
|
|
3512
|
+
return /*#__PURE__*/React.createElement(LinkView, Object.assign({}, linkStates, props));
|
|
3513
|
+
};
|
|
3514
|
+
/**
|
|
3515
|
+
* Link allows users to navigate from page to page. It have a similar appearance as the hyperlink.
|
|
3516
|
+
*/
|
|
3517
|
+
var Link = LinkComponent;
|
|
3518
|
+
|
|
3519
|
+
var DefaultSizes = {
|
|
3520
|
+
xs: 14,
|
|
3521
|
+
sm: 18,
|
|
3522
|
+
md: 22,
|
|
3523
|
+
lg: 26,
|
|
3524
|
+
xl: 30,
|
|
3525
|
+
'2xl': 40,
|
|
3526
|
+
'3xl': 50,
|
|
3527
|
+
'4xl': 60,
|
|
3528
|
+
'5xl': 70,
|
|
3529
|
+
'6xl': 80
|
|
3530
|
+
};
|
|
3531
|
+
var DefaultSpeeds = {
|
|
3532
|
+
fast: 50,
|
|
3533
|
+
normal: 100,
|
|
3534
|
+
slow: 300
|
|
3535
|
+
};
|
|
3536
|
+
|
|
3537
|
+
var _excluded$d = ["size", "speed", "color"],
|
|
3538
|
+
_excluded2$1 = ["size", "speed", "color"],
|
|
3539
|
+
_excluded3$1 = ["size", "speed", "color"],
|
|
3540
|
+
_excluded4$1 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
|
|
3541
|
+
var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
3542
|
+
var _ref$size = _ref.size,
|
|
3543
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3544
|
+
_ref$speed = _ref.speed,
|
|
3545
|
+
speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
|
|
3546
|
+
_ref$color = _ref.color,
|
|
3547
|
+
color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
|
|
3548
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
3549
|
+
var theme = useTheme();
|
|
3550
|
+
var colorStyle = theme.getColor(color);
|
|
3551
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3552
|
+
var _useState = useState(0),
|
|
3553
|
+
angle = _useState[0],
|
|
3554
|
+
setAngle = _useState[1];
|
|
3555
|
+
useEffect(function () {
|
|
3556
|
+
var intervalId = setInterval(function () {
|
|
3557
|
+
setAngle(function (prevAngle) {
|
|
3558
|
+
return prevAngle + 45;
|
|
3559
|
+
});
|
|
3560
|
+
}, DefaultSpeeds[speed]);
|
|
3561
|
+
return function () {
|
|
3562
|
+
return clearInterval(intervalId);
|
|
3563
|
+
};
|
|
3564
|
+
}, [speed]);
|
|
3565
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
3566
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3567
|
+
width: sizeStyle + "px",
|
|
3568
|
+
height: sizeStyle + "px",
|
|
3569
|
+
viewBox: "0 0 24 24",
|
|
3570
|
+
fill: "none",
|
|
3571
|
+
stroke: colorStyle,
|
|
3572
|
+
strokeWidth: "2",
|
|
3573
|
+
strokeLinecap: "round",
|
|
3574
|
+
strokeLinejoin: "round",
|
|
3575
|
+
style: {
|
|
3576
|
+
transform: "rotate(" + angle + "deg)"
|
|
3577
|
+
}
|
|
3578
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
3579
|
+
id: "SVGRepo_bgCarrier",
|
|
3580
|
+
strokeWidth: "0"
|
|
3581
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
3582
|
+
id: "SVGRepo_tracerCarrier",
|
|
3583
|
+
strokeLinecap: "round",
|
|
3584
|
+
strokeLinejoin: "round"
|
|
3585
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
3586
|
+
id: "SVGRepo_iconCarrier"
|
|
3587
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3588
|
+
d: "M21 12a9 9 0 11-6.219-8.56"
|
|
3589
|
+
})));
|
|
3590
|
+
};
|
|
3591
|
+
var Dotted = function Dotted(_ref2) {
|
|
3592
|
+
var _ref2$size = _ref2.size,
|
|
3593
|
+
size = _ref2$size === void 0 ? 'md' : _ref2$size,
|
|
3594
|
+
_ref2$speed = _ref2.speed,
|
|
3595
|
+
speed = _ref2$speed === void 0 ? 'normal' : _ref2$speed,
|
|
3596
|
+
_ref2$color = _ref2.color,
|
|
3597
|
+
color = _ref2$color === void 0 ? 'theme.loading' : _ref2$color,
|
|
3598
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
|
|
3599
|
+
var theme = useTheme();
|
|
3600
|
+
var colorStyle = theme.getColor(color);
|
|
3601
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3602
|
+
var _useState2 = useState(0),
|
|
3603
|
+
angle = _useState2[0],
|
|
3604
|
+
setAngle = _useState2[1];
|
|
3605
|
+
useEffect(function () {
|
|
3606
|
+
var intervalId = setInterval(function () {
|
|
3607
|
+
setAngle(function (prevAngle) {
|
|
3608
|
+
return prevAngle + 45;
|
|
3609
|
+
});
|
|
3610
|
+
}, DefaultSpeeds[speed]);
|
|
3611
|
+
return function () {
|
|
3612
|
+
return clearInterval(intervalId);
|
|
3613
|
+
};
|
|
3614
|
+
}, [speed]);
|
|
3615
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
3616
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3617
|
+
viewBox: "0 0 50 50",
|
|
3618
|
+
width: sizeStyle + "px",
|
|
3619
|
+
height: sizeStyle + "px",
|
|
3620
|
+
style: {
|
|
3621
|
+
transform: "rotate(" + angle + "deg)"
|
|
3622
|
+
}
|
|
3623
|
+
}, props), /*#__PURE__*/React.createElement("circle", {
|
|
3624
|
+
cx: "10",
|
|
3625
|
+
cy: "25",
|
|
3626
|
+
r: "4",
|
|
3627
|
+
fill: colorStyle
|
|
3628
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
3629
|
+
cx: "25",
|
|
3630
|
+
cy: "25",
|
|
3631
|
+
r: "4",
|
|
3632
|
+
fill: colorStyle
|
|
3633
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
3634
|
+
cx: "40",
|
|
3635
|
+
cy: "25",
|
|
3636
|
+
r: "4",
|
|
3637
|
+
fill: colorStyle
|
|
3638
|
+
}));
|
|
3639
|
+
};
|
|
3640
|
+
var Quarter = function Quarter(_ref3) {
|
|
3641
|
+
var _ref3$size = _ref3.size,
|
|
3642
|
+
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
3643
|
+
_ref3$speed = _ref3.speed,
|
|
3644
|
+
speed = _ref3$speed === void 0 ? 'normal' : _ref3$speed,
|
|
3645
|
+
_ref3$color = _ref3.color,
|
|
3646
|
+
color = _ref3$color === void 0 ? 'theme.loading' : _ref3$color,
|
|
3647
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
3648
|
+
var theme = useTheme();
|
|
3649
|
+
var colorStyle = theme.getColor(color);
|
|
3650
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
3651
|
+
var _useState3 = useState(0),
|
|
3652
|
+
angle = _useState3[0],
|
|
3653
|
+
setAngle = _useState3[1];
|
|
3654
|
+
useEffect(function () {
|
|
3655
|
+
var intervalId = setInterval(function () {
|
|
3656
|
+
setAngle(function (prevAngle) {
|
|
3657
|
+
return prevAngle + 45;
|
|
3658
|
+
});
|
|
3659
|
+
}, DefaultSpeeds[speed]);
|
|
3660
|
+
return function () {
|
|
3661
|
+
return clearInterval(intervalId);
|
|
3662
|
+
};
|
|
3663
|
+
}, [speed]);
|
|
3664
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
3665
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3666
|
+
viewBox: "0 0 50 50",
|
|
3667
|
+
width: sizeStyle + "px",
|
|
3668
|
+
height: sizeStyle + "px",
|
|
3669
|
+
style: {
|
|
3670
|
+
transform: "rotate(" + angle + "deg)"
|
|
3671
|
+
}
|
|
3672
|
+
}, props), /*#__PURE__*/React.createElement("circle", {
|
|
3673
|
+
cx: "25",
|
|
3674
|
+
cy: "25",
|
|
3675
|
+
r: "20",
|
|
3676
|
+
fill: "none",
|
|
3677
|
+
stroke: colorStyle,
|
|
3678
|
+
strokeWidth: "5",
|
|
3679
|
+
strokeDasharray: "1,10"
|
|
3680
|
+
}));
|
|
3681
|
+
};
|
|
3682
|
+
var LoaderView = function LoaderView(_ref4) {
|
|
3683
|
+
var size = _ref4.size,
|
|
3684
|
+
children = _ref4.children,
|
|
3685
|
+
textColor = _ref4.textColor,
|
|
3686
|
+
loaderColor = _ref4.loaderColor,
|
|
3687
|
+
_ref4$type = _ref4.type,
|
|
3688
|
+
type = _ref4$type === void 0 ? 'default' : _ref4$type,
|
|
3689
|
+
_ref4$speed = _ref4.speed,
|
|
3690
|
+
speed = _ref4$speed === void 0 ? 'normal' : _ref4$speed,
|
|
3691
|
+
_ref4$textPosition = _ref4.textPosition,
|
|
3692
|
+
textPosition = _ref4$textPosition === void 0 ? 'right' : _ref4$textPosition,
|
|
3693
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$1);
|
|
3694
|
+
var style = {
|
|
3695
|
+
size: size,
|
|
3696
|
+
speed: speed,
|
|
3697
|
+
color: loaderColor
|
|
3698
|
+
};
|
|
3699
|
+
var variants = {
|
|
3700
|
+
default: /*#__PURE__*/React.createElement(DefaultSpinner, Object.assign({}, style)),
|
|
3701
|
+
dotted: /*#__PURE__*/React.createElement(Dotted, Object.assign({}, style)),
|
|
3702
|
+
quarter: /*#__PURE__*/React.createElement(Quarter, Object.assign({}, style))
|
|
3703
|
+
};
|
|
3704
|
+
return /*#__PURE__*/React.createElement(Center$1, Object.assign({
|
|
3705
|
+
gap: 10,
|
|
3706
|
+
flexDirection: textPosition === 'top' || textPosition === 'bottom' ? 'column' : 'row'
|
|
3707
|
+
}, props), (textPosition === 'left' || textPosition === 'top') && children && /*#__PURE__*/React.createElement(View, {
|
|
3708
|
+
color: textColor
|
|
3709
|
+
}, children), variants[type], (textPosition === 'right' || textPosition === 'bottom') && children && /*#__PURE__*/React.createElement(View, {
|
|
3710
|
+
color: textColor
|
|
3711
|
+
}, children));
|
|
3712
|
+
};
|
|
3713
|
+
|
|
3714
|
+
var LoadingComponent = function LoadingComponent(props) {
|
|
3715
|
+
return /*#__PURE__*/React.createElement(LoaderView, Object.assign({}, props));
|
|
3716
|
+
};
|
|
3717
|
+
/**
|
|
3718
|
+
* It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
|
|
3719
|
+
*/
|
|
3720
|
+
var Loading = LoadingComponent;
|
|
3721
|
+
|
|
3722
|
+
var ContainerShapes = {
|
|
3723
|
+
sharp: {
|
|
3724
|
+
borderRadius: 0
|
|
3725
|
+
},
|
|
3726
|
+
rounded: {
|
|
3727
|
+
borderRadius: 4
|
|
3728
|
+
}
|
|
3729
|
+
};
|
|
3730
|
+
var OverlayAlignments = {
|
|
3731
|
+
center: {
|
|
3732
|
+
justifyContent: 'center',
|
|
3733
|
+
alignItems: 'center'
|
|
3734
|
+
},
|
|
3735
|
+
top: {
|
|
3736
|
+
justifyContent: 'center'
|
|
3737
|
+
},
|
|
3738
|
+
right: {
|
|
3739
|
+
justifyContent: 'flex-end',
|
|
3740
|
+
alignItems: 'center'
|
|
3741
|
+
},
|
|
3742
|
+
bottom: {
|
|
3743
|
+
justifyContent: 'center',
|
|
3744
|
+
alignItems: 'flex-end'
|
|
3745
|
+
},
|
|
3746
|
+
left: {
|
|
3747
|
+
alignItems: 'center'
|
|
3748
|
+
}
|
|
3749
|
+
};
|
|
3750
|
+
var HeaderIconSizes = {
|
|
3751
|
+
xs: 12,
|
|
3752
|
+
sm: 16,
|
|
3753
|
+
md: 20,
|
|
3754
|
+
lg: 24,
|
|
3755
|
+
xl: 28
|
|
3756
|
+
};
|
|
3757
|
+
|
|
3758
|
+
var _excluded$e = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
|
|
3759
|
+
_excluded2$2 = ["children", "shadow", "isFullScreen", "shape"],
|
|
3760
|
+
_excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
|
|
3761
|
+
_excluded4$2 = ["children"],
|
|
3762
|
+
_excluded5 = ["children"];
|
|
3763
|
+
var ModalOverlay = function ModalOverlay(_ref) {
|
|
3764
|
+
var children = _ref.children,
|
|
3765
|
+
blur = _ref.blur,
|
|
3766
|
+
_ref$isOpen = _ref.isOpen,
|
|
3767
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
3768
|
+
_ref$isClosePrevented = _ref.isClosePrevented,
|
|
3769
|
+
isClosePrevented = _ref$isClosePrevented === void 0 ? false : _ref$isClosePrevented,
|
|
3770
|
+
_ref$onClose = _ref.onClose,
|
|
3771
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
3772
|
+
_ref$position = _ref.position,
|
|
3773
|
+
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
3774
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
3775
|
+
var setOpen = useModalStore(function (state) {
|
|
3776
|
+
return state.setOpen;
|
|
3777
|
+
});
|
|
3778
|
+
var setOnClose = useModalStore(function (state) {
|
|
3779
|
+
return state.setOnClose;
|
|
3780
|
+
});
|
|
3781
|
+
useEffect(function () {
|
|
3782
|
+
setOnClose(onClose);
|
|
3783
|
+
if (isOpen) setOpen();
|
|
3784
|
+
});
|
|
3785
|
+
if (!isOpen) return null;
|
|
3786
|
+
var handleClick = function handleClick() {
|
|
3787
|
+
if (!isClosePrevented) onClose();
|
|
3788
|
+
};
|
|
3789
|
+
return /*#__PURE__*/React.createElement(Center$1, {
|
|
3790
|
+
position: "fixed",
|
|
3791
|
+
top: 0,
|
|
3792
|
+
left: 0,
|
|
3793
|
+
width: "100%",
|
|
3794
|
+
height: "100%",
|
|
3795
|
+
zIndex: 1000,
|
|
3796
|
+
onClick: handleClick,
|
|
3797
|
+
visibility: isOpen ? 'visible' : 'hidden'
|
|
3798
|
+
}, /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
3799
|
+
cursor: "pointer",
|
|
3800
|
+
position: "absolute",
|
|
3801
|
+
top: 0,
|
|
3802
|
+
left: 0,
|
|
3803
|
+
zIndex: 1000,
|
|
3804
|
+
width: "100vw",
|
|
3805
|
+
height: "100vh",
|
|
3806
|
+
display: "flex",
|
|
3807
|
+
backgroundColor: "blackAlpha.500",
|
|
3808
|
+
backdropFilter: blur ? "blur(" + blur + "px)" : undefined,
|
|
3809
|
+
onClick: handleClick
|
|
3810
|
+
}, OverlayAlignments[position], props), children));
|
|
3811
|
+
};
|
|
3812
|
+
var ModalContainer = function ModalContainer(_ref2) {
|
|
3813
|
+
var children = _ref2.children,
|
|
3814
|
+
shadow = _ref2.shadow,
|
|
3815
|
+
_ref2$isFullScreen = _ref2.isFullScreen,
|
|
3816
|
+
isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen,
|
|
3817
|
+
_ref2$shape = _ref2.shape,
|
|
3818
|
+
shape = _ref2$shape === void 0 ? 'rounded' : _ref2$shape,
|
|
3819
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
3820
|
+
var defaultShadow = typeof document !== undefined ? {
|
|
3821
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.3)'
|
|
3822
|
+
} : {
|
|
3823
|
+
elevation: 5,
|
|
3824
|
+
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
3825
|
+
shadowOffset: {
|
|
3826
|
+
width: 0,
|
|
3827
|
+
height: 2
|
|
3828
|
+
},
|
|
3829
|
+
shadowOpacity: 1,
|
|
3830
|
+
shadowRadius: 8
|
|
3831
|
+
};
|
|
3832
|
+
var handleClick = function handleClick(event) {
|
|
3833
|
+
return event.stopPropagation();
|
|
3834
|
+
};
|
|
3835
|
+
return /*#__PURE__*/React.createElement(Vertical$1, Object.assign({
|
|
3836
|
+
cursor: "default",
|
|
3837
|
+
overflow: "hidden",
|
|
3838
|
+
backgroundColor: "white",
|
|
3839
|
+
width: isFullScreen ? '100%' : 600,
|
|
3840
|
+
height: isFullScreen ? '100%' : 'fit-content',
|
|
3841
|
+
onClick: handleClick
|
|
3842
|
+
}, shadow ? shadow : defaultShadow, ContainerShapes[shape], props), children);
|
|
3843
|
+
};
|
|
3844
|
+
var ModalHeader = function ModalHeader(_ref3) {
|
|
3845
|
+
var children = _ref3.children,
|
|
3846
|
+
_ref3$buttonColor = _ref3.buttonColor,
|
|
3847
|
+
buttonColor = _ref3$buttonColor === void 0 ? 'theme.primary' : _ref3$buttonColor,
|
|
3848
|
+
_ref3$iconSize = _ref3.iconSize,
|
|
3849
|
+
iconSize = _ref3$iconSize === void 0 ? 'md' : _ref3$iconSize,
|
|
3850
|
+
_ref3$buttonPosition = _ref3.buttonPosition,
|
|
3851
|
+
buttonPosition = _ref3$buttonPosition === void 0 ? 'right' : _ref3$buttonPosition,
|
|
3852
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$2);
|
|
3853
|
+
var onClose = useModalStore(function (state) {
|
|
3854
|
+
return state.onClose;
|
|
3855
|
+
});
|
|
3856
|
+
var buttonIcon = /*#__PURE__*/React.createElement(Button$1, {
|
|
3857
|
+
onClick: onClose,
|
|
3858
|
+
colorScheme: "transparent",
|
|
3859
|
+
icon: /*#__PURE__*/React.createElement(CloseSvg, {
|
|
3860
|
+
size: HeaderIconSizes[iconSize],
|
|
3861
|
+
color: buttonColor
|
|
3862
|
+
}),
|
|
3863
|
+
padding: 0,
|
|
3864
|
+
margin: 0,
|
|
3865
|
+
filter: "none",
|
|
3866
|
+
isAuto: true
|
|
3867
|
+
});
|
|
3868
|
+
return /*#__PURE__*/React.createElement(Horizontal$1, Object.assign({
|
|
3869
|
+
justifyContent: buttonPosition === 'none' ? 'center' : 'space-between',
|
|
3870
|
+
alignItems: "center",
|
|
3871
|
+
paddingVertical: 15,
|
|
3872
|
+
paddingHorizontal: 20
|
|
3873
|
+
}, props), buttonPosition === 'left' && buttonIcon, children, buttonPosition === 'right' && buttonIcon);
|
|
3874
|
+
};
|
|
3875
|
+
var ModalBody = function ModalBody(_ref4) {
|
|
3876
|
+
var children = _ref4.children,
|
|
3877
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$2);
|
|
3878
|
+
var defaultBorder = {
|
|
3879
|
+
borderBottomWidth: 2,
|
|
3880
|
+
borderTopWidth: 2,
|
|
3881
|
+
borderColor: 'rgba(250, 250, 250, 1)',
|
|
3882
|
+
borderStyle: 'solid'
|
|
3883
|
+
};
|
|
3884
|
+
return /*#__PURE__*/React.createElement(View$1, Object.assign({
|
|
3885
|
+
overflowY: "auto",
|
|
3886
|
+
paddingVertical: 15,
|
|
3887
|
+
paddingHorizontal: 20
|
|
3888
|
+
}, defaultBorder, props), children);
|
|
3889
|
+
};
|
|
3890
|
+
var ModalFooter = function ModalFooter(_ref5) {
|
|
3891
|
+
var children = _ref5.children,
|
|
3892
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
3893
|
+
return /*#__PURE__*/React.createElement(Horizontal$1, Object.assign({
|
|
3894
|
+
marginTop: "auto",
|
|
3895
|
+
alignItems: "center",
|
|
3896
|
+
justifyContent: "flex-end",
|
|
3897
|
+
paddingVertical: 15,
|
|
3898
|
+
paddingHorizontal: 20
|
|
3899
|
+
}, props), children);
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3902
|
+
/**
|
|
3903
|
+
* It is a custom content overlay that appears on top of the main screen.
|
|
3904
|
+
*/
|
|
3905
|
+
// eslint-disable-next-line react/prop-types
|
|
3906
|
+
var Modal = function Modal(_ref) {
|
|
3907
|
+
var children = _ref.children;
|
|
3908
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
3909
|
+
};
|
|
3910
|
+
Modal.Overlay = ModalOverlay;
|
|
3911
|
+
Modal.Container = ModalContainer;
|
|
3912
|
+
Modal.Header = ModalHeader;
|
|
3913
|
+
Modal.Body = ModalBody;
|
|
3914
|
+
Modal.Footer = ModalFooter;
|
|
3915
|
+
|
|
3916
|
+
var HeadingSizes = {
|
|
3917
|
+
h1: {
|
|
3918
|
+
fontSize: 96,
|
|
3919
|
+
lineHeight: 112,
|
|
3920
|
+
letterSpacing: -1.5
|
|
3921
|
+
},
|
|
3922
|
+
h2: {
|
|
3923
|
+
fontSize: 60,
|
|
3924
|
+
lineHeight: 71,
|
|
3925
|
+
letterSpacing: -0.5
|
|
3926
|
+
},
|
|
3927
|
+
h3: {
|
|
3928
|
+
fontSize: 48,
|
|
3929
|
+
lineHeight: 57,
|
|
3930
|
+
letterSpacing: 0
|
|
3931
|
+
},
|
|
3932
|
+
h4: {
|
|
3933
|
+
fontSize: 34,
|
|
3934
|
+
lineHeight: 40,
|
|
3935
|
+
letterSpacing: 0.25
|
|
3936
|
+
},
|
|
3937
|
+
h5: {
|
|
3938
|
+
fontSize: 24,
|
|
3939
|
+
lineHeight: 28,
|
|
3940
|
+
letterSpacing: 0
|
|
3941
|
+
},
|
|
3942
|
+
h6: {
|
|
3943
|
+
fontSize: 20,
|
|
3944
|
+
lineHeight: 24,
|
|
3945
|
+
letterSpacing: 0.15
|
|
3946
|
+
}
|
|
3947
|
+
};
|
|
3948
|
+
|
|
3949
|
+
var _excluded$f = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
|
|
3950
|
+
var TextContent = function TextContent(_ref) {
|
|
3951
|
+
var children = _ref.children,
|
|
3952
|
+
isSub = _ref.isSub,
|
|
3953
|
+
isSup = _ref.isSup;
|
|
3954
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, typeof children === 'string' ? /*#__PURE__*/React.createElement(React.Fragment, null, isSub && /*#__PURE__*/React.createElement("sup", null, children), isSup && /*#__PURE__*/React.createElement("sup", null, children), !isSub && !isSup && /*#__PURE__*/React.createElement(React.Fragment, null, children)) : children);
|
|
3955
|
+
};
|
|
3956
|
+
var TruncateText = function TruncateText(_ref2) {
|
|
3957
|
+
var text = _ref2.text,
|
|
3958
|
+
_ref2$maxLines = _ref2.maxLines,
|
|
3959
|
+
maxLines = _ref2$maxLines === void 0 ? 1 : _ref2$maxLines;
|
|
3960
|
+
var containerRef = useRef(null);
|
|
3961
|
+
var _useState = useState(text),
|
|
3962
|
+
content = _useState[0],
|
|
3963
|
+
setContent = _useState[1];
|
|
3964
|
+
useEffect(function () {
|
|
3965
|
+
var textContent = content;
|
|
3966
|
+
var textNode = containerRef.current;
|
|
3967
|
+
if (textNode) {
|
|
3968
|
+
var contentHeight = textNode.offsetHeight;
|
|
3969
|
+
var comLineHeight = getComputedStyle(textNode).lineHeight;
|
|
3970
|
+
var lineHeight = comLineHeight !== 'normal' ? parseFloat(comLineHeight) : 20;
|
|
3971
|
+
var maxHeight = Math.ceil(lineHeight * maxLines);
|
|
3972
|
+
if (contentHeight > maxHeight) {
|
|
3973
|
+
textContent = textContent.slice(0, -1);
|
|
3974
|
+
} else if (contentHeight === maxHeight) {
|
|
3975
|
+
if (content.length !== text.length) {
|
|
3976
|
+
textContent = textContent.slice(0, -3) + '...';
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
setContent(textContent);
|
|
3980
|
+
}
|
|
3981
|
+
}, [maxLines, text, containerRef, content]);
|
|
3982
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3983
|
+
ref: containerRef
|
|
3984
|
+
}, content);
|
|
3985
|
+
};
|
|
3986
|
+
var TextView = function TextView(_ref3) {
|
|
3987
|
+
var children = _ref3.children,
|
|
3988
|
+
heading = _ref3.heading,
|
|
3989
|
+
maxLines = _ref3.maxLines,
|
|
3990
|
+
_ref3$isItalic = _ref3.isItalic,
|
|
3991
|
+
isItalic = _ref3$isItalic === void 0 ? false : _ref3$isItalic,
|
|
3992
|
+
_ref3$isUnderlined = _ref3.isUnderlined,
|
|
3993
|
+
isUnderlined = _ref3$isUnderlined === void 0 ? false : _ref3$isUnderlined,
|
|
3994
|
+
_ref3$isSub = _ref3.isSub,
|
|
3995
|
+
isSub = _ref3$isSub === void 0 ? false : _ref3$isSub,
|
|
3996
|
+
_ref3$isSup = _ref3.isSup,
|
|
3997
|
+
isSup = _ref3$isSup === void 0 ? false : _ref3$isSup,
|
|
3998
|
+
_ref3$isStriked = _ref3.isStriked,
|
|
3999
|
+
isStriked = _ref3$isStriked === void 0 ? false : _ref3$isStriked,
|
|
4000
|
+
_ref3$isTruncated = _ref3.isTruncated,
|
|
4001
|
+
isTruncated = _ref3$isTruncated === void 0 ? false : _ref3$isTruncated,
|
|
4002
|
+
_ref3$weight = _ref3.weight,
|
|
4003
|
+
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
|
|
4004
|
+
_ref3$size = _ref3.size,
|
|
4005
|
+
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
4006
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$f);
|
|
4007
|
+
var headingStyles = heading ? HeadingSizes[heading] : {};
|
|
4008
|
+
var noLineBreak = isSub || isSup ? {
|
|
4009
|
+
display: 'inline'
|
|
4010
|
+
} : {};
|
|
4011
|
+
var fontSize = Typography.fontSizes[size];
|
|
4012
|
+
return /*#__PURE__*/React.createElement(Element, Object.assign({
|
|
4013
|
+
role: "text",
|
|
4014
|
+
fontSize: fontSize,
|
|
4015
|
+
lineHeight: Typography.lineHeights[size],
|
|
4016
|
+
fontStyle: isItalic ? 'italic' : 'normal',
|
|
4017
|
+
fontWeight: Typography.fontWeights[weight],
|
|
4018
|
+
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
|
|
4019
|
+
}, noLineBreak, headingStyles, props), isTruncated && maxLines && typeof children === 'string' ? /*#__PURE__*/React.createElement(TruncateText, {
|
|
4020
|
+
text: children,
|
|
4021
|
+
maxLines: maxLines
|
|
4022
|
+
}) : /*#__PURE__*/React.createElement(TextContent, Object.assign({
|
|
4023
|
+
isSub: isSub,
|
|
4024
|
+
isSup: isSup
|
|
4025
|
+
}, props), children));
|
|
4026
|
+
};
|
|
4027
|
+
|
|
4028
|
+
var TextComponent = function TextComponent(props) {
|
|
4029
|
+
return /*#__PURE__*/React.createElement(TextView, Object.assign({}, props));
|
|
4030
|
+
};
|
|
4031
|
+
/**
|
|
4032
|
+
* The Text component is a simple component that renders a text string or paragraphs as a DOM element in the UI. It is a <p> tag by default.
|
|
4033
|
+
*/
|
|
4034
|
+
var Text = TextComponent;
|
|
4035
|
+
|
|
4036
|
+
export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loading, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
|
|
18
4037
|
//# sourceMappingURL=web.esm.js.map
|