Package not found. Please check the package name and try again.

@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
@@ -10,7 +10,7 @@ export type LinkProps = NativeProps & {
10
10
  className?: string;
11
11
  dataTestId?: string;
12
12
  onClick?: NativeProps['onClick'];
13
- children: ReactNode;
13
+ children?: ReactNode;
14
14
  };
15
15
  export declare const Link: React.ForwardRefExoticComponent<NativeProps & {
16
16
  href?: string | undefined;
@@ -22,6 +22,6 @@ export declare const Link: React.ForwardRefExoticComponent<NativeProps & {
22
22
  className?: string | undefined;
23
23
  dataTestId?: string | undefined;
24
24
  onClick?: NativeProps['onClick'];
25
- children: ReactNode;
25
+ children?: ReactNode;
26
26
  } & React.RefAttributes<HTMLAnchorElement>>;
27
27
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as a, jsxs as N } from "react/jsx-runtime";
2
+ import n from "classnames";
2
3
  import R, { forwardRef as k, useRef as b } from "react";
3
4
  import j from "react-merge-refs";
4
- import n from "classnames";
5
5
  import { useFocus as w } from "../hooks/useFocus/index.js";
6
6
  import e from "./index.module.css.js";
7
7
  const g = k(
@@ -1,13 +1,14 @@
1
- import { jsxs as o, jsx as c } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as c } from "react/jsx-runtime";
2
2
  import t from "classnames";
3
- import i from "./index.module.css.js";
4
- const l = ({ className: r, dataTestId: e }) => /* @__PURE__ */ o(
3
+ import o from "./index.module.css.js";
4
+ const d = ({ className: r, dataTestId: e }) => /* @__PURE__ */ i(
5
5
  "svg",
6
6
  {
7
7
  height: "24",
8
8
  width: "24",
9
9
  viewBox: "0 0 24 24",
10
- className: t(i.component, r),
10
+ "aria-hidden": "true",
11
+ className: t(o.component, r),
11
12
  "data-test-id": e,
12
13
  children: [
13
14
  /* @__PURE__ */ c("circle", { cx: "4", cy: "12", r: "2" }),
@@ -17,5 +18,5 @@ const l = ({ className: r, dataTestId: e }) => /* @__PURE__ */ o(
17
18
  }
18
19
  );
19
20
  export {
20
- l as Loader
21
+ d as Loader
21
22
  };
@@ -1,21 +1,12 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
- import M, { useRef as l, useState as m, useCallback as c, useEffect as i } from "react";
3
- import w from "react-merge-refs";
4
- import P from "classnames";
2
+ import M from "classnames";
3
+ import w, { useRef as l, useState as m, useCallback as c, useEffect as i } from "react";
4
+ import P from "react-merge-refs";
5
5
  import { createTextMaskInputElement as v } from "text-mask-core";
6
6
  import { Input as A } from "../input/component.js";
7
7
  import L from "./index.module.css.js";
8
- const T = " ", q = M.forwardRef(
9
- ({
10
- mask: p,
11
- value: n,
12
- defaultValue: s,
13
- className: d,
14
- onBeforeDisplay: f,
15
- onChange: u,
16
- onClear: o,
17
- ...x
18
- }, C) => {
8
+ const T = " ", q = w.forwardRef(
9
+ ({ mask: p, value: n, defaultValue: s, className: d, onBeforeDisplay: f, onChange: u, onClear: o, ...x }, C) => {
19
10
  const r = l(null), a = l(null), [R, h] = m(n || s || ""), [k, E] = m(!0), t = c((e = "") => {
20
11
  a.current && r.current && (a.current.update(e), h(r.current.value));
21
12
  }, []), H = c(
@@ -52,11 +43,11 @@ const T = " ", q = M.forwardRef(
52
43
  A,
53
44
  {
54
45
  ...x,
55
- className: P(d, { [L.textHidden]: k }),
46
+ className: M(d, { [L.textHidden]: k }),
56
47
  value: R,
57
48
  onChange: H,
58
49
  onClear: I,
59
- ref: w([C, r])
50
+ ref: P([C, r])
60
51
  }
61
52
  );
62
53
  }
@@ -1,11 +1,11 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import s from "classnames";
3
- import { useMenu as S } from "./hooks/use-menu.js";
4
- import { ContentHeader as j } from "./components/content-header/index.js";
5
- import { MenuAvatar as L } from "./components/menu-avatar/index.js";
6
- import { MenuBackButton as T } from "./components/menu-back-button/index.js";
7
- import { MenuButtonsList as W } from "./components/menu-buttons-list/index.js";
8
- import { UserButton as $ } from "./components/user-button/index.js";
3
+ import { ContentHeader as S } from "./components/content-header/index.js";
4
+ import { MenuAvatar as j } from "./components/menu-avatar/index.js";
5
+ import { MenuBackButton as L } from "./components/menu-back-button/index.js";
6
+ import { MenuButtonsList as T } from "./components/menu-buttons-list/index.js";
7
+ import { UserButton as W } from "./components/user-button/index.js";
8
+ import { useMenu as $ } from "./hooks/use-menu.js";
9
9
  import t from "./index.module.css.js";
10
10
  const E = ({
11
11
  pathname: i,
@@ -22,12 +22,7 @@ const E = ({
22
22
  navigate: v,
23
23
  t: c
24
24
  }) => {
25
- const {
26
- staticMenu: n,
27
- setStaticMenu: B,
28
- showMenu: a,
29
- ref: C
30
- } = S(), r = n || a, l = `/${i.split("/").slice(-1)[0]}`, N = () => v("/app/calendar"), y = s(t.left_menu, {
25
+ const { staticMenu: n, setStaticMenu: B, showMenu: a, ref: C } = $(), r = n || a, l = `/${i.split("/").slice(-1)[0]}`, N = () => v("/app/calendar"), y = s(t.left_menu, {
31
26
  [t.menu_static]: n,
32
27
  [t.hidden_menu_opened]: a
33
28
  }), x = s(t.content_wrapper, {
@@ -37,7 +32,7 @@ const E = ({
37
32
  return /* @__PURE__ */ o("div", { className: s(t.layout_wrapper), children: [
38
33
  /* @__PURE__ */ o("div", { ref: C, className: y, children: [
39
34
  /* @__PURE__ */ e(
40
- L,
35
+ j,
41
36
  {
42
37
  title: _,
43
38
  showTitle: r,
@@ -45,9 +40,9 @@ const E = ({
45
40
  onClick: k
46
41
  }
47
42
  ),
48
- u && /* @__PURE__ */ e(T, { showTitle: r, onClick: N }),
43
+ u && /* @__PURE__ */ e(L, { showTitle: r, onClick: N }),
49
44
  /* @__PURE__ */ e(
50
- W,
45
+ T,
51
46
  {
52
47
  routes: p,
53
48
  showLabels: r,
@@ -60,13 +55,13 @@ const E = ({
60
55
  /* @__PURE__ */ o("div", { className: x, children: [
61
56
  /* @__PURE__ */ o("div", { className: t.content_header, children: [
62
57
  /* @__PURE__ */ e(
63
- j,
58
+ S,
64
59
  {
65
60
  onClick: () => B(!n),
66
61
  title: c(`menu.${l}`)
67
62
  }
68
63
  ),
69
- /* @__PURE__ */ e($, { photo: f, fullName: d, options: h })
64
+ /* @__PURE__ */ e(W, { photo: f, fullName: d, options: h })
70
65
  ] }),
71
66
  m
72
67
  ] })
@@ -4,15 +4,7 @@ import { IconButton as m } from "../../../icon-button/component.js";
4
4
  import { Typography as n } from "../../../typography/component.js";
5
5
  import p from "./index.module.css.js";
6
6
  const f = ({ onClick: r, title: t }) => /* @__PURE__ */ e("div", { children: [
7
- /* @__PURE__ */ o(
8
- m,
9
- {
10
- size: "m",
11
- icon: i,
12
- onClick: r,
13
- className: p.open_button
14
- }
15
- ),
7
+ /* @__PURE__ */ o(m, { size: "m", icon: i, onClick: r, className: p.open_button }),
16
8
  /* @__PURE__ */ o(n.Title, { color: "primary", tag: "div", view: "xsmall", weight: "regular", children: t })
17
9
  ] });
18
10
  export {
@@ -3,12 +3,7 @@ import n from "classnames";
3
3
  import { Avatar as c } from "../../../avatar/component.js";
4
4
  import { Typography as d } from "../../../typography/component.js";
5
5
  import r from "./index.module.css.js";
6
- const u = ({
7
- showTitle: o,
8
- title: e,
9
- image: i,
10
- onClick: t
11
- }) => {
6
+ const u = ({ showTitle: o, title: e, image: i, onClick: t }) => {
12
7
  const a = () => {
13
8
  t && t();
14
9
  };
@@ -20,16 +20,7 @@ const f = ({
20
20
  to: s,
21
21
  children: [
22
22
  o && /* @__PURE__ */ t("div", { className: e.leftAddons, children: o }),
23
- /* @__PURE__ */ t(
24
- d.Text,
25
- {
26
- view: "title",
27
- weight: "medium",
28
- color: "secondary",
29
- className: e.text,
30
- children: m
31
- }
32
- ),
23
+ /* @__PURE__ */ t(d.Text, { view: "title", weight: "medium", color: "secondary", className: e.text, children: m }),
33
24
  i && /* @__PURE__ */ t("div", { className: e.rightAddons, children: i })
34
25
  ]
35
26
  }
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { MenuElement } from '../..';
3
2
  import { TFunction } from '../../../modal';
3
+ import { MenuElement } from '../..';
4
4
  type Props = {
5
5
  routes: MenuElement[];
6
6
  showLabels?: boolean;
@@ -1,13 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { MenuButton as p } from "../menu-button/index.js";
3
3
  import a from "./index.module.css.js";
4
- const d = ({
5
- routes: e,
6
- showLabels: o,
7
- currentPath: s,
8
- t: l,
9
- Link: m
10
- }) => /* @__PURE__ */ i("div", { className: a.component, children: !!e.length && e.map((t) => {
4
+ const d = ({ routes: e, showLabels: o, currentPath: s, t: l, Link: m }) => /* @__PURE__ */ i("div", { className: a.component, children: !!e.length && e.map((t) => {
11
5
  const n = `/${t.path.split("/").slice(-1)[0]}`;
12
6
  return /* @__PURE__ */ i(
13
7
  p,
@@ -1,23 +1,23 @@
1
- import { useState as i, useRef as m, useCallback as a, useEffect as l } from "react";
1
+ import { useState as c, useRef as i, useCallback as m, useEffect as l } from "react";
2
2
  const d = () => {
3
- const [e, f] = i(!0), [n, o] = i(!1), t = m(void 0), s = m(null), c = a(() => {
4
- e || o(!0);
5
- }, [e]), u = a(() => {
6
- t.current && clearTimeout(t.current), t.current = setTimeout(c, 600);
7
- }, [c]);
3
+ const [e, a] = c(!0), [f, n] = c(!1), t = i(void 0), o = i(null), s = m(() => {
4
+ e || n(!0);
5
+ }, [e]), u = m(() => {
6
+ t.current && clearTimeout(t.current), t.current = setTimeout(s, 600);
7
+ }, [s]);
8
8
  return l(() => {
9
- const r = s.current;
9
+ const r = o.current;
10
10
  if (!(e || !r))
11
11
  return r.addEventListener("mousemove", u), r.addEventListener("mouseleave", () => {
12
- clearTimeout(t.current), o(!1);
12
+ clearTimeout(t.current), n(!1);
13
13
  }), () => {
14
14
  r.removeEventListener("mousemove", u), clearTimeout(t.current);
15
15
  };
16
- }, [e, n, u]), {
17
- ref: s,
16
+ }, [e, u]), {
17
+ ref: o,
18
18
  staticMenu: e,
19
- showMenu: n,
20
- setStaticMenu: f
19
+ showMenu: f,
20
+ setStaticMenu: a
21
21
  };
22
22
  };
23
23
  export {
@@ -5,18 +5,18 @@ import { Flex as j } from "../flex/component.js";
5
5
  import { Image as p } from "../image/component.js";
6
6
  import { ImageGallery as I } from "../image-gallery/component.js";
7
7
  import { Padding as z } from "../padding/component.js";
8
- import { Typography as t } from "../typography/component.js";
8
+ import { Typography as l } from "../typography/component.js";
9
9
  import i from "./index.module.css.js";
10
10
  const P = ({
11
11
  className: h,
12
12
  dataTestId: g,
13
13
  title: m,
14
- date: o,
15
- rightAddons: s,
14
+ date: s,
15
+ rightAddons: o,
16
16
  answer: d,
17
17
  text: f,
18
18
  image: y,
19
- photos: l = [],
19
+ photos: a = [],
20
20
  withImage: v = !0
21
21
  }) => {
22
22
  const [w, c] = n(!1), [x, u] = n(0);
@@ -24,30 +24,49 @@ const P = ({
24
24
  /* @__PURE__ */ r("div", { className: i.topRow, children: [
25
25
  /* @__PURE__ */ r("div", { className: i.leftSide, children: [
26
26
  v && /* @__PURE__ */ e(p, { src: y, size: "s", text: m, view: "circle" }),
27
- /* @__PURE__ */ e(t.Text, { color: "primary", className: i.title, view: "title", weight: "bold", children: m }),
28
- o && /* @__PURE__ */ e(t.Text, { view: "title", color: "secondary", weight: "regular", children: o })
27
+ /* @__PURE__ */ e(
28
+ l.Text,
29
+ {
30
+ color: "primary",
31
+ className: i.title,
32
+ view: "title",
33
+ weight: "bold",
34
+ children: m
35
+ }
36
+ ),
37
+ s && /* @__PURE__ */ e(l.Text, { view: "title", color: "secondary", weight: "regular", children: s })
29
38
  ] }),
30
- s && /* @__PURE__ */ e("div", { className: i.rightAddons, children: s })
39
+ o && /* @__PURE__ */ e("div", { className: i.rightAddons, children: o })
31
40
  ] }),
32
41
  /* @__PURE__ */ r("div", { className: i.text, children: [
33
- /* @__PURE__ */ e(t.Text, { view: "primary-medium", color: "primary", weight: "medium", children: f }),
34
- !!d && /* @__PURE__ */ e(t.Text, { className: i.answer, view: "primary-small", color: "secondary", weight: "medium", children: d }),
35
- !!l.length && /* @__PURE__ */ r(S.Fragment, { children: [
42
+ /* @__PURE__ */ e(l.Text, { view: "primary-medium", color: "primary", weight: "medium", children: f }),
43
+ !!d && /* @__PURE__ */ e(
44
+ l.Text,
45
+ {
46
+ className: i.answer,
47
+ view: "primary-small",
48
+ color: "secondary",
49
+ weight: "medium",
50
+ children: d
51
+ }
52
+ ),
53
+ !!a.length && /* @__PURE__ */ r(S.Fragment, { children: [
36
54
  /* @__PURE__ */ e(z, { padding: "8px 0" }),
37
- /* @__PURE__ */ e(j, { justify: "start", gap: "md", children: l.map((a, N) => /* @__PURE__ */ e(
55
+ /* @__PURE__ */ e(j, { justify: "start", gap: "md", children: a.map((t, N) => /* @__PURE__ */ e(
38
56
  T,
39
57
  {
40
58
  view: "ghost",
41
59
  onClick: () => {
42
60
  u(N), c(!0);
43
61
  },
44
- children: /* @__PURE__ */ e(p, { src: a, size: "xl", view: "default" })
45
- }
62
+ children: /* @__PURE__ */ e(p, { src: t, size: "xl", view: "default" })
63
+ },
64
+ t
46
65
  )) }),
47
66
  /* @__PURE__ */ e(
48
67
  I,
49
68
  {
50
- photos: l.map((a) => ({ src: a })),
69
+ photos: a.map((t) => ({ src: t })),
51
70
  initialSlide: x || 0,
52
71
  open: w,
53
72
  onClose: () => c(!1)
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { ModalObject, TFunction } from '../../types';
3
2
  import { ModalsProps } from '.';
4
3
  type ModalProps = {
@@ -6,5 +5,5 @@ type ModalProps = {
6
5
  index: number;
7
6
  t: TFunction;
8
7
  } & Pick<ModalsProps, 'dirtyModals' | 'closeModal' | 'currentModalId'>;
9
- export declare const Modal: ({ modal, t, index, dirtyModals, closeModal, currentModalId, }: ModalProps) => React.JSX.Element;
8
+ export declare const Modal: ({ modal, t, index, dirtyModals, closeModal, currentModalId }: ModalProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,36 +1,33 @@
1
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
- import y, { useState as C, useLayoutEffect as d, useCallback as h, useEffect as z } from "react";
3
- import v from "classnames";
4
- import { ButtonArrow as x } from "../../../button-arrow/component.js";
1
+ import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
+ import y from "classnames";
3
+ import { useState as C, useLayoutEffect as d, useCallback as b, useEffect as z } from "react";
4
+ import { ButtonArrow as v } from "../../../button-arrow/component.js";
5
5
  import o from "./index.module.css.js";
6
- const k = {
6
+ const h = {
7
7
  s: 488,
8
8
  m: 888,
9
9
  full: "96%"
10
- }, F = ({
11
- modal: e,
12
- t: b,
13
- index: l,
14
- dirtyModals: p,
15
- closeModal: a,
16
- currentModalId: r
17
- }) => {
18
- const c = -k[e.props.size] - 102, [w, f] = C(c);
10
+ }, j = ({ modal: e, t: l, index: p, dirtyModals: a, closeModal: f, currentModalId: r }) => {
11
+ const c = -h[e.props.size] - 102, [w, m] = C(c);
19
12
  d(() => {
20
- setTimeout(() => f(0), 0);
13
+ setTimeout(() => m(0), 0);
21
14
  }, []);
22
- const m = h(
15
+ const u = b(
23
16
  (s) => (
24
17
  // eslint-disable-next-line no-restricted-globals
25
- !p[s] || confirm(b("common:exitConfirm"))
18
+ !a[s] || confirm(l("common:exitConfirm"))
26
19
  ),
27
- [p]
28
- ), t = h((s) => {
29
- const { id: i } = e;
30
- m(s || i) && (f(c), setTimeout(() => {
31
- e.props.closeCallback && e.props.closeCallback(), a(s || i);
32
- }, 250));
33
- }, [a, m, e, c]);
20
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
+ [a, l]
22
+ ), t = b(
23
+ (s) => {
24
+ const { id: i } = e;
25
+ u(s || i) && (m(c), setTimeout(() => {
26
+ e.props.closeCallback && e.props.closeCallback(), f(s || i);
27
+ }, 250));
28
+ },
29
+ [f, u, e, c]
30
+ );
34
31
  return z(() => {
35
32
  const s = (i) => {
36
33
  (i.key === "27" || i.key === "Escape") && t(r);
@@ -38,27 +35,27 @@ const k = {
38
35
  return e.id === r && window?.addEventListener("keydown", s), () => {
39
36
  window?.removeEventListener("keydown", s);
40
37
  };
41
- }, [t, r, e.id]), /* @__PURE__ */ n(y.Fragment, { children: /* @__PURE__ */ u(
38
+ }, [t, r, e.id]), /* @__PURE__ */ k(
42
39
  "div",
43
40
  {
44
41
  className: o.container,
45
42
  style: {
46
- zIndex: 9999998 + l
43
+ zIndex: 9999998 + p
47
44
  },
48
45
  children: [
49
46
  /* @__PURE__ */ n(
50
47
  "div",
51
48
  {
52
- className: v(o.right, o.content),
49
+ className: y(o.right, o.content),
53
50
  style: {
54
- zIndex: 9999999 + l,
55
- width: k[e.props.size],
51
+ zIndex: 9999999 + p,
52
+ width: h[e.props.size],
56
53
  right: w
57
54
  },
58
- children: /* @__PURE__ */ u("div", { className: o.inner, children: [
55
+ children: /* @__PURE__ */ k("div", { className: o.inner, children: [
59
56
  /* @__PURE__ */ n(e.modal, { ...e.props, close: () => t() }),
60
57
  e.props.showCloser !== !1 && /* @__PURE__ */ n(
61
- x,
58
+ v,
62
59
  {
63
60
  className: o.button,
64
61
  size: "s",
@@ -80,8 +77,8 @@ const k = {
80
77
  )
81
78
  ]
82
79
  }
83
- ) });
80
+ );
84
81
  };
85
82
  export {
86
- F as Modal
83
+ j as Modal
87
84
  };
@@ -11,14 +11,7 @@ const u = M.createContext({
11
11
  setModalDirty: () => {
12
12
  }
13
13
  }), h = ({ children: l, t: i, portal: o }) => {
14
- const {
15
- modals: r,
16
- openModal: t,
17
- setModalDirty: d,
18
- currentModalId: e,
19
- dirtyModals: n,
20
- closeModal: s
21
- } = f(i);
14
+ const { modals: r, openModal: t, setModalDirty: d, currentModalId: e, dirtyModals: n, closeModal: s } = f(i);
22
15
  return /* @__PURE__ */ m(
23
16
  u.Provider,
24
17
  {
@@ -29,7 +22,17 @@ const u = M.createContext({
29
22
  currentModalId: e
30
23
  },
31
24
  children: [
32
- /* @__PURE__ */ a(c, { getPortalContainer: o ? () => o : void 0, children: /* @__PURE__ */ a(p, { modals: r, dirtyModals: n, closeModal: s, openModal: t, setModalDirty: d, currentModalId: e }) }),
25
+ /* @__PURE__ */ a(c, { getPortalContainer: o ? () => o : void 0, children: /* @__PURE__ */ a(
26
+ p,
27
+ {
28
+ modals: r,
29
+ dirtyModals: n,
30
+ closeModal: s,
31
+ openModal: t,
32
+ setModalDirty: d,
33
+ currentModalId: e
34
+ }
35
+ ) }),
33
36
  l
34
37
  ]
35
38
  }
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { ModalObject, ModalSize, OwnModalProps, TFunction } from '../types';
3
3
  export declare const useModal: (t: TFunction) => {
4
- openModal: <T extends unknown>(modal: React.FC<T>, size?: ModalSize, showCloser?: boolean) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
4
+ openModal: <T>(modal: React.FC<T>, size?: ModalSize, showCloser?: boolean) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
5
5
  modals: ModalObject[];
6
6
  setModalDirty: (id: string, isDirty: boolean) => void;
7
7
  currentModalId: string;
@@ -1,42 +1,42 @@
1
- import n, { useEffect as I } from "react";
2
- import { v4 as S } from "uuid";
1
+ import n, { useCallback as I, useEffect as S } from "react";
2
+ import { v4 as b } from "uuid";
3
3
  import { deletePropertyById as g } from "../utils/delete-property-by-id.js";
4
4
  const x = (c) => {
5
- const [s, l] = n.useState([]), [u, M] = n.useState(""), [i, a] = n.useState({}), p = (t) => {
5
+ const [r, l] = n.useState([]), [u, M] = n.useState(""), [p, a] = n.useState({}), f = (t) => {
6
6
  a((o) => g(o, t)), l((o) => o.filter((e) => e.id !== t));
7
- }, m = (t) => {
7
+ }, i = (t) => {
8
8
  l((o) => [...o, t]);
9
- }, f = (t, o) => {
10
- a((e) => ({
9
+ }, m = I((t, o) => {
10
+ t && a((e) => e[t] === o ? e : {
11
11
  ...e,
12
12
  [t]: o
13
- }));
14
- };
15
- return I(() => {
16
- const t = [...s].pop()?.id;
17
- M(t || ""), document.body.style.overflow = s.length ? "hidden" : "unset";
18
- }, [s]), {
13
+ });
14
+ }, []);
15
+ return S(() => {
16
+ const t = [...r].pop()?.id;
17
+ M(t || ""), document.body.style.overflow = r.length ? "hidden" : "unset";
18
+ }, [r]), {
19
19
  openModal: (t, o = "s", e = !0) => {
20
- const y = (d, r) => ({
21
- id: S(),
20
+ const y = (s, d) => ({
21
+ id: b(),
22
22
  modal: t,
23
23
  props: {
24
24
  size: o,
25
25
  showCloser: e,
26
- closeCallback: r,
26
+ closeCallback: d,
27
27
  t: c,
28
- ...d
28
+ ...s
29
29
  }
30
30
  });
31
- return (d, r) => {
32
- m(y(d, r));
31
+ return (s, d) => {
32
+ i(y(s, d));
33
33
  };
34
34
  },
35
- modals: s,
36
- setModalDirty: f,
35
+ modals: r,
36
+ setModalDirty: m,
37
37
  currentModalId: u,
38
- dirtyModals: i,
39
- closeModal: p
38
+ dirtyModals: p,
39
+ closeModal: f
40
40
  };
41
41
  };
42
42
  export {
@@ -2,12 +2,7 @@ import { jsx as n } from "react/jsx-runtime";
2
2
  import { useEffect as m, Fragment as p } from "react";
3
3
  import { useMatchMedia as u } from "./use-match-media.js";
4
4
  import { isPointerEventsSupported as f, isTouchSupported as d } from "./utils.js";
5
- const e = typeof window < "u", S = e && (f() || d()), R = ({
6
- children: i,
7
- query: s = "",
8
- touch: r,
9
- onMatchChange: t
10
- }) => {
5
+ const e = typeof window < "u", S = e && (f() || d()), R = ({ children: i, query: s = "", touch: r, onMatchChange: t }) => {
11
6
  const [c] = u(s), o = (r === void 0 ? !0 : r === S) && (!s || c);
12
7
  return m(() => {
13
8
  t && t(o);