@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
@@ -17,11 +17,11 @@ type __VLS_Props = {
17
17
  ariaLabelledby?: string;
18
18
  ariaDescribedby?: string;
19
19
  };
20
- declare var __VLS_1: {}, __VLS_3: {};
20
+ declare var __VLS_7: {}, __VLS_9: {};
21
21
  type __VLS_Slots = {} & {
22
- caption?: (props: typeof __VLS_1) => any;
22
+ caption?: (props: typeof __VLS_7) => any;
23
23
  } & {
24
- default?: (props: typeof __VLS_3) => any;
24
+ default?: (props: typeof __VLS_9) => any;
25
25
  };
26
26
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, ElementApi<HTMLTableElement>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
27
27
  busy: boolean;
@@ -1,8 +1,8 @@
1
- import "../../../../../assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_52b5825e_scoped_52b5825e_lang.css";
1
+ import "../../../../../assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_914bad28_scoped_914bad28_lang.css";
2
2
  import e from "../../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./STableFrame.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/data-display/_internal/STableFrame.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-52b5825e"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-914bad28"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,14 +1,16 @@
1
1
  import { validateBoolean as e, validateExactString as t } from "../../../../internal/runtimeContract.js";
2
- import { useOwnedAttrs as n } from "../../../../internal/ownedAttrs.js";
3
- import { validateTableMetadata as r } from "./tableFoundation.js";
4
- import { validateScrollableViewportMaxBlockSize as i } from "../../../../internal/semanticSizing.js";
5
- import { Fragment as a, computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeProps as d, openBlock as f, ref as p, renderList as m, renderSlot as h, unref as g, watchEffect as _ } from "vue";
2
+ import { useUiKitLocale as n } from "../../../../composables/useUiKitLocale.js";
3
+ import { useOwnedAttrs as r } from "../../../../internal/ownedAttrs.js";
4
+ import { validateTableMetadata as i } from "./tableFoundation.js";
5
+ import { validateScrollableViewportMaxBlockSize as a } from "../../../../internal/semanticSizing.js";
6
+ import o from "../SScrollViewport.vue.js";
7
+ import { Fragment as s, computed as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeProps as m, openBlock as h, ref as g, renderList as _, renderSlot as v, unref as y, watchEffect as b, withCtx as x } from "vue";
6
8
  //#region src/components/shared/data-display/_internal/STableFrame.vue?vue&type=script&setup=true&lang.ts
7
- var v = [
9
+ var S = [
8
10
  "data-surface",
9
11
  "data-min-width",
10
12
  "data-max-height"
11
- ], y = [
13
+ ], C = [
12
14
  "data-density",
13
15
  "id",
14
16
  "tabindex",
@@ -19,10 +21,10 @@ var v = [
19
21
  "aria-labelledby",
20
22
  "aria-describedby",
21
23
  "aria-busy"
22
- ], b = {
24
+ ], w = {
23
25
  key: 0,
24
26
  class: "s-table__caption"
25
- }, x = ["span"], S = /*@__PURE__*/ u({
27
+ }, T = ["span"], E = /*@__PURE__*/ p({
26
28
  inheritAttrs: !1,
27
29
  __name: "STableFrame",
28
30
  props: {
@@ -47,52 +49,66 @@ var v = [
47
49
  ariaLabelledby: {},
48
50
  ariaDescribedby: {}
49
51
  },
50
- setup(u, { expose: S }) {
51
- let C = u, w = n({
52
+ setup(p, { expose: E }) {
53
+ let D = p, O = r({
52
54
  component: "STableFrame",
53
55
  owner: "canonical table scroll surface"
54
- }), T = p(null), E = o(() => t("STableFrame", "density", C.density, ["default", "compact"])), D = o(() => t("STableFrame", "surface", C.surface, ["bordered", "plain"])), O = o(() => t("STableFrame", "minWidth", C.minWidth, [
56
+ }), { t: k } = n(), A = c(() => D.ariaLabelledby === void 0 ? D.ariaLabel ?? k("table.accessibleName") : void 0), j = g(null), M = c(() => t("STableFrame", "density", D.density, ["default", "compact"])), N = c(() => t("STableFrame", "surface", D.surface, ["bordered", "plain"])), P = c(() => t("STableFrame", "minWidth", D.minWidth, [
55
57
  "content",
56
58
  "md",
57
59
  "lg"
58
- ])), k = o(() => i("STableFrame", "maxHeight", C.maxHeight));
59
- function A(e) {
60
- if (e === null || e instanceof HTMLTableElement) T.value = e;
60
+ ])), F = c(() => a("STableFrame", "maxHeight", D.maxHeight));
61
+ function I(e) {
62
+ if (e === null || e instanceof HTMLTableElement) j.value = e;
61
63
  else throw TypeError("STableFrame: ref must resolve to its native table.");
62
64
  }
63
- return _(() => {
64
- e("STableFrame", "busy", C.busy), r("STableFrame", C);
65
- for (let e of C.columnGroups) if (!Number.isSafeInteger(e) || e < 1 || e > 1e3) throw TypeError("STableFrame: column group span must be an integer from 1 to 1000");
66
- }), S({ getElement: () => {
67
- if (!T.value) throw Error("STableFrame: native table is unavailable.");
68
- return T.value;
69
- } }), (e, t) => (f(), c("div", d(g(w).bindings(), {
65
+ return b(() => {
66
+ e("STableFrame", "busy", D.busy), i("STableFrame", D);
67
+ for (let e of D.columnGroups) if (!Number.isSafeInteger(e) || e < 1 || e > 1e3) throw TypeError("STableFrame: column group span must be an integer from 1 to 1000");
68
+ }), E({ getElement: () => {
69
+ if (!j.value) throw Error("STableFrame: native table is unavailable.");
70
+ return j.value;
71
+ } }), (e, t) => (h(), u("div", m(y(O).bindings(), {
70
72
  class: "s-table-wrapper",
71
- "data-surface": D.value,
72
- "data-min-width": O.value,
73
- "data-max-height": k.value
74
- }), [l("table", {
75
- ref: A,
76
- class: "s-table",
77
- "data-density": E.value,
78
- id: u.domId,
79
- tabindex: u.focusTarget ? -1 : void 0,
80
- title: u.title,
81
- lang: u.language,
82
- dir: u.direction,
83
- "aria-label": u.ariaLabel,
84
- "aria-labelledby": u.ariaLabelledby,
85
- "aria-describedby": u.ariaDescribedby,
86
- "aria-busy": u.busy ? "true" : void 0
87
- }, [
88
- e.$slots.caption ? (f(), c("caption", b, [h(e.$slots, "caption", {}, void 0, !0)])) : s("", !0),
89
- (f(!0), c(a, null, m(u.columnGroups, (e, t) => (f(), c("colgroup", {
90
- key: t,
91
- span: e
92
- }, null, 8, x))), 128)),
93
- h(e.$slots, "default", {}, void 0, !0)
94
- ], 8, y)], 16, v));
73
+ "data-surface": N.value,
74
+ "data-min-width": P.value,
75
+ "data-max-height": F.value
76
+ }), [f(o, {
77
+ "accessible-label": A.value,
78
+ "accessible-labelledby": p.ariaLabelledby,
79
+ axis: "both",
80
+ "block-size": "content",
81
+ "focus-policy": "overflow",
82
+ "max-block-size": F.value
83
+ }, {
84
+ default: x(() => [d("table", {
85
+ ref: I,
86
+ class: "s-table",
87
+ "data-density": M.value,
88
+ id: p.domId,
89
+ tabindex: p.focusTarget ? -1 : void 0,
90
+ title: p.title,
91
+ lang: p.language,
92
+ dir: p.direction,
93
+ "aria-label": p.ariaLabel,
94
+ "aria-labelledby": p.ariaLabelledby,
95
+ "aria-describedby": p.ariaDescribedby,
96
+ "aria-busy": p.busy ? "true" : void 0
97
+ }, [
98
+ e.$slots.caption ? (h(), u("caption", w, [v(e.$slots, "caption", {}, void 0, !0)])) : l("", !0),
99
+ (h(!0), u(s, null, _(p.columnGroups, (e, t) => (h(), u("colgroup", {
100
+ key: t,
101
+ span: e
102
+ }, null, 8, T))), 128)),
103
+ v(e.$slots, "default", {}, void 0, !0)
104
+ ], 8, C)]),
105
+ _: 3
106
+ }, 8, [
107
+ "accessible-label",
108
+ "accessible-labelledby",
109
+ "max-block-size"
110
+ ])], 16, S));
95
111
  }
96
112
  });
97
113
  //#endregion
98
- export { S as default };
114
+ export { E as default };
@@ -1,4 +1,6 @@
1
1
  export type SScrollViewportAxis = 'x' | 'y' | 'both';
2
+ /** Root focus policy: always available or only during enabled-axis overflow. / Политика root focus: постоянная или при overflow разрешённой оси. */
3
+ export type SScrollViewportFocusPolicy = 'always' | 'overflow';
2
4
  export type SScrollViewportOverscrollBehavior = 'auto' | 'contain' | 'none';
3
5
  export type SScrollViewportPhysicalAxis = 'x' | 'y';
4
6
  export type SScrollViewportBoundary = 'start' | 'end';
@@ -1,8 +1,8 @@
1
- import "../../../../assets/src/components/shared/navigation/SBottomNav.vue_vue_type_style_index_0_scoped_24be0f2b_lang.css";
1
+ import "../../../../assets/src/components/shared/navigation/SBottomNav.vue_vue_type_style_index_0_scoped_68cf84b3_lang.css";
2
2
  import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./SBottomNav.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/navigation/SBottomNav.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-24be0f2b"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-68cf84b3"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -64,7 +64,9 @@ var de = ["aria-label"], fe = { class: "s-bottom-nav__items" }, pe = { key: 0 },
64
64
  current: e.kind === "view" && b.modelValue === e.id,
65
65
  layout: "tile"
66
66
  }) : [];
67
- }), P = 0, F = null, I = null, L = null, R = !1, z = null;
67
+ }), P = 0, F = null;
68
+ _(T, () => F?.refreshModality(), { flush: "sync" });
69
+ let I = null, L = null, R = !1, z = null;
68
70
  _(O, (e) => {
69
71
  e || q(!1);
70
72
  }, { flush: "sync" });
@@ -33,8 +33,8 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {
33
33
  scrollActiveIntoCenter: () => void;
34
34
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
35
35
  ariaLabel: string;
36
- divider: boolean;
37
36
  placement: "top" | "bottom";
37
+ divider: boolean;
38
38
  inset: "none" | "compact" | "content";
39
39
  headerPosition: "sticky" | "static";
40
40
  tabListId: string;
@@ -14,16 +14,26 @@ export interface DialogOverlayOptions {
14
14
  }
15
15
  export interface DialogOverlayController {
16
16
  panelRef: Ref<HTMLElement | null>;
17
+ portalRef: Ref<HTMLElement | null>;
18
+ dismissalRef: Ref<HTMLElement | null>;
19
+ /** Native cycle availability, independent of its captured initial-focus permission. */
20
+ nativeAdmitted: Readonly<Ref<boolean>>;
17
21
  renderOpen: Readonly<Ref<boolean>>;
22
+ /** Exact current layer base for the private dialog surface's semantic paint bands. */
23
+ layerIndex: Readonly<Ref<string | null>>;
18
24
  setPanelElement: (element: Element | ComponentPublicInstance | null) => void;
25
+ setPortalElement: (element: Element | ComponentPublicInstance | null) => void;
26
+ setDismissalElement: (element: Element | ComponentPublicInstance | null) => void;
19
27
  backdropStyle: Readonly<Ref<Record<string, string>>>;
20
28
  surfaceStyle: Readonly<Ref<Record<string, string>>>;
21
- /** Retires this cycle and descendant layers; pending focus cannot resume it. */
29
+ /** Exact native portal paint band; global toast priority is unchanged. */
30
+ portalStyle: Readonly<Ref<Record<string, string>>>;
31
+ /** Explicit cleanup retires this cycle and descendants without a focus-return request. */
22
32
  dispose: () => void;
23
33
  }
24
34
  /**
25
35
  * Owns one mounted dialog cycle in the shared layer stack. Viewport dialogs lock
26
- * body/trap focus; contained dialogs lease their host without global modality.
36
+ * body/trap focus and isolate the native background; contained dialogs lease their host without global modality.
27
37
  * Retirement requires a new false→true open request before another cycle.
28
38
  */
29
39
  export declare function useDialogOverlay(options: DialogOverlayOptions): DialogOverlayController;
@@ -1,24 +1,34 @@
1
1
  import { createAggregateError as e } from "../internal/es2020.js";
2
- import { trapFocusInsidePanel as t } from "../components/shared/_internal/focusTrap.js";
3
- import { registerLayer as n } from "../internal/layerStack.js";
4
- import { useOverlayAdmission as r } from "../internal/overlayHost.js";
5
- import { validateBoolean as i, validateExactString as a } from "../internal/runtimeContract.js";
6
- import { inject as o, nextTick as s, onBeforeUnmount as c, onMounted as l, provide as u, readonly as d, ref as f, shallowRef as p, watch as m } from "vue";
2
+ import { flatTreeContains as t } from "../internal/flatTree.js";
3
+ import { trapFocusInsidePanel as n } from "../components/shared/_internal/focusTrap.js";
4
+ import { resolveDialogSurfaceLayerIndex as r } from "../components/shared/_internal/dialogSurface.js";
5
+ import { captureLayerFocusAdmission as i, registerLayer as a } from "../internal/layerStack.js";
6
+ import { useOverlayAdmission as o } from "../internal/overlayHost.js";
7
+ import { validateBoolean as s, validateExactString as c } from "../internal/runtimeContract.js";
8
+ import { provideOverlayPortal as l, useOverlayPortal as u } from "../internal/overlayPortal.js";
9
+ import { computed as d, inject as f, nextTick as p, onBeforeUnmount as m, onMounted as h, provide as g, readonly as _, ref as v, shallowRef as y, watch as b } from "vue";
7
10
  //#region src/composables/useDialogOverlay.ts
8
- var h = Symbol("ui-kit-dialog-parent-lease");
9
- function g(g) {
10
- let _ = () => a("useDialogOverlay", "scope", g.scope?.value ?? "viewport", ["viewport", "contained"]), v = () => i("useDialogOverlay", "open", g.open.value), y = () => i("useDialogOverlay", "closable", g.closable.value), b = () => {
11
- if (!g.host) throw TypeError("useDialogOverlay: scope=\"contained\" requires a parent SOverlayHost");
12
- return g.host;
13
- }, x = _(), S = v();
14
- y(), x === "contained" && b(), g.validate?.();
15
- let C = r(), w = f(null), T = o(h, null), E = p(null);
16
- u(h, {
17
- registration: E,
18
- panel: w
11
+ var x = Symbol("ui-kit-dialog-parent-lease");
12
+ function S(S) {
13
+ let C = () => c("useDialogOverlay", "scope", S.scope?.value ?? "viewport", ["viewport", "contained"]), w = () => s("useDialogOverlay", "open", S.open.value), T = () => s("useDialogOverlay", "closable", S.closable.value), E = () => {
14
+ if (!S.host) throw TypeError("useDialogOverlay: scope=\"contained\" requires a parent SOverlayHost");
15
+ return S.host;
16
+ }, D = C(), ee = w();
17
+ T(), D === "contained" && E(), S.validate?.();
18
+ let O = o(), k = v(null), A = v(null), j = v(null), M = v(!1), N = u();
19
+ l({
20
+ scope: d(() => C() === "viewport" ? "native" : N?.scope.value ?? "document"),
21
+ subject: d(() => C() === "viewport" ? k.value instanceof HTMLDialogElement ? k.value : null : N?.subject.value ?? null),
22
+ target: d(() => C() === "viewport" ? A.value : N?.target.value ?? null),
23
+ admitted: d(() => C() === "viewport" ? M.value : N?.admitted.value ?? !1)
19
24
  });
20
- let D = f(C.value && x === "viewport" && S), O = f(!1), k = f({}), A = f({}), j = null, M = !1, N = !1, P = !1, F = x, I = () => {
21
- let e = b(), t = [
25
+ let P = f(x, null), F = y(null), I = d(() => F.value?.zIndex ?? null);
26
+ g(x, {
27
+ registration: F,
28
+ panel: k
29
+ });
30
+ let L = v(O.value && D === "viewport" && ee), R = v(!1), z = v({}), B = v({}), V = v({}), H = null, U = !1, W = !1, G = !1, K = D, q = () => {
31
+ let e = E(), t = [
22
32
  e.root.value,
23
33
  e.content.value,
24
34
  e.portal.value
@@ -28,11 +38,11 @@ function g(g) {
28
38
  if (!n || !r || !i || !n.isConnected || !r.isConnected || !i.isConnected) return null;
29
39
  if (n.ownerDocument !== document || r.ownerDocument !== document || i.ownerDocument !== document || r.parentElement !== n || i.parentElement !== n || r === i) throw TypeError("useDialogOverlay: SOverlayHost requires connected same-document sibling content/portal owners");
30
40
  return e;
31
- }, L = () => {
32
- !P && v() && (P = !0, g.requestClose());
33
- }, R = (t) => {
34
- let n = j;
35
- j = null, D.value = !1, k.value = {}, A.value = {};
41
+ }, J = () => {
42
+ !G && w() && (G = !0, S.requestClose());
43
+ }, Y = (t) => {
44
+ let n = H;
45
+ H = null, L.value = !1, z.value = {}, B.value = {}, V.value = {};
36
46
  let r = [];
37
47
  try {
38
48
  n?.registration?.unregister({
@@ -41,8 +51,10 @@ function g(g) {
41
51
  });
42
52
  } catch (e) {
43
53
  r.push(e);
54
+ } finally {
55
+ n?.focusAdmission?.cancel();
44
56
  }
45
- E.value = null;
57
+ F.value = null, M.value = !1, n?.releaseNativeListeners?.();
46
58
  try {
47
59
  n?.releaseHost?.();
48
60
  } catch (e) {
@@ -50,84 +62,127 @@ function g(g) {
50
62
  }
51
63
  if (r.length === 1) throw r[0];
52
64
  if (r.length > 1) throw e(r, "useDialogOverlay: layer and host retirement failed");
53
- }, z = (t, n) => {
65
+ }, X = (t, n) => {
54
66
  let r = [];
55
67
  try {
56
- R(t);
68
+ Y(t);
57
69
  } catch (e) {
58
70
  r.push(e);
59
71
  }
60
72
  if (n) try {
61
- L();
73
+ J();
62
74
  } catch (e) {
63
75
  r.push(e);
64
76
  }
65
77
  if (r.length === 1) throw r[0];
66
78
  if (r.length > 1) throw e(r, "useDialogOverlay: retirement and close intent failed");
67
- }, B = (e = !0) => {
68
- M = !0, z(e, !0);
69
- }, V = (e) => j === e && O.value && !N && !M && C.value && v() && D.value, H = () => {
79
+ }, Z = (e = !0) => {
80
+ U = !0, X(e, !0);
81
+ }, Q = (e) => H === e && R.value && !W && !U && O.value && w() && L.value, te = () => {
70
82
  try {
71
- let e = _(), t = v();
72
- if (y(), e !== F && t) throw TypeError("useDialogOverlay: scope can change only while open=false");
73
- e === "contained" && b(), g.validate?.();
83
+ let e = C(), t = w();
84
+ if (T(), e !== K && t) throw TypeError("useDialogOverlay: scope can change only while open=false");
85
+ e === "contained" && E(), S.validate?.();
74
86
  } catch (t) {
75
- M = !0;
87
+ U = !0;
76
88
  try {
77
- R(!1);
89
+ Y(!1);
78
90
  } catch (n) {
79
91
  throw e([t, n], "useDialogOverlay: validation and resource retirement failed");
80
92
  }
81
93
  throw t;
82
94
  }
83
- }, U = async () => {
84
- let e = j, r = w.value;
85
- if (!e || !V(e) || !r?.isConnected || e.focusing) return;
86
- let i = T?.registration.value ?? null;
87
- if (T && (!i || !T.panel.value?.isConnected)) return;
88
- if (e.scope === "contained" && e.portal?.contains(r) !== !0) throw TypeError("useDialogOverlay: contained dialog surface must mount inside its SOverlayHost portal");
89
- H(), e.focusing = !0;
90
- let a = e.scope === "contained";
91
- if (a) {
92
- let t = I();
93
- if (!t || t.root.value !== e.root || t.content.value !== e.content || t.portal.value !== e.portal) {
94
- B();
95
- return;
96
- }
97
- if (e.releaseHost = t.acquire(B), !V(e)) {
98
- e.releaseHost();
99
- return;
95
+ }, ne = async () => {
96
+ let i = H, o = k.value;
97
+ if (!i || !Q(i) || !o?.isConnected || i.focusing || i.scope === "viewport" && !A.value?.isConnected) return;
98
+ let s = P?.registration.value ?? null;
99
+ if (!P || s && P.panel.value?.isConnected) {
100
+ if (i.scope === "contained" && i.portal?.contains(o) !== !0) throw TypeError("useDialogOverlay: contained dialog surface must mount inside its SOverlayHost portal");
101
+ te(), i.focusing = !0;
102
+ try {
103
+ let e = i.scope === "contained";
104
+ if (e) {
105
+ let e = q();
106
+ if (!e || e.root.value !== i.root || e.content.value !== i.content || e.portal.value !== i.portal) {
107
+ Z();
108
+ return;
109
+ }
110
+ if (i.releaseHost = i.focusAdmission ? i.focusAdmission.acquireHost(() => e.acquire(Z)) : e.acquire(Z), !Q(i)) {
111
+ i.releaseHost(), i.focusAdmission?.cancel();
112
+ return;
113
+ }
114
+ }
115
+ let c = P?.panel.value ?? null, l = c && !c.contains(i.restoreTarget) ? c : i.restoreTarget;
116
+ if (!e) {
117
+ if (!(o instanceof HTMLDialogElement)) throw TypeError("useDialogOverlay: viewport panel ref requires an actual HTMLDialogElement and its exact direct portal");
118
+ let e = (e) => {
119
+ e.target === o && (e.preventDefault(), Q(i) && T() && S.requestClose());
120
+ }, n = (e) => {
121
+ if (e.defaultPrevented) return;
122
+ let n = e.target;
123
+ if (!(n instanceof HTMLFormElement) || n.closest("dialog") !== o || !t(o, n)) return;
124
+ let r = e.submitter;
125
+ if (((r instanceof HTMLButtonElement || r instanceof HTMLInputElement) && r.hasAttribute("formmethod") ? r.formMethod : n.method) === "dialog") throw e.preventDefault(), TypeError("useDialogOverlay: native form method=\"dialog\" bypasses controlled open; use a typed close action or update open");
126
+ };
127
+ o.addEventListener("cancel", e, !0), o.addEventListener("submit", n, !0), i.releaseNativeListeners = () => {
128
+ o.removeEventListener("cancel", e, !0), o.removeEventListener("submit", n, !0);
129
+ };
130
+ }
131
+ if (i.registration = a({
132
+ kind: "dialog",
133
+ root: () => k.value,
134
+ modal: !e,
135
+ ...o instanceof HTMLDialogElement && !e ? { nativeDialog: {
136
+ subject: o,
137
+ portal: () => A.value
138
+ } } : {},
139
+ dismissalRoots: () => {
140
+ let t = j.value ?? k.value, n = e ? null : A.value;
141
+ return [...t ? [t] : [], ...n ? [n] : []];
142
+ },
143
+ parent: s,
144
+ eventBoundary: e ? () => i.root : void 0,
145
+ restoreTarget: l,
146
+ focusAdmission: i.focusAdmission,
147
+ dismissOnEscape: T,
148
+ dismissOnOutsidePointer: T,
149
+ blocksParentFocusTrap: !e,
150
+ ...e ? {} : { trapFocus: (e) => n(e, k, !0) },
151
+ requestDismiss: () => S.requestClose(),
152
+ onRetire: Z
153
+ }), !Q(i)) {
154
+ i.registration.unregister({
155
+ restoreFocus: !1,
156
+ retireDescendants: !0
157
+ }), i.focusAdmission?.cancel(), i.releaseNativeListeners?.(), i.releaseNativeListeners = null;
158
+ return;
159
+ }
160
+ if (F.value = i.registration, M.value = !e, z.value = { zIndex: r(i.registration.zIndex, "backdrop") }, B.value = { zIndex: r(i.registration.zIndex, "surface") }, V.value = e ? {} : { "--s-layer-root-toast": r(i.registration.zIndex, "toast") }, await p(), !Q(i) || k.value !== o || !o.isConnected || !i.registration.isTopmost()) {
161
+ i.focusAdmission?.cancel();
162
+ return;
163
+ }
164
+ i.registration.claimFocus(o) && Q(i) && S.opened?.();
165
+ } catch (t) {
166
+ try {
167
+ H === i ? (U = !0, Y(!1)) : i.focusAdmission?.cancel();
168
+ } catch (n) {
169
+ throw e([t, n], "useDialogOverlay: focus admission and resource retirement failed");
170
+ }
171
+ throw t;
100
172
  }
101
173
  }
102
- let o = T?.panel.value ?? null, c = o && !o.contains(e.restoreTarget) ? o : e.restoreTarget;
103
- if (e.registration = n({
104
- kind: "dialog",
105
- root: () => w.value,
106
- modal: !a,
107
- parent: i,
108
- eventBoundary: a ? () => e.root : void 0,
109
- restoreTarget: c,
110
- dismissOnEscape: y,
111
- dismissOnOutsidePointer: y,
112
- blocksParentFocusTrap: !a,
113
- ...a ? {} : { trapFocus: (e) => t(e, w, !0) },
114
- requestDismiss: () => g.requestClose(),
115
- onRetire: B
116
- }), E.value = e.registration, k.value = { zIndex: e.registration.zIndex }, A.value = { zIndex: `calc(${e.registration.zIndex} + var(--s-layer-overlay-surface-offset))` }, await s(), !V(e) || w.value !== r || !r.isConnected || !e.registration.isTopmost()) return;
117
- let l = document.activeElement, u = l === document.body && e.restoreTarget !== null && e.content?.contains(e.restoreTarget) && e.content.hasAttribute("inert");
118
- (l === e.restoreTarget || u) && (r.focus({ preventScroll: a }), V(e) && document.activeElement === r && g.opened?.());
119
- }, W = () => {
174
+ }, re = () => {
120
175
  let e;
121
176
  try {
122
- let t = _(), n = v();
123
- if (y(), t !== F && n) throw TypeError("useDialogOverlay: scope can change only while open=false");
124
- t === "contained" && b(), g.validate?.(), e = {
177
+ let t = C(), n = w();
178
+ if (T(), t !== K && n) throw TypeError("useDialogOverlay: scope can change only while open=false");
179
+ t === "contained" && E(), S.validate?.(), e = {
125
180
  valid: !0,
126
181
  open: n,
127
182
  scope: t,
128
- host: O.value && t === "contained" ? I() : null,
129
- parent: T?.registration.value ?? null,
130
- admitted: C.value
183
+ host: R.value && t === "contained" ? q() : null,
184
+ parent: P?.registration.value ?? null,
185
+ admitted: O.value
131
186
  };
132
187
  } catch (t) {
133
188
  e = {
@@ -136,75 +191,93 @@ function g(g) {
136
191
  };
137
192
  }
138
193
  return e;
139
- }, G = (t) => {
194
+ }, ie = (t) => {
140
195
  if (!t.valid) {
141
- M = !0;
196
+ U = !0;
142
197
  try {
143
- R(!1);
198
+ Y(!1);
144
199
  } catch (n) {
145
200
  throw e([t.error, n], "useDialogOverlay: validation and resource retirement failed");
146
201
  }
147
202
  throw t.error;
148
203
  }
149
- let { open: n, scope: r, host: i, admitted: a } = t;
150
- if (r !== F) {
204
+ let { open: n, scope: r, host: a, admitted: o } = t;
205
+ if (r !== K) {
151
206
  if (n) throw TypeError("useDialogOverlay: scope can change only while open=false");
152
- F = r, r === "contained" && b();
207
+ K = r, r === "contained" && E();
153
208
  }
154
209
  if (!n) {
155
- M = !1, P = !1, R(a);
210
+ U = !1, G = !1, Y(o);
156
211
  return;
157
212
  }
158
- if (!a) {
159
- B(!1);
213
+ if (!o) {
214
+ Z(!1);
160
215
  return;
161
216
  }
162
- if (!O.value || N || M) return;
163
- if (j) {
164
- (r === "contained" && (i === null || j.root !== i.root.value || j.content !== i.content.value || j.portal !== i.portal.value) || j.registration && T && !t.parent) && B();
217
+ if (!R.value || W || U) return;
218
+ if (H) {
219
+ (r === "contained" && (a === null || H.root !== a.root.value || H.content !== a.content.value || H.portal !== a.portal.value) || H.registration && P && !t.parent) && Z();
165
220
  return;
166
221
  }
167
- if (r === "contained" && !i) return;
168
- let o = document.activeElement instanceof HTMLElement ? document.activeElement : null;
169
- j = {
222
+ if (r === "contained" && !a) return;
223
+ let s = i({ releaseBoundary: a?.content.value ?? null }), c = s?.restoreTarget ?? null;
224
+ H = {
170
225
  scope: r,
171
- root: i?.root.value ?? null,
172
- content: i?.content.value ?? null,
173
- portal: i?.portal.value ?? null,
174
- restoreTarget: o,
226
+ root: a?.root.value ?? null,
227
+ content: a?.content.value ?? null,
228
+ portal: a?.portal.value ?? null,
229
+ restoreTarget: c,
230
+ focusAdmission: s,
175
231
  releaseHost: null,
176
232
  registration: null,
233
+ releaseNativeListeners: null,
177
234
  focusing: !1
178
- }, D.value = !0;
179
- }, K = (e) => {
235
+ }, L.value = !0;
236
+ }, ae = (e) => {
180
237
  if (e !== null && !(e instanceof HTMLElement)) throw TypeError("Dialog overlay panel ref обязан указывать на HTMLElement");
181
- w.value = e;
238
+ k.value = e;
239
+ }, oe = (e) => {
240
+ if (e !== null && !(e instanceof HTMLElement)) throw TypeError("useDialogOverlay: native portal ref must resolve to HTMLElement or null");
241
+ A.value = e;
242
+ }, se = (e) => {
243
+ if (e !== null && !(e instanceof HTMLElement)) throw TypeError("useDialogOverlay: visual dismissal ref must resolve to HTMLElement or null");
244
+ j.value = e;
182
245
  };
183
- m(W, G, {
246
+ b(re, ie, {
184
247
  flush: "sync",
185
248
  immediate: !0
186
- }), m([
187
- O,
188
- w,
189
- D,
190
- () => T?.registration.value
191
- ], U, { flush: "post" }), l(() => {
192
- O.value = !0;
249
+ }), b(k, () => {
250
+ H?.registration?.refreshModality();
251
+ }, { flush: "sync" }), b(A, () => H?.registration?.refreshModality(), { flush: "sync" }), b([
252
+ R,
253
+ k,
254
+ A,
255
+ L,
256
+ () => P?.registration.value
257
+ ], ne, { flush: "post" }), h(() => {
258
+ R.value = !0;
193
259
  });
194
- let q = () => {
195
- if (N) return;
196
- N = !0;
197
- let e = F === "contained" && v();
198
- z(!1, e);
260
+ let $ = (e) => {
261
+ if (W) return;
262
+ W = !0;
263
+ let t = K === "contained" && w();
264
+ X(e, t);
199
265
  };
200
- return c(q), {
201
- panelRef: w,
202
- renderOpen: d(D),
203
- setPanelElement: K,
204
- backdropStyle: k,
205
- surfaceStyle: A,
206
- dispose: q
266
+ return m(() => $(O.value)), {
267
+ panelRef: k,
268
+ portalRef: A,
269
+ dismissalRef: j,
270
+ nativeAdmitted: _(M),
271
+ renderOpen: _(L),
272
+ layerIndex: I,
273
+ setPanelElement: ae,
274
+ setPortalElement: oe,
275
+ setDismissalElement: se,
276
+ backdropStyle: z,
277
+ surfaceStyle: B,
278
+ portalStyle: V,
279
+ dispose: () => $(!1)
207
280
  };
208
281
  }
209
282
  //#endregion
210
- export { g as useDialogOverlay };
283
+ export { S as useDialogOverlay };