@alphakits/ui 2.3.1 → 2.4.1

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 (219) hide show
  1. package/dist/__internal/utils/index.d.ts +1 -1
  2. package/dist/__internal/utils/index.js +4 -4
  3. package/dist/amount-input/component.js +41 -41
  4. package/dist/avatar/component.js +2 -18
  5. package/dist/badge/component.d.ts +1 -1
  6. package/dist/base-card/component.js +1 -7
  7. package/dist/bottom-sheet/component.d.ts +1 -1
  8. package/dist/bottom-sheet/component.js +9 -13
  9. package/dist/box/component.d.ts +2 -2
  10. package/dist/box/component.js +4 -4
  11. package/dist/button/component.js +9 -9
  12. package/dist/button-arrow/component.js +6 -1
  13. package/dist/calendar/component.d.ts +1 -2
  14. package/dist/calendar/component.js +77 -74
  15. package/dist/calendar/components/days-table/component.js +31 -34
  16. package/dist/calendar/components/header/{/321/201omponent.js → component.js} +3 -12
  17. package/dist/calendar/components/header/index.d.ts +1 -1
  18. package/dist/calendar/components/header/index.js +1 -1
  19. package/dist/calendar/components/months-table/{/321/201omponent.js → component.js} +7 -7
  20. package/dist/calendar/components/months-table/index.d.ts +1 -1
  21. package/dist/calendar/components/months-table/index.js +1 -1
  22. package/dist/calendar/components/select-button/{/321/201omponent.d.ts → component.d.ts} +3 -3
  23. package/dist/calendar/components/select-button/{/321/201omponent.js → component.js} +5 -11
  24. package/dist/calendar/components/select-button/index.d.ts +1 -1
  25. package/dist/calendar/components/select-button/index.js +1 -1
  26. package/dist/calendar/components/years-table/{/321/201omponent.js → component.js} +14 -14
  27. package/dist/calendar/components/years-table/index.d.ts +1 -1
  28. package/dist/calendar/components/years-table/index.js +1 -1
  29. package/dist/calendar/index.d.ts +2 -2
  30. package/dist/calendar/index.js +4 -4
  31. package/dist/calendar/use-calendar.js +51 -47
  32. package/dist/calendar/utils.js +7 -9
  33. package/dist/calendar-input/component.js +22 -22
  34. package/dist/card/component.js +2 -18
  35. package/dist/cell/base/component.js +31 -31
  36. package/dist/cell/pure/component.js +2 -2
  37. package/dist/checkbox/component.js +11 -11
  38. package/dist/checkbox-group/component.js +23 -24
  39. package/dist/checkbox-lists/component.d.ts +1 -2
  40. package/dist/checkbox-lists/component.js +59 -61
  41. package/dist/collapsable-row/addons.d.ts +3 -4
  42. package/dist/collapsable-row/addons.js +6 -9
  43. package/dist/collapsable-row/component.d.ts +1 -1
  44. package/dist/collapsable-row/component.js +7 -7
  45. package/dist/collapse/component.js +45 -54
  46. package/dist/copy-button/component.d.ts +1 -2
  47. package/dist/copy-button/component.js +1 -5
  48. package/dist/date/component.js +1 -1
  49. package/dist/date-switcher/component.d.ts +1 -2
  50. package/dist/date-switcher/component.js +8 -8
  51. package/dist/decorated-item/component.js +10 -20
  52. package/dist/dot/component.js +1 -4
  53. package/dist/empty-page/component.js +1 -9
  54. package/dist/filter-tag/component.d.ts +1 -1
  55. package/dist/flex/component.d.ts +2 -2
  56. package/dist/footer/component.js +57 -53
  57. package/dist/form/component.d.ts +1 -2
  58. package/dist/form/component.js +2 -12
  59. package/dist/form/templates/base-form/index.d.ts +3 -3
  60. package/dist/form/templates/base-form/index.js +26 -26
  61. package/dist/form/templates/filters-form/index.d.ts +1 -1
  62. package/dist/form/templates/filters-form/index.js +20 -23
  63. package/dist/form/templates/rest-form/form.d.ts +1 -2
  64. package/dist/form/templates/rest-form/form.js +77 -80
  65. package/dist/form/templates/rest-form/index.d.ts +3 -3
  66. package/dist/form/templates/rest-form/index.js +16 -27
  67. package/dist/form/utils/get-default-values.js +3 -6
  68. package/dist/form/utils/remove-undefined-from-object.js +1 -3
  69. package/dist/form-control/component.js +1 -1
  70. package/dist/formik/index.d.ts +2 -2
  71. package/dist/header-search/component.js +1 -6
  72. package/dist/hooks/index.d.ts +2 -2
  73. package/dist/hooks/index.js +10 -10
  74. package/dist/hooks/use-get-one/index.js +16 -16
  75. package/dist/icon-button/component.d.ts +3 -3
  76. package/dist/icon-button/component.js +2 -8
  77. package/dist/image/component.js +52 -30
  78. package/dist/image/image-base.js +1 -7
  79. package/dist/image/use-image-render-component.d.ts +1 -1
  80. package/dist/image/use-image-render-component.js +11 -14
  81. package/dist/image-gallery/component.js +40 -45
  82. package/dist/image-uploader/component.js +56 -53
  83. package/dist/index.js +41 -41
  84. package/dist/info-block-wrapper/component.d.ts +1 -1
  85. package/dist/input/component.js +1 -1
  86. package/dist/input-autocomplete/autocomplete-field/index.d.ts +1 -2
  87. package/dist/input-autocomplete/autocomplete-field/index.js +6 -6
  88. package/dist/input-autocomplete/component.d.ts +26 -26
  89. package/dist/input-ghost/component.d.ts +1 -1
  90. package/dist/link/component.d.ts +2 -2
  91. package/dist/link/component.js +1 -1
  92. package/dist/loader/component.js +6 -5
  93. package/dist/masked-input/component.js +7 -16
  94. package/dist/menu/component.js +12 -17
  95. package/dist/menu/components/content-header/index.js +1 -9
  96. package/dist/menu/components/menu-avatar/index.js +1 -6
  97. package/dist/menu/components/menu-button/index.js +1 -10
  98. package/dist/menu/components/menu-buttons-list/index.d.ts +1 -1
  99. package/dist/menu/components/menu-buttons-list/index.js +1 -7
  100. package/dist/menu/hooks/use-menu.js +12 -12
  101. package/dist/message/component.js +33 -14
  102. package/dist/modal/components/modals/modal.d.ts +1 -2
  103. package/dist/modal/components/modals/modal.js +30 -33
  104. package/dist/modal/context.js +12 -9
  105. package/dist/modal/hooks/use-modal.d.ts +1 -1
  106. package/dist/modal/hooks/use-modal.js +22 -22
  107. package/dist/mq/component.js +1 -6
  108. package/dist/notification/component.js +14 -12
  109. package/dist/page-container/component.js +1 -6
  110. package/dist/page-loading/component.d.ts +1 -2
  111. package/dist/page-with-controls/component.js +4 -7
  112. package/dist/picker-button/common/labeled-button/index.js +18 -12
  113. package/dist/picker-button/component.js +5 -5
  114. package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
  115. package/dist/picker-button/field/index.d.ts +1 -1
  116. package/dist/picker-button/field/index.js +1 -1
  117. package/dist/picker-button/index.d.ts +1 -1
  118. package/dist/picker-button/index.js +4 -4
  119. package/dist/popover/component.d.ts +2 -2
  120. package/dist/popover/component.js +77 -79
  121. package/dist/radio/component.js +7 -7
  122. package/dist/radio-groups/component.d.ts +1 -2
  123. package/dist/radio-groups/component.js +9 -7
  124. package/dist/select/component.d.ts +8 -9
  125. package/dist/select/component.js +1 -9
  126. package/dist/select/components/arrow/component.d.ts +1 -2
  127. package/dist/select/components/base-select/component.js +97 -90
  128. package/dist/select/components/checkmark/component.d.ts +1 -2
  129. package/dist/select/components/field/component.d.ts +1 -2
  130. package/dist/select/components/field/component.js +8 -5
  131. package/dist/select/components/native-select/component.js +4 -11
  132. package/dist/select/components/optgroup/component.d.ts +1 -2
  133. package/dist/select/components/optgroup/component.js +4 -4
  134. package/dist/select/components/option/component.js +1 -1
  135. package/dist/select/components/options-list/component.d.ts +1 -2
  136. package/dist/select/components/options-list/component.js +25 -23
  137. package/dist/select/components/select-search/index.d.ts +1 -1
  138. package/dist/select/components/select-search/index.js +28 -26
  139. package/dist/select/components/virtual-options-list/component.d.ts +1 -2
  140. package/dist/select/components/virtual-options-list/component.js +52 -45
  141. package/dist/select/index.js +4 -4
  142. package/dist/select/presets/index.d.ts +1 -1
  143. package/dist/select/presets/index.js +4 -4
  144. package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
  145. package/dist/select/presets/use-lazy-loading/index.js +45 -43
  146. package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
  147. package/dist/select/presets/use-select-with-loading/hook.js +8 -1
  148. package/dist/select/utils.js +32 -32
  149. package/dist/sidepanel/component.js +21 -15
  150. package/dist/sidepanel-header/component.js +17 -16
  151. package/dist/skeleton/component.js +4 -4
  152. package/dist/space/component.d.ts +2 -2
  153. package/dist/space/component.js +42 -45
  154. package/dist/space/{Item.d.ts → item.d.ts} +2 -2
  155. package/dist/spinner/component.js +6 -5
  156. package/dist/stack/index.d.ts +1 -1
  157. package/dist/stack/index.js +5 -5
  158. package/dist/stepped-progress-bar/components/step-bar.js +3 -3
  159. package/dist/stepped-progress-bar/index.d.ts +2 -2
  160. package/dist/stepped-progress-bar/index.js +37 -22
  161. package/dist/sticker/component.js +1 -17
  162. package/dist/suffix-input/component.js +13 -13
  163. package/dist/switch/component.js +7 -7
  164. package/dist/table/components/cells/index.d.ts +1 -2
  165. package/dist/table/components/empty-list/index.d.ts +3 -3
  166. package/dist/table/components/empty-list/index.js +6 -3
  167. package/dist/table/components/error/index.d.ts +3 -3
  168. package/dist/table/components/error/index.js +8 -5
  169. package/dist/table/components/loading/index.d.ts +1 -1
  170. package/dist/table/components/loading/index.js +18 -12
  171. package/dist/table/components/pagination/index.js +56 -53
  172. package/dist/table/components/table-header/index.js +59 -56
  173. package/dist/table/hooks/use-table-data.js +64 -59
  174. package/dist/table/table.d.ts +1 -1
  175. package/dist/table/table.js +80 -80
  176. package/dist/table/types.d.ts +3 -3
  177. package/dist/table/utils/get-query-from-url.js +1 -8
  178. package/dist/table/utils/get-tags.d.ts +1 -1
  179. package/dist/table/utils/get-tags.js +9 -12
  180. package/dist/table/utils/index.d.ts +1 -1
  181. package/dist/table/utils/index.js +4 -4
  182. package/dist/table/utils/parse-query-params.js +5 -1
  183. package/dist/table/utils/prepare-rows.d.ts +1 -2
  184. package/dist/table/utils/prepare-rows.js +4 -3
  185. package/dist/table/utils/query-adapter.d.ts +1 -1
  186. package/dist/table/utils/query-adapter.js +5 -5
  187. package/dist/table/utils/remove-query-param.js +3 -1
  188. package/dist/table/utils/reset-query-param.js +16 -9
  189. package/dist/table-status/component.js +5 -1
  190. package/dist/textarea/component.js +36 -28
  191. package/dist/theme-provider/component.js +33 -29
  192. package/dist/toast/component.d.ts +7 -8
  193. package/dist/toast/component.js +6 -6
  194. package/dist/toast-notifier/component.js +13 -13
  195. package/dist/toast-notifier/use-timer.d.ts +1 -1
  196. package/dist/toast-notifier/use-timer.js +5 -5
  197. package/dist/toast-plate/component.d.ts +3 -3
  198. package/dist/toast-plate/component.js +7 -7
  199. package/dist/tooltip/component.js +35 -35
  200. package/dist/tooltip/node-resolver.js +7 -7
  201. package/dist/typings/api.d.ts +3 -5
  202. package/dist/typography/colors.d.ts +1 -1
  203. package/dist/typography/title/component.d.ts +3 -3
  204. package/dist/typography/title/index.d.ts +1 -1
  205. package/dist/typography/title/index.js +3 -3
  206. package/dist/utils/date/index.js +12 -2
  207. package/dist/utils/index.d.ts +2 -2
  208. package/dist/utils/index.js +14 -14
  209. package/dist/utils/split-amount/util.js +4 -4
  210. package/dist/with-suffix/component.d.ts +13 -13
  211. package/dist/with-suffix/component.js +8 -8
  212. package/package.json +9 -34
  213. /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
  214. /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
  215. /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  216. /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  217. /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  218. /package/dist/picker-button/field/{Component.js → component.js} +0 -0
  219. /package/dist/space/{Item.js → item.js} +0 -0
@@ -1,35 +1,35 @@
1
1
  import { jsx as a, jsxs as rt } from "react/jsx-runtime";
2
- import st, { forwardRef as ot, useRef as y, useMemo as T, useCallback as L, useEffect as W } from "react";
3
- import re from "react-merge-refs";
4
- import se from "classnames";
5
- import { useMultipleSelection as oe, useCombobox as j } from "downshift";
2
+ import re from "classnames";
3
+ import { useMultipleSelection as se, useCombobox as L } from "downshift";
4
+ import st, { forwardRef as ot, useRef as y, useMemo as T, useCallback as W, useEffect as j } from "react";
5
+ import oe from "react-merge-refs";
6
6
  import { ResizeObserver as ct } from "resize-observer";
7
- import { getDataTestId as A } from "../../../__internal/utils/getDataTestId.js";
7
+ import { getDataTestId as A } from "../../../__internal/utils/get-data-test-id.js";
8
8
  import { Popover as it } from "../../../popover/component.js";
9
9
  import { processOptions as lt } from "../../utils.js";
10
10
  import { NativeSelect as at } from "../native-select/component.js";
11
- import x from "./index.module.css.js";
12
- const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
13
- const R = y(c);
14
- return R.current = c, R;
11
+ import v from "./index.module.css.js";
12
+ const ce = (o) => o ? o.key?.toString() : "", ie = (o) => {
13
+ const x = y(o);
14
+ return x.current = o, x;
15
15
  }, kt = ot(
16
16
  ({
17
- dataTestId: c = "",
18
- className: R,
17
+ dataTestId: o = "",
18
+ className: x,
19
19
  fieldClassName: le,
20
20
  filteredOptions: ae,
21
21
  popoverOuterClassname: de,
22
22
  optionsListClassName: ue,
23
23
  optionClassName: $,
24
- options: I,
24
+ options: R,
25
25
  actionButton: H,
26
- autocomplete: w = !1,
26
+ autocomplete: I = !1,
27
27
  multiple: m = !1,
28
28
  allowUnselect: M = !1,
29
29
  disabled: u = !1,
30
30
  closeOnSelect: U = !m,
31
31
  circularNavigation: fe = !1,
32
- nativeSelect: b = !1,
32
+ nativeSelect: w = !1,
33
33
  defaultOpen: V = !1,
34
34
  open: N,
35
35
  popoverPosition: pe = "bottom-start",
@@ -67,15 +67,15 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
67
67
  showEmptyOptionsList: Be = !1,
68
68
  visibleOptions: Le
69
69
  }, We) => {
70
- const k = y(null), Q = y(null), v = y(null), X = y(null), g = y(null), Y = ie(Pe), Z = ie(De), { flatOptions: i, selectedOptions: ee } = T(
71
- () => lt(I || [], C),
72
- [I, C]
70
+ const b = y(null), Q = y(null), k = y(null), X = y(null), g = y(null), Y = ie(Pe), Z = ie(De), { flatOptions: c, selectedOptions: ee } = T(
71
+ () => lt(R || [], C),
72
+ [R, C]
73
73
  ), te = T(() => {
74
74
  const e = /* @__PURE__ */ new Map();
75
- return i.forEach((t, o) => {
76
- e.set(t.key, o);
75
+ return c.forEach((t, s) => {
76
+ e.set(t.key, s);
77
77
  }), e;
78
- }, [i]), je = T(
78
+ }, [c]), je = T(
79
79
  () => ({
80
80
  itemToString: ce,
81
81
  onSelectedItemsChange: (e) => {
@@ -87,21 +87,21 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
87
87
  });
88
88
  },
89
89
  stateReducer: (e, t) => {
90
- const { type: o, changes: n } = t;
91
- return !M && o === oe.stateChangeTypes.DropdownKeyDownBackspace ? e : n;
90
+ const { type: s, changes: n } = t;
91
+ return !M && s === se.stateChangeTypes.DropdownKeyDownBackspace ? e : n;
92
92
  },
93
93
  ...C !== void 0 ? { selectedItems: ee } : {}
94
94
  }),
95
95
  [M, h, C, ee, Y]
96
96
  ), {
97
- selectedItems: s,
97
+ selectedItems: i,
98
98
  addSelectedItem: Ae,
99
99
  setSelectedItems: E,
100
100
  removeSelectedItem: $e,
101
101
  getDropdownProps: He
102
- } = oe(je), F = T(
103
- () => new Set(s.map((e) => e.key)),
104
- [s]
102
+ } = se(je), F = T(
103
+ () => new Set(i.map((e) => e.key)),
104
+ [i]
105
105
  ), {
106
106
  isOpen: l,
107
107
  getMenuProps: Ue,
@@ -112,25 +112,25 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
112
112
  highlightedIndex: P,
113
113
  toggleMenu: K,
114
114
  openMenu: f
115
- } = j({
115
+ } = L({
116
116
  id: ye,
117
117
  isOpen: N,
118
118
  circularNavigation: fe,
119
- items: i,
119
+ items: c,
120
120
  itemToString: ce,
121
- defaultHighlightedIndex: s.length === 0 ? -1 : void 0,
121
+ defaultHighlightedIndex: i.length === 0 ? -1 : void 0,
122
122
  onIsOpenChange: (e) => {
123
123
  Z.current && setTimeout(() => {
124
124
  Z.current?.({ open: e.isOpen, name: h });
125
125
  }, 0);
126
126
  },
127
127
  stateReducer: (e, t) => {
128
- const { type: o, changes: n } = t, { selectedItem: d } = n;
129
- switch (o) {
130
- case j.stateChangeTypes.InputKeyDownEnter:
131
- case j.stateChangeTypes.ItemClick:
128
+ const { type: s, changes: n } = t, { selectedItem: d } = n;
129
+ switch (s) {
130
+ case L.stateChangeTypes.InputKeyDownEnter:
131
+ case L.stateChangeTypes.ItemClick:
132
132
  if (d && !d.disabled) {
133
- const D = F.has(d.key), r = M || m && s.length > 1;
133
+ const D = F.has(d.key), r = M || m && i.length > 1;
134
134
  D && r && $e(d), D || (m ? Ae(d) : E([d]));
135
135
  }
136
136
  return {
@@ -143,33 +143,33 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
143
143
  }
144
144
  }
145
145
  }), ze = Ue(
146
- { ref: v },
146
+ { ref: k },
147
147
  { suppressRefError: !0 }
148
- ), p = Ve(He({ ref: re([We, Q]) })), Ge = (e) => {
149
- Te?.(e), w && !l && f();
148
+ ), p = Ve(He({ ref: oe([We, Q]) })), Ge = (e) => {
149
+ Te?.(e), I && !l && f();
150
150
  }, Je = (e) => {
151
151
  const t = e.relatedTarget || document.activeElement;
152
- !!(t && v.current?.contains(t)) || (Me?.(e), p.onBlur(e));
152
+ !!(t && k.current?.contains(t)) || (Me?.(e), p.onBlur(e));
153
153
  }, Qe = (e) => {
154
- p.onKeyDown(e), w && !l && e.key.length === 1 && f(), [" ", "Enter"].includes(e.key) && !w && !b && e.target.tagName !== "INPUT" && (e.preventDefault(), (!l || P === -1) && K());
154
+ p.onKeyDown(e), I && !l && e.key.length === 1 && f(), [" ", "Enter"].includes(e.key) && !I && !w && e.target.tagName !== "INPUT" && (e.preventDefault(), (!l || P === -1) && K());
155
155
  }, Xe = (e) => {
156
- v.current?.contains(e.target) || (!w || e.target.tagName !== "INPUT" ? K() : f());
157
- }, Ye = L(
156
+ k.current?.contains(e.target) || (!I || e.target.tagName !== "INPUT" ? K() : f());
157
+ }, Ye = W(
158
158
  (e) => {
159
159
  E(
160
160
  Array.from(e.target.options).reduce(
161
- (t, o, n) => o.selected ? t.concat(i[n]) : t,
161
+ (t, s, n) => s.selected ? t.concat(c[n]) : t,
162
162
  []
163
163
  )
164
164
  );
165
165
  },
166
- [i, E]
167
- ), Ze = L(
168
- ({ option: e, index: t, ...o }) => {
166
+ [c, E]
167
+ ), Ze = W(
168
+ ({ option: e, index: t, ...s }) => {
169
169
  if (!e) return null;
170
170
  const n = te.get(e.key);
171
171
  if (n === void 0) return null;
172
- const d = i[n], D = ne({
172
+ const d = c[n], D = ne({
173
173
  item: d,
174
174
  index: n,
175
175
  disabled: e.disabled,
@@ -186,7 +186,7 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
186
186
  });
187
187
  return /* @__PURE__ */ a(st.Fragment, { children: J({
188
188
  ...z,
189
- ...o,
189
+ ...s,
190
190
  className: $,
191
191
  innerProps: D,
192
192
  index: t,
@@ -199,7 +199,7 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
199
199
  },
200
200
  [
201
201
  z,
202
- i,
202
+ c,
203
203
  te,
204
204
  $,
205
205
  ne,
@@ -209,56 +209,56 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
209
209
  J
210
210
  ]
211
211
  );
212
- W(() => {
212
+ j(() => {
213
213
  V && f();
214
- }, [V, f]), W(() => {
214
+ }, [V, f]), j(() => {
215
215
  N === !0 && f();
216
216
  }, [N, f]);
217
- const B = L(() => {
218
- if (!v.current || !k.current) return;
219
- const e = _ === "field" ? "width" : "minWidth", t = Math.round(k.current.getBoundingClientRect().width);
220
- X.current !== t && (X.current = t, v.current.style[e] = `${t}px`);
217
+ const B = W(() => {
218
+ if (!k.current || !b.current) return;
219
+ const e = _ === "field" ? "width" : "minWidth", t = Math.round(b.current.getBoundingClientRect().width);
220
+ X.current !== t && (X.current = t, k.current.style[e] = `${t}px`);
221
221
  }, [_]);
222
- W(() => {
223
- if (!l || !k.current) return;
222
+ j(() => {
223
+ if (!l || !b.current) return;
224
224
  const e = () => {
225
225
  g.current && window.clearTimeout(g.current), g.current = window.setTimeout(B, 50);
226
226
  }, t = new ct(e);
227
- return t.observe(k.current), B(), () => {
227
+ return t.observe(b.current), B(), () => {
228
228
  t.disconnect(), g.current && window.clearTimeout(g.current), g.current = null;
229
229
  };
230
- }, [l, B, I, s]);
231
- const et = m ? s.map((e) => e.key?.toString()) : s[0]?.key?.toString(), tt = i.length > 0 || Be || !!H, nt = O ? /* @__PURE__ */ a("span", { ...qe(), children: Ie ? `${O} *` : O }) : void 0;
230
+ }, [l, B]);
231
+ const et = m ? i.map((e) => e.key?.toString()) : i[0]?.key?.toString(), tt = c.length > 0 || Be || !!H, nt = O ? /* @__PURE__ */ a("span", { ...qe(), children: Ie ? `${O} *` : O }) : void 0;
232
232
  return /* @__PURE__ */ rt(
233
233
  "div",
234
234
  {
235
235
  ..._e({
236
- ref: k,
236
+ ref: b,
237
237
  ...u && { "aria-disabled": !0 },
238
- className: se(x.component, { [x.block]: ke }, R)
238
+ className: re(v.component, { [v.block]: ke }, x)
239
239
  }),
240
240
  onKeyDown: u ? void 0 : Qe,
241
241
  tabIndex: -1,
242
242
  id: "slect_wrapper",
243
- "data-test-id": A("combobox", c),
243
+ "data-test-id": A("combobox", o),
244
244
  children: [
245
- b && /* @__PURE__ */ a(
245
+ w && /* @__PURE__ */ a(
246
246
  at,
247
247
  {
248
- className: x.nativeSelect,
248
+ className: v.nativeSelect,
249
249
  disabled: u,
250
250
  multiple: m,
251
251
  name: h,
252
252
  value: et,
253
253
  onChange: Ye,
254
- options: I
254
+ options: R
255
255
  }
256
256
  ),
257
257
  /* @__PURE__ */ a(
258
258
  Se,
259
259
  {
260
- selectedMultiple: s,
261
- selected: s[0],
260
+ selectedMultiple: i,
261
+ selected: i[0],
262
262
  multiple: m,
263
263
  open: l,
264
264
  disabled: u,
@@ -274,19 +274,19 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
274
274
  onBlur: Je,
275
275
  onFocus: u ? void 0 : Ge,
276
276
  onClick: u ? void 0 : Xe,
277
- tabIndex: b || u ? -1 : 0,
278
- ref: re([p.ref]),
277
+ tabIndex: w || u ? -1 : 0,
278
+ ref: oe([p.ref]),
279
279
  id: p.id,
280
280
  "aria-labelledby": p["aria-labelledby"],
281
281
  "aria-controls": p["aria-controls"],
282
- "aria-autocomplete": w ? p["aria-autocomplete"] : void 0
282
+ "aria-autocomplete": I ? p["aria-autocomplete"] : void 0
283
283
  },
284
- dataTestId: A("field", c),
284
+ dataTestId: A("field", o),
285
285
  ...xe
286
286
  }
287
287
  ),
288
- h && !b && s.map((e) => /* @__PURE__ */ a("input", { type: "hidden", name: h, value: e.key }, e.key)),
289
- !b && /* @__PURE__ */ a(
288
+ h && !w && i.map((e) => /* @__PURE__ */ a("input", { type: "hidden", name: h, value: e.key }, e.key)),
289
+ !w && /* @__PURE__ */ a(
290
290
  it,
291
291
  {
292
292
  open: l,
@@ -297,27 +297,34 @@ const ce = (c) => c ? c.key?.toString() : "", ie = (c) => {
297
297
  withArrow: he,
298
298
  preventFlip: ge,
299
299
  className: de,
300
- popperClassName: x.popoverInner,
300
+ popperClassName: v.popoverInner,
301
301
  update: Fe,
302
302
  zIndex: Ke,
303
- children: tt && /* @__PURE__ */ a("div", { ...ze, className: se(ue, x.optionsList), children: /* @__PURE__ */ a(
304
- Oe,
303
+ children: tt && /* @__PURE__ */ a(
304
+ "div",
305
305
  {
306
- ...Re,
307
- flatOptions: i,
308
- highlightedIndex: P,
309
- open: l,
310
- size: S,
311
- toggleMenu: K,
312
- actionButton: H,
313
- options: ae ?? I,
314
- Optgroup: Ee,
315
- Option: Ze,
316
- visibleOptions: Le,
317
- onScroll: Ne,
318
- dataTestId: A("options-list", c)
306
+ ...ze,
307
+ className: re(ue, v.optionsList),
308
+ children: /* @__PURE__ */ a(
309
+ Oe,
310
+ {
311
+ ...Re,
312
+ flatOptions: c,
313
+ highlightedIndex: P,
314
+ open: l,
315
+ size: S,
316
+ toggleMenu: K,
317
+ actionButton: H,
318
+ options: ae ?? R,
319
+ Optgroup: Ee,
320
+ Option: Ze,
321
+ visibleOptions: Le,
322
+ onScroll: Ne,
323
+ dataTestId: A("options-list", o)
324
+ }
325
+ )
319
326
  }
320
- ) })
327
+ )
321
328
  }
322
329
  )
323
330
  ]
@@ -1,3 +1,2 @@
1
- import { default as React } from 'react';
2
1
  import { CheckmarkProps } from '../../typings';
3
- export declare const Checkmark: ({ selected }: CheckmarkProps) => React.JSX.Element;
2
+ export declare const Checkmark: ({ selected }: CheckmarkProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { FormControlProps } from '../../../form-control';
3
2
  import { SelectFieldProps as BaseFieldProps } from '../../typings';
4
- export declare const SelectField: ({ size, open, multiple, error, hint, disabled, label, placeholder, selectedMultiple, selected, rightAddons, valueRenderer, Arrow, innerProps, dataTestId, fieldClassName, ...restProps }: BaseFieldProps & FormControlProps) => React.JSX.Element;
3
+ export declare const SelectField: ({ size, open, multiple, error, hint, disabled, label, placeholder, selectedMultiple, selected, rightAddons, valueRenderer, Arrow, innerProps, dataTestId, fieldClassName, ...restProps }: BaseFieldProps & FormControlProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
- import d, { useState as w, useRef as E, useCallback as f } from "react";
3
- import L from "classnames";
2
+ import w from "classnames";
3
+ import d, { useState as E, useRef as L, useCallback as f } from "react";
4
4
  import { FormControl as O } from "../../../form-control/component.js";
5
5
  import { useFocus as W } from "../../../hooks/useFocus/index.js";
6
6
  import { joinOptions as q } from "../../utils.js";
@@ -24,7 +24,7 @@ const P = ({
24
24
  fieldClassName: B,
25
25
  ...C
26
26
  }) => {
27
- const [R, a] = w(!1), i = E(null), [y] = W(i, "keyboard"), S = f(() => a(!0), []), V = f(() => a(!1), []), m = j({ selected: v, selectedMultiple: N }), s = !!m, g = !!n && (s || !l);
27
+ const [R, a] = E(!1), i = L(null), [y] = W(i, "keyboard"), S = f(() => a(!0), []), V = f(() => a(!1), []), m = j({ selected: v, selectedMultiple: N }), s = !!m, g = !!n && (s || !l);
28
28
  return /* @__PURE__ */ o(
29
29
  "div",
30
30
  {
@@ -35,7 +35,7 @@ const P = ({
35
35
  children: /* @__PURE__ */ o(
36
36
  O,
37
37
  {
38
- fieldClassName: L(e.field, B, {
38
+ fieldClassName: w(e.field, B, {
39
39
  [e.disabled]: c,
40
40
  [e.focusVisible]: y
41
41
  }),
@@ -49,7 +49,10 @@ const P = ({
49
49
  hint: b,
50
50
  rightAddons: (t || r) && /* @__PURE__ */ u(d.Fragment, { children: [
51
51
  r,
52
- t ? d.cloneElement(t, { className: e.arrow }) : null
52
+ t ? d.cloneElement(
53
+ t,
54
+ { className: e.arrow }
55
+ ) : null
53
56
  ] }),
54
57
  "data-test-id": x,
55
58
  ...C,
@@ -2,16 +2,7 @@ import { jsx as l } from "react/jsx-runtime";
2
2
  import { forwardRef as f, useCallback as p, createElement as u } from "react";
3
3
  import { isGroup as y } from "../../utils.js";
4
4
  const a = ({ option: e }) => /* @__PURE__ */ l("option", { value: e.key, disabled: e.disabled, children: typeof e.content == "string" ? e.content : e.key }), b = ({ label: e, options: c }) => /* @__PURE__ */ l("optgroup", { label: e, children: c.map((t) => /* @__PURE__ */ l(a, { option: t }, t.key)) }), v = f(
5
- ({
6
- className: e,
7
- disabled: c,
8
- multiple: t,
9
- value: s,
10
- name: n,
11
- options: d,
12
- onChange: m,
13
- ...k
14
- }, o) => {
5
+ ({ className: e, disabled: c, multiple: t, value: s, name: n, options: d, onChange: m, ...k }, o) => {
15
6
  const i = p((r) => {
16
7
  r.stopPropagation();
17
8
  }, []);
@@ -27,7 +18,9 @@ const a = ({ option: e }) => /* @__PURE__ */ l("option", { value: e.key, disable
27
18
  onClick: i,
28
19
  ref: o,
29
20
  ...k,
30
- children: d.map((r) => y(r) ? /* @__PURE__ */ u(b, { ...r, key: r.label }) : /* @__PURE__ */ l(a, { option: r }, r.key))
21
+ children: d.map(
22
+ (r) => y(r) ? /* @__PURE__ */ u(b, { ...r, key: r.label }) : /* @__PURE__ */ l(a, { option: r }, r.key)
23
+ )
31
24
  }
32
25
  );
33
26
  }
@@ -1,3 +1,2 @@
1
- import { default as React } from 'react';
2
1
  import { OptgroupProps } from '../../typings';
3
- export declare const Optgroup: ({ children, label, size }: OptgroupProps) => React.JSX.Element;
2
+ export declare const Optgroup: ({ children, label, size }: OptgroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import p from "react";
3
- import a from "classnames";
2
+ import p from "classnames";
3
+ import a from "react";
4
4
  import r from "./index.module.css.js";
5
- const d = ({ children: s, label: m, size: t = "s" }) => /* @__PURE__ */ e(p.Fragment, { children: [
6
- /* @__PURE__ */ o("div", { className: a(r.optgroup, r[t]), children: /* @__PURE__ */ o("span", { className: r.label, children: m }) }),
5
+ const d = ({ children: s, label: m, size: t = "s" }) => /* @__PURE__ */ e(a.Fragment, { children: [
6
+ /* @__PURE__ */ o("div", { className: p(r.optgroup, r[t]), children: /* @__PURE__ */ o("span", { className: r.label, children: m }) }),
7
7
  s
8
8
  ] });
9
9
  export {
@@ -1,6 +1,6 @@
1
1
  import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { isValidElement as k } from "react";
3
2
  import s from "classnames";
3
+ import { isValidElement as k } from "react";
4
4
  import { Skeleton as x } from "../../../skeleton/component.js";
5
5
  import { Checkmark as g } from "../checkmark/component.js";
6
6
  import t from "./index.module.css.js";
@@ -1,3 +1,2 @@
1
- import { default as React } from 'react';
2
1
  import { OptionsListProps } from '../../typings';
3
- export declare const OptionsList: React.ForwardRefExoticComponent<OptionsListProps & React.RefAttributes<unknown>>;
2
+ export declare const OptionsList: import('react').ForwardRefExoticComponent<OptionsListProps & import('react').RefAttributes<unknown>>;
@@ -1,52 +1,54 @@
1
- import { jsx as s, jsxs as a } from "react/jsx-runtime";
2
- import { forwardRef as R, useRef as g, useCallback as N } from "react";
3
- import j from "react-merge-refs";
4
- import w from "@alphakits/icons/dist/ClockCircleM";
5
- import G from "classnames";
1
+ import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
+ import R from "@alphakits/icons/dist/ClockCircleM";
3
+ import N from "classnames";
4
+ import { forwardRef as g, useRef as j, useCallback as w } from "react";
5
+ import G from "react-merge-refs";
6
6
  import { Button as L } from "../../../button/component.js";
7
- import { useVisibleOptions as O, isGroup as M } from "../../utils.js";
7
+ import { useVisibleOptions as M, isGroup as O } from "../../utils.js";
8
8
  import { Optgroup as V } from "../optgroup/component.js";
9
9
  import t from "./index.module.css.js";
10
10
  const W = () => {
11
11
  let e = 0;
12
12
  return () => e++;
13
- }, K = R(
13
+ }, K = g(
14
14
  ({
15
15
  size: e = "s",
16
- className: f,
17
- Option: o,
16
+ className: d,
17
+ Option: m,
18
18
  options: l = [],
19
19
  actionButton: i,
20
- Optgroup: d = V,
20
+ Optgroup: c = V,
21
21
  dataTestId: p,
22
- emptyPlaceholder: m,
22
+ emptyPlaceholder: o,
23
23
  visibleOptions: u = 5,
24
24
  onScroll: b,
25
25
  toggleMenu: h,
26
26
  open: x
27
27
  }, C) => {
28
- const c = g(null), n = W(), v = N(
29
- (r) => /* @__PURE__ */ s(d, { label: r.label, size: e, children: r.options.map((k) => o({ option: k, index: n() })) }, r.label),
28
+ const a = j(null), n = W(), v = w(
29
+ (r) => /* @__PURE__ */ s(c, { label: r.label, size: e, children: r.options.map((k) => m({ option: k, index: n() })) }, r.label),
30
30
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
- [o, n, e]
31
+ [m, n, e, c]
32
32
  );
33
- return O({
33
+ return M({
34
34
  visibleOptions: u,
35
- listRef: c,
35
+ listRef: a,
36
36
  open: x,
37
37
  invalidate: l
38
- }), l.length === 0 && !m && !i ? null : /* @__PURE__ */ a(
38
+ }), l.length === 0 && !o && !i ? null : /* @__PURE__ */ f(
39
39
  "div",
40
40
  {
41
- className: G(t.optionsList, t[e], f),
41
+ className: N(t.optionsList, t[e], d),
42
42
  "data-test-id": p,
43
- ref: j([c, C]),
43
+ ref: G([a, C]),
44
44
  onScroll: b,
45
45
  children: [
46
- l.map((r) => M(r) ? v(r) : o({ option: r, index: n() })),
47
- m && l.length === 0 && /* @__PURE__ */ a("div", { className: t.emptyPlaceholder, children: [
48
- /* @__PURE__ */ s(w, {}),
49
- m
46
+ l.map(
47
+ (r) => O(r) ? v(r) : m({ option: r, index: n() })
48
+ ),
49
+ o && l.length === 0 && /* @__PURE__ */ f("div", { className: t.emptyPlaceholder, children: [
50
+ /* @__PURE__ */ s(R, {}),
51
+ o
50
52
  ] }),
51
53
  !!i && /* @__PURE__ */ s("div", { className: t.actionButtonWrapper, children: /* @__PURE__ */ s(
52
54
  L,
@@ -8,4 +8,4 @@ type SelectSearchProps = Omit<SelectProps, 'options'> & {
8
8
  options: any;
9
9
  searchType?: 'text' | 'number';
10
10
  };
11
- export declare const SelectSearch: ({ options, searchType, onChange, selected, ...restProps }: SelectSearchProps) => React.JSX.Element;
11
+ export declare const SelectSearch: ({ options, searchType, onChange, selected, ...restProps }: SelectSearchProps) => import("react/jsx-runtime").JSX.Element;