@cloudflare/kumo 2.6.0 → 2.8.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.
- package/CHANGELOG.md +53 -0
- package/ai/component-registry.json +1182 -163
- package/ai/component-registry.md +1425 -119
- package/ai/schemas.ts +137 -8
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +259 -22
- package/dist/ai/schemas.d.ts.map +1 -1
- package/dist/ai/schemas.js +1516 -1299
- package/dist/ai/schemas.js.map +1 -1
- package/dist/chunks/Maps-imwfwgb7do9lr3i5.js +2448 -0
- package/dist/chunks/Maps-imwfwgb7do9lr3i5.js.map +1 -0
- package/dist/chunks/{autocomplete-hgprlcuf0ixbbo6d.js → autocomplete-a4gvspveibfuod24.js} +5 -5
- package/dist/chunks/{autocomplete-hgprlcuf0ixbbo6d.js.map → autocomplete-a4gvspveibfuod24.js.map} +1 -1
- package/dist/chunks/{badge-c1th6h6ahz7eu49q.js → badge-dfc1r37osagi3rs4.js} +9 -9
- package/dist/chunks/{badge-c1th6h6ahz7eu49q.js.map → badge-dfc1r37osagi3rs4.js.map} +1 -1
- package/dist/chunks/{banner-es5iwuk4pf25e29e.js → banner-j52y8l13puk7dybi.js} +2 -2
- package/dist/chunks/{banner-es5iwuk4pf25e29e.js.map → banner-j52y8l13puk7dybi.js.map} +1 -1
- package/dist/chunks/{breadcrumbs-lyj8ljudrm2owx5y.js → breadcrumbs-js59m7m57bdsveew.js} +4 -4
- package/dist/chunks/{breadcrumbs-lyj8ljudrm2owx5y.js.map → breadcrumbs-js59m7m57bdsveew.js.map} +1 -1
- package/dist/chunks/{button-gtdhvogt5rlrf1is.js → button-ebfdg9mkhojue36n.js} +80 -80
- package/dist/chunks/button-ebfdg9mkhojue36n.js.map +1 -0
- package/dist/chunks/{checkbox-byg8t8r9vbmif696.js → checkbox-k355pnfisqt0h4eg.js} +4 -4
- package/dist/chunks/{checkbox-byg8t8r9vbmif696.js.map → checkbox-k355pnfisqt0h4eg.js.map} +1 -1
- package/dist/chunks/{clipboard-text-lf909phvldd8rfk8.js → clipboard-text-isb05zkg2aox0tp6.js} +5 -5
- package/dist/chunks/{clipboard-text-lf909phvldd8rfk8.js.map → clipboard-text-isb05zkg2aox0tp6.js.map} +1 -1
- package/dist/chunks/{cloudflare-logo-fya2cd2ljozkzjh8.js → cloudflare-logo-fiuocxdxqrxawjfv.js} +2 -2
- package/dist/chunks/{cloudflare-logo-fya2cd2ljozkzjh8.js.map → cloudflare-logo-fiuocxdxqrxawjfv.js.map} +1 -1
- package/dist/chunks/{cn-ct4n7r74mh8y0f48.js → cn-bo7ya7641lkickbt.js} +6 -10
- package/dist/chunks/cn-bo7ya7641lkickbt.js.map +1 -0
- package/dist/chunks/{code-bbnjm8vk9hxl129r.js → code-pbkfdfat0yilg6dx.js} +2 -2
- package/dist/chunks/{code-bbnjm8vk9hxl129r.js.map → code-pbkfdfat0yilg6dx.js.map} +1 -1
- package/dist/chunks/{collapsible-dl61f8gd4j897hmv.js → collapsible-f9hgtc1u6xvqrgt8.js} +3 -3
- package/dist/chunks/{collapsible-dl61f8gd4j897hmv.js.map → collapsible-f9hgtc1u6xvqrgt8.js.map} +1 -1
- package/dist/chunks/{combobox-dxff22zxzq846nec.js → combobox-hc9wi9nwsyyli8ur.js} +5 -5
- package/dist/chunks/{combobox-dxff22zxzq846nec.js.map → combobox-hc9wi9nwsyyli8ur.js.map} +1 -1
- package/dist/chunks/{command-palette-i4r0402b838wiy0j.js → command-palette-c03zze4ayuytwxjg.js} +4 -4
- package/dist/chunks/{command-palette-i4r0402b838wiy0j.js.map → command-palette-c03zze4ayuytwxjg.js.map} +1 -1
- package/dist/chunks/{date-picker-mjocqqbggb76n8rt.js → date-picker-bffp889exjixmgz3.js} +8 -8
- package/dist/chunks/{date-picker-mjocqqbggb76n8rt.js.map → date-picker-bffp889exjixmgz3.js.map} +1 -1
- package/dist/chunks/{date-range-picker-o8uyril1kogvhoei.js → date-range-picker-oks2r14lbbukd545.js} +2 -2
- package/dist/chunks/{date-range-picker-o8uyril1kogvhoei.js.map → date-range-picker-oks2r14lbbukd545.js.map} +1 -1
- package/dist/chunks/{dialog-g1b8161nbyixdit0.js → dialog-ovhmzfuppr5xix0e.js} +15 -15
- package/dist/chunks/dialog-ovhmzfuppr5xix0e.js.map +1 -0
- package/dist/chunks/{dropdown-irp18txvgz8590e9.js → dropdown-iey8f344rd5dgahz.js} +24 -16
- package/dist/chunks/dropdown-iey8f344rd5dgahz.js.map +1 -0
- package/dist/chunks/{empty-daa6d7u9oleaw24a.js → empty-k83r53jh5utqvv7w.js} +3 -3
- package/dist/chunks/{empty-daa6d7u9oleaw24a.js.map → empty-k83r53jh5utqvv7w.js.map} +1 -1
- package/dist/chunks/{field-f1hy08um3jf9jos6.js → field-bmglk138wa8bf3ei.js} +4 -4
- package/dist/chunks/{field-f1hy08um3jf9jos6.js.map → field-bmglk138wa8bf3ei.js.map} +1 -1
- package/dist/chunks/{grid-do93dv1rjggqxx7p.js → grid-jze04557ljywg3uc.js} +2 -2
- package/dist/chunks/{grid-do93dv1rjggqxx7p.js.map → grid-jze04557ljywg3uc.js.map} +1 -1
- package/dist/chunks/input-area-sg518xu4pyg4m0km.js +144 -0
- package/dist/chunks/input-area-sg518xu4pyg4m0km.js.map +1 -0
- package/dist/chunks/{input-f2ct7obgdzypjmp2.js → input-ckl5misj0jd9cu5r.js} +4 -4
- package/dist/chunks/{input-f2ct7obgdzypjmp2.js.map → input-ckl5misj0jd9cu5r.js.map} +1 -1
- package/dist/chunks/{input-group-kcd3jin5pbdijmw8.js → input-group-bflx1m6ki55e99vf.js} +6 -6
- package/dist/chunks/{input-group-kcd3jin5pbdijmw8.js.map → input-group-bflx1m6ki55e99vf.js.map} +1 -1
- package/dist/chunks/{label-himqjkdhh0hgfdsa.js → label-i1xbmg8y1n0tbtkx.js} +4 -4
- package/dist/chunks/{label-himqjkdhh0hgfdsa.js.map → label-i1xbmg8y1n0tbtkx.js.map} +1 -1
- package/dist/chunks/{layer-card-cshi5vydqg3phyfx.js → layer-card-m6h85dpadvee39h2.js} +3 -3
- package/dist/chunks/{layer-card-cshi5vydqg3phyfx.js.map → layer-card-m6h85dpadvee39h2.js.map} +1 -1
- package/dist/chunks/{link-bw21ofmgg58igq5n.js → link-j93fl5m8zrcfivsr.js} +3 -3
- package/dist/chunks/{link-bw21ofmgg58igq5n.js.map → link-j93fl5m8zrcfivsr.js.map} +1 -1
- package/dist/chunks/{menubar-m12wcbbucuszspw4.js → menubar-opzxfzylaatfz4nv.js} +8 -8
- package/dist/chunks/{menubar-m12wcbbucuszspw4.js.map → menubar-opzxfzylaatfz4nv.js.map} +1 -1
- package/dist/chunks/{meter-dn8vgc0smpk0du75.js → meter-6br6z5ekw41trxeh.js} +3 -3
- package/dist/chunks/{meter-dn8vgc0smpk0du75.js.map → meter-6br6z5ekw41trxeh.js.map} +1 -1
- package/dist/chunks/{pagination-oafyxvdndm9m8250.js → pagination-j33ntwqmm9qskfgv.js} +4 -4
- package/dist/chunks/{pagination-oafyxvdndm9m8250.js.map → pagination-j33ntwqmm9qskfgv.js.map} +1 -1
- package/dist/chunks/{popover-bbxr39l1lx175hum.js → popover-cqdmpp8i4hg8gzzx.js} +3 -3
- package/dist/chunks/{popover-bbxr39l1lx175hum.js.map → popover-cqdmpp8i4hg8gzzx.js.map} +1 -1
- package/dist/chunks/{radio-ffx05ih9nc764evh.js → radio-ejey7i6r4tq314av.js} +3 -3
- package/dist/chunks/{radio-ffx05ih9nc764evh.js.map → radio-ejey7i6r4tq314av.js.map} +1 -1
- package/dist/chunks/{select-kl1skfh3pmwc33rp.js → select-p8adn2tnpom25hpl.js} +8 -8
- package/dist/chunks/{select-kl1skfh3pmwc33rp.js.map → select-p8adn2tnpom25hpl.js.map} +1 -1
- package/dist/chunks/{sensitive-input-izmbyk1t7r56ciiq.js → sensitive-input-it1hsswlccq3u7g6.js} +5 -5
- package/dist/chunks/{sensitive-input-izmbyk1t7r56ciiq.js.map → sensitive-input-it1hsswlccq3u7g6.js.map} +1 -1
- package/dist/chunks/{sidebar-ior8rnhsd7gy5am5.js → sidebar-7whsl7qwrw5b6ip8.js} +307 -307
- package/dist/chunks/sidebar-7whsl7qwrw5b6ip8.js.map +1 -0
- package/dist/chunks/{skeleton-line-epxenksfesr2fkcv.js → skeleton-line-omxgxia23vpav94x.js} +2 -2
- package/dist/chunks/{skeleton-line-epxenksfesr2fkcv.js.map → skeleton-line-omxgxia23vpav94x.js.map} +1 -1
- package/dist/chunks/{surface-g5a1buofz4erjov2.js → surface-gc2gblserrxcb1eg.js} +5 -5
- package/dist/chunks/{surface-g5a1buofz4erjov2.js.map → surface-gc2gblserrxcb1eg.js.map} +1 -1
- package/dist/chunks/{switch-kh8a6l3l0hszm9h4.js → switch-ljsq915e0l1a5mjd.js} +4 -4
- package/dist/chunks/{switch-kh8a6l3l0hszm9h4.js.map → switch-ljsq915e0l1a5mjd.js.map} +1 -1
- package/dist/chunks/{table-of-contents-jco9kvt48d34dwsw.js → table-of-contents-cghjqyk43nj5zmlw.js} +2 -2
- package/dist/chunks/{table-of-contents-jco9kvt48d34dwsw.js.map → table-of-contents-cghjqyk43nj5zmlw.js.map} +1 -1
- package/dist/chunks/{table-dz2k55oab66h2vi9.js → table-ojjjeqszmt9jgnug.js} +3 -3
- package/dist/chunks/{table-dz2k55oab66h2vi9.js.map → table-ojjjeqszmt9jgnug.js.map} +1 -1
- package/dist/chunks/{tabs-kcw98wibdz4mhpkc.js → tabs-kemdy19kfesj2xjr.js} +3 -3
- package/dist/chunks/{tabs-kcw98wibdz4mhpkc.js.map → tabs-kemdy19kfesj2xjr.js.map} +1 -1
- package/dist/chunks/{text-be7ehenoyldhyjma.js → text-oqp48b9m5u6t62b4.js} +2 -2
- package/dist/chunks/{text-be7ehenoyldhyjma.js.map → text-oqp48b9m5u6t62b4.js.map} +1 -1
- package/dist/chunks/{toast-dkdo1lu72tnefya6.js → toast-ldj9zi940w83ub90.js} +97 -81
- package/dist/chunks/toast-ldj9zi940w83ub90.js.map +1 -0
- package/dist/chunks/{toolbar-o7xe6pd189evdd53.js → toolbar-lmylyrod70sn0q4i.js} +6 -6
- package/dist/chunks/{toolbar-o7xe6pd189evdd53.js.map → toolbar-lmylyrod70sn0q4i.js.map} +1 -1
- package/dist/chunks/{tooltip-eqnhjdbvwapy8gj4.js → tooltip-mooldq78tg77ekvv.js} +4 -4
- package/dist/chunks/tooltip-mooldq78tg77ekvv.js.map +1 -0
- package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js +25027 -0
- package/dist/chunks/vendor-base-ui-elpbzr8xeffrz4h2.js.map +1 -0
- package/dist/chunks/{vendor-floating-ui-c4mwmh0xmfzevy9l.js → vendor-floating-ui-k1zjlb8fkwtcw4k5.js} +22 -23
- package/dist/chunks/{vendor-floating-ui-c4mwmh0xmfzevy9l.js.map → vendor-floating-ui-k1zjlb8fkwtcw4k5.js.map} +1 -1
- package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js +3252 -0
- package/dist/chunks/vendor-styling-ofvnbcuht98q88oo.js.map +1 -0
- package/dist/code.js +2 -2
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/chart.js +6 -4
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/cloudflare-logo.js +1 -1
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/flow.js +2277 -2312
- package/dist/components/flow.js.map +1 -1
- package/dist/components/grid.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/surface.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table-of-contents.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/index.js +128 -126
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +1 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/otp-field.js +3 -2
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.js +27 -26
- package/dist/src/components/button/button.d.ts +2 -2
- package/dist/src/components/chart/Color.d.ts +16 -0
- package/dist/src/components/chart/Color.d.ts.map +1 -1
- package/dist/src/components/chart/EChart.d.ts +7 -0
- package/dist/src/components/chart/EChart.d.ts.map +1 -1
- package/dist/src/components/chart/Maps.d.ts +211 -0
- package/dist/src/components/chart/Maps.d.ts.map +1 -0
- package/dist/src/components/chart/SankeyChart.d.ts.map +1 -1
- package/dist/src/components/chart/TimeseriesChart.d.ts +8 -0
- package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
- package/dist/src/components/chart/index.d.ts +2 -1
- package/dist/src/components/chart/index.d.ts.map +1 -1
- package/dist/src/components/chart/timeseries-markers.d.ts +107 -0
- package/dist/src/components/chart/timeseries-markers.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-thresholds.d.ts +61 -0
- package/dist/src/components/chart/timeseries-thresholds.d.ts.map +1 -0
- package/dist/src/components/chart/timeseries-tooltip.d.ts +28 -0
- package/dist/src/components/chart/timeseries-tooltip.d.ts.map +1 -0
- package/dist/src/components/chart/tooltip-utils.d.ts +4 -0
- package/dist/src/components/chart/tooltip-utils.d.ts.map +1 -0
- package/dist/src/components/dialog/dialog.d.ts +12 -12
- package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/src/components/flow/connectors.d.ts +18 -0
- package/dist/src/components/flow/connectors.d.ts.map +1 -1
- package/dist/src/components/flow/diagram.d.ts +48 -39
- package/dist/src/components/flow/diagram.d.ts.map +1 -1
- package/dist/src/components/flow/flow-layout.d.ts +77 -0
- package/dist/src/components/flow/flow-layout.d.ts.map +1 -0
- package/dist/src/components/flow/node.d.ts.map +1 -1
- package/dist/src/components/flow/parallel.d.ts +3 -7
- package/dist/src/components/flow/parallel.d.ts.map +1 -1
- package/dist/src/components/flow/use-children.d.ts +0 -60
- package/dist/src/components/flow/use-children.d.ts.map +1 -1
- package/dist/src/components/input/input-area.d.ts +18 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -1
- package/dist/src/components/sidebar/sidebar.d.ts +2 -0
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/components/toast/toast.d.ts +2 -2
- package/dist/src/components/toast/toast.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/primitives/index.d.ts +1 -0
- package/dist/src/primitives/index.d.ts.map +1 -1
- package/dist/src/primitives/otp-field.d.ts +1 -0
- package/dist/src/primitives/otp-field.d.ts.map +1 -1
- package/dist/src/utils/cn.d.ts +1 -2
- package/dist/src/utils/cn.d.ts.map +1 -1
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/utils.js +8 -7
- package/dist/utils.js.map +1 -1
- package/package.json +6 -5
- package/scripts/component-registry/discovery.ts +87 -0
- package/scripts/component-registry/index.test.ts +89 -1
- package/scripts/component-registry/index.ts +27 -2
- package/scripts/component-registry/sub-components.ts +34 -21
- package/scripts/generate-primitives.ts +9 -0
- package/dist/chunks/SankeyChart-g1tng405ml2e0qg2.js +0 -890
- package/dist/chunks/SankeyChart-g1tng405ml2e0qg2.js.map +0 -1
- package/dist/chunks/button-gtdhvogt5rlrf1is.js.map +0 -1
- package/dist/chunks/cn-ct4n7r74mh8y0f48.js.map +0 -1
- package/dist/chunks/dialog-g1b8161nbyixdit0.js.map +0 -1
- package/dist/chunks/dropdown-irp18txvgz8590e9.js.map +0 -1
- package/dist/chunks/input-area-bwyujceeulpfkpxv.js +0 -78
- package/dist/chunks/input-area-bwyujceeulpfkpxv.js.map +0 -1
- package/dist/chunks/sidebar-ior8rnhsd7gy5am5.js.map +0 -1
- package/dist/chunks/toast-dkdo1lu72tnefya6.js.map +0 -1
- package/dist/chunks/tooltip-eqnhjdbvwapy8gj4.js.map +0 -1
- package/dist/chunks/vendor-base-ui-f9z44m829vvptrg0.js +0 -24712
- package/dist/chunks/vendor-base-ui-f9z44m829vvptrg0.js.map +0 -1
- package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js +0 -2775
- package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/kumo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Kumo - Cloudflare's component library for building modern web applications",
|
|
@@ -444,20 +444,21 @@
|
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
446
|
"dependencies": {
|
|
447
|
-
"@base-ui/react": "^1.
|
|
447
|
+
"@base-ui/react": "^1.6.0",
|
|
448
448
|
"@shikijs/langs": "^4.0.0",
|
|
449
449
|
"@shikijs/themes": "^4.0.0",
|
|
450
|
-
"
|
|
450
|
+
"cnfast": "^0.0.8",
|
|
451
|
+
"d3-geo": "^3.1.1",
|
|
451
452
|
"motion": "^12.34.1",
|
|
452
453
|
"react-day-picker": "^9.13.2",
|
|
453
|
-
"shiki": "^4.0.0"
|
|
454
|
-
"tailwind-merge": "^3.4.0"
|
|
454
|
+
"shiki": "^4.0.0"
|
|
455
455
|
},
|
|
456
456
|
"devDependencies": {
|
|
457
457
|
"@tailwindcss/cli": "^4.1.17",
|
|
458
458
|
"@tailwindcss/vite": "^4.1.17",
|
|
459
459
|
"@testing-library/react": "16.3.1",
|
|
460
460
|
"@testing-library/user-event": "14.6.1",
|
|
461
|
+
"@types/d3-geo": "^3.1.0",
|
|
461
462
|
"@types/glob": "9.0.0",
|
|
462
463
|
"@types/node": "^22.10.2",
|
|
463
464
|
"@types/react": "19.2.4",
|
|
@@ -34,6 +34,7 @@ export const CATEGORY_MAP: Record<string, string> = {
|
|
|
34
34
|
// Display
|
|
35
35
|
badge: "Display",
|
|
36
36
|
breadcrumbs: "Display",
|
|
37
|
+
chart: "Data Visualization",
|
|
37
38
|
code: "Display",
|
|
38
39
|
collapsible: "Display",
|
|
39
40
|
empty: "Display",
|
|
@@ -182,6 +183,59 @@ export function detectExportsFromIndex(dirPath: string): DetectedExports {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
interface BarrelComponentExport extends DetectedExports {
|
|
187
|
+
componentName: string;
|
|
188
|
+
propsType: string;
|
|
189
|
+
sourceFile: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Detect components in a barrel directory that does not have a conventional
|
|
194
|
+
* `{directory}/{directory}.tsx` entry point.
|
|
195
|
+
*/
|
|
196
|
+
export function detectComponentExportsFromIndex(
|
|
197
|
+
dirPath: string,
|
|
198
|
+
): BarrelComponentExport[] {
|
|
199
|
+
const indexPath = join(dirPath, "index.ts");
|
|
200
|
+
if (!existsSync(indexPath)) return [];
|
|
201
|
+
|
|
202
|
+
const content = readFileSync(indexPath, "utf-8");
|
|
203
|
+
const exports: BarrelComponentExport[] = [];
|
|
204
|
+
const exportPattern = /export\s*\{([^}]+)\}\s*from\s*["'](.+?)["']/g;
|
|
205
|
+
let match: RegExpExecArray | null;
|
|
206
|
+
|
|
207
|
+
while ((match = exportPattern.exec(content)) !== null) {
|
|
208
|
+
const sourceName = match[2].replace(/^\.\//, "");
|
|
209
|
+
const sourceFile = [`${sourceName}.tsx`, `${sourceName}.ts`].find((file) =>
|
|
210
|
+
existsSync(join(dirPath, file)),
|
|
211
|
+
);
|
|
212
|
+
if (!sourceFile) continue;
|
|
213
|
+
|
|
214
|
+
const namedExports: string[] = [];
|
|
215
|
+
const typeExports: string[] = [];
|
|
216
|
+
|
|
217
|
+
for (const item of match[1].split(",").map((value) => value.trim())) {
|
|
218
|
+
const typeMatch = item.match(/^type\s+(\w+)(?:\s+as\s+(\w+))?/);
|
|
219
|
+
if (typeMatch) {
|
|
220
|
+
typeExports.push(typeMatch[2] || typeMatch[1]);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const nameMatch = item.match(/^(\w+)(?:\s+as\s+(\w+))?/);
|
|
225
|
+
if (nameMatch) namedExports.push(nameMatch[2] || nameMatch[1]);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
for (const componentName of namedExports) {
|
|
229
|
+
const propsType = `${componentName}Props`;
|
|
230
|
+
if (typeExports.includes(propsType)) {
|
|
231
|
+
exports.push({ componentName, propsType, sourceFile });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return exports;
|
|
237
|
+
}
|
|
238
|
+
|
|
185
239
|
/**
|
|
186
240
|
* Detect props type from the main component file by looking for interfaces/types.
|
|
187
241
|
* Checks both exported and non-exported types since many components use internal type aliases.
|
|
@@ -435,6 +489,39 @@ export async function discoverFromDir(
|
|
|
435
489
|
});
|
|
436
490
|
}
|
|
437
491
|
|
|
492
|
+
for (const entry of readdirSync(sourceDir)) {
|
|
493
|
+
const dirPath = join(sourceDir, entry);
|
|
494
|
+
if (!statSync(dirPath).isDirectory()) continue;
|
|
495
|
+
if (existsSync(join(dirPath, `${entry}.tsx`))) continue;
|
|
496
|
+
|
|
497
|
+
for (const detected of detectComponentExportsFromIndex(dirPath)) {
|
|
498
|
+
const mainFile = join(dirPath, detected.sourceFile);
|
|
499
|
+
const variantsData = extractVariantsFromFile(mainFile);
|
|
500
|
+
const styling = extractStylingFromFile(mainFile);
|
|
501
|
+
|
|
502
|
+
console.log(
|
|
503
|
+
` ${entry}/${detected.sourceFile} → ${detected.componentName} (props: ${detected.propsType}, type: ${type})`,
|
|
504
|
+
);
|
|
505
|
+
|
|
506
|
+
configs.push({
|
|
507
|
+
name: detected.componentName,
|
|
508
|
+
propsType: detected.propsType,
|
|
509
|
+
sourceFile: `${entry}/${detected.sourceFile}`,
|
|
510
|
+
dirName: entry,
|
|
511
|
+
sourceDir,
|
|
512
|
+
type,
|
|
513
|
+
description: extractDescription(mainFile, detected.componentName),
|
|
514
|
+
category: CATEGORY_MAP[entry] || "Other",
|
|
515
|
+
variants: variantsData?.variants ?? {},
|
|
516
|
+
defaults: variantsData?.defaults ?? {},
|
|
517
|
+
...(variantsData?.baseStyles && {
|
|
518
|
+
baseStyles: variantsData.baseStyles,
|
|
519
|
+
}),
|
|
520
|
+
...(styling && { styling }),
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
438
525
|
return configs;
|
|
439
526
|
}
|
|
440
527
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { describe, it, expect } from "vitest";
|
|
10
|
+
import { detectComponentExportsFromIndex } from "./discovery.js";
|
|
10
11
|
|
|
11
12
|
// =============================================================================
|
|
12
13
|
// Tests for string transformation utilities
|
|
@@ -580,6 +581,55 @@ describe("getComponentNameFromPath", () => {
|
|
|
580
581
|
});
|
|
581
582
|
});
|
|
582
583
|
|
|
584
|
+
describe("detectComponentExportsFromIndex", () => {
|
|
585
|
+
it("detects multiple components with matching props from a barrel", () => {
|
|
586
|
+
const dir = mkdtempSync(join(tmpdir(), "kumo-barrel-test-"));
|
|
587
|
+
try {
|
|
588
|
+
writeFileSync(
|
|
589
|
+
join(dir, "index.ts"),
|
|
590
|
+
`
|
|
591
|
+
export {
|
|
592
|
+
BubbleMap,
|
|
593
|
+
ChoroplethMap,
|
|
594
|
+
type MapGeoJson,
|
|
595
|
+
type BubbleMapProps,
|
|
596
|
+
type ChoroplethMapProps,
|
|
597
|
+
} from "./Maps";
|
|
598
|
+
export {
|
|
599
|
+
ServerChart,
|
|
600
|
+
type ServerChartProps,
|
|
601
|
+
} from "./ServerChart";
|
|
602
|
+
`,
|
|
603
|
+
);
|
|
604
|
+
writeFileSync(join(dir, "Maps.tsx"), "export const placeholder = true;");
|
|
605
|
+
writeFileSync(
|
|
606
|
+
join(dir, "ServerChart.ts"),
|
|
607
|
+
"export const placeholder = true;",
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
expect(detectComponentExportsFromIndex(dir)).toEqual([
|
|
611
|
+
{
|
|
612
|
+
componentName: "BubbleMap",
|
|
613
|
+
propsType: "BubbleMapProps",
|
|
614
|
+
sourceFile: "Maps.tsx",
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
componentName: "ChoroplethMap",
|
|
618
|
+
propsType: "ChoroplethMapProps",
|
|
619
|
+
sourceFile: "Maps.tsx",
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
componentName: "ServerChart",
|
|
623
|
+
propsType: "ServerChartProps",
|
|
624
|
+
sourceFile: "ServerChart.ts",
|
|
625
|
+
},
|
|
626
|
+
]);
|
|
627
|
+
} finally {
|
|
628
|
+
rmSync(dir, { recursive: true });
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
});
|
|
632
|
+
|
|
583
633
|
// =============================================================================
|
|
584
634
|
// Tests for JSON Schema type conversion
|
|
585
635
|
// =============================================================================
|
|
@@ -681,7 +731,7 @@ describe("jsonSchemaTypeToString", () => {
|
|
|
681
731
|
|
|
682
732
|
// Tests for sub-component detection utilities
|
|
683
733
|
|
|
684
|
-
import { writeFileSync, unlinkSync, mkdtempSync } from "node:fs";
|
|
734
|
+
import { writeFileSync, unlinkSync, mkdtempSync, rmSync } from "node:fs";
|
|
685
735
|
import { join } from "node:path";
|
|
686
736
|
import { tmpdir } from "node:os";
|
|
687
737
|
import {
|
|
@@ -942,6 +992,44 @@ interface GroupProps extends BaseProps {
|
|
|
942
992
|
const props = extractPropsFromInterface(content, "MyProps", cliFlags);
|
|
943
993
|
expect(props).toEqual({});
|
|
944
994
|
});
|
|
995
|
+
|
|
996
|
+
it("extracts documented props from a generic interface", () => {
|
|
997
|
+
const content = `
|
|
998
|
+
interface MapProps<T extends { id: string }> {
|
|
999
|
+
/** Raw data rows. */
|
|
1000
|
+
data: T[];
|
|
1001
|
+
/** Value accessor. */
|
|
1002
|
+
value: MapAccessor<T, number>;
|
|
1003
|
+
/** Show the tooltip. Default: true. */
|
|
1004
|
+
showTooltip?: boolean;
|
|
1005
|
+
/** Nested configuration. */
|
|
1006
|
+
config?: { item: { id: string }; enabled: boolean };
|
|
1007
|
+
}
|
|
1008
|
+
`;
|
|
1009
|
+
const props = extractPropsFromInterface(content, "MapProps", cliFlags);
|
|
1010
|
+
expect(props).toEqual({
|
|
1011
|
+
data: {
|
|
1012
|
+
type: "T[]",
|
|
1013
|
+
required: true,
|
|
1014
|
+
description: "Raw data rows.",
|
|
1015
|
+
},
|
|
1016
|
+
value: {
|
|
1017
|
+
type: "MapAccessor<T, number>",
|
|
1018
|
+
required: true,
|
|
1019
|
+
description: "Value accessor.",
|
|
1020
|
+
},
|
|
1021
|
+
showTooltip: {
|
|
1022
|
+
type: "boolean",
|
|
1023
|
+
optional: true,
|
|
1024
|
+
description: "Show the tooltip. Default: true.",
|
|
1025
|
+
},
|
|
1026
|
+
config: {
|
|
1027
|
+
type: "{ item: { id: string }; enabled: boolean }",
|
|
1028
|
+
optional: true,
|
|
1029
|
+
description: "Nested configuration.",
|
|
1030
|
+
},
|
|
1031
|
+
});
|
|
1032
|
+
});
|
|
945
1033
|
});
|
|
946
1034
|
|
|
947
1035
|
describe("SUB_COMPONENT_OVERRIDES", () => {
|
|
@@ -54,6 +54,7 @@ import { discoverComponents, discoverBlocks } from "./discovery.js";
|
|
|
54
54
|
import { shouldSkipProp } from "./props-filter.js";
|
|
55
55
|
import {
|
|
56
56
|
detectSubComponents,
|
|
57
|
+
extractPropsFromInterface,
|
|
57
58
|
extractSubComponentProps,
|
|
58
59
|
} from "./sub-components.js";
|
|
59
60
|
import { generateAIContext } from "./markdown-generator.js";
|
|
@@ -433,8 +434,32 @@ function generatePropsFromType(
|
|
|
433
434
|
`Warning: Could not generate schema for ${getPropsType(config)}:`,
|
|
434
435
|
error,
|
|
435
436
|
);
|
|
436
|
-
|
|
437
|
-
|
|
437
|
+
const fallbackProps = generatePropsFromVariantsOnly(config);
|
|
438
|
+
let interfaceProps: Record<string, PropSchema> = {};
|
|
439
|
+
|
|
440
|
+
try {
|
|
441
|
+
interfaceProps = extractPropsFromInterface(
|
|
442
|
+
readFileSync(sourcePath, "utf-8"),
|
|
443
|
+
propsType,
|
|
444
|
+
CLI_FLAGS,
|
|
445
|
+
);
|
|
446
|
+
} catch (readError) {
|
|
447
|
+
console.warn(
|
|
448
|
+
`Warning: Could not read ${sourcePath} for interface fallback:`,
|
|
449
|
+
readError,
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (Object.keys(interfaceProps).length > 0) {
|
|
454
|
+
delete fallbackProps.className;
|
|
455
|
+
delete fallbackProps.children;
|
|
456
|
+
console.log(
|
|
457
|
+
` → Fallback: extracted ${Object.keys(interfaceProps).length} props from interface`,
|
|
458
|
+
);
|
|
459
|
+
return { ...fallbackProps, ...interfaceProps };
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return fallbackProps;
|
|
438
463
|
}
|
|
439
464
|
}
|
|
440
465
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
|
+
import * as ts from "typescript";
|
|
9
10
|
import type { SubComponentConfig, PropSchema } from "./types.js";
|
|
10
11
|
import { extractBalancedBraces } from "./utils.js";
|
|
11
12
|
import { shouldSkipProp } from "./props-filter.js";
|
|
@@ -348,32 +349,44 @@ export function extractPropsFromInterface(
|
|
|
348
349
|
cliFlags: CLIFlags,
|
|
349
350
|
): Record<string, PropSchema> {
|
|
350
351
|
const props: Record<string, PropSchema> = {};
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
const sourceFile = ts.createSourceFile(
|
|
353
|
+
"component.tsx",
|
|
354
|
+
content,
|
|
355
|
+
ts.ScriptTarget.Latest,
|
|
356
|
+
true,
|
|
357
|
+
ts.ScriptKind.TSX,
|
|
355
358
|
);
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
const declaration = sourceFile.statements.find(
|
|
360
|
+
(statement): statement is ts.InterfaceDeclaration =>
|
|
361
|
+
ts.isInterfaceDeclaration(statement) &&
|
|
362
|
+
statement.name.text === interfaceName,
|
|
363
|
+
);
|
|
364
|
+
if (!declaration) return props;
|
|
362
365
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
for (const member of declaration.members) {
|
|
367
|
+
if (!ts.isPropertySignature(member) || !member.type) continue;
|
|
368
|
+
if (!ts.isIdentifier(member.name) && !ts.isStringLiteral(member.name)) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
367
371
|
|
|
368
|
-
|
|
372
|
+
const propName = member.name.text;
|
|
373
|
+
if (shouldSkipProp(propName, cliFlags)) continue;
|
|
369
374
|
|
|
370
|
-
|
|
375
|
+
const descriptions = ts
|
|
376
|
+
.getJSDocCommentsAndTags(member)
|
|
377
|
+
.filter(ts.isJSDoc)
|
|
378
|
+
.flatMap((doc) => {
|
|
379
|
+
if (typeof doc.comment === "string") return [doc.comment];
|
|
380
|
+
return doc.comment?.map((part) => part.text).filter(Boolean) ?? [];
|
|
381
|
+
});
|
|
371
382
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
383
|
+
props[propName] = {
|
|
384
|
+
type: member.type.getText(sourceFile),
|
|
385
|
+
...(member.questionToken ? { optional: true } : { required: true }),
|
|
386
|
+
...(descriptions.length > 0 && {
|
|
387
|
+
description: descriptions.join(" ").replace(/\s+/g, " ").trim(),
|
|
388
|
+
}),
|
|
389
|
+
};
|
|
377
390
|
}
|
|
378
391
|
|
|
379
392
|
return props;
|
|
@@ -33,6 +33,12 @@ const EXCLUDED_EXPORTS = new Set([
|
|
|
33
33
|
"./use-render", // Internal hook
|
|
34
34
|
]);
|
|
35
35
|
|
|
36
|
+
const COMPATIBILITY_EXPORTS: Record<string, string[]> = {
|
|
37
|
+
"otp-field": [
|
|
38
|
+
'export { OTPField, OTPField as OTPFieldPreview } from "@base-ui/react/otp-field";',
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
36
42
|
function main() {
|
|
37
43
|
// Read base-ui package.json
|
|
38
44
|
if (!existsSync(BASE_UI_PACKAGE)) {
|
|
@@ -97,6 +103,7 @@ function generateBarrelExport(subpaths: string[]) {
|
|
|
97
103
|
for (const subpath of subpaths) {
|
|
98
104
|
const modulePath = `@base-ui/react/${subpath.replace("./", "")}`;
|
|
99
105
|
lines.push(`export * from "${modulePath}";`);
|
|
106
|
+
lines.push(...(COMPATIBILITY_EXPORTS[subpath.replace("./", "")] ?? []));
|
|
100
107
|
}
|
|
101
108
|
lines.push("");
|
|
102
109
|
|
|
@@ -109,6 +116,7 @@ function generateIndividualPrimitives(subpaths: string[]) {
|
|
|
109
116
|
const primitiveFile = join(PRIMITIVES_DIR, `${primitiveName}.ts`);
|
|
110
117
|
const modulePath = `@base-ui/react/${primitiveName}`;
|
|
111
118
|
|
|
119
|
+
const compatibilityExports = COMPATIBILITY_EXPORTS[primitiveName] ?? [];
|
|
112
120
|
const content = [
|
|
113
121
|
"/**",
|
|
114
122
|
` * ${primitiveName} primitive`,
|
|
@@ -123,6 +131,7 @@ function generateIndividualPrimitives(subpaths: string[]) {
|
|
|
123
131
|
" */",
|
|
124
132
|
"",
|
|
125
133
|
`export * from "${modulePath}";`,
|
|
134
|
+
...compatibilityExports,
|
|
126
135
|
"",
|
|
127
136
|
].join("\n");
|
|
128
137
|
|