@box-kite/react 2.2.5 → 2.2.6

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.
Files changed (83) hide show
  1. package/.claude/rules/box-kite-rules.md +3 -1
  2. package/.claude/skills/box-kite/SKILL.md +3 -1
  3. package/.claude/skills/box-kite/references/components.md +34 -0
  4. package/.cursor/rules/box-kite.mdc +3 -1
  5. package/AGENTS.md +3 -1
  6. package/BOX_AI_CONTEXT.md +95 -5
  7. package/BOX_KITE_AI_CONTEXT.md +95 -5
  8. package/box.cjs +1 -1
  9. package/box.mjs +7 -7
  10. package/catalog.cjs +1 -1
  11. package/catalog.mjs +521 -0
  12. package/client.cjs +1 -1
  13. package/client.mjs +94 -106
  14. package/components/calendar.cjs +1 -0
  15. package/components/calendar.d.ts +77 -0
  16. package/components/calendar.mjs +483 -0
  17. package/components/dataGrid/components/dataGridBooleanValue.d.ts +11 -0
  18. package/components/dataGrid/components/dataGridDateParts.d.ts +40 -0
  19. package/components/dataGrid/components/dataGridDateValue.d.ts +14 -0
  20. package/components/dataGrid/contracts/dataGridContract.d.ts +38 -11
  21. package/components/dataGrid/models/columnModel.d.ts +3 -1
  22. package/components/dataGrid/models/editModel.d.ts +3 -1
  23. package/components/dataGrid/models/localeText.d.ts +4 -0
  24. package/components/dataGrid/useDateParts.d.ts +17 -0
  25. package/components/dataGrid.cjs +3 -3
  26. package/components/dataGrid.mjs +797 -664
  27. package/components/dateField.cjs +1 -0
  28. package/components/dateField.d.ts +78 -0
  29. package/components/dateField.mjs +313 -0
  30. package/components/datePicker.cjs +1 -0
  31. package/components/datePicker.d.ts +120 -0
  32. package/components/datePicker.mjs +529 -0
  33. package/components/dateTime.cjs +1 -0
  34. package/components/dateTime.d.ts +23 -0
  35. package/components/dateTime.mjs +34 -0
  36. package/components/dialog.cjs +1 -1
  37. package/components/dialog.mjs +87 -75
  38. package/components/overlay.cjs +1 -1
  39. package/components/overlay.mjs +1 -1
  40. package/components/semantics.d.ts +29 -29
  41. package/components/timeZoneSelect.cjs +1 -0
  42. package/components/timeZoneSelect.d.ts +52 -0
  43. package/components/timeZoneSelect.mjs +74 -0
  44. package/components/toaster.cjs +1 -1
  45. package/components/toaster.mjs +1 -1
  46. package/dataGridDateParts.cjs +1 -0
  47. package/dataGridDateParts.mjs +223 -0
  48. package/dataGridList.cjs +1 -1
  49. package/dataGridList.mjs +328 -365
  50. package/dataGridListLayout.cjs +1 -0
  51. package/dataGridListLayout.mjs +49 -0
  52. package/date-environment.cjs +1 -0
  53. package/date-environment.mjs +29 -0
  54. package/date-input.cjs +1 -0
  55. package/date-input.mjs +346 -0
  56. package/date-math.cjs +1 -0
  57. package/date-math.mjs +317 -0
  58. package/date.cjs +1 -0
  59. package/date.d.ts +40 -0
  60. package/date.mjs +4 -0
  61. package/dates.cjs +1 -0
  62. package/dates.mjs +689 -0
  63. package/docs/components.md +6 -1
  64. package/package.json +118 -26
  65. package/react/boxComponent.d.ts +1 -1
  66. package/react/date/dateChange.d.ts +18 -0
  67. package/react/date/dateEnvironment.d.ts +34 -0
  68. package/react-shared.cjs +1 -1
  69. package/react-shared.mjs +1 -1
  70. package/ssg.cjs +1 -1
  71. package/ssg.mjs +1 -1
  72. package/utils/date/calendar.d.ts +44 -0
  73. package/utils/date/calendarModel.d.ts +46 -0
  74. package/utils/date/dateTime.d.ts +144 -0
  75. package/utils/date/fieldModel.d.ts +74 -0
  76. package/utils/date/format.d.ts +39 -0
  77. package/utils/date/iso.d.ts +40 -0
  78. package/utils/date/locale.d.ts +17 -0
  79. package/utils/date/parse.d.ts +20 -0
  80. package/utils/date/settings.d.ts +26 -0
  81. package/utils/date/value.d.ts +43 -0
  82. package/utils/date/zoneOptions.d.ts +19 -0
  83. package/utils/date/zones.d.ts +32 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box-kite/react",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "pages/**"
@@ -44,6 +44,11 @@
44
44
  "import": "./interop.mjs",
45
45
  "require": "./interop.cjs"
46
46
  },
47
+ "./date": {
48
+ "types": "./date.d.ts",
49
+ "import": "./date.mjs",
50
+ "require": "./date.cjs"
51
+ },
47
52
  "./spec": {
48
53
  "types": "./spec.d.ts",
49
54
  "import": "./spec.mjs",
@@ -117,7 +122,7 @@
117
122
  "./themeReveal-*"
118
123
  ],
119
124
  "gzip": true,
120
- "limit": "39.07 KB"
125
+ "limit": "39.45 KB"
121
126
  },
122
127
  {
123
128
  "name": "Box in a Server Component (react-server entry)",
@@ -129,7 +134,7 @@
129
134
  "./themeReveal-*"
130
135
  ],
131
136
  "gzip": true,
132
- "limit": "37.10 KB"
137
+ "limit": "37.47 KB"
133
138
  },
134
139
  {
135
140
  "name": "Behavior primitives (a11y entry)",
@@ -165,7 +170,7 @@
165
170
  "./themeReveal-*"
166
171
  ],
167
172
  "gzip": true,
168
- "limit": "58.71 KB"
173
+ "limit": "61.11 KB"
169
174
  },
170
175
  {
171
176
  "name": "Spec renderer (spec entry)",
@@ -191,11 +196,23 @@
191
196
  "gzip": true,
192
197
  "limit": "4 KB"
193
198
  },
199
+ {
200
+ "name": "Dates, times and zones (date entry, no React)",
201
+ "path": "dist/date.mjs",
202
+ "ignore": [
203
+ "react",
204
+ "react-dom",
205
+ "./diagnostics-*",
206
+ "./themeReveal-*"
207
+ ],
208
+ "gzip": true,
209
+ "limit": "7.59 KB"
210
+ },
194
211
  {
195
212
  "name": "Core engine (@box-kite/core, no React)",
196
213
  "path": "dist-core/core.mjs",
197
214
  "gzip": true,
198
- "limit": "38.31 KB",
215
+ "limit": "38.68 KB",
199
216
  "ignore": [
200
217
  "./diagnostics-*",
201
218
  "./themeReveal-*"
@@ -211,7 +228,7 @@
211
228
  "./themeReveal-*"
212
229
  ],
213
230
  "gzip": true,
214
- "limit": "41.14 KB"
231
+ "limit": "41.54 KB"
215
232
  },
216
233
  {
217
234
  "name": "Popover",
@@ -223,7 +240,7 @@
223
240
  "./themeReveal-*"
224
241
  ],
225
242
  "gzip": true,
226
- "limit": "42.68 KB"
243
+ "limit": "43.07 KB"
227
244
  },
228
245
  {
229
246
  "name": "Menu",
@@ -235,7 +252,7 @@
235
252
  "./themeReveal-*"
236
253
  ],
237
254
  "gzip": true,
238
- "limit": "44.94 KB"
255
+ "limit": "45.31 KB"
239
256
  },
240
257
  {
241
258
  "name": "Accordion",
@@ -247,7 +264,7 @@
247
264
  "./themeReveal-*"
248
265
  ],
249
266
  "gzip": true,
250
- "limit": "40.41 KB"
267
+ "limit": "40.78 KB"
251
268
  },
252
269
  {
253
270
  "name": "Agent",
@@ -259,7 +276,7 @@
259
276
  "./themeReveal-*"
260
277
  ],
261
278
  "gzip": true,
262
- "limit": "41.19 KB"
279
+ "limit": "41.56 KB"
263
280
  },
264
281
  {
265
282
  "name": "Markdown",
@@ -271,7 +288,7 @@
271
288
  "./themeReveal-*"
272
289
  ],
273
290
  "gzip": true,
274
- "limit": "39.66 KB"
291
+ "limit": "40.04 KB"
275
292
  },
276
293
  {
277
294
  "name": "List",
@@ -283,7 +300,7 @@
283
300
  "./themeReveal-*"
284
301
  ],
285
302
  "gzip": true,
286
- "limit": "40.98 KB"
303
+ "limit": "41.36 KB"
287
304
  },
288
305
  {
289
306
  "name": "SwipeItem",
@@ -295,7 +312,7 @@
295
312
  "./themeReveal-*"
296
313
  ],
297
314
  "gzip": true,
298
- "limit": "44.06 KB"
315
+ "limit": "44.44 KB"
299
316
  },
300
317
  {
301
318
  "name": "SortableList",
@@ -307,7 +324,7 @@
307
324
  "./themeReveal-*"
308
325
  ],
309
326
  "gzip": true,
310
- "limit": "44.33 KB"
327
+ "limit": "44.72 KB"
311
328
  },
312
329
  {
313
330
  "name": "VirtualList",
@@ -319,7 +336,7 @@
319
336
  "./themeReveal-*"
320
337
  ],
321
338
  "gzip": true,
322
- "limit": "43.16 KB"
339
+ "limit": "43.53 KB"
323
340
  },
324
341
  {
325
342
  "name": "Skeleton",
@@ -331,7 +348,7 @@
331
348
  "./themeReveal-*"
332
349
  ],
333
350
  "gzip": true,
334
- "limit": "38.98 KB"
351
+ "limit": "39.39 KB"
335
352
  },
336
353
  {
337
354
  "name": "Tabs",
@@ -343,7 +360,7 @@
343
360
  "./themeReveal-*"
344
361
  ],
345
362
  "gzip": true,
346
- "limit": "41.62 KB"
363
+ "limit": "41.99 KB"
347
364
  },
348
365
  {
349
366
  "name": "Slider",
@@ -355,7 +372,7 @@
355
372
  "./themeReveal-*"
356
373
  ],
357
374
  "gzip": true,
358
- "limit": "40.77 KB"
375
+ "limit": "41.16 KB"
359
376
  },
360
377
  {
361
378
  "name": "Progress",
@@ -367,7 +384,7 @@
367
384
  "./themeReveal-*"
368
385
  ],
369
386
  "gzip": true,
370
- "limit": "38.96 KB"
387
+ "limit": "39.34 KB"
371
388
  },
372
389
  {
373
390
  "name": "Toaster",
@@ -379,7 +396,67 @@
379
396
  "./themeReveal-*"
380
397
  ],
381
398
  "gzip": true,
382
- "limit": "42.40 KB"
399
+ "limit": "42.77 KB"
400
+ },
401
+ {
402
+ "name": "DateField",
403
+ "path": "dist/components/dateField.mjs",
404
+ "ignore": [
405
+ "react",
406
+ "react-dom",
407
+ "./diagnostics-*",
408
+ "./themeReveal-*"
409
+ ],
410
+ "gzip": true,
411
+ "limit": "47.97 KB"
412
+ },
413
+ {
414
+ "name": "Calendar",
415
+ "path": "dist/components/calendar.mjs",
416
+ "ignore": [
417
+ "react",
418
+ "react-dom",
419
+ "./diagnostics-*",
420
+ "./themeReveal-*"
421
+ ],
422
+ "gzip": true,
423
+ "limit": "47.39 KB"
424
+ },
425
+ {
426
+ "name": "DatePicker",
427
+ "path": "dist/components/datePicker.mjs",
428
+ "ignore": [
429
+ "react",
430
+ "react-dom",
431
+ "./diagnostics-*",
432
+ "./themeReveal-*"
433
+ ],
434
+ "gzip": true,
435
+ "limit": "60.07 KB"
436
+ },
437
+ {
438
+ "name": "DateTime",
439
+ "path": "dist/components/dateTime.mjs",
440
+ "ignore": [
441
+ "react",
442
+ "react-dom",
443
+ "./diagnostics-*",
444
+ "./themeReveal-*"
445
+ ],
446
+ "gzip": true,
447
+ "limit": "42.9 KB"
448
+ },
449
+ {
450
+ "name": "TimeZoneSelect",
451
+ "path": "dist/components/timeZoneSelect.mjs",
452
+ "ignore": [
453
+ "react",
454
+ "react-dom",
455
+ "./diagnostics-*",
456
+ "./themeReveal-*"
457
+ ],
458
+ "gzip": true,
459
+ "limit": "50.51 KB"
383
460
  },
384
461
  {
385
462
  "name": "Combobox",
@@ -391,7 +468,7 @@
391
468
  "./themeReveal-*"
392
469
  ],
393
470
  "gzip": true,
394
- "limit": "48.21 KB"
471
+ "limit": "48.58 KB"
395
472
  },
396
473
  {
397
474
  "name": "Dashboard",
@@ -403,7 +480,7 @@
403
480
  "./themeReveal-*"
404
481
  ],
405
482
  "gzip": true,
406
- "limit": "44.62 KB"
483
+ "limit": "45.01 KB"
407
484
  },
408
485
  {
409
486
  "name": "DataGrid",
@@ -413,10 +490,11 @@
413
490
  "react-dom",
414
491
  "./diagnostics-*",
415
492
  "./themeReveal-*",
416
- "../dataGridList.mjs"
493
+ "../dataGridList.mjs",
494
+ "../dataGridDateParts.mjs"
417
495
  ],
418
496
  "gzip": true,
419
- "limit": "93.23 KB"
497
+ "limit": "94.65 KB"
420
498
  },
421
499
  {
422
500
  "name": "DataGrid export, the chunk fetched on the first press",
@@ -444,6 +522,20 @@
444
522
  "gzip": true,
445
523
  "limit": "7.83 KB"
446
524
  },
525
+ {
526
+ "name": "DataGrid dates, the chunk a grid with a date column fetches on top of the grid",
527
+ "path": "dist/dataGridDateParts.mjs",
528
+ "ignore": [
529
+ "react",
530
+ "react-dom",
531
+ "./diagnostics-*",
532
+ "./themeReveal-*",
533
+ "./box.mjs",
534
+ "./components/*"
535
+ ],
536
+ "gzip": true,
537
+ "limit": "7.49 KB"
538
+ },
447
539
  {
448
540
  "name": "Full library (Box + ssg + every component)",
449
541
  "path": "dev/size-full.mjs",
@@ -454,7 +546,7 @@
454
546
  "./themeReveal-*"
455
547
  ],
456
548
  "gzip": true,
457
- "limit": "140.38 KB"
549
+ "limit": "162.25 KB"
458
550
  }
459
551
  ],
460
552
  "repository": {
@@ -494,7 +586,7 @@
494
586
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
495
587
  },
496
588
  "dependencies": {
497
- "@box-kite/core": "2.2.5",
589
+ "@box-kite/core": "2.2.6",
498
590
  "csstype": "^3.2.3",
499
591
  "use-sync-external-store": "^1.6.0"
500
592
  },
@@ -4,7 +4,7 @@ type Render = (props: any, ref: any) => React.ReactNode;
4
4
  * A component that is a Box: memoized, which skips a leaf whose props are all primitives, and one fiber on
5
5
  * React 19. React 18 needs a `forwardRef` under the `memo`, which makes it two.
6
6
  */
7
- export default function boxComponent(render: Render, displayName: string): React.MemoExoticComponent<((props: {
7
+ export default function boxComponent(render: Render, displayName: string): React.MemoExoticComponent<(({ ref, ...props }: {
8
8
  ref?: Ref<unknown>;
9
9
  }) => React.ReactNode) | React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>>;
10
10
  export {};
@@ -0,0 +1,18 @@
1
+ import { DateReadings } from '../../utils/date/dateTime';
2
+ import { ChangeDetails } from '../a11y/useControllableState';
3
+ /**
4
+ * Why a date value changed: digits or arrows in a field, a paste, a day picked in a calendar or a time in a
5
+ * list, a preset, the clear button, or a form reset.
6
+ */
7
+ export type DateChangeReason = 'keyboard' | 'paste' | 'select' | 'preset' | 'clear' | 'reset';
8
+ /**
9
+ * What a date control hands its `onValueChange` beside the string: the reason, plus every reading of the
10
+ * value an app is likely to want — `utc`, the reader's `local` wall clock, a `Date`, the epoch.
11
+ *
12
+ * ```tsx
13
+ * <DateField type="datetime" onValueChange={(value, { utc, local }) => save(utc)} />
14
+ * ```
15
+ */
16
+ export type DateChangeDetails<TReason extends string = DateChangeReason> = ChangeDetails<TReason> & DateReadings;
17
+ /** A date control's change handler: the canonical string (or `null`) and the readings. */
18
+ export type DateChangeHandler<TValue = string | null, TReason extends string = DateChangeReason> = (value: TValue, details: DateChangeDetails<TReason>) => void;
@@ -0,0 +1,34 @@
1
+ import { ZoneInput } from '../../utils/date/zones';
2
+ /** What a subtree knows about its reader: the language and the zone. */
3
+ export interface DateEnvironmentValue {
4
+ /** A BCP 47 tag. */
5
+ locale?: string;
6
+ /** The reader's zone — what `'local'` means inside. */
7
+ timeZone?: string;
8
+ }
9
+ export interface DateProviderProps extends DateEnvironmentValue {
10
+ children?: React.ReactNode;
11
+ }
12
+ /**
13
+ * Says who the reader is for every date component inside: their language and their zone. On a server that
14
+ * read the zone off a cookie (`readZoneCookie`), this is what makes the first paint already right — the
15
+ * server and the browser render the same text, and nothing changes after hydration.
16
+ */
17
+ export declare function DateProvider({ locale, timeZone, children }: DateProviderProps): import("react").JSX.Element;
18
+ export interface DateEnvironment {
19
+ locale: string;
20
+ /** The zone resolved to a name: `UTC`, an IANA zone or a fixed offset. */
21
+ zone: string;
22
+ /** The reader's own zone, which is what `'local'` resolved to. */
23
+ readerZone: string;
24
+ }
25
+ /**
26
+ * The locale and zone a date component renders in. A prop wins, then a `DateProvider`, then
27
+ * `configureDates()`, then the browser. **A server and a hydrating browser both use the fallback** — `UTC` and
28
+ * `en-US` unless something above configured them — because neither can know the other's runtime, and two
29
+ * renders that disagree are a hydration error. The render after hydration switches to the reader's own.
30
+ */
31
+ export declare function useDateEnvironment(props?: {
32
+ locale?: string;
33
+ zone?: ZoneInput;
34
+ }): DateEnvironment;
package/react-shared.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?t=>e(t,t.ref??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1,f=new WeakMap,p=new WeakMap;function m(e){let n=f.get(e);if(!n){let{href:r,css:i,precedence:a}=e;n=t.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),f.set(e,n)}return n}function h(e){if(!e?.length)return;!u&&!d&&(d=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${t.default.version} will render them inline. Use the default sink instead.`));let n=p.get(e);return n||(n=e.map(m),p.set(e,n)),n}function g(e,t,r){let{classNames:i,signature:a,styleElements:o}=(0,n.getDefaultEngine)().resolveClassNames(e,t,r);return{classNames:i,signature:a,styleElements:h(o)}}var _=`__boxAttributesInProps`;function v(e){return e[_]=!0,e}function y(e){return typeof e==`function`||typeof e==`object`&&e?e[_]===!0:!1}var b=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function x(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&b.some(e=>e in t)))return{"aria-hidden":!0}}var S;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(S||={});var C=S,w;(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})(w||={});var T=w,E=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],D=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function O(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}});
1
+ const e=require("./rolldown-runtime.cjs");let t=require("react");t=e.t(t,1);let n=require("@box-kite/core");function r({classNames:e,styleElements:t},r){return{className:(0,n.classNames)(e,r).join(` `),styles:t}}var i=parseInt(t.default.version,10)>=19;function a(e,n){let r=i?({ref:t,...n})=>e(n,t??null):(0,t.forwardRef)(e),a=(0,t.memo)(r);return r.displayName=n,a.displayName=n,a}var o={selected:`aria-selected`},s;(function(e){function t(e,t,n){e!==void 0&&e!=null&&(n[o[t]??t]=Array.isArray(e)?e[0]:e)}e.assignBooleanProp=t})(s||={});var c=s;function l(e,t){let r=e,{props:i,className:a,disabled:o,required:s,checked:l,selected:u}=r,d={...i,className:(0,n.classNames)(t,a).join(` `)};return c.assignBooleanProp(o,`disabled`,d),c.assignBooleanProp(s,`required`,d),c.assignBooleanProp(l,`checked`,d),c.assignBooleanProp(u,`selected`,d),`style`in r&&(d.style=r.style),`id`in r&&(d.id=r.id),d}var u=parseInt(t.default.version,10)>=19,d=!1,f=new WeakMap,p=new WeakMap;function m(e){let n=f.get(e);if(!n){let{href:r,css:i,precedence:a}=e;n=t.default.createElement(`style`,{key:r,href:r,precedence:a,dangerouslySetInnerHTML:{__html:i}}),f.set(e,n)}return n}function h(e){if(!e?.length)return;!u&&!d&&(d=!0,console.warn(`[box-kite] Box.configure({ sink: 'element' }) needs React 19 to hoist and dedupe its <style> elements; React ${t.default.version} will render them inline. Use the default sink instead.`));let n=p.get(e);return n||(n=e.map(m),p.set(e,n)),n}function g(e,t,r){let{classNames:i,signature:a,styleElements:o}=(0,n.getDefaultEngine)().resolveClassNames(e,t,r);return{classNames:i,signature:a,styleElements:h(o)}}var _=`__boxAttributesInProps`;function v(e){return e[_]=!0,e}function y(e){return typeof e==`function`||typeof e==`object`&&e?e[_]===!0:!1}var b=[`role`,`aria-label`,`aria-labelledby`,`aria-hidden`];function x(e,t){if(e!==void 0)return{role:`img`,"aria-label":e};if(!(t&&b.some(e=>e in t)))return{"aria-hidden":!0}}var S;(function(e){function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}e.capitalize=t})(S||={});var C=S,w;(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})(w||={});var T=w,E=[`sky-500`,`emerald-500`,`amber-500`,`violet-500`,`rose-500`,`cyan-500`],D=[`sky-400`,`emerald-400`,`amber-400`,`violet-400`,`rose-400`,`cyan-400`];function O(e){return e.reduce((e,t,n)=>(e[`chart-${n+1}`]=t,e),{})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}});
package/react-shared.mjs CHANGED
@@ -11,7 +11,7 @@ function a({ classNames: e, styleElements: t }, n) {
11
11
  //#region src/react/boxComponent.ts
12
12
  var o = parseInt(e.version, 10) >= 19;
13
13
  function s(e, r) {
14
- let i = o ? (t) => e(t, t.ref ?? null) : t(e), a = n(i);
14
+ let i = o ? ({ ref: t, ...n }) => e(n, t ?? null) : t(e), a = n(i);
15
15
  return i.displayName = r, a.displayName = r, a;
16
16
  }
17
17
  //#endregion
package/ssg.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime.cjs"),t=require("./client.cjs");let n=require("react-dom/server");n=e.t(n,1);function r(){return t.i.getStyles()}function i(){return t.i.getStyleTag()}function a(){t.i.clear()}function o(e,t=!0){let o=n.default.renderToStaticMarkup(e),s=r(),c=i();if(t){let e=o.indexOf(`<head>`);if(e>-1){let t=e+6;o=o.substring(0,t)+c+o.substring(t)}}return a(),{html:o,styles:s,styleTag:c}}exports.getStyleTag=i,exports.getStyles=r,exports.renderToStaticMarkup=o,exports.resetStyles=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime.cjs"),t=require("./client.cjs");let n=require("react-dom/server");n=e.t(n,1);function r(){return t.r.getStyles()}function i(){return t.r.getStyleTag()}function a(){t.r.clear()}function o(e,t=!0){let o=n.default.renderToStaticMarkup(e),s=r(),c=i();if(t){let e=o.indexOf(`<head>`);if(e>-1){let t=e+6;o=o.substring(0,t)+c+o.substring(t)}}return a(),{html:o,styles:s,styleTag:c}}exports.getStyleTag=i,exports.getStyles=r,exports.renderToStaticMarkup=o,exports.resetStyles=a;
package/ssg.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as e } from "./client.mjs";
1
+ import { r as e } from "./client.mjs";
2
2
  import t from "react-dom/server";
3
3
  //#region src/ssg.ts
4
4
  function n() {
@@ -0,0 +1,44 @@
1
+ /** A day on the proleptic Gregorian calendar, with no time and no zone. `month` is 1–12. */
2
+ export interface DateFields {
3
+ year: number;
4
+ month: number;
5
+ day: number;
6
+ }
7
+ /** A wall-clock time, with no date and no zone. */
8
+ export interface TimeFields {
9
+ hour: number;
10
+ minute: number;
11
+ second: number;
12
+ millisecond: number;
13
+ }
14
+ export type DateTimeFields = DateFields & TimeFields;
15
+ export declare const MS_PER_MINUTE = 60000;
16
+ export declare const MS_PER_HOUR = 3600000;
17
+ export declare const MS_PER_DAY = 86400000;
18
+ export declare const MIDNIGHT: TimeFields;
19
+ /** Floor division, so a negative epoch lands on the day before rather than the day after. */
20
+ export declare function floorDiv(value: number, by: number): number;
21
+ /** A remainder that is never negative. */
22
+ export declare function mod(value: number, by: number): number;
23
+ export declare function isLeapYear(year: number): boolean;
24
+ export declare function daysInMonth(year: number, month: number): number;
25
+ /** Days since 1970-01-01, for any year — Howard Hinnant's `days_from_civil`, pure integer arithmetic and no `Date`. */
26
+ export declare function epochDay({ year, month, day }: DateFields): number;
27
+ /** The inverse of `epochDay`. */
28
+ export declare function fromEpochDay(days: number): DateFields;
29
+ /** 0 is Sunday, which is what `Intl.Locale#getWeekInfo` counts from too once its 7 is taken as 0. */
30
+ export declare function dayOfWeek(date: DateFields): number;
31
+ /** A wall clock read as though it were UTC — the number every zone conversion starts from. */
32
+ export declare function fieldsToMs(fields: DateTimeFields): number;
33
+ export declare function msToFields(ms: number): DateTimeFields;
34
+ export declare function addDays(date: DateFields, days: number): DateFields;
35
+ /** Months forward or back, the day clamped to the month it lands in — 31 January plus a month is 28 or 29 February. */
36
+ export declare function addMonths(date: DateFields, months: number): DateFields;
37
+ export declare function compareDates(a: DateFields, b: DateFields): number;
38
+ export declare function isValidDate({ year, month, day }: DateFields): boolean;
39
+ export declare function isValidTime({ hour, minute, second, millisecond }: TimeFields): boolean;
40
+ /** The ISO 8601 week: weeks start on Monday and week 1 holds the year's first Thursday. */
41
+ export declare function isoWeek(date: DateFields): {
42
+ year: number;
43
+ week: number;
44
+ };
@@ -0,0 +1,46 @@
1
+ import { DateFields } from './calendar';
2
+ /** One day cell of a month grid. */
3
+ export interface CalendarDay {
4
+ /** `2026-10-19`. */
5
+ date: string;
6
+ day: number;
7
+ /** Whether it belongs to the month on show rather than the weeks either side of it. */
8
+ outside: boolean;
9
+ }
10
+ export interface CalendarWeek {
11
+ /** The ISO week number of the week's Thursday-anchored year. */
12
+ week: number;
13
+ days: CalendarDay[];
14
+ }
15
+ /** A day as fields, or `null` for anything that is not a date. */
16
+ export declare function dayOf(value: string | null | undefined): DateFields | null;
17
+ export declare function dayText(date: DateFields): string;
18
+ /**
19
+ * Six weeks starting on the locale's first day, always six so the grid does not change height from month to
20
+ * month — the month on show plus the days around it that complete its weeks.
21
+ */
22
+ export declare function monthGrid(year: number, month: number, firstDay: number): CalendarWeek[];
23
+ export interface NavigationOptions {
24
+ rtl: boolean;
25
+ firstDay: number;
26
+ }
27
+ /**
28
+ * Where a key moves the focused day, APG's map: the arrows a day or a week (the sideways pair following the
29
+ * reading order), Home and End the week's ends, Page Up and Down a month, with Shift a year. `null` for any
30
+ * other key.
31
+ */
32
+ export declare function moveFocus(focused: DateFields, key: string, shift: boolean, options: NavigationOptions): DateFields | null;
33
+ export interface Bounds {
34
+ min?: DateFields | null;
35
+ max?: DateFields | null;
36
+ }
37
+ /** Whether a day is before `min` or after `max`. */
38
+ export declare function isOutOfBounds(date: DateFields, bounds: Bounds): boolean;
39
+ /** A day pulled inside the bounds. */
40
+ export declare function clampDay(date: DateFields, bounds: Bounds): DateFields;
41
+ /** A range in order, whichever end was picked first. */
42
+ export declare function orderedRange(a: DateFields, b: DateFields): [DateFields, DateFields];
43
+ /** Where a day sits relative to a range: its first day, its last, strictly inside, or not in it. */
44
+ export declare function rangePosition(date: DateFields, start: DateFields | null, end: DateFields | null): 'start' | 'end' | 'middle' | null;
45
+ /** Whether any day of a range is one nobody can choose — a range is refused across a blocked day. */
46
+ export declare function rangeCrosses(start: DateFields, end: DateFields, isBlocked: (date: string) => boolean): boolean;
@@ -0,0 +1,144 @@
1
+ import { DateKind } from './iso';
2
+ import { DateInput, ZoneOptions } from './value';
3
+ import { ZoneInput } from './zones';
4
+ /** An amount of time to move a value by. Years to days move the calendar; hours and below move the clock. */
5
+ export interface Duration {
6
+ years?: number;
7
+ months?: number;
8
+ weeks?: number;
9
+ days?: number;
10
+ hours?: number;
11
+ minutes?: number;
12
+ seconds?: number;
13
+ milliseconds?: number;
14
+ }
15
+ export type DateUnit = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
16
+ export interface UnitOptions extends ZoneOptions {
17
+ /** Whose week `'week'` means — Monday-first in Moldova, Sunday-first in the US. Default the configured locale. */
18
+ locale?: string;
19
+ }
20
+ /** Every reading of one value at once — what a date control hands its `onValueChange` beside the string. */
21
+ export interface DateTimeDetails {
22
+ /** The value itself, written canonically. */
23
+ value: string;
24
+ kind: DateKind;
25
+ /** The zone the wall-clock fields below are read in. */
26
+ zone: string;
27
+ /** The moment in UTC (`…Z`). A date is its midnight in `zone`; a time has none. */
28
+ utc: string | null;
29
+ /** The moment on `zone`'s wall clock, with its offset. */
30
+ zoned: string | null;
31
+ /** The same moment as the reader's own wall clock, with no zone: what a person in the browser sees. */
32
+ local: string | null;
33
+ /** `zone`'s offset at that moment, `+03:00`. */
34
+ offset: string | null;
35
+ /** A `Date` for the moment, for an API that wants one. */
36
+ date: Date | null;
37
+ /** Epoch milliseconds. */
38
+ epoch: number | null;
39
+ year: number;
40
+ month: number;
41
+ day: number;
42
+ hour: number;
43
+ minute: number;
44
+ second: number;
45
+ millisecond: number;
46
+ }
47
+ /** What kind a string is, or `null` when it is not a date value at all. */
48
+ export declare function kindOf(input: DateInput): DateKind | null;
49
+ /** Whether the input is a value — of `kind`, when one is named. */
50
+ export declare function isValid(input: DateInput, kind?: DateKind): boolean;
51
+ /** The input rewritten canonically, its kind kept: `2026-10-19 14:30` → `2026-10-19T14:30:00`. */
52
+ export declare function normalize(input: DateInput): string | null;
53
+ /** The moment in UTC: `2026-10-19T11:30:00Z`. A date-time is read on `zone`'s wall clock, a date as its midnight there. */
54
+ export declare function toUtc(input: DateInput, options?: Omit<ZoneOptions, 'zone'> & {
55
+ from?: ZoneInput;
56
+ }): string | null;
57
+ /** The moment on another zone's wall clock, with that zone's offset: `2026-10-19T07:30:00-04:00`. */
58
+ export declare function toZone(input: DateInput, zone: ZoneInput, options?: Omit<ZoneOptions, 'zone'> & {
59
+ from?: ZoneInput;
60
+ }): string | null;
61
+ /** The moment on the reader's wall clock, with its offset. On a server, "the reader" is `configureDates({ timeZone })` or the server. */
62
+ export declare function toLocal(input: DateInput, options?: Omit<ZoneOptions, 'zone'> & {
63
+ from?: ZoneInput;
64
+ }): string | null;
65
+ /** The day an input falls on in `zone`: `2026-10-19`. */
66
+ export declare function toPlainDate(input: DateInput, options?: ZoneOptions): string | null;
67
+ /** The wall-clock time an input shows in `zone`: `14:30:00`. */
68
+ export declare function toPlainTime(input: DateInput, options?: ZoneOptions): string | null;
69
+ /** The wall clock an input shows in `zone`, with no zone attached: `2026-10-19T14:30:00`. */
70
+ export declare function toPlainDateTime(input: DateInput, options?: ZoneOptions): string | null;
71
+ /** The instant an input names, on `zone`'s wall clock. A date-time is read there; a date is its midnight. */
72
+ export declare function toInstant(input: DateInput, options?: ZoneOptions): string | null;
73
+ /** Epoch milliseconds. */
74
+ export declare function toEpoch(input: DateInput, options?: ZoneOptions): number | null;
75
+ /** A `Date`, for an API that insists. A date is its midnight in `zone`, which is the one way a `Date` can hold a day. */
76
+ export declare function toDate(input: DateInput, options?: ZoneOptions): Date | null;
77
+ /** A `Date` or epoch milliseconds as a value of `kind` — by default the instant, in UTC. */
78
+ export declare function fromDate(date: Date | number, options?: ZoneOptions & {
79
+ kind?: DateKind;
80
+ }): string | null;
81
+ /** A date and a time put together: a date-time, or with `zone` the instant it names there. */
82
+ export declare function combine(date: DateInput, time: DateInput, options?: ZoneOptions): string | null;
83
+ /** Today's date in `zone`. Default the reader's. */
84
+ export declare function today(zone?: ZoneInput): string;
85
+ /** This moment on `zone`'s wall clock, with its offset — `now('utc')` is `…Z`. */
86
+ export declare function now(zone?: ZoneInput): string;
87
+ /** The time on `zone`'s wall clock. */
88
+ export declare function currentTime(zone?: ZoneInput): string;
89
+ /**
90
+ * Moves a value by a duration, keeping its kind. The calendar half (years to days) moves the wall clock, so a
91
+ * day later is the same time tomorrow across a DST change; the clock half (hours down) moves the instant. A
92
+ * date ignores the clock half, and a time wraps round midnight.
93
+ */
94
+ export declare function add(input: DateInput, duration: Duration, options?: ZoneOptions): string | null;
95
+ export declare function subtract(input: DateInput, duration: Duration, options?: ZoneOptions): string | null;
96
+ /** The first moment of the unit a value is in — the 1st of its month, its week's first day in the locale, its hour. */
97
+ export declare function startOf(input: DateInput, unit: DateUnit, options?: UnitOptions): string | null;
98
+ /** The last moment of the unit — for a date, the last day; for anything with a clock, one millisecond before the next unit. */
99
+ export declare function endOf(input: DateInput, unit: DateUnit, options?: UnitOptions): string | null;
100
+ /**
101
+ * Below zero when `a` is earlier, above when later, `0` when equal. Two values of one zone-free kind compare
102
+ * on their wall clocks; anything else compares as instants, a zone-free side read in `zone`.
103
+ */
104
+ export declare function compare(a: DateInput, b: DateInput, options?: ZoneOptions): number;
105
+ export declare function isBefore(a: DateInput, b: DateInput, options?: ZoneOptions): boolean;
106
+ export declare function isAfter(a: DateInput, b: DateInput, options?: ZoneOptions): boolean;
107
+ /** Whether two inputs are the same moment — `…14:30+03:00` and `…11:30Z` are. */
108
+ export declare function isEqual(a: DateInput, b: DateInput, options?: ZoneOptions): boolean;
109
+ /** Whether two inputs fall in the same unit — the same day, the same week in the locale — on `zone`'s wall clock. */
110
+ export declare function isSame(a: DateInput, b: DateInput, unit: DateUnit, options?: UnitOptions): boolean;
111
+ /** Whether `input` is from `start` to `end`, both included. A missing end is open. */
112
+ export declare function isBetween(input: DateInput, start: DateInput, end: DateInput, options?: ZoneOptions): boolean;
113
+ /** The input, moved inside `[min, max]`. */
114
+ export declare function clamp(input: DateInput, min: DateInput, max: DateInput, options?: ZoneOptions): string | null;
115
+ /**
116
+ * How many whole units `a` is after `b` (negative when before). Months and years count on the calendar — 31
117
+ * January to 28 February is not yet a month — and days count calendar days between two dates.
118
+ */
119
+ export declare function difference(a: DateInput, b: DateInput, unit: DateUnit, options?: ZoneOptions): number | null;
120
+ /** How many days the month a value falls in has. */
121
+ export declare function daysInMonthOf(input: DateInput, options?: ZoneOptions): number | null;
122
+ /**
123
+ * Every reading of a value at once: the canonical string, the UTC moment, the moment on `zone`'s wall clock
124
+ * and on the reader's, the offset, a `Date`, the epoch, and the wall-clock fields. `null` for a non-value.
125
+ */
126
+ export declare function details(input: DateInput, options?: ZoneOptions): DateTimeDetails | null;
127
+ /** Minutes east of UTC that `zone` is at a moment (default now): `180` for Chisinau in summer, `-240` for New York. */
128
+ export declare function offsetOf(zone?: ZoneInput, at?: DateInput): number | null;
129
+ /** What a date control reports beside its value: the readings an app most often wants, all `null` for no value. */
130
+ export interface DateReadings {
131
+ /** The moment in UTC, `…Z`. A date is its midnight in the control's zone; a time has none. */
132
+ utc: string | null;
133
+ /** The moment on the reader's own wall clock, with no zone. */
134
+ local: string | null;
135
+ /** The moment on the control's zone's wall clock, with its offset. */
136
+ zoned: string | null;
137
+ date: Date | null;
138
+ epoch: number | null;
139
+ /** The zone the control reads and writes in. */
140
+ zone: string;
141
+ offset: string | null;
142
+ }
143
+ /** The readings for a value in a control's zone — what `onValueChange` hands over beside the string. */
144
+ export declare function readingsOf(value: string | null | undefined, zone?: ZoneInput): DateReadings;