@box-kite/react 2.4.0 → 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 +1 -1
- package/.claude/skills/box-kite/SKILL.md +1 -1
- package/.claude/skills/box-kite/references/components.md +7 -0
- package/.claude/skills/box-kite/references/rules.md +2 -2
- package/.claude/skills/box-kite/references/styling.md +5 -3
- package/.cursor/rules/box-kite.mdc +1 -1
- package/AGENTS.md +1 -1
- package/BOX_AI_CONTEXT.md +77 -7
- package/BOX_KITE_AI_CONTEXT.md +77 -7
- 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 +7 -7
- 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.cjs +1 -1
- package/components/combobox.mjs +70 -70
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- 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 +1 -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.mjs +1 -0
- 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.mjs +1 -1
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +1 -1
- 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/components.md +1 -0
- package/docs/props.md +1 -1
- package/package.json +43 -29
- package/react/boxClassNames.d.ts +2 -2
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box-kite/react",
|
|
3
|
-
"version": "2.4.
|
|
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",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"./interactionListening.mjs"
|
|
135
135
|
],
|
|
136
136
|
"gzip": true,
|
|
137
|
-
"limit": "
|
|
137
|
+
"limit": "45.51 kB"
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "Box in a Server Component (react-server entry)",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"./interactionListening.mjs"
|
|
148
148
|
],
|
|
149
149
|
"gzip": true,
|
|
150
|
-
"limit": "
|
|
150
|
+
"limit": "42.88 kB"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"name": "Behavior primitives (a11y entry)",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"./interactionListening.mjs"
|
|
187
187
|
],
|
|
188
188
|
"gzip": true,
|
|
189
|
-
"limit": "
|
|
189
|
+
"limit": "67.01 kB"
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
"name": "Spec renderer (spec entry)",
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"name": "Core engine (@box-kite/core, no React)",
|
|
245
245
|
"path": "dist-core/core.mjs",
|
|
246
246
|
"gzip": true,
|
|
247
|
-
"limit": "
|
|
247
|
+
"limit": "44.09 kB",
|
|
248
248
|
"ignore": [
|
|
249
249
|
"./diagnostics-*",
|
|
250
250
|
"./themeReveal-*",
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"./interactionListening.mjs"
|
|
263
263
|
],
|
|
264
264
|
"gzip": true,
|
|
265
|
-
"limit": "
|
|
265
|
+
"limit": "48.21 kB"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"name": "Popover",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"./interactionListening.mjs"
|
|
276
276
|
],
|
|
277
277
|
"gzip": true,
|
|
278
|
-
"limit": "
|
|
278
|
+
"limit": "49.89 kB"
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
"name": "Menu",
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"./interactionListening.mjs"
|
|
289
289
|
],
|
|
290
290
|
"gzip": true,
|
|
291
|
-
"limit": "
|
|
291
|
+
"limit": "51.99 kB"
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
"name": "Accordion",
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
"./interactionListening.mjs"
|
|
302
302
|
],
|
|
303
303
|
"gzip": true,
|
|
304
|
-
"limit": "
|
|
304
|
+
"limit": "47.03 kB"
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
307
|
"name": "Agent",
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"./interactionListening.mjs"
|
|
315
315
|
],
|
|
316
316
|
"gzip": true,
|
|
317
|
-
"limit": "
|
|
317
|
+
"limit": "47.78 kB"
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"name": "Markdown",
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"./interactionListening.mjs"
|
|
328
328
|
],
|
|
329
329
|
"gzip": true,
|
|
330
|
-
"limit": "
|
|
330
|
+
"limit": "46.07 kB"
|
|
331
331
|
},
|
|
332
332
|
{
|
|
333
333
|
"name": "List",
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
"./interactionListening.mjs"
|
|
341
341
|
],
|
|
342
342
|
"gzip": true,
|
|
343
|
-
"limit": "
|
|
343
|
+
"limit": "47.38 kB"
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
"name": "SwipeItem",
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
"./interactionListening.mjs"
|
|
354
354
|
],
|
|
355
355
|
"gzip": true,
|
|
356
|
-
"limit": "
|
|
356
|
+
"limit": "50.66 kB"
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
"name": "SortableList",
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
"./interactionListening.mjs"
|
|
367
367
|
],
|
|
368
368
|
"gzip": true,
|
|
369
|
-
"limit": "
|
|
369
|
+
"limit": "50.98 kB"
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
"name": "VirtualList",
|
|
@@ -379,7 +379,20 @@
|
|
|
379
379
|
"./interactionListening.mjs"
|
|
380
380
|
],
|
|
381
381
|
"gzip": true,
|
|
382
|
-
"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"
|
|
383
396
|
},
|
|
384
397
|
{
|
|
385
398
|
"name": "Skeleton",
|
|
@@ -392,7 +405,7 @@
|
|
|
392
405
|
"./interactionListening.mjs"
|
|
393
406
|
],
|
|
394
407
|
"gzip": true,
|
|
395
|
-
"limit": "
|
|
408
|
+
"limit": "45.42 kB"
|
|
396
409
|
},
|
|
397
410
|
{
|
|
398
411
|
"name": "Tabs",
|
|
@@ -405,7 +418,7 @@
|
|
|
405
418
|
"./interactionListening.mjs"
|
|
406
419
|
],
|
|
407
420
|
"gzip": true,
|
|
408
|
-
"limit": "
|
|
421
|
+
"limit": "48.28 kB"
|
|
409
422
|
},
|
|
410
423
|
{
|
|
411
424
|
"name": "Slider",
|
|
@@ -418,7 +431,7 @@
|
|
|
418
431
|
"./interactionListening.mjs"
|
|
419
432
|
],
|
|
420
433
|
"gzip": true,
|
|
421
|
-
"limit": "
|
|
434
|
+
"limit": "47.40 kB"
|
|
422
435
|
},
|
|
423
436
|
{
|
|
424
437
|
"name": "Progress",
|
|
@@ -431,7 +444,7 @@
|
|
|
431
444
|
"./interactionListening.mjs"
|
|
432
445
|
],
|
|
433
446
|
"gzip": true,
|
|
434
|
-
"limit": "
|
|
447
|
+
"limit": "45.36 kB"
|
|
435
448
|
},
|
|
436
449
|
{
|
|
437
450
|
"name": "Toaster",
|
|
@@ -457,7 +470,7 @@
|
|
|
457
470
|
"./interactionListening.mjs"
|
|
458
471
|
],
|
|
459
472
|
"gzip": true,
|
|
460
|
-
"limit": "
|
|
473
|
+
"limit": "54.21 kB"
|
|
461
474
|
},
|
|
462
475
|
{
|
|
463
476
|
"name": "Calendar",
|
|
@@ -470,7 +483,7 @@
|
|
|
470
483
|
"./interactionListening.mjs"
|
|
471
484
|
],
|
|
472
485
|
"gzip": true,
|
|
473
|
-
"limit": "
|
|
486
|
+
"limit": "53.66 kB"
|
|
474
487
|
},
|
|
475
488
|
{
|
|
476
489
|
"name": "DatePicker",
|
|
@@ -483,7 +496,7 @@
|
|
|
483
496
|
"./interactionListening.mjs"
|
|
484
497
|
],
|
|
485
498
|
"gzip": true,
|
|
486
|
-
"limit": "
|
|
499
|
+
"limit": "67.73 kB"
|
|
487
500
|
},
|
|
488
501
|
{
|
|
489
502
|
"name": "DateTime",
|
|
@@ -496,7 +509,7 @@
|
|
|
496
509
|
"./interactionListening.mjs"
|
|
497
510
|
],
|
|
498
511
|
"gzip": true,
|
|
499
|
-
"limit": "
|
|
512
|
+
"limit": "48.95 kB"
|
|
500
513
|
},
|
|
501
514
|
{
|
|
502
515
|
"name": "TimeZoneSelect",
|
|
@@ -509,7 +522,7 @@
|
|
|
509
522
|
"./interactionListening.mjs"
|
|
510
523
|
],
|
|
511
524
|
"gzip": true,
|
|
512
|
-
"limit": "
|
|
525
|
+
"limit": "56.75 kB"
|
|
513
526
|
},
|
|
514
527
|
{
|
|
515
528
|
"name": "Combobox",
|
|
@@ -522,7 +535,7 @@
|
|
|
522
535
|
"./interactionListening.mjs"
|
|
523
536
|
],
|
|
524
537
|
"gzip": true,
|
|
525
|
-
"limit": "
|
|
538
|
+
"limit": "54.72 kB"
|
|
526
539
|
},
|
|
527
540
|
{
|
|
528
541
|
"name": "Dashboard",
|
|
@@ -535,7 +548,7 @@
|
|
|
535
548
|
"./interactionListening.mjs"
|
|
536
549
|
],
|
|
537
550
|
"gzip": true,
|
|
538
|
-
"limit": "
|
|
551
|
+
"limit": "51.32 kB"
|
|
539
552
|
},
|
|
540
553
|
{
|
|
541
554
|
"name": "DataGrid",
|
|
@@ -616,7 +629,7 @@
|
|
|
616
629
|
"./interactionListening.mjs"
|
|
617
630
|
],
|
|
618
631
|
"gzip": true,
|
|
619
|
-
"limit": "
|
|
632
|
+
"limit": "173.38 kB"
|
|
620
633
|
}
|
|
621
634
|
],
|
|
622
635
|
"repository": {
|
|
@@ -685,6 +698,7 @@
|
|
|
685
698
|
"@types/react-dom": "^19.2.4",
|
|
686
699
|
"@vitejs/plugin-react": "^6.0.5",
|
|
687
700
|
"@vitest/coverage-v8": "^4.1.11",
|
|
701
|
+
"@xyflow/react": "^12.12.1",
|
|
688
702
|
"ag-grid-community": "^36.2.0",
|
|
689
703
|
"ag-grid-react": "^36.2.0",
|
|
690
704
|
"axe-core": "^4.13.0",
|
|
@@ -718,6 +732,6 @@
|
|
|
718
732
|
"zod": "^4.6.5"
|
|
719
733
|
},
|
|
720
734
|
"dependencies": {
|
|
721
|
-
"@box-kite/core": "2.4.
|
|
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-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;
|