@app-studio/web 0.1.16 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/StyleGuideWrapper.d.ts +1 -1
  2. package/dist/components/Button/Button/Button.props.d.ts +1 -1
  3. package/dist/components/Button/examples/AutoFocusButton.d.ts +2 -2
  4. package/dist/components/Button/examples/BorderedButtons.d.ts +2 -2
  5. package/dist/components/Button/examples/ColoredButtons.d.ts +2 -2
  6. package/dist/components/Button/examples/DefaultButton.d.ts +2 -2
  7. package/dist/components/Button/examples/DisabledButton.d.ts +2 -2
  8. package/dist/components/Button/examples/IconButtons.d.ts +2 -2
  9. package/dist/components/Button/examples/LoaderButtons.d.ts +2 -0
  10. package/dist/components/Button/examples/ShadowButton.d.ts +2 -2
  11. package/dist/components/Button/examples/SizeButtons.d.ts +2 -2
  12. package/dist/components/Button/examples/VariantButtons.d.ts +2 -2
  13. package/dist/components/Button/examples/index.d.ts +1 -1
  14. package/dist/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -1
  15. package/dist/components/Form/Checkbox/examples/ColorScheme.d.ts +2 -2
  16. package/dist/components/Form/Checkbox/examples/Default.d.ts +2 -2
  17. package/dist/components/Form/Checkbox/examples/DisabledInput.d.ts +2 -2
  18. package/dist/components/Form/Checkbox/examples/ErrorCheckbox.d.ts +2 -2
  19. package/dist/components/Form/Checkbox/examples/FormCheckout.d.ts +2 -2
  20. package/dist/components/Form/Checkbox/examples/IconCheckbox.d.ts +2 -2
  21. package/dist/components/Form/Checkbox/examples/IndeterminateCheckbox.d.ts +2 -2
  22. package/dist/components/Form/Checkbox/examples/ReadOnlyInput.d.ts +2 -2
  23. package/dist/components/Form/Checkbox/examples/Shadow.d.ts +2 -2
  24. package/dist/components/Form/Checkbox/examples/SizeInput.d.ts +2 -2
  25. package/dist/components/Form/Checkbox/examples/StylesInput.d.ts +2 -2
  26. package/dist/components/Form/CountryPicker/CountryPicker/CountryPicker.props.d.ts +1 -1
  27. package/dist/components/Form/CountryPicker/examples/Color.d.ts +2 -2
  28. package/dist/components/Form/CountryPicker/examples/Default.d.ts +2 -2
  29. package/dist/components/Form/CountryPicker/examples/Disabled.d.ts +2 -2
  30. package/dist/components/Form/CountryPicker/examples/Error.d.ts +2 -2
  31. package/dist/components/Form/CountryPicker/examples/Form.d.ts +2 -2
  32. package/dist/components/Form/CountryPicker/examples/Formik.d.ts +2 -2
  33. package/dist/components/Form/CountryPicker/examples/HelperText.d.ts +2 -2
  34. package/dist/components/Form/CountryPicker/examples/ReadOnlyInput.d.ts +2 -2
  35. package/dist/components/Form/CountryPicker/examples/Shadow.d.ts +2 -2
  36. package/dist/components/Form/CountryPicker/examples/Shape.d.ts +2 -2
  37. package/dist/components/Form/CountryPicker/examples/SizeInput.d.ts +2 -2
  38. package/dist/components/Form/CountryPicker/examples/StylesInput.d.ts +2 -2
  39. package/dist/components/Form/CountryPicker/examples/Variant.d.ts +2 -2
  40. package/dist/components/Form/DatePicker/DatePicker/DatePicker.props.d.ts +1 -1
  41. package/dist/components/Form/DatePicker/examples/ColorScheme.d.ts +2 -2
  42. package/dist/components/Form/DatePicker/examples/Default.d.ts +2 -2
  43. package/dist/components/Form/DatePicker/examples/DisabledInput.d.ts +2 -2
  44. package/dist/components/Form/DatePicker/examples/ErrorCheckbox.d.ts +2 -2
  45. package/dist/components/Form/DatePicker/examples/FormCheckout.d.ts +2 -2
  46. package/dist/components/Form/DatePicker/examples/Formik.d.ts +2 -2
  47. package/dist/components/Form/DatePicker/examples/ReadOnlyInput.d.ts +2 -2
  48. package/dist/components/Form/DatePicker/examples/Shadow.d.ts +2 -2
  49. package/dist/components/Form/DatePicker/examples/SizeInput.d.ts +2 -2
  50. package/dist/components/Form/DatePicker/examples/StylesInput.d.ts +2 -2
  51. package/dist/components/Form/DatePicker/examples/helperTextDatePicker.d.ts +2 -2
  52. package/dist/components/Form/Password/example/Default.d.ts +2 -2
  53. package/dist/components/Form/Password/example/DisabledInput.d.ts +2 -2
  54. package/dist/components/Form/Password/example/ErrorInput.d.ts +2 -2
  55. package/dist/components/Form/Password/example/FormikErrorInput.d.ts +2 -2
  56. package/dist/components/Form/Password/example/FormikHelperText.d.ts +2 -2
  57. package/dist/components/Form/Password/example/HelperText.d.ts +2 -2
  58. package/dist/components/Form/Select/Select/Select.props.d.ts +1 -1
  59. package/dist/components/Form/Select/examples/Color.d.ts +2 -2
  60. package/dist/components/Form/Select/examples/Default.d.ts +2 -2
  61. package/dist/components/Form/Select/examples/Disabled.d.ts +2 -2
  62. package/dist/components/Form/Select/examples/Error.d.ts +2 -2
  63. package/dist/components/Form/Select/examples/Form.d.ts +2 -2
  64. package/dist/components/Form/Select/examples/Formik.d.ts +2 -2
  65. package/dist/components/Form/Select/examples/HelperText.d.ts +2 -2
  66. package/dist/components/Form/Select/examples/Multiple.d.ts +2 -2
  67. package/dist/components/Form/Select/examples/ReadOnlyInput.d.ts +2 -2
  68. package/dist/components/Form/Select/examples/Shadow.d.ts +2 -2
  69. package/dist/components/Form/Select/examples/SizeInput.d.ts +2 -2
  70. package/dist/components/Form/Select/examples/StylesInput.d.ts +2 -2
  71. package/dist/components/Form/Switch/Switch/Switch.props.d.ts +1 -1
  72. package/dist/components/Form/Switch/examples/ChildSwitch.d.ts +2 -2
  73. package/dist/components/Form/Switch/examples/ColorScheme.d.ts +2 -2
  74. package/dist/components/Form/Switch/examples/Default.d.ts +2 -2
  75. package/dist/components/Form/Switch/examples/DisabledInput.d.ts +2 -2
  76. package/dist/components/Form/Switch/examples/FormSwitch.d.ts +2 -2
  77. package/dist/components/Form/Switch/examples/Formik.d.ts +2 -2
  78. package/dist/components/Form/Switch/examples/ReadOnlyInput.d.ts +2 -2
  79. package/dist/components/Form/Switch/examples/Shadow.d.ts +2 -2
  80. package/dist/components/Form/Switch/examples/SizeInput.d.ts +2 -2
  81. package/dist/components/Form/Switch/examples/StylesInput.d.ts +2 -2
  82. package/dist/components/Form/TextArea/TextArea/TextArea.props.d.ts +1 -1
  83. package/dist/components/Form/TextArea/examples/ColorScheme.d.ts +2 -2
  84. package/dist/components/Form/TextArea/examples/Default.d.ts +2 -2
  85. package/dist/components/Form/TextArea/examples/DisabledInput.d.ts +2 -2
  86. package/dist/components/Form/TextArea/examples/ErrorInput.d.ts +2 -2
  87. package/dist/components/Form/TextArea/examples/FormikErrorInput.d.ts +2 -2
  88. package/dist/components/Form/TextArea/examples/FormikHelperText.d.ts +2 -2
  89. package/dist/components/Form/TextArea/examples/HelperText.d.ts +2 -2
  90. package/dist/components/Form/TextArea/examples/LabelInput.d.ts +2 -2
  91. package/dist/components/Form/TextArea/examples/MaxRowCol.d.ts +2 -2
  92. package/dist/components/Form/TextArea/examples/Placeholder.d.ts +2 -2
  93. package/dist/components/Form/TextArea/examples/ReadOnlyInput.d.ts +2 -2
  94. package/dist/components/Form/TextArea/examples/ShadowArea.d.ts +2 -2
  95. package/dist/components/Form/TextArea/examples/ShapeInput.d.ts +2 -2
  96. package/dist/components/Form/TextArea/examples/SizeInput.d.ts +2 -2
  97. package/dist/components/Form/TextArea/examples/StylesInput.d.ts +2 -2
  98. package/dist/components/Form/TextArea/examples/VariantsInputs.d.ts +2 -2
  99. package/dist/components/Form/TextField/TextField/TextField.props.d.ts +1 -1
  100. package/dist/components/Form/TextField/examples/ClearInput.d.ts +2 -2
  101. package/dist/components/Form/TextField/examples/ColorScheme.d.ts +2 -2
  102. package/dist/components/Form/TextField/examples/Default.d.ts +2 -2
  103. package/dist/components/Form/TextField/examples/DisabledInput.d.ts +2 -2
  104. package/dist/components/Form/TextField/examples/ErrorInput.d.ts +2 -2
  105. package/dist/components/Form/TextField/examples/FormikErrorInput.d.ts +2 -2
  106. package/dist/components/Form/TextField/examples/FormikHelperText.d.ts +2 -2
  107. package/dist/components/Form/TextField/examples/HelperText.d.ts +2 -2
  108. package/dist/components/Form/TextField/examples/LabelInput.d.ts +2 -2
  109. package/dist/components/Form/TextField/examples/LeftChild.d.ts +2 -2
  110. package/dist/components/Form/TextField/examples/Placeholder.d.ts +2 -2
  111. package/dist/components/Form/TextField/examples/ReadOnlyInput.d.ts +2 -2
  112. package/dist/components/Form/TextField/examples/RightChild.d.ts +2 -2
  113. package/dist/components/Form/TextField/examples/ShapeInput.d.ts +2 -2
  114. package/dist/components/Form/TextField/examples/SizeInput.d.ts +2 -2
  115. package/dist/components/Form/TextField/examples/StylesInput.d.ts +2 -2
  116. package/dist/components/Form/TextField/examples/VariantsInputs.d.ts +2 -2
  117. package/dist/components/Layout/Horizontal/examples/Default.d.ts +2 -2
  118. package/dist/components/Layout/Horizontal/examples/Justify.d.ts +2 -2
  119. package/dist/components/Layout/Horizontal/examples/Reversed.d.ts +2 -2
  120. package/dist/components/Layout/Horizontal/examples/Wrap.d.ts +2 -2
  121. package/dist/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -1
  122. package/dist/components/Layout/Vertical/examples/Default.d.ts +2 -2
  123. package/dist/components/Layout/Vertical/examples/Justify.d.ts +2 -2
  124. package/dist/components/Layout/Vertical/examples/Reversed.d.ts +2 -2
  125. package/dist/components/Layout/Vertical/examples/Wrap.d.ts +2 -2
  126. package/dist/components/Link/examples/Default.d.ts +2 -2
  127. package/dist/components/Link/examples/IsExternal.d.ts +2 -2
  128. package/dist/components/Link/examples/Underline.d.ts +2 -2
  129. package/dist/components/Loader/Loader.d.ts +1 -1
  130. package/dist/components/Loader/examples/ColorLoader.d.ts +2 -2
  131. package/dist/components/Loader/examples/DefaultLoader.d.ts +2 -2
  132. package/dist/components/Loader/examples/PositionLoader.d.ts +2 -2
  133. package/dist/components/Loader/examples/SizeLoader.d.ts +2 -2
  134. package/dist/components/Loader/examples/SpeedLoader.d.ts +2 -2
  135. package/dist/components/Loader/examples/TextLoader.d.ts +2 -2
  136. package/dist/components/Loader/examples/VariantLoader.d.ts +2 -2
  137. package/dist/components/Modal/Examples/BlurModal.d.ts +2 -2
  138. package/dist/components/Modal/Examples/CloseButtonModal.d.ts +2 -2
  139. package/dist/components/Modal/Examples/DefaultModal.d.ts +2 -2
  140. package/dist/components/Modal/Examples/FullScreenModal.d.ts +2 -2
  141. package/dist/components/Modal/Examples/ModalPosition.d.ts +2 -2
  142. package/dist/components/Modal/Examples/PreventCloseModal.d.ts +2 -2
  143. package/dist/components/Modal/Examples/ScrollModal.d.ts +2 -2
  144. package/dist/components/Modal/Examples/ShadowModal.d.ts +2 -2
  145. package/dist/components/Modal/Examples/VariantModal.d.ts +2 -2
  146. package/dist/components/Modal/Modal/Modal.props.d.ts +1 -1
  147. package/dist/features.d.ts +2 -2
  148. package/dist/pages/button.page.d.ts +2 -2
  149. package/dist/pages/center.page.d.ts +2 -2
  150. package/dist/pages/checkbox.page.d.ts +2 -2
  151. package/dist/pages/components.page.d.ts +2 -2
  152. package/dist/pages/countryPicker.page.d.ts +2 -2
  153. package/dist/pages/datePicker.page.d.ts +2 -2
  154. package/dist/pages/home.page.d.ts +2 -2
  155. package/dist/pages/horizontal.page.d.ts +2 -2
  156. package/dist/pages/input.page.d.ts +2 -2
  157. package/dist/pages/link.page.d.ts +2 -2
  158. package/dist/pages/loader.page.d.ts +2 -2
  159. package/dist/pages/modal.page.d.ts +2 -2
  160. package/dist/pages/password.page.d.ts +2 -2
  161. package/dist/pages/select.page.d.ts +2 -2
  162. package/dist/pages/switch.page.d.ts +2 -2
  163. package/dist/pages/text.page.d.ts +2 -2
  164. package/dist/pages/textArea.page.d.ts +2 -2
  165. package/dist/pages/vertical.page.d.ts +2 -2
  166. package/dist/routes/routes.d.ts +2 -2
  167. package/dist/web.cjs.development.js +459 -459
  168. package/dist/web.cjs.development.js.map +1 -1
  169. package/dist/web.cjs.production.min.js +1 -1
  170. package/dist/web.cjs.production.min.js.map +1 -1
  171. package/dist/web.esm.js +460 -460
  172. package/dist/web.esm.js.map +1 -1
  173. package/package.json +1 -2
  174. package/dist/components/Button/examples/LoadingButtons.d.ts +0 -2
package/dist/web.esm.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import 'core-js/modules/es6.object.assign.js';
2
- import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
2
+ import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
3
3
  import { View, Element, Typography, useTheme, Input } from 'app-studio';
4
4
  export { View } from 'app-studio';
5
5
  import { Link as Link$1 } from 'react-router-dom';
6
6
  import 'core-js/modules/es6.array.map.js';
7
7
  import 'core-js/modules/es6.array.filter.js';
8
8
  import 'core-js/modules/es6.string.starts-with.js';
9
+ import 'core-js/modules/es6.array.slice.js';
9
10
  import format from 'date-fns/format';
10
11
  import 'core-js/modules/es6.string.includes.js';
11
12
  import 'core-js/modules/es7.array.includes.js';
12
- import { useModalStore } from './store/useModalStore';
13
- import 'core-js/modules/es6.array.slice.js';
13
+ import { useModalStore } from 'src/store/useModalStore';
14
14
 
15
15
  var useButtonState = function useButtonState() {
16
16
  var _React$useState = React.useState(false),
@@ -45,11 +45,37 @@ var useLinkState = function useLinkState() {
45
45
  };
46
46
  };
47
47
 
48
- var _excluded = ["children", "wrap"];
48
+ var _excluded = ["children", "wrap", "justify", "isReversed"];
49
+ var HorizontalView = function HorizontalView(_ref) {
50
+ var children = _ref.children,
51
+ _ref$wrap = _ref.wrap,
52
+ wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
53
+ _ref$justify = _ref.justify,
54
+ justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
55
+ _ref$isReversed = _ref.isReversed,
56
+ isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
57
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
58
+ return /*#__PURE__*/React.createElement(View, Object.assign({
59
+ display: "flex",
60
+ flexWrap: wrap,
61
+ flexDirection: isReversed ? 'row-reverse' : 'row',
62
+ justifyContent: justify
63
+ }, props), children);
64
+ };
65
+
66
+ /**
67
+ * Horizontal layout aligns all the elements in a container on the horizontal axis.
68
+ */
69
+ var HorizontalComponent = function HorizontalComponent(props) {
70
+ return /*#__PURE__*/React.createElement(HorizontalView, Object.assign({}, props));
71
+ };
72
+ var Horizontal = HorizontalComponent;
73
+
74
+ var _excluded$1 = ["children", "wrap"];
49
75
  var CenterView = function CenterView(_ref) {
50
76
  var children = _ref.children,
51
77
  wrap = _ref.wrap,
52
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
78
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
53
79
  return /*#__PURE__*/React.createElement(View, Object.assign({
54
80
  display: "flex",
55
81
  justifyContent: "center",
@@ -66,11 +92,11 @@ var CenterComponent = function CenterComponent(props) {
66
92
  };
67
93
  var Center = CenterComponent;
68
94
 
69
- var _excluded$1 = ["size", "color"];
95
+ var _excluded$2 = ["size", "color"];
70
96
  var ArrowDownSvg = function ArrowDownSvg(_ref) {
71
97
  var _ref$size = _ref.size,
72
98
  size = _ref$size === void 0 ? 64 : _ref$size,
73
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
99
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
74
100
  return /*#__PURE__*/React.createElement(Center, {
75
101
  width: size + "px",
76
102
  height: size + "px"
@@ -106,11 +132,11 @@ var ArrowDownSvg = function ArrowDownSvg(_ref) {
106
132
  })))))));
107
133
  };
108
134
 
109
- var _excluded$2 = ["size", "color"];
135
+ var _excluded$3 = ["size", "color"];
110
136
  var ArrowUpSvg = function ArrowUpSvg(_ref) {
111
137
  var _ref$size = _ref.size,
112
138
  size = _ref$size === void 0 ? 64 : _ref$size,
113
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
139
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
114
140
  return /*#__PURE__*/React.createElement(Center, {
115
141
  width: size + "px",
116
142
  height: size + "px"
@@ -148,13 +174,13 @@ var ArrowUpSvg = function ArrowUpSvg(_ref) {
148
174
  })))))));
149
175
  };
150
176
 
151
- var _excluded$3 = ["size", "color"];
177
+ var _excluded$4 = ["size", "color"];
152
178
  var CheckSvg = function CheckSvg(_ref) {
153
179
  var _ref$size = _ref.size,
154
180
  size = _ref$size === void 0 ? 64 : _ref$size,
155
181
  _ref$color = _ref.color,
156
182
  color = _ref$color === void 0 ? 'white' : _ref$color,
157
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
183
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
158
184
  return /*#__PURE__*/React.createElement(Center, {
159
185
  width: size + "px",
160
186
  height: size + "px"
@@ -184,13 +210,13 @@ var CheckSvg = function CheckSvg(_ref) {
184
210
  }))));
185
211
  };
186
212
 
187
- var _excluded$4 = ["size", "color"];
213
+ var _excluded$5 = ["size", "color"];
188
214
  var CloseSvg = function CloseSvg(_ref) {
189
215
  var _ref$size = _ref.size,
190
216
  size = _ref$size === void 0 ? 64 : _ref$size,
191
217
  _ref$color = _ref.color,
192
218
  color = _ref$color === void 0 ? 'white' : _ref$color,
193
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
219
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
194
220
  return /*#__PURE__*/React.createElement(Center, {
195
221
  width: size + "px",
196
222
  height: size + "px"
@@ -215,13 +241,13 @@ var CloseSvg = function CloseSvg(_ref) {
215
241
  }))));
216
242
  };
217
243
 
218
- var _excluded$5 = ["size", "color"];
244
+ var _excluded$6 = ["size", "color"];
219
245
  var ExternalLinkSvg = function ExternalLinkSvg(_ref) {
220
246
  var _ref$size = _ref.size,
221
247
  size = _ref$size === void 0 ? 64 : _ref$size,
222
248
  _ref$color = _ref.color,
223
249
  color = _ref$color === void 0 ? 'white' : _ref$color,
224
- props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
250
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
225
251
  return /*#__PURE__*/React.createElement(Center, {
226
252
  width: size + "px",
227
253
  height: size + "px"
@@ -250,13 +276,13 @@ var ExternalLinkSvg = function ExternalLinkSvg(_ref) {
250
276
  }))));
251
277
  };
252
278
 
253
- var _excluded$6 = ["size", "color"];
279
+ var _excluded$7 = ["size", "color"];
254
280
  var IndeterminateSvg = function IndeterminateSvg(_ref) {
255
281
  var _ref$size = _ref.size,
256
282
  size = _ref$size === void 0 ? 64 : _ref$size,
257
283
  _ref$color = _ref.color,
258
284
  color = _ref$color === void 0 ? 'white' : _ref$color,
259
- props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
285
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
260
286
  return /*#__PURE__*/React.createElement(Center, {
261
287
  width: size + "px",
262
288
  height: size + "px"
@@ -295,7 +321,7 @@ var IconSizes = {
295
321
  '6xl': 64
296
322
  };
297
323
 
298
- var _excluded$7 = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "colorScheme", "styles", "setIsHovered"];
324
+ var _excluded$8 = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "colorScheme", "styles", "setIsHovered"];
299
325
  var LinkView = function LinkView(_ref) {
300
326
  var children = _ref.children,
301
327
  _ref$href = _ref.href,
@@ -317,7 +343,7 @@ var LinkView = function LinkView(_ref) {
317
343
  } : _ref$styles,
318
344
  _ref$setIsHovered = _ref.setIsHovered,
319
345
  setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
320
- props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
346
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
321
347
  var handleHover = function handleHover() {
322
348
  if (underline === 'hover') setIsHovered(true);
323
349
  };
@@ -439,7 +465,7 @@ var IconSizes$1 = {
439
465
  }
440
466
  };
441
467
 
442
- var _excluded$8 = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick"];
468
+ var _excluded$9 = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoader", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick"];
443
469
  var ButtonView = function ButtonView(_ref) {
444
470
  var _props$onClick;
445
471
  var icon = _ref.icon,
@@ -453,8 +479,8 @@ var ButtonView = function ButtonView(_ref) {
453
479
  isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
454
480
  _ref$isIconRounded = _ref.isIconRounded,
455
481
  isIconRounded = _ref$isIconRounded === void 0 ? false : _ref$isIconRounded,
456
- _ref$isLoading = _ref.isLoading,
457
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
482
+ _ref$isLoader = _ref.isLoader,
483
+ isLoader = _ref$isLoader === void 0 ? false : _ref$isLoader,
458
484
  _ref$isDisabled = _ref.isDisabled,
459
485
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
460
486
  _ref$size = _ref.size,
@@ -469,8 +495,8 @@ var ButtonView = function ButtonView(_ref) {
469
495
  shape = _ref$shape === void 0 ? 'rounded' : _ref$shape,
470
496
  _ref$onClick = _ref.onClick,
471
497
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
472
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
473
- var isActive = !(isDisabled || isLoading);
498
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
499
+ var isActive = !(isDisabled || isLoader);
474
500
  var defaultNativeProps = {
475
501
  disabled: !isActive
476
502
  };
@@ -507,7 +533,7 @@ var ButtonView = function ButtonView(_ref) {
507
533
  var changePadding = {
508
534
  padding: isIconRounded ? IconSizes$1[size].padding : ButtonSizes[size].padding
509
535
  };
510
- var content = /*#__PURE__*/React.createElement(React.Fragment, null, icon && iconPosition === 'left' && !isLoading && icon, children, icon && iconPosition === 'right' && !isLoading && icon);
536
+ var content = /*#__PURE__*/React.createElement(React.Fragment, null, icon && iconPosition === 'left' && !isLoader && icon, children, icon && iconPosition === 'right' && !isLoader && icon);
511
537
  return /*#__PURE__*/React.createElement(Element, Object.assign({
512
538
  gap: 8,
513
539
  as: "button",
@@ -598,7 +624,7 @@ var HeadingSizes = {
598
624
  }
599
625
  };
600
626
 
601
- var _excluded$9 = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
627
+ var _excluded$a = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
602
628
  var LabelView = function LabelView(_ref) {
603
629
  var children = _ref.children,
604
630
  heading = _ref.heading,
@@ -612,7 +638,7 @@ var LabelView = function LabelView(_ref) {
612
638
  weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
613
639
  _ref$size = _ref.size,
614
640
  size = _ref$size === void 0 ? 'sm' : _ref$size,
615
- props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
641
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
616
642
  var headingStyles = heading ? HeadingSizes[heading] : {};
617
643
  return /*#__PURE__*/React.createElement(Element, Object.assign({
618
644
  as: "label",
@@ -684,7 +710,7 @@ var IconSizes$2 = {
684
710
  '6xl': 60
685
711
  };
686
712
 
687
- var _excluded$a = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
713
+ var _excluded$b = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
688
714
  var CheckboxView = function CheckboxView(_ref) {
689
715
  var id = _ref.id,
690
716
  icon = _ref.icon,
@@ -719,7 +745,7 @@ var CheckboxView = function CheckboxView(_ref) {
719
745
  checkbox: {},
720
746
  label: {}
721
747
  } : _ref$styles,
722
- props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
748
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
723
749
  var handleHover = function handleHover() {
724
750
  return setIsHovered(!isHovered);
725
751
  };
@@ -2263,7 +2289,7 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
2263
2289
  };
2264
2290
  };
2265
2291
 
2266
- var _excluded$b = ["children", "wrap", "justify", "isReversed"];
2292
+ var _excluded$c = ["children", "wrap", "justify", "isReversed"];
2267
2293
  var VerticalView = function VerticalView(_ref) {
2268
2294
  var children = _ref.children,
2269
2295
  _ref$wrap = _ref.wrap,
@@ -2272,7 +2298,7 @@ var VerticalView = function VerticalView(_ref) {
2272
2298
  justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
2273
2299
  _ref$isReversed = _ref.isReversed,
2274
2300
  isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
2275
- props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
2301
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
2276
2302
  return /*#__PURE__*/React.createElement(View, Object.assign({
2277
2303
  display: "flex",
2278
2304
  flexWrap: wrap,
@@ -2289,7 +2315,127 @@ var VerticalComponent = function VerticalComponent(props) {
2289
2315
  };
2290
2316
  var Vertical = VerticalComponent;
2291
2317
 
2292
- var _excluded$c = ["children", "styles", "error"];
2318
+ var HeadingSizes$1 = {
2319
+ h1: {
2320
+ fontSize: 96,
2321
+ lineHeight: 112,
2322
+ letterSpacing: -1.5
2323
+ },
2324
+ h2: {
2325
+ fontSize: 60,
2326
+ lineHeight: 71,
2327
+ letterSpacing: -0.5
2328
+ },
2329
+ h3: {
2330
+ fontSize: 48,
2331
+ lineHeight: 57,
2332
+ letterSpacing: 0
2333
+ },
2334
+ h4: {
2335
+ fontSize: 34,
2336
+ lineHeight: 40,
2337
+ letterSpacing: 0.25
2338
+ },
2339
+ h5: {
2340
+ fontSize: 24,
2341
+ lineHeight: 28,
2342
+ letterSpacing: 0
2343
+ },
2344
+ h6: {
2345
+ fontSize: 20,
2346
+ lineHeight: 24,
2347
+ letterSpacing: 0.15
2348
+ }
2349
+ };
2350
+
2351
+ var _excluded$d = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
2352
+ var TextContent = function TextContent(_ref) {
2353
+ var children = _ref.children,
2354
+ isSub = _ref.isSub,
2355
+ isSup = _ref.isSup;
2356
+ 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);
2357
+ };
2358
+ var TruncateText = function TruncateText(_ref2) {
2359
+ var text = _ref2.text,
2360
+ _ref2$maxLines = _ref2.maxLines,
2361
+ maxLines = _ref2$maxLines === void 0 ? 1 : _ref2$maxLines;
2362
+ var containerRef = useRef(null);
2363
+ var _useState = useState(text),
2364
+ content = _useState[0],
2365
+ setContent = _useState[1];
2366
+ useEffect(function () {
2367
+ var textContent = content;
2368
+ var textNode = containerRef.current;
2369
+ if (textNode) {
2370
+ var contentHeight = textNode.offsetHeight;
2371
+ var comLineHeight = getComputedStyle(textNode).lineHeight;
2372
+ var lineHeight = comLineHeight !== 'normal' ? parseFloat(comLineHeight) : 20;
2373
+ var maxHeight = Math.ceil(lineHeight * maxLines);
2374
+ if (contentHeight > maxHeight) {
2375
+ textContent = textContent.slice(0, -1);
2376
+ } else if (contentHeight === maxHeight) {
2377
+ if (content.length !== text.length) {
2378
+ textContent = textContent.slice(0, -3) + '...';
2379
+ }
2380
+ }
2381
+ setContent(textContent);
2382
+ }
2383
+ }, [maxLines, text, containerRef, content]);
2384
+ return /*#__PURE__*/React.createElement("div", {
2385
+ ref: containerRef
2386
+ }, content);
2387
+ };
2388
+ var TextView = function TextView(_ref3) {
2389
+ var children = _ref3.children,
2390
+ heading = _ref3.heading,
2391
+ maxLines = _ref3.maxLines,
2392
+ _ref3$isItalic = _ref3.isItalic,
2393
+ isItalic = _ref3$isItalic === void 0 ? false : _ref3$isItalic,
2394
+ _ref3$isUnderlined = _ref3.isUnderlined,
2395
+ isUnderlined = _ref3$isUnderlined === void 0 ? false : _ref3$isUnderlined,
2396
+ _ref3$isSub = _ref3.isSub,
2397
+ isSub = _ref3$isSub === void 0 ? false : _ref3$isSub,
2398
+ _ref3$isSup = _ref3.isSup,
2399
+ isSup = _ref3$isSup === void 0 ? false : _ref3$isSup,
2400
+ _ref3$isStriked = _ref3.isStriked,
2401
+ isStriked = _ref3$isStriked === void 0 ? false : _ref3$isStriked,
2402
+ _ref3$isTruncated = _ref3.isTruncated,
2403
+ isTruncated = _ref3$isTruncated === void 0 ? false : _ref3$isTruncated,
2404
+ _ref3$weight = _ref3.weight,
2405
+ weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
2406
+ _ref3$size = _ref3.size,
2407
+ size = _ref3$size === void 0 ? 'md' : _ref3$size,
2408
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded$d);
2409
+ var headingStyles = heading ? HeadingSizes$1[heading] : {};
2410
+ var noLineBreak = isSub || isSup ? {
2411
+ display: 'inline'
2412
+ } : {};
2413
+ var fontSize = Typography.fontSizes[size];
2414
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
2415
+ role: "text",
2416
+ fontSize: fontSize,
2417
+ lineHeight: Typography.lineHeights[size],
2418
+ fontStyle: isItalic ? 'italic' : 'normal',
2419
+ fontWeight: Typography.fontWeights[weight],
2420
+ textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
2421
+ }, noLineBreak, headingStyles, props), isTruncated && maxLines && typeof children === 'string' ? /*#__PURE__*/React.createElement(TruncateText, {
2422
+ text: children,
2423
+ maxLines: maxLines
2424
+ }) : /*#__PURE__*/React.createElement(TextContent, Object.assign({
2425
+ isSub: isSub,
2426
+ isSup: isSup
2427
+ }, props), children));
2428
+ };
2429
+
2430
+ var TextComponent = function TextComponent(props) {
2431
+ return /*#__PURE__*/React.createElement(TextView, Object.assign({}, props));
2432
+ };
2433
+ /**
2434
+ * 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.
2435
+ */
2436
+ var Text = TextComponent;
2437
+
2438
+ var _excluded$e = ["children", "styles", "error"];
2293
2439
  var HelperText = function HelperText(_ref) {
2294
2440
  var children = _ref.children,
2295
2441
  _ref$styles = _ref.styles,
@@ -2298,7 +2444,7 @@ var HelperText = function HelperText(_ref) {
2298
2444
  } : _ref$styles,
2299
2445
  _ref$error = _ref.error,
2300
2446
  error = _ref$error === void 0 ? false : _ref$error,
2301
- props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
2447
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
2302
2448
  return /*#__PURE__*/React.createElement(Text, Object.assign({
2303
2449
  size: "xs",
2304
2450
  marginVertical: 0,
@@ -2307,14 +2453,14 @@ var HelperText = function HelperText(_ref) {
2307
2453
  }, styles['helperText'], props), children);
2308
2454
  };
2309
2455
 
2310
- var _excluded$d = ["children", "helperText", "error", "styles"];
2456
+ var _excluded$f = ["children", "helperText", "error", "styles"];
2311
2457
  var FieldContainer = function FieldContainer(_ref) {
2312
2458
  var children = _ref.children,
2313
2459
  helperText = _ref.helperText,
2314
2460
  _ref$error = _ref.error,
2315
2461
  error = _ref$error === void 0 ? false : _ref$error,
2316
2462
  styles = _ref.styles,
2317
- props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
2463
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
2318
2464
  return /*#__PURE__*/React.createElement(Vertical, Object.assign({
2319
2465
  gap: 5,
2320
2466
  position: "relative"
@@ -2372,33 +2518,7 @@ var PaddingWithoutLabel = {
2372
2518
  paddingRight: 35
2373
2519
  };
2374
2520
 
2375
- var _excluded$e = ["children", "wrap", "justify", "isReversed"];
2376
- var HorizontalView = function HorizontalView(_ref) {
2377
- var children = _ref.children,
2378
- _ref$wrap = _ref.wrap,
2379
- wrap = _ref$wrap === void 0 ? 'wrap' : _ref$wrap,
2380
- _ref$justify = _ref.justify,
2381
- justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
2382
- _ref$isReversed = _ref.isReversed,
2383
- isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
2384
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
2385
- return /*#__PURE__*/React.createElement(View, Object.assign({
2386
- display: "flex",
2387
- flexWrap: wrap,
2388
- flexDirection: isReversed ? 'row-reverse' : 'row',
2389
- justifyContent: justify
2390
- }, props), children);
2391
- };
2392
-
2393
- /**
2394
- * Horizontal layout aligns all the elements in a container on the horizontal axis.
2395
- */
2396
- var HorizontalComponent = function HorizontalComponent(props) {
2397
- return /*#__PURE__*/React.createElement(HorizontalView, Object.assign({}, props));
2398
- };
2399
- var Horizontal = HorizontalComponent;
2400
-
2401
- var _excluded$f = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "isWithLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "colorScheme", "styles"];
2521
+ var _excluded$g = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "isWithLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "colorScheme", "styles"];
2402
2522
  var FieldContent = function FieldContent(_ref) {
2403
2523
  var shadow = _ref.shadow,
2404
2524
  children = _ref.children,
@@ -2426,7 +2546,7 @@ var FieldContent = function FieldContent(_ref) {
2426
2546
  styles = _ref$styles === void 0 ? {
2427
2547
  pickerBox: {}
2428
2548
  } : _ref$styles,
2429
- props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
2549
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2430
2550
  var isInteractive = (isHovered || isFocused) && !isDisabled;
2431
2551
  var color = error ? 'error' : isInteractive ? colorScheme : 'midgray';
2432
2552
  return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
@@ -2446,10 +2566,10 @@ var FieldContent = function FieldContent(_ref) {
2446
2566
  }, isWithLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], styles['box'], props), children);
2447
2567
  };
2448
2568
 
2449
- var _excluded$g = ["children"];
2569
+ var _excluded$h = ["children"];
2450
2570
  var FieldIcons = function FieldIcons(_ref) {
2451
2571
  var children = _ref.children,
2452
- props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2572
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
2453
2573
  return /*#__PURE__*/React.createElement(Center, Object.assign({
2454
2574
  gap: 10,
2455
2575
  top: "50%",
@@ -2461,7 +2581,7 @@ var FieldIcons = function FieldIcons(_ref) {
2461
2581
  }, props), children);
2462
2582
  };
2463
2583
 
2464
- var _excluded$h = ["children", "size", "error", "color", "styles"];
2584
+ var _excluded$i = ["children", "size", "error", "color", "styles"];
2465
2585
  var FieldLabel = function FieldLabel(_ref) {
2466
2586
  var children = _ref.children,
2467
2587
  _ref$size = _ref.size,
@@ -2474,7 +2594,7 @@ var FieldLabel = function FieldLabel(_ref) {
2474
2594
  styles = _ref$styles === void 0 ? {
2475
2595
  label: {}
2476
2596
  } : _ref$styles,
2477
- props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
2597
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
2478
2598
  return /*#__PURE__*/React.createElement(Label, Object.assign({
2479
2599
  top: 4,
2480
2600
  zIndex: 1000,
@@ -2487,10 +2607,10 @@ var FieldLabel = function FieldLabel(_ref) {
2487
2607
  }, styles['label'], props), children);
2488
2608
  };
2489
2609
 
2490
- var _excluded$i = ["children"];
2610
+ var _excluded$j = ["children"];
2491
2611
  var FieldWrapper = function FieldWrapper(_ref) {
2492
2612
  var children = _ref.children,
2493
- props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
2613
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
2494
2614
  return /*#__PURE__*/React.createElement(Vertical, Object.assign({
2495
2615
  width: "100%"
2496
2616
  }, props), children);
@@ -2504,7 +2624,7 @@ var IconSizes$3 = {
2504
2624
  xl: 16
2505
2625
  };
2506
2626
 
2507
- var _excluded$j = ["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"];
2627
+ var _excluded$k = ["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"];
2508
2628
  var CountryList = function CountryList(props) {
2509
2629
  return /*#__PURE__*/React.createElement(Element, Object.assign({
2510
2630
  as: "ul"
@@ -2644,7 +2764,7 @@ var CountryPickerView = function CountryPickerView(_ref3) {
2644
2764
  helperText: {},
2645
2765
  box: {}
2646
2766
  } : _ref3$styles,
2647
- props = _objectWithoutPropertiesLoose(_ref3, _excluded$j);
2767
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded$k);
2648
2768
  var _useTheme = useTheme(),
2649
2769
  getColor = _useTheme.getColor;
2650
2770
  var IconColor = getColor('color.blueGray.700');
@@ -2782,7 +2902,7 @@ var useDatePickerState = function useDatePickerState() {
2782
2902
  };
2783
2903
  };
2784
2904
 
2785
- var _excluded$k = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "colorScheme", "styles", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
2905
+ var _excluded$l = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "colorScheme", "styles", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
2786
2906
  var DatePickerContent = function DatePickerContent(props) {
2787
2907
  return /*#__PURE__*/React.createElement(Input, Object.assign({
2788
2908
  type: "date"
@@ -2830,7 +2950,7 @@ var DatePickerView = function DatePickerView(_ref) {
2830
2950
  setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
2831
2951
  onChange = _ref.onChange,
2832
2952
  onChangeText = _ref.onChangeText,
2833
- props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
2953
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
2834
2954
  var isWithLabel = !!(isFocused && label);
2835
2955
  var handleHover = function handleHover() {
2836
2956
  return setIsHovered(!isHovered);
@@ -2923,48 +3043,260 @@ var usePasswordState = function usePasswordState() {
2923
3043
  };
2924
3044
  };
2925
3045
 
2926
- var _excluded$l = ["name", "visibleIcon", "hiddenIcon", "isDisabled", "isVisible", "setIsVisible"];
2927
- var PasswordView = function PasswordView(_ref) {
2928
- var name = _ref.name,
2929
- visibleIcon = _ref.visibleIcon,
2930
- hiddenIcon = _ref.hiddenIcon,
2931
- _ref$isDisabled = _ref.isDisabled,
2932
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
2933
- _ref$isVisible = _ref.isVisible,
2934
- isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
2935
- _ref$setIsVisible = _ref.setIsVisible,
2936
- setIsVisible = _ref$setIsVisible === void 0 ? function () {} : _ref$setIsVisible,
2937
- props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
2938
- return /*#__PURE__*/React.createElement(TextField, Object.assign({
2939
- name: name,
2940
- type: isVisible ? 'text' : 'password',
2941
- rightChild: /*#__PURE__*/React.createElement(View, {
2942
- onClick: function onClick() {
2943
- if (!isDisabled) setIsVisible(!isVisible);
2944
- }
2945
- }, isVisible ? visibleIcon : hiddenIcon),
2946
- isClearable: false
2947
- }, props));
2948
- };
2949
-
2950
- var PasswordComponent = function PasswordComponent(props) {
2951
- var passwordState = usePasswordState();
2952
- return /*#__PURE__*/React.createElement(PasswordView, Object.assign({}, passwordState, props));
2953
- };
2954
- /**
2955
- * To allow users to securely enter sensitive information
2956
- */
2957
- var Password = PasswordComponent;
2958
-
2959
- var useSelectState = function useSelectState(_ref) {
2960
- var placeholder = _ref.placeholder,
2961
- isMulti = _ref.isMulti,
2962
- options = _ref.options;
2963
- var defaultSelected = placeholder ? isMulti ? [] : '' : options[0];
2964
- var _React$useState = React.useState(true),
2965
- hide = _React$useState[0],
2966
- setHide = _React$useState[1];
2967
- var _React$useState2 = React.useState(false),
3046
+ var useTextFieldState = function useTextFieldState(_ref) {
3047
+ var label = _ref.label,
3048
+ placeholder = _ref.placeholder,
3049
+ value = _ref.value;
3050
+ var _useState = useState(label != null ? label : placeholder),
3051
+ hint = _useState[0],
3052
+ setHint = _useState[1];
3053
+ var _useState2 = useState(false),
3054
+ isFocused = _useState2[0],
3055
+ setIsFocused = _useState2[1];
3056
+ var _useState3 = useState(false),
3057
+ isHovered = _useState3[0],
3058
+ setIsHovered = _useState3[1];
3059
+ var _useState4 = useState(value || ''),
3060
+ inputValue = _useState4[0],
3061
+ setInputValue = _useState4[1];
3062
+ return {
3063
+ hint: hint,
3064
+ setHint: setHint,
3065
+ isFocused: isFocused,
3066
+ setIsFocused: setIsFocused,
3067
+ isHovered: isHovered,
3068
+ setIsHovered: setIsHovered,
3069
+ inputValue: inputValue,
3070
+ setInputValue: setInputValue
3071
+ };
3072
+ };
3073
+
3074
+ var _excluded$m = ["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"];
3075
+ var TextFieldInput = function TextFieldInput(props) {
3076
+ return /*#__PURE__*/React.createElement(Input, Object.assign({
3077
+ type: "text"
3078
+ }, props));
3079
+ };
3080
+ var TextFieldView = function TextFieldView(_ref) {
3081
+ var id = _ref.id,
3082
+ name = _ref.name,
3083
+ label = _ref.label,
3084
+ hint = _ref.hint,
3085
+ inputValue = _ref.inputValue,
3086
+ onChange = _ref.onChange,
3087
+ leftChild = _ref.leftChild,
3088
+ rightChild = _ref.rightChild,
3089
+ helperText = _ref.helperText,
3090
+ placeholder = _ref.placeholder,
3091
+ onChangeText = _ref.onChangeText,
3092
+ _ref$shadow = _ref.shadow,
3093
+ shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
3094
+ _ref$styles = _ref.styles,
3095
+ styles = _ref$styles === void 0 ? {
3096
+ box: {},
3097
+ field: {},
3098
+ label: {},
3099
+ helperText: {},
3100
+ text: {}
3101
+ } : _ref$styles,
3102
+ _ref$size = _ref.size,
3103
+ size = _ref$size === void 0 ? 'md' : _ref$size,
3104
+ _ref$shape = _ref.shape,
3105
+ shape = _ref$shape === void 0 ? 'default' : _ref$shape,
3106
+ _ref$variant = _ref.variant,
3107
+ variant = _ref$variant === void 0 ? 'default' : _ref$variant,
3108
+ _ref$colorScheme = _ref.colorScheme,
3109
+ colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
3110
+ _ref$error = _ref.error,
3111
+ error = _ref$error === void 0 ? false : _ref$error,
3112
+ _ref$isFocused = _ref.isFocused,
3113
+ isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
3114
+ _ref$isHovered = _ref.isHovered,
3115
+ isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
3116
+ _ref$isDisabled = _ref.isDisabled,
3117
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3118
+ _ref$isReadOnly = _ref.isReadOnly,
3119
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
3120
+ _ref$isClearable = _ref.isClearable,
3121
+ isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
3122
+ _ref$isAutoFocus = _ref.isAutoFocus,
3123
+ isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
3124
+ _ref$setHint = _ref.setHint,
3125
+ setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
3126
+ _ref$setIsFocused = _ref.setIsFocused,
3127
+ setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
3128
+ _ref$setIsHovered = _ref.setIsHovered,
3129
+ setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
3130
+ _ref$setInputValue = _ref.setInputValue,
3131
+ setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
3132
+ onFocus = _ref.onFocus,
3133
+ _ref$onBlur = _ref.onBlur,
3134
+ onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
3135
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
3136
+ var _useTheme = useTheme(),
3137
+ getColor = _useTheme.getColor;
3138
+ var IconColor = getColor('color.blueGray.700');
3139
+ var isWithLabel = !!(isFocused && label);
3140
+ useMemo(function () {
3141
+ setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
3142
+ }, [inputValue, isFocused, label, placeholder]);
3143
+ var fieldStyles = Object.assign({
3144
+ margin: 0,
3145
+ paddingVertical: 8,
3146
+ padddingHorizontal: 0,
3147
+ width: '100%',
3148
+ heigth: '100%',
3149
+ border: 'none',
3150
+ on: {
3151
+ focus: {
3152
+ outline: 'none'
3153
+ }
3154
+ },
3155
+ fontSize: Typography.fontSizes[size],
3156
+ backgroundColor: 'transparent',
3157
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3158
+ cursor: isDisabled ? 'not-allowed' : 'auto'
3159
+ }, styles['field']);
3160
+ var handleFocus = function handleFocus() {
3161
+ setIsFocused(true);
3162
+ if (onFocus) onFocus();
3163
+ };
3164
+ var handleHover = function handleHover() {
3165
+ return setIsHovered(!isHovered);
3166
+ };
3167
+ var handleBlur = function handleBlur(event) {
3168
+ onBlur(event);
3169
+ setIsFocused(false);
3170
+ };
3171
+ var handleChange = function handleChange(event) {
3172
+ if (typeof event === 'string') {
3173
+ //for ios and android
3174
+ setInputValue(event);
3175
+ if (onChangeText) onChangeText(event);
3176
+ } else {
3177
+ //Web
3178
+ setInputValue(event.target.value);
3179
+ if (onChange) onChange(event);
3180
+ }
3181
+ };
3182
+ var handleClear = function handleClear() {
3183
+ setInputValue('');
3184
+ //Web
3185
+ if (onChange) {
3186
+ onBlur({
3187
+ target: {
3188
+ name: name
3189
+ }
3190
+ });
3191
+ onChange({
3192
+ target: {
3193
+ name: name,
3194
+ value: ''
3195
+ }
3196
+ });
3197
+ }
3198
+ //for ios and android
3199
+ if (typeof document === 'undefined' && onChangeText) onChangeText('');
3200
+ };
3201
+ return /*#__PURE__*/React.createElement(FieldContainer, {
3202
+ helperText: helperText,
3203
+ error: error,
3204
+ styles: styles
3205
+ }, /*#__PURE__*/React.createElement(FieldContent, {
3206
+ label: label,
3207
+ size: size,
3208
+ error: error,
3209
+ shape: shape,
3210
+ styles: styles,
3211
+ shadow: shadow,
3212
+ variant: variant,
3213
+ value: inputValue,
3214
+ color: colorScheme,
3215
+ isHovered: isHovered,
3216
+ isDisabled: isDisabled,
3217
+ isReadOnly: isReadOnly,
3218
+ isFocused: isFocused,
3219
+ isWithLabel: isWithLabel,
3220
+ colorScheme: colorScheme,
3221
+ onMouseEnter: handleHover,
3222
+ onMouseLeave: handleHover
3223
+ }, leftChild, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
3224
+ htmlFor: id,
3225
+ color: colorScheme,
3226
+ error: error
3227
+ }, styles), label), /*#__PURE__*/React.createElement(TextFieldInput, Object.assign({
3228
+ id: id,
3229
+ name: name,
3230
+ value: inputValue,
3231
+ readOnly: isReadOnly,
3232
+ disabled: isDisabled,
3233
+ autoFocus: isAutoFocus,
3234
+ placeholder: hint,
3235
+ onFocus: handleFocus,
3236
+ onBlur: handleBlur,
3237
+ autoComplete: "off"
3238
+ }, fieldStyles, props, {
3239
+ onChange: handleChange
3240
+ }, onChangeText && {
3241
+ onChangeText: handleChange
3242
+ }))), (rightChild || isClearable && inputValue) && /*#__PURE__*/React.createElement(FieldIcons, null, rightChild && /*#__PURE__*/React.createElement(React.Fragment, null, rightChild), isClearable && inputValue && !isReadOnly && !isDisabled && /*#__PURE__*/React.createElement(CloseSvg, {
3243
+ size: Typography.fontSizes[size],
3244
+ color: IconColor,
3245
+ onClick: handleClear
3246
+ }))));
3247
+ };
3248
+
3249
+ var TextFieldComponent = function TextFieldComponent(props) {
3250
+ var textFieldStates = useTextFieldState(props);
3251
+ return /*#__PURE__*/React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
3252
+ };
3253
+ /**
3254
+ * TextField is used to capture text data from users.
3255
+ */
3256
+ var TextField = TextFieldComponent;
3257
+
3258
+ var _excluded$n = ["name", "visibleIcon", "hiddenIcon", "isDisabled", "isVisible", "setIsVisible"];
3259
+ var PasswordView = function PasswordView(_ref) {
3260
+ var name = _ref.name,
3261
+ visibleIcon = _ref.visibleIcon,
3262
+ hiddenIcon = _ref.hiddenIcon,
3263
+ _ref$isDisabled = _ref.isDisabled,
3264
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3265
+ _ref$isVisible = _ref.isVisible,
3266
+ isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
3267
+ _ref$setIsVisible = _ref.setIsVisible,
3268
+ setIsVisible = _ref$setIsVisible === void 0 ? function () {} : _ref$setIsVisible,
3269
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
3270
+ return /*#__PURE__*/React.createElement(TextField, Object.assign({
3271
+ name: name,
3272
+ type: isVisible ? 'text' : 'password',
3273
+ rightChild: /*#__PURE__*/React.createElement(View, {
3274
+ onClick: function onClick() {
3275
+ if (!isDisabled) setIsVisible(!isVisible);
3276
+ }
3277
+ }, isVisible ? visibleIcon : hiddenIcon),
3278
+ isClearable: false
3279
+ }, props));
3280
+ };
3281
+
3282
+ var PasswordComponent = function PasswordComponent(props) {
3283
+ var passwordState = usePasswordState();
3284
+ return /*#__PURE__*/React.createElement(PasswordView, Object.assign({}, passwordState, props));
3285
+ };
3286
+ /**
3287
+ * To allow users to securely enter sensitive information
3288
+ */
3289
+ var Password = PasswordComponent;
3290
+
3291
+ var useSelectState = function useSelectState(_ref) {
3292
+ var placeholder = _ref.placeholder,
3293
+ isMulti = _ref.isMulti,
3294
+ options = _ref.options;
3295
+ var defaultSelected = placeholder ? isMulti ? [] : '' : options[0];
3296
+ var _React$useState = React.useState(true),
3297
+ hide = _React$useState[0],
3298
+ setHide = _React$useState[1];
3299
+ var _React$useState2 = React.useState(false),
2968
3300
  isHovered = _React$useState2[0],
2969
3301
  setIsHovered = _React$useState2[1];
2970
3302
  var _React$useState3 = React.useState(false),
@@ -3002,7 +3334,7 @@ var IconSizes$4 = {
3002
3334
  xl: 16
3003
3335
  };
3004
3336
 
3005
- var _excluded$m = ["isHovered", "setIsHovered", "option", "size", "callback"],
3337
+ var _excluded$o = ["isHovered", "setIsHovered", "option", "size", "callback"],
3006
3338
  _excluded2 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
3007
3339
  _excluded3 = ["option", "size", "removeOption"],
3008
3340
  _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"];
@@ -3014,7 +3346,7 @@ var Item = function Item(_ref) {
3014
3346
  size = _ref$size === void 0 ? 'md' : _ref$size,
3015
3347
  _ref$callback = _ref.callback,
3016
3348
  callback = _ref$callback === void 0 ? function () {} : _ref$callback,
3017
- props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
3349
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
3018
3350
  var handleOptionClick = function handleOptionClick(option) {
3019
3351
  return callback(option);
3020
3352
  };
@@ -3484,7 +3816,7 @@ var SliderPadding = {
3484
3816
  }
3485
3817
  };
3486
3818
 
3487
- var _excluded$n = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
3819
+ var _excluded$p = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
3488
3820
  var SwitchContent = function SwitchContent(props) {
3489
3821
  return /*#__PURE__*/React.createElement(Input, Object.assign({
3490
3822
  type: "checkbox"
@@ -3520,7 +3852,7 @@ var SwitchView = function SwitchView(_ref) {
3520
3852
  slider: {},
3521
3853
  circle: {}
3522
3854
  } : _ref$styles,
3523
- props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
3855
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
3524
3856
  var handleToggle = function handleToggle(event) {
3525
3857
  if (!isReadOnly) {
3526
3858
  setOn(!on);
@@ -3596,7 +3928,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
3596
3928
  };
3597
3929
  };
3598
3930
 
3599
- var _excluded$o = ["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"];
3931
+ var _excluded$q = ["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"];
3600
3932
  var TextAreaView = function TextAreaView(_ref) {
3601
3933
  var id = _ref.id,
3602
3934
  name = _ref.name,
@@ -3654,7 +3986,7 @@ var TextAreaView = function TextAreaView(_ref) {
3654
3986
  helperText: {},
3655
3987
  field: {}
3656
3988
  } : _ref$styles,
3657
- props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
3989
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
3658
3990
  var isWithLabel = !!(isFocused && label);
3659
3991
  useMemo(function () {
3660
3992
  setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
@@ -3753,218 +4085,6 @@ var TextAreaComponent = function TextAreaComponent(props) {
3753
4085
  */
3754
4086
  var TextArea = TextAreaComponent;
3755
4087
 
3756
- var useTextFieldState = function useTextFieldState(_ref) {
3757
- var label = _ref.label,
3758
- placeholder = _ref.placeholder,
3759
- value = _ref.value;
3760
- var _useState = useState(label != null ? label : placeholder),
3761
- hint = _useState[0],
3762
- setHint = _useState[1];
3763
- var _useState2 = useState(false),
3764
- isFocused = _useState2[0],
3765
- setIsFocused = _useState2[1];
3766
- var _useState3 = useState(false),
3767
- isHovered = _useState3[0],
3768
- setIsHovered = _useState3[1];
3769
- var _useState4 = useState(value || ''),
3770
- inputValue = _useState4[0],
3771
- setInputValue = _useState4[1];
3772
- return {
3773
- hint: hint,
3774
- setHint: setHint,
3775
- isFocused: isFocused,
3776
- setIsFocused: setIsFocused,
3777
- isHovered: isHovered,
3778
- setIsHovered: setIsHovered,
3779
- inputValue: inputValue,
3780
- setInputValue: setInputValue
3781
- };
3782
- };
3783
-
3784
- var _excluded$p = ["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"];
3785
- var TextFieldInput = function TextFieldInput(props) {
3786
- return /*#__PURE__*/React.createElement(Input, Object.assign({
3787
- type: "text"
3788
- }, props));
3789
- };
3790
- var TextFieldView = function TextFieldView(_ref) {
3791
- var id = _ref.id,
3792
- name = _ref.name,
3793
- label = _ref.label,
3794
- hint = _ref.hint,
3795
- inputValue = _ref.inputValue,
3796
- onChange = _ref.onChange,
3797
- leftChild = _ref.leftChild,
3798
- rightChild = _ref.rightChild,
3799
- helperText = _ref.helperText,
3800
- placeholder = _ref.placeholder,
3801
- onChangeText = _ref.onChangeText,
3802
- _ref$shadow = _ref.shadow,
3803
- shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
3804
- _ref$styles = _ref.styles,
3805
- styles = _ref$styles === void 0 ? {
3806
- box: {},
3807
- field: {},
3808
- label: {},
3809
- helperText: {},
3810
- text: {}
3811
- } : _ref$styles,
3812
- _ref$size = _ref.size,
3813
- size = _ref$size === void 0 ? 'md' : _ref$size,
3814
- _ref$shape = _ref.shape,
3815
- shape = _ref$shape === void 0 ? 'default' : _ref$shape,
3816
- _ref$variant = _ref.variant,
3817
- variant = _ref$variant === void 0 ? 'default' : _ref$variant,
3818
- _ref$colorScheme = _ref.colorScheme,
3819
- colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
3820
- _ref$error = _ref.error,
3821
- error = _ref$error === void 0 ? false : _ref$error,
3822
- _ref$isFocused = _ref.isFocused,
3823
- isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
3824
- _ref$isHovered = _ref.isHovered,
3825
- isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
3826
- _ref$isDisabled = _ref.isDisabled,
3827
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3828
- _ref$isReadOnly = _ref.isReadOnly,
3829
- isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
3830
- _ref$isClearable = _ref.isClearable,
3831
- isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
3832
- _ref$isAutoFocus = _ref.isAutoFocus,
3833
- isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
3834
- _ref$setHint = _ref.setHint,
3835
- setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
3836
- _ref$setIsFocused = _ref.setIsFocused,
3837
- setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
3838
- _ref$setIsHovered = _ref.setIsHovered,
3839
- setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
3840
- _ref$setInputValue = _ref.setInputValue,
3841
- setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
3842
- onFocus = _ref.onFocus,
3843
- _ref$onBlur = _ref.onBlur,
3844
- onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
3845
- props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
3846
- var _useTheme = useTheme(),
3847
- getColor = _useTheme.getColor;
3848
- var IconColor = getColor('color.blueGray.700');
3849
- var isWithLabel = !!(isFocused && label);
3850
- useMemo(function () {
3851
- setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
3852
- }, [inputValue, isFocused, label, placeholder]);
3853
- var fieldStyles = Object.assign({
3854
- margin: 0,
3855
- paddingVertical: 8,
3856
- padddingHorizontal: 0,
3857
- width: '100%',
3858
- heigth: '100%',
3859
- border: 'none',
3860
- on: {
3861
- focus: {
3862
- outline: 'none'
3863
- }
3864
- },
3865
- fontSize: Typography.fontSizes[size],
3866
- backgroundColor: 'transparent',
3867
- color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
3868
- cursor: isDisabled ? 'not-allowed' : 'auto'
3869
- }, styles['field']);
3870
- var handleFocus = function handleFocus() {
3871
- setIsFocused(true);
3872
- if (onFocus) onFocus();
3873
- };
3874
- var handleHover = function handleHover() {
3875
- return setIsHovered(!isHovered);
3876
- };
3877
- var handleBlur = function handleBlur(event) {
3878
- onBlur(event);
3879
- setIsFocused(false);
3880
- };
3881
- var handleChange = function handleChange(event) {
3882
- if (typeof event === 'string') {
3883
- //for ios and android
3884
- setInputValue(event);
3885
- if (onChangeText) onChangeText(event);
3886
- } else {
3887
- //Web
3888
- setInputValue(event.target.value);
3889
- if (onChange) onChange(event);
3890
- }
3891
- };
3892
- var handleClear = function handleClear() {
3893
- setInputValue('');
3894
- //Web
3895
- if (onChange) {
3896
- onBlur({
3897
- target: {
3898
- name: name
3899
- }
3900
- });
3901
- onChange({
3902
- target: {
3903
- name: name,
3904
- value: ''
3905
- }
3906
- });
3907
- }
3908
- //for ios and android
3909
- if (typeof document === 'undefined' && onChangeText) onChangeText('');
3910
- };
3911
- return /*#__PURE__*/React.createElement(FieldContainer, {
3912
- helperText: helperText,
3913
- error: error,
3914
- styles: styles
3915
- }, /*#__PURE__*/React.createElement(FieldContent, {
3916
- label: label,
3917
- size: size,
3918
- error: error,
3919
- shape: shape,
3920
- styles: styles,
3921
- shadow: shadow,
3922
- variant: variant,
3923
- value: inputValue,
3924
- color: colorScheme,
3925
- isHovered: isHovered,
3926
- isDisabled: isDisabled,
3927
- isReadOnly: isReadOnly,
3928
- isFocused: isFocused,
3929
- isWithLabel: isWithLabel,
3930
- colorScheme: colorScheme,
3931
- onMouseEnter: handleHover,
3932
- onMouseLeave: handleHover
3933
- }, leftChild, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
3934
- htmlFor: id,
3935
- color: colorScheme,
3936
- error: error
3937
- }, styles), label), /*#__PURE__*/React.createElement(TextFieldInput, Object.assign({
3938
- id: id,
3939
- name: name,
3940
- value: inputValue,
3941
- readOnly: isReadOnly,
3942
- disabled: isDisabled,
3943
- autoFocus: isAutoFocus,
3944
- placeholder: hint,
3945
- onFocus: handleFocus,
3946
- onBlur: handleBlur,
3947
- autoComplete: "off"
3948
- }, fieldStyles, props, {
3949
- onChange: handleChange
3950
- }, onChangeText && {
3951
- onChangeText: handleChange
3952
- }))), (rightChild || isClearable && inputValue) && /*#__PURE__*/React.createElement(FieldIcons, null, rightChild && /*#__PURE__*/React.createElement(React.Fragment, null, rightChild), isClearable && inputValue && !isReadOnly && !isDisabled && /*#__PURE__*/React.createElement(CloseSvg, {
3953
- size: Typography.fontSizes[size],
3954
- color: IconColor,
3955
- onClick: handleClear
3956
- }))));
3957
- };
3958
-
3959
- var TextFieldComponent = function TextFieldComponent(props) {
3960
- var textFieldStates = useTextFieldState(props);
3961
- return /*#__PURE__*/React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
3962
- };
3963
- /**
3964
- * TextField is used to capture text data from users.
3965
- */
3966
- var TextField = TextFieldComponent;
3967
-
3968
4088
  var DefaultSizes = {
3969
4089
  xs: 14,
3970
4090
  sm: 18,
@@ -3983,7 +4103,7 @@ var DefaultSpeeds = {
3983
4103
  slow: 300
3984
4104
  };
3985
4105
 
3986
- var _excluded$q = ["size", "speed", "color"],
4106
+ var _excluded$r = ["size", "speed", "color"],
3987
4107
  _excluded2$1 = ["size", "speed", "color"],
3988
4108
  _excluded3$1 = ["size", "speed", "color"],
3989
4109
  _excluded4$1 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
@@ -3994,7 +4114,7 @@ var DefaultSpinner = function DefaultSpinner(_ref) {
3994
4114
  speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
3995
4115
  _ref$color = _ref.color,
3996
4116
  color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
3997
- props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
4117
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
3998
4118
  var theme = useTheme();
3999
4119
  var colorStyle = theme.getColor(color);
4000
4120
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
@@ -4160,13 +4280,13 @@ var LoaderView = function LoaderView(_ref4) {
4160
4280
  }, children));
4161
4281
  };
4162
4282
 
4163
- var LoadingComponent = function LoadingComponent(props) {
4283
+ var LoaderComponent = function LoaderComponent(props) {
4164
4284
  return /*#__PURE__*/React.createElement(LoaderView, Object.assign({}, props));
4165
4285
  };
4166
4286
  /**
4167
4287
  * It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
4168
4288
  */
4169
- var Loading = LoadingComponent;
4289
+ var Loader = LoaderComponent;
4170
4290
 
4171
4291
  var ContainerShapes = {
4172
4292
  sharp: {
@@ -4204,7 +4324,7 @@ var HeaderIconSizes = {
4204
4324
  xl: 28
4205
4325
  };
4206
4326
 
4207
- var _excluded$r = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
4327
+ var _excluded$s = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
4208
4328
  _excluded2$2 = ["children", "shadow", "isFullScreen", "shape"],
4209
4329
  _excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
4210
4330
  _excluded4$2 = ["children"],
@@ -4220,7 +4340,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
4220
4340
  onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
4221
4341
  _ref$position = _ref.position,
4222
4342
  position = _ref$position === void 0 ? 'center' : _ref$position,
4223
- props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
4343
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
4224
4344
  var setOpen = useModalStore(function (state) {
4225
4345
  return state.setOpen;
4226
4346
  });
@@ -4362,125 +4482,5 @@ Modal.Header = ModalHeader;
4362
4482
  Modal.Body = ModalBody;
4363
4483
  Modal.Footer = ModalFooter;
4364
4484
 
4365
- var HeadingSizes$1 = {
4366
- h1: {
4367
- fontSize: 96,
4368
- lineHeight: 112,
4369
- letterSpacing: -1.5
4370
- },
4371
- h2: {
4372
- fontSize: 60,
4373
- lineHeight: 71,
4374
- letterSpacing: -0.5
4375
- },
4376
- h3: {
4377
- fontSize: 48,
4378
- lineHeight: 57,
4379
- letterSpacing: 0
4380
- },
4381
- h4: {
4382
- fontSize: 34,
4383
- lineHeight: 40,
4384
- letterSpacing: 0.25
4385
- },
4386
- h5: {
4387
- fontSize: 24,
4388
- lineHeight: 28,
4389
- letterSpacing: 0
4390
- },
4391
- h6: {
4392
- fontSize: 20,
4393
- lineHeight: 24,
4394
- letterSpacing: 0.15
4395
- }
4396
- };
4397
-
4398
- var _excluded$s = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
4399
- var TextContent = function TextContent(_ref) {
4400
- var children = _ref.children,
4401
- isSub = _ref.isSub,
4402
- isSup = _ref.isSup;
4403
- 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);
4404
- };
4405
- var TruncateText = function TruncateText(_ref2) {
4406
- var text = _ref2.text,
4407
- _ref2$maxLines = _ref2.maxLines,
4408
- maxLines = _ref2$maxLines === void 0 ? 1 : _ref2$maxLines;
4409
- var containerRef = useRef(null);
4410
- var _useState = useState(text),
4411
- content = _useState[0],
4412
- setContent = _useState[1];
4413
- useEffect(function () {
4414
- var textContent = content;
4415
- var textNode = containerRef.current;
4416
- if (textNode) {
4417
- var contentHeight = textNode.offsetHeight;
4418
- var comLineHeight = getComputedStyle(textNode).lineHeight;
4419
- var lineHeight = comLineHeight !== 'normal' ? parseFloat(comLineHeight) : 20;
4420
- var maxHeight = Math.ceil(lineHeight * maxLines);
4421
- if (contentHeight > maxHeight) {
4422
- textContent = textContent.slice(0, -1);
4423
- } else if (contentHeight === maxHeight) {
4424
- if (content.length !== text.length) {
4425
- textContent = textContent.slice(0, -3) + '...';
4426
- }
4427
- }
4428
- setContent(textContent);
4429
- }
4430
- }, [maxLines, text, containerRef, content]);
4431
- return /*#__PURE__*/React.createElement("div", {
4432
- ref: containerRef
4433
- }, content);
4434
- };
4435
- var TextView = function TextView(_ref3) {
4436
- var children = _ref3.children,
4437
- heading = _ref3.heading,
4438
- maxLines = _ref3.maxLines,
4439
- _ref3$isItalic = _ref3.isItalic,
4440
- isItalic = _ref3$isItalic === void 0 ? false : _ref3$isItalic,
4441
- _ref3$isUnderlined = _ref3.isUnderlined,
4442
- isUnderlined = _ref3$isUnderlined === void 0 ? false : _ref3$isUnderlined,
4443
- _ref3$isSub = _ref3.isSub,
4444
- isSub = _ref3$isSub === void 0 ? false : _ref3$isSub,
4445
- _ref3$isSup = _ref3.isSup,
4446
- isSup = _ref3$isSup === void 0 ? false : _ref3$isSup,
4447
- _ref3$isStriked = _ref3.isStriked,
4448
- isStriked = _ref3$isStriked === void 0 ? false : _ref3$isStriked,
4449
- _ref3$isTruncated = _ref3.isTruncated,
4450
- isTruncated = _ref3$isTruncated === void 0 ? false : _ref3$isTruncated,
4451
- _ref3$weight = _ref3.weight,
4452
- weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
4453
- _ref3$size = _ref3.size,
4454
- size = _ref3$size === void 0 ? 'md' : _ref3$size,
4455
- props = _objectWithoutPropertiesLoose(_ref3, _excluded$s);
4456
- var headingStyles = heading ? HeadingSizes$1[heading] : {};
4457
- var noLineBreak = isSub || isSup ? {
4458
- display: 'inline'
4459
- } : {};
4460
- var fontSize = Typography.fontSizes[size];
4461
- return /*#__PURE__*/React.createElement(Element, Object.assign({
4462
- role: "text",
4463
- fontSize: fontSize,
4464
- lineHeight: Typography.lineHeights[size],
4465
- fontStyle: isItalic ? 'italic' : 'normal',
4466
- fontWeight: Typography.fontWeights[weight],
4467
- textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
4468
- }, noLineBreak, headingStyles, props), isTruncated && maxLines && typeof children === 'string' ? /*#__PURE__*/React.createElement(TruncateText, {
4469
- text: children,
4470
- maxLines: maxLines
4471
- }) : /*#__PURE__*/React.createElement(TextContent, Object.assign({
4472
- isSub: isSub,
4473
- isSup: isSup
4474
- }, props), children));
4475
- };
4476
-
4477
- var TextComponent = function TextComponent(props) {
4478
- return /*#__PURE__*/React.createElement(TextView, Object.assign({}, props));
4479
- };
4480
- /**
4481
- * 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.
4482
- */
4483
- var Text = TextComponent;
4484
-
4485
- export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loading, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
4485
+ export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loader, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
4486
4486
  //# sourceMappingURL=web.esm.js.map