@x-plat/design-system 0.15.0 → 0.15.2

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.
@@ -50,8 +50,10 @@ var Portal_default = Portal;
50
50
  var import_react = __toESM(require("react"), 1);
51
51
  var findScrollParent = (el) => {
52
52
  for (let p = el.parentElement; p; p = p.parentElement) {
53
- const { overflowY, overflowX } = getComputedStyle(p);
54
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
53
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
54
+ const { overflowY } = getComputedStyle(p);
55
+ if (!/(auto|scroll)/.test(overflowY)) continue;
56
+ if (p.scrollHeight > p.clientHeight) return p;
55
57
  }
56
58
  return null;
57
59
  };
@@ -84,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
84
86
  left = triggerRect.right - popW;
85
87
  }
86
88
  if (left < clip.left + 8) left = clip.left + 8;
87
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
88
89
  return {
89
90
  direction,
90
91
  top,
91
92
  left,
92
- maxHeight,
93
- over: {
94
- top: Math.max(0, clip.top - top),
95
- right: Math.max(0, left + popW - clip.right),
96
- bottom: Math.max(0, top + drawnH - clip.bottom),
97
- left: Math.max(0, clip.left - left)
98
- }
93
+ maxHeight
99
94
  };
100
95
  };
101
96
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -139,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
139
134
  const desiredH = cap == null ? popH : Math.min(popH, cap);
140
135
  const frozen = frozenMaxRef.current;
141
136
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
142
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
137
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
143
138
  triggerRect,
144
139
  popW,
145
140
  effectiveH,
@@ -151,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
146
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
152
147
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
153
148
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
154
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
155
149
  directionRef.current = next;
156
150
  pop.classList.toggle("top", next === "top");
157
151
  pop.classList.toggle("bottom", next === "bottom");
@@ -14,8 +14,10 @@ var Portal_default = Portal;
14
14
  import React from "react";
15
15
  var findScrollParent = (el) => {
16
16
  for (let p = el.parentElement; p; p = p.parentElement) {
17
- const { overflowY, overflowX } = getComputedStyle(p);
18
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
17
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
18
+ const { overflowY } = getComputedStyle(p);
19
+ if (!/(auto|scroll)/.test(overflowY)) continue;
20
+ if (p.scrollHeight > p.clientHeight) return p;
19
21
  }
20
22
  return null;
21
23
  };
@@ -48,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
48
50
  left = triggerRect.right - popW;
49
51
  }
50
52
  if (left < clip.left + 8) left = clip.left + 8;
51
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
52
53
  return {
53
54
  direction,
54
55
  top,
55
56
  left,
56
- maxHeight,
57
- over: {
58
- top: Math.max(0, clip.top - top),
59
- right: Math.max(0, left + popW - clip.right),
60
- bottom: Math.max(0, top + drawnH - clip.bottom),
61
- left: Math.max(0, clip.left - left)
62
- }
57
+ maxHeight
63
58
  };
64
59
  };
65
60
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -103,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
98
  const desiredH = cap == null ? popH : Math.min(popH, cap);
104
99
  const frozen = frozenMaxRef.current;
105
100
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
106
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
101
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
107
102
  triggerRect,
108
103
  popW,
109
104
  effectiveH,
@@ -115,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
110
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
116
111
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
117
112
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
118
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
119
113
  directionRef.current = next;
120
114
  pop.classList.toggle("top", next === "top");
121
115
  pop.classList.toggle("bottom", next === "bottom");
@@ -50,8 +50,10 @@ var Portal_default = Portal;
50
50
  var import_react = __toESM(require("react"), 1);
51
51
  var findScrollParent = (el) => {
52
52
  for (let p = el.parentElement; p; p = p.parentElement) {
53
- const { overflowY, overflowX } = getComputedStyle(p);
54
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
53
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
54
+ const { overflowY } = getComputedStyle(p);
55
+ if (!/(auto|scroll)/.test(overflowY)) continue;
56
+ if (p.scrollHeight > p.clientHeight) return p;
55
57
  }
56
58
  return null;
57
59
  };
@@ -84,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
84
86
  left = triggerRect.right - popW;
85
87
  }
86
88
  if (left < clip.left + 8) left = clip.left + 8;
87
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
88
89
  return {
89
90
  direction,
90
91
  top,
91
92
  left,
92
- maxHeight,
93
- over: {
94
- top: Math.max(0, clip.top - top),
95
- right: Math.max(0, left + popW - clip.right),
96
- bottom: Math.max(0, top + drawnH - clip.bottom),
97
- left: Math.max(0, clip.left - left)
98
- }
93
+ maxHeight
99
94
  };
100
95
  };
101
96
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -139,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
139
134
  const desiredH = cap == null ? popH : Math.min(popH, cap);
140
135
  const frozen = frozenMaxRef.current;
141
136
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
142
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
137
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
143
138
  triggerRect,
144
139
  popW,
145
140
  effectiveH,
@@ -151,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
146
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
152
147
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
153
148
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
154
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
155
149
  directionRef.current = next;
156
150
  pop.classList.toggle("top", next === "top");
157
151
  pop.classList.toggle("bottom", next === "bottom");
@@ -14,8 +14,10 @@ var Portal_default = Portal;
14
14
  import React from "react";
15
15
  var findScrollParent = (el) => {
16
16
  for (let p = el.parentElement; p; p = p.parentElement) {
17
- const { overflowY, overflowX } = getComputedStyle(p);
18
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
17
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
18
+ const { overflowY } = getComputedStyle(p);
19
+ if (!/(auto|scroll)/.test(overflowY)) continue;
20
+ if (p.scrollHeight > p.clientHeight) return p;
19
21
  }
20
22
  return null;
21
23
  };
@@ -48,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
48
50
  left = triggerRect.right - popW;
49
51
  }
50
52
  if (left < clip.left + 8) left = clip.left + 8;
51
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
52
53
  return {
53
54
  direction,
54
55
  top,
55
56
  left,
56
- maxHeight,
57
- over: {
58
- top: Math.max(0, clip.top - top),
59
- right: Math.max(0, left + popW - clip.right),
60
- bottom: Math.max(0, top + drawnH - clip.bottom),
61
- left: Math.max(0, clip.left - left)
62
- }
57
+ maxHeight
63
58
  };
64
59
  };
65
60
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -103,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
98
  const desiredH = cap == null ? popH : Math.min(popH, cap);
104
99
  const frozen = frozenMaxRef.current;
105
100
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
106
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
101
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
107
102
  triggerRect,
108
103
  popW,
109
104
  effectiveH,
@@ -115,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
110
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
116
111
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
117
112
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
118
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
119
113
  directionRef.current = next;
120
114
  pop.classList.toggle("top", next === "top");
121
115
  pop.classList.toggle("bottom", next === "bottom");
@@ -51,8 +51,10 @@ var Portal_default = Portal;
51
51
  var import_react = __toESM(require("react"), 1);
52
52
  var findScrollParent = (el) => {
53
53
  for (let p = el.parentElement; p; p = p.parentElement) {
54
- const { overflowY, overflowX } = getComputedStyle(p);
55
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
54
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
55
+ const { overflowY } = getComputedStyle(p);
56
+ if (!/(auto|scroll)/.test(overflowY)) continue;
57
+ if (p.scrollHeight > p.clientHeight) return p;
56
58
  }
57
59
  return null;
58
60
  };
@@ -85,18 +87,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
85
87
  left = triggerRect.right - popW;
86
88
  }
87
89
  if (left < clip.left + 8) left = clip.left + 8;
88
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
89
90
  return {
90
91
  direction,
91
92
  top,
92
93
  left,
93
- maxHeight,
94
- over: {
95
- top: Math.max(0, clip.top - top),
96
- right: Math.max(0, left + popW - clip.right),
97
- bottom: Math.max(0, top + drawnH - clip.bottom),
98
- left: Math.max(0, clip.left - left)
99
- }
94
+ maxHeight
100
95
  };
101
96
  };
102
97
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -140,7 +135,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
140
135
  const desiredH = cap == null ? popH : Math.min(popH, cap);
141
136
  const frozen = frozenMaxRef.current;
142
137
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
143
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
138
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
144
139
  triggerRect,
145
140
  popW,
146
141
  effectiveH,
@@ -152,7 +147,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
152
147
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
153
148
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
154
149
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
155
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
156
150
  directionRef.current = next;
157
151
  pop.classList.toggle("top", next === "top");
158
152
  pop.classList.toggle("bottom", next === "bottom");
@@ -14,8 +14,10 @@ var Portal_default = Portal;
14
14
  import React from "react";
15
15
  var findScrollParent = (el) => {
16
16
  for (let p = el.parentElement; p; p = p.parentElement) {
17
- const { overflowY, overflowX } = getComputedStyle(p);
18
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
17
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
18
+ const { overflowY } = getComputedStyle(p);
19
+ if (!/(auto|scroll)/.test(overflowY)) continue;
20
+ if (p.scrollHeight > p.clientHeight) return p;
19
21
  }
20
22
  return null;
21
23
  };
@@ -48,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
48
50
  left = triggerRect.right - popW;
49
51
  }
50
52
  if (left < clip.left + 8) left = clip.left + 8;
51
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
52
53
  return {
53
54
  direction,
54
55
  top,
55
56
  left,
56
- maxHeight,
57
- over: {
58
- top: Math.max(0, clip.top - top),
59
- right: Math.max(0, left + popW - clip.right),
60
- bottom: Math.max(0, top + drawnH - clip.bottom),
61
- left: Math.max(0, clip.left - left)
62
- }
57
+ maxHeight
63
58
  };
64
59
  };
65
60
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -103,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
98
  const desiredH = cap == null ? popH : Math.min(popH, cap);
104
99
  const frozen = frozenMaxRef.current;
105
100
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
106
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
101
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
107
102
  triggerRect,
108
103
  popW,
109
104
  effectiveH,
@@ -115,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
110
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
116
111
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
117
112
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
118
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
119
113
  directionRef.current = next;
120
114
  pop.classList.toggle("top", next === "top");
121
115
  pop.classList.toggle("bottom", next === "bottom");
@@ -59,18 +59,25 @@ var Table = (props) => {
59
59
  headerSticky = false,
60
60
  stickyShadow = true
61
61
  } = props;
62
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
- TableContext_default.Provider,
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ "div",
64
64
  {
65
- value: {
66
- rowBorderUse,
67
- colBorderUse,
68
- headerSticky,
69
- stickyShadow
70
- },
71
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "lib-xplat-table", children })
65
+ className: `lib-xplat-table-wrapper ${size}`,
66
+ "data-xplat-overlay-escape": "",
67
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
+ TableContext_default.Provider,
69
+ {
70
+ value: {
71
+ rowBorderUse,
72
+ colBorderUse,
73
+ headerSticky,
74
+ stickyShadow
75
+ },
76
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "lib-xplat-table", children })
77
+ }
78
+ )
72
79
  }
73
- ) });
80
+ );
74
81
  };
75
82
  Table.displayName = "Table";
76
83
  var Table_default = Table;
@@ -19,18 +19,25 @@ var Table = (props) => {
19
19
  headerSticky = false,
20
20
  stickyShadow = true
21
21
  } = props;
22
- return /* @__PURE__ */ jsx("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx(
23
- TableContext_default.Provider,
22
+ return /* @__PURE__ */ jsx(
23
+ "div",
24
24
  {
25
- value: {
26
- rowBorderUse,
27
- colBorderUse,
28
- headerSticky,
29
- stickyShadow
30
- },
31
- children: /* @__PURE__ */ jsx("table", { className: "lib-xplat-table", children })
25
+ className: `lib-xplat-table-wrapper ${size}`,
26
+ "data-xplat-overlay-escape": "",
27
+ children: /* @__PURE__ */ jsx(
28
+ TableContext_default.Provider,
29
+ {
30
+ value: {
31
+ rowBorderUse,
32
+ colBorderUse,
33
+ headerSticky,
34
+ stickyShadow
35
+ },
36
+ children: /* @__PURE__ */ jsx("table", { className: "lib-xplat-table", children })
37
+ }
38
+ )
32
39
  }
33
- ) });
40
+ );
34
41
  };
35
42
  Table.displayName = "Table";
36
43
  var Table_default = Table;
@@ -50,8 +50,10 @@ var Portal_default = Portal;
50
50
  var import_react = __toESM(require("react"), 1);
51
51
  var findScrollParent = (el) => {
52
52
  for (let p = el.parentElement; p; p = p.parentElement) {
53
- const { overflowY, overflowX } = getComputedStyle(p);
54
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
53
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
54
+ const { overflowY } = getComputedStyle(p);
55
+ if (!/(auto|scroll)/.test(overflowY)) continue;
56
+ if (p.scrollHeight > p.clientHeight) return p;
55
57
  }
56
58
  return null;
57
59
  };
@@ -84,18 +86,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
84
86
  left = triggerRect.right - popW;
85
87
  }
86
88
  if (left < clip.left + 8) left = clip.left + 8;
87
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
88
89
  return {
89
90
  direction,
90
91
  top,
91
92
  left,
92
- maxHeight,
93
- over: {
94
- top: Math.max(0, clip.top - top),
95
- right: Math.max(0, left + popW - clip.right),
96
- bottom: Math.max(0, top + drawnH - clip.bottom),
97
- left: Math.max(0, clip.left - left)
98
- }
93
+ maxHeight
99
94
  };
100
95
  };
101
96
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -139,7 +134,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
139
134
  const desiredH = cap == null ? popH : Math.min(popH, cap);
140
135
  const frozen = frozenMaxRef.current;
141
136
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
142
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
137
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
143
138
  triggerRect,
144
139
  popW,
145
140
  effectiveH,
@@ -151,7 +146,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
151
146
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
152
147
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
153
148
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
154
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
155
149
  directionRef.current = next;
156
150
  pop.classList.toggle("top", next === "top");
157
151
  pop.classList.toggle("bottom", next === "bottom");
@@ -14,8 +14,10 @@ var Portal_default = Portal;
14
14
  import React from "react";
15
15
  var findScrollParent = (el) => {
16
16
  for (let p = el.parentElement; p; p = p.parentElement) {
17
- const { overflowY, overflowX } = getComputedStyle(p);
18
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
17
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
18
+ const { overflowY } = getComputedStyle(p);
19
+ if (!/(auto|scroll)/.test(overflowY)) continue;
20
+ if (p.scrollHeight > p.clientHeight) return p;
19
21
  }
20
22
  return null;
21
23
  };
@@ -48,18 +50,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
48
50
  left = triggerRect.right - popW;
49
51
  }
50
52
  if (left < clip.left + 8) left = clip.left + 8;
51
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
52
53
  return {
53
54
  direction,
54
55
  top,
55
56
  left,
56
- maxHeight,
57
- over: {
58
- top: Math.max(0, clip.top - top),
59
- right: Math.max(0, left + popW - clip.right),
60
- bottom: Math.max(0, top + drawnH - clip.bottom),
61
- left: Math.max(0, clip.left - left)
62
- }
57
+ maxHeight
63
58
  };
64
59
  };
65
60
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -103,7 +98,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
98
  const desiredH = cap == null ? popH : Math.min(popH, cap);
104
99
  const frozen = frozenMaxRef.current;
105
100
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
106
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
101
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
107
102
  triggerRect,
108
103
  popW,
109
104
  effectiveH,
@@ -115,7 +110,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
115
110
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
116
111
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
117
112
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
118
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
119
113
  directionRef.current = next;
120
114
  pop.classList.toggle("top", next === "top");
121
115
  pop.classList.toggle("bottom", next === "bottom");
@@ -3236,8 +3236,10 @@ var import_react11 = __toESM(require("react"), 1);
3236
3236
  var import_react10 = __toESM(require("react"), 1);
3237
3237
  var findScrollParent = (el) => {
3238
3238
  for (let p = el.parentElement; p; p = p.parentElement) {
3239
- const { overflowY, overflowX } = getComputedStyle(p);
3240
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
3239
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
3240
+ const { overflowY } = getComputedStyle(p);
3241
+ if (!/(auto|scroll)/.test(overflowY)) continue;
3242
+ if (p.scrollHeight > p.clientHeight) return p;
3241
3243
  }
3242
3244
  return null;
3243
3245
  };
@@ -3270,18 +3272,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
3270
3272
  left = triggerRect.right - popW;
3271
3273
  }
3272
3274
  if (left < clip.left + 8) left = clip.left + 8;
3273
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
3274
3275
  return {
3275
3276
  direction,
3276
3277
  top,
3277
3278
  left,
3278
- maxHeight,
3279
- over: {
3280
- top: Math.max(0, clip.top - top),
3281
- right: Math.max(0, left + popW - clip.right),
3282
- bottom: Math.max(0, top + drawnH - clip.bottom),
3283
- left: Math.max(0, clip.left - left)
3284
- }
3279
+ maxHeight
3285
3280
  };
3286
3281
  };
3287
3282
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -3325,7 +3320,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3325
3320
  const desiredH = cap == null ? popH : Math.min(popH, cap);
3326
3321
  const frozen = frozenMaxRef.current;
3327
3322
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
3328
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
3323
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
3329
3324
  triggerRect,
3330
3325
  popW,
3331
3326
  effectiveH,
@@ -3337,7 +3332,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3337
3332
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
3338
3333
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
3339
3334
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
3340
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
3341
3335
  directionRef.current = next;
3342
3336
  pop.classList.toggle("top", next === "top");
3343
3337
  pop.classList.toggle("bottom", next === "bottom");
@@ -7067,18 +7061,25 @@ var Table = (props) => {
7067
7061
  headerSticky = false,
7068
7062
  stickyShadow = true
7069
7063
  } = props;
7070
- return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
7071
- TableContext_default.Provider,
7064
+ return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
7065
+ "div",
7072
7066
  {
7073
- value: {
7074
- rowBorderUse,
7075
- colBorderUse,
7076
- headerSticky,
7077
- stickyShadow
7078
- },
7079
- children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("table", { className: "lib-xplat-table", children })
7067
+ className: `lib-xplat-table-wrapper ${size}`,
7068
+ "data-xplat-overlay-escape": "",
7069
+ children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
7070
+ TableContext_default.Provider,
7071
+ {
7072
+ value: {
7073
+ rowBorderUse,
7074
+ colBorderUse,
7075
+ headerSticky,
7076
+ stickyShadow
7077
+ },
7078
+ children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("table", { className: "lib-xplat-table", children })
7079
+ }
7080
+ )
7080
7081
  }
7081
- ) });
7082
+ );
7082
7083
  };
7083
7084
  Table.displayName = "Table";
7084
7085
  var Table_default = Table;
@@ -3134,8 +3134,10 @@ import React11 from "react";
3134
3134
  import React10 from "react";
3135
3135
  var findScrollParent = (el) => {
3136
3136
  for (let p = el.parentElement; p; p = p.parentElement) {
3137
- const { overflowY, overflowX } = getComputedStyle(p);
3138
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
3137
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
3138
+ const { overflowY } = getComputedStyle(p);
3139
+ if (!/(auto|scroll)/.test(overflowY)) continue;
3140
+ if (p.scrollHeight > p.clientHeight) return p;
3139
3141
  }
3140
3142
  return null;
3141
3143
  };
@@ -3168,18 +3170,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
3168
3170
  left = triggerRect.right - popW;
3169
3171
  }
3170
3172
  if (left < clip.left + 8) left = clip.left + 8;
3171
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
3172
3173
  return {
3173
3174
  direction,
3174
3175
  top,
3175
3176
  left,
3176
- maxHeight,
3177
- over: {
3178
- top: Math.max(0, clip.top - top),
3179
- right: Math.max(0, left + popW - clip.right),
3180
- bottom: Math.max(0, top + drawnH - clip.bottom),
3181
- left: Math.max(0, clip.left - left)
3182
- }
3177
+ maxHeight
3183
3178
  };
3184
3179
  };
3185
3180
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -3223,7 +3218,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3223
3218
  const desiredH = cap == null ? popH : Math.min(popH, cap);
3224
3219
  const frozen = frozenMaxRef.current;
3225
3220
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
3226
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
3221
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
3227
3222
  triggerRect,
3228
3223
  popW,
3229
3224
  effectiveH,
@@ -3235,7 +3230,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3235
3230
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
3236
3231
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
3237
3232
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
3238
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
3239
3233
  directionRef.current = next;
3240
3234
  pop.classList.toggle("top", next === "top");
3241
3235
  pop.classList.toggle("bottom", next === "bottom");
@@ -6965,18 +6959,25 @@ var Table = (props) => {
6965
6959
  headerSticky = false,
6966
6960
  stickyShadow = true
6967
6961
  } = props;
6968
- return /* @__PURE__ */ jsx344("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx344(
6969
- TableContext_default.Provider,
6962
+ return /* @__PURE__ */ jsx344(
6963
+ "div",
6970
6964
  {
6971
- value: {
6972
- rowBorderUse,
6973
- colBorderUse,
6974
- headerSticky,
6975
- stickyShadow
6976
- },
6977
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
6965
+ className: `lib-xplat-table-wrapper ${size}`,
6966
+ "data-xplat-overlay-escape": "",
6967
+ children: /* @__PURE__ */ jsx344(
6968
+ TableContext_default.Provider,
6969
+ {
6970
+ value: {
6971
+ rowBorderUse,
6972
+ colBorderUse,
6973
+ headerSticky,
6974
+ stickyShadow
6975
+ },
6976
+ children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
6977
+ }
6978
+ )
6978
6979
  }
6979
- ) });
6980
+ );
6980
6981
  };
6981
6982
  Table.displayName = "Table";
6982
6983
  var Table_default = Table;
package/dist/index.cjs CHANGED
@@ -7648,8 +7648,10 @@ var import_react11 = __toESM(require("react"), 1);
7648
7648
  var import_react10 = __toESM(require("react"), 1);
7649
7649
  var findScrollParent = (el) => {
7650
7650
  for (let p = el.parentElement; p; p = p.parentElement) {
7651
- const { overflowY, overflowX } = getComputedStyle(p);
7652
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
7651
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
7652
+ const { overflowY } = getComputedStyle(p);
7653
+ if (!/(auto|scroll)/.test(overflowY)) continue;
7654
+ if (p.scrollHeight > p.clientHeight) return p;
7653
7655
  }
7654
7656
  return null;
7655
7657
  };
@@ -7682,18 +7684,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
7682
7684
  left = triggerRect.right - popW;
7683
7685
  }
7684
7686
  if (left < clip.left + 8) left = clip.left + 8;
7685
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
7686
7687
  return {
7687
7688
  direction,
7688
7689
  top,
7689
7690
  left,
7690
- maxHeight,
7691
- over: {
7692
- top: Math.max(0, clip.top - top),
7693
- right: Math.max(0, left + popW - clip.right),
7694
- bottom: Math.max(0, top + drawnH - clip.bottom),
7695
- left: Math.max(0, clip.left - left)
7696
- }
7691
+ maxHeight
7697
7692
  };
7698
7693
  };
7699
7694
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -7737,7 +7732,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7737
7732
  const desiredH = cap == null ? popH : Math.min(popH, cap);
7738
7733
  const frozen = frozenMaxRef.current;
7739
7734
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
7740
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
7735
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
7741
7736
  triggerRect,
7742
7737
  popW,
7743
7738
  effectiveH,
@@ -7749,7 +7744,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7749
7744
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
7750
7745
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
7751
7746
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
7752
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
7753
7747
  directionRef.current = next;
7754
7748
  pop.classList.toggle("top", next === "top");
7755
7749
  pop.classList.toggle("bottom", next === "bottom");
@@ -11479,18 +11473,25 @@ var Table = (props) => {
11479
11473
  headerSticky = false,
11480
11474
  stickyShadow = true
11481
11475
  } = props;
11482
- return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
11483
- TableContext_default.Provider,
11476
+ return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
11477
+ "div",
11484
11478
  {
11485
- value: {
11486
- rowBorderUse,
11487
- colBorderUse,
11488
- headerSticky,
11489
- stickyShadow
11490
- },
11491
- children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("table", { className: "lib-xplat-table", children })
11479
+ className: `lib-xplat-table-wrapper ${size}`,
11480
+ "data-xplat-overlay-escape": "",
11481
+ children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
11482
+ TableContext_default.Provider,
11483
+ {
11484
+ value: {
11485
+ rowBorderUse,
11486
+ colBorderUse,
11487
+ headerSticky,
11488
+ stickyShadow
11489
+ },
11490
+ children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("table", { className: "lib-xplat-table", children })
11491
+ }
11492
+ )
11492
11493
  }
11493
- ) });
11494
+ );
11494
11495
  };
11495
11496
  Table.displayName = "Table";
11496
11497
  var Table_default = Table;
package/dist/index.js CHANGED
@@ -7237,8 +7237,10 @@ import React11 from "react";
7237
7237
  import React10 from "react";
7238
7238
  var findScrollParent = (el) => {
7239
7239
  for (let p = el.parentElement; p; p = p.parentElement) {
7240
- const { overflowY, overflowX } = getComputedStyle(p);
7241
- if (/(auto|scroll)/.test(overflowY) || /(auto|scroll)/.test(overflowX)) return p;
7240
+ if (p.dataset.xplatOverlayEscape !== void 0) continue;
7241
+ const { overflowY } = getComputedStyle(p);
7242
+ if (!/(auto|scroll)/.test(overflowY)) continue;
7243
+ if (p.scrollHeight > p.clientHeight) return p;
7242
7244
  }
7243
7245
  return null;
7244
7246
  };
@@ -7271,18 +7273,11 @@ var computePlacement = (triggerRect, popW, popH, clip) => {
7271
7273
  left = triggerRect.right - popW;
7272
7274
  }
7273
7275
  if (left < clip.left + 8) left = clip.left + 8;
7274
- const drawnH = maxHeight === null ? popH : Math.min(popH, maxHeight);
7275
7276
  return {
7276
7277
  direction,
7277
7278
  top,
7278
7279
  left,
7279
- maxHeight,
7280
- over: {
7281
- top: Math.max(0, clip.top - top),
7282
- right: Math.max(0, left + popW - clip.right),
7283
- bottom: Math.max(0, top + drawnH - clip.bottom),
7284
- left: Math.max(0, clip.left - left)
7285
- }
7280
+ maxHeight
7286
7281
  };
7287
7282
  };
7288
7283
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
@@ -7326,7 +7321,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7326
7321
  const desiredH = cap == null ? popH : Math.min(popH, cap);
7327
7322
  const frozen = frozenMaxRef.current;
7328
7323
  const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
7329
- const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
7324
+ const { direction: next, top, left, maxHeight: suggested } = computePlacement(
7330
7325
  triggerRect,
7331
7326
  popW,
7332
7327
  effectiveH,
@@ -7338,7 +7333,6 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
7338
7333
  pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
7339
7334
  pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
7340
7335
  pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
7341
- pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
7342
7336
  directionRef.current = next;
7343
7337
  pop.classList.toggle("top", next === "top");
7344
7338
  pop.classList.toggle("bottom", next === "bottom");
@@ -11068,18 +11062,25 @@ var Table = (props) => {
11068
11062
  headerSticky = false,
11069
11063
  stickyShadow = true
11070
11064
  } = props;
11071
- return /* @__PURE__ */ jsx344("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx344(
11072
- TableContext_default.Provider,
11065
+ return /* @__PURE__ */ jsx344(
11066
+ "div",
11073
11067
  {
11074
- value: {
11075
- rowBorderUse,
11076
- colBorderUse,
11077
- headerSticky,
11078
- stickyShadow
11079
- },
11080
- children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
11068
+ className: `lib-xplat-table-wrapper ${size}`,
11069
+ "data-xplat-overlay-escape": "",
11070
+ children: /* @__PURE__ */ jsx344(
11071
+ TableContext_default.Provider,
11072
+ {
11073
+ value: {
11074
+ rowBorderUse,
11075
+ colBorderUse,
11076
+ headerSticky,
11077
+ stickyShadow
11078
+ },
11079
+ children: /* @__PURE__ */ jsx344("table", { className: "lib-xplat-table", children })
11080
+ }
11081
+ )
11081
11082
  }
11082
- ) });
11083
+ );
11083
11084
  };
11084
11085
  Table.displayName = "Table";
11085
11086
  var Table_default = Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",