lawgic-dev-kit 0.19.2 → 0.20.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.
- package/dist/_virtual/index2.js +3 -2
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +2 -5
- package/dist/components/atoms/ClickAwayListener/ClickAwayListener.d.ts +4 -0
- package/dist/components/atoms/ClickAwayListener/ClickAwayListener.js +43 -0
- package/dist/components/atoms/ClickAwayListener/ClickAwayListener.types.d.ts +7 -0
- package/dist/components/atoms/ClickAwayListener/index.d.ts +1 -0
- package/dist/components/atoms/FilterPill/FilterPill.js +158 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/molecules/FiltersMenu/FiltersMenu.js +49 -0
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +42 -34
- package/dist/components/molecules/FloatingMenu/FloatingMenu.types.d.ts +1 -0
- package/dist/components/molecules/SideModal/SideModal.d.ts +4 -0
- package/dist/components/molecules/SideModal/SideModal.js +97 -0
- package/dist/components/molecules/SideModal/SideModal.types.d.ts +10 -0
- package/dist/components/molecules/SideModal/index.d.ts +1 -0
- package/dist/components/molecules/index.d.ts +2 -0
- package/dist/index.js +89 -81
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +53 -50
- package/dist/node_modules/@fortawesome/pro-regular-svg-icons/index.js +15 -5
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.d.ts +4 -0
- package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.types.d.ts +7 -0
- package/dist/src/components/atoms/ClickAwayListener/index.d.ts +1 -0
- package/dist/src/components/atoms/index.d.ts +42 -0
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/toposort/index.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const s = /* @__PURE__ */ o(t);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
s as default
|
|
5
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { j as f } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useRef as l, useEffect as h } from "react";
|
|
3
|
+
const p = ({
|
|
4
|
+
children: i,
|
|
5
|
+
onClickAway: r,
|
|
6
|
+
enabled: u = !0,
|
|
7
|
+
mouseEvent: o = "onClick",
|
|
8
|
+
touchEvent: c = "onTouchEnd"
|
|
9
|
+
}) => {
|
|
10
|
+
const n = l(null);
|
|
11
|
+
return h(() => {
|
|
12
|
+
if (!u) return;
|
|
13
|
+
const t = (e) => {
|
|
14
|
+
n.current && (n.current.contains(e.target) || r());
|
|
15
|
+
}, d = (e) => {
|
|
16
|
+
switch (e) {
|
|
17
|
+
case "onClick":
|
|
18
|
+
return "click";
|
|
19
|
+
case "onMouseDown":
|
|
20
|
+
return "mousedown";
|
|
21
|
+
case "onMouseUp":
|
|
22
|
+
return "mouseup";
|
|
23
|
+
default:
|
|
24
|
+
return "click";
|
|
25
|
+
}
|
|
26
|
+
}, m = (e) => {
|
|
27
|
+
switch (e) {
|
|
28
|
+
case "onTouchStart":
|
|
29
|
+
return "touchstart";
|
|
30
|
+
case "onTouchEnd":
|
|
31
|
+
return "touchend";
|
|
32
|
+
default:
|
|
33
|
+
return "touchend";
|
|
34
|
+
}
|
|
35
|
+
}, s = d(o), a = m(c);
|
|
36
|
+
return document.addEventListener(s, t, !0), document.addEventListener(a, t, !0), () => {
|
|
37
|
+
document.removeEventListener(s, t, !0), document.removeEventListener(a, t, !0);
|
|
38
|
+
};
|
|
39
|
+
}, [u, r, o, c]), /* @__PURE__ */ f.jsx("div", { ref: n, style: { display: "contents" }, children: i });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
p as default
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ClickAwayListener } from './ClickAwayListener';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { j as a } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { FontAwesomeIcon as D } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
3
|
+
import { faFilter as C, faX as I } from "../../../node_modules/@fortawesome/pro-regular-svg-icons/index.js";
|
|
4
|
+
import { useState as O } from "react";
|
|
5
|
+
import "../../../contexts/themeContext.js";
|
|
6
|
+
import "../../../_virtual/lodash.js";
|
|
7
|
+
import "react-hook-form";
|
|
8
|
+
import "../../../constants/countries.js";
|
|
9
|
+
import "../ImageProfileInput/ImageProfileInput.validators.js";
|
|
10
|
+
import $ from "../UncontrolledSelector/UncontrolledSelector.js";
|
|
11
|
+
import L from "../UncontrolledTextInput/UncontrolledTextInput.js";
|
|
12
|
+
import M from "../../molecules/FloatingMenu/FloatingMenu.js";
|
|
13
|
+
import "../../molecules/InformationContainer/InformationContainer.js";
|
|
14
|
+
import h from "../../molecules/UncontrolledDateInput/UncontrolledDateInput.js";
|
|
15
|
+
const G = ({
|
|
16
|
+
filter: e,
|
|
17
|
+
filterControl: g,
|
|
18
|
+
translations: j = {}
|
|
19
|
+
}) => {
|
|
20
|
+
var c, p, u, d, r, m, x, v, y, b;
|
|
21
|
+
const [k, l] = O(!0), { updateFilter: o, removeFilter: w } = g, S = !!(e != null && e.value), n = (t, s) => j[t] || s, N = (t, s = []) => {
|
|
22
|
+
const i = s.find((F) => F.value === t);
|
|
23
|
+
return i ? i.label : String(t);
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ a.jsx(
|
|
26
|
+
M,
|
|
27
|
+
{
|
|
28
|
+
open: k,
|
|
29
|
+
onClose: () => l(!1),
|
|
30
|
+
placement: "bottom",
|
|
31
|
+
className: "min-w-[400px]",
|
|
32
|
+
component: /* @__PURE__ */ a.jsxs("div", { children: [
|
|
33
|
+
/* @__PURE__ */ a.jsx("p", { children: n(e.key, e.label) }),
|
|
34
|
+
e.type === "date" ? /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
35
|
+
/* @__PURE__ */ a.jsx("div", { className: "scale-[0.8] origin-left -mr-[10%] w-[125%]! relative z-99", children: /* @__PURE__ */ a.jsx(
|
|
36
|
+
h,
|
|
37
|
+
{
|
|
38
|
+
currentDate: (c = e.value) != null && c.startDate ? new Date(e.value.startDate) : null,
|
|
39
|
+
maxDate: (p = e.value) != null && p.endDate ? new Date(e.value.endDate) : void 0,
|
|
40
|
+
futureDates: !0,
|
|
41
|
+
onDateChange: (t) => o({
|
|
42
|
+
key: e.key,
|
|
43
|
+
value: {
|
|
44
|
+
...e.value || {},
|
|
45
|
+
startDate: (t == null ? void 0 : t.toISOString()) || ""
|
|
46
|
+
},
|
|
47
|
+
label: e.label,
|
|
48
|
+
type: e.type
|
|
49
|
+
}),
|
|
50
|
+
label: "Fecha de inicio",
|
|
51
|
+
translatedKey: "start_date"
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ a.jsx("div", { className: "scale-[0.8] origin-left -mr-[10%] w-[125%]! ", children: /* @__PURE__ */ a.jsx(
|
|
55
|
+
h,
|
|
56
|
+
{
|
|
57
|
+
currentDate: (u = e.value) != null && u.endDate ? new Date(e.value.endDate) : null,
|
|
58
|
+
minDate: (d = e.value) != null && d.startDate ? new Date(e.value.startDate) : void 0,
|
|
59
|
+
onDateChange: (t) => o({
|
|
60
|
+
key: e.key,
|
|
61
|
+
value: {
|
|
62
|
+
...e.value || {},
|
|
63
|
+
endDate: (t == null ? void 0 : t.toISOString()) || ""
|
|
64
|
+
},
|
|
65
|
+
label: e.label,
|
|
66
|
+
type: e.type
|
|
67
|
+
}),
|
|
68
|
+
label: "Fecha de fin",
|
|
69
|
+
futureDates: !0,
|
|
70
|
+
translatedKey: "end_date"
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
] }) : e.type === "select" ? /* @__PURE__ */ a.jsx(
|
|
74
|
+
$,
|
|
75
|
+
{
|
|
76
|
+
className: "scale-[0.8] origin-left -mr-[10%] w-[125%]! p-0! m-0!",
|
|
77
|
+
value: e.value || "",
|
|
78
|
+
options: e.options || [],
|
|
79
|
+
label: "",
|
|
80
|
+
allowSearch: !0,
|
|
81
|
+
onChange: (t) => o({
|
|
82
|
+
key: e.key,
|
|
83
|
+
value: t,
|
|
84
|
+
label: e.label,
|
|
85
|
+
type: e.type
|
|
86
|
+
}),
|
|
87
|
+
placeholder: n(e.key, e.label)
|
|
88
|
+
}
|
|
89
|
+
) : /* @__PURE__ */ a.jsx(
|
|
90
|
+
L,
|
|
91
|
+
{
|
|
92
|
+
size: "sm",
|
|
93
|
+
name: e.key,
|
|
94
|
+
value: e.value,
|
|
95
|
+
onChange: (t) => o({
|
|
96
|
+
key: e.key,
|
|
97
|
+
value: t,
|
|
98
|
+
label: e.label,
|
|
99
|
+
type: e.type
|
|
100
|
+
}),
|
|
101
|
+
placeholder: n(e.key, e.label)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] }),
|
|
105
|
+
children: /* @__PURE__ */ a.jsxs(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: `flex gap-[8px] items-center px-[12px] py-[8px] bg-blue-100 max-w-[400px] ${S && "border-1! border-blue-500!"} cursor-pointer transition ease-in-out rounded-full border border-transparent hover:border-blue-500`,
|
|
109
|
+
onClick: () => l(!0),
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ a.jsxs("div", { className: "flex justify-between items-center gap-[6px] min-w-0", children: [
|
|
112
|
+
/* @__PURE__ */ a.jsx(
|
|
113
|
+
D,
|
|
114
|
+
{
|
|
115
|
+
icon: e.icon || C,
|
|
116
|
+
className: "text-[14px] text-blue-500"
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ a.jsx(
|
|
120
|
+
"p",
|
|
121
|
+
{
|
|
122
|
+
className: "flex-1 min-w-0 text-[12px] font-semibold text-gray-800 truncate overflow-hidden whitespace-nowrap",
|
|
123
|
+
title: e.type === "date" ? `${((r = e.value) == null ? void 0 : r.startDate) || "..."} - ${((m = e.value) == null ? void 0 : m.endDate) || "..."}` : String(
|
|
124
|
+
e.value || n(e.key, e.label)
|
|
125
|
+
),
|
|
126
|
+
children: e.value && (e.type === "date" ? (x = e.value) != null && x.startDate || (v = e.value) != null && v.endDate : e.value) ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
127
|
+
n(e.key, e.label),
|
|
128
|
+
":",
|
|
129
|
+
" ",
|
|
130
|
+
/* @__PURE__ */ a.jsx("span", { className: "text-gray-600 truncate overflow-hidden whitespace-nowrap", children: e.type === "date" ? `${(y = e.value) != null && y.startDate ? new Date(
|
|
131
|
+
e.value.startDate
|
|
132
|
+
).toLocaleDateString() : "..."} - ${(b = e.value) != null && b.endDate ? new Date(
|
|
133
|
+
e.value.endDate
|
|
134
|
+
).toLocaleDateString() : "..."}` : e.type === "select" ? N(
|
|
135
|
+
e.value,
|
|
136
|
+
e.options
|
|
137
|
+
) : String(e.value) })
|
|
138
|
+
] }) : n(e.key, e.label)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ a.jsx(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
className: "flex justify-center items-center",
|
|
146
|
+
onClick: () => w({ key: e.key }),
|
|
147
|
+
children: /* @__PURE__ */ a.jsx(D, { icon: I, className: "text-[10px] text-gray-400" })
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
export {
|
|
157
|
+
G as default
|
|
158
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { faBarsFilter as x } from "../../../node_modules/@fortawesome/pro-regular-svg-icons/index.js";
|
|
3
|
+
import { FontAwesomeIcon as o } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import c from "../FloatingMenu/FloatingMenu.js";
|
|
6
|
+
const g = ({ filters: r }) => {
|
|
7
|
+
const [l, s] = p(!1), a = () => s(!1), n = () => s(!0);
|
|
8
|
+
return /* @__PURE__ */ e.jsx(
|
|
9
|
+
c,
|
|
10
|
+
{
|
|
11
|
+
open: l,
|
|
12
|
+
onClose: a,
|
|
13
|
+
placement: "bottom-start",
|
|
14
|
+
className: "w-[326px] shadow-md px-0! text-base! py-12!",
|
|
15
|
+
component: /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col gap-[10px]", children: [
|
|
16
|
+
/* @__PURE__ */ e.jsx("h4", { className: "px-24 text-lg font-semibold text-blue-900", children: "Filtros" }),
|
|
17
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col", children: r.map((t, i) => /* @__PURE__ */ e.jsxs(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: "group flex gap-[8px] items-center px-[24px] py-[8px] hover:bg-blue-100 cursor-pointer transition ease-in-out",
|
|
21
|
+
onClick: t.onClick,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ e.jsx(
|
|
24
|
+
o,
|
|
25
|
+
{
|
|
26
|
+
icon: t.icon,
|
|
27
|
+
className: "text-[14px] text-gray-600 group-hover:text-blue-500"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-[12px] text-gray-500 font-semibold group-hover:text-gray-800", children: t.label })
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
i
|
|
34
|
+
)) })
|
|
35
|
+
] }),
|
|
36
|
+
children: /* @__PURE__ */ e.jsx(
|
|
37
|
+
o,
|
|
38
|
+
{
|
|
39
|
+
icon: x,
|
|
40
|
+
onClick: n,
|
|
41
|
+
className: "transition text-[16px] ease-in-out duration-150 hover:text-gray-600 cursor-pointer"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
g as default
|
|
49
|
+
};
|
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useFloating as M, useClick as N, useDismiss as O, useInteractions as S, useTransitionStyles as
|
|
3
|
-
import
|
|
2
|
+
import { useFloating as M, useClick as N, useDismiss as O, useInteractions as S, useTransitionStyles as k } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
|
|
3
|
+
import w, { useState as P, useEffect as _ } from "react";
|
|
4
4
|
import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
5
5
|
import "../../../_virtual/lodash.js";
|
|
6
6
|
import "../../../contexts/themeContext.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import "../InformationContainer/InformationContainer.js";
|
|
9
|
-
import
|
|
9
|
+
import z from "../../atoms/BoxContainer/BoxContainer.js";
|
|
10
10
|
import "../../../constants/countries.js";
|
|
11
11
|
import "../../atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
12
12
|
import "fuse.js";
|
|
13
|
-
import { autoUpdate as
|
|
14
|
-
import { offset as
|
|
15
|
-
const
|
|
13
|
+
import { autoUpdate as B } from "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
14
|
+
import { offset as D, flip as T, shift as U } from "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
15
|
+
const $ = ({
|
|
16
16
|
open: e,
|
|
17
17
|
onClose: s,
|
|
18
18
|
component: i,
|
|
19
|
-
children:
|
|
19
|
+
children: n,
|
|
20
20
|
placement: l = "bottom",
|
|
21
|
-
className:
|
|
22
|
-
strategy:
|
|
21
|
+
className: f = "",
|
|
22
|
+
strategy: m = "absolute",
|
|
23
|
+
styles: c = {},
|
|
23
24
|
offset: p = 8,
|
|
24
|
-
padding:
|
|
25
|
+
padding: d = 8
|
|
25
26
|
}) => {
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const [u, o] = P(e);
|
|
28
|
+
_(() => {
|
|
29
|
+
o(e);
|
|
29
30
|
}, [e]);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}, { x
|
|
33
|
-
strategy:
|
|
34
|
-
open:
|
|
31
|
+
const g = () => {
|
|
32
|
+
o(!1), s == null || s();
|
|
33
|
+
}, { x, y, strategy: h, refs: a, context: r } = M({
|
|
34
|
+
strategy: m,
|
|
35
|
+
open: u,
|
|
35
36
|
onOpenChange: (I) => {
|
|
36
|
-
I
|
|
37
|
+
!I && !e && g();
|
|
37
38
|
},
|
|
38
|
-
middleware: [
|
|
39
|
-
whileElementsMounted:
|
|
39
|
+
middleware: [D(p), T(), U({ padding: d })],
|
|
40
|
+
whileElementsMounted: B,
|
|
40
41
|
placement: l
|
|
41
|
-
}),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
}), j = N(r, {
|
|
43
|
+
enabled: !1
|
|
44
|
+
// Deshabilitamos el click interno ya que está controlado externamente
|
|
45
|
+
}), b = O(r, {
|
|
46
|
+
enabled: !1
|
|
47
|
+
// Deshabilitamos dismiss cuando está controlado externamente por props
|
|
48
|
+
}), { getReferenceProps: v, getFloatingProps: E } = S([
|
|
49
|
+
j,
|
|
50
|
+
b
|
|
51
|
+
]), { isMounted: F, styles: R } = k(r, {
|
|
45
52
|
duration: {
|
|
46
53
|
open: 200,
|
|
47
54
|
close: 150
|
|
@@ -55,30 +62,31 @@ const Z = ({
|
|
|
55
62
|
/* @__PURE__ */ t.jsx(
|
|
56
63
|
"div",
|
|
57
64
|
{
|
|
58
|
-
ref:
|
|
65
|
+
ref: a.setReference,
|
|
59
66
|
...v(),
|
|
60
67
|
className: "reference-element",
|
|
61
|
-
children:
|
|
68
|
+
children: n
|
|
62
69
|
}
|
|
63
70
|
),
|
|
64
71
|
F && /* @__PURE__ */ t.jsx(
|
|
65
72
|
"div",
|
|
66
73
|
{
|
|
67
|
-
ref:
|
|
74
|
+
ref: a.setFloating,
|
|
68
75
|
style: {
|
|
69
|
-
position:
|
|
70
|
-
top:
|
|
71
|
-
left:
|
|
76
|
+
position: h,
|
|
77
|
+
top: y ?? 0,
|
|
78
|
+
left: x ?? 0,
|
|
72
79
|
...R,
|
|
73
|
-
zIndex:
|
|
80
|
+
zIndex: 999,
|
|
81
|
+
...c
|
|
74
82
|
},
|
|
75
83
|
...E(),
|
|
76
84
|
className: "floating-element",
|
|
77
|
-
children: /* @__PURE__ */ t.jsx(
|
|
85
|
+
children: /* @__PURE__ */ t.jsx(z, { className: f, children: typeof i == "function" ? w.createElement(i) : i })
|
|
78
86
|
}
|
|
79
87
|
)
|
|
80
88
|
] });
|
|
81
89
|
};
|
|
82
90
|
export {
|
|
83
|
-
|
|
91
|
+
$ as default
|
|
84
92
|
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { j as i } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useEffect as x } from "react";
|
|
3
|
+
import { AnimatePresence as u } from "../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
4
|
+
import { motion as r } from "../../../node_modules/motion/dist/es/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
open: e,
|
|
7
|
+
onClose: a,
|
|
8
|
+
children: s,
|
|
9
|
+
side: n = "right",
|
|
10
|
+
className: l = "",
|
|
11
|
+
backdropClassName: d = "",
|
|
12
|
+
width: o = "650px",
|
|
13
|
+
zIndex: m = 9999
|
|
14
|
+
}) => {
|
|
15
|
+
x(() => {
|
|
16
|
+
const t = (p) => {
|
|
17
|
+
p.key === "Escape" && e && a();
|
|
18
|
+
};
|
|
19
|
+
return e && (document.addEventListener("keydown", t), document.body.style.overflow = "hidden"), () => {
|
|
20
|
+
document.removeEventListener("keydown", t), document.body.style.overflow = "unset";
|
|
21
|
+
};
|
|
22
|
+
}, [e, a]);
|
|
23
|
+
const c = {
|
|
24
|
+
initial: {
|
|
25
|
+
x: n === "right" ? "100%" : "-100%"
|
|
26
|
+
// opacity: 0,
|
|
27
|
+
},
|
|
28
|
+
animate: {
|
|
29
|
+
x: 0,
|
|
30
|
+
// opacity: 1,
|
|
31
|
+
transition: {
|
|
32
|
+
type: "spring",
|
|
33
|
+
stiffness: 300,
|
|
34
|
+
damping: 30,
|
|
35
|
+
opacity: { duration: 0.2 }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
exit: {
|
|
39
|
+
x: n === "right" ? "100%" : "-100%",
|
|
40
|
+
// opacity: 0,
|
|
41
|
+
transition: {
|
|
42
|
+
type: "spring",
|
|
43
|
+
stiffness: 300,
|
|
44
|
+
damping: 30,
|
|
45
|
+
opacity: { duration: 0.15 }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, f = {
|
|
49
|
+
initial: { opacity: 0 },
|
|
50
|
+
animate: { opacity: 1, transition: { duration: 0.2 } },
|
|
51
|
+
exit: { opacity: 0, transition: { duration: 0.15 } }
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ i.jsx(u, { children: e && /* @__PURE__ */ i.jsxs("div", { className: `fixed inset-0 z-[${m}] flex`, children: [
|
|
54
|
+
/* @__PURE__ */ i.jsx(
|
|
55
|
+
r.div,
|
|
56
|
+
{
|
|
57
|
+
variants: f,
|
|
58
|
+
initial: "initial",
|
|
59
|
+
animate: "animate",
|
|
60
|
+
exit: "exit",
|
|
61
|
+
className: `absolute inset-0 bg-black/50 backdrop-blur-[0.60px] ${d}`,
|
|
62
|
+
onClick: (t) => {
|
|
63
|
+
t.preventDefault(), t.stopPropagation(), a();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ i.jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: `relative flex w-full pointer-events-none ${n === "left" ? "justify-start" : "justify-end"}`,
|
|
71
|
+
children: /* @__PURE__ */ i.jsx(
|
|
72
|
+
r.div,
|
|
73
|
+
{
|
|
74
|
+
variants: c,
|
|
75
|
+
initial: "initial",
|
|
76
|
+
animate: "animate",
|
|
77
|
+
exit: "exit",
|
|
78
|
+
className: `
|
|
79
|
+
relative bg-white shadow-2xl h-full overflow-hidden flex flex-col pointer-events-auto
|
|
80
|
+
${l}
|
|
81
|
+
`,
|
|
82
|
+
style: {
|
|
83
|
+
width: typeof o == "number" ? `${o}px` : o
|
|
84
|
+
},
|
|
85
|
+
onClick: (t) => {
|
|
86
|
+
t.preventDefault(), t.stopPropagation();
|
|
87
|
+
},
|
|
88
|
+
children: s
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }) });
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
b as default
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SideModal } from './SideModal';
|