@situaction/traq-ui-ste 1.2.28 → 1.2.29

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.
@@ -27,5 +27,7 @@ export interface ModalProps {
27
27
  anchorRef?: RefObject<HTMLElement>;
28
28
  /** If true, show a background overlay behind the panel */
29
29
  overlayBackground?: boolean;
30
+ /** Base z-index for the modal stack */
31
+ zIndex?: number;
30
32
  }
31
33
  export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,65 +1,76 @@
1
- import { jsxs as x, Fragment as B, jsx as m } from "react/jsx-runtime";
1
+ import { jsxs as D, Fragment as P, jsx as v } from "react/jsx-runtime";
2
2
  import { forwardRef as h, useRef as j, useState as C, useEffect as E, useLayoutEffect as N } from "react";
3
- import '../../styles/Modal.css';const F = "_overlay_1hu8i_1", L = "_overlayBackground_1hu8i_11", M = "_modalContent_1hu8i_15", S = "_centered_1hu8i_22", c = {
4
- overlay: F,
5
- overlayBackground: L,
6
- modalContent: M,
7
- centered: S
8
- }, q = h(
3
+ import '../../styles/Modal.css';const Z = "_overlay_1hu8i_1", z = "_overlayBackground_1hu8i_11", F = "_modalContent_1hu8i_15", I = "_centered_1hu8i_22", f = {
4
+ overlay: Z,
5
+ overlayBackground: z,
6
+ modalContent: F,
7
+ centered: I
8
+ }, S = h(
9
9
  ({
10
10
  open: t,
11
11
  onClose: d,
12
- children: v,
13
- position: l,
14
- centered: r = !1,
12
+ children: y,
13
+ position: e,
14
+ centered: a = !1,
15
15
  className: _,
16
- disableOverlay: g = !1,
16
+ disableOverlay: m = !1,
17
17
  autoCloseCondition: u,
18
- anchorRef: f,
19
- overlayBackground: y = !1
20
- }, w) => {
21
- const $ = j(null), k = w || $, [e, b] = C();
22
- return E(() => {
18
+ anchorRef: c,
19
+ overlayBackground: w = !1,
20
+ zIndex: g = 11
21
+ }, $) => {
22
+ const k = j(null), x = $ || k, [r, B] = C();
23
+ if (E(() => {
23
24
  !u && u !== void 0 && t && d();
24
25
  }, [u, t, d]), N(() => {
25
- if (f != null && f.current && t && !l && !r) {
26
- const a = f.current.getBoundingClientRect();
27
- b({
28
- top: `${a.bottom + window.scrollY}px`,
29
- left: `${a.left + window.scrollX}px`
26
+ if (c != null && c.current && t && !e && !a) {
27
+ const l = c.current.getBoundingClientRect();
28
+ B({
29
+ top: `${l.bottom + window.scrollY}px`,
30
+ left: `${l.left + window.scrollX}px`
30
31
  });
31
32
  }
32
- }, [f, t, l, r]), t ? /* @__PURE__ */ x(B, { children: [
33
- !g && /* @__PURE__ */ m(
33
+ }, [c, t, e, a]), !t) return null;
34
+ const b = g, n = g + 1;
35
+ return /* @__PURE__ */ D(P, { children: [
36
+ !m && /* @__PURE__ */ v(
34
37
  "div",
35
38
  {
36
- className: `${c.overlay} ${y ? c.overlayBackground : ""}`,
37
- onClick: (a) => {
38
- a.stopPropagation(), d();
39
+ className: `${f.overlay} ${w ? f.overlayBackground : ""}`,
40
+ style: { zIndex: b },
41
+ onPointerDown: (l) => {
42
+ l.preventDefault(), l.stopPropagation(), d();
43
+ },
44
+ onClick: (l) => {
45
+ l.preventDefault(), l.stopPropagation();
39
46
  }
40
47
  }
41
48
  ),
42
- /* @__PURE__ */ m(
49
+ /* @__PURE__ */ v(
43
50
  "div",
44
51
  {
45
- ref: k,
46
- className: `${c.modalContent} ${_ || ""} ${r ? c.centered : ""}`,
52
+ ref: x,
53
+ className: `${f.modalContent} ${_ || ""} ${a ? f.centered : ""}`,
47
54
  style: {
55
+ zIndex: n,
48
56
  position: "absolute",
49
- top: r ? "50%" : (l == null ? void 0 : l.top) ?? (e == null ? void 0 : e.top),
50
- left: r ? "50%" : (l == null ? void 0 : l.left) ?? (e == null ? void 0 : e.left),
51
- right: l == null ? void 0 : l.right,
52
- bottom: l == null ? void 0 : l.bottom,
53
- width: l == null ? void 0 : l.width,
54
- transform: r || !(l != null && l.top) && !(l != null && l.left) && !e ? "translate(-50%, -50%)" : void 0
57
+ top: a ? "50%" : (e == null ? void 0 : e.top) ?? (r == null ? void 0 : r.top),
58
+ left: a ? "50%" : (e == null ? void 0 : e.left) ?? (r == null ? void 0 : r.left),
59
+ right: e == null ? void 0 : e.right,
60
+ bottom: e == null ? void 0 : e.bottom,
61
+ width: e == null ? void 0 : e.width,
62
+ transform: a || !(e != null && e.top) && !(e != null && e.left) && !r ? "translate(-50%, -50%)" : void 0
55
63
  },
56
- onClick: (a) => a.stopPropagation(),
57
- children: v
64
+ role: "dialog",
65
+ "aria-modal": !m,
66
+ onPointerDown: (l) => l.stopPropagation(),
67
+ onClick: (l) => l.stopPropagation(),
68
+ children: y
58
69
  }
59
70
  )
60
- ] }) : null;
71
+ ] });
61
72
  }
62
73
  );
63
74
  export {
64
- q as Modal
75
+ S as Modal
65
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",