@box-kite/react 2.2.15 → 2.2.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/.claude/rules/box-kite-rules.md +1 -1
- package/.claude/skills/box-kite/SKILL.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +1 -1
- package/.cursor/rules/box-kite.mdc +1 -1
- package/AGENTS.md +1 -1
- package/BOX_AI_CONTEXT.md +16 -0
- package/BOX_KITE_AI_CONTEXT.md +16 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +16 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +1 -1
- package/client.cjs +1 -1
- package/client.mjs +10 -10
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +95 -91
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +212 -210
- package/components/chart.cjs +1 -1
- package/components/chart.d.ts +8 -3
- package/components/chart.mjs +70 -65
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +187 -186
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.d.ts +1 -44
- package/components/dashboard.mjs +202 -201
- package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
- package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
- package/components/dataGrid/models/gridModel.d.ts +1 -1
- package/components/dataGrid.cjs +2 -2
- package/components/dataGrid.mjs +10 -10
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +96 -96
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +177 -179
- package/components/dialog.cjs +1 -1
- package/components/dialog.d.ts +2 -64
- package/components/dialog.mjs +130 -126
- package/components/form.cjs +1 -1
- package/components/form.d.ts +4 -3
- package/components/form.mjs +25 -22
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -73
- package/components/menu.mjs +222 -218
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +43 -43
- package/components/popover.cjs +1 -1
- package/components/popover.d.ts +1 -41
- package/components/popover.mjs +55 -51
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +59 -55
- package/components/slider.cjs +1 -1
- package/components/slider.d.ts +1 -55
- package/components/slider.mjs +92 -90
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +149 -148
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +100 -100
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +135 -132
- package/components/toaster.cjs +1 -1
- package/components/toaster.d.ts +1 -37
- package/components/toaster.mjs +130 -128
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -34
- package/components/tooltip.mjs +73 -69
- package/components/virtualList.cjs +1 -1
- package/components/virtualList.mjs +88 -87
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/package.json +31 -30
- package/placement.cjs +1 -1
- package/placement.mjs +1 -1
- package/platform.cjs +1 -1
- package/platform.mjs +17 -14
- package/react/componentsContext.d.ts +1 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/utils/chart/chartUtils.d.ts +3 -2
- package/utils/dashboard/dashboardUtils.d.ts +1 -1
- package/utils/dom/domUtils.d.ts +6 -0
- package/create/src/agents.d.ts +0 -22
- package/create/src/agents.test.d.ts +0 -1
- package/create/src/index.d.ts +0 -1
- package/create/src/options.d.ts +0 -31
- package/create/src/options.test.d.ts +0 -1
- package/create/src/packageManager.d.ts +0 -5
- package/create/src/project.d.ts +0 -27
- package/create/src/project.test.d.ts +0 -1
- package/create/templates/ts/designs/azure.d.ts +0 -5
- package/create/templates/ts/designs/ember.d.ts +0 -5
- package/create/templates/ts/designs/mono.d.ts +0 -5
- package/create/templates/ts/src/App.d.ts +0 -2
- package/create/templates/ts/src/design.d.ts +0 -5
- package/create/templates/ts/src/main.d.ts +0 -0
- package/mcp/src/data.d.ts +0 -90
- package/mcp/src/data.test.d.ts +0 -1
- package/mcp/src/engine.d.ts +0 -23
- package/mcp/src/index.d.ts +0 -1
- package/mcp/src/search.d.ts +0 -38
- package/mcp/src/search.test.d.ts +0 -1
- package/mcp/src/server.d.ts +0 -18
- package/mcp/src/server.test.d.ts +0 -1
- package/mcp/src/styles.d.ts +0 -27
- package/mcp/src/styles.test.d.ts +0 -1
- package/mcp/src/tools.d.ts +0 -18
- package/mcp/src/vocabulary.d.ts +0 -41
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
- package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
- package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
- package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
- package/registry/blocks/settings-form/settings-form.d.ts +0 -17
- package/registry/designs/store/address-form.d.ts +0 -11
- package/registry/designs/store/cart-items.d.ts +0 -10
- package/registry/designs/store/cart-page.d.ts +0 -4
- package/registry/designs/store/checkout-page.d.ts +0 -7
- package/registry/designs/store/credit-card-form.d.ts +0 -10
- package/registry/designs/store/form-field.d.ts +0 -19
- package/registry/designs/store/order-summary.d.ts +0 -18
- package/registry/designs/store/product-art.d.ts +0 -26
- package/registry/designs/store/product-card.d.ts +0 -11
- package/registry/designs/store/product-gallery.d.ts +0 -11
- package/registry/designs/store/product-grid.d.ts +0 -10
- package/registry/designs/store/product-page.d.ts +0 -5
- package/registry/designs/store/quantity-stepper.d.ts +0 -13
- package/registry/designs/store/shipping-method.d.ts +0 -14
- package/registry/designs/store/store-data.d.ts +0 -53
- package/registry/designs/store/store-design.d.ts +0 -63
- package/registry/designs/store/store-shell.d.ts +0 -12
- package/registry/designs/store/storefront-page.d.ts +0 -4
- package/registry/designs/store/variant-picker.d.ts +0 -15
- package/supabase/functions/collect/index.d.ts +0 -30
- package/supabase/functions/collect/index.test.d.ts +0 -1
package/components/tooltip.mjs
CHANGED
|
@@ -1,110 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import i from "
|
|
5
|
-
import a from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { f as e } from "../react-shared.mjs";
|
|
3
|
+
import { l as t } from "../platform.mjs";
|
|
4
|
+
import { a as n, i as r, r as i } from "../behavior.mjs";
|
|
5
|
+
import { t as a } from "../identity.mjs";
|
|
6
|
+
import o from "./overlay.mjs";
|
|
7
|
+
import s from "./presence.mjs";
|
|
8
|
+
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
9
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
10
|
//#region src/components/tooltip.tsx
|
|
9
|
-
function
|
|
10
|
-
let { content:
|
|
11
|
-
value:
|
|
12
|
-
defaultValue:
|
|
13
|
-
onChange:
|
|
14
|
-
}), [
|
|
15
|
-
|
|
16
|
-
}, []), V =
|
|
17
|
-
|
|
11
|
+
function g(e, g) {
|
|
12
|
+
let { content: _, children: v, open: y, defaultOpen: b = !1, onOpenChange: x, openDelay: S = 300, closeDelay: C = 150, side: w = "bottom", align: T = "center", offset: E = 1, flip: D = !0, props: O, ...k } = e, A = a("tooltip"), j = k.id ?? A, [M, N] = r({
|
|
13
|
+
value: y,
|
|
14
|
+
defaultValue: b,
|
|
15
|
+
onChange: x
|
|
16
|
+
}), [P, F] = f(null), I = d(null), L = c((e) => {
|
|
17
|
+
I.current = e, t(g, e);
|
|
18
|
+
}, [g]), R = d(void 0), z = d(!1), B = d(!1), V = d(!1), H = d(!1), U = c(() => {
|
|
19
|
+
clearTimeout(R.current), R.current = void 0;
|
|
20
|
+
}, []), W = c((e, t) => {
|
|
21
|
+
if (U(), e <= 0) {
|
|
18
22
|
t();
|
|
19
23
|
return;
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
R.current = setTimeout(() => {
|
|
26
|
+
R.current = void 0, t();
|
|
23
27
|
}, e);
|
|
24
|
-
}, [
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
}, [U]), G = c((e, t) => {
|
|
29
|
+
W(C, () => {
|
|
30
|
+
z.current || B.current || V.current || N(!1, {
|
|
27
31
|
reason: e,
|
|
28
32
|
event: t
|
|
29
33
|
});
|
|
30
34
|
});
|
|
31
35
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
C,
|
|
37
|
+
W,
|
|
38
|
+
N
|
|
35
39
|
]);
|
|
36
|
-
|
|
37
|
-
enabled:
|
|
40
|
+
i({
|
|
41
|
+
enabled: M,
|
|
38
42
|
outsidePointer: !1,
|
|
39
|
-
inside: [
|
|
43
|
+
inside: [I],
|
|
40
44
|
onDismiss: (e, t) => {
|
|
41
|
-
|
|
45
|
+
U(), H.current = !0, N(!1, {
|
|
42
46
|
reason: e,
|
|
43
47
|
event: t
|
|
44
48
|
});
|
|
45
49
|
}
|
|
46
|
-
}),
|
|
47
|
-
let
|
|
48
|
-
|
|
50
|
+
}), l(() => U, [U]);
|
|
51
|
+
let K = M && _ != null, q = n((e) => {
|
|
52
|
+
z.current = !0, !H.current && W(S, () => N(!0, {
|
|
49
53
|
reason: "hover",
|
|
50
54
|
event: e
|
|
51
55
|
}));
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
+
}), J = n((e) => {
|
|
57
|
+
z.current = !1, H.current = !1, G("pointer-leave", e);
|
|
58
|
+
}), Y = n((e) => {
|
|
59
|
+
V.current = !0, U(), N(!0, {
|
|
56
60
|
reason: "focus",
|
|
57
61
|
event: e
|
|
58
62
|
});
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
}),
|
|
66
|
-
ref:
|
|
63
|
+
}), X = n((e) => {
|
|
64
|
+
V.current = !1, H.current = !1, G("blur", e);
|
|
65
|
+
}), Z = n(() => {
|
|
66
|
+
B.current = !0, U();
|
|
67
|
+
}), Q = n((e) => {
|
|
68
|
+
B.current = !1, G("pointer-leave", e);
|
|
69
|
+
}), $ = u(() => ({
|
|
70
|
+
ref: F,
|
|
67
71
|
props: {
|
|
68
|
-
"aria-describedby":
|
|
69
|
-
onPointerEnter:
|
|
70
|
-
onPointerLeave:
|
|
71
|
-
onFocus:
|
|
72
|
-
onBlur:
|
|
72
|
+
"aria-describedby": K ? j : void 0,
|
|
73
|
+
onPointerEnter: q,
|
|
74
|
+
onPointerLeave: J,
|
|
75
|
+
onFocus: Y,
|
|
76
|
+
onBlur: X
|
|
73
77
|
}
|
|
74
78
|
}), [
|
|
79
|
+
X,
|
|
75
80
|
q,
|
|
76
|
-
|
|
81
|
+
Y,
|
|
82
|
+
J,
|
|
77
83
|
K,
|
|
78
|
-
|
|
79
|
-
U,
|
|
80
|
-
k
|
|
84
|
+
j
|
|
81
85
|
]);
|
|
82
|
-
return /* @__PURE__ */ p
|
|
83
|
-
present:
|
|
84
|
-
children: (e) => /* @__PURE__ */
|
|
85
|
-
ref:
|
|
86
|
+
return /* @__PURE__ */ h(p, { children: [v($), /* @__PURE__ */ m(s, {
|
|
87
|
+
present: K,
|
|
88
|
+
children: (e) => /* @__PURE__ */ m(o, {
|
|
89
|
+
ref: L,
|
|
86
90
|
contentRef: e.ref,
|
|
87
|
-
anchor:
|
|
88
|
-
side:
|
|
89
|
-
align:
|
|
90
|
-
offset:
|
|
91
|
-
flip:
|
|
91
|
+
anchor: P,
|
|
92
|
+
side: w,
|
|
93
|
+
align: T,
|
|
94
|
+
offset: E,
|
|
95
|
+
flip: D,
|
|
92
96
|
matchWidth: !1,
|
|
93
97
|
component: "tooltip",
|
|
94
|
-
...
|
|
95
|
-
variant: [
|
|
96
|
-
id:
|
|
98
|
+
...k,
|
|
99
|
+
variant: [k.variant, { closed: !e.present }],
|
|
100
|
+
id: j,
|
|
97
101
|
props: {
|
|
98
102
|
role: "tooltip",
|
|
99
103
|
...e.props,
|
|
100
|
-
...
|
|
101
|
-
onPointerEnter:
|
|
102
|
-
onPointerLeave:
|
|
104
|
+
...O,
|
|
105
|
+
onPointerEnter: Z,
|
|
106
|
+
onPointerLeave: Q
|
|
103
107
|
},
|
|
104
|
-
children:
|
|
108
|
+
children: _
|
|
105
109
|
})
|
|
106
110
|
})] });
|
|
107
111
|
}
|
|
108
|
-
|
|
112
|
+
var _ = e(g, "Tooltip");
|
|
109
113
|
//#endregion
|
|
110
|
-
export {
|
|
114
|
+
export { _ as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../
|
|
1
|
+
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../platform.cjs"),n=require("../effects.cjs"),r=require("../behavior.cjs"),i=require("../scrolling.cjs"),a=require("./list.cjs");let o=require("react"),s=require("react/jsx-runtime");function c(e,t,n){return Math.min(Math.max(e,t),n)}var l;(function(e){let t=e.DEFAULT_OVERSCAN=4,n=e.PIN_REACH=50;function r(e){let t=Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}e.offsetsOf=r;function a(e,t){let n=0,r=0;for(let t of e)n+=t,r++;return r?n/r:t}e.typicalSize=a;function o(e){let{offsets:r,viewStart:a,viewEnd:o,overscan:s=t,pin:l=-1}=e,u=r.length-1,d=r[u]??0;if(u<=0)return{startIndex:0,endIndex:0,offsetY:0,totalHeight:0};let f=c(i.n(r,a,u)-s,0,u-1),p=c(i.n(r,o-.5,u)+1+s,f+1,u);return l>=0&&l<u&&(l<f&&f-l<=n?f=l:l>=p&&l-p<n&&(p=l+1)),{startIndex:f,endIndex:p,offsetY:r[f],totalHeight:d}}e.measuredWindow=o})(l||={});var u=l;function d(e,t){for(let n of Array.from(e.children)){let e=n.getBoundingClientRect();if(e.bottom>t)return{element:n,top:e.top}}return null}var f=150;function p(e,c){let{items:l,itemKey:p,children:m,estimateSize:h=57,overscan:g=6,initialCount:_=20,onRangeChange:v,scrollerRef:y,vars:b,css:x,props:S,...C}=e,w=(0,o.useRef)(null),[T,E]=(0,o.useState)(()=>new Map),[,D]=(0,o.useState)(0),[O,k]=(0,o.useState)({startIndex:0,endIndex:Math.min(_,l.length)}),[A,j]=(0,o.useState)(-1),M=r.a(v),N=(0,o.useCallback)(e=>{w.current=e,t.l(c,e)},[c]),[P,F]=(0,o.useState)(null),I=(0,o.useMemo)(()=>l.map((e,t)=>p(e,t)),[l,p]),L=(0,o.useMemo)(()=>u.typicalSize(T.values(),h),[T,h]),R=P?.count===l.length?P:null,z=R?R.estimate:L,B=(0,o.useMemo)(()=>u.offsetsOf(I.map(e=>T.get(e)??z)),[I,T,z]),V=B[l.length],H=r.o({offsets:B,pin:A,overscan:g,count:l.length,total:V,estimate:z}),U=(0,o.useRef)(null),W=Math.min(O.startIndex,Math.max(0,l.length-1)),G=Math.min(Math.max(O.endIndex,W),l.length),K=r.a(()=>{let e=w.current,{offsets:t,pin:n,overscan:r,count:a}=H.current;if(!e||a===0)return;let o=y?.current??i.t(e),s=e.ownerDocument.defaultView,c=o?o.getBoundingClientRect().top+o.clientTop:0,l=o?o.clientHeight:s?.innerHeight??0,d=e.getBoundingClientRect().top+e.clientTop,f=u.measuredWindow({offsets:t,viewStart:c-d,viewEnd:c-d+l,overscan:r,pin:n});k(e=>e.startIndex===f.startIndex&&e.endIndex===f.endIndex?e:{startIndex:f.startIndex,endIndex:f.endIndex})});n.n(()=>{let e=w.current;if(!e)return;let t=null,n=0,r=y?.current??i.t(e),a=r?r.getBoundingClientRect().top:0,o=parseFloat(getComputedStyle(e).rowGap)||0,s=U.current;if(U.current=null,s?.element.isConnected&&(n+=s.element.getBoundingClientRect().top-s.top),Array.from(e.children).forEach((e,r)=>{let i=W+r,s=I[i];if(s===void 0)return;e.setAttribute(`aria-setsize`,String(l.length)),e.setAttribute(`aria-posinset`,String(i+1));let c=e.getBoundingClientRect(),u=c.height+o,d=T.get(s)??z;c.height>0&&T.get(s)!==u&&(t??=new Map(T),t.set(s,u),c.bottom<=a&&(n+=u-d))}),n!==0){let t=r??e.ownerDocument.defaultView,i=r?r.scrollTop:t?.scrollY??0;t?.scrollTo({top:i+n,behavior:`instant`})}t?(U.current=d(e,a),E(t)):K()}),(0,o.useEffect)(()=>{let e=w.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>D(e=>e+1));return Array.from(e.children).forEach(e=>t.observe(e)),()=>t.disconnect()},[O,I]),(0,o.useEffect)(()=>{let e=w.current,t=e?.ownerDocument.defaultView;if(!e||!t)return;let n=y?.current??i.t(e),r=n??t,a=0,o=!1,s=0,c=()=>{a||=requestAnimationFrame(()=>(a=0,K()))},l=()=>{let{count:r,total:i,estimate:a}=H.current;F(e=>e??{count:r,total:i,estimate:a}),clearTimeout(s),s=t.setTimeout(()=>{o||(U.current=d(e,n?n.getBoundingClientRect().top:0),F(null))},f)},u=()=>{l(),c()},p=()=>{o=!0,l()},m=()=>{o&&(o=!1,l())};r.addEventListener(`scroll`,u,{passive:!0}),r.addEventListener(`pointerdown`,p,{capture:!0,passive:!0}),t.addEventListener(`pointerup`,m,!0),t.addEventListener(`pointercancel`,m,!0),t.addEventListener(`resize`,c);let h=typeof ResizeObserver>`u`?null:new ResizeObserver(c);return n&&h?.observe(n),()=>{cancelAnimationFrame(a),clearTimeout(s),r.removeEventListener(`scroll`,u),r.removeEventListener(`pointerdown`,p,!0),t.removeEventListener(`pointerup`,m,!0),t.removeEventListener(`pointercancel`,m,!0),t.removeEventListener(`resize`,c),h?.disconnect()}},[y,K,H]),(0,o.useEffect)(()=>{M({startIndex:O.startIndex,endIndex:O.endIndex})},[O,M]);let q=e=>{let t=w.current,n=Array.from(t?.children??[]).findIndex(t=>t.contains(e.target));n>=0&&j(W+n)},J=e=>{w.current?.contains(e.relatedTarget)||j(-1)},Y=[];for(let e=W;e<G;e++)Y.push((0,s.jsx)(o.Fragment,{children:m(l[e],e)},I[e]));return(0,s.jsx)(a.default,{ref:N,...C,vars:W>0?{...b,"list-first-divider":`block`}:b,css:{...x,overflowAnchor:`none`},transition:`none`,style:{paddingBlockStart:`${B[W]}px`,paddingBlockEnd:`${Math.max(0,(R&&G<l.length?R.total:V)-B[G])}px`},props:{...S,onFocus:q,onBlur:J},children:Y})}var m=e.f(p,`VirtualList`);exports.default=m;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { f as e } from "../react-shared.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import o from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
3
|
+
import { l as t } from "../platform.mjs";
|
|
4
|
+
import { n } from "../effects.mjs";
|
|
5
|
+
import { a as r, o as i } from "../behavior.mjs";
|
|
6
|
+
import { n as a, t as o } from "../scrolling.mjs";
|
|
7
|
+
import s from "./list.mjs";
|
|
8
|
+
import { Fragment as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
9
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
9
10
|
//#region src/utils/virtual/measuredWindow.ts
|
|
10
|
-
function
|
|
11
|
+
function h(e, t, n) {
|
|
11
12
|
return Math.min(Math.max(e, t), n);
|
|
12
13
|
}
|
|
13
|
-
var
|
|
14
|
+
var g;
|
|
14
15
|
(function(e) {
|
|
15
16
|
let t = e.DEFAULT_OVERSCAN = 4, n = e.PIN_REACH = 50;
|
|
16
17
|
function r(e) {
|
|
@@ -20,21 +21,21 @@ var h;
|
|
|
20
21
|
return t;
|
|
21
22
|
}
|
|
22
23
|
e.offsetsOf = r;
|
|
23
|
-
function
|
|
24
|
+
function i(e, t) {
|
|
24
25
|
let n = 0, r = 0;
|
|
25
26
|
for (let t of e) n += t, r++;
|
|
26
27
|
return r ? n / r : t;
|
|
27
28
|
}
|
|
28
|
-
e.typicalSize =
|
|
29
|
+
e.typicalSize = i;
|
|
29
30
|
function o(e) {
|
|
30
|
-
let { offsets: r, viewStart:
|
|
31
|
+
let { offsets: r, viewStart: i, viewEnd: o, overscan: s = t, pin: c = -1 } = e, l = r.length - 1, u = r[l] ?? 0;
|
|
31
32
|
if (l <= 0) return {
|
|
32
33
|
startIndex: 0,
|
|
33
34
|
endIndex: 0,
|
|
34
35
|
offsetY: 0,
|
|
35
36
|
totalHeight: 0
|
|
36
37
|
};
|
|
37
|
-
let d =
|
|
38
|
+
let d = h(a(r, i, l) - s, 0, l - 1), f = h(a(r, o - .5, l) + 1 + s, d + 1, l);
|
|
38
39
|
return c >= 0 && c < l && (c < d && d - c <= n ? d = c : c >= f && c - f < n && (f = c + 1)), {
|
|
39
40
|
startIndex: d,
|
|
40
41
|
endIndex: f,
|
|
@@ -43,11 +44,11 @@ var h;
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
e.measuredWindow = o;
|
|
46
|
-
})(
|
|
47
|
-
var
|
|
47
|
+
})(g ||= {});
|
|
48
|
+
var _ = g;
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region src/components/virtualList.tsx
|
|
50
|
-
function
|
|
51
|
+
function v(e, t) {
|
|
51
52
|
for (let n of Array.from(e.children)) {
|
|
52
53
|
let e = n.getBoundingClientRect();
|
|
53
54
|
if (e.bottom > t) return {
|
|
@@ -57,49 +58,49 @@ function _(e, t) {
|
|
|
57
58
|
}
|
|
58
59
|
return null;
|
|
59
60
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
let { items:
|
|
61
|
+
var y = 150;
|
|
62
|
+
function b(e, a) {
|
|
63
|
+
let { items: h, itemKey: g, children: b, estimateSize: x = 57, overscan: S = 6, initialCount: C = 20, onRangeChange: w, scrollerRef: T, vars: E, css: D, props: O, ...k } = e, A = f(null), [j, M] = p(() => /* @__PURE__ */ new Map()), [, N] = p(0), [P, F] = p({
|
|
63
64
|
startIndex: 0,
|
|
64
|
-
endIndex: Math.min(
|
|
65
|
-
}), [
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]),
|
|
72
|
-
offsets:
|
|
73
|
-
pin:
|
|
74
|
-
overscan:
|
|
75
|
-
count:
|
|
76
|
-
total:
|
|
77
|
-
estimate:
|
|
78
|
-
}),
|
|
79
|
-
let e =
|
|
65
|
+
endIndex: Math.min(C, h.length)
|
|
66
|
+
}), [I, L] = p(-1), R = r(w), z = l((e) => {
|
|
67
|
+
A.current = e, t(a, e);
|
|
68
|
+
}, [a]), [B, V] = p(null), H = d(() => h.map((e, t) => g(e, t)), [h, g]), U = d(() => _.typicalSize(j.values(), x), [j, x]), W = B?.count === h.length ? B : null, G = W ? W.estimate : U, K = d(() => _.offsetsOf(H.map((e) => j.get(e) ?? G)), [
|
|
69
|
+
H,
|
|
70
|
+
j,
|
|
71
|
+
G
|
|
72
|
+
]), q = K[h.length], J = i({
|
|
73
|
+
offsets: K,
|
|
74
|
+
pin: I,
|
|
75
|
+
overscan: S,
|
|
76
|
+
count: h.length,
|
|
77
|
+
total: q,
|
|
78
|
+
estimate: G
|
|
79
|
+
}), Y = f(null), X = Math.min(P.startIndex, Math.max(0, h.length - 1)), Z = Math.min(Math.max(P.endIndex, X), h.length), Q = r(() => {
|
|
80
|
+
let e = A.current, { offsets: t, pin: n, overscan: r, count: i } = J.current;
|
|
80
81
|
if (!e || i === 0) return;
|
|
81
|
-
let
|
|
82
|
+
let a = T?.current ?? o(e), s = e.ownerDocument.defaultView, c = a ? a.getBoundingClientRect().top + a.clientTop : 0, l = a ? a.clientHeight : s?.innerHeight ?? 0, u = e.getBoundingClientRect().top + e.clientTop, d = _.measuredWindow({
|
|
82
83
|
offsets: t,
|
|
83
84
|
viewStart: c - u,
|
|
84
85
|
viewEnd: c - u + l,
|
|
85
86
|
overscan: r,
|
|
86
87
|
pin: n
|
|
87
88
|
});
|
|
88
|
-
|
|
89
|
+
F((e) => e.startIndex === d.startIndex && e.endIndex === d.endIndex ? e : {
|
|
89
90
|
startIndex: d.startIndex,
|
|
90
91
|
endIndex: d.endIndex
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
|
-
|
|
94
|
-
let e =
|
|
94
|
+
n(() => {
|
|
95
|
+
let e = A.current;
|
|
95
96
|
if (!e) return;
|
|
96
|
-
let t = null, n = 0, r =
|
|
97
|
-
if (
|
|
98
|
-
let
|
|
97
|
+
let t = null, n = 0, r = T?.current ?? o(e), i = r ? r.getBoundingClientRect().top : 0, a = parseFloat(getComputedStyle(e).rowGap) || 0, s = Y.current;
|
|
98
|
+
if (Y.current = null, s?.element.isConnected && (n += s.element.getBoundingClientRect().top - s.top), Array.from(e.children).forEach((e, r) => {
|
|
99
|
+
let o = X + r, s = H[o];
|
|
99
100
|
if (s === void 0) return;
|
|
100
|
-
e.setAttribute("aria-setsize", String(
|
|
101
|
-
let c = e.getBoundingClientRect(), l = c.height +
|
|
102
|
-
c.height > 0 &&
|
|
101
|
+
e.setAttribute("aria-setsize", String(h.length)), e.setAttribute("aria-posinset", String(o + 1));
|
|
102
|
+
let c = e.getBoundingClientRect(), l = c.height + a, u = j.get(s) ?? G;
|
|
103
|
+
c.height > 0 && j.get(s) !== l && (t ??= new Map(j), t.set(s, l), c.bottom <= i && (n += l - u));
|
|
103
104
|
}), n !== 0) {
|
|
104
105
|
let t = r ?? e.ownerDocument.defaultView, i = r ? r.scrollTop : t?.scrollY ?? 0;
|
|
105
106
|
t?.scrollTo({
|
|
@@ -107,32 +108,32 @@ function y(e, i) {
|
|
|
107
108
|
behavior: "instant"
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
|
-
t ? (
|
|
111
|
-
}),
|
|
112
|
-
let e =
|
|
111
|
+
t ? (Y.current = v(e, i), M(t)) : Q();
|
|
112
|
+
}), u(() => {
|
|
113
|
+
let e = A.current;
|
|
113
114
|
if (!e || typeof ResizeObserver > "u") return;
|
|
114
|
-
let t = new ResizeObserver(() =>
|
|
115
|
+
let t = new ResizeObserver(() => N((e) => e + 1));
|
|
115
116
|
return Array.from(e.children).forEach((e) => t.observe(e)), () => t.disconnect();
|
|
116
|
-
}, [
|
|
117
|
-
let e =
|
|
117
|
+
}, [P, H]), u(() => {
|
|
118
|
+
let e = A.current, t = e?.ownerDocument.defaultView;
|
|
118
119
|
if (!e || !t) return;
|
|
119
|
-
let n =
|
|
120
|
-
i ||= requestAnimationFrame(() => (i = 0,
|
|
120
|
+
let n = T?.current ?? o(e), r = n ?? t, i = 0, a = !1, s = 0, c = () => {
|
|
121
|
+
i ||= requestAnimationFrame(() => (i = 0, Q()));
|
|
121
122
|
}, l = () => {
|
|
122
|
-
let { count: r, total: i, estimate:
|
|
123
|
-
|
|
123
|
+
let { count: r, total: i, estimate: o } = J.current;
|
|
124
|
+
V((e) => e ?? {
|
|
124
125
|
count: r,
|
|
125
126
|
total: i,
|
|
126
|
-
estimate:
|
|
127
|
+
estimate: o
|
|
127
128
|
}), clearTimeout(s), s = t.setTimeout(() => {
|
|
128
|
-
|
|
129
|
-
},
|
|
129
|
+
a || (Y.current = v(e, n ? n.getBoundingClientRect().top : 0), V(null));
|
|
130
|
+
}, y);
|
|
130
131
|
}, u = () => {
|
|
131
132
|
l(), c();
|
|
132
133
|
}, d = () => {
|
|
133
|
-
|
|
134
|
+
a = !0, l();
|
|
134
135
|
}, f = () => {
|
|
135
|
-
|
|
136
|
+
a && (a = !1, l());
|
|
136
137
|
};
|
|
137
138
|
r.addEventListener("scroll", u, { passive: !0 }), r.addEventListener("pointerdown", d, {
|
|
138
139
|
capture: !0,
|
|
@@ -143,46 +144,46 @@ function y(e, i) {
|
|
|
143
144
|
cancelAnimationFrame(i), clearTimeout(s), r.removeEventListener("scroll", u), r.removeEventListener("pointerdown", d, !0), t.removeEventListener("pointerup", f, !0), t.removeEventListener("pointercancel", f, !0), t.removeEventListener("resize", c), p?.disconnect();
|
|
144
145
|
};
|
|
145
146
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
]),
|
|
150
|
-
|
|
151
|
-
startIndex:
|
|
152
|
-
endIndex:
|
|
147
|
+
T,
|
|
148
|
+
Q,
|
|
149
|
+
J
|
|
150
|
+
]), u(() => {
|
|
151
|
+
R({
|
|
152
|
+
startIndex: P.startIndex,
|
|
153
|
+
endIndex: P.endIndex
|
|
153
154
|
});
|
|
154
|
-
}, [
|
|
155
|
-
let
|
|
156
|
-
let t =
|
|
157
|
-
n >= 0 &&
|
|
158
|
-
},
|
|
159
|
-
|
|
155
|
+
}, [P, R]);
|
|
156
|
+
let ee = (e) => {
|
|
157
|
+
let t = A.current, n = Array.from(t?.children ?? []).findIndex((t) => t.contains(e.target));
|
|
158
|
+
n >= 0 && L(X + n);
|
|
159
|
+
}, te = (e) => {
|
|
160
|
+
A.current?.contains(e.relatedTarget) || L(-1);
|
|
160
161
|
}, $ = [];
|
|
161
|
-
for (let e =
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
ref:
|
|
164
|
-
...
|
|
165
|
-
vars:
|
|
166
|
-
...
|
|
162
|
+
for (let e = X; e < Z; e++) $.push(/* @__PURE__ */ m(c, { children: b(h[e], e) }, H[e]));
|
|
163
|
+
return /* @__PURE__ */ m(s, {
|
|
164
|
+
ref: z,
|
|
165
|
+
...k,
|
|
166
|
+
vars: X > 0 ? {
|
|
167
|
+
...E,
|
|
167
168
|
"list-first-divider": "block"
|
|
168
|
-
} :
|
|
169
|
+
} : E,
|
|
169
170
|
css: {
|
|
170
|
-
...
|
|
171
|
+
...D,
|
|
171
172
|
overflowAnchor: "none"
|
|
172
173
|
},
|
|
173
174
|
transition: "none",
|
|
174
175
|
style: {
|
|
175
|
-
paddingBlockStart: `${
|
|
176
|
-
paddingBlockEnd: `${Math.max(0, (
|
|
176
|
+
paddingBlockStart: `${K[X]}px`,
|
|
177
|
+
paddingBlockEnd: `${Math.max(0, (W && Z < h.length ? W.total : q) - K[Z])}px`
|
|
177
178
|
},
|
|
178
179
|
props: {
|
|
179
|
-
...
|
|
180
|
-
onFocus:
|
|
181
|
-
onBlur:
|
|
180
|
+
...O,
|
|
181
|
+
onFocus: ee,
|
|
182
|
+
onBlur: te
|
|
182
183
|
},
|
|
183
184
|
children: $
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
|
-
var
|
|
187
|
+
var x = e(b, "VirtualList");
|
|
187
188
|
//#endregion
|
|
188
|
-
export {
|
|
189
|
+
export { x as default };
|
package/interactionListening.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs");function t(e){let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`object`||!n)return n;if(n instanceof Set)return Array.from(n);if(n instanceof Map)return Object.fromEntries(n);if(t.has(n))return;let r=Object.getPrototypeOf(n);if(!(!Array.isArray(n)&&(r!==Object.prototype&&r!==null||`$$typeof`in n)))return t.add(n),n});return n===void 0?void 0:JSON.parse(n)}var n=[`click`,`dblclick`,`keydown`,`pointerdown`,`pointerup`,`change`,`submit`,`copy`,`paste`,`focusout`],r=[`imperative`,`programmatic`,`timeout`],i=`a[href],button,input,select,textarea,summary,label,[tabindex],[role=option],[role=button]`;function a(e){let t=globalThis.scheduler;t?.postTask?t.postTask(e,{priority:`background`}):setTimeout(e,0)}function o(e){typeof reportError==`function`?reportError(e):setTimeout(()=>{throw e})}var s=e=>typeof Element<`u`&&e instanceof Element?e:void 0,c=e=>e?.closest(i)??void 0;function l({kind:e,input:n,event:i,handler:a,timeStamp:o,time:l,url:u},d){let f=d?[]:n.content??[],p=t(n.details&&Object.fromEntries(Object.entries(n.details).filter(([e])=>!f.includes(e)))),m=n.source??(n.reason&&r.includes(n.reason)?`app`:`user`);return{kind:e,component:n.component,type:n.type,reason:n.reason,value:f.includes(`value`)?void 0:t(n.value),details:p&&Object.keys(p).length>0?p:void 0,source:m,event:i,target:s(a)??c(s(i?.target))??n.target??s(i?.target),timeStamp:o,time:l,url:d?u:u.split(/[?#]/)[0]}}function u(t){let r=!1,i=()=>{r=!1;let e=t.queue.splice(0);if(t.listeners.size!==0)for(let n of e){if(n.kind===`dom`&&e.some(e=>e.kind!==`dom`&&e.event===n.event))continue;let r,i;t.listeners.forEach((e,t)=>{let a=e.content?r??=l(n,!0):i??=l(n,!1);try{t(a)}catch(e){o(e)}})}},u=()=>{r||(r=!0,a(i))};if(t.flush=i,t.schedule=u,t.queue.length>0&&u(),typeof addEventListener!=`function`)return;let d=n=>{let r=s(n.target);if(!r||t.listeners.size===0)return;if(!e.
|
|
1
|
+
const e=require("./platform.cjs");function t(e){let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`object`||!n)return n;if(n instanceof Set)return Array.from(n);if(n instanceof Map)return Object.fromEntries(n);if(t.has(n))return;let r=Object.getPrototypeOf(n);if(!(!Array.isArray(n)&&(r!==Object.prototype&&r!==null||`$$typeof`in n)))return t.add(n),n});return n===void 0?void 0:JSON.parse(n)}var n=[`click`,`dblclick`,`keydown`,`pointerdown`,`pointerup`,`change`,`submit`,`copy`,`paste`,`focusout`],r=[`imperative`,`programmatic`,`timeout`],i=`a[href],button,input,select,textarea,summary,label,[tabindex],[role=option],[role=button]`;function a(e){let t=globalThis.scheduler;t?.postTask?t.postTask(e,{priority:`background`}):setTimeout(e,0)}function o(e){typeof reportError==`function`?reportError(e):setTimeout(()=>{throw e})}var s=e=>typeof Element<`u`&&e instanceof Element?e:void 0,c=e=>e?.closest(i)??void 0;function l({kind:e,input:n,event:i,handler:a,timeStamp:o,time:l,url:u},d){let f=d?[]:n.content??[],p=t(n.details&&Object.fromEntries(Object.entries(n.details).filter(([e])=>!f.includes(e)))),m=n.source??(n.reason&&r.includes(n.reason)?`app`:`user`);return{kind:e,component:n.component,type:n.type,reason:n.reason,value:f.includes(`value`)?void 0:t(n.value),details:p&&Object.keys(p).length>0?p:void 0,source:m,event:i,target:s(a)??c(s(i?.target))??n.target??s(i?.target),timeStamp:o,time:l,url:d?u:u.split(/[?#]/)[0]}}function u(t){let r=!1,i=()=>{r=!1;let e=t.queue.splice(0);if(t.listeners.size!==0)for(let n of e){if(n.kind===`dom`&&e.some(e=>e.kind!==`dom`&&e.event===n.event))continue;let r,i;t.listeners.forEach((e,t)=>{let a=e.content?r??=l(n,!0):i??=l(n,!1);try{t(a)}catch(e){o(e)}})}},u=()=>{r||(r=!0,a(i))};if(t.flush=i,t.schedule=u,t.queue.length>0&&u(),typeof addEventListener!=`function`)return;let d=n=>{let r=s(n.target);if(!r||t.listeners.size===0)return;if(!e.h()){e.a()&&e.v()&&!t.warned&&(t.warned=!0,console.warn(`[box-kite] Box.onInteraction hears no clicks without data-bk: write Box.configure({ componentAttribute: true }).`));return}let i=c(r),a=(i??r).closest(`[data-bk]`);if(!a)return;let o=r instanceof HTMLInputElement&&(r.type===`checkbox`||r.type===`radio`);t.queue.push({kind:`dom`,input:{component:a.getAttribute(`data-bk`)??``,type:n.type,value:n.type===`change`&&o?r.checked:void 0,details:{interactive:i!==void 0},target:i??a,source:n.isTrusted?`user`:`app`},event:n,timeStamp:performance.now(),time:Date.now(),url:location.href}),u()},f=!1,p=e=>{t.dispatching=e,f||(f=!0,setTimeout(()=>{f=!1,t.dispatching=void 0},0)),(e.type===`click`||e.type===`change`)&&d(e)};n.forEach(e=>{document.addEventListener(e,p,!0),addEventListener(e,e=>{t.dispatching===e&&(t.dispatching=void 0)})}),addEventListener(`pagehide`,i)}exports.default=u;
|
package/interactionListening.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, h as t, v as n } from "./platform.mjs";
|
|
2
2
|
//#region src/utils/interactions/interactionJson.ts
|
|
3
3
|
function r(e) {
|
|
4
4
|
let t = /* @__PURE__ */ new WeakSet(), n = JSON.stringify(e, (e, n) => {
|
|
@@ -80,8 +80,8 @@ function f(r) {
|
|
|
80
80
|
let p = (i) => {
|
|
81
81
|
let a = l(i.target);
|
|
82
82
|
if (!a || r.listeners.size === 0) return;
|
|
83
|
-
if (!
|
|
84
|
-
|
|
83
|
+
if (!t()) {
|
|
84
|
+
e() && n() && !r.warned && (r.warned = !0, console.warn("[box-kite] Box.onInteraction hears no clicks without data-bk: write Box.configure({ componentAttribute: true })."));
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
let o = u(a), s = (o ?? a).closest("[data-bk]");
|
package/layer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs"),i=require("./reporting.cjs");let a=require("react");var o=()=>()=>{},s=()=>!0;function c(){return(0,a.useSyncExternalStore)(o,e.c,s)}function l(o){let{haspopup:s,id:l,idPrefix:u,open:d,defaultOpen:f=!1,onOpenChange:p,onOpened:m,onClosing:h,inside:g,interaction:_}=o,v=r.t(u),y=l??v,[b,x]=i.a({value:d,defaultValue:f,onChange:p,interaction:_}),[S,C]=(0,a.useState)(null),[w,T]=(0,a.useState)(null),E=c(),[D,O]=(0,a.useState)(!1),[k,A]=(0,a.useState)(),j=(0,a.useRef)(`imperative`),M=(0,a.useRef)(!1),N=n.a(m),P=n.a(h),F=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&d===!1){e.preventDefault(),setTimeout(()=>x(!0,{reason:`trigger`,event:e}));return}t||(M.current=n.contains(document.activeElement),P(M.current,S)),O(t);let r=t?`trigger`:j.current;j.current=`imperative`,x(t,{reason:r,event:e})}),I=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&N(t)});t.n(()=>{if(!E||!w)return;let e=new AbortController;return w.addEventListener(`beforetoggle`,F,{signal:e.signal}),w.addEventListener(`toggle`,I,{signal:e.signal}),()=>e.abort()},[E,w,F,I]),t.n(()=>{!E||!e.c()||!w||b===D||(b?w.showPopover():w.hidePopover())},[b,D,w,E]),t.n(()=>{if(!E||!b)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(j.current=`escape`)}),n(`pointerdown`,t=>{let n=!!S&&e.
|
|
1
|
+
const e=require("./platform.cjs"),t=require("./effects.cjs"),n=require("./behavior.cjs"),r=require("./identity.cjs"),i=require("./reporting.cjs");let a=require("react");var o=()=>()=>{},s=()=>!0;function c(){return(0,a.useSyncExternalStore)(o,e.c,s)}function l(o){let{haspopup:s,id:l,idPrefix:u,open:d,defaultOpen:f=!1,onOpenChange:p,onOpened:m,onClosing:h,inside:g,interaction:_}=o,v=r.t(u),y=l??v,[b,x]=i.a({value:d,defaultValue:f,onChange:p,interaction:_}),[S,C]=(0,a.useState)(null),[w,T]=(0,a.useState)(null),E=c(),[D,O]=(0,a.useState)(!1),[k,A]=(0,a.useState)(),j=(0,a.useRef)(`imperative`),M=(0,a.useRef)(!1),N=n.a(m),P=n.a(h),F=n.a(e=>{let t=e.newState===`open`,n=e.currentTarget;if(t&&d===!1){e.preventDefault(),setTimeout(()=>x(!0,{reason:`trigger`,event:e}));return}t||(M.current=n.contains(document.activeElement),P(M.current,S)),O(t);let r=t?`trigger`:j.current;j.current=`imperative`,x(t,{reason:r,event:e})}),I=n.a(e=>{let t=e.currentTarget;e.newState===`open`&&N(t)});t.n(()=>{if(!E||!w)return;let e=new AbortController;return w.addEventListener(`beforetoggle`,F,{signal:e.signal}),w.addEventListener(`toggle`,I,{signal:e.signal}),()=>e.abort()},[E,w,F,I]),t.n(()=>{!E||!e.c()||!w||b===D||(b?w.showPopover():w.hidePopover())},[b,D,w,E]),t.n(()=>{if(!E||!b)return;let t=new AbortController,n=(e,n)=>document.addEventListener(e,n,{signal:t.signal,capture:!0});return n(`keydown`,e=>{e.key===`Escape`&&(j.current=`escape`)}),n(`pointerdown`,t=>{let n=!!S&&e.p(t,[S]);j.current=n?`trigger`:`outside-pointer`}),()=>t.abort()},[E,b,S]),t.n(()=>{S&&(S.id||S.setAttribute(`id`,`${y}-trigger`),A(S.id))},[S,y]),t.n(()=>{if(!(!E||!S))return S.setAttribute(`popovertarget`,y),()=>S.removeAttribute(`popovertarget`)},[E,S,y]),t.n(()=>{E||!b||!w||N(w)},[E,b,w,N]),n.r({enabled:!E&&b,inside:[w,S,...g??[]],onDismiss:(e,t)=>x(!1,{reason:e,event:t})}),n.n({enabled:!E&&b,returnTo:S});let L=n.a(e=>{x(e=>!e,{reason:`trigger`,event:e})});return{platform:E,isOpen:b,setOpen:x,id:y,trigger:(0,a.useMemo)(()=>({ref:C,props:{"aria-expanded":b,"aria-haspopup":s,"aria-controls":b?y:void 0,...E?{}:{onClick:L}}}),[L,s,b,y,E]),triggerElement:S,triggerId:k,setPanel:T,panelElement:w}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/layer.mjs
CHANGED