motile-ui 1.3.1 โ†’ 1.4.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 (42) hide show
  1. package/README.md +4 -0
  2. package/dist/components/Drawer/Drawer.js +3 -1
  3. package/dist/components/Input/Input.d.ts +6 -0
  4. package/dist/components/Input/Input.js +48 -44
  5. package/dist/components/Modal/Modal.js +53 -51
  6. package/dist/components/Popover/Popover.js +23 -19
  7. package/dist/components/Select/Select.js +61 -59
  8. package/dist/components/Sheet/Sheet.js +3 -1
  9. package/dist/components/SpeedDial/SpeedDial.js +38 -36
  10. package/dist/components/Textarea/Textarea.d.ts +6 -0
  11. package/dist/components/Textarea/Textarea.js +44 -40
  12. package/dist/hooks/index.d.ts +2 -0
  13. package/dist/hooks/index.js +10 -8
  14. package/dist/hooks/useAutoBlur.d.ts +45 -0
  15. package/dist/hooks/useAutoBlur.js +32 -0
  16. package/dist/hooks/useEscapeKey.d.ts +15 -1
  17. package/dist/hooks/useEscapeKey.js +27 -12
  18. package/dist/hooks/useHistoryClose.js +89 -48
  19. package/dist/hooks/useScrollLock.js +42 -24
  20. package/package.json +1 -1
  21. package/dist/components/Accordion/Accordion.test.d.ts +0 -1
  22. package/dist/components/Badge/Badge.test.d.ts +0 -1
  23. package/dist/components/Button/Button.test.d.ts +0 -1
  24. package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
  25. package/dist/components/Dock/Dock.test.d.ts +0 -1
  26. package/dist/components/Drawer/Drawer.test.d.ts +0 -1
  27. package/dist/components/Input/Input.test.d.ts +0 -1
  28. package/dist/components/Modal/Modal.test.d.ts +0 -1
  29. package/dist/components/NumberFlow/NumberFlow.test.d.ts +0 -1
  30. package/dist/components/Popover/Popover.test.d.ts +0 -1
  31. package/dist/components/Select/Select.test.d.ts +0 -1
  32. package/dist/components/Sheet/Sheet.test.d.ts +0 -1
  33. package/dist/components/Skeleton/Skeleton.test.d.ts +0 -1
  34. package/dist/components/SpeedDial/SpeedDial.test.d.ts +0 -1
  35. package/dist/components/Switch/Switch.test.d.ts +0 -1
  36. package/dist/components/Tab/Tab.test.d.ts +0 -1
  37. package/dist/components/Textarea/Textarea.test.d.ts +0 -1
  38. package/dist/components/TimePicker/TimePicker.test.d.ts +0 -1
  39. package/dist/components/Toast/Toast.test.d.ts +0 -1
  40. package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
  41. package/dist/test/setup.d.ts +0 -1
  42. package/dist/test/utils.d.ts +0 -22
package/README.md CHANGED
@@ -43,6 +43,8 @@
43
43
  - ๐Ÿ“ฑ **๋ชจ๋ฐ”์ผ ์ตœ์ ํ™”** - ํ„ฐ์น˜ ์นœํ™”์  ์ธํ„ฐ๋ž™์…˜๊ณผ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ
44
44
  - โ™ฟ **์ ‘๊ทผ์„ฑ** - WCAG 2.1 AA ์ค€์ˆ˜ ์ปดํฌ๋„ŒํŠธ
45
45
  - ๐ŸŽฏ **ํŠธ๋ฆฌ์‰์ดํ‚น ์ง€์›** - ํ•„์š”ํ•œ ๊ฒƒ๋งŒ import
46
+ - ๐Ÿง… **์ค‘์ฒฉ ์˜ค๋ฒ„๋ ˆ์ด ์•ˆ์ „** - Sheet ์œ„ Sheet์ฒ˜๋Ÿผ ์˜ค๋ฒ„๋ ˆ์ด๊ฐ€ ๊ฒน์ณ๋„ ๋’ค๋กœ๊ฐ€๊ธฐยทESCยท์Šคํฌ๋กค ์ž ๊ธˆ์ด ํ•œ ๊ฒน์”ฉ ์ •ํ™•ํžˆ ๋™์ž‘
47
+ - โŒจ๏ธ **์Šคํฌ๋กค ์‹œ ํ‚ค๋ณด๋“œ ๋‹ซ๊ธฐ** - ๋ชจ๋ฐ”์ผ์—์„œ ์ž…๋ ฅ์— ํฌ์ปค์Šคํ•œ ์ฑ„ ์Šคํฌ๋กคํ•˜๋ฉด ์†Œํ”„ํŠธ ํ‚ค๋ณด๋“œ๋ฅผ ์ž๋™์œผ๋กœ ๋‹ซ์Œ (useAutoBlur ํ›… ยท autoBlur prop)
46
48
  - ๐Ÿ“– **ํ’๋ถ€ํ•œ ๋ฌธ์„œ** - Storybook์„ ํ†ตํ•œ ๋ผ์ด๋ธŒ ์˜ˆ์ œ ์ œ๊ณต
47
49
 
48
50
  ---
@@ -234,6 +236,8 @@ MIT ยฉ [Innopers](https://github.com/Innopers)
234
236
  - ๐Ÿ“ฑ **Mobile Optimized** - Touch-friendly interactions and responsive design
235
237
  - โ™ฟ **Accessible** - WCAG 2.1 AA compliant components
236
238
  - ๐ŸŽฏ **Tree-shakeable** - Import only what you need
239
+ - ๐Ÿง… **Nesting-Safe Overlays** - Back navigation, ESC, and scroll lock peel one layer at a time when overlays stack (e.g. Sheet over Sheet)
240
+ - โŒจ๏ธ **Dismiss Keyboard on Scroll** - On mobile, scrolling with an input focused auto-dismisses the soft keyboard (useAutoBlur hook ยท autoBlur prop)
237
241
  - ๐Ÿ“– **Well Documented** - Comprehensive docs with live examples via Storybook
238
242
 
239
243
  ---
@@ -60,7 +60,9 @@ const $ = G(null), f = () => {
60
60
  enabled: D && S.clickOutside
61
61
  }), Z({
62
62
  handler: p,
63
- enabled: D && S.escapeKey
63
+ enabled: D && S.escapeKey,
64
+ stacked: !0
65
+ // ์ค‘์ฒฉ ์˜ค๋ฒ„๋ ˆ์ด์—์„œ ESC๋Š” ์ตœ์ƒ๋‹จ๋งŒ ๋‹ซ๋Š”๋‹ค
64
66
  });
65
67
  const j = {
66
68
  open: x,
@@ -56,6 +56,12 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
56
56
  * Floating label (focus ์ „์—๋Š” placeholder ์œ„์น˜, focus/๊ฐ’ ์žˆ์„ ๋•Œ ์œ„๋กœ ์ด๋™)
57
57
  */
58
58
  label?: string;
59
+ /**
60
+ * ๋ชจ๋ฐ”์ผ์—์„œ ์ด ์ž…๋ ฅ์— ํฌ์ปค์Šค๋œ ์ฑ„ ์Šคํฌ๋กคํ•˜๋ฉด ํฌ์ปค์Šค๋ฅผ ํ•ด์ œํ•ด ์†Œํ”„ํŠธ ํ‚ค๋ณด๋“œ๋ฅผ
61
+ * ๋‹ซ์Šต๋‹ˆ๋‹ค (useAutoBlur ๋‚ด์žฅ). ๋ฐ์Šคํฌํ†ฑ(๋น„ํ„ฐ์น˜)์—๋Š” ์˜ํ–ฅ์ด ์—†์Šต๋‹ˆ๋‹ค.
62
+ * @default false
63
+ */
64
+ autoBlur?: boolean;
59
65
  }
60
66
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
61
67
  export {};
@@ -1,78 +1,82 @@
1
1
  import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as D, useId as F, useRef as G, useEffect as H } from "react";
2
+ import { forwardRef as H, useId as J, useRef as v, useEffect as K } from "react";
3
+ import { useAutoBlur as O } from "../../hooks/useAutoBlur.js";
3
4
  import './Input.css';/* empty css */
4
- const J = D(
5
+ const P = H(
5
6
  ({
6
- id: N,
7
+ id: y,
7
8
  autoFocus: $ = !1,
8
- autoSelect: _ = !1,
9
- variant: v = "outlined",
10
- isError: y,
9
+ autoSelect: f = !1,
10
+ variant: B = "outlined",
11
+ isError: C,
11
12
  errorMessage: r,
12
13
  onClear: m,
13
14
  leftIcon: d,
14
15
  rightIcon: p,
15
- className: C,
16
- value: o,
17
- color: f,
18
- style: B,
19
- maxLength: h,
16
+ className: R,
17
+ value: l,
18
+ color: _,
19
+ style: j,
20
+ maxLength: u,
20
21
  label: i,
22
+ autoBlur: x = !1,
21
23
  placeholder: b,
22
24
  ...w
23
- }, j) => {
24
- const x = F().replace(/:/g, ""), n = N ?? `motile-input-${x}`, R = G(null), l = j || R, s = y ?? !!r;
25
- H(() => {
26
- if ($ && l.current) {
27
- const A = setTimeout(() => {
28
- l.current && (l.current.focus(), _ && l.current.select());
25
+ }, L) => {
26
+ const k = J().replace(/:/g, ""), n = y ?? `motile-input-${k}`, E = v(null), o = L || E, N = v(null);
27
+ O({ containerRef: N, enabled: x });
28
+ const s = C ?? !!r;
29
+ K(() => {
30
+ if ($ && o.current) {
31
+ const G = setTimeout(() => {
32
+ o.current && (o.current.focus(), f && o.current.select());
29
33
  }, 50);
30
- return () => clearTimeout(A);
34
+ return () => clearTimeout(G);
31
35
  }
32
- }, [$, _]);
33
- const e = "motile-input", u = m && o, L = !!d, k = u || p, E = [
36
+ }, [$, f]);
37
+ const e = "motile-input", h = m && l, S = !!d, T = h || p, z = [
34
38
  e,
35
- `${e}--${v}`,
39
+ `${e}--${B}`,
36
40
  s && `${e}--error`,
37
- L && `${e}--with-left-icon`,
38
- k && `${e}--with-right-content`,
41
+ S && `${e}--with-left-icon`,
42
+ T && `${e}--with-right-content`,
39
43
  i && `${e}--with-label`,
40
- C
41
- ].filter(Boolean).join(" "), S = [
44
+ R
45
+ ].filter(Boolean).join(" "), A = [
42
46
  `${e}-wrapper`,
43
47
  i && `${e}-wrapper--with-label`,
44
48
  s && `${e}-wrapper--shake`
45
- ].filter(Boolean).join(" "), T = [
49
+ ].filter(Boolean).join(" "), I = [
46
50
  `${e}__label`,
47
51
  s && `${e}__label--error`
48
- ].filter(Boolean).join(" "), z = f ? { "--motile-input-color": f } : void 0, I = {
49
- ...B
50
- }, g = o ? String(o).length : 0, c = h !== void 0, q = [
52
+ ].filter(Boolean).join(" "), g = _ ? { "--motile-input-color": _ } : void 0, q = {
53
+ ...j
54
+ }, D = l ? String(l).length : 0, c = u !== void 0, F = [
51
55
  w["aria-describedby"],
52
56
  r ? `${n}-error` : void 0,
53
57
  c ? `${n}-counter` : void 0
54
58
  ].filter(Boolean).join(" ") || void 0;
55
- return /* @__PURE__ */ a("div", { className: `${e}-root`, children: [
56
- /* @__PURE__ */ a("div", { className: S, style: z, children: [
57
- i && /* @__PURE__ */ t("label", { className: T, htmlFor: n, children: i }),
59
+ return /* @__PURE__ */ a("div", { className: `${e}-root`, ref: N, children: [
60
+ /* @__PURE__ */ a("div", { className: A, style: g, children: [
61
+ i && /* @__PURE__ */ t("label", { className: I, htmlFor: n, children: i }),
58
62
  d && /* @__PURE__ */ t("div", { className: `${e}__left-icon`, children: d }),
59
63
  /* @__PURE__ */ t(
60
64
  "input",
61
65
  {
62
66
  id: n,
63
67
  ...w,
64
- "aria-describedby": q,
68
+ "aria-describedby": F,
65
69
  "aria-invalid": s || void 0,
66
- ref: l,
67
- className: E,
68
- value: o,
69
- maxLength: h,
70
- style: I,
70
+ ref: o,
71
+ className: z,
72
+ value: l,
73
+ maxLength: u,
74
+ style: q,
71
75
  placeholder: i ? b || " " : b
72
76
  }
73
77
  ),
74
- p && !u && /* @__PURE__ */ t("div", { className: `${e}__right-icon`, children: p }),
75
- u && /* @__PURE__ */ t(
78
+ p && !h && /* @__PURE__ */ t("div", { className: `${e}__right-icon`, children: p }),
79
+ h && /* @__PURE__ */ t(
76
80
  "button",
77
81
  {
78
82
  type: "button",
@@ -106,9 +110,9 @@ const J = D(
106
110
  }
107
111
  ),
108
112
  c && /* @__PURE__ */ a("span", { id: `${n}-counter`, className: `${e}__counter`, children: [
109
- g,
113
+ D,
110
114
  "/",
111
- h
115
+ u
112
116
  ] })
113
117
  ]
114
118
  }
@@ -116,7 +120,7 @@ const J = D(
116
120
  ] });
117
121
  }
118
122
  );
119
- J.displayName = "Input";
123
+ P.displayName = "Input";
120
124
  export {
121
- J as Input
125
+ P as Input
122
126
  };
@@ -1,13 +1,13 @@
1
- import { jsx as l, jsxs as L } from "react/jsx-runtime";
2
- import n, { useRef as k, useState as O, useEffect as P, useId as h, createContext as V, useContext as q } from "react";
1
+ import { jsx as l, jsxs as K } from "react/jsx-runtime";
2
+ import n, { useRef as L, useState as O, useEffect as P, useId as v, createContext as V, useContext as q } from "react";
3
3
  import { createPortal as z } from "react-dom";
4
4
  import { useClickOutside as A } from "../../hooks/useClickOutside.js";
5
5
  import { useEscapeKey as D } from "../../hooks/useEscapeKey.js";
6
6
  import { useScrollLock as G } from "../../hooks/useScrollLock.js";
7
7
  import { Slot as J } from "../../utils/Slot.js";
8
8
  import './Modal.css';/* empty css */
9
- const v = V(null), m = () => {
10
- const o = q(v);
9
+ const _ = V(null), m = () => {
10
+ const o = q(_);
11
11
  if (!o)
12
12
  throw new Error("Modal compound components must be used within Modal.Root");
13
13
  return o;
@@ -16,7 +16,7 @@ const v = V(null), m = () => {
16
16
  onOpenChange: t,
17
17
  children: e
18
18
  }) => {
19
- const a = h(), d = h(), r = n.useMemo(
19
+ const a = v(), d = v(), r = n.useMemo(
20
20
  () => ({
21
21
  open: o,
22
22
  onOpenChange: t,
@@ -25,8 +25,8 @@ const v = V(null), m = () => {
25
25
  }),
26
26
  [o, t, a, d]
27
27
  );
28
- return /* @__PURE__ */ l(v.Provider, { value: r, children: e });
29
- }, _ = n.forwardRef(
28
+ return /* @__PURE__ */ l(_.Provider, { value: r, children: e });
29
+ }, N = n.forwardRef(
30
30
  ({
31
31
  container: o,
32
32
  variant: t = "scale",
@@ -37,14 +37,14 @@ const v = V(null), m = () => {
37
37
  zIndex: s = 1e3,
38
38
  className: u,
39
39
  onClick: i,
40
- style: $,
40
+ style: g,
41
41
  ...p
42
- }, g) => {
43
- const { open: c, onOpenChange: f } = m(), M = k(null), [S, E] = O(!1);
42
+ }, S) => {
43
+ const { open: c, onOpenChange: f } = m(), M = L(null), [E, T] = O(!1);
44
44
  P(() => {
45
- E(!0);
45
+ T(!0);
46
46
  }, []);
47
- const b = typeof e == "boolean" ? e : e.clickOutside ?? !1, T = typeof e == "boolean" ? e : e.escapeKey ?? !1;
47
+ const b = typeof e == "boolean" ? e : e.clickOutside ?? !1, h = typeof e == "boolean" ? e : e.escapeKey ?? !1;
48
48
  G({
49
49
  enabled: c && !a,
50
50
  allowedSelectors: [".motile-modal__content"]
@@ -56,30 +56,32 @@ const v = V(null), m = () => {
56
56
  enabled: c
57
57
  }), D({
58
58
  handler: () => {
59
- T && f(!1);
59
+ h && f(!1);
60
60
  },
61
- enabled: c
61
+ enabled: c && h,
62
+ stacked: !0
63
+ // ์ค‘์ฒฉ ์˜ค๋ฒ„๋ ˆ์ด์—์„œ ESC๋Š” ์ตœ์ƒ๋‹จ๋งŒ ๋‹ซ๋Š”๋‹ค
62
64
  });
63
65
  const j = (y) => {
64
66
  i == null || i(y), y.target === y.currentTarget && b && f(!1);
65
67
  };
66
- if (!S || !c) return null;
67
- const F = {
68
+ if (!E || !c) return null;
69
+ const k = {
68
70
  zIndex: s,
69
- ...$
70
- }, H = {
71
+ ...g
72
+ }, F = {
71
73
  ...d && { "--modal-width": d },
72
74
  ...r && { "--modal-max-width": r },
73
75
  zIndex: s + 1
74
- }, K = /* @__PURE__ */ l(
76
+ }, H = /* @__PURE__ */ l(
75
77
  "div",
76
78
  {
77
- ref: g,
79
+ ref: S,
78
80
  className: `motile-modal__backdrop ${u || ""}`,
79
81
  "data-state": c ? "open" : "closed",
80
82
  "data-variant": t,
81
83
  onClick: j,
82
- style: F,
84
+ style: k,
83
85
  ...p,
84
86
  children: /* @__PURE__ */ l(
85
87
  "div",
@@ -87,17 +89,17 @@ const v = V(null), m = () => {
87
89
  ref: M,
88
90
  className: "motile-modal",
89
91
  "data-variant": t,
90
- style: H,
92
+ style: F,
91
93
  children: p.children
92
94
  }
93
95
  )
94
96
  }
95
97
  );
96
- return z(K, o || document.body);
98
+ return z(H, o || document.body);
97
99
  }
98
100
  );
99
- _.displayName = "Modal.Overlay";
100
- const N = n.forwardRef(
101
+ N.displayName = "Modal.Overlay";
102
+ const w = n.forwardRef(
101
103
  ({ className: o, forceMount: t, ...e }, a) => {
102
104
  const { open: d, titleId: r, descriptionId: s } = m();
103
105
  return !d && !t ? null : /* @__PURE__ */ l(
@@ -115,8 +117,8 @@ const N = n.forwardRef(
115
117
  );
116
118
  }
117
119
  );
118
- N.displayName = "Modal.Content";
119
- const w = n.forwardRef(
120
+ w.displayName = "Modal.Content";
121
+ const x = n.forwardRef(
120
122
  ({ className: o, ...t }, e) => {
121
123
  const { titleId: a } = m();
122
124
  return /* @__PURE__ */ l(
@@ -130,8 +132,8 @@ const w = n.forwardRef(
130
132
  );
131
133
  }
132
134
  );
133
- w.displayName = "Modal.Title";
134
- const x = n.forwardRef(
135
+ x.displayName = "Modal.Title";
136
+ const R = n.forwardRef(
135
137
  ({ className: o, ...t }, e) => {
136
138
  const { descriptionId: a } = m();
137
139
  return /* @__PURE__ */ l(
@@ -145,8 +147,8 @@ const x = n.forwardRef(
145
147
  );
146
148
  }
147
149
  );
148
- x.displayName = "Modal.Body";
149
- const R = n.forwardRef(
150
+ R.displayName = "Modal.Body";
151
+ const C = n.forwardRef(
150
152
  ({ asChild: o, className: t, onClick: e, children: a, ...d }, r) => {
151
153
  const { onOpenChange: s } = m(), u = (i) => {
152
154
  e == null || e(i), s(!1);
@@ -168,7 +170,7 @@ const R = n.forwardRef(
168
170
  onClick: u,
169
171
  "aria-label": "๋‹ซ๊ธฐ",
170
172
  ...d,
171
- children: a || /* @__PURE__ */ L(
173
+ children: a || /* @__PURE__ */ K(
172
174
  "svg",
173
175
  {
174
176
  width: "18",
@@ -189,8 +191,8 @@ const R = n.forwardRef(
189
191
  );
190
192
  }
191
193
  );
192
- R.displayName = "Modal.Close";
193
- const C = n.forwardRef(
194
+ C.displayName = "Modal.Close";
195
+ const I = n.forwardRef(
194
196
  ({ className: o, ...t }, e) => /* @__PURE__ */ l(
195
197
  "div",
196
198
  {
@@ -200,8 +202,8 @@ const C = n.forwardRef(
200
202
  }
201
203
  )
202
204
  );
203
- C.displayName = "Modal.Footer";
204
- const I = n.forwardRef(
205
+ I.displayName = "Modal.Footer";
206
+ const $ = n.forwardRef(
205
207
  ({ className: o, ...t }, e) => /* @__PURE__ */ l(
206
208
  "div",
207
209
  {
@@ -211,25 +213,25 @@ const I = n.forwardRef(
211
213
  }
212
214
  )
213
215
  );
214
- I.displayName = "Modal.Header";
216
+ $.displayName = "Modal.Header";
215
217
  const te = {
216
218
  Root: Q,
217
- Overlay: _,
218
- Content: N,
219
- Title: w,
220
- Body: x,
221
- Close: R,
222
- Footer: C,
223
- Header: I
219
+ Overlay: N,
220
+ Content: w,
221
+ Title: x,
222
+ Body: R,
223
+ Close: C,
224
+ Footer: I,
225
+ Header: $
224
226
  };
225
227
  export {
226
228
  te as Modal,
227
- x as ModalBody,
228
- R as ModalClose,
229
- N as ModalContent,
230
- C as ModalFooter,
231
- I as ModalHeader,
232
- _ as ModalOverlay,
229
+ R as ModalBody,
230
+ C as ModalClose,
231
+ w as ModalContent,
232
+ I as ModalFooter,
233
+ $ as ModalHeader,
234
+ N as ModalOverlay,
233
235
  Q as ModalRoot,
234
- w as ModalTitle
236
+ x as ModalTitle
235
237
  };
@@ -1,5 +1,5 @@
1
- import { jsxs as $, jsx as g } from "react/jsx-runtime";
2
- import k, { useCallback as b, useId as N, useRef as I, useMemo as j, createContext as E, useContext as T } from "react";
1
+ import { jsxs as y, jsx as g } from "react/jsx-runtime";
2
+ import $, { useCallback as b, useId as N, useRef as I, useMemo as j, createContext as E, useContext as T } from "react";
3
3
  import { useClickOutside as h } from "../../hooks/useClickOutside.js";
4
4
  import { useEscapeKey as A } from "../../hooks/useEscapeKey.js";
5
5
  import { FloatingArrow as B } from "../../utils/FloatingArrow.js";
@@ -17,7 +17,7 @@ function K({
17
17
  defaultValue: p = !1,
18
18
  onChange: o
19
19
  }) {
20
- const e = t !== void 0, [r, s] = k.useState(p), l = e ? t : r, c = b(
20
+ const e = t !== void 0, [r, s] = $.useState(p), l = e ? t : r, c = b(
21
21
  (a) => {
22
22
  const d = typeof a == "function" ? a(l) : a;
23
23
  e || s(d), o == null || o(d);
@@ -38,15 +38,15 @@ function M({
38
38
  open: a,
39
39
  defaultOpen: d = !1,
40
40
  onOpenChange: m,
41
- onClickOutside: f,
41
+ onClickOutside: u,
42
42
  onDismiss: v,
43
- autoClose: u = !0
43
+ autoClose: f = !0
44
44
  }) {
45
45
  const n = N().replace(/:/g, ""), x = I(null), w = I(null), P = I(null), [R, i] = K({
46
46
  value: a,
47
47
  defaultValue: d,
48
48
  onChange: m
49
- }), y = j(
49
+ }), k = j(
50
50
  () => ({
51
51
  open: R,
52
52
  setOpen: i,
@@ -56,10 +56,10 @@ function M({
56
56
  showArrow: r,
57
57
  zIndex: s,
58
58
  color: l,
59
- autoClose: u,
59
+ autoClose: f,
60
60
  bounceCount: c,
61
61
  onOpenChange: m,
62
- onClickOutside: f,
62
+ onClickOutside: u,
63
63
  onDismiss: v,
64
64
  triggerId: `${n}-trigger`,
65
65
  contentId: `${n}-content`,
@@ -76,15 +76,15 @@ function M({
76
76
  r,
77
77
  s,
78
78
  l,
79
- u,
79
+ f,
80
80
  c,
81
81
  m,
82
- f,
82
+ u,
83
83
  v,
84
84
  n
85
85
  ]
86
86
  );
87
- return /* @__PURE__ */ g(S.Provider, { value: y, children: /* @__PURE__ */ g("div", { ref: P, className: "motile-popover-wrapper", children: t }) });
87
+ return /* @__PURE__ */ g(S.Provider, { value: k, children: /* @__PURE__ */ g("div", { ref: P, className: "motile-popover-wrapper", children: t }) });
88
88
  }
89
89
  function V({ children: t, asChild: p = !1 }) {
90
90
  const { open: o, setOpen: e, triggerId: r, contentId: s, triggerRef: l } = C(), c = b(() => {
@@ -129,9 +129,9 @@ function q({
129
129
  showArrow: a,
130
130
  zIndex: d,
131
131
  color: m,
132
- autoClose: f,
132
+ autoClose: u,
133
133
  bounceCount: v,
134
- onClickOutside: u,
134
+ onClickOutside: f,
135
135
  onDismiss: n,
136
136
  contentId: x,
137
137
  contentRef: w,
@@ -140,23 +140,27 @@ function q({
140
140
  if (A({
141
141
  handler: b(
142
142
  (i) => {
143
- f && (n == null || n(i), i.defaultPrevented || r(!1));
143
+ u && (n == null || n(i), i.defaultPrevented || r(!1));
144
144
  },
145
- [f, n, r]
145
+ [u, n, r]
146
146
  ),
147
- enabled: e
147
+ // enabled๋ฅผ ์ •์งํ•˜๊ฒŒ ๊ณ„์‚ฐ โ€” ๋‹ซํžˆ์ง€ ์•Š์„(autoClose=false) ํŒ์˜ค๋ฒ„๊ฐ€
148
+ // ESC ์Šคํƒ์˜ top์„ ์ ์œ ํ•ด ์•„๋ž˜ ์˜ค๋ฒ„๋ ˆ์ด์˜ ESC๋ฅผ ์‚ผํ‚ค์ง€ ์•Š๊ฒŒ
149
+ enabled: e && u,
150
+ stacked: !0
151
+ // ์ค‘์ฒฉ ์˜ค๋ฒ„๋ ˆ์ด์—์„œ ESC๋Š” ์ตœ์ƒ๋‹จ๋งŒ ๋‹ซ๋Š”๋‹ค
148
152
  }), h({
149
153
  refs: [P],
150
154
  handler: b(
151
155
  (i) => {
152
- f && (u == null || u(i), n == null || n(i), i.defaultPrevented || r(!1));
156
+ u && (f == null || f(i), n == null || n(i), i.defaultPrevented || r(!1));
153
157
  },
154
- [f, u, n, r]
158
+ [u, f, n, r]
155
159
  ),
156
160
  enabled: e
157
161
  }), !e) return null;
158
162
  const R = v !== 0;
159
- return /* @__PURE__ */ $(
163
+ return /* @__PURE__ */ y(
160
164
  "div",
161
165
  {
162
166
  ref: w,