@alphakits/ui 2.3.1 → 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 +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 +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 +56 -56
  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 +6 -6
  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,69 +1,66 @@
1
1
  import { jsx as n, jsxs as j } from "react/jsx-runtime";
2
- import { useRef as x, useMemo as z, useCallback as C } from "react";
3
- import { TransitionGroup as P, CSSTransition as W } from "react-transition-group";
4
2
  import R from "classnames";
5
- import { weekDaysShort as q, isSameDay as d, isWithinInterval as G, isLastDayOfMonth as H, isBefore as I, endOfDay as M, isEqual as J, isToday as K, startOfMonth as Q } from "../../../utils/date/index.js";
6
- import { capitalize as U } from "../../../utils/string.js";
7
- import { Button as V } from "../../../button/component.js";
8
- import { Flex as b } from "../../../flex/component.js";
9
- import { usePrevious as X } from "../../../hooks/usePrevious/index.js";
3
+ import { useRef as b, useMemo as z, useCallback as C } from "react";
4
+ import { TransitionGroup as P, CSSTransition as W } from "react-transition-group";
5
+ import { Button as q } from "../../../button/component.js";
6
+ import { Flex as T } from "../../../flex/component.js";
7
+ import { usePrevious as G } from "../../../hooks/usePrevious/index.js";
8
+ import { weekDaysShort as H, isSameDay as l, isWithinInterval as I, isLastDayOfMonth as M, isBefore as J, endOfDay as K, isEqual as Q, isToday as U, startOfMonth as V } from "../../../utils/date/index.js";
9
+ import { capitalize as X } from "../../../utils/string.js";
10
10
  import { getSelectionRange as Y } from "../../utils.js";
11
11
  import t from "./index.module.css.js";
12
- const Z = ({
13
- children: l,
14
- ...a
15
- }) => {
16
- const i = x(null);
17
- return /* @__PURE__ */ n(W, { ...a, nodeRef: i, children: /* @__PURE__ */ n("div", { ref: i, children: l }) });
12
+ const Z = ({ children: m, ...i }) => {
13
+ const a = b(null);
14
+ return /* @__PURE__ */ n(W, { ...i, nodeRef: a, children: /* @__PURE__ */ n("div", { ref: a, children: m }) });
18
15
  }, ce = ({
19
- weeks: l = [],
20
- activeMonth: a = /* @__PURE__ */ new Date(),
21
- highlighted: i,
22
- selectedFrom: m,
16
+ weeks: m = [],
17
+ activeMonth: i = /* @__PURE__ */ new Date(),
18
+ highlighted: a,
19
+ selectedFrom: o,
23
20
  selectedTo: f,
24
- getDayProps: N,
21
+ getDayProps: x,
25
22
  locale: p
26
23
  }) => {
27
- const u = x(a);
28
- u.current = a;
29
- const D = X(a), g = D && (a < D ? "right" : "left"), s = Y(m, f, i), v = z(() => q(p), [p]), S = C(
30
- () => v.map((e) => /* @__PURE__ */ n("div", { className: t.dayName, children: U(e) }, e)),
24
+ const u = b(i);
25
+ u.current = i;
26
+ const D = G(i), g = D && (i < D ? "right" : "left"), s = Y(o, f, a), v = z(() => H(p), [p]), N = C(
27
+ () => v.map((e) => /* @__PURE__ */ n("div", { className: t.dayName, children: X(e) }, e)),
31
28
  [v]
32
- ), T = (e) => {
33
- const o = e.selected || m != null && d(e.date, new Date(m)) || f != null && d(e.date, new Date(f)), r = !o && s && G(e.date, s), c = e.date.getDate() === 1, h = H(e.date), y = c && r && s && e.date > s.start, k = h && r && s && e.date < s.end, A = s && d(e.date, s.start), B = s && d(e.date, s.end), w = N(e), L = I(M(new Date(e.date)), /* @__PURE__ */ new Date());
29
+ ), S = (e) => {
30
+ const c = e.selected || o != null && l(e.date, new Date(o)) || f != null && l(e.date, new Date(f)), r = !c && s && I(e.date, s), d = e.date.getDate() === 1, h = M(e.date), y = d && r && s && e.date > s.start, k = h && r && s && e.date < s.end, A = s && l(e.date, s.start), B = s && l(e.date, s.end), w = x(e), L = J(K(new Date(e.date)), /* @__PURE__ */ new Date());
34
31
  return /* @__PURE__ */ n(
35
- V,
32
+ q,
36
33
  {
37
34
  ...w,
38
35
  ref: (O) => {
39
- Q(e.date).getTime() === u.current.getTime() && w.ref(O);
36
+ V(e.date).getTime() === u.current.getTime() && w.ref(O);
40
37
  },
41
38
  type: "button",
42
39
  view: "ghost",
43
40
  size: "xs",
44
41
  disabled: e.disabled,
45
42
  className: R(t.day, {
46
- [t.selected]: o,
43
+ [t.selected]: c,
47
44
  [t.range]: r,
48
45
  [t.rangeStart]: A,
49
46
  [t.rangeEnd]: B,
50
47
  [t.transitLeft]: y,
51
48
  [t.transitRight]: k,
52
- [t.today]: K(e.date),
53
- [t.firstDay]: c,
49
+ [t.today]: U(e.date),
50
+ [t.firstDay]: d,
54
51
  [t.lastDay]: h,
55
52
  [t.event]: e.event,
56
53
  [t.prev]: L,
57
54
  [t.disabled]: e.disabled,
58
55
  [t.muted]: e.muted || e.disabled,
59
- [t.highlighted]: i && J(e.date, i)
56
+ [t.highlighted]: a && Q(e.date, a)
60
57
  }),
61
58
  children: e.date.getDate()
62
59
  }
63
60
  );
64
- }, E = (e, o) => /* @__PURE__ */ n(b, { className: t.weekRow, children: e.map((r, c) => /* @__PURE__ */ n("div", { className: t.daysRowDay, children: r && T(r) }, r ? r.date.getTime() : c)) }, o);
61
+ }, E = (e, c) => /* @__PURE__ */ n(T, { className: t.weekRow, children: e.map((r, d) => /* @__PURE__ */ n("div", { className: t.daysRowDay, children: r && S(r) }, r ? r.date.getTime() : d)) }, c);
65
62
  return /* @__PURE__ */ j("div", { className: R(t.daysTable, g && t[g]), children: [
66
- /* @__PURE__ */ n("div", { className: t.daysRow, children: /* @__PURE__ */ n(b, { children: S() }) }),
63
+ /* @__PURE__ */ n("div", { className: t.daysRow, children: /* @__PURE__ */ n(T, { children: N() }) }),
67
64
  /* @__PURE__ */ n(P, { component: null, children: /* @__PURE__ */ n(
68
65
  Z,
69
66
  {
@@ -74,9 +71,9 @@ const Z = ({
74
71
  exit: t.daysExit,
75
72
  exitActive: t.daysExitActive
76
73
  },
77
- children: /* @__PURE__ */ n("div", { className: t.daysBody, children: l.map(E) })
74
+ children: /* @__PURE__ */ n("div", { className: t.daysBody, children: m.map(E) })
78
75
  },
79
- a.getTime()
76
+ i.getTime()
80
77
  ) })
81
78
  ] });
82
79
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
2
  import t from "@alphakits/icons/dist/ChevronBackS";
3
3
  import s from "classnames";
4
- import { capitalize as b } from "../../../utils/string.js";
5
4
  import { Button as i } from "../../../button/component.js";
6
- import { SelectButton as u } from "../select-button/сomponent.js";
5
+ import { capitalize as b } from "../../../utils/string.js";
6
+ import { SelectButton as u } from "../select-button/component.js";
7
7
  import e from "./index.module.css.js";
8
8
  const $ = ({
9
9
  month: d,
@@ -37,16 +37,7 @@ const $ = ({
37
37
  }
38
38
  ),
39
39
  /* @__PURE__ */ l("div", { className: e.selectors, children: [
40
- m && /* @__PURE__ */ o(
41
- i,
42
- {
43
- view: "outlined",
44
- className: e.today,
45
- onClick: n,
46
- size: "xs",
47
- children: "today"
48
- }
49
- ),
40
+ m && /* @__PURE__ */ o(i, { view: "outlined", className: e.today, onClick: n, size: "xs", children: "today" }),
50
41
  /* @__PURE__ */ o(
51
42
  i,
52
43
  {
@@ -1 +1 @@
1
- export * from './сomponent';
1
+ export * from './component';
@@ -1,4 +1,4 @@
1
- import { Header as o } from "./сomponent.js";
1
+ import { Header as o } from "./component.js";
2
2
  export {
3
3
  o as Header
4
4
  };
@@ -1,10 +1,10 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { useCallback as n, createElement as f } from "react";
3
- import { isSameMonth as p, isThisMonth as u } from "../../../utils/date/index.js";
4
- import { capitalize as c } from "../../../utils/string.js";
5
- import { FlexColumns as d } from "../../../flex-columns/component.js";
3
+ import { FlexColumns as p } from "../../../flex-columns/component.js";
4
+ import { isSameMonth as u, isThisMonth as c } from "../../../utils/date/index.js";
5
+ import { capitalize as d } from "../../../utils/string.js";
6
6
  import { monthName as b } from "../../utils.js";
7
- import { SelectButton as g } from "../select-button/сomponent.js";
7
+ import { SelectButton as g } from "../select-button/component.js";
8
8
  import r from "./index.module.css.js";
9
9
  const C = ({
10
10
  selectedMonth: e,
@@ -14,10 +14,10 @@ const C = ({
14
14
  shortNames: i
15
15
  }) => {
16
16
  const s = n(
17
- (t) => e && p(e, t.date) ? "selected" : u(t.date) ? "outlined" : "default",
17
+ (t) => e && u(e, t.date) ? "selected" : c(t.date) ? "outlined" : "default",
18
18
  [e]
19
19
  );
20
- return /* @__PURE__ */ l(d, { columns: 3, gc: 0, gr: 8, className: r.monthsTable, children: o.map((t) => /* @__PURE__ */ f(
20
+ return /* @__PURE__ */ l(p, { columns: 3, gc: 0, gr: 8, className: r.monthsTable, children: o.map((t) => /* @__PURE__ */ f(
21
21
  g,
22
22
  {
23
23
  ...m(t),
@@ -25,7 +25,7 @@ const C = ({
25
25
  className: r.button,
26
26
  view: s(t)
27
27
  },
28
- c(b(t.date, a, i))
28
+ d(b(t.date, a, i))
29
29
  )) });
30
30
  };
31
31
  export {
@@ -1 +1 @@
1
- export * from './сomponent';
1
+ export * from './component';
@@ -1,4 +1,4 @@
1
- import { MonthsTable as r } from "./сomponent.js";
1
+ import { MonthsTable as r } from "./component.js";
2
2
  export {
3
3
  r as MonthsTable
4
4
  };
@@ -1,9 +1,9 @@
1
- import { default as React, ButtonHTMLAttributes } from 'react';
1
+ import { ButtonHTMLAttributes } from 'react';
2
2
  export type SelectButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
3
3
  className?: string;
4
4
  view?: 'default' | 'filled' | 'outlined' | 'selected';
5
5
  };
6
- export declare const SelectButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
+ export declare const SelectButton: import('react').ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
7
7
  className?: string | undefined;
8
8
  view?: "default" | "outlined" | "filled" | "selected" | undefined;
9
- } & React.RefAttributes<HTMLButtonElement>>;
9
+ } & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,16 +1,10 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import n from "classnames";
2
+ import p from "classnames";
3
+ import { forwardRef as n } from "react";
4
4
  import { Button as a } from "../../../button/component.js";
5
5
  import o from "./index.module.css.js";
6
- const w = p(
7
- ({
8
- className: r,
9
- children: m,
10
- disabled: t,
11
- view: e = "default",
12
- ...s
13
- }, f) => /* @__PURE__ */ i(
6
+ const w = n(
7
+ ({ className: r, children: m, disabled: t, view: e = "default", ...s }, f) => /* @__PURE__ */ i(
14
8
  a,
15
9
  {
16
10
  ...s,
@@ -18,7 +12,7 @@ const w = p(
18
12
  view: "ghost",
19
13
  size: "xs",
20
14
  disabled: t,
21
- className: n(o.button, o[e], r, {
15
+ className: p(o.button, o[e], r, {
22
16
  [o.disabled]: t
23
17
  }),
24
18
  children: m
@@ -1 +1 @@
1
- export * from './сomponent';
1
+ export * from './component';
@@ -1,4 +1,4 @@
1
- import { SelectButton as o } from "./сomponent.js";
1
+ import { SelectButton as o } from "./component.js";
2
2
  export {
3
3
  o as SelectButton
4
4
  };
@@ -1,35 +1,35 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useRef as d, useCallback as c, useLayoutEffect as T, createElement as b } from "react";
3
3
  import { isSameYear as h, isThisYear as g } from "../../../utils/date/index.js";
4
- import { SelectButton as N } from "../select-button/сomponent.js";
4
+ import { SelectButton as N } from "../select-button/component.js";
5
5
  import r from "./index.module.css.js";
6
6
  const E = ({
7
- selectedYear: t,
7
+ selectedYear: o,
8
8
  years: i = [],
9
- getYearProps: u,
10
- onScroll: o
9
+ getYearProps: a,
10
+ onScroll: t
11
11
  }) => {
12
- const l = d(null), a = c(
13
- (e) => t && h(t, e) ? "selected" : g(e) ? "outlined" : "default",
14
- [t]
12
+ const l = d(null), u = c(
13
+ (e) => o && h(o, e) ? "selected" : g(e) ? "outlined" : "default",
14
+ [o]
15
15
  ), m = c(
16
16
  (e) => {
17
- o(e.currentTarget.scrollTop);
17
+ t(e.currentTarget.scrollTop);
18
18
  },
19
- [o]
19
+ [t]
20
20
  );
21
21
  return T(() => {
22
- const e = l.current, f = `.${r.button}[tabIndex="0"]`, s = e && e.querySelector(f);
22
+ const e = l.current, f = `.${r.button}[tabIndex="0"]`, s = e?.querySelector(f);
23
23
  if (e && s) {
24
24
  const p = e.clientHeight / 2 - s.clientHeight / 2;
25
- e.scrollTop = s.offsetTop - p, o(e.scrollTop);
25
+ e.scrollTop = s.offsetTop - p, t(e.scrollTop);
26
26
  }
27
- }, [o, t]), /* @__PURE__ */ n("div", { className: r.yearsTable, onScroll: m, ref: l, children: /* @__PURE__ */ n("div", { className: r.inner, children: i.map((e) => /* @__PURE__ */ b(
27
+ }, [t]), /* @__PURE__ */ n("div", { className: r.yearsTable, onScroll: m, ref: l, children: /* @__PURE__ */ n("div", { className: r.inner, children: i.map((e) => /* @__PURE__ */ b(
28
28
  N,
29
29
  {
30
- ...u(e),
30
+ ...a(e),
31
31
  key: e.getFullYear(),
32
- view: a(e),
32
+ view: u(e),
33
33
  className: r.button
34
34
  },
35
35
  e.getFullYear()
@@ -1 +1 @@
1
- export * from './сomponent';
1
+ export * from './component';
@@ -1,4 +1,4 @@
1
- import { YearsTable as a } from "./сomponent.js";
1
+ import { YearsTable as a } from "./component.js";
2
2
  export {
3
3
  a as YearsTable
4
4
  };
@@ -1,4 +1,4 @@
1
1
  export * from './component';
2
- export { usePeriod } from './use-period';
3
2
  export { useCalendar } from './use-calendar';
4
- export { russianWeekDay, dateInLimits, limitDate, monthName, DAYS_IN_WEEK, MONTHS_IN_YEAR, SUNDAY_INDEX, } from './utils';
3
+ export { usePeriod } from './use-period';
4
+ export { DAYS_IN_WEEK, dateInLimits, limitDate, MONTHS_IN_YEAR, monthName, russianWeekDay, SUNDAY_INDEX, } from './utils';
@@ -1,6 +1,6 @@
1
1
  import { Calendar as o } from "./component.js";
2
- import { usePeriod as t } from "./use-period.js";
3
- import { useCalendar as i } from "./use-calendar.js";
2
+ import { useCalendar as t } from "./use-calendar.js";
3
+ import { usePeriod as i } from "./use-period.js";
4
4
  import { DAYS_IN_WEEK as n, MONTHS_IN_YEAR as s, SUNDAY_INDEX as D, dateInLimits as _, limitDate as d, monthName as f, russianWeekDay as p } from "./utils.js";
5
5
  export {
6
6
  o as Calendar,
@@ -11,6 +11,6 @@ export {
11
11
  d as limitDate,
12
12
  f as monthName,
13
13
  p as russianWeekDay,
14
- i as useCalendar,
15
- t as usePeriod
14
+ t as useCalendar,
15
+ i as usePeriod
16
16
  };
@@ -1,13 +1,13 @@
1
- import { useState as O, useRef as nt, useMemo as c, useCallback as o } from "react";
1
+ import { useState as O, useRef as ct, useMemo as r, useCallback as o } from "react";
2
2
  import Tt from "react-merge-refs";
3
- import { startOfMonth as rt, startOfYear as at, subYears as Dt, addMonths as Rt, addYears as mt, isSameDay as Ft, isSameMonth as ct } from "../utils/date/index.js";
4
- import { dateArrayToHashTable as dt, generateWeeks as Nt, generateMonths as Pt, generateYears as It, limitDate as W, simulateTab as Bt, modifyDateByShift as Et, MONTHS_IN_YEAR as Lt } from "./utils.js";
3
+ import { startOfMonth as dt, startOfYear as ft, subYears as Dt, addMonths as Rt, addYears as mt, isSameDay as Ft, isSameMonth as ut } from "../utils/date/index.js";
4
+ import { dateArrayToHashTable as it, generateWeeks as Nt, generateMonths as Pt, generateYears as It, limitDate as W, simulateTab as Bt, modifyDateByShift as Et, MONTHS_IN_YEAR as Lt } from "./utils.js";
5
5
  function Ut({
6
6
  defaultMonth: C,
7
7
  month: R,
8
- minDate: r,
8
+ minDate: a,
9
9
  view: H = "days",
10
- maxDate: a,
10
+ maxDate: c,
11
11
  selected: h,
12
12
  events: U,
13
13
  offDays: x,
@@ -16,24 +16,24 @@ function Ut({
16
16
  onChange: N,
17
17
  setView: K
18
18
  }) {
19
- const [ft, ut] = O(C), [it, _] = O(C), [lt, j] = O(), g = R === void 0, d = g ? ft : R, Y = g ? it : R, M = nt([]), P = nt(null), u = c(() => r && rt(r), [r]), i = c(() => a && rt(a), [a]), q = c(() => r && at(r), [r]), z = c(() => a && at(a), [a]), ht = u ? d > u : !0, gt = i ? d < i : !0, G = c(() => dt(U || []), [U]), b = c(() => dt(x || []), [x]), Mt = c(
19
+ const [lt, ht] = O(C), [gt, _] = O(C), [Mt, j] = O(), g = R === void 0, d = g ? lt : R, Y = g ? gt : R, M = ct([]), P = ct(null), u = r(() => a && dt(a), [a]), i = r(() => c && dt(c), [c]), q = r(() => a && ft(a), [a]), z = r(() => c && ft(c), [c]), wt = u ? d > u : !0, yt = i ? d < i : !0, G = r(() => it(U || []), [U]), b = r(() => it(x || []), [x]), pt = r(
20
20
  () => Nt(d, {
21
- minDate: r,
22
- maxDate: a,
21
+ minDate: a,
22
+ maxDate: c,
23
23
  selected: h,
24
24
  eventsMap: G,
25
25
  offDaysMap: b
26
26
  }),
27
- [a, r, h, d, G, b]
28
- ), wt = c(
27
+ [c, a, h, d, G, b]
28
+ ), Yt = r(
29
29
  () => Pt(Y, { minMonth: u, maxMonth: i }),
30
30
  [u, i, Y]
31
- ), J = c(
32
- () => It(r || Dt(/* @__PURE__ */ new Date(), 5), a || /* @__PURE__ */ new Date()),
33
- [r, a]
31
+ ), J = r(
32
+ () => It(a || Dt(/* @__PURE__ */ new Date(), 5), c || /* @__PURE__ */ new Date()),
33
+ [a, c]
34
34
  ), k = o(
35
35
  (t) => {
36
- g && (ut(t), _(t)), m && m(t.getTime());
36
+ g && (ht(t), _(t)), m && m(t.getTime());
37
37
  },
38
38
  [m, g]
39
39
  ), Q = o(
@@ -60,9 +60,9 @@ function Ut({
60
60
  v(1);
61
61
  }, [v]), E = o(() => {
62
62
  v(-1);
63
- }, [v]), yt = o(() => {
63
+ }, [v]), St = o(() => {
64
64
  T(1);
65
- }, [T]), pt = o(() => {
65
+ }, [T]), At = o(() => {
66
66
  T(-1);
67
67
  }, [T]), w = o(
68
68
  () => M.current.find((t) => document.activeElement === t),
@@ -78,12 +78,12 @@ function Ut({
78
78
  ), f = o(
79
79
  (t) => {
80
80
  const e = w();
81
- if (e && e.dataset.date) {
82
- const n = /* @__PURE__ */ new Date(+e.dataset.date), s = Et(t, n, r, a, b);
81
+ if (e?.dataset.date) {
82
+ const n = /* @__PURE__ */ new Date(+e.dataset.date), s = Et(t, n, a, c, b);
83
83
  let p = !1;
84
84
  s < n && s.getMonth() !== n.getMonth() && (E(), p = !0), s > n && s.getMonth() !== n.getMonth() && (B(), p = !0);
85
- const st = () => l(M.current[s.getDate() - 1]);
86
- p ? setTimeout(st, 0) : st();
85
+ const at = () => l(M.current[s.getDate() - 1]);
86
+ p ? setTimeout(at, 0) : at();
87
87
  } else
88
88
  y();
89
89
  },
@@ -91,8 +91,8 @@ function Ut({
91
91
  l,
92
92
  y,
93
93
  w,
94
+ c,
94
95
  a,
95
- r,
96
96
  b,
97
97
  B,
98
98
  E
@@ -100,7 +100,7 @@ function Ut({
100
100
  ), S = o(
101
101
  (t) => {
102
102
  const e = w();
103
- if (e && e.dataset.date) {
103
+ if (e?.dataset.date) {
104
104
  const s = (/* @__PURE__ */ new Date(+e.dataset.date)).getMonth() + t;
105
105
  s >= 0 && s < Lt && l(M.current[s]);
106
106
  } else
@@ -110,7 +110,7 @@ function Ut({
110
110
  ), A = o(
111
111
  (t) => {
112
112
  const e = w();
113
- if (e && e.dataset.date) {
113
+ if (e?.dataset.date) {
114
114
  const s = (/* @__PURE__ */ new Date(+e.dataset.date)).getFullYear() + t, p = (/* @__PURE__ */ new Date()).getFullYear();
115
115
  s <= p && s > p - J.length && l(M.current[s]);
116
116
  } else
@@ -136,7 +136,7 @@ function Ut({
136
136
  e && N && N(+e);
137
137
  },
138
138
  [N]
139
- ), Yt = c(
139
+ ), et = r(
140
140
  () => ({
141
141
  ArrowLeft: () => f("prev"),
142
142
  ArrowRight: () => f("next"),
@@ -148,7 +148,7 @@ function Ut({
148
148
  PageDown: () => f("nextMonth")
149
149
  }),
150
150
  [f]
151
- ), St = c(
151
+ ), ot = r(
152
152
  () => ({
153
153
  ArrowLeft: () => S(-1),
154
154
  ArrowRight: () => S(1),
@@ -156,7 +156,7 @@ function Ut({
156
156
  ArrowDown: () => S(3)
157
157
  }),
158
158
  [S]
159
- ), At = c(
159
+ ), st = r(
160
160
  () => ({
161
161
  ArrowLeft: () => A(1),
162
162
  ArrowRight: () => A(-1),
@@ -164,23 +164,26 @@ function Ut({
164
164
  ArrowDown: () => A(-3)
165
165
  }),
166
166
  [A]
167
- ), et = {
168
- days: Yt,
169
- months: St,
170
- years: At
171
- }, L = o(
167
+ ), nt = r(
168
+ () => ({
169
+ days: et,
170
+ months: ot,
171
+ years: st
172
+ }),
173
+ [et, ot, st]
174
+ ), rt = o(
172
175
  (t) => {
173
- const e = et[H];
176
+ const e = nt[H];
174
177
  t.key in e && (e[t.key](), t.preventDefault());
175
178
  },
176
- [et, H]
179
+ [nt, H]
177
180
  );
178
- let ot = !1;
181
+ let L = !1;
179
182
  const bt = o(
180
183
  (t) => {
181
184
  const e = h && Ft(h, t.date);
182
185
  let n = e;
183
- return (!h || !ct(h, d)) && !ot && !t.disabled && (ot = !0, n = !0), {
186
+ return (!h || !ut(h, d)) && !L && !t.disabled && (L = !0, n = !0), {
184
187
  "data-date": t.date.getTime(),
185
188
  "aria-selected": e,
186
189
  ref: (s) => {
@@ -195,14 +198,15 @@ function Ut({
195
198
  [
196
199
  tt,
197
200
  D,
198
- L,
199
201
  Z,
200
202
  $,
201
- h
203
+ h,
204
+ L,
205
+ d
202
206
  ]
203
207
  ), kt = o(
204
208
  (t) => {
205
- const e = ct(d, t.date);
209
+ const e = ut(d, t.date);
206
210
  return {
207
211
  "data-date": t.date.getTime(),
208
212
  "aria-selected": e,
@@ -219,24 +223,24 @@ function Ut({
219
223
  [d, D, X, K]
220
224
  ), vt = o(
221
225
  ({ ref: t = null } = {}) => ({
222
- onKeyDown: L,
226
+ onKeyDown: rt,
223
227
  ref: Tt([t, P]),
224
228
  tabIndex: -1
225
229
  }),
226
- [L]
230
+ [rt]
227
231
  );
228
232
  return {
229
233
  activeMonth: d,
230
234
  activeYear: Y,
231
- weeks: Mt,
232
- months: wt,
233
- canSetPrevMonth: ht,
234
- canSetNextMonth: gt,
235
- highlighted: lt,
235
+ weeks: pt,
236
+ months: Yt,
237
+ canSetPrevMonth: wt,
238
+ canSetNextMonth: yt,
239
+ highlighted: Mt,
236
240
  setPrevMonth: E,
237
241
  setNextMonth: B,
238
- setNextYear: yt,
239
- setPrevYear: pt,
242
+ setNextYear: St,
243
+ setPrevYear: At,
240
244
  setMonthByDate: I,
241
245
  getDayProps: bt,
242
246
  getMonthProps: kt,
@@ -14,7 +14,9 @@ function j(e, t) {
14
14
  }, []);
15
15
  }
16
16
  function q(e, t) {
17
- return S({ start: u(e), end: E(e) }).map((n) => U(n, t));
17
+ return S({ start: u(e), end: E(e) }).map(
18
+ (n) => U(n, t)
19
+ );
18
20
  }
19
21
  function z(e, t) {
20
22
  return x({
@@ -23,13 +25,7 @@ function z(e, t) {
23
25
  }).reverse();
24
26
  }
25
27
  function H(e, t, n) {
26
- const {
27
- minDate: r,
28
- maxDate: i,
29
- selected: a,
30
- eventsMap: s = {},
31
- offDaysMap: o = {}
32
- } = n, f = o[e.getTime()], c = r && M(e, r) || i && b(e, i);
28
+ const { minDate: r, maxDate: i, selected: a, eventsMap: s = {}, offDaysMap: o = {} } = n, f = o[e.getTime()], c = r && M(e, r) || i && b(e, i);
33
29
  return {
34
30
  date: e,
35
31
  disabled: c || f,
@@ -53,7 +49,9 @@ function C(e, t, n) {
53
49
  return e && W(e, t, n).getTime() === new Date(e).getTime();
54
50
  }
55
51
  function G(e, t, n) {
56
- return new Intl.DateTimeFormat(t, { month: n ? "short" : "long" }).format(e);
52
+ return new Intl.DateTimeFormat(t, { month: n ? "short" : "long" }).format(
53
+ e
54
+ );
57
55
  }
58
56
  function J(e) {
59
57
  return e.reduce((t, n) => (t[k(n).getTime()] = !0, t), {});