@box-kite/react 2.2.6 → 2.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box-kite/react",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "pages/**"
@@ -81,6 +81,7 @@
81
81
  "build": "npm run build:core && vite build",
82
82
  "build:core": "vite build --config vite.core.config.ts && node scripts/postbuild-core.mjs",
83
83
  "build:mcp": "vite build --config vite.mcp.config.ts && node scripts/postbuild-mcp.mjs",
84
+ "build:create": "vite build --config vite.create.config.ts && node scripts/postbuild-create.mjs",
84
85
  "postbuild": "node scripts/postbuild.mjs",
85
86
  "build:dev": "npm run build:core && vite build --mode dev",
86
87
  "compile": "tsc --noEmit --skipLibCheck",
@@ -98,10 +99,12 @@
98
99
  "docs:components": "node scripts/check-components-api.mjs --fix",
99
100
  "check:catalog": "node scripts/check-catalog-api.mjs",
100
101
  "docs:catalog": "node scripts/check-catalog-api.mjs --fix",
102
+ "check:create": "node scripts/check-create-templates.mjs",
103
+ "docs:create": "node scripts/check-create-templates.mjs --fix",
101
104
  "check:conventions": "node scripts/check-component-conventions.mjs",
102
105
  "check:agents": "node scripts/check-agent-files.mjs",
103
106
  "docs:agents": "node scripts/check-agent-files.mjs --fix",
104
- "check:package": "publint dist && attw --pack dist --ignore-rules false-esm cjs-resolves-to-esm internal-resolution-error && publint dist-core && attw --pack dist-core --ignore-rules false-esm cjs-resolves-to-esm internal-resolution-error && publint dist-mcp",
107
+ "check:package": "publint dist && attw --pack dist --ignore-rules false-esm cjs-resolves-to-esm internal-resolution-error && publint dist-core && attw --pack dist-core --ignore-rules false-esm cjs-resolves-to-esm internal-resolution-error && publint dist-mcp && publint dist-create",
105
108
  "bench": "node bench/run.mjs",
106
109
  "compare": "node dev/compare/report.mjs",
107
110
  "compare:tailwind": "node dev/compare/report.mjs tailwind",
@@ -122,7 +125,7 @@
122
125
  "./themeReveal-*"
123
126
  ],
124
127
  "gzip": true,
125
- "limit": "39.45 KB"
128
+ "limit": "40.47 kB"
126
129
  },
127
130
  {
128
131
  "name": "Box in a Server Component (react-server entry)",
@@ -134,7 +137,7 @@
134
137
  "./themeReveal-*"
135
138
  ],
136
139
  "gzip": true,
137
- "limit": "37.47 KB"
140
+ "limit": "38.18 kB"
138
141
  },
139
142
  {
140
143
  "name": "Behavior primitives (a11y entry)",
@@ -170,7 +173,7 @@
170
173
  "./themeReveal-*"
171
174
  ],
172
175
  "gzip": true,
173
- "limit": "61.11 KB"
176
+ "limit": "61.80 kB"
174
177
  },
175
178
  {
176
179
  "name": "Spec renderer (spec entry)",
@@ -212,7 +215,7 @@
212
215
  "name": "Core engine (@box-kite/core, no React)",
213
216
  "path": "dist-core/core.mjs",
214
217
  "gzip": true,
215
- "limit": "38.68 KB",
218
+ "limit": "39.43 kB",
216
219
  "ignore": [
217
220
  "./diagnostics-*",
218
221
  "./themeReveal-*"
@@ -228,7 +231,7 @@
228
231
  "./themeReveal-*"
229
232
  ],
230
233
  "gzip": true,
231
- "limit": "41.54 KB"
234
+ "limit": "42.53 kB"
232
235
  },
233
236
  {
234
237
  "name": "Popover",
@@ -240,7 +243,7 @@
240
243
  "./themeReveal-*"
241
244
  ],
242
245
  "gzip": true,
243
- "limit": "43.07 KB"
246
+ "limit": "44.08 kB"
244
247
  },
245
248
  {
246
249
  "name": "Menu",
@@ -252,7 +255,7 @@
252
255
  "./themeReveal-*"
253
256
  ],
254
257
  "gzip": true,
255
- "limit": "45.31 KB"
258
+ "limit": "46.32 kB"
256
259
  },
257
260
  {
258
261
  "name": "Accordion",
@@ -264,7 +267,7 @@
264
267
  "./themeReveal-*"
265
268
  ],
266
269
  "gzip": true,
267
- "limit": "40.78 KB"
270
+ "limit": "41.80 kB"
268
271
  },
269
272
  {
270
273
  "name": "Agent",
@@ -276,7 +279,7 @@
276
279
  "./themeReveal-*"
277
280
  ],
278
281
  "gzip": true,
279
- "limit": "41.56 KB"
282
+ "limit": "42.57 kB"
280
283
  },
281
284
  {
282
285
  "name": "Markdown",
@@ -288,7 +291,7 @@
288
291
  "./themeReveal-*"
289
292
  ],
290
293
  "gzip": true,
291
- "limit": "40.04 KB"
294
+ "limit": "41.04 kB"
292
295
  },
293
296
  {
294
297
  "name": "List",
@@ -300,7 +303,7 @@
300
303
  "./themeReveal-*"
301
304
  ],
302
305
  "gzip": true,
303
- "limit": "41.36 KB"
306
+ "limit": "42.38 kB"
304
307
  },
305
308
  {
306
309
  "name": "SwipeItem",
@@ -312,7 +315,7 @@
312
315
  "./themeReveal-*"
313
316
  ],
314
317
  "gzip": true,
315
- "limit": "44.44 KB"
318
+ "limit": "45.47 kB"
316
319
  },
317
320
  {
318
321
  "name": "SortableList",
@@ -324,7 +327,7 @@
324
327
  "./themeReveal-*"
325
328
  ],
326
329
  "gzip": true,
327
- "limit": "44.72 KB"
330
+ "limit": "45.80 kB"
328
331
  },
329
332
  {
330
333
  "name": "VirtualList",
@@ -336,7 +339,7 @@
336
339
  "./themeReveal-*"
337
340
  ],
338
341
  "gzip": true,
339
- "limit": "43.53 KB"
342
+ "limit": "44.58 kB"
340
343
  },
341
344
  {
342
345
  "name": "Skeleton",
@@ -348,7 +351,7 @@
348
351
  "./themeReveal-*"
349
352
  ],
350
353
  "gzip": true,
351
- "limit": "39.39 KB"
354
+ "limit": "40.38 kB"
352
355
  },
353
356
  {
354
357
  "name": "Tabs",
@@ -360,7 +363,7 @@
360
363
  "./themeReveal-*"
361
364
  ],
362
365
  "gzip": true,
363
- "limit": "41.99 KB"
366
+ "limit": "43.01 kB"
364
367
  },
365
368
  {
366
369
  "name": "Slider",
@@ -372,7 +375,7 @@
372
375
  "./themeReveal-*"
373
376
  ],
374
377
  "gzip": true,
375
- "limit": "41.16 KB"
378
+ "limit": "42.16 kB"
376
379
  },
377
380
  {
378
381
  "name": "Progress",
@@ -384,7 +387,7 @@
384
387
  "./themeReveal-*"
385
388
  ],
386
389
  "gzip": true,
387
- "limit": "39.34 KB"
390
+ "limit": "40.35 kB"
388
391
  },
389
392
  {
390
393
  "name": "Toaster",
@@ -396,7 +399,7 @@
396
399
  "./themeReveal-*"
397
400
  ],
398
401
  "gzip": true,
399
- "limit": "42.77 KB"
402
+ "limit": "43.78 kB"
400
403
  },
401
404
  {
402
405
  "name": "DateField",
@@ -408,7 +411,7 @@
408
411
  "./themeReveal-*"
409
412
  ],
410
413
  "gzip": true,
411
- "limit": "47.97 KB"
414
+ "limit": "49.03 kB"
412
415
  },
413
416
  {
414
417
  "name": "Calendar",
@@ -420,7 +423,7 @@
420
423
  "./themeReveal-*"
421
424
  ],
422
425
  "gzip": true,
423
- "limit": "47.39 KB"
426
+ "limit": "48.39 kB"
424
427
  },
425
428
  {
426
429
  "name": "DatePicker",
@@ -432,7 +435,7 @@
432
435
  "./themeReveal-*"
433
436
  ],
434
437
  "gzip": true,
435
- "limit": "60.07 KB"
438
+ "limit": "61.10 kB"
436
439
  },
437
440
  {
438
441
  "name": "DateTime",
@@ -444,7 +447,7 @@
444
447
  "./themeReveal-*"
445
448
  ],
446
449
  "gzip": true,
447
- "limit": "42.9 KB"
450
+ "limit": "43.92 kB"
448
451
  },
449
452
  {
450
453
  "name": "TimeZoneSelect",
@@ -456,7 +459,7 @@
456
459
  "./themeReveal-*"
457
460
  ],
458
461
  "gzip": true,
459
- "limit": "50.51 KB"
462
+ "limit": "51.50 kB"
460
463
  },
461
464
  {
462
465
  "name": "Combobox",
@@ -468,7 +471,7 @@
468
471
  "./themeReveal-*"
469
472
  ],
470
473
  "gzip": true,
471
- "limit": "48.58 KB"
474
+ "limit": "49.59 kB"
472
475
  },
473
476
  {
474
477
  "name": "Dashboard",
@@ -480,7 +483,7 @@
480
483
  "./themeReveal-*"
481
484
  ],
482
485
  "gzip": true,
483
- "limit": "45.01 KB"
486
+ "limit": "46.06 kB"
484
487
  },
485
488
  {
486
489
  "name": "DataGrid",
@@ -494,7 +497,7 @@
494
497
  "../dataGridDateParts.mjs"
495
498
  ],
496
499
  "gzip": true,
497
- "limit": "94.65 KB"
500
+ "limit": "95.67 kB"
498
501
  },
499
502
  {
500
503
  "name": "DataGrid export, the chunk fetched on the first press",
@@ -546,7 +549,7 @@
546
549
  "./themeReveal-*"
547
550
  ],
548
551
  "gzip": true,
549
- "limit": "162.25 KB"
552
+ "limit": "163.09 kB"
550
553
  }
551
554
  ],
552
555
  "repository": {
@@ -586,13 +589,14 @@
586
589
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
587
590
  },
588
591
  "dependencies": {
589
- "@box-kite/core": "2.2.6",
592
+ "@box-kite/core": "2.2.7",
590
593
  "csstype": "^3.2.3",
591
594
  "use-sync-external-store": "^1.6.0"
592
595
  },
593
596
  "devDependencies": {
594
597
  "@arethetypeswrong/cli": "^0.18.5",
595
598
  "@assistant-ui/core": "^0.3.20",
599
+ "@clack/prompts": "^1.8.1",
596
600
  "@copilotkit/a2ui-renderer": "^1.73.0",
597
601
  "@emotion/react": "^11.14.0",
598
602
  "@emotion/styled": "^11.14.1",
@@ -623,6 +627,7 @@
623
627
  "ag-grid-community": "^36.2.0",
624
628
  "ag-grid-react": "^36.2.0",
625
629
  "axe-core": "^4.13.0",
630
+ "create-vite": "^9.3.0",
626
631
  "eslint": "^10.8.0",
627
632
  "eslint-config-prettier": "^10.1.8",
628
633
  "eslint-plugin-import-x": "^4.17.1",
@@ -29,6 +29,13 @@ interface ThemeProps {
29
29
  * since one wrapper holding a design in both light and dark is what a themed section usually is.
30
30
  */
31
31
  components?: ComponentsRegistry;
32
+ /**
33
+ * The design this subtree is drawn in — a name given to `Box.components(styles, { design })` — written as
34
+ * `data-design` on `<html>` (`use="global"`) or on the wrapper. `Box.useDesign()` reads and sets it.
35
+ */
36
+ design?: string;
37
+ /** When provided, persists the design `Box.useDesign()` sets to localStorage under this key. */
38
+ designStorageKey?: string;
32
39
  }
33
40
  /**
34
41
  * The React binding for the theme system. Everything that actually touches the platform — reading
@@ -39,5 +46,7 @@ interface ThemeProps {
39
46
  declare function Theme(props: ThemeProps): React.JSX.Element;
40
47
  declare namespace Theme {
41
48
  function useTheme(): [string, (theme: string | null) => void];
49
+ /** The design the nearest provider is drawing, and the setter; null goes back to its `design` prop. */
50
+ function useDesign(): [string | undefined, (design: string | null) => void];
42
51
  }
43
52
  export default Theme;
@@ -2,6 +2,8 @@ import { default as React } from 'react';
2
2
  interface ThemeContextProps {
3
3
  theme: string;
4
4
  setTheme(theme: string | null): void;
5
+ design?: string;
6
+ setDesign(design: string | null): void;
5
7
  }
6
8
  declare const ThemeContext: React.Context<ThemeContextProps>;
7
9
  export default ThemeContext;
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.l(e,i===`svg`);return n.default.createElement(n.default.Fragment,null,s,n.default.createElement(i,t.d(e,o),a))}function a(e){return i(e)}var o=a;o.extend=r.BoxExtends.extend,o.components=r.BoxExtends.components,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.p(t.l(e,n?.svg===!0),e.className)}exports.default=o,exports.useBoxElement=i,exports.useClassNames=s;
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.l(e,i===`svg`);return n.default.createElement(n.default.Fragment,null,s,n.default.createElement(i,t.d(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.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.p(t.l(e,n?.svg===!0),e.className)}exports.default=o,exports.useBoxElement=i,exports.useClassNames=s;
package/rsc.d.ts CHANGED
@@ -12,6 +12,8 @@ interface RscBoxType {
12
12
  <TTag extends keyof React.JSX.IntrinsicElements = 'div', TKey extends keyof ComponentsAndVariants = never>(props: BoxCoreProps<TTag, TKey>): React.ReactNode;
13
13
  extend: typeof BoxExtends.extend;
14
14
  components: typeof BoxExtends.components;
15
+ /** The `vars` record that points the components' `accent` and `base` families at others, for an element and its subtree. */
16
+ palette: typeof BoxExtends.palette;
15
17
  /** A design for one subtree. A Server Component cannot read the provider that applies it; a client one under `<Box.Components>` can. */
16
18
  createComponents: typeof BoxExtends.createComponents;
17
19
  keyframes: typeof BoxExtends.keyframes;
@@ -37,3 +39,4 @@ export declare function useClassNames<TKey extends keyof ComponentsAndVariants =
37
39
  }): BoxClassNames;
38
40
  export default RscBox;
39
41
  export type { BoxClassNames, BoxClassNameProps };
42
+ export type { BoxComponentStyles, BoxStyleProps } from '@box-kite/core/types';
package/rsc.mjs CHANGED
@@ -13,7 +13,7 @@ function l(e) {
13
13
  return c(e);
14
14
  }
15
15
  var u = l;
16
- u.extend = i.extend, u.components = i.components, 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;
16
+ u.extend = i.extend, u.components = i.components, u.palette = i.palette, 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
18
  return n(t(e, r?.svg === !0), e.className);
19
19
  }