@reportportal/ui-kit 0.0.1-alpha.11 → 0.0.1-alpha.110

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 (222) hide show
  1. package/README.md +28 -2
  2. package/dist/attachedFile.js +9 -0
  3. package/dist/autocompletes.js +694 -0
  4. package/dist/baseIconButton-251479f7.js +25 -0
  5. package/dist/baseIconButton.js +1 -1
  6. package/dist/breadcrumbs-8e5ca8d7.js +183 -0
  7. package/dist/breadcrumbs.js +11 -0
  8. package/dist/bubblesLoader-f3ffa240.js +28 -0
  9. package/dist/bubblesLoader.js +1 -1
  10. package/dist/button-97d9e587.js +66 -0
  11. package/dist/button.js +1 -1
  12. package/dist/calendarArrow-44c7e60e.js +5 -0
  13. package/dist/checkbox-ed6cc375.js +73 -0
  14. package/dist/checkbox.js +1 -1
  15. package/dist/chevronDownDropdown-66f5b1af.js +7 -0
  16. package/dist/close-4d480ef7.js +5 -0
  17. package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
  18. package/dist/common/types.d.ts +4 -0
  19. package/dist/common/utils/getFileExtension.d.ts +1 -0
  20. package/dist/common/utils/index.d.ts +2 -0
  21. package/dist/common/utils/isString.d.ts +1 -0
  22. package/dist/components/attachedFile/attachedFile.d.ts +14 -0
  23. package/dist/components/attachedFile/index.d.ts +2 -0
  24. package/dist/components/autocompletes/common/autocompleteMenu/autocompleteMenu.d.ts +9 -0
  25. package/dist/components/autocompletes/common/autocompleteMenu/index.d.ts +1 -0
  26. package/dist/components/autocompletes/common/autocompleteOption/autocompleteOption.d.ts +13 -0
  27. package/dist/components/autocompletes/common/autocompleteOption/index.d.ts +1 -0
  28. package/dist/components/autocompletes/common/autocompleteOptions.d.ts +19 -0
  29. package/dist/components/autocompletes/common/autocompletePrompt/autocompletePrompt.d.ts +7 -0
  30. package/dist/components/autocompletes/common/autocompletePrompt/index.d.ts +1 -0
  31. package/dist/components/autocompletes/common/index.d.ts +19 -0
  32. package/dist/components/autocompletes/constants.d.ts +2 -0
  33. package/dist/components/autocompletes/index.d.ts +3 -0
  34. package/dist/components/autocompletes/multipleAutocomplete/index.d.ts +17 -0
  35. package/dist/components/autocompletes/multipleAutocomplete/multipleAutocomplete.d.ts +46 -0
  36. package/dist/components/autocompletes/multipleAutocomplete/multipleDownshift.d.ts +25 -0
  37. package/dist/components/autocompletes/multipleAutocomplete/selectedItems/index.d.ts +1 -0
  38. package/dist/components/autocompletes/multipleAutocomplete/selectedItems/selectedItems.d.ts +35 -0
  39. package/dist/components/autocompletes/singleAutocomplete/index.d.ts +1 -0
  40. package/dist/components/autocompletes/singleAutocomplete/singleAutocomplete.d.ts +40 -0
  41. package/dist/components/autocompletes/types.d.ts +8 -0
  42. package/dist/components/autocompletes/utils.d.ts +5 -0
  43. package/dist/components/{icons/baseIconButton → baseIconButton}/baseIconButton.d.ts +1 -0
  44. package/dist/components/{icons/baseIconButton → baseIconButton}/index.d.ts +1 -0
  45. package/dist/components/breadcrumbs/breadcrumb/breadcrumb.d.ts +10 -0
  46. package/dist/components/breadcrumbs/breadcrumb/index.d.ts +1 -0
  47. package/dist/components/breadcrumbs/breadcrumbs.d.ts +3 -0
  48. package/dist/components/breadcrumbs/breadcrumbsProvider/breadcrumbsProvider.d.ts +13 -0
  49. package/dist/components/breadcrumbs/breadcrumbsProvider/hooks.d.ts +3 -0
  50. package/dist/components/breadcrumbs/breadcrumbsProvider/index.d.ts +1 -0
  51. package/dist/components/breadcrumbs/hiddenBreadcrumbs/hiddenBreadcrumbs.d.ts +6 -0
  52. package/dist/components/breadcrumbs/hiddenBreadcrumbs/index.d.ts +2 -0
  53. package/dist/components/breadcrumbs/index.d.ts +5 -0
  54. package/dist/components/breadcrumbs/tree/index.d.ts +1 -0
  55. package/dist/components/breadcrumbs/tree/tree.d.ts +7 -0
  56. package/dist/components/breadcrumbs/types.d.ts +24 -0
  57. package/dist/components/bubblesLoader/bubblesLoader.d.ts +2 -0
  58. package/dist/components/bubblesLoader/index.d.ts +1 -0
  59. package/dist/components/button/button.d.ts +5 -4
  60. package/dist/components/button/index.d.ts +1 -0
  61. package/dist/components/checkbox/checkbox.d.ts +2 -1
  62. package/dist/components/checkbox/index.d.ts +1 -0
  63. package/dist/components/datePicker/datePicker.d.ts +25 -0
  64. package/dist/components/datePicker/header/datePickerHeader.d.ts +16 -0
  65. package/dist/components/datePicker/header/index.d.ts +4 -0
  66. package/dist/components/datePicker/index.d.ts +5 -0
  67. package/dist/components/datePicker/utils.d.ts +4 -0
  68. package/dist/components/dropdown/constants.d.ts +1 -0
  69. package/dist/components/dropdown/dropdown.d.ts +14 -4
  70. package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
  71. package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
  72. package/dist/components/dropdown/index.d.ts +1 -0
  73. package/dist/components/dropdown/types.d.ts +3 -0
  74. package/dist/components/dropdown/utils.d.ts +2 -1
  75. package/dist/components/fieldLabel/fieldLabel.d.ts +7 -0
  76. package/dist/components/fieldLabel/index.d.ts +1 -0
  77. package/dist/components/fieldNumber/constants.d.ts +1 -0
  78. package/dist/components/fieldNumber/fieldNumber.d.ts +3 -3
  79. package/dist/components/fieldNumber/index.d.ts +1 -0
  80. package/dist/components/fieldText/fieldText.d.ts +12 -4
  81. package/dist/components/fieldText/index.d.ts +1 -0
  82. package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +5 -2
  83. package/dist/components/fieldTextFlex/index.d.ts +1 -0
  84. package/dist/components/fileDropArea/attachedFilesList/attachedFilesList.d.ts +21 -0
  85. package/dist/components/fileDropArea/attachedFilesList/index.d.ts +5 -0
  86. package/dist/components/fileDropArea/browseButton/browseButton.d.ts +9 -0
  87. package/dist/components/fileDropArea/browseButton/index.d.ts +4 -0
  88. package/dist/components/fileDropArea/constants.d.ts +2 -0
  89. package/dist/components/fileDropArea/dropZone/dropZone.d.ts +10 -0
  90. package/dist/components/fileDropArea/dropZone/index.d.ts +4 -0
  91. package/dist/components/fileDropArea/errorMessage/errorMessage.d.ts +5 -0
  92. package/dist/components/fileDropArea/errorMessage/index.d.ts +4 -0
  93. package/dist/components/fileDropArea/fileDropArea.d.ts +19 -0
  94. package/dist/components/fileDropArea/fileDropAreaProvider/fileDropAreaProvider.d.ts +17 -0
  95. package/dist/components/fileDropArea/fileDropAreaProvider/index.d.ts +1 -0
  96. package/dist/components/fileDropArea/fileDropAreaProvider/useFileDropAreaContext.d.ts +3 -0
  97. package/dist/components/fileDropArea/hooks/index.d.ts +1 -0
  98. package/dist/components/fileDropArea/hooks/useFileDropArea.d.ts +13 -0
  99. package/dist/components/fileDropArea/hooks/useFileProcessing.d.ts +13 -0
  100. package/dist/components/fileDropArea/hooks/useOverlayDropArea.d.ts +22 -0
  101. package/dist/components/fileDropArea/index.d.ts +6 -0
  102. package/dist/components/fileDropArea/types.d.ts +58 -0
  103. package/dist/components/fileDropArea/utils/getValidationErrorMessage.d.ts +3 -0
  104. package/dist/components/fileDropArea/utils/index.d.ts +2 -0
  105. package/dist/components/fileDropArea/utils/validateFile.d.ts +3 -0
  106. package/dist/components/icons/index.d.ts +60 -7
  107. package/dist/components/index.d.ts +21 -9
  108. package/dist/components/maxValueDisplay/index.d.ts +4 -0
  109. package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +8 -0
  110. package/dist/components/maxValueDisplay/utils/index.d.ts +1 -0
  111. package/dist/components/maxValueDisplay/utils/isPositiveInteger.d.ts +1 -0
  112. package/dist/components/modal/index.d.ts +1 -0
  113. package/dist/components/modal/modal.d.ts +7 -3
  114. package/dist/components/modal/modalContent/modalContent.d.ts +2 -0
  115. package/dist/components/modal/modalFooter/modalFooter.d.ts +3 -1
  116. package/dist/components/modal/modalHeader/modalHeader.d.ts +2 -1
  117. package/dist/components/modal/types.d.ts +6 -0
  118. package/dist/components/pagination/index.d.ts +1 -0
  119. package/dist/components/pagination/itemsCounter/itemCounter.d.ts +1 -0
  120. package/dist/components/pagination/pageControls/activePage/activePage.d.ts +1 -0
  121. package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +1 -0
  122. package/dist/components/pagination/pageControls/pageControls.d.ts +1 -0
  123. package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +1 -0
  124. package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +1 -0
  125. package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +1 -0
  126. package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +1 -0
  127. package/dist/components/pagination/pagination.d.ts +1 -0
  128. package/dist/components/popover/index.d.ts +4 -1
  129. package/dist/components/popover/popover.d.ts +3 -2
  130. package/dist/components/radio/index.d.ts +1 -0
  131. package/dist/components/radio/radio.d.ts +1 -0
  132. package/dist/components/radio/radioGroup.d.ts +1 -0
  133. package/dist/components/selection/index.d.ts +5 -0
  134. package/dist/components/selection/selection.d.ts +12 -0
  135. package/dist/components/selection/types.d.ts +1 -0
  136. package/dist/components/sidePanel/index.d.ts +2 -0
  137. package/dist/components/sidePanel/sidePanel.d.ts +17 -0
  138. package/dist/components/spinLoader/index.d.ts +4 -0
  139. package/dist/components/spinLoader/spinLoader.d.ts +8 -0
  140. package/dist/components/systemAlert/index.d.ts +1 -0
  141. package/dist/components/systemAlert/systemAlert.d.ts +4 -0
  142. package/dist/components/systemAlert/types.d.ts +22 -0
  143. package/dist/components/systemMessage/index.d.ts +1 -0
  144. package/dist/components/systemMessage/systemMessage.d.ts +1 -0
  145. package/dist/components/table/constants.d.ts +5 -0
  146. package/dist/components/table/hooks/index.d.ts +4 -0
  147. package/dist/components/table/hooks/useColumnWidths.d.ts +8 -0
  148. package/dist/components/table/hooks/useTableColumns.d.ts +13 -0
  149. package/dist/components/table/hooks/useTableExpansion.d.ts +15 -0
  150. package/dist/components/table/hooks/useTableHover.d.ts +10 -0
  151. package/dist/components/table/index.d.ts +2 -0
  152. package/dist/components/table/table.d.ts +1 -0
  153. package/dist/components/table/types.d.ts +24 -9
  154. package/dist/components/table/utils.d.ts +10 -1
  155. package/dist/components/themeProvider/index.d.ts +1 -0
  156. package/dist/components/themeProvider/themeProvider.d.ts +1 -0
  157. package/dist/components/toggle/index.d.ts +1 -0
  158. package/dist/components/toggle/toggle.d.ts +1 -0
  159. package/dist/components/tooltip/tooltip.d.ts +12 -2
  160. package/dist/datePicker-efa4e2d6.js +194 -0
  161. package/dist/datePicker.js +27 -0
  162. package/dist/dropdown-0260bb66.js +5 -0
  163. package/dist/dropdown-ec754bbe.js +289 -0
  164. package/dist/dropdown.js +5 -2
  165. package/dist/fieldLabel.js +18 -0
  166. package/dist/fieldNumber-d1b5a7a1.js +140 -0
  167. package/dist/fieldNumber.js +5 -2
  168. package/dist/fieldText-ba8a917c.js +165 -0
  169. package/dist/fieldText.js +6 -2
  170. package/dist/fieldTextFlex-2f51c173.js +80 -0
  171. package/dist/fieldTextFlex.js +3 -1
  172. package/dist/fileDropArea.js +325 -0
  173. package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
  174. package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
  175. package/dist/icons.js +80 -0
  176. package/dist/index-1a874a8b.js +110 -0
  177. package/dist/index.js +140 -48
  178. package/dist/isEmpty-ccacb5ff.js +38 -0
  179. package/dist/maxValueDisplay-9be01a75.js +13 -0
  180. package/dist/maxValueDisplay.js +6 -0
  181. package/dist/minus-2857540f.js +5 -0
  182. package/dist/modal.js +153 -14
  183. package/dist/openEye-7b9cf080.js +7 -0
  184. package/dist/pagination-43330c73.js +347 -0
  185. package/dist/pagination.js +10 -5
  186. package/dist/plus-199fb2a8.js +5 -0
  187. package/dist/popover.js +61 -57
  188. package/dist/prevPage-87faf576.js +6 -0
  189. package/dist/radio-62546efa.js +76 -0
  190. package/dist/radio.js +1 -1
  191. package/dist/selection-9124d029.js +38 -0
  192. package/dist/selection.js +10 -0
  193. package/dist/sidePanel.js +74 -0
  194. package/dist/spinLoader-c4a53718.js +11 -0
  195. package/dist/spinLoader.js +7 -0
  196. package/dist/style.css +1 -1
  197. package/dist/success-8fd8bd2c.js +7 -0
  198. package/dist/systemAlert.js +69 -0
  199. package/dist/systemMessage-924fdaa6.js +30 -0
  200. package/dist/systemMessage.js +1 -1
  201. package/dist/table-ea578f47.js +476 -0
  202. package/dist/table.js +3 -3
  203. package/dist/toggle-304107fa.js +59 -0
  204. package/dist/toggle.js +1 -1
  205. package/dist/tooltip.js +87 -56
  206. package/dist/tree-c3dd3d45.js +6 -0
  207. package/dist/xls-995781cc.js +11 -0
  208. package/package.json +47 -16
  209. package/dist/baseIconButton-7bc53dec.js +0 -25
  210. package/dist/bubblesLoader-a7e709d4.js +0 -17
  211. package/dist/button-7fb84fde.js +0 -62
  212. package/dist/checkbox-6777be17.js +0 -73
  213. package/dist/dropdown-e07f2a71.js +0 -212
  214. package/dist/fieldNumber-46fe79b9.js +0 -127
  215. package/dist/fieldText-d80b29ba.js +0 -102
  216. package/dist/fieldTextFlex-5bddf46a.js +0 -67
  217. package/dist/index-bb9b62ef.js +0 -131
  218. package/dist/pagination-5449cd03.js +0 -346
  219. package/dist/radio-fd49a09c.js +0 -76
  220. package/dist/systemMessage-1ced6079.js +0 -30
  221. package/dist/table-231fd19c.js +0 -138
  222. package/dist/toggle-707ecb74.js +0 -67
@@ -0,0 +1,694 @@
1
+ import { jsx as r, jsxs as F, Fragment as te } from "react/jsx-runtime";
2
+ import { useState as ae, useCallback as K, forwardRef as ye, useRef as Ne, useEffect as we } from "react";
3
+ import { c as L } from "./bind-06a7ff84.js";
4
+ import { Scrollbars as ke } from "rc-scrollbars";
5
+ import { B as xe } from "./bubblesLoader-f3ffa240.js";
6
+ import { B as Ee } from "./button-97d9e587.js";
7
+ import { S as Ie } from "./plus-199fb2a8.js";
8
+ import { i as Se } from "./isEmpty-ccacb5ff.js";
9
+ import V from "downshift";
10
+ import { useFloating as _e, autoUpdate as pe } from "@floating-ui/react";
11
+ import { F as Be } from "./fieldText-ba8a917c.js";
12
+ import { S as Fe } from "./close-4d480ef7.js";
13
+ import { S as qe } from "./openEye-7b9cf080.js";
14
+ import "./baseIconButton-251479f7.js";
15
+ import "./spinLoader-c4a53718.js";
16
+ import "./maxValueDisplay-9be01a75.js";
17
+ import "./fieldLabel.js";
18
+ const Ae = "_disabled_18ek6_43", $e = "_input_18ek6_97", Me = {
19
+ "selected-item": "_selected-item_18ek6_16",
20
+ "validation-error": "_validation-error_18ek6_35",
21
+ "highlight-un-stored-item": "_highlight-un-stored-item_18ek6_40",
22
+ disabled: Ae,
23
+ "mobile-disabled": "_mobile-disabled_18ek6_48",
24
+ "cross-icon": "_cross-icon_18ek6_54",
25
+ input: $e
26
+ }, le = L.bind(Me), Oe = ({
27
+ item: s,
28
+ onRemoveItem: e,
29
+ disabled: i = !1,
30
+ mobileDisabled: n = !1,
31
+ parseValueToString: o,
32
+ error: a = !1,
33
+ editItem: p,
34
+ editable: u = !1,
35
+ getAdditionalCreationCondition: b = () => !0,
36
+ storedOption: y = !0,
37
+ highlightUnStoredItem: h = !1,
38
+ variant: x = "light",
39
+ getItemName: g
40
+ }) => {
41
+ const [f, E] = ae(!1), [_, N] = ae(""), I = () => {
42
+ !i && u && !y && (N((g == null ? void 0 : g(s)) || (o == null ? void 0 : o(s)) || ""), E(!0));
43
+ }, B = (t) => {
44
+ N(t.target.value);
45
+ }, q = (t) => {
46
+ const c = b(_);
47
+ t.key === "Enter" && c && (p(s, _), E(!1), N(""));
48
+ }, l = () => {
49
+ E(!1), N("");
50
+ }, d = (t) => {
51
+ t.stopPropagation(), e(s);
52
+ };
53
+ return f ? /* @__PURE__ */ r(
54
+ "input",
55
+ {
56
+ autoFocus: !0,
57
+ value: _,
58
+ onChange: B,
59
+ onKeyDown: q,
60
+ onBlur: l,
61
+ className: le("input")
62
+ }
63
+ ) : /* @__PURE__ */ F(
64
+ "div",
65
+ {
66
+ className: le("selected-item", x, {
67
+ [`validation-${a}`]: a,
68
+ disabled: i,
69
+ "mobile-disabled": n,
70
+ "highlight-un-stored-item": h && !y
71
+ }),
72
+ onClick: I,
73
+ children: [
74
+ o == null ? void 0 : o(s),
75
+ !i && /* @__PURE__ */ r(
76
+ "button",
77
+ {
78
+ type: "button",
79
+ className: le("cross-icon", {
80
+ [`validation-${a}`]: a,
81
+ "mobile-disabled": n,
82
+ disabled: i
83
+ }),
84
+ onClick: d,
85
+ children: /* @__PURE__ */ r(Fe, {})
86
+ }
87
+ )
88
+ ]
89
+ }
90
+ );
91
+ }, Re = ({
92
+ items: s = [],
93
+ parseValueToString: e,
94
+ getItemValidationErrorType: i,
95
+ storedItemsMap: n = {},
96
+ highlightUnStoredItem: o = !1,
97
+ renderCustomSelectedItem: a,
98
+ ...p
99
+ }) => s.map((u) => a ? a(u) : /* @__PURE__ */ r(
100
+ Oe,
101
+ {
102
+ parseValueToString: e,
103
+ error: (i == null ? void 0 : i(u)) || "",
104
+ item: u,
105
+ storedOption: !!n[e(u)],
106
+ highlightUnStoredItem: o,
107
+ ...p
108
+ },
109
+ e == null ? void 0 : e(u)
110
+ )), Ce = "_prompt_1xfmd_16", De = {
111
+ prompt: Ce
112
+ }, je = L.bind(De), He = ({ children: s = null }) => /* @__PURE__ */ r("div", { className: je("prompt"), children: s }), Pe = "_item_1qhaq_16", Le = "_divider_1qhaq_24", We = "_active_1qhaq_48", ze = "_value_1qhaq_60", Ke = "_tag_1qhaq_78", Ye = "_disabled_1qhaq_89", Xe = {
113
+ item: Pe,
114
+ divider: Le,
115
+ "new-item": "_new-item_1qhaq_31",
116
+ active: We,
117
+ value: ze,
118
+ "key-variant": "_key-variant_1qhaq_75",
119
+ tag: Ke,
120
+ "button-active": "_button-active_1qhaq_89",
121
+ disabled: Ye,
122
+ "value-variant": "_value-variant_1qhaq_109"
123
+ }, Y = L.bind(Xe), me = ({
124
+ isActive: s = !1,
125
+ isSelected: e = !1,
126
+ isNew: i = !1,
127
+ children: n = null,
128
+ disabled: o = !1,
129
+ optionVariant: a = "",
130
+ newItemButtonText: p = "",
131
+ ...u
132
+ }) => {
133
+ const b = () => p || (a === "key-variant" ? "New key" : "New value");
134
+ return i ? /* @__PURE__ */ F(te, { children: [
135
+ /* @__PURE__ */ r("div", { className: Y("divider") }),
136
+ /* @__PURE__ */ F(
137
+ "li",
138
+ {
139
+ className: Y("new-item", a, {
140
+ active: s,
141
+ selected: e,
142
+ disabled: o
143
+ }),
144
+ ...u,
145
+ children: [
146
+ /* @__PURE__ */ r("span", { className: Y("value"), children: n }),
147
+ /* @__PURE__ */ r(
148
+ Ee,
149
+ {
150
+ ...!o && u,
151
+ className: Y({ "button-active": s }),
152
+ icon: /* @__PURE__ */ r(Ie, {}),
153
+ variant: "text",
154
+ children: b()
155
+ }
156
+ )
157
+ ]
158
+ }
159
+ )
160
+ ] }) : /* @__PURE__ */ r(
161
+ "li",
162
+ {
163
+ className: Y("item", a, {
164
+ active: s,
165
+ selected: e,
166
+ disabled: o
167
+ }),
168
+ ...o ? {} : u,
169
+ children: /* @__PURE__ */ r("span", { className: Y("label", "tag"), children: n })
170
+ }
171
+ );
172
+ }, Ge = "_container_igshu_16", Je = {
173
+ container: Ge
174
+ }, ie = L.bind(Je), Qe = (s) => {
175
+ const {
176
+ options: e,
177
+ async: i,
178
+ inputValue: n,
179
+ loading: o,
180
+ createWithoutConfirmation: a,
181
+ customEmptyListMessage: p,
182
+ customNoMatchesMessage: u,
183
+ optionVariant: b,
184
+ newItemButtonText: y,
185
+ renderOption: h,
186
+ getUniqKey: x,
187
+ getItemProps: g,
188
+ parseValueToString: f
189
+ } = s, E = K(() => (e || []).filter((t) => f(t).toUpperCase().indexOf((n.toUpperCase() || "").trim()) > -1), [n, e, f]), _ = K(
190
+ (t, c, v = !1) => h ? h(t, c, v, g) : /* @__PURE__ */ r(
191
+ me,
192
+ {
193
+ optionVariant: b,
194
+ ...g({ item: t, index: c }),
195
+ isNew: v,
196
+ newItemButtonText: y,
197
+ children: f(t)
198
+ },
199
+ (x == null ? void 0 : x(t)) || f(t)
200
+ ),
201
+ [g, x, y, b, f, h]
202
+ ), N = K(
203
+ (t) => t.length ? t.map((c, v) => _(c, v)) : "",
204
+ [_]
205
+ ), I = K(
206
+ (t) => {
207
+ const c = t.length;
208
+ return /* @__PURE__ */ r("div", { className: ie({ container: !c }), children: /* @__PURE__ */ r(
209
+ me,
210
+ {
211
+ optionVariant: b,
212
+ isNew: !0,
213
+ ...g({ item: n, index: c }),
214
+ children: f(n)
215
+ },
216
+ f(n)
217
+ ) });
218
+ },
219
+ [g, n, b, f]
220
+ ), B = K(
221
+ (t) => o ? /* @__PURE__ */ F(te, { children: [
222
+ /* @__PURE__ */ r(He, { children: /* @__PURE__ */ r(xe, {}) }),
223
+ !a && I(t)
224
+ ] }) : "",
225
+ [a, o, I]
226
+ ), q = K(() => {
227
+ const t = (e == null ? void 0 : e.length) === 0 ? p || "No available options" : u || "No matches found";
228
+ return /* @__PURE__ */ r("div", { className: ie("empty-list-message"), children: t });
229
+ }, [p, u, e == null ? void 0 : e.length]), l = i ? e : E(), d = B(e);
230
+ return d || /* @__PURE__ */ F("div", { className: ie({ container: e.length }), children: [
231
+ /* @__PURE__ */ r(ke, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: Se(l) ? q() : N(l) }),
232
+ !a && I(l)
233
+ ] });
234
+ }, Ze = "_menu_1bgrz_16", Te = "_opened_1bgrz_35", Ue = "_dark_1bgrz_38", Ve = {
235
+ menu: Ze,
236
+ opened: Te,
237
+ dark: Ue
238
+ }, et = L.bind(Ve), tt = (s, e) => !s || s <= e.trim().length, he = ye(
239
+ ({
240
+ isOpen: s = !1,
241
+ style: e = {},
242
+ minLength: i = 1,
243
+ inputValue: n = "",
244
+ className: o = "",
245
+ ...a
246
+ }, p) => /* @__PURE__ */ r(
247
+ "ul",
248
+ {
249
+ ref: p,
250
+ className: et(
251
+ "menu",
252
+ { opened: s && tt(i, n) },
253
+ o
254
+ ),
255
+ style: e,
256
+ children: /* @__PURE__ */ r(Qe, { inputValue: n, ...a })
257
+ }
258
+ )
259
+ ), fe = (s, e) => typeof s == "string" ? s : e ? String(s[e(s)]) : "", ee = (s, e) => {
260
+ var n;
261
+ return s === e ? !0 : !!(s && e && typeof s == "object" && typeof e == "object" && Object.keys(s).length === Object.keys(e).length && ((n = Object.entries(s)) != null && n.every(([o, a]) => ee(a, e[o]))));
262
+ }, st = (s, e, i) => typeof s == "string" ? s === e : i ? (() => {
263
+ const n = i(s);
264
+ return s[n] === e[n];
265
+ })() : !1, ot = ({
266
+ options: s = [],
267
+ onChange: e,
268
+ selectedItems: i = [],
269
+ handleUnStoredItemCb: n = null,
270
+ existingItemsMap: o = {},
271
+ children: a,
272
+ customizeNewSelectedValue: p = (h) => h,
273
+ getOptionUniqKey: u,
274
+ getOptionUniqKeyValue: b,
275
+ ...y
276
+ }) => {
277
+ const [h, x] = ae(o), g = (l, d) => {
278
+ const t = {
279
+ ...h
280
+ };
281
+ l.forEach((c) => {
282
+ if (s.find((v) => st(v, c, u))) {
283
+ const v = fe(c, u);
284
+ t[v] = !0;
285
+ }
286
+ }), x(t), d(t);
287
+ }, f = (l, d) => {
288
+ const t = fe(l, u);
289
+ if (t in h) {
290
+ const c = { ...h };
291
+ delete c[t], x(c), d(c);
292
+ } else
293
+ d(h);
294
+ }, E = (l, d) => {
295
+ const t = p(l), c = Array.isArray(t) ? t : [t], M = [...i.filter((O) => c.indexOf(O) < 0), ...c];
296
+ e == null || e(M, d), g(c, (O) => n == null ? void 0 : n(M, O));
297
+ }, _ = (l, d) => {
298
+ const t = i.indexOf(l), c = [...i];
299
+ c.splice(t, 1, d), e == null || e(c, null);
300
+ }, N = (l, d) => {
301
+ const t = i.filter((v) => !ee(v, l));
302
+ e == null || e(t, d), f(l, (v) => n == null ? void 0 : n(t, v));
303
+ }, I = (l, d) => {
304
+ l && E(l, d);
305
+ }, B = (l) => ({
306
+ removeItem: N,
307
+ editItem: _,
308
+ handleChange: e,
309
+ getOptionUniqKeyValue: b,
310
+ storedItemsMap: h,
311
+ ...l
312
+ });
313
+ return /* @__PURE__ */ r(
314
+ V,
315
+ {
316
+ ...y,
317
+ stateReducer: (l, d) => {
318
+ switch (d.type) {
319
+ case V.stateChangeTypes.keyDownEnter:
320
+ case V.stateChangeTypes.clickItem:
321
+ return {
322
+ ...d,
323
+ highlightedIndex: l.highlightedIndex,
324
+ inputValue: ""
325
+ };
326
+ default:
327
+ return d;
328
+ }
329
+ },
330
+ onChange: I,
331
+ selectedItem: null,
332
+ children: (l) => a == null ? void 0 : a(B(l))
333
+ }
334
+ );
335
+ }, nt = "_autocomplete_1rvi8_16", rt = "_disabled_1rvi8_32", ct = "_error_1rvi8_35", lt = "_touched_1rvi8_35", it = "_input_1rvi8_74", at = {
336
+ autocomplete: nt,
337
+ "autocomplete-wrapper": "_autocomplete-wrapper_1rvi8_28",
338
+ disabled: rt,
339
+ error: ct,
340
+ touched: lt,
341
+ "clear-icon": "_clear-icon_1rvi8_46",
342
+ "clear-icon--disabled": "_clear-icon--disabled_1rvi8_56",
343
+ "autocomplete-input": "_autocomplete-input_1rvi8_60",
344
+ "mobile-disabled": "_mobile-disabled_1rvi8_69",
345
+ input: it,
346
+ "type-number": "_type-number_1rvi8_98",
347
+ "error-text": "_error-text_1rvi8_109"
348
+ }, X = L.bind(at), Mt = (s) => {
349
+ const {
350
+ options: e = [],
351
+ loading: i = !1,
352
+ onStateChange: n = () => {
353
+ },
354
+ value: o = [],
355
+ placeholder: a = "",
356
+ error: p = "",
357
+ touched: u = !1,
358
+ creatable: b = !1,
359
+ editable: y = !1,
360
+ onChange: h = () => {
361
+ },
362
+ onFocus: x = () => {
363
+ },
364
+ onBlur: g = () => {
365
+ },
366
+ disabled: f = !1,
367
+ mobileDisabled: E = !1,
368
+ inputProps: _ = {},
369
+ parseValueToString: N = (m) => m == null ? "" : String(m),
370
+ maxLength: I = null,
371
+ async: B = !1,
372
+ customClass: q = "",
373
+ createWithoutConfirmation: l = !1,
374
+ getItemValidationErrorType: d = null,
375
+ clearItemsError: t = () => {
376
+ },
377
+ getAdditionalCreationCondition: c = () => !0,
378
+ highlightUnStoredItem: v = !1,
379
+ parseInputValueFn: M = null,
380
+ handleUnStoredItemCb: Z = null,
381
+ dataAutomationId: O = "",
382
+ existingItemsMap: T = {},
383
+ customizeNewSelectedValue: se = (m) => m,
384
+ renderCustomSelectedItem: oe,
385
+ useFixedPositioning: ne,
386
+ newItemButtonText: S = "",
387
+ ...R
388
+ } = s, { refs: C, floatingStyles: D } = _e({
389
+ placement: "bottom-start",
390
+ strategy: ne ? "fixed" : "absolute",
391
+ whileElementsMounted: pe
392
+ }), A = o.length === 0 && !f ? a : "", j = Ne(null);
393
+ we(() => {
394
+ t();
395
+ }, [t, o]);
396
+ const re = (m, w) => {
397
+ h(m, w);
398
+ }, G = (m, w, $) => ({ item: k, index: Q, ...W }) => m({
399
+ item: k,
400
+ index: Q,
401
+ isSelected: $.some((ce) => ee(ce, k)),
402
+ ...W,
403
+ isActive: w === Q
404
+ }), H = ({
405
+ event: m,
406
+ removeItem: w,
407
+ inputValue: $
408
+ }) => {
409
+ m.key === "Backspace" && !$ && o.length && w(o[o.length - 1], null);
410
+ }, P = ({
411
+ inputValue: m,
412
+ selectItem: w,
413
+ clearSelection: $
414
+ }) => {
415
+ if (M) {
416
+ const k = M(m);
417
+ (k.length ? k : [m]).forEach((W) => w(W)), $();
418
+ } else
419
+ w(m), $();
420
+ }, J = (m) => (w) => {
421
+ m(w, null), j.current && j.current.focus();
422
+ }, U = e.filter((m) => o.every((w) => !ee(w, m)));
423
+ return /* @__PURE__ */ r(
424
+ ot,
425
+ {
426
+ onChange: re,
427
+ itemToString: N,
428
+ selectedItems: o,
429
+ onStateChange: n,
430
+ options: e,
431
+ existingItemsMap: T,
432
+ handleUnStoredItemCb: Z,
433
+ customizeNewSelectedValue: se,
434
+ children: ({
435
+ getInputProps: m,
436
+ getItemProps: w,
437
+ isOpen: $,
438
+ inputValue: k,
439
+ highlightedIndex: Q,
440
+ removeItem: W,
441
+ editItem: ce,
442
+ openMenu: ve,
443
+ selectItem: de,
444
+ clearSelection: ue,
445
+ storedItemsMap: be,
446
+ getRootProps: ge
447
+ }) => /* @__PURE__ */ F(
448
+ "div",
449
+ {
450
+ ...ge(void 0, { suppressRefError: !0 }),
451
+ className: X("autocomplete-wrapper"),
452
+ ref: C.setReference,
453
+ children: [
454
+ /* @__PURE__ */ F(te, { children: [
455
+ /* @__PURE__ */ F(
456
+ "div",
457
+ {
458
+ className: X("autocomplete", q, {
459
+ "mobile-disabled": E,
460
+ error: p,
461
+ touched: u,
462
+ disabled: f
463
+ }),
464
+ children: [
465
+ /* @__PURE__ */ F(
466
+ "div",
467
+ {
468
+ className: X("autocomplete-input", {
469
+ "mobile-disabled": E
470
+ }),
471
+ children: [
472
+ /* @__PURE__ */ r(
473
+ Re,
474
+ {
475
+ items: o,
476
+ onRemoveItem: J(W),
477
+ disabled: f,
478
+ mobileDisabled: E,
479
+ parseValueToString: N,
480
+ getItemValidationErrorType: d,
481
+ renderCustomSelectedItem: oe,
482
+ editItem: ce,
483
+ editable: y,
484
+ getAdditionalCreationCondition: c,
485
+ storedItemsMap: be,
486
+ highlightUnStoredItem: v
487
+ }
488
+ ),
489
+ /* @__PURE__ */ r(
490
+ "input",
491
+ {
492
+ ...m({
493
+ ref: j,
494
+ placeholder: A,
495
+ maxLength: I,
496
+ onFocus: () => {
497
+ ve(), x();
498
+ },
499
+ onKeyDown: (z) => {
500
+ z.key === "Enter" && k && b && c(k) && P({
501
+ inputValue: k,
502
+ selectItem: de,
503
+ clearSelection: ue
504
+ }), H({ event: z, removeItem: W, inputValue: k });
505
+ },
506
+ onBlur: () => {
507
+ g(), k && b && c(k) && P({
508
+ inputValue: k,
509
+ selectItem: de,
510
+ clearSelection: ue
511
+ });
512
+ },
513
+ disabled: f,
514
+ ..._
515
+ }),
516
+ className: X("input", { disabled: f }),
517
+ "data-automation-id": O
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ ),
523
+ (_ == null ? void 0 : _.clearable) && (o == null ? void 0 : o.length) > 0 && /* @__PURE__ */ r(
524
+ "button",
525
+ {
526
+ className: X("clear-icon", { "clear-icon--disabled": f }),
527
+ onClick: () => {
528
+ var z;
529
+ return !f && ((z = _ == null ? void 0 : _.onClear) == null ? void 0 : z.call(_));
530
+ },
531
+ children: /* @__PURE__ */ r(qe, {})
532
+ }
533
+ )
534
+ ]
535
+ }
536
+ ),
537
+ p && u && /* @__PURE__ */ r("span", { className: X("error-text"), children: p })
538
+ ] }),
539
+ /* @__PURE__ */ r(
540
+ he,
541
+ {
542
+ isOpen: $,
543
+ loading: i,
544
+ async: B,
545
+ ref: C.setFloating,
546
+ newItemButtonText: S,
547
+ style: D,
548
+ inputValue: (k || "").trim(),
549
+ getItemProps: G(w, Q, o),
550
+ parseValueToString: N,
551
+ createWithoutConfirmation: l,
552
+ options: U,
553
+ ...R
554
+ }
555
+ )
556
+ ]
557
+ }
558
+ )
559
+ }
560
+ );
561
+ }, dt = "Enter", ut = "Tab", mt = {
562
+ "input-wrapper": "_input-wrapper_14hlh_1"
563
+ }, ft = L.bind(mt), _t = 0, Ot = (s) => {
564
+ const {
565
+ options: e = [],
566
+ value: i,
567
+ placeholder: n = "",
568
+ onChange: o = () => {
569
+ },
570
+ onFocus: a = () => {
571
+ },
572
+ onBlur: p = () => {
573
+ },
574
+ disabled: u = !1,
575
+ inputProps: b = {},
576
+ parseValueToString: y = (S) => S === null ? "" : String(S),
577
+ minLength: h = 1,
578
+ skipOptionCreation: x = !1,
579
+ maxLength: g = null,
580
+ optionVariant: f = "",
581
+ isRequired: E = !1,
582
+ error: _ = "",
583
+ touched: N = !1,
584
+ setTouch: I = () => {
585
+ },
586
+ createWithoutConfirmation: B = !1,
587
+ menuClassName: q = "",
588
+ icon: l,
589
+ isOptionUnique: d,
590
+ refFunction: t,
591
+ stateReducer: c,
592
+ onStateChange: v,
593
+ useFixedPositioning: M,
594
+ newItemButtonText: Z = "",
595
+ ...O
596
+ } = s, { refs: T, floatingStyles: se } = _e({
597
+ placement: "bottom-start",
598
+ strategy: M ? "fixed" : "absolute",
599
+ whileElementsMounted: pe
600
+ }), oe = (S, R, C) => ({ item: D, index: A, ...j }) => S({
601
+ item: D,
602
+ index: A,
603
+ isSelected: C !== null && C === D,
604
+ ...j,
605
+ isActive: R === A
606
+ }), ne = (S, R) => {
607
+ S.key === ut && (S.preventDefault(), R(e.length));
608
+ };
609
+ return /* @__PURE__ */ r(
610
+ V,
611
+ {
612
+ onChange: o,
613
+ itemToString: y,
614
+ selectedItem: i,
615
+ onStateChange: v,
616
+ defaultHighlightedIndex: _t,
617
+ stateReducer: c,
618
+ children: ({
619
+ getInputProps: S,
620
+ getItemProps: R,
621
+ setHighlightedIndex: C,
622
+ isOpen: D,
623
+ inputValue: A,
624
+ highlightedIndex: j,
625
+ getRootProps: re,
626
+ selectItem: G
627
+ }) => /* @__PURE__ */ r(te, { children: /* @__PURE__ */ F(
628
+ "div",
629
+ {
630
+ className: ft("input-wrapper"),
631
+ ...re(void 0, { suppressRefError: !0 }),
632
+ ref: T.setReference,
633
+ children: [
634
+ /* @__PURE__ */ r(
635
+ Be,
636
+ {
637
+ ...S({
638
+ placeholder: u ? "" : n,
639
+ maxLength: g || void 0,
640
+ onFocus: () => {
641
+ a();
642
+ },
643
+ refFunction: t,
644
+ onKeyDown: (H) => {
645
+ H.key === dt && H.preventDefault(), A && D && ne(H, C);
646
+ },
647
+ onBlur: (H) => {
648
+ const P = (A ?? "").trim(), J = !!P, U = J ? e.find((m) => y(m) === P) : void 0;
649
+ G(U || (!x && B && J ? P : null)), p(H), d == null || d(
650
+ J ? !e.some((m) => y(m) === P) : null
651
+ ), I == null || I(!0);
652
+ },
653
+ disabled: u,
654
+ defaultWidth: !1,
655
+ isRequired: E,
656
+ touched: N,
657
+ error: _,
658
+ endIcon: l,
659
+ ...b
660
+ })
661
+ }
662
+ ),
663
+ /* @__PURE__ */ r(
664
+ he,
665
+ {
666
+ isOpen: D,
667
+ style: se,
668
+ ref: T.setFloating,
669
+ minLength: h,
670
+ inputValue: (A || "").trim(),
671
+ getItemProps: oe(R, j, i),
672
+ parseValueToString: y,
673
+ optionVariant: f,
674
+ createWithoutConfirmation: B,
675
+ className: q,
676
+ options: e,
677
+ newItemButtonText: Z,
678
+ ...O
679
+ }
680
+ )
681
+ ]
682
+ }
683
+ ) })
684
+ }
685
+ );
686
+ };
687
+ export {
688
+ he as AutocompleteMenu,
689
+ me as AutocompleteOption,
690
+ Qe as AutocompleteOptions,
691
+ He as AutocompletePrompt,
692
+ Mt as MultipleAutocomplete,
693
+ Ot as SingleAutocomplete
694
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { c as e } from "./bind-06a7ff84.js";
3
+ const b = "_disabled_1q88n_12", i = {
4
+ "base-icon-button": "_base-icon-button_1q88n_1",
5
+ disabled: b
6
+ }, l = e.bind(i), _ = ({
7
+ children: t,
8
+ className: o,
9
+ disabled: s = !1,
10
+ onClick: n,
11
+ ...a
12
+ }) => /* @__PURE__ */ c(
13
+ "button",
14
+ {
15
+ className: l("base-icon-button", o, { disabled: s }),
16
+ type: "button",
17
+ disabled: s,
18
+ onClick: n,
19
+ ...a,
20
+ children: t
21
+ }
22
+ );
23
+ export {
24
+ _ as B
25
+ };