@x-plat/design-system 0.14.2 → 0.14.4

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 (74) hide show
  1. package/dist/components/AutoResizeTextArea/index.d.cts +1 -1
  2. package/dist/components/AutoResizeTextArea/index.d.ts +1 -1
  3. package/dist/components/Badge/index.d.cts +1 -1
  4. package/dist/components/Badge/index.d.ts +1 -1
  5. package/dist/components/ChatInput/index.d.cts +1 -1
  6. package/dist/components/ChatInput/index.d.ts +1 -1
  7. package/dist/components/CheckBox/index.cjs +3 -3
  8. package/dist/components/CheckBox/index.d.cts +2 -2
  9. package/dist/components/CheckBox/index.d.ts +2 -2
  10. package/dist/components/CheckBox/index.js +3 -3
  11. package/dist/components/DatePicker/index.d.cts +1 -1
  12. package/dist/components/DatePicker/index.d.ts +1 -1
  13. package/dist/components/Dropdown/index.cjs +16 -13
  14. package/dist/components/Dropdown/index.css +3 -1
  15. package/dist/components/Dropdown/index.js +16 -13
  16. package/dist/components/FieldMessage/index.d.cts +1 -1
  17. package/dist/components/FieldMessage/index.d.ts +1 -1
  18. package/dist/components/FileUpload/index.d.cts +1 -1
  19. package/dist/components/FileUpload/index.d.ts +1 -1
  20. package/dist/components/ImageSelector/index.d.cts +1 -1
  21. package/dist/components/ImageSelector/index.d.ts +1 -1
  22. package/dist/components/Input/index.d.cts +1 -1
  23. package/dist/components/Input/index.d.ts +1 -1
  24. package/dist/components/NotificationBadge/index.d.cts +1 -1
  25. package/dist/components/NotificationBadge/index.d.ts +1 -1
  26. package/dist/components/Pagination/index.d.cts +1 -1
  27. package/dist/components/Pagination/index.d.ts +1 -1
  28. package/dist/components/PopOver/index.cjs +15 -14
  29. package/dist/components/PopOver/index.css +3 -1
  30. package/dist/components/PopOver/index.js +15 -14
  31. package/dist/components/Progress/index.d.cts +1 -1
  32. package/dist/components/Progress/index.d.ts +1 -1
  33. package/dist/components/Radio/index.d.cts +2 -2
  34. package/dist/components/Radio/index.d.ts +2 -2
  35. package/dist/components/Select/index.cjs +16 -12
  36. package/dist/components/Select/index.css +1 -1
  37. package/dist/components/Select/index.d.cts +1 -1
  38. package/dist/components/Select/index.d.ts +1 -1
  39. package/dist/components/Select/index.js +16 -12
  40. package/dist/components/Spinner/index.d.cts +1 -1
  41. package/dist/components/Spinner/index.d.ts +1 -1
  42. package/dist/components/Stat/index.d.cts +1 -1
  43. package/dist/components/Stat/index.d.ts +1 -1
  44. package/dist/components/Steps/index.d.cts +1 -1
  45. package/dist/components/Steps/index.d.ts +1 -1
  46. package/dist/components/Switch/index.d.cts +2 -2
  47. package/dist/components/Switch/index.d.ts +2 -2
  48. package/dist/components/TextArea/index.d.cts +1 -1
  49. package/dist/components/TextArea/index.d.ts +1 -1
  50. package/dist/components/TimePicker/index.cjs +17 -13
  51. package/dist/components/TimePicker/index.css +3 -1
  52. package/dist/components/TimePicker/index.d.cts +1 -1
  53. package/dist/components/TimePicker/index.d.ts +1 -1
  54. package/dist/components/TimePicker/index.js +17 -13
  55. package/dist/components/index.cjs +22 -22
  56. package/dist/components/index.css +4 -4
  57. package/dist/components/index.d.cts +2 -2
  58. package/dist/components/index.d.ts +2 -2
  59. package/dist/components/index.js +22 -22
  60. package/dist/index.cjs +24 -22
  61. package/dist/index.css +4 -4
  62. package/dist/index.d.cts +3 -3
  63. package/dist/index.d.ts +3 -3
  64. package/dist/index.js +23 -22
  65. package/dist/{status-njWqQWFV.d.cts → status-C70BBv2S.d.cts} +3 -1
  66. package/dist/{status-njWqQWFV.d.ts → status-C70BBv2S.d.ts} +3 -1
  67. package/dist/tokens/index.cjs +5 -0
  68. package/dist/tokens/index.d.cts +3 -0
  69. package/dist/tokens/index.d.ts +3 -0
  70. package/dist/tokens/index.js +4 -0
  71. package/dist/{validation-Dqo1zqhT.d.cts → validation-BYpAI6Ct.d.cts} +1 -1
  72. package/dist/{validation-Dqo1zqhT.d.ts → validation-BYpAI6Ct.d.ts} +1 -1
  73. package/guidelines/MIGRATION.md +50 -1
  74. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { T as TextareaAttributes } from '../../attributes-DJIWir_0.cjs';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
4
4
 
5
5
  interface AutoResizeTextAreaProps extends TextareaAttributes {
6
6
  /** ChatInput 등 내부 임베딩 시 wrapper 없이 textarea만 렌더 */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { T as TextareaAttributes } from '../../attributes-DJIWir_0.js';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
4
4
 
5
5
  interface AutoResizeTextAreaProps extends TextareaAttributes {
6
6
  /** ChatInput 등 내부 임베딩 시 wrapper 없이 textarea만 렌더 */
@@ -1,4 +1,4 @@
1
1
  export { Badge, Badge as NotificationBadge, Badge as default } from '../NotificationBadge/index.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
- import '../../status-njWqQWFV.cjs';
4
+ import '../../status-C70BBv2S.cjs';
@@ -1,4 +1,4 @@
1
1
  export { Badge, Badge as NotificationBadge, Badge as default } from '../NotificationBadge/index.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
- import '../../status-njWqQWFV.js';
4
+ import '../../status-C70BBv2S.js';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
3
3
 
4
4
  type ButtonType = "primary" | "secondary" | "ghost";
5
5
  interface ChatInputProps {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
3
3
 
4
4
  type ButtonType = "primary" | "secondary" | "ghost";
5
5
  interface ChatInputProps {
@@ -27,6 +27,9 @@ module.exports = __toCommonJS(CheckBox_exports);
27
27
  // src/tokens/colors.ts
28
28
  var import_tokens_core = require("@x-plat/tokens-core");
29
29
 
30
+ // src/tokens/interface/status.ts
31
+ var normalizeStatus = (value) => value === "brand" ? "primary" : value;
32
+
30
33
  // src/tokens/svg/action/CopyIcon.tsx
31
34
  var import_jsx_runtime = require("react/jsx-runtime");
32
35
 
@@ -1019,9 +1022,6 @@ var import_jsx_runtime294 = require("react/jsx-runtime");
1019
1022
  // src/tokens/index.ts
1020
1023
  var import_tokens_core2 = require("@x-plat/tokens-core");
1021
1024
 
1022
- // src/tokens/interface/status.ts
1023
- var normalizeStatus = (value) => value === "brand" ? "primary" : value;
1024
-
1025
1025
  // ../../node_modules/clsx/dist/clsx.mjs
1026
1026
  function r(e) {
1027
1027
  var t, f, n = "";
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.cjs';
4
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.cjs';
4
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
5
5
  import 'react';
6
6
 
7
7
  type CheckBoxSize = "sm" | "md" | "lg";
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.js';
4
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.js';
4
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
5
5
  import 'react';
6
6
 
7
7
  type CheckBoxSize = "sm" | "md" | "lg";
@@ -1,6 +1,9 @@
1
1
  // src/tokens/colors.ts
2
2
  import { semantic } from "@x-plat/tokens-core";
3
3
 
4
+ // src/tokens/interface/status.ts
5
+ var normalizeStatus = (value) => value === "brand" ? "primary" : value;
6
+
4
7
  // src/tokens/svg/action/CopyIcon.tsx
5
8
  import { jsx, jsxs } from "react/jsx-runtime";
6
9
 
@@ -993,9 +996,6 @@ import { jsx as jsx294, jsxs as jsxs188 } from "react/jsx-runtime";
993
996
  // src/tokens/index.ts
994
997
  import { cssVar } from "@x-plat/tokens-core";
995
998
 
996
- // src/tokens/interface/status.ts
997
- var normalizeStatus = (value) => value === "brand" ? "primary" : value;
998
-
999
999
  // ../../node_modules/clsx/dist/clsx.mjs
1000
1000
  function r(e) {
1001
1001
  var t, f, n = "";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface InputDatePickerProps {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface InputDatePickerProps {
@@ -49,23 +49,22 @@ var Portal_default = Portal;
49
49
  // src/tokens/hooks/useAutoPosition.ts
50
50
  var import_react = __toESM(require("react"), 1);
51
51
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
52
- const [position, setPosition] = import_react.default.useState({
53
- position: {},
54
- direction: "bottom"
55
- });
52
+ const [direction, setDirection] = import_react.default.useState("bottom");
53
+ const directionRef = import_react.default.useRef("bottom");
56
54
  const calculatePosition = import_react.default.useCallback(() => {
57
- if (!triggerRef.current || !popRef.current) return;
55
+ const pop = popRef.current;
56
+ if (!triggerRef.current || !pop) return;
58
57
  const triggerRect = triggerRef.current.getBoundingClientRect();
59
- const popW = popRef.current.offsetWidth;
60
- const popH = popRef.current.offsetHeight;
58
+ const popW = pop.offsetWidth;
59
+ const popH = pop.offsetHeight;
61
60
  const viewportHeight = window.innerHeight;
62
61
  const viewportWidth = window.innerWidth;
63
62
  if (popH === 0 || popW === 0) return;
64
- let direction = "bottom";
63
+ let next = "bottom";
65
64
  let top;
66
65
  let left;
67
66
  if (triggerRect.bottom + popH > viewportHeight && triggerRect.top - popH > 0) {
68
- direction = "top";
67
+ next = "top";
69
68
  top = triggerRect.top - popH;
70
69
  } else {
71
70
  top = triggerRect.bottom;
@@ -75,7 +74,12 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
75
74
  left = triggerRect.right - popW;
76
75
  }
77
76
  if (left < 8) left = 8;
78
- setPosition({ position: { top, left }, direction });
77
+ pop.style.top = `${top + window.scrollY}px`;
78
+ pop.style.left = `${left + window.scrollX}px`;
79
+ if (next !== directionRef.current) {
80
+ directionRef.current = next;
81
+ setDirection(next);
82
+ }
79
83
  }, [triggerRef, popRef]);
80
84
  import_react.default.useLayoutEffect(() => {
81
85
  if (!enabled) return;
@@ -106,7 +110,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
106
110
  window.removeEventListener("scroll", onScrollOrResize, true);
107
111
  };
108
112
  }, [calculatePosition, enabled]);
109
- return position;
113
+ return { direction };
110
114
  };
111
115
  var useAutoPosition_default = useAutoPosition;
112
116
 
@@ -184,7 +188,7 @@ var Dropdown = (props) => {
184
188
  const [visible, setVisible] = import_react4.default.useState(false);
185
189
  const triggerRef = import_react4.default.useRef(null);
186
190
  const menuRef = import_react4.default.useRef(null);
187
- const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
191
+ const { direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
188
192
  useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
189
193
  useEscapeKey(isOpen, () => {
190
194
  setIsOpen(false);
@@ -220,7 +224,6 @@ var Dropdown = (props) => {
220
224
  {
221
225
  ref: menuRef,
222
226
  className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
223
- style: { top: position.top, left: position.left },
224
227
  role: "menu",
225
228
  children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
226
229
  "button",
@@ -1,3 +1,5 @@
1
+ @charset "UTF-8";
2
+
1
3
  /* src/components/Dropdown/dropdown.scss */
2
4
  .lib-xplat-dropdown {
3
5
  position: relative;
@@ -8,7 +10,7 @@
8
10
  cursor: pointer;
9
11
  }
10
12
  .lib-xplat-dropdown-menu {
11
- position: fixed;
13
+ position: absolute;
12
14
  z-index: 1000;
13
15
  min-width: 160px;
14
16
  background: var(--semantic-surface-neutral-primary);
@@ -13,23 +13,22 @@ var Portal_default = Portal;
13
13
  // src/tokens/hooks/useAutoPosition.ts
14
14
  import React from "react";
15
15
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
16
- const [position, setPosition] = React.useState({
17
- position: {},
18
- direction: "bottom"
19
- });
16
+ const [direction, setDirection] = React.useState("bottom");
17
+ const directionRef = React.useRef("bottom");
20
18
  const calculatePosition = React.useCallback(() => {
21
- if (!triggerRef.current || !popRef.current) return;
19
+ const pop = popRef.current;
20
+ if (!triggerRef.current || !pop) return;
22
21
  const triggerRect = triggerRef.current.getBoundingClientRect();
23
- const popW = popRef.current.offsetWidth;
24
- const popH = popRef.current.offsetHeight;
22
+ const popW = pop.offsetWidth;
23
+ const popH = pop.offsetHeight;
25
24
  const viewportHeight = window.innerHeight;
26
25
  const viewportWidth = window.innerWidth;
27
26
  if (popH === 0 || popW === 0) return;
28
- let direction = "bottom";
27
+ let next = "bottom";
29
28
  let top;
30
29
  let left;
31
30
  if (triggerRect.bottom + popH > viewportHeight && triggerRect.top - popH > 0) {
32
- direction = "top";
31
+ next = "top";
33
32
  top = triggerRect.top - popH;
34
33
  } else {
35
34
  top = triggerRect.bottom;
@@ -39,7 +38,12 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
39
38
  left = triggerRect.right - popW;
40
39
  }
41
40
  if (left < 8) left = 8;
42
- setPosition({ position: { top, left }, direction });
41
+ pop.style.top = `${top + window.scrollY}px`;
42
+ pop.style.left = `${left + window.scrollX}px`;
43
+ if (next !== directionRef.current) {
44
+ directionRef.current = next;
45
+ setDirection(next);
46
+ }
43
47
  }, [triggerRef, popRef]);
44
48
  React.useLayoutEffect(() => {
45
49
  if (!enabled) return;
@@ -70,7 +74,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
70
74
  window.removeEventListener("scroll", onScrollOrResize, true);
71
75
  };
72
76
  }, [calculatePosition, enabled]);
73
- return position;
77
+ return { direction };
74
78
  };
75
79
  var useAutoPosition_default = useAutoPosition;
76
80
 
@@ -148,7 +152,7 @@ var Dropdown = (props) => {
148
152
  const [visible, setVisible] = React4.useState(false);
149
153
  const triggerRef = React4.useRef(null);
150
154
  const menuRef = React4.useRef(null);
151
- const { position, direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
155
+ const { direction } = useAutoPosition_default(triggerRef, menuRef, mounted);
152
156
  useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
153
157
  useEscapeKey(isOpen, () => {
154
158
  setIsOpen(false);
@@ -184,7 +188,6 @@ var Dropdown = (props) => {
184
188
  {
185
189
  ref: menuRef,
186
190
  className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
187
- style: { top: position.top, left: position.left },
188
191
  role: "menu",
189
192
  children: items.map((item) => /* @__PURE__ */ jsx(
190
193
  "button",
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
4
4
 
5
5
  interface FieldMessageProps {
6
6
  /** 표시할 검증 메시지 목록. 비어 있거나 없으면 아무것도 그리지 않는다 */
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
4
4
 
5
5
  interface FieldMessageProps {
6
6
  /** 표시할 검증 메시지 목록. 비어 있거나 없으면 아무것도 그리지 않는다 */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
3
3
 
4
4
  interface FileUploadProps {
5
5
  /** 고를 수 있는 파일 형식 (input 의 accept 와 같다) */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
3
3
 
4
4
  interface FileUploadProps {
5
5
  /** 고를 수 있는 파일 형식 (input 의 accept 와 같다) */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
3
3
 
4
4
  interface ImageSelectorProps {
5
5
  /** 선택된 이미지 파일. 주면 미리보기가 나온다 */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
2
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
3
3
 
4
4
  interface ImageSelectorProps {
5
5
  /** 선택된 이미지 파일. 주면 미리보기가 나온다 */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
4
4
 
5
5
  type InputSize$1 = "sm" | "md" | "lg";
6
6
  interface InputProps extends Omit<InputAttributes, "size"> {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
3
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
4
4
 
5
5
  type InputSize$1 = "sm" | "md" | "lg";
6
6
  interface InputProps extends Omit<InputAttributes, "size"> {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.cjs';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.cjs';
4
4
 
5
5
  /** NotificationBadge 의 상태 색 */
6
6
  type NotificationBadgeType = "primary" | "success" | "error" | "warning" | "info";
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.js';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.js';
4
4
 
5
5
  /** NotificationBadge 의 상태 색 */
6
6
  type NotificationBadgeType = "primary" | "success" | "error" | "warning" | "info";
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { L as LegacyStatusType } from '../../status-njWqQWFV.cjs';
2
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.cjs';
3
3
 
4
4
  type PaginationSize = "sm" | "md" | "lg";
5
5
  /** Pagination 의 상태 색 */
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { L as LegacyStatusType } from '../../status-njWqQWFV.js';
2
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.js';
3
3
 
4
4
  type PaginationSize = "sm" | "md" | "lg";
5
5
  /** Pagination 의 상태 색 */
@@ -49,23 +49,22 @@ var Portal_default = Portal;
49
49
  // src/tokens/hooks/useAutoPosition.ts
50
50
  var import_react = __toESM(require("react"), 1);
51
51
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
52
- const [position, setPosition] = import_react.default.useState({
53
- position: {},
54
- direction: "bottom"
55
- });
52
+ const [direction, setDirection] = import_react.default.useState("bottom");
53
+ const directionRef = import_react.default.useRef("bottom");
56
54
  const calculatePosition = import_react.default.useCallback(() => {
57
- if (!triggerRef.current || !popRef.current) return;
55
+ const pop = popRef.current;
56
+ if (!triggerRef.current || !pop) return;
58
57
  const triggerRect = triggerRef.current.getBoundingClientRect();
59
- const popW = popRef.current.offsetWidth;
60
- const popH = popRef.current.offsetHeight;
58
+ const popW = pop.offsetWidth;
59
+ const popH = pop.offsetHeight;
61
60
  const viewportHeight = window.innerHeight;
62
61
  const viewportWidth = window.innerWidth;
63
62
  if (popH === 0 || popW === 0) return;
64
- let direction = "bottom";
63
+ let next = "bottom";
65
64
  let top;
66
65
  let left;
67
66
  if (triggerRect.bottom + popH > viewportHeight && triggerRect.top - popH > 0) {
68
- direction = "top";
67
+ next = "top";
69
68
  top = triggerRect.top - popH;
70
69
  } else {
71
70
  top = triggerRect.bottom;
@@ -75,7 +74,12 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
75
74
  left = triggerRect.right - popW;
76
75
  }
77
76
  if (left < 8) left = 8;
78
- setPosition({ position: { top, left }, direction });
77
+ pop.style.top = `${top + window.scrollY}px`;
78
+ pop.style.left = `${left + window.scrollX}px`;
79
+ if (next !== directionRef.current) {
80
+ directionRef.current = next;
81
+ setDirection(next);
82
+ }
79
83
  }, [triggerRef, popRef]);
80
84
  import_react.default.useLayoutEffect(() => {
81
85
  if (!enabled) return;
@@ -106,7 +110,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
106
110
  window.removeEventListener("scroll", onScrollOrResize, true);
107
111
  };
108
112
  }, [calculatePosition, enabled]);
109
- return position;
113
+ return { direction };
110
114
  };
111
115
  var useAutoPosition_default = useAutoPosition;
112
116
 
@@ -221,9 +225,6 @@ var PopOver = (props) => {
221
225
  eventTrigger && "visible"
222
226
  ),
223
227
  ref: popRef,
224
- style: {
225
- ...position.position
226
- },
227
228
  children: PopOverEl
228
229
  }
229
230
  ) })
@@ -1,3 +1,5 @@
1
+ @charset "UTF-8";
2
+
1
3
  /* src/components/PopOver/popOver.scss */
2
4
  .lib-xplat-pop-over {
3
5
  position: relative;
@@ -7,7 +9,7 @@
7
9
  user-select: none;
8
10
  }
9
11
  .lib-xplat-pop-over-content {
10
- position: fixed;
12
+ position: absolute;
11
13
  z-index: 1000;
12
14
  cursor: default;
13
15
  transition: transform 0.2s ease, opacity 0.2s ease;
@@ -13,23 +13,22 @@ var Portal_default = Portal;
13
13
  // src/tokens/hooks/useAutoPosition.ts
14
14
  import React from "react";
15
15
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
16
- const [position, setPosition] = React.useState({
17
- position: {},
18
- direction: "bottom"
19
- });
16
+ const [direction, setDirection] = React.useState("bottom");
17
+ const directionRef = React.useRef("bottom");
20
18
  const calculatePosition = React.useCallback(() => {
21
- if (!triggerRef.current || !popRef.current) return;
19
+ const pop = popRef.current;
20
+ if (!triggerRef.current || !pop) return;
22
21
  const triggerRect = triggerRef.current.getBoundingClientRect();
23
- const popW = popRef.current.offsetWidth;
24
- const popH = popRef.current.offsetHeight;
22
+ const popW = pop.offsetWidth;
23
+ const popH = pop.offsetHeight;
25
24
  const viewportHeight = window.innerHeight;
26
25
  const viewportWidth = window.innerWidth;
27
26
  if (popH === 0 || popW === 0) return;
28
- let direction = "bottom";
27
+ let next = "bottom";
29
28
  let top;
30
29
  let left;
31
30
  if (triggerRect.bottom + popH > viewportHeight && triggerRect.top - popH > 0) {
32
- direction = "top";
31
+ next = "top";
33
32
  top = triggerRect.top - popH;
34
33
  } else {
35
34
  top = triggerRect.bottom;
@@ -39,7 +38,12 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
39
38
  left = triggerRect.right - popW;
40
39
  }
41
40
  if (left < 8) left = 8;
42
- setPosition({ position: { top, left }, direction });
41
+ pop.style.top = `${top + window.scrollY}px`;
42
+ pop.style.left = `${left + window.scrollX}px`;
43
+ if (next !== directionRef.current) {
44
+ directionRef.current = next;
45
+ setDirection(next);
46
+ }
43
47
  }, [triggerRef, popRef]);
44
48
  React.useLayoutEffect(() => {
45
49
  if (!enabled) return;
@@ -70,7 +74,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
70
74
  window.removeEventListener("scroll", onScrollOrResize, true);
71
75
  };
72
76
  }, [calculatePosition, enabled]);
73
- return position;
77
+ return { direction };
74
78
  };
75
79
  var useAutoPosition_default = useAutoPosition;
76
80
 
@@ -185,9 +189,6 @@ var PopOver = (props) => {
185
189
  eventTrigger && "visible"
186
190
  ),
187
191
  ref: popRef,
188
- style: {
189
- ...position.position
190
- },
191
192
  children: PopOverEl
192
193
  }
193
194
  ) })
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { L as LegacyStatusType } from '../../status-njWqQWFV.cjs';
2
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.cjs';
3
3
 
4
4
  type ProgressSize = "sm" | "md" | "lg";
5
5
  /** Progress 의 상태 색 */
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { L as LegacyStatusType } from '../../status-njWqQWFV.js';
2
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.js';
3
3
 
4
4
  type ProgressSize = "sm" | "md" | "lg";
5
5
  /** Progress 의 상태 색 */
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.cjs';
4
- import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.cjs';
4
+ import { V as Validation } from '../../validation-BYpAI6Ct.cjs';
5
5
  import React from 'react';
6
6
 
7
7
  type RadioSize = "sm" | "md" | "lg";
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
3
- import { L as LegacyStatusType } from '../../status-njWqQWFV.js';
4
- import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
+ import { L as LegacyStatusType } from '../../status-C70BBv2S.js';
4
+ import { V as Validation } from '../../validation-BYpAI6Ct.js';
5
5
  import React from 'react';
6
6
 
7
7
  type RadioSize = "sm" | "md" | "lg";
@@ -50,23 +50,22 @@ var Portal_default = Portal;
50
50
  // src/tokens/hooks/useAutoPosition.ts
51
51
  var import_react = __toESM(require("react"), 1);
52
52
  var useAutoPosition = (triggerRef, popRef, enabled = true) => {
53
- const [position, setPosition] = import_react.default.useState({
54
- position: {},
55
- direction: "bottom"
56
- });
53
+ const [direction, setDirection] = import_react.default.useState("bottom");
54
+ const directionRef = import_react.default.useRef("bottom");
57
55
  const calculatePosition = import_react.default.useCallback(() => {
58
- if (!triggerRef.current || !popRef.current) return;
56
+ const pop = popRef.current;
57
+ if (!triggerRef.current || !pop) return;
59
58
  const triggerRect = triggerRef.current.getBoundingClientRect();
60
- const popW = popRef.current.offsetWidth;
61
- const popH = popRef.current.offsetHeight;
59
+ const popW = pop.offsetWidth;
60
+ const popH = pop.offsetHeight;
62
61
  const viewportHeight = window.innerHeight;
63
62
  const viewportWidth = window.innerWidth;
64
63
  if (popH === 0 || popW === 0) return;
65
- let direction = "bottom";
64
+ let next = "bottom";
66
65
  let top;
67
66
  let left;
68
67
  if (triggerRect.bottom + popH > viewportHeight && triggerRect.top - popH > 0) {
69
- direction = "top";
68
+ next = "top";
70
69
  top = triggerRect.top - popH;
71
70
  } else {
72
71
  top = triggerRect.bottom;
@@ -76,7 +75,12 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
76
75
  left = triggerRect.right - popW;
77
76
  }
78
77
  if (left < 8) left = 8;
79
- setPosition({ position: { top, left }, direction });
78
+ pop.style.top = `${top + window.scrollY}px`;
79
+ pop.style.left = `${left + window.scrollX}px`;
80
+ if (next !== directionRef.current) {
81
+ directionRef.current = next;
82
+ setDirection(next);
83
+ }
80
84
  }, [triggerRef, popRef]);
81
85
  import_react.default.useLayoutEffect(() => {
82
86
  if (!enabled) return;
@@ -107,7 +111,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
107
111
  window.removeEventListener("scroll", onScrollOrResize, true);
108
112
  };
109
113
  }, [calculatePosition, enabled]);
110
- return position;
114
+ return { direction };
111
115
  };
112
116
  var useAutoPosition_default = useAutoPosition;
113
117
 
@@ -1414,7 +1418,7 @@ var SelectRoot = (props) => {
1414
1418
  {
1415
1419
  className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
1416
1420
  ref: contentRef,
1417
- style: { ...position.position, width: triggerRef.current?.offsetWidth },
1421
+ style: { width: triggerRef.current?.offsetWidth },
1418
1422
  role: "listbox",
1419
1423
  children: [
1420
1424
  searchable && /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: "select-search", children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(