@true-engineering/true-react-common-ui-kit 1.5.2 → 1.6.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 (244) hide show
  1. package/LICENSE +201 -201
  2. package/dist/components/Checkbox/Checkbox.d.ts +2 -1
  3. package/dist/components/Checkbox/Checkbox.styles.d.ts +4 -1
  4. package/dist/components/Flag/augment.d.ts +1 -1
  5. package/dist/components/Icon/complexIcons/augment.d.ts +1 -1
  6. package/dist/components/Input/Input.d.ts +1 -1
  7. package/dist/helpers/index.d.ts +0 -1
  8. package/dist/helpers/utils.d.ts +8 -0
  9. package/dist/true-react-common-ui-kit.js +183 -155
  10. package/dist/true-react-common-ui-kit.js.map +1 -1
  11. package/dist/true-react-common-ui-kit.umd.cjs +183 -155
  12. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  13. package/dist/vite-env.d.ts +1 -1
  14. package/package.json +91 -91
  15. package/src/components/AccountInfo/AccountInfo.stories.tsx +35 -35
  16. package/src/components/AccountInfo/AccountInfo.styles.ts +55 -55
  17. package/src/components/AccountInfo/AccountInfo.tsx +106 -106
  18. package/src/components/AccountInfo/index.ts +2 -2
  19. package/src/components/AddButton/AddButton.stories.tsx +21 -21
  20. package/src/components/AddButton/AddButton.styles.ts +34 -34
  21. package/src/components/AddButton/AddButton.tsx +49 -49
  22. package/src/components/AddButton/index.ts +2 -2
  23. package/src/components/Button/Button.stories.tsx +61 -61
  24. package/src/components/Button/Button.styles.ts +196 -196
  25. package/src/components/Button/Button.tsx +195 -195
  26. package/src/components/Button/index.ts +2 -2
  27. package/src/components/Checkbox/Checkbox.stories.tsx +35 -35
  28. package/src/components/Checkbox/Checkbox.styles.ts +62 -59
  29. package/src/components/Checkbox/Checkbox.tsx +106 -93
  30. package/src/components/Checkbox/index.ts +2 -2
  31. package/src/components/CloseButton/CloseButton.styles.ts +34 -34
  32. package/src/components/CloseButton/CloseButton.tsx +37 -37
  33. package/src/components/CloseButton/index.ts +2 -2
  34. package/src/components/Colors/Colors.stories.tsx +7 -7
  35. package/src/components/Colors/Colors.styles.ts +38 -38
  36. package/src/components/Colors/Colors.tsx +34 -34
  37. package/src/components/Colors/index.ts +2 -2
  38. package/src/components/CssBaseline/CssBaseline.styles.ts +15 -15
  39. package/src/components/CssBaseline/CssBaseline.tsx +17 -17
  40. package/src/components/CssBaseline/index.ts +2 -2
  41. package/src/components/DateInput/DateInput.stories.tsx +63 -63
  42. package/src/components/DateInput/DateInput.styles.ts +14 -14
  43. package/src/components/DateInput/DateInput.tsx +60 -60
  44. package/src/components/DateInput/index.ts +2 -2
  45. package/src/components/DatePicker/DatePicker.stories.tsx +96 -96
  46. package/src/components/DatePicker/DatePicker.styles.ts +54 -54
  47. package/src/components/DatePicker/DatePicker.tsx +358 -358
  48. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.styles.ts +84 -84
  49. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.tsx +94 -94
  50. package/src/components/DatePicker/DatePickerHeader/index.ts +1 -1
  51. package/src/components/DatePicker/DatePickerInput/DatePickerInput.styles.ts +25 -25
  52. package/src/components/DatePicker/DatePickerInput/DatePickerInput.tsx +31 -31
  53. package/src/components/DatePicker/DatePickerInput/index.ts +1 -1
  54. package/src/components/DatePicker/index.ts +4 -4
  55. package/src/components/Description/Description.stories.tsx +29 -29
  56. package/src/components/Description/Description.styles.ts +31 -31
  57. package/src/components/Description/Description.tsx +69 -69
  58. package/src/components/Description/index.ts +2 -2
  59. package/src/components/FiltersPane/FilterInterval/FilterInterval.styles.ts +64 -64
  60. package/src/components/FiltersPane/FilterInterval/FilterInterval.tsx +162 -162
  61. package/src/components/FiltersPane/FilterInterval/index.ts +1 -1
  62. package/src/components/FiltersPane/FilterMultiSelect/FilterMultiSelect.tsx +14 -14
  63. package/src/components/FiltersPane/FilterMultiSelect/index.ts +1 -1
  64. package/src/components/FiltersPane/FilterSelect/FilterSelect.styles.ts +144 -144
  65. package/src/components/FiltersPane/FilterSelect/FilterSelect.tsx +397 -397
  66. package/src/components/FiltersPane/FilterSelect/index.ts +1 -1
  67. package/src/components/FiltersPane/FilterSelect/locales.ts +37 -37
  68. package/src/components/FiltersPane/FilterValueView/FilterValueView.styles.tsx +15 -15
  69. package/src/components/FiltersPane/FilterValueView/FilterValueView.tsx +186 -186
  70. package/src/components/FiltersPane/FilterValueView/index.tsx +1 -1
  71. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.styles.ts +60 -60
  72. package/src/components/FiltersPane/FilterWithDates/FilterWithDates.tsx +222 -222
  73. package/src/components/FiltersPane/FilterWithDates/index.ts +1 -1
  74. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.styles.ts +17 -17
  75. package/src/components/FiltersPane/FilterWithPeriod/FilterWithPeriod.tsx +231 -231
  76. package/src/components/FiltersPane/FilterWithPeriod/index.ts +1 -1
  77. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.styles.ts +110 -110
  78. package/src/components/FiltersPane/FilterWrapper/FilterWrapper.tsx +360 -360
  79. package/src/components/FiltersPane/FilterWrapper/index.ts +1 -1
  80. package/src/components/FiltersPane/FiltersPane.stories.tsx +308 -308
  81. package/src/components/FiltersPane/FiltersPane.styles.ts +71 -71
  82. package/src/components/FiltersPane/FiltersPane.tsx +193 -193
  83. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.styles.ts +109 -109
  84. package/src/components/FiltersPane/FiltersPaneSearch/FiltersPaneSearch.tsx +175 -175
  85. package/src/components/FiltersPane/FiltersPaneSearch/index.ts +1 -1
  86. package/src/components/FiltersPane/index.ts +20 -20
  87. package/src/components/FiltersPane/locales.ts +107 -107
  88. package/src/components/FiltersPane/types.ts +126 -126
  89. package/src/components/Flag/Flag.stories.tsx +29 -29
  90. package/src/components/Flag/Flag.styles.ts +18 -18
  91. package/src/components/Flag/Flag.tsx +28 -28
  92. package/src/components/Flag/augment.d.ts +1 -1
  93. package/src/components/Flag/index.ts +2 -2
  94. package/src/components/FlexibleTable/FlexibleTable.stories.tsx +80 -80
  95. package/src/components/FlexibleTable/FlexibleTable.styles.ts +131 -131
  96. package/src/components/FlexibleTable/FlexibleTable.tsx +243 -243
  97. package/src/components/FlexibleTable/TableRow.tsx +171 -171
  98. package/src/components/FlexibleTable/TableValue.tsx +83 -83
  99. package/src/components/FlexibleTable/fixture-test.ts +254 -254
  100. package/src/components/FlexibleTable/index.ts +3 -3
  101. package/src/components/FlexibleTable/types.ts +58 -58
  102. package/src/components/Icon/ComplexIconBoilerplate.tsx +17 -17
  103. package/src/components/Icon/Icon.stories.tsx +88 -88
  104. package/src/components/Icon/Icon.styles.ts +10 -10
  105. package/src/components/Icon/Icon.tsx +34 -34
  106. package/src/components/Icon/IconBoilerplate.tsx +42 -42
  107. package/src/components/Icon/complexIcons/augment.d.ts +1 -1
  108. package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
  109. package/src/components/Icon/complexIcons/icons.ts +7 -7
  110. package/src/components/Icon/complexIcons/index.ts +1 -1
  111. package/src/components/Icon/icons/icons.ts +838 -838
  112. package/src/components/Icon/icons/index.ts +1 -1
  113. package/src/components/Icon/index.ts +4 -4
  114. package/src/components/IncrementInput/ChangeButton.tsx +34 -34
  115. package/src/components/IncrementInput/IncrementInput.stories.tsx +34 -34
  116. package/src/components/IncrementInput/IncrementInput.styles.ts +77 -77
  117. package/src/components/IncrementInput/IncrementInput.tsx +95 -95
  118. package/src/components/IncrementInput/index.ts +2 -2
  119. package/src/components/Input/Input.stories.tsx +92 -92
  120. package/src/components/Input/Input.styles.ts +305 -305
  121. package/src/components/Input/Input.tsx +318 -324
  122. package/src/components/Input/index.ts +2 -2
  123. package/src/components/List/List.stories.tsx +62 -62
  124. package/src/components/List/List.styles.ts +52 -52
  125. package/src/components/List/List.tsx +82 -82
  126. package/src/components/List/index.ts +2 -2
  127. package/src/components/Modal/Modal.stories.tsx +113 -113
  128. package/src/components/Modal/Modal.styles.ts +308 -308
  129. package/src/components/Modal/Modal.tsx +210 -210
  130. package/src/components/Modal/index.ts +2 -2
  131. package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
  132. package/src/components/MoreMenu/MoreMenu.styles.ts +70 -70
  133. package/src/components/MoreMenu/MoreMenu.tsx +102 -102
  134. package/src/components/MoreMenu/index.ts +2 -2
  135. package/src/components/MultiSelect/MultiSelect.stories.tsx +46 -46
  136. package/src/components/MultiSelect/MultiSelect.styles.ts +55 -55
  137. package/src/components/MultiSelect/MultiSelect.tsx +98 -98
  138. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.styles.ts +73 -73
  139. package/src/components/MultiSelect/MultiSelectInput/MultiSelectInput.tsx +62 -62
  140. package/src/components/MultiSelect/MultiSelectInput/index.ts +1 -1
  141. package/src/components/MultiSelect/index.ts +3 -3
  142. package/src/components/MultiSelectList/MultiSelectList.styles.ts +125 -125
  143. package/src/components/MultiSelectList/MultiSelectList.tsx +519 -519
  144. package/src/components/MultiSelectList/index.ts +2 -2
  145. package/src/components/MultiSelectList/locales.ts +37 -37
  146. package/src/components/Notification/Notification.stories.tsx +51 -51
  147. package/src/components/Notification/Notification.styles.ts +50 -50
  148. package/src/components/Notification/Notification.tsx +84 -84
  149. package/src/components/Notification/index.ts +2 -2
  150. package/src/components/NumberInput/NumberInput.stories.tsx +36 -36
  151. package/src/components/NumberInput/NumberInput.tsx +154 -154
  152. package/src/components/NumberInput/helpers.ts +87 -87
  153. package/src/components/NumberInput/index.ts +1 -1
  154. package/src/components/PhoneInput/PhoneInput.stories.tsx +71 -71
  155. package/src/components/PhoneInput/PhoneInput.styles.ts +84 -84
  156. package/src/components/PhoneInput/PhoneInput.tsx +223 -223
  157. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +21 -21
  158. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.styles.ts +100 -100
  159. package/src/components/PhoneInput/PhoneInputCountryList/PhoneInputCountryList.tsx +171 -171
  160. package/src/components/PhoneInput/PhoneInputCountryList/index.ts +2 -2
  161. package/src/components/PhoneInput/index.ts +6 -6
  162. package/src/components/PhoneInput/phone-info.ts +2167 -2167
  163. package/src/components/PhoneInput/types.ts +16 -16
  164. package/src/components/RadioButton/RadioButton.stories.tsx +46 -46
  165. package/src/components/RadioButton/RadioButton.styles.ts +37 -37
  166. package/src/components/RadioButton/RadioButton.tsx +56 -56
  167. package/src/components/RadioButton/index.ts +2 -2
  168. package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +66 -66
  169. package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
  170. package/src/components/SearchInput/SearchInput.stories.tsx +24 -24
  171. package/src/components/SearchInput/SearchInput.styles.ts +50 -50
  172. package/src/components/SearchInput/SearchInput.tsx +63 -63
  173. package/src/components/SearchInput/index.ts +2 -2
  174. package/src/components/Select/Select.stories.tsx +258 -258
  175. package/src/components/Select/Select.styles.ts +85 -85
  176. package/src/components/Select/Select.tsx +514 -508
  177. package/src/components/Select/SelectList/SelectList.styles.ts +68 -68
  178. package/src/components/Select/SelectList/SelectList.tsx +139 -139
  179. package/src/components/Select/SelectList/index.ts +1 -1
  180. package/src/components/Select/helpers.ts +21 -21
  181. package/src/components/Select/index.ts +3 -3
  182. package/src/components/SmartInput/SmartInput.stories.tsx +63 -63
  183. package/src/components/SmartInput/SmartInput.tsx +180 -180
  184. package/src/components/SmartInput/helpers.ts +85 -85
  185. package/src/components/SmartInput/index.ts +1 -1
  186. package/src/components/Switch/Switch.stories.tsx +40 -40
  187. package/src/components/Switch/Switch.styles.ts +75 -75
  188. package/src/components/Switch/Switch.tsx +89 -89
  189. package/src/components/Switch/index.ts +2 -2
  190. package/src/components/TextArea/TextArea.stories.tsx +35 -35
  191. package/src/components/TextArea/TextArea.styles.ts +153 -153
  192. package/src/components/TextArea/TextArea.tsx +178 -178
  193. package/src/components/TextArea/index.ts +2 -2
  194. package/src/components/TextWithInfo/TextWithInfo.stories.tsx +53 -53
  195. package/src/components/TextWithInfo/TextWithInfo.styles.ts +60 -60
  196. package/src/components/TextWithInfo/TextWithInfo.tsx +67 -67
  197. package/src/components/TextWithInfo/index.ts +2 -2
  198. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
  199. package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +19 -19
  200. package/src/components/TextWithTooltip/TextWithTooltip.tsx +163 -163
  201. package/src/components/TextWithTooltip/index.ts +2 -2
  202. package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +41 -41
  203. package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +21 -21
  204. package/src/components/ThemedPreloader/ThemedPreloader.tsx +56 -56
  205. package/src/components/ThemedPreloader/components/DefaultPreloader/DefaultPreloader.tsx +34 -34
  206. package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
  207. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +54 -54
  208. package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +18 -18
  209. package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
  210. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
  211. package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +32 -32
  212. package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
  213. package/src/components/ThemedPreloader/components/index.ts +2 -2
  214. package/src/components/ThemedPreloader/index.ts +2 -2
  215. package/src/components/Toaster/Toaster.stories.tsx +34 -34
  216. package/src/components/Toaster/Toaster.styles.ts +59 -59
  217. package/src/components/Toaster/Toaster.tsx +113 -113
  218. package/src/components/Toaster/index.ts +2 -2
  219. package/src/components/Tooltip/Tooltip.stories.tsx +21 -21
  220. package/src/components/Tooltip/Tooltip.styles.ts +45 -45
  221. package/src/components/Tooltip/Tooltip.tsx +40 -40
  222. package/src/components/Tooltip/index.ts +3 -3
  223. package/src/components/Tooltip/types.ts +1 -1
  224. package/src/components/index.ts +36 -36
  225. package/src/helpers/colors.ts +2 -2
  226. package/src/helpers/dateHelpers/date-helpers.ts +9 -9
  227. package/src/helpers/index.ts +4 -5
  228. package/src/helpers/phone.ts +106 -106
  229. package/src/helpers/popper-helpers.ts +17 -17
  230. package/src/helpers/snippets.tsx +5 -5
  231. package/src/helpers/utils.ts +219 -178
  232. package/src/hooks/index.ts +6 -6
  233. package/src/hooks/use-did-mount-effect.ts +21 -21
  234. package/src/hooks/use-dropdown.ts +85 -85
  235. package/src/hooks/use-is-mounted.ts +15 -15
  236. package/src/hooks/use-on-click-outside.ts +92 -92
  237. package/src/hooks/use-theme.ts +36 -36
  238. package/src/hooks/use-tweak-styles.ts +14 -14
  239. package/src/index.ts +6 -6
  240. package/src/theme.ts +155 -155
  241. package/src/types.ts +106 -106
  242. package/src/vite-env.d.ts +1 -1
  243. package/dist/helpers/data-attributes.d.ts +0 -5
  244. package/src/helpers/data-attributes.ts +0 -18
@@ -1099,6 +1099,79 @@
1099
1099
  const Fragment = jsxRuntime.exports.Fragment;
1100
1100
  const jsx = jsxRuntime.exports.jsx;
1101
1101
  const jsxs = jsxRuntime.exports.jsxs;
1102
+ var rgba = hexToRgba;
1103
+ function _array_like_to_array$q(arr, len) {
1104
+ if (len == null || len > arr.length)
1105
+ len = arr.length;
1106
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
1107
+ arr2[i] = arr[i];
1108
+ return arr2;
1109
+ }
1110
+ function _array_with_holes$o(arr) {
1111
+ if (Array.isArray(arr))
1112
+ return arr;
1113
+ }
1114
+ function _array_without_holes$6(arr) {
1115
+ if (Array.isArray(arr))
1116
+ return _array_like_to_array$q(arr);
1117
+ }
1118
+ function _iterable_to_array$6(iter) {
1119
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1120
+ return Array.from(iter);
1121
+ }
1122
+ function _iterable_to_array_limit$o(arr, i) {
1123
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1124
+ if (_i == null)
1125
+ return;
1126
+ var _arr = [];
1127
+ var _n = true;
1128
+ var _d = false;
1129
+ var _s, _e;
1130
+ try {
1131
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
1132
+ _arr.push(_s.value);
1133
+ if (i && _arr.length === i)
1134
+ break;
1135
+ }
1136
+ } catch (err) {
1137
+ _d = true;
1138
+ _e = err;
1139
+ } finally {
1140
+ try {
1141
+ if (!_n && _i["return"] != null)
1142
+ _i["return"]();
1143
+ } finally {
1144
+ if (_d)
1145
+ throw _e;
1146
+ }
1147
+ }
1148
+ return _arr;
1149
+ }
1150
+ function _non_iterable_rest$o() {
1151
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1152
+ }
1153
+ function _non_iterable_spread$6() {
1154
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1155
+ }
1156
+ function _sliced_to_array$o(arr, i) {
1157
+ return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$o();
1158
+ }
1159
+ function _to_consumable_array$6(arr) {
1160
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$6();
1161
+ }
1162
+ function _unsupported_iterable_to_array$q(o, minLen) {
1163
+ if (!o)
1164
+ return;
1165
+ if (typeof o === "string")
1166
+ return _array_like_to_array$q(o, minLen);
1167
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1168
+ if (n === "Object" && o.constructor)
1169
+ n = o.constructor.name;
1170
+ if (n === "Map" || n === "Set")
1171
+ return Array.from(n);
1172
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1173
+ return _array_like_to_array$q(o, minLen);
1174
+ }
1102
1175
  var transformToKebab = function(string) {
1103
1176
  var result = "";
1104
1177
  string.split("").forEach(function(char) {
@@ -1222,84 +1295,6 @@
1222
1295
  var trimStringToMaxLength = function(val, maxLength) {
1223
1296
  return val.length > maxLength ? val.slice(0, maxLength) : val;
1224
1297
  };
1225
- var getTestId = function(testId, postfix) {
1226
- if (!isNotEmpty(testId)) {
1227
- return void 0;
1228
- }
1229
- return isNotEmpty(postfix) ? "".concat(testId, "-").concat(postfix) : testId;
1230
- };
1231
- function _array_like_to_array$q(arr, len) {
1232
- if (len == null || len > arr.length)
1233
- len = arr.length;
1234
- for (var i = 0, arr2 = new Array(len); i < len; i++)
1235
- arr2[i] = arr[i];
1236
- return arr2;
1237
- }
1238
- function _array_with_holes$o(arr) {
1239
- if (Array.isArray(arr))
1240
- return arr;
1241
- }
1242
- function _array_without_holes$6(arr) {
1243
- if (Array.isArray(arr))
1244
- return _array_like_to_array$q(arr);
1245
- }
1246
- function _iterable_to_array$6(iter) {
1247
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
1248
- return Array.from(iter);
1249
- }
1250
- function _iterable_to_array_limit$o(arr, i) {
1251
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1252
- if (_i == null)
1253
- return;
1254
- var _arr = [];
1255
- var _n = true;
1256
- var _d = false;
1257
- var _s, _e;
1258
- try {
1259
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
1260
- _arr.push(_s.value);
1261
- if (i && _arr.length === i)
1262
- break;
1263
- }
1264
- } catch (err) {
1265
- _d = true;
1266
- _e = err;
1267
- } finally {
1268
- try {
1269
- if (!_n && _i["return"] != null)
1270
- _i["return"]();
1271
- } finally {
1272
- if (_d)
1273
- throw _e;
1274
- }
1275
- }
1276
- return _arr;
1277
- }
1278
- function _non_iterable_rest$o() {
1279
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1280
- }
1281
- function _non_iterable_spread$6() {
1282
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1283
- }
1284
- function _sliced_to_array$o(arr, i) {
1285
- return _array_with_holes$o(arr) || _iterable_to_array_limit$o(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$o();
1286
- }
1287
- function _to_consumable_array$6(arr) {
1288
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$6();
1289
- }
1290
- function _unsupported_iterable_to_array$q(o, minLen) {
1291
- if (!o)
1292
- return;
1293
- if (typeof o === "string")
1294
- return _array_like_to_array$q(o, minLen);
1295
- var n = Object.prototype.toString.call(o).slice(8, -1);
1296
- if (n === "Object" && o.constructor)
1297
- n = o.constructor.name;
1298
- if (n === "Map" || n === "Set")
1299
- return Array.from(n);
1300
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
1301
- return _array_like_to_array$q(o, minLen);
1302
- }
1303
1298
  var addDataAttributes = function() {
1304
1299
  var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1305
1300
  return Object.fromEntries(Object.entries(data).map(function(param) {
@@ -1319,7 +1314,29 @@
1319
1314
  "data-testid": testId
1320
1315
  } : void 0;
1321
1316
  };
1322
- var rgba = hexToRgba;
1317
+ var getTestId = function(testId, postfix) {
1318
+ if (!isNotEmpty(testId)) {
1319
+ return void 0;
1320
+ }
1321
+ return isNotEmpty(postfix) ? "".concat(testId, "-").concat(postfix) : testId;
1322
+ };
1323
+ var getSelectKeyHandler = function(cb) {
1324
+ return function(e) {
1325
+ if (e.code === "Enter" || e.code === "NumpadEnter") {
1326
+ cb(e);
1327
+ }
1328
+ };
1329
+ };
1330
+ var addClickHandler = function(cb) {
1331
+ var hasAction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
1332
+ return hasAction && isNotEmpty(cb) ? {
1333
+ tabIndex: 0,
1334
+ onClick: cb,
1335
+ onKeyDown: getSelectKeyHandler(cb)
1336
+ } : {
1337
+ tabIndex: -1
1338
+ };
1339
+ };
1323
1340
  var minWidthModifier = {
1324
1341
  name: "minWidth",
1325
1342
  enabled: true,
@@ -4183,63 +4200,63 @@
4183
4200
  ]
4184
4201
  });
4185
4202
  };
4186
- const avatarGreen = ` <svg
4187
- width="100%"
4188
- height="100%"
4189
- viewBox="0 0 32 32"
4190
- fill="none"
4191
- xmlns="http://www.w3.org/2000/svg"
4192
- >
4193
- <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />
4194
- <mask
4195
- id="mask0_0_12744"
4196
- style="mask-type: 'alpha';"
4197
- maskUnits="userSpaceOnUse"
4198
- x="0"
4199
- y="0"
4200
- width="32"
4201
- height="32"
4202
- >
4203
- <circle cx="16" cy="16" r="16" fill="white" />
4204
- </mask>
4205
- <g mask="url(#mask0_0_12744)">
4206
- <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />
4207
- <mask
4208
- id="mask1_0_12744"
4209
- style="mask-type: 'alpha';"
4210
- maskUnits="userSpaceOnUse"
4211
- x="3"
4212
- y="16"
4213
- width="26"
4214
- height="26"
4215
- >
4216
- <circle cx="16" cy="29" r="13" fill="white" />
4217
- </mask>
4218
- <g mask="url(#mask1_0_12744)">
4219
- <ellipse
4220
- cx="16"
4221
- cy="17.5"
4222
- rx="6"
4223
- ry="7.5"
4224
- fill="#505F79"
4225
- fill-opacity="0.204983"
4226
- />
4227
- </g>
4228
- </g>
4229
- <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />
4230
- <defs>
4231
- <linearGradient
4232
- id="paint0_linear_0_12744"
4233
- x1="13.347"
4234
- y1="46.279"
4235
- x2="33.5318"
4236
- y2="30.8088"
4237
- gradientUnits="userSpaceOnUse"
4238
- >
4239
- <stop stop-color="#ABD229" />
4240
- <stop offset="1" stop-color="#9CD03F" />
4241
- </linearGradient>
4242
- </defs>
4203
+ const avatarGreen = ` <svg\r
4204
+ width="100%"\r
4205
+ height="100%"\r
4206
+ viewBox="0 0 32 32"\r
4207
+ fill="none"\r
4208
+ xmlns="http://www.w3.org/2000/svg"\r
4209
+ >\r
4210
+ <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />\r
4211
+ <mask\r
4212
+ id="mask0_0_12744"\r
4213
+ style="mask-type: 'alpha';"\r
4214
+ maskUnits="userSpaceOnUse"\r
4215
+ x="0"\r
4216
+ y="0"\r
4217
+ width="32"\r
4218
+ height="32"\r
4219
+ >\r
4220
+ <circle cx="16" cy="16" r="16" fill="white" />\r
4221
+ </mask>\r
4222
+ <g mask="url(#mask0_0_12744)">\r
4223
+ <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />\r
4224
+ <mask\r
4225
+ id="mask1_0_12744"\r
4226
+ style="mask-type: 'alpha';"\r
4227
+ maskUnits="userSpaceOnUse"\r
4228
+ x="3"\r
4229
+ y="16"\r
4230
+ width="26"\r
4231
+ height="26"\r
4232
+ >\r
4233
+ <circle cx="16" cy="29" r="13" fill="white" />\r
4234
+ </mask>\r
4235
+ <g mask="url(#mask1_0_12744)">\r
4236
+ <ellipse\r
4237
+ cx="16"\r
4238
+ cy="17.5"\r
4239
+ rx="6"\r
4240
+ ry="7.5"\r
4241
+ fill="#505F79"\r
4242
+ fill-opacity="0.204983"\r
4243
+ />\r
4244
+ </g>\r
4245
+ </g>\r
4246
+ <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />\r
4247
+ <defs>\r
4248
+ <linearGradient\r
4249
+ id="paint0_linear_0_12744"\r
4250
+ x1="13.347"\r
4251
+ y1="46.279"\r
4252
+ x2="33.5318"\r
4253
+ y2="30.8088"\r
4254
+ gradientUnits="userSpaceOnUse"\r
4255
+ >\r
4256
+ <stop stop-color="#ABD229" />\r
4257
+ <stop offset="1" stop-color="#9CD03F" />\r
4258
+ </linearGradient>\r
4259
+ </defs>\r
4243
4260
  </svg>`;
4244
4261
  var complexIcons = {
4245
4262
  avatar: avatarGreen
@@ -5383,7 +5400,10 @@
5383
5400
  pointerEvents: "none"
5384
5401
  },
5385
5402
  input: {
5386
- display: "none"
5403
+ width: 1,
5404
+ height: 1,
5405
+ position: "absolute",
5406
+ opacity: 0
5387
5407
  },
5388
5408
  children: {
5389
5409
  maxWidth: "calc(100% - 32px)",
@@ -5533,19 +5553,21 @@
5533
5553
  return _array_like_to_array$m(o, minLen);
5534
5554
  }
5535
5555
  function Checkbox(param) {
5536
- var children = param.children, isDisabled = param.isDisabled, _param_isChecked = param.isChecked, isChecked = _param_isChecked === void 0 ? false : _param_isChecked, value = param.value, _param_size = param.size, size = _param_size === void 0 ? 18 : _param_size, _param_alignItems = param.alignItems, alignItems = _param_alignItems === void 0 ? "center" : _param_alignItems, textMargin = param.textMargin, data = param.data, testId = param.testId, isSemiChecked = param.isSemiChecked, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? "right" : _param_labelPosition, tweakStyles = param.tweakStyles, onSelect = param.onSelect;
5556
+ var children = param.children, isDisabled = param.isDisabled, isReadonly = param.isReadonly, _param_isChecked = param.isChecked, isChecked = _param_isChecked === void 0 ? false : _param_isChecked, value = param.value, _param_size = param.size, size = _param_size === void 0 ? 18 : _param_size, _param_alignItems = param.alignItems, alignItems = _param_alignItems === void 0 ? "center" : _param_alignItems, textMargin = param.textMargin, data = param.data, testId = param.testId, isSemiChecked = param.isSemiChecked, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? "right" : _param_labelPosition, tweakStyles = param.tweakStyles, onSelect = param.onSelect;
5537
5557
  var classes = useTheme("Checkbox", styles$C, tweakStyles, {
5538
5558
  size,
5539
5559
  alignItems,
5540
5560
  textMargin
5541
5561
  }).classes;
5542
5562
  var _useState = _sliced_to_array$m(React.useState(false), 2), isSelected = _useState[0], setIsSelected = _useState[1];
5543
- var onChange = function(isBeingSelected) {
5563
+ var hasAction = !isDisabled && !isReadonly;
5564
+ var onToggle = function() {
5565
+ var newValue = !isSelected;
5544
5566
  onSelect({
5545
5567
  value,
5546
- isSelected: isBeingSelected
5568
+ isSelected: newValue
5547
5569
  });
5548
- setIsSelected(isBeingSelected);
5570
+ setIsSelected(newValue);
5549
5571
  };
5550
5572
  React.useEffect(function() {
5551
5573
  setIsSelected(isChecked);
@@ -5557,15 +5579,16 @@
5557
5579
  className: clsx(classes.root, (_obj = {}, _define_property$E(_obj, classes.disabled, isDisabled), _define_property$E(_obj, classes.labelPositionLeft, labelPosition === "left"), _obj))
5558
5580
  }, addDataTestId(testId), addDataAttributes(data)), {
5559
5581
  children: [
5560
- /* @__PURE__ */ jsx("input", {
5582
+ /* @__PURE__ */ jsx("input", _object_spread$D({
5583
+ type: "checkbox",
5561
5584
  className: classes.input,
5562
5585
  checked: isSelected,
5563
- onChange: isDisabled ? void 0 : function() {
5564
- return onChange(!isSelected);
5565
- },
5566
5586
  disabled: isDisabled,
5567
- type: "checkbox"
5568
- }),
5587
+ readOnly: isReadonly
5588
+ }, hasAction && {
5589
+ onChange: onToggle,
5590
+ onKeyDown: getSelectKeyHandler(onToggle)
5591
+ })),
5569
5592
  /* @__PURE__ */ jsx("div", {
5570
5593
  className: clsx(classes.check, isSelected && classes.checked),
5571
5594
  children: /* @__PURE__ */ jsx(Icon, {
@@ -6360,7 +6383,7 @@
6360
6383
  };
6361
6384
  var DEFAULT_SIZE = 6;
6362
6385
  var Input = /* @__PURE__ */ React.forwardRef(function(param, ref) {
6363
- var _param_value = param.value, value = _param_value === void 0 ? "" : _param_value, label = param.label, placeholder = param.placeholder, _param_type = param.type, type = _param_type === void 0 ? "text" : _param_type, isDisabled = param.isDisabled, isReadonly = param.isReadonly, _param_hasFloatingLabel = param.hasFloatingLabel, hasFloatingLabel = _param_hasFloatingLabel === void 0 ? true : _param_hasFloatingLabel, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isClearable = param.isClearable, isClearable = _param_isClearable === void 0 ? false : _param_isClearable, infoMessage = param.infoMessage, errorMessage = param.errorMessage, _param_errorPosition = param.errorPosition, errorPosition = _param_errorPosition === void 0 ? "bottom" : _param_errorPosition, inlineStyle = param.inlineStyle, border = param.border, isRequired = param.isRequired, isLoading = param.isLoading, isAutoSizeable = param.isAutoSizeable, _param_defaultSize = param.defaultSize, defaultSize = _param_defaultSize === void 0 ? DEFAULT_SIZE : _param_defaultSize, iconType = param.iconType, name = param.name, hasRequiredLabel = param.hasRequiredLabel, data = param.data, tweakStyles = param.tweakStyles, maxLength = param.maxLength, shouldFocusOnMount = param.shouldFocusOnMount, units = param.units, testId = param.testId, tabIndex = param.tabIndex, onChange = param.onChange, onPaste = param.onPaste, onFocus = param.onFocus, onBlur = param.onBlur, onIconClick = param.onIconClick, onKeyDown = param.onKeyDown, mask = param.mask, maskChar = param.maskChar, maskPlaceholder = param.maskPlaceholder, alwaysShowMask = param.alwaysShowMask, beforeMaskedStateChange = param.beforeMaskedStateChange;
6386
+ var _param_value = param.value, value = _param_value === void 0 ? "" : _param_value, label = param.label, placeholder = param.placeholder, _param_type = param.type, type = _param_type === void 0 ? "text" : _param_type, isDisabled = param.isDisabled, isReadonly = param.isReadonly, _param_hasFloatingLabel = param.hasFloatingLabel, hasFloatingLabel = _param_hasFloatingLabel === void 0 ? true : _param_hasFloatingLabel, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isClearable = param.isClearable, isClearable = _param_isClearable === void 0 ? false : _param_isClearable, infoMessage = param.infoMessage, errorMessage = param.errorMessage, _param_errorPosition = param.errorPosition, errorPosition = _param_errorPosition === void 0 ? "bottom" : _param_errorPosition, inlineStyle = param.inlineStyle, border = param.border, isRequired = param.isRequired, isLoading = param.isLoading, isAutoSizeable = param.isAutoSizeable, _param_defaultSize = param.defaultSize, defaultSize = _param_defaultSize === void 0 ? DEFAULT_SIZE : _param_defaultSize, iconType = param.iconType, name = param.name, hasRequiredLabel = param.hasRequiredLabel, data = param.data, tweakStyles = param.tweakStyles, maxLength = param.maxLength, shouldFocusOnMount = param.shouldFocusOnMount, units = param.units, testId = param.testId, tabIndex = param.tabIndex, onChange = param.onChange, onPaste = param.onPaste, onFocus = param.onFocus, onBlur = param.onBlur, onIconClick = param.onIconClick, onKeyDown = param.onKeyDown, mask = param.mask, maskPlaceholder = param.maskPlaceholder, alwaysShowMask = param.alwaysShowMask, beforeMaskedStateChange = param.beforeMaskedStateChange;
6364
6387
  var _useTheme = useTheme("Input", styles$y, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
6365
6388
  var _useState = _sliced_to_array$k(React.useState(false), 2), isFocused = _useState[0], setFocused = _useState[1];
6366
6389
  var inputRef = React.useRef(null);
@@ -6440,7 +6463,6 @@
6440
6463
  }, props)) : /* @__PURE__ */ jsx(InputMask, _object_spread$A({
6441
6464
  ref: ref !== null && ref !== void 0 ? ref : inputRef,
6442
6465
  mask,
6443
- maskChar,
6444
6466
  maskPlaceholder,
6445
6467
  alwaysShowMask,
6446
6468
  beforeMaskedStateChange
@@ -7663,7 +7685,7 @@
7663
7685
  if (optionsMode !== "search") {
7664
7686
  return options;
7665
7687
  }
7666
- if (optionsFilter) {
7688
+ if (isNotEmpty(optionsFilter)) {
7667
7689
  return optionsFilter(options, searchValue);
7668
7690
  }
7669
7691
  var lowerCaseValue = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
@@ -7685,12 +7707,14 @@
7685
7707
  value,
7686
7708
  convertValueToString
7687
7709
  ]);
7688
- var handleListClose = function(event) {
7710
+ var handleListClose = React.useCallback(function(event) {
7689
7711
  setIsListOpen(false);
7690
7712
  setSearchValue("");
7691
7713
  setShouldShowDefaultOption(true);
7692
7714
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
7693
- };
7715
+ }, [
7716
+ onBlur
7717
+ ]);
7694
7718
  var handleListOpen = function() {
7695
7719
  if (!isListOpen) {
7696
7720
  setIsListOpen(true);
@@ -7708,11 +7732,11 @@
7708
7732
  handleListClose(event);
7709
7733
  return;
7710
7734
  }
7711
- if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current)) {
7735
+ if (!isNotEmpty(event.relatedTarget) || !isNotEmpty(list.current) || !isNotEmpty(inputWrapper.current)) {
7712
7736
  return;
7713
7737
  }
7714
- var isActionInsideList = hasExactParent(event.relatedTarget, list.current);
7715
- if (!isActionInsideList) {
7738
+ var isActionInsideSelect = hasExactParent(event.relatedTarget, list.current) || hasExactParent(event.relatedTarget, inputWrapper.current);
7739
+ if (!isActionInsideSelect) {
7716
7740
  handleListClose(event);
7717
7741
  }
7718
7742
  };
@@ -7724,6 +7748,7 @@
7724
7748
  onChange(newValue);
7725
7749
  }, [
7726
7750
  value,
7751
+ compareValuesOnChange,
7727
7752
  onChange
7728
7753
  ]);
7729
7754
  var handleOptionSelect = React.useCallback(function(index, event) {
@@ -7733,6 +7758,7 @@
7733
7758
  (_input_current = input.current) === null || _input_current === void 0 ? void 0 : _input_current.blur();
7734
7759
  }, [
7735
7760
  handleOnChange,
7761
+ handleListClose,
7736
7762
  filteredOptions
7737
7763
  ]);
7738
7764
  var handleOnType = React.useCallback(function() {
@@ -27117,6 +27143,7 @@
27117
27143
  exports2.ThemedPreloader = ThemedPreloader;
27118
27144
  exports2.Toaster = Toaster;
27119
27145
  exports2.Tooltip = Tooltip;
27146
+ exports2.addClickHandler = addClickHandler;
27120
27147
  exports2.addDataAttributes = addDataAttributes;
27121
27148
  exports2.addDataTestId = addDataTestId;
27122
27149
  exports2.checkElementParentsClassNames = checkElementParentsClassNames;
@@ -27137,6 +27164,7 @@
27137
27164
  exports2.getPhoneMask = getPhoneMask;
27138
27165
  exports2.getPhoneObjFromString = getPhoneObjFromString;
27139
27166
  exports2.getScrollParent = getScrollParent$1;
27167
+ exports2.getSelectKeyHandler = getSelectKeyHandler;
27140
27168
  exports2.getStyleComputedProperty = getStyleComputedProperty;
27141
27169
  exports2.getTestId = getTestId;
27142
27170
  exports2.hasExactParent = hasExactParent;