@alphakits/ui 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) 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 +46 -43
  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 +51 -56
  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/mq/component.js +1 -6
  107. package/dist/notification/component.js +14 -12
  108. package/dist/page-container/component.js +1 -6
  109. package/dist/page-loading/component.d.ts +1 -2
  110. package/dist/page-with-controls/component.js +4 -7
  111. package/dist/picker-button/common/labeled-button/index.js +18 -12
  112. package/dist/picker-button/component.js +5 -5
  113. package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
  114. package/dist/picker-button/field/index.d.ts +1 -1
  115. package/dist/picker-button/field/index.js +1 -1
  116. package/dist/picker-button/index.d.ts +1 -1
  117. package/dist/picker-button/index.js +4 -4
  118. package/dist/popover/component.d.ts +2 -2
  119. package/dist/popover/component.js +69 -63
  120. package/dist/radio/component.js +7 -7
  121. package/dist/radio-groups/component.d.ts +1 -2
  122. package/dist/radio-groups/component.js +9 -7
  123. package/dist/select/component.d.ts +8 -9
  124. package/dist/select/component.js +1 -9
  125. package/dist/select/components/arrow/component.d.ts +1 -2
  126. package/dist/select/components/base-select/component.js +97 -90
  127. package/dist/select/components/checkmark/component.d.ts +1 -2
  128. package/dist/select/components/field/component.d.ts +1 -2
  129. package/dist/select/components/field/component.js +8 -5
  130. package/dist/select/components/native-select/component.js +4 -11
  131. package/dist/select/components/optgroup/component.d.ts +1 -2
  132. package/dist/select/components/optgroup/component.js +4 -4
  133. package/dist/select/components/option/component.js +1 -1
  134. package/dist/select/components/options-list/component.d.ts +1 -2
  135. package/dist/select/components/options-list/component.js +25 -23
  136. package/dist/select/components/select-search/index.d.ts +1 -1
  137. package/dist/select/components/select-search/index.js +28 -26
  138. package/dist/select/components/virtual-options-list/component.d.ts +1 -2
  139. package/dist/select/components/virtual-options-list/component.js +52 -45
  140. package/dist/select/index.js +4 -4
  141. package/dist/select/presets/index.d.ts +1 -1
  142. package/dist/select/presets/index.js +4 -4
  143. package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
  144. package/dist/select/presets/use-lazy-loading/index.js +45 -43
  145. package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
  146. package/dist/select/presets/use-select-with-loading/hook.js +8 -1
  147. package/dist/select/utils.js +32 -32
  148. package/dist/sidepanel/component.js +21 -15
  149. package/dist/sidepanel-header/component.js +17 -16
  150. package/dist/skeleton/component.js +4 -4
  151. package/dist/space/component.d.ts +2 -2
  152. package/dist/space/component.js +42 -45
  153. package/dist/space/{Item.d.ts → item.d.ts} +2 -2
  154. package/dist/spinner/component.js +6 -5
  155. package/dist/stack/index.d.ts +1 -1
  156. package/dist/stack/index.js +5 -5
  157. package/dist/stepped-progress-bar/components/step-bar.js +3 -3
  158. package/dist/stepped-progress-bar/index.d.ts +2 -2
  159. package/dist/stepped-progress-bar/index.js +37 -22
  160. package/dist/sticker/component.js +1 -17
  161. package/dist/suffix-input/component.js +13 -13
  162. package/dist/switch/component.js +7 -7
  163. package/dist/table/components/cells/index.d.ts +1 -2
  164. package/dist/table/components/empty-list/index.d.ts +1 -2
  165. package/dist/table/components/error/index.d.ts +2 -3
  166. package/dist/table/components/error/index.js +1 -1
  167. package/dist/table/components/loading/index.d.ts +1 -1
  168. package/dist/table/components/loading/index.js +18 -12
  169. package/dist/table/components/pagination/index.js +56 -53
  170. package/dist/table/components/table-header/index.js +59 -56
  171. package/dist/table/hooks/use-table-data.js +63 -60
  172. package/dist/table/table.d.ts +1 -1
  173. package/dist/table/table.js +73 -73
  174. package/dist/table/types.d.ts +3 -3
  175. package/dist/table/utils/get-query-from-url.js +1 -8
  176. package/dist/table/utils/get-tags.d.ts +1 -1
  177. package/dist/table/utils/get-tags.js +9 -12
  178. package/dist/table/utils/index.d.ts +1 -1
  179. package/dist/table/utils/index.js +4 -4
  180. package/dist/table/utils/parse-query-params.js +5 -1
  181. package/dist/table/utils/prepare-rows.d.ts +1 -2
  182. package/dist/table/utils/prepare-rows.js +4 -3
  183. package/dist/table/utils/query-adapter.d.ts +1 -1
  184. package/dist/table/utils/query-adapter.js +5 -5
  185. package/dist/table/utils/remove-query-param.js +3 -1
  186. package/dist/table/utils/reset-query-param.js +16 -9
  187. package/dist/table-status/component.js +5 -1
  188. package/dist/textarea/component.js +36 -28
  189. package/dist/theme-provider/component.js +33 -29
  190. package/dist/toast/component.d.ts +7 -8
  191. package/dist/toast/component.js +65 -63
  192. package/dist/toast-notifier/component.js +13 -13
  193. package/dist/toast-notifier/use-timer.d.ts +1 -1
  194. package/dist/toast-notifier/use-timer.js +5 -5
  195. package/dist/toast-plate/component.d.ts +3 -3
  196. package/dist/toast-plate/component.js +7 -7
  197. package/dist/tooltip/component.js +35 -35
  198. package/dist/tooltip/node-resolver.js +7 -7
  199. package/dist/typings/api.d.ts +3 -5
  200. package/dist/typography/colors.d.ts +1 -1
  201. package/dist/typography/title/component.d.ts +3 -3
  202. package/dist/typography/title/index.d.ts +1 -1
  203. package/dist/typography/title/index.js +3 -3
  204. package/dist/utils/date/index.js +12 -2
  205. package/dist/utils/index.d.ts +2 -2
  206. package/dist/utils/index.js +14 -14
  207. package/dist/utils/split-amount/util.js +4 -4
  208. package/dist/with-suffix/component.d.ts +13 -13
  209. package/dist/with-suffix/component.js +8 -8
  210. package/package.json +9 -34
  211. /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
  212. /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
  213. /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  214. /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  215. /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
  216. /package/dist/picker-button/field/{Component.js → component.js} +0 -0
  217. /package/dist/space/{Item.js → item.js} +0 -0
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { PopoverProps } from '../popover';
3
2
  import { ToastPlateProps } from '../toast-plate';
4
3
  export type ToastProps = ToastPlateProps & Pick<PopoverProps, 'position' | 'offset' | 'open' | 'getPortalContainer' | 'preventFlip' | 'transition'> & {
@@ -7,21 +6,21 @@ export type ToastProps = ToastPlateProps & Pick<PopoverProps, 'position' | 'offs
7
6
  onClose: () => void;
8
7
  bottomOffset?: number;
9
8
  };
10
- export declare const Toast: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
9
+ export declare const Toast: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
11
10
  className?: string | undefined;
12
11
  contentClassName?: string | undefined;
13
- children?: React.ReactNode;
14
- title?: React.ReactNode;
12
+ children?: import('react').ReactNode;
13
+ title?: import('react').ReactNode;
15
14
  view: "attention" | "positive" | "negative" | "default" | "black" | "neutral";
16
- leftAddons?: React.ReactNode;
17
- bottomAddons?: React.ReactNode;
15
+ leftAddons?: import('react').ReactNode;
16
+ bottomAddons?: import('react').ReactNode;
18
17
  dataTestId?: string | undefined;
19
18
  hasCloser?: boolean | undefined;
20
19
  block?: boolean | undefined;
21
- onClose?: ((event?: React.MouseEvent<HTMLButtonElement, MouseEvent> | undefined) => void) | undefined;
20
+ onClose?: ((event?: import('react').MouseEvent<HTMLButtonElement, MouseEvent> | undefined) => void) | undefined;
22
21
  } & Pick<PopoverProps, "open" | "getPortalContainer" | "transition" | "offset" | "position" | "preventFlip"> & {
23
22
  anchorElement?: HTMLElement | undefined;
24
23
  autoCloseDelay?: number | undefined;
25
24
  onClose: () => void;
26
25
  bottomOffset?: number | undefined;
27
- } & React.RefAttributes<HTMLDivElement>>;
26
+ } & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,99 +1,101 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as L, useRef as O, useCallback as i, useEffect as M } from "react";
3
- import $ from "react-merge-refs";
4
- import { CSSTransition as g } from "react-transition-group";
5
- import k from "classnames";
6
- import { useClickOutside as q } from "../hooks/useClickOutside/index.js";
7
- import { usePrevious as y } from "../hooks/usePrevious/index.js";
8
- import { Popover as z } from "../popover/component.js";
9
- import { Portal as B } from "../portal/component.js";
10
- import { ToastPlate as w } from "../toast-plate/component.js";
11
- import r from "./index.module.css.js";
12
- const F = {
13
- enter: r.enter,
14
- enterActive: r.enterActive,
15
- exit: r.exit,
16
- exitActive: r.exitActive
17
- }, D = L(
2
+ import I from "classnames";
3
+ import { forwardRef as $, useRef as l, useCallback as i, useEffect as g } from "react";
4
+ import P from "react-merge-refs";
5
+ import { CSSTransition as q } from "react-transition-group";
6
+ import { useClickOutside as y } from "../hooks/useClickOutside/index.js";
7
+ import { usePrevious as z } from "../hooks/usePrevious/index.js";
8
+ import { Popover as B } from "../popover/component.js";
9
+ import { Portal as F } from "../portal/component.js";
10
+ import { ToastPlate as _ } from "../toast-plate/component.js";
11
+ import e from "./index.module.css.js";
12
+ const G = {
13
+ enter: e.enter,
14
+ enterActive: e.enterActive,
15
+ exit: e.exit,
16
+ exitActive: e.exitActive
17
+ }, tt = $(
18
18
  ({
19
- anchorElement: a,
20
- position: I,
21
- offset: P,
22
- open: e,
23
- autoCloseDelay: l = 3e3,
24
- className: d,
25
- bottomOffset: T,
26
- style: x = {},
27
- block: v,
19
+ anchorElement: d,
20
+ position: E,
21
+ offset: b,
22
+ open: r,
23
+ autoCloseDelay: T = 3e3,
24
+ className: x,
25
+ bottomOffset: v,
26
+ style: S = {},
27
+ block: A,
28
28
  onMouseEnter: n,
29
29
  onMouseLeave: f,
30
30
  onTouchStart: u,
31
31
  onClose: o,
32
- getPortalContainer: S,
33
- ...A
34
- }, _) => {
35
- const h = O(null), p = O(0), N = y(e), c = i(() => {
36
- clearTimeout(p.current), p.current = window.setTimeout(o, l);
37
- }, [l, o]), t = i(() => {
32
+ getPortalContainer: R,
33
+ ...h
34
+ }, N) => {
35
+ const a = l(null), O = l(null), p = l(0), k = z(r), c = i(() => {
36
+ clearTimeout(p.current), p.current = window.setTimeout(o, T);
37
+ }, [T, o]), t = i(() => {
38
38
  clearTimeout(p.current);
39
- }, []), E = i(
39
+ }, []), j = i(
40
40
  (m) => {
41
41
  t(), n && n(m);
42
42
  },
43
43
  [n, t]
44
- ), b = i(
44
+ ), C = i(
45
45
  (m) => {
46
46
  c(), f && f(m);
47
47
  },
48
48
  [f, c]
49
- ), j = i(
49
+ ), L = i(
50
50
  (m) => {
51
51
  t(), u && u(m);
52
52
  },
53
53
  [u, t]
54
- ), C = i(() => {
54
+ ), M = i(() => {
55
55
  o(), t();
56
56
  }, [o, t]);
57
- q(h, C), M(() => (e !== N && e && c(), () => {
57
+ y(a, M), g(() => (r !== k && r && c(), () => {
58
58
  t();
59
- }), [e, N, c, t]);
60
- const R = {
61
- block: v,
59
+ }), [r, k, c, t]);
60
+ const w = {
61
+ block: A,
62
62
  onClose: o,
63
- onMouseEnter: E,
64
- onMouseLeave: b,
65
- onTouchStart: j,
66
- ref: $([_, h])
63
+ onMouseEnter: j,
64
+ onMouseLeave: C,
65
+ onTouchStart: L,
66
+ ref: P([N, a])
67
67
  };
68
- return a ? /* @__PURE__ */ s(
69
- z,
68
+ return d ? /* @__PURE__ */ s(
69
+ B,
70
70
  {
71
- open: e,
72
- anchorElement: a,
73
- position: I,
74
- offset: P,
75
- popperClassName: k(r.popover, { [r.block]: v }),
71
+ open: r,
72
+ anchorElement: d,
73
+ position: E,
74
+ offset: b,
75
+ popperClassName: I(e.popover, { [e.block]: A }),
76
76
  transition: { timeout: 150 },
77
- getPortalContainer: S,
78
- children: /* @__PURE__ */ s(w, { ...A, style: x, className: d, ...R })
77
+ getPortalContainer: R,
78
+ children: /* @__PURE__ */ s(_, { ...h, style: S, className: x, ...w })
79
79
  }
80
- ) : /* @__PURE__ */ s(B, { getPortalContainer: S, children: /* @__PURE__ */ s(
81
- g,
80
+ ) : /* @__PURE__ */ s(F, { getPortalContainer: R, children: /* @__PURE__ */ s(
81
+ q,
82
82
  {
83
83
  unmountOnExit: !0,
84
- in: e,
84
+ in: r,
85
85
  timeout: 150,
86
- classNames: F,
86
+ classNames: G,
87
+ nodeRef: O,
87
88
  children: /* @__PURE__ */ s(
88
- w,
89
+ _,
89
90
  {
90
- ...A,
91
- className: k(r.fixed, r.toastPlate, d),
91
+ ...h,
92
+ className: I(e.fixed, e.toastPlate, x),
92
93
  style: {
93
- ...x,
94
- bottom: T && `${T}px`
94
+ ...S,
95
+ bottom: v && `${v}px`
95
96
  },
96
- ...R
97
+ ...w,
98
+ ref: P([N, a, O])
97
99
  }
98
100
  )
99
101
  }
@@ -101,5 +103,5 @@ const F = {
101
103
  }
102
104
  );
103
105
  export {
104
- D as Toast
106
+ tt as Toast
105
107
  };
@@ -1,13 +1,13 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
- import { createRoot as C } from "react-dom/client";
3
- import g from "classnames";
2
+ import C from "classnames";
3
+ import { createRoot as g } from "react-dom/client";
4
4
  import { ToastPlate as y } from "../toast-plate/component.js";
5
- import { useTimer as w } from "./use-timer.js";
6
5
  import o from "./index.module.css.js";
6
+ import { createTimer as w } from "./use-timer.js";
7
7
  let e;
8
8
  typeof window < "u" && (e = document.createElement("div"), e.setAttribute("id", "toast_manager"), document.body.appendChild(e));
9
9
  const z = ({
10
- className: a,
10
+ className: m,
11
11
  children: E,
12
12
  offset: n = 108,
13
13
  hasCloser: l = !0,
@@ -21,18 +21,18 @@ const z = ({
21
21
  ...f
22
22
  }) => {
23
23
  if (typeof window > "u") return null;
24
- const s = window.innerWidth > 600, h = () => {
25
- const m = "position: fixed; z-index: 999999999;";
26
- return s ? `${m} ${p}: ${n}px; right: 30px` : `${m} top: ${n}px; right: 30px; left: 30px`;
24
+ const r = window.innerWidth > 600, h = () => {
25
+ const a = "position: fixed; z-index: 999999999;";
26
+ return r ? `${a} ${p}: ${n}px; right: 30px` : `${a} top: ${n}px; right: 30px; left: 30px`;
27
27
  };
28
28
  e.setAttribute("style", h());
29
29
  const t = document.createElement("div");
30
30
  t.classList.remove(o.isClosing), t.setAttribute("id", `toast_wrap-${Math.random()}`), t.setAttribute("style", "margin-bottom: 18px"), e.appendChild(t);
31
- const i = C(t), r = () => {
31
+ const i = g(t), s = () => {
32
32
  t.classList.add(o.isClosing), setTimeout(() => {
33
33
  i.unmount(), e?.removeChild(t);
34
34
  }, 300);
35
- }, { pause: v, resume: x } = w(r, c);
35
+ }, { pause: v, resume: x } = w(s, c);
36
36
  return t.addEventListener("mouseenter", () => {
37
37
  v();
38
38
  }), t.addEventListener("mouseleave", () => {
@@ -42,12 +42,12 @@ const z = ({
42
42
  y,
43
43
  {
44
44
  hasCloser: l,
45
- className: g(
45
+ className: C(
46
46
  {
47
47
  [o.isVisible]: !0,
48
- [o.mobile]: !s
48
+ [o.mobile]: !r
49
49
  },
50
- a
50
+ m
51
51
  ),
52
52
  contentClassName: o.toastContent,
53
53
  style: {
@@ -56,7 +56,7 @@ const z = ({
56
56
  ...u
57
57
  },
58
58
  role: "alert",
59
- onClose: r,
59
+ onClose: s,
60
60
  ...f,
61
61
  children: d
62
62
  }
@@ -1,4 +1,4 @@
1
- export declare const useTimer: (fn: () => void, countdown: number) => {
1
+ export declare const createTimer: (fn: () => void, countdown: number) => {
2
2
  cancel: () => void;
3
3
  pause: () => void;
4
4
  resume: () => void;
@@ -1,13 +1,13 @@
1
- const n = (s, e) => {
1
+ const u = (s, e) => {
2
2
  let t, i = !1;
3
- const a = (/* @__PURE__ */ new Date()).getTime(), m = ((T, u) => (/* @__PURE__ */ new Date()).getTime() - T)(a), c = () => {
3
+ const a = Date.now(), m = ((r, n) => Date.now() - r)(a), c = () => {
4
4
  clearTimeout(t);
5
- }, r = () => {
5
+ }, o = () => {
6
6
  clearTimeout(t), i = m >= e;
7
7
  };
8
8
  return t = setTimeout(s, e), {
9
9
  cancel: c,
10
- pause: r,
10
+ pause: o,
11
11
  resume: () => {
12
12
  t = i ? -1 : setTimeout(s, e - m);
13
13
  },
@@ -15,5 +15,5 @@ const n = (s, e) => {
15
15
  };
16
16
  };
17
17
  export {
18
- n as useTimer
18
+ u as createTimer
19
19
  };
@@ -1,4 +1,4 @@
1
- import { default as React, HTMLAttributes, MouseEvent, ReactNode } from 'react';
1
+ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
2
  export type ToastPlateProps = HTMLAttributes<HTMLDivElement> & {
3
3
  className?: string;
4
4
  contentClassName?: string;
@@ -12,7 +12,7 @@ export type ToastPlateProps = HTMLAttributes<HTMLDivElement> & {
12
12
  block?: boolean;
13
13
  onClose?: (event?: MouseEvent<HTMLButtonElement>) => void;
14
14
  };
15
- export declare const ToastPlate: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
15
+ export declare const ToastPlate: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
16
16
  className?: string | undefined;
17
17
  contentClassName?: string | undefined;
18
18
  children?: ReactNode;
@@ -24,4 +24,4 @@ export declare const ToastPlate: React.ForwardRefExoticComponent<React.HTMLAttri
24
24
  hasCloser?: boolean | undefined;
25
25
  block?: boolean | undefined;
26
26
  onClose?: ((event?: MouseEvent<HTMLButtonElement>) => void) | undefined;
27
- } & React.RefAttributes<HTMLDivElement>>;
27
+ } & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,13 +1,13 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { forwardRef as M, useCallback as g } from "react";
3
2
  import f from "@alphakits/icons/dist/AlertCircleM";
4
- import j from "@alphakits/icons/dist/CheckmarkCircleM";
3
+ import M from "@alphakits/icons/dist/CheckmarkCircleM";
5
4
  import p from "@alphakits/icons/dist/ClockCircleM";
6
- import A from "@alphakits/icons/dist/CloseS";
5
+ import g from "@alphakits/icons/dist/CloseS";
7
6
  import o from "classnames";
7
+ import { forwardRef as j, useCallback as A } from "react";
8
8
  import { Button as B } from "../button/component.js";
9
9
  import r from "./index.module.css.js";
10
- const E = M(
10
+ const E = j(
11
11
  ({
12
12
  dataTestId: h,
13
13
  className: k,
@@ -25,11 +25,11 @@ const E = M(
25
25
  const l = {
26
26
  negative: /* @__PURE__ */ e(f, {}),
27
27
  attention: /* @__PURE__ */ e(f, {}),
28
- positive: /* @__PURE__ */ e(j, {}),
28
+ positive: /* @__PURE__ */ e(M, {}),
29
29
  default: /* @__PURE__ */ e(p, {}),
30
30
  neutral: /* @__PURE__ */ e(p, {}),
31
31
  black: null
32
- }, b = g(
32
+ }, b = A(
33
33
  (x) => {
34
34
  a && a(x);
35
35
  },
@@ -65,7 +65,7 @@ const E = M(
65
65
  view: "ghost",
66
66
  onClick: b,
67
67
  "aria-label": "закрыть",
68
- leftAddons: /* @__PURE__ */ e(A, {})
68
+ leftAddons: /* @__PURE__ */ e(g, {})
69
69
  }
70
70
  )
71
71
  ] })
@@ -1,19 +1,19 @@
1
1
  import { jsxs as X, jsx as l } from "react/jsx-runtime";
2
- import f, { useState as M, useRef as Y, useCallback as C, useEffect as Z, cloneElement as _ } from "react";
3
- import m from "classnames";
2
+ import f from "classnames";
3
+ import m, { useState as C, useRef as Y, useCallback as d, useEffect as Z, cloneElement as _ } from "react";
4
4
  import { Popover as $ } from "../popover/component.js";
5
+ import T from "./index.module.css.js";
5
6
  import { NodeResolver as D } from "./node-resolver.js";
6
- import d from "./index.module.css.js";
7
7
  const ce = ({
8
8
  children: t,
9
9
  content: O,
10
- trigger: T = "hover",
11
- onCloseDelay: v = 300,
10
+ trigger: v = "hover",
11
+ onCloseDelay: g = 300,
12
12
  onOpenDelay: b = 300,
13
13
  dataTestId: E,
14
- onClose: u,
15
- onOpen: g,
16
- open: a,
14
+ onClose: c,
15
+ onOpen: h,
16
+ open: u,
17
17
  getPortalContainer: N,
18
18
  offset: P = [0, 10],
19
19
  position: S,
@@ -22,47 +22,47 @@ const ce = ({
22
22
  popoverClassName: j,
23
23
  updatePopover: L
24
24
  }) => {
25
- const [n, h] = M(!!a), [k, A] = M(null), c = f.useRef(null), i = f.useRef(null), o = Y(0), p = () => {
26
- n || (h(!0), g && g());
27
- }, s = C(() => {
28
- n && (h(!1), u && u());
29
- }, [u, n]), B = () => {
30
- n ? s() : p();
31
- }, w = (e) => !(c.current && c.current.contains(e) || i.current && i.current.contains(e));
25
+ const [n, k] = C(!!u), [w, A] = C(null), a = m.useRef(null), R = m.useRef(null), o = Y(0), i = () => {
26
+ n || (k(!0), h && h());
27
+ }, s = d(() => {
28
+ n && (k(!1), c && c());
29
+ }, [c, n]), B = () => {
30
+ n ? s() : i();
31
+ }, p = d((e) => !(a.current?.contains(e) || R.current?.contains(e)), []);
32
32
  Z(() => {
33
33
  const e = (r) => {
34
34
  const W = r.target;
35
- w(W) && s();
35
+ p(W) && s();
36
36
  };
37
37
  return document.body.addEventListener("click", e), () => {
38
38
  document.body.removeEventListener("click", e), clearTimeout(o.current);
39
39
  };
40
- }, [s]);
40
+ }, [s, p]);
41
41
  const F = (e) => {
42
42
  t.props.onClick && t.props.onClick(e), B();
43
43
  }, H = (e) => {
44
44
  t.props.onMouseOver && t.props.onMouseOver(e), clearTimeout(o.current), o.current = window.setTimeout(() => {
45
- p();
45
+ i();
46
46
  }, b);
47
47
  }, V = (e) => {
48
48
  t.props.onMouseOut && t.props.onMouseOut(e), clearTimeout(o.current), o.current = window.setTimeout(() => {
49
49
  s();
50
- }, v);
50
+ }, g);
51
51
  }, q = (e) => {
52
52
  t.props.onTouchStart && t.props.onTouchStart(e);
53
53
  const r = e.target;
54
- clearTimeout(o.current), w(r) ? o.current = window.setTimeout(() => {
54
+ clearTimeout(o.current), p(r) ? o.current = window.setTimeout(() => {
55
55
  s();
56
- }, v) : p();
57
- }, z = { onClick: F }, R = {
56
+ }, g) : i();
57
+ }, z = { onClick: F }, M = {
58
58
  onMouseOver: H,
59
59
  onMouseOut: V,
60
60
  onTouchStart: q
61
61
  }, G = (e) => {
62
62
  const r = {
63
- className: m(d.target, e.className)
63
+ className: f(T.target, e.className)
64
64
  };
65
- switch (T) {
65
+ switch (v) {
66
66
  case "click":
67
67
  return {
68
68
  ...r,
@@ -71,22 +71,22 @@ const ce = ({
71
71
  case "hover":
72
72
  return {
73
73
  ...r,
74
- ...R
74
+ ...M
75
75
  };
76
76
  default:
77
77
  return {};
78
78
  }
79
79
  }, I = () => {
80
80
  const e = {
81
- ref: i,
81
+ ref: R,
82
82
  "data-test-id": E,
83
- className: m(d.component, x)
83
+ className: f(T.component, x)
84
84
  };
85
- switch (T) {
85
+ switch (v) {
86
86
  case "hover":
87
87
  return {
88
88
  ...e,
89
- ...R
89
+ ...M
90
90
  };
91
91
  default:
92
92
  return e;
@@ -97,19 +97,19 @@ const ce = ({
97
97
  }, K = () => {
98
98
  const e = I();
99
99
  return /* @__PURE__ */ l("div", { ...e, children: O });
100
- }, Q = a === void 0 ? n : a, U = C((e) => {
101
- c.current = e, A(c.current);
100
+ }, Q = u === void 0 ? n : u, U = d((e) => {
101
+ a.current = e, A(a.current);
102
102
  }, []);
103
- return /* @__PURE__ */ X(f.Fragment, { children: [
103
+ return /* @__PURE__ */ X(m.Fragment, { children: [
104
104
  /* @__PURE__ */ l(D, { innerRef: U, children: J() }),
105
- k && /* @__PURE__ */ l(
105
+ w && /* @__PURE__ */ l(
106
106
  $,
107
107
  {
108
- anchorElement: k,
108
+ anchorElement: w,
109
109
  open: Q,
110
110
  getPortalContainer: N,
111
111
  arrowClassName: y,
112
- popperClassName: m(d.popper, j),
112
+ popperClassName: f(T.popper, j),
113
113
  offset: P,
114
114
  withArrow: !0,
115
115
  position: S,
@@ -1,12 +1,12 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { useRef as n, useEffect as l } from "react";
3
- const p = ({ innerRef: e, children: t }) => {
4
- const o = n(null);
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useRef as s, useEffect as l } from "react";
3
+ const f = ({ innerRef: e, children: n }) => {
4
+ const t = s(null);
5
5
  return l(() => {
6
- const r = o.current?.firstElementChild;
6
+ const r = t.current?.firstElementChild;
7
7
  return e(r instanceof HTMLElement ? r : null), () => e(null);
8
- }, [e, t]), /* @__PURE__ */ s("span", { ref: o, style: { display: "contents" }, children: t });
8
+ }, [e]), /* @__PURE__ */ o("span", { ref: t, style: { display: "contents" }, children: n });
9
9
  };
10
10
  export {
11
- p as NodeResolver
11
+ f as NodeResolver
12
12
  };
@@ -9,10 +9,8 @@ export type ApiDeclaration<T> = {
9
9
  export type Api<T> = {
10
10
  [P in keyof T]: MakeServiceFromServiceDeclaration<ExtendServiceParams<T[P]>>;
11
11
  };
12
- export type MakeServiceFromServiceDeclaration<T> = {
13
- (params: ExtractApiMethodParamsType<T>): AxiosPromise<ExtractApiMethodResponseDataType<T>>;
14
- };
15
- type ExtractApiMethodResponseDataType<T> = T extends ApiMethodDeclaration<infer P, infer D> ? D : any;
16
- type ExtractApiMethodParamsType<T> = T extends ApiMethodDeclaration<infer P, infer D> ? P : any;
12
+ export type MakeServiceFromServiceDeclaration<T> = (params: ExtractApiMethodParamsType<T>) => AxiosPromise<ExtractApiMethodResponseDataType<T>>;
13
+ type ExtractApiMethodResponseDataType<T> = T extends ApiMethodDeclaration<infer _P, infer D> ? D : any;
14
+ type ExtractApiMethodParamsType<T> = T extends ApiMethodDeclaration<infer P, infer _D> ? P : any;
17
15
  export type ExtendServiceParams<T> = ApiMethodDeclaration<ExtractApiMethodParamsType<T>, ExtractApiMethodResponseDataType<T>>;
18
16
  export {};
@@ -1,2 +1,2 @@
1
1
  export declare const colors: readonly ["tertiary", "disabled", "accent", "primary", "attention", "positive", "secondary", "tertiary-inverted", "primary-inverted", "secondary-inverted", "link", "negative"];
2
- export type Color = typeof colors[number];
2
+ export type Color = (typeof colors)[number];
@@ -1,4 +1,4 @@
1
- import { default as React, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { Color } from '../colors';
3
3
  export type TitleProps = {
4
4
  tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
@@ -10,12 +10,12 @@ export type TitleProps = {
10
10
  through?: boolean;
11
11
  className?: string;
12
12
  dataTestId?: string;
13
- children: ReactNode;
13
+ children?: ReactNode;
14
14
  };
15
15
  type Styles = {
16
16
  styles: {
17
17
  [key: string]: string;
18
18
  };
19
19
  };
20
- export declare const Title: ({ tag: Component, view, weight, defaultMargins, color, className, dataTestId, uppercase, through, children, styles, }: TitleProps & Styles) => React.JSX.Element;
20
+ export declare const Title: ({ tag: Component, view, weight, defaultMargins, color, className, dataTestId, uppercase, through, children, styles, }: TitleProps & Styles) => import("react/jsx-runtime").JSX.Element;
21
21
  export {};
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { TitleProps } from './component';
3
3
  declare const Title: FC<TitleProps>;
4
- export { Title };
5
4
  export type { TitleProps };
5
+ export { Title };
@@ -1,13 +1,13 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { Title as m } from "./component.js";
3
- import r from "./common.module.css.js";
2
+ import m from "./common.module.css.js";
3
+ import { Title as r } from "./component.js";
4
4
  import s from "./index.module.css.js";
5
5
  const f = (o) => (
6
6
  /**
7
7
  * Если поменять Object.assign на деструктуризацию, то упадут тесты.
8
8
  * Видимо, это особенность работы jest и css-modules.
9
9
  */
10
- /* @__PURE__ */ t(m, { ...o, styles: { ...r, ...s } })
10
+ /* @__PURE__ */ t(r, { ...o, styles: { ...m, ...s } })
11
11
  );
12
12
  export {
13
13
  f as Title
@@ -49,7 +49,15 @@ function b(t, e) {
49
49
  }
50
50
  function f(t, e) {
51
51
  const n = t.getDate(), r = t.getFullYear(), a = t.getMonth() + e, o = Math.min(n, b(r, a));
52
- return new Date(r, a, o, t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds());
52
+ return new Date(
53
+ r,
54
+ a,
55
+ o,
56
+ t.getHours(),
57
+ t.getMinutes(),
58
+ t.getSeconds(),
59
+ t.getMilliseconds()
60
+ );
53
61
  }
54
62
  function B(t, e) {
55
63
  return f(t, -e);
@@ -139,7 +147,9 @@ function tt(t) {
139
147
  );
140
148
  }
141
149
  function y(t, e, n) {
142
- return new Intl.DateTimeFormat(e, { day: "numeric", month: n }).formatToParts(t).find((o) => o.type === "month")?.value ?? new Intl.DateTimeFormat(e, { month: n }).format(t);
150
+ return new Intl.DateTimeFormat(e, { day: "numeric", month: n }).formatToParts(
151
+ t
152
+ ).find((o) => o.type === "month")?.value ?? new Intl.DateTimeFormat(e, { month: n }).format(t);
143
153
  }
144
154
  function h(t, e, n) {
145
155
  return new Intl.DateTimeFormat(e, { month: n }).format(t);
@@ -1,8 +1,8 @@
1
1
  export * from './date';
2
2
  export * from './debounce';
3
- export * from './safe-stringify';
4
3
  export * from './format-amount/util';
4
+ export * from './format-date';
5
+ export * from './safe-stringify';
5
6
  export * from './show-toast';
6
7
  export * from './split-amount/util';
7
- export * from './format-date';
8
8
  export * from './string';