@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,2 +1,2 @@
1
- export * from './getDataTestId';
2
1
  export * from './clear-text';
2
+ export * from './get-data-test-id';
@@ -1,6 +1,6 @@
1
- import { getDataTestId as r } from "./getDataTestId.js";
2
- import { clearText as a } from "./clear-text.js";
1
+ import { clearText as r } from "./clear-text.js";
2
+ import { getDataTestId as a } from "./get-data-test-id.js";
3
3
  export {
4
- a as clearText,
5
- r as getDataTestId
4
+ r as clearText,
5
+ a as getDataTestId
6
6
  };
@@ -1,23 +1,23 @@
1
- import { jsx as F, jsxs as v } from "react/jsx-runtime";
1
+ import { jsx as F, jsxs as x } from "react/jsx-runtime";
2
+ import C from "classnames";
2
3
  import { forwardRef as T, useState as z, useEffect as D, useCallback as G, Fragment as J } from "react";
3
- import x from "classnames";
4
4
  import { getCurrencySymbol as K } from "../utils/get-currency-symbol/util.js";
5
5
  import { Input as M } from "../input/component.js";
6
- import { formatAmount as C, THINSP as O } from "../utils/format-amount/util.js";
6
+ import { formatAmount as R, THINSP as O } from "../utils/format-amount/util.js";
7
7
  import { withSuffix as Q } from "../with-suffix/component.js";
8
- import { getAmountValueFromStr as R, getFormattedValue as X } from "./utils/index.js";
9
- import r from "./index.module.css.js";
8
+ import a from "./index.module.css.js";
9
+ import { getAmountValueFromStr as v, getFormattedValue as X } from "./utils/index.js";
10
10
  const Y = Q(M), lt = T(
11
11
  ({
12
- value: l = null,
12
+ value: s = null,
13
13
  integerLength: E = 9,
14
14
  suffix: f = "RUR",
15
15
  placeholder: N = "",
16
16
  bold: $ = !0,
17
- type: i = "default",
18
- className: y,
19
- focusedClassName: I,
20
- required: q,
17
+ type: o = "default",
18
+ className: I,
19
+ focusedClassName: q,
20
+ required: y,
21
21
  dataTestId: P,
22
22
  clear: b = !1,
23
23
  allowNegative: d = !1,
@@ -25,23 +25,23 @@ const Y = Q(M), lt = T(
25
25
  onClear: c,
26
26
  ...j
27
27
  }, U) => {
28
- const u = i === "default" ? l : (l || 0) / 100, [a, m] = z(
29
- C({
28
+ const u = o === "default" ? s : (s || 0) / 100, [r, m] = z(
29
+ R({
30
30
  value: u || 0,
31
31
  currency: "RUR",
32
32
  type: "default"
33
33
  }).formatted
34
34
  );
35
- D(() => R(a, i === "default") !== l ? m(
36
- C({
35
+ D(() => v(r, o === "default") !== s ? m(
36
+ R({
37
37
  value: u,
38
38
  currency: "RUR",
39
39
  type: "default"
40
40
  }).formatted
41
41
  ) : () => {
42
- }, [u]);
43
- const W = (o) => {
44
- const t = o.target;
42
+ }, [u, s, o, r]);
43
+ const W = (i) => {
44
+ const t = i.target;
45
45
  let n = t.value.replace(/\s/g, "").replace(".", ",");
46
46
  const g = n.startsWith("-");
47
47
  if (g) {
@@ -54,9 +54,9 @@ const Y = Q(M), lt = T(
54
54
  }
55
55
  n = n.slice(1);
56
56
  }
57
- if (!RegExp(
58
- `(^[0-9]{1,${E}}(,([0-9]+)?)?$|^\\s*$)`
59
- ).test(n)) {
57
+ if (!RegExp(`(^[0-9]{1,${E}}(,([0-9]+)?)?$|^\\s*$)`).test(
58
+ n
59
+ )) {
60
60
  const e = t.selectionStart - 1;
61
61
  window.requestAnimationFrame(() => {
62
62
  t.selectionStart = e, t.selectionEnd = e;
@@ -64,8 +64,8 @@ const Y = Q(M), lt = T(
64
64
  return;
65
65
  }
66
66
  g && d && (n = `-${n}`);
67
- const s = X(n, i === "default");
68
- if (s === a) {
67
+ const l = X(n, o === "default");
68
+ if (l === r) {
69
69
  const e = t.selectionStart;
70
70
  window.requestAnimationFrame(() => {
71
71
  t.selectionStart = e, t.selectionEnd = e;
@@ -74,51 +74,51 @@ const Y = Q(M), lt = T(
74
74
  const [e, V] = n.replace("-", "").split(/\.|,/);
75
75
  let w = e.length;
76
76
  V && (w += 1 + V.slice(0, 2).length);
77
- const L = s.length - w, A = t.selectionStart + L;
77
+ const L = l.length - w, A = t.selectionStart + L;
78
78
  window.requestAnimationFrame(() => {
79
79
  t.selectionStart = A, t.selectionEnd = A;
80
80
  });
81
81
  }
82
- m(s);
83
- const h = s;
84
- p && p(o, {
85
- value: R(h.toString(), i === "default"),
82
+ m(l);
83
+ const h = l;
84
+ p && p(i, {
85
+ value: v(h.toString(), o === "default"),
86
86
  valueString: h.toString()
87
87
  });
88
88
  }, k = G(
89
- (o) => {
90
- m(""), c && c(o);
89
+ (i) => {
90
+ m(""), c && c(i);
91
91
  },
92
92
  [c]
93
- ), [B, S] = a.replace("-", "").split(","), H = a.startsWith("-");
93
+ ), [B, S] = r.replace("-", "").split(","), H = r.startsWith("-");
94
94
  return /* @__PURE__ */ F(
95
95
  "div",
96
96
  {
97
- className: x(r.container, {
98
- [r.bold]: $,
99
- [r.filled]: !!a
97
+ className: C(a.container, {
98
+ [a.bold]: $,
99
+ [a.filled]: !!r
100
100
  }),
101
101
  children: /* @__PURE__ */ F(
102
102
  Y,
103
103
  {
104
104
  ...j,
105
- suffix: /* @__PURE__ */ v(J, { children: [
105
+ suffix: /* @__PURE__ */ x(J, { children: [
106
106
  H && "-",
107
107
  B,
108
- /* @__PURE__ */ v("span", { className: r.minorPartAndCurrency, children: [
108
+ /* @__PURE__ */ x("span", { className: a.minorPartAndCurrency, children: [
109
109
  S !== void 0 && `,${S}`,
110
110
  O,
111
111
  K(f) || f
112
112
  ] })
113
113
  ] }),
114
- suffixContainerClassName: r.suffixContainer,
114
+ suffixContainerClassName: a.suffixContainer,
115
115
  clear: b,
116
- required: q,
116
+ required: y,
117
117
  placeholder: N,
118
- value: a,
119
- className: x(r.component, y),
120
- focusedClassName: I,
121
- inputClassName: r.input,
118
+ value: r,
119
+ className: C(a.component, I),
120
+ focusedClassName: q,
121
+ inputClassName: a.input,
122
122
  onChange: W,
123
123
  onClear: k,
124
124
  dataTestId: P,
@@ -4,14 +4,7 @@ import i from "classnames";
4
4
  import { Button as p } from "../button/component.js";
5
5
  import { Image as f } from "../image/component.js";
6
6
  import r from "./index.module.css.js";
7
- const N = ({
8
- src: m,
9
- text: t,
10
- slot: o,
11
- selected: l,
12
- ref: a,
13
- onClick: s
14
- }) => /* @__PURE__ */ c(
7
+ const N = ({ src: m, text: t, slot: o, selected: l, ref: a, onClick: s }) => /* @__PURE__ */ c(
15
8
  p,
16
9
  {
17
10
  ref: a,
@@ -24,16 +17,7 @@ const N = ({
24
17
  ]),
25
18
  view: "ghost",
26
19
  children: [
27
- /* @__PURE__ */ e(
28
- f,
29
- {
30
- view: "circle",
31
- bgColor: "secondary",
32
- size: "s",
33
- src: m,
34
- text: t
35
- }
36
- ),
20
+ /* @__PURE__ */ e(f, { view: "circle", bgColor: "secondary", size: "s", src: m, text: t }),
37
21
  l && /* @__PURE__ */ e("div", { className: i(r.slot, r.selected), children: /* @__PURE__ */ e(d, {}) }),
38
22
  o && /* @__PURE__ */ e("div", { className: r.slot, children: o })
39
23
  ]
@@ -9,4 +9,4 @@ export interface BadgeProps {
9
9
  iconColor?: 'positive' | 'attention' | 'negative' | 'tertiary' | 'secondary' | 'primary';
10
10
  dataTestId?: string;
11
11
  }
12
- export declare const Badge: ({ className, size, view, visibleIconOutline, content, iconColor, color, dataTestId, }: BadgeProps) => React.JSX.Element;
12
+ export declare const Badge: ({ className, size, view, visibleIconOutline, content, iconColor, color, dataTestId, }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -38,13 +38,7 @@ const T = (i) => /* @__PURE__ */ a("a", { ...i, children: i.children }), b = (i)
38
38
  ),
39
39
  children: [
40
40
  !!m && /* @__PURE__ */ r("div", { className: e.imageWrap, children: [
41
- /* @__PURE__ */ a(
42
- y,
43
- {
44
- src: m,
45
- size: "auto"
46
- }
47
- ),
41
+ /* @__PURE__ */ a(y, { src: m, size: "auto" }),
48
42
  !!s && /* @__PURE__ */ a("div", { className: e.topLeftAddons, children: s }),
49
43
  !!c && /* @__PURE__ */ a("div", { className: e.topRightAddons, children: c }),
50
44
  !t && /* @__PURE__ */ a("div", { className: e.shadow })
@@ -4,6 +4,6 @@ export type BottomSheetProps = {
4
4
  open: boolean;
5
5
  marginTop?: number;
6
6
  onBackClick?: () => void;
7
- children: React.ReactNode;
7
+ children?: React.ReactNode;
8
8
  };
9
9
  export declare const BottomSheet: React.FC<BottomSheetProps>;
@@ -1,6 +1,6 @@
1
1
  import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
- import x from "react-swipeable-bottom-sheet";
3
- import d from "@alphakits/icons/dist/ChevronBackM";
2
+ import x from "@alphakits/icons/dist/ChevronBackM";
3
+ import d from "react-swipeable-bottom-sheet";
4
4
  import l from "./index.module.css.js";
5
5
  const h = ({
6
6
  children: r,
@@ -9,7 +9,7 @@ const h = ({
9
9
  marginTop: o = 40,
10
10
  onBackClick: e
11
11
  }) => /* @__PURE__ */ n(
12
- x,
12
+ d,
13
13
  {
14
14
  overflowHeight: 0,
15
15
  style: { zIndex: 999999, maxWidth: "100%" },
@@ -18,17 +18,13 @@ const h = ({
18
18
  topShadow: !1,
19
19
  open: i,
20
20
  onChange: p,
21
- bodyStyle: { borderRadius: o ? "21px 21px 0 0 " : "0px", padding: "16px 16px", boxSizing: "border-box" },
21
+ bodyStyle: {
22
+ borderRadius: o ? "21px 21px 0 0 " : "0px",
23
+ padding: "16px 16px",
24
+ boxSizing: "border-box"
25
+ },
22
26
  children: [
23
- !!e && /* @__PURE__ */ t(
24
- "button",
25
- {
26
- type: "button",
27
- className: l.back_btn,
28
- onClick: e,
29
- children: /* @__PURE__ */ t(d, {})
30
- }
31
- ),
27
+ !!e && /* @__PURE__ */ t("button", { type: "button", className: l.back_btn, onClick: e, children: /* @__PURE__ */ t(x, {}) }),
32
28
  r
33
29
  ]
34
30
  }
@@ -1,4 +1,4 @@
1
- import { default as React, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export declare enum Radiuses {
3
3
  xs = 8,
4
4
  sm = 12,
@@ -29,5 +29,5 @@ type Props = {
29
29
  margin?: keyof typeof Spaces;
30
30
  marginCustom?: string;
31
31
  };
32
- export declare const Box: ({ children, id, className, padding, paddingCustom, border, margin, marginCustom, background, width, height, rounded, }: Props) => React.JSX.Element;
32
+ export declare const Box: ({ children, id, className, padding, paddingCustom, border, margin, marginCustom, background, width, height, rounded, }: Props) => import("react/jsx-runtime").JSX.Element;
33
33
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as M } from "react/jsx-runtime";
2
- import { useMemo as N } from "react";
3
- import b from "classnames";
2
+ import N from "classnames";
3
+ import { useMemo as b } from "react";
4
4
  import m from "./index.module.css.js";
5
5
  var q = /* @__PURE__ */ ((r) => (r[r.xs = 8] = "xs", r[r.sm = 12] = "sm", r[r.md = 16] = "md", r.round = "round", r))(q || {}), z = /* @__PURE__ */ ((r) => (r[r.xxs = 4] = "xxs", r[r.xs = 8] = "xs", r[r.sm = 12] = "sm", r[r.md = 16] = "md", r[r.ml = 20] = "ml", r[r.l = 20] = "l", r[r.xl = 24] = "xl", r[r.xxl = 32] = "xxl", r))(z || {});
6
6
  const G = ({
@@ -17,7 +17,7 @@ const G = ({
17
17
  height: n,
18
18
  rounded: _
19
19
  }) => {
20
- const B = N(() => {
20
+ const B = b(() => {
21
21
  const x = {};
22
22
  return f && (x.background = f), o && (x.padding = o), l && (x.margin = l), t && (x.width = `${t}px`), n && (x.height = `${n}px`), x;
23
23
  }, [f, t, n, o, l]);
@@ -26,7 +26,7 @@ const G = ({
26
26
  {
27
27
  id: y,
28
28
  style: B,
29
- className: b([
29
+ className: N([
30
30
  i,
31
31
  m.component,
32
32
  {
@@ -1,11 +1,11 @@
1
1
  import { jsxs as F, jsx as o } from "react/jsx-runtime";
2
- import i, { useRef as v } from "react";
3
- import u from "react-merge-refs";
4
- import d from "classnames";
2
+ import i from "classnames";
3
+ import u, { useRef as v } from "react";
4
+ import d from "react-merge-refs";
5
5
  import { useFocus as C } from "../hooks/useFocus/index.js";
6
6
  import { Loader as L } from "../loader/component.js";
7
7
  import e from "./index.module.css.js";
8
- const E = i.forwardRef(
8
+ const E = u.forwardRef(
9
9
  ({
10
10
  children: r,
11
11
  view: b = "secondary",
@@ -21,7 +21,7 @@ const E = i.forwardRef(
21
21
  ...a
22
22
  }, l) => {
23
23
  const c = v(null), [h] = C(c, "keyboard"), f = {
24
- className: d(
24
+ className: i(
25
25
  e.component,
26
26
  e[b],
27
27
  e[x],
@@ -35,12 +35,12 @@ const E = i.forwardRef(
35
35
  R
36
36
  ),
37
37
  "data-test-id": y || null
38
- }, p = /* @__PURE__ */ F(i.Fragment, { children: [
38
+ }, p = /* @__PURE__ */ F(u.Fragment, { children: [
39
39
  t && /* @__PURE__ */ o("span", { className: e.addons, children: t }),
40
40
  r && /* @__PURE__ */ o(
41
41
  "span",
42
42
  {
43
- className: d(e.text, {
43
+ className: i(e.text, {
44
44
  [e.stretchText]: !(t || s)
45
45
  }),
46
46
  children: r
@@ -58,7 +58,7 @@ const E = i.forwardRef(
58
58
  ...f,
59
59
  ...a,
60
60
  href: m,
61
- ref: u([c, l]),
61
+ ref: d([c, l]),
62
62
  children: p
63
63
  }
64
64
  );
@@ -72,7 +72,7 @@ const E = i.forwardRef(
72
72
  ...f,
73
73
  ...w,
74
74
  disabled: j || n,
75
- ref: u([c, l]),
75
+ ref: d([c, l]),
76
76
  children: p
77
77
  }
78
78
  )
@@ -40,7 +40,12 @@ const J = ({
40
40
  type: "button",
41
41
  disabled: c,
42
42
  onClick: i,
43
- className: d(r.component, r[n], { [r.disabled]: c }, p),
43
+ className: d(
44
+ r.component,
45
+ r[n],
46
+ { [r.disabled]: c },
47
+ p
48
+ ),
44
49
  children: h(e, n)
45
50
  }
46
51
  );
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { locales } from '../utils/format-date';
3
2
  import { View } from './typings';
4
3
  export type ExternalLocale = keyof typeof locales;
@@ -21,4 +20,4 @@ export type CalendarProps = {
21
20
  locale?: ExternalLocale;
22
21
  shortNames?: boolean;
23
22
  };
24
- export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
23
+ export declare const Calendar: import('react').ForwardRefExoticComponent<CalendarProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,108 +1,111 @@
1
- import { jsxs as N, jsx as y } from "react/jsx-runtime";
2
- import { forwardRef as re, useState as P, useMemo as o, useCallback as a } from "react";
3
- import ae from "classnames";
1
+ import { jsxs as P, jsx as y } from "react/jsx-runtime";
2
+ import se from "classnames";
3
+ import { forwardRef as ae, useState as S, useMemo as o, useCallback as a } from "react";
4
4
  import { startOfMonth as D, isSameDay as le } from "../utils/date/index.js";
5
5
  import { locales as ce } from "../utils/format-date/index.js";
6
6
  import { DaysTable as ie } from "./components/days-table/component.js";
7
- import { Header as de } from "./components/header/сomponent.js";
8
- import { MonthsTable as he } from "./components/months-table/сomponent.js";
9
- import { useCalendar as fe } from "./use-calendar.js";
10
- import { useDidUpdateEffect as S, monthName as we } from "./utils.js";
7
+ import { Header as de } from "./components/header/component.js";
8
+ import { MonthsTable as he } from "./components/months-table/component.js";
11
9
  import g from "./index.module.css.js";
12
- const me = ce, Pe = re(
10
+ import { useCalendar as fe } from "./use-calendar.js";
11
+ import { useDidUpdateEffect as A, monthName as we } from "./utils.js";
12
+ const me = ce, Pe = ae(
13
13
  ({
14
- className: A,
15
- defaultView: b = "days",
14
+ className: b,
15
+ defaultView: Y = "days",
16
16
  value: n,
17
17
  month: i,
18
- defaultMonth: Y = +/* @__PURE__ */ new Date(),
18
+ defaultMonth: p = Date.now(),
19
19
  minDate: d,
20
20
  maxDate: h,
21
- selectedFrom: f,
21
+ selectedFrom: l,
22
22
  selectedTo: V,
23
23
  offDays: j,
24
24
  events: R,
25
- onChange: w,
26
- onMonthChange: T,
27
- onYearChange: B,
28
- locale: E = "en",
29
- shortNames: H = !0,
30
- dataTestId: L
31
- }, O) => {
32
- const [e, l] = P(b), [U, W] = P(!1), m = me[E], s = o(() => n ? new Date(n) : void 0, [n]), q = o(
25
+ onChange: f,
26
+ onMonthChange: B,
27
+ onYearChange: E,
28
+ locale: H = "en",
29
+ shortNames: L = !0,
30
+ dataTestId: O
31
+ }, T) => {
32
+ const [e, w] = S(Y), [U, W] = S(!1), m = me[H], r = o(() => n ? new Date(n) : void 0, [n]), q = o(
33
33
  () => D(
34
- s ?? (f != null ? new Date(f) : new Date(Y))
34
+ r ?? (l != null ? new Date(l) : new Date(p))
35
35
  ),
36
36
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
- []
37
+ [p, l, r]
38
38
  ), z = o(
39
39
  () => i ? new Date(i) : void 0,
40
40
  [i]
41
- ), F = o(
41
+ ), G = o(
42
42
  () => d ? new Date(d) : void 0,
43
43
  [d]
44
- ), G = o(
44
+ ), I = o(
45
45
  () => h ? new Date(h) : void 0,
46
46
  [h]
47
47
  ), {
48
48
  activeMonth: c,
49
- activeYear: I,
50
- weeks: p,
51
- months: J,
52
- canSetPrevMonth: K,
53
- canSetNextMonth: Q,
49
+ activeYear: J,
50
+ weeks: k,
51
+ months: K,
52
+ canSetPrevMonth: Q,
53
+ canSetNextMonth: X,
54
54
  setMonthByDate: M,
55
- setPrevMonth: k,
56
- setNextMonth: v,
57
- setNextYear: x,
55
+ setPrevMonth: v,
56
+ setNextMonth: x,
57
+ setNextYear: C,
58
58
  setPrevYear: u,
59
- highlighted: X,
60
- getDayProps: Z,
61
- getMonthProps: _,
62
- getRootProps: $
59
+ highlighted: Z,
60
+ getDayProps: _,
61
+ getMonthProps: $,
62
+ getRootProps: F
63
63
  } = fe({
64
64
  month: z,
65
65
  defaultMonth: q,
66
66
  view: e,
67
- minDate: F,
68
- maxDate: G,
69
- selected: s,
67
+ minDate: G,
68
+ maxDate: I,
69
+ selected: r,
70
70
  offDays: j,
71
71
  events: R,
72
- onChange: w,
73
- onMonthChange: T,
74
- onYearChange: B,
75
- setView: l
76
- }), C = a(
72
+ onChange: f,
73
+ onMonthChange: B,
74
+ onYearChange: E,
75
+ setView: w
76
+ }), N = a(
77
77
  (t) => {
78
- l(e === t ? "days" : t);
78
+ w(e === t ? "days" : t);
79
79
  },
80
80
  [e]
81
- ), r = o(() => {
81
+ ), s = o(() => {
82
82
  const t = /* @__PURE__ */ new Date();
83
83
  return new Date(t.getFullYear(), t.getMonth(), t.getDate());
84
- }, []), ee = o(() => !s || !le(s, r), [s, r]), te = a(() => {
85
- l("days"), M(D(r)), w?.(r.getTime());
86
- }, [w, M, l, r]), oe = a(() => {
87
- e === "days" ? k() : u();
88
- }, [k, e, u]), ne = a(() => {
89
- e === "days" ? v() : x();
90
- }, [v, e, x]), se = a(() => {
91
- C("months");
92
- }, [C]);
93
- return S(() => {
84
+ }, []), ee = o(
85
+ () => !r || !le(r, s),
86
+ [r, s]
87
+ ), te = a(() => {
88
+ w("days"), M(D(s)), f?.(s.getTime());
89
+ }, [f, M, s]), oe = a(() => {
90
+ e === "days" ? v() : u();
91
+ }, [v, e, u]), ne = a(() => {
92
+ e === "days" ? x() : C();
93
+ }, [x, e, C]), re = a(() => {
94
+ N("months");
95
+ }, [N]);
96
+ return A(() => {
94
97
  W(!1);
95
- }, [e]), S(() => {
98
+ }, [e]), A(() => {
96
99
  const t = n != null && D(new Date(n));
97
100
  t && t.getTime() !== c.getTime() && M(t);
98
- }, [n]), /* @__PURE__ */ N(
101
+ }, [n]), /* @__PURE__ */ P(
99
102
  "div",
100
103
  {
101
- ...$({ ref: O }),
102
- className: ae(g.component, A, {
103
- [g.sixWeeks]: p.length === 6
104
+ ...F({ ref: T }),
105
+ className: se(g.component, b, {
106
+ [g.sixWeeks]: k.length === 6
104
107
  }),
105
- "data-test-id": L,
108
+ "data-test-id": O,
106
109
  children: [
107
110
  /* @__PURE__ */ y(
108
111
  de,
@@ -110,27 +113,27 @@ const me = ce, Pe = re(
110
113
  month: we(c, m, !1),
111
114
  onTodayClick: te,
112
115
  showToday: ee,
113
- year: I.getFullYear().toString(),
114
- prevArrowVisible: K,
115
- nextArrowVisible: Q,
116
+ year: J.getFullYear().toString(),
117
+ prevArrowVisible: Q,
118
+ nextArrowVisible: X,
116
119
  onPrevArrowClick: oe,
117
120
  onNextArrowClick: ne,
118
- onMonthClick: se,
121
+ onMonthClick: re,
119
122
  view: e,
120
123
  withShadow: U
121
124
  }
122
125
  ),
123
- /* @__PURE__ */ N("div", { className: g.container, children: [
126
+ /* @__PURE__ */ P("div", { className: g.container, children: [
124
127
  e === "days" && /* @__PURE__ */ y(
125
128
  ie,
126
129
  {
127
130
  locale: m,
128
- weeks: p,
131
+ weeks: k,
129
132
  activeMonth: c,
130
- selectedFrom: f,
133
+ selectedFrom: l,
131
134
  selectedTo: V,
132
- getDayProps: Z,
133
- highlighted: X
135
+ getDayProps: _,
136
+ highlighted: Z
134
137
  }
135
138
  ),
136
139
  e === "months" && /* @__PURE__ */ y(
@@ -138,9 +141,9 @@ const me = ce, Pe = re(
138
141
  {
139
142
  selectedMonth: c,
140
143
  selectedLocale: m,
141
- shortNames: H,
142
- months: J,
143
- getMonthProps: _
144
+ shortNames: L,
145
+ months: K,
146
+ getMonthProps: $
144
147
  }
145
148
  )
146
149
  ] })