@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,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,8 +1,8 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
+ import I from "classnames";
2
3
  import { forwardRef as $, useRef as l, useCallback as i, useEffect as g } from "react";
3
- import I from "react-merge-refs";
4
+ import P from "react-merge-refs";
4
5
  import { CSSTransition as q } from "react-transition-group";
5
- import P from "classnames";
6
6
  import { useClickOutside as y } from "../hooks/useClickOutside/index.js";
7
7
  import { usePrevious as z } from "../hooks/usePrevious/index.js";
8
8
  import { Popover as B } from "../popover/component.js";
@@ -63,7 +63,7 @@ const G = {
63
63
  onMouseEnter: j,
64
64
  onMouseLeave: C,
65
65
  onTouchStart: L,
66
- ref: I([N, a])
66
+ ref: P([N, a])
67
67
  };
68
68
  return d ? /* @__PURE__ */ s(
69
69
  B,
@@ -72,7 +72,7 @@ const G = {
72
72
  anchorElement: d,
73
73
  position: E,
74
74
  offset: b,
75
- popperClassName: P(e.popover, { [e.block]: A }),
75
+ popperClassName: I(e.popover, { [e.block]: A }),
76
76
  transition: { timeout: 150 },
77
77
  getPortalContainer: R,
78
78
  children: /* @__PURE__ */ s(_, { ...h, style: S, className: x, ...w })
@@ -89,13 +89,13 @@ const G = {
89
89
  _,
90
90
  {
91
91
  ...h,
92
- className: P(e.fixed, e.toastPlate, x),
92
+ className: I(e.fixed, e.toastPlate, x),
93
93
  style: {
94
94
  ...S,
95
95
  bottom: v && `${v}px`
96
96
  },
97
97
  ...w,
98
- ref: I([N, a, O])
98
+ ref: P([N, a, O])
99
99
  }
100
100
  )
101
101
  }
@@ -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';
@@ -1,14 +1,14 @@
1
1
  import { add as r, addDays as t, addMonths as s, addYears as o, eachDayOfInterval as f, eachMonthOfInterval as n, eachYearOfInterval as i, endOfDay as O, endOfISOWeek as m, endOfWeek as h, endOfYear as d, format as p, isAfter as S, isBefore as y, isEqual as M, isLastDayOfMonth as l, isSameDay as D, isSameMonth as u, isSameYear as x, isThisMonth as I, isThisYear as c, isToday as A, isWithinInterval as T, lastDayOfMonth as Y, max as k, min as W, parse as b, parseISO as R, startOfDay as v, startOfISOWeek as _, startOfMonth as w, startOfWeek as E, startOfYear as N, subDays as P, subMonths as g, subWeeks as q, subYears as z, weekDaysShort as B } from "./date/index.js";
2
2
  import { debounce as J } from "./debounce.js";
3
- import { safeStringify as U } from "./safe-stringify.js";
4
- import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as C, THINSP as F, formatAmount as G } from "./format-amount/util.js";
5
- import { showError as Q, showSuccess as V } from "./show-toast/index.js";
6
- import { splitAmount as Z } from "./split-amount/util.js";
7
- import { formatDate as ee, locales as ae } from "./format-date/index.js";
3
+ import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as U, THINSP as j, formatAmount as C } from "./format-amount/util.js";
4
+ import { formatDate as G, locales as K } from "./format-date/index.js";
5
+ import { safeStringify as V } from "./safe-stringify.js";
6
+ import { showError as Z, showSuccess as $ } from "./show-toast/index.js";
7
+ import { splitAmount as ae } from "./split-amount/util.js";
8
8
  import { capitalize as te } from "./string.js";
9
9
  export {
10
- C as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
11
- F as THINSP,
10
+ U as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
11
+ j as THINSP,
12
12
  r as add,
13
13
  t as addDays,
14
14
  s as addMonths,
@@ -23,8 +23,8 @@ export {
23
23
  h as endOfWeek,
24
24
  d as endOfYear,
25
25
  p as format,
26
- G as formatAmount,
27
- ee as formatDate,
26
+ C as formatAmount,
27
+ G as formatDate,
28
28
  S as isAfter,
29
29
  y as isBefore,
30
30
  M as isEqual,
@@ -37,15 +37,15 @@ export {
37
37
  A as isToday,
38
38
  T as isWithinInterval,
39
39
  Y as lastDayOfMonth,
40
- ae as locales,
40
+ K as locales,
41
41
  k as max,
42
42
  W as min,
43
43
  b as parse,
44
44
  R as parseISO,
45
- U as safeStringify,
46
- Q as showError,
47
- V as showSuccess,
48
- Z as splitAmount,
45
+ V as safeStringify,
46
+ Z as showError,
47
+ $ as showSuccess,
48
+ ae as splitAmount,
49
49
  v as startOfDay,
50
50
  _ as startOfISOWeek,
51
51
  w as startOfMonth,
@@ -1,7 +1,7 @@
1
- const r = (e, n = 3, p, l = 4) => {
2
- const g = `\\B(?=(\\d{${n}})+(?!\\d))`;
3
- return e.length < l ? e : (console.log({ pp: e.replace(new RegExp(g, "g"), p) }), e.replace(new RegExp(g, "g"), p));
1
+ const g = (e, t = 3, n, p = 4) => {
2
+ const r = `\\B(?=(\\d{${t}})+(?!\\d))`;
3
+ return e.length < p ? e : e.replace(new RegExp(r, "g"), n);
4
4
  };
5
5
  export {
6
- r as splitAmount
6
+ g as splitAmount
7
7
  };
@@ -1,10 +1,10 @@
1
- import { default as React, FC, ReactNode, RefAttributes } from 'react';
1
+ import { FC, ReactNode, RefAttributes } from 'react';
2
2
  import { InputProps } from '../input';
3
3
  export type WithSuffixProps = InputProps & {
4
4
  suffix?: ReactNode;
5
5
  suffixContainerClassName?: string;
6
6
  };
7
- export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "type" | "size"> & {
7
+ export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "type" | "size"> & {
8
8
  value?: string | undefined;
9
9
  defaultValue?: string | undefined;
10
10
  block?: boolean | undefined;
@@ -14,12 +14,12 @@ export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInput
14
14
  error?: string | boolean | undefined;
15
15
  success?: boolean | undefined;
16
16
  hint?: string | undefined;
17
- label?: React.ReactNode;
17
+ label?: ReactNode;
18
18
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
19
- wrapperRef?: React.Ref<HTMLDivElement> | undefined;
20
- leftAddons?: React.ReactNode;
21
- rightAddons?: React.ReactNode;
22
- bottomAddons?: React.ReactNode;
19
+ wrapperRef?: import('react').Ref<HTMLDivElement> | undefined;
20
+ leftAddons?: ReactNode;
21
+ rightAddons?: ReactNode;
22
+ bottomAddons?: ReactNode;
23
23
  className?: string | undefined;
24
24
  fieldClassName?: string | undefined;
25
25
  inputClassName?: string | undefined;
@@ -27,15 +27,15 @@ export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInput
27
27
  addonsClassName?: string | undefined;
28
28
  focusedClassName?: string | undefined;
29
29
  filledClassName?: string | undefined;
30
- onChange?: ((event: React.ChangeEvent<HTMLInputElement, Element>, payload: {
30
+ onChange?: ((event: import('react').ChangeEvent<HTMLInputElement, Element>, payload: {
31
31
  value: string;
32
32
  }) => void) | undefined;
33
- onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
34
- onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
35
- onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
36
- onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
33
+ onClear?: ((event: import('react').MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
34
+ onClick?: ((event: import('react').MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
35
+ onMouseDown?: ((event: import('react').MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
36
+ onMouseUp?: ((event: import('react').MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
37
37
  dataTestId?: string | undefined;
38
38
  } & {
39
39
  suffix?: ReactNode;
40
40
  suffixContainerClassName?: string | undefined;
41
- } & React.RefAttributes<HTMLInputElement>>;
41
+ } & RefAttributes<HTMLInputElement>>;