@box-kite/react 2.2.17 → 2.2.18
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 +3 -3
- package/.claude/skills/box-kite/SKILL.md +3 -3
- package/.claude/skills/box-kite/references/components.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +1 -1
- package/.cursor/rules/box-kite.mdc +3 -3
- package/AGENTS.md +3 -3
- package/BOX_AI_CONTEXT.md +2 -2
- package/BOX_KITE_AI_CONTEXT.md +2 -2
- package/behavior.cjs +1 -1
- package/behavior.mjs +62 -62
- package/catalog.cjs +1 -1
- package/catalog.mjs +3 -3
- package/client.cjs +1 -1
- package/client.mjs +15 -15
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +1 -1
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +1 -1
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +1 -1
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid.cjs +2 -2
- package/components/dataGrid.mjs +11 -11
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +1 -1
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +2 -5
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +108 -101
- package/components/form.cjs +1 -1
- package/components/form.mjs +1 -1
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +1 -1
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +4 -4
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +1 -1
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +1 -1
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +1 -1
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +1 -1
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +11 -11
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +133 -115
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.mjs +1 -1
- package/components/virtualList.cjs +1 -1
- package/components/virtualList.mjs +1 -1
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +17 -14
- package/package.json +2 -2
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +18 -11
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/utils/dom/domUtils.d.ts +7 -0
package/placement.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as e, m as t } from "./platform.mjs";
|
|
2
2
|
import { n } from "./effects.mjs";
|
|
3
3
|
import { t as r } from "./identity.mjs";
|
|
4
4
|
import { useCallback as i, useState as a } from "react";
|
|
@@ -82,9 +82,9 @@ function S(o = {}) {
|
|
|
82
82
|
n(() => {
|
|
83
83
|
v() || O(!1);
|
|
84
84
|
}, []), n(() => {
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
let e = t(C);
|
|
86
|
+
if (e) return e.style.setProperty("anchor-name", E), () => {
|
|
87
|
+
e.style.removeProperty("anchor-name");
|
|
88
88
|
};
|
|
89
89
|
}, [C, E]), n(() => {
|
|
90
90
|
!D || !w || !j || I(l(getComputedStyle(j).getPropertyValue("position-area")));
|
|
@@ -96,16 +96,16 @@ function S(o = {}) {
|
|
|
96
96
|
d,
|
|
97
97
|
p
|
|
98
98
|
]), n(() => {
|
|
99
|
-
let n =
|
|
99
|
+
let n = t(C) ?? k;
|
|
100
100
|
if (D || !n || !j) return;
|
|
101
101
|
let r = () => {
|
|
102
|
-
let
|
|
102
|
+
let t = b(n), r = b(j), i = {
|
|
103
103
|
top: 0,
|
|
104
104
|
left: 0,
|
|
105
105
|
width: window.innerWidth,
|
|
106
106
|
height: window.innerHeight
|
|
107
|
-
}, a = g ? Math.max(r.width,
|
|
108
|
-
...m(
|
|
107
|
+
}, a = g ? Math.max(r.width, t.width) : r.width, o = {
|
|
108
|
+
...m(t, {
|
|
109
109
|
...r,
|
|
110
110
|
width: a
|
|
111
111
|
}, i, {
|
|
@@ -113,9 +113,9 @@ function S(o = {}) {
|
|
|
113
113
|
align: d,
|
|
114
114
|
offset: f / h * y(),
|
|
115
115
|
flip: p,
|
|
116
|
-
rtl:
|
|
116
|
+
rtl: e(n)
|
|
117
117
|
}),
|
|
118
|
-
anchorWidth:
|
|
118
|
+
anchorWidth: t.width
|
|
119
119
|
};
|
|
120
120
|
P((e) => x(e, o) ? e : o);
|
|
121
121
|
};
|
package/platform.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}function d(){return typeof window<`u`&&window.document!==void 0}function
|
|
1
|
+
var e=globalThis[Symbol.for(`box-kite.componentAttribute`)]??={on:!1,warnings:!0},t=()=>e.on,n=()=>e.warnings;function r(t){e.on=t}function i(t){e.warnings=t}function a(e){return e?`current`in e?e.current:e:null}function o(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function s(e){let t=a(e);return t instanceof HTMLElement?t:null}function c(e,t){let n=typeof e.composedPath==`function`?e.composedPath():[];return t.some(t=>{let r=a(t);return r?n.includes(r)||e.target instanceof Node&&r.contains(e.target):!1})}function l(e){let t=a(e),n=t?.ownerDocument?.defaultView;return!!t&&!!n&&n.getComputedStyle(t).direction===`rtl`}function u(e){let t=a(e)?.ownerDocument?.defaultView?.getSelection();t&&!t.isCollapsed&&t.removeAllRanges()}var d=`box-kite:modal`;function f(e,t){e.ownerDocument.dispatchEvent(new CustomEvent(d,{detail:{dialog:e,open:t}}))}function p(){return typeof window<`u`&&window.document!==void 0}function m(){try{return process.env.NODE_ENV!==`production`}catch{return!1}}function h(){return typeof document<`u`}function g(){return h()?document:null}function _(){return g()?.documentElement??null}function v(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`}function y(){return typeof HTMLDialogElement<`u`&&`closedBy`in HTMLDialogElement.prototype}function b(e){return typeof window>`u`||typeof window.matchMedia!=`function`?null:window.matchMedia(e)}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return r}});
|
package/platform.mjs
CHANGED
|
@@ -36,35 +36,42 @@ function u(e) {
|
|
|
36
36
|
let t = a(e)?.ownerDocument?.defaultView?.getSelection();
|
|
37
37
|
t && !t.isCollapsed && t.removeAllRanges();
|
|
38
38
|
}
|
|
39
|
+
var d = "box-kite:modal";
|
|
40
|
+
function f(e, t) {
|
|
41
|
+
e.ownerDocument.dispatchEvent(new CustomEvent(d, { detail: {
|
|
42
|
+
dialog: e,
|
|
43
|
+
open: t
|
|
44
|
+
} }));
|
|
45
|
+
}
|
|
39
46
|
//#endregion
|
|
40
47
|
//#region src/utils/environment/environmentUtils.ts
|
|
41
|
-
function
|
|
48
|
+
function p() {
|
|
42
49
|
return typeof window < "u" && window.document !== void 0;
|
|
43
50
|
}
|
|
44
|
-
function
|
|
51
|
+
function m() {
|
|
45
52
|
try {
|
|
46
53
|
return process.env.NODE_ENV !== "production";
|
|
47
54
|
} catch {
|
|
48
55
|
return !1;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
|
-
function
|
|
58
|
+
function h() {
|
|
52
59
|
return typeof document < "u";
|
|
53
60
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
61
|
+
function g() {
|
|
62
|
+
return h() ? document : null;
|
|
56
63
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
64
|
+
function _() {
|
|
65
|
+
return g()?.documentElement ?? null;
|
|
59
66
|
}
|
|
60
|
-
function
|
|
67
|
+
function v() {
|
|
61
68
|
return typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
|
|
62
69
|
}
|
|
63
|
-
function
|
|
70
|
+
function y() {
|
|
64
71
|
return typeof HTMLDialogElement < "u" && "closedBy" in HTMLDialogElement.prototype;
|
|
65
72
|
}
|
|
66
|
-
function
|
|
73
|
+
function b(e) {
|
|
67
74
|
return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
|
|
68
75
|
}
|
|
69
76
|
//#endregion
|
|
70
|
-
export {
|
|
77
|
+
export { t as _, m as a, n as b, v as c, o as d, u as f, l as g, c as h, p as i, d as l, s as m, _ as n, b as o, a as p, h as r, y as s, g as t, f as u, i as v, r as y };
|
package/react-shared.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime.cjs"),t=require("./platform.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");function i({classNames:e,styleElements:t},n){return{className:(0,r.classNames)(e,n).join(` `),styles:t}}var a=parseInt(n.default.version,10)>=19;function o(e,t){let r=a?({ref:t,...n})=>e(n,t??null):(0,n.forwardRef)(e),i=(0,n.memo)(r);return r.displayName=t,i.displayName=t,i}var s={selected:`aria-selected`},c;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[s[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(c||={});var l=c;function u(e,n){let i=e,{props:a,className:o,disabled:s,required:c,checked:u,selected:d}=i,f={...a,className:(0,r.classNames)(n,o).join(` `)};return typeof i.component==`string`&&t.
|
|
1
|
+
const e=require("./rolldown-runtime.cjs"),t=require("./platform.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");function i({classNames:e,styleElements:t},n){return{className:(0,r.classNames)(e,n).join(` `),styles:t}}var a=parseInt(n.default.version,10)>=19;function o(e,t){let r=a?({ref:t,...n})=>e(n,t??null):(0,n.forwardRef)(e),i=(0,n.memo)(r);return r.displayName=t,i.displayName=t,i}var s={selected:`aria-selected`},c;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[s[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(c||={});var l=c;function u(e,n){let i=e,{props:a,className:o,disabled:s,required:c,checked:u,selected:d}=i,f={...a,className:(0,r.classNames)(n,o).join(` `)};return typeof i.component==`string`&&t._()&&(f[`data-bk`]??=i.component),l.assignBooleanProp(s,`disabled`,f),l.assignBooleanProp(c,`required`,f),l.assignBooleanProp(u,`checked`,f),l.assignBooleanProp(d,`selected`,f),`style`in i&&(f.style=i.style),`id`in i&&(f.id=i.id),f}var d=parseInt(n.default.version,10)>=19,f=!1,p=new WeakMap,m=new WeakMap;function h(e){let t=p.get(e);if(!t){let{href:r,css:i,precedence:a}=e;t=n.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),p.set(e,t)}return t}function g(e){if(!e?.length)return;!d&&!f&&(f=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${n.default.version} will render them inline. Use the default sink instead.`));let t=m.get(e);return t||(t=e.map(h),m.set(e,t)),t}function _(e,t,n){let{classNames:i,signature:a,styleElements:o}=(0,r.getDefaultEngine)().resolveClassNames(e,t,n);return{classNames:i,signature:a,styleElements:g(o)}}var v=`__boxAttributesInProps`;function y(e){return e[v]=!0,e}function b(e){return typeof e==`function`||typeof e==`object`&&e?e[v]===!0:!1}var x=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function S(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&x.some(e=>e in t)))return{"aria-hidden":!0}}var C;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(C||={});var w=C,T;(function(e){function t(e,t,n){let r={...e},i=r.props||{};return t.forEach(e=>{e in r&&(i[e]=r[e],delete r[e])}),n&&Object.entries(n).forEach(([e,t])=>{i[e]=t}),r.props=i,r}e.buildProps=t;function n(e){return!!e&&typeof e==`object`}e.isObject=n;function r(e,t){return e in t}e.isKeyOf=r})(T||={});var E=T,D=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],O=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function k(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return g}});
|
package/react-shared.mjs
CHANGED
package/scrolling.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./platform.cjs");function t(e,t,n=e.length){let r=0,i=n-1;if(i<=0)return 0;for(;r<i;){let n=r+i+1>>>1;e[n]<=t?r=n:i=n-1}return r}function n(t){let n=e.
|
|
1
|
+
const e=require("./platform.cjs");function t(e,t,n=e.length){let r=0,i=n-1;if(i<=0)return 0;for(;r<i;){let n=r+i+1>>>1;e[n]<=t?r=n:i=n-1}return r}function n(t){let n=e.p(t),r=n?.ownerDocument?.defaultView;if(!n||!r)return null;let i=n.ownerDocument.scrollingElement??n.ownerDocument.documentElement;for(let e=n.parentElement;e&&e!==i&&e!==n.ownerDocument.body;e=e.parentElement)if(/auto|scroll|overlay/.test(r.getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return null}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/scrolling.mjs
CHANGED
package/utils/dom/domUtils.d.ts
CHANGED
|
@@ -36,3 +36,10 @@ export declare function isRtl(value: ElementLike): boolean;
|
|
|
36
36
|
* which the browser repairs to the nearest boundary and then paints over whatever is rendered inside it.
|
|
37
37
|
*/
|
|
38
38
|
export declare function clearSelection(element: ElementLike): void;
|
|
39
|
+
/** What a `<Dialog>` dispatches on its document when it opens or closes as a modal, since everything outside one is inert. */
|
|
40
|
+
export declare const MODAL_EVENT = "box-kite:modal";
|
|
41
|
+
export type ModalEventDetail = {
|
|
42
|
+
dialog: HTMLElement;
|
|
43
|
+
open: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare function announceModal(dialog: HTMLElement, open: boolean): void;
|