@pgcorp/ui-kit 0.14.0 → 0.15.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 (117) hide show
  1. package/README.md +330 -12
  2. package/dist/assets/src/components/layout/{SResizeHandle.vue_vue_type_style_index_0_scoped_13b9b27a_lang.css → SResizeHandle.vue_vue_type_style_index_0_scoped_dc65aba1_lang.css} +1 -1
  3. package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_a108e8f1_scoped_a108e8f1_lang.css +2 -0
  4. package/dist/assets/src/components/shared/containers/{SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css → SCollapsiblePanel.css_vue_type_style_index_0_src_db85261d_scoped_db85261d_lang.css} +1 -1
  5. package/dist/assets/src/components/shared/containers/{SOverlayHost.css_vue_type_style_index_0_src_8f9be94e_scoped_8f9be94e_lang.css → SOverlayHost.css_vue_type_style_index_0_src_09215628_scoped_09215628_lang.css} +1 -1
  6. package/dist/assets/src/components/shared/containers/{SPopover.css_vue_type_style_index_0_src_4091d007_scoped_4091d007_lang.css → SPopover.css_vue_type_style_index_0_src_a4f1f64a_scoped_a4f1f64a_lang.css} +1 -1
  7. package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_52396e42_scoped_52396e42_lang.css +2 -0
  8. package/dist/assets/src/components/shared/controls/SButton.css_vue_type_style_index_0_src_7a5acda9_scoped_7a5acda9_lang.css +1 -1
  9. package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_2562f916_scoped_2562f916_lang.css +2 -0
  10. package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_d630c922_scoped_d630c922_lang.css +2 -0
  11. package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_43b6e378_scoped_43b6e378_lang.css +1 -0
  12. package/dist/assets/src/components/shared/controls/{SDropdownMenu.css_vue_type_style_index_0_src_857e2649_scoped_857e2649_lang.css → SDropdownMenu.css_vue_type_style_index_0_src_40040ae5_scoped_40040ae5_lang.css} +1 -1
  13. package/dist/assets/src/components/shared/controls/{SMenuSurface.css_vue_type_style_index_0_src_84109ad9_scoped_84109ad9_lang.css → SMenuSurface.css_vue_type_style_index_0_src_d2b7d71b_scoped_d2b7d71b_lang.css} +1 -1
  14. package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_d1ead6c0_scoped_d1ead6c0_lang.css +2 -0
  15. package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_a69aa84b_scoped_a69aa84b_lang.css +2 -0
  16. package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_d94fcf8c_scoped_d94fcf8c_lang.css +2 -0
  17. package/dist/assets/src/components/shared/data-display/STooltip.css_vue_type_style_index_0_src_true_lang.css +1 -1
  18. package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_914bad28_scoped_914bad28_lang.css +2 -0
  19. package/dist/assets/src/components/shared/navigation/{SBottomNav.vue_vue_type_style_index_0_scoped_24be0f2b_lang.css → SBottomNav.vue_vue_type_style_index_0_scoped_68cf84b3_lang.css} +1 -1
  20. package/dist/src/components/layout/SResizeHandle.vue.js +2 -2
  21. package/dist/src/components/layout/SResizeHandle.vue_vue_type_script_setup_true_lang.js +4 -2
  22. package/dist/src/components/shared/_internal/SDialogSurface.vue.d.ts +9 -1
  23. package/dist/src/components/shared/_internal/SDialogSurface.vue.js +2 -2
  24. package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +174 -82
  25. package/dist/src/components/shared/_internal/dialogSurface.d.ts +2 -0
  26. package/dist/src/components/shared/_internal/dialogSurface.js +30 -27
  27. package/dist/src/components/shared/_internal/dialogSurfaceMotion.d.ts +14 -0
  28. package/dist/src/components/shared/_internal/dialogSurfaceMotion.js +84 -0
  29. package/dist/src/components/shared/_internal/focusTrap.js +15 -13
  30. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +5 -0
  31. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
  32. package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +123 -121
  33. package/dist/src/components/shared/containers/SDrawer.vue.d.ts +4 -4
  34. package/dist/src/components/shared/containers/SDrawer.vue.js +3 -6
  35. package/dist/src/components/shared/containers/SDrawer.vue_vue_type_script_setup_true_lang.js +104 -128
  36. package/dist/src/components/shared/containers/SModal.vue.d.ts +8 -8
  37. package/dist/src/components/shared/containers/SModal.vue.js +3 -6
  38. package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +87 -103
  39. package/dist/src/components/shared/containers/SOverlayHost.vue.js +2 -2
  40. package/dist/src/components/shared/containers/SOverlayHost.vue_vue_type_script_setup_true_lang.js +32 -31
  41. package/dist/src/components/shared/containers/SPanel.vue.d.ts +1 -1
  42. package/dist/src/components/shared/containers/SPopover.vue.js +2 -2
  43. package/dist/src/components/shared/containers/SPopover.vue_vue_type_script_setup_true_lang.js +225 -200
  44. package/dist/src/components/shared/containers/SSidebarSection.vue.js +2 -2
  45. package/dist/src/components/shared/containers/SSidebarSection.vue_vue_type_script_setup_true_lang.js +4 -3
  46. package/dist/src/components/shared/controls/SCheckbox.vue.js +2 -2
  47. package/dist/src/components/shared/controls/SCheckbox.vue_vue_type_script_setup_true_lang.js +13 -7
  48. package/dist/src/components/shared/controls/SCombobox.vue.js +2 -2
  49. package/dist/src/components/shared/controls/SCombobox.vue_vue_type_script_setup_true_lang.js +104 -94
  50. package/dist/src/components/shared/controls/SContextMenu.vue.js +2 -2
  51. package/dist/src/components/shared/controls/SContextMenu.vue_vue_type_script_setup_true_lang.js +86 -81
  52. package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
  53. package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +77 -72
  54. package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
  55. package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +81 -77
  56. package/dist/src/components/shared/controls/SSelect.vue.js +2 -2
  57. package/dist/src/components/shared/controls/SSelect.vue_vue_type_script_setup_true_lang.js +85 -77
  58. package/dist/src/components/shared/data-display/SControlledToastViewport.vue.js +2 -2
  59. package/dist/src/components/shared/data-display/SControlledToastViewport.vue_vue_type_script_setup_true_lang.js +58 -49
  60. package/dist/src/components/shared/data-display/SScrollViewport.vue.d.ts +10 -5
  61. package/dist/src/components/shared/data-display/SScrollViewport.vue.js +2 -2
  62. package/dist/src/components/shared/data-display/SScrollViewport.vue_vue_type_script_setup_true_lang.js +162 -111
  63. package/dist/src/components/shared/data-display/STooltip.vue_vue_type_script_setup_true_lang.js +276 -224
  64. package/dist/src/components/shared/data-display/_internal/STableFrame.vue.d.ts +3 -3
  65. package/dist/src/components/shared/data-display/_internal/STableFrame.vue.js +2 -2
  66. package/dist/src/components/shared/data-display/_internal/STableFrame.vue_vue_type_script_setup_true_lang.js +62 -46
  67. package/dist/src/components/shared/data-display/scrollViewport.d.ts +2 -0
  68. package/dist/src/components/shared/navigation/SBottomNav.vue.js +2 -2
  69. package/dist/src/components/shared/navigation/SBottomNav.vue_vue_type_script_setup_true_lang.js +3 -1
  70. package/dist/src/components/shared/navigation/STabList.vue.d.ts +1 -1
  71. package/dist/src/composables/useDialogOverlay.d.ts +12 -2
  72. package/dist/src/composables/useDialogOverlay.js +192 -119
  73. package/dist/src/internal/flatTree.d.ts +8 -0
  74. package/dist/src/internal/flatTree.js +23 -0
  75. package/dist/src/internal/focusNavigation.d.ts +3 -0
  76. package/dist/src/internal/focusNavigation.js +28 -15
  77. package/dist/src/internal/inertLease.d.ts +8 -0
  78. package/dist/src/internal/inertLease.js +33 -0
  79. package/dist/src/internal/layerStack.d.ts +40 -0
  80. package/dist/src/internal/layerStack.js +301 -94
  81. package/dist/src/internal/nativeFocus.d.ts +4 -0
  82. package/dist/src/internal/nativeFocus.js +12 -0
  83. package/dist/src/internal/overlayPortal.d.ts +17 -0
  84. package/dist/src/internal/overlayPortal.js +23 -0
  85. package/dist/src/internal/semanticSizing.d.ts +2 -2
  86. package/dist/src/internal/semanticSizing.js +2 -1
  87. package/dist/src/internal/useMenuLayer.d.ts +1 -0
  88. package/dist/src/internal/useMenuLayer.js +63 -57
  89. package/dist/src/internal/viewportModality.d.ts +27 -0
  90. package/dist/src/internal/viewportModality.js +132 -0
  91. package/dist/typography.js +17 -62
  92. package/docs/overlay-lifecycle.md +195 -0
  93. package/docs/public-api.md +141 -4
  94. package/docs/resize.md +34 -5
  95. package/docs/scroll-viewport.md +30 -10
  96. package/docs/theming.md +42 -8
  97. package/package.json +1 -1
  98. package/src/components/shared/_internal/SDialogSurface.css +185 -40
  99. package/src/components/shared/controls/SButton.css +0 -3
  100. package/src/components/shared/controls/SCheckbox.css +19 -7
  101. package/src/components/shared/data-display/SControlledToastViewport.css +2 -10
  102. package/src/components/shared/data-display/SScrollViewport.css +17 -1
  103. package/src/components/shared/data-display/STooltip.css +1 -1
  104. package/src/components/shared/data-display/_internal/STableFrame.css +1 -5
  105. package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_0e58afdc_scoped_0e58afdc_lang.css +0 -2
  106. package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_61cf20dd_scoped_61cf20dd_lang.css +0 -2
  107. package/dist/assets/src/components/shared/containers/SModal.css_vue_type_style_index_0_src_42e1bd5f_scoped_42e1bd5f_lang.css +0 -2
  108. package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_21f71ae8_scoped_21f71ae8_lang.css +0 -2
  109. package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_55d4826e_scoped_55d4826e_lang.css +0 -2
  110. package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_537f5744_scoped_537f5744_lang.css +0 -2
  111. package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_03921269_scoped_03921269_lang.css +0 -1
  112. package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_df3d6688_scoped_df3d6688_lang.css +0 -2
  113. package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_5864b6c6_scoped_5864b6c6_lang.css +0 -2
  114. package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_e5d11342_scoped_e5d11342_lang.css +0 -2
  115. package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_52b5825e_scoped_52b5825e_lang.css +0 -2
  116. package/src/components/shared/containers/SDrawer.css +0 -87
  117. package/src/components/shared/containers/SModal.css +0 -27
@@ -1,24 +1,27 @@
1
1
  import { hasOwn as e } from "../../../internal/es2020.js";
2
2
  //#region src/components/shared/_internal/dialogSurface.ts
3
3
  function t(e, t) {
4
+ return t === "backdrop" ? e : `calc(${e} + var(${t === "surface" ? "--s-layer-overlay-surface-offset" : "--s-layer-toast"}))`;
5
+ }
6
+ function n(e, t) {
4
7
  if (t === 1 || t === 2 || t === 3 || t === 4 || t === 5 || t === 6) return t;
5
8
  throw TypeError(`${e}: headingLevel должен быть целым числом от 1 до 6; получено ${String(t)}. / ${e}: headingLevel must be an integer from 1 to 6; received ${String(t)}.`);
6
9
  }
7
- function n(e, t) {
10
+ function r(e, t) {
8
11
  if (typeof t == "number" && Number.isFinite(t) && t > 0 && t <= 100) return t;
9
12
  throw TypeError(`${e}: extent must be a finite percentage in (0,100]; received ${String(t)}`);
10
13
  }
11
- var r = class extends Error {
14
+ var i = class extends Error {
12
15
  constructor(e, t) {
13
16
  super(t), this.name = "DialogSurfaceContractError", this.code = e;
14
17
  }
15
- }, i = /* @__PURE__ */ new Set([
18
+ }, a = /* @__PURE__ */ new Set([
16
19
  "kind",
17
20
  "size",
18
21
  "fullscreen",
19
22
  "surface",
20
23
  "scrollBehavior"
21
- ]), a = /* @__PURE__ */ new Set([
24
+ ]), o = /* @__PURE__ */ new Set([
22
25
  "kind",
23
26
  "size",
24
27
  "placement",
@@ -26,7 +29,7 @@ var r = class extends Error {
26
29
  "scope",
27
30
  "extent",
28
31
  "scrollBehavior"
29
- ]), o = /* @__PURE__ */ new Set([
32
+ ]), s = /* @__PURE__ */ new Set([
30
33
  "sm",
31
34
  "md",
32
35
  "lg",
@@ -36,38 +39,38 @@ var r = class extends Error {
36
39
  "4xl",
37
40
  "wide",
38
41
  "full"
39
- ]), s = /* @__PURE__ */ new Set([
42
+ ]), c = /* @__PURE__ */ new Set([
40
43
  "sm",
41
44
  "md",
42
45
  "lg"
43
- ]), c = /* @__PURE__ */ new Set([
46
+ ]), l = /* @__PURE__ */ new Set([
44
47
  "left",
45
48
  "right",
46
49
  "bottom"
47
- ]), l = /* @__PURE__ */ new Set(["default", "subtle"]), u = /* @__PURE__ */ new Set(["page", "body"]), d = (e, t, n) => {
48
- let i = Object.keys(e).find((e) => !n.has(e));
49
- if (i) throw new r("invalid-presentation", `SDialogSurface presentation kind="${t}" содержит недопустимое поле ${i}`);
50
+ ]), u = /* @__PURE__ */ new Set(["default", "subtle"]), d = /* @__PURE__ */ new Set(["page", "body"]), f = (e, t, n) => {
51
+ let r = Object.keys(e).find((e) => !n.has(e));
52
+ if (r) throw new i("invalid-presentation", `SDialogSurface presentation kind="${t}" содержит недопустимое поле ${r}`);
50
53
  };
51
- function f(t) {
52
- let f = t;
53
- if (f.kind === "modal") {
54
- if (d(f, "modal", i), !o.has(f.size)) throw new r("invalid-size", `Недопустимый размер SModal: ${String(f.size)}`);
55
- if (typeof f.fullscreen != "boolean") throw new r("invalid-presentation", "SModal presentation требует boolean fullscreen");
56
- if (!l.has(f.surface)) throw new r("invalid-surface", `Недопустимая поверхность SModal: ${String(f.surface)}`);
57
- if (!u.has(f.scrollBehavior)) throw new r("invalid-scroll-behavior", `Недопустимый scroll behavior SModal: ${String(f.scrollBehavior)}`);
54
+ function p(t) {
55
+ let n = t;
56
+ if (n.kind === "modal") {
57
+ if (f(n, "modal", a), !s.has(n.size)) throw new i("invalid-size", `Недопустимый размер SModal: ${String(n.size)}`);
58
+ if (typeof n.fullscreen != "boolean") throw new i("invalid-presentation", "SModal presentation требует boolean fullscreen");
59
+ if (!u.has(n.surface)) throw new i("invalid-surface", `Недопустимая поверхность SModal: ${String(n.surface)}`);
60
+ if (!d.has(n.scrollBehavior)) throw new i("invalid-scroll-behavior", `Недопустимый scroll behavior SModal: ${String(n.scrollBehavior)}`);
58
61
  return;
59
62
  }
60
- if (f.kind === "drawer") {
61
- if (d(f, "drawer", a), !s.has(f.size)) throw new r("invalid-size", `Недопустимый размер SDrawer: ${String(f.size)}`);
62
- if (!c.has(f.placement)) throw new r("invalid-presentation", `Недопустимое размещение SDrawer: ${String(f.placement)}`);
63
- if (typeof f.mobileFullScreen != "boolean") throw new r("invalid-presentation", "SDrawer presentation требует boolean mobileFullScreen");
64
- if (f.scope !== "viewport" && f.scope !== "contained") throw new r("invalid-presentation", "SDrawer presentation requires viewport or contained scope");
65
- if (f.scrollBehavior !== "body" && f.scrollBehavior !== "content") throw new r("invalid-scroll-behavior", "SDrawer presentation requires body or content scrollBehavior");
66
- if (f.scope === "contained") n("SDialogSurface", f.extent);
67
- else if (e(f, "extent")) throw new r("invalid-presentation", "SDrawer extent requires contained scope");
63
+ if (n.kind === "drawer") {
64
+ if (f(n, "drawer", o), !c.has(n.size)) throw new i("invalid-size", `Недопустимый размер SDrawer: ${String(n.size)}`);
65
+ if (!l.has(n.placement)) throw new i("invalid-presentation", `Недопустимое размещение SDrawer: ${String(n.placement)}`);
66
+ if (typeof n.mobileFullScreen != "boolean") throw new i("invalid-presentation", "SDrawer presentation требует boolean mobileFullScreen");
67
+ if (n.scope !== "viewport" && n.scope !== "contained") throw new i("invalid-presentation", "SDrawer presentation requires viewport or contained scope");
68
+ if (n.scrollBehavior !== "body" && n.scrollBehavior !== "content") throw new i("invalid-scroll-behavior", "SDrawer presentation requires body or content scrollBehavior");
69
+ if (n.scope === "contained") r("SDialogSurface", n.extent);
70
+ else if (e(n, "extent")) throw new i("invalid-presentation", "SDrawer extent requires contained scope");
68
71
  return;
69
72
  }
70
- throw new r("invalid-presentation", `Неизвестный kind SDialogSurface: ${String(f.kind)}`);
73
+ throw new i("invalid-presentation", `Неизвестный kind SDialogSurface: ${String(n.kind)}`);
71
74
  }
72
75
  //#endregion
73
- export { r as DialogSurfaceContractError, f as assertDialogSurfacePresentation, t as validateDialogSurfaceHeadingLevel, n as validateDrawerExtent };
76
+ export { i as DialogSurfaceContractError, p as assertDialogSurfacePresentation, t as resolveDialogSurfaceLayerIndex, n as validateDialogSurfaceHeadingLevel, r as validateDrawerExtent };
@@ -0,0 +1,14 @@
1
+ export interface DialogSurfaceMotionElements {
2
+ readonly subject: HTMLElement;
3
+ readonly frame: HTMLElement;
4
+ readonly backdrop: HTMLElement;
5
+ }
6
+ export interface DialogSurfaceMotionOwner {
7
+ readonly register: (elements: DialogSurfaceMotionElements) => () => void;
8
+ readonly enter: (element: Element, done: () => void) => void;
9
+ readonly leave: (element: Element, done: () => void) => void;
10
+ readonly cancel: (element: Element) => void;
11
+ readonly dispose: () => void;
12
+ }
13
+ /** Coordinates exact child CSS effects with Vue's explicit completion hooks; no duration clock or root motion. */
14
+ export declare function useDialogSurfaceMotion(enabled: () => boolean): DialogSurfaceMotionOwner;
@@ -0,0 +1,84 @@
1
+ import { createAggregateError as e } from "../../../internal/es2020.js";
2
+ import { onBeforeUnmount as t } from "vue";
3
+ //#region src/components/shared/_internal/dialogSurfaceMotion.ts
4
+ function n(n) {
5
+ let r = "s-dialog-surface-motion", i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = !1, s = (e) => {
6
+ if (!(e instanceof HTMLElement)) return;
7
+ let t = a.get(e);
8
+ t && (a.delete(e), t.observer.disconnect());
9
+ }, c = (e) => !o && a.get(e.subject) === e, l = (e) => {
10
+ c(e) && (s(e.subject), e.direction === "leave" && i.delete(e.subject), e.done());
11
+ }, u = (e) => [...e.frame.getAnimations().filter((t) => t.effect instanceof KeyframeEffect && t.effect.target === e.frame && t.effect.pseudoElement === null && "transitionProperty" in t && t.transitionProperty === "transform"), ...e.backdrop.getAnimations().filter((t) => t.effect instanceof KeyframeEffect && t.effect.target === e.backdrop && t.effect.pseudoElement === null && "transitionProperty" in t && t.transitionProperty === "opacity")].filter((e) => e.playState !== "idle" && e.playState !== "finished"), d = (e) => {
12
+ if (!c(e) || !e.subject.classList.contains(e.toClass) || e.waiting) return;
13
+ let t = i.get(e.subject);
14
+ if (!t) throw TypeError("dialogSurfaceMotion: current semantic subject requires its exact frame/backdrop refs");
15
+ let n = u(t);
16
+ if (n.length === 0) {
17
+ l(e);
18
+ return;
19
+ }
20
+ e.waiting = !0, Promise.all(n.map((e) => e.finished)).then(() => {
21
+ e.waiting = !1, d(e);
22
+ }, (t) => {
23
+ if (e.waiting = !1, !(t instanceof DOMException) || t.name !== "AbortError") throw s(e.subject), t;
24
+ d(e);
25
+ });
26
+ }, f = (e, t, l) => {
27
+ if (!(e instanceof HTMLElement)) throw TypeError("dialogSurfaceMotion: Vue subject must be its native HTMLElement");
28
+ if (s(e), o || !n()) {
29
+ l === "leave" && i.delete(e), t();
30
+ return;
31
+ }
32
+ let u = `${r}-${l}-active`, f = `${r}-${l}-to`, p = new MutationObserver(() => {
33
+ if (c(m)) {
34
+ if (!e.classList.contains(u)) {
35
+ s(e);
36
+ return;
37
+ }
38
+ d(m);
39
+ }
40
+ }), m = {
41
+ subject: e,
42
+ direction: l,
43
+ activeClass: u,
44
+ toClass: f,
45
+ done: t,
46
+ observer: p,
47
+ waiting: !1
48
+ };
49
+ a.set(e, m), p.observe(e, {
50
+ attributes: !0,
51
+ attributeFilter: ["class"]
52
+ }), d(m);
53
+ }, p = () => {
54
+ if (o) return;
55
+ o = !0;
56
+ let t = [];
57
+ for (let e of [...a.values()]) {
58
+ s(e.subject);
59
+ try {
60
+ e.done();
61
+ } catch (e) {
62
+ t.push(e);
63
+ }
64
+ }
65
+ if (i.clear(), t.length === 1) throw t[0];
66
+ if (t.length > 1) throw e(t, "dialogSurfaceMotion: completion cleanup failed");
67
+ };
68
+ return t(p), {
69
+ register: (e) => {
70
+ if (e.frame === e.backdrop || !e.subject.contains(e.frame) || !e.subject.contains(e.backdrop)) throw TypeError("dialogSurfaceMotion: exact frame/backdrop must be distinct descendants of their subject");
71
+ i.set(e.subject, e);
72
+ let t = a.get(e.subject);
73
+ return t && d(t), () => {
74
+ i.get(e.subject) === e && (e.subject.isConnected || (i.delete(e.subject), s(e.subject)));
75
+ };
76
+ },
77
+ enter: (e, t) => f(e, t, "enter"),
78
+ leave: (e, t) => f(e, t, "leave"),
79
+ cancel: s,
80
+ dispose: p
81
+ };
82
+ }
83
+ //#endregion
84
+ export { n as useDialogSurfaceMotion };
@@ -1,20 +1,22 @@
1
- import { getFocusableElements as e } from "../../../internal/focusNavigation.js";
1
+ import { flatTreeContains as e } from "../../../internal/flatTree.js";
2
+ import { nativeFocusedElement as t } from "../../../internal/nativeFocus.js";
3
+ import { getFocusableElements as n } from "../../../internal/focusNavigation.js";
2
4
  //#region src/components/shared/_internal/focusTrap.ts
3
- function t(t, n, r) {
4
- if (t.key !== "Tab" || !r) return;
5
- let i = n.value;
6
- if (!i) return;
7
- let a = e(i, { requireLayout: !0 });
8
- if (a.length === 0) {
9
- t.preventDefault(), i.focus();
5
+ function r(r, i, a) {
6
+ if (r.key !== "Tab" || !a) return;
7
+ let o = i.value;
8
+ if (!o) return;
9
+ let s = n(o, { requireLayout: !0 });
10
+ if (s.length === 0) {
11
+ r.preventDefault(), o.focus();
10
12
  return;
11
13
  }
12
- let o = a[0], s = a[a.length - 1], c = document.activeElement, l = c === i || !i.contains(c);
13
- if (t.shiftKey) {
14
- (c === o || l) && (t.preventDefault(), s?.focus());
14
+ let c = s[0], l = s[s.length - 1], u = t(), d = u === o || u === null || !e(o, u);
15
+ if (r.shiftKey) {
16
+ (u === c || d) && (r.preventDefault(), l?.focus());
15
17
  return;
16
18
  }
17
- (c === s || l) && (t.preventDefault(), o?.focus());
19
+ (u === l || d) && (r.preventDefault(), c?.focus());
18
20
  }
19
21
  //#endregion
20
- export { t as trapFocusInsidePanel };
22
+ export { r as trapFocusInsidePanel };
@@ -1,4 +1,6 @@
1
1
  import { SDisclosureSummaryBadge, SDisclosureSummaryCase, SDisclosureSummaryFact, SDisclosureSummaryState, SDisclosureSummaryStatus, SDisclosureSummaryTypography } from './disclosureSummary';
2
+ /** Семантика disclosure content: landmark section или локальная именованная группа. / Disclosure-content semantics: a landmark section or a local named group. */
3
+ export type SCollapsiblePanelContentRole = 'region' | 'group';
2
4
  export interface Props {
3
5
  summary: string;
4
6
  summaryTypography?: SDisclosureSummaryTypography;
@@ -12,6 +14,8 @@ export interface Props {
12
14
  fill?: boolean;
13
15
  density?: 'comfortable' | 'compact' | 'dense';
14
16
  contentPadding?: 'density' | 'none';
17
+ /** region включается в landmark navigation; group предназначен для повторяемых и вложенных сведений. / region participates in landmark navigation; group is intended for repeated and nested details. */
18
+ contentRole?: SCollapsiblePanelContentRole;
15
19
  headerVariant?: 'default' | 'minimal';
16
20
  lazy?: boolean;
17
21
  noAnimation?: boolean;
@@ -43,6 +47,7 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, i
43
47
  summaryBadges: readonly SDisclosureSummaryBadge[];
44
48
  summaryStatus: SDisclosureSummaryStatus;
45
49
  contentPadding: "density" | "none";
50
+ contentRole: SCollapsiblePanelContentRole;
46
51
  headerVariant: "default" | "minimal";
47
52
  noAnimation: boolean;
48
53
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,8 +1,8 @@
1
- import "../../../../assets/src/components/shared/containers/SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css";
1
+ import "../../../../assets/src/components/shared/containers/SCollapsiblePanel.css_vue_type_style_index_0_src_db85261d_scoped_db85261d_lang.css";
2
2
  import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/containers/SCollapsiblePanel.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-71824088"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-db85261d"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,21 +1,26 @@
1
- import { useDisclosure as e } from "../../../composables/useDisclosure.js";
2
- import { useOwnedAttrs as t } from "../../../internal/ownedAttrs.js";
3
- import n from "../controls/SButton.vue.js";
4
- import r from "../_internal/SDisclosureSummary.vue.js";
5
- import { computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeProps as u, nextTick as d, normalizeClass as f, normalizeStyle as ee, onBeforeUnmount as te, onMounted as p, openBlock as m, ref as h, renderSlot as g, unref as _, useSlots as v, vShow as y, watch as b, withCtx as x, withDirectives as S } from "vue";
1
+ import { isFocusableElement as e } from "../../../internal/focusNavigation.js";
2
+ import { validateExactString as t } from "../../../internal/runtimeContract.js";
3
+ import { useDisclosure as n } from "../../../composables/useDisclosure.js";
4
+ import { useOwnedAttrs as r } from "../../../internal/ownedAttrs.js";
5
+ import i from "../controls/SButton.vue.js";
6
+ import a from "../_internal/SDisclosureSummary.vue.js";
7
+ import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, openBlock as v, ref as y, renderSlot as b, unref as x, useSlots as S, vShow as ee, watch as te, withCtx as C, withDirectives as w } from "vue";
6
8
  //#region src/components/shared/containers/SCollapsiblePanel.vue?vue&type=script&setup=true&lang.ts
7
- var C = [
9
+ var ne = [
8
10
  "data-density",
9
11
  "data-surface",
10
12
  "data-content-padding"
11
- ], w = { class: "s-collapsible-panel-header" }, T = { class: "s-collapsible-panel-trigger" }, E = {
13
+ ], T = { class: "s-collapsible-panel-header" }, E = { class: "s-collapsible-panel-trigger" }, D = {
12
14
  key: 0,
13
15
  class: "s-collapsible-panel-actions"
14
- }, D = [
16
+ }, O = [
15
17
  "id",
16
18
  "aria-labelledby",
19
+ "role",
20
+ "inert",
21
+ "aria-hidden",
17
22
  "data-open"
18
- ], O = /*@__PURE__*/ l({
23
+ ], k = /*@__PURE__*/ d({
19
24
  inheritAttrs: !1,
20
25
  __name: "SCollapsiblePanel",
21
26
  props: {
@@ -40,6 +45,7 @@ var C = [
40
45
  },
41
46
  density: { default: "comfortable" },
42
47
  contentPadding: { default: "density" },
48
+ contentRole: { default: "region" },
43
49
  headerVariant: { default: "default" },
44
50
  lazy: {
45
51
  type: Boolean,
@@ -57,128 +63,122 @@ var C = [
57
63
  }
58
64
  },
59
65
  emits: ["update:open"],
60
- setup(l, { emit: O }) {
61
- let k = l, ne = v(), A = O, j = i(() => !!ne.actions), M = t({
66
+ setup(d, { emit: k }) {
67
+ let A = d, re = S(), ie = k, ae = o(() => !!re.actions), oe = r({
62
68
  component: "SCollapsiblePanel",
63
69
  owner: "collapsible panel root"
64
- }), N = i(() => k.density === "comfortable" ? "md" : "sm"), P = i(() => k.density === "comfortable" ? "default" : "compact"), F = i(() => k.open ?? !1), I = e({
65
- id: k.id,
66
- open: k.open === void 0 ? void 0 : F,
67
- defaultOpen: k.open === void 0 ? k.defaultOpen : void 0,
68
- disabled: () => k.disabled,
69
- onUpdate: (e) => A("update:open", e)
70
- }), { isOpen: L, triggerId: R, panelId: z } = I, B = h(!1), V = i(() => L.value || B.value), H = h(!k.lazy || k.defaultOpen || k.open === !0);
71
- b(() => k.open, (e) => {
72
- e && (H.value = !0);
73
- });
74
- function U() {
75
- if (k.disabled) return;
76
- if (k.noAnimation) {
77
- I.toggle();
78
- return;
79
- }
80
- let e = K.value, t = W.value;
81
- B.value = !0, e?.classList.add("is-animating"), e?.classList.remove("is-opened"), t?.classList.add("is-animating"), t?.classList.remove("is-opened"), I.toggle();
70
+ }), se = o(() => t("SCollapsiblePanel", "contentRole", A.contentRole, ["region", "group"])), ce = o(() => A.density === "comfortable" ? "md" : "sm"), le = o(() => A.density === "comfortable" ? "default" : "compact"), j = o(() => A.open ?? !1), M = n({
71
+ id: A.id,
72
+ open: A.open === void 0 ? void 0 : j,
73
+ defaultOpen: A.open === void 0 ? A.defaultOpen : void 0,
74
+ disabled: () => A.disabled,
75
+ onUpdate: (e) => ie("update:open", e)
76
+ }), { isOpen: N, triggerId: P, panelId: F } = M, I = y(!1), L = o(() => N.value || I.value), R = y(!A.lazy || N.value), z = y(null), B = y(null), V = y(null), H = y(null), U = null, W = null, G = 0, K = 0, q = !1;
77
+ function ue() {
78
+ M.toggle();
79
+ }
80
+ function J() {
81
+ W !== null && (window.cancelAnimationFrame(W), W = null);
82
82
  }
83
- let W = h(null), G = h(null), K = h(null), q = null, J = null;
84
83
  function Y() {
85
- J !== null && (window.cancelAnimationFrame(J), J = null);
84
+ let e = B.value;
85
+ e && (e.classList.remove("is-animating"), e.classList.add("is-opened"), e.style.transition = A.noAnimation ? "none" : "", e.style.overflow = "", e.style.maxHeight = "", H.value?.classList.remove("is-animating"), H.value?.classList.add("is-opened"));
86
86
  }
87
87
  function X() {
88
- let e = W.value, t = G.value;
89
- if (!e || !t || !L.value || !B.value) return;
90
- let n = `${t.scrollHeight}px`;
91
- e.style.maxHeight !== n && (e.style.maxHeight = n);
88
+ let e = B.value;
89
+ e && (e.classList.remove("is-animating", "is-opened"), e.style.transition = A.noAnimation ? "none" : "", e.style.maxHeight = "0px", e.style.overflow = "hidden", H.value?.classList.remove("is-animating", "is-opened"));
92
90
  }
93
- function re() {
94
- Y(), J = window.requestAnimationFrame(() => {
95
- J = null, X();
96
- });
97
- }
98
- function Z() {
99
- let e = W.value;
100
- if (!e) return;
101
- e.classList.remove("is-animating"), e.classList.add("is-opened"), e.style.overflow = "", e.style.maxHeight = "";
102
- let t = K.value;
103
- t && (t.classList.remove("is-animating"), t.classList.add("is-opened"));
91
+ function Z(e, t) {
92
+ return !q && t === G && N.value === e;
104
93
  }
105
- function Q() {
106
- let e = W.value;
107
- if (!e) return;
108
- e.classList.remove("is-animating"), e.classList.remove("is-opened"), e.style.maxHeight = "0px", e.style.overflow = "hidden";
109
- let t = K.value;
110
- t && (t.classList.remove("is-animating"), t.classList.remove("is-opened"));
94
+ function Q(e, t) {
95
+ Z(e, t) && (K += 1, J(), e ? Y() : X(), I.value = !1);
111
96
  }
112
- async function $(e) {
113
- e ? (await d(), H.value = !0, Z()) : Q(), B.value = !1;
97
+ function $(e, t, n) {
98
+ let r = ++K, i = e.getAnimations().filter((t) => t.effect instanceof KeyframeEffect && t.effect.target === e && t.effect.pseudoElement === null && "transitionProperty" in t && t.transitionProperty === "max-height" && t.playState !== "idle" && t.playState !== "finished");
99
+ if (i.length === 0) {
100
+ Q(t, n);
101
+ return;
102
+ }
103
+ let a = () => Z(t, n) && B.value === e && r === K;
104
+ Promise.all(i.map((e) => e.finished)).then(() => {
105
+ a() && Q(t, n);
106
+ }, (r) => {
107
+ if (!(r instanceof DOMException) || r.name !== "AbortError") throw r;
108
+ a() && $(e, t, n);
109
+ });
114
110
  }
115
- async function ie() {
116
- let e = W.value;
117
- if (!e) return;
118
- let t = K.value;
119
- await d(), e.classList.remove("is-opened"), e.classList.add("is-animating"), t && (t.classList.add("is-animating"), t.classList.remove("is-opened")), e.style.overflow = "hidden", e.style.maxHeight = "0px", e.offsetHeight, e.style.maxHeight = e.scrollHeight + "px";
120
- let n = () => {
121
- e.removeEventListener("transitionend", n), L.value && (Y(), e.style.maxHeight = "", e.style.overflow = "", e.classList.remove("is-animating"), e.classList.add("is-opened"), t && (t.classList.remove("is-animating"), t.classList.add("is-opened")), B.value = !1);
122
- };
123
- e.addEventListener("transitionend", n);
111
+ function de() {
112
+ let e = B.value, t = V.value;
113
+ if (q || !e || !t || !N.value || !I.value) return;
114
+ let n = `${t.scrollHeight}px`;
115
+ e.style.maxHeight !== n && (K += 1, e.style.maxHeight = n, $(e, !0, G));
124
116
  }
125
- function ae() {
126
- let e = W.value;
127
- if (!e) return;
128
- let t = K.value;
129
- B.value = !0, e.classList.add("is-animating"), e.classList.remove("is-opened"), t && (t.classList.add("is-animating"), t.classList.remove("is-opened")), (e.style.maxHeight === "" || e.style.maxHeight === "none") && (e.style.maxHeight = e.scrollHeight + "px", e.offsetHeight), e.style.overflow = "hidden", e.style.maxHeight = "0px";
130
- let n = () => {
131
- e.removeEventListener("transitionend", n), !L.value && (Y(), e.classList.remove("is-animating"), t && t.classList.remove("is-animating"), B.value = !1);
132
- };
133
- e.addEventListener("transitionend", n);
117
+ function fe() {
118
+ q || (J(), W = window.requestAnimationFrame(() => {
119
+ W = null, de();
120
+ }));
134
121
  }
135
- return p(() => {
136
- let e = W.value;
137
- if (!e) return;
138
- e.style.willChange = "max-height", k.noAnimation ? $(L.value) : L.value ? Z() : Q();
139
- let t = G.value;
140
- !k.noAnimation && "ResizeObserver" in window && t && (q = new ResizeObserver(() => {
141
- re();
142
- }), q.observe(t));
143
- }), te(() => {
144
- Y(), q &&= (q.disconnect(), null);
145
- }), b(L, (e) => {
146
- if (k.noAnimation) {
147
- $(e);
148
- return;
122
+ async function pe(t) {
123
+ let n = ++G;
124
+ K += 1, J(), t && (R.value = !0);
125
+ let r = B.value, i = V.value;
126
+ if (!r || !i) return;
127
+ let a = r.ownerDocument.activeElement, o = z.value;
128
+ if (!t && !A.disabled && a && r.contains(a) && o) {
129
+ let t = o.getElement();
130
+ t.isConnected && e(t) && o.focus({ preventScroll: !0 });
131
+ }
132
+ let s = r.getBoundingClientRect().height;
133
+ if (I.value = !A.noAnimation, await p(), Z(t, n) && B.value === r && V.value === i) {
134
+ if (A.noAnimation) {
135
+ Q(t, n);
136
+ return;
137
+ }
138
+ r.classList.remove("is-opened"), r.classList.add("is-animating"), H.value?.classList.remove("is-opened"), H.value?.classList.add("is-animating"), r.style.transition = "none", r.style.overflow = "hidden", r.style.maxHeight = `${s}px`, r.offsetHeight, r.style.transition = "", r.style.maxHeight = `${t ? i.scrollHeight : 0}px`, $(r, t, n);
149
139
  }
150
- e ? ie() : ae();
151
- }), (e, t) => (m(), o("div", u({
140
+ }
141
+ return _(() => {
142
+ N.value ? Y() : X();
143
+ let e = V.value;
144
+ "ResizeObserver" in window && e && (U = new ResizeObserver(fe), U.observe(e));
145
+ }), g(() => {
146
+ q = !0, G += 1, K += 1, J(), U?.disconnect(), U = null;
147
+ }), te([N, () => A.noAnimation], ([e]) => {
148
+ pe(e);
149
+ }), (e, t) => (v(), c("div", f({
152
150
  class: "s-collapsible-panel",
153
151
  ref_key: "rootEl",
154
- ref: K,
155
- "data-density": l.density,
156
- "data-surface": l.surface,
157
- "data-content-padding": l.contentPadding
158
- }, _(M).bindings()), [s("div", w, [s("div", T, [c(n, {
159
- id: _(R),
160
- appearance: l.headerVariant === "minimal" ? "ghost" : "soft",
152
+ ref: H,
153
+ "data-density": d.density,
154
+ "data-surface": d.surface,
155
+ "data-content-padding": d.contentPadding
156
+ }, x(oe).bindings()), [l("div", T, [l("div", E, [u(i, {
157
+ ref_key: "triggerApi",
158
+ ref: z,
159
+ id: x(P),
160
+ appearance: d.headerVariant === "minimal" ? "ghost" : "soft",
161
161
  severity: "secondary",
162
162
  shape: "row",
163
- size: N.value,
164
- density: P.value,
163
+ size: ce.value,
164
+ density: le.value,
165
165
  width: "full",
166
166
  "content-align": "between",
167
- disabled: l.disabled,
167
+ disabled: d.disabled,
168
168
  disclosure: {
169
- expanded: _(L),
170
- controls: _(z)
169
+ expanded: x(N),
170
+ controls: x(F)
171
171
  },
172
- onClick: U
172
+ onClick: ue
173
173
  }, {
174
- default: x(() => [c(r, {
175
- title: l.summary,
176
- typography: l.summaryTypography,
177
- casing: l.summaryCase,
178
- state: l.summaryState,
179
- facts: l.summaryFacts,
180
- badges: l.summaryBadges,
181
- status: l.summaryStatus
174
+ default: C(() => [u(a, {
175
+ title: d.summary,
176
+ typography: d.summaryTypography,
177
+ casing: d.summaryCase,
178
+ state: d.summaryState,
179
+ facts: d.summaryFacts,
180
+ badges: d.summaryBadges,
181
+ status: d.summaryStatus
182
182
  }, null, 8, [
183
183
  "title",
184
184
  "typography",
@@ -196,21 +196,23 @@ var C = [
196
196
  "density",
197
197
  "disabled",
198
198
  "disclosure"
199
- ])]), j.value ? (m(), o("div", E, [g(e.$slots, "actions", {}, void 0, !0)])) : a("", !0)]), S(s("div", {
200
- id: _(z),
201
- "aria-labelledby": _(R),
202
- role: "region",
199
+ ])]), ae.value ? (v(), c("div", D, [b(e.$slots, "actions", {}, void 0, !0)])) : s("", !0)]), w(l("div", {
200
+ id: x(F),
201
+ "aria-labelledby": x(P),
202
+ role: se.value,
203
+ inert: !x(N) || void 0,
204
+ "aria-hidden": !x(N),
203
205
  ref_key: "contentWrapEl",
204
- ref: W,
205
- class: f(["s-collapsible-panel-content w-full min-w-0", [{ "min-h-0 flex flex-col grow overflow-y-auto overflow-x-hidden": l.fill }, { "no-transition": l.noAnimation }]]),
206
- "data-open": _(L),
207
- style: ee({ ...l.noAnimation ? { transition: "none" } : {} })
208
- }, [s("div", {
206
+ ref: B,
207
+ class: m(["s-collapsible-panel-content w-full min-w-0", [{ "min-h-0 flex flex-col grow overflow-y-auto overflow-x-hidden": d.fill }, { "no-transition": d.noAnimation }]]),
208
+ "data-open": x(N),
209
+ style: h({ ...d.noAnimation ? { transition: "none" } : {} })
210
+ }, [l("div", {
209
211
  ref_key: "contentInnerEl",
210
- ref: G,
212
+ ref: V,
211
213
  class: "s-collapsible-panel-inner"
212
- }, [H.value ? g(e.$slots, "default", {}, void 0, !0, 0) : a("", !0)], 512)], 14, D), [[y, V.value]])], 16, C));
214
+ }, [R.value ? b(e.$slots, "default", {}, void 0, !0, 0) : s("", !0)], 512)], 14, O), [[ee, L.value]])], 16, ne));
213
215
  }
214
216
  });
215
217
  //#endregion
216
- export { O as default };
218
+ export { k as default };
@@ -21,15 +21,15 @@ export interface Props {
21
21
  /** body owns padded native scrolling; content delegates unpadded fill layout to a child viewport. */
22
22
  scrollBehavior?: DrawerScrollBehavior;
23
23
  }
24
- declare var __VLS_28: {}, __VLS_30: {}, __VLS_33: {
24
+ declare var __VLS_17: {}, __VLS_19: {}, __VLS_22: {
25
25
  close: () => void;
26
26
  };
27
27
  type __VLS_Slots = {} & {
28
- header?: (props: typeof __VLS_28) => any;
28
+ header?: (props: typeof __VLS_17) => any;
29
29
  } & {
30
- default?: (props: typeof __VLS_30) => any;
30
+ default?: (props: typeof __VLS_19) => any;
31
31
  } & {
32
- footer?: (props: typeof __VLS_33) => any;
32
+ footer?: (props: typeof __VLS_22) => any;
33
33
  };
34
34
  declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
35
35
  "update:open": (value: boolean) => any;
@@ -1,8 +1,5 @@
1
- import "../../../../assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_61cf20dd_scoped_61cf20dd_lang.css";
2
- import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
- import t from "./SDrawer.vue_vue_type_script_setup_true_lang.js";
4
- /* empty css */
1
+ import e from "./SDrawer.vue_vue_type_script_setup_true_lang.js";
5
2
  //#region src/components/shared/containers/SDrawer.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-61cf20dd"]]);
3
+ var t = e;
7
4
  //#endregion
8
- export { n as default };
5
+ export { t as default };