@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,16 +1,16 @@
1
1
  import { jsx as l, jsxs as O } from "react/jsx-runtime";
2
- import ue, { forwardRef as de, useState as W, useRef as u, useCallback as t, useEffect as fe } from "react";
2
+ import ue from "classnames";
3
+ import de, { forwardRef as fe, useState as W, useRef as u, useCallback as t, useEffect as me } from "react";
3
4
  import T from "react-merge-refs";
4
- import me from "classnames";
5
5
  import { Calendar as he } from "../calendar/component.js";
6
6
  import { dateInLimits as ve } from "../calendar/utils.js";
7
7
  import { MaskedInput as ye } from "../masked-input/component.js";
8
8
  import { Popover as Re } from "../popover/component.js";
9
- import "../toast-notifier/component.js";
10
9
  import { formatDate as H } from "../utils/format-date/index.js";
11
- import { parseDateString as I, isCompleteDateInput as ge, DATE_MASK as we, SUPPORTS_INPUT_TYPE_DATE as De, NATIVE_DATE_FORMAT as Te } from "./utils.js";
10
+ import "../toast-notifier/component.js";
12
11
  import p from "./index.module.css.js";
13
- const be = de(
12
+ import { parseDateString as I, isCompleteDateInput as ge, DATE_MASK as we, SUPPORTS_INPUT_TYPE_DATE as De, NATIVE_DATE_FORMAT as Te } from "./utils.js";
13
+ const be = fe(
14
14
  ({
15
15
  block: L = !1,
16
16
  className: Y,
@@ -19,7 +19,7 @@ const be = de(
19
19
  defaultMonth: C,
20
20
  defaultValue: d = "",
21
21
  calendarPosition: k = "popover",
22
- value: o,
22
+ value: s,
23
23
  dataTestId: z,
24
24
  minDate: f,
25
25
  required: G,
@@ -35,38 +35,38 @@ const be = de(
35
35
  readOnly: S,
36
36
  ...X
37
37
  }, _) => {
38
- o = o && o.split("-").length ? o.split("-").reverse().join(".") : o;
39
- const R = o === void 0, K = De && E === "native", P = E === "input", Z = k === "static" && !P, $ = k === "popover" && !K && !P, [i, a] = W(!1), [ee, te] = W(d), g = R ? ee : o, w = g ? I(g).getTime() : void 0, V = ve(w, f, m), D = M || S, b = u(null), j = u(null), ne = u(null), r = u(null), oe = t((e) => {
38
+ s = s?.split("-").length ? s.split("-").reverse().join(".") : s;
39
+ const R = s === void 0, K = De && E === "native", P = E === "input", Z = k === "static" && !P, $ = k === "popover" && !K && !P, [i, a] = W(!1), [ee, te] = W(d), g = R ? ee : s, w = g ? I(g).getTime() : void 0, V = ve(w, f, m), D = M || S, b = u(null), j = u(null), ne = u(null), o = u(null), oe = t((e) => {
40
40
  e.key === "Escape" && a(!1);
41
41
  }, []), re = t(() => {
42
42
  i || a(!0);
43
43
  }, [i]), se = t(
44
44
  (e) => {
45
- a(!0), !i && e.target.tagName !== "INPUT" && r.current && r.current.focus();
45
+ a(!0), !i && e.target.tagName !== "INPUT" && o.current && o.current.focus();
46
46
  },
47
47
  [i]
48
48
  ), ae = t((e) => {
49
- r.current && r.current.contains(e.relatedTarget) === !1 && a(!1);
49
+ o.current && o.current.contains(e.relatedTarget) === !1 && a(!1);
50
50
  }, []), ce = t((e) => {
51
- ["ArrowDown", "ArrowUp"].includes(e.key) && r.current && (e.preventDefault(), r.current.focus());
51
+ ["ArrowDown", "ArrowUp"].includes(e.key) && o.current && (e.preventDefault(), o.current.focus());
52
52
  }, []), c = t(
53
- (e, n, s, B = "input", pe = !0) => {
54
- B === "input" && e && v && v(e, { value: n, date: s }), B === "calendar" && y && y(s.getTime()), pe && (R && te(n), h && h(e, {
55
- date: s,
53
+ (e, n, r, B = "input", pe = !0) => {
54
+ B === "input" && e && v && v(e, { value: n, date: r }), B === "calendar" && y && y(r.getTime()), pe && (R && te(n), h && h(e, {
55
+ date: r,
56
56
  value: n.split(".").reverse().join("-")
57
57
  }));
58
58
  },
59
59
  [y, h, v, R]
60
60
  ), le = t(
61
61
  (e) => {
62
- const n = e.target.value, s = I(n);
63
- c(e, n, s, "input", ge(n));
62
+ const n = e.target.value, r = I(n);
63
+ c(e, n, r, "input", ge(n));
64
64
  },
65
65
  [c]
66
66
  ), ie = t(
67
67
  (e) => {
68
- const n = I(e.target.value, Te), s = e.target.value === "" ? "" : H(n, { format: "dd.MM.yyyy" });
69
- c(e, s, n);
68
+ const n = I(e.target.value, Te), r = e.target.value === "" ? "" : H(n, { format: "dd.MM.yyyy" });
69
+ c(e, r, n);
70
70
  },
71
71
  [c]
72
72
  ), F = t(
@@ -82,7 +82,7 @@ const be = de(
82
82
  ), U = t((e) => {
83
83
  e.preventDefault();
84
84
  }, []);
85
- fe(() => {
85
+ me(() => {
86
86
  a(N);
87
87
  }, [N]);
88
88
  const x = t(
@@ -92,7 +92,7 @@ const be = de(
92
92
  he,
93
93
  {
94
94
  ...A,
95
- ref: r,
95
+ ref: o,
96
96
  defaultMonth: C,
97
97
  value: V ? w : void 0,
98
98
  onChange: F,
@@ -118,7 +118,7 @@ const be = de(
118
118
  "div",
119
119
  {
120
120
  ref: ne,
121
- className: me(p.component, Y, {
121
+ className: ue(p.component, Y, {
122
122
  [p.block]: L
123
123
  }),
124
124
  tabIndex: -1,
@@ -141,7 +141,7 @@ const be = de(
141
141
  disabled: M,
142
142
  readOnly: S,
143
143
  mask: we,
144
- rightAddons: /* @__PURE__ */ O(ue.Fragment, { children: [
144
+ rightAddons: /* @__PURE__ */ O(de.Fragment, { children: [
145
145
  /* @__PURE__ */ l("span", { className: p.calendarIcon }),
146
146
  K && /* @__PURE__ */ l(
147
147
  "input",
@@ -12,26 +12,10 @@ const y = ({
12
12
  subtitle: s,
13
13
  titleAddons: d
14
14
  }) => /* @__PURE__ */ r("div", { className: n([e.component, e[i]]), children: [
15
- !!o.length && /* @__PURE__ */ t(
16
- p,
17
- {
18
- orientation: l,
19
- images: o,
20
- view: i
21
- }
22
- ),
15
+ !!o.length && /* @__PURE__ */ t(p, { orientation: l, images: o, view: i }),
23
16
  /* @__PURE__ */ r("div", { className: e.content, children: [
24
17
  /* @__PURE__ */ r("div", { className: e.titleWrap, children: [
25
- /* @__PURE__ */ t(
26
- m.Text,
27
- {
28
- view: "title",
29
- color: "primary",
30
- weight: "medium",
31
- tag: "div",
32
- children: c
33
- }
34
- ),
18
+ /* @__PURE__ */ t(m.Text, { view: "title", color: "primary", weight: "medium", tag: "div", children: c }),
35
19
  d
36
20
  ] }),
37
21
  /* @__PURE__ */ t(
@@ -1,28 +1,28 @@
1
- import { jsx as s, jsxs as z } from "react/jsx-runtime";
2
- import I, { useRef as u, useState as N, useMemo as E, useEffect as j } from "react";
3
- import p from "classnames";
4
- import { getDataTestId as k } from "../../__internal/utils/getDataTestId.js";
5
- import { useFocus as F } from "../../hooks/useFocus/index.js";
1
+ import { jsxs as z, jsx as c } from "react/jsx-runtime";
2
+ import u from "classnames";
3
+ import { useRef as p, useState as I, useMemo as N, useEffect as E } from "react";
4
+ import { getDataTestId as j } from "../../__internal/utils/get-data-test-id.js";
5
+ import { useFocus as k } from "../../hooks/useFocus/index.js";
6
6
  import { Typography as v } from "../../typography/component.js";
7
7
  import { Pure as S } from "../pure/component.js";
8
8
  import r from "./index.module.css.js";
9
- const q = ({
10
- className: h,
11
- dataTestId: w,
9
+ const P = ({
10
+ className: w,
11
+ dataTestId: y,
12
12
  title: e,
13
13
  subtitle: m,
14
- size: y = "m",
15
- addon: g,
16
- compactAddon: b,
17
- singleLineTitle: i,
18
- showTitleTooltipOnOverflow: n
14
+ size: h = "m",
15
+ addon: b,
16
+ compactAddon: g,
17
+ singleLineTitle: s,
18
+ showTitleTooltipOnOverflow: i
19
19
  }) => {
20
- const d = u(null), a = u(null), [x] = F(d, "keyboard"), [R, f] = N(!1), c = E(
20
+ const d = p(null), a = p(null), [x] = k(d, "keyboard"), [R, f] = I(!1), n = N(
21
21
  () => typeof e == "string" || typeof e == "number" ? String(e) : void 0,
22
22
  [e]
23
23
  );
24
- return j(() => {
25
- if (!i || !n || !c) {
24
+ return E(() => {
25
+ if (!s || !i || !n) {
26
26
  f(!1);
27
27
  return;
28
28
  }
@@ -36,26 +36,26 @@ const q = ({
36
36
  return l.observe(t), () => l.disconnect();
37
37
  }
38
38
  return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
39
- }, [i, n, c]), /* @__PURE__ */ s(
39
+ }, [s, i, n]), /* @__PURE__ */ z(
40
40
  S,
41
41
  {
42
- slot: g,
43
- compact: b,
44
- className: p(r.component, { [r.focused]: x }, h),
45
- dataTestId: k("cell-action", w, !0),
42
+ slot: b,
43
+ compact: g,
44
+ className: u(r.component, { [r.focused]: x }, w),
45
+ dataTestId: j("cell-action", y, !0),
46
46
  tabIndex: 0,
47
- size: y,
47
+ size: h,
48
48
  ref: d,
49
- children: /* @__PURE__ */ z(I.Fragment, { children: [
50
- e && /* @__PURE__ */ s(
49
+ children: [
50
+ e && /* @__PURE__ */ c(
51
51
  "div",
52
52
  {
53
53
  ref: a,
54
- className: p(r.title_wrap, {
55
- [r.single_line]: i
54
+ className: u(r.title_wrap, {
55
+ [r.single_line]: s
56
56
  }),
57
- title: R && n ? c : void 0,
58
- children: /* @__PURE__ */ s(
57
+ title: R && i ? n : void 0,
58
+ children: /* @__PURE__ */ c(
59
59
  v.Text,
60
60
  {
61
61
  view: "title",
@@ -68,7 +68,7 @@ const q = ({
68
68
  )
69
69
  }
70
70
  ),
71
- m && /* @__PURE__ */ s(
71
+ m && /* @__PURE__ */ c(
72
72
  v.Text,
73
73
  {
74
74
  weight: "medium",
@@ -79,10 +79,10 @@ const q = ({
79
79
  children: m
80
80
  }
81
81
  )
82
- ] })
82
+ ]
83
83
  }
84
84
  );
85
85
  };
86
86
  export {
87
- q as Base
87
+ P as Base
88
88
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as v } from "react";
3
2
  import m from "classnames";
4
- import { getDataTestId as h } from "../../__internal/utils/getDataTestId.js";
3
+ import { forwardRef as v } from "react";
4
+ import { getDataTestId as h } from "../../__internal/utils/get-data-test-id.js";
5
5
  import r from "./index.module.css.js";
6
6
  const w = v(
7
7
  ({
@@ -1,12 +1,12 @@
1
1
  import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as y, useRef as C } from "react";
3
- import j from "react-merge-refs";
4
- import M from "@alphakits/icons/dist/CheckmarkS";
5
- import w from "@alphakits/icons/dist/MinusM";
6
- import F from "classnames";
2
+ import y from "@alphakits/icons/dist/CheckmarkS";
3
+ import C from "@alphakits/icons/dist/MinusM";
4
+ import j from "classnames";
5
+ import { forwardRef as M, useRef as w } from "react";
6
+ import F from "react-merge-refs";
7
7
  import { useFocus as I } from "../hooks/useFocus/index.js";
8
8
  import e from "./index.module.css.js";
9
- const G = y(
9
+ const G = M(
10
10
  ({
11
11
  checked: r,
12
12
  label: o,
@@ -23,7 +23,7 @@ const G = y(
23
23
  indeterminate: l = !1,
24
24
  ...k
25
25
  }, x) => {
26
- const i = C(null), [R] = I(i, "keyboard"), g = (f) => {
26
+ const i = w(null), [R] = I(i, "keyboard"), g = (f) => {
27
27
  n && n(f, { checked: f.target.checked, name: N });
28
28
  };
29
29
  return (
@@ -31,14 +31,14 @@ const G = y(
31
31
  /* @__PURE__ */ c(
32
32
  "label",
33
33
  {
34
- className: F(e.component, e[p], e[d], u, {
34
+ className: j(e.component, e[p], e[d], u, {
35
35
  [e.disabled]: t,
36
36
  [e.checked]: r,
37
37
  [e.indeterminate]: l,
38
38
  [e.focused]: R,
39
39
  [e.block]: h
40
40
  }),
41
- ref: j([i, x]),
41
+ ref: F([i, x]),
42
42
  children: [
43
43
  /* @__PURE__ */ c("span", { className: e.box, children: [
44
44
  /* @__PURE__ */ s(
@@ -52,8 +52,8 @@ const G = y(
52
52
  ...k
53
53
  }
54
54
  ),
55
- r && /* @__PURE__ */ s(M, {}),
56
- l && !r && /* @__PURE__ */ s("div", { className: e.indeterminateIcon, children: /* @__PURE__ */ s(w, {}) })
55
+ r && /* @__PURE__ */ s(y, {}),
56
+ l && !r && /* @__PURE__ */ s("div", { className: e.indeterminateIcon, children: /* @__PURE__ */ s(C, {}) })
57
57
  ] }),
58
58
  (o || a) && /* @__PURE__ */ c("span", { className: e.content, children: [
59
59
  o && /* @__PURE__ */ s("span", { className: e.label, children: o }),
@@ -1,33 +1,32 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import v from "react";
3
- import { Checkbox as y } from "../checkbox/component.js";
4
- import { FlexColumns as u } from "../flex-columns/component.js";
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
+ import { Checkbox as v } from "../checkbox/component.js";
3
+ import { FlexColumns as y } from "../flex-columns/component.js";
5
4
  import { Typography as l } from "../typography/component.js";
6
- import s from "./index.module.css.js";
7
- const F = ({
5
+ import d from "./index.module.css.js";
6
+ const $ = ({
8
7
  title: c,
9
8
  subtitle: t,
10
- selected: d = [],
11
- data: h = [],
9
+ selected: h = [],
10
+ data: m = [],
12
11
  onChange: a,
13
12
  columns: p = 1,
14
13
  disabled: x,
15
14
  gr: g = 20,
16
- gc: f = 20,
15
+ gc: k = 20,
17
16
  dataTestId: i
18
17
  }) => {
19
- const r = d || [], k = (e) => {
18
+ const o = h || [], b = (e) => {
20
19
  a(
21
- r?.includes(e) ? r?.filter((n) => n !== e) : [...r, e]
20
+ o?.includes(e) ? o?.filter((n) => n !== e) : [...o, e]
22
21
  );
23
- }, b = (e) => i ? `checkbox_${i}_${e}` : `checkbox_${e}`;
24
- return /* @__PURE__ */ m("div", { children: [
25
- (c || t) && /* @__PURE__ */ m("div", { className: s.text, children: [
26
- c && /* @__PURE__ */ o(l.Text, { tag: "div", view: "title", color: "primary", weight: "bold", children: c }),
27
- t && /* @__PURE__ */ o(
22
+ }, f = (e) => i ? `checkbox_${i}_${e}` : `checkbox_${e}`;
23
+ return /* @__PURE__ */ s("div", { children: [
24
+ (c || t) && /* @__PURE__ */ s("div", { className: d.text, children: [
25
+ c && /* @__PURE__ */ r(l.Text, { tag: "div", view: "title", color: "primary", weight: "bold", children: c }),
26
+ t && /* @__PURE__ */ r(
28
27
  l.Text,
29
28
  {
30
- className: s.subtitle,
29
+ className: d.subtitle,
31
30
  tag: "div",
32
31
  view: "caps",
33
32
  color: "secondary",
@@ -36,19 +35,19 @@ const F = ({
36
35
  }
37
36
  )
38
37
  ] }),
39
- /* @__PURE__ */ o(u, { columns: p, gr: g, gc: f, children: /* @__PURE__ */ o(v.Fragment, { children: h?.map((e, n) => /* @__PURE__ */ o(
40
- y,
38
+ /* @__PURE__ */ r(y, { columns: p, gr: g, gc: k, children: m?.map((e, n) => /* @__PURE__ */ r(
39
+ v,
41
40
  {
42
41
  disabled: x,
43
- dataTestId: b(n),
44
- onChange: () => k(e.key),
45
- checked: r?.includes(e.key),
42
+ dataTestId: f(n),
43
+ onChange: () => b(e.key),
44
+ checked: o?.includes(e.key),
46
45
  label: e.content
47
46
  },
48
47
  e.key + e.content
49
- )) }) })
48
+ )) })
50
49
  ] });
51
50
  };
52
51
  export {
53
- F as CheckboxGroup
52
+ $ as CheckboxGroup
54
53
  };
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  type Child = {
3
2
  id: number;
4
3
  title: string;
@@ -17,5 +16,5 @@ export interface CheckboxGroupsProps {
17
16
  collapsable?: boolean;
18
17
  disabled?: boolean;
19
18
  }
20
- export declare const CheckboxGroups: ({ parents, childs, selected, checkableParent, collapsable, disabled, onChange, }: CheckboxGroupsProps) => React.JSX.Element;
19
+ export declare const CheckboxGroups: ({ parents, childs, selected, checkableParent, collapsable, disabled, onChange, }: CheckboxGroupsProps) => import("react/jsx-runtime").JSX.Element;
21
20
  export {};
@@ -1,85 +1,83 @@
1
- import { jsx as l, jsxs as a } from "react/jsx-runtime";
2
- import f, { useState as E } from "react";
3
- import _ from "@alphakits/icons/dist/ChevronDownS";
4
- import j from "classnames";
5
- import { Checkbox as u } from "../checkbox/component.js";
6
- import { Collapse as F } from "../collapse/component.js";
7
- import { Divider as N } from "../divider/component.js";
8
- import { FlexColumns as P } from "../flex-columns/component.js";
9
- import { IconButton as S } from "../icon-button/component.js";
10
- import { Padding as z } from "../padding/component.js";
11
- import { Typography as B } from "../typography/component.js";
1
+ import { jsx as l, jsxs as h } from "react/jsx-runtime";
2
+ import A from "@alphakits/icons/dist/ChevronDownS";
3
+ import E from "classnames";
4
+ import _, { useState as j } from "react";
5
+ import { Checkbox as f } from "../checkbox/component.js";
6
+ import { Collapse as N } from "../collapse/component.js";
7
+ import { Divider as P } from "../divider/component.js";
8
+ import { FlexColumns as S } from "../flex-columns/component.js";
9
+ import { IconButton as z } from "../icon-button/component.js";
10
+ import { Padding as B } from "../padding/component.js";
11
+ import { Typography as D } from "../typography/component.js";
12
12
  import s from "./index.module.css.js";
13
13
  const Q = ({
14
- parents: C,
15
- childs: g,
16
- selected: d,
14
+ parents: u,
15
+ childs: C,
16
+ selected: a,
17
17
  checkableParent: k,
18
18
  collapsable: x,
19
19
  disabled: b,
20
- onChange: p
20
+ onChange: d
21
21
  }) => {
22
- const m = [], i = Array.isArray(d) ? d : [];
23
- C?.forEach((e) => {
24
- const r = {
22
+ const p = [], i = Array.isArray(a) ? a : [];
23
+ u?.forEach((e) => {
24
+ const o = {
25
25
  parent: {},
26
26
  childs: [],
27
27
  collapsed: !1
28
28
  };
29
- g?.forEach((o) => {
30
- o.locationId === e.id && (r.parent = e, r.childs.push(o));
31
- }), r.parent.id && m.push(r);
29
+ C?.forEach((r) => {
30
+ r.locationId === e.id && (o.parent = e, o.childs.push(r));
31
+ }), o.parent.id && p.push(o);
32
32
  });
33
- const [c, y] = E(m), v = (e) => {
34
- const r = c.map((t, n) => (n === e && (t.collapsed ? t.collapsed = !1 : t.collapsed = !0), t)), o = c.concat(r);
35
- y(o.filter((t, n) => o.indexOf(t) === n));
36
- }, h = (e) => {
37
- e.forEach((r) => {
38
- i?.includes(r) ? p(i.filter((o) => !e.includes(o))) : p([...i, ...e]);
33
+ const [c, g] = j(p), y = (e) => {
34
+ const o = c.map((t, n) => (n === e && (t.collapsed ? t.collapsed = !1 : t.collapsed = !0), t)), r = c.concat(o);
35
+ g(r.filter((t, n) => r.indexOf(t) === n));
36
+ }, m = (e) => {
37
+ e.forEach((o) => {
38
+ i?.includes(o) ? d(i.filter((r) => !e.includes(r))) : d([...i, ...e]);
39
39
  });
40
- }, w = (e) => {
41
- let r = !1;
42
- return e.forEach((o) => {
43
- i?.includes(o) && (r = !0);
44
- }), r;
45
- }, A = ({ element: e }) => k ? /* @__PURE__ */ l(
46
- u,
40
+ }, v = (e) => {
41
+ let o = !1;
42
+ return e.forEach((r) => {
43
+ i?.includes(r) && (o = !0);
44
+ }), o;
45
+ }, w = ({ element: e }) => k ? /* @__PURE__ */ l(
46
+ f,
47
47
  {
48
48
  block: !0,
49
49
  disabled: b,
50
- checked: w(
51
- e.childs.map((r) => r.id)
52
- ),
53
- onChange: () => h(e.childs.map((r) => r.id)),
50
+ checked: v(e.childs.map((o) => o.id)),
51
+ onChange: () => m(e.childs.map((o) => o.id)),
54
52
  label: `${e.parent.title}`
55
53
  }
56
- ) : /* @__PURE__ */ l(B.Text, { view: "title", weight: "medium", color: "primary", children: e.parent.title });
57
- return /* @__PURE__ */ l("div", { children: c.map((e, r) => /* @__PURE__ */ a(f.Fragment, { children: [
58
- /* @__PURE__ */ a(f.Fragment, { children: [
59
- /* @__PURE__ */ a("div", { className: s.list_head, children: [
60
- /* @__PURE__ */ l(A, { element: e }),
61
- x && /* @__PURE__ */ l(
62
- S,
63
- {
64
- onClick: () => v(r),
65
- size: "s",
66
- className: j(s.collapse_btn, { [s.collapse_btn_collapsed]: e.collapsed }),
67
- icon: _
68
- }
69
- )
70
- ] }),
71
- !e.collapsed && /* @__PURE__ */ l(z, { padding: "16px 0 0 0" })
54
+ ) : /* @__PURE__ */ l(D.Text, { view: "title", weight: "medium", color: "primary", children: e.parent.title });
55
+ return /* @__PURE__ */ l("div", { children: c.map((e, o) => /* @__PURE__ */ h(_.Fragment, { children: [
56
+ /* @__PURE__ */ h("div", { className: s.list_head, children: [
57
+ /* @__PURE__ */ l(w, { element: e }),
58
+ x && /* @__PURE__ */ l(
59
+ z,
60
+ {
61
+ onClick: () => y(o),
62
+ size: "s",
63
+ className: E(s.collapse_btn, {
64
+ [s.collapse_btn_collapsed]: e.collapsed
65
+ }),
66
+ icon: A
67
+ }
68
+ )
72
69
  ] }),
73
- /* @__PURE__ */ l(F, { expanded: !e.collapsed, children: /* @__PURE__ */ l("div", { className: s.content, children: /* @__PURE__ */ l(P, { columns: 1, gr: 8, children: e.childs.map((o) => /* @__PURE__ */ l(
74
- u,
70
+ !e.collapsed && /* @__PURE__ */ l(B, { padding: "16px 0 0 0" }),
71
+ /* @__PURE__ */ l(N, { expanded: !e.collapsed, children: /* @__PURE__ */ l("div", { className: s.content, children: /* @__PURE__ */ l(S, { columns: 1, gr: 8, children: e.childs.map((r) => /* @__PURE__ */ l(
72
+ f,
75
73
  {
76
- onChange: () => h([o.id]),
77
- checked: i?.includes(o.id),
78
- label: o.title
74
+ onChange: () => m([r.id]),
75
+ checked: i?.includes(r.id),
76
+ label: r.title
79
77
  },
80
- o.id
78
+ r.id
81
79
  )) }) }) }),
82
- r !== c?.length - 1 && /* @__PURE__ */ l(N, { size: "m" })
80
+ o !== c?.length - 1 && /* @__PURE__ */ l(P, { size: "m" })
83
81
  ] }, e.parent.id)) });
84
82
  };
85
83
  export {
@@ -1,6 +1,5 @@
1
- import { default as React } from 'react';
2
- export declare const Content: ({ location, onClick, }: {
1
+ export declare const Content: ({ location, onClick }: {
3
2
  location: any;
4
3
  onClick: () => void;
5
- }) => React.JSX.Element;
6
- export declare const Addons: ({ onClick }: any) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const Addons: ({ onClick }: any) => import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,14 @@
1
1
  import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import e from "react";
3
- import m from "@alphakits/icons/dist/EditS";
4
- import s from "@alphakits/icons/dist/PlusS";
2
+ import e from "@alphakits/icons/dist/EditS";
3
+ import m from "@alphakits/icons/dist/PlusS";
4
+ import s from "react";
5
5
  import { Button as n } from "../button/component.js";
6
6
  import { IconButton as d } from "../icon-button/component.js";
7
7
  import { Typography as p } from "../typography/component.js";
8
- const w = ({
9
- location: r,
10
- onClick: t
11
- }) => /* @__PURE__ */ i(e.Fragment, { children: [
8
+ const w = ({ location: r, onClick: t }) => /* @__PURE__ */ i(s.Fragment, { children: [
12
9
  /* @__PURE__ */ o(p.Text, { view: "title", weight: "bold", color: "primary", children: r.address }),
13
- /* @__PURE__ */ o(d, { icon: m, onClick: t, size: "s", view: "ghost" })
14
- ] }), y = ({ onClick: r }) => /* @__PURE__ */ o(n, { leftAddons: /* @__PURE__ */ o(s, {}), size: "xs", onClick: r, view: "secondary", children: "Добавить квест" });
10
+ /* @__PURE__ */ o(d, { icon: e, onClick: t, size: "s", view: "ghost" })
11
+ ] }), y = ({ onClick: r }) => /* @__PURE__ */ o(n, { leftAddons: /* @__PURE__ */ o(m, {}), size: "xs", onClick: r, view: "secondary", children: "Добавить квест" });
15
12
  export {
16
13
  y as Addons,
17
14
  w as Content
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type CollapsableRowProps = {
3
- children: React.ReactNode;
3
+ children?: React.ReactNode;
4
4
  label?: string;
5
5
  content?: React.ReactNode;
6
6
  expanded?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import { useState as p, useEffect as d } from "react";
3
- import f from "@alphakits/icons/dist/ChevronDownS";
4
- import h from "classnames";
2
+ import p from "@alphakits/icons/dist/ChevronDownS";
3
+ import d from "classnames";
4
+ import { useState as f, useEffect as h } from "react";
5
5
  import { Collapse as w } from "../collapse/component.js";
6
6
  import { IconButton as v } from "../icon-button/component.js";
7
7
  import { Typography as u } from "../typography/component.js";
@@ -14,8 +14,8 @@ const E = ({
14
14
  children: m,
15
15
  disabled: n
16
16
  }) => {
17
- const [s, a] = p(r);
18
- return d(() => {
17
+ const [s, a] = f(r);
18
+ return h(() => {
19
19
  a(r);
20
20
  }, [r]), /* @__PURE__ */ e("div", { children: [
21
21
  /* @__PURE__ */ e("div", { className: o.wrapper, children: [
@@ -38,10 +38,10 @@ const E = ({
38
38
  v,
39
39
  {
40
40
  onClick: () => a(!s),
41
- className: h(o.collapse_button, { [o.expanded_icon]: s }),
41
+ className: d(o.collapse_button, { [o.expanded_icon]: s }),
42
42
  disabled: n,
43
43
  view: "ghost",
44
- icon: f,
44
+ icon: p,
45
45
  size: "s"
46
46
  }
47
47
  )