@box-kite/react 2.3.1 → 2.4.1
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 +58 -94
- package/.claude/skills/box-kite/SKILL.md +69 -104
- package/.claude/skills/box-kite/references/components.md +8 -1
- package/.claude/skills/box-kite/references/patterns.md +1 -1
- package/.claude/skills/box-kite/references/rules.md +115 -0
- package/.claude/skills/box-kite/references/styling.md +5 -3
- package/.cursor/rules/box-kite.mdc +60 -96
- package/AGENTS.md +61 -97
- package/BOX_AI_CONTEXT.md +111 -40
- package/BOX_KITE_AI_CONTEXT.md +111 -40
- package/README.md +200 -721
- package/box.cjs +1 -1
- package/box.d.ts +5 -0
- package/box.mjs +5 -5
- package/catalog.cjs +1 -1
- package/catalog.mjs +53 -18
- package/client.cjs +1 -1
- package/client.mjs +85 -85
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +1 -1
- package/components/button.cjs +1 -1
- package/components/button.mjs +1 -1
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +1 -1
- package/components/chart.cjs +1 -1
- package/components/chart.mjs +3 -3
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.mjs +1 -1
- package/components/combobox/comboboxListbox.d.ts +2 -1
- package/components/combobox.cjs +1 -1
- package/components/combobox.d.ts +1 -1
- package/components/combobox.mjs +200 -189
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid/contracts/dataGridContract.d.ts +2 -1
- package/components/dataGrid/useListLayout.d.ts +1 -1
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +453 -453
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +16 -16
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +1 -1
- package/components/dateTime.cjs +1 -1
- package/components/dateTime.mjs +1 -1
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +1 -1
- package/components/flex.cjs +1 -1
- package/components/flex.mjs +1 -1
- package/components/flow.cjs +1 -0
- package/components/flow.d.ts +56 -0
- package/components/flow.mjs +98 -0
- package/components/form.cjs +1 -1
- package/components/form.mjs +1 -1
- package/components/grid.cjs +1 -1
- package/components/grid.mjs +1 -1
- package/components/icon.cjs +1 -1
- package/components/icon.mjs +1 -1
- package/components/list.cjs +1 -1
- package/components/list.mjs +1 -1
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +1 -1
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +1 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +1 -1
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +2 -1
- package/components/semantics.cjs +1 -1
- package/components/semantics.d.ts +32 -30
- package/components/semantics.mjs +3 -3
- package/components/skeleton.cjs +1 -1
- package/components/skeleton.d.ts +1 -1
- package/components/skeleton.mjs +3 -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/svg.cjs +1 -1
- package/components/svg.mjs +14 -14
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +1 -1
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +1 -1
- package/components/textarea.cjs +1 -1
- package/components/textarea.d.ts +1 -1
- package/components/textarea.mjs +1 -1
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +1 -1
- package/components/textbox.mjs +1 -1
- package/components/timeZoneSelect.d.ts +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +14 -15
- 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/components/visuallyHidden.cjs +1 -1
- package/components/visuallyHidden.mjs +1 -1
- package/docs/a11y.md +1 -2
- package/docs/components.md +1 -0
- package/docs/index.md +1 -1
- package/docs/props.md +1 -1
- package/effects.cjs +1 -1
- package/effects.mjs +2 -2
- package/identity.cjs +1 -1
- package/identity.mjs +5 -7
- package/package.json +50 -36
- package/react/boxClassNames.d.ts +2 -2
- package/react/effects.d.ts +5 -6
- package/react/identity/useIdentifier.d.ts +0 -3
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +42 -3
- package/rsc.cjs +1 -1
- package/rsc.d.ts +1 -0
- package/rsc.mjs +2 -2
- package/utils/catalog/catalogContracts.d.ts +0 -10
- package/utils/flow/flowPalette.d.ts +17 -0
- package/utils/flow/flowUtils.d.ts +47 -0
package/docs/index.md
CHANGED
|
@@ -11,4 +11,4 @@ The markdown `@box-kite/react` ships for whatever is reading its source tree. No
|
|
|
11
11
|
- [`interop.md`](interop.md) — the agentic runtimes (`@box-kite/react/interop`): AI SDK, assistant-ui, CopilotKit, A2UI and AG-UI, each verified against its own package
|
|
12
12
|
- [`mcp.md`](mcp.md) — the MCP server (`npx @box-kite/mcp`), whose `check_styles` tool is the only way to be sure a value works
|
|
13
13
|
|
|
14
|
-
The rest sits at the package root: `BOX_KITE_AI_CONTEXT.md`, the long-form reference (prop tables, the DataGrid API, debugging); `.claude/skills/box-kite/`, the same rules as an installable skill with
|
|
14
|
+
The rest sits at the package root: `BOX_KITE_AI_CONTEXT.md`, the long-form reference (prop tables, the DataGrid API, debugging); `.claude/skills/box-kite/`, the same rules as an installable skill with five references beside it; and `.cursor/rules/box-kite.mdc`, which is that skill as a Cursor rule — copy either into the project rather than reading it from here, so it is loaded without anyone asking.
|
package/docs/props.md
CHANGED
|
@@ -666,7 +666,7 @@ The flex-direction CSS property sets how flex items are placed in the flex conta
|
|
|
666
666
|
|
|
667
667
|
### `display`
|
|
668
668
|
|
|
669
|
-
The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex.
|
|
669
|
+
The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. Every Box is `block` until told otherwise, so margin and padding always apply, except an inline phrasing element (`a`, `span`, `label`, `time`, `mark`, `code`…), which is `inline-block` so it stays in its sentence. A prose link that must wrap with its sentence sets `display="inline"`.
|
|
670
670
|
|
|
671
671
|
- Writes: `display`
|
|
672
672
|
- Values: `none` · `block` · `inline` · `inline-block` · `flex` · `inline-flex` · `grid` · `inline-grid` · `contents` · `list-item` · `table` · `table-header-group` · `table-row-group` · `table-row` · `table-cell`
|
package/effects.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./platform.cjs");let t=require("react");var n=e.i(),r=n?t.useLayoutEffect:t.useEffect,i=n?t.useInsertionEffect:t.useEffect;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
package/effects.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./platform.mjs";
|
|
2
|
-
import
|
|
2
|
+
import { useEffect as t, useInsertionEffect as n, useLayoutEffect as r } from "react";
|
|
3
3
|
//#region src/react/effects.ts
|
|
4
|
-
var i = e(), a = i ? r :
|
|
4
|
+
var i = e(), a = i ? r : t, o = i ? n : t;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { a as n, o as t };
|
package/identity.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let e=require("react");function t(e){return e.replace(/[^\w-]/g,``)}function n(n=`box`){return`${n}-${t((0,e.useId)())}`}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/identity.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useId as e } from "react";
|
|
2
2
|
//#region src/react/identity/useIdentifier.ts
|
|
3
|
-
|
|
4
|
-
function i(e) {
|
|
3
|
+
function t(e) {
|
|
5
4
|
return e.replace(/[^\w-]/g, "");
|
|
6
5
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
return `${e}-${a ? i(a) : o}`;
|
|
6
|
+
function n(n = "box") {
|
|
7
|
+
return `${n}-${t(e())}`;
|
|
10
8
|
}
|
|
11
9
|
//#endregion
|
|
12
|
-
export {
|
|
10
|
+
export { n as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box-kite/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"pages/**"
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"test:watch": "vitest",
|
|
96
96
|
"test:a11y": "vitest run a11y",
|
|
97
97
|
"lint": "eslint .",
|
|
98
|
-
"check:boundaries": "node scripts/check-core-boundary.mjs && node scripts/check-rsc-boundary.mjs",
|
|
98
|
+
"check:boundaries": "node scripts/check-core-boundary.mjs && node scripts/check-rsc-boundary.mjs && node scripts/check-dependencies.mjs",
|
|
99
99
|
"check:brand": "node scripts/check-brand.mjs",
|
|
100
100
|
"check:docs": "node scripts/check-docs-snippets.mjs",
|
|
101
101
|
"check:props": "node scripts/check-props-api.mjs",
|
|
@@ -104,6 +104,8 @@
|
|
|
104
104
|
"docs:components": "node scripts/check-components-api.mjs --fix",
|
|
105
105
|
"check:catalog": "node scripts/check-catalog-api.mjs",
|
|
106
106
|
"docs:catalog": "node scripts/check-catalog-api.mjs --fix",
|
|
107
|
+
"check:csstype": "node scripts/check-csstype.mjs",
|
|
108
|
+
"docs:csstype": "node scripts/check-csstype.mjs --fix",
|
|
107
109
|
"check:create": "node scripts/check-create-templates.mjs",
|
|
108
110
|
"docs:create": "node scripts/check-create-templates.mjs --fix",
|
|
109
111
|
"check:conventions": "node scripts/check-component-conventions.mjs",
|
|
@@ -132,7 +134,7 @@
|
|
|
132
134
|
"./interactionListening.mjs"
|
|
133
135
|
],
|
|
134
136
|
"gzip": true,
|
|
135
|
-
"limit": "
|
|
137
|
+
"limit": "45.51 kB"
|
|
136
138
|
},
|
|
137
139
|
{
|
|
138
140
|
"name": "Box in a Server Component (react-server entry)",
|
|
@@ -145,7 +147,7 @@
|
|
|
145
147
|
"./interactionListening.mjs"
|
|
146
148
|
],
|
|
147
149
|
"gzip": true,
|
|
148
|
-
"limit": "
|
|
150
|
+
"limit": "42.88 kB"
|
|
149
151
|
},
|
|
150
152
|
{
|
|
151
153
|
"name": "Behavior primitives (a11y entry)",
|
|
@@ -184,7 +186,7 @@
|
|
|
184
186
|
"./interactionListening.mjs"
|
|
185
187
|
],
|
|
186
188
|
"gzip": true,
|
|
187
|
-
"limit": "
|
|
189
|
+
"limit": "67.01 kB"
|
|
188
190
|
},
|
|
189
191
|
{
|
|
190
192
|
"name": "Spec renderer (spec entry)",
|
|
@@ -242,7 +244,7 @@
|
|
|
242
244
|
"name": "Core engine (@box-kite/core, no React)",
|
|
243
245
|
"path": "dist-core/core.mjs",
|
|
244
246
|
"gzip": true,
|
|
245
|
-
"limit": "
|
|
247
|
+
"limit": "44.09 kB",
|
|
246
248
|
"ignore": [
|
|
247
249
|
"./diagnostics-*",
|
|
248
250
|
"./themeReveal-*",
|
|
@@ -260,7 +262,7 @@
|
|
|
260
262
|
"./interactionListening.mjs"
|
|
261
263
|
],
|
|
262
264
|
"gzip": true,
|
|
263
|
-
"limit": "
|
|
265
|
+
"limit": "48.21 kB"
|
|
264
266
|
},
|
|
265
267
|
{
|
|
266
268
|
"name": "Popover",
|
|
@@ -273,7 +275,7 @@
|
|
|
273
275
|
"./interactionListening.mjs"
|
|
274
276
|
],
|
|
275
277
|
"gzip": true,
|
|
276
|
-
"limit": "
|
|
278
|
+
"limit": "49.89 kB"
|
|
277
279
|
},
|
|
278
280
|
{
|
|
279
281
|
"name": "Menu",
|
|
@@ -286,7 +288,7 @@
|
|
|
286
288
|
"./interactionListening.mjs"
|
|
287
289
|
],
|
|
288
290
|
"gzip": true,
|
|
289
|
-
"limit": "
|
|
291
|
+
"limit": "51.99 kB"
|
|
290
292
|
},
|
|
291
293
|
{
|
|
292
294
|
"name": "Accordion",
|
|
@@ -299,7 +301,7 @@
|
|
|
299
301
|
"./interactionListening.mjs"
|
|
300
302
|
],
|
|
301
303
|
"gzip": true,
|
|
302
|
-
"limit": "
|
|
304
|
+
"limit": "47.03 kB"
|
|
303
305
|
},
|
|
304
306
|
{
|
|
305
307
|
"name": "Agent",
|
|
@@ -312,7 +314,7 @@
|
|
|
312
314
|
"./interactionListening.mjs"
|
|
313
315
|
],
|
|
314
316
|
"gzip": true,
|
|
315
|
-
"limit": "
|
|
317
|
+
"limit": "47.78 kB"
|
|
316
318
|
},
|
|
317
319
|
{
|
|
318
320
|
"name": "Markdown",
|
|
@@ -325,7 +327,7 @@
|
|
|
325
327
|
"./interactionListening.mjs"
|
|
326
328
|
],
|
|
327
329
|
"gzip": true,
|
|
328
|
-
"limit": "
|
|
330
|
+
"limit": "46.07 kB"
|
|
329
331
|
},
|
|
330
332
|
{
|
|
331
333
|
"name": "List",
|
|
@@ -338,7 +340,7 @@
|
|
|
338
340
|
"./interactionListening.mjs"
|
|
339
341
|
],
|
|
340
342
|
"gzip": true,
|
|
341
|
-
"limit": "
|
|
343
|
+
"limit": "47.38 kB"
|
|
342
344
|
},
|
|
343
345
|
{
|
|
344
346
|
"name": "SwipeItem",
|
|
@@ -351,7 +353,7 @@
|
|
|
351
353
|
"./interactionListening.mjs"
|
|
352
354
|
],
|
|
353
355
|
"gzip": true,
|
|
354
|
-
"limit": "
|
|
356
|
+
"limit": "50.66 kB"
|
|
355
357
|
},
|
|
356
358
|
{
|
|
357
359
|
"name": "SortableList",
|
|
@@ -364,7 +366,7 @@
|
|
|
364
366
|
"./interactionListening.mjs"
|
|
365
367
|
],
|
|
366
368
|
"gzip": true,
|
|
367
|
-
"limit": "
|
|
369
|
+
"limit": "50.98 kB"
|
|
368
370
|
},
|
|
369
371
|
{
|
|
370
372
|
"name": "VirtualList",
|
|
@@ -377,7 +379,20 @@
|
|
|
377
379
|
"./interactionListening.mjs"
|
|
378
380
|
],
|
|
379
381
|
"gzip": true,
|
|
380
|
-
"limit": "
|
|
382
|
+
"limit": "49.58 kB"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"name": "FlowContainer",
|
|
386
|
+
"path": "dist/components/flow.mjs",
|
|
387
|
+
"ignore": [
|
|
388
|
+
"react",
|
|
389
|
+
"react-dom",
|
|
390
|
+
"./diagnostics-*",
|
|
391
|
+
"./themeReveal-*",
|
|
392
|
+
"./interactionListening.mjs"
|
|
393
|
+
],
|
|
394
|
+
"gzip": true,
|
|
395
|
+
"limit": "45.86 kB"
|
|
381
396
|
},
|
|
382
397
|
{
|
|
383
398
|
"name": "Skeleton",
|
|
@@ -390,7 +405,7 @@
|
|
|
390
405
|
"./interactionListening.mjs"
|
|
391
406
|
],
|
|
392
407
|
"gzip": true,
|
|
393
|
-
"limit": "
|
|
408
|
+
"limit": "45.42 kB"
|
|
394
409
|
},
|
|
395
410
|
{
|
|
396
411
|
"name": "Tabs",
|
|
@@ -403,7 +418,7 @@
|
|
|
403
418
|
"./interactionListening.mjs"
|
|
404
419
|
],
|
|
405
420
|
"gzip": true,
|
|
406
|
-
"limit": "
|
|
421
|
+
"limit": "48.28 kB"
|
|
407
422
|
},
|
|
408
423
|
{
|
|
409
424
|
"name": "Slider",
|
|
@@ -416,7 +431,7 @@
|
|
|
416
431
|
"./interactionListening.mjs"
|
|
417
432
|
],
|
|
418
433
|
"gzip": true,
|
|
419
|
-
"limit": "
|
|
434
|
+
"limit": "47.40 kB"
|
|
420
435
|
},
|
|
421
436
|
{
|
|
422
437
|
"name": "Progress",
|
|
@@ -429,7 +444,7 @@
|
|
|
429
444
|
"./interactionListening.mjs"
|
|
430
445
|
],
|
|
431
446
|
"gzip": true,
|
|
432
|
-
"limit": "
|
|
447
|
+
"limit": "45.36 kB"
|
|
433
448
|
},
|
|
434
449
|
{
|
|
435
450
|
"name": "Toaster",
|
|
@@ -455,7 +470,7 @@
|
|
|
455
470
|
"./interactionListening.mjs"
|
|
456
471
|
],
|
|
457
472
|
"gzip": true,
|
|
458
|
-
"limit": "
|
|
473
|
+
"limit": "54.21 kB"
|
|
459
474
|
},
|
|
460
475
|
{
|
|
461
476
|
"name": "Calendar",
|
|
@@ -468,7 +483,7 @@
|
|
|
468
483
|
"./interactionListening.mjs"
|
|
469
484
|
],
|
|
470
485
|
"gzip": true,
|
|
471
|
-
"limit": "
|
|
486
|
+
"limit": "53.66 kB"
|
|
472
487
|
},
|
|
473
488
|
{
|
|
474
489
|
"name": "DatePicker",
|
|
@@ -481,7 +496,7 @@
|
|
|
481
496
|
"./interactionListening.mjs"
|
|
482
497
|
],
|
|
483
498
|
"gzip": true,
|
|
484
|
-
"limit": "
|
|
499
|
+
"limit": "67.73 kB"
|
|
485
500
|
},
|
|
486
501
|
{
|
|
487
502
|
"name": "DateTime",
|
|
@@ -494,7 +509,7 @@
|
|
|
494
509
|
"./interactionListening.mjs"
|
|
495
510
|
],
|
|
496
511
|
"gzip": true,
|
|
497
|
-
"limit": "
|
|
512
|
+
"limit": "48.95 kB"
|
|
498
513
|
},
|
|
499
514
|
{
|
|
500
515
|
"name": "TimeZoneSelect",
|
|
@@ -507,7 +522,7 @@
|
|
|
507
522
|
"./interactionListening.mjs"
|
|
508
523
|
],
|
|
509
524
|
"gzip": true,
|
|
510
|
-
"limit": "
|
|
525
|
+
"limit": "56.75 kB"
|
|
511
526
|
},
|
|
512
527
|
{
|
|
513
528
|
"name": "Combobox",
|
|
@@ -520,7 +535,7 @@
|
|
|
520
535
|
"./interactionListening.mjs"
|
|
521
536
|
],
|
|
522
537
|
"gzip": true,
|
|
523
|
-
"limit": "
|
|
538
|
+
"limit": "54.72 kB"
|
|
524
539
|
},
|
|
525
540
|
{
|
|
526
541
|
"name": "Dashboard",
|
|
@@ -533,7 +548,7 @@
|
|
|
533
548
|
"./interactionListening.mjs"
|
|
534
549
|
],
|
|
535
550
|
"gzip": true,
|
|
536
|
-
"limit": "
|
|
551
|
+
"limit": "51.32 kB"
|
|
537
552
|
},
|
|
538
553
|
{
|
|
539
554
|
"name": "DataGrid",
|
|
@@ -614,7 +629,7 @@
|
|
|
614
629
|
"./interactionListening.mjs"
|
|
615
630
|
],
|
|
616
631
|
"gzip": true,
|
|
617
|
-
"limit": "
|
|
632
|
+
"limit": "173.38 kB"
|
|
618
633
|
}
|
|
619
634
|
],
|
|
620
635
|
"repository": {
|
|
@@ -650,13 +665,8 @@
|
|
|
650
665
|
"homepage": "https://www.box-kite.dev",
|
|
651
666
|
"description": "One React component that takes CSS properties as typed props and generates atomic CSS at runtime — no CSS files, no build step, renders in a Server Component.",
|
|
652
667
|
"peerDependencies": {
|
|
653
|
-
"react": "
|
|
654
|
-
"react-dom": "
|
|
655
|
-
},
|
|
656
|
-
"dependencies": {
|
|
657
|
-
"@box-kite/core": "2.3.1",
|
|
658
|
-
"csstype": "^3.2.3",
|
|
659
|
-
"use-sync-external-store": "^1.6.0"
|
|
668
|
+
"react": ">=18.0.0",
|
|
669
|
+
"react-dom": ">=18.0.0"
|
|
660
670
|
},
|
|
661
671
|
"devDependencies": {
|
|
662
672
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -686,13 +696,14 @@
|
|
|
686
696
|
"@types/node": "^26.1.2",
|
|
687
697
|
"@types/react": "^19.2.18",
|
|
688
698
|
"@types/react-dom": "^19.2.4",
|
|
689
|
-
"@types/use-sync-external-store": "^1.5.0",
|
|
690
699
|
"@vitejs/plugin-react": "^6.0.5",
|
|
691
700
|
"@vitest/coverage-v8": "^4.1.11",
|
|
701
|
+
"@xyflow/react": "^12.12.1",
|
|
692
702
|
"ag-grid-community": "^36.2.0",
|
|
693
703
|
"ag-grid-react": "^36.2.0",
|
|
694
704
|
"axe-core": "^4.13.0",
|
|
695
705
|
"create-vite": "^9.3.0",
|
|
706
|
+
"csstype": "^3.2.3",
|
|
696
707
|
"eslint": "^10.8.0",
|
|
697
708
|
"eslint-config-prettier": "^10.1.8",
|
|
698
709
|
"eslint-plugin-import-x": "^4.17.1",
|
|
@@ -719,5 +730,8 @@
|
|
|
719
730
|
"vite-plugin-dts": "^5.0.3",
|
|
720
731
|
"vitest": "^4.1.10",
|
|
721
732
|
"zod": "^4.6.5"
|
|
733
|
+
},
|
|
734
|
+
"dependencies": {
|
|
735
|
+
"@box-kite/core": "2.4.1"
|
|
722
736
|
}
|
|
723
737
|
}
|
package/react/boxClassNames.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export interface BoxClassNames {
|
|
|
17
17
|
/**
|
|
18
18
|
* The resolved styles as a class attribute. Hook-free, so the client entry and the Server-Component
|
|
19
19
|
* one give `useClassNames` the same shape — the only difference between them is whether resolving
|
|
20
|
-
* the styles scheduled a flush effect.
|
|
20
|
+
* the styles scheduled a flush effect. `base: false` drops the reset class, which the engine always puts first.
|
|
21
21
|
*/
|
|
22
|
-
export default function boxClassNames({ classNames: styleClasses, styleElements }: ResolvedBoxStyles, userClassName?: ClassNameType): {
|
|
22
|
+
export default function boxClassNames({ classNames: styleClasses, styleElements }: ResolvedBoxStyles, userClassName?: ClassNameType, base?: boolean): {
|
|
23
23
|
className: string;
|
|
24
24
|
styles: import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>[] | undefined;
|
|
25
25
|
};
|
package/react/effects.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
2
2
|
/** A layout effect on the browser, a passive one everywhere else. */
|
|
3
|
-
export declare const useIsomorphicLayoutEffect: typeof
|
|
3
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
4
4
|
/**
|
|
5
|
-
* An insertion effect on the browser
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `getStyles()` flushes for itself, so `useEffect` keeps React quiet.
|
|
5
|
+
* An insertion effect on the browser — React's own recommendation for injecting CSS-in-JS. It runs during
|
|
6
|
+
* the commit ahead of *every* layout effect, so a component measuring its DOM already sees the styles. Off
|
|
7
|
+
* the browser nothing paints and `getStyles()` flushes for itself, so `useEffect` keeps React quiet.
|
|
9
8
|
*/
|
|
10
9
|
export declare const useIsomorphicInsertionEffect: typeof useLayoutEffect;
|
|
@@ -10,8 +10,5 @@
|
|
|
10
10
|
* const id = useIdentifier('select');
|
|
11
11
|
* // `${id}-trigger`, `${id}-listbox`
|
|
12
12
|
* ```
|
|
13
|
-
*
|
|
14
|
-
* On React 16/17 the fallback is a module counter, which cannot match between a server render and
|
|
15
|
-
* the client one — pass ids in explicitly there if the tree is hydrated.
|
|
16
13
|
*/
|
|
17
14
|
export default function useIdentifier(prefix?: string): string;
|
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)(
|
|
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,i=!0){let a=i?e:e.slice(1);return{className:(0,r.classNames)(a,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.v()&&(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),{})}var A=[`surface`,`panel`,`text`,`border`,`grid`,`edge`,`selection`,`handle`],j={surface:`white`,panel:`white`,text:`base-900`,border:`base-300`,grid:`base-300`,edge:`base-400`,selection:`accent-500`,handle:`base-700`},M={surface:`base-950`,panel:`base-900`,text:`base-100`,border:`base-700`,grid:`base-700`,edge:`base-500`,selection:`accent-400`,handle:`base-300`};function N(e){return`--flow-${e}`}function P(e){let t={};for(let n of A)e[n]!==void 0&&(t[N(n).slice(2)]=e[n]);return t}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return i}});
|
package/react-shared.mjs
CHANGED
|
@@ -2,9 +2,10 @@ import { v as e } from "./platform.mjs";
|
|
|
2
2
|
import t, { forwardRef as n, memo as r } from "react";
|
|
3
3
|
import { classNames as i, getDefaultEngine as a } from "@box-kite/core";
|
|
4
4
|
//#region src/react/boxClassNames.ts
|
|
5
|
-
function o({ classNames: e, styleElements: t }, n) {
|
|
5
|
+
function o({ classNames: e, styleElements: t }, n, r = !0) {
|
|
6
|
+
let a = r ? e : e.slice(1);
|
|
6
7
|
return {
|
|
7
|
-
className: i(
|
|
8
|
+
className: i(a, n).join(" "),
|
|
8
9
|
styles: t
|
|
9
10
|
};
|
|
10
11
|
}
|
|
@@ -138,4 +139,42 @@ function j(e) {
|
|
|
138
139
|
return e.reduce((e, t, n) => (e[`chart-${n + 1}`] = t, e), {});
|
|
139
140
|
}
|
|
140
141
|
//#endregion
|
|
141
|
-
|
|
142
|
+
//#region src/utils/flow/flowPalette.ts
|
|
143
|
+
var M = [
|
|
144
|
+
"surface",
|
|
145
|
+
"panel",
|
|
146
|
+
"text",
|
|
147
|
+
"border",
|
|
148
|
+
"grid",
|
|
149
|
+
"edge",
|
|
150
|
+
"selection",
|
|
151
|
+
"handle"
|
|
152
|
+
], N = {
|
|
153
|
+
surface: "white",
|
|
154
|
+
panel: "white",
|
|
155
|
+
text: "base-900",
|
|
156
|
+
border: "base-300",
|
|
157
|
+
grid: "base-300",
|
|
158
|
+
edge: "base-400",
|
|
159
|
+
selection: "accent-500",
|
|
160
|
+
handle: "base-700"
|
|
161
|
+
}, P = {
|
|
162
|
+
surface: "base-950",
|
|
163
|
+
panel: "base-900",
|
|
164
|
+
text: "base-100",
|
|
165
|
+
border: "base-700",
|
|
166
|
+
grid: "base-700",
|
|
167
|
+
edge: "base-500",
|
|
168
|
+
selection: "accent-400",
|
|
169
|
+
handle: "base-300"
|
|
170
|
+
};
|
|
171
|
+
function F(e) {
|
|
172
|
+
return `--flow-${e}`;
|
|
173
|
+
}
|
|
174
|
+
function I(e) {
|
|
175
|
+
let t = {};
|
|
176
|
+
for (let n of M) e[n] !== void 0 && (t[F(n).slice(2)] = e[n]);
|
|
177
|
+
return t;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { c as _, F as a, j as c, w as d, S as f, f as g, v as h, I as i, O as l, y as m, N as n, A as o, x as p, M as r, k as s, P as t, E as u, o as v };
|
package/rsc.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime.cjs"),t=require("./react-shared.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");(0,r.getDefaultEngine)().configure({sink:`element`});function i(e,r){let{tag:i=`div`,children:a}=e;if(typeof a==`function`)throw Error(`[box-kite] Box children as a function track hover state, which needs the client Box — render it from a 'use client' module.`);let{classNames:o,styleElements:s}=t.
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime.cjs"),t=require("./react-shared.cjs");let n=require("react");n=e.t(n,1);let r=require("@box-kite/core");(0,r.getDefaultEngine)().configure({sink:`element`});function i(e,r){let{tag:i=`div`,children:a}=e;if(typeof a==`function`)throw Error(`[box-kite] Box children as a function track hover state, which needs the client Box — render it from a 'use client' module.`);let{classNames:o,styleElements:s}=t.m(e,i===`svg`);return n.default.createElement(n.default.Fragment,null,s,n.default.createElement(i,t.g(e,o),a))}function a(e){return i(e)}var o=a;o.extend=r.BoxExtends.extend,o.components=r.BoxExtends.components,o.palette=r.BoxExtends.palette,o.sizes=r.BoxExtends.sizes,o.createComponents=r.BoxExtends.createComponents,o.keyframes=r.BoxExtends.keyframes,o.spring=r.Springs.spring,o.getVariableValue=e=>(0,r.getDefaultEngine)().getVariableValue(e),o.configure=e=>(0,r.getDefaultEngine)().configure(e),o.viewTransition=r.startViewTransition;function s(e,n){return t.v(t.m(e,n?.svg===!0),e.className,n?.base)}exports.default=o,exports.useBoxElement=i,exports.useClassNames=s;
|
package/rsc.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ declare const RscBox: RscBoxType;
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function useClassNames<TKey extends keyof ComponentsAndVariants = never>(props: BoxClassNameProps<TKey>, options?: {
|
|
39
39
|
svg?: boolean;
|
|
40
|
+
base?: boolean;
|
|
40
41
|
}): BoxClassNames;
|
|
41
42
|
export default RscBox;
|
|
42
43
|
export type { BoxClassNames, BoxClassNameProps };
|
package/rsc.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as e, m as t, v as n } from "./react-shared.mjs";
|
|
2
2
|
import r from "react";
|
|
3
3
|
import { BoxExtends as i, Springs as a, getDefaultEngine as o, startViewTransition as s } from "@box-kite/core";
|
|
4
4
|
//#region src/rsc.ts
|
|
@@ -15,7 +15,7 @@ function l(e) {
|
|
|
15
15
|
var u = l;
|
|
16
16
|
u.extend = i.extend, u.components = i.components, u.palette = i.palette, u.sizes = i.sizes, u.createComponents = i.createComponents, u.keyframes = i.keyframes, u.spring = a.spring, u.getVariableValue = (e) => o().getVariableValue(e), u.configure = (e) => o().configure(e), u.viewTransition = s;
|
|
17
17
|
function d(e, r) {
|
|
18
|
-
return n(t(e, r?.svg === !0), e.className);
|
|
18
|
+
return n(t(e, r?.svg === !0), e.className, r?.base);
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
export { u as default, c as useBoxElement, d as useClassNames };
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { CatalogContract } from '@box-kite/core';
|
|
2
|
-
/**
|
|
3
|
-
* The props that are a *shape* rather than a value — a grid's columns, a dashboard's layout — as the JSON
|
|
4
|
-
* Schema a generated spec is judged against. Written here rather than extracted because the manifest maps
|
|
5
|
-
* types, and half of each of these shapes is React: a `Cell` renderer, an `onCellEdit`, a `ReactNode`. A
|
|
6
|
-
* mapping has to drop such a prop whole, which is what left the catalog able to place a dashboard and not
|
|
7
|
-
* to say what was in it — `<DataGrid>` arrived with no `def` at all, and `def` is required.
|
|
8
|
-
*
|
|
9
|
-
* Every key is typed against the interface it mirrors, so a prop renamed in the component is a compile
|
|
10
|
-
* error here rather than a constraint that silently stops matching anything.
|
|
11
|
-
*/
|
|
12
2
|
declare namespace CatalogContracts {
|
|
13
3
|
/**
|
|
14
4
|
* Component name → the props of it a manifest entry cannot describe. Merged over the generated entry, so
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A canvas's roles, on their own so that `boxComponents.ts` can declare them without dragging the `--xy-*` mapping
|
|
3
|
+
* into the bundle every Box already pays for. `FlowUtils` re-exports them, so the public names are unchanged.
|
|
4
|
+
*/
|
|
5
|
+
/** What a canvas is painted from. Every `--xy-*` variable the container declares reads one of these. */
|
|
6
|
+
export declare const ROLES: readonly ["surface", "panel", "text", "border", "grid", "edge", "selection", "handle"];
|
|
7
|
+
export type Role = (typeof ROLES)[number];
|
|
8
|
+
/** A role's paint in one theme: a palette token, an alias like `accent-500`, or one with an alpha. */
|
|
9
|
+
export type RoleTokens = Readonly<Record<Role, string>>;
|
|
10
|
+
/** The roles on a light page. `accent`/`base` rather than named families, so `Box.palette()` reaches the canvas. */
|
|
11
|
+
export declare const LIGHT: RoleTokens;
|
|
12
|
+
/** The same roles on a dark page. */
|
|
13
|
+
export declare const DARK: RoleTokens;
|
|
14
|
+
/** A role's own custom property — what an override or a custom node reads. */
|
|
15
|
+
export declare function roleVariable(role: Role): string;
|
|
16
|
+
/** Role tokens as `vars` entries: `{ 'flow-surface': 'white', … }`. */
|
|
17
|
+
export declare function roleEntries(tokens: Partial<Record<Role, string>>): Record<string, string>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as FlowPalette from './flowPalette';
|
|
2
|
+
/**
|
|
3
|
+
* The model behind `<FlowContainer>`: React Flow's public CSS variables written in terms of eight roles, and the
|
|
4
|
+
* roles in palette tokens for each theme. No React and no xyflow import — the contract is CSS, so it is data here.
|
|
5
|
+
*/
|
|
6
|
+
declare namespace FlowUtils {
|
|
7
|
+
const ROLES: readonly ["surface", "panel", "text", "border", "grid", "edge", "selection", "handle"];
|
|
8
|
+
type Role = FlowPalette.Role;
|
|
9
|
+
type RoleTokens = FlowPalette.RoleTokens;
|
|
10
|
+
const LIGHT: Readonly<Record<"text" | "grid" | "border" | "selection" | "surface" | "panel" | "edge" | "handle", string>>;
|
|
11
|
+
const DARK: Readonly<Record<"text" | "grid" | "border" | "selection" | "surface" | "panel" | "edge" | "handle", string>>;
|
|
12
|
+
const roleVariable: typeof FlowPalette.roleVariable;
|
|
13
|
+
/**
|
|
14
|
+
* Every `--xy-*` variable the container declares, keyed without the `--`. Each one is resolved on the container,
|
|
15
|
+
* which is an ancestor of `.react-flow`, so it beats xyflow's `-default` in either `colorMode`; the `-props`
|
|
16
|
+
* twins a component prop sets inline still win, which is right — that is the app speaking.
|
|
17
|
+
*/
|
|
18
|
+
const VARIABLES: Readonly<Record<string, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* The `--xy-*` variables deliberately left to xyflow: widths, a radius, and two strokes that are transparent in
|
|
21
|
+
* both of its themes. Listed so the mapping test can tell "left alone" from "missed".
|
|
22
|
+
*/
|
|
23
|
+
const UNMAPPED: readonly ["xy-edge-stroke-width", "xy-connectionline-stroke-width", "xy-node-border-radius", "xy-minimap-mask-stroke-color", "xy-minimap-mask-stroke-width", "xy-minimap-node-stroke-color", "xy-minimap-node-stroke-width"];
|
|
24
|
+
/** A role override: one token for both themes, or one per theme. */
|
|
25
|
+
type RoleOverride = string | {
|
|
26
|
+
readonly light?: string;
|
|
27
|
+
readonly dark?: string;
|
|
28
|
+
};
|
|
29
|
+
type Tokens = Partial<Record<Role, RoleOverride>>;
|
|
30
|
+
/** The role variables for one theme, with the caller's overrides over the defaults. Unknown keys are dropped. */
|
|
31
|
+
function roleVariables(theme: 'light' | 'dark', tokens?: Tokens): Record<string, string>;
|
|
32
|
+
/** Only the roles the caller repaints in one theme — the defaults are the `flowContainer` style node's. */
|
|
33
|
+
function overrideVariables(theme: 'light' | 'dark', tokens?: Tokens): Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* `<ReactFlow colorMode>` from Box Kite's theme, so the canvas's own `.dark` class agrees with the page. A canvas in a
|
|
36
|
+
* different theme from the page sits in `<Box.Theme use="local">` instead — never `colorMode="light"` under a dark page.
|
|
37
|
+
*/
|
|
38
|
+
function colorMode(theme: string | undefined): 'light' | 'dark';
|
|
39
|
+
/**
|
|
40
|
+
* The base class draws every outline in `--outlineColor`, so declaring it on the container makes a node's focus and
|
|
41
|
+
* selection outlines the `selection` role with no colour prop — colour props take tokens, not `var()`.
|
|
42
|
+
*/
|
|
43
|
+
const OUTLINE: Readonly<Record<string, string>>;
|
|
44
|
+
/** The properties a canvas moves every frame need no transition; `static` zeroes both of Box's transition times. */
|
|
45
|
+
const STATIC_MOTION: Readonly<Record<string, string>>;
|
|
46
|
+
}
|
|
47
|
+
export default FlowUtils;
|