@app-studio/web 0.1.15 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) 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 +9 -9
  14. package/dist/components/Form/Checkbox/examples/ColorScheme.d.ts +2 -2
  15. package/dist/components/Form/Checkbox/examples/Default.d.ts +2 -2
  16. package/dist/components/Form/Checkbox/examples/DisabledInput.d.ts +2 -2
  17. package/dist/components/Form/Checkbox/examples/ErrorCheckbox.d.ts +2 -2
  18. package/dist/components/Form/Checkbox/examples/FormCheckout.d.ts +2 -2
  19. package/dist/components/Form/Checkbox/examples/IconCheckbox.d.ts +2 -2
  20. package/dist/components/Form/Checkbox/examples/IndeterminateCheckbox.d.ts +2 -2
  21. package/dist/components/Form/Checkbox/examples/ReadOnlyInput.d.ts +2 -2
  22. package/dist/components/Form/Checkbox/examples/Shadow.d.ts +2 -2
  23. package/dist/components/Form/Checkbox/examples/SizeInput.d.ts +2 -2
  24. package/dist/components/Form/Checkbox/examples/StylesInput.d.ts +2 -2
  25. package/dist/components/Form/Checkbox/examples/index.d.ts +11 -11
  26. package/dist/components/Form/CountryPicker/examples/Color.d.ts +2 -2
  27. package/dist/components/Form/CountryPicker/examples/Default.d.ts +2 -2
  28. package/dist/components/Form/CountryPicker/examples/Disabled.d.ts +2 -2
  29. package/dist/components/Form/CountryPicker/examples/Error.d.ts +2 -2
  30. package/dist/components/Form/CountryPicker/examples/Form.d.ts +2 -2
  31. package/dist/components/Form/CountryPicker/examples/Formik.d.ts +2 -2
  32. package/dist/components/Form/CountryPicker/examples/HelperText.d.ts +2 -2
  33. package/dist/components/Form/CountryPicker/examples/ReadOnlyInput.d.ts +2 -2
  34. package/dist/components/Form/CountryPicker/examples/Shadow.d.ts +2 -2
  35. package/dist/components/Form/CountryPicker/examples/Shape.d.ts +2 -2
  36. package/dist/components/Form/CountryPicker/examples/SizeInput.d.ts +2 -2
  37. package/dist/components/Form/CountryPicker/examples/StylesInput.d.ts +2 -2
  38. package/dist/components/Form/CountryPicker/examples/Variant.d.ts +2 -2
  39. package/dist/components/Form/CountryPicker/examples/index.d.ts +12 -12
  40. package/dist/components/Form/DatePicker/examples/ColorScheme.d.ts +2 -2
  41. package/dist/components/Form/DatePicker/examples/Default.d.ts +2 -2
  42. package/dist/components/Form/DatePicker/examples/DisabledInput.d.ts +2 -2
  43. package/dist/components/Form/DatePicker/examples/ErrorCheckbox.d.ts +2 -2
  44. package/dist/components/Form/DatePicker/examples/FormCheckout.d.ts +2 -2
  45. package/dist/components/Form/DatePicker/examples/Formik.d.ts +2 -2
  46. package/dist/components/Form/DatePicker/examples/ReadOnlyInput.d.ts +2 -2
  47. package/dist/components/Form/DatePicker/examples/Shadow.d.ts +2 -2
  48. package/dist/components/Form/DatePicker/examples/SizeInput.d.ts +2 -2
  49. package/dist/components/Form/DatePicker/examples/StylesInput.d.ts +2 -2
  50. package/dist/components/Form/DatePicker/examples/helperTextDatePicker.d.ts +2 -2
  51. package/dist/components/Form/DatePicker/examples/index.d.ts +11 -11
  52. package/dist/components/Form/Password/Password/Password.props.d.ts +1 -1
  53. package/dist/components/Form/Password/example/Default.d.ts +2 -2
  54. package/dist/components/Form/Password/example/DisabledInput.d.ts +2 -2
  55. package/dist/components/Form/Password/example/ErrorInput.d.ts +2 -2
  56. package/dist/components/Form/Password/example/FormikErrorInput.d.ts +2 -2
  57. package/dist/components/Form/Password/example/FormikHelperText.d.ts +2 -2
  58. package/dist/components/Form/Password/example/HelperText.d.ts +2 -2
  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/examples/ChildSwitch.d.ts +2 -2
  72. package/dist/components/Form/Switch/examples/ColorScheme.d.ts +2 -2
  73. package/dist/components/Form/Switch/examples/Default.d.ts +2 -2
  74. package/dist/components/Form/Switch/examples/DisabledInput.d.ts +2 -2
  75. package/dist/components/Form/Switch/examples/FormSwitch.d.ts +2 -2
  76. package/dist/components/Form/Switch/examples/Formik.d.ts +2 -2
  77. package/dist/components/Form/Switch/examples/ReadOnlyInput.d.ts +2 -2
  78. package/dist/components/Form/Switch/examples/Shadow.d.ts +2 -2
  79. package/dist/components/Form/Switch/examples/SizeInput.d.ts +2 -2
  80. package/dist/components/Form/Switch/examples/StylesInput.d.ts +2 -2
  81. package/dist/components/Form/TextArea/examples/ColorScheme.d.ts +2 -2
  82. package/dist/components/Form/TextArea/examples/Default.d.ts +2 -2
  83. package/dist/components/Form/TextArea/examples/DisabledInput.d.ts +2 -2
  84. package/dist/components/Form/TextArea/examples/ErrorInput.d.ts +2 -2
  85. package/dist/components/Form/TextArea/examples/FormikErrorInput.d.ts +2 -2
  86. package/dist/components/Form/TextArea/examples/FormikHelperText.d.ts +2 -2
  87. package/dist/components/Form/TextArea/examples/HelperText.d.ts +2 -2
  88. package/dist/components/Form/TextArea/examples/LabelInput.d.ts +2 -2
  89. package/dist/components/Form/TextArea/examples/MaxRowCol.d.ts +2 -2
  90. package/dist/components/Form/TextArea/examples/Placeholder.d.ts +2 -2
  91. package/dist/components/Form/TextArea/examples/ReadOnlyInput.d.ts +2 -2
  92. package/dist/components/Form/TextArea/examples/ShadowArea.d.ts +2 -2
  93. package/dist/components/Form/TextArea/examples/ShapeInput.d.ts +2 -2
  94. package/dist/components/Form/TextArea/examples/SizeInput.d.ts +2 -2
  95. package/dist/components/Form/TextArea/examples/StylesInput.d.ts +2 -2
  96. package/dist/components/Form/TextArea/examples/VariantsInputs.d.ts +2 -2
  97. package/dist/components/Form/TextArea/examples/index.d.ts +15 -15
  98. package/dist/components/Form/TextField/examples/ClearInput.d.ts +2 -2
  99. package/dist/components/Form/TextField/examples/ColorScheme.d.ts +2 -2
  100. package/dist/components/Form/TextField/examples/Default.d.ts +2 -2
  101. package/dist/components/Form/TextField/examples/DisabledInput.d.ts +2 -2
  102. package/dist/components/Form/TextField/examples/ErrorInput.d.ts +2 -2
  103. package/dist/components/Form/TextField/examples/FormikErrorInput.d.ts +2 -2
  104. package/dist/components/Form/TextField/examples/FormikHelperText.d.ts +2 -2
  105. package/dist/components/Form/TextField/examples/HelperText.d.ts +2 -2
  106. package/dist/components/Form/TextField/examples/LabelInput.d.ts +2 -2
  107. package/dist/components/Form/TextField/examples/LeftChild.d.ts +2 -2
  108. package/dist/components/Form/TextField/examples/Placeholder.d.ts +2 -2
  109. package/dist/components/Form/TextField/examples/ReadOnlyInput.d.ts +2 -2
  110. package/dist/components/Form/TextField/examples/RightChild.d.ts +2 -2
  111. package/dist/components/Form/TextField/examples/ShapeInput.d.ts +2 -2
  112. package/dist/components/Form/TextField/examples/SizeInput.d.ts +2 -2
  113. package/dist/components/Form/TextField/examples/StylesInput.d.ts +2 -2
  114. package/dist/components/Form/TextField/examples/VariantsInputs.d.ts +2 -2
  115. package/dist/components/Form/TextField/examples/index.d.ts +17 -17
  116. package/dist/components/Layout/Horizontal/examples/Default.d.ts +2 -2
  117. package/dist/components/Layout/Horizontal/examples/Justify.d.ts +2 -2
  118. package/dist/components/Layout/Horizontal/examples/Reversed.d.ts +2 -2
  119. package/dist/components/Layout/Horizontal/examples/Wrap.d.ts +2 -2
  120. package/dist/components/Layout/Horizontal/examples/index.d.ts +4 -4
  121. package/dist/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.d.ts +1 -1
  122. package/dist/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -1
  123. package/dist/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.d.ts +1 -1
  124. package/dist/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.d.ts +1 -1
  125. package/dist/components/Layout/Input/HelperText/HelperText.props.d.ts +1 -1
  126. package/dist/components/Layout/Input/index.d.ts +7 -7
  127. package/dist/components/Layout/Vertical/examples/Default.d.ts +2 -2
  128. package/dist/components/Layout/Vertical/examples/Justify.d.ts +2 -2
  129. package/dist/components/Layout/Vertical/examples/Reversed.d.ts +2 -2
  130. package/dist/components/Layout/Vertical/examples/Wrap.d.ts +2 -2
  131. package/dist/components/Link/examples/Default.d.ts +2 -2
  132. package/dist/components/Link/examples/IsExternal.d.ts +2 -2
  133. package/dist/components/Link/examples/Underline.d.ts +2 -2
  134. package/dist/components/Loader/Loader.d.ts +1 -1
  135. package/dist/components/Loader/examples/ColorLoader.d.ts +2 -2
  136. package/dist/components/Loader/examples/DefaultLoader.d.ts +2 -2
  137. package/dist/components/Loader/examples/PositionLoader.d.ts +2 -2
  138. package/dist/components/Loader/examples/SizeLoader.d.ts +2 -2
  139. package/dist/components/Loader/examples/SpeedLoader.d.ts +2 -2
  140. package/dist/components/Loader/examples/TextLoader.d.ts +2 -2
  141. package/dist/components/Loader/examples/VariantLoader.d.ts +2 -2
  142. package/dist/components/Loader/examples/index.d.ts +7 -7
  143. package/dist/components/Modal/Examples/BlurModal.d.ts +2 -2
  144. package/dist/components/Modal/Examples/CloseButtonModal.d.ts +2 -2
  145. package/dist/components/Modal/Examples/DefaultModal.d.ts +2 -2
  146. package/dist/components/Modal/Examples/FullScreenModal.d.ts +2 -2
  147. package/dist/components/Modal/Examples/ModalPosition.d.ts +2 -2
  148. package/dist/components/Modal/Examples/PreventCloseModal.d.ts +2 -2
  149. package/dist/components/Modal/Examples/ScrollModal.d.ts +2 -2
  150. package/dist/components/Modal/Examples/ShadowModal.d.ts +2 -2
  151. package/dist/components/Modal/Examples/VariantModal.d.ts +2 -2
  152. package/dist/components/Modal/Examples/index.d.ts +9 -9
  153. package/dist/features.d.ts +2 -2
  154. package/dist/pages/button.page.d.ts +2 -2
  155. package/dist/pages/center.page.d.ts +2 -2
  156. package/dist/pages/checkbox.page.d.ts +2 -2
  157. package/dist/pages/components.page.d.ts +2 -2
  158. package/dist/pages/countryPicker.page.d.ts +2 -2
  159. package/dist/pages/datePicker.page.d.ts +2 -2
  160. package/dist/pages/home.page.d.ts +2 -2
  161. package/dist/pages/horizontal.page.d.ts +2 -2
  162. package/dist/pages/input.page.d.ts +2 -2
  163. package/dist/pages/link.page.d.ts +2 -2
  164. package/dist/pages/loader.page.d.ts +2 -2
  165. package/dist/pages/modal.page.d.ts +2 -2
  166. package/dist/pages/password.page.d.ts +2 -2
  167. package/dist/pages/select.page.d.ts +2 -2
  168. package/dist/pages/switch.page.d.ts +2 -2
  169. package/dist/pages/text.page.d.ts +2 -2
  170. package/dist/pages/textArea.page.d.ts +2 -2
  171. package/dist/pages/vertical.page.d.ts +2 -2
  172. package/dist/routes/routes.d.ts +2 -2
  173. package/dist/web.cjs.development.js +1728 -1279
  174. package/dist/web.cjs.development.js.map +1 -1
  175. package/dist/web.cjs.production.min.js +1 -1
  176. package/dist/web.cjs.production.min.js.map +1 -1
  177. package/dist/web.esm.js +1694 -1245
  178. package/dist/web.esm.js.map +1 -1
  179. package/package.json +1 -2
  180. package/dist/components/Button/examples/LoadingButtons.d.ts +0 -2
package/dist/web.esm.js CHANGED
@@ -1,28 +1,16 @@
1
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';
2
+ import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
3
+ import { View, Element, Typography, useTheme, Input } from 'app-studio';
4
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 './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';
5
+ import { Link as Link$1 } from 'react-router-dom';
8
6
  import 'core-js/modules/es6.array.map.js';
9
7
  import 'core-js/modules/es6.array.filter.js';
10
8
  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';
9
+ import 'core-js/modules/es6.array.slice.js';
14
10
  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
11
  import 'core-js/modules/es6.string.includes.js';
20
12
  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
13
  import { useModalStore } from './store/useModalStore';
25
- import 'core-js/modules/es6.array.slice.js';
26
14
 
27
15
  var useButtonState = function useButtonState() {
28
16
  var _React$useState = React.useState(false),
@@ -47,6 +35,346 @@ function _objectWithoutPropertiesLoose(source, excluded) {
47
35
  return target;
48
36
  }
49
37
 
38
+ var useLinkState = function useLinkState() {
39
+ var _useState = useState(false),
40
+ isHovered = _useState[0],
41
+ setIsHovered = _useState[1];
42
+ return {
43
+ isHovered: isHovered,
44
+ setIsHovered: setIsHovered
45
+ };
46
+ };
47
+
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"];
75
+ var CenterView = function CenterView(_ref) {
76
+ var children = _ref.children,
77
+ wrap = _ref.wrap,
78
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
79
+ return /*#__PURE__*/React.createElement(View, Object.assign({
80
+ display: "flex",
81
+ justifyContent: "center",
82
+ alignItems: "center",
83
+ flexWrap: wrap
84
+ }, props), children);
85
+ };
86
+
87
+ /**
88
+ * The Center component is a React functional component that provides a centered layout for its children using flexbox.
89
+ */
90
+ var CenterComponent = function CenterComponent(props) {
91
+ return /*#__PURE__*/React.createElement(CenterView, Object.assign({}, props));
92
+ };
93
+ var Center = CenterComponent;
94
+
95
+ var _excluded$2 = ["size", "color"];
96
+ var ArrowDownSvg = function ArrowDownSvg(_ref) {
97
+ var _ref$size = _ref.size,
98
+ size = _ref$size === void 0 ? 64 : _ref$size,
99
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
100
+ return /*#__PURE__*/React.createElement(Center, {
101
+ width: size + "px",
102
+ height: size + "px"
103
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
104
+ viewBox: "0 -4.5 20 20",
105
+ version: "1.1",
106
+ fill: "#000000"
107
+ }, props), /*#__PURE__*/React.createElement("g", {
108
+ id: "SVGRepo_bgCarrier",
109
+ strokeWidth: "0"
110
+ }), /*#__PURE__*/React.createElement("g", {
111
+ id: "SVGRepo_tracerCarrier",
112
+ strokeLinecap: "round",
113
+ strokeLinejoin: "round"
114
+ }), /*#__PURE__*/React.createElement("g", {
115
+ id: "SVGRepo_iconCarrier"
116
+ }, /*#__PURE__*/React.createElement("title", null, "arrow_down [#338]"), " ", /*#__PURE__*/React.createElement("desc", null, "Created with Sketch."), /*#__PURE__*/React.createElement("defs", null, " "), /*#__PURE__*/React.createElement("g", {
117
+ id: "Page-1",
118
+ stroke: "none",
119
+ strokeWidth: "1",
120
+ fill: "none",
121
+ fillRule: "evenodd"
122
+ }, /*#__PURE__*/React.createElement("g", {
123
+ id: "Dribbble-Light-Preview",
124
+ transform: "translate(-220.000000, -6684.000000)",
125
+ fill: "#000000"
126
+ }, /*#__PURE__*/React.createElement("g", {
127
+ id: "icons",
128
+ transform: "translate(56.000000, 160.000000)"
129
+ }, /*#__PURE__*/React.createElement("path", {
130
+ d: "M164.292308,6524.36583 L164.292308,6524.36583 C163.902564,6524.77071 163.902564,6525.42619 164.292308,6525.83004 L172.555873,6534.39267 C173.33636,6535.20244 174.602528,6535.20244 175.383014,6534.39267 L183.70754,6525.76791 C184.093286,6525.36716 184.098283,6524.71997 183.717533,6524.31405 C183.328789,6523.89985 182.68821,6523.89467 182.29347,6524.30266 L174.676479,6532.19636 C174.285736,6532.60124 173.653152,6532.60124 173.262409,6532.19636 L165.705379,6524.36583 C165.315635,6523.96094 164.683051,6523.96094 164.292308,6524.36583",
131
+ id: "arrow_down-[#338]"
132
+ })))))));
133
+ };
134
+
135
+ var _excluded$3 = ["size", "color"];
136
+ var ArrowUpSvg = function ArrowUpSvg(_ref) {
137
+ var _ref$size = _ref.size,
138
+ size = _ref$size === void 0 ? 64 : _ref$size,
139
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
140
+ return /*#__PURE__*/React.createElement(Center, {
141
+ width: size + "px",
142
+ height: size + "px"
143
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
144
+ width: size + "px",
145
+ height: size + "px",
146
+ viewBox: "0 -4.5 20 20",
147
+ version: "1.1",
148
+ fill: "#000000"
149
+ }, props), /*#__PURE__*/React.createElement("g", {
150
+ id: "SVGRepo_bgCarrier",
151
+ strokeWidth: "0"
152
+ }), /*#__PURE__*/React.createElement("g", {
153
+ id: "SVGRepo_tracerCarrier",
154
+ strokeLinecap: "round",
155
+ strokeLinejoin: "round"
156
+ }), /*#__PURE__*/React.createElement("g", {
157
+ id: "SVGRepo_iconCarrier"
158
+ }, /*#__PURE__*/React.createElement("title", null, "arrow_up [#337]"), " ", /*#__PURE__*/React.createElement("desc", null, "Created with Sketch."), /*#__PURE__*/React.createElement("defs", null, " "), /*#__PURE__*/React.createElement("g", {
159
+ id: "Page-1",
160
+ stroke: "none",
161
+ strokeWidth: "1",
162
+ fill: "none",
163
+ fillRule: "evenodd"
164
+ }, /*#__PURE__*/React.createElement("g", {
165
+ id: "Dribbble-Light-Preview",
166
+ transform: "translate(-260.000000, -6684.000000)",
167
+ fill: "#000000"
168
+ }, /*#__PURE__*/React.createElement("g", {
169
+ id: "icons",
170
+ transform: "translate(56.000000, 160.000000)"
171
+ }, /*#__PURE__*/React.createElement("path", {
172
+ d: "M223.707692,6534.63378 L223.707692,6534.63378 C224.097436,6534.22888 224.097436,6533.57338 223.707692,6533.16951 L215.444127,6524.60657 C214.66364,6523.79781 213.397472,6523.79781 212.616986,6524.60657 L204.29246,6533.23165 C203.906714,6533.6324 203.901717,6534.27962 204.282467,6534.68555 C204.671211,6535.10081 205.31179,6535.10495 205.70653,6534.69695 L213.323521,6526.80297 C213.714264,6526.39807 214.346848,6526.39807 214.737591,6526.80297 L222.294621,6534.63378 C222.684365,6535.03868 223.317949,6535.03868 223.707692,6534.63378",
173
+ id: "arrow_up-[#337]"
174
+ })))))));
175
+ };
176
+
177
+ var _excluded$4 = ["size", "color"];
178
+ var CheckSvg = function CheckSvg(_ref) {
179
+ var _ref$size = _ref.size,
180
+ size = _ref$size === void 0 ? 64 : _ref$size,
181
+ _ref$color = _ref.color,
182
+ color = _ref$color === void 0 ? 'white' : _ref$color,
183
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
184
+ return /*#__PURE__*/React.createElement(Center, {
185
+ width: size + "px",
186
+ height: size + "px"
187
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
188
+ width: size + "px",
189
+ height: size + "px",
190
+ viewBox: "0 0 24 24",
191
+ fill: "none",
192
+ xmlns: "http://www.w3.org/2000/svg"
193
+ }, props), /*#__PURE__*/React.createElement("g", {
194
+ id: "SVGRepo_bgCarrier",
195
+ strokeWidth: "0"
196
+ }), /*#__PURE__*/React.createElement("g", {
197
+ id: "SVGRepo_tracerCarrier",
198
+ strokeLinecap: "round",
199
+ strokeLinejoin: "round",
200
+ stroke: "#CCCCCC",
201
+ strokeWidth: "0.048"
202
+ }), /*#__PURE__*/React.createElement("g", {
203
+ id: "SVGRepo_iconCarrier"
204
+ }, /*#__PURE__*/React.createElement("path", {
205
+ d: "M17.0001 9L10 16L7 13",
206
+ stroke: color,
207
+ strokeWidth: "1.5",
208
+ strokeLinecap: "round",
209
+ strokeLinejoin: "round"
210
+ }))));
211
+ };
212
+
213
+ var _excluded$5 = ["size", "color"];
214
+ var CloseSvg = function CloseSvg(_ref) {
215
+ var _ref$size = _ref.size,
216
+ size = _ref$size === void 0 ? 64 : _ref$size,
217
+ _ref$color = _ref.color,
218
+ color = _ref$color === void 0 ? 'white' : _ref$color,
219
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
220
+ return /*#__PURE__*/React.createElement(Center, {
221
+ width: size + "px",
222
+ height: size + "px"
223
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
224
+ width: size + "px",
225
+ height: size + "px",
226
+ viewBox: "0 0 1024 1024",
227
+ xmlns: "http://www.w3.org/2000/svg",
228
+ fill: "#000000"
229
+ }, props), /*#__PURE__*/React.createElement("g", {
230
+ id: "SVGRepo_bgCarrier",
231
+ strokeWidth: "0"
232
+ }), /*#__PURE__*/React.createElement("g", {
233
+ id: "SVGRepo_tracerCarrier",
234
+ strokeLinecap: "round",
235
+ strokeLinejoin: "round"
236
+ }), /*#__PURE__*/React.createElement("g", {
237
+ id: "SVGRepo_iconCarrier"
238
+ }, /*#__PURE__*/React.createElement("path", {
239
+ fill: color,
240
+ d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
241
+ }))));
242
+ };
243
+
244
+ var _excluded$6 = ["size", "color"];
245
+ var ExternalLinkSvg = function ExternalLinkSvg(_ref) {
246
+ var _ref$size = _ref.size,
247
+ size = _ref$size === void 0 ? 64 : _ref$size,
248
+ _ref$color = _ref.color,
249
+ color = _ref$color === void 0 ? 'white' : _ref$color,
250
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
251
+ return /*#__PURE__*/React.createElement(Center, {
252
+ width: size + "px",
253
+ height: size + "px"
254
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
255
+ fill: color,
256
+ width: size + "px",
257
+ height: size + "px",
258
+ viewBox: "0 0 50 50",
259
+ xmlns: "http://www.w3.org/2000/svg",
260
+ stroke: color
261
+ }, props), /*#__PURE__*/React.createElement("g", {
262
+ id: "SVGRepo_bgCarrier",
263
+ strokeWidth: "0"
264
+ }), /*#__PURE__*/React.createElement("g", {
265
+ id: "SVGRepo_tracerCarrier",
266
+ strokeLinecap: "round",
267
+ strokeLinejoin: "round"
268
+ }), /*#__PURE__*/React.createElement("g", {
269
+ id: "SVGRepo_iconCarrier"
270
+ }, /*#__PURE__*/React.createElement("path", {
271
+ d: "M38.288 10.297l1.414 1.415-14.99 14.99-1.414-1.414z"
272
+ }), /*#__PURE__*/React.createElement("path", {
273
+ d: "M40 20h-2v-8h-8v-2h10z"
274
+ }), /*#__PURE__*/React.createElement("path", {
275
+ d: "M35 38H15c-1.7 0-3-1.3-3-3V15c0-1.7 1.3-3 3-3h11v2H15c-.6 0-1 .4-1 1v20c0 .6.4 1 1 1h20c.6 0 1-.4 1-1V24h2v11c0 1.7-1.3 3-3 3z"
276
+ }))));
277
+ };
278
+
279
+ var _excluded$7 = ["size", "color"];
280
+ var IndeterminateSvg = function IndeterminateSvg(_ref) {
281
+ var _ref$size = _ref.size,
282
+ size = _ref$size === void 0 ? 64 : _ref$size,
283
+ _ref$color = _ref.color,
284
+ color = _ref$color === void 0 ? 'white' : _ref$color,
285
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
286
+ return /*#__PURE__*/React.createElement(Center, {
287
+ width: size + "px",
288
+ height: size + "px"
289
+ }, /*#__PURE__*/React.createElement("svg", Object.assign({
290
+ viewBox: "0 0 24 24",
291
+ fill: "none",
292
+ xmlns: "http://www.w3.org/2000/svg"
293
+ }, props), /*#__PURE__*/React.createElement("g", {
294
+ id: "SVGRepo_bgCarrier",
295
+ strokeWidth: "0"
296
+ }), /*#__PURE__*/React.createElement("g", {
297
+ id: "SVGRepo_tracerCarrier",
298
+ strokeLinecap: "round",
299
+ strokeLinejoin: "round"
300
+ }), /*#__PURE__*/React.createElement("g", {
301
+ id: "SVGRepo_iconCarrier"
302
+ }, /*#__PURE__*/React.createElement("path", {
303
+ d: "M7 12L17 12",
304
+ stroke: color,
305
+ strokeWidth: "1.5",
306
+ strokeLinecap: "round",
307
+ strokeLinejoin: "round"
308
+ }), ' ')));
309
+ };
310
+
311
+ var IconSizes = {
312
+ xs: 12,
313
+ sm: 14,
314
+ md: 16,
315
+ lg: 18,
316
+ xl: 20,
317
+ '2xl': 24,
318
+ '3xl': 30,
319
+ '4xl': 36,
320
+ '5xl': 48,
321
+ '6xl': 64
322
+ };
323
+
324
+ var _excluded$8 = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "colorScheme", "styles", "setIsHovered"];
325
+ var LinkView = function LinkView(_ref) {
326
+ var children = _ref.children,
327
+ _ref$href = _ref.href,
328
+ href = _ref$href === void 0 ? '/' : _ref$href,
329
+ _ref$iconSize = _ref.iconSize,
330
+ iconSize = _ref$iconSize === void 0 ? 'sm' : _ref$iconSize,
331
+ _ref$underline = _ref.underline,
332
+ underline = _ref$underline === void 0 ? 'default' : _ref$underline,
333
+ _ref$isHovered = _ref.isHovered,
334
+ isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
335
+ _ref$isExternal = _ref.isExternal,
336
+ isExternal = _ref$isExternal === void 0 ? false : _ref$isExternal,
337
+ _ref$colorScheme = _ref.colorScheme,
338
+ colorScheme = _ref$colorScheme === void 0 ? '#0072F5' : _ref$colorScheme,
339
+ _ref$styles = _ref.styles,
340
+ styles = _ref$styles === void 0 ? {
341
+ icon: {},
342
+ text: {}
343
+ } : _ref$styles,
344
+ _ref$setIsHovered = _ref.setIsHovered,
345
+ setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
346
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
347
+ var handleHover = function handleHover() {
348
+ if (underline === 'hover') setIsHovered(true);
349
+ };
350
+ return /*#__PURE__*/React.createElement(Link$1, {
351
+ to: href,
352
+ target: isExternal ? '_blank' : '_self'
353
+ }, /*#__PURE__*/React.createElement(Element, Object.assign({
354
+ color: colorScheme,
355
+ onMouseEnter: handleHover,
356
+ onMouseLeave: handleHover,
357
+ textDecoration: isHovered || underline === 'underline' ? 'underline !important' : 'none'
358
+ }, styles.text, props), /*#__PURE__*/React.createElement(Horizontal, {
359
+ gap: 3,
360
+ alignItems: "center",
361
+ wrap: "nowrap"
362
+ }, children, isExternal && /*#__PURE__*/React.createElement(ExternalLinkSvg, {
363
+ color: colorScheme,
364
+ size: IconSizes[iconSize],
365
+ style: styles.icon
366
+ }))));
367
+ };
368
+
369
+ var LinkComponent = function LinkComponent(props) {
370
+ var linkStates = useLinkState();
371
+ return /*#__PURE__*/React.createElement(LinkView, Object.assign({}, linkStates, props));
372
+ };
373
+ /**
374
+ * Link allows users to navigate from page to page. It have a similar appearance as the hyperlink.
375
+ */
376
+ var Link = LinkComponent;
377
+
50
378
  var ButtonSizes = {
51
379
  xs: {
52
380
  width: 79,
@@ -109,7 +437,7 @@ var ButtonShapes = {
109
437
  rounded: 4,
110
438
  pillShaped: 24
111
439
  };
112
- var IconSizes = {
440
+ var IconSizes$1 = {
113
441
  xs: {
114
442
  width: 24,
115
443
  height: 24,
@@ -137,7 +465,7 @@ var IconSizes = {
137
465
  }
138
466
  };
139
467
 
140
- var _excluded = ["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"];
141
469
  var ButtonView = function ButtonView(_ref) {
142
470
  var _props$onClick;
143
471
  var icon = _ref.icon,
@@ -151,8 +479,8 @@ var ButtonView = function ButtonView(_ref) {
151
479
  isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
152
480
  _ref$isIconRounded = _ref.isIconRounded,
153
481
  isIconRounded = _ref$isIconRounded === void 0 ? false : _ref$isIconRounded,
154
- _ref$isLoading = _ref.isLoading,
155
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
482
+ _ref$isLoader = _ref.isLoader,
483
+ isLoader = _ref$isLoader === void 0 ? false : _ref$isLoader,
156
484
  _ref$isDisabled = _ref.isDisabled,
157
485
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
158
486
  _ref$size = _ref.size,
@@ -167,8 +495,8 @@ var ButtonView = function ButtonView(_ref) {
167
495
  shape = _ref$shape === void 0 ? 'rounded' : _ref$shape,
168
496
  _ref$onClick = _ref.onClick,
169
497
  onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
170
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
171
- var isActive = !(isDisabled || isLoading);
498
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
499
+ var isActive = !(isDisabled || isLoader);
172
500
  var defaultNativeProps = {
173
501
  disabled: !isActive
174
502
  };
@@ -203,9 +531,9 @@ var ButtonView = function ButtonView(_ref) {
203
531
  width: isAuto ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
204
532
  };
205
533
  var changePadding = {
206
- padding: isIconRounded ? IconSizes[size].padding : ButtonSizes[size].padding
534
+ padding: isIconRounded ? IconSizes$1[size].padding : ButtonSizes[size].padding
207
535
  };
208
- 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);
209
537
  return /*#__PURE__*/React.createElement(Element, Object.assign({
210
538
  gap: 8,
211
539
  as: "button",
@@ -220,7 +548,7 @@ var ButtonView = function ButtonView(_ref) {
220
548
  borderRadius: ButtonShapes[shape],
221
549
  onClick: (_props$onClick = props.onClick) != null ? _props$onClick : onClick,
222
550
  cursor: isActive ? 'pointer' : 'default'
223
- }, defaultNativeProps, buttonSizeStyles, buttonVariant, scaleWidth, changePadding, shadow, props), variant === 'link' && externalHref ? /*#__PURE__*/React.createElement(Link$1, {
551
+ }, defaultNativeProps, buttonSizeStyles, buttonVariant, scaleWidth, changePadding, shadow, props), variant === 'link' && externalHref ? /*#__PURE__*/React.createElement(Link, {
224
552
  href: externalHref,
225
553
  textDecorationColor: colorScheme,
226
554
  colorScheme: colorScheme,
@@ -263,25 +591,89 @@ var useCheckboxState = function useCheckboxState(_ref) {
263
591
  };
264
592
  };
265
593
 
266
- var Sizes = {
267
- xs: {
268
- height: 8,
269
- width: 8
270
- },
271
- sm: {
272
- height: 12,
273
- width: 12
594
+ var HeadingSizes = {
595
+ h1: {
596
+ fontSize: 96,
597
+ lineHeight: 112,
598
+ letterSpacing: -1.5
274
599
  },
275
- md: {
276
- height: 18,
277
- width: 18
600
+ h2: {
601
+ fontSize: 60,
602
+ lineHeight: 71,
603
+ letterSpacing: -0.5
278
604
  },
279
- lg: {
280
- height: 24,
281
- width: 24
605
+ h3: {
606
+ fontSize: 48,
607
+ lineHeight: 57,
608
+ letterSpacing: 0
282
609
  },
283
- xl: {
284
- height: 30,
610
+ h4: {
611
+ fontSize: 34,
612
+ lineHeight: 40,
613
+ letterSpacing: 0.25
614
+ },
615
+ h5: {
616
+ fontSize: 24,
617
+ lineHeight: 28,
618
+ letterSpacing: 0
619
+ },
620
+ h6: {
621
+ fontSize: 20,
622
+ lineHeight: 24,
623
+ letterSpacing: 0.15
624
+ }
625
+ };
626
+
627
+ var _excluded$a = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
628
+ var LabelView = function LabelView(_ref) {
629
+ var children = _ref.children,
630
+ heading = _ref.heading,
631
+ _ref$isItalic = _ref.isItalic,
632
+ isItalic = _ref$isItalic === void 0 ? false : _ref$isItalic,
633
+ _ref$isUnderlined = _ref.isUnderlined,
634
+ isUnderlined = _ref$isUnderlined === void 0 ? false : _ref$isUnderlined,
635
+ _ref$isStriked = _ref.isStriked,
636
+ isStriked = _ref$isStriked === void 0 ? false : _ref$isStriked,
637
+ _ref$weight = _ref.weight,
638
+ weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
639
+ _ref$size = _ref.size,
640
+ size = _ref$size === void 0 ? 'sm' : _ref$size,
641
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
642
+ var headingStyles = heading ? HeadingSizes[heading] : {};
643
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
644
+ as: "label",
645
+ width: "100%",
646
+ fontSize: size,
647
+ fontStyle: isItalic ? 'italic' : 'normal',
648
+ fontWeight: Typography.fontWeights[weight],
649
+ textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
650
+ }, headingStyles, props), children);
651
+ };
652
+
653
+ var LabelComponent = function LabelComponent(props) {
654
+ return /*#__PURE__*/React.createElement(LabelView, Object.assign({}, props));
655
+ };
656
+ var Label = LabelComponent;
657
+
658
+ var Sizes = {
659
+ xs: {
660
+ height: 8,
661
+ width: 8
662
+ },
663
+ sm: {
664
+ height: 12,
665
+ width: 12
666
+ },
667
+ md: {
668
+ height: 18,
669
+ width: 18
670
+ },
671
+ lg: {
672
+ height: 24,
673
+ width: 24
674
+ },
675
+ xl: {
676
+ height: 30,
285
677
  width: 30
286
678
  },
287
679
  '2xl': {
@@ -305,7 +697,7 @@ var Sizes = {
305
697
  width: 60
306
698
  }
307
699
  };
308
- var IconSizes$1 = {
700
+ var IconSizes$2 = {
309
701
  xs: 6,
310
702
  sm: 12,
311
703
  md: 18,
@@ -318,7 +710,7 @@ var IconSizes$1 = {
318
710
  '6xl': 60
319
711
  };
320
712
 
321
- var _excluded$1 = ["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"];
322
714
  var CheckboxView = function CheckboxView(_ref) {
323
715
  var id = _ref.id,
324
716
  icon = _ref.icon,
@@ -353,7 +745,7 @@ var CheckboxView = function CheckboxView(_ref) {
353
745
  checkbox: {},
354
746
  label: {}
355
747
  } : _ref$styles,
356
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
748
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
357
749
  var handleHover = function handleHover() {
358
750
  return setIsHovered(!isHovered);
359
751
  };
@@ -397,8 +789,8 @@ var CheckboxView = function CheckboxView(_ref) {
397
789
  onMouseEnter: handleHover,
398
790
  onMouseLeave: handleHover,
399
791
  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]
792
+ }, checkboxStyle.container, props), /*#__PURE__*/React.createElement(Center, Object.assign({}, checkboxStyle.checkbox), isIndeterminate ? /*#__PURE__*/React.createElement(IndeterminateSvg, null) : (isChecked || isSelected) && (icon != null ? icon : /*#__PURE__*/React.createElement(CheckSvg, {
793
+ size: IconSizes$2[size]
402
794
  }))), label);
403
795
  };
404
796
 
@@ -1897,47 +2289,374 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
1897
2289
  };
1898
2290
  };
1899
2291
 
1900
- var IconSizes$2 = {
2292
+ var _excluded$c = ["children", "wrap", "justify", "isReversed"];
2293
+ var VerticalView = function VerticalView(_ref) {
2294
+ var children = _ref.children,
2295
+ _ref$wrap = _ref.wrap,
2296
+ wrap = _ref$wrap === void 0 ? 'nowrap' : _ref$wrap,
2297
+ _ref$justify = _ref.justify,
2298
+ justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
2299
+ _ref$isReversed = _ref.isReversed,
2300
+ isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
2301
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
2302
+ return /*#__PURE__*/React.createElement(View, Object.assign({
2303
+ display: "flex",
2304
+ flexWrap: wrap,
2305
+ flexDirection: isReversed ? 'column-reverse' : 'column',
2306
+ justifyContent: justify
2307
+ }, props), children);
2308
+ };
2309
+
2310
+ /**
2311
+ * Vertical layout aligns all the elements in a container on the vertical axis.
2312
+ */
2313
+ var VerticalComponent = function VerticalComponent(props) {
2314
+ return /*#__PURE__*/React.createElement(VerticalView, Object.assign({}, props));
2315
+ };
2316
+ var Vertical = VerticalComponent;
2317
+
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"];
2439
+ var HelperText = function HelperText(_ref) {
2440
+ var children = _ref.children,
2441
+ _ref$styles = _ref.styles,
2442
+ styles = _ref$styles === void 0 ? {
2443
+ helperText: {}
2444
+ } : _ref$styles,
2445
+ _ref$error = _ref.error,
2446
+ error = _ref$error === void 0 ? false : _ref$error,
2447
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
2448
+ return /*#__PURE__*/React.createElement(Text, Object.assign({
2449
+ size: "xs",
2450
+ marginVertical: 0,
2451
+ marginHorizontal: 0,
2452
+ color: error ? 'theme.error' : 'theme.text.dark'
2453
+ }, styles['helperText'], props), children);
2454
+ };
2455
+
2456
+ var _excluded$f = ["children", "helperText", "error", "styles"];
2457
+ var FieldContainer = function FieldContainer(_ref) {
2458
+ var children = _ref.children,
2459
+ helperText = _ref.helperText,
2460
+ _ref$error = _ref.error,
2461
+ error = _ref$error === void 0 ? false : _ref$error,
2462
+ styles = _ref.styles,
2463
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
2464
+ return /*#__PURE__*/React.createElement(Vertical, Object.assign({
2465
+ gap: 5,
2466
+ position: "relative"
2467
+ }, props), children, helperText && /*#__PURE__*/React.createElement(HelperText, Object.assign({
2468
+ error: error
2469
+ }, styles), helperText));
2470
+ };
2471
+
2472
+ var Shapes = {
2473
+ default: {
2474
+ borderTopLeftRadius: 6,
2475
+ borderTopRightRadius: 6,
2476
+ borderBottomLeftRadius: 0,
2477
+ borderBottomRightRadius: 0
2478
+ },
2479
+ sharp: {
2480
+ borderRadius: 0
2481
+ },
2482
+ rounded: {
2483
+ borderRadius: 4
2484
+ },
2485
+ pillShaped: {
2486
+ borderRadius: 24
2487
+ }
2488
+ };
2489
+ var LabelSizes = {
1901
2490
  xs: 8,
1902
2491
  sm: 10,
1903
2492
  md: 12,
1904
2493
  lg: 14,
1905
2494
  xl: 16
1906
2495
  };
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));
2496
+ var InputVariants = {
2497
+ outline: {
2498
+ borderWidth: 1
2499
+ },
2500
+ default: {
2501
+ borderWidth: 0,
2502
+ borderBottomWidth: 2
2503
+ },
2504
+ unStyled: {
2505
+ border: 'none',
2506
+ backgroundColor: 'transparent'
2507
+ }
1913
2508
  };
1914
- var CountrySelector = function CountrySelector(props) {
1915
- return /*#__PURE__*/React.createElement(Input, Object.assign({
1916
- type: "country"
1917
- }, props));
2509
+ var PadddingWithLabel = {
2510
+ paddingTop: 16,
2511
+ paddingBottom: 0,
2512
+ paddingLeft: 16,
2513
+ paddingRight: 35
1918
2514
  };
1919
- var CountryItem = function CountryItem(props) {
1920
- return /*#__PURE__*/React.createElement(Element, Object.assign({
1921
- as: "li"
1922
- }, props));
2515
+ var PaddingWithoutLabel = {
2516
+ paddingVertical: 8,
2517
+ paddingLeft: 16,
2518
+ paddingRight: 35
1923
2519
  };
1924
- var DropDownItem = function DropDownItem(_ref) {
1925
- var option = _ref.option,
2520
+
2521
+ var _excluded$g = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "isWithLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "colorScheme", "styles"];
2522
+ var FieldContent = function FieldContent(_ref) {
2523
+ var shadow = _ref.shadow,
2524
+ children = _ref.children,
1926
2525
  _ref$size = _ref.size,
1927
2526
  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
- };
2527
+ _ref$shape = _ref.shape,
2528
+ shape = _ref$shape === void 0 ? 'default' : _ref$shape,
2529
+ _ref$variant = _ref.variant,
2530
+ variant = _ref$variant === void 0 ? 'default' : _ref$variant,
2531
+ _ref$error = _ref.error,
2532
+ error = _ref$error === void 0 ? false : _ref$error,
2533
+ _ref$isWithLabel = _ref.isWithLabel,
2534
+ isWithLabel = _ref$isWithLabel === void 0 ? false : _ref$isWithLabel,
2535
+ _ref$isFocused = _ref.isFocused,
2536
+ isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
2537
+ _ref$isHovered = _ref.isHovered,
2538
+ isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
2539
+ _ref$isDisabled = _ref.isDisabled,
2540
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
2541
+ _ref$isReadOnly = _ref.isReadOnly,
2542
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
2543
+ _ref$colorScheme = _ref.colorScheme,
2544
+ colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
2545
+ _ref$styles = _ref.styles,
2546
+ styles = _ref$styles === void 0 ? {
2547
+ pickerBox: {}
2548
+ } : _ref$styles,
2549
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
2550
+ var isInteractive = (isHovered || isFocused) && !isDisabled;
2551
+ var color = error ? 'error' : isInteractive ? colorScheme : 'midgray';
2552
+ return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
2553
+ gap: 10,
2554
+ width: "100%",
2555
+ display: "flex",
2556
+ wrap: "nowrap",
2557
+ borderStyle: "solid",
2558
+ alignItems: "center",
2559
+ borderColor: color,
2560
+ backgroundColor: "trueGray.50",
2561
+ transition: "padding 0.2s ease",
2562
+ justifyContent: "space-between",
2563
+ fontSize: Typography.fontSizes[size],
2564
+ filter: isHovered ? 'brightness(0.97)' : 'brightness(1)',
2565
+ cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
2566
+ }, isWithLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], styles['box'], props), children);
2567
+ };
2568
+
2569
+ var _excluded$h = ["children"];
2570
+ var FieldIcons = function FieldIcons(_ref) {
2571
+ var children = _ref.children,
2572
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
2573
+ return /*#__PURE__*/React.createElement(Center, Object.assign({
2574
+ gap: 10,
2575
+ top: "50%",
2576
+ right: 16,
2577
+ zIndex: 500,
2578
+ wrap: "nowrap",
2579
+ position: "absolute",
2580
+ transform: "translateY(-50%)"
2581
+ }, props), children);
2582
+ };
2583
+
2584
+ var _excluded$i = ["children", "size", "error", "color", "styles"];
2585
+ var FieldLabel = function FieldLabel(_ref) {
2586
+ var children = _ref.children,
2587
+ _ref$size = _ref.size,
2588
+ size = _ref$size === void 0 ? 'md' : _ref$size,
2589
+ _ref$error = _ref.error,
2590
+ error = _ref$error === void 0 ? false : _ref$error,
2591
+ _ref$color = _ref.color,
2592
+ color = _ref$color === void 0 ? 'theme.primary' : _ref$color,
2593
+ _ref$styles = _ref.styles,
2594
+ styles = _ref$styles === void 0 ? {
2595
+ label: {}
2596
+ } : _ref$styles,
2597
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
2598
+ return /*#__PURE__*/React.createElement(Label, Object.assign({
2599
+ top: 4,
2600
+ zIndex: 1000,
2601
+ lineHeight: 15,
2602
+ letterSpacing: 0.25,
2603
+ whiteSpace: "noWrap",
2604
+ position: "absolute",
2605
+ color: error ? 'error' : color,
2606
+ fontSize: LabelSizes[size]
2607
+ }, styles['label'], props), children);
2608
+ };
2609
+
2610
+ var _excluded$j = ["children"];
2611
+ var FieldWrapper = function FieldWrapper(_ref) {
2612
+ var children = _ref.children,
2613
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
2614
+ return /*#__PURE__*/React.createElement(Vertical, Object.assign({
2615
+ width: "100%"
2616
+ }, props), children);
2617
+ };
2618
+
2619
+ var IconSizes$3 = {
2620
+ xs: 8,
2621
+ sm: 10,
2622
+ md: 12,
2623
+ lg: 14,
2624
+ xl: 16
2625
+ };
2626
+
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"];
2628
+ var CountryList = function CountryList(props) {
2629
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
2630
+ as: "ul"
2631
+ }, props));
2632
+ };
2633
+ var CountrySelector = function CountrySelector(props) {
2634
+ return /*#__PURE__*/React.createElement(Input, Object.assign({
2635
+ type: "country"
2636
+ }, props));
2637
+ };
2638
+ var CountryItem = function CountryItem(props) {
2639
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
2640
+ as: "li"
2641
+ }, props));
2642
+ };
2643
+ var DropDownItem = function DropDownItem(_ref) {
2644
+ var option = _ref.option,
2645
+ _ref$size = _ref.size,
2646
+ size = _ref$size === void 0 ? 'md' : _ref$size,
2647
+ _ref$callback = _ref.callback,
2648
+ callback = _ref$callback === void 0 ? function () {} : _ref$callback,
2649
+ _ref$styles = _ref.styles,
2650
+ styles = _ref$styles === void 0 ? {
2651
+ text: {}
2652
+ } : _ref$styles;
2653
+ var _useState = useState(false),
2654
+ isHovered = _useState[0],
2655
+ setIsHovered = _useState[1];
2656
+ var handleOptionClick = function handleOptionClick(event) {
2657
+ event.stopPropagation();
2658
+ callback(option);
2659
+ };
1941
2660
  var handleHover = function handleHover() {
1942
2661
  return setIsHovered(!isHovered);
1943
2662
  };
@@ -2045,7 +2764,7 @@ var CountryPickerView = function CountryPickerView(_ref3) {
2045
2764
  helperText: {},
2046
2765
  box: {}
2047
2766
  } : _ref3$styles,
2048
- props = _objectWithoutPropertiesLoose(_ref3, _excluded$2);
2767
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded$k);
2049
2768
  var _useTheme = useTheme(),
2050
2769
  getColor = _useTheme.getColor;
2051
2770
  var IconColor = getColor('color.blueGray.700');
@@ -2139,11 +2858,11 @@ var CountryPickerView = function CountryPickerView(_ref3) {
2139
2858
  value: selected,
2140
2859
  onChange: handleChange
2141
2860
  }))), /*#__PURE__*/React.createElement(FieldIcons, null, hide ? /*#__PURE__*/React.createElement(ArrowDownSvg, {
2142
- size: IconSizes$2[size],
2861
+ size: IconSizes$3[size],
2143
2862
  color: IconColor,
2144
2863
  style: styles['icon']
2145
2864
  }) : /*#__PURE__*/React.createElement(ArrowUpSvg, {
2146
- size: IconSizes$2[size],
2865
+ size: IconSizes$3[size],
2147
2866
  color: IconColor,
2148
2867
  style: styles['icon']
2149
2868
  }))), !hide && /*#__PURE__*/React.createElement(DropDown, {
@@ -2183,7 +2902,7 @@ var useDatePickerState = function useDatePickerState() {
2183
2902
  };
2184
2903
  };
2185
2904
 
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"];
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"];
2187
2906
  var DatePickerContent = function DatePickerContent(props) {
2188
2907
  return /*#__PURE__*/React.createElement(Input, Object.assign({
2189
2908
  type: "date"
@@ -2231,7 +2950,7 @@ var DatePickerView = function DatePickerView(_ref) {
2231
2950
  setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
2232
2951
  onChange = _ref.onChange,
2233
2952
  onChangeText = _ref.onChangeText,
2234
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2953
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
2235
2954
  var isWithLabel = !!(isFocused && label);
2236
2955
  var handleHover = function handleHover() {
2237
2956
  return setIsHovered(!isHovered);
@@ -2266,11 +2985,11 @@ var DatePickerView = function DatePickerView(_ref) {
2266
2985
  color: isDisabled ? 'trueGray.600' : 'blueGray.700',
2267
2986
  cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'pointer'
2268
2987
  }, styles['field']);
2269
- return /*#__PURE__*/React.createElement(FieldContainer$1, {
2988
+ return /*#__PURE__*/React.createElement(FieldContainer, {
2270
2989
  helperText: helperText,
2271
2990
  error: error,
2272
2991
  styles: styles
2273
- }, /*#__PURE__*/React.createElement(FieldContent$1, {
2992
+ }, /*#__PURE__*/React.createElement(FieldContent, {
2274
2993
  label: label,
2275
2994
  size: size,
2276
2995
  error: error,
@@ -2288,7 +3007,7 @@ var DatePickerView = function DatePickerView(_ref) {
2288
3007
  colorScheme: colorScheme,
2289
3008
  onMouseEnter: handleHover,
2290
3009
  onMouseLeave: handleHover
2291
- }, /*#__PURE__*/React.createElement(FieldWrapper$1, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel$1, Object.assign({
3010
+ }, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
2292
3011
  htmlFor: id,
2293
3012
  color: colorScheme,
2294
3013
  error: error
@@ -2324,360 +3043,166 @@ var usePasswordState = function usePasswordState() {
2324
3043
  };
2325
3044
  };
2326
3045
 
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];
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];
2377
3062
  return {
2378
- selected: selected,
2379
- setSelected: setSelected,
2380
- hide: hide,
2381
- setHide: setHide,
2382
- isHovered: isHovered,
2383
- setIsHovered: setIsHovered,
3063
+ hint: hint,
3064
+ setHint: setHint,
2384
3065
  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 {
3066
+ setIsFocused: setIsFocused,
2393
3067
  isHovered: isHovered,
2394
- setIsHovered: setIsHovered
3068
+ setIsHovered: setIsHovered,
3069
+ inputValue: inputValue,
3070
+ setInputValue: setInputValue
2395
3071
  };
2396
3072
  };
2397
3073
 
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);
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));
2439
3079
  };
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 ? {
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: {},
2445
3097
  field: {},
3098
+ label: {},
3099
+ helperText: {},
2446
3100
  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;
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]);
2453
3143
  var fieldStyles = Object.assign({
2454
3144
  margin: 0,
2455
- width: '95%',
3145
+ paddingVertical: 8,
3146
+ padddingHorizontal: 0,
3147
+ width: '100%',
2456
3148
  heigth: '100%',
2457
3149
  border: 'none',
2458
- paddingVertical: 8,
2459
- paddingHorizontal: 0,
3150
+ on: {
3151
+ focus: {
3152
+ outline: 'none'
3153
+ }
3154
+ },
2460
3155
  fontSize: Typography.fontSizes[size],
2461
3156
  backgroundColor: 'transparent',
2462
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3157
+ color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
2463
3158
  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);
3159
+ }, styles['field']);
3160
+ var handleFocus = function handleFocus() {
3161
+ setIsFocused(true);
3162
+ if (onFocus) onFocus();
2573
3163
  };
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
3164
  var handleHover = function handleHover() {
2648
3165
  return setIsHovered(!isHovered);
2649
3166
  };
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);
3167
+ var handleBlur = function handleBlur(event) {
3168
+ onBlur(event);
3169
+ setIsFocused(false);
2657
3170
  };
2658
- var handleCallback = useCallback(function (option) {
2659
- setHide(!hide);
2660
- if (isMulti && Array.isArray(selected)) {
2661
- !selected.includes(option) && setSelected([].concat(selected, [option]));
3171
+ var handleChange = function handleChange(event) {
3172
+ if (typeof event === 'string') {
3173
+ //for ios and android
3174
+ setInputValue(event);
3175
+ if (onChangeText) onChangeText(event);
2662
3176
  } else {
2663
- setSelected(option);
3177
+ //Web
3178
+ setInputValue(event.target.value);
3179
+ if (onChange) onChange(event);
2664
3180
  }
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;
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
+ }
2670
3196
  });
2671
- setSelected(newSelected.length === 0 ? [] : newSelected);
2672
3197
  }
3198
+ //for ios and android
3199
+ if (typeof document === 'undefined' && onChangeText) onChangeText('');
2673
3200
  };
2674
- return /*#__PURE__*/React.createElement(FieldContainer$1, {
2675
- role: "SelectBox",
3201
+ return /*#__PURE__*/React.createElement(FieldContainer, {
2676
3202
  helperText: helperText,
2677
3203
  error: error,
2678
- styles: styles,
2679
- onClick: isDisabled || isReadOnly ? function () {} : handleClick
2680
- }, /*#__PURE__*/React.createElement(FieldContent$1, {
3204
+ styles: styles
3205
+ }, /*#__PURE__*/React.createElement(FieldContent, {
2681
3206
  label: label,
2682
3207
  size: size,
2683
3208
  error: error,
@@ -2685,7 +3210,7 @@ var SelectView = function SelectView(_ref6) {
2685
3210
  styles: styles,
2686
3211
  shadow: shadow,
2687
3212
  variant: variant,
2688
- value: selected,
3213
+ value: inputValue,
2689
3214
  color: colorScheme,
2690
3215
  isHovered: isHovered,
2691
3216
  isDisabled: isDisabled,
@@ -2695,413 +3220,394 @@ var SelectView = function SelectView(_ref6) {
2695
3220
  colorScheme: colorScheme,
2696
3221
  onMouseEnter: handleHover,
2697
3222
  onMouseLeave: handleHover
2698
- }, /*#__PURE__*/React.createElement(FieldWrapper$1, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel$1, Object.assign({
3223
+ }, leftChild, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
2699
3224
  htmlFor: id,
2700
3225
  color: colorScheme,
2701
3226
  error: error
2702
- }, styles), label), /*#__PURE__*/React.createElement(HiddenSelect, Object.assign({
3227
+ }, styles), label), /*#__PURE__*/React.createElement(TextFieldInput, Object.assign({
2703
3228
  id: id,
2704
3229
  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
- }));
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
+ }))));
2733
3247
  };
2734
3248
 
2735
- var SelectComponent = function SelectComponent(props) {
2736
- var selectStates = useSelectState(props);
2737
- return /*#__PURE__*/React.createElement(SelectView, Object.assign({}, selectStates, props));
3249
+ var TextFieldComponent = function TextFieldComponent(props) {
3250
+ var textFieldStates = useTextFieldState(props);
3251
+ return /*#__PURE__*/React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
2738
3252
  };
2739
3253
  /**
2740
- * Select provides a dropdown list of options for the user to choose from.
3254
+ * TextField is used to capture text data from users.
2741
3255
  */
2742
- var Select = SelectComponent;
3256
+ var TextField = TextFieldComponent;
2743
3257
 
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
- };
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));
2759
3280
  };
2760
3281
 
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
- }
3282
+ var PasswordComponent = function PasswordComponent(props) {
3283
+ var passwordState = usePasswordState();
3284
+ return /*#__PURE__*/React.createElement(PasswordView, Object.assign({}, passwordState, props));
2844
3285
  };
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
- }
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),
3300
+ isHovered = _React$useState2[0],
3301
+ setIsHovered = _React$useState2[1];
3302
+ var _React$useState3 = React.useState(false),
3303
+ isFocused = _React$useState3[0],
3304
+ setIsFocused = _React$useState3[1];
3305
+ var _React$useState4 = React.useState(defaultSelected),
3306
+ selected = _React$useState4[0],
3307
+ setSelected = _React$useState4[1];
3308
+ return {
3309
+ selected: selected,
3310
+ setSelected: setSelected,
3311
+ hide: hide,
3312
+ setHide: setHide,
3313
+ isHovered: isHovered,
3314
+ setIsHovered: setIsHovered,
3315
+ isFocused: isFocused,
3316
+ setIsFocused: setIsFocused
3317
+ };
3318
+ };
3319
+ var useItemState = function useItemState() {
3320
+ var _React$useState5 = React.useState(false),
3321
+ isHovered = _React$useState5[0],
3322
+ setIsHovered = _React$useState5[1];
3323
+ return {
3324
+ isHovered: isHovered,
3325
+ setIsHovered: setIsHovered
3326
+ };
2886
3327
  };
2887
3328
 
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));
3329
+ var IconSizes$4 = {
3330
+ xs: 8,
3331
+ sm: 10,
3332
+ md: 12,
3333
+ lg: 14,
3334
+ xl: 16
2893
3335
  };
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,
3336
+
3337
+ var _excluded$o = ["isHovered", "setIsHovered", "option", "size", "callback"],
3338
+ _excluded2 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
3339
+ _excluded3 = ["option", "size", "removeOption"],
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"];
3341
+ var Item = function Item(_ref) {
3342
+ var isHovered = _ref.isHovered,
3343
+ setIsHovered = _ref.setIsHovered,
3344
+ option = _ref.option,
2901
3345
  _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
- }
3346
+ size = _ref$size === void 0 ? 'md' : _ref$size,
3347
+ _ref$callback = _ref.callback,
3348
+ callback = _ref$callback === void 0 ? function () {} : _ref$callback,
3349
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
3350
+ var handleOptionClick = function handleOptionClick(option) {
3351
+ return callback(option);
2930
3352
  };
2931
3353
  var handleHover = function handleHover() {
2932
3354
  return setIsHovered(!isHovered);
2933
3355
  };
2934
- return /*#__PURE__*/React.createElement(Label, {
2935
- htmlFor: id,
3356
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
3357
+ as: "li",
3358
+ margin: 0,
3359
+ paddingVertical: 8,
3360
+ paddingHorizontal: 12,
3361
+ listStyleType: "none",
2936
3362
  onMouseEnter: handleHover,
2937
- onMouseLeave: handleHover
2938
- }, /*#__PURE__*/React.createElement(SwitchContent, Object.assign({
3363
+ onMouseLeave: handleHover,
3364
+ fontSize: Typography.fontSizes[size],
3365
+ onClick: function onClick() {
3366
+ return handleOptionClick(option);
3367
+ },
3368
+ backgroundColor: isHovered ? 'trueGray.100' : 'transparent'
3369
+ }, props), option);
3370
+ };
3371
+ var SelectBox = function SelectBox(_ref2) {
3372
+ var _ref2$size = _ref2.size,
3373
+ size = _ref2$size === void 0 ? 'md' : _ref2$size,
3374
+ _ref2$styles = _ref2.styles,
3375
+ styles = _ref2$styles === void 0 ? {
3376
+ field: {},
3377
+ text: {}
3378
+ } : _ref2$styles,
3379
+ selected = _ref2.selected,
3380
+ isDisabled = _ref2.isDisabled,
3381
+ placeholder = _ref2.placeholder,
3382
+ _ref2$removeOption = _ref2.removeOption,
3383
+ removeOption = _ref2$removeOption === void 0 ? function () {} : _ref2$removeOption;
3384
+ var fieldStyles = Object.assign({
3385
+ margin: 0,
3386
+ width: '95%',
3387
+ heigth: '100%',
3388
+ border: 'none',
3389
+ paddingVertical: 8,
3390
+ paddingHorizontal: 0,
3391
+ fontSize: Typography.fontSizes[size],
3392
+ backgroundColor: 'transparent',
3393
+ color: isDisabled ? 'trueGray.600' : 'blueGray.700',
3394
+ cursor: isDisabled ? 'not-allowed' : 'auto'
3395
+ }, styles['field'], styles['text']);
3396
+ return /*#__PURE__*/React.createElement(Text, 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, {
3397
+ gap: 6
3398
+ }, selected.map(function (option) {
3399
+ return /*#__PURE__*/React.createElement(MultiSelect, {
3400
+ key: option,
3401
+ option: option,
3402
+ removeOption: removeOption
3403
+ });
3404
+ }))));
3405
+ };
3406
+ var HiddenSelect = function HiddenSelect(_ref3) {
3407
+ var id = _ref3.id,
3408
+ name = _ref3.name,
3409
+ selected = _ref3.selected,
3410
+ onChange = _ref3.onChange,
3411
+ _ref3$isMulti = _ref3.isMulti,
3412
+ isMulti = _ref3$isMulti === void 0 ? false : _ref3$isMulti,
3413
+ _ref3$isDisabled = _ref3.isDisabled,
3414
+ isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled,
3415
+ _ref3$isReadOnly = _ref3.isReadOnly,
3416
+ isReadOnly = _ref3$isReadOnly === void 0 ? false : _ref3$isReadOnly,
3417
+ _ref3$options = _ref3.options,
3418
+ options = _ref3$options === void 0 ? [] : _ref3$options,
3419
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded2);
3420
+ var handleChange = function handleChange(event) {
3421
+ if (onChange) onChange(event);
3422
+ };
3423
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
2939
3424
  id: id,
2940
3425
  name: name,
3426
+ as: "select",
2941
3427
  opacity: 0,
2942
3428
  width: 0,
2943
3429
  height: 0,
2944
- checked: on,
2945
- onChange: handleToggle,
3430
+ position: "absolute",
3431
+ value: selected,
2946
3432
  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)));
3433
+ readOnly: isReadOnly,
3434
+ onChange: handleChange,
3435
+ multiple: isMulti
3436
+ }, props), options.map(function (option) {
3437
+ return /*#__PURE__*/React.createElement("option", {
3438
+ key: option,
3439
+ value: option
3440
+ }, option);
3441
+ }));
2963
3442
  };
2964
-
2965
- var SwitchComponent = function SwitchComponent(props) {
2966
- var switchStates = useSwitchState(props);
2967
- return /*#__PURE__*/React.createElement(SwitchView, Object.assign({}, switchStates, props));
3443
+ var DropDown$1 = function DropDown(_ref4) {
3444
+ var size = _ref4.size,
3445
+ _ref4$styles = _ref4.styles,
3446
+ styles = _ref4$styles === void 0 ? {
3447
+ dropDown: {}
3448
+ } : _ref4$styles,
3449
+ options = _ref4.options,
3450
+ _ref4$callback = _ref4.callback,
3451
+ callback = _ref4$callback === void 0 ? function () {} : _ref4$callback;
3452
+ var itemStates = useItemState();
3453
+ var handleCallback = function handleCallback(option) {
3454
+ return callback(option);
3455
+ };
3456
+ var shadow = typeof document !== undefined ? {
3457
+ 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'
3458
+ } : {
3459
+ elevation: 2,
3460
+ shadowColor: 'rgba(0, 0, 0, 0.07)',
3461
+ shadowOffset: {
3462
+ width: 0,
3463
+ height: 1
3464
+ },
3465
+ shadowOpacity: 1,
3466
+ shadowRadius: 1
3467
+ };
3468
+ return /*#__PURE__*/React.createElement(Element, Object.assign({
3469
+ as: "ul",
3470
+ role: "dropdown",
3471
+ top: "100%",
3472
+ width: "100%",
3473
+ display: "flex",
3474
+ zIndex: 1000,
3475
+ overflowY: "auto",
3476
+ marginTop: 5,
3477
+ marginLeft: 0,
3478
+ marginRight: 0,
3479
+ marginBottom: 0,
3480
+ padding: 0,
3481
+ borderRadius: 4,
3482
+ position: "absolute",
3483
+ flexDirection: "column",
3484
+ backgroundColor: "white",
3485
+ justifyContent: "space-evenly"
3486
+ }, shadow, styles['dropDown']), options.map(function (option) {
3487
+ return /*#__PURE__*/React.createElement(Item, Object.assign({
3488
+ key: option,
3489
+ size: size,
3490
+ option: option,
3491
+ callback: handleCallback
3492
+ }, itemStates, styles['text']));
3493
+ }));
2968
3494
  };
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
3495
+ var MultiSelect = function MultiSelect(_ref5) {
3496
+ var option = _ref5.option,
3497
+ _ref5$size = _ref5.size,
3498
+ size = _ref5$size === void 0 ? 'md' : _ref5$size,
3499
+ _ref5$removeOption = _ref5.removeOption,
3500
+ removeOption = _ref5$removeOption === void 0 ? function () {} : _ref5$removeOption,
3501
+ props = _objectWithoutPropertiesLoose(_ref5, _excluded3);
3502
+ var handleClick = function handleClick() {
3503
+ return removeOption(option);
2997
3504
  };
3505
+ return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
3506
+ gap: 10,
3507
+ padding: 6,
3508
+ borderRadius: 4,
3509
+ alignItems: "center",
3510
+ fontSize: Typography.fontSizes[size],
3511
+ backgroundColor: "trueGray.300",
3512
+ onClick: function onClick(event) {
3513
+ return event.stopPropagation();
3514
+ }
3515
+ }, props), /*#__PURE__*/React.createElement(Text, {
3516
+ size: size
3517
+ }, option), /*#__PURE__*/React.createElement(CloseSvg, {
3518
+ role: "close-button",
3519
+ color: "inherit",
3520
+ size: IconSizes$4[size],
3521
+ onClick: handleClick
3522
+ }));
2998
3523
  };
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: {},
3524
+ var SelectView = function SelectView(_ref6) {
3525
+ var id = _ref6.id,
3526
+ name = _ref6.name,
3527
+ label = _ref6.label,
3528
+ selected = _ref6.selected,
3529
+ placeholder = _ref6.placeholder,
3530
+ helperText = _ref6.helperText,
3531
+ _ref6$hide = _ref6.hide,
3532
+ hide = _ref6$hide === void 0 ? false : _ref6$hide,
3533
+ _ref6$error = _ref6.error,
3534
+ error = _ref6$error === void 0 ? false : _ref6$error,
3535
+ _ref6$isMulti = _ref6.isMulti,
3536
+ isMulti = _ref6$isMulti === void 0 ? false : _ref6$isMulti,
3537
+ _ref6$isFocused = _ref6.isFocused,
3538
+ isFocused = _ref6$isFocused === void 0 ? false : _ref6$isFocused,
3539
+ _ref6$isHovered = _ref6.isHovered,
3540
+ isHovered = _ref6$isHovered === void 0 ? false : _ref6$isHovered,
3541
+ _ref6$isDisabled = _ref6.isDisabled,
3542
+ isDisabled = _ref6$isDisabled === void 0 ? false : _ref6$isDisabled,
3543
+ _ref6$isReadOnly = _ref6.isReadOnly,
3544
+ isReadOnly = _ref6$isReadOnly === void 0 ? false : _ref6$isReadOnly,
3545
+ _ref6$options = _ref6.options,
3546
+ options = _ref6$options === void 0 ? [] : _ref6$options,
3547
+ _ref6$shadow = _ref6.shadow,
3548
+ shadow = _ref6$shadow === void 0 ? {} : _ref6$shadow,
3549
+ _ref6$size = _ref6.size,
3550
+ size = _ref6$size === void 0 ? 'md' : _ref6$size,
3551
+ _ref6$colorScheme = _ref6.colorScheme,
3552
+ colorScheme = _ref6$colorScheme === void 0 ? 'theme.primary' : _ref6$colorScheme,
3553
+ _ref6$shape = _ref6.shape,
3554
+ shape = _ref6$shape === void 0 ? 'default' : _ref6$shape,
3555
+ _ref6$variant = _ref6.variant,
3556
+ variant = _ref6$variant === void 0 ? 'default' : _ref6$variant,
3557
+ _ref6$styles = _ref6.styles,
3558
+ styles = _ref6$styles === void 0 ? {
3053
3559
  text: {},
3560
+ icon: {},
3561
+ dropDown: {},
3562
+ selectBox: {},
3054
3563
  label: {},
3055
- helperText: {},
3056
- field: {}
3057
- } : _ref$styles,
3058
- props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
3564
+ helperText: {}
3565
+ } : _ref6$styles,
3566
+ _ref6$onChange = _ref6.onChange,
3567
+ onChange = _ref6$onChange === void 0 ? function () {} : _ref6$onChange,
3568
+ _ref6$setHide = _ref6.setHide,
3569
+ setHide = _ref6$setHide === void 0 ? function () {} : _ref6$setHide,
3570
+ _ref6$setSelected = _ref6.setSelected,
3571
+ setSelected = _ref6$setSelected === void 0 ? function () {} : _ref6$setSelected,
3572
+ _ref6$setIsHovered = _ref6.setIsHovered,
3573
+ setIsHovered = _ref6$setIsHovered === void 0 ? function () {} : _ref6$setIsHovered,
3574
+ _ref6$setIsFocused = _ref6.setIsFocused,
3575
+ setIsFocused = _ref6$setIsFocused === void 0 ? function () {} : _ref6$setIsFocused,
3576
+ props = _objectWithoutPropertiesLoose(_ref6, _excluded4);
3059
3577
  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
3578
  var handleHover = function handleHover() {
3081
3579
  return setIsHovered(!isHovered);
3082
3580
  };
3083
3581
  var handleFocus = function handleFocus() {
3084
- setIsFocused(true);
3085
- if (onFocus) onFocus();
3582
+ return setIsFocused(true);
3086
3583
  };
3087
- var handleBlur = function handleBlur(event) {
3088
- onBlur(event);
3089
- setIsFocused(false);
3584
+ var handleClick = function handleClick(event) {
3585
+ event.stopPropagation();
3586
+ setHide(!hide);
3587
+ setIsFocused(!isFocused);
3090
3588
  };
3091
- var handleChange = function handleChange(event) {
3092
- if (typeof event === 'string') {
3093
- //for ios and android
3094
- setInputValue(event);
3095
- if (onChangeText) onChangeText(event);
3589
+ var handleCallback = useCallback(function (option) {
3590
+ setHide(!hide);
3591
+ if (isMulti && Array.isArray(selected)) {
3592
+ !selected.includes(option) && setSelected([].concat(selected, [option]));
3096
3593
  } else {
3097
- setInputValue(event.target.value);
3098
- if (onChange) onChange(event);
3594
+ setSelected(option);
3595
+ }
3596
+ }, [hide, isMulti, selected]);
3597
+ var handleRemoveOption = function handleRemoveOption(selectedOption) {
3598
+ if (Array.isArray(selected) && selected.includes(selectedOption)) {
3599
+ var newSelected = selected.filter(function (option) {
3600
+ return option !== selectedOption;
3601
+ });
3602
+ setSelected(newSelected.length === 0 ? [] : newSelected);
3099
3603
  }
3100
3604
  };
3101
3605
  return /*#__PURE__*/React.createElement(FieldContainer, {
3606
+ role: "SelectBox",
3102
3607
  helperText: helperText,
3103
3608
  error: error,
3104
- styles: styles
3609
+ styles: styles,
3610
+ onClick: isDisabled || isReadOnly ? function () {} : handleClick
3105
3611
  }, /*#__PURE__*/React.createElement(FieldContent, {
3106
3612
  label: label,
3107
3613
  size: size,
@@ -3110,7 +3616,7 @@ var TextAreaView = function TextAreaView(_ref) {
3110
3616
  styles: styles,
3111
3617
  shadow: shadow,
3112
3618
  variant: variant,
3113
- value: inputValue,
3619
+ value: selected,
3114
3620
  color: colorScheme,
3115
3621
  isHovered: isHovered,
3116
3622
  isDisabled: isDisabled,
@@ -3124,397 +3630,460 @@ var TextAreaView = function TextAreaView(_ref) {
3124
3630
  htmlFor: id,
3125
3631
  color: colorScheme,
3126
3632
  error: error
3127
- }, styles), label), /*#__PURE__*/React.createElement(Element, Object.assign({
3128
- as: "textarea",
3633
+ }, styles), label), /*#__PURE__*/React.createElement(HiddenSelect, Object.assign({
3129
3634
  id: id,
3130
3635
  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));
3636
+ options: options,
3637
+ onChange: onChange,
3638
+ selected: selected,
3639
+ isDisabled: isDisabled,
3640
+ isReadOnly: isReadOnly,
3641
+ isMulti: isMulti,
3642
+ onFocus: handleFocus
3643
+ }, props)), /*#__PURE__*/React.createElement(SelectBox, {
3644
+ size: size,
3645
+ styles: styles,
3646
+ selected: selected,
3647
+ isDisabled: isDisabled,
3648
+ placeholder: placeholder,
3649
+ removeOption: handleRemoveOption
3650
+ })), /*#__PURE__*/React.createElement(FieldIcons, null, !isReadOnly && !isDisabled && /*#__PURE__*/React.createElement(React.Fragment, null, hide ? /*#__PURE__*/React.createElement(ArrowDownSvg, {
3651
+ color: "inherit",
3652
+ size: IconSizes$4[size],
3653
+ style: styles.icon
3654
+ }) : /*#__PURE__*/React.createElement(ArrowUpSvg, {
3655
+ color: "inherit",
3656
+ size: IconSizes$4[size],
3657
+ style: styles.icon
3658
+ })))), !hide && /*#__PURE__*/React.createElement(DropDown$1, {
3659
+ size: size,
3660
+ styles: styles,
3661
+ options: options,
3662
+ callback: handleCallback
3663
+ }));
3151
3664
  };
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];
3665
+
3666
+ var SelectComponent = function SelectComponent(props) {
3667
+ var selectStates = useSelectState(props);
3668
+ return /*#__PURE__*/React.createElement(SelectView, Object.assign({}, selectStates, props));
3669
+ };
3670
+ /**
3671
+ * Select provides a dropdown list of options for the user to choose from.
3672
+ */
3673
+ var Select = SelectComponent;
3674
+
3675
+ var useSwitchState = function useSwitchState(_ref) {
3676
+ var isDisabled = _ref.isDisabled,
3677
+ isChecked = _ref.isChecked;
3678
+ var _React$useState = React.useState(false),
3679
+ isHovered = _React$useState[0],
3680
+ setIsHovered = _React$useState[1];
3681
+ var _React$useState2 = React.useState(isDisabled ? !isDisabled : isChecked),
3682
+ on = _React$useState2[0],
3683
+ setOn = _React$useState2[1];
3173
3684
  return {
3174
- hint: hint,
3175
- setHint: setHint,
3176
- isFocused: isFocused,
3177
- setIsFocused: setIsFocused,
3178
3685
  isHovered: isHovered,
3179
3686
  setIsHovered: setIsHovered,
3180
- inputValue: inputValue,
3181
- setInputValue: setInputValue
3687
+ on: on,
3688
+ setOn: setOn
3182
3689
  };
3183
3690
  };
3184
3691
 
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) {
3692
+ var KnobSizes = {
3693
+ xs: {
3694
+ height: 6,
3695
+ width: 6
3696
+ },
3697
+ sm: {
3698
+ height: 9,
3699
+ width: 9
3700
+ },
3701
+ md: {
3702
+ height: 12,
3703
+ width: 12
3704
+ },
3705
+ lg: {
3706
+ height: 15,
3707
+ width: 15
3708
+ },
3709
+ xl: {
3710
+ height: 18,
3711
+ width: 18
3712
+ },
3713
+ '2xl': {
3714
+ height: 21,
3715
+ width: 21
3716
+ },
3717
+ '3xl': {
3718
+ height: 24,
3719
+ width: 24
3720
+ },
3721
+ '4xl': {
3722
+ height: 27,
3723
+ width: 27
3724
+ },
3725
+ '5xl': {
3726
+ height: 30,
3727
+ width: 30
3728
+ },
3729
+ '6xl': {
3730
+ height: 33,
3731
+ width: 33
3732
+ }
3733
+ };
3734
+ var SliderSizes = {
3735
+ xs: {
3736
+ height: 16,
3737
+ width: 28
3738
+ },
3739
+ sm: {
3740
+ height: 20,
3741
+ width: 36
3742
+ },
3743
+ md: {
3744
+ height: 24,
3745
+ width: 44
3746
+ },
3747
+ lg: {
3748
+ height: 28,
3749
+ width: 52
3750
+ },
3751
+ xl: {
3752
+ height: 32,
3753
+ width: 60
3754
+ },
3755
+ '2xl': {
3756
+ height: 36,
3757
+ width: 68
3758
+ },
3759
+ '3xl': {
3760
+ height: 40,
3761
+ width: 76
3762
+ },
3763
+ '4xl': {
3764
+ height: 44,
3765
+ width: 84
3766
+ },
3767
+ '5xl': {
3768
+ height: 48,
3769
+ width: 92
3770
+ },
3771
+ '6xl': {
3772
+ height: 52,
3773
+ width: 100
3774
+ }
3775
+ };
3776
+ var SliderPadding = {
3777
+ xs: {
3778
+ paddingVertical: 0,
3779
+ paddingHorizontal: 2
3780
+ },
3781
+ sm: {
3782
+ paddingVertical: 0,
3783
+ paddingHorizontal: 3
3784
+ },
3785
+ md: {
3786
+ paddingVertical: 0,
3787
+ paddingHorizontal: 5
3788
+ },
3789
+ lg: {
3790
+ paddingVertical: 0,
3791
+ paddingHorizontal: 6
3792
+ },
3793
+ xl: {
3794
+ paddingVertical: 0,
3795
+ paddingHorizontal: 8
3796
+ },
3797
+ '2xl': {
3798
+ paddingVertical: 0,
3799
+ paddingHorizontal: 9
3800
+ },
3801
+ '3xl': {
3802
+ paddingVertical: 0,
3803
+ paddingHorizontal: 10
3804
+ },
3805
+ '4xl': {
3806
+ paddingVertical: 0,
3807
+ paddingHorizontal: 13
3808
+ },
3809
+ '5xl': {
3810
+ paddingVertical: 0,
3811
+ paddingHorizontal: 15
3812
+ },
3813
+ '6xl': {
3814
+ paddingVertical: 0,
3815
+ paddingHorizontal: 16
3816
+ }
3817
+ };
3818
+
3819
+ var _excluded$p = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
3820
+ var SwitchContent = function SwitchContent(props) {
3187
3821
  return /*#__PURE__*/React.createElement(Input, Object.assign({
3188
- type: "text"
3822
+ type: "checkbox"
3189
3823
  }, props));
3190
3824
  };
3191
- var TextFieldView = function TextFieldView(_ref) {
3825
+ var SwitchView = function SwitchView(_ref) {
3192
3826
  var id = _ref.id,
3193
3827
  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,
3828
+ inActiveChild = _ref.inActiveChild,
3829
+ activeChild = _ref.activeChild,
3203
3830
  _ref$shadow = _ref.shadow,
3204
3831
  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
3832
  _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);
3833
+ size = _ref$size === void 0 ? 'sm' : _ref$size,
3834
+ _ref$colorScheme = _ref.colorScheme,
3835
+ colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
3836
+ _ref$on = _ref.on,
3837
+ on = _ref$on === void 0 ? false : _ref$on,
3838
+ _ref$isHovered = _ref.isHovered,
3839
+ isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
3840
+ _ref$isDisabled = _ref.isDisabled,
3841
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3842
+ _ref$isReadOnly = _ref.isReadOnly,
3843
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
3844
+ onChange = _ref.onChange,
3845
+ onValueChange = _ref.onValueChange,
3846
+ _ref$setOn = _ref.setOn,
3847
+ setOn = _ref$setOn === void 0 ? function () {} : _ref$setOn,
3848
+ _ref$setIsHovered = _ref.setIsHovered,
3849
+ setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
3850
+ _ref$styles = _ref.styles,
3851
+ styles = _ref$styles === void 0 ? {
3852
+ slider: {},
3853
+ circle: {}
3854
+ } : _ref$styles,
3855
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
3856
+ var handleToggle = function handleToggle(event) {
3857
+ if (!isReadOnly) {
3858
+ setOn(!on);
3290
3859
  if (onChange) onChange(event);
3291
3860
  }
3292
3861
  };
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('');
3862
+ var handleHover = function handleHover() {
3863
+ return setIsHovered(!isHovered);
3311
3864
  };
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,
3865
+ return /*#__PURE__*/React.createElement(Label, {
3866
+ htmlFor: id,
3332
3867
  onMouseEnter: handleHover,
3333
3868
  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({
3869
+ }, /*#__PURE__*/React.createElement(SwitchContent, Object.assign({
3339
3870
  id: id,
3340
3871
  name: name,
3341
- value: inputValue,
3342
- readOnly: isReadOnly,
3872
+ opacity: 0,
3873
+ width: 0,
3874
+ height: 0,
3875
+ checked: on,
3876
+ onChange: handleToggle,
3343
3877
  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({
3878
+ readOnly: isReadOnly
3879
+ }, onValueChange && {
3880
+ onValueChange: handleToggle
3881
+ }, props)), /*#__PURE__*/React.createElement(View, Object.assign({
3375
3882
  display: "flex",
3376
- justifyContent: "center",
3883
+ cursor: "pointer",
3377
3884
  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);
3885
+ borderRadius: 24,
3886
+ filter: isHovered && on ? 'brightness(0.9)' : 'brightness(1)',
3887
+ transition: "justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
3888
+ backgroundColor: isDisabled ? 'disabled' : on ? colorScheme : 'lightgray',
3889
+ justifyContent: activeChild ? 'space-between' : on ? 'flex-end' : 'flex-start'
3890
+ }, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild && on && /*#__PURE__*/React.createElement(View, null, activeChild), /*#__PURE__*/React.createElement(View, Object.assign({
3891
+ borderRadius: "50%",
3892
+ backgroundColor: "white"
3893
+ }, KnobSizes[size], styles['circle'])), inActiveChild && !on && /*#__PURE__*/React.createElement(View, null, inActiveChild)));
3432
3894
  };
3433
3895
 
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));
3896
+ var SwitchComponent = function SwitchComponent(props) {
3897
+ var switchStates = useSwitchState(props);
3898
+ return /*#__PURE__*/React.createElement(SwitchView, Object.assign({}, switchStates, props));
3439
3899
  };
3440
- var Vertical = VerticalComponent;
3900
+ var Switch = SwitchComponent;
3441
3901
 
3442
- var useLinkState = function useLinkState() {
3443
- var _useState = useState(false),
3444
- isHovered = _useState[0],
3445
- setIsHovered = _useState[1];
3902
+ var useTextAreaState = function useTextAreaState(_ref) {
3903
+ var label = _ref.label,
3904
+ placeholder = _ref.placeholder,
3905
+ defaultValue = _ref.defaultValue,
3906
+ value = _ref.value;
3907
+ var _useState = useState(label != null ? label : placeholder),
3908
+ hint = _useState[0],
3909
+ setHint = _useState[1];
3910
+ var _useState2 = useState(false),
3911
+ isHovered = _useState2[0],
3912
+ setIsHovered = _useState2[1];
3913
+ var _useState3 = useState(value || defaultValue || ''),
3914
+ inputValue = _useState3[0],
3915
+ setInputValue = _useState3[1];
3916
+ var _useState4 = useState(false),
3917
+ isFocused = _useState4[0],
3918
+ setIsFocused = _useState4[1];
3446
3919
  return {
3920
+ hint: hint,
3921
+ setHint: setHint,
3447
3922
  isHovered: isHovered,
3448
- setIsHovered: setIsHovered
3923
+ setIsHovered: setIsHovered,
3924
+ inputValue: inputValue,
3925
+ setInputValue: setInputValue,
3926
+ isFocused: isFocused,
3927
+ setIsFocused: setIsFocused
3449
3928
  };
3450
3929
  };
3451
3930
 
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,
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"];
3932
+ var TextAreaView = function TextAreaView(_ref) {
3933
+ var id = _ref.id,
3934
+ name = _ref.name,
3935
+ hint = _ref.hint,
3936
+ error = _ref.error,
3937
+ label = _ref.label,
3938
+ shadow = _ref.shadow,
3939
+ inputValue = _ref.inputValue,
3940
+ helperText = _ref.helperText,
3941
+ placeholder = _ref.placeholder,
3942
+ _ref$size = _ref.size,
3943
+ size = _ref$size === void 0 ? 'sm' : _ref$size,
3944
+ _ref$shape = _ref.shape,
3945
+ shape = _ref$shape === void 0 ? 'default' : _ref$shape,
3946
+ _ref$variant = _ref.variant,
3947
+ variant = _ref$variant === void 0 ? 'default' : _ref$variant,
3948
+ _ref$colorScheme = _ref.colorScheme,
3949
+ colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
3474
3950
  _ref$isHovered = _ref.isHovered,
3475
3951
  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,
3952
+ _ref$isFocused = _ref.isFocused,
3953
+ isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
3954
+ _ref$isEditable = _ref.isEditable,
3955
+ isEditable = _ref$isEditable === void 0 ? false : _ref$isEditable,
3956
+ _ref$isReadOnly = _ref.isReadOnly,
3957
+ isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
3958
+ _ref$isDisabled = _ref.isDisabled,
3959
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3960
+ _ref$isAutoFocus = _ref.isAutoFocus,
3961
+ isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
3962
+ _ref$isMultiline = _ref.isMultiline,
3963
+ isMultiline = _ref$isMultiline === void 0 ? false : _ref$isMultiline,
3964
+ _ref$maxRows = _ref.maxRows,
3965
+ maxRows = _ref$maxRows === void 0 ? 3 : _ref$maxRows,
3966
+ _ref$maxCols = _ref.maxCols,
3967
+ maxCols = _ref$maxCols === void 0 ? 30 : _ref$maxCols,
3968
+ _ref$onBlur = _ref.onBlur,
3969
+ onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
3970
+ onChange = _ref.onChange,
3971
+ onFocus = _ref.onFocus,
3972
+ onChangeText = _ref.onChangeText,
3973
+ _ref$setHint = _ref.setHint,
3974
+ setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
3975
+ _ref$setInputValue = _ref.setInputValue,
3976
+ setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
3977
+ _ref$setIsFocused = _ref.setIsFocused,
3978
+ setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
3979
+ _ref$setIsHovered = _ref.setIsHovered,
3980
+ setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
3480
3981
  _ref$styles = _ref.styles,
3481
3982
  styles = _ref$styles === void 0 ? {
3482
- icon: {},
3483
- text: {}
3983
+ box: {},
3984
+ text: {},
3985
+ label: {},
3986
+ helperText: {},
3987
+ field: {}
3484
3988
  } : _ref$styles,
3485
- _ref$setIsHovered = _ref.setIsHovered,
3486
- setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
3487
- props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
3989
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
3990
+ var isWithLabel = !!(isFocused && label);
3991
+ useMemo(function () {
3992
+ setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
3993
+ }, [inputValue, isFocused, label, placeholder]);
3994
+ var fieldStyles = Object.assign({
3995
+ margin: 0,
3996
+ paddingVertical: 8,
3997
+ paddingHorizontal: 0,
3998
+ width: '100%',
3999
+ heigth: '100%',
4000
+ border: 'none',
4001
+ on: {
4002
+ focus: {
4003
+ outline: 'none'
4004
+ }
4005
+ },
4006
+ fontSize: Typography.fontSizes[size],
4007
+ backgroundColor: 'transparent',
4008
+ color: isDisabled ? 'trueGray.600' : 'blueGray.700',
4009
+ cursor: isDisabled ? 'not-allowed' : 'auto'
4010
+ }, styles['field']);
3488
4011
  var handleHover = function handleHover() {
3489
- if (underline === 'hover') setIsHovered(true);
4012
+ return setIsHovered(!isHovered);
3490
4013
  };
3491
- return /*#__PURE__*/React.createElement(Link$2, {
3492
- to: href,
3493
- target: isExternal ? '_blank' : '_self'
3494
- }, /*#__PURE__*/React.createElement(Element, Object.assign({
4014
+ var handleFocus = function handleFocus() {
4015
+ setIsFocused(true);
4016
+ if (onFocus) onFocus();
4017
+ };
4018
+ var handleBlur = function handleBlur(event) {
4019
+ onBlur(event);
4020
+ setIsFocused(false);
4021
+ };
4022
+ var handleChange = function handleChange(event) {
4023
+ if (typeof event === 'string') {
4024
+ //for ios and android
4025
+ setInputValue(event);
4026
+ if (onChangeText) onChangeText(event);
4027
+ } else {
4028
+ setInputValue(event.target.value);
4029
+ if (onChange) onChange(event);
4030
+ }
4031
+ };
4032
+ return /*#__PURE__*/React.createElement(FieldContainer, {
4033
+ helperText: helperText,
4034
+ error: error,
4035
+ styles: styles
4036
+ }, /*#__PURE__*/React.createElement(FieldContent, {
4037
+ label: label,
4038
+ size: size,
4039
+ error: error,
4040
+ shape: shape,
4041
+ styles: styles,
4042
+ shadow: shadow,
4043
+ variant: variant,
4044
+ value: inputValue,
3495
4045
  color: colorScheme,
4046
+ isHovered: isHovered,
4047
+ isDisabled: isDisabled,
4048
+ isReadOnly: isReadOnly,
4049
+ isFocused: isFocused,
4050
+ isWithLabel: isWithLabel,
4051
+ colorScheme: colorScheme,
3496
4052
  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, {
4053
+ onMouseLeave: handleHover
4054
+ }, /*#__PURE__*/React.createElement(FieldWrapper, null, isWithLabel && /*#__PURE__*/React.createElement(FieldLabel, Object.assign({
4055
+ htmlFor: id,
3504
4056
  color: colorScheme,
3505
- size: IconSizes$4[iconSize],
3506
- style: styles.icon
3507
- }))));
4057
+ error: error
4058
+ }, styles), label), /*#__PURE__*/React.createElement(Element, Object.assign({
4059
+ as: "textarea",
4060
+ id: id,
4061
+ name: name,
4062
+ rows: maxRows,
4063
+ cols: maxCols,
4064
+ value: inputValue,
4065
+ readOnly: isReadOnly,
4066
+ disabled: isDisabled,
4067
+ autoFocus: isAutoFocus,
4068
+ editable: isEditable,
4069
+ placeholder: hint,
4070
+ onBlur: handleBlur,
4071
+ onFocus: handleFocus,
4072
+ onChange: handleChange,
4073
+ multiline: isMultiline
4074
+ }, fieldStyles, props, onChangeText && {
4075
+ onChangeText: handleChange
4076
+ })))));
3508
4077
  };
3509
4078
 
3510
- var LinkComponent = function LinkComponent(props) {
3511
- var linkStates = useLinkState();
3512
- return /*#__PURE__*/React.createElement(LinkView, Object.assign({}, linkStates, props));
4079
+ var TextAreaComponent = function TextAreaComponent(props) {
4080
+ var textAreaState = useTextAreaState(props);
4081
+ return /*#__PURE__*/React.createElement(TextAreaView, Object.assign({}, textAreaState, props));
3513
4082
  };
3514
4083
  /**
3515
- * Link allows users to navigate from page to page. It have a similar appearance as the hyperlink.
4084
+ * Text Area is an component used to create a multi-line input field.
3516
4085
  */
3517
- var Link = LinkComponent;
4086
+ var TextArea = TextAreaComponent;
3518
4087
 
3519
4088
  var DefaultSizes = {
3520
4089
  xs: 14,
@@ -3534,7 +4103,7 @@ var DefaultSpeeds = {
3534
4103
  slow: 300
3535
4104
  };
3536
4105
 
3537
- var _excluded$d = ["size", "speed", "color"],
4106
+ var _excluded$r = ["size", "speed", "color"],
3538
4107
  _excluded2$1 = ["size", "speed", "color"],
3539
4108
  _excluded3$1 = ["size", "speed", "color"],
3540
4109
  _excluded4$1 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
@@ -3545,7 +4114,7 @@ var DefaultSpinner = function DefaultSpinner(_ref) {
3545
4114
  speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
3546
4115
  _ref$color = _ref.color,
3547
4116
  color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
3548
- props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
4117
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
3549
4118
  var theme = useTheme();
3550
4119
  var colorStyle = theme.getColor(color);
3551
4120
  var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
@@ -3701,7 +4270,7 @@ var LoaderView = function LoaderView(_ref4) {
3701
4270
  dotted: /*#__PURE__*/React.createElement(Dotted, Object.assign({}, style)),
3702
4271
  quarter: /*#__PURE__*/React.createElement(Quarter, Object.assign({}, style))
3703
4272
  };
3704
- return /*#__PURE__*/React.createElement(Center$1, Object.assign({
4273
+ return /*#__PURE__*/React.createElement(Center, Object.assign({
3705
4274
  gap: 10,
3706
4275
  flexDirection: textPosition === 'top' || textPosition === 'bottom' ? 'column' : 'row'
3707
4276
  }, props), (textPosition === 'left' || textPosition === 'top') && children && /*#__PURE__*/React.createElement(View, {
@@ -3711,13 +4280,13 @@ var LoaderView = function LoaderView(_ref4) {
3711
4280
  }, children));
3712
4281
  };
3713
4282
 
3714
- var LoadingComponent = function LoadingComponent(props) {
4283
+ var LoaderComponent = function LoaderComponent(props) {
3715
4284
  return /*#__PURE__*/React.createElement(LoaderView, Object.assign({}, props));
3716
4285
  };
3717
4286
  /**
3718
4287
  * It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
3719
4288
  */
3720
- var Loading = LoadingComponent;
4289
+ var Loader = LoaderComponent;
3721
4290
 
3722
4291
  var ContainerShapes = {
3723
4292
  sharp: {
@@ -3755,7 +4324,7 @@ var HeaderIconSizes = {
3755
4324
  xl: 28
3756
4325
  };
3757
4326
 
3758
- var _excluded$e = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
4327
+ var _excluded$s = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
3759
4328
  _excluded2$2 = ["children", "shadow", "isFullScreen", "shape"],
3760
4329
  _excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
3761
4330
  _excluded4$2 = ["children"],
@@ -3771,7 +4340,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
3771
4340
  onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
3772
4341
  _ref$position = _ref.position,
3773
4342
  position = _ref$position === void 0 ? 'center' : _ref$position,
3774
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
4343
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
3775
4344
  var setOpen = useModalStore(function (state) {
3776
4345
  return state.setOpen;
3777
4346
  });
@@ -3786,7 +4355,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
3786
4355
  var handleClick = function handleClick() {
3787
4356
  if (!isClosePrevented) onClose();
3788
4357
  };
3789
- return /*#__PURE__*/React.createElement(Center$1, {
4358
+ return /*#__PURE__*/React.createElement(Center, {
3790
4359
  position: "fixed",
3791
4360
  top: 0,
3792
4361
  left: 0,
@@ -3795,7 +4364,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
3795
4364
  zIndex: 1000,
3796
4365
  onClick: handleClick,
3797
4366
  visibility: isOpen ? 'visible' : 'hidden'
3798
- }, /*#__PURE__*/React.createElement(View$1, Object.assign({
4367
+ }, /*#__PURE__*/React.createElement(View, Object.assign({
3799
4368
  cursor: "pointer",
3800
4369
  position: "absolute",
3801
4370
  top: 0,
@@ -3832,7 +4401,7 @@ var ModalContainer = function ModalContainer(_ref2) {
3832
4401
  var handleClick = function handleClick(event) {
3833
4402
  return event.stopPropagation();
3834
4403
  };
3835
- return /*#__PURE__*/React.createElement(Vertical$1, Object.assign({
4404
+ return /*#__PURE__*/React.createElement(Vertical, Object.assign({
3836
4405
  cursor: "default",
3837
4406
  overflow: "hidden",
3838
4407
  backgroundColor: "white",
@@ -3853,7 +4422,7 @@ var ModalHeader = function ModalHeader(_ref3) {
3853
4422
  var onClose = useModalStore(function (state) {
3854
4423
  return state.onClose;
3855
4424
  });
3856
- var buttonIcon = /*#__PURE__*/React.createElement(Button$1, {
4425
+ var buttonIcon = /*#__PURE__*/React.createElement(Button, {
3857
4426
  onClick: onClose,
3858
4427
  colorScheme: "transparent",
3859
4428
  icon: /*#__PURE__*/React.createElement(CloseSvg, {
@@ -3865,7 +4434,7 @@ var ModalHeader = function ModalHeader(_ref3) {
3865
4434
  filter: "none",
3866
4435
  isAuto: true
3867
4436
  });
3868
- return /*#__PURE__*/React.createElement(Horizontal$1, Object.assign({
4437
+ return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
3869
4438
  justifyContent: buttonPosition === 'none' ? 'center' : 'space-between',
3870
4439
  alignItems: "center",
3871
4440
  paddingVertical: 15,
@@ -3881,7 +4450,7 @@ var ModalBody = function ModalBody(_ref4) {
3881
4450
  borderColor: 'rgba(250, 250, 250, 1)',
3882
4451
  borderStyle: 'solid'
3883
4452
  };
3884
- return /*#__PURE__*/React.createElement(View$1, Object.assign({
4453
+ return /*#__PURE__*/React.createElement(View, Object.assign({
3885
4454
  overflowY: "auto",
3886
4455
  paddingVertical: 15,
3887
4456
  paddingHorizontal: 20
@@ -3890,7 +4459,7 @@ var ModalBody = function ModalBody(_ref4) {
3890
4459
  var ModalFooter = function ModalFooter(_ref5) {
3891
4460
  var children = _ref5.children,
3892
4461
  props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
3893
- return /*#__PURE__*/React.createElement(Horizontal$1, Object.assign({
4462
+ return /*#__PURE__*/React.createElement(Horizontal, Object.assign({
3894
4463
  marginTop: "auto",
3895
4464
  alignItems: "center",
3896
4465
  justifyContent: "flex-end",
@@ -3913,125 +4482,5 @@ Modal.Header = ModalHeader;
3913
4482
  Modal.Body = ModalBody;
3914
4483
  Modal.Footer = ModalFooter;
3915
4484
 
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 };
4485
+ export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loader, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
4037
4486
  //# sourceMappingURL=web.esm.js.map