@cloudflare/kumo 2.16.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/ai/component-registry.json +33 -7
  3. package/ai/component-registry.md +58 -3
  4. package/ai/schemas.ts +1 -0
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +2 -0
  7. package/dist/ai/schemas.js +1 -0
  8. package/dist/chunks/{autocomplete-ht782okfv7nv75mq.js → autocomplete-evlm6fj7v7w0g2z2.js} +2 -2
  9. package/dist/chunks/{banner-cpla8vqjxaulggyd.js → banner-lvbgdzxq3yndkbot.js} +1 -1
  10. package/dist/chunks/{breadcrumbs-oyuqwb09l08uhok2.js → breadcrumbs-fsuyq7z6hdh1thjv.js} +1 -1
  11. package/dist/chunks/{button-oxy32x5w9x9az80g.js → button-k7axs4vu1rwx89w3.js} +1 -1
  12. package/dist/chunks/{checkbox-o9627970y7c9ciqy.js → checkbox-g8b4f2hs5vux3u26.js} +1 -1
  13. package/dist/chunks/{clipboard-text-c0ad6lzyxauxduv1.js → clipboard-text-fffd5tpa0iye6r6m.js} +17 -6
  14. package/dist/chunks/{combobox-kgf0gmniahm15n81.js → combobox-iawd8lxwd5b18fce.js} +2 -2
  15. package/dist/chunks/{date-picker-oee5ehsrepnlmltj.js → date-picker-kfoxd4u7ckg4nsez.js} +78 -6
  16. package/dist/chunks/{empty-ft85jcbs7fd5t3tn.js → empty-ir5bg5w4kkisuc1c.js} +1 -1
  17. package/dist/chunks/{field-jzzlgre0jmrr38o2.js → field-n7gmbg5xvh6oqbom.js} +7 -2
  18. package/dist/chunks/{input-jk86hoj6nqfhl5u8.js → input-f0pbcvjudf5zb8ek.js} +1 -1
  19. package/dist/chunks/{input-group-hc2qp3m6gsfomqvr.js → input-group-dqo5tcoewbdx86qx.js} +4 -4
  20. package/dist/chunks/{input-jsnp6etq7rbjjj9e.js → input-iev3wgdzhkqpae2k.js} +2 -2
  21. package/dist/chunks/{label-hugrtzreeqk5mtqu.js → label-njfcj6h9utmg2n9l.js} +2 -2
  22. package/dist/chunks/{layer-dialog-dwrrgv1wasrerow4.js → layer-dialog-n7foup6icxowm82n.js} +11 -3
  23. package/dist/chunks/{menubar-m5pqhx7lu5z7mkks.js → menubar-b454nksysu0wicbz.js} +1 -1
  24. package/dist/chunks/{pagination-nyknrk1lyexwgyrx.js → pagination-mwlpbysq4cxmvs45.js} +2 -2
  25. package/dist/chunks/{select-owq85889zm4y23ws.js → select-fae2ls189jrq902h.js} +4 -4
  26. package/dist/chunks/{sensitive-input-nzwvjuwlpb51ze04.js → sensitive-input-heb3xapwahzhpq6y.js} +2 -2
  27. package/dist/chunks/{sidebar-gluq5b5oacrdk4m4.js → sidebar-h6g412ror8p7uo0d.js} +3 -3
  28. package/dist/chunks/{switch-mqf1ulvle4nd6d2t.js → switch-ktfauhluw1yi5tkk.js} +1 -1
  29. package/dist/chunks/{table-nysse5tiwf47gg4k.js → table-lp41fsw7mqr751hn.js} +1 -1
  30. package/dist/chunks/{tag-input-fjfzlsaxmnqee7dk.js → tag-input-k6vzllby4qebmv63.js} +4 -4
  31. package/dist/chunks/{toast-b4t9rt9y1sumcmy2.js → toast-kzwscia42707sau6.js} +60 -52
  32. package/dist/chunks/{toolbar-l9laewk5jvf4u0si.js → toolbar-nnos2ouwfk7i6tpw.js} +3 -3
  33. package/dist/chunks/{tooltip-lguwh8bjhxwnjfus.js → tooltip-bcymn9bfyz29fvji.js} +2 -0
  34. package/dist/code.js +1 -1
  35. package/dist/components/autocomplete.js +1 -1
  36. package/dist/components/banner.js +1 -1
  37. package/dist/components/breadcrumbs.js +1 -1
  38. package/dist/components/button.js +1 -1
  39. package/dist/components/checkbox.js +1 -1
  40. package/dist/components/clipboard-text.d.ts +1 -1
  41. package/dist/components/clipboard-text.js +1 -1
  42. package/dist/components/combobox.js +1 -1
  43. package/dist/components/date-picker.d.ts +1 -1
  44. package/dist/components/date-picker.js +1 -1
  45. package/dist/components/empty.js +1 -1
  46. package/dist/components/field.js +1 -1
  47. package/dist/components/input-group.js +1 -1
  48. package/dist/components/input.js +3 -3
  49. package/dist/components/label.js +1 -1
  50. package/dist/components/layer-dialog.d.ts +1 -1
  51. package/dist/components/layer-dialog.js +1 -1
  52. package/dist/components/menubar.js +1 -1
  53. package/dist/components/pagination.js +1 -1
  54. package/dist/components/select.js +1 -1
  55. package/dist/components/sensitive-input.js +1 -1
  56. package/dist/components/sidebar.js +1 -1
  57. package/dist/components/switch.js +1 -1
  58. package/dist/components/table.js +1 -1
  59. package/dist/components/tag-input.js +1 -1
  60. package/dist/components/toast.js +1 -1
  61. package/dist/components/toolbar.js +1 -1
  62. package/dist/components/tooltip.js +1 -1
  63. package/dist/{index-DJIRVD5B.d.ts → index-CReGk3Dc.d.ts} +6 -0
  64. package/dist/{index-5bJAnzUo.d.ts → index-Dmbgjww7.d.ts} +1 -0
  65. package/dist/{index-DNsSKNUe.d.ts → index-bBPKMepR.d.ts} +4 -0
  66. package/dist/index.d.ts +3 -3
  67. package/dist/index.js +26 -26
  68. package/dist/styles/kumo-binding.css +159 -0
  69. package/dist/styles/kumo-standalone.css +1 -1
  70. package/dist/styles/kumo.css +0 -545
  71. package/package.json +1 -1
  72. package/scripts/format-generated.ts +12 -0
  73. package/scripts/generate-primitives.ts +16 -12
  74. package/scripts/theme-generator/index.ts +2 -2
  75. package/dist/index-DhOvcB0m.d.ts +0 -60
@@ -89,551 +89,6 @@
89
89
  animation: refresh 1s linear infinite;
90
90
  }
91
91
 
92
- /* ============================================
93
- react-day-picker styles for Calendar/DatePicker
94
- ============================================ */
95
-
96
- .rdp-root {
97
- /* Prevent horizontal jitter from number width changes */
98
- font-variant-numeric: tabular-nums;
99
- --rdp-cell-padding: 2px;
100
- --rdp-day-height: calc(2rem + var(--rdp-cell-padding) * 2);
101
- --rdp-day-width: calc(2rem + var(--rdp-cell-padding) * 2);
102
- --rdp-day_button-border-radius: 0.375rem;
103
- --rdp-day_button-border: none;
104
- --rdp-day_button-height: 2rem;
105
- --rdp-day_button-width: 2rem;
106
- --rdp-selected-border: none;
107
- --rdp-disabled-opacity: 0.4;
108
- --rdp-outside-opacity: 0.4;
109
- --rdp-dropdown-gap: 0.5rem;
110
- --rdp-months-gap: 1rem;
111
- --rdp-nav_button-disabled-opacity: 0.5;
112
- --rdp-nav_button-height: 2rem;
113
- --rdp-nav_button-width: 2rem;
114
- --rdp-nav-height: 2.5rem;
115
- --rdp-week_number-border-radius: 0.375rem;
116
- --rdp-week_number-border: none;
117
- --rdp-week_number-height: var(--rdp-day-height);
118
- --rdp-week_number-opacity: 0.75;
119
- --rdp-week_number-width: var(--rdp-day-width);
120
- --rdp-weekday-opacity: 1;
121
- --rdp-weekday-padding: 0.5rem 0;
122
- --rdp-gradient-direction: 90deg;
123
- --rdp-animation_duration: 0.2s;
124
- --rdp-animation_timing: ease-out;
125
-
126
- /* Light mode colors */
127
- --rdp-accent-color: oklch(20.5% 0 0);
128
- --rdp-accent-background-color: oklch(92.2% 0 0);
129
- --rdp-range_middle-background-color: oklch(92.2% 0 0);
130
- --rdp-range_middle-color: oklch(21% 0.006 285.885);
131
- --rdp-range_start-color: oklch(97% 0 0);
132
- --rdp-range_start-date-background-color: oklch(20.5% 0 0);
133
- --rdp-range_end-color: oklch(97% 0 0);
134
- --rdp-range_end-date-background-color: oklch(20.5% 0 0);
135
- --rdp-today-color: oklch(54.6% 0.215 262.881);
136
- --rdp-day-color: oklch(21% 0.006 285.885);
137
- --rdp-day-color-subtle: oklch(55.6% 0 0);
138
- --rdp-nav-bg: transparent;
139
- --rdp-nav-border: oklch(14.5% 0 0 / 0.1);
140
- --rdp-hover-bg: oklch(90% 0 0);
141
- --rdp-fill-hover-bg: oklch(87% 0 0);
142
- --rdp-focus-ring: var(--color-kumo-brand);
143
-
144
- position: relative;
145
- box-sizing: border-box;
146
- }
147
-
148
- [data-mode="dark"] .rdp-root {
149
- /* Dark mode colors */
150
- --rdp-accent-color: oklch(97% 0 0);
151
- --rdp-accent-background-color: oklch(35% 0 0);
152
- --rdp-range_middle-background-color: oklch(28% 0 0);
153
- --rdp-range_middle-color: oklch(97% 0 0);
154
- --rdp-range_start-color: oklch(20.5% 0 0);
155
- --rdp-range_start-date-background-color: oklch(97% 0 0);
156
- --rdp-range_end-color: oklch(20.5% 0 0);
157
- --rdp-range_end-date-background-color: oklch(97% 0 0);
158
- --rdp-today-color: oklch(62.3% 0.214 259.815);
159
- --rdp-day-color: oklch(97% 0 0);
160
- --rdp-day-color-subtle: oklch(70% 0 0);
161
- --rdp-nav-bg: transparent;
162
- --rdp-nav-border: oklch(26.9% 0 0);
163
- --rdp-hover-bg: oklch(20% 0 0);
164
- --rdp-fill-hover-bg: oklch(25% 0 0);
165
- --rdp-focus-ring: var(--color-kumo-brand);
166
- }
167
-
168
- .rdp-root[dir="rtl"] {
169
- --rdp-gradient-direction: -90deg;
170
- }
171
-
172
- .rdp-root * {
173
- box-sizing: border-box;
174
- }
175
-
176
- .rdp-root thead {
177
- background: transparent;
178
- }
179
-
180
- /* Day cells */
181
- .rdp-day {
182
- width: var(--rdp-day-width);
183
- height: var(--rdp-day-height);
184
- text-align: center;
185
- padding: var(--rdp-cell-padding);
186
- }
187
-
188
- .rdp-day_button {
189
- background: none;
190
- padding: 0;
191
- margin: 0;
192
- cursor: pointer;
193
- font: inherit;
194
- font-size: 0.8125rem;
195
- color: var(--rdp-day-color);
196
- justify-content: center;
197
- align-items: center;
198
- display: flex;
199
- width: var(--rdp-day_button-width);
200
- height: var(--rdp-day_button-height);
201
- border: var(--rdp-day_button-border);
202
- border-radius: var(--rdp-day_button-border-radius);
203
- outline: none;
204
- transition:
205
- background-color 0.15s ease,
206
- color 0.15s ease;
207
- }
208
-
209
- .rdp-day_button:focus-visible {
210
- box-shadow: inset 0 0 0 2px var(--rdp-focus-ring);
211
- }
212
-
213
- .rdp-day_button:hover {
214
- background-color: var(--rdp-hover-bg);
215
- }
216
-
217
- .rdp-day_button:disabled {
218
- cursor: not-allowed;
219
- }
220
-
221
- /* Caption / Month header */
222
- .rdp-caption_label {
223
- z-index: 1;
224
- position: relative;
225
- display: inline-flex;
226
- align-items: center;
227
- white-space: nowrap;
228
- border: 0;
229
- font-weight: 600;
230
- color: var(--rdp-day-color);
231
- }
232
-
233
- /* Navigation buttons - styled like outline button sm */
234
- .rdp-button_next,
235
- .rdp-button_previous {
236
- border: none;
237
- background: transparent !important;
238
- padding: 0;
239
- margin: 0;
240
- cursor: pointer;
241
- font: inherit;
242
- color: var(--rdp-day-color);
243
- display: inline-flex;
244
- align-items: center;
245
- justify-content: center;
246
- position: relative;
247
- appearance: none;
248
- width: 1.5rem !important;
249
- height: 1.5rem !important;
250
- border-radius: 0.375rem;
251
- box-shadow: inset 0 0 0 1px var(--rdp-nav-border);
252
- outline: none;
253
- transition:
254
- background-color 0.15s ease,
255
- box-shadow 0.15s ease;
256
- }
257
-
258
- .rdp-button_next:hover,
259
- .rdp-button_previous:hover {
260
- background: var(--rdp-hover-bg) !important;
261
- }
262
-
263
- .rdp-button_next:focus-visible,
264
- .rdp-button_previous:focus-visible {
265
- box-shadow: inset 0 0 0 2px var(--rdp-focus-ring);
266
- }
267
-
268
- .rdp-button_next:disabled,
269
- .rdp-button_next[aria-disabled="true"],
270
- .rdp-button_previous:disabled,
271
- .rdp-button_previous[aria-disabled="true"] {
272
- cursor: not-allowed;
273
- opacity: var(--rdp-nav_button-disabled-opacity);
274
- }
275
-
276
- .rdp-chevron {
277
- display: inline-block;
278
- fill: var(--rdp-day-color);
279
- }
280
-
281
- .rdp-root[dir="rtl"] .rdp-nav .rdp-chevron {
282
- transform: rotate(180deg);
283
- transform-origin: 50%;
284
- }
285
-
286
- /* Dropdowns */
287
- .rdp-dropdowns {
288
- position: relative;
289
- display: inline-flex;
290
- align-items: center;
291
- gap: var(--rdp-dropdown-gap);
292
- }
293
-
294
- .rdp-dropdown {
295
- z-index: 2;
296
- opacity: 0;
297
- appearance: none;
298
- position: absolute;
299
- inset-block-start: 0;
300
- inset-block-end: 0;
301
- inset-inline-start: 0;
302
- width: 100%;
303
- margin: 0;
304
- padding: 0;
305
- cursor: inherit;
306
- border: none;
307
- line-height: inherit;
308
- }
309
-
310
- .rdp-dropdown_root {
311
- position: relative;
312
- display: inline-flex;
313
- align-items: center;
314
- }
315
-
316
- .rdp-dropdown_root[data-disabled="true"] .rdp-chevron {
317
- opacity: var(--rdp-disabled-opacity);
318
- }
319
-
320
- /* Month caption */
321
- .rdp-month_caption {
322
- display: flex;
323
- align-content: center;
324
- height: var(--rdp-nav-height);
325
- font-weight: 600;
326
- }
327
-
328
- .rdp-root[data-nav-layout="around"] .rdp-month,
329
- .rdp-root[data-nav-layout="after"] .rdp-month {
330
- position: relative;
331
- }
332
-
333
- .rdp-root[data-nav-layout="around"] .rdp-month_caption {
334
- justify-content: center;
335
- margin-inline-start: var(--rdp-nav_button-width);
336
- margin-inline-end: var(--rdp-nav_button-width);
337
- position: relative;
338
- }
339
-
340
- .rdp-root[data-nav-layout="around"] .rdp-button_previous {
341
- position: absolute;
342
- inset-inline-start: 0;
343
- top: 0;
344
- height: var(--rdp-nav-height);
345
- display: inline-flex;
346
- }
347
-
348
- .rdp-root[data-nav-layout="around"] .rdp-button_next {
349
- position: absolute;
350
- inset-inline-end: 0;
351
- top: 0;
352
- height: var(--rdp-nav-height);
353
- display: inline-flex;
354
- justify-content: center;
355
- }
356
-
357
- /* Months container */
358
- .rdp-months {
359
- position: relative;
360
- display: flex;
361
- flex-wrap: wrap;
362
- gap: var(--rdp-months-gap);
363
- max-width: fit-content;
364
- }
365
-
366
- .rdp-month_grid {
367
- border-collapse: collapse;
368
- border-spacing: 0;
369
- }
370
-
371
- /* Navigation bar */
372
- .rdp-nav {
373
- position: absolute;
374
- inset-block-start: 0;
375
- inset-inline-end: 0;
376
- display: flex;
377
- align-items: center;
378
- gap: 0.25rem;
379
- height: var(--rdp-nav-height);
380
- }
381
-
382
- /* Weekday headers */
383
- .rdp-weekday {
384
- opacity: var(--rdp-weekday-opacity);
385
- padding: var(--rdp-weekday-padding);
386
- font-weight: 500;
387
- font-size: smaller;
388
- text-align: center;
389
- color: var(--rdp-day-color-subtle);
390
- }
391
-
392
- /* Week numbers */
393
- .rdp-week_number {
394
- opacity: var(--rdp-week_number-opacity);
395
- font-weight: 400;
396
- font-size: small;
397
- height: var(--rdp-week_number-height);
398
- width: var(--rdp-week_number-width);
399
- border: var(--rdp-week_number-border);
400
- border-radius: var(--rdp-week_number-border-radius);
401
- text-align: center;
402
- color: var(--rdp-day-color-subtle);
403
- }
404
-
405
- /* DAY MODIFIERS */
406
-
407
- /* Today (only when not selected) */
408
- .rdp-today:not(.rdp-outside):not(.rdp-selected) .rdp-day_button {
409
- color: var(--rdp-today-color);
410
- font-weight: 600;
411
- }
412
-
413
- /* Selected (single/multiple selection mode) */
414
- .rdp-selected .rdp-day_button {
415
- background-color: var(--rdp-accent-color);
416
- color: var(--rdp-range_start-color);
417
- border-radius: var(--rdp-day_button-border-radius);
418
- }
419
-
420
- .rdp-selected .rdp-day_button:hover {
421
- background-color: var(--rdp-accent-color);
422
- }
423
-
424
- /* Outside (days from adjacent months) */
425
- .rdp-outside .rdp-day_button {
426
- opacity: var(--rdp-outside-opacity);
427
- color: var(--rdp-day-color-subtle);
428
- }
429
-
430
- /* Disabled */
431
- .rdp-disabled:not(.rdp-selected) .rdp-day_button {
432
- opacity: var(--rdp-disabled-opacity);
433
- cursor: not-allowed;
434
- }
435
-
436
- .rdp-disabled .rdp-day_button:hover {
437
- background-color: transparent;
438
- }
439
-
440
- /* Hidden */
441
- .rdp-hidden {
442
- visibility: hidden;
443
- }
444
-
445
- /* RANGE SELECTION */
446
- /* All styling goes on the CELL (<td>), buttons are transparent */
447
-
448
- /* Range start CELL - dark bg, rounded left, flat right for continuity */
449
- .rdp-day.rdp-range_start:not(.rdp-range_end) {
450
- background-color: var(--rdp-range_start-date-background-color);
451
- border-radius: var(--rdp-day_button-border-radius) 0 0
452
- var(--rdp-day_button-border-radius);
453
- }
454
-
455
- /* Range start BUTTON - transparent, inherits cell appearance */
456
- .rdp-day.rdp-range_start .rdp-day_button {
457
- background-color: transparent;
458
- color: var(--rdp-range_start-color);
459
- }
460
-
461
- .rdp-day.rdp-range_start .rdp-day_button:hover {
462
- background-color: transparent;
463
- }
464
-
465
- /* Range middle CELL - solid background fills the entire cell */
466
- .rdp-day.rdp-range_middle {
467
- background-color: var(--rdp-range_middle-background-color);
468
- }
469
-
470
- /* Range middle BUTTON - transparent, shows cell background through */
471
- .rdp-day.rdp-range_middle .rdp-day_button {
472
- background-color: transparent;
473
- color: var(--rdp-range_middle-color);
474
- }
475
-
476
- .rdp-day.rdp-range_middle .rdp-day_button:hover {
477
- background-color: var(--rdp-fill-hover-bg);
478
- border-radius: var(--rdp-day_button-border-radius);
479
- }
480
-
481
- /* Range end CELL - dark bg, flat left, rounded right */
482
- .rdp-day.rdp-range_end:not(.rdp-range_start) {
483
- background-color: var(--rdp-range_end-date-background-color);
484
- border-radius: 0 var(--rdp-day_button-border-radius)
485
- var(--rdp-day_button-border-radius) 0;
486
- }
487
-
488
- /* Range end BUTTON - transparent, inherits cell appearance */
489
- .rdp-day.rdp-range_end .rdp-day_button {
490
- background-color: transparent;
491
- color: var(--rdp-range_end-color);
492
- }
493
-
494
- .rdp-day.rdp-range_end .rdp-day_button:hover {
495
- background-color: transparent;
496
- }
497
-
498
- /* When start and end are the same day - fully rounded cell */
499
- .rdp-day.rdp-range_start.rdp-range_end {
500
- background-color: var(--rdp-range_start-date-background-color);
501
- border-radius: var(--rdp-day_button-border-radius);
502
- }
503
-
504
- .rdp-day.rdp-range_start.rdp-range_end .rdp-day_button {
505
- background-color: transparent;
506
- color: var(--rdp-range_start-color);
507
- }
508
-
509
- /* Focusable days */
510
- .rdp-focusable {
511
- cursor: pointer;
512
- }
513
-
514
- /* Footer - prevent it from affecting calendar width */
515
- .rdp-footer {
516
- width: 0;
517
- min-width: 100%;
518
- padding-top: 0.5rem;
519
- }
520
-
521
- /* ANIMATIONS */
522
-
523
- @keyframes rdp-slide_in_left {
524
- from {
525
- transform: translateX(-100%);
526
- }
527
- to {
528
- transform: translateX(0);
529
- }
530
- }
531
-
532
- @keyframes rdp-slide_in_right {
533
- from {
534
- transform: translateX(100%);
535
- }
536
- to {
537
- transform: translateX(0);
538
- }
539
- }
540
-
541
- @keyframes rdp-slide_out_left {
542
- from {
543
- transform: translateX(0);
544
- }
545
- to {
546
- transform: translateX(-100%);
547
- }
548
- }
549
-
550
- @keyframes rdp-slide_out_right {
551
- from {
552
- transform: translateX(0);
553
- }
554
- to {
555
- transform: translateX(100%);
556
- }
557
- }
558
-
559
- .rdp-weeks_before_enter {
560
- animation: rdp-slide_in_left var(--rdp-animation_duration)
561
- var(--rdp-animation_timing) forwards;
562
- }
563
-
564
- .rdp-weeks_before_exit {
565
- animation: rdp-slide_out_left var(--rdp-animation_duration)
566
- var(--rdp-animation_timing) forwards;
567
- }
568
-
569
- .rdp-weeks_after_enter {
570
- animation: rdp-slide_in_right var(--rdp-animation_duration)
571
- var(--rdp-animation_timing) forwards;
572
- }
573
-
574
- .rdp-weeks_after_exit {
575
- animation: rdp-slide_out_right var(--rdp-animation_duration)
576
- var(--rdp-animation_timing) forwards;
577
- }
578
-
579
- .rdp-root[dir="rtl"] .rdp-weeks_after_enter {
580
- animation: rdp-slide_in_left var(--rdp-animation_duration)
581
- var(--rdp-animation_timing) forwards;
582
- }
583
-
584
- .rdp-root[dir="rtl"] .rdp-weeks_before_exit {
585
- animation: rdp-slide_out_right var(--rdp-animation_duration)
586
- var(--rdp-animation_timing) forwards;
587
- }
588
-
589
- .rdp-root[dir="rtl"] .rdp-weeks_before_enter {
590
- animation: rdp-slide_in_right var(--rdp-animation_duration)
591
- var(--rdp-animation_timing) forwards;
592
- }
593
-
594
- .rdp-root[dir="rtl"] .rdp-weeks_after_exit {
595
- animation: rdp-slide_out_left var(--rdp-animation_duration)
596
- var(--rdp-animation_timing) forwards;
597
- }
598
-
599
- @keyframes rdp-fade_in {
600
- from {
601
- opacity: 0;
602
- }
603
- to {
604
- opacity: 1;
605
- }
606
- }
607
-
608
- @keyframes rdp-fade_out {
609
- from {
610
- opacity: 1;
611
- }
612
- to {
613
- opacity: 0;
614
- }
615
- }
616
-
617
- .rdp-caption_after_enter {
618
- animation: rdp-fade_in var(--rdp-animation_duration)
619
- var(--rdp-animation_timing) forwards;
620
- }
621
-
622
- .rdp-caption_after_exit {
623
- animation: rdp-fade_out var(--rdp-animation_duration)
624
- var(--rdp-animation_timing) forwards;
625
- }
626
-
627
- .rdp-caption_before_enter {
628
- animation: rdp-fade_in var(--rdp-animation_duration)
629
- var(--rdp-animation_timing) forwards;
630
- }
631
-
632
- .rdp-caption_before_exit {
633
- animation: rdp-fade_out var(--rdp-animation_duration)
634
- var(--rdp-animation_timing) forwards;
635
- }
636
-
637
92
  /* ============================================
638
93
  Shiki syntax highlighting styles
639
94
  ============================================ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/kumo",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "private": false,
5
5
  "description": "Kumo - Cloudflare's component library for building modern web applications",
6
6
  "keywords": [
@@ -0,0 +1,12 @@
1
+ import { writeFileSync } from "node:fs";
2
+ import { format } from "vite-plus/fmt";
3
+
4
+ export async function writeFormattedFile(filePath: string, content: string) {
5
+ const result = await format(filePath, content, { printWidth: 80 });
6
+
7
+ if (result.errors.length > 0) {
8
+ throw new Error(`Failed to format generated file: ${filePath}`);
9
+ }
10
+
11
+ writeFileSync(filePath, result.code, "utf-8");
12
+ }
@@ -7,9 +7,10 @@
7
7
  * Run: pnpm build:primitives
8
8
  */
9
9
 
10
- import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
10
+ import { readFileSync, mkdirSync, existsSync } from "fs";
11
11
  import { join, dirname } from "path";
12
12
  import { fileURLToPath } from "url";
13
+ import { writeFormattedFile } from "./format-generated.js";
13
14
 
14
15
  const __filename = fileURLToPath(import.meta.url);
15
16
  const __dirname = dirname(__filename);
@@ -39,7 +40,7 @@ const COMPATIBILITY_EXPORTS: Record<string, string[]> = {
39
40
  ],
40
41
  };
41
42
 
42
- function main() {
43
+ async function main() {
43
44
  // Read base-ui package.json
44
45
  if (!existsSync(BASE_UI_PACKAGE)) {
45
46
  console.error("❌ @base-ui/react not found. Run pnpm install first.");
@@ -65,13 +66,13 @@ function main() {
65
66
  }
66
67
 
67
68
  // Generate barrel export (index.ts)
68
- generateBarrelExport(subpaths);
69
+ await generateBarrelExport(subpaths);
69
70
 
70
71
  // Generate individual primitive files
71
- generateIndividualPrimitives(subpaths);
72
+ await generateIndividualPrimitives(subpaths);
72
73
 
73
74
  // Update package.json with granular exports
74
- updatePackageJsonExports(subpaths);
75
+ await updatePackageJsonExports(subpaths);
75
76
 
76
77
  console.log(`✓ Generated primitives`);
77
78
  console.log(` → ${subpaths.length} base-ui exports`);
@@ -80,7 +81,7 @@ function main() {
80
81
  console.log(` → Updated package.json exports`);
81
82
  }
82
83
 
83
- function generateBarrelExport(subpaths: string[]) {
84
+ async function generateBarrelExport(subpaths: string[]) {
84
85
  const lines: string[] = [
85
86
  "/**",
86
87
  " * Base UI Primitives - Barrel Export",
@@ -107,10 +108,10 @@ function generateBarrelExport(subpaths: string[]) {
107
108
  }
108
109
  lines.push("");
109
110
 
110
- writeFileSync(PRIMITIVES_FILE, lines.join("\n"));
111
+ await writeFormattedFile(PRIMITIVES_FILE, lines.join("\n"));
111
112
  }
112
113
 
113
- function generateIndividualPrimitives(subpaths: string[]) {
114
+ async function generateIndividualPrimitives(subpaths: string[]) {
114
115
  for (const subpath of subpaths) {
115
116
  const primitiveName = subpath.replace("./", "");
116
117
  const primitiveFile = join(PRIMITIVES_DIR, `${primitiveName}.ts`);
@@ -135,11 +136,11 @@ function generateIndividualPrimitives(subpaths: string[]) {
135
136
  "",
136
137
  ].join("\n");
137
138
 
138
- writeFileSync(primitiveFile, content);
139
+ await writeFormattedFile(primitiveFile, content);
139
140
  }
140
141
  }
141
142
 
142
- function updatePackageJsonExports(subpaths: string[]) {
143
+ async function updatePackageJsonExports(subpaths: string[]) {
143
144
  const pkg = JSON.parse(readFileSync(PACKAGE_JSON, "utf-8"));
144
145
 
145
146
  // Find the "./primitives" export and add granular exports after it
@@ -179,7 +180,7 @@ function updatePackageJsonExports(subpaths: string[]) {
179
180
  }
180
181
 
181
182
  pkg.exports = newExports;
182
- writeFileSync(PACKAGE_JSON, JSON.stringify(pkg, null, 2) + "\n");
183
+ await writeFormattedFile(PACKAGE_JSON, JSON.stringify(pkg, null, 2) + "\n");
183
184
  }
184
185
 
185
186
  function toPascalCase(str: string): string {
@@ -189,4 +190,7 @@ function toPascalCase(str: string): string {
189
190
  .join("");
190
191
  }
191
192
 
192
- main();
193
+ main().catch((error) => {
194
+ console.error(error);
195
+ process.exit(1);
196
+ });
@@ -10,9 +10,9 @@
10
10
  * pnpm codegen:themes --dry-run # Preview without writing
11
11
  */
12
12
 
13
- import * as fs from "node:fs";
14
13
  import * as path from "node:path";
15
14
  import { fileURLToPath } from "node:url";
15
+ import { writeFormattedFile } from "../format-generated.js";
16
16
  import {
17
17
  generateAllThemes,
18
18
  listAllTokens,
@@ -140,7 +140,7 @@ async function main() {
140
140
  console.log(`\n=== ${filename} ===\n`);
141
141
  console.log(content);
142
142
  } else {
143
- fs.writeFileSync(filepath, content, "utf-8");
143
+ await writeFormattedFile(filepath, content);
144
144
  console.log(` Wrote ${filename}`);
145
145
  }
146
146
  }