@box-kite/react 2.2.3 → 2.2.5
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/.claude/rules/box-kite-rules.md +8 -0
- package/.claude/skills/box-kite/SKILL.md +8 -0
- package/.claude/skills/box-kite/references/components.md +49 -3
- package/.cursor/rules/box-kite.mdc +8 -0
- package/AGENTS.md +8 -0
- package/BOX_AI_CONTEXT.md +276 -20
- package/BOX_KITE_AI_CONTEXT.md +276 -20
- package/behavior.cjs +1 -1
- package/behavior.mjs +57 -57
- package/box.cjs +1 -1
- package/box.d.ts +5 -0
- package/box.mjs +17 -17
- package/catalog.cjs +1 -1
- package/catalog.mjs +385 -0
- package/client.cjs +1 -1
- package/client.mjs +113 -87
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid/components/dataGridList.d.ts +12 -0
- package/components/dataGrid/components/dataGridListAggregate.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilter.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilterSheet.d.ts +11 -0
- package/components/dataGrid/components/dataGridListFooter.d.ts +13 -0
- package/components/dataGrid/components/dataGridListGroup.d.ts +13 -0
- package/components/dataGrid/components/dataGridListItem.d.ts +21 -0
- package/components/dataGrid/components/dataGridListLayout.d.ts +20 -0
- package/components/dataGrid/components/dataGridListRecord.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSelectionBar.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSheet.d.ts +30 -0
- package/components/dataGrid/components/dataGridListSortSheet.d.ts +10 -0
- package/components/dataGrid/components/dataGridListToolbar.d.ts +10 -0
- package/components/dataGrid/components/dataGridListValue.d.ts +12 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +32 -0
- package/components/dataGrid/models/gridModel.d.ts +3 -0
- package/components/dataGrid/models/listModel.d.ts +129 -0
- package/components/dataGrid/models/localeText.d.ts +32 -0
- package/components/dataGrid/models/viewportModel.d.ts +0 -2
- package/components/dataGrid/useListLayout.d.ts +13 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +1052 -788
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +85 -97
- package/components/list/listItemParts.d.ts +9 -0
- package/components/list.cjs +1 -0
- package/components/list.d.ts +118 -0
- package/components/list.mjs +391 -0
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +25 -25
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +12 -12
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +1 -1
- package/components/sortableList.cjs +1 -0
- package/components/sortableList.d.ts +49 -0
- package/components/sortableList.mjs +384 -0
- package/components/swipeItem.cjs +1 -0
- package/components/swipeItem.d.ts +52 -0
- package/components/swipeItem.mjs +321 -0
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +24 -24
- package/components/virtualList.cjs +1 -0
- package/components/virtualList.d.ts +32 -0
- package/components/virtualList.mjs +188 -0
- package/dataGridList.cjs +1 -0
- package/dataGridList.mjs +1351 -0
- package/docs/components.md +5 -1
- package/icons/closeIcon.d.ts +2 -0
- package/icons/filterIcon.d.ts +2 -0
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/mcp/src/data.d.ts +2 -0
- package/package.json +86 -22
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +4 -1
- package/react/a11y/useControllableState.d.ts +2 -1
- package/react/componentsContext.d.ts +4 -0
- package/react/componentsProvider.d.ts +10 -0
- package/react/resolveStyles.d.ts +2 -1
- package/react/theme/theme.d.ts +6 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +40 -29
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +3 -1
- package/registry/designs/store/address-form.d.ts +11 -0
- package/registry/designs/store/cart-items.d.ts +10 -0
- package/registry/designs/store/cart-page.d.ts +4 -0
- package/registry/designs/store/checkout-page.d.ts +7 -0
- package/registry/designs/store/credit-card-form.d.ts +10 -0
- package/registry/designs/store/form-field.d.ts +19 -0
- package/registry/designs/store/order-summary.d.ts +18 -0
- package/registry/designs/store/product-art.d.ts +26 -0
- package/registry/designs/store/product-card.d.ts +11 -0
- package/registry/designs/store/product-gallery.d.ts +11 -0
- package/registry/designs/store/product-grid.d.ts +10 -0
- package/registry/designs/store/product-page.d.ts +5 -0
- package/registry/designs/store/quantity-stepper.d.ts +13 -0
- package/registry/designs/store/shipping-method.d.ts +14 -0
- package/registry/designs/store/store-data.d.ts +53 -0
- package/registry/designs/store/store-design.d.ts +63 -0
- package/registry/designs/store/store-shell.d.ts +12 -0
- package/registry/designs/store/storefront-page.d.ts +4 -0
- package/registry/designs/store/variant-picker.d.ts +15 -0
- package/rsc.cjs +1 -1
- package/rsc.d.ts +2 -0
- package/rsc.mjs +1 -1
- package/scrolling.cjs +1 -0
- package/scrolling.mjs +22 -0
- package/ssg.cjs +1 -1
- package/ssg.mjs +1 -1
- package/utils/scroll/scrollUtils.d.ts +6 -0
- package/utils/sortable/sortableUtils.d.ts +25 -0
- package/utils/swipe/swipeUtils.d.ts +53 -0
- package/utils/virtual/measuredWindow.d.ts +28 -0
- package/utils/virtual/rowSearch.d.ts +11 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { f as e } from "../react-shared.mjs";
|
|
2
|
+
import { Path as t, Svg as n } from "./svg.mjs";
|
|
3
|
+
import { classNames as r, mergeDeep as i } from "@box-kite/core";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { useBoxElement as c } from "@box-kite/react";
|
|
6
|
+
//#region src/components/list/listItemParts.ts
|
|
7
|
+
var l = {
|
|
8
|
+
position: "relative",
|
|
9
|
+
css: { borderRadius: "var(--list-item-radius, 0)" },
|
|
10
|
+
before: {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
top: 0,
|
|
13
|
+
insetEnd: 0,
|
|
14
|
+
css: {
|
|
15
|
+
insetInlineStart: "var(--list-divider-inset, 0px)",
|
|
16
|
+
height: "1px"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
after: {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
inset: 0,
|
|
22
|
+
pointerEvents: "none",
|
|
23
|
+
css: {
|
|
24
|
+
border: "var(--list-item-frame, none)",
|
|
25
|
+
borderRadius: "inherit"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
nth: { first: { before: { css: { display: "var(--list-first-divider, none)" } } } }
|
|
29
|
+
}, u = {
|
|
30
|
+
display: "flex",
|
|
31
|
+
ai: "center",
|
|
32
|
+
gap: 3,
|
|
33
|
+
px: 4,
|
|
34
|
+
py: 3,
|
|
35
|
+
minHeight: 14
|
|
36
|
+
}, d = {
|
|
37
|
+
sm: {
|
|
38
|
+
gap: 2,
|
|
39
|
+
py: 2,
|
|
40
|
+
minHeight: 11
|
|
41
|
+
},
|
|
42
|
+
md: {},
|
|
43
|
+
lg: {
|
|
44
|
+
gap: 4,
|
|
45
|
+
py: 4,
|
|
46
|
+
minHeight: 18
|
|
47
|
+
}
|
|
48
|
+
}, f = [
|
|
49
|
+
"css",
|
|
50
|
+
"before",
|
|
51
|
+
"after",
|
|
52
|
+
"nth"
|
|
53
|
+
];
|
|
54
|
+
function p(e, t) {
|
|
55
|
+
let n = {
|
|
56
|
+
...e,
|
|
57
|
+
...t
|
|
58
|
+
}, r = e;
|
|
59
|
+
for (let e of f) {
|
|
60
|
+
let a = t[e];
|
|
61
|
+
r[e] && a && (n[e] = i(r[e], a));
|
|
62
|
+
}
|
|
63
|
+
return n;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/list.tsx
|
|
67
|
+
var m = [
|
|
68
|
+
"h1",
|
|
69
|
+
"h2",
|
|
70
|
+
"h3",
|
|
71
|
+
"h4",
|
|
72
|
+
"h5",
|
|
73
|
+
"h6"
|
|
74
|
+
], h = { fontVariantNumeric: "tabular-nums" }, g = {
|
|
75
|
+
display: "flex",
|
|
76
|
+
ai: "center",
|
|
77
|
+
jc: "center",
|
|
78
|
+
flexShrink: 0
|
|
79
|
+
}, _ = {
|
|
80
|
+
icon: {
|
|
81
|
+
width: 10,
|
|
82
|
+
height: 10,
|
|
83
|
+
borderRadius: 2
|
|
84
|
+
},
|
|
85
|
+
avatar: {
|
|
86
|
+
width: 10,
|
|
87
|
+
height: 10,
|
|
88
|
+
borderRadius: 999,
|
|
89
|
+
overflow: "hidden",
|
|
90
|
+
fontSize: 14,
|
|
91
|
+
fontWeight: 600
|
|
92
|
+
},
|
|
93
|
+
image: {
|
|
94
|
+
width: 16,
|
|
95
|
+
height: 16,
|
|
96
|
+
borderRadius: 2,
|
|
97
|
+
overflow: "hidden"
|
|
98
|
+
}
|
|
99
|
+
}, v = {
|
|
100
|
+
display: "flex",
|
|
101
|
+
ai: "baseline",
|
|
102
|
+
jc: "space-between",
|
|
103
|
+
gap: 2,
|
|
104
|
+
minWidth: 0
|
|
105
|
+
}, y = {
|
|
106
|
+
flexWrap: "wrap",
|
|
107
|
+
jc: "start",
|
|
108
|
+
rowGap: 1
|
|
109
|
+
}, b = {
|
|
110
|
+
fontSize: 14,
|
|
111
|
+
lineHeight: 20
|
|
112
|
+
}, x = {
|
|
113
|
+
"list.title": {
|
|
114
|
+
display: "block",
|
|
115
|
+
minWidth: 0,
|
|
116
|
+
fontSize: 16,
|
|
117
|
+
lineHeight: 22,
|
|
118
|
+
fontWeight: 500
|
|
119
|
+
},
|
|
120
|
+
"list.description": {
|
|
121
|
+
display: "block",
|
|
122
|
+
minWidth: 0,
|
|
123
|
+
fontSize: 14,
|
|
124
|
+
lineHeight: 20
|
|
125
|
+
},
|
|
126
|
+
"list.overline": {
|
|
127
|
+
display: "block",
|
|
128
|
+
minWidth: 0,
|
|
129
|
+
fontSize: 12,
|
|
130
|
+
lineHeight: 16,
|
|
131
|
+
fontWeight: 500
|
|
132
|
+
}
|
|
133
|
+
}, S = {
|
|
134
|
+
color: "currentColor",
|
|
135
|
+
textDecoration: "none",
|
|
136
|
+
cursor: "pointer",
|
|
137
|
+
css: {
|
|
138
|
+
display: "inherit",
|
|
139
|
+
font: "inherit",
|
|
140
|
+
textAlign: "inherit",
|
|
141
|
+
overflow: "inherit",
|
|
142
|
+
textOverflow: "inherit",
|
|
143
|
+
WebkitLineClamp: "inherit",
|
|
144
|
+
WebkitBoxOrient: "inherit"
|
|
145
|
+
},
|
|
146
|
+
after: {
|
|
147
|
+
position: "absolute",
|
|
148
|
+
inset: 0,
|
|
149
|
+
css: { borderRadius: "var(--list-item-radius, 0)" }
|
|
150
|
+
}
|
|
151
|
+
}, C = {
|
|
152
|
+
1: {
|
|
153
|
+
overflow: "hidden",
|
|
154
|
+
textOverflow: "ellipsis",
|
|
155
|
+
whiteSpace: "nowrap"
|
|
156
|
+
},
|
|
157
|
+
2: {
|
|
158
|
+
overflow: "hidden",
|
|
159
|
+
css: {
|
|
160
|
+
display: "-webkit-box",
|
|
161
|
+
WebkitBoxOrient: "vertical",
|
|
162
|
+
WebkitLineClamp: 2
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
3: {
|
|
166
|
+
overflow: "hidden",
|
|
167
|
+
css: {
|
|
168
|
+
display: "-webkit-box",
|
|
169
|
+
WebkitBoxOrient: "vertical",
|
|
170
|
+
WebkitLineClamp: 3
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}, w = {
|
|
174
|
+
content: {
|
|
175
|
+
display: "flex",
|
|
176
|
+
d: "column",
|
|
177
|
+
gap: .5,
|
|
178
|
+
flex1: !0,
|
|
179
|
+
minWidth: 0
|
|
180
|
+
},
|
|
181
|
+
meta: {
|
|
182
|
+
flexShrink: 0,
|
|
183
|
+
fontSize: 13,
|
|
184
|
+
lineHeight: 18,
|
|
185
|
+
whiteSpace: "nowrap",
|
|
186
|
+
css: h
|
|
187
|
+
},
|
|
188
|
+
end: {
|
|
189
|
+
display: "flex",
|
|
190
|
+
d: "column",
|
|
191
|
+
ai: "end",
|
|
192
|
+
gap: .5,
|
|
193
|
+
flexShrink: 0,
|
|
194
|
+
maxWidth: "1/2",
|
|
195
|
+
textAlign: "end",
|
|
196
|
+
css: h
|
|
197
|
+
},
|
|
198
|
+
actions: {
|
|
199
|
+
display: "flex",
|
|
200
|
+
ai: "center",
|
|
201
|
+
gap: 1,
|
|
202
|
+
flexShrink: 0,
|
|
203
|
+
position: "relative",
|
|
204
|
+
zIndex: 1
|
|
205
|
+
},
|
|
206
|
+
fields: {
|
|
207
|
+
display: "grid",
|
|
208
|
+
columnGap: 4,
|
|
209
|
+
rowGap: 2,
|
|
210
|
+
mt: 1,
|
|
211
|
+
css: { gridTemplateColumns: "repeat(auto-fill, minmax(min(8rem, 100%), 1fr))" }
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
function T(e, t) {
|
|
215
|
+
let { props: n, ...r } = e;
|
|
216
|
+
return c({
|
|
217
|
+
tag: "ul",
|
|
218
|
+
component: "list",
|
|
219
|
+
...r,
|
|
220
|
+
props: {
|
|
221
|
+
role: "list",
|
|
222
|
+
...n
|
|
223
|
+
}
|
|
224
|
+
}, t);
|
|
225
|
+
}
|
|
226
|
+
function E(e, t) {
|
|
227
|
+
let { size: n = "md", wrap: r = !1, selected: i = !1, chevron: f = !1, variant: m, children: h, ...g } = e;
|
|
228
|
+
return c({
|
|
229
|
+
tag: "li",
|
|
230
|
+
component: "list.item",
|
|
231
|
+
...p({
|
|
232
|
+
...l,
|
|
233
|
+
...u,
|
|
234
|
+
...d[n],
|
|
235
|
+
...r ? { flexWrap: "wrap" } : {}
|
|
236
|
+
}, g),
|
|
237
|
+
variant: [m, { selected: i }],
|
|
238
|
+
children: f ? /* @__PURE__ */ s(a, { children: [h, /* @__PURE__ */ o(O, {})] }) : h
|
|
239
|
+
}, t);
|
|
240
|
+
}
|
|
241
|
+
function D(e, r) {
|
|
242
|
+
return c({
|
|
243
|
+
tag: "span",
|
|
244
|
+
component: "list.muted",
|
|
245
|
+
display: "flex",
|
|
246
|
+
flexShrink: 0,
|
|
247
|
+
alignSelf: "center",
|
|
248
|
+
rtl: { flip: "xAxis" },
|
|
249
|
+
...e,
|
|
250
|
+
props: {
|
|
251
|
+
"aria-hidden": !0,
|
|
252
|
+
...e.props
|
|
253
|
+
},
|
|
254
|
+
children: /* @__PURE__ */ o(n, {
|
|
255
|
+
viewBox: "0 0 16 16",
|
|
256
|
+
width: "1rem",
|
|
257
|
+
fill: "none",
|
|
258
|
+
stroke: "currentColor",
|
|
259
|
+
strokeWidth: 1.75,
|
|
260
|
+
children: /* @__PURE__ */ o(t, {
|
|
261
|
+
d: "M6 3.5 10.5 8 6 12.5",
|
|
262
|
+
strokeLinecap: "round",
|
|
263
|
+
strokeLinejoin: "round"
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
}, r);
|
|
267
|
+
}
|
|
268
|
+
var O = e(D, "List.Chevron");
|
|
269
|
+
function k(e, t) {
|
|
270
|
+
let n = r(e.variant).find((e) => e in _);
|
|
271
|
+
return c({
|
|
272
|
+
component: "list.media",
|
|
273
|
+
...g,
|
|
274
|
+
...n ? _[n] : {},
|
|
275
|
+
...e
|
|
276
|
+
}, t);
|
|
277
|
+
}
|
|
278
|
+
function A(e, t) {
|
|
279
|
+
let { wrap: n = !1, secondary: r = !1, ...i } = e;
|
|
280
|
+
return c({
|
|
281
|
+
...r ? {
|
|
282
|
+
component: "list.muted",
|
|
283
|
+
...b
|
|
284
|
+
} : {},
|
|
285
|
+
...v,
|
|
286
|
+
...n ? y : {},
|
|
287
|
+
...i
|
|
288
|
+
}, t);
|
|
289
|
+
}
|
|
290
|
+
function j(t, n) {
|
|
291
|
+
let r = t !== "list.title";
|
|
292
|
+
return e((e, n) => {
|
|
293
|
+
let { lines: i, ...a } = e, o = i ? p(x[t], C[i]) : x[t];
|
|
294
|
+
return c({
|
|
295
|
+
tag: "span",
|
|
296
|
+
...r ? { component: "list.muted" } : {},
|
|
297
|
+
...p(o, a)
|
|
298
|
+
}, n);
|
|
299
|
+
}, n);
|
|
300
|
+
}
|
|
301
|
+
function M(e, t) {
|
|
302
|
+
let { props: n, tag: r, onClick: i, ...a } = e, o = r ?? (n?.href === void 0 ? n?.htmlFor === void 0 ? "button" : "label" : "a");
|
|
303
|
+
return c({
|
|
304
|
+
tag: o,
|
|
305
|
+
component: "list.action",
|
|
306
|
+
...p(S, a),
|
|
307
|
+
props: {
|
|
308
|
+
...o === "button" ? { type: "button" } : {},
|
|
309
|
+
"data-list-action": "",
|
|
310
|
+
...n,
|
|
311
|
+
...i ? { onClick: i } : {}
|
|
312
|
+
}
|
|
313
|
+
}, t);
|
|
314
|
+
}
|
|
315
|
+
function N(e, t) {
|
|
316
|
+
let { label: n, children: r, ...i } = e;
|
|
317
|
+
return c({
|
|
318
|
+
minWidth: 0,
|
|
319
|
+
...i,
|
|
320
|
+
children: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(P, { children: n }), /* @__PURE__ */ o(F, { children: r })] })
|
|
321
|
+
}, t);
|
|
322
|
+
}
|
|
323
|
+
function P({ children: e }) {
|
|
324
|
+
return c({
|
|
325
|
+
tag: "dt",
|
|
326
|
+
component: "list.muted",
|
|
327
|
+
fontSize: 12,
|
|
328
|
+
lineHeight: 16,
|
|
329
|
+
children: e
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function F({ children: e }) {
|
|
333
|
+
return c({
|
|
334
|
+
tag: "dd",
|
|
335
|
+
minWidth: 0,
|
|
336
|
+
fontSize: 14,
|
|
337
|
+
lineHeight: 20,
|
|
338
|
+
css: {
|
|
339
|
+
overflowWrap: "anywhere",
|
|
340
|
+
...h
|
|
341
|
+
},
|
|
342
|
+
children: e
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function I(e, t) {
|
|
346
|
+
let { label: n, level: r, sticky: i = !1, children: l, ...u } = e;
|
|
347
|
+
return c({
|
|
348
|
+
tag: "li",
|
|
349
|
+
...u,
|
|
350
|
+
children: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(L, {
|
|
351
|
+
level: r,
|
|
352
|
+
sticky: i,
|
|
353
|
+
children: n
|
|
354
|
+
}), /* @__PURE__ */ o(R, { children: l })] })
|
|
355
|
+
}, t);
|
|
356
|
+
}
|
|
357
|
+
function L({ level: e, sticky: t, children: n }) {
|
|
358
|
+
return c({
|
|
359
|
+
tag: e ? m[e - 1] : "div",
|
|
360
|
+
component: "list.label",
|
|
361
|
+
px: 4,
|
|
362
|
+
py: 1.5,
|
|
363
|
+
fontSize: 13,
|
|
364
|
+
lineHeight: 18,
|
|
365
|
+
fontWeight: 600,
|
|
366
|
+
...t ? {
|
|
367
|
+
position: "sticky",
|
|
368
|
+
zIndex: 2,
|
|
369
|
+
css: { top: "var(--list-sticky-top, 0)" }
|
|
370
|
+
} : {},
|
|
371
|
+
children: n
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function R({ children: e }) {
|
|
375
|
+
return c({
|
|
376
|
+
tag: "ul",
|
|
377
|
+
props: { role: "list" },
|
|
378
|
+
children: e
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
function z(t, n, r, i = !1) {
|
|
382
|
+
return e((e, r) => c({
|
|
383
|
+
tag: t,
|
|
384
|
+
...i ? { component: "list.muted" } : {},
|
|
385
|
+
...p(n, e)
|
|
386
|
+
}, r), r);
|
|
387
|
+
}
|
|
388
|
+
var B = e(k, "List.Media"), V = z("div", w.content, "List.Content"), H = j("list.overline", "List.Overline"), U = j("list.title", "List.Title"), W = j("list.description", "List.Description"), G = z("span", w.meta, "List.Meta", !0), K = z("div", w.end, "List.End"), q = z("div", w.actions, "List.Actions"), J = z("dl", w.fields, "List.Fields"), Y = e(T, "List");
|
|
389
|
+
Y.Item = e(E, "List.Item"), Y.Media = B, Y.Content = V, Y.Row = e(A, "List.Row"), Y.Overline = H, Y.Title = U, Y.Description = W, Y.Meta = G, Y.End = K, Y.Actions = q, Y.Action = e(M, "List.Action"), Y.Fields = J, Y.Field = e(N, "List.Field"), Y.Group = e(I, "List.Group"), Y.Chevron = O;
|
|
390
|
+
//#endregion
|
|
391
|
+
export { Y as default, p as i, u as n, d as r, l as t };
|
package/components/menu.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../effects.cjs"),n=require("../box.cjs"),r=require("../behavior.cjs"),i=require("../identity.cjs"),a=require("../keyboard.cjs"),o=require("../placement.cjs"),s=require("../layer.cjs"),c=require("./overlay.cjs");let l=require("react"),u=require("react/jsx-runtime");var d;(function(e){let t=e.ITEM_SELECTOR=`[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]`;function n(e,t){return t instanceof Element&&t.closest(`[role="menu"]`)===e}e.owns=n;function r(e){return[...e.querySelectorAll(t)].filter(t=>n(e,t))}e.items=r;function i(e){return e.getAttribute(`aria-disabled`)===`true`}e.isDisabled=i;function o(e){return e.getAttribute(`aria-haspopup`)===`menu`}e.isSubTrigger=o;function s(e,t,n){if(e.length!==0)return e[t<0?n>0?0:e.length-1:((t+n)%e.length+e.length)%e.length]}e.step=s;function c(e,t,n){let r=a.t.target(t,n,e.length,t=>e[t].textContent??``);return r<0?void 0:e[r]}e.typeaheadTarget=c})(d||={});var f=d,p=(0,l.createContext)(null);function m(e){let t=(0,l.useContext)(p);if(!t)throw Error(`<${e}> must be rendered inside a <Menu>.`);return t}function h(e){let[t,n]=(0,l.useState)([]);return{panels:t,registerLayer:(0,l.useCallback)(t=>{n(e=>[...e,t]);let r=e?.(t);return()=>{n(e=>e.filter(e=>e!==t)),r?.()}},[e])}}var g=(0,l.createContext)(null);function _(e){let{trigger:t,children:n,open:i,defaultOpen:a=!1,onOpenChange:o,label:c,labelledBy:d,side:m=`bottom`,align:g=`start`,offset:_=1,flip:y=!0,matchWidth:b=!1,props:x,...S}=e,C=(0,l.useRef)(`first`),w=r.a(e=>{let t=f.items(e),n=C.current===`last`?t[t.length-1]:t[0];C.current=`first`,(n??e).focus()}),{panels:T,registerLayer:E}=h(),D=s.t({haspopup:`menu`,idPrefix:`menu`,id:S.id,open:i,defaultOpen:a,onOpenChange:o,onOpened:w,inside:T}),O=r.a(e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),C.current=e.key===`ArrowUp`?`last`:`first`,D.isOpen&&D.panelElement?w(D.panelElement):D.setOpen(!0,{reason:`trigger`,event:e}))}),k=(0,l.useMemo)(()=>({ref:D.trigger.ref,props:{...D.trigger.props,onKeyDown:O}}),[O,D.trigger]),A=r.a(e=>D.setOpen(!1,e)),j=(0,l.useMemo)(()=>({open:D.isOpen,closeAll:A,registerLayer:E}),[A,D.isOpen,E]);return(0,u.jsxs)(u.Fragment,{children:[t(k),(0,u.jsx)(p.Provider,{value:j,children:(0,u.jsx)(v,{layer:D,side:m,align:g,offset:_,flip:y,matchWidth:b,label:c,labelledBy:d??(c?void 0:D.triggerId),contentProps:x,...S,children:n})})]})}function v(t){let{layer:i,side:s,align:d,offset:p,flip:h,matchWidth:g,label:_,labelledBy:v,contentProps:y,closeSelf:b,children:x,...S}=t,{platform:C,isOpen:w,id:T,triggerElement:E,setPanel:D}=i,O=m(`Menu`),k=(0,l.useRef)({query:``,at:0}),A=o.t({side:s,align:d,offset:p,flip:h,matchWidth:g,anchor:E}),j={role:`menu`,"aria-label":_,"aria-labelledby":v,tabIndex:-1,onKeyDown:r.a(t=>{let n=t.currentTarget;if(!f.owns(n,t.target))return;let r=f.items(n),i=r.indexOf(document.activeElement),o=e=>{e&&(t.preventDefault(),e.focus())},s=e.
|
|
1
|
+
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../effects.cjs"),n=require("../box.cjs"),r=require("../behavior.cjs"),i=require("../identity.cjs"),a=require("../keyboard.cjs"),o=require("../placement.cjs"),s=require("../layer.cjs"),c=require("./overlay.cjs");let l=require("react"),u=require("react/jsx-runtime");var d;(function(e){let t=e.ITEM_SELECTOR=`[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]`;function n(e,t){return t instanceof Element&&t.closest(`[role="menu"]`)===e}e.owns=n;function r(e){return[...e.querySelectorAll(t)].filter(t=>n(e,t))}e.items=r;function i(e){return e.getAttribute(`aria-disabled`)===`true`}e.isDisabled=i;function o(e){return e.getAttribute(`aria-haspopup`)===`menu`}e.isSubTrigger=o;function s(e,t,n){if(e.length!==0)return e[t<0?n>0?0:e.length-1:((t+n)%e.length+e.length)%e.length]}e.step=s;function c(e,t,n){let r=a.t.target(t,n,e.length,t=>e[t].textContent??``);return r<0?void 0:e[r]}e.typeaheadTarget=c})(d||={});var f=d,p=(0,l.createContext)(null);function m(e){let t=(0,l.useContext)(p);if(!t)throw Error(`<${e}> must be rendered inside a <Menu>.`);return t}function h(e){let[t,n]=(0,l.useState)([]);return{panels:t,registerLayer:(0,l.useCallback)(t=>{n(e=>[...e,t]);let r=e?.(t);return()=>{n(e=>e.filter(e=>e!==t)),r?.()}},[e])}}var g=(0,l.createContext)(null);function _(e){let{trigger:t,children:n,open:i,defaultOpen:a=!1,onOpenChange:o,label:c,labelledBy:d,side:m=`bottom`,align:g=`start`,offset:_=1,flip:y=!0,matchWidth:b=!1,props:x,...S}=e,C=(0,l.useRef)(`first`),w=r.a(e=>{let t=f.items(e),n=C.current===`last`?t[t.length-1]:t[0];C.current=`first`,(n??e).focus()}),{panels:T,registerLayer:E}=h(),D=s.t({haspopup:`menu`,idPrefix:`menu`,id:S.id,open:i,defaultOpen:a,onOpenChange:o,onOpened:w,inside:T}),O=r.a(e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),C.current=e.key===`ArrowUp`?`last`:`first`,D.isOpen&&D.panelElement?w(D.panelElement):D.setOpen(!0,{reason:`trigger`,event:e}))}),k=(0,l.useMemo)(()=>({ref:D.trigger.ref,props:{...D.trigger.props,onKeyDown:O}}),[O,D.trigger]),A=r.a(e=>D.setOpen(!1,e)),j=(0,l.useMemo)(()=>({open:D.isOpen,closeAll:A,registerLayer:E}),[A,D.isOpen,E]);return(0,u.jsxs)(u.Fragment,{children:[t(k),(0,u.jsx)(p.Provider,{value:j,children:(0,u.jsx)(v,{layer:D,side:m,align:g,offset:_,flip:y,matchWidth:b,label:c,labelledBy:d??(c?void 0:D.triggerId),contentProps:x,...S,children:n})})]})}function v(t){let{layer:i,side:s,align:d,offset:p,flip:h,matchWidth:g,label:_,labelledBy:v,contentProps:y,closeSelf:b,children:x,...S}=t,{platform:C,isOpen:w,id:T,triggerElement:E,setPanel:D}=i,O=m(`Menu`),k=(0,l.useRef)({query:``,at:0}),A=o.t({side:s,align:d,offset:p,flip:h,matchWidth:g,anchor:E}),j={role:`menu`,"aria-label":_,"aria-labelledby":v,tabIndex:-1,onKeyDown:r.a(t=>{let n=t.currentTarget;if(!f.owns(n,t.target))return;let r=f.items(n),i=r.indexOf(document.activeElement),o=e=>{e&&(t.preventDefault(),e.focus())},s=e.d(n)?`ArrowRight`:`ArrowLeft`;switch(t.key){case`ArrowDown`:return o(f.step(r,i,1));case`ArrowUp`:return o(f.step(r,i,-1));case`Home`:return o(r[0]);case`End`:return o(r[r.length-1]);case`Tab`:return O.closeAll({reason:`tab`,event:t});case s:return b?(t.preventDefault(),b({reason:`trigger`,event:t})):void 0}if(a.t.isPrintable(t)){let e=a.t.push(k.current,t.key,t.timeStamp);o(f.typeaheadTarget(r,e,i))}}),onPointerOver:r.a(e=>{let t=e.currentTarget,n=e.target?.closest(f.ITEM_SELECTOR);!n||!f.owns(t,n)||n===document.activeElement||n.focus()}),...y};return C?(0,u.jsx)(n.default,{ref:D,component:`menu`,...S,variant:[S.variant,{topLayer:!0}],...A.layerProps,id:T,props:{popover:`auto`,...j},children:x}):w?(0,u.jsx)(c.default,{contentRef:D,anchor:E,side:s,align:d,offset:p,flip:h,matchWidth:g,component:`menu`,...S,id:T,props:j,children:x}):null}function y(a){let{label:o,children:c,disabled:d,side:g=`end`,align:_=`start`,offset:y=0,flip:b=!0,itemProps:x,props:S,...C}=a,w=m(`Menu.Sub`),T=i.t(`menu-sub`),E=r.a(e=>{(f.items(e)[0]??e).focus()}),D=r.a((e,t)=>{e&&t?.focus()}),{panels:O,registerLayer:k}=h(w.registerLayer),A=s.t({haspopup:`menu`,idPrefix:`menu-sub`,id:C.id,onOpened:E,onClosing:D,inside:O});t.n(()=>{if(!(!A.isOpen||!A.panelElement))return w.registerLayer(A.panelElement)},[A.isOpen,A.panelElement,w.registerLayer]),t.n(()=>{w.open||A.setOpen(!1,{reason:`imperative`})},[w.open,A.setOpen]),t.n(()=>{if(!A.isOpen)return;let t=new AbortController;return document.addEventListener(`focusin`,t=>{e.u(t,[A.panelElement,A.triggerElement])||A.setOpen(!1,{reason:`imperative`,event:t})},{signal:t.signal}),()=>t.abort()},[A.isOpen,A.panelElement,A.triggerElement,A.setOpen]);let j=r.a(t=>{let n=e.d(t.currentTarget)?`ArrowLeft`:`ArrowRight`;d||t.key!==n||(t.preventDefault(),A.setOpen(!0,{reason:`trigger`,event:t}))}),M=r.a(e=>{d||A.setOpen(!0,{reason:`trigger`,event:e})}),N=(0,l.useMemo)(()=>({open:A.isOpen,closeAll:w.closeAll,registerLayer:k}),[A.isOpen,w.closeAll,k]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(n.default,{tag:`button`,ref:d?void 0:A.trigger.ref,component:`menu.item`,variant:{sub:!0},id:T,props:{type:`button`,role:`menuitem`,tabIndex:-1,"aria-disabled":d||void 0,...A.trigger.props,...x,onKeyDown:j,onPointerEnter:M},children:[o,(0,u.jsx)(n.default,{component:`menu.arrow`})]}),!d&&(0,u.jsx)(p.Provider,{value:N,children:(0,u.jsx)(v,{layer:A,side:g,align:_,offset:y,flip:b,matchWidth:!1,labelledBy:T,contentProps:S,closeSelf:e=>A.setOpen(!1,e),...C,children:c})})]})}function b(e){let{onSelect:t,disabled:i,closeOnSelect:a=!0,props:o,children:s,...c}=e,l=m(`Menu.Item`),d=r.a(e=>{i||(t?.(e),a&&l.closeAll({reason:`select`,event:e}))});return(0,u.jsx)(n.default,{tag:`button`,component:`menu.item`,...c,props:{type:`button`,role:`menuitem`,tabIndex:-1,"aria-disabled":i||void 0,...o,onClick:d},children:s})}function x(e){let{checked:t,defaultChecked:i=!1,onCheckedChange:a,disabled:o,closeOnSelect:s=!1,props:c,children:l,...d}=e,f=m(`Menu.CheckboxItem`),[p,h]=r.i({value:t,defaultValue:i,onChange:a}),g=r.a(e=>{o||(h(!p,{reason:`select`,event:e}),s&&f.closeAll({reason:`select`,event:e}))});return(0,u.jsxs)(n.default,{tag:`button`,component:`menu.item`,...d,props:{type:`button`,role:`menuitemcheckbox`,tabIndex:-1,"aria-checked":p,"aria-disabled":o||void 0,...c,onClick:g},children:[(0,u.jsx)(n.default,{component:`menu.indicator`,children:p&&(0,u.jsx)(n.default,{component:`menu.check`})}),l]})}function S(e){let{label:t,value:n,defaultValue:i=``,onValueChange:a,children:o,...s}=e,[c,d]=r.i({value:n,defaultValue:i,onChange:a}),f=r.a((e,t)=>d(e,{reason:`select`,event:t})),p=(0,l.useMemo)(()=>({value:c,select:f}),[c,f]);return(0,u.jsx)(g.Provider,{value:p,children:(0,u.jsx)(w,{label:t,...s,children:o})})}function C(e){let{value:t,disabled:i,closeOnSelect:a=!1,props:o,children:s,...c}=e,d=m(`Menu.RadioItem`),f=(0,l.useContext)(g);if(!f)throw Error(`<Menu.RadioItem> must be rendered inside a <Menu.RadioGroup>.`);let p=f.value===t,h=r.a(e=>{i||(f.select(t,e),a&&d.closeAll({reason:`select`,event:e}))});return(0,u.jsxs)(n.default,{tag:`button`,component:`menu.item`,...c,props:{type:`button`,role:`menuitemradio`,tabIndex:-1,"aria-checked":p,"aria-disabled":i||void 0,...o,onClick:h},children:[(0,u.jsx)(n.default,{component:`menu.indicator`,children:p&&(0,u.jsx)(n.default,{component:`menu.dot`})}),s]})}function w(e){let{label:t,props:r,children:a,...o}=e,s=i.t(`menu-group`);return(0,u.jsxs)(n.default,{component:`menu.group`,...o,props:{role:`group`,"aria-labelledby":t?s:void 0,...r},children:[t&&(0,u.jsx)(n.default,{component:`menu.label`,id:s,props:{role:`presentation`},children:t}),a]})}function T(e){let{props:t,...r}=e;return(0,u.jsx)(n.default,{component:`menu.separator`,...r,props:{role:`separator`,...t}})}b.displayName=`Menu.Item`,x.displayName=`Menu.CheckboxItem`,S.displayName=`Menu.RadioGroup`,C.displayName=`Menu.RadioItem`,w.displayName=`Menu.Group`,T.displayName=`Menu.Separator`,y.displayName=`Menu.Sub`;var E=Object.assign(_,{Item:b,CheckboxItem:x,RadioGroup:S,RadioItem:C,Group:w,Separator:T,Sub:y});_.displayName=`Menu`,exports.default=E;
|
package/components/menu.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { d as e, u as t } from "../platform.mjs";
|
|
3
3
|
import { n } from "../effects.mjs";
|
|
4
4
|
import r from "../box.mjs";
|
|
5
5
|
import { a as i, i as a } from "../behavior.mjs";
|
|
@@ -110,8 +110,8 @@ function E(e) {
|
|
|
110
110
|
})
|
|
111
111
|
})] });
|
|
112
112
|
}
|
|
113
|
-
function D(
|
|
114
|
-
let { layer: n, side: a, align: o, offset: l, flip: d, matchWidth: f, label: p, labelledBy: m, contentProps: g, closeSelf: _, children: y, ...b } =
|
|
113
|
+
function D(t) {
|
|
114
|
+
let { layer: n, side: a, align: o, offset: l, flip: d, matchWidth: f, label: p, labelledBy: m, contentProps: g, closeSelf: _, children: y, ...b } = t, { platform: S, isOpen: w, id: T, triggerElement: E, setPanel: D } = n, O = C("Menu"), k = h({
|
|
115
115
|
query: "",
|
|
116
116
|
at: 0
|
|
117
117
|
}), A = c({
|
|
@@ -126,29 +126,29 @@ function D(e) {
|
|
|
126
126
|
"aria-label": p,
|
|
127
127
|
"aria-labelledby": m,
|
|
128
128
|
tabIndex: -1,
|
|
129
|
-
onKeyDown: i((
|
|
130
|
-
let n =
|
|
131
|
-
if (!x.owns(n,
|
|
132
|
-
let r = x.items(n), i = r.indexOf(document.activeElement), a = (
|
|
133
|
-
|
|
134
|
-
}, o =
|
|
135
|
-
switch (
|
|
129
|
+
onKeyDown: i((t) => {
|
|
130
|
+
let n = t.currentTarget;
|
|
131
|
+
if (!x.owns(n, t.target)) return;
|
|
132
|
+
let r = x.items(n), i = r.indexOf(document.activeElement), a = (e) => {
|
|
133
|
+
e && (t.preventDefault(), e.focus());
|
|
134
|
+
}, o = e(n) ? "ArrowRight" : "ArrowLeft";
|
|
135
|
+
switch (t.key) {
|
|
136
136
|
case "ArrowDown": return a(x.step(r, i, 1));
|
|
137
137
|
case "ArrowUp": return a(x.step(r, i, -1));
|
|
138
138
|
case "Home": return a(r[0]);
|
|
139
139
|
case "End": return a(r[r.length - 1]);
|
|
140
140
|
case "Tab": return O.closeAll({
|
|
141
141
|
reason: "tab",
|
|
142
|
-
event:
|
|
142
|
+
event: t
|
|
143
143
|
});
|
|
144
|
-
case o: return _ ? (
|
|
144
|
+
case o: return _ ? (t.preventDefault(), _({
|
|
145
145
|
reason: "trigger",
|
|
146
|
-
event:
|
|
146
|
+
event: t
|
|
147
147
|
})) : void 0;
|
|
148
148
|
}
|
|
149
|
-
if (s.isPrintable(
|
|
150
|
-
let
|
|
151
|
-
a(x.typeaheadTarget(r,
|
|
149
|
+
if (s.isPrintable(t)) {
|
|
150
|
+
let e = s.push(k.current, t.key, t.timeStamp);
|
|
151
|
+
a(x.typeaheadTarget(r, e, i));
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
154
154
|
onPointerOver: i((e) => {
|
|
@@ -207,24 +207,24 @@ function O(a) {
|
|
|
207
207
|
E.open || N.setOpen(!1, { reason: "imperative" });
|
|
208
208
|
}, [E.open, N.setOpen]), n(() => {
|
|
209
209
|
if (!N.isOpen) return;
|
|
210
|
-
let
|
|
211
|
-
return document.addEventListener("focusin", (
|
|
212
|
-
e
|
|
210
|
+
let e = new AbortController();
|
|
211
|
+
return document.addEventListener("focusin", (e) => {
|
|
212
|
+
t(e, [N.panelElement, N.triggerElement]) || N.setOpen(!1, {
|
|
213
213
|
reason: "imperative",
|
|
214
|
-
event:
|
|
214
|
+
event: e
|
|
215
215
|
});
|
|
216
|
-
}, { signal:
|
|
216
|
+
}, { signal: e.signal }), () => e.abort();
|
|
217
217
|
}, [
|
|
218
218
|
N.isOpen,
|
|
219
219
|
N.panelElement,
|
|
220
220
|
N.triggerElement,
|
|
221
221
|
N.setOpen
|
|
222
222
|
]);
|
|
223
|
-
let P = i((
|
|
224
|
-
let n = t
|
|
225
|
-
u ||
|
|
223
|
+
let P = i((t) => {
|
|
224
|
+
let n = e(t.currentTarget) ? "ArrowLeft" : "ArrowRight";
|
|
225
|
+
u || t.key !== n || (t.preventDefault(), N.setOpen(!0, {
|
|
226
226
|
reason: "trigger",
|
|
227
|
-
event:
|
|
227
|
+
event: t
|
|
228
228
|
}));
|
|
229
229
|
}), F = i((e) => {
|
|
230
230
|
u || N.setOpen(!0, {
|
package/components/overlay.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../
|
|
1
|
+
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../client.cjs"),t=require("../platform.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../placement.cjs"),a=require("../layer.cjs");let o=require("react"),s=require("react/jsx-runtime"),c=require("react-dom");function l(l,u){let{side:d=`bottom`,align:f=`center`,offset:p=0,flip:m=!0,onSideChange:h,anchor:g,contentRef:_,matchWidth:v=!0,...y}=l,[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)(!1),w=(0,o.useRef)(null),T=a.n(),E=(0,o.useRef)(null),D=e.n(!T),O=i.t({side:d,align:f,offset:p,flip:m,matchWidth:v,anchor:g??b,trackSide:!!h});n.n(()=>{let e=E.current;!T||!t.o()||!e||!e.isConnected||e.matches(`:popover-open`)||e.showPopover()}),n.n(()=>{if(T)return;let e=t.l(g)??b;C(!!e&&t.d(e))},[g,b,T]),n.n(()=>{w.current!==O.side&&(w.current=O.side,h?.(O.side))});let k=O.layerProps.ref,A=(0,o.useCallback)(e=>{k?.(e),E.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[k,u]),j=(0,s.jsx)(r.default,{...O.layerProps,ref:A,transition:`none`,props:T?{popover:`manual`}:{dir:S?`rtl`:`ltr`},children:(0,s.jsx)(r.default,{ref:_,...y})});return(0,s.jsxs)(s.Fragment,{children:[!g&&(0,s.jsx)(r.default,{ref:x}),T?j:D&&(0,c.createPortal)(j,D)]})}var u=(0,o.forwardRef)(l);u.displayName=`Overlay`,exports.default=u;
|
package/components/overlay.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { t as r } from "../
|
|
2
|
+
import { n as e } from "../client.mjs";
|
|
3
|
+
import { d as t, l as n, o as r } from "../platform.mjs";
|
|
4
4
|
import { n as i } from "../effects.mjs";
|
|
5
5
|
import a from "../box.mjs";
|
|
6
6
|
import { t as o } from "../placement.mjs";
|
|
7
7
|
import { n as s } from "../layer.mjs";
|
|
8
8
|
import { forwardRef as c, useCallback as l, useRef as u, useState as d } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import { createPortal as h } from "react-dom";
|
|
11
11
|
//#region src/components/overlay.tsx
|
|
12
12
|
function g(c, g) {
|
|
13
|
-
let { side: _ = "bottom", align: v = "center", offset: y = 0, flip: b = !0, onSideChange: x, anchor: S, contentRef: C, matchWidth: w = !0, ...T } = c, [E, D] = d(null), [O, k] = d(!1), A = u(null), j = s(), M = u(null), N =
|
|
13
|
+
let { side: _ = "bottom", align: v = "center", offset: y = 0, flip: b = !0, onSideChange: x, anchor: S, contentRef: C, matchWidth: w = !0, ...T } = c, [E, D] = d(null), [O, k] = d(!1), A = u(null), j = s(), M = u(null), N = e(!j), P = o({
|
|
14
14
|
side: _,
|
|
15
15
|
align: v,
|
|
16
16
|
offset: y,
|
|
@@ -20,12 +20,12 @@ function g(c, g) {
|
|
|
20
20
|
trackSide: !!x
|
|
21
21
|
});
|
|
22
22
|
i(() => {
|
|
23
|
-
let
|
|
24
|
-
!j || !
|
|
23
|
+
let e = M.current;
|
|
24
|
+
!j || !r() || !e || !e.isConnected || e.matches(":popover-open") || e.showPopover();
|
|
25
25
|
}), i(() => {
|
|
26
26
|
if (j) return;
|
|
27
|
-
let e =
|
|
28
|
-
k(!!e &&
|
|
27
|
+
let e = n(S) ?? E;
|
|
28
|
+
k(!!e && t(e));
|
|
29
29
|
}, [
|
|
30
30
|
S,
|
|
31
31
|
E,
|
|
@@ -35,17 +35,17 @@ function g(c, g) {
|
|
|
35
35
|
});
|
|
36
36
|
let F = P.layerProps.ref, I = l((e) => {
|
|
37
37
|
F?.(e), M.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
|
|
38
|
-
}, [F, g]), L = /* @__PURE__ */
|
|
38
|
+
}, [F, g]), L = /* @__PURE__ */ p(a, {
|
|
39
39
|
...P.layerProps,
|
|
40
40
|
ref: I,
|
|
41
41
|
transition: "none",
|
|
42
42
|
props: j ? { popover: "manual" } : { dir: O ? "rtl" : "ltr" },
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ p(a, {
|
|
44
44
|
ref: C,
|
|
45
45
|
...T
|
|
46
46
|
})
|
|
47
47
|
});
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ m(f, { children: [!S && /* @__PURE__ */ p(a, { ref: D }), j ? L : N && h(L, N)] });
|
|
49
49
|
}
|
|
50
50
|
var _ = c(g);
|
|
51
51
|
_.displayName = "Overlay";
|