asterui 0.12.14 → 0.12.16
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 +1 -1
- package/dist/components/Autocomplete.d.ts +22 -2
- package/dist/components/Button.d.ts +10 -5
- package/dist/components/Form.d.ts +11 -1
- package/dist/components/HoverGallery.d.ts +10 -0
- package/dist/components/Rating.d.ts +12 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +156 -154
- package/dist/index.js.map +1 -1
- package/dist/index100.js +11 -43
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +44 -11
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +10 -12
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +14 -7
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +7 -12
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +11 -29
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +29 -16
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +21 -0
- package/dist/index107.js.map +1 -0
- package/dist/index21.js +1 -1
- package/dist/index34.js +133 -119
- package/dist/index34.js.map +1 -1
- package/dist/index37.js +15 -120
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +119 -37
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +40 -398
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +390 -89
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +90 -215
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +211 -135
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +155 -15
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +15 -17
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +17 -21
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +18 -134
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +134 -10
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +13 -35
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +35 -34
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +161 -80
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +34 -81
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +71 -166
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +167 -144
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +152 -11
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +10 -20
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +22 -14
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +14 -7
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +6 -333
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +334 -47
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +47 -122
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +120 -108
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +107 -167
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +167 -29
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +30 -120
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +116 -80
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +85 -19
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +19 -73
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +71 -54
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +56 -44
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +42 -49
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +52 -62
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +118 -102
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +107 -41
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +41 -68
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +66 -19
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +18 -55
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +55 -251
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +254 -22
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +22 -31
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +30 -93
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +89 -324
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +322 -73
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +79 -39
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +40 -23
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +21 -93
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +87 -148
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +147 -152
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +159 -63
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +65 -35
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +35 -234
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +55 -53
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +231 -31
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +34 -210
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +195 -198
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +159 -241
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +283 -166
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +173 -253
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +258 -14
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +12 -31
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +32 -5
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +5 -13
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index39.js
CHANGED
|
@@ -1,401 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, []
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [A, o]), L(() => {
|
|
41
|
-
const t = (E) => {
|
|
42
|
-
$.current && !$.current.contains(E.target) && (g(!1, "trigger"), x(-1));
|
|
43
|
-
};
|
|
44
|
-
if (A)
|
|
45
|
-
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
46
|
-
}, [A, g]);
|
|
47
|
-
const ee = R(() => {
|
|
48
|
-
M.includes("hover") && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
49
|
-
g(!0, "trigger");
|
|
50
|
-
}, m * 1e3));
|
|
51
|
-
}, [M, m, g]), ne = R(() => {
|
|
52
|
-
M.includes("hover") && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
53
|
-
g(!1, "trigger"), x(-1);
|
|
54
|
-
}, c * 1e3));
|
|
55
|
-
}, [M, c, g]), te = R((t) => {
|
|
56
|
-
M.includes("contextMenu") && (t.preventDefault(), g(!0, "trigger"));
|
|
57
|
-
}, [M, g]);
|
|
58
|
-
L(() => () => {
|
|
59
|
-
C.current && clearTimeout(C.current);
|
|
60
|
-
}, []);
|
|
61
|
-
const re = {
|
|
62
|
-
top: "dropdown-top",
|
|
63
|
-
bottom: "dropdown-bottom",
|
|
64
|
-
left: "dropdown-left",
|
|
65
|
-
right: "dropdown-right"
|
|
66
|
-
}, oe = {
|
|
67
|
-
start: "",
|
|
68
|
-
center: "dropdown-center",
|
|
69
|
-
end: "dropdown-end"
|
|
70
|
-
}, se = typeof f == "boolean" ? f : !!f, ae = [
|
|
71
|
-
"dropdown",
|
|
72
|
-
re[s],
|
|
73
|
-
oe[u],
|
|
74
|
-
M.includes("hover") && "dropdown-hover",
|
|
75
|
-
A && "dropdown-open",
|
|
76
|
-
k
|
|
77
|
-
].filter(Boolean).join(" "), le = () => d ? d.map((t, E) => {
|
|
78
|
-
if ("type" in t && t.type === "divider")
|
|
79
|
-
return /* @__PURE__ */ i(X, {}, t.key || `divider-${E}`);
|
|
80
|
-
const a = t;
|
|
81
|
-
return a.children && a.children.length > 0 ? /* @__PURE__ */ i(
|
|
82
|
-
Q,
|
|
83
|
-
{
|
|
84
|
-
itemKey: a.key,
|
|
85
|
-
title: a.label,
|
|
86
|
-
icon: a.icon,
|
|
87
|
-
disabled: a.disabled,
|
|
88
|
-
children: a.children.map((K) => /* @__PURE__ */ i(
|
|
89
|
-
O,
|
|
90
|
-
{
|
|
91
|
-
itemKey: K.key,
|
|
92
|
-
icon: K.icon,
|
|
93
|
-
disabled: K.disabled,
|
|
94
|
-
danger: K.danger,
|
|
95
|
-
onClick: K.onClick,
|
|
96
|
-
children: K.label
|
|
97
|
-
},
|
|
98
|
-
K.key
|
|
99
|
-
))
|
|
100
|
-
},
|
|
101
|
-
a.key
|
|
102
|
-
) : /* @__PURE__ */ i(
|
|
103
|
-
O,
|
|
104
|
-
{
|
|
105
|
-
itemKey: a.key,
|
|
106
|
-
icon: a.icon,
|
|
107
|
-
disabled: a.disabled,
|
|
108
|
-
danger: a.danger,
|
|
109
|
-
onClick: a.onClick,
|
|
110
|
-
children: a.label
|
|
111
|
-
},
|
|
112
|
-
a.key
|
|
113
|
-
);
|
|
114
|
-
}) : null, ce = d ? /* @__PURE__ */ B(ie, { children: [
|
|
115
|
-
D.Children.toArray(l).find(
|
|
116
|
-
(t) => D.isValidElement(t) && t.type === G
|
|
117
|
-
),
|
|
118
|
-
(Y || !o) && /* @__PURE__ */ i(J, { children: le() })
|
|
119
|
-
] }) : l;
|
|
120
|
-
return /* @__PURE__ */ i(
|
|
121
|
-
_.Provider,
|
|
122
|
-
{
|
|
123
|
-
value: {
|
|
124
|
-
position: s,
|
|
125
|
-
align: u,
|
|
126
|
-
menuId: U,
|
|
127
|
-
triggerId: v,
|
|
128
|
-
isOpen: A,
|
|
129
|
-
setIsOpen: g,
|
|
130
|
-
focusedIndex: w,
|
|
131
|
-
setFocusedIndex: x,
|
|
132
|
-
registerItem: H,
|
|
133
|
-
itemCount: T,
|
|
134
|
-
setItemCount: P,
|
|
135
|
-
disabled: p,
|
|
136
|
-
arrow: se,
|
|
137
|
-
closeDropdown: Z
|
|
138
|
-
},
|
|
139
|
-
children: /* @__PURE__ */ i(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
ref: $,
|
|
143
|
-
className: ae,
|
|
144
|
-
"data-state": A ? "open" : "closed",
|
|
145
|
-
"aria-disabled": p || void 0,
|
|
146
|
-
onMouseEnter: ee,
|
|
147
|
-
onMouseLeave: ne,
|
|
148
|
-
onContextMenu: te,
|
|
149
|
-
...S,
|
|
150
|
-
children: ce
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
function G({ children: l, className: d = "" }) {
|
|
157
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, setFocusedIndex: n, itemCount: r, disabled: p } = V(), f = (o) => {
|
|
158
|
-
switch (o.key) {
|
|
159
|
-
case "Enter":
|
|
160
|
-
case " ":
|
|
161
|
-
case "ArrowDown":
|
|
162
|
-
o.preventDefault(), u(!0), n(0);
|
|
163
|
-
break;
|
|
164
|
-
case "ArrowUp":
|
|
165
|
-
o.preventDefault(), u(!0), n(r - 1);
|
|
166
|
-
break;
|
|
167
|
-
case "Escape":
|
|
168
|
-
o.preventDefault(), u(!1), n(-1);
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
}, m = () => {
|
|
172
|
-
u(!s), s || n(0);
|
|
173
|
-
}, c = D.Children.only(l), y = c.props;
|
|
174
|
-
return D.cloneElement(c, {
|
|
175
|
-
id: h,
|
|
176
|
-
tabIndex: p ? -1 : 0,
|
|
177
|
-
"aria-haspopup": "menu",
|
|
178
|
-
"aria-expanded": s,
|
|
179
|
-
"aria-controls": b,
|
|
180
|
-
onClick: (o) => {
|
|
181
|
-
m(), y.onClick?.(o);
|
|
182
|
-
},
|
|
183
|
-
onKeyDown: (o) => {
|
|
184
|
-
f(o), y.onKeyDown?.(o);
|
|
185
|
-
},
|
|
186
|
-
className: `${y.className || ""} ${d}`.trim()
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function J({ children: l, className: d = "" }) {
|
|
190
|
-
const { menuId: b, triggerId: h, isOpen: s, setIsOpen: u, focusedIndex: n, setFocusedIndex: r, setItemCount: p, arrow: f, position: m } = V(), c = N(null), y = D.Children.toArray(l).filter(
|
|
191
|
-
(e) => D.isValidElement(e) && e.type === O
|
|
192
|
-
);
|
|
193
|
-
L(() => {
|
|
194
|
-
p(y.length);
|
|
195
|
-
}, [y.length, p]), L(() => {
|
|
196
|
-
s && n >= 0 && c.current && c.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')[n]?.focus();
|
|
197
|
-
}, [s, n]);
|
|
198
|
-
const o = (e) => {
|
|
199
|
-
const w = y.filter(
|
|
200
|
-
(x) => D.isValidElement(x) && !x.props.disabled
|
|
201
|
-
).length;
|
|
202
|
-
switch (e.key) {
|
|
203
|
-
case "ArrowDown":
|
|
204
|
-
e.preventDefault(), r((n + 1) % w);
|
|
205
|
-
break;
|
|
206
|
-
case "ArrowUp":
|
|
207
|
-
e.preventDefault(), r((n - 1 + w) % w);
|
|
208
|
-
break;
|
|
209
|
-
case "Home":
|
|
210
|
-
e.preventDefault(), r(0);
|
|
211
|
-
break;
|
|
212
|
-
case "End":
|
|
213
|
-
e.preventDefault(), r(w - 1);
|
|
214
|
-
break;
|
|
215
|
-
case "Escape":
|
|
216
|
-
e.preventDefault(), u(!1), r(-1), document.getElementById(h)?.focus();
|
|
217
|
-
break;
|
|
218
|
-
case "Tab":
|
|
219
|
-
u(!1), r(-1);
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
222
|
-
}, k = [
|
|
223
|
-
"dropdown-content",
|
|
224
|
-
"menu",
|
|
225
|
-
"bg-base-100",
|
|
226
|
-
"rounded-box",
|
|
227
|
-
"z-50",
|
|
228
|
-
"shadow",
|
|
229
|
-
d
|
|
230
|
-
].filter(Boolean).join(" "), S = D.Children.map(l, (e, I) => D.isValidElement(e) && e.type === O ? D.cloneElement(e, { _index: I }) : e), v = f ? /* @__PURE__ */ i(
|
|
231
|
-
"span",
|
|
232
|
-
{
|
|
233
|
-
className: `absolute w-0 h-0 border-8 border-solid ${{
|
|
234
|
-
top: "bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-t-base-100 border-l-transparent border-r-transparent border-b-transparent",
|
|
235
|
-
bottom: "top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-base-100 border-l-transparent border-r-transparent border-t-transparent",
|
|
236
|
-
left: "right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-base-100 border-t-transparent border-b-transparent border-r-transparent",
|
|
237
|
-
right: "left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-base-100 border-t-transparent border-b-transparent border-l-transparent"
|
|
238
|
-
}[m || "bottom"]}`,
|
|
239
|
-
"aria-hidden": "true"
|
|
240
|
-
}
|
|
241
|
-
) : null;
|
|
242
|
-
return /* @__PURE__ */ B(
|
|
243
|
-
"ul",
|
|
244
|
-
{
|
|
245
|
-
ref: c,
|
|
246
|
-
id: b,
|
|
247
|
-
role: "menu",
|
|
248
|
-
"aria-labelledby": h,
|
|
249
|
-
tabIndex: -1,
|
|
250
|
-
className: `${k} ${f ? "relative" : ""}`,
|
|
251
|
-
onKeyDown: o,
|
|
252
|
-
children: [
|
|
253
|
-
v,
|
|
254
|
-
S
|
|
255
|
-
]
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
function O({
|
|
260
|
-
children: l,
|
|
261
|
-
itemKey: d,
|
|
262
|
-
icon: b,
|
|
263
|
-
label: h,
|
|
264
|
-
onClick: s,
|
|
265
|
-
active: u = !1,
|
|
266
|
-
disabled: n = !1,
|
|
267
|
-
danger: r = !1,
|
|
268
|
-
className: p = ""
|
|
269
|
-
}) {
|
|
270
|
-
const { closeDropdown: f } = V(), m = [u && "active", n && "disabled", p].filter(Boolean).join(" "), c = () => {
|
|
271
|
-
n || (s?.(), f());
|
|
272
|
-
};
|
|
273
|
-
return /* @__PURE__ */ i("li", { className: m, role: "none", "data-key": d, children: /* @__PURE__ */ B(
|
|
274
|
-
"a",
|
|
275
|
-
{
|
|
276
|
-
role: "menuitem",
|
|
277
|
-
tabIndex: n ? -1 : 0,
|
|
278
|
-
"aria-disabled": n || void 0,
|
|
279
|
-
className: r ? "text-error" : "",
|
|
280
|
-
onClick: c,
|
|
281
|
-
onKeyDown: (k) => {
|
|
282
|
-
(k.key === "Enter" || k.key === " ") && !n && (k.preventDefault(), c());
|
|
283
|
-
},
|
|
284
|
-
children: [
|
|
285
|
-
b && /* @__PURE__ */ i("span", { className: "mr-2 inline-flex items-center", children: b }),
|
|
286
|
-
h || l
|
|
287
|
-
]
|
|
288
|
-
}
|
|
289
|
-
) });
|
|
290
|
-
}
|
|
291
|
-
function Q({
|
|
292
|
-
children: l,
|
|
293
|
-
itemKey: d,
|
|
294
|
-
title: b,
|
|
295
|
-
icon: h,
|
|
296
|
-
disabled: s = !1,
|
|
297
|
-
className: u = ""
|
|
298
|
-
}) {
|
|
299
|
-
const [n, r] = j(!1), p = N(null), f = N(null), m = N(null), c = q(), y = () => {
|
|
300
|
-
s || r(!0);
|
|
301
|
-
}, o = () => {
|
|
302
|
-
r(!1);
|
|
303
|
-
}, k = () => {
|
|
304
|
-
setTimeout(() => {
|
|
305
|
-
m.current?.querySelector('[role="menuitem"]:not([aria-disabled="true"])')?.focus();
|
|
306
|
-
}, 0);
|
|
307
|
-
}, S = (e) => {
|
|
308
|
-
if (!s)
|
|
309
|
-
switch (e.key) {
|
|
310
|
-
case "ArrowRight":
|
|
311
|
-
case "Enter":
|
|
312
|
-
case " ":
|
|
313
|
-
e.preventDefault(), e.stopPropagation(), r(!0), k();
|
|
314
|
-
break;
|
|
315
|
-
case "ArrowLeft":
|
|
316
|
-
case "Escape":
|
|
317
|
-
e.preventDefault(), e.stopPropagation(), r(!1);
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
}, U = (e) => {
|
|
321
|
-
switch (e.key) {
|
|
322
|
-
case "ArrowLeft":
|
|
323
|
-
case "Escape":
|
|
324
|
-
e.preventDefault(), e.stopPropagation(), r(!1), f.current?.focus();
|
|
325
|
-
break;
|
|
326
|
-
case "ArrowDown":
|
|
327
|
-
e.preventDefault(), e.stopPropagation();
|
|
328
|
-
const I = m.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
329
|
-
if (I) {
|
|
330
|
-
const T = (Array.from(I).findIndex((P) => P === document.activeElement) + 1) % I.length;
|
|
331
|
-
I[T]?.focus();
|
|
332
|
-
}
|
|
333
|
-
break;
|
|
334
|
-
case "ArrowUp":
|
|
335
|
-
e.preventDefault(), e.stopPropagation();
|
|
336
|
-
const w = m.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
337
|
-
if (w) {
|
|
338
|
-
const T = (Array.from(w).findIndex((P) => P === document.activeElement) - 1 + w.length) % w.length;
|
|
339
|
-
w[T]?.focus();
|
|
340
|
-
}
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
}, v = [s && "disabled", u].filter(Boolean).join(" ");
|
|
344
|
-
return /* @__PURE__ */ i(
|
|
345
|
-
"li",
|
|
346
|
-
{
|
|
347
|
-
ref: p,
|
|
348
|
-
className: v,
|
|
349
|
-
role: "none",
|
|
350
|
-
"data-key": d,
|
|
351
|
-
onMouseEnter: y,
|
|
352
|
-
onMouseLeave: o,
|
|
353
|
-
children: /* @__PURE__ */ B("details", { open: n, children: [
|
|
354
|
-
/* @__PURE__ */ B(
|
|
355
|
-
"summary",
|
|
356
|
-
{
|
|
357
|
-
ref: f,
|
|
358
|
-
role: "menuitem",
|
|
359
|
-
tabIndex: s ? -1 : 0,
|
|
360
|
-
"aria-disabled": s || void 0,
|
|
361
|
-
"aria-haspopup": "menu",
|
|
362
|
-
"aria-expanded": n,
|
|
363
|
-
"aria-controls": c,
|
|
364
|
-
onKeyDown: S,
|
|
365
|
-
children: [
|
|
366
|
-
h && /* @__PURE__ */ i("span", { className: "mr-2 inline-flex items-center", children: h }),
|
|
367
|
-
b
|
|
368
|
-
]
|
|
369
|
-
}
|
|
370
|
-
),
|
|
371
|
-
/* @__PURE__ */ i(
|
|
372
|
-
"ul",
|
|
373
|
-
{
|
|
374
|
-
ref: m,
|
|
375
|
-
id: c,
|
|
376
|
-
className: "menu bg-base-100 rounded-box z-50 shadow",
|
|
377
|
-
role: "menu",
|
|
378
|
-
"aria-label": typeof b == "string" ? b : void 0,
|
|
379
|
-
onKeyDown: U,
|
|
380
|
-
children: l
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
] })
|
|
384
|
-
}
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
function X({ className: l = "" }) {
|
|
388
|
-
const d = ["border-base-content/10", l].filter(Boolean).join(" ");
|
|
389
|
-
return /* @__PURE__ */ i("li", { role: "separator", className: "my-1", children: /* @__PURE__ */ i("hr", { className: d }) });
|
|
390
|
-
}
|
|
391
|
-
const be = Object.assign(pe, {
|
|
392
|
-
Trigger: G,
|
|
393
|
-
Menu: J,
|
|
394
|
-
Item: O,
|
|
395
|
-
SubMenu: Q,
|
|
396
|
-
Divider: X
|
|
397
|
-
});
|
|
1
|
+
import { jsxs as p, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
|
+
const j = ({
|
|
4
|
+
position: r = "top-end",
|
|
5
|
+
children: s,
|
|
6
|
+
className: c = "",
|
|
7
|
+
...o
|
|
8
|
+
}) => {
|
|
9
|
+
const n = (d) => {
|
|
10
|
+
const [l, h] = d.split("-"), t = [];
|
|
11
|
+
switch (l) {
|
|
12
|
+
case "top":
|
|
13
|
+
t.push("indicator-top");
|
|
14
|
+
break;
|
|
15
|
+
case "middle":
|
|
16
|
+
t.push("indicator-middle");
|
|
17
|
+
break;
|
|
18
|
+
case "bottom":
|
|
19
|
+
t.push("indicator-bottom");
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
switch (h) {
|
|
23
|
+
case "start":
|
|
24
|
+
t.push("indicator-start");
|
|
25
|
+
break;
|
|
26
|
+
case "center":
|
|
27
|
+
t.push("indicator-center");
|
|
28
|
+
break;
|
|
29
|
+
case "end":
|
|
30
|
+
t.push("indicator-end");
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return t.join(" ");
|
|
34
|
+
}, e = b.Children.toArray(s), a = e[0], i = e[1];
|
|
35
|
+
return /* @__PURE__ */ p("div", { className: `indicator inline-block ${c}`, ...o, children: [
|
|
36
|
+
i && /* @__PURE__ */ m("div", { className: `indicator-item ${n(r)}`, children: i }),
|
|
37
|
+
a
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
398
40
|
export {
|
|
399
|
-
|
|
41
|
+
j as Indicator
|
|
400
42
|
};
|
|
401
43
|
//# sourceMappingURL=index39.js.map
|
package/dist/index39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.js","sources":["../src/components/Dropdown.tsx"],"sourcesContent":["import React, { createContext, useContext, useId, useRef, useState, useCallback, useEffect } from 'react'\n\n// Types for data-driven items prop\nexport type DropdownTriggerType = 'click' | 'hover' | 'contextMenu'\n\nexport interface DropdownMenuItem {\n key: string\n label: React.ReactNode\n icon?: React.ReactNode\n disabled?: boolean\n danger?: boolean\n onClick?: () => void\n children?: DropdownMenuItem[] // For submenus\n}\n\nexport interface DropdownMenuDivider {\n type: 'divider'\n key?: string\n}\n\nexport type DropdownMenuItemType = DropdownMenuItem | DropdownMenuDivider\n\ninterface DropdownContextValue {\n position?: 'top' | 'bottom' | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n menuId: string\n triggerId: string\n isOpen: boolean\n setIsOpen: (open: boolean) => void\n focusedIndex: number\n setFocusedIndex: (index: number) => void\n registerItem: (index: number, ref: HTMLElement | null, disabled: boolean) => void\n itemCount: number\n setItemCount: (count: number) => void\n disabled: boolean\n arrow: boolean\n closeDropdown: () => void\n}\n\nconst DropdownContext = createContext<DropdownContextValue | undefined>(undefined)\n\nfunction useDropdownContext() {\n const context = useContext(DropdownContext)\n if (!context) {\n throw new Error('Dropdown compound components must be used within Dropdown')\n }\n return context\n}\n\nexport interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Trigger element and dropdown content (compound pattern) */\n children?: React.ReactNode\n /** Menu items (data-driven pattern) */\n items?: DropdownMenuItemType[]\n /** @deprecated Use trigger={['hover']} instead */\n hover?: boolean\n /** Trigger mode(s) for dropdown */\n trigger?: DropdownTriggerType[]\n position?: 'top' | 'bottom' | 'left' | 'right'\n align?: 'start' | 'center' | 'end'\n /** Controlled open state */\n open?: boolean\n /** Callback when open state changes */\n onOpenChange?: (open: boolean, info?: { source: 'trigger' | 'menu' }) => void\n /** Disable the dropdown */\n disabled?: boolean\n /** Show arrow pointing to trigger */\n arrow?: boolean | { pointAtCenter?: boolean }\n /** Delay before showing dropdown on hover (seconds) */\n mouseEnterDelay?: number\n /** Delay before hiding dropdown on mouse leave (seconds) */\n mouseLeaveDelay?: number\n /** Container for the dropdown menu */\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement\n /** Destroy dropdown when hidden */\n destroyOnHidden?: boolean\n}\n\nexport interface DropdownTriggerProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface DropdownMenuProps {\n children?: React.ReactNode\n className?: string\n}\n\nexport interface DropdownItemProps {\n children?: React.ReactNode\n /** Unique key for the item */\n itemKey?: string\n /** Icon to display before label */\n icon?: React.ReactNode\n /** Item label (alternative to children) */\n label?: React.ReactNode\n onClick?: () => void\n active?: boolean\n disabled?: boolean\n danger?: boolean\n className?: string\n _index?: number // Internal prop passed by DropdownMenu\n}\n\nexport interface DropdownSubMenuProps {\n children: React.ReactNode\n /** Unique key for the submenu */\n itemKey?: string\n /** Submenu title/label */\n title: React.ReactNode\n /** Icon to display before title */\n icon?: React.ReactNode\n disabled?: boolean\n className?: string\n}\n\nexport interface DropdownDividerProps {\n className?: string\n}\n\nfunction DropdownRoot({\n children,\n items,\n hover = false,\n trigger = ['click'],\n position = 'bottom',\n align = 'start',\n open: controlledOpen,\n onOpenChange,\n disabled = false,\n arrow = false,\n mouseEnterDelay = 0.15,\n mouseLeaveDelay = 0.1,\n getPopupContainer,\n destroyOnHidden = false,\n className = '',\n ...rest\n}: DropdownProps) {\n const menuId = useId()\n const triggerId = useId()\n const [internalOpen, setInternalOpen] = useState(false)\n const [focusedIndex, setFocusedIndex] = useState(-1)\n const [itemCount, setItemCount] = useState(0)\n const [shouldRender, setShouldRender] = useState(!destroyOnHidden)\n const itemRefs = useRef<Map<number, { ref: HTMLElement | null; disabled: boolean }>>(new Map())\n const dropdownRef = useRef<HTMLDivElement>(null)\n const hoverTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n // Normalize trigger - support both hover boolean (deprecated) and trigger array\n const triggers = hover ? ['hover'] : trigger\n\n // Use controlled or uncontrolled open state\n const isControlled = controlledOpen !== undefined\n const isOpen = isControlled ? controlledOpen : internalOpen\n\n const setIsOpen = useCallback((open: boolean, source: 'trigger' | 'menu' = 'trigger') => {\n if (disabled) return\n if (!isControlled) {\n setInternalOpen(open)\n }\n if (open) {\n setShouldRender(true)\n }\n onOpenChange?.(open, { source })\n }, [disabled, isControlled, onOpenChange])\n\n const closeDropdown = useCallback(() => {\n setIsOpen(false, 'menu')\n setFocusedIndex(-1)\n document.getElementById(triggerId)?.focus()\n }, [setIsOpen, triggerId])\n\n const registerItem = useCallback((index: number, ref: HTMLElement | null, itemDisabled: boolean) => {\n if (ref) {\n itemRefs.current.set(index, { ref, disabled: itemDisabled })\n } else {\n itemRefs.current.delete(index)\n }\n }, [])\n\n // Handle destroyOnHidden\n useEffect(() => {\n if (destroyOnHidden && !isOpen) {\n const timeout = setTimeout(() => setShouldRender(false), 300)\n return () => clearTimeout(timeout)\n }\n }, [isOpen, destroyOnHidden])\n\n // Close dropdown when clicking outside\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {\n setIsOpen(false, 'trigger')\n setFocusedIndex(-1)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen, setIsOpen])\n\n // Hover handlers with delay\n const handleMouseEnter = useCallback(() => {\n if (!triggers.includes('hover')) return\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n hoverTimeoutRef.current = setTimeout(() => {\n setIsOpen(true, 'trigger')\n }, mouseEnterDelay * 1000)\n }, [triggers, mouseEnterDelay, setIsOpen])\n\n const handleMouseLeave = useCallback(() => {\n if (!triggers.includes('hover')) return\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n hoverTimeoutRef.current = setTimeout(() => {\n setIsOpen(false, 'trigger')\n setFocusedIndex(-1)\n }, mouseLeaveDelay * 1000)\n }, [triggers, mouseLeaveDelay, setIsOpen])\n\n // Context menu handler\n const handleContextMenu = useCallback((event: React.MouseEvent) => {\n if (!triggers.includes('contextMenu')) return\n event.preventDefault()\n setIsOpen(true, 'trigger')\n }, [triggers, setIsOpen])\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (hoverTimeoutRef.current) {\n clearTimeout(hoverTimeoutRef.current)\n }\n }\n }, [])\n\n const positionClasses: Record<string, string> = {\n top: 'dropdown-top',\n bottom: 'dropdown-bottom',\n left: 'dropdown-left',\n right: 'dropdown-right',\n }\n\n const alignClasses: Record<string, string> = {\n start: '',\n center: 'dropdown-center',\n end: 'dropdown-end',\n }\n\n const showArrow = typeof arrow === 'boolean' ? arrow : !!arrow\n\n const dropdownClasses = [\n 'dropdown',\n positionClasses[position],\n alignClasses[align],\n triggers.includes('hover') && 'dropdown-hover',\n isOpen && 'dropdown-open',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Render items from data-driven prop\n const renderItems = () => {\n if (!items) return null\n return items.map((item, index) => {\n if ('type' in item && item.type === 'divider') {\n return <DropdownDivider key={item.key || `divider-${index}`} />\n }\n const menuItem = item as DropdownMenuItem\n if (menuItem.children && menuItem.children.length > 0) {\n return (\n <DropdownSubMenu\n key={menuItem.key}\n itemKey={menuItem.key}\n title={menuItem.label}\n icon={menuItem.icon}\n disabled={menuItem.disabled}\n >\n {menuItem.children.map((child) => (\n <DropdownItem\n key={child.key}\n itemKey={child.key}\n icon={child.icon}\n disabled={child.disabled}\n danger={child.danger}\n onClick={child.onClick}\n >\n {child.label}\n </DropdownItem>\n ))}\n </DropdownSubMenu>\n )\n }\n return (\n <DropdownItem\n key={menuItem.key}\n itemKey={menuItem.key}\n icon={menuItem.icon}\n disabled={menuItem.disabled}\n danger={menuItem.danger}\n onClick={menuItem.onClick}\n >\n {menuItem.label}\n </DropdownItem>\n )\n })\n }\n\n // Determine content - either compound children or items-generated menu\n const content = items ? (\n <>\n {React.Children.toArray(children).find(\n (child) => React.isValidElement(child) && child.type === DropdownTrigger\n )}\n {(shouldRender || !destroyOnHidden) && (\n <DropdownMenu>{renderItems()}</DropdownMenu>\n )}\n </>\n ) : (\n children\n )\n\n return (\n <DropdownContext.Provider\n value={{\n position,\n align,\n menuId,\n triggerId,\n isOpen,\n setIsOpen,\n focusedIndex,\n setFocusedIndex,\n registerItem,\n itemCount,\n setItemCount,\n disabled,\n arrow: showArrow,\n closeDropdown,\n }}\n >\n <div\n ref={dropdownRef}\n className={dropdownClasses}\n data-state={isOpen ? 'open' : 'closed'}\n aria-disabled={disabled || undefined}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onContextMenu={handleContextMenu}\n {...rest}\n >\n {content}\n </div>\n </DropdownContext.Provider>\n )\n}\n\nfunction DropdownTrigger({ children, className = '' }: DropdownTriggerProps) {\n const { menuId, triggerId, isOpen, setIsOpen, setFocusedIndex, itemCount, disabled } = useDropdownContext()\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case 'Enter':\n case ' ':\n case 'ArrowDown':\n event.preventDefault()\n setIsOpen(true)\n setFocusedIndex(0)\n break\n case 'ArrowUp':\n event.preventDefault()\n setIsOpen(true)\n setFocusedIndex(itemCount - 1)\n break\n case 'Escape':\n event.preventDefault()\n setIsOpen(false)\n setFocusedIndex(-1)\n break\n }\n }\n\n const handleClick = () => {\n setIsOpen(!isOpen)\n if (!isOpen) {\n setFocusedIndex(0)\n }\n }\n\n // Clone the child element to add event handlers and ARIA attributes\n const child = React.Children.only(children) as React.ReactElement<\n React.HTMLAttributes<HTMLElement> & {\n onClick?: (e: React.MouseEvent) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n className?: string\n }\n >\n\n const childProps = child.props\n\n return React.cloneElement(child, {\n id: triggerId,\n tabIndex: disabled ? -1 : 0,\n 'aria-haspopup': 'menu' as const,\n 'aria-expanded': isOpen,\n 'aria-controls': menuId,\n onClick: (e: React.MouseEvent) => {\n handleClick()\n childProps.onClick?.(e)\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n handleKeyDown(e)\n childProps.onKeyDown?.(e)\n },\n className: `${childProps.className || ''} ${className}`.trim(),\n })\n}\n\nfunction DropdownMenu({ children, className = '' }: DropdownMenuProps) {\n const { menuId, triggerId, isOpen, setIsOpen, focusedIndex, setFocusedIndex, setItemCount, arrow, position } = useDropdownContext()\n const menuRef = useRef<HTMLUListElement>(null)\n\n // Count children and set item count\n const childArray = React.Children.toArray(children).filter(\n (child) => React.isValidElement(child) && (child.type === DropdownItem)\n )\n\n useEffect(() => {\n setItemCount(childArray.length)\n }, [childArray.length, setItemCount])\n\n // Focus management\n useEffect(() => {\n if (isOpen && focusedIndex >= 0 && menuRef.current) {\n const items = menuRef.current.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n const item = items[focusedIndex] as HTMLElement\n item?.focus()\n }\n }, [isOpen, focusedIndex])\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const enabledItems = childArray.filter(\n (child) => React.isValidElement(child) && !(child.props as DropdownItemProps).disabled\n )\n const enabledCount = enabledItems.length\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n setFocusedIndex((focusedIndex + 1) % enabledCount)\n break\n case 'ArrowUp':\n event.preventDefault()\n setFocusedIndex((focusedIndex - 1 + enabledCount) % enabledCount)\n break\n case 'Home':\n event.preventDefault()\n setFocusedIndex(0)\n break\n case 'End':\n event.preventDefault()\n setFocusedIndex(enabledCount - 1)\n break\n case 'Escape':\n event.preventDefault()\n setIsOpen(false)\n setFocusedIndex(-1)\n // Return focus to trigger\n document.getElementById(triggerId)?.focus()\n break\n case 'Tab':\n setIsOpen(false)\n setFocusedIndex(-1)\n break\n }\n }\n\n const menuClasses = [\n 'dropdown-content',\n 'menu',\n 'bg-base-100',\n 'rounded-box',\n 'z-50',\n 'shadow',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // Clone children to pass index\n const childrenWithIndex = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child) && child.type === DropdownItem) {\n return React.cloneElement(child as React.ReactElement<any>, { _index: index })\n }\n return child\n })\n\n // Arrow position classes based on menu position\n const arrowPositionClasses: Record<string, string> = {\n top: 'bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-t-base-100 border-l-transparent border-r-transparent border-b-transparent',\n bottom: 'top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-base-100 border-l-transparent border-r-transparent border-t-transparent',\n left: 'right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-base-100 border-t-transparent border-b-transparent border-r-transparent',\n right: 'left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-base-100 border-t-transparent border-b-transparent border-l-transparent',\n }\n\n const arrowElement = arrow ? (\n <span\n className={`absolute w-0 h-0 border-8 border-solid ${arrowPositionClasses[position || 'bottom']}`}\n aria-hidden=\"true\"\n />\n ) : null\n\n return (\n <ul\n ref={menuRef}\n id={menuId}\n role=\"menu\"\n aria-labelledby={triggerId}\n tabIndex={-1}\n className={`${menuClasses} ${arrow ? 'relative' : ''}`}\n onKeyDown={handleKeyDown}\n >\n {arrowElement}\n {childrenWithIndex}\n </ul>\n )\n}\n\nfunction DropdownItem({\n children,\n itemKey,\n icon,\n label,\n onClick,\n active = false,\n disabled = false,\n danger = false,\n className = '',\n}: DropdownItemProps) {\n const { closeDropdown } = useDropdownContext()\n const itemClasses = [active && 'active', disabled && 'disabled', className].filter(Boolean).join(' ')\n\n const handleClick = () => {\n if (!disabled) {\n onClick?.()\n closeDropdown()\n }\n }\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if ((event.key === 'Enter' || event.key === ' ') && !disabled) {\n event.preventDefault()\n handleClick()\n }\n }\n\n const content = label || children\n\n return (\n <li className={itemClasses} role=\"none\" data-key={itemKey}>\n <a\n role=\"menuitem\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled || undefined}\n className={danger ? 'text-error' : ''}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {icon && <span className=\"mr-2 inline-flex items-center\">{icon}</span>}\n {content}\n </a>\n </li>\n )\n}\n\nfunction DropdownSubMenu({\n children,\n itemKey,\n title,\n icon,\n disabled = false,\n className = '',\n}: DropdownSubMenuProps) {\n const [isSubOpen, setIsSubOpen] = useState(false)\n const subMenuRef = useRef<HTMLLIElement>(null)\n const summaryRef = useRef<HTMLElement>(null)\n const subMenuListRef = useRef<HTMLUListElement>(null)\n const subMenuId = useId()\n\n const handleMouseEnter = () => {\n if (!disabled) setIsSubOpen(true)\n }\n\n const handleMouseLeave = () => {\n setIsSubOpen(false)\n }\n\n // Focus first item in submenu\n const focusFirstItem = () => {\n setTimeout(() => {\n const firstItem = subMenuListRef.current?.querySelector('[role=\"menuitem\"]:not([aria-disabled=\"true\"])') as HTMLElement\n firstItem?.focus()\n }, 0)\n }\n\n // Keyboard handler for summary (submenu trigger)\n const handleSummaryKeyDown = (event: React.KeyboardEvent) => {\n if (disabled) return\n\n switch (event.key) {\n case 'ArrowRight':\n case 'Enter':\n case ' ':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(true)\n focusFirstItem()\n break\n case 'ArrowLeft':\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(false)\n break\n }\n }\n\n // Keyboard handler for submenu items\n const handleSubMenuKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowLeft':\n case 'Escape':\n event.preventDefault()\n event.stopPropagation()\n setIsSubOpen(false)\n summaryRef.current?.focus()\n break\n case 'ArrowDown':\n event.preventDefault()\n event.stopPropagation()\n const items = subMenuListRef.current?.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n if (items) {\n const currentIndex = Array.from(items).findIndex(item => item === document.activeElement)\n const nextIndex = (currentIndex + 1) % items.length\n ;(items[nextIndex] as HTMLElement)?.focus()\n }\n break\n case 'ArrowUp':\n event.preventDefault()\n event.stopPropagation()\n const itemsUp = subMenuListRef.current?.querySelectorAll('[role=\"menuitem\"]:not([aria-disabled=\"true\"])')\n if (itemsUp) {\n const currentIndexUp = Array.from(itemsUp).findIndex(item => item === document.activeElement)\n const prevIndex = (currentIndexUp - 1 + itemsUp.length) % itemsUp.length\n ;(itemsUp[prevIndex] as HTMLElement)?.focus()\n }\n break\n }\n }\n\n const itemClasses = [disabled && 'disabled', className].filter(Boolean).join(' ')\n\n return (\n <li\n ref={subMenuRef}\n className={itemClasses}\n role=\"none\"\n data-key={itemKey}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <details open={isSubOpen}>\n <summary\n ref={summaryRef}\n role=\"menuitem\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled || undefined}\n aria-haspopup=\"menu\"\n aria-expanded={isSubOpen}\n aria-controls={subMenuId}\n onKeyDown={handleSummaryKeyDown}\n >\n {icon && <span className=\"mr-2 inline-flex items-center\">{icon}</span>}\n {title}\n </summary>\n <ul\n ref={subMenuListRef}\n id={subMenuId}\n className=\"menu bg-base-100 rounded-box z-50 shadow\"\n role=\"menu\"\n aria-label={typeof title === 'string' ? title : undefined}\n onKeyDown={handleSubMenuKeyDown}\n >\n {children}\n </ul>\n </details>\n </li>\n )\n}\n\nfunction DropdownDivider({ className = '' }: DropdownDividerProps) {\n const classes = ['border-base-content/10', className].filter(Boolean).join(' ')\n return (\n <li role=\"separator\" className=\"my-1\">\n <hr className={classes} />\n </li>\n )\n}\n\nexport const Dropdown = Object.assign(DropdownRoot, {\n Trigger: DropdownTrigger,\n Menu: DropdownMenu,\n Item: DropdownItem,\n SubMenu: DropdownSubMenu,\n Divider: DropdownDivider,\n})\n"],"names":["DropdownContext","createContext","useDropdownContext","context","useContext","DropdownRoot","children","items","hover","trigger","position","align","controlledOpen","onOpenChange","disabled","arrow","mouseEnterDelay","mouseLeaveDelay","getPopupContainer","destroyOnHidden","className","rest","menuId","useId","triggerId","internalOpen","setInternalOpen","useState","focusedIndex","setFocusedIndex","itemCount","setItemCount","shouldRender","setShouldRender","itemRefs","useRef","dropdownRef","hoverTimeoutRef","triggers","isControlled","isOpen","setIsOpen","useCallback","open","source","closeDropdown","registerItem","index","ref","itemDisabled","useEffect","timeout","handleClickOutside","event","handleMouseEnter","handleMouseLeave","handleContextMenu","positionClasses","alignClasses","showArrow","dropdownClasses","renderItems","item","DropdownDivider","menuItem","jsx","DropdownSubMenu","child","DropdownItem","content","jsxs","Fragment","React","DropdownTrigger","DropdownMenu","handleKeyDown","handleClick","childProps","e","menuRef","childArray","enabledCount","menuClasses","childrenWithIndex","arrowElement","itemKey","icon","label","onClick","active","danger","itemClasses","title","isSubOpen","setIsSubOpen","subMenuRef","summaryRef","subMenuListRef","subMenuId","focusFirstItem","handleSummaryKeyDown","handleSubMenuKeyDown","nextIndex","itemsUp","prevIndex","classes","Dropdown"],"mappings":";;AAuCA,MAAMA,IAAkBC,GAAgD,MAAS;AAEjF,SAASC,IAAqB;AAC5B,QAAMC,IAAUC,GAAWJ,CAAe;AAC1C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,2DAA2D;AAE7E,SAAOA;AACT;AAyEA,SAASE,GAAa;AAAA,EACpB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU,CAAC,OAAO;AAAA,EAClB,UAAAC,IAAW;AAAA,EACX,OAAAC,IAAQ;AAAA,EACR,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC,IAAQ;AAAA,EACR,iBAAAC,IAAkB;AAAA,EAClB,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAASC,EAAA,GACTC,IAAYD,EAAA,GACZ,CAACE,GAAcC,CAAe,IAAIC,EAAS,EAAK,GAChD,CAACC,GAAcC,CAAe,IAAIF,EAAS,EAAE,GAC7C,CAACG,GAAWC,CAAY,IAAIJ,EAAS,CAAC,GACtC,CAACK,GAAcC,CAAe,IAAIN,EAAS,CAACR,CAAe,GAC3De,IAAWC,EAAoE,oBAAI,KAAK,GACxFC,IAAcD,EAAuB,IAAI,GACzCE,IAAkBF,EAA6C,IAAI,GAGnEG,IAAW9B,IAAQ,CAAC,OAAO,IAAIC,GAG/B8B,IAAe3B,MAAmB,QAClC4B,IAASD,IAAe3B,IAAiBa,GAEzCgB,IAAYC,EAAY,CAACC,GAAeC,IAA6B,cAAc;AACvF,IAAI9B,MACCyB,KACHb,EAAgBiB,CAAI,GAElBA,KACFV,EAAgB,EAAI,GAEtBpB,IAAe8B,GAAM,EAAE,Q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AA,QAAA;AAAA,MACH,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,SAASyD,EAAgB,EAAE,WAAA3C,IAAY,MAA4B;AACjE,QAAMqF,IAAU,CAAC,0BAA0BrF,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAC9E,SACE,gBAAA6C,EAAC,MAAA,EAAG,MAAK,aAAY,WAAU,QAC7B,UAAA,gBAAAA,EAAC,MAAA,EAAG,WAAWwC,EAAA,CAAS,EAAA,CAC1B;AAEJ;AAEO,MAAMC,KAAW,OAAO,OAAOrG,IAAc;AAAA,EAClD,SAASoE;AAAA,EACT,MAAMC;AAAA,EACN,MAAMN;AAAA,EACN,SAASF;AAAA,EACT,SAASH;AACX,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index39.js","sources":["../src/components/Indicator.tsx"],"sourcesContent":["import React from 'react'\n\nexport type IndicatorPosition =\n | 'top-start'\n | 'top-center'\n | 'top-end'\n | 'middle-start'\n | 'middle-center'\n | 'middle-end'\n | 'bottom-start'\n | 'bottom-center'\n | 'bottom-end'\n\nexport interface IndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n position?: IndicatorPosition\n children: React.ReactNode\n}\n\nexport const Indicator: React.FC<IndicatorProps> = ({\n position = 'top-end',\n children,\n className = '',\n ...rest\n}) => {\n // Get position classes for indicator\n const getPositionClasses = (pos: IndicatorPosition) => {\n const [vertical, horizontal] = pos.split('-')\n const classes: string[] = []\n\n switch (vertical) {\n case 'top':\n classes.push('indicator-top')\n break\n case 'middle':\n classes.push('indicator-middle')\n break\n case 'bottom':\n classes.push('indicator-bottom')\n break\n }\n\n switch (horizontal) {\n case 'start':\n classes.push('indicator-start')\n break\n case 'center':\n classes.push('indicator-center')\n break\n case 'end':\n classes.push('indicator-end')\n break\n }\n\n return classes.join(' ')\n }\n\n const childrenArray = React.Children.toArray(children)\n const content = childrenArray[0]\n const indicatorElement = childrenArray[1]\n\n return (\n <div className={`indicator inline-block ${className}`} {...rest}>\n {indicatorElement && (\n <div className={`indicator-item ${getPositionClasses(position)}`}>\n {indicatorElement}\n </div>\n )}\n {content}\n </div>\n )\n}\n"],"names":["Indicator","position","children","className","rest","getPositionClasses","pos","vertical","horizontal","classes","childrenArray","React","content","indicatorElement","jsx"],"mappings":";;AAkBO,MAAMA,IAAsC,CAAC;AAAA,EAClD,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AAEJ,QAAMC,IAAqB,CAACC,MAA2B;AACrD,UAAM,CAACC,GAAUC,CAAU,IAAIF,EAAI,MAAM,GAAG,GACtCG,IAAoB,CAAA;AAE1B,YAAQF,GAAA;AAAA,MACN,KAAK;AACH,QAAAE,EAAQ,KAAK,eAAe;AAC5B;AAAA,MACF,KAAK;AACH,QAAAA,EAAQ,KAAK,kBAAkB;AAC/B;AAAA,MACF,KAAK;AACH,QAAAA,EAAQ,KAAK,kBAAkB;AAC/B;AAAA,IAAA;AAGJ,YAAQD,GAAA;AAAA,MACN,KAAK;AACH,QAAAC,EAAQ,KAAK,iBAAiB;AAC9B;AAAA,MACF,KAAK;AACH,QAAAA,EAAQ,KAAK,kBAAkB;AAC/B;AAAA,MACF,KAAK;AACH,QAAAA,EAAQ,KAAK,eAAe;AAC5B;AAAA,IAAA;AAGJ,WAAOA,EAAQ,KAAK,GAAG;AAAA,EACzB,GAEMC,IAAgBC,EAAM,SAAS,QAAQT,CAAQ,GAC/CU,IAAUF,EAAc,CAAC,GACzBG,IAAmBH,EAAc,CAAC;AAExC,2BACG,OAAA,EAAI,WAAW,0BAA0BP,CAAS,IAAK,GAAGC,GACxD,UAAA;AAAA,IAAAS,KACC,gBAAAC,EAAC,SAAI,WAAW,kBAAkBT,EAAmBJ,CAAQ,CAAC,IAC3D,UAAAY,EAAA,CACH;AAAA,IAEDD;AAAA,EAAA,GACH;AAEJ;"}
|