@ohseungik/maru-ui 0.1.0 → 0.1.1
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/README.md +2 -2
- package/dist/components/Popover/Popover.d.ts +48 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +20 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +21 -0
- package/dist/components/Table/TableParts.d.ts +30 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/Tooltip/index.d.ts +1 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +653 -427
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{components/Tooltip → utils}/position.d.ts +5 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,187 +1,187 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
2
|
+
import { jsxs as L, jsx as l, Fragment as j } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as E, useRef as S, useCallback as Q, useEffect as P, useId as O, createContext as re, useContext as se, useState as U, Children as ae, isValidElement as le, cloneElement as ie, useLayoutEffect as ce, useMemo as ye } from "react";
|
|
4
|
+
function T(...s) {
|
|
5
|
+
return s.filter(Boolean).join(" ");
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
root:
|
|
9
|
-
spinner:
|
|
10
|
-
},
|
|
7
|
+
const we = "maru-Button-module__root__Q2R8-", Te = "maru-Button-module__spinner__ZExvW", G = {
|
|
8
|
+
root: we,
|
|
9
|
+
spinner: Te
|
|
10
|
+
}, Lt = E(function({
|
|
11
11
|
variant: e = "primary",
|
|
12
|
-
size:
|
|
12
|
+
size: t = "md",
|
|
13
13
|
loading: n = !1,
|
|
14
|
-
type:
|
|
15
|
-
disabled:
|
|
16
|
-
className:
|
|
17
|
-
children:
|
|
18
|
-
...
|
|
14
|
+
type: o = "button",
|
|
15
|
+
disabled: a = !1,
|
|
16
|
+
className: u,
|
|
17
|
+
children: i,
|
|
18
|
+
...c
|
|
19
19
|
}, d) {
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ L(
|
|
21
21
|
"button",
|
|
22
22
|
{
|
|
23
|
-
...
|
|
23
|
+
...c,
|
|
24
24
|
ref: d,
|
|
25
|
-
type:
|
|
26
|
-
className:
|
|
25
|
+
type: o,
|
|
26
|
+
className: T(G.root, u),
|
|
27
27
|
"data-variant": e,
|
|
28
|
-
"data-size":
|
|
28
|
+
"data-size": t,
|
|
29
29
|
"data-loading": n ? "" : void 0,
|
|
30
|
-
disabled:
|
|
30
|
+
disabled: a || n,
|
|
31
31
|
"aria-busy": n ? !0 : void 0,
|
|
32
32
|
children: [
|
|
33
|
-
n ? /* @__PURE__ */ l("span", { className:
|
|
34
|
-
|
|
33
|
+
n ? /* @__PURE__ */ l("span", { className: G.spinner, "aria-hidden": "true" }) : null,
|
|
34
|
+
i
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
39
|
-
root:
|
|
40
|
-
control:
|
|
41
|
-
input:
|
|
42
|
-
box:
|
|
43
|
-
},
|
|
44
|
-
const d =
|
|
45
|
-
(
|
|
46
|
-
d.current =
|
|
38
|
+
}), xe = "maru-Checkbox-module__root__mY3qk", Ee = "maru-Checkbox-module__control__PxoNk", ke = "maru-Checkbox-module__input__2kt-h", Ne = "maru-Checkbox-module__box__OCPee", A = {
|
|
39
|
+
root: xe,
|
|
40
|
+
control: Ee,
|
|
41
|
+
input: ke,
|
|
42
|
+
box: Ne
|
|
43
|
+
}, Ct = E(function({ size: e = "md", indeterminate: t = !1, invalid: n = !1, disabled: o, className: a, children: u, ...i }, c) {
|
|
44
|
+
const d = S(null), _ = Q(
|
|
45
|
+
(f) => {
|
|
46
|
+
d.current = f, typeof c == "function" ? c(f) : c && (c.current = f);
|
|
47
47
|
},
|
|
48
|
-
[
|
|
48
|
+
[c]
|
|
49
49
|
);
|
|
50
|
-
return
|
|
51
|
-
d.current && (d.current.indeterminate =
|
|
52
|
-
}), /* @__PURE__ */
|
|
50
|
+
return P(() => {
|
|
51
|
+
d.current && (d.current.indeterminate = t);
|
|
52
|
+
}), /* @__PURE__ */ L(
|
|
53
53
|
"label",
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
55
|
+
className: T(A.root, a),
|
|
56
56
|
"data-size": e,
|
|
57
|
-
"data-disabled":
|
|
57
|
+
"data-disabled": o ? "" : void 0,
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ L("span", { className: A.control, children: [
|
|
60
60
|
/* @__PURE__ */ l(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
|
-
...
|
|
63
|
+
...i,
|
|
64
64
|
ref: _,
|
|
65
65
|
type: "checkbox",
|
|
66
|
-
className:
|
|
67
|
-
disabled:
|
|
66
|
+
className: A.input,
|
|
67
|
+
disabled: o,
|
|
68
68
|
"data-invalid": n ? "" : void 0,
|
|
69
69
|
"aria-invalid": n ? !0 : void 0
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */ l("span", { className:
|
|
72
|
+
/* @__PURE__ */ l("span", { className: A.box, "aria-hidden": "true" })
|
|
73
73
|
] }),
|
|
74
|
-
|
|
74
|
+
u ? /* @__PURE__ */ l("span", { className: A.label, children: u }) : null
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
|
-
}),
|
|
79
|
-
root:
|
|
80
|
-
},
|
|
78
|
+
}), $e = "maru-Heading-module__root__-To4U", ge = {
|
|
79
|
+
root: $e
|
|
80
|
+
}, Le = {
|
|
81
81
|
1: "4xl",
|
|
82
82
|
2: "3xl",
|
|
83
83
|
3: "2xl",
|
|
84
84
|
4: "xl",
|
|
85
85
|
5: "lg",
|
|
86
86
|
6: "md"
|
|
87
|
-
},
|
|
88
|
-
const
|
|
87
|
+
}, Ce = E(function({ level: e, size: t, tone: n = "default", className: o, ...a }, u) {
|
|
88
|
+
const i = `h${e}`;
|
|
89
89
|
return /* @__PURE__ */ l(
|
|
90
|
-
|
|
90
|
+
i,
|
|
91
91
|
{
|
|
92
|
-
...
|
|
93
|
-
ref:
|
|
94
|
-
className:
|
|
95
|
-
"data-size":
|
|
92
|
+
...a,
|
|
93
|
+
ref: u,
|
|
94
|
+
className: T(ge.root, o),
|
|
95
|
+
"data-size": t ?? Le[e],
|
|
96
96
|
"data-tone": n
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
|
-
}),
|
|
100
|
-
root:
|
|
101
|
-
panel:
|
|
102
|
-
header:
|
|
103
|
-
title:
|
|
104
|
-
description:
|
|
105
|
-
body:
|
|
106
|
-
actions:
|
|
107
|
-
close:
|
|
99
|
+
}), Ie = "maru-Dialog-module__root__tvkOF", Se = "maru-Dialog-module__panel__b2y0S", Pe = "maru-Dialog-module__header__bdJRp", Be = "maru-Dialog-module__title__glVA6", De = "maru-Dialog-module__description__6Bsa9", Re = "maru-Dialog-module__body__1ZbVo", Me = "maru-Dialog-module__actions__JRD2K", ze = "maru-Dialog-module__close__Zz2uv", z = {
|
|
100
|
+
root: Ie,
|
|
101
|
+
panel: Se,
|
|
102
|
+
header: Pe,
|
|
103
|
+
title: Be,
|
|
104
|
+
description: De,
|
|
105
|
+
body: Re,
|
|
106
|
+
actions: Me,
|
|
107
|
+
close: ze
|
|
108
108
|
};
|
|
109
|
-
let
|
|
110
|
-
function
|
|
111
|
-
|
|
109
|
+
let W = 0, de = "";
|
|
110
|
+
function Oe() {
|
|
111
|
+
W === 0 && (de = document.body.style.overflow, document.body.style.overflow = "hidden"), W += 1;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
113
|
+
function Fe() {
|
|
114
|
+
W = Math.max(0, W - 1), W === 0 && (document.body.style.overflow = de);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const It = E(function({
|
|
117
117
|
open: e,
|
|
118
|
-
onClose:
|
|
118
|
+
onClose: t,
|
|
119
119
|
title: n,
|
|
120
|
-
description:
|
|
121
|
-
actions:
|
|
122
|
-
size:
|
|
123
|
-
closeOnBackdropClick:
|
|
124
|
-
closeLabel:
|
|
120
|
+
description: o,
|
|
121
|
+
actions: a,
|
|
122
|
+
size: u = "md",
|
|
123
|
+
closeOnBackdropClick: i = !0,
|
|
124
|
+
closeLabel: c = "Close",
|
|
125
125
|
initialFocusRef: d,
|
|
126
126
|
keepMounted: _ = !1,
|
|
127
|
-
className:
|
|
128
|
-
children:
|
|
129
|
-
...
|
|
130
|
-
},
|
|
131
|
-
const y =
|
|
132
|
-
|
|
133
|
-
k.current =
|
|
127
|
+
className: f,
|
|
128
|
+
children: p,
|
|
129
|
+
...v
|
|
130
|
+
}, w) {
|
|
131
|
+
const y = O(), b = `${y}-title`, m = `${y}-description`, N = S(null), k = S(t), h = S(e), x = S(i);
|
|
132
|
+
P(() => {
|
|
133
|
+
k.current = t, h.current = e, x.current = i;
|
|
134
134
|
});
|
|
135
|
-
const
|
|
136
|
-
(
|
|
137
|
-
|
|
135
|
+
const R = Q(
|
|
136
|
+
(r) => {
|
|
137
|
+
N.current = r, typeof w == "function" ? w(r) : w && (w.current = r);
|
|
138
138
|
},
|
|
139
|
-
[
|
|
140
|
-
),
|
|
141
|
-
return
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
139
|
+
[w]
|
|
140
|
+
), D = e || _;
|
|
141
|
+
return P(() => {
|
|
142
|
+
const r = N.current;
|
|
143
|
+
if (!r || !e) return;
|
|
144
|
+
const $ = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
145
|
+
return r.open || r.showModal(), Oe(), d?.current && d.current.focus(), () => {
|
|
146
|
+
Fe(), r.open && r.close();
|
|
147
|
+
const C = document.activeElement, I = !C || C === document.body || r.contains(C);
|
|
148
|
+
$?.isConnected && I && $.focus();
|
|
149
149
|
};
|
|
150
|
-
}, [e]),
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
|
|
150
|
+
}, [e]), P(() => {
|
|
151
|
+
const r = N.current;
|
|
152
|
+
if (!r) return;
|
|
153
|
+
const $ = (M) => {
|
|
154
|
+
M.preventDefault(), k.current();
|
|
155
|
+
}, C = () => {
|
|
156
|
+
h.current && !r.open && k.current();
|
|
157
157
|
};
|
|
158
|
-
let
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
const
|
|
163
|
-
|
|
158
|
+
let I = !1;
|
|
159
|
+
const F = (M) => {
|
|
160
|
+
I = M.target === r;
|
|
161
|
+
}, H = (M) => {
|
|
162
|
+
const g = I && M.target === r && x.current;
|
|
163
|
+
I = !1, g && k.current();
|
|
164
164
|
};
|
|
165
|
-
return
|
|
166
|
-
|
|
165
|
+
return r.addEventListener("cancel", $), r.addEventListener("close", C), r.addEventListener("mousedown", F), r.addEventListener("click", H), () => {
|
|
166
|
+
r.removeEventListener("cancel", $), r.removeEventListener("close", C), r.removeEventListener("mousedown", F), r.removeEventListener("click", H);
|
|
167
167
|
};
|
|
168
|
-
}, [
|
|
168
|
+
}, [D]), D ? /* @__PURE__ */ l(
|
|
169
169
|
"dialog",
|
|
170
170
|
{
|
|
171
|
-
...
|
|
172
|
-
ref:
|
|
173
|
-
className:
|
|
174
|
-
"data-size":
|
|
175
|
-
"aria-labelledby":
|
|
176
|
-
"aria-describedby":
|
|
177
|
-
children: /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */ l(
|
|
180
|
-
|
|
171
|
+
...v,
|
|
172
|
+
ref: R,
|
|
173
|
+
className: T(z.root, f),
|
|
174
|
+
"data-size": u,
|
|
175
|
+
"aria-labelledby": b,
|
|
176
|
+
"aria-describedby": o ? m : void 0,
|
|
177
|
+
children: /* @__PURE__ */ L("div", { className: z.panel, children: [
|
|
178
|
+
/* @__PURE__ */ L("header", { className: z.header, children: [
|
|
179
|
+
/* @__PURE__ */ l(Ce, { level: 2, size: "lg", id: b, className: z.title, children: n }),
|
|
180
|
+
o ? /* @__PURE__ */ l("p", { id: m, className: z.description, children: o }) : null
|
|
181
181
|
] }),
|
|
182
|
-
/* @__PURE__ */ l("div", { className:
|
|
183
|
-
|
|
184
|
-
/* @__PURE__ */ l("button", { type: "button", className:
|
|
182
|
+
/* @__PURE__ */ l("div", { className: z.body, children: p }),
|
|
183
|
+
a ? /* @__PURE__ */ l("footer", { className: z.actions, children: a }) : null,
|
|
184
|
+
/* @__PURE__ */ l("button", { type: "button", className: z.close, "aria-label": c, onClick: t, children: /* @__PURE__ */ l("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ l(
|
|
185
185
|
"path",
|
|
186
186
|
{
|
|
187
187
|
d: "M3 3l10 10M13 3L3 13",
|
|
@@ -194,116 +194,260 @@ const it = $(function({
|
|
|
194
194
|
] })
|
|
195
195
|
}
|
|
196
196
|
) : null;
|
|
197
|
-
}),
|
|
198
|
-
function
|
|
199
|
-
return
|
|
197
|
+
}), ue = re(null);
|
|
198
|
+
function me() {
|
|
199
|
+
return se(ue);
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
root:
|
|
203
|
-
label:
|
|
204
|
-
required:
|
|
205
|
-
description:
|
|
206
|
-
error:
|
|
201
|
+
const He = "maru-Field-module__root__OOI9-", Ae = "maru-Field-module__label__LAQio", qe = "maru-Field-module__required__8HCWC", Ke = "maru-Field-module__description__yqljW", We = "maru-Field-module__error__m0uol", q = {
|
|
202
|
+
root: He,
|
|
203
|
+
label: Ae,
|
|
204
|
+
required: qe,
|
|
205
|
+
description: Ke,
|
|
206
|
+
error: We
|
|
207
207
|
};
|
|
208
|
-
function
|
|
209
|
-
return
|
|
208
|
+
function ee(s) {
|
|
209
|
+
return s != null && s !== !1 && s !== "";
|
|
210
210
|
}
|
|
211
|
-
const
|
|
212
|
-
const _ =
|
|
213
|
-
return /* @__PURE__ */
|
|
211
|
+
const St = E(function({ label: e, description: t, error: n, required: o = !1, disabled: a = !1, className: u, children: i, ...c }, d) {
|
|
212
|
+
const _ = O(), f = `${_}-control`, p = `${_}-description`, v = `${_}-error`, w = ee(t), y = ee(n), b = [w ? p : null, y ? v : null].filter(Boolean).join(" ") || void 0;
|
|
213
|
+
return /* @__PURE__ */ L(
|
|
214
214
|
"div",
|
|
215
215
|
{
|
|
216
|
-
...
|
|
216
|
+
...c,
|
|
217
217
|
ref: d,
|
|
218
|
-
className:
|
|
218
|
+
className: T(q.root, u),
|
|
219
219
|
"data-invalid": y ? "" : void 0,
|
|
220
220
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ L("label", { htmlFor: f, className: q.label, children: [
|
|
222
222
|
e,
|
|
223
|
-
|
|
223
|
+
o ? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: q.required, children: " *" }) : null
|
|
224
224
|
] }),
|
|
225
|
-
|
|
225
|
+
w ? /* @__PURE__ */ l("p", { id: p, className: q.description, children: t }) : null,
|
|
226
226
|
/* @__PURE__ */ l(
|
|
227
|
-
|
|
227
|
+
ue.Provider,
|
|
228
228
|
{
|
|
229
|
-
value: { controlId:
|
|
230
|
-
children:
|
|
229
|
+
value: { controlId: f, describedBy: b, invalid: y, required: o, disabled: a },
|
|
230
|
+
children: i
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
|
-
/* @__PURE__ */ l("div", { "aria-live": "polite", children: y ? /* @__PURE__ */ l("p", { id:
|
|
233
|
+
/* @__PURE__ */ l("div", { "aria-live": "polite", children: y ? /* @__PURE__ */ l("p", { id: v, className: q.error, children: n }) : null })
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
|
-
}),
|
|
238
|
-
root:
|
|
239
|
-
},
|
|
237
|
+
}), Ve = "maru-Input-module__root__KgYPo", je = {
|
|
238
|
+
root: Ve
|
|
239
|
+
}, Pt = E(function({
|
|
240
240
|
size: e = "md",
|
|
241
|
-
type:
|
|
241
|
+
type: t = "text",
|
|
242
242
|
invalid: n,
|
|
243
|
-
id:
|
|
244
|
-
disabled:
|
|
245
|
-
required:
|
|
246
|
-
className:
|
|
247
|
-
"aria-describedby":
|
|
243
|
+
id: o,
|
|
244
|
+
disabled: a,
|
|
245
|
+
required: u,
|
|
246
|
+
className: i,
|
|
247
|
+
"aria-describedby": c,
|
|
248
248
|
...d
|
|
249
249
|
}, _) {
|
|
250
|
-
const
|
|
250
|
+
const f = me(), p = n ?? f?.invalid ?? !1, v = [c, f?.describedBy].filter(Boolean).join(" ") || void 0;
|
|
251
251
|
return /* @__PURE__ */ l(
|
|
252
252
|
"input",
|
|
253
253
|
{
|
|
254
254
|
...d,
|
|
255
255
|
ref: _,
|
|
256
|
-
id:
|
|
257
|
-
type:
|
|
258
|
-
className:
|
|
256
|
+
id: f?.controlId ?? o,
|
|
257
|
+
type: t,
|
|
258
|
+
className: T(je.root, i),
|
|
259
259
|
"data-size": e,
|
|
260
|
-
"data-invalid":
|
|
261
|
-
"aria-invalid":
|
|
262
|
-
"aria-describedby":
|
|
263
|
-
disabled:
|
|
264
|
-
required:
|
|
260
|
+
"data-invalid": p ? "" : void 0,
|
|
261
|
+
"aria-invalid": p ? !0 : void 0,
|
|
262
|
+
"aria-describedby": v,
|
|
263
|
+
disabled: a ?? f?.disabled,
|
|
264
|
+
required: u ?? f?.required
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
|
-
}),
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
}), te = {
|
|
268
|
+
top: "bottom",
|
|
269
|
+
bottom: "top",
|
|
270
|
+
left: "right",
|
|
271
|
+
right: "left"
|
|
272
|
+
};
|
|
273
|
+
function fe(s, e, t, n, o = 8, a = 8) {
|
|
274
|
+
const u = {
|
|
275
|
+
top: s.top - o - e.height >= a,
|
|
276
|
+
bottom: s.bottom + o + e.height <= t.height - a,
|
|
277
|
+
left: s.left - o - e.width >= a,
|
|
278
|
+
right: s.right + o + e.width <= t.width - a
|
|
279
|
+
}, i = !u[n] && u[te[n]] ? te[n] : n, c = (f, p, v) => Math.max(a, Math.min(f, v - a - p)), d = (s.left + s.right) / 2 - e.width / 2, _ = (s.top + s.bottom) / 2 - e.height / 2;
|
|
280
|
+
switch (i) {
|
|
281
|
+
case "top":
|
|
282
|
+
return {
|
|
283
|
+
side: i,
|
|
284
|
+
x: c(d, e.width, t.width),
|
|
285
|
+
y: s.top - o - e.height
|
|
286
|
+
};
|
|
287
|
+
case "bottom":
|
|
288
|
+
return {
|
|
289
|
+
side: i,
|
|
290
|
+
x: c(d, e.width, t.width),
|
|
291
|
+
y: s.bottom + o
|
|
292
|
+
};
|
|
293
|
+
case "left":
|
|
294
|
+
return {
|
|
295
|
+
side: i,
|
|
296
|
+
x: s.left - o - e.width,
|
|
297
|
+
y: c(_, e.height, t.height)
|
|
298
|
+
};
|
|
299
|
+
case "right":
|
|
300
|
+
return {
|
|
301
|
+
side: i,
|
|
302
|
+
x: s.right + o,
|
|
303
|
+
y: c(_, e.height, t.height)
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const Ue = "maru-Popover-module__root__vEMon", Ze = "maru-Popover-module__title__hAl5w", Ye = "maru-Popover-module__body__d6SIw", Y = {
|
|
308
|
+
root: Ue,
|
|
309
|
+
title: Ze,
|
|
310
|
+
body: Ye
|
|
311
|
+
}, oe = typeof document > "u" ? P : ce, Je = [
|
|
312
|
+
"a[href]",
|
|
313
|
+
"button:not([disabled])",
|
|
314
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
315
|
+
"select:not([disabled])",
|
|
316
|
+
"textarea:not([disabled])",
|
|
317
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
318
|
+
].join(",");
|
|
319
|
+
function Bt({
|
|
320
|
+
content: s,
|
|
321
|
+
children: e,
|
|
322
|
+
title: t,
|
|
323
|
+
"aria-label": n,
|
|
324
|
+
placement: o = "bottom",
|
|
325
|
+
open: a,
|
|
326
|
+
defaultOpen: u = !1,
|
|
327
|
+
onOpenChange: i,
|
|
328
|
+
disabled: c = !1,
|
|
329
|
+
className: d
|
|
330
|
+
}) {
|
|
331
|
+
const _ = O(), f = O(), p = S(null), [v, w] = U(u), y = a !== void 0, b = !c && (y ? a : v), m = S({ open: b, controlled: y, onOpenChange: i });
|
|
332
|
+
oe(() => {
|
|
333
|
+
m.current = { open: b, controlled: y, onOpenChange: i };
|
|
334
|
+
});
|
|
335
|
+
const N = (r) => {
|
|
336
|
+
const { open: $, controlled: C, onOpenChange: I } = m.current;
|
|
337
|
+
r !== $ && (C || w(r), I?.(r));
|
|
338
|
+
}, k = () => p.current?.previousElementSibling ?? null;
|
|
339
|
+
oe(() => {
|
|
340
|
+
const r = p.current;
|
|
341
|
+
if (!r || !b) return;
|
|
342
|
+
const $ = () => {
|
|
343
|
+
const g = k();
|
|
344
|
+
if (!g) return;
|
|
345
|
+
const { x: V, y: pe, side: ve } = fe(
|
|
346
|
+
g.getBoundingClientRect(),
|
|
347
|
+
{ width: r.offsetWidth, height: r.offsetHeight },
|
|
348
|
+
{
|
|
349
|
+
width: document.documentElement.clientWidth,
|
|
350
|
+
height: document.documentElement.clientHeight
|
|
351
|
+
},
|
|
352
|
+
o
|
|
353
|
+
);
|
|
354
|
+
r.style.left = `${V}px`, r.style.top = `${pe}px`, r.dataset.placement = ve;
|
|
355
|
+
};
|
|
356
|
+
let C = !1;
|
|
357
|
+
typeof r.showPopover == "function" && (r.showPopover(), C = !0), $();
|
|
358
|
+
const I = (g) => g instanceof Node && !r.contains(g) && !k()?.contains(g), F = (g) => {
|
|
359
|
+
if (g.key !== "Escape") return;
|
|
360
|
+
g.preventDefault(), g.stopPropagation(), N(!1);
|
|
361
|
+
const V = k();
|
|
362
|
+
V instanceof HTMLElement && V.focus();
|
|
363
|
+
}, H = (g) => {
|
|
364
|
+
I(g.target) && N(!1);
|
|
365
|
+
}, M = (g) => {
|
|
366
|
+
I(g.target) && N(!1);
|
|
367
|
+
};
|
|
368
|
+
return window.addEventListener("scroll", $, !0), window.addEventListener("resize", $), document.addEventListener("keydown", F, !0), document.addEventListener("pointerdown", H, !0), document.addEventListener("focusin", M), () => {
|
|
369
|
+
window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $), document.removeEventListener("keydown", F, !0), document.removeEventListener("pointerdown", H, !0), document.removeEventListener("focusin", M), C && r.hidePopover();
|
|
370
|
+
};
|
|
371
|
+
}, [b, o]);
|
|
372
|
+
const h = S(b);
|
|
373
|
+
P(() => {
|
|
374
|
+
const r = p.current;
|
|
375
|
+
b && !h.current && r && (r.querySelector(Je) ?? r).focus(), h.current = b;
|
|
376
|
+
}, [b]);
|
|
377
|
+
const x = ae.only(e);
|
|
378
|
+
if (!le(x)) return /* @__PURE__ */ l(j, { children: e });
|
|
379
|
+
if (c) return x;
|
|
380
|
+
const R = x.props, D = ie(x, {
|
|
381
|
+
"aria-expanded": b,
|
|
382
|
+
"aria-controls": _,
|
|
383
|
+
"aria-haspopup": "dialog",
|
|
384
|
+
onClick: (r) => {
|
|
385
|
+
R.onClick?.(r), !r.defaultPrevented && N(!m.current.open);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
return /* @__PURE__ */ L(j, { children: [
|
|
389
|
+
D,
|
|
390
|
+
/* @__PURE__ */ L(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
ref: p,
|
|
394
|
+
id: _,
|
|
395
|
+
role: "dialog",
|
|
396
|
+
popover: "manual",
|
|
397
|
+
"aria-labelledby": t ? f : void 0,
|
|
398
|
+
"aria-label": t ? void 0 : n,
|
|
399
|
+
tabIndex: -1,
|
|
400
|
+
className: T(Y.root, d),
|
|
401
|
+
"data-open": b ? "" : void 0,
|
|
402
|
+
"data-placement": o,
|
|
403
|
+
children: [
|
|
404
|
+
t ? /* @__PURE__ */ l("div", { id: f, className: Y.title, children: t }) : null,
|
|
405
|
+
b ? /* @__PURE__ */ l("div", { className: Y.body, children: s }) : null
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] });
|
|
410
|
+
}
|
|
411
|
+
const Qe = "maru-Select-module__wrapper__KS2K3", Xe = "maru-Select-module__root__y0u6b", Ge = "maru-Select-module__chevron__PLUsh", J = {
|
|
412
|
+
wrapper: Qe,
|
|
413
|
+
root: Xe,
|
|
414
|
+
chevron: Ge
|
|
415
|
+
}, Dt = E(function({
|
|
272
416
|
size: e = "md",
|
|
273
|
-
invalid:
|
|
417
|
+
invalid: t,
|
|
274
418
|
placeholder: n,
|
|
275
|
-
id:
|
|
276
|
-
disabled:
|
|
277
|
-
required:
|
|
278
|
-
value:
|
|
279
|
-
defaultValue:
|
|
419
|
+
id: o,
|
|
420
|
+
disabled: a,
|
|
421
|
+
required: u,
|
|
422
|
+
value: i,
|
|
423
|
+
defaultValue: c,
|
|
280
424
|
className: d,
|
|
281
425
|
children: _,
|
|
282
|
-
"aria-describedby":
|
|
283
|
-
...
|
|
284
|
-
},
|
|
285
|
-
const
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
426
|
+
"aria-describedby": f,
|
|
427
|
+
...p
|
|
428
|
+
}, v) {
|
|
429
|
+
const w = me(), y = t ?? w?.invalid ?? !1, b = a ?? w?.disabled ?? !1, m = [f, w?.describedBy].filter(Boolean).join(" ") || void 0, N = i !== void 0 ? { value: i } : { defaultValue: c ?? (n !== void 0 ? "" : void 0) };
|
|
430
|
+
return /* @__PURE__ */ L("span", { className: J.wrapper, "data-size": e, "data-disabled": b ? "" : void 0, children: [
|
|
431
|
+
/* @__PURE__ */ L(
|
|
288
432
|
"select",
|
|
289
433
|
{
|
|
290
|
-
...
|
|
291
|
-
...
|
|
292
|
-
ref:
|
|
293
|
-
id:
|
|
294
|
-
className:
|
|
434
|
+
...p,
|
|
435
|
+
...N,
|
|
436
|
+
ref: v,
|
|
437
|
+
id: w?.controlId ?? o,
|
|
438
|
+
className: T(J.root, d),
|
|
295
439
|
"data-invalid": y ? "" : void 0,
|
|
296
440
|
"aria-invalid": y ? !0 : void 0,
|
|
297
|
-
"aria-describedby":
|
|
298
|
-
disabled:
|
|
299
|
-
required:
|
|
441
|
+
"aria-describedby": m,
|
|
442
|
+
disabled: b,
|
|
443
|
+
required: u ?? w?.required,
|
|
300
444
|
children: [
|
|
301
445
|
n !== void 0 ? /* @__PURE__ */ l("option", { value: "", disabled: !0, hidden: !0, children: n }) : null,
|
|
302
446
|
_
|
|
303
447
|
]
|
|
304
448
|
}
|
|
305
449
|
),
|
|
306
|
-
/* @__PURE__ */ l("svg", { className:
|
|
450
|
+
/* @__PURE__ */ l("svg", { className: J.chevron, viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ l(
|
|
307
451
|
"path",
|
|
308
452
|
{
|
|
309
453
|
d: "M4 6l4 4 4-4",
|
|
@@ -315,349 +459,431 @@ const lt = $(function({ label: e, description: o, error: n, required: t = !1, di
|
|
|
315
459
|
}
|
|
316
460
|
) })
|
|
317
461
|
] });
|
|
318
|
-
}),
|
|
319
|
-
root:
|
|
320
|
-
}
|
|
462
|
+
}), et = "maru-Skeleton-module__root__qaX19", tt = {
|
|
463
|
+
root: et
|
|
464
|
+
};
|
|
465
|
+
function ne(s) {
|
|
466
|
+
return typeof s == "number" ? `${s}px` : s;
|
|
467
|
+
}
|
|
468
|
+
const Rt = E(function({ variant: e = "text", width: t, height: n, lines: o = 1, className: a, style: u, ...i }, c) {
|
|
469
|
+
const d = e === "text" ? Math.max(1, Math.floor(o) || 1) : 1, _ = {
|
|
470
|
+
"--maru-skeleton-width": ne(t),
|
|
471
|
+
"--maru-skeleton-height": ne(n),
|
|
472
|
+
...u
|
|
473
|
+
};
|
|
474
|
+
return /* @__PURE__ */ l(
|
|
475
|
+
"div",
|
|
476
|
+
{
|
|
477
|
+
...i,
|
|
478
|
+
ref: c,
|
|
479
|
+
"aria-hidden": "true",
|
|
480
|
+
className: T(tt.root, a),
|
|
481
|
+
style: _,
|
|
482
|
+
"data-variant": e,
|
|
483
|
+
"data-lines": d > 1 ? d : void 0,
|
|
484
|
+
children: d > 1 ? Array.from({ length: d }, (f, p) => /* @__PURE__ */ l("span", {}, p)) : null
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
}), ot = "maru-Stack-module__root__NUN-x", nt = {
|
|
488
|
+
root: ot
|
|
489
|
+
}, Mt = E(function({
|
|
321
490
|
as: e = "div",
|
|
322
|
-
direction:
|
|
491
|
+
direction: t = "vertical",
|
|
323
492
|
gap: n = 4,
|
|
324
|
-
align:
|
|
325
|
-
justify:
|
|
326
|
-
wrap:
|
|
327
|
-
className:
|
|
328
|
-
style:
|
|
493
|
+
align: o,
|
|
494
|
+
justify: a,
|
|
495
|
+
wrap: u = !1,
|
|
496
|
+
className: i,
|
|
497
|
+
style: c,
|
|
329
498
|
...d
|
|
330
499
|
}, _) {
|
|
331
|
-
const
|
|
500
|
+
const f = e, p = {
|
|
332
501
|
"--maru-stack-gap": `var(--maru-space-${n})`,
|
|
333
|
-
...
|
|
502
|
+
...c
|
|
334
503
|
};
|
|
335
504
|
return /* @__PURE__ */ l(
|
|
336
|
-
|
|
505
|
+
f,
|
|
337
506
|
{
|
|
338
507
|
...d,
|
|
339
508
|
ref: _,
|
|
340
|
-
className:
|
|
341
|
-
style:
|
|
342
|
-
"data-direction":
|
|
343
|
-
"data-align":
|
|
344
|
-
"data-justify":
|
|
345
|
-
"data-wrap":
|
|
509
|
+
className: T(nt.root, i),
|
|
510
|
+
style: p,
|
|
511
|
+
"data-direction": t,
|
|
512
|
+
"data-align": o,
|
|
513
|
+
"data-justify": a,
|
|
514
|
+
"data-wrap": u ? "" : void 0
|
|
346
515
|
}
|
|
347
516
|
);
|
|
348
|
-
}),
|
|
349
|
-
root:
|
|
350
|
-
control:
|
|
351
|
-
input:
|
|
352
|
-
track:
|
|
353
|
-
},
|
|
354
|
-
return /* @__PURE__ */
|
|
517
|
+
}), rt = "maru-Switch-module__root__Y5Ydi", st = "maru-Switch-module__control__HV3vX", at = "maru-Switch-module__input__5BPNu", lt = "maru-Switch-module__track__7ObdZ", K = {
|
|
518
|
+
root: rt,
|
|
519
|
+
control: st,
|
|
520
|
+
input: at,
|
|
521
|
+
track: lt
|
|
522
|
+
}, zt = E(function({ size: e = "md", disabled: t, className: n, children: o, ...a }, u) {
|
|
523
|
+
return /* @__PURE__ */ L(
|
|
355
524
|
"label",
|
|
356
525
|
{
|
|
357
|
-
className:
|
|
526
|
+
className: T(K.root, n),
|
|
358
527
|
"data-size": e,
|
|
359
|
-
"data-disabled":
|
|
528
|
+
"data-disabled": t ? "" : void 0,
|
|
360
529
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ L("span", { className: K.control, children: [
|
|
362
531
|
/* @__PURE__ */ l(
|
|
363
532
|
"input",
|
|
364
533
|
{
|
|
365
|
-
...
|
|
366
|
-
ref:
|
|
534
|
+
...a,
|
|
535
|
+
ref: u,
|
|
367
536
|
type: "checkbox",
|
|
368
537
|
role: "switch",
|
|
369
|
-
className:
|
|
370
|
-
disabled:
|
|
538
|
+
className: K.input,
|
|
539
|
+
disabled: t
|
|
371
540
|
}
|
|
372
541
|
),
|
|
373
|
-
/* @__PURE__ */ l("span", { className:
|
|
542
|
+
/* @__PURE__ */ l("span", { className: K.track, "aria-hidden": "true" })
|
|
374
543
|
] }),
|
|
375
|
-
|
|
544
|
+
o ? /* @__PURE__ */ l("span", { className: K.label, children: o }) : null
|
|
376
545
|
]
|
|
377
546
|
}
|
|
378
547
|
);
|
|
379
|
-
}),
|
|
380
|
-
|
|
381
|
-
|
|
548
|
+
}), it = "maru-Table-module__wrapper__Qd7Cl", ct = "maru-Table-module__root__aMWWS", dt = "maru-Table-module__caption__9vU1I", ut = "maru-Table-module__header__5ZCAk", mt = "maru-Table-module__cell__nJrDK", ft = "maru-Table-module__body__8JxwZ", ht = "maru-Table-module__row__DD8Km", _t = "maru-Table-module__sort__Oet49", bt = "maru-Table-module__sortIcon__V3-dH", B = {
|
|
549
|
+
wrapper: it,
|
|
550
|
+
root: ct,
|
|
551
|
+
caption: dt,
|
|
552
|
+
header: ut,
|
|
553
|
+
cell: mt,
|
|
554
|
+
body: ft,
|
|
555
|
+
row: ht,
|
|
556
|
+
sort: _t,
|
|
557
|
+
sortIcon: bt
|
|
558
|
+
}, Ot = E(function({ caption: e, hideCaption: t = !1, size: n = "md", striped: o = !1, className: a, children: u, ...i }, c) {
|
|
559
|
+
const d = O(), _ = S(null), [f, p] = U(!1);
|
|
560
|
+
P(() => {
|
|
561
|
+
const y = _.current;
|
|
562
|
+
if (!y) return;
|
|
563
|
+
const b = () => p(y.scrollWidth > y.clientWidth);
|
|
564
|
+
if (b(), typeof ResizeObserver > "u")
|
|
565
|
+
return window.addEventListener("resize", b), () => window.removeEventListener("resize", b);
|
|
566
|
+
const m = new ResizeObserver(b);
|
|
567
|
+
return m.observe(y), y.firstElementChild && m.observe(y.firstElementChild), () => m.disconnect();
|
|
568
|
+
}, []);
|
|
569
|
+
const v = e != null && e !== !1, w = i["aria-label"];
|
|
570
|
+
return /* @__PURE__ */ l(
|
|
571
|
+
"div",
|
|
572
|
+
{
|
|
573
|
+
ref: _,
|
|
574
|
+
className: B.wrapper,
|
|
575
|
+
...f ? {
|
|
576
|
+
role: "region",
|
|
577
|
+
tabIndex: 0,
|
|
578
|
+
"aria-labelledby": v ? d : void 0,
|
|
579
|
+
"aria-label": v ? void 0 : w
|
|
580
|
+
} : null,
|
|
581
|
+
children: /* @__PURE__ */ L(
|
|
582
|
+
"table",
|
|
583
|
+
{
|
|
584
|
+
...i,
|
|
585
|
+
ref: c,
|
|
586
|
+
className: T(B.root, a),
|
|
587
|
+
"data-size": n,
|
|
588
|
+
"data-striped": o ? "" : void 0,
|
|
589
|
+
children: [
|
|
590
|
+
v ? /* @__PURE__ */ l(
|
|
591
|
+
"caption",
|
|
592
|
+
{
|
|
593
|
+
id: d,
|
|
594
|
+
className: B.caption,
|
|
595
|
+
"data-hidden": t ? "" : void 0,
|
|
596
|
+
children: e
|
|
597
|
+
}
|
|
598
|
+
) : null,
|
|
599
|
+
u
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}), Ft = E(function({ className: e, ...t }, n) {
|
|
606
|
+
return /* @__PURE__ */ l("thead", { ...t, ref: n, className: T(B.head, e) });
|
|
607
|
+
}), Ht = E(function({ className: e, ...t }, n) {
|
|
608
|
+
return /* @__PURE__ */ l("tbody", { ...t, ref: n, className: T(B.body, e) });
|
|
609
|
+
}), At = E(function({ className: e, ...t }, n) {
|
|
610
|
+
return /* @__PURE__ */ l("tr", { ...t, ref: n, className: T(B.row, e) });
|
|
611
|
+
}), qt = E(function({ scope: e = "col", numeric: t = !1, sort: n, onSort: o, className: a, children: u, ...i }, c) {
|
|
612
|
+
return /* @__PURE__ */ l(
|
|
613
|
+
"th",
|
|
614
|
+
{
|
|
615
|
+
...i,
|
|
616
|
+
ref: c,
|
|
617
|
+
scope: e,
|
|
618
|
+
"aria-sort": n,
|
|
619
|
+
className: T(B.header, a),
|
|
620
|
+
"data-numeric": t ? "" : void 0,
|
|
621
|
+
children: o ? /* @__PURE__ */ L("button", { type: "button", className: B.sort, onClick: o, "data-sort": n, children: [
|
|
622
|
+
u,
|
|
623
|
+
/* @__PURE__ */ l("span", { className: B.sortIcon, "aria-hidden": "true" })
|
|
624
|
+
] }) : u
|
|
625
|
+
}
|
|
626
|
+
);
|
|
627
|
+
}), Kt = E(function({ numeric: e = !1, className: t, ...n }, o) {
|
|
628
|
+
return /* @__PURE__ */ l(
|
|
629
|
+
"td",
|
|
630
|
+
{
|
|
631
|
+
...n,
|
|
632
|
+
ref: o,
|
|
633
|
+
className: T(B.cell, t),
|
|
634
|
+
"data-numeric": e ? "" : void 0
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
}), he = re(null);
|
|
638
|
+
function X(s) {
|
|
639
|
+
const e = se(he);
|
|
382
640
|
if (!e)
|
|
383
|
-
throw new Error(`<${
|
|
641
|
+
throw new Error(`<${s}> must be rendered inside <Tabs>.`);
|
|
384
642
|
return e;
|
|
385
643
|
}
|
|
386
|
-
function
|
|
387
|
-
return `${
|
|
644
|
+
function _e(s, e) {
|
|
645
|
+
return `${s}-tab-${encodeURIComponent(e)}`;
|
|
388
646
|
}
|
|
389
|
-
function
|
|
390
|
-
return `${
|
|
647
|
+
function be(s, e) {
|
|
648
|
+
return `${s}-panel-${encodeURIComponent(e)}`;
|
|
391
649
|
}
|
|
392
|
-
const
|
|
393
|
-
root:
|
|
394
|
-
list:
|
|
395
|
-
tab:
|
|
396
|
-
panel:
|
|
397
|
-
},
|
|
398
|
-
const { baseId:
|
|
399
|
-
function
|
|
400
|
-
n?.(
|
|
650
|
+
const pt = "maru-Tabs-module__root__-VKVI", vt = "maru-Tabs-module__list__qRVME", yt = "maru-Tabs-module__tab__IdDYc", wt = "maru-Tabs-module__panel__08i9c", Z = {
|
|
651
|
+
root: pt,
|
|
652
|
+
list: vt,
|
|
653
|
+
tab: yt,
|
|
654
|
+
panel: wt
|
|
655
|
+
}, Wt = E(function({ value: e, className: t, onClick: n, onFocus: o, onKeyDown: a, ...u }, i) {
|
|
656
|
+
const { baseId: c, value: d, select: _, orientation: f, activation: p } = X("Tab"), v = e === d;
|
|
657
|
+
function w(m) {
|
|
658
|
+
n?.(m), m.defaultPrevented || _(e);
|
|
401
659
|
}
|
|
402
|
-
function y(
|
|
403
|
-
|
|
660
|
+
function y(m) {
|
|
661
|
+
o?.(m), !m.defaultPrevented && p === "automatic" && _(e);
|
|
404
662
|
}
|
|
405
|
-
function
|
|
406
|
-
if (
|
|
407
|
-
const
|
|
408
|
-
if (!
|
|
409
|
-
const k = Array.from(
|
|
410
|
-
if (
|
|
411
|
-
const
|
|
412
|
-
let
|
|
413
|
-
if (
|
|
414
|
-
|
|
415
|
-
else if (
|
|
416
|
-
|
|
417
|
-
else if (
|
|
418
|
-
|
|
419
|
-
else if (
|
|
420
|
-
|
|
663
|
+
function b(m) {
|
|
664
|
+
if (a?.(m), m.defaultPrevented) return;
|
|
665
|
+
const N = m.currentTarget.closest('[role="tablist"]');
|
|
666
|
+
if (!N) return;
|
|
667
|
+
const k = Array.from(N.querySelectorAll('[role="tab"]:not(:disabled)')), h = k.indexOf(m.currentTarget);
|
|
668
|
+
if (h === -1) return;
|
|
669
|
+
const x = getComputedStyle(N).direction === "rtl", R = f === "vertical" ? "ArrowUp" : x ? "ArrowRight" : "ArrowLeft", D = f === "vertical" ? "ArrowDown" : x ? "ArrowLeft" : "ArrowRight";
|
|
670
|
+
let r;
|
|
671
|
+
if (m.key === D)
|
|
672
|
+
r = k[(h + 1) % k.length];
|
|
673
|
+
else if (m.key === R)
|
|
674
|
+
r = k[(h - 1 + k.length) % k.length];
|
|
675
|
+
else if (m.key === "Home")
|
|
676
|
+
r = k[0];
|
|
677
|
+
else if (m.key === "End")
|
|
678
|
+
r = k[k.length - 1];
|
|
421
679
|
else
|
|
422
680
|
return;
|
|
423
|
-
|
|
681
|
+
m.preventDefault(), r?.focus();
|
|
424
682
|
}
|
|
425
683
|
return /* @__PURE__ */ l(
|
|
426
684
|
"button",
|
|
427
685
|
{
|
|
428
|
-
...
|
|
429
|
-
ref:
|
|
686
|
+
...u,
|
|
687
|
+
ref: i,
|
|
430
688
|
type: "button",
|
|
431
689
|
role: "tab",
|
|
432
|
-
id:
|
|
433
|
-
"aria-selected":
|
|
434
|
-
"aria-controls":
|
|
435
|
-
tabIndex:
|
|
436
|
-
className:
|
|
437
|
-
"data-selected":
|
|
438
|
-
"data-orientation":
|
|
439
|
-
onClick:
|
|
690
|
+
id: _e(c, e),
|
|
691
|
+
"aria-selected": v,
|
|
692
|
+
"aria-controls": be(c, e),
|
|
693
|
+
tabIndex: v ? 0 : -1,
|
|
694
|
+
className: T(Z.tab, t),
|
|
695
|
+
"data-selected": v ? "" : void 0,
|
|
696
|
+
"data-orientation": f,
|
|
697
|
+
onClick: w,
|
|
440
698
|
onFocus: y,
|
|
441
|
-
onKeyDown:
|
|
699
|
+
onKeyDown: b
|
|
442
700
|
}
|
|
443
701
|
);
|
|
444
|
-
}),
|
|
445
|
-
const { orientation:
|
|
702
|
+
}), Vt = E(function({ className: e, ...t }, n) {
|
|
703
|
+
const { orientation: o } = X("TabList");
|
|
446
704
|
return /* @__PURE__ */ l(
|
|
447
705
|
"div",
|
|
448
706
|
{
|
|
449
|
-
...
|
|
707
|
+
...t,
|
|
450
708
|
ref: n,
|
|
451
709
|
role: "tablist",
|
|
452
|
-
"aria-orientation":
|
|
453
|
-
className:
|
|
454
|
-
"data-orientation":
|
|
710
|
+
"aria-orientation": o,
|
|
711
|
+
className: T(Z.list, e),
|
|
712
|
+
"data-orientation": o
|
|
455
713
|
}
|
|
456
714
|
);
|
|
457
|
-
}),
|
|
458
|
-
const { baseId:
|
|
715
|
+
}), jt = E(function({ value: e, keepMounted: t = !1, className: n, children: o, ...a }, u) {
|
|
716
|
+
const { baseId: i, value: c } = X("TabPanel"), d = e === c;
|
|
459
717
|
return /* @__PURE__ */ l(
|
|
460
718
|
"div",
|
|
461
719
|
{
|
|
462
|
-
...
|
|
463
|
-
ref:
|
|
720
|
+
...a,
|
|
721
|
+
ref: u,
|
|
464
722
|
role: "tabpanel",
|
|
465
|
-
id:
|
|
466
|
-
"aria-labelledby":
|
|
723
|
+
id: be(i, e),
|
|
724
|
+
"aria-labelledby": _e(i, e),
|
|
467
725
|
tabIndex: 0,
|
|
468
726
|
hidden: !d,
|
|
469
|
-
className:
|
|
470
|
-
children: d ||
|
|
727
|
+
className: T(Z.panel, n),
|
|
728
|
+
children: d || t ? o : null
|
|
471
729
|
}
|
|
472
730
|
);
|
|
473
|
-
}),
|
|
731
|
+
}), Ut = E(function({
|
|
474
732
|
value: e,
|
|
475
|
-
defaultValue:
|
|
733
|
+
defaultValue: t,
|
|
476
734
|
onValueChange: n,
|
|
477
|
-
orientation:
|
|
478
|
-
activation:
|
|
479
|
-
className:
|
|
480
|
-
children:
|
|
481
|
-
...
|
|
735
|
+
orientation: o = "horizontal",
|
|
736
|
+
activation: a = "automatic",
|
|
737
|
+
className: u,
|
|
738
|
+
children: i,
|
|
739
|
+
...c
|
|
482
740
|
}, d) {
|
|
483
|
-
const _ =
|
|
484
|
-
(
|
|
485
|
-
|
|
741
|
+
const _ = O(), [f, p] = U(t ?? ""), v = e !== void 0, w = v ? e : f, y = Q(
|
|
742
|
+
(m) => {
|
|
743
|
+
m !== w && (v || p(m), n?.(m));
|
|
486
744
|
},
|
|
487
|
-
[
|
|
488
|
-
),
|
|
489
|
-
() => ({ baseId: _, value:
|
|
490
|
-
[_,
|
|
745
|
+
[w, v, n]
|
|
746
|
+
), b = ye(
|
|
747
|
+
() => ({ baseId: _, value: w, select: y, orientation: o, activation: a }),
|
|
748
|
+
[_, w, y, o, a]
|
|
491
749
|
);
|
|
492
|
-
return /* @__PURE__ */ l(
|
|
750
|
+
return /* @__PURE__ */ l(he.Provider, { value: b, children: /* @__PURE__ */ l(
|
|
493
751
|
"div",
|
|
494
752
|
{
|
|
495
|
-
...
|
|
753
|
+
...c,
|
|
496
754
|
ref: d,
|
|
497
|
-
className:
|
|
498
|
-
"data-orientation":
|
|
499
|
-
children:
|
|
755
|
+
className: T(Z.root, u),
|
|
756
|
+
"data-orientation": o,
|
|
757
|
+
children: i
|
|
500
758
|
}
|
|
501
759
|
) });
|
|
502
|
-
}),
|
|
503
|
-
root:
|
|
504
|
-
},
|
|
760
|
+
}), Tt = "maru-Text-module__root__rsBo7", xt = {
|
|
761
|
+
root: Tt
|
|
762
|
+
}, Zt = E(function({ as: e = "p", size: t = "md", tone: n = "default", weight: o = "regular", className: a, ...u }, i) {
|
|
505
763
|
return /* @__PURE__ */ l(
|
|
506
764
|
e,
|
|
507
765
|
{
|
|
508
|
-
...
|
|
509
|
-
ref:
|
|
510
|
-
className:
|
|
511
|
-
"data-size":
|
|
766
|
+
...u,
|
|
767
|
+
ref: i,
|
|
768
|
+
className: T(xt.root, a),
|
|
769
|
+
"data-size": t,
|
|
512
770
|
"data-tone": n,
|
|
513
|
-
"data-weight":
|
|
771
|
+
"data-weight": o
|
|
514
772
|
}
|
|
515
773
|
);
|
|
516
|
-
}),
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
};
|
|
522
|
-
function et(r, e, o, n, t = 8, s = 8) {
|
|
523
|
-
const m = {
|
|
524
|
-
top: r.top - t - e.height >= s,
|
|
525
|
-
bottom: r.bottom + t + e.height <= o.height - s,
|
|
526
|
-
left: r.left - t - e.width >= s,
|
|
527
|
-
right: r.right + t + e.width <= o.width - s
|
|
528
|
-
}, c = !m[n] && m[J[n]] ? J[n] : n, i = (h, v, b) => Math.max(s, Math.min(h, b - s - v)), d = (r.left + r.right) / 2 - e.width / 2, _ = (r.top + r.bottom) / 2 - e.height / 2;
|
|
529
|
-
switch (c) {
|
|
530
|
-
case "top":
|
|
531
|
-
return {
|
|
532
|
-
side: c,
|
|
533
|
-
x: i(d, e.width, o.width),
|
|
534
|
-
y: r.top - t - e.height
|
|
535
|
-
};
|
|
536
|
-
case "bottom":
|
|
537
|
-
return {
|
|
538
|
-
side: c,
|
|
539
|
-
x: i(d, e.width, o.width),
|
|
540
|
-
y: r.bottom + t
|
|
541
|
-
};
|
|
542
|
-
case "left":
|
|
543
|
-
return {
|
|
544
|
-
side: c,
|
|
545
|
-
x: r.left - t - e.width,
|
|
546
|
-
y: i(_, e.height, o.height)
|
|
547
|
-
};
|
|
548
|
-
case "right":
|
|
549
|
-
return {
|
|
550
|
-
side: c,
|
|
551
|
-
x: r.right + t,
|
|
552
|
-
y: i(_, e.height, o.height)
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
const tt = "maru-Tooltip-module__root__U84l8", ot = {
|
|
557
|
-
root: tt
|
|
558
|
-
}, nt = typeof document > "u" ? D : ue;
|
|
559
|
-
function yt({
|
|
560
|
-
content: r,
|
|
774
|
+
}), Et = "maru-Tooltip-module__root__U84l8", kt = {
|
|
775
|
+
root: Et
|
|
776
|
+
}, Nt = typeof document > "u" ? P : ce;
|
|
777
|
+
function Yt({
|
|
778
|
+
content: s,
|
|
561
779
|
children: e,
|
|
562
|
-
placement:
|
|
780
|
+
placement: t = "top",
|
|
563
781
|
openDelay: n = 300,
|
|
564
|
-
closeDelay:
|
|
565
|
-
disabled:
|
|
566
|
-
className:
|
|
782
|
+
closeDelay: o = 100,
|
|
783
|
+
disabled: a = !1,
|
|
784
|
+
className: u
|
|
567
785
|
}) {
|
|
568
|
-
const
|
|
569
|
-
clearTimeout(
|
|
570
|
-
},
|
|
571
|
-
_.current =
|
|
572
|
-
}, y = (
|
|
573
|
-
|
|
786
|
+
const i = O(), [c, d] = U(!1), _ = S(null), f = S(null), p = S(void 0), v = () => {
|
|
787
|
+
clearTimeout(p.current), p.current = void 0;
|
|
788
|
+
}, w = (h, x) => {
|
|
789
|
+
_.current = h, v(), x > 0 ? p.current = setTimeout(() => d(!0), x) : d(!0);
|
|
790
|
+
}, y = (h) => {
|
|
791
|
+
v(), h > 0 ? p.current = setTimeout(() => d(!1), h) : d(!1);
|
|
574
792
|
};
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}, [
|
|
578
|
-
const
|
|
579
|
-
if (!
|
|
580
|
-
const
|
|
581
|
-
const
|
|
582
|
-
if (!
|
|
583
|
-
const { x:
|
|
584
|
-
|
|
585
|
-
{ width:
|
|
793
|
+
P(() => v, []), P(() => {
|
|
794
|
+
a && (v(), d(!1));
|
|
795
|
+
}, [a]), Nt(() => {
|
|
796
|
+
const h = f.current;
|
|
797
|
+
if (!h || !c) return;
|
|
798
|
+
const x = () => {
|
|
799
|
+
const r = _.current;
|
|
800
|
+
if (!r) return;
|
|
801
|
+
const { x: $, y: C, side: I } = fe(
|
|
802
|
+
r.getBoundingClientRect(),
|
|
803
|
+
{ width: h.offsetWidth, height: h.offsetHeight },
|
|
586
804
|
{
|
|
587
805
|
width: document.documentElement.clientWidth,
|
|
588
806
|
height: document.documentElement.clientHeight
|
|
589
807
|
},
|
|
590
|
-
|
|
808
|
+
t
|
|
591
809
|
);
|
|
592
|
-
|
|
810
|
+
h.style.left = `${$}px`, h.style.top = `${C}px`, h.dataset.placement = I;
|
|
593
811
|
};
|
|
594
|
-
let
|
|
595
|
-
typeof
|
|
596
|
-
const
|
|
597
|
-
|
|
812
|
+
let R = !1;
|
|
813
|
+
typeof h.showPopover == "function" && (h.showPopover(), R = !0), x();
|
|
814
|
+
const D = (r) => {
|
|
815
|
+
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), d(!1));
|
|
598
816
|
};
|
|
599
|
-
return window.addEventListener("scroll",
|
|
600
|
-
window.removeEventListener("scroll",
|
|
817
|
+
return window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), document.addEventListener("keydown", D, !0), () => {
|
|
818
|
+
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x), document.removeEventListener("keydown", D, !0), R && h.hidePopover();
|
|
601
819
|
};
|
|
602
|
-
}, [
|
|
603
|
-
const
|
|
604
|
-
if (!le(
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
"aria-describedby":
|
|
608
|
-
onMouseEnter: (
|
|
609
|
-
|
|
820
|
+
}, [c, t]);
|
|
821
|
+
const b = ae.only(e);
|
|
822
|
+
if (!le(b)) return /* @__PURE__ */ l(j, { children: e });
|
|
823
|
+
if (a) return b;
|
|
824
|
+
const m = b.props, N = [m["aria-describedby"], i].filter(Boolean).join(" "), k = ie(b, {
|
|
825
|
+
"aria-describedby": N,
|
|
826
|
+
onMouseEnter: (h) => {
|
|
827
|
+
m.onMouseEnter?.(h), w(h.currentTarget, n);
|
|
610
828
|
},
|
|
611
|
-
onMouseLeave: (
|
|
612
|
-
|
|
829
|
+
onMouseLeave: (h) => {
|
|
830
|
+
m.onMouseLeave?.(h), y(o);
|
|
613
831
|
},
|
|
614
|
-
onFocus: (
|
|
615
|
-
|
|
616
|
-
let
|
|
832
|
+
onFocus: (h) => {
|
|
833
|
+
m.onFocus?.(h);
|
|
834
|
+
let x = !0;
|
|
617
835
|
try {
|
|
618
|
-
|
|
836
|
+
x = h.currentTarget.matches(":focus-visible");
|
|
619
837
|
} catch {
|
|
620
838
|
}
|
|
621
|
-
|
|
839
|
+
x && w(h.currentTarget, 0);
|
|
622
840
|
},
|
|
623
|
-
onBlur: (
|
|
624
|
-
|
|
841
|
+
onBlur: (h) => {
|
|
842
|
+
m.onBlur?.(h), y(0);
|
|
625
843
|
}
|
|
626
844
|
});
|
|
627
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ L(j, { children: [
|
|
628
846
|
k,
|
|
629
847
|
/* @__PURE__ */ l(
|
|
630
848
|
"span",
|
|
631
849
|
{
|
|
632
|
-
ref:
|
|
633
|
-
id:
|
|
850
|
+
ref: f,
|
|
851
|
+
id: i,
|
|
634
852
|
role: "tooltip",
|
|
635
853
|
popover: "manual",
|
|
636
|
-
className:
|
|
637
|
-
"data-open":
|
|
638
|
-
"data-placement":
|
|
639
|
-
onMouseEnter:
|
|
640
|
-
onMouseLeave: () => y(
|
|
641
|
-
children:
|
|
854
|
+
className: T(kt.root, u),
|
|
855
|
+
"data-open": c ? "" : void 0,
|
|
856
|
+
"data-placement": t,
|
|
857
|
+
onMouseEnter: v,
|
|
858
|
+
onMouseLeave: () => y(o),
|
|
859
|
+
children: s
|
|
642
860
|
}
|
|
643
861
|
)
|
|
644
862
|
] });
|
|
645
863
|
}
|
|
646
864
|
export {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
865
|
+
Lt as Button,
|
|
866
|
+
Ct as Checkbox,
|
|
867
|
+
It as Dialog,
|
|
868
|
+
St as Field,
|
|
869
|
+
Ce as Heading,
|
|
870
|
+
Pt as Input,
|
|
871
|
+
Bt as Popover,
|
|
872
|
+
Dt as Select,
|
|
873
|
+
Rt as Skeleton,
|
|
874
|
+
Mt as Stack,
|
|
875
|
+
zt as Switch,
|
|
876
|
+
Wt as Tab,
|
|
877
|
+
Vt as TabList,
|
|
878
|
+
jt as TabPanel,
|
|
879
|
+
Ot as Table,
|
|
880
|
+
Ht as TableBody,
|
|
881
|
+
Kt as TableCell,
|
|
882
|
+
Ft as TableHead,
|
|
883
|
+
qt as TableHeader,
|
|
884
|
+
At as TableRow,
|
|
885
|
+
Ut as Tabs,
|
|
886
|
+
Zt as Text,
|
|
887
|
+
Yt as Tooltip
|
|
662
888
|
};
|
|
663
889
|
//# sourceMappingURL=index.js.map
|