@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,10 +1,11 @@
1
1
  import { findFocusableOwner as e, findRelativeTabTarget as t } from "./focusNavigation.js";
2
2
  import { registerLayer as n } from "./layerStack.js";
3
3
  import { useOverlayAdmission as r } from "./overlayHost.js";
4
- import { useFloatingPosition as i } from "../composables/useFloatingPosition.js";
5
- import { computed as a, nextTick as o, onBeforeUnmount as s, ref as c, watch as l } from "vue";
4
+ import { useOverlayPortalTarget as i } from "./overlayPortal.js";
5
+ import { useFloatingPosition as a } from "../composables/useFloatingPosition.js";
6
+ import { computed as o, nextTick as s, onBeforeUnmount as c, ref as l, watch as u } from "vue";
6
7
  //#region src/internal/useMenuLayer.ts
7
- var u = 5, d = (e, t) => ({
8
+ var d = 5, f = (e, t) => ({
8
9
  x: e,
9
10
  y: t,
10
11
  left: e,
@@ -18,93 +19,98 @@ var u = 5, d = (e, t) => ({
18
19
  y: t
19
20
  })
20
21
  });
21
- function f(f, p = {}) {
22
- let m = a(() => f.value?.getElement() ?? null), h = r(), g = c(!1), _ = c("var(--s-layer-root-floating)"), v = null, y = null, b = null, x = null, S = !1, C = 0;
23
- function w(e = "programmatic") {
24
- C += 1;
25
- let t = S && (e === "tab" || e === "programmatic");
26
- t || (x?.(), x = null), S = !1, (g.value || b) && (g.value = !1, b?.unregister({
22
+ function p(p, m = {}) {
23
+ let h = o(() => p.value?.getElement() ?? null), g = r(), _ = i(), v = l(!1), y = l("var(--s-layer-root-floating)"), b = null, x = null, S = null, C = null, w = !1, T = 0;
24
+ u(h, () => S?.refreshModality(), { flush: "sync" });
25
+ function E(e = "programmatic") {
26
+ T += 1;
27
+ let t = w && (e === "tab" || e === "programmatic");
28
+ t || (C?.(), C = null), w = !1, (v.value || S) && (v.value = !1, S?.unregister({
27
29
  restoreFocus: !t && e !== "outside",
28
30
  commitFocusHandoff: t
29
- }), b = null, v = null, y = null, _.value = "var(--s-layer-root-floating)");
31
+ }), S = null, b = null, x = null, y.value = "var(--s-layer-root-floating)");
30
32
  }
31
- function T(e) {
32
- if (p.onRequestDismiss) {
33
- p.onRequestDismiss(e);
33
+ function D(e) {
34
+ if (m.onRequestDismiss) {
35
+ m.onRequestDismiss(e);
34
36
  return;
35
37
  }
36
- w(e), p.onDismiss?.(e);
38
+ E(e), m.onDismiss?.(e);
37
39
  }
38
- function E(e) {
39
- let n = y;
40
+ function O(e) {
41
+ let n = x;
40
42
  if (!n) {
41
- w("outside");
43
+ E("outside");
42
44
  return;
43
45
  }
44
- let r = b?.focusScope() ?? document, i = t(n, r, m.value, e.shiftKey);
45
- e.preventDefault(), x?.(), x = i && b ? b.handoffFocus(i) : null, S = !0, T("tab");
46
+ let r = S?.focusScope() ?? document, i = t(n, r, h.value, e.shiftKey);
47
+ e.preventDefault(), C?.(), C = i && S ? S.handoffFocus(i) : null, w = !0, D("tab");
46
48
  }
47
- let { coordinates: D, availableSize: O, updatePosition: k } = i({
48
- active: g,
49
- placement: () => v?.type === "element" && v.placement === "inline" ? v.align === "right" ? "left-start" : "right-start" : v?.type === "element" && v.placement === "top" ? v.align === "right" ? "top-end" : "top-start" : v?.type === "element" && v.align === "right" ? "bottom-end" : "bottom-start",
50
- anchorElement: () => v?.type === "element" ? v.element : null,
51
- anchorRect: () => v ? v.type === "point" ? d(v.x, v.y) : v.element.isConnected ? v.element.getBoundingClientRect() : (w("outside"), null) : null,
52
- panelRef: m,
49
+ let { coordinates: k, availableSize: A, updatePosition: j } = a({
50
+ active: v,
51
+ placement: () => b?.type === "element" && b.placement === "inline" ? b.align === "right" ? "left-start" : "right-start" : b?.type === "element" && b.placement === "top" ? b.align === "right" ? "top-end" : "top-start" : b?.type === "element" && b.align === "right" ? "bottom-end" : "bottom-start",
52
+ anchorElement: () => b?.type === "element" ? b.element : null,
53
+ anchorRect: () => b ? b.type === "point" ? f(b.x, b.y) : b.element.isConnected ? b.element.getBoundingClientRect() : (E("outside"), null) : null,
54
+ panelRef: h,
53
55
  offset: () => 0,
54
- boundaryPadding: () => u,
56
+ boundaryPadding: () => d,
55
57
  flip: () => !0,
56
58
  shift: () => !0,
57
59
  widthMatch: () => "none",
58
60
  viewportSizing: () => !0,
59
- sizingElements: () => f.value?.getSizingElements() ?? null,
60
- zIndex: () => _.value,
61
+ sizingElements: () => p.value?.getSizingElements() ?? null,
62
+ zIndex: () => y.value,
61
63
  scrollStrategy: "reposition"
62
64
  });
63
- async function A(t, r) {
64
- if (!h.value) {
65
- w("outside"), p.onRetire?.();
65
+ async function M(t, r) {
66
+ if (!g.value) {
67
+ E("outside"), m.onRetire?.();
66
68
  return;
67
69
  }
68
- x?.(), x = null, S = !1, g.value && w("outside");
69
- let i = ++C;
70
+ if (_.value === null) return;
71
+ C?.(), C = null, w = !1, v.value && E("outside");
72
+ let i = ++T;
70
73
  if (t.type === "element" && e(t.element) !== t.element) throw Error("useMenuLayer: element anchor must be the canonical focusable owner");
71
- v = t;
74
+ b = t;
72
75
  let a = e(r ?? null) ?? e(document.activeElement);
73
- if (y = t.type === "element" ? t.element : a, g.value = !0, await o(), C === i && g.value && h.value) {
74
- if (!m.value?.isConnected) throw w("outside"), Error("useMenuLayer: connected layer element is unavailable after opening");
75
- if (b = n({
76
+ if (x = t.type === "element" ? t.element : a, v.value = !0, await s(), T === i && v.value && g.value) {
77
+ if (!h.value?.isConnected) throw E("outside"), Error("useMenuLayer: connected layer element is unavailable after opening");
78
+ if (S = n({
76
79
  kind: "menu",
77
- root: () => m.value,
80
+ root: () => h.value,
78
81
  anchor: () => t.type === "element" ? t.element : a,
79
82
  restoreTarget: a,
80
83
  requestDismiss: (e) => {
81
- T(e === "escape" ? "escape" : "outside");
84
+ D(e === "escape" ? "escape" : "outside");
82
85
  },
83
86
  onRetire: () => {
84
- w("outside"), p.onRetire?.();
87
+ E("outside"), m.onRetire?.();
85
88
  }
86
- }), _.value = b.zIndex, await o(), C === i && g.value && h.value) {
87
- if (!m.value) throw w("outside"), Error("useMenuLayer: layer element is unavailable after opening");
88
- k();
89
+ }), y.value = S.zIndex, await s(), T === i && v.value && g.value) {
90
+ if (!h.value) throw E("outside"), Error("useMenuLayer: layer element is unavailable after opening");
91
+ j();
89
92
  }
90
93
  }
91
94
  }
92
- function j(e, t) {
93
- g.value ? w("trigger") : A(e, t);
95
+ function N(e, t) {
96
+ v.value ? E("trigger") : M(e, t);
94
97
  }
95
- return s(() => w("outside")), l(h, (e) => {
96
- e || !g.value && !b || (w("outside"), p.onRetire?.());
98
+ return c(() => E("outside")), u(g, (e) => {
99
+ e || !v.value && !S || (E("outside"), m.onRetire?.());
100
+ }, { flush: "sync" }), u(_, (e) => {
101
+ e === null && (v.value || S) && (E("outside"), m.onRetire?.());
97
102
  }, { flush: "sync" }), {
98
- isOpen: g,
99
- position: D,
100
- availableSize: O,
101
- zIndex: _,
102
- open: A,
103
- close: w,
104
- closeForTab: E,
105
- toggle: j,
106
- positionLayer: k
103
+ isOpen: v,
104
+ portalTarget: _,
105
+ position: k,
106
+ availableSize: A,
107
+ zIndex: y,
108
+ open: M,
109
+ close: E,
110
+ closeForTab: O,
111
+ toggle: N,
112
+ positionLayer: j
107
113
  };
108
114
  }
109
115
  //#endregion
110
- export { f as useMenuLayer };
116
+ export { p as useMenuLayer };
@@ -0,0 +1,27 @@
1
+ /** Exact loss evidence from the native owner, never from an arbitrary historical BODY state. */
2
+ export interface ModalityMutation {
3
+ readonly boundary: Element;
4
+ readonly isCurrent: () => boolean;
5
+ }
6
+ export interface NativeDialogCycle {
7
+ readonly subject: HTMLDialogElement;
8
+ readonly refresh: () => void;
9
+ readonly close: (beforeRetire?: (mutation: ModalityMutation) => void) => void;
10
+ }
11
+ /** Admits only the actual live native modal owned by this shared lifecycle. */
12
+ export declare function isOwnedNativeModal(element: Element): boolean;
13
+ /** Native modal focus semantics apply to an exposed host subject as well as a kit owner. */
14
+ export declare function isActualNativeModal(element: Element): boolean;
15
+ /** Native Document blocking is independent of visible inert attributes on background elements. */
16
+ export declare function isNativeModalBackground(element: Element): boolean;
17
+ /** Releases the exact inactive shell lease after removal, or before the same subject acquires a new cycle. */
18
+ export declare function releaseRetiredNativeSubject(subject: HTMLDialogElement): void;
19
+ /**
20
+ * Acquires one actual connected native dialog. Self inert suppresses UA autofocus;
21
+ * the authenticated shared admission performs the sole initial focus claim.
22
+ * Exact previous native subjects remain inert for the acquired cycle's lifetime,
23
+ * including their direct portals; leases release before authorized source return.
24
+ * Native close extends its Document blocking synchronously until all UA return steps
25
+ * finish, preserving arbitrary source styles and attributes.
26
+ */
27
+ export declare function acquireNativeDialog(subject: HTMLDialogElement, beforeAcquire?: (mutation: ModalityMutation) => void, onUnownedSourceLoss?: () => void): NativeDialogCycle;
@@ -0,0 +1,132 @@
1
+ import { createAggregateError as e } from "./es2020.js";
2
+ import { flatTreeContains as t, flatTreeParent as n } from "./flatTree.js";
3
+ import { acquireInertLease as r } from "./inertLease.js";
4
+ import { nativeFocusChain as i } from "./nativeFocus.js";
5
+ //#region src/internal/viewportModality.ts
6
+ var a = [], o = /* @__PURE__ */ new WeakMap();
7
+ function s(e) {
8
+ return e instanceof HTMLDialogElement && e.open && e.matches(":modal");
9
+ }
10
+ function c(e) {
11
+ let n = a[a.length - 1]?.subject;
12
+ return !!(n?.open && n.isConnected && e.isConnected && !t(n, e));
13
+ }
14
+ function l(e) {
15
+ let t = o.get(e);
16
+ t && (o.delete(e), t.observer.disconnect(), t.lease.release());
17
+ }
18
+ var u = (e, t) => {
19
+ let r = () => {
20
+ i.disconnect();
21
+ for (let t = n(e); t; t = n(t)) i.observe(t, { childList: !0 });
22
+ }, i = new MutationObserver(() => {
23
+ e.isConnected ? r() : l(e);
24
+ });
25
+ o.set(e, {
26
+ lease: t,
27
+ observer: i
28
+ }), e.isConnected ? r() : l(e);
29
+ }, d = (e) => {
30
+ let t = [];
31
+ for (let r = e; r; r = n(r)) r instanceof HTMLDialogElement && s(r) && t.push(r);
32
+ return t;
33
+ };
34
+ function f(n, o, s) {
35
+ if (!(n instanceof HTMLDialogElement) || !n.isConnected || n.ownerDocument !== document) throw TypeError("ui-kit native dialog: subject must be a connected same-document HTMLDialogElement");
36
+ if (n.open || a.some((e) => e.subject === n)) throw TypeError("ui-kit native dialog: subject lifecycle is already open");
37
+ l(n);
38
+ let f = !0, p = !0, m = !0, h = i(), g = [], _ = h[h.length - 1], v = _ && _ !== document.body && _ !== document.documentElement ? {
39
+ boundary: _,
40
+ isCurrent: () => m && f && n.open && n.isConnected && (p || a[a.length - 1] === C) && c(_)
41
+ } : null, y = () => {
42
+ let e = i(), r = e[e.length - 1];
43
+ r && r !== document.body && r !== document.documentElement && !t(n, r) && (h = e);
44
+ }, b = (e) => {
45
+ !n.open && _ && e.composedPath().includes(_) && (m = !1, s?.());
46
+ }, x = () => {
47
+ if (f && (!n.open || !n.isConnected || !n.matches(":modal"))) throw TypeError("ui-kit native dialog: external close(), showModal(), open mutation or subject removal violates the owned lifecycle");
48
+ }, S = new MutationObserver((e) => {
49
+ if (f && e.some((e) => e.type === "attributes" && e.attributeName === "open")) throw TypeError("ui-kit native dialog: external open attribute mutation violates the owned lifecycle");
50
+ x();
51
+ }), C = {
52
+ subject: n,
53
+ refresh: x,
54
+ close: (t) => {
55
+ if (!f) return;
56
+ S.disconnect();
57
+ let i = [], o = [];
58
+ try {
59
+ let e = /* @__PURE__ */ new Set();
60
+ for (let t of h) for (let r of d(t)) r !== n && e.add(r);
61
+ for (let t of a) t !== C && t.subject.open && t.subject.isConnected && e.add(t.subject);
62
+ i.push(r(n.ownerDocument.documentElement));
63
+ for (let t of e) i.push(r(t));
64
+ let s = null, c = {
65
+ boundary: n,
66
+ isCurrent: () => s?.isCurrent() === !0 && n.isConnected && !n.open
67
+ };
68
+ try {
69
+ t?.(c);
70
+ } catch (e) {
71
+ o.push(e);
72
+ }
73
+ if (s = r(n), u(n, s), f = !1, n.open) try {
74
+ n.close();
75
+ } catch (e) {
76
+ o.push(e);
77
+ }
78
+ } finally {
79
+ f = !1;
80
+ let e = a.indexOf(C);
81
+ e >= 0 && a.splice(e, 1);
82
+ for (let e of g.splice(0).reverse()) try {
83
+ e.release();
84
+ } catch (e) {
85
+ o.push(e);
86
+ }
87
+ for (let e of i.reverse()) try {
88
+ e.release();
89
+ } catch (e) {
90
+ o.push(e);
91
+ }
92
+ }
93
+ if (o.length === 1) throw o[0];
94
+ if (o.length > 1) throw e(o, "ui-kit native dialog: close transaction cleanup failed");
95
+ }
96
+ }, w = r(n);
97
+ a.push(C), document.addEventListener("focusin", y, !0), document.addEventListener("focusout", b, !0);
98
+ try {
99
+ if (v && o?.(v), n.showModal(), !n.open || !n.isConnected) throw TypeError("ui-kit native dialog: showModal() must establish the connected native cycle");
100
+ let e = /* @__PURE__ */ new Set();
101
+ for (let t of a) t !== C && t.subject.open && t.subject.isConnected && e.add(t.subject);
102
+ for (let t of h) for (let r of d(t)) r !== n && e.add(r);
103
+ for (let t of e) g.push(r(t));
104
+ S.observe(n, {
105
+ attributes: !0,
106
+ attributeFilter: ["open"]
107
+ });
108
+ } catch (t) {
109
+ let r = [t];
110
+ if (n.open) try {
111
+ C.close();
112
+ } catch (e) {
113
+ r.push(e);
114
+ }
115
+ else {
116
+ f = !1;
117
+ let e = a.indexOf(C);
118
+ e >= 0 && a.splice(e, 1);
119
+ for (let e of g.splice(0).reverse()) try {
120
+ e.release();
121
+ } catch (e) {
122
+ r.push(e);
123
+ }
124
+ }
125
+ throw r.length > 1 ? e(r, "ui-kit native dialog: acquisition cleanup failed") : t;
126
+ } finally {
127
+ p = !1, document.removeEventListener("focusin", y, !0), document.removeEventListener("focusout", b, !0), w.release();
128
+ }
129
+ return C;
130
+ }
131
+ //#endregion
132
+ export { f as acquireNativeDialog, s as isActualNativeModal, c as isNativeModalBackground, l as releaseRetiredNativeSubject };
@@ -1,7 +1,9 @@
1
1
  /*! Bundled @tailwindcss/typography@0.5.20; postcss-selector-parser@7.1.6. MIT notices: typography.LICENSE.txt */
2
+ import { createRequire } from "node:module";
2
3
  import plugin from "tailwindcss/plugin";
3
4
  //#region \0rolldown/runtime.js
4
5
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
6
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
5
7
  //#endregion
6
8
  //#region \0ui-kit:typography-tailwind-plugin-external
7
9
  var require__ui_kit_typography_tailwind_plugin_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -1795,7 +1797,7 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
1795
1797
  }));
1796
1798
  //#endregion
1797
1799
  //#region ../../node_modules/postcss-selector-parser/dist/selectors/node.js
1798
- var require_node = /* @__PURE__ */ __commonJSMin(((exports) => {
1800
+ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
1799
1801
  Object.defineProperty(exports, "__esModule", { value: true });
1800
1802
  var util_1 = require_util();
1801
1803
  var cloneNode = function(obj, parent, depth) {
@@ -2070,7 +2072,7 @@ var require_container = /* @__PURE__ */ __commonJSMin(((exports) => {
2070
2072
  };
2071
2073
  Object.defineProperty(exports, "__esModule", { value: true });
2072
2074
  var util_1 = require_util();
2073
- var node_1 = __importDefault(require_node());
2075
+ var node_1 = __importDefault(require_node$1());
2074
2076
  var types = __importStar(require_types());
2075
2077
  exports.default = function(_super) {
2076
2078
  __extends(Container, _super);
@@ -2538,7 +2540,7 @@ var require_className = /* @__PURE__ */ __commonJSMin(((exports) => {
2538
2540
  Object.defineProperty(exports, "__esModule", { value: true });
2539
2541
  var cssesc_1 = __importDefault(require_cssesc());
2540
2542
  var util_1 = require_util();
2541
- var node_1 = __importDefault(require_node());
2543
+ var node_1 = __importDefault(require_node$1());
2542
2544
  var types_1 = require_types();
2543
2545
  exports.default = function(_super) {
2544
2546
  __extends(ClassName, _super);
@@ -2596,7 +2598,7 @@ var require_comment = /* @__PURE__ */ __commonJSMin(((exports) => {
2596
2598
  return mod && mod.__esModule ? mod : { "default": mod };
2597
2599
  };
2598
2600
  Object.defineProperty(exports, "__esModule", { value: true });
2599
- var node_1 = __importDefault(require_node());
2601
+ var node_1 = __importDefault(require_node$1());
2600
2602
  var types_1 = require_types();
2601
2603
  exports.default = function(_super) {
2602
2604
  __extends(Comment, _super);
@@ -2633,7 +2635,7 @@ var require_id = /* @__PURE__ */ __commonJSMin(((exports) => {
2633
2635
  return mod && mod.__esModule ? mod : { "default": mod };
2634
2636
  };
2635
2637
  Object.defineProperty(exports, "__esModule", { value: true });
2636
- var node_1 = __importDefault(require_node());
2638
+ var node_1 = __importDefault(require_node$1());
2637
2639
  var types_1 = require_types();
2638
2640
  exports.default = function(_super) {
2639
2641
  __extends(ID, _super);
@@ -2729,7 +2731,7 @@ var require_namespace = /* @__PURE__ */ __commonJSMin(((exports) => {
2729
2731
  return this.qualifiedName(_super.prototype.valueToString.call(this));
2730
2732
  };
2731
2733
  return Namespace;
2732
- }(__importDefault(require_node()).default);
2734
+ }(__importDefault(require_node$1()).default);
2733
2735
  }));
2734
2736
  //#endregion
2735
2737
  //#region ../../node_modules/postcss-selector-parser/dist/selectors/tag.js
@@ -2793,7 +2795,7 @@ var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
2793
2795
  return mod && mod.__esModule ? mod : { "default": mod };
2794
2796
  };
2795
2797
  Object.defineProperty(exports, "__esModule", { value: true });
2796
- var node_1 = __importDefault(require_node());
2798
+ var node_1 = __importDefault(require_node$1());
2797
2799
  var types_1 = require_types();
2798
2800
  var String = function(_super) {
2799
2801
  __extends(String, _super);
@@ -2857,60 +2859,12 @@ var require_pseudo = /* @__PURE__ */ __commonJSMin(((exports) => {
2857
2859
  }(container_1.default);
2858
2860
  }));
2859
2861
  //#endregion
2860
- //#region ../../node_modules/util-deprecate/browser.js
2861
- var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2862
+ //#region ../../node_modules/util-deprecate/node.js
2863
+ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2862
2864
  /**
2863
- * Module exports.
2865
+ * For Node.js, simply re-export the core `util.deprecate` function.
2864
2866
  */
2865
- module.exports = deprecate;
2866
- /**
2867
- * Mark that a method should not be used.
2868
- * Returns a modified function which warns once by default.
2869
- *
2870
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
2871
- *
2872
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
2873
- * will throw an Error when invoked.
2874
- *
2875
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
2876
- * will invoke `console.trace()` instead of `console.error()`.
2877
- *
2878
- * @param {Function} fn - the function to deprecate
2879
- * @param {String} msg - the string to print to the console when `fn` is invoked
2880
- * @returns {Function} a new "deprecated" version of `fn`
2881
- * @api public
2882
- */
2883
- function deprecate(fn, msg) {
2884
- if (config("noDeprecation")) return fn;
2885
- var warned = false;
2886
- function deprecated() {
2887
- if (!warned) {
2888
- if (config("throwDeprecation")) throw new Error(msg);
2889
- else if (config("traceDeprecation")) console.trace(msg);
2890
- else console.warn(msg);
2891
- warned = true;
2892
- }
2893
- return fn.apply(this, arguments);
2894
- }
2895
- return deprecated;
2896
- }
2897
- /**
2898
- * Checks `localStorage` for boolean values for the given `name`.
2899
- *
2900
- * @param {String} name
2901
- * @returns {Boolean}
2902
- * @api private
2903
- */
2904
- function config(name) {
2905
- try {
2906
- if (!global.localStorage) return false;
2907
- } catch (_) {
2908
- return false;
2909
- }
2910
- var val = global.localStorage[name];
2911
- if (null == val) return false;
2912
- return String(val).toLowerCase() === "true";
2913
- }
2867
+ module.exports = __require("node:util").deprecate;
2914
2868
  }));
2915
2869
  //#endregion
2916
2870
  //#region ../../node_modules/postcss-selector-parser/dist/selectors/attribute.js
@@ -2943,7 +2897,7 @@ var require_attribute = /* @__PURE__ */ __commonJSMin(((exports) => {
2943
2897
  var unesc_1 = __importDefault(require_unesc());
2944
2898
  var namespace_1 = __importDefault(require_namespace());
2945
2899
  var types_1 = require_types();
2946
- var deprecate = require_browser();
2900
+ var deprecate = require_node();
2947
2901
  var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
2948
2902
  var warnOfDeprecatedValueAssignment = deprecate(function() {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead.");
2949
2903
  var warnOfDeprecatedQuotedAssignment = deprecate(function() {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
@@ -3361,7 +3315,7 @@ var require_combinator = /* @__PURE__ */ __commonJSMin(((exports) => {
3361
3315
  return mod && mod.__esModule ? mod : { "default": mod };
3362
3316
  };
3363
3317
  Object.defineProperty(exports, "__esModule", { value: true });
3364
- var node_1 = __importDefault(require_node());
3318
+ var node_1 = __importDefault(require_node$1());
3365
3319
  var types_1 = require_types();
3366
3320
  exports.default = function(_super) {
3367
3321
  __extends(Combinator, _super);
@@ -3398,7 +3352,7 @@ var require_nesting = /* @__PURE__ */ __commonJSMin(((exports) => {
3398
3352
  return mod && mod.__esModule ? mod : { "default": mod };
3399
3353
  };
3400
3354
  Object.defineProperty(exports, "__esModule", { value: true });
3401
- var node_1 = __importDefault(require_node());
3355
+ var node_1 = __importDefault(require_node$1());
3402
3356
  var types_1 = require_types();
3403
3357
  exports.default = function(_super) {
3404
3358
  __extends(Nesting, _super);
@@ -5148,3 +5102,4 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5148
5102
  }));
5149
5103
  //#endregion
5150
5104
  export default require_src();
5105
+ export {};