@box-kite/react 2.0.1 → 2.2.0
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 +24 -2
- package/.claude/skills/box-kite/SKILL.md +27 -5
- package/.claude/skills/box-kite/references/components.md +8 -3
- package/.claude/skills/box-kite/references/patterns.md +24 -1
- package/.claude/skills/box-kite/references/styling.md +23 -0
- package/.cursor/rules/box-kite.mdc +25 -3
- package/AGENTS.md +28 -3
- package/BOX_AI_CONTEXT.md +732 -12
- package/BOX_KITE_AI_CONTEXT.md +732 -12
- package/README.md +41 -9
- package/box.cjs +1 -1
- package/box.d.ts +13 -2
- package/box.mjs +25 -18
- package/catalog.cjs +1 -0
- package/catalog.d.ts +8 -0
- package/catalog.mjs +2347 -0
- package/client.cjs +1 -1
- package/client.mjs +59 -53
- package/components/agent.cjs +1 -0
- package/components/agent.d.ts +215 -0
- package/components/agent.mjs +405 -0
- package/components/button.cjs +1 -1
- package/components/button.mjs +10 -14
- package/components/chart.d.ts +1 -0
- package/components/dashboard.cjs +1 -0
- package/components/dashboard.d.ts +121 -0
- package/components/dashboard.mjs +690 -0
- package/components/dataGrid/components/dataGridBody.d.ts +2 -1
- package/components/dataGrid/components/dataGridDetailRow.d.ts +13 -2
- package/components/dataGrid/components/dataGridGroupRow.d.ts +13 -2
- package/components/dataGrid/components/dataGridRow.d.ts +13 -2
- package/components/dataGrid/contracts/dataGridContract.d.ts +66 -2
- package/components/dataGrid/models/cellModel.d.ts +3 -0
- package/components/dataGrid/models/editModel.d.ts +27 -0
- package/components/dataGrid/models/exportModel.d.ts +2 -1
- package/components/dataGrid/models/gridModel.d.ts +3 -0
- package/components/dataGrid/models/rangeModel.d.ts +119 -0
- package/components/dataGrid/models/viewportModel.d.ts +23 -2
- package/components/dataGrid/useGridNavigation.d.ts +10 -2
- package/components/dataGrid.cjs +4 -1
- package/components/dataGrid.d.ts +3 -0
- package/components/dataGrid.mjs +1056 -765
- package/components/flex.cjs +1 -1
- package/components/flex.mjs +10 -13
- package/components/form.cjs +1 -1
- package/components/form.mjs +7 -7
- package/components/grid.cjs +1 -1
- package/components/grid.mjs +10 -13
- package/components/markdown.cjs +1 -0
- package/components/markdown.d.ts +55 -0
- package/components/markdown.mjs +179 -0
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +16 -16
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +35 -34
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +4 -4
- package/components/semantics.cjs +1 -1
- package/components/semantics.d.ts +29 -29
- package/components/semantics.mjs +9 -13
- package/components/skeleton.cjs +1 -0
- package/components/skeleton.d.ts +34 -0
- package/components/skeleton.mjs +25 -0
- package/components/svg.cjs +1 -1
- package/components/svg.mjs +38 -44
- package/components/textarea.cjs +1 -1
- package/components/textarea.mjs +12 -16
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +12 -16
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +42 -43
- package/components/visuallyHidden.cjs +1 -1
- package/components/visuallyHidden.mjs +10 -13
- package/dashboardSchema.cjs +1 -0
- package/dashboardSchema.mjs +78 -0
- package/docs/a11y.md +2 -3
- package/docs/catalog.md +451 -0
- package/docs/components.md +4 -0
- package/docs/index.md +3 -0
- package/docs/interop.md +237 -0
- package/docs/mcp.md +70 -0
- package/docs/props.md +135 -23
- package/interop.cjs +1 -0
- package/interop.d.ts +51 -0
- package/interop.mjs +454 -0
- package/layer.cjs +1 -1
- package/layer.mjs +61 -59
- package/mcp/src/data.d.ts +88 -0
- package/mcp/src/data.test.d.ts +1 -0
- package/mcp/src/engine.d.ts +23 -0
- package/mcp/src/index.d.ts +1 -0
- package/mcp/src/search.d.ts +26 -0
- package/mcp/src/search.test.d.ts +1 -0
- package/mcp/src/server.d.ts +18 -0
- package/mcp/src/server.test.d.ts +1 -0
- package/mcp/src/styles.d.ts +27 -0
- package/mcp/src/styles.test.d.ts +1 -0
- package/mcp/src/tools.d.ts +18 -0
- package/mcp/src/vocabulary.d.ts +41 -0
- package/package.json +170 -37
- package/react/boxComponent.d.ts +10 -0
- package/react/popover/useTopLayer.d.ts +17 -0
- package/react/spec/renderSpec.d.ts +51 -0
- package/react/spec/specBoundary.d.ts +25 -0
- package/react/spec/specRegistry.d.ts +42 -0
- package/react/spec/specRenderer.d.ts +10 -0
- package/react/theme/theme.d.ts +10 -0
- package/react/useStyles.d.ts +2 -0
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +44 -37
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +22 -0
- package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +13 -0
- package/registry/blocks/data-grid/invoice-rows.d.ts +15 -0
- package/registry/blocks/data-grid/invoices-grid.d.ts +1 -0
- package/registry/blocks/settings-form/settings-form.d.ts +17 -0
- package/rsc.cjs +1 -1
- package/rsc.d.ts +11 -1
- package/rsc.mjs +15 -12
- package/spec.cjs +2 -0
- package/spec.d.ts +12 -0
- package/spec.mjs +382 -0
- package/specData.cjs +1 -0
- package/specData.mjs +69 -0
- package/specDefs.cjs +1 -0
- package/specDefs.mjs +33 -0
- package/specSchema.cjs +1 -0
- package/specSchema.mjs +88 -0
- package/ssg.cjs +1 -1
- package/ssg.d.ts +8 -2
- package/ssg.mjs +13 -9
- package/utils/agent/agentUtils.d.ts +81 -0
- package/utils/catalog/catalogContracts.d.ts +19 -0
- package/utils/catalog/catalogManifest.d.ts +8 -0
- package/utils/dashboard/dashboardSchema.d.ts +18 -0
- package/utils/dashboard/dashboardUtils.d.ts +97 -0
- package/utils/environment/environmentUtils.d.ts +5 -0
- package/utils/interop/a2uiInterop.d.ts +82 -0
- package/utils/interop/assistantUiInterop.d.ts +34 -0
- package/utils/interop/toolInterop.d.ts +30 -0
- package/utils/spec/specData.d.ts +19 -0
- package/utils/spec/specDefs.d.ts +11 -0
- package/utils/spec/specProps.d.ts +15 -0
- package/utils/spec/specSchema.d.ts +23 -0
- package/utils/spec/specTypes.d.ts +71 -0
- package/utils/spec/specValidate.d.ts +10 -0
package/components/semantics.mjs
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { a as e } from "../react-shared.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import r from "@box-kite/react";
|
|
1
|
+
import { a as e, f as t } from "../react-shared.mjs";
|
|
2
|
+
import { useBoxElement as n } from "@box-kite/react";
|
|
5
3
|
//#region src/components/semantics.tsx
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
tag:
|
|
9
|
-
|
|
10
|
-
component: i,
|
|
4
|
+
function r(r) {
|
|
5
|
+
return t((e, t) => n({
|
|
6
|
+
tag: r,
|
|
7
|
+
component: r,
|
|
11
8
|
...e
|
|
12
|
-
}));
|
|
13
|
-
return a.displayName = e.capitalize(i), a;
|
|
9
|
+
}, t), e.capitalize(r));
|
|
14
10
|
}
|
|
15
|
-
var
|
|
11
|
+
var i = r("label"), a = r("span"), o = r("article"), s = r("aside"), c = r("details"), l = r("figcaption"), u = r("figure"), d = r("footer"), f = r("header"), p = r("main"), m = r("mark"), h = r("nav"), g = r("menu"), _ = g, v = r("section"), y = r("summary"), b = r("time"), x = r("p"), S = r("ul"), C = r("ol"), w = r("li"), T = r("h1"), E = r("h2"), D = r("h3"), O = r("h4"), k = r("h5"), A = r("h6"), j = r("a"), M = r("img");
|
|
16
12
|
//#endregion
|
|
17
|
-
export {
|
|
13
|
+
export { o as Article, s as Aside, c as Details, l as Figcaption, u as Figure, d as Footer, T as H1, E as H2, D as H3, O as H4, k as H5, A as H6, f as Header, M as Img, i as Label, w as Li, j as Link, p as Main, m as Mark, _ as Menu, g as MenuList, h as Nav, C as Ol, x as P, v as Section, a as Span, y as Summary, b as Time, S as Ul };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../rolldown-runtime.cjs"),t=require("./visuallyHidden.cjs");let n=require("react/jsx-runtime"),r=require("@box-kite/react");r=e.t(r,1);function i(e){let{lines:i=1,circle:a=!1,label:o,props:s,...c}=e,l=a?1:Math.max(1,Math.trunc(i));return(0,n.jsxs)(r.default,{component:`skeleton`,...c,props:{...o===void 0?{"aria-hidden":!0}:{role:`status`},...s},children:[Array.from({length:l},(e,t)=>(0,n.jsx)(r.default,{component:`skeleton.bar`,variant:{circle:a,short:!a&&l>1&&t===l-1},children:(0,n.jsx)(r.default,{component:`skeleton.gloss`})},t)),o!==void 0&&(0,n.jsx)(t.default,{children:o})]})}exports.default=i;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
|
+
import { ComponentsAndVariants } from '@box-kite/core/types';
|
|
4
|
+
export interface SkeletonProps<TKey extends keyof ComponentsAndVariants = 'skeleton'> extends BoxProps<'div', TKey> {
|
|
5
|
+
/** How many bars to draw. Default `1`; past that the last one is short, the way a paragraph's last line is. */
|
|
6
|
+
lines?: number;
|
|
7
|
+
/** A round placeholder — an avatar, a thumbnail. `width` sets its size and the height follows. */
|
|
8
|
+
circle?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* What is loading, for a reader. It makes the skeleton a `role="status"` with the words in it, so put
|
|
11
|
+
* it on the one skeleton that stands for a region and leave it off the rest — a screen of placeholders
|
|
12
|
+
* each announcing itself is a screen nobody can listen to.
|
|
13
|
+
*/
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Where content will be, while it is being fetched.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Skeleton lines={3} label="Loading orders" />
|
|
21
|
+
* <Skeleton circle width={10} />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* **Decoration by default**: with no `label` the whole thing is `aria-hidden`, because a reader told
|
|
25
|
+
* "three empty bars" has been told nothing. What announces a load is the content arriving in a region the
|
|
26
|
+
* page already had — which is also why a `label` is what somebody hears on *landing* rather than a
|
|
27
|
+
* guaranteed announcement: a live region inserted together with its text is not reliably read out.
|
|
28
|
+
*
|
|
29
|
+
* The gloss crossing each bar is a named duration, so it sits outside what `--transitionTime` zeroes and
|
|
30
|
+
* stops itself under `prefers-reduced-motion`. It renders on a server: no state, no effect, no measurement.
|
|
31
|
+
*
|
|
32
|
+
* @a11y `aria-hidden` unless `label` is given, and then `role="status"` naming what is on its way.
|
|
33
|
+
*/
|
|
34
|
+
export default function Skeleton<TKey extends keyof ComponentsAndVariants = 'skeleton'>(props: SkeletonProps<TKey>): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "./visuallyHidden.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@box-kite/react";
|
|
4
|
+
//#region src/components/skeleton.tsx
|
|
5
|
+
function i(i) {
|
|
6
|
+
let { lines: a = 1, circle: o = !1, label: s, props: c, ...l } = i, u = o ? 1 : Math.max(1, Math.trunc(a));
|
|
7
|
+
return /* @__PURE__ */ n(r, {
|
|
8
|
+
component: "skeleton",
|
|
9
|
+
...l,
|
|
10
|
+
props: {
|
|
11
|
+
...s === void 0 ? { "aria-hidden": !0 } : { role: "status" },
|
|
12
|
+
...c
|
|
13
|
+
},
|
|
14
|
+
children: [Array.from({ length: u }, (e, n) => /* @__PURE__ */ t(r, {
|
|
15
|
+
component: "skeleton.bar",
|
|
16
|
+
variant: {
|
|
17
|
+
circle: o,
|
|
18
|
+
short: !o && u > 1 && n === u - 1
|
|
19
|
+
},
|
|
20
|
+
children: /* @__PURE__ */ t(r, { component: "skeleton.gloss" })
|
|
21
|
+
}, n)), s !== void 0 && /* @__PURE__ */ t(e, { children: s })]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as default };
|
package/components/svg.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../react-shared.cjs");let t=require("@box-kite/react");function n(e,t){let{props:n,...r}=e,i=r,a;for(let e of t)e in i&&((a??={})[e]=i[e],delete i[e]);return{styleProps:i,tagProps:a?{...n,...a}:n}}function r(r,i=[],a){let o=i;return e.c(e.f((e,i)=>{let{styleProps:a,tagProps:s}=n(e,o);return(0,t.useBoxElement)({tag:r,component:r,...a,props:s},i)},a??e.a.capitalize(r)))}var i=`http://www.w3.org/2000/svg`,a=[`viewBox`,`preserveAspectRatio`,`width`,`height`];function o(r,o){let{label:s,...c}=r,{styleProps:l,tagProps:u}=n(c,a);return(0,t.useBoxElement)({tag:`svg`,component:`svg`,...l,props:{xmlns:i,...e.o(s,u),...u}},o)}var s=e.c(e.f(o,`Svg`)),c=r(`g`,[`transform`]),l=r(`defs`),u=r(`path`,[`d`,`transform`,`pathLength`]),d=r(`circle`,[`transform`,`pathLength`]),f=r(`ellipse`,[`transform`,`pathLength`]),p=r(`rect`,[`width`,`height`,`transform`,`pathLength`]),m=r(`line`,[`x1`,`y1`,`x2`,`y2`,`transform`,`pathLength`]),h=r(`polyline`,[`points`,`transform`,`pathLength`]),g=r(`polygon`,[`points`,`transform`,`pathLength`]),_=r(`text`,[`x`,`y`,`dx`,`dy`,`textLength`,`lengthAdjust`,`transform`],`SvgText`),v=r(`tspan`,[`x`,`y`,`dx`,`dy`,`textLength`,`lengthAdjust`],`TSpan`),y=r(`linearGradient`,[`x1`,`y1`,`x2`,`y2`,`gradientUnits`,`gradientTransform`,`spreadMethod`]),b=r(`radialGradient`,[`cx`,`cy`,`r`,`fx`,`fy`,`gradientUnits`,`gradientTransform`,`spreadMethod`]),x=r(`stop`,[`offset`,`stopColor`,`stopOpacity`]),S=r(`clipPath`,[`clipPathUnits`,`transform`]),C=r(`mask`,[`maskUnits`,`maskContentUnits`,`x`,`y`,`width`,`height`]),w=r(`use`,[`href`,`width`,`height`,`transform`]),T=r(`symbol`,[`viewBox`,`preserveAspectRatio`,`x`,`y`,`width`,`height`],`SvgSymbol`),E=r(`marker`,[`markerWidth`,`markerHeight`,`refX`,`refY`,`orient`,`markerUnits`,`viewBox`]);exports.Circle=d,exports.ClipPath=S,exports.Defs=l,exports.Ellipse=f,exports.G=c,exports.Line=m,exports.LinearGradient=y,exports.Marker=E,exports.Mask=C,exports.Path=u,exports.Polygon=g,exports.Polyline=h,exports.RadialGradient=b,exports.Rect=p,exports.Stop=x,exports.Svg=s,exports.SvgSymbol=T,exports.SvgText=_,exports.TSpan=v,exports.Use=w;
|
package/components/svg.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { a as e, c as t,
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
-
import a from "@box-kite/react";
|
|
1
|
+
import { a as e, c as t, f as n, o as r } from "../react-shared.mjs";
|
|
2
|
+
import { useBoxElement as i } from "@box-kite/react";
|
|
5
3
|
//#region src/components/svg.tsx
|
|
6
|
-
function
|
|
4
|
+
function a(e, t) {
|
|
7
5
|
let { props: n, ...r } = e, i = r, a;
|
|
8
6
|
for (let e of t) e in i && ((a ??= {})[e] = i[e], delete i[e]);
|
|
9
7
|
return {
|
|
@@ -14,66 +12,62 @@ function o(e, t) {
|
|
|
14
12
|
} : n
|
|
15
13
|
};
|
|
16
14
|
}
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
component:
|
|
24
|
-
...
|
|
25
|
-
props:
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
return u.displayName = c ?? e.capitalize(n), t(u), u;
|
|
15
|
+
function o(r, o = [], s) {
|
|
16
|
+
let c = o;
|
|
17
|
+
return t(n((e, t) => {
|
|
18
|
+
let { styleProps: n, tagProps: o } = a(e, c);
|
|
19
|
+
return i({
|
|
20
|
+
tag: r,
|
|
21
|
+
component: r,
|
|
22
|
+
...n,
|
|
23
|
+
props: o
|
|
24
|
+
}, t);
|
|
25
|
+
}, s ?? e.capitalize(r)));
|
|
29
26
|
}
|
|
30
|
-
var
|
|
27
|
+
var s = "http://www.w3.org/2000/svg", c = [
|
|
31
28
|
"viewBox",
|
|
32
29
|
"preserveAspectRatio",
|
|
33
30
|
"width",
|
|
34
31
|
"height"
|
|
35
32
|
];
|
|
36
|
-
function
|
|
37
|
-
let { label:
|
|
38
|
-
return
|
|
33
|
+
function l(e, t) {
|
|
34
|
+
let { label: n, ...o } = e, { styleProps: l, tagProps: u } = a(o, c);
|
|
35
|
+
return i({
|
|
39
36
|
tag: "svg",
|
|
40
|
-
ref: t,
|
|
41
37
|
component: "svg",
|
|
42
|
-
...
|
|
38
|
+
...l,
|
|
43
39
|
props: {
|
|
44
|
-
xmlns:
|
|
45
|
-
...n
|
|
46
|
-
...
|
|
40
|
+
xmlns: s,
|
|
41
|
+
...r(n, u),
|
|
42
|
+
...u
|
|
47
43
|
}
|
|
48
|
-
});
|
|
44
|
+
}, t);
|
|
49
45
|
}
|
|
50
|
-
var
|
|
51
|
-
d.displayName = "Svg";
|
|
52
|
-
var f = /* @__PURE__ */ s("g", ["transform"]), p = /* @__PURE__ */ s("defs"), m = /* @__PURE__ */ s("path", [
|
|
46
|
+
var u = /* @__PURE__ */ t(n(l, "Svg")), d = /* @__PURE__ */ o("g", ["transform"]), f = /* @__PURE__ */ o("defs"), p = /* @__PURE__ */ o("path", [
|
|
53
47
|
"d",
|
|
54
48
|
"transform",
|
|
55
49
|
"pathLength"
|
|
56
|
-
]),
|
|
50
|
+
]), m = /* @__PURE__ */ o("circle", ["transform", "pathLength"]), h = /* @__PURE__ */ o("ellipse", ["transform", "pathLength"]), g = /* @__PURE__ */ o("rect", [
|
|
57
51
|
"width",
|
|
58
52
|
"height",
|
|
59
53
|
"transform",
|
|
60
54
|
"pathLength"
|
|
61
|
-
]),
|
|
55
|
+
]), _ = /* @__PURE__ */ o("line", [
|
|
62
56
|
"x1",
|
|
63
57
|
"y1",
|
|
64
58
|
"x2",
|
|
65
59
|
"y2",
|
|
66
60
|
"transform",
|
|
67
61
|
"pathLength"
|
|
68
|
-
]),
|
|
62
|
+
]), v = /* @__PURE__ */ o("polyline", [
|
|
69
63
|
"points",
|
|
70
64
|
"transform",
|
|
71
65
|
"pathLength"
|
|
72
|
-
]),
|
|
66
|
+
]), y = /* @__PURE__ */ o("polygon", [
|
|
73
67
|
"points",
|
|
74
68
|
"transform",
|
|
75
69
|
"pathLength"
|
|
76
|
-
]),
|
|
70
|
+
]), b = /* @__PURE__ */ o("text", [
|
|
77
71
|
"x",
|
|
78
72
|
"y",
|
|
79
73
|
"dx",
|
|
@@ -81,14 +75,14 @@ var f = /* @__PURE__ */ s("g", ["transform"]), p = /* @__PURE__ */ s("defs"), m
|
|
|
81
75
|
"textLength",
|
|
82
76
|
"lengthAdjust",
|
|
83
77
|
"transform"
|
|
84
|
-
], "SvgText"),
|
|
78
|
+
], "SvgText"), x = /* @__PURE__ */ o("tspan", [
|
|
85
79
|
"x",
|
|
86
80
|
"y",
|
|
87
81
|
"dx",
|
|
88
82
|
"dy",
|
|
89
83
|
"textLength",
|
|
90
84
|
"lengthAdjust"
|
|
91
|
-
], "TSpan"),
|
|
85
|
+
], "TSpan"), S = /* @__PURE__ */ o("linearGradient", [
|
|
92
86
|
"x1",
|
|
93
87
|
"y1",
|
|
94
88
|
"x2",
|
|
@@ -96,7 +90,7 @@ var f = /* @__PURE__ */ s("g", ["transform"]), p = /* @__PURE__ */ s("defs"), m
|
|
|
96
90
|
"gradientUnits",
|
|
97
91
|
"gradientTransform",
|
|
98
92
|
"spreadMethod"
|
|
99
|
-
]),
|
|
93
|
+
]), C = /* @__PURE__ */ o("radialGradient", [
|
|
100
94
|
"cx",
|
|
101
95
|
"cy",
|
|
102
96
|
"r",
|
|
@@ -105,30 +99,30 @@ var f = /* @__PURE__ */ s("g", ["transform"]), p = /* @__PURE__ */ s("defs"), m
|
|
|
105
99
|
"gradientUnits",
|
|
106
100
|
"gradientTransform",
|
|
107
101
|
"spreadMethod"
|
|
108
|
-
]),
|
|
102
|
+
]), w = /* @__PURE__ */ o("stop", [
|
|
109
103
|
"offset",
|
|
110
104
|
"stopColor",
|
|
111
105
|
"stopOpacity"
|
|
112
|
-
]),
|
|
106
|
+
]), T = /* @__PURE__ */ o("clipPath", ["clipPathUnits", "transform"]), E = /* @__PURE__ */ o("mask", [
|
|
113
107
|
"maskUnits",
|
|
114
108
|
"maskContentUnits",
|
|
115
109
|
"x",
|
|
116
110
|
"y",
|
|
117
111
|
"width",
|
|
118
112
|
"height"
|
|
119
|
-
]),
|
|
113
|
+
]), D = /* @__PURE__ */ o("use", [
|
|
120
114
|
"href",
|
|
121
115
|
"width",
|
|
122
116
|
"height",
|
|
123
117
|
"transform"
|
|
124
|
-
]),
|
|
118
|
+
]), O = /* @__PURE__ */ o("symbol", [
|
|
125
119
|
"viewBox",
|
|
126
120
|
"preserveAspectRatio",
|
|
127
121
|
"x",
|
|
128
122
|
"y",
|
|
129
123
|
"width",
|
|
130
124
|
"height"
|
|
131
|
-
], "SvgSymbol"),
|
|
125
|
+
], "SvgSymbol"), k = /* @__PURE__ */ o("marker", [
|
|
132
126
|
"markerWidth",
|
|
133
127
|
"markerHeight",
|
|
134
128
|
"refX",
|
|
@@ -138,4 +132,4 @@ var f = /* @__PURE__ */ s("g", ["transform"]), p = /* @__PURE__ */ s("defs"), m
|
|
|
138
132
|
"viewBox"
|
|
139
133
|
]);
|
|
140
134
|
//#endregion
|
|
141
|
-
export {
|
|
135
|
+
export { m as Circle, T as ClipPath, f as Defs, h as Ellipse, d as G, _ as Line, S as LinearGradient, k as Marker, E as Mask, p as Path, y as Polygon, v as Polyline, C as RadialGradient, g as Rect, w as Stop, u as Svg, O as SvgSymbol, b as SvgText, x as TSpan, D as Use };
|
package/components/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../forms.cjs");let n=require("@box-kite/react");var r=[`name`,`onInput`,`onChange`,`value`,`defaultValue`,`rows`,`cols`,`autoFocus`,`maxLength`,`minLength`,`readOnly`];function i(i,a){let{placeholder:o,...s}=i,{text:c,styles:l}=t.t(o),u=e.i.buildProps(s,r,c===void 0?void 0:{placeholder:c});return(0,n.useBoxElement)({tag:`textarea`,component:`textarea`,...u,placeholder:l},a)}var a=e.f(i,`Textarea`);exports.default=a;
|
package/components/textarea.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../forms.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
import i from "@box-kite/react";
|
|
1
|
+
import { f as e, i as t } from "../react-shared.mjs";
|
|
2
|
+
import { t as n } from "../forms.mjs";
|
|
3
|
+
import { useBoxElement as r } from "@box-kite/react";
|
|
6
4
|
//#region src/components/textarea.tsx
|
|
7
|
-
var
|
|
5
|
+
var i = [
|
|
8
6
|
"name",
|
|
9
7
|
"onInput",
|
|
10
8
|
"onChange",
|
|
@@ -17,17 +15,15 @@ var a = [
|
|
|
17
15
|
"minLength",
|
|
18
16
|
"readOnly"
|
|
19
17
|
];
|
|
20
|
-
function
|
|
21
|
-
let { placeholder:
|
|
22
|
-
return
|
|
23
|
-
ref: o,
|
|
18
|
+
function a(e, a) {
|
|
19
|
+
let { placeholder: o, ...s } = e, { text: c, styles: l } = n(o), u = t.buildProps(s, i, c === void 0 ? void 0 : { placeholder: c });
|
|
20
|
+
return r({
|
|
24
21
|
tag: "textarea",
|
|
25
22
|
component: "textarea",
|
|
26
|
-
...
|
|
27
|
-
placeholder:
|
|
28
|
-
});
|
|
23
|
+
...u,
|
|
24
|
+
placeholder: l
|
|
25
|
+
}, a);
|
|
29
26
|
}
|
|
30
|
-
var
|
|
31
|
-
s.displayName = "Textarea";
|
|
27
|
+
var o = e(a, "Textarea");
|
|
32
28
|
//#endregion
|
|
33
|
-
export {
|
|
29
|
+
export { o as default };
|
package/components/textbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../forms.cjs");let n=require("@box-kite/react");var r=[`name`,`onInput`,`onChange`,`type`,`step`,`defaultValue`,`autoFocus`,`readOnly`,`required`,`value`,`pattern`];function i(i,a){let{placeholder:o,...s}=i,{text:c,styles:l}=t.t(o),u=e.i.buildProps(s,r,c===void 0?void 0:{placeholder:c});return(0,n.useBoxElement)({tag:`input`,component:`textbox`,...u,placeholder:l},a)}var a=e.f(i,`Textbox`);exports.default=a;
|
package/components/textbox.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../forms.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
import i from "@box-kite/react";
|
|
1
|
+
import { f as e, i as t } from "../react-shared.mjs";
|
|
2
|
+
import { t as n } from "../forms.mjs";
|
|
3
|
+
import { useBoxElement as r } from "@box-kite/react";
|
|
6
4
|
//#region src/components/textbox.tsx
|
|
7
|
-
var
|
|
5
|
+
var i = [
|
|
8
6
|
"name",
|
|
9
7
|
"onInput",
|
|
10
8
|
"onChange",
|
|
@@ -17,17 +15,15 @@ var a = [
|
|
|
17
15
|
"value",
|
|
18
16
|
"pattern"
|
|
19
17
|
];
|
|
20
|
-
function
|
|
21
|
-
let { placeholder:
|
|
22
|
-
return
|
|
23
|
-
ref: o,
|
|
18
|
+
function a(e, a) {
|
|
19
|
+
let { placeholder: o, ...s } = e, { text: c, styles: l } = n(o), u = t.buildProps(s, i, c === void 0 ? void 0 : { placeholder: c });
|
|
20
|
+
return r({
|
|
24
21
|
tag: "input",
|
|
25
22
|
component: "textbox",
|
|
26
|
-
...
|
|
27
|
-
placeholder:
|
|
28
|
-
});
|
|
23
|
+
...u,
|
|
24
|
+
placeholder: l
|
|
25
|
+
}, a);
|
|
29
26
|
}
|
|
30
|
-
var
|
|
31
|
-
s.displayName = "Textbox";
|
|
27
|
+
var o = e(a, "Textbox");
|
|
32
28
|
//#endregion
|
|
33
|
-
export {
|
|
29
|
+
export { o as default };
|
package/components/toaster.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../client.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../motion.cjs");let
|
|
1
|
+
"use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../client.cjs"),n=require("../effects.cjs"),r=require("../box.cjs"),i=require("../layer.cjs"),a=require("../motion.cjs");let o=require("react"),s=require("react-dom"),c=require("react/jsx-runtime"),l=require("use-sync-external-store/shim");var u={toasts:[],overflow:0},d=0;function f(){return d+=1,`toast-${d}`}function p(e){let t=[],n=u,r=e?.limit??3,i=e?.duration??5e3,a=!1,o=new Set,s=new Map,c=e=>{let t=s.get(e);t?.handle&&clearTimeout(t.handle),s.delete(e)},l=()=>{let e=0;t=t.map(t=>{let n=!t.open||e++<r;return t.visible===n?t:{...t,visible:n}}),n={toasts:t,overflow:Math.max(0,e-r)},d(),o.forEach(e=>e())};function d(){let e=new Set;for(let n of t){if(!n.open||!n.visible||!Number.isFinite(n.duration))continue;e.add(n.id);let t=s.get(n.id)??{handle:null,remaining:n.duration,startedAt:0};s.set(n.id,t),!(a||t.handle)&&(t.startedAt=Date.now(),t.handle=setTimeout(()=>{s.delete(n.id),m(n.id,`timeout`)},t.remaining))}for(let t of[...s.keys()])e.has(t)||c(t)}let p=(e,t)=>t??(e===`loading`?1/0:i);function m(e,n=`imperative`){let r=[];t=t.map(t=>!t.open||e!==void 0&&t.id!==e?t:(r.push(t),c(t.id),{...t,open:!1})),r.length&&(l(),r.forEach(e=>e.onDismiss?.(n)))}function h(e,n,r){let i=!1;t=t.map(t=>{if(t.id!==e)return t;i=!0,c(e);let a=r?.kind??t.kind;return{...t,...r,id:e,message:n,kind:a,duration:r?.duration??(r?.kind?p(a):t.duration),open:!0}}),i&&l()}function g(e,n){let r=n?.id??f();if(n?.id&&t.some(e=>e.id===r))return h(r,e,n),r;let i=n?.kind??`default`;return t=[...t,{id:r,kind:i,message:e,description:n?.description,duration:p(i,n?.duration),action:n?.action,dismissible:n?.dismissible??!0,onDismiss:n?.onDismiss,open:!0,visible:!1}],l(),r}return{subscribe(e){return o.add(e),()=>o.delete(e)},getSnapshot:()=>n,getServerSnapshot:()=>u,add:g,update:h,dismiss:m,remove(e){let n=t.filter(t=>t.id!==e);n.length!==t.length&&(c(e),t=n,l())},setLimit(e){e!==r&&(r=e,l())},setDefaultDuration(e){i=e},pause(){if(!a){a=!0;for(let e of s.values())e.handle&&(clearTimeout(e.handle),e.handle=null,e.remaining=Math.max(0,e.remaining-(Date.now()-e.startedAt)))}},resume(){a&&(a=!1,d())},reset(){for(let e of[...s.keys()])c(e);t=[],n=u,o.forEach(e=>e())}}}var m=p(),h=e=>(t,n)=>m.add(t,{...n,kind:e}),g=Object.assign((e,t)=>m.add(e,t),{success:h(`success`),error:h(`error`),warning:h(`warning`),info:h(`info`),loading:h(`loading`),update:(e,t,n)=>m.update(e,t,n),dismiss:e=>m.dismiss(e,`imperative`),promise(e,t,n){let r=m.add(t.loading,{...n,id:n?.id,kind:`loading`}),i=(e,t)=>typeof e==`function`?e(t):e;return e.then(e=>m.update(r,i(t.success,e),{kind:`success`}),e=>m.update(r,i(t.error,e),{kind:`error`})),e}}),_={"top-start":`topStart`,"top-center":`topCenter`,"top-end":`topEnd`,"bottom-start":`bottomStart`,"bottom-center":`bottomCenter`,"bottom-end":`bottomEnd`};function v(e,t){let n=t.toLowerCase().split(`+`),r=n[n.length-1],i=new Set(n.slice(0,-1));return e.key.toLowerCase()===r&&e.altKey===i.has(`alt`)&&e.ctrlKey===i.has(`ctrl`)&&e.shiftKey===i.has(`shift`)&&e.metaKey===i.has(`meta`)}function y(e){let{toast:t,store:i,fromTop:o,closeLabel:s}=e,{mounted:l,ref:u,props:d}=a.t({present:t.open});if(n.n(()=>{l||i.remove(t.id)},[l,i,t.id]),!l)return null;let f=t.action,p=()=>{f?.onClick(),f?.closeOnClick!==!1&&i.dismiss(t.id,`action`)};return(0,c.jsxs)(r.default,{ref:u,component:`toaster.toast`,variant:{[t.kind]:t.kind!=="default",fromTop:o},props:{...t.kind===`error`?{role:`alert`}:{},"data-toast-id":t.id,...d},children:[(0,c.jsx)(r.default,{component:`toaster.message`,children:t.message}),t.description!==void 0&&(0,c.jsx)(r.default,{component:`toaster.description`,children:t.description}),f&&(0,c.jsx)(r.default,{tag:`button`,component:`toaster.action`,props:{type:`button`,onClick:p},children:f.label}),t.dismissible&&(0,c.jsx)(r.default,{tag:`button`,component:`toaster.close`,props:{type:`button`,"aria-label":s,onClick:()=>i.dismiss(t.id,`close`)}})]})}function b(a){let{position:u=`bottom-end`,limit:d=3,duration:f=5e3,label:p=`Notifications`,closeLabel:h=`Close`,overflowLabel:g=e=>`+${e} more`,hotkey:b=`F6`,store:x=m,props:S,...C}=a,w=(0,l.useSyncExternalStore)(x.subscribe,x.getSnapshot,x.getServerSnapshot),T=i.n(),E=t.t(!T),D=(0,o.useRef)(null),O=(0,o.useRef)(null),k=(0,o.useRef)({hovered:!1,focused:!1,hidden:!1}),A=(0,o.useCallback)(()=>{let{hovered:e,focused:t,hidden:n}=k.current;e||t||n?x.pause():x.resume()},[x]);n.n(()=>x.setLimit(d),[x,d]),n.n(()=>x.setDefaultDuration(f),[x,f]),n.n(()=>{let t=D.current;!T||!e.a()||!t||!t.isConnected||t.matches(`:popover-open`)||t.showPopover()}),n.n(()=>{let t=e.t();if(!t)return;let n=new AbortController;return t.addEventListener(`visibilitychange`,()=>{k.current.hidden=t.hidden,A()},{signal:n.signal}),()=>n.abort()},[A]),n.n(()=>{let t=e.t();if(!b||!t)return;let n=new AbortController;return t.addEventListener(`keydown`,e=>{!v(e,b)||!D.current||(e.preventDefault(),O.current=t.activeElement,D.current.focus())},{signal:n.signal}),()=>n.abort()},[b]);let j=e=>!!e&&!!D.current?.contains(e),M=()=>{k.current.hovered=!0,A()},N=e=>{j(e.relatedTarget)||(k.current.hovered=!1,A())},P=e=>{k.current.focused=!0,A(),j(e.relatedTarget)||(O.current=e.relatedTarget)},F=e=>{j(e.relatedTarget)||(k.current.focused=!1,A())},I=e=>{if(e.key!==`Escape`)return;let t=(e.target.closest?.(`[data-toast-id]`))?.getAttribute(`data-toast-id`);t&&x.dismiss(t,`close`),x.getSnapshot().toasts.some(e=>e.open)?D.current?.focus():O.current?.focus()},L=u.startsWith(`top`),R=w.toasts.filter(e=>e.visible),z=L?[...R].reverse():R,B=w.overflow>0&&(0,c.jsx)(r.default,{component:`toaster.overflow`,children:g(w.overflow)}),V=(0,c.jsxs)(r.default,{tag:`section`,ref:D,component:`toaster`,...C,variant:[C.variant,{[_[u]]:!0}],props:{...T?{popover:`manual`}:{},"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions text`,"aria-label":p,tabIndex:-1,...S,onPointerOver:M,onPointerOut:N,onFocus:P,onBlur:F,onKeyDown:I},children:[!L&&B,z.map(e=>(0,c.jsx)(y,{toast:e,store:x,fromTop:L,closeLabel:h},e.id)),L&&B]});return T?V:E?(0,s.createPortal)(V,E):null}var x=b;x.displayName=`Toaster`,exports.createToastStore=p,exports.default=x,exports.defaultToastStore=m,exports.toast=g;
|
package/components/toaster.mjs
CHANGED
|
@@ -3,10 +3,11 @@ import { a as e, t } from "../platform.mjs";
|
|
|
3
3
|
import { t as n } from "../client.mjs";
|
|
4
4
|
import { n as r } from "../effects.mjs";
|
|
5
5
|
import i from "../box.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { createPortal as
|
|
6
|
+
import { n as a } from "../layer.mjs";
|
|
7
|
+
import { t as o } from "../motion.mjs";
|
|
8
|
+
import { useCallback as s, useRef as c } from "react";
|
|
9
|
+
import { createPortal as l } from "react-dom";
|
|
10
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
11
|
import { useSyncExternalStore as f } from "use-sync-external-store/shim";
|
|
11
12
|
//#region src/utils/toast/toastStore.ts
|
|
12
13
|
var p = {
|
|
@@ -159,7 +160,7 @@ function x(e, t) {
|
|
|
159
160
|
return e.key.toLowerCase() === r && e.altKey === i.has("alt") && e.ctrlKey === i.has("ctrl") && e.shiftKey === i.has("shift") && e.metaKey === i.has("meta");
|
|
160
161
|
}
|
|
161
162
|
function S(e) {
|
|
162
|
-
let { toast: t, store: n, fromTop:
|
|
163
|
+
let { toast: t, store: n, fromTop: a, closeLabel: s } = e, { mounted: c, ref: l, props: f } = o({ present: t.open });
|
|
163
164
|
if (r(() => {
|
|
164
165
|
c || n.remove(t.id);
|
|
165
166
|
}, [
|
|
@@ -170,12 +171,12 @@ function S(e) {
|
|
|
170
171
|
let p = t.action, m = () => {
|
|
171
172
|
p?.onClick(), p?.closeOnClick !== !1 && n.dismiss(t.id, "action");
|
|
172
173
|
};
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
ref:
|
|
174
|
+
return /* @__PURE__ */ d(i, {
|
|
175
|
+
ref: l,
|
|
175
176
|
component: "toaster.toast",
|
|
176
177
|
variant: {
|
|
177
178
|
[t.kind]: t.kind !== "default",
|
|
178
|
-
fromTop:
|
|
179
|
+
fromTop: a
|
|
179
180
|
},
|
|
180
181
|
props: {
|
|
181
182
|
...t.kind === "error" ? { role: "alert" } : {},
|
|
@@ -183,15 +184,15 @@ function S(e) {
|
|
|
183
184
|
...f
|
|
184
185
|
},
|
|
185
186
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ u(i, {
|
|
187
188
|
component: "toaster.message",
|
|
188
189
|
children: t.message
|
|
189
190
|
}),
|
|
190
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
191
|
+
t.description !== void 0 && /* @__PURE__ */ u(i, {
|
|
191
192
|
component: "toaster.description",
|
|
192
193
|
children: t.description
|
|
193
194
|
}),
|
|
194
|
-
p && /* @__PURE__ */
|
|
195
|
+
p && /* @__PURE__ */ u(i, {
|
|
195
196
|
tag: "button",
|
|
196
197
|
component: "toaster.action",
|
|
197
198
|
props: {
|
|
@@ -200,7 +201,7 @@ function S(e) {
|
|
|
200
201
|
},
|
|
201
202
|
children: p.label
|
|
202
203
|
}),
|
|
203
|
-
t.dismissible && /* @__PURE__ */
|
|
204
|
+
t.dismissible && /* @__PURE__ */ u(i, {
|
|
204
205
|
tag: "button",
|
|
205
206
|
component: "toaster.close",
|
|
206
207
|
props: {
|
|
@@ -212,53 +213,51 @@ function S(e) {
|
|
|
212
213
|
]
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
|
-
function C(
|
|
216
|
-
let { position: p = "bottom-end", limit: m = 3, duration: h = 5e3, label: g = "Notifications", closeLabel: v = "Close", overflowLabel: y = (e) => `+${e} more`, hotkey: C = "F6", store: w = _, props: T, ...E } =
|
|
216
|
+
function C(o) {
|
|
217
|
+
let { position: p = "bottom-end", limit: m = 3, duration: h = 5e3, label: g = "Notifications", closeLabel: v = "Close", overflowLabel: y = (e) => `+${e} more`, hotkey: C = "F6", store: w = _, props: T, ...E } = o, D = f(w.subscribe, w.getSnapshot, w.getServerSnapshot), O = a(), k = n(!O), A = c(null), j = c(null), M = c({
|
|
217
218
|
hovered: !1,
|
|
218
219
|
focused: !1,
|
|
219
220
|
hidden: !1
|
|
220
|
-
}),
|
|
221
|
-
let { hovered: e, focused: t, hidden: n } =
|
|
221
|
+
}), N = s(() => {
|
|
222
|
+
let { hovered: e, focused: t, hidden: n } = M.current;
|
|
222
223
|
e || t || n ? w.pause() : w.resume();
|
|
223
224
|
}, [w]);
|
|
224
|
-
r(() => {
|
|
225
|
-
|
|
226
|
-
}, []), r(() => w.setLimit(m), [w, m]), r(() => w.setDefaultDuration(h), [w, h]), r(() => {
|
|
227
|
-
let t = j.current;
|
|
225
|
+
r(() => w.setLimit(m), [w, m]), r(() => w.setDefaultDuration(h), [w, h]), r(() => {
|
|
226
|
+
let t = A.current;
|
|
228
227
|
!O || !e() || !t || !t.isConnected || t.matches(":popover-open") || t.showPopover();
|
|
229
228
|
}), r(() => {
|
|
230
229
|
let e = t();
|
|
231
230
|
if (!e) return;
|
|
232
231
|
let n = new AbortController();
|
|
233
232
|
return e.addEventListener("visibilitychange", () => {
|
|
234
|
-
|
|
233
|
+
M.current.hidden = e.hidden, N();
|
|
235
234
|
}, { signal: n.signal }), () => n.abort();
|
|
236
|
-
}, [
|
|
235
|
+
}, [N]), r(() => {
|
|
237
236
|
let e = t();
|
|
238
237
|
if (!C || !e) return;
|
|
239
238
|
let n = new AbortController();
|
|
240
239
|
return e.addEventListener("keydown", (t) => {
|
|
241
|
-
!x(t, C) || !
|
|
240
|
+
!x(t, C) || !A.current || (t.preventDefault(), j.current = e.activeElement, A.current.focus());
|
|
242
241
|
}, { signal: n.signal }), () => n.abort();
|
|
243
242
|
}, [C]);
|
|
244
|
-
let
|
|
245
|
-
|
|
243
|
+
let P = (e) => !!e && !!A.current?.contains(e), F = () => {
|
|
244
|
+
M.current.hovered = !0, N();
|
|
245
|
+
}, I = (e) => {
|
|
246
|
+
P(e.relatedTarget) || (M.current.hovered = !1, N());
|
|
246
247
|
}, L = (e) => {
|
|
247
|
-
|
|
248
|
+
M.current.focused = !0, N(), P(e.relatedTarget) || (j.current = e.relatedTarget);
|
|
248
249
|
}, R = (e) => {
|
|
249
|
-
|
|
250
|
+
P(e.relatedTarget) || (M.current.focused = !1, N());
|
|
250
251
|
}, z = (e) => {
|
|
251
|
-
F(e.relatedTarget) || (N.current.focused = !1, P());
|
|
252
|
-
}, B = (e) => {
|
|
253
252
|
if (e.key !== "Escape") return;
|
|
254
253
|
let t = (e.target.closest?.("[data-toast-id]"))?.getAttribute("data-toast-id");
|
|
255
|
-
t && w.dismiss(t, "close"), w.getSnapshot().toasts.some((e) => e.open) ?
|
|
256
|
-
},
|
|
254
|
+
t && w.dismiss(t, "close"), w.getSnapshot().toasts.some((e) => e.open) ? A.current?.focus() : j.current?.focus();
|
|
255
|
+
}, B = p.startsWith("top"), V = D.toasts.filter((e) => e.visible), H = B ? [...V].reverse() : V, U = D.overflow > 0 && /* @__PURE__ */ u(i, {
|
|
257
256
|
component: "toaster.overflow",
|
|
258
257
|
children: y(D.overflow)
|
|
259
|
-
}),
|
|
258
|
+
}), W = /* @__PURE__ */ d(i, {
|
|
260
259
|
tag: "section",
|
|
261
|
-
ref:
|
|
260
|
+
ref: A,
|
|
262
261
|
component: "toaster",
|
|
263
262
|
...E,
|
|
264
263
|
variant: [E.variant, { [b[p]]: !0 }],
|
|
@@ -270,24 +269,24 @@ function C(a) {
|
|
|
270
269
|
"aria-label": g,
|
|
271
270
|
tabIndex: -1,
|
|
272
271
|
...T,
|
|
273
|
-
onPointerOver:
|
|
274
|
-
onPointerOut:
|
|
275
|
-
onFocus:
|
|
276
|
-
onBlur:
|
|
277
|
-
onKeyDown:
|
|
272
|
+
onPointerOver: F,
|
|
273
|
+
onPointerOut: I,
|
|
274
|
+
onFocus: L,
|
|
275
|
+
onBlur: R,
|
|
276
|
+
onKeyDown: z
|
|
278
277
|
},
|
|
279
278
|
children: [
|
|
280
|
-
!
|
|
281
|
-
|
|
279
|
+
!B && U,
|
|
280
|
+
H.map((e) => /* @__PURE__ */ u(S, {
|
|
282
281
|
toast: e,
|
|
283
282
|
store: w,
|
|
284
|
-
fromTop:
|
|
283
|
+
fromTop: B,
|
|
285
284
|
closeLabel: v
|
|
286
285
|
}, e.id)),
|
|
287
|
-
|
|
286
|
+
B && U
|
|
288
287
|
]
|
|
289
288
|
});
|
|
290
|
-
return O ?
|
|
289
|
+
return O ? W : k ? l(W, k) : null;
|
|
291
290
|
}
|
|
292
291
|
var w = C;
|
|
293
292
|
w.displayName = "Toaster";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs");let t=require("@box-kite/react");var n=.25;function r(e,r){return(0,t.useBoxElement)({position:`absolute`,width:n,height:n,p:0,b:0,overflow:`hidden`,whiteSpace:`nowrap`,clipPath:`inset(50%)`,...e},r)}var i=e.f(r,`VisuallyHidden`);exports.default=i;
|