@cloudraker/reki 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1892 -0
- package/README.md +525 -0
- package/ai/USAGE.md +201 -0
- package/ai/component-registry.json +6707 -0
- package/ai/component-registry.md +8346 -0
- package/ai/schemas.ts +955 -0
- package/bin/reki.js +36 -0
- package/dist/.build-complete +1 -0
- package/dist/ai/schemas.d.ts +2514 -0
- package/dist/ai/schemas.d.ts.map +1 -0
- package/dist/ai/schemas.js +3985 -0
- package/dist/ai/schemas.js.map +1 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +213 -0
- package/dist/blocks-source/page-header/page-header.tsx +99 -0
- package/dist/blocks-source/resource-list/resource-list.test.tsx +28 -0
- package/dist/blocks-source/resource-list/resource-list.tsx +69 -0
- package/dist/catalog.js +229 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunks/SankeyChart-jwwpwps4npqzbrvn.js +890 -0
- package/dist/chunks/SankeyChart-jwwpwps4npqzbrvn.js.map +1 -0
- package/dist/chunks/autocomplete-f4vetako14h2aqsw.js +193 -0
- package/dist/chunks/autocomplete-f4vetako14h2aqsw.js.map +1 -0
- package/dist/chunks/badge-pc33c5ir7muabgfh.js +163 -0
- package/dist/chunks/badge-pc33c5ir7muabgfh.js.map +1 -0
- package/dist/chunks/banner-kis9h1yq636liunc.js +120 -0
- package/dist/chunks/banner-kis9h1yq636liunc.js.map +1 -0
- package/dist/chunks/bash-g5z23u7me5rx7bzt.js +15 -0
- package/dist/chunks/bash-g5z23u7me5rx7bzt.js.map +1 -0
- package/dist/chunks/breadcrumbs-d6149hyct4puz3x4.js +169 -0
- package/dist/chunks/breadcrumbs-d6149hyct4puz3x4.js.map +1 -0
- package/dist/chunks/button-nc5p1h28cwes0tjw.js +237 -0
- package/dist/chunks/button-nc5p1h28cwes0tjw.js.map +1 -0
- package/dist/chunks/checkbox-g2661n3eodgoispq.js +216 -0
- package/dist/chunks/checkbox-g2661n3eodgoispq.js.map +1 -0
- package/dist/chunks/clipboard-text-g3659lejx2d7i93e.js +191 -0
- package/dist/chunks/clipboard-text-g3659lejx2d7i93e.js.map +1 -0
- package/dist/chunks/cloudflare-logo-k0f07zztsda8m4ca.js +175 -0
- package/dist/chunks/cloudflare-logo-k0f07zztsda8m4ca.js.map +1 -0
- package/dist/chunks/cn-ct4n7r74mh8y0f48.js +26 -0
- package/dist/chunks/cn-ct4n7r74mh8y0f48.js.map +1 -0
- package/dist/chunks/code-fm5rpi47v6cj9o8o.js +61 -0
- package/dist/chunks/code-fm5rpi47v6cj9o8o.js.map +1 -0
- package/dist/chunks/collapsible-ndvmgo29s5iqfcor.js +76 -0
- package/dist/chunks/collapsible-ndvmgo29s5iqfcor.js.map +1 -0
- package/dist/chunks/combobox-i38w67netm8ukw4f.js +408 -0
- package/dist/chunks/combobox-i38w67netm8ukw4f.js.map +1 -0
- package/dist/chunks/command-palette-fe5cjfdgsg3t17vq.js +403 -0
- package/dist/chunks/command-palette-fe5cjfdgsg3t17vq.js.map +1 -0
- package/dist/chunks/core-oowp00biqxe3hvjc.js +5806 -0
- package/dist/chunks/core-oowp00biqxe3hvjc.js.map +1 -0
- package/dist/chunks/css-d1mi3wy1sl3fzekh.js +8 -0
- package/dist/chunks/css-d1mi3wy1sl3fzekh.js.map +1 -0
- package/dist/chunks/date-picker-81mc3zrsmobm3ydm.js +2921 -0
- package/dist/chunks/date-picker-81mc3zrsmobm3ydm.js.map +1 -0
- package/dist/chunks/date-range-picker-c8ttrfaos9mb1w5n.js +408 -0
- package/dist/chunks/date-range-picker-c8ttrfaos9mb1w5n.js.map +1 -0
- package/dist/chunks/dialog-m4go8xof25fospqo.js +134 -0
- package/dist/chunks/dialog-m4go8xof25fospqo.js.map +1 -0
- package/dist/chunks/diff-cpj1h9lg0bw716mj.js +8 -0
- package/dist/chunks/diff-cpj1h9lg0bw716mj.js.map +1 -0
- package/dist/chunks/dropdown-j5uht8mn4z7xc9fc.js +313 -0
- package/dist/chunks/dropdown-j5uht8mn4z7xc9fc.js.map +1 -0
- package/dist/chunks/empty-kazxr0248zjemw6n.js +94 -0
- package/dist/chunks/empty-kazxr0248zjemw6n.js.map +1 -0
- package/dist/chunks/engine-javascript-iqcmg6wi2pjun29k.js +2637 -0
- package/dist/chunks/engine-javascript-iqcmg6wi2pjun29k.js.map +1 -0
- package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js +295 -0
- package/dist/chunks/engine-oniguruma-g75h8oxao68cjmhg.js.map +1 -0
- package/dist/chunks/field-fe5m8z3vbpvtctbe.js +77 -0
- package/dist/chunks/field-fe5m8z3vbpvtctbe.js.map +1 -0
- package/dist/chunks/github-light-ulev8flhimfg79ob.js +6 -0
- package/dist/chunks/github-light-ulev8flhimfg79ob.js.map +1 -0
- package/dist/chunks/graphql-ft2h47erta7isqn4.js +16 -0
- package/dist/chunks/graphql-ft2h47erta7isqn4.js.map +1 -0
- package/dist/chunks/grid-enlbb88vucgeq1np.js +128 -0
- package/dist/chunks/grid-enlbb88vucgeq1np.js.map +1 -0
- package/dist/chunks/hcl-hcu7d6ja6t540ijn.js +8 -0
- package/dist/chunks/hcl-hcu7d6ja6t540ijn.js.map +1 -0
- package/dist/chunks/html-kl304jmqj4jxj777.js +12 -0
- package/dist/chunks/html-kl304jmqj4jxj777.js.map +1 -0
- package/dist/chunks/input-area-ciw85g3fno06t4tw.js +78 -0
- package/dist/chunks/input-area-ciw85g3fno06t4tw.js.map +1 -0
- package/dist/chunks/input-group-mo7tq7jr19hmgor5.js +505 -0
- package/dist/chunks/input-group-mo7tq7jr19hmgor5.js.map +1 -0
- package/dist/chunks/input-i5nefqk213n4z7pr.js +130 -0
- package/dist/chunks/input-i5nefqk213n4z7pr.js.map +1 -0
- package/dist/chunks/javascript-hhx3avh9uv2o27ay.js +8 -0
- package/dist/chunks/javascript-hhx3avh9uv2o27ay.js.map +1 -0
- package/dist/chunks/json-jovp9qemdkp5cziz.js +8 -0
- package/dist/chunks/json-jovp9qemdkp5cziz.js.map +1 -0
- package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js +8 -0
- package/dist/chunks/jsonc-jbkkgjer6ispw2u3.js.map +1 -0
- package/dist/chunks/jsx-ij885l2li2lzfoss.js +8 -0
- package/dist/chunks/jsx-ij885l2li2lzfoss.js.map +1 -0
- package/dist/chunks/label-fcho4757rbdess0c.js +68 -0
- package/dist/chunks/label-fcho4757rbdess0c.js.map +1 -0
- package/dist/chunks/layer-card-kzu48dhzxm3e9p4u.js +47 -0
- package/dist/chunks/layer-card-kzu48dhzxm3e9p4u.js.map +1 -0
- package/dist/chunks/link-j2gu5dr3nr4i4yf0.js +95 -0
- package/dist/chunks/link-j2gu5dr3nr4i4yf0.js.map +1 -0
- package/dist/chunks/link-provider-bgljdgs4hs438h0u.js +22 -0
- package/dist/chunks/link-provider-bgljdgs4hs438h0u.js.map +1 -0
- package/dist/chunks/loader-cxzp72mn53lzbv9c.js +109 -0
- package/dist/chunks/loader-cxzp72mn53lzbv9c.js.map +1 -0
- package/dist/chunks/markdown-n2vyyq7l68fy32wc.js +8 -0
- package/dist/chunks/markdown-n2vyyq7l68fy32wc.js.map +1 -0
- package/dist/chunks/menubar-ir5gbjmsizsddz7g.js +98 -0
- package/dist/chunks/menubar-ir5gbjmsizsddz7g.js.map +1 -0
- package/dist/chunks/meter-o5yd7ctjf80vvyjx.js +51 -0
- package/dist/chunks/meter-o5yd7ctjf80vvyjx.js.map +1 -0
- package/dist/chunks/pagination-bryw6rohfr7mm3km.js +266 -0
- package/dist/chunks/pagination-bryw6rohfr7mm3km.js.map +1 -0
- package/dist/chunks/popover-elxcmvv7mu7m7uk4.js +181 -0
- package/dist/chunks/popover-elxcmvv7mu7m7uk4.js.map +1 -0
- package/dist/chunks/portal-provider-off76og7tjyz96ys.js +18 -0
- package/dist/chunks/portal-provider-off76og7tjyz96ys.js.map +1 -0
- package/dist/chunks/python-gg755pb8oe9ra1d1.js +8 -0
- package/dist/chunks/python-gg755pb8oe9ra1d1.js.map +1 -0
- package/dist/chunks/radio-newyq331uk4lltr6.js +226 -0
- package/dist/chunks/radio-newyq331uk4lltr6.js.map +1 -0
- package/dist/chunks/resolve-variant-t8jcltsizeg29ege.js +11 -0
- package/dist/chunks/resolve-variant-t8jcltsizeg29ege.js.map +1 -0
- package/dist/chunks/select-h5480mbro0ypxu0b.js +237 -0
- package/dist/chunks/select-h5480mbro0ypxu0b.js.map +1 -0
- package/dist/chunks/sensitive-input-lqugq6uvx0lkpu0u.js +273 -0
- package/dist/chunks/sensitive-input-lqugq6uvx0lkpu0u.js.map +1 -0
- package/dist/chunks/sidebar-noz668nhdu2gso12.js +1144 -0
- package/dist/chunks/sidebar-noz668nhdu2gso12.js.map +1 -0
- package/dist/chunks/skeleton-line-epxenksfesr2fkcv.js +33 -0
- package/dist/chunks/skeleton-line-epxenksfesr2fkcv.js.map +1 -0
- package/dist/chunks/sql-ovukp5mrfunfk5tv.js +8 -0
- package/dist/chunks/sql-ovukp5mrfunfk5tv.js.map +1 -0
- package/dist/chunks/surface-cyxme7mlr49l33f8.js +29 -0
- package/dist/chunks/surface-cyxme7mlr49l33f8.js.map +1 -0
- package/dist/chunks/switch-bigo96fyjlh7ivbi.js +256 -0
- package/dist/chunks/switch-bigo96fyjlh7ivbi.js.map +1 -0
- package/dist/chunks/table-mwcmwp6a80zvyrxw.js +208 -0
- package/dist/chunks/table-mwcmwp6a80zvyrxw.js.map +1 -0
- package/dist/chunks/table-of-contents-gkuvkr2w6lbhi7wt.js +106 -0
- package/dist/chunks/table-of-contents-gkuvkr2w6lbhi7wt.js.map +1 -0
- package/dist/chunks/tabs-e4pcjkw94kpe35x0.js +177 -0
- package/dist/chunks/tabs-e4pcjkw94kpe35x0.js.map +1 -0
- package/dist/chunks/text-oxsrbmjmfq99ue85.js +103 -0
- package/dist/chunks/text-oxsrbmjmfq99ue85.js.map +1 -0
- package/dist/chunks/toast-ivr4097bstjcjotf.js +370 -0
- package/dist/chunks/toast-ivr4097bstjcjotf.js.map +1 -0
- package/dist/chunks/toml-nczb2z9n0o23o3ci.js +8 -0
- package/dist/chunks/toml-nczb2z9n0o23o3ci.js.map +1 -0
- package/dist/chunks/tooltip-ncaia8n1lavkyw8n.js +103 -0
- package/dist/chunks/tooltip-ncaia8n1lavkyw8n.js.map +1 -0
- package/dist/chunks/tsx-ehy8lrzet6v54zur.js +8 -0
- package/dist/chunks/tsx-ehy8lrzet6v54zur.js.map +1 -0
- package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js +8 -0
- package/dist/chunks/typescript-k4ggjrxhrhcdni6u.js.map +1 -0
- package/dist/chunks/vendor-base-ui-bgl9g5nkvqy3tn36.js +24690 -0
- package/dist/chunks/vendor-base-ui-bgl9g5nkvqy3tn36.js.map +1 -0
- package/dist/chunks/vendor-floating-ui-dn8xswn8036udsqq.js +1311 -0
- package/dist/chunks/vendor-floating-ui-dn8xswn8036udsqq.js.map +1 -0
- package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js +2775 -0
- package/dist/chunks/vendor-styling-gobnkhsy0rva4qd3.js.map +1 -0
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js +217 -0
- package/dist/chunks/vendor-utils-m5h2xu7s2rs3pgk5.js.map +1 -0
- package/dist/chunks/vesper-ebfu9ns65f2v830s.js +6 -0
- package/dist/chunks/vesper-ebfu9ns65f2v830s.js.map +1 -0
- package/dist/chunks/wasm-oj22f8usru9h7dzg.js +9 -0
- package/dist/chunks/wasm-oj22f8usru9h7dzg.js.map +1 -0
- package/dist/chunks/yaml-e2v22lr79tss2brj.js +8 -0
- package/dist/chunks/yaml-e2v22lr79tss2brj.js.map +1 -0
- package/dist/code/server.js +88 -0
- package/dist/code/server.js.map +1 -0
- package/dist/code.js +256 -0
- package/dist/code.js.map +1 -0
- package/dist/command-line/cli.js +850 -0
- package/dist/command-line/commands/add.js +282 -0
- package/dist/command-line/commands/ai.js +22 -0
- package/dist/command-line/commands/blocks.js +61 -0
- package/dist/command-line/commands/doc.js +167 -0
- package/dist/command-line/commands/init.js +95 -0
- package/dist/command-line/commands/ls.js +53 -0
- package/dist/components/autocomplete.js +9 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/badge.js +7 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/banner.js +7 -0
- package/dist/components/banner.js.map +1 -0
- package/dist/components/breadcrumbs.js +9 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/button.js +9 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/chart.js +10 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/clipboard-text.js +6 -0
- package/dist/components/clipboard-text.js.map +1 -0
- package/dist/components/cloudflare-logo.js +10 -0
- package/dist/components/cloudflare-logo.js.map +1 -0
- package/dist/components/code.js +7 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/collapsible.js +6 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.js +6 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command-palette.js +8 -0
- package/dist/components/command-palette.js.map +1 -0
- package/dist/components/date-picker.js +6 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/date-range-picker.js +6 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.js +11 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown.js +6 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/empty.js +9 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.js +10 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/flow.js +5831 -0
- package/dist/components/flow.js.map +1 -0
- package/dist/components/grid.js +11 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/input-group.js +8 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.js +14 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.js +10 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layer-card.js +6 -0
- package/dist/components/layer-card.js.map +1 -0
- package/dist/components/link.js +9 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/loader.js +8 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/menubar.js +7 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/meter.js +6 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/pagination.js +6 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +14 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/radio.js +10 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/select.js +6 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/sensitive-input.js +8 -0
- package/dist/components/sensitive-input.js.map +1 -0
- package/dist/components/sidebar.js +34 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/surface.js +6 -0
- package/dist/components/surface.js.map +1 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table-of-contents.js +8 -0
- package/dist/components/table-of-contents.js.map +1 -0
- package/dist/components/table.js +8 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +6 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text.js +6 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/toast.js +11 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/tooltip.js +7 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/index.js +344 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives/accordion.js +6 -0
- package/dist/primitives/accordion.js.map +1 -0
- package/dist/primitives/alert-dialog.js +6 -0
- package/dist/primitives/alert-dialog.js.map +1 -0
- package/dist/primitives/autocomplete.js +6 -0
- package/dist/primitives/autocomplete.js.map +1 -0
- package/dist/primitives/avatar.js +6 -0
- package/dist/primitives/avatar.js.map +1 -0
- package/dist/primitives/button.js +6 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/checkbox-group.js +6 -0
- package/dist/primitives/checkbox-group.js.map +1 -0
- package/dist/primitives/checkbox.js +6 -0
- package/dist/primitives/checkbox.js.map +1 -0
- package/dist/primitives/collapsible.js +6 -0
- package/dist/primitives/collapsible.js.map +1 -0
- package/dist/primitives/combobox.js +6 -0
- package/dist/primitives/combobox.js.map +1 -0
- package/dist/primitives/context-menu.js +6 -0
- package/dist/primitives/context-menu.js.map +1 -0
- package/dist/primitives/csp-provider.js +6 -0
- package/dist/primitives/csp-provider.js.map +1 -0
- package/dist/primitives/dialog.js +6 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/direction-provider.js +7 -0
- package/dist/primitives/direction-provider.js.map +1 -0
- package/dist/primitives/drawer.js +6 -0
- package/dist/primitives/drawer.js.map +1 -0
- package/dist/primitives/field.js +6 -0
- package/dist/primitives/field.js.map +1 -0
- package/dist/primitives/fieldset.js +6 -0
- package/dist/primitives/fieldset.js.map +1 -0
- package/dist/primitives/form.js +6 -0
- package/dist/primitives/form.js.map +1 -0
- package/dist/primitives/input.js +6 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/menu.js +6 -0
- package/dist/primitives/menu.js.map +1 -0
- package/dist/primitives/menubar.js +6 -0
- package/dist/primitives/menubar.js.map +1 -0
- package/dist/primitives/meter.js +6 -0
- package/dist/primitives/meter.js.map +1 -0
- package/dist/primitives/navigation-menu.js +6 -0
- package/dist/primitives/navigation-menu.js.map +1 -0
- package/dist/primitives/number-field.js +6 -0
- package/dist/primitives/number-field.js.map +1 -0
- package/dist/primitives/otp-field.js +6 -0
- package/dist/primitives/otp-field.js.map +1 -0
- package/dist/primitives/popover.js +6 -0
- package/dist/primitives/popover.js.map +1 -0
- package/dist/primitives/preview-card.js +6 -0
- package/dist/primitives/preview-card.js.map +1 -0
- package/dist/primitives/progress.js +6 -0
- package/dist/primitives/progress.js.map +1 -0
- package/dist/primitives/radio-group.js +6 -0
- package/dist/primitives/radio-group.js.map +1 -0
- package/dist/primitives/radio.js +6 -0
- package/dist/primitives/radio.js.map +1 -0
- package/dist/primitives/scroll-area.js +6 -0
- package/dist/primitives/scroll-area.js.map +1 -0
- package/dist/primitives/select.js +6 -0
- package/dist/primitives/select.js.map +1 -0
- package/dist/primitives/separator.js +6 -0
- package/dist/primitives/separator.js.map +1 -0
- package/dist/primitives/slider.js +6 -0
- package/dist/primitives/slider.js.map +1 -0
- package/dist/primitives/switch.js +6 -0
- package/dist/primitives/switch.js.map +1 -0
- package/dist/primitives/tabs.js +6 -0
- package/dist/primitives/tabs.js.map +1 -0
- package/dist/primitives/toast.js +6 -0
- package/dist/primitives/toast.js.map +1 -0
- package/dist/primitives/toggle-group.js +6 -0
- package/dist/primitives/toggle-group.js.map +1 -0
- package/dist/primitives/toggle.js +6 -0
- package/dist/primitives/toggle.js.map +1 -0
- package/dist/primitives/toolbar.js +6 -0
- package/dist/primitives/toolbar.js.map +1 -0
- package/dist/primitives/tooltip.js +6 -0
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/primitives.js +46 -0
- package/dist/primitives.js.map +1 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/scripts/theme-generator/config.d.ts +6 -0
- package/dist/scripts/theme-generator/config.d.ts.map +1 -0
- package/dist/scripts/theme-generator/config.js +629 -0
- package/dist/scripts/theme-generator/config.js.map +1 -0
- package/dist/scripts/theme-generator/generate-css.d.ts +31 -0
- package/dist/scripts/theme-generator/generate-css.d.ts.map +1 -0
- package/dist/scripts/theme-generator/index.d.ts +13 -0
- package/dist/scripts/theme-generator/index.d.ts.map +1 -0
- package/dist/scripts/theme-generator/migrate.d.ts +56 -0
- package/dist/scripts/theme-generator/migrate.d.ts.map +1 -0
- package/dist/scripts/theme-generator/types.d.ts +82 -0
- package/dist/scripts/theme-generator/types.d.ts.map +1 -0
- package/dist/scripts/theme-generator/types.js +2 -0
- package/dist/scripts/theme-generator/types.js.map +1 -0
- package/dist/src/blocks/delete-resource/delete-resource.d.ts +46 -0
- package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -0
- package/dist/src/blocks/delete-resource/index.d.ts +2 -0
- package/dist/src/blocks/delete-resource/index.d.ts.map +1 -0
- package/dist/src/blocks/page-header/index.d.ts +2 -0
- package/dist/src/blocks/page-header/index.d.ts.map +1 -0
- package/dist/src/blocks/page-header/page-header.d.ts +38 -0
- package/dist/src/blocks/page-header/page-header.d.ts.map +1 -0
- package/dist/src/blocks/resource-list/index.d.ts +2 -0
- package/dist/src/blocks/resource-list/index.d.ts.map +1 -0
- package/dist/src/blocks/resource-list/resource-list.d.ts +18 -0
- package/dist/src/blocks/resource-list/resource-list.d.ts.map +1 -0
- package/dist/src/catalog/catalog.d.ts +75 -0
- package/dist/src/catalog/catalog.d.ts.map +1 -0
- package/dist/src/catalog/data.d.ts +44 -0
- package/dist/src/catalog/data.d.ts.map +1 -0
- package/dist/src/catalog/index.d.ts +39 -0
- package/dist/src/catalog/index.d.ts.map +1 -0
- package/dist/src/catalog/types.d.ts +226 -0
- package/dist/src/catalog/types.d.ts.map +1 -0
- package/dist/src/catalog/visibility.d.ts +37 -0
- package/dist/src/catalog/visibility.d.ts.map +1 -0
- package/dist/src/code/code-highlighted.d.ts +32 -0
- package/dist/src/code/code-highlighted.d.ts.map +1 -0
- package/dist/src/code/context.d.ts +16 -0
- package/dist/src/code/context.d.ts.map +1 -0
- package/dist/src/code/index.d.ts +32 -0
- package/dist/src/code/index.d.ts.map +1 -0
- package/dist/src/code/provider.d.ts +13 -0
- package/dist/src/code/provider.d.ts.map +1 -0
- package/dist/src/code/server.d.ts +95 -0
- package/dist/src/code/server.d.ts.map +1 -0
- package/dist/src/code/types.d.ts +130 -0
- package/dist/src/code/types.d.ts.map +1 -0
- package/dist/src/code/use-shiki-highlighter.d.ts +36 -0
- package/dist/src/code/use-shiki-highlighter.d.ts.map +1 -0
- package/dist/src/command-line/build-cli.d.ts +7 -0
- package/dist/src/command-line/build-cli.d.ts.map +1 -0
- package/dist/src/command-line/cli.d.ts +13 -0
- package/dist/src/command-line/cli.d.ts.map +1 -0
- package/dist/src/command-line/commands/add.d.ts +10 -0
- package/dist/src/command-line/commands/add.d.ts.map +1 -0
- package/dist/src/command-line/commands/ai.d.ts +10 -0
- package/dist/src/command-line/commands/ai.d.ts.map +1 -0
- package/dist/src/command-line/commands/blocks.d.ts +10 -0
- package/dist/src/command-line/commands/blocks.d.ts.map +1 -0
- package/dist/src/command-line/commands/doc.d.ts +14 -0
- package/dist/src/command-line/commands/doc.d.ts.map +1 -0
- package/dist/src/command-line/commands/init.d.ts +18 -0
- package/dist/src/command-line/commands/init.d.ts.map +1 -0
- package/dist/src/command-line/commands/ls.d.ts +10 -0
- package/dist/src/command-line/commands/ls.d.ts.map +1 -0
- package/dist/src/command-line/commands/migrate.d.ts +10 -0
- package/dist/src/command-line/commands/migrate.d.ts.map +1 -0
- package/dist/src/command-line/utils/config.d.ts +42 -0
- package/dist/src/command-line/utils/config.d.ts.map +1 -0
- package/dist/src/command-line/utils/transformer.d.ts +21 -0
- package/dist/src/command-line/utils/transformer.d.ts.map +1 -0
- package/dist/src/components/autocomplete/autocomplete.d.ts +181 -0
- package/dist/src/components/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/src/components/autocomplete/index.d.ts +3 -0
- package/dist/src/components/autocomplete/index.d.ts.map +1 -0
- package/dist/src/components/badge/badge.d.ts +180 -0
- package/dist/src/components/badge/badge.d.ts.map +1 -0
- package/dist/src/components/badge/index.d.ts +2 -0
- package/dist/src/components/badge/index.d.ts.map +1 -0
- package/dist/src/components/banner/banner.d.ts +106 -0
- package/dist/src/components/banner/banner.d.ts.map +1 -0
- package/dist/src/components/banner/index.d.ts +2 -0
- package/dist/src/components/banner/index.d.ts.map +1 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +78 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/breadcrumbs/index.d.ts +2 -0
- package/dist/src/components/breadcrumbs/index.d.ts.map +1 -0
- package/dist/src/components/button/button.d.ts +214 -0
- package/dist/src/components/button/button.d.ts.map +1 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/button/index.d.ts.map +1 -0
- package/dist/src/components/chart/Color.d.ts +91 -0
- package/dist/src/components/chart/Color.d.ts.map +1 -0
- package/dist/src/components/chart/EChart.d.ts +159 -0
- package/dist/src/components/chart/EChart.d.ts.map +1 -0
- package/dist/src/components/chart/Legend.d.ts +51 -0
- package/dist/src/components/chart/Legend.d.ts.map +1 -0
- package/dist/src/components/chart/SankeyChart.d.ts +98 -0
- package/dist/src/components/chart/SankeyChart.d.ts.map +1 -0
- package/dist/src/components/chart/TimeseriesChart.d.ts +181 -0
- package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -0
- package/dist/src/components/chart/index.d.ts +6 -0
- package/dist/src/components/chart/index.d.ts.map +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +197 -0
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/src/components/checkbox/index.d.ts +2 -0
- package/dist/src/components/checkbox/index.d.ts.map +1 -0
- package/dist/src/components/clipboard-text/clipboard-text.d.ts +88 -0
- package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -0
- package/dist/src/components/clipboard-text/index.d.ts +2 -0
- package/dist/src/components/clipboard-text/index.d.ts.map +1 -0
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts +133 -0
- package/dist/src/components/cloudflare-logo/cloudflare-logo.d.ts.map +1 -0
- package/dist/src/components/cloudflare-logo/index.d.ts +2 -0
- package/dist/src/components/cloudflare-logo/index.d.ts.map +1 -0
- package/dist/src/components/code/code.d.ts +189 -0
- package/dist/src/components/code/code.d.ts.map +1 -0
- package/dist/src/components/code/index.d.ts +4 -0
- package/dist/src/components/code/index.d.ts.map +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +109 -0
- package/dist/src/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/src/components/collapsible/index.d.ts +2 -0
- package/dist/src/components/collapsible/index.d.ts.map +1 -0
- package/dist/src/components/combobox/combobox.d.ts +246 -0
- package/dist/src/components/combobox/combobox.d.ts.map +1 -0
- package/dist/src/components/combobox/index.d.ts +3 -0
- package/dist/src/components/combobox/index.d.ts.map +1 -0
- package/dist/src/components/command-palette/command-palette.d.ts +258 -0
- package/dist/src/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/src/components/command-palette/index.d.ts +3 -0
- package/dist/src/components/command-palette/index.d.ts.map +1 -0
- package/dist/src/components/command-palette/types.d.ts +168 -0
- package/dist/src/components/command-palette/types.d.ts.map +1 -0
- package/dist/src/components/date-picker/date-picker.d.ts +65 -0
- package/dist/src/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/src/components/date-picker/index.d.ts +4 -0
- package/dist/src/components/date-picker/index.d.ts.map +1 -0
- package/dist/src/components/date-range-picker/date-range-picker.d.ts +125 -0
- package/dist/src/components/date-range-picker/date-range-picker.d.ts.map +1 -0
- package/dist/src/components/date-range-picker/index.d.ts +5 -0
- package/dist/src/components/date-range-picker/index.d.ts.map +1 -0
- package/dist/src/components/dialog/dialog.d.ts +242 -0
- package/dist/src/components/dialog/dialog.d.ts.map +1 -0
- package/dist/src/components/dialog/index.d.ts +2 -0
- package/dist/src/components/dialog/index.d.ts.map +1 -0
- package/dist/src/components/dropdown/dropdown.d.ts +116 -0
- package/dist/src/components/dropdown/dropdown.d.ts.map +1 -0
- package/dist/src/components/dropdown/index.d.ts +2 -0
- package/dist/src/components/dropdown/index.d.ts.map +1 -0
- package/dist/src/components/empty/empty.d.ts +69 -0
- package/dist/src/components/empty/empty.d.ts.map +1 -0
- package/dist/src/components/empty/index.d.ts +2 -0
- package/dist/src/components/empty/index.d.ts.map +1 -0
- package/dist/src/components/field/field.d.ts +89 -0
- package/dist/src/components/field/field.d.ts.map +1 -0
- package/dist/src/components/field/index.d.ts +2 -0
- package/dist/src/components/field/index.d.ts.map +1 -0
- package/dist/src/components/flow/connectors.d.ts +41 -0
- package/dist/src/components/flow/connectors.d.ts.map +1 -0
- package/dist/src/components/flow/diagram.d.ts +96 -0
- package/dist/src/components/flow/diagram.d.ts.map +1 -0
- package/dist/src/components/flow/index.d.ts +26 -0
- package/dist/src/components/flow/index.d.ts.map +1 -0
- package/dist/src/components/flow/node.d.ts +61 -0
- package/dist/src/components/flow/node.d.ts.map +1 -0
- package/dist/src/components/flow/parallel.d.ts +13 -0
- package/dist/src/components/flow/parallel.d.ts.map +1 -0
- package/dist/src/components/flow/use-children.d.ts +87 -0
- package/dist/src/components/flow/use-children.d.ts.map +1 -0
- package/dist/src/components/grid/grid.d.ts +135 -0
- package/dist/src/components/grid/grid.d.ts.map +1 -0
- package/dist/src/components/grid/index.d.ts +2 -0
- package/dist/src/components/grid/index.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +19 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/input/input-area.d.ts +65 -0
- package/dist/src/components/input/input-area.d.ts.map +1 -0
- package/dist/src/components/input/input.d.ts +175 -0
- package/dist/src/components/input/input.d.ts.map +1 -0
- package/dist/src/components/input-group/context.d.ts +96 -0
- package/dist/src/components/input-group/context.d.ts.map +1 -0
- package/dist/src/components/input-group/index.d.ts +2 -0
- package/dist/src/components/input-group/index.d.ts.map +1 -0
- package/dist/src/components/input-group/input-group-addon.d.ts +15 -0
- package/dist/src/components/input-group/input-group-addon.d.ts.map +1 -0
- package/dist/src/components/input-group/input-group-button.d.ts +36 -0
- package/dist/src/components/input-group/input-group-button.d.ts.map +1 -0
- package/dist/src/components/input-group/input-group-input.d.ts +9 -0
- package/dist/src/components/input-group/input-group-input.d.ts.map +1 -0
- package/dist/src/components/input-group/input-group-suffix.d.ts +13 -0
- package/dist/src/components/input-group/input-group-suffix.d.ts.map +1 -0
- package/dist/src/components/input-group/input-group.d.ts +43 -0
- package/dist/src/components/input-group/input-group.d.ts.map +1 -0
- package/dist/src/components/label/index.d.ts +2 -0
- package/dist/src/components/label/index.d.ts.map +1 -0
- package/dist/src/components/label/label.d.ts +67 -0
- package/dist/src/components/label/label.d.ts.map +1 -0
- package/dist/src/components/layer-card/index.d.ts +2 -0
- package/dist/src/components/layer-card/index.d.ts.map +1 -0
- package/dist/src/components/layer-card/layer-card.d.ts +60 -0
- package/dist/src/components/layer-card/layer-card.d.ts.map +1 -0
- package/dist/src/components/link/index.d.ts +2 -0
- package/dist/src/components/link/index.d.ts.map +1 -0
- package/dist/src/components/link/link.d.ts +66 -0
- package/dist/src/components/link/link.d.ts.map +1 -0
- package/dist/src/components/loader/index.d.ts +3 -0
- package/dist/src/components/loader/index.d.ts.map +1 -0
- package/dist/src/components/loader/loader.d.ts +70 -0
- package/dist/src/components/loader/loader.d.ts.map +1 -0
- package/dist/src/components/loader/skeleton-line.d.ts +11 -0
- package/dist/src/components/loader/skeleton-line.d.ts.map +1 -0
- package/dist/src/components/menubar/index.d.ts +3 -0
- package/dist/src/components/menubar/index.d.ts.map +1 -0
- package/dist/src/components/menubar/menubar.d.ts +66 -0
- package/dist/src/components/menubar/menubar.d.ts.map +1 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts +8 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts.map +1 -0
- package/dist/src/components/meter/index.d.ts +2 -0
- package/dist/src/components/meter/index.d.ts.map +1 -0
- package/dist/src/components/meter/meter.d.ts +44 -0
- package/dist/src/components/meter/meter.d.ts.map +1 -0
- package/dist/src/components/pagination/index.d.ts +2 -0
- package/dist/src/components/pagination/index.d.ts.map +1 -0
- package/dist/src/components/pagination/pagination.d.ts +241 -0
- package/dist/src/components/pagination/pagination.d.ts.map +1 -0
- package/dist/src/components/popover/index.d.ts +3 -0
- package/dist/src/components/popover/index.d.ts.map +1 -0
- package/dist/src/components/popover/popover.d.ts +178 -0
- package/dist/src/components/popover/popover.d.ts.map +1 -0
- package/dist/src/components/radio/index.d.ts +2 -0
- package/dist/src/components/radio/index.d.ts.map +1 -0
- package/dist/src/components/radio/radio.d.ts +277 -0
- package/dist/src/components/radio/radio.d.ts.map +1 -0
- package/dist/src/components/radio/radio.type-spec.d.ts +12 -0
- package/dist/src/components/radio/radio.type-spec.d.ts.map +1 -0
- package/dist/src/components/select/index.d.ts +2 -0
- package/dist/src/components/select/index.d.ts.map +1 -0
- package/dist/src/components/select/select.d.ts +288 -0
- package/dist/src/components/select/select.d.ts.map +1 -0
- package/dist/src/components/sensitive-input/index.d.ts +2 -0
- package/dist/src/components/sensitive-input/index.d.ts.map +1 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +94 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts.map +1 -0
- package/dist/src/components/sidebar/index.d.ts +2 -0
- package/dist/src/components/sidebar/index.d.ts.map +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +581 -0
- package/dist/src/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/src/components/surface/index.d.ts +5 -0
- package/dist/src/components/surface/index.d.ts.map +1 -0
- package/dist/src/components/surface/surface.d.ts +64 -0
- package/dist/src/components/surface/surface.d.ts.map +1 -0
- package/dist/src/components/switch/index.d.ts +2 -0
- package/dist/src/components/switch/index.d.ts.map +1 -0
- package/dist/src/components/switch/switch.d.ts +197 -0
- package/dist/src/components/switch/switch.d.ts.map +1 -0
- package/dist/src/components/table/index.d.ts +2 -0
- package/dist/src/components/table/index.d.ts.map +1 -0
- package/dist/src/components/table/table.d.ts +138 -0
- package/dist/src/components/table/table.d.ts.map +1 -0
- package/dist/src/components/table-of-contents/index.d.ts +2 -0
- package/dist/src/components/table-of-contents/index.d.ts.map +1 -0
- package/dist/src/components/table-of-contents/table-of-contents.d.ts +72 -0
- package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +1 -0
- package/dist/src/components/tabs/index.d.ts +3 -0
- package/dist/src/components/tabs/index.d.ts.map +1 -0
- package/dist/src/components/tabs/tabs.d.ts +116 -0
- package/dist/src/components/tabs/tabs.d.ts.map +1 -0
- package/dist/src/components/text/index.d.ts +2 -0
- package/dist/src/components/text/index.d.ts.map +1 -0
- package/dist/src/components/text/text.d.ts +214 -0
- package/dist/src/components/text/text.d.ts.map +1 -0
- package/dist/src/components/text/text.type-spec.d.ts +44 -0
- package/dist/src/components/text/text.type-spec.d.ts.map +1 -0
- package/dist/src/components/toast/index.d.ts +5 -0
- package/dist/src/components/toast/index.d.ts.map +1 -0
- package/dist/src/components/toast/toast.d.ts +197 -0
- package/dist/src/components/toast/toast.d.ts.map +1 -0
- package/dist/src/components/tooltip/index.d.ts +2 -0
- package/dist/src/components/tooltip/index.d.ts.map +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +108 -0
- package/dist/src/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/src/index.d.ts +84 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/primitives/accordion.d.ts +13 -0
- package/dist/src/primitives/accordion.d.ts.map +1 -0
- package/dist/src/primitives/alert-dialog.d.ts +13 -0
- package/dist/src/primitives/alert-dialog.d.ts.map +1 -0
- package/dist/src/primitives/autocomplete.d.ts +13 -0
- package/dist/src/primitives/autocomplete.d.ts.map +1 -0
- package/dist/src/primitives/avatar.d.ts +13 -0
- package/dist/src/primitives/avatar.d.ts.map +1 -0
- package/dist/src/primitives/button.d.ts +13 -0
- package/dist/src/primitives/button.d.ts.map +1 -0
- package/dist/src/primitives/checkbox-group.d.ts +13 -0
- package/dist/src/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/src/primitives/checkbox.d.ts +13 -0
- package/dist/src/primitives/checkbox.d.ts.map +1 -0
- package/dist/src/primitives/collapsible.d.ts +13 -0
- package/dist/src/primitives/collapsible.d.ts.map +1 -0
- package/dist/src/primitives/combobox.d.ts +13 -0
- package/dist/src/primitives/combobox.d.ts.map +1 -0
- package/dist/src/primitives/context-menu.d.ts +13 -0
- package/dist/src/primitives/context-menu.d.ts.map +1 -0
- package/dist/src/primitives/csp-provider.d.ts +13 -0
- package/dist/src/primitives/csp-provider.d.ts.map +1 -0
- package/dist/src/primitives/dialog.d.ts +13 -0
- package/dist/src/primitives/dialog.d.ts.map +1 -0
- package/dist/src/primitives/direction-provider.d.ts +13 -0
- package/dist/src/primitives/direction-provider.d.ts.map +1 -0
- package/dist/src/primitives/drawer.d.ts +13 -0
- package/dist/src/primitives/drawer.d.ts.map +1 -0
- package/dist/src/primitives/field.d.ts +13 -0
- package/dist/src/primitives/field.d.ts.map +1 -0
- package/dist/src/primitives/fieldset.d.ts +13 -0
- package/dist/src/primitives/fieldset.d.ts.map +1 -0
- package/dist/src/primitives/form.d.ts +13 -0
- package/dist/src/primitives/form.d.ts.map +1 -0
- package/dist/src/primitives/index.d.ts +55 -0
- package/dist/src/primitives/index.d.ts.map +1 -0
- package/dist/src/primitives/input.d.ts +13 -0
- package/dist/src/primitives/input.d.ts.map +1 -0
- package/dist/src/primitives/menu.d.ts +13 -0
- package/dist/src/primitives/menu.d.ts.map +1 -0
- package/dist/src/primitives/menubar.d.ts +13 -0
- package/dist/src/primitives/menubar.d.ts.map +1 -0
- package/dist/src/primitives/meter.d.ts +13 -0
- package/dist/src/primitives/meter.d.ts.map +1 -0
- package/dist/src/primitives/navigation-menu.d.ts +13 -0
- package/dist/src/primitives/navigation-menu.d.ts.map +1 -0
- package/dist/src/primitives/number-field.d.ts +13 -0
- package/dist/src/primitives/number-field.d.ts.map +1 -0
- package/dist/src/primitives/otp-field.d.ts +13 -0
- package/dist/src/primitives/otp-field.d.ts.map +1 -0
- package/dist/src/primitives/popover.d.ts +13 -0
- package/dist/src/primitives/popover.d.ts.map +1 -0
- package/dist/src/primitives/preview-card.d.ts +13 -0
- package/dist/src/primitives/preview-card.d.ts.map +1 -0
- package/dist/src/primitives/progress.d.ts +13 -0
- package/dist/src/primitives/progress.d.ts.map +1 -0
- package/dist/src/primitives/radio-group.d.ts +13 -0
- package/dist/src/primitives/radio-group.d.ts.map +1 -0
- package/dist/src/primitives/radio.d.ts +13 -0
- package/dist/src/primitives/radio.d.ts.map +1 -0
- package/dist/src/primitives/scroll-area.d.ts +13 -0
- package/dist/src/primitives/scroll-area.d.ts.map +1 -0
- package/dist/src/primitives/select.d.ts +13 -0
- package/dist/src/primitives/select.d.ts.map +1 -0
- package/dist/src/primitives/separator.d.ts +13 -0
- package/dist/src/primitives/separator.d.ts.map +1 -0
- package/dist/src/primitives/slider.d.ts +13 -0
- package/dist/src/primitives/slider.d.ts.map +1 -0
- package/dist/src/primitives/switch.d.ts +13 -0
- package/dist/src/primitives/switch.d.ts.map +1 -0
- package/dist/src/primitives/tabs.d.ts +13 -0
- package/dist/src/primitives/tabs.d.ts.map +1 -0
- package/dist/src/primitives/toast.d.ts +13 -0
- package/dist/src/primitives/toast.d.ts.map +1 -0
- package/dist/src/primitives/toggle-group.d.ts +13 -0
- package/dist/src/primitives/toggle-group.d.ts.map +1 -0
- package/dist/src/primitives/toggle.d.ts +13 -0
- package/dist/src/primitives/toggle.d.ts.map +1 -0
- package/dist/src/primitives/toolbar.d.ts +13 -0
- package/dist/src/primitives/toolbar.d.ts.map +1 -0
- package/dist/src/primitives/tooltip.d.ts +13 -0
- package/dist/src/primitives/tooltip.d.ts.map +1 -0
- package/dist/src/registry/index.d.ts +8 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/types.d.ts +191 -0
- package/dist/src/registry/types.d.ts.map +1 -0
- package/dist/src/utils/cn.d.ts +4 -0
- package/dist/src/utils/cn.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/link-provider.d.ts +66 -0
- package/dist/src/utils/link-provider.d.ts.map +1 -0
- package/dist/src/utils/portal-provider.d.ts +56 -0
- package/dist/src/utils/portal-provider.d.ts.map +1 -0
- package/dist/src/utils/prop-examples.d.ts +36 -0
- package/dist/src/utils/prop-examples.d.ts.map +1 -0
- package/dist/src/utils/resolve-variant.d.ts +27 -0
- package/dist/src/utils/resolve-variant.d.ts.map +1 -0
- package/dist/styles/reki-binding.css +303 -0
- package/dist/styles/reki-standalone.css +2 -0
- package/dist/styles/reki.css +700 -0
- package/dist/styles/theme-fedramp.css +39 -0
- package/dist/styles/theme-reki.css +412 -0
- package/dist/utils.js +12 -0
- package/dist/utils.js.map +1 -0
- package/package.json +511 -0
- package/scripts/component-registry/cache.ts +123 -0
- package/scripts/component-registry/discovery.ts +469 -0
- package/scripts/component-registry/example-cleanup.ts +168 -0
- package/scripts/component-registry/index.test.ts +987 -0
- package/scripts/component-registry/index.ts +970 -0
- package/scripts/component-registry/markdown-generator.ts +222 -0
- package/scripts/component-registry/metadata.ts +956 -0
- package/scripts/component-registry/props-filter.ts +310 -0
- package/scripts/component-registry/schema-generator.ts +331 -0
- package/scripts/component-registry/sub-components.ts +380 -0
- package/scripts/component-registry/types.ts +158 -0
- package/scripts/component-registry/utils.ts +280 -0
- package/scripts/component-registry/variant-parser.ts +261 -0
- package/scripts/css-build.ts +105 -0
- package/scripts/generate-primitives.ts +183 -0
- package/scripts/theme-generator/config.ts +653 -0
- package/scripts/theme-generator/generate-css.test.ts +30 -0
- package/scripts/theme-generator/generate-css.ts +351 -0
- package/scripts/theme-generator/index.ts +159 -0
- package/scripts/theme-generator/migrate.ts +560 -0
- package/scripts/theme-generator/types.ts +92 -0
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for component-registry utility functions.
|
|
3
|
+
*
|
|
4
|
+
* These tests cover the pure utility functions that will be extracted
|
|
5
|
+
* into separate modules. Writing tests first ensures we don't break
|
|
6
|
+
* functionality during the refactoring.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { describe, it, expect } from "vitest";
|
|
10
|
+
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Tests for string transformation utilities
|
|
13
|
+
// =============================================================================
|
|
14
|
+
|
|
15
|
+
describe("toPascalCase", () => {
|
|
16
|
+
// Function: Convert kebab-case to PascalCase
|
|
17
|
+
// "clipboard-text" → "ClipboardText"
|
|
18
|
+
|
|
19
|
+
function toPascalCase(str: string): string {
|
|
20
|
+
return str
|
|
21
|
+
.split("-")
|
|
22
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
23
|
+
.join("");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
it("converts simple kebab-case to PascalCase", () => {
|
|
27
|
+
expect(toPascalCase("button")).toBe("Button");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("converts multi-word kebab-case to PascalCase", () => {
|
|
31
|
+
expect(toPascalCase("clipboard-text")).toBe("ClipboardText");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("converts triple-word kebab-case to PascalCase", () => {
|
|
35
|
+
expect(toPascalCase("date-range-picker")).toBe("DateRangePicker");
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("handles already-capitalized segments", () => {
|
|
39
|
+
expect(toPascalCase("page-header")).toBe("PageHeader");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("toScreamingSnakeCase", () => {
|
|
44
|
+
// Function: Convert PascalCase to SCREAMING_SNAKE_CASE
|
|
45
|
+
// "ClipboardText" → "CLIPBOARD_TEXT"
|
|
46
|
+
|
|
47
|
+
function toScreamingSnakeCase(str: string): string {
|
|
48
|
+
return str
|
|
49
|
+
.replace(/([a-z])([A-Z])/g, "$1_$2")
|
|
50
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2")
|
|
51
|
+
.toUpperCase();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
it("converts simple PascalCase to SCREAMING_SNAKE_CASE", () => {
|
|
55
|
+
expect(toScreamingSnakeCase("Button")).toBe("BUTTON");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("converts multi-word PascalCase to SCREAMING_SNAKE_CASE", () => {
|
|
59
|
+
expect(toScreamingSnakeCase("ClipboardText")).toBe("CLIPBOARD_TEXT");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("converts triple-word PascalCase to SCREAMING_SNAKE_CASE", () => {
|
|
63
|
+
expect(toScreamingSnakeCase("DateRangePicker")).toBe("DATE_RANGE_PICKER");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("handles consecutive uppercase letters", () => {
|
|
67
|
+
expect(toScreamingSnakeCase("HTMLParser")).toBe("HTML_PARSER");
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// Tests for variant parsing utilities
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
75
|
+
describe("extractBalancedBraces", () => {
|
|
76
|
+
// Function: Extract a balanced brace block starting from a position
|
|
77
|
+
|
|
78
|
+
function extractBalancedBraces(
|
|
79
|
+
content: string,
|
|
80
|
+
startIndex: number,
|
|
81
|
+
): string | null {
|
|
82
|
+
let depth = 0;
|
|
83
|
+
let start = -1;
|
|
84
|
+
|
|
85
|
+
for (let i = startIndex; i < content.length; i++) {
|
|
86
|
+
if (content[i] === "{") {
|
|
87
|
+
if (depth === 0) start = i;
|
|
88
|
+
depth++;
|
|
89
|
+
} else if (content[i] === "}") {
|
|
90
|
+
depth--;
|
|
91
|
+
if (depth === 0 && start !== -1) {
|
|
92
|
+
return content.substring(start, i + 1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
it("extracts simple object", () => {
|
|
100
|
+
const content = 'const x = { foo: "bar" };';
|
|
101
|
+
expect(extractBalancedBraces(content, 10)).toBe('{ foo: "bar" }');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("extracts nested objects", () => {
|
|
105
|
+
const content = 'const x = { foo: { bar: "baz" } };';
|
|
106
|
+
expect(extractBalancedBraces(content, 10)).toBe('{ foo: { bar: "baz" } }');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("extracts deeply nested objects", () => {
|
|
110
|
+
const content = "const x = { a: { b: { c: 1 } } };";
|
|
111
|
+
expect(extractBalancedBraces(content, 10)).toBe("{ a: { b: { c: 1 } } }");
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("returns null for unbalanced braces", () => {
|
|
115
|
+
const content = "const x = { foo:";
|
|
116
|
+
expect(extractBalancedBraces(content, 10)).toBeNull();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("starts from correct position", () => {
|
|
120
|
+
const content = "a = {}; b = { inner: true };";
|
|
121
|
+
// Start after first object
|
|
122
|
+
expect(extractBalancedBraces(content, 12)).toBe("{ inner: true }");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
describe("parseDefaultsObject", () => {
|
|
127
|
+
// Function: Parse a defaults object string into a key-value map
|
|
128
|
+
|
|
129
|
+
function parseDefaultsObject(objStr: string): Record<string, string> {
|
|
130
|
+
const result: Record<string, string> = {};
|
|
131
|
+
const propPattern = /(\w+)\s*:\s*["']([^"']*)["']/g;
|
|
132
|
+
let match: RegExpExecArray | null;
|
|
133
|
+
|
|
134
|
+
while ((match = propPattern.exec(objStr)) !== null) {
|
|
135
|
+
result[match[1]] = match[2];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
it("parses simple defaults object", () => {
|
|
142
|
+
const objStr = '{ variant: "primary", size: "base" }';
|
|
143
|
+
expect(parseDefaultsObject(objStr)).toEqual({
|
|
144
|
+
variant: "primary",
|
|
145
|
+
size: "base",
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("handles single-quoted values", () => {
|
|
150
|
+
const objStr = "{ variant: 'secondary' }";
|
|
151
|
+
expect(parseDefaultsObject(objStr)).toEqual({ variant: "secondary" });
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("handles multi-line objects", () => {
|
|
155
|
+
const objStr = `{
|
|
156
|
+
variant: "ghost",
|
|
157
|
+
size: "lg",
|
|
158
|
+
shape: "round"
|
|
159
|
+
}`;
|
|
160
|
+
expect(parseDefaultsObject(objStr)).toEqual({
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "lg",
|
|
163
|
+
shape: "round",
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("returns empty object for empty input", () => {
|
|
168
|
+
expect(parseDefaultsObject("{}")).toEqual({});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// =============================================================================
|
|
173
|
+
// Tests for state class extraction
|
|
174
|
+
// =============================================================================
|
|
175
|
+
|
|
176
|
+
describe("extractStateClasses", () => {
|
|
177
|
+
// Function: Extract state-specific classes from a class string
|
|
178
|
+
|
|
179
|
+
function extractStateClasses(classString: string): Record<string, string> {
|
|
180
|
+
const states: Record<string, string> = {};
|
|
181
|
+
const classes = classString.split(/\s+/);
|
|
182
|
+
|
|
183
|
+
for (const cls of classes) {
|
|
184
|
+
if (!cls) continue;
|
|
185
|
+
|
|
186
|
+
if (cls.startsWith("hover:") || cls.match(/^\[&:hover[^\]]*\]:/)) {
|
|
187
|
+
states.hover = states.hover ? `${states.hover} ${cls}` : cls;
|
|
188
|
+
} else if (
|
|
189
|
+
cls.match(/^(focus|focus-visible|focus-within):/) ||
|
|
190
|
+
cls.match(/^\[&:focus(-visible|-within)?[^\]]*\]:/)
|
|
191
|
+
) {
|
|
192
|
+
states.focus = states.focus ? `${states.focus} ${cls}` : cls;
|
|
193
|
+
} else if (cls.startsWith("active:")) {
|
|
194
|
+
states.active = states.active ? `${states.active} ${cls}` : cls;
|
|
195
|
+
} else if (cls.startsWith("disabled:")) {
|
|
196
|
+
states.disabled = states.disabled ? `${states.disabled} ${cls}` : cls;
|
|
197
|
+
} else if (cls.startsWith("not-disabled:")) {
|
|
198
|
+
states["not-disabled"] = states["not-disabled"]
|
|
199
|
+
? `${states["not-disabled"]} ${cls}`
|
|
200
|
+
: cls;
|
|
201
|
+
} else if (cls.match(/^data-\[state=[^\]]+\]:/)) {
|
|
202
|
+
states["data-state"] = states["data-state"]
|
|
203
|
+
? `${states["data-state"]} ${cls}`
|
|
204
|
+
: cls;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return states;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
it("extracts hover state", () => {
|
|
212
|
+
const classes = "bg-reki-brand hover:bg-primary-dark";
|
|
213
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
214
|
+
hover: "hover:bg-primary-dark",
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it("extracts focus state", () => {
|
|
219
|
+
const classes = "ring-reki-line focus:ring-reki-hairline";
|
|
220
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
221
|
+
focus: "focus:ring-reki-hairline",
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("extracts multiple states", () => {
|
|
226
|
+
const classes =
|
|
227
|
+
"bg-reki-base hover:bg-reki-elevated focus:ring-reki-hairline disabled:opacity-50";
|
|
228
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
229
|
+
hover: "hover:bg-reki-elevated",
|
|
230
|
+
focus: "focus:ring-reki-hairline",
|
|
231
|
+
disabled: "disabled:opacity-50",
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it("handles focus-visible variant", () => {
|
|
236
|
+
const classes = "focus-visible:ring-2";
|
|
237
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
238
|
+
focus: "focus-visible:ring-2",
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it("handles complex selectors", () => {
|
|
243
|
+
const classes = "[&:hover>span]:text-white";
|
|
244
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
245
|
+
hover: "[&:hover>span]:text-white",
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("returns empty object for no state classes", () => {
|
|
250
|
+
const classes = "bg-reki-base text-reki-default rounded-lg";
|
|
251
|
+
expect(extractStateClasses(classes)).toEqual({});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it("combines multiple classes of same state", () => {
|
|
255
|
+
const classes = "hover:bg-reki-brand hover:text-white";
|
|
256
|
+
expect(extractStateClasses(classes)).toEqual({
|
|
257
|
+
hover: "hover:bg-reki-brand hover:text-white",
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// =============================================================================
|
|
263
|
+
// Tests for example cleanup utilities
|
|
264
|
+
// =============================================================================
|
|
265
|
+
|
|
266
|
+
describe("cleanupExample", () => {
|
|
267
|
+
// Function: Clean up extracted examples to fix common issues
|
|
268
|
+
|
|
269
|
+
function cleanupExample(example: string): string {
|
|
270
|
+
let cleaned = example;
|
|
271
|
+
|
|
272
|
+
// Fix stringified functions: prop="() => {}" -> prop={() => {}}
|
|
273
|
+
cleaned = cleaned.replace(/(\w+)="(\(\)\s*=>\s*\{[^}]*\})"/g, "$1={$2}");
|
|
274
|
+
|
|
275
|
+
// Fix stringified arrays: prop={`[...]`} -> prop={[...]}
|
|
276
|
+
cleaned = cleaned.replace(/(\w+)=\{`(\[[\s\S]*?\])`\}/g, "$1={$2}");
|
|
277
|
+
|
|
278
|
+
// Fix escaped template literals: \` -> `
|
|
279
|
+
cleaned = cleaned.replace(/\\`/g, "`");
|
|
280
|
+
|
|
281
|
+
// Fix double backticks
|
|
282
|
+
cleaned = cleaned.replace(/\{``/g, "{`");
|
|
283
|
+
cleaned = cleaned.replace(/``\}/g, "`}");
|
|
284
|
+
|
|
285
|
+
// Fix unquoted identifiers that should be strings
|
|
286
|
+
const identifierAsStringProps = ["label"];
|
|
287
|
+
for (const prop of identifierAsStringProps) {
|
|
288
|
+
const pattern = new RegExp(
|
|
289
|
+
`(${prop})=\\{([A-Z][a-z]+)\\}(?![\\w.])`,
|
|
290
|
+
"g",
|
|
291
|
+
);
|
|
292
|
+
cleaned = cleaned.replace(pattern, '$1="$2"');
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return cleaned;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
it("fixes stringified function props", () => {
|
|
299
|
+
const example = '<Button onClick="() => {}">Click</Button>';
|
|
300
|
+
expect(cleanupExample(example)).toBe(
|
|
301
|
+
"<Button onClick={() => {}}>Click</Button>",
|
|
302
|
+
);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it("fixes stringified array props", () => {
|
|
306
|
+
const example = '<Tabs tabs={`["one", "two"]`} />';
|
|
307
|
+
expect(cleanupExample(example)).toBe('<Tabs tabs={["one", "two"]} />');
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it("fixes escaped template literals", () => {
|
|
311
|
+
const example = "<Code code={\\`const x = 1;\\`} />";
|
|
312
|
+
expect(cleanupExample(example)).toBe("<Code code={`const x = 1;`} />");
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
it("fixes unquoted label identifiers", () => {
|
|
316
|
+
const example = "<Checkbox label={Checked} />";
|
|
317
|
+
expect(cleanupExample(example)).toBe('<Checkbox label="Checked" />');
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
it("preserves already correct examples", () => {
|
|
321
|
+
const example = '<Button variant="primary">Submit</Button>';
|
|
322
|
+
expect(cleanupExample(example)).toBe(
|
|
323
|
+
'<Button variant="primary">Submit</Button>',
|
|
324
|
+
);
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
describe("shouldIncludeExample", () => {
|
|
329
|
+
// Function: Filter out problematic examples
|
|
330
|
+
|
|
331
|
+
function shouldIncludeExample(
|
|
332
|
+
example: string,
|
|
333
|
+
componentName: string,
|
|
334
|
+
): boolean {
|
|
335
|
+
const undefinedComponents = [
|
|
336
|
+
"RefreshButton",
|
|
337
|
+
"LinkButton",
|
|
338
|
+
"DefaultMenuBar",
|
|
339
|
+
"ToastTriggerButton",
|
|
340
|
+
];
|
|
341
|
+
for (const comp of undefinedComponents) {
|
|
342
|
+
if (example.includes(`<${comp}`)) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (example.trim().length < 10) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const emptyPattern = new RegExp(`^<${componentName}\\s*/>$`);
|
|
352
|
+
if (emptyPattern.test(example.trim())) {
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const undefinedVars = [
|
|
357
|
+
"args.placeholder",
|
|
358
|
+
"args.inputSide",
|
|
359
|
+
"botList",
|
|
360
|
+
"INITIAL_BOT_LIST",
|
|
361
|
+
];
|
|
362
|
+
for (const varName of undefinedVars) {
|
|
363
|
+
if (example.includes(varName)) {
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
it("rejects examples with undefined components", () => {
|
|
372
|
+
expect(shouldIncludeExample("<RefreshButton />", "Button")).toBe(false);
|
|
373
|
+
expect(shouldIncludeExample("<DefaultMenuBar />", "MenuBar")).toBe(false);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it("rejects empty examples", () => {
|
|
377
|
+
expect(shouldIncludeExample("<Button />", "Button")).toBe(false);
|
|
378
|
+
expect(shouldIncludeExample("", "Button")).toBe(false);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it("rejects examples with undefined variables", () => {
|
|
382
|
+
expect(
|
|
383
|
+
shouldIncludeExample("<Input placeholder={args.placeholder} />", "Input"),
|
|
384
|
+
).toBe(false);
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
it("accepts valid examples", () => {
|
|
388
|
+
expect(
|
|
389
|
+
shouldIncludeExample(
|
|
390
|
+
'<Button variant="primary">Submit</Button>',
|
|
391
|
+
"Button",
|
|
392
|
+
),
|
|
393
|
+
).toBe(true);
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
describe("getExampleSignature", () => {
|
|
398
|
+
// Function: Generate a signature for an example to detect near-duplicates
|
|
399
|
+
|
|
400
|
+
function getExampleSignature(example: string): string {
|
|
401
|
+
const propPattern = /(\w+)=["'{]/g;
|
|
402
|
+
const props: string[] = [];
|
|
403
|
+
let match: RegExpExecArray | null;
|
|
404
|
+
while ((match = propPattern.exec(example)) !== null) {
|
|
405
|
+
props.push(match[1]);
|
|
406
|
+
}
|
|
407
|
+
return props.sort().join(",");
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
it("extracts prop names as signature", () => {
|
|
411
|
+
expect(getExampleSignature('<Button variant="primary" size="lg" />')).toBe(
|
|
412
|
+
"size,variant",
|
|
413
|
+
);
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
it("handles single prop", () => {
|
|
417
|
+
expect(getExampleSignature('<Button variant="primary" />')).toBe("variant");
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
it("handles JSX expression props", () => {
|
|
421
|
+
expect(getExampleSignature("<Button onClick={() => {}} />")).toBe(
|
|
422
|
+
"onClick",
|
|
423
|
+
);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it("returns empty string for no props", () => {
|
|
427
|
+
expect(getExampleSignature("<Button>Click</Button>")).toBe("");
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// =============================================================================
|
|
432
|
+
// Tests for props filtering utilities
|
|
433
|
+
// =============================================================================
|
|
434
|
+
|
|
435
|
+
describe("shouldSkipProp", () => {
|
|
436
|
+
// Constants used by the filter
|
|
437
|
+
const ALWAYS_SKIP_PROPS = new Set([
|
|
438
|
+
"key",
|
|
439
|
+
"ref",
|
|
440
|
+
"style",
|
|
441
|
+
"dangerouslySetInnerHTML",
|
|
442
|
+
]);
|
|
443
|
+
|
|
444
|
+
const SKIP_PROP_PREFIXES = ["aria-", "data-", "on"];
|
|
445
|
+
|
|
446
|
+
const KEEP_PROPS = new Set([
|
|
447
|
+
"children",
|
|
448
|
+
"className",
|
|
449
|
+
"id",
|
|
450
|
+
"disabled",
|
|
451
|
+
"name",
|
|
452
|
+
"value",
|
|
453
|
+
"checked",
|
|
454
|
+
"required",
|
|
455
|
+
"placeholder",
|
|
456
|
+
"readOnly",
|
|
457
|
+
"type",
|
|
458
|
+
"size",
|
|
459
|
+
"title",
|
|
460
|
+
"label",
|
|
461
|
+
"href",
|
|
462
|
+
"lang",
|
|
463
|
+
"onClick",
|
|
464
|
+
"onChange",
|
|
465
|
+
"onSubmit",
|
|
466
|
+
]);
|
|
467
|
+
|
|
468
|
+
const MINIMAL_SKIP_PROPS = new Set([
|
|
469
|
+
"accessKey",
|
|
470
|
+
"autoCapitalize",
|
|
471
|
+
"autoFocus",
|
|
472
|
+
"contentEditable",
|
|
473
|
+
"dir",
|
|
474
|
+
"draggable",
|
|
475
|
+
"hidden",
|
|
476
|
+
"spellCheck",
|
|
477
|
+
"tabIndex",
|
|
478
|
+
"translate",
|
|
479
|
+
]);
|
|
480
|
+
|
|
481
|
+
function shouldSkipProp(propName: string): boolean {
|
|
482
|
+
if (KEEP_PROPS.has(propName)) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
if (ALWAYS_SKIP_PROPS.has(propName)) {
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
for (const prefix of SKIP_PROP_PREFIXES) {
|
|
489
|
+
if (propName.startsWith(prefix)) {
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (MINIMAL_SKIP_PROPS.has(propName)) {
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
it("keeps important props like children and className", () => {
|
|
500
|
+
expect(shouldSkipProp("children")).toBe(false);
|
|
501
|
+
expect(shouldSkipProp("className")).toBe(false);
|
|
502
|
+
expect(shouldSkipProp("disabled")).toBe(false);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("keeps common event handlers", () => {
|
|
506
|
+
expect(shouldSkipProp("onClick")).toBe(false);
|
|
507
|
+
expect(shouldSkipProp("onChange")).toBe(false);
|
|
508
|
+
expect(shouldSkipProp("onSubmit")).toBe(false);
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
it("skips React internal props", () => {
|
|
512
|
+
expect(shouldSkipProp("key")).toBe(true);
|
|
513
|
+
expect(shouldSkipProp("ref")).toBe(true);
|
|
514
|
+
expect(shouldSkipProp("style")).toBe(true);
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
it("skips aria attributes", () => {
|
|
518
|
+
expect(shouldSkipProp("aria-label")).toBe(true);
|
|
519
|
+
expect(shouldSkipProp("aria-hidden")).toBe(true);
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
it("skips data attributes", () => {
|
|
523
|
+
expect(shouldSkipProp("data-testid")).toBe(true);
|
|
524
|
+
expect(shouldSkipProp("data-state")).toBe(true);
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
it("skips most event handlers except kept ones", () => {
|
|
528
|
+
expect(shouldSkipProp("onMouseDown")).toBe(true);
|
|
529
|
+
expect(shouldSkipProp("onKeyUp")).toBe(true);
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
it("skips common HTML attributes", () => {
|
|
533
|
+
expect(shouldSkipProp("accessKey")).toBe(true);
|
|
534
|
+
expect(shouldSkipProp("tabIndex")).toBe(true);
|
|
535
|
+
expect(shouldSkipProp("spellCheck")).toBe(true);
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
// =============================================================================
|
|
540
|
+
// Tests for path detection utilities
|
|
541
|
+
// =============================================================================
|
|
542
|
+
|
|
543
|
+
describe("getComponentNameFromPath", () => {
|
|
544
|
+
// Function: Extract component name from file path
|
|
545
|
+
|
|
546
|
+
function getComponentNameFromPath(filename: string): string | null {
|
|
547
|
+
const match = filename.match(/src\/components\/([^/]+)\/\1\.tsx$/);
|
|
548
|
+
if (!match) return null;
|
|
549
|
+
return match[1].toUpperCase().replace(/-/g, "_");
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
it("extracts component name from standard path", () => {
|
|
553
|
+
expect(getComponentNameFromPath("src/components/button/button.tsx")).toBe(
|
|
554
|
+
"BUTTON",
|
|
555
|
+
);
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
it("handles kebab-case component names", () => {
|
|
559
|
+
expect(
|
|
560
|
+
getComponentNameFromPath(
|
|
561
|
+
"src/components/clipboard-text/clipboard-text.tsx",
|
|
562
|
+
),
|
|
563
|
+
).toBe("CLIPBOARD_TEXT");
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
it("returns null for non-component files", () => {
|
|
567
|
+
expect(getComponentNameFromPath("src/utils/cn.ts")).toBeNull();
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
it("returns null for mismatched directory/file names", () => {
|
|
571
|
+
expect(
|
|
572
|
+
getComponentNameFromPath("src/components/button/types.tsx"),
|
|
573
|
+
).toBeNull();
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
it("returns null for test files", () => {
|
|
577
|
+
expect(
|
|
578
|
+
getComponentNameFromPath("src/components/button/button.test.tsx"),
|
|
579
|
+
).toBeNull();
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// =============================================================================
|
|
584
|
+
// Tests for JSON Schema type conversion
|
|
585
|
+
// =============================================================================
|
|
586
|
+
|
|
587
|
+
describe("jsonSchemaTypeToString", () => {
|
|
588
|
+
// Function: Convert JSON Schema type to string representation
|
|
589
|
+
|
|
590
|
+
interface Definition {
|
|
591
|
+
$ref?: string;
|
|
592
|
+
enum?: unknown[];
|
|
593
|
+
type?: string | string[];
|
|
594
|
+
items?: Definition;
|
|
595
|
+
anyOf?: Definition[];
|
|
596
|
+
oneOf?: Definition[];
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
function jsonSchemaTypeToString(def: Definition): string {
|
|
600
|
+
if (def.$ref) {
|
|
601
|
+
const refName = decodeURIComponent(
|
|
602
|
+
def.$ref.split("/").pop() || "unknown",
|
|
603
|
+
);
|
|
604
|
+
if (refName.includes("ReactNode") || refName.includes("ReactElement")) {
|
|
605
|
+
return "ReactNode";
|
|
606
|
+
}
|
|
607
|
+
return refName;
|
|
608
|
+
}
|
|
609
|
+
if (def.enum) {
|
|
610
|
+
return "enum";
|
|
611
|
+
}
|
|
612
|
+
if (def.type === "array") {
|
|
613
|
+
const itemType = def.items
|
|
614
|
+
? jsonSchemaTypeToString(def.items)
|
|
615
|
+
: "unknown";
|
|
616
|
+
return `${itemType}[]`;
|
|
617
|
+
}
|
|
618
|
+
if (def.anyOf || def.oneOf) {
|
|
619
|
+
const types = (def.anyOf || def.oneOf) as Definition[];
|
|
620
|
+
const typeStrings = types
|
|
621
|
+
.map((t) => jsonSchemaTypeToString(t))
|
|
622
|
+
.filter((t) => t !== "undefined" && t !== "null");
|
|
623
|
+
if (typeStrings.some((t) => t.includes("React"))) {
|
|
624
|
+
return "ReactNode";
|
|
625
|
+
}
|
|
626
|
+
return typeStrings.join(" | ");
|
|
627
|
+
}
|
|
628
|
+
if (def.type) {
|
|
629
|
+
return Array.isArray(def.type) ? def.type.join(" | ") : def.type;
|
|
630
|
+
}
|
|
631
|
+
return "unknown";
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
it("converts basic types", () => {
|
|
635
|
+
expect(jsonSchemaTypeToString({ type: "string" })).toBe("string");
|
|
636
|
+
expect(jsonSchemaTypeToString({ type: "number" })).toBe("number");
|
|
637
|
+
expect(jsonSchemaTypeToString({ type: "boolean" })).toBe("boolean");
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
it("converts array types", () => {
|
|
641
|
+
expect(
|
|
642
|
+
jsonSchemaTypeToString({ type: "array", items: { type: "string" } }),
|
|
643
|
+
).toBe("string[]");
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
it("converts $ref to type name", () => {
|
|
647
|
+
expect(
|
|
648
|
+
jsonSchemaTypeToString({ $ref: "#/definitions/ButtonVariant" }),
|
|
649
|
+
).toBe("ButtonVariant");
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
it("simplifies ReactNode references", () => {
|
|
653
|
+
expect(jsonSchemaTypeToString({ $ref: "#/definitions/ReactNode" })).toBe(
|
|
654
|
+
"ReactNode",
|
|
655
|
+
);
|
|
656
|
+
expect(jsonSchemaTypeToString({ $ref: "#/definitions/ReactElement" })).toBe(
|
|
657
|
+
"ReactNode",
|
|
658
|
+
);
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
it("converts enums", () => {
|
|
662
|
+
expect(jsonSchemaTypeToString({ enum: ["primary", "secondary"] })).toBe(
|
|
663
|
+
"enum",
|
|
664
|
+
);
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
it("converts union types", () => {
|
|
668
|
+
expect(
|
|
669
|
+
jsonSchemaTypeToString({
|
|
670
|
+
anyOf: [{ type: "string" }, { type: "number" }],
|
|
671
|
+
}),
|
|
672
|
+
).toBe("string | number");
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
it("handles multiple types", () => {
|
|
676
|
+
expect(jsonSchemaTypeToString({ type: ["string", "null"] })).toBe(
|
|
677
|
+
"string | null",
|
|
678
|
+
);
|
|
679
|
+
});
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// Tests for sub-component detection utilities
|
|
683
|
+
|
|
684
|
+
import { writeFileSync, unlinkSync, mkdtempSync } from "node:fs";
|
|
685
|
+
import { join } from "node:path";
|
|
686
|
+
import { tmpdir } from "node:os";
|
|
687
|
+
import {
|
|
688
|
+
detectSubComponents,
|
|
689
|
+
extractSubComponentProps,
|
|
690
|
+
extractPropsFromInterface,
|
|
691
|
+
} from "./sub-components.js";
|
|
692
|
+
|
|
693
|
+
function writeTempFile(content: string): {
|
|
694
|
+
filePath: string;
|
|
695
|
+
cleanup: () => void;
|
|
696
|
+
} {
|
|
697
|
+
const dir = mkdtempSync(join(tmpdir(), "reki-test-"));
|
|
698
|
+
const filePath = join(dir, "test.tsx");
|
|
699
|
+
writeFileSync(filePath, content);
|
|
700
|
+
return { filePath, cleanup: () => unlinkSync(filePath) };
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
const cliFlags = {
|
|
704
|
+
includeInheritedProps: false,
|
|
705
|
+
noCache: true,
|
|
706
|
+
verbose: false,
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
describe("detectSubComponents", () => {
|
|
710
|
+
it("detects sub-components from Object.assign with function declarations", () => {
|
|
711
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
712
|
+
function GroupComponent({ legend, children }: GroupProps) {
|
|
713
|
+
return <div>{children}</div>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const Root = () => <div />;
|
|
717
|
+
|
|
718
|
+
export const MyComponent = Object.assign(Root, {
|
|
719
|
+
Group: GroupComponent,
|
|
720
|
+
});
|
|
721
|
+
`);
|
|
722
|
+
|
|
723
|
+
try {
|
|
724
|
+
const result = detectSubComponents(filePath);
|
|
725
|
+
expect(result).toHaveLength(1);
|
|
726
|
+
expect(result[0].name).toBe("Group");
|
|
727
|
+
expect(result[0].valueName).toBe("GroupComponent");
|
|
728
|
+
expect(result[0].propsType).toBe("GroupProps");
|
|
729
|
+
} finally {
|
|
730
|
+
cleanup();
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
it("detects sub-components from Object.assign with multi-line forwardRef", () => {
|
|
735
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
736
|
+
import { forwardRef } from "react";
|
|
737
|
+
|
|
738
|
+
export interface MyItemProps {
|
|
739
|
+
active?: boolean;
|
|
740
|
+
label: string;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
const MyItem = forwardRef<
|
|
744
|
+
HTMLLIElement,
|
|
745
|
+
MyItemProps
|
|
746
|
+
>(({ active, label, ...props }, ref) => (
|
|
747
|
+
<li ref={ref} {...props}>{label}</li>
|
|
748
|
+
));
|
|
749
|
+
|
|
750
|
+
const Root = forwardRef<HTMLElement, {}>(
|
|
751
|
+
(props, ref) => <nav ref={ref} {...props} />
|
|
752
|
+
);
|
|
753
|
+
|
|
754
|
+
export const MyComponent = Object.assign(Root, {
|
|
755
|
+
Item: MyItem,
|
|
756
|
+
});
|
|
757
|
+
`);
|
|
758
|
+
|
|
759
|
+
try {
|
|
760
|
+
const result = detectSubComponents(filePath);
|
|
761
|
+
expect(result).toHaveLength(1);
|
|
762
|
+
expect(result[0].name).toBe("Item");
|
|
763
|
+
expect(result[0].valueName).toBe("MyItem");
|
|
764
|
+
expect(result[0].propsType).toBe("MyItemProps");
|
|
765
|
+
} finally {
|
|
766
|
+
cleanup();
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
it("detects sub-components with single-line forwardRef generics", () => {
|
|
771
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
772
|
+
import { forwardRef } from "react";
|
|
773
|
+
|
|
774
|
+
export interface CellProps { span?: number; }
|
|
775
|
+
|
|
776
|
+
const TableCell = forwardRef<HTMLTableCellElement, CellProps>((props, ref) => (
|
|
777
|
+
<td ref={ref} {...props} />
|
|
778
|
+
));
|
|
779
|
+
|
|
780
|
+
const Root = forwardRef<HTMLTableElement, {}>((props, ref) => <table ref={ref} {...props} />);
|
|
781
|
+
|
|
782
|
+
export const Table = Object.assign(Root, {
|
|
783
|
+
Cell: TableCell,
|
|
784
|
+
});
|
|
785
|
+
`);
|
|
786
|
+
|
|
787
|
+
try {
|
|
788
|
+
const result = detectSubComponents(filePath);
|
|
789
|
+
expect(result).toHaveLength(1);
|
|
790
|
+
expect(result[0].name).toBe("Cell");
|
|
791
|
+
expect(result[0].valueName).toBe("TableCell");
|
|
792
|
+
expect(result[0].propsType).toBe("CellProps");
|
|
793
|
+
} finally {
|
|
794
|
+
cleanup();
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
it("populates valueName field for direct property assignment", () => {
|
|
799
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
800
|
+
function Link({ href }: LinkProps) {
|
|
801
|
+
return <a href={href} />;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const Breadcrumbs = () => <nav />;
|
|
805
|
+
Breadcrumbs.Link = Link;
|
|
806
|
+
`);
|
|
807
|
+
|
|
808
|
+
try {
|
|
809
|
+
const result = detectSubComponents(filePath);
|
|
810
|
+
expect(result).toHaveLength(1);
|
|
811
|
+
expect(result[0].name).toBe("Link");
|
|
812
|
+
expect(result[0].valueName).toBe("Link");
|
|
813
|
+
} finally {
|
|
814
|
+
cleanup();
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
describe("extractSubComponentProps", () => {
|
|
820
|
+
it("extracts props from interface via propsType (forwardRef pattern)", () => {
|
|
821
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
822
|
+
import { forwardRef } from "react";
|
|
823
|
+
|
|
824
|
+
export interface ItemProps {
|
|
825
|
+
active?: boolean;
|
|
826
|
+
label: string;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
const MyItem = forwardRef<HTMLLIElement, ItemProps>(
|
|
830
|
+
({ active, label, ...props }, ref) => <li ref={ref} {...props}>{label}</li>
|
|
831
|
+
);
|
|
832
|
+
`);
|
|
833
|
+
|
|
834
|
+
try {
|
|
835
|
+
const props = extractSubComponentProps(
|
|
836
|
+
filePath,
|
|
837
|
+
{
|
|
838
|
+
name: "Item",
|
|
839
|
+
valueName: "MyItem",
|
|
840
|
+
propsType: "ItemProps",
|
|
841
|
+
description: "Item sub-component",
|
|
842
|
+
isPassThrough: false,
|
|
843
|
+
},
|
|
844
|
+
cliFlags,
|
|
845
|
+
);
|
|
846
|
+
|
|
847
|
+
expect(props).toHaveProperty("active");
|
|
848
|
+
expect(props.active).toEqual({ type: "boolean", optional: true });
|
|
849
|
+
expect(props).toHaveProperty("label");
|
|
850
|
+
expect(props.label).toEqual({ type: "string", required: true });
|
|
851
|
+
} finally {
|
|
852
|
+
cleanup();
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
it("skips pass-through sub-components", () => {
|
|
857
|
+
const { filePath, cleanup } = writeTempFile("export const Foo = {};");
|
|
858
|
+
|
|
859
|
+
try {
|
|
860
|
+
const props = extractSubComponentProps(
|
|
861
|
+
filePath,
|
|
862
|
+
{
|
|
863
|
+
name: "Root",
|
|
864
|
+
valueName: "DialogBase.Root",
|
|
865
|
+
propsType: null,
|
|
866
|
+
description: "Root sub-component (wraps DialogBase)",
|
|
867
|
+
isPassThrough: true,
|
|
868
|
+
baseComponent: "DialogBase.Root",
|
|
869
|
+
},
|
|
870
|
+
cliFlags,
|
|
871
|
+
);
|
|
872
|
+
|
|
873
|
+
expect(props).toEqual({});
|
|
874
|
+
} finally {
|
|
875
|
+
cleanup();
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
it("uses valueName for inline props lookup when name doesn't match", () => {
|
|
880
|
+
const { filePath, cleanup } = writeTempFile(`
|
|
881
|
+
function TableOfContentsGroup({ label, href }: { label: string; href?: string }) {
|
|
882
|
+
return <div>{label}</div>;
|
|
883
|
+
}
|
|
884
|
+
`);
|
|
885
|
+
|
|
886
|
+
try {
|
|
887
|
+
const props = extractSubComponentProps(
|
|
888
|
+
filePath,
|
|
889
|
+
{
|
|
890
|
+
name: "Group",
|
|
891
|
+
valueName: "TableOfContentsGroup",
|
|
892
|
+
propsType: null,
|
|
893
|
+
description: "Group sub-component",
|
|
894
|
+
isPassThrough: false,
|
|
895
|
+
},
|
|
896
|
+
cliFlags,
|
|
897
|
+
);
|
|
898
|
+
|
|
899
|
+
expect(props).toHaveProperty("label");
|
|
900
|
+
expect(props.label).toEqual({ type: "string", required: true });
|
|
901
|
+
expect(props).toHaveProperty("href");
|
|
902
|
+
expect(props.href).toEqual({ type: "string", optional: true });
|
|
903
|
+
} finally {
|
|
904
|
+
cleanup();
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
describe("extractPropsFromInterface", () => {
|
|
910
|
+
it("extracts props from a simple interface", () => {
|
|
911
|
+
const content = `
|
|
912
|
+
interface MyProps {
|
|
913
|
+
label: string;
|
|
914
|
+
active?: boolean;
|
|
915
|
+
count: number;
|
|
916
|
+
}
|
|
917
|
+
`;
|
|
918
|
+
const props = extractPropsFromInterface(content, "MyProps", cliFlags);
|
|
919
|
+
expect(props).toEqual({
|
|
920
|
+
label: { type: "string", required: true },
|
|
921
|
+
active: { type: "boolean", optional: true },
|
|
922
|
+
count: { type: "number", required: true },
|
|
923
|
+
});
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
it("extracts props from interface with extends", () => {
|
|
927
|
+
const content = `
|
|
928
|
+
interface GroupProps extends BaseProps {
|
|
929
|
+
label: string;
|
|
930
|
+
href?: string;
|
|
931
|
+
}
|
|
932
|
+
`;
|
|
933
|
+
const props = extractPropsFromInterface(content, "GroupProps", cliFlags);
|
|
934
|
+
expect(props).toEqual({
|
|
935
|
+
label: { type: "string", required: true },
|
|
936
|
+
href: { type: "string", optional: true },
|
|
937
|
+
});
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
it("returns empty object when interface not found", () => {
|
|
941
|
+
const content = "interface OtherProps { foo: string; }";
|
|
942
|
+
const props = extractPropsFromInterface(content, "MyProps", cliFlags);
|
|
943
|
+
expect(props).toEqual({});
|
|
944
|
+
});
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
describe("SUB_COMPONENT_OVERRIDES", () => {
|
|
948
|
+
it("declares a Tooltip.Provider entry that passes through to TooltipBase.Provider", async () => {
|
|
949
|
+
const { SUB_COMPONENT_OVERRIDES, PASSTHROUGH_COMPONENT_DOCS } =
|
|
950
|
+
await import("./metadata.js");
|
|
951
|
+
|
|
952
|
+
expect(SUB_COMPONENT_OVERRIDES.Tooltip).toBeDefined();
|
|
953
|
+
const tooltipOverrides = SUB_COMPONENT_OVERRIDES.Tooltip;
|
|
954
|
+
expect(tooltipOverrides).toHaveLength(1);
|
|
955
|
+
|
|
956
|
+
const provider = tooltipOverrides[0];
|
|
957
|
+
expect(provider.name).toBe("Provider");
|
|
958
|
+
expect(provider.valueName).toBe("TooltipProvider");
|
|
959
|
+
expect(provider.isPassThrough).toBe(true);
|
|
960
|
+
expect(provider.baseComponent).toBe("TooltipBase.Provider");
|
|
961
|
+
expect(provider.propsType).toBeNull();
|
|
962
|
+
|
|
963
|
+
// The baseComponent must resolve to a documented passthrough entry so the
|
|
964
|
+
// merge + lookup path in index.ts produces real docs, not an empty stub.
|
|
965
|
+
expect(
|
|
966
|
+
PASSTHROUGH_COMPONENT_DOCS[provider.baseComponent as string],
|
|
967
|
+
).toBeDefined();
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
it("entries have the same shape as detectSubComponents() results", async () => {
|
|
971
|
+
const { SUB_COMPONENT_OVERRIDES } = await import("./metadata.js");
|
|
972
|
+
|
|
973
|
+
for (const overrides of Object.values(SUB_COMPONENT_OVERRIDES)) {
|
|
974
|
+
for (const entry of overrides) {
|
|
975
|
+
// Required fields of SubComponentConfig.
|
|
976
|
+
expect(typeof entry.name).toBe("string");
|
|
977
|
+
expect(typeof entry.valueName).toBe("string");
|
|
978
|
+
expect(typeof entry.description).toBe("string");
|
|
979
|
+
expect(typeof entry.isPassThrough).toBe("boolean");
|
|
980
|
+
// propsType may be a string or null.
|
|
981
|
+
expect(
|
|
982
|
+
entry.propsType === null || typeof entry.propsType === "string",
|
|
983
|
+
).toBe(true);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
});
|