urfu-ui-kit-react 2.1.7-next.4 → 2.1.7-next.5

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 (150) hide show
  1. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  2. package/dist/components/Accordion/Accordion.js +16 -15
  3. package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
  4. package/dist/components/BreadCrumbs/BreadCrumbs.js +23 -22
  5. package/dist/components/Button/Button.d.ts.map +1 -1
  6. package/dist/components/Button/Button.js +51 -50
  7. package/dist/components/Button/ButtonRefreshIcon.d.ts.map +1 -1
  8. package/dist/components/Button/ButtonRefreshIcon.js +9 -8
  9. package/dist/components/Calendar/Calendar.js +232 -232
  10. package/dist/components/Calendar/CalendarSelect.d.ts.map +1 -1
  11. package/dist/components/Calendar/CalendarSelect.js +41 -40
  12. package/dist/components/Card/Card.d.ts.map +1 -1
  13. package/dist/components/Card/Card.js +59 -58
  14. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  15. package/dist/components/Checkbox/Checkbox.js +20 -19
  16. package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
  17. package/dist/components/ColumnSettings/ColumnSettings.js +112 -111
  18. package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
  19. package/dist/components/ConfirmModal/ConfirmModal.js +30 -29
  20. package/dist/components/Drawer/Drawer.js +57 -57
  21. package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
  22. package/dist/components/ErrorScreen/ErrorScreen.js +151 -150
  23. package/dist/components/ErrorScreen/ErrorScreenIllustration.d.ts.map +1 -1
  24. package/dist/components/ErrorScreen/ErrorScreenIllustration.js +35 -34
  25. package/dist/components/FormField/FormField.d.ts.map +1 -1
  26. package/dist/components/FormField/FormField.js +30 -29
  27. package/dist/components/Icon/Icon.d.ts.map +1 -1
  28. package/dist/components/Icon/Icon.js +17 -16
  29. package/dist/components/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
  30. package/dist/components/InfiniteScroll/InfiniteScroll.js +23 -22
  31. package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts.map +1 -1
  32. package/dist/components/InputExpandTextarea/InputExpandTextarea.js +88 -87
  33. package/dist/components/InputFile/InputFile.d.ts.map +1 -1
  34. package/dist/components/InputFile/InputFile.js +99 -98
  35. package/dist/components/InputNumber/InputNumber.d.ts.map +1 -1
  36. package/dist/components/InputNumber/InputNumber.js +112 -111
  37. package/dist/components/InputText/InputAffix.d.ts.map +1 -1
  38. package/dist/components/InputText/InputAffix.js +69 -68
  39. package/dist/components/InputText/InputText.d.ts.map +1 -1
  40. package/dist/components/InputText/InputText.js +108 -107
  41. package/dist/components/InputTime/InputTime.d.ts.map +1 -1
  42. package/dist/components/InputTime/InputTime.js +202 -201
  43. package/dist/components/InputTime/InputTimeDropdown.d.ts.map +1 -1
  44. package/dist/components/InputTime/InputTimeDropdown.js +21 -20
  45. package/dist/components/Menu/Menu.d.ts.map +1 -1
  46. package/dist/components/Menu/Menu.js +58 -57
  47. package/dist/components/Message/Message.d.ts.map +1 -1
  48. package/dist/components/Message/Message.js +19 -18
  49. package/dist/components/Modal/Modal.js +66 -66
  50. package/dist/components/Modal/useModalTitleClearance.d.ts.map +1 -1
  51. package/dist/components/Modal/useModalTitleClearance.js +34 -33
  52. package/dist/components/Multiselect/Multiselect.js +222 -222
  53. package/dist/components/Notification/Notification.js +90 -90
  54. package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
  55. package/dist/components/OfflineBanner/OfflineBanner.js +40 -37
  56. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  57. package/dist/components/Pagination/Pagination.js +59 -58
  58. package/dist/components/Preloader/Preloader.d.ts.map +1 -1
  59. package/dist/components/Preloader/Preloader.js +28 -27
  60. package/dist/components/Radio/Radio.d.ts.map +1 -1
  61. package/dist/components/Radio/Radio.js +21 -20
  62. package/dist/components/Search/Search.d.ts.map +1 -1
  63. package/dist/components/Search/Search.js +33 -32
  64. package/dist/components/SearchSelect/SearchSelect.js +178 -178
  65. package/dist/components/SearchSelect/SearchSelectOption.d.ts.map +1 -1
  66. package/dist/components/SearchSelect/SearchSelectOption.js +21 -20
  67. package/dist/components/Select/MobileOptionSheet.d.ts.map +1 -1
  68. package/dist/components/Select/MobileOptionSheet.js +65 -64
  69. package/dist/components/Select/Select.js +184 -184
  70. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
  71. package/dist/components/Skeleton/Skeleton.js +26 -25
  72. package/dist/components/Status/Status.d.ts.map +1 -1
  73. package/dist/components/Status/Status.js +36 -35
  74. package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
  75. package/dist/components/StickyActionBar/StickyActionBar.js +36 -35
  76. package/dist/components/Switch/Switch.d.ts.map +1 -1
  77. package/dist/components/Switch/Switch.js +19 -18
  78. package/dist/components/Table/Filter/DefaultInput.d.ts.map +1 -1
  79. package/dist/components/Table/Filter/DefaultInput.js +12 -11
  80. package/dist/components/Table/Filter/Filter.d.ts.map +1 -1
  81. package/dist/components/Table/Filter/Filter.js +99 -98
  82. package/dist/components/Table/Filter/FilterBooleanBox.d.ts.map +1 -1
  83. package/dist/components/Table/Filter/FilterBooleanBox.js +7 -6
  84. package/dist/components/Table/Filter/FilterBoxShell.js +48 -48
  85. package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
  86. package/dist/components/Table/Filter/FilterDateBox.js +65 -64
  87. package/dist/components/Table/Filter/FilterSortIndicator.d.ts.map +1 -1
  88. package/dist/components/Table/Filter/FilterSortIndicator.js +8 -7
  89. package/dist/components/Table/Filter/SelectFilter.js +53 -53
  90. package/dist/components/Table/Filter/TableFilterOptions.d.ts.map +1 -1
  91. package/dist/components/Table/Filter/TableFilterOptions.js +141 -140
  92. package/dist/components/Table/Filter/TableFilterSortButton.d.ts.map +1 -1
  93. package/dist/components/Table/Filter/TableFilterSortButton.js +10 -9
  94. package/dist/components/Table/Filter/useVirtualOptionWindow.d.ts.map +1 -1
  95. package/dist/components/Table/Filter/useVirtualOptionWindow.js +9 -8
  96. package/dist/components/Table/Skeleton/createSkeletonColumns.d.ts.map +1 -1
  97. package/dist/components/Table/Skeleton/createSkeletonColumns.js +9 -8
  98. package/dist/components/Table/Table.d.ts.map +1 -1
  99. package/dist/components/Table/Table.helpers.d.ts.map +1 -1
  100. package/dist/components/Table/Table.helpers.js +31 -30
  101. package/dist/components/Table/Table.js +253 -252
  102. package/dist/components/Table/TableHead.d.ts.map +1 -1
  103. package/dist/components/Table/TableHead.js +92 -91
  104. package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
  105. package/dist/components/Table/TableMobileCard.js +121 -120
  106. package/dist/components/Table/TableMobileFilters.d.ts.map +1 -1
  107. package/dist/components/Table/TableMobileFilters.js +28 -27
  108. package/dist/components/Table/TableMobileView.d.ts.map +1 -1
  109. package/dist/components/Table/TableMobileView.js +178 -177
  110. package/dist/components/Table/TableRow.d.ts.map +1 -1
  111. package/dist/components/Table/TableRow.js +59 -58
  112. package/dist/components/Table/useTableColumnPinning.d.ts +2 -917
  113. package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
  114. package/dist/components/Table/useTableColumnPinning.js +21 -20
  115. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  116. package/dist/components/Tabs/Tabs.js +102 -101
  117. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  118. package/dist/components/Textarea/Textarea.js +70 -69
  119. package/dist/components/Tooltip/Tooltip.js +106 -106
  120. package/dist/components/TreeView/TreeView.js +183 -183
  121. package/dist/components/VirtualList/VirtualList.d.ts.map +1 -1
  122. package/dist/components/VirtualList/VirtualList.js +42 -41
  123. package/dist/dev/index.js +1 -1
  124. package/dist/hooks/useAutoId.d.ts.map +1 -1
  125. package/dist/hooks/useAutoId.js +7 -6
  126. package/dist/hooks/useSelectEngine.d.ts.map +1 -1
  127. package/dist/hooks/useSelectEngine.js +31 -30
  128. package/dist/index.d.ts +2 -1
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/responsive/uiKitResponsive.d.ts +6 -0
  131. package/dist/responsive/uiKitResponsive.d.ts.map +1 -1
  132. package/dist/responsive/uiKitResponsive.js +27 -26
  133. package/dist/shared/kitCopy.js +1 -1
  134. package/dist/shared/optionStateColors.d.ts +3 -2
  135. package/dist/shared/optionStateColors.d.ts.map +1 -1
  136. package/dist/shared/optionStateColors.js +9 -4
  137. package/dist/shared/popupTransition.d.ts.map +1 -1
  138. package/dist/shared/popupTransition.js +7 -6
  139. package/dist/shared/sheetTitle.d.ts +2 -1
  140. package/dist/shared/sheetTitle.d.ts.map +1 -1
  141. package/dist/shared/size.d.ts.map +1 -1
  142. package/dist/shared/size.js +3 -2
  143. package/dist/shared/uiKitDefaults.d.ts +21 -0
  144. package/dist/shared/uiKitDefaults.d.ts.map +1 -1
  145. package/dist/shared/uiKitDefaults.js +32 -18
  146. package/dist/style.shell.lk.css +53 -0
  147. package/dist/urfu-ui-kit-react.js +27 -26
  148. package/dist/vanilla/core/describeError.js +1 -1
  149. package/dist/vanilla/core/sheetTitle.js +7 -7
  150. package/package.json +3 -1
@@ -1,101 +1,102 @@
1
- import { jsx as i, Fragment as B, jsxs as f } from "react/jsx-runtime";
2
- import { useRef as D, useEffect as h, useState as F } from "react";
1
+ import { jsx as r, Fragment as B, jsxs as h } from "react/jsx-runtime";
2
+ import { useRef as C, useEffect as b, useState as D } from "react";
3
3
  /* empty css */
4
- import { useAutoId$u as O } from "../../hooks/useAutoId.js";
4
+ import { useAutoId$u as F } from "../../hooks/useAutoId.js";
5
5
  /* empty css */
6
- import { isPlainLeftClick$u as R } from "../../vanilla/core/linkClick.js";
7
- const H = ({
8
- onClickSection: a,
9
- onClickSwitchMenu: l,
10
- showMenu: s,
11
- menuData: b,
12
- activeSection: o,
13
- type: x = "collapsible",
14
- paddingUl: g = "32px 16px 32px 14px",
15
- className: w = "",
16
- foldedWidth: y = "1px",
17
- statisticsCard: $,
18
- maxWidth: v,
19
- minWidth: N,
20
- overlayMaxWidth: r = 1100,
21
- LinkComponent: u,
6
+ import { kitCls$u as i, kitClasses$u as O, getUiKitPrefix$u as R } from "../../shared/uiKitDefaults.js";
7
+ import { isPlainLeftClick$u as q } from "../../vanilla/core/linkClick.js";
8
+ const S = ({
9
+ onClickSection: o,
10
+ onClickSwitchMenu: s,
11
+ showMenu: a,
12
+ menuData: x,
13
+ activeSection: m,
14
+ type: g = "collapsible",
15
+ paddingUl: w = "32px 16px 32px 14px",
16
+ className: y = "",
17
+ foldedWidth: $ = "1px",
18
+ statisticsCard: v,
19
+ maxWidth: N,
20
+ minWidth: k,
21
+ overlayMaxWidth: l = 1100,
22
+ LinkComponent: d,
22
23
  id: E
23
24
  }) => {
24
- const m = D(null), d = O(E, "u-collapsible-menu"), L = u, k = (e) => typeof e == "number" ? `${e}px` : String(e), p = (e) => {
25
+ const u = C(null), p = F(E, i("collapsible-menu")), L = d, P = (e) => typeof e == "number" ? `${e}px` : String(e), f = (e) => {
25
26
  if (e == null) return;
26
27
  if (typeof e == "number")
27
28
  return `calc(${e} * var(--u-unit, 1px))`;
28
29
  const t = String(e).trim(), n = t.match(/^(-?\d+(?:\.\d+)?)px$/i);
29
30
  return n ? `calc(${n[1]} * var(--u-unit, 1px))` : t;
30
31
  }, I = (e) => e && e.replaceAll(/(-?\d+(?:\.\d+)?)px\b/gi, (t, n) => `calc(${n} * var(--u-unit, 1px))`);
31
- h(() => {
32
- if (s || typeof l != "function") return;
32
+ b(() => {
33
+ if (a || typeof s != "function") return;
33
34
  const e = (t) => {
34
35
  var c;
35
- if (!window.matchMedia(`(max-width: ${r}px)`).matches) return;
36
+ if (!window.matchMedia(`(max-width: ${l}px)`).matches) return;
36
37
  const n = t.target;
37
- n && ((c = m.current) != null && c.contains(n) || l(!0));
38
+ n && ((c = u.current) != null && c.contains(n) || s(!0));
38
39
  };
39
40
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
40
- }, [l, s, r]);
41
- const [P, j] = F(
42
- () => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(`(max-width: ${r}px)`).matches : !1
41
+ }, [s, a, l]);
42
+ const [U, j] = D(
43
+ () => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(`(max-width: ${l}px)`).matches : !1
43
44
  );
44
- h(() => {
45
+ b(() => {
45
46
  if (typeof window > "u" || typeof window.matchMedia != "function") return;
46
- const e = window.matchMedia(`(max-width: ${r}px)`), t = () => j(e.matches);
47
+ const e = window.matchMedia(`(max-width: ${l}px)`), t = () => j(e.matches);
47
48
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
48
- }, [r]);
49
- const A = P ? "u-collapsible-menu--overlay" : "";
50
- return /* @__PURE__ */ i(B, { children: x === "collapsible" && /* @__PURE__ */ f(
49
+ }, [l]);
50
+ const A = U ? i("collapsible-menu--overlay") : "";
51
+ return /* @__PURE__ */ r(B, { children: g === "collapsible" && /* @__PURE__ */ h(
51
52
  "div",
52
53
  {
53
- ref: m,
54
+ ref: u,
54
55
  style: {
55
56
  height: "100%",
56
- "--max-width": k(y),
57
+ "--max-width": P($),
57
58
  width: "100%"
58
59
  },
59
- className: `u-collapsible-menu ${A} ${w}`.trim(),
60
+ className: `${R()}-collapsible-menu ${A} ${y}`.trim(),
60
61
  children: [
61
- /* @__PURE__ */ i(
62
+ /* @__PURE__ */ r(
62
63
  "input",
63
64
  {
64
- className: "u-collapsible-menu-input",
65
+ className: i("collapsible-menu-input"),
65
66
  type: "checkbox",
66
- name: "u-collapsible-menu",
67
- id: d,
68
- checked: s,
69
- onChange: (e) => l(e.target.checked)
67
+ name: i("collapsible-menu"),
68
+ id: p,
69
+ checked: a,
70
+ onChange: (e) => s(e.target.checked)
70
71
  }
71
72
  ),
72
- /* @__PURE__ */ i("label", { className: "u-collapsible-menu-toggle", htmlFor: d }),
73
- /* @__PURE__ */ f(
73
+ /* @__PURE__ */ r("label", { className: i("collapsible-menu-toggle"), htmlFor: p }),
74
+ /* @__PURE__ */ h(
74
75
  "div",
75
76
  {
76
- className: "u-collapsible-menu-body",
77
+ className: i("collapsible-menu-body"),
77
78
  style: {
78
79
  height: "100%",
79
- "--max-width-body": p(v)
80
+ "--max-width-body": f(N)
80
81
  },
81
82
  children: [
82
- /* @__PURE__ */ i(
83
+ /* @__PURE__ */ r(
83
84
  "ul",
84
85
  {
85
- className: "u-collapsible-menu-list",
86
- style: { padding: I(g), minWidth: p(N) },
87
- children: b.map((e, t) => {
88
- const n = o == e.id ? "page" : void 0;
89
- return /* @__PURE__ */ i(
86
+ className: i("collapsible-menu-list"),
87
+ style: { padding: I(w), minWidth: f(k) },
88
+ children: x.map((e, t) => {
89
+ const n = m == e.id ? "page" : void 0;
90
+ return /* @__PURE__ */ r(
90
91
  "li",
91
92
  {
92
- className: o == e.id ? "u-collapsible-menu-list-item u-menu-active" : "u-collapsible-menu-list-item",
93
+ className: m == e.id ? O("collapsible-menu-list-item", "menu-active") : i("collapsible-menu-list-item"),
93
94
  id: String(e.id),
94
- onClick: (c) => a && R(c) && a(e),
95
- children: u ? /* @__PURE__ */ i(L, { to: e.url, className: "u-collapsible-menu-list-item-link", "aria-current": n, children: e.title }) : /* @__PURE__ */ i(
95
+ onClick: (c) => o && q(c) && o(e),
96
+ children: d ? /* @__PURE__ */ r(L, { to: e.url, className: i("collapsible-menu-list-item-link"), "aria-current": n, children: e.title }) : /* @__PURE__ */ r(
96
97
  "a",
97
98
  {
98
- className: "u-collapsible-menu-list-item-link",
99
+ className: i("collapsible-menu-list-item-link"),
99
100
  href: e.url,
100
101
  "aria-current": n,
101
102
  children: e.title
@@ -107,7 +108,7 @@ const H = ({
107
108
  })
108
109
  }
109
110
  ),
110
- $
111
+ v
111
112
  ]
112
113
  }
113
114
  )
@@ -115,4 +116,4 @@ const H = ({
115
116
  }
116
117
  ) });
117
118
  };
118
- export { H as Menu$u };
119
+ export { S as Menu$u };
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,eAAO,MAAM,OAAO,GAAI,wCAKrB,iBAAiB,4CA2BnB,CAAA"}
1
+ {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGnD,eAAO,MAAM,OAAO,GAAI,wCAKrB,iBAAiB,4CA2BnB,CAAA"}
@@ -1,29 +1,30 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as c } from "react/jsx-runtime";
2
2
  /* empty css */
3
3
  /* empty css */
4
- const g = ({
5
- size: e = "medium",
6
- variant: s = "info",
7
- children: a,
8
- className: m = ""
9
- }) => /* @__PURE__ */ i("div", { className: `${((r, u) => {
10
- switch (`${r}-${u}`) {
4
+ import { kitCls$u as s } from "../../shared/uiKitDefaults.js";
5
+ const f = ({
6
+ size: a = "medium",
7
+ variant: e = "info",
8
+ children: m,
9
+ className: r = ""
10
+ }) => /* @__PURE__ */ c("div", { className: `${((i, l) => {
11
+ switch (`${i}-${l}`) {
11
12
  case "medium-info":
12
- return "u-message";
13
+ return s("message");
13
14
  case "medium-fail":
14
- return "u-message-fail";
15
+ return s("message-fail");
15
16
  case "medium-success":
16
- return "u-message-success";
17
+ return s("message-success");
17
18
  case "medium-warning":
18
- return "u-message-warning";
19
+ return s("message-warning");
19
20
  case "small-info":
20
- return "u-message-small";
21
+ return s("message-small");
21
22
  case "small-fail":
22
- return "u-message-small-fail";
23
+ return s("message-small-fail");
23
24
  case "small-success":
24
- return "u-message-small-success";
25
+ return s("message-small-success");
25
26
  case "small-warning":
26
- return "u-message-small-warning";
27
+ return s("message-small-warning");
27
28
  }
28
- })(e, s)} ${m}`, role: s === "fail" || s === "warning" ? "alert" : void 0, children: a });
29
- export { g as Message$u };
29
+ })(a, e)} ${r}`, role: e === "fail" || e === "warning" ? "alert" : void 0, children: m });
30
+ export { f as Message$u };
@@ -1,105 +1,105 @@
1
- import { jsx as a, jsxs as I } from "react/jsx-runtime";
2
- import { useRef as F, useState as H, useInsertionEffect as L, useLayoutEffect as R, useEffect as l } from "react";
3
- import { createPortal as z } from "react-dom";
4
- import { useMountTransition$u as O } from "../../hooks/useMountTransition.js";
1
+ import { jsx as a, jsxs as H } from "react/jsx-runtime";
2
+ import { useRef as L, useState as R, useInsertionEffect as U, useLayoutEffect as z, useEffect as c } from "react";
3
+ import { createPortal as O } from "react-dom";
4
+ import { useMountTransition$u as q } from "../../hooks/useMountTransition.js";
5
5
  /* empty css */
6
- import { useModalFocus$u as U, ModalFocusContext$u as q, isTopModal$u as B } from "./useModalFocus.js";
7
- import { isEditorPopupTarget$u as G } from "./editorFocus.js";
8
- import { useModalTitleClearance$u as J } from "./useModalTitleClearance.js";
6
+ import { useModalFocus$u as B, ModalFocusContext$u as G, isTopModal$u as J } from "./useModalFocus.js";
7
+ import { isEditorPopupTarget$u as Q } from "./editorFocus.js";
8
+ import { useModalTitleClearance$u as V } from "./useModalTitleClearance.js";
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  /* empty css */
13
- import { getPortalScopeProps$u as Q, getUiKitDefaults$u as V } from "../../shared/uiKitDefaults.js";
14
- import { MOTION_EASE$u as W, motionMs$u as X, MOTION_MS$u as x } from "../../vanilla/core/motion.js";
15
- import { lockKitScroll$u as Y, ownKitNode$u as Z, isKitEventHandled$u as oo, markKitEventHandled$u as eo } from "../../vanilla/core/kitRegistry.js";
16
- const Eo = ({
17
- onCancel: n,
18
- active: e,
13
+ import { kitCls$u as l, getUiKitPrefix$u as d, kitClasses$u as W, getPortalScopeProps$u as X, getUiKitDefaults$u as Y } from "../../shared/uiKitDefaults.js";
14
+ import { MOTION_EASE$u as Z, motionMs$u as ee, MOTION_MS$u as v } from "../../vanilla/core/motion.js";
15
+ import { lockKitScroll$u as oe, ownKitNode$u as te, isKitEventHandled$u as re, markKitEventHandled$u as se } from "../../vanilla/core/kitRegistry.js";
16
+ const Me = ({
17
+ onCancel: i,
18
+ active: o,
19
19
  ariaLabel: N,
20
- ariaLabelledBy: m,
21
- children: c,
20
+ ariaLabelledBy: f,
21
+ children: p,
22
22
  maxWidth: _ = "900px",
23
- maxHeight: k,
23
+ maxHeight: P,
24
24
  className: w = "",
25
- height: P = "",
26
- notCloseClickOnBack: f,
25
+ height: K = "",
26
+ notCloseClickOnBack: y,
27
27
  closeOnEscape: S,
28
- closeButtonInside: p = !1,
29
- lockScroll: y = !1,
28
+ closeButtonInside: b = !1,
29
+ lockScroll: g = !1,
30
30
  unmountOnClose: T = !1,
31
31
  portalOn: s = !0,
32
- trapFocus: $ = !0,
33
- initialFocus: K = "first",
34
- mobileSheet: A
32
+ trapFocus: C = !0,
33
+ initialFocus: A = "first",
34
+ mobileSheet: j
35
35
  }) => {
36
- const b = A ?? V().mobileSheets, i = F(null), [o] = H(
36
+ const E = j ?? Y().mobileSheets, n = L(null), [e] = R(
37
37
  () => typeof document > "u" ? null : document.createElement("div")
38
38
  );
39
- L(() => {
40
- if (!(!s || !o))
41
- return o.className = "u-react-modal-portal", document.body.appendChild(o), () => o.remove();
42
- }, [s, o]), R(() => {
43
- if (!s || !o) return;
44
- const t = Q()["data-u-kit"];
45
- if (t ? o.setAttribute("data-u-kit", t) : o.removeAttribute("data-u-kit"), e) {
39
+ U(() => {
40
+ if (!(!s || !e))
41
+ return e.className = "u-react-modal-portal", document.body.appendChild(e), () => e.remove();
42
+ }, [s, e]), z(() => {
43
+ if (!s || !e) return;
44
+ const t = X()["data-u-kit"];
45
+ if (t ? e.setAttribute("data-u-kit", t) : e.removeAttribute("data-u-kit"), o) {
46
46
  const r = document.activeElement;
47
- document.body.appendChild(o), r instanceof HTMLElement && o.contains(r) && r.focus({ preventScroll: !0 });
47
+ document.body.appendChild(e), r instanceof HTMLElement && e.contains(r) && r.focus({ preventScroll: !0 });
48
48
  }
49
- }, [e, s, o]);
50
- const { shouldRender: g, status: j, isAnimated: C } = O({
51
- isOpen: !!e,
52
- duration: b ? x.base : x.fast
53
- }), d = C && j === "exiting", E = !!e || d, h = d ? { opacity: 0, transition: `opacity ${X("fast")}ms ${W.exit}` } : null, { scope: u, onFocusCapture: D } = U(i, !!e, $, K);
54
- J(i, E, m, c, p);
55
- const M = S ?? !f;
56
- if (l(() => {
57
- if (!e || !M || typeof n != "function") return;
49
+ }, [o, s, e]);
50
+ const { shouldRender: h, status: D, isAnimated: I } = q({
51
+ isOpen: !!o,
52
+ duration: E ? v.base : v.fast
53
+ }), u = I && D === "exiting", M = !!o || u, $ = u ? { opacity: 0, transition: `opacity ${ee("fast")}ms ${Z.exit}` } : null, { scope: m, onFocusCapture: F } = B(n, !!o, C, A);
54
+ V(n, M, f, p, b);
55
+ const x = S ?? !y;
56
+ if (c(() => {
57
+ if (!o || !x || typeof i != "function") return;
58
58
  const t = (r) => {
59
- r.key !== "Escape" || r.defaultPrevented || oo(r) || !B(u) || G(i.current, r.target) || (eo(r), n(r));
59
+ r.key !== "Escape" || r.defaultPrevented || re(r) || !J(m) || Q(n.current, r.target) || (se(r), i(r));
60
60
  };
61
61
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
62
- }, [e, M, n, u]), l(() => {
63
- if (!(!e || !y))
64
- return Y();
65
- }, [e, y]), l(() => {
66
- const t = i.current;
67
- return t ? Z(t) : void 0;
68
- }, [g, s]), T && !g) return null;
69
- const v = /* @__PURE__ */ a(q.Provider, { value: u, children: /* @__PURE__ */ a(
62
+ }, [o, x, i, m]), c(() => {
63
+ if (!(!o || !g))
64
+ return oe();
65
+ }, [o, g]), c(() => {
66
+ const t = n.current;
67
+ return t ? te(t) : void 0;
68
+ }, [h, s]), T && !h) return null;
69
+ const k = /* @__PURE__ */ a(G.Provider, { value: m, children: /* @__PURE__ */ a(
70
70
  "div",
71
71
  {
72
- className: `${E ? "u-modal u-modal-active" : "u-modal"}${b ? " u-react-modal-sheet" : ""}${d ? " u-react-modal-closing" : ""} ${w}`,
72
+ className: `${M ? W("modal", "modal-active") : l("modal")}${E ? ` ${d()}-react-modal-sheet` : ""}${u ? ` ${d()}-react-modal-closing` : ""} ${w}`,
73
73
  style: { backgroundColor: "unset" },
74
- onMouseDown: f ? () => {
75
- } : n,
76
- children: /* @__PURE__ */ a("div", { className: "u-modal__container", style: Object.assign({ backgroundColor: "var(--u-modal-overlay, #0006)" }, h), children: /* @__PURE__ */ I(
74
+ onMouseDown: y ? () => {
75
+ } : i,
76
+ children: /* @__PURE__ */ a("div", { className: l("modal__container"), style: Object.assign({ backgroundColor: `var(--${d()}-modal-overlay, #0006)` }, $), children: /* @__PURE__ */ H(
77
77
  "div",
78
78
  {
79
- className: `u-modal__body${p ? " u-modal__body--close-inside" : ""}`,
80
- ref: i,
79
+ className: `${d()}-modal__body${b ? ` ${d()}-modal__body--close-inside` : ""}`,
80
+ ref: n,
81
81
  tabIndex: -1,
82
- onFocusCapture: D,
82
+ onFocusCapture: F,
83
83
  role: "dialog",
84
84
  "aria-label": N,
85
- "aria-labelledby": m,
86
- "aria-modal": e || void 0,
87
- "aria-hidden": !e || void 0,
85
+ "aria-labelledby": f,
86
+ "aria-modal": o || void 0,
87
+ "aria-hidden": !o || void 0,
88
88
  onMouseDown: (t) => {
89
89
  t.stopPropagation();
90
90
  },
91
91
  style: Object.assign(
92
- { width: "100%", maxWidth: _, height: P, maxHeight: k, zIndex: 1001 },
93
- h
92
+ { width: "100%", maxWidth: _, height: K, maxHeight: P, zIndex: 1001 },
93
+ $
94
94
  ),
95
95
  children: [
96
- c,
97
- /* @__PURE__ */ a("div", { className: "u-modal__exit", children: /* @__PURE__ */ a("button", { className: "u-button-cross", onClick: n, "aria-label": "Закрыть" }) })
96
+ p,
97
+ /* @__PURE__ */ a("div", { className: l("modal__exit"), children: /* @__PURE__ */ a("button", { className: l("button-cross"), onClick: i, "aria-label": "Закрыть" }) })
98
98
  ]
99
99
  }
100
100
  ) })
101
101
  }
102
102
  ) });
103
- return !s || !o ? v : z(v, o);
103
+ return !s || !e ? k : O(k, e);
104
104
  };
105
- export { Eo as Modal$u };
105
+ export { Me as Modal$u };
@@ -1 +1 @@
1
- {"version":3,"file":"useModalTitleClearance.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/useModalTitleClearance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgClD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,GAC/B,SAAS,SAAS,CAAC,cAAc,CAAC,EAClC,QAAQ,OAAO,EACf,YAAY,MAAM,GAAG,SAAS,EAC9B,UAAU,SAAS,EACnB,mBAAmB,OAAO,SAiE7B,CAAC"}
1
+ {"version":3,"file":"useModalTitleClearance.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/useModalTitleClearance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiClD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,GAC/B,SAAS,SAAS,CAAC,cAAc,CAAC,EAClC,QAAQ,OAAO,EACf,YAAY,MAAM,GAAG,SAAS,EAC9B,UAAU,SAAS,EACnB,mBAAmB,OAAO,SAiE7B,CAAC"}
@@ -1,48 +1,49 @@
1
1
  import { useLayoutEffect as v } from "react";
2
- const F = (r, g, p, b, w) => {
3
- var o, f, m;
4
- const t = r.ownerDocument.defaultView, a = t == null ? void 0 : t.getComputedStyle(r), e = g.top + (Number.parseFloat((a == null ? void 0 : a.borderTopWidth) ?? "") || 0) + (Number.parseFloat((a == null ? void 0 : a.paddingTop) ?? "") || 0), i = Math.max(0, p - e + b), l = (f = (o = r.ownerDocument).createRange) == null ? void 0 : f.call(o);
5
- l == null || l.selectNodeContents(r);
6
- const s = [...((m = l == null ? void 0 : l.getClientRects) == null ? void 0 : m.call(l)) ?? []].filter((c) => c.width > 0 || c.height > 0).map((c) => (c.top + c.bottom) / 2 + w / 2);
7
- if (s.length === 0) return i;
8
- const h = Math.max(...s) - e;
9
- if (i <= h) return i;
10
- const d = r.nextElementSibling, n = Math.max(
2
+ import { getUiKitPrefix$u as i } from "../../shared/uiKitDefaults.js";
3
+ const F = (c, f, h, $, x) => {
4
+ var o, y, p;
5
+ const t = c.ownerDocument.defaultView, a = t == null ? void 0 : t.getComputedStyle(c), e = f.top + (Number.parseFloat((a == null ? void 0 : a.borderTopWidth) ?? "") || 0) + (Number.parseFloat((a == null ? void 0 : a.paddingTop) ?? "") || 0), r = Math.max(0, h - e + $), l = (y = (o = c.ownerDocument).createRange) == null ? void 0 : y.call(o);
6
+ l == null || l.selectNodeContents(c);
7
+ const m = [...((p = l == null ? void 0 : l.getClientRects) == null ? void 0 : p.call(l)) ?? []].filter((s) => s.width > 0 || s.height > 0).map((s) => (s.top + s.bottom) / 2 + x / 2);
8
+ if (m.length === 0) return r;
9
+ const g = Math.max(...m) - e;
10
+ if (r <= g) return r;
11
+ const d = c.nextElementSibling, n = Math.max(
11
12
  0,
12
13
  Number.parseFloat((a == null ? void 0 : a.marginBottom) ?? "") || 0,
13
14
  d && t && Number.parseFloat(t.getComputedStyle(d).marginTop) || 0
14
15
  );
15
- return Math.min(i, Math.max(h, p - e - n));
16
- }, A = (r, g, p, b, w) => {
16
+ return Math.min(r, Math.max(g, h - e - n));
17
+ }, A = (c, f, h, $, x) => {
17
18
  v(() => {
18
- const t = r.current;
19
- if (!g || !t) return;
20
- const e = (p ?? "").split(/\s+/).map((o) => t.ownerDocument.getElementById(o)).find((o) => (o == null ? void 0 : o.closest(".u-modal__body")) === t) ?? [...t.querySelectorAll("h1, h2, h3, h4, h5, h6")].find((o) => o.closest(".u-modal__body") === t), i = t.querySelector(":scope > .u-modal__exit > button"), l = t.ownerDocument.defaultView;
21
- if (!e || !i || !l || ["flex", "inline-flex", "grid", "inline-grid"].includes(l.getComputedStyle(e).display)) return;
22
- t.setAttribute("data-u-modal-has-title", "");
23
- let s = 0;
24
- const h = () => {
25
- const o = e.getBoundingClientRect(), f = i.getBoundingClientRect(), m = t.getBoundingClientRect(), c = l.getComputedStyle(e), x = Number.parseFloat(c.lineHeight) || (Number.parseFloat(c.fontSize) || 16) * 1.2, C = t.offsetWidth > 0 && m.width > 0 ? m.width / t.offsetWidth : 1;
19
+ const t = c.current;
20
+ if (!f || !t) return;
21
+ const e = (h ?? "").split(/\s+/).map((o) => t.ownerDocument.getElementById(o)).find((o) => (o == null ? void 0 : o.closest(`.${i()}-modal__body`)) === t) ?? [...t.querySelectorAll("h1, h2, h3, h4, h5, h6")].find((o) => o.closest(`.${i()}-modal__body`) === t), r = t.querySelector(`:scope > .${i()}-modal__exit > button`), l = t.ownerDocument.defaultView;
22
+ if (!e || !r || !l || ["flex", "inline-flex", "grid", "inline-grid"].includes(l.getComputedStyle(e).display)) return;
23
+ t.setAttribute(`data-${i()}-modal-has-title`, "");
24
+ let m = 0;
25
+ const g = () => {
26
+ const o = e.getBoundingClientRect(), y = r.getBoundingClientRect(), p = t.getBoundingClientRect(), s = l.getComputedStyle(e), w = Number.parseFloat(s.lineHeight) || (Number.parseFloat(s.fontSize) || 16) * 1.2, C = t.offsetWidth > 0 && p.width > 0 ? p.width / t.offsetWidth : 1;
26
27
  t.style.setProperty(
27
- "--u-modal-title-close-top",
28
- `${(o.top - m.top - f.height / 2) / C + x / 2}px`
28
+ `--${i()}-modal-title-close-top`,
29
+ `${(o.top - p.top - y.height / 2) / C + w / 2}px`
29
30
  );
30
- const u = i.getBoundingClientRect(), y = Number.parseFloat(l.getComputedStyle(t).getPropertyValue("--u-modal-title-gap")) || 8;
31
- u.left < o.right + y && u.right > o.left && u.bottom + y > o.top && u.top < o.bottom ? (e.setAttribute("data-u-modal-title-clearance", ""), e.style.setProperty(
32
- "--u-modal-title-clearance-width",
33
- `${Math.min(o.width, Math.max(0, o.right - u.left + y))}px`
31
+ const u = r.getBoundingClientRect(), b = Number.parseFloat(l.getComputedStyle(t).getPropertyValue(`--${i()}-modal-title-gap`)) || 8;
32
+ u.left < o.right + b && u.right > o.left && u.bottom + b > o.top && u.top < o.bottom ? (e.setAttribute(`data-${i()}-modal-title-clearance`, ""), e.style.setProperty(
33
+ `--${i()}-modal-title-clearance-width`,
34
+ `${Math.min(o.width, Math.max(0, o.right - u.left + b))}px`
34
35
  ), e.style.setProperty(
35
- "--u-modal-title-clearance-height",
36
- `${F(e, o, u.bottom, y, x)}px`
37
- )) : (e.removeAttribute("data-u-modal-title-clearance"), e.style.removeProperty("--u-modal-title-clearance-width"), e.style.removeProperty("--u-modal-title-clearance-height"));
36
+ `--${i()}-modal-title-clearance-height`,
37
+ `${F(e, o, u.bottom, b, w)}px`
38
+ )) : (e.removeAttribute(`data-${i()}-modal-title-clearance`), e.style.removeProperty(`--${i()}-modal-title-clearance-width`), e.style.removeProperty(`--${i()}-modal-title-clearance-height`));
38
39
  }, d = () => {
39
- l.cancelAnimationFrame(s), s = l.requestAnimationFrame(h);
40
+ l.cancelAnimationFrame(m), m = l.requestAnimationFrame(g);
40
41
  };
41
- h();
42
+ g();
42
43
  const n = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
43
- return n == null || n.observe(t), n == null || n.observe(e), n == null || n.observe(i), l.addEventListener("resize", d), () => {
44
- n == null || n.disconnect(), l.removeEventListener("resize", d), l.cancelAnimationFrame(s), t.removeAttribute("data-u-modal-has-title"), t.style.removeProperty("--u-modal-title-close-top"), e.removeAttribute("data-u-modal-title-clearance"), e.style.removeProperty("--u-modal-title-clearance-width"), e.style.removeProperty("--u-modal-title-clearance-height");
44
+ return n == null || n.observe(t), n == null || n.observe(e), n == null || n.observe(r), l.addEventListener("resize", d), () => {
45
+ n == null || n.disconnect(), l.removeEventListener("resize", d), l.cancelAnimationFrame(m), t.removeAttribute(`data-${i()}-modal-has-title`), t.style.removeProperty(`--${i()}-modal-title-close-top`), e.removeAttribute(`data-${i()}-modal-title-clearance`), e.style.removeProperty(`--${i()}-modal-title-clearance-width`), e.style.removeProperty(`--${i()}-modal-title-clearance-height`);
45
46
  };
46
- }, [r, g, p, b, w]);
47
+ }, [c, f, h, $, x]);
47
48
  };
48
49
  export { A as useModalTitleClearance$u };