react-kui 2.0.0 → 3.0.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/AI.en-US.md +23 -0
- package/AI.md +76 -0
- package/LICENSE +21 -21
- package/README.zh-CN.md +142 -0
- package/ai/behaviors.json +16 -0
- package/ai/cli.mjs +27 -0
- package/ai/evals/README.md +59 -0
- package/ai/evals/cases.json +207 -0
- package/ai/evals/config.json +4 -0
- package/ai/evals/evaluate.mjs +267 -0
- package/ai/evals/run.mjs +118 -0
- package/ai/kui-components.json +58292 -0
- package/ai/kui-components.schema.json +143 -0
- package/ai/mcp.mjs +290 -0
- package/ai/skills/react-kui/SKILL.md +16 -0
- package/ai/skills/react-kui/references/components.md +9 -0
- package/ai/skills/react-kui/references/mcp.md +14 -0
- package/ai/templates/form.tsx +69 -0
- package/ai/templates/index.json +23 -0
- package/ai/templates/modal-editor.tsx +80 -0
- package/ai/templates/table.tsx +85 -0
- package/ai/validate.d.mts +16 -0
- package/ai/validate.mjs +184 -0
- package/es/_virtual/_rolldown/runtime.js +21 -0
- package/es/affix/index.js +222 -0
- package/es/alert/index.js +71 -0
- package/es/anchor/anchor-context.js +13 -0
- package/es/anchor/anchor-link.js +121 -0
- package/es/anchor/anchor.js +431 -0
- package/es/auto-complete/index.js +692 -0
- package/es/avatar/avatar-group-context.js +13 -0
- package/es/avatar/avatar-group.js +145 -0
- package/es/avatar/avatar.js +204 -0
- package/es/back-top/index.js +224 -0
- package/es/badge/index.js +66 -0
- package/es/base/teleport.js +83 -0
- package/es/base/transition-props.js +56 -0
- package/es/base/transition.js +108 -0
- package/es/breadcrumb/breadcrumb-context.js +13 -0
- package/es/breadcrumb/breadcrumb-item.js +128 -0
- package/es/breadcrumb/breadcrumb.js +75 -0
- package/es/button/button-group-context.js +13 -0
- package/es/button/button-group.js +100 -0
- package/es/button/button.js +99 -0
- package/es/calendar/index.js +271 -0
- package/es/card/index.js +157 -0
- package/es/carousel/carousel-context.js +17 -0
- package/es/carousel/carousel-item.js +71 -0
- package/es/carousel/carousel.js +453 -0
- package/es/cascader/index.js +435 -0
- package/es/check-card/check-card-group.js +211 -0
- package/es/check-card/check-card.js +326 -0
- package/es/check-card/context.js +13 -0
- package/es/checkbox/checkbox-group-context.js +13 -0
- package/es/checkbox/checkbox-group.js +168 -0
- package/es/checkbox/checkbox.js +270 -0
- package/es/checkbox/index.js +14 -0
- package/es/collapse/collapse-panel.js +233 -0
- package/es/collapse/collapse.js +186 -0
- package/es/color-picker/alpha.js +131 -0
- package/es/color-picker/hue.js +111 -0
- package/es/color-picker/index.js +329 -0
- package/es/color-picker/mode.js +178 -0
- package/es/color-picker/paint.js +175 -0
- package/es/color-picker/presets.js +80 -0
- package/es/components.js +260 -0
- package/es/config/config-context.js +13 -0
- package/es/config/context.js +26 -0
- package/es/config/index.js +52 -0
- package/es/config/size-context.js +13 -0
- package/es/config/use-config-appearance.js +39 -0
- package/es/const/var.js +31 -0
- package/es/date-picker/index.js +1257 -0
- package/es/descriptions/descriptions-item.js +25 -0
- package/es/descriptions/descriptions.js +285 -0
- package/es/divider/index.js +38 -0
- package/es/drawer/index.js +432 -0
- package/es/dropdown/dropdown-button.js +139 -0
- package/es/dropdown/dropdown-context.js +16 -0
- package/es/dropdown/dropdown.js +351 -0
- package/es/dropdown/trigger.js +88 -0
- package/es/empty/index.js +133 -0
- package/es/feature-card/index.js +74 -0
- package/es/feedback-panel/index.js +179 -0
- package/es/flame-wrap/index.js +262 -0
- package/es/flame-wrap/types.js +593 -0
- package/es/flex/index.js +46 -0
- package/es/form/field-context.js +102 -0
- package/es/form/form-context.js +13 -0
- package/es/form/form-item.js +327 -0
- package/es/form/form.js +303 -0
- package/es/form/utils.js +44 -0
- package/es/grid/grid-item.js +130 -0
- package/es/grid/grid.js +177 -0
- package/es/grid/useBreakpoint.js +64 -0
- package/es/icon/index.js +161 -0
- package/es/image/group.js +121 -0
- package/es/image/image-group-context.js +13 -0
- package/es/image/image.js +314 -0
- package/es/image/instance.js +47 -0
- package/es/image/preview.js +383 -0
- package/es/image/utils.js +39 -0
- package/es/index.js +129 -0
- package/es/input/index.js +15 -0
- package/es/input/input-box.js +40 -0
- package/es/input/input-group.js +150 -0
- package/es/input/input.js +203 -0
- package/es/input/textarea.js +135 -0
- package/es/input-number/index.js +153 -0
- package/es/input-otp/index.js +142 -0
- package/es/input-tag/index.js +178 -0
- package/es/kanban/index.js +254 -0
- package/es/layout/index.js +256 -0
- package/es/layout/layout-context.js +13 -0
- package/es/list-panel/index.js +194 -0
- package/es/loading/index.js +69 -0
- package/es/loading/loading-bar.js +133 -0
- package/es/locale/de.js +69 -0
- package/es/locale/el.js +69 -0
- package/es/locale/en.js +69 -0
- package/es/locale/fr.js +69 -0
- package/es/locale/it.js +69 -0
- package/es/locale/ja.js +69 -0
- package/es/locale/ko.js +69 -0
- package/es/locale/ru.js +69 -0
- package/es/locale/th.js +69 -0
- package/es/locale/uk.js +69 -0
- package/es/locale/vi.js +69 -0
- package/es/locale/zh-CN.js +69 -0
- package/es/locale/zh-TW.js +69 -0
- package/es/mentions/index.js +710 -0
- package/es/menu/menu-context.js +20 -0
- package/es/menu/menu-divider.js +29 -0
- package/es/menu/menu-group.js +49 -0
- package/es/menu/menu-item.js +79 -0
- package/es/menu/menu-keyboard.js +35 -0
- package/es/menu/menu.js +484 -0
- package/es/menu/recursive-menu.js +68 -0
- package/es/menu/sub-menu.js +256 -0
- package/es/message/index.js +67 -0
- package/es/modal/api.js +62 -0
- package/es/modal/modal.js +589 -0
- package/es/modal/toast.js +99 -0
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +189 -0
- package/es/notice/container.js +123 -0
- package/es/notice/content.js +92 -0
- package/es/notice/index.js +52 -0
- package/es/notice/instance.js +65 -0
- package/es/page/index.js +275 -0
- package/es/page-header/index.js +134 -0
- package/es/popconfirm/index.js +275 -0
- package/es/poptip/index.js +270 -0
- package/es/progress/index.js +253 -0
- package/es/qrcode/index.js +204 -0
- package/es/radio/radio-button.js +158 -0
- package/es/radio/radio-group-context.js +13 -0
- package/es/radio/radio-group.js +264 -0
- package/es/radio/radio.js +232 -0
- package/es/rate/index.js +253 -0
- package/es/rate/star.js +150 -0
- package/es/result/index.js +147 -0
- package/es/ripple/index.js +245 -0
- package/es/ripple/types.js +433 -0
- package/es/row-col/col.js +163 -0
- package/es/row-col/row.js +37 -0
- package/es/segmented/index.js +240 -0
- package/es/select/option.js +124 -0
- package/es/select/select.js +655 -0
- package/es/skeleton/skeleton-avatar.js +44 -0
- package/es/skeleton/skeleton-button.js +43 -0
- package/es/skeleton/skeleton-image.js +131 -0
- package/es/skeleton/skeleton-text.js +113 -0
- package/es/skeleton/skeleton.js +148 -0
- package/es/skeleton/use-skeleton-loading.js +53 -0
- package/es/slider/index.js +484 -0
- package/es/slider/thumb.js +158 -0
- package/es/space/index.js +94 -0
- package/es/spin/index.js +61 -0
- package/es/splitter/splitter-panel.js +50 -0
- package/es/splitter/splitter.js +310 -0
- package/es/stat-card/countup.js +157 -0
- package/es/stat-card/stat-card.js +63 -0
- package/es/stat-card/stat-number.js +125 -0
- package/es/stat-card/utils/countup.js +291 -0
- package/es/stat-card/utils/odometer.js +129 -0
- package/es/steps/index.js +139 -0
- package/es/switch/index.js +72 -0
- package/es/table/column-setting.js +179 -0
- package/es/table/index.js +506 -0
- package/es/table/utils.js +34 -0
- package/es/tabs/tab-panel.js +86 -0
- package/es/tabs/tabs.js +263 -0
- package/es/tag/index.js +74 -0
- package/es/time-line/timeline-item.js +133 -0
- package/es/time-line/timeline.js +55 -0
- package/es/tooltip/index.js +278 -0
- package/es/tour/index.js +379 -0
- package/es/transfer/index.js +511 -0
- package/es/tree/index.js +488 -0
- package/es/tree/utils.js +101 -0
- package/es/tree-select/index.js +938 -0
- package/es/typography/index.js +359 -0
- package/es/upload/file-list.js +143 -0
- package/es/upload/index.js +434 -0
- package/es/upload/picture-sort.js +142 -0
- package/es/upload/selector.js +207 -0
- package/es/utils/checked.js +24 -0
- package/es/utils/color.js +15 -0
- package/es/utils/number.js +74 -0
- package/es/utils/placement.js +151 -0
- package/es/utils/react-node.js +63 -0
- package/es/utils/share.js +12 -0
- package/es/utils/theme.js +57 -0
- package/es/utils/transition.js +58 -0
- package/es/utils/use-value.js +60 -0
- package/es/virtual-list/index.js +252 -0
- package/es/virtual-list/range.js +27 -0
- package/es/watermark/index.js +313 -0
- package/lib/index.cjs +9 -0
- package/lib/locale/de.cjs +9 -0
- package/lib/locale/el.cjs +9 -0
- package/lib/locale/en.cjs +9 -0
- package/lib/locale/fr.cjs +9 -0
- package/lib/locale/it.cjs +9 -0
- package/lib/locale/ja.cjs +9 -0
- package/lib/locale/ko.cjs +9 -0
- package/lib/locale/ru.cjs +9 -0
- package/lib/locale/th.cjs +9 -0
- package/lib/locale/uk.cjs +9 -0
- package/lib/locale/vi.cjs +9 -0
- package/lib/locale/zh-CN.cjs +9 -0
- package/lib/locale/zh-TW.cjs +9 -0
- package/package.json +175 -94
- package/readme.md +142 -82
- package/style/base.css +9 -0
- package/style/components.css +9 -0
- package/style/index.css +9 -0
- package/style/theme.css +9 -0
- package/types/affix/index.d.cts +9 -0
- package/types/affix/index.d.ts +9 -0
- package/types/alert/index.d.cts +18 -0
- package/types/alert/index.d.ts +18 -0
- package/types/anchor/anchor-context.d.cts +7 -0
- package/types/anchor/anchor-context.d.ts +7 -0
- package/types/anchor/anchor-link.d.cts +6 -0
- package/types/anchor/anchor-link.d.ts +6 -0
- package/types/anchor/anchor.d.cts +10 -0
- package/types/anchor/anchor.d.ts +10 -0
- package/types/anchor/index.d.cts +5 -0
- package/types/anchor/index.d.ts +5 -0
- package/types/auto-complete/index.d.cts +28 -0
- package/types/auto-complete/index.d.ts +28 -0
- package/types/avatar/avatar-group-context.d.cts +7 -0
- package/types/avatar/avatar-group-context.d.ts +7 -0
- package/types/avatar/avatar-group.d.cts +11 -0
- package/types/avatar/avatar-group.d.ts +11 -0
- package/types/avatar/avatar.d.cts +14 -0
- package/types/avatar/avatar.d.ts +14 -0
- package/types/avatar/index.d.cts +5 -0
- package/types/avatar/index.d.ts +5 -0
- package/types/back-top/index.d.cts +11 -0
- package/types/back-top/index.d.ts +11 -0
- package/types/badge/index.d.cts +15 -0
- package/types/badge/index.d.ts +15 -0
- package/types/base/teleport.d.cts +13 -0
- package/types/base/teleport.d.ts +13 -0
- package/types/base/transition-props.d.cts +4 -0
- package/types/base/transition-props.d.ts +4 -0
- package/types/base/transition.d.cts +27 -0
- package/types/base/transition.d.ts +27 -0
- package/types/breadcrumb/breadcrumb-context.d.cts +2 -0
- package/types/breadcrumb/breadcrumb-context.d.ts +2 -0
- package/types/breadcrumb/breadcrumb-item.d.cts +11 -0
- package/types/breadcrumb/breadcrumb-item.d.ts +11 -0
- package/types/breadcrumb/breadcrumb.d.cts +7 -0
- package/types/breadcrumb/breadcrumb.d.ts +7 -0
- package/types/breadcrumb/index.d.cts +5 -0
- package/types/breadcrumb/index.d.ts +5 -0
- package/types/button/button-group-context.d.cts +6 -0
- package/types/button/button-group-context.d.ts +6 -0
- package/types/button/button-group.d.cts +9 -0
- package/types/button/button-group.d.ts +9 -0
- package/types/button/button.d.cts +20 -0
- package/types/button/button.d.ts +20 -0
- package/types/button/index.d.cts +5 -0
- package/types/button/index.d.ts +5 -0
- package/types/calendar/index.d.cts +36 -0
- package/types/calendar/index.d.ts +36 -0
- package/types/card/index.d.cts +22 -0
- package/types/card/index.d.ts +22 -0
- package/types/carousel/carousel-context.d.cts +6 -0
- package/types/carousel/carousel-context.d.ts +6 -0
- package/types/carousel/carousel-item.d.cts +3 -0
- package/types/carousel/carousel-item.d.ts +3 -0
- package/types/carousel/carousel.d.cts +18 -0
- package/types/carousel/carousel.d.ts +18 -0
- package/types/carousel/index.d.cts +5 -0
- package/types/carousel/index.d.ts +5 -0
- package/types/cascader/index.d.cts +5 -0
- package/types/cascader/index.d.ts +5 -0
- package/types/cascader/types.d.cts +38 -0
- package/types/cascader/types.d.ts +38 -0
- package/types/check-card/check-card-group.d.cts +4 -0
- package/types/check-card/check-card-group.d.ts +4 -0
- package/types/check-card/check-card.d.cts +4 -0
- package/types/check-card/check-card.d.ts +4 -0
- package/types/check-card/context.d.cts +14 -0
- package/types/check-card/context.d.ts +14 -0
- package/types/check-card/index.d.cts +4 -0
- package/types/check-card/index.d.ts +4 -0
- package/types/check-card/types.d.cts +46 -0
- package/types/check-card/types.d.ts +46 -0
- package/types/checkbox/checkbox-group-context.d.cts +11 -0
- package/types/checkbox/checkbox-group-context.d.ts +11 -0
- package/types/checkbox/checkbox-group.d.cts +22 -0
- package/types/checkbox/checkbox-group.d.ts +22 -0
- package/types/checkbox/checkbox.d.cts +23 -0
- package/types/checkbox/checkbox.d.ts +23 -0
- package/types/checkbox/index.d.cts +6 -0
- package/types/checkbox/index.d.ts +6 -0
- package/types/collapse/collapse-panel.d.cts +12 -0
- package/types/collapse/collapse-panel.d.ts +12 -0
- package/types/collapse/collapse.d.cts +15 -0
- package/types/collapse/collapse.d.ts +15 -0
- package/types/collapse/index.d.cts +6 -0
- package/types/collapse/index.d.ts +6 -0
- package/types/color-picker/alpha.d.cts +6 -0
- package/types/color-picker/alpha.d.ts +6 -0
- package/types/color-picker/hue.d.cts +5 -0
- package/types/color-picker/hue.d.ts +5 -0
- package/types/color-picker/index.d.cts +30 -0
- package/types/color-picker/index.d.ts +30 -0
- package/types/color-picker/mode.d.cts +10 -0
- package/types/color-picker/mode.d.ts +10 -0
- package/types/color-picker/paint.d.cts +7 -0
- package/types/color-picker/paint.d.ts +7 -0
- package/types/color-picker/presets.d.cts +7 -0
- package/types/color-picker/presets.d.ts +7 -0
- package/types/components.d.cts +165 -0
- package/types/components.d.ts +165 -0
- package/types/config/config-context.d.cts +11 -0
- package/types/config/config-context.d.ts +11 -0
- package/types/config/context.d.cts +7 -0
- package/types/config/context.d.ts +7 -0
- package/types/config/index.d.cts +14 -0
- package/types/config/index.d.ts +14 -0
- package/types/config/size-context.d.cts +3 -0
- package/types/config/size-context.d.ts +3 -0
- package/types/config/use-config-appearance.d.cts +7 -0
- package/types/config/use-config-appearance.d.ts +7 -0
- package/types/const/types.d.cts +22 -0
- package/types/const/types.d.ts +22 -0
- package/types/const/var.d.cts +1 -0
- package/types/const/var.d.ts +1 -0
- package/types/date-picker/index.d.cts +54 -0
- package/types/date-picker/index.d.ts +54 -0
- package/types/descriptions/descriptions-item.d.cts +5 -0
- package/types/descriptions/descriptions-item.d.ts +5 -0
- package/types/descriptions/descriptions.d.cts +21 -0
- package/types/descriptions/descriptions.d.ts +21 -0
- package/types/descriptions/index.d.cts +4 -0
- package/types/descriptions/index.d.ts +4 -0
- package/types/directives/outsiteclick.d.cts +3 -0
- package/types/directives/outsiteclick.d.ts +3 -0
- package/types/directives/resize.d.cts +3 -0
- package/types/directives/resize.d.ts +3 -0
- package/types/directives/scroll.d.cts +3 -0
- package/types/directives/scroll.d.ts +3 -0
- package/types/directives/transfer.d.cts +2 -0
- package/types/directives/transfer.d.ts +2 -0
- package/types/divider/index.d.cts +14 -0
- package/types/divider/index.d.ts +14 -0
- package/types/drawer/index.d.cts +27 -0
- package/types/drawer/index.d.ts +27 -0
- package/types/dropdown/dropdown-button.d.cts +17 -0
- package/types/dropdown/dropdown-button.d.ts +17 -0
- package/types/dropdown/dropdown-context.d.cts +11 -0
- package/types/dropdown/dropdown-context.d.ts +11 -0
- package/types/dropdown/dropdown.d.cts +18 -0
- package/types/dropdown/dropdown.d.ts +18 -0
- package/types/dropdown/index.d.cts +4 -0
- package/types/dropdown/index.d.ts +4 -0
- package/types/dropdown/trigger.d.cts +9 -0
- package/types/dropdown/trigger.d.ts +9 -0
- package/types/empty/index.d.cts +9 -0
- package/types/empty/index.d.ts +9 -0
- package/types/feature-card/index.d.cts +20 -0
- package/types/feature-card/index.d.ts +20 -0
- package/types/feedback-panel/index.d.cts +15 -0
- package/types/feedback-panel/index.d.ts +15 -0
- package/types/flame-wrap/index.d.cts +3 -0
- package/types/flame-wrap/index.d.ts +3 -0
- package/types/flame-wrap/types.d.cts +71 -0
- package/types/flame-wrap/types.d.ts +71 -0
- package/types/flex/index.d.cts +15 -0
- package/types/flex/index.d.ts +15 -0
- package/types/form/field-context.d.cts +39 -0
- package/types/form/field-context.d.ts +39 -0
- package/types/form/form-context.d.cts +22 -0
- package/types/form/form-context.d.ts +22 -0
- package/types/form/form-item.d.cts +12 -0
- package/types/form/form-item.d.ts +12 -0
- package/types/form/form.d.cts +40 -0
- package/types/form/form.d.ts +40 -0
- package/types/form/index.d.cts +7 -0
- package/types/form/index.d.ts +7 -0
- package/types/form/types.d.cts +20 -0
- package/types/form/types.d.ts +20 -0
- package/types/form/utils.d.cts +6 -0
- package/types/form/utils.d.ts +6 -0
- package/types/grid/grid-item.d.cts +10 -0
- package/types/grid/grid-item.d.ts +10 -0
- package/types/grid/grid.d.cts +17 -0
- package/types/grid/grid.d.ts +17 -0
- package/types/grid/index.d.cts +6 -0
- package/types/grid/index.d.ts +6 -0
- package/types/grid/useBreakpoint.d.cts +11 -0
- package/types/grid/useBreakpoint.d.ts +11 -0
- package/types/icon/index.d.cts +15 -0
- package/types/icon/index.d.ts +15 -0
- package/types/image/group.d.cts +5 -0
- package/types/image/group.d.ts +5 -0
- package/types/image/image-group-context.d.cts +8 -0
- package/types/image/image-group-context.d.ts +8 -0
- package/types/image/image.d.cts +28 -0
- package/types/image/image.d.ts +28 -0
- package/types/image/index.d.cts +6 -0
- package/types/image/index.d.ts +6 -0
- package/types/image/instance.d.cts +5 -0
- package/types/image/instance.d.ts +5 -0
- package/types/image/preview.d.cts +19 -0
- package/types/image/preview.d.ts +19 -0
- package/types/image/utils.d.cts +6 -0
- package/types/image/utils.d.ts +6 -0
- package/types/index.d.cts +8 -0
- package/types/index.d.ts +8 -0
- package/types/input/index.d.cts +8 -0
- package/types/input/index.d.ts +8 -0
- package/types/input/input-box.d.cts +14 -0
- package/types/input/input-box.d.ts +14 -0
- package/types/input/input-group.d.cts +11 -0
- package/types/input/input-group.d.ts +11 -0
- package/types/input/input.d.cts +28 -0
- package/types/input/input.d.ts +28 -0
- package/types/input/textarea.d.cts +11 -0
- package/types/input/textarea.d.ts +11 -0
- package/types/input-number/index.d.cts +27 -0
- package/types/input-number/index.d.ts +27 -0
- package/types/input-otp/index.d.cts +27 -0
- package/types/input-otp/index.d.ts +27 -0
- package/types/input-tag/index.d.cts +23 -0
- package/types/input-tag/index.d.ts +23 -0
- package/types/kanban/index.d.cts +31 -0
- package/types/kanban/index.d.ts +31 -0
- package/types/layout/index.d.cts +29 -0
- package/types/layout/index.d.ts +29 -0
- package/types/layout/layout-context.d.cts +1 -0
- package/types/layout/layout-context.d.ts +1 -0
- package/types/list-panel/index.d.cts +16 -0
- package/types/list-panel/index.d.ts +16 -0
- package/types/loading/index.d.cts +10 -0
- package/types/loading/index.d.ts +10 -0
- package/types/loading/loading-bar.d.cts +12 -0
- package/types/loading/loading-bar.d.ts +12 -0
- package/types/locale/de.d.cts +65 -0
- package/types/locale/de.d.ts +65 -0
- package/types/locale/el.d.cts +65 -0
- package/types/locale/el.d.ts +65 -0
- package/types/locale/en.d.cts +65 -0
- package/types/locale/en.d.ts +65 -0
- package/types/locale/fr.d.cts +65 -0
- package/types/locale/fr.d.ts +65 -0
- package/types/locale/it.d.cts +65 -0
- package/types/locale/it.d.ts +65 -0
- package/types/locale/ja.d.cts +65 -0
- package/types/locale/ja.d.ts +65 -0
- package/types/locale/ko.d.cts +65 -0
- package/types/locale/ko.d.ts +65 -0
- package/types/locale/ru.d.cts +65 -0
- package/types/locale/ru.d.ts +65 -0
- package/types/locale/th.d.cts +65 -0
- package/types/locale/th.d.ts +65 -0
- package/types/locale/uk.d.cts +65 -0
- package/types/locale/uk.d.ts +65 -0
- package/types/locale/vi.d.cts +65 -0
- package/types/locale/vi.d.ts +65 -0
- package/types/locale/zh-CN.d.cts +65 -0
- package/types/locale/zh-CN.d.ts +65 -0
- package/types/locale/zh-TW.d.cts +65 -0
- package/types/locale/zh-TW.d.ts +65 -0
- package/types/mentions/index.d.cts +28 -0
- package/types/mentions/index.d.ts +28 -0
- package/types/menu/index.d.cts +7 -0
- package/types/menu/index.d.ts +7 -0
- package/types/menu/menu-context.d.cts +24 -0
- package/types/menu/menu-context.d.ts +24 -0
- package/types/menu/menu-divider.d.cts +3 -0
- package/types/menu/menu-divider.d.ts +3 -0
- package/types/menu/menu-group.d.cts +7 -0
- package/types/menu/menu-group.d.ts +7 -0
- package/types/menu/menu-item.d.cts +15 -0
- package/types/menu/menu-item.d.ts +15 -0
- package/types/menu/menu-keyboard.d.cts +7 -0
- package/types/menu/menu-keyboard.d.ts +7 -0
- package/types/menu/menu.d.cts +33 -0
- package/types/menu/menu.d.ts +33 -0
- package/types/menu/recursive-menu.d.cts +7 -0
- package/types/menu/recursive-menu.d.ts +7 -0
- package/types/menu/sub-menu.d.cts +12 -0
- package/types/menu/sub-menu.d.ts +12 -0
- package/types/message/index.d.cts +24 -0
- package/types/message/index.d.ts +24 -0
- package/types/modal/api.d.cts +26 -0
- package/types/modal/api.d.ts +26 -0
- package/types/modal/index.d.cts +4 -0
- package/types/modal/index.d.ts +4 -0
- package/types/modal/modal.d.cts +32 -0
- package/types/modal/modal.d.ts +32 -0
- package/types/modal/toast.d.cts +15 -0
- package/types/modal/toast.d.ts +15 -0
- package/types/notice/container.d.cts +9 -0
- package/types/notice/container.d.ts +9 -0
- package/types/notice/content.d.cts +22 -0
- package/types/notice/content.d.ts +22 -0
- package/types/notice/index.d.cts +24 -0
- package/types/notice/index.d.ts +24 -0
- package/types/notice/instance.d.cts +7 -0
- package/types/notice/instance.d.ts +7 -0
- package/types/page/index.d.cts +19 -0
- package/types/page/index.d.ts +19 -0
- package/types/page-header/index.d.cts +10 -0
- package/types/page-header/index.d.ts +10 -0
- package/types/popconfirm/index.d.cts +27 -0
- package/types/popconfirm/index.d.ts +27 -0
- package/types/poptip/index.d.cts +25 -0
- package/types/poptip/index.d.ts +25 -0
- package/types/progress/index.d.cts +21 -0
- package/types/progress/index.d.ts +21 -0
- package/types/qrcode/index.d.cts +28 -0
- package/types/qrcode/index.d.ts +28 -0
- package/types/radio/index.d.cts +7 -0
- package/types/radio/index.d.ts +7 -0
- package/types/radio/radio-button.d.cts +20 -0
- package/types/radio/radio-button.d.ts +20 -0
- package/types/radio/radio-group-context.d.cts +13 -0
- package/types/radio/radio-group-context.d.ts +13 -0
- package/types/radio/radio-group.d.cts +26 -0
- package/types/radio/radio-group.d.ts +26 -0
- package/types/radio/radio.d.cts +17 -0
- package/types/radio/radio.d.ts +17 -0
- package/types/radio/types.d.cts +5 -0
- package/types/radio/types.d.ts +5 -0
- package/types/rate/index.d.cts +22 -0
- package/types/rate/index.d.ts +22 -0
- package/types/rate/star.d.cts +19 -0
- package/types/rate/star.d.ts +19 -0
- package/types/result/index.d.cts +12 -0
- package/types/result/index.d.ts +12 -0
- package/types/ripple/index.d.cts +10 -0
- package/types/ripple/index.d.ts +10 -0
- package/types/ripple/types.d.cts +48 -0
- package/types/ripple/types.d.ts +48 -0
- package/types/row-col/col.d.cts +26 -0
- package/types/row-col/col.d.ts +26 -0
- package/types/row-col/index.d.cts +5 -0
- package/types/row-col/index.d.ts +5 -0
- package/types/row-col/row.d.cts +9 -0
- package/types/row-col/row.d.ts +9 -0
- package/types/segmented/index.d.cts +25 -0
- package/types/segmented/index.d.ts +25 -0
- package/types/select/index.d.cts +5 -0
- package/types/select/index.d.ts +5 -0
- package/types/select/option.d.cts +17 -0
- package/types/select/option.d.ts +17 -0
- package/types/select/select.d.cts +51 -0
- package/types/select/select.d.ts +51 -0
- package/types/skeleton/index.d.cts +11 -0
- package/types/skeleton/index.d.ts +11 -0
- package/types/skeleton/skeleton-avatar.d.cts +13 -0
- package/types/skeleton/skeleton-avatar.d.ts +13 -0
- package/types/skeleton/skeleton-button.d.cts +14 -0
- package/types/skeleton/skeleton-button.d.ts +14 -0
- package/types/skeleton/skeleton-image.d.cts +11 -0
- package/types/skeleton/skeleton-image.d.ts +11 -0
- package/types/skeleton/skeleton-text.d.cts +12 -0
- package/types/skeleton/skeleton-text.d.ts +12 -0
- package/types/skeleton/skeleton.d.cts +19 -0
- package/types/skeleton/skeleton.d.ts +19 -0
- package/types/skeleton/use-skeleton-loading.d.cts +1 -0
- package/types/skeleton/use-skeleton-loading.d.ts +1 -0
- package/types/slider/index.d.cts +21 -0
- package/types/slider/index.d.ts +21 -0
- package/types/slider/thumb.d.cts +17 -0
- package/types/slider/thumb.d.ts +17 -0
- package/types/space/index.d.cts +15 -0
- package/types/space/index.d.ts +15 -0
- package/types/spin/index.d.cts +11 -0
- package/types/spin/index.d.ts +11 -0
- package/types/splitter/index.d.cts +4 -0
- package/types/splitter/index.d.ts +4 -0
- package/types/splitter/splitter-panel.d.cts +7 -0
- package/types/splitter/splitter-panel.d.ts +7 -0
- package/types/splitter/splitter.d.cts +9 -0
- package/types/splitter/splitter.d.ts +9 -0
- package/types/stat-card/countup.d.cts +11 -0
- package/types/stat-card/countup.d.ts +11 -0
- package/types/stat-card/index.d.cts +5 -0
- package/types/stat-card/index.d.ts +5 -0
- package/types/stat-card/rollup.d.cts +7 -0
- package/types/stat-card/rollup.d.ts +7 -0
- package/types/stat-card/stat-card.d.cts +31 -0
- package/types/stat-card/stat-card.d.ts +31 -0
- package/types/stat-card/stat-number.d.cts +13 -0
- package/types/stat-card/stat-number.d.ts +13 -0
- package/types/stat-card/utils/countup.d.cts +128 -0
- package/types/stat-card/utils/countup.d.ts +128 -0
- package/types/stat-card/utils/odometer.d.cts +14 -0
- package/types/stat-card/utils/odometer.d.ts +14 -0
- package/types/steps/index.d.cts +20 -0
- package/types/steps/index.d.ts +20 -0
- package/types/switch/index.d.cts +21 -0
- package/types/switch/index.d.ts +21 -0
- package/types/table/column-setting.d.cts +28 -0
- package/types/table/column-setting.d.ts +28 -0
- package/types/table/index.d.cts +5 -0
- package/types/table/index.d.ts +5 -0
- package/types/table/types.d.cts +66 -0
- package/types/table/types.d.ts +66 -0
- package/types/table/utils.d.cts +14 -0
- package/types/table/utils.d.ts +14 -0
- package/types/tabs/index.d.cts +5 -0
- package/types/tabs/index.d.ts +5 -0
- package/types/tabs/tab-panel.d.cts +17 -0
- package/types/tabs/tab-panel.d.ts +17 -0
- package/types/tabs/tabs.d.cts +16 -0
- package/types/tabs/tabs.d.ts +16 -0
- package/types/tabs/types.d.cts +16 -0
- package/types/tabs/types.d.ts +16 -0
- package/types/tag/index.d.cts +16 -0
- package/types/tag/index.d.ts +16 -0
- package/types/time-line/index.d.cts +5 -0
- package/types/time-line/index.d.ts +5 -0
- package/types/time-line/timeline-item.d.cts +10 -0
- package/types/time-line/timeline-item.d.ts +10 -0
- package/types/time-line/timeline.d.cts +6 -0
- package/types/time-line/timeline.d.ts +6 -0
- package/types/tooltip/index.d.cts +23 -0
- package/types/tooltip/index.d.ts +23 -0
- package/types/tour/index.d.cts +22 -0
- package/types/tour/index.d.ts +22 -0
- package/types/transfer/index.d.cts +33 -0
- package/types/transfer/index.d.ts +33 -0
- package/types/tree/index.d.cts +51 -0
- package/types/tree/index.d.ts +51 -0
- package/types/tree/types.d.cts +27 -0
- package/types/tree/types.d.ts +27 -0
- package/types/tree/utils.d.cts +33 -0
- package/types/tree/utils.d.ts +33 -0
- package/types/tree-select/index.d.cts +60 -0
- package/types/tree-select/index.d.ts +60 -0
- package/types/typography/index.d.cts +40 -0
- package/types/typography/index.d.ts +40 -0
- package/types/upload/file-list.d.cts +19 -0
- package/types/upload/file-list.d.ts +19 -0
- package/types/upload/index.d.cts +90 -0
- package/types/upload/index.d.ts +90 -0
- package/types/upload/picture-sort.d.cts +2 -0
- package/types/upload/picture-sort.d.ts +2 -0
- package/types/upload/selector.d.cts +21 -0
- package/types/upload/selector.d.ts +21 -0
- package/types/utils/checked.d.cts +2 -0
- package/types/utils/checked.d.ts +2 -0
- package/types/utils/color.d.cts +1 -0
- package/types/utils/color.d.ts +1 -0
- package/types/utils/element.d.cts +2 -0
- package/types/utils/element.d.ts +2 -0
- package/types/utils/mouse.d.cts +1 -0
- package/types/utils/mouse.d.ts +1 -0
- package/types/utils/number.d.cts +6 -0
- package/types/utils/number.d.ts +6 -0
- package/types/utils/placement.d.cts +16 -0
- package/types/utils/placement.d.ts +16 -0
- package/types/utils/react-node.d.cts +5 -0
- package/types/utils/react-node.d.ts +5 -0
- package/types/utils/share.d.cts +12 -0
- package/types/utils/share.d.ts +12 -0
- package/types/utils/theme.d.cts +5 -0
- package/types/utils/theme.d.ts +5 -0
- package/types/utils/transition.d.cts +3 -0
- package/types/utils/transition.d.ts +3 -0
- package/types/utils/use-value.d.cts +2 -0
- package/types/utils/use-value.d.ts +2 -0
- package/types/virtual-list/index.d.cts +17 -0
- package/types/virtual-list/index.d.ts +17 -0
- package/types/virtual-list/range.d.cts +15 -0
- package/types/virtual-list/range.d.ts +15 -0
- package/types/watermark/index.d.cts +27 -0
- package/types/watermark/index.d.ts +27 -0
- package/dist/k-ui.css +0 -7
- package/dist/k-ui.js +0 -13
package/AI.en-US.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# React KUI AI integration
|
|
2
|
+
|
|
3
|
+
For building React 19.2+ applications with `react-kui`. This is not a Vue plugin.
|
|
4
|
+
|
|
5
|
+
Install `react-kui` and `kui-icons`, then run `pnpm exec react-kui-ai init`. It appends project guidance to AGENTS.md without overwriting existing content or duplicating its section. Install the optional Skill from `node_modules/react-kui/ai/skills/react-kui` using your client's Skill mechanism.
|
|
6
|
+
|
|
7
|
+
Configure a stdio MCP service with command `pnpm` and args `["exec", "react-kui-mcp"]`, running from the consuming project's directory. Configuration locations vary by client.
|
|
8
|
+
|
|
9
|
+
Use named imports and load `react-kui/style/index.css` once. Input onChange receives a value, not a DOM event. Switch uses checked/onChange; Modal uses open/onOpenChange. A Form model supplied by the application must be updated through onChange(nextModel); onSubmit receives { valid }. Button uses htmlType for submit/reset. The image export is KImage. Do not use Vue v-model, slots or app.use.
|
|
10
|
+
|
|
11
|
+
MCP tools:
|
|
12
|
+
|
|
13
|
+
- search_components and recommend_components for discovery.
|
|
14
|
+
- get_component_api({ name, section? }) for all/props/events/renderProps/behavior, without example source by default.
|
|
15
|
+
- list_component_examples followed by get_component_example for one documented example (relative imports use its original directory).
|
|
16
|
+
- list_templates and get_template for runnable form/table/modal-editor TSX, setup instructions and local mock requests.
|
|
17
|
+
- validate_kui_usage for static JSX/TSX checks. Named aliases and namespace imports are supported. valid is not proof of full correctness: read skipped checks, then run tsc and interaction tests.
|
|
18
|
+
|
|
19
|
+
Search/example lists accept offset and limit (default 10, max 20). Full resources use react-kui://components/{Name}; prompts embed the corresponding business templates.
|
|
20
|
+
|
|
21
|
+
Versioned npm resources: react-kui/metadata, react-kui/metadata/schema, react-kui/skill. Site builds publish llms.txt, llms-full.txt, kui-components.json and schema/kui-components.schema.json. Prefer installed-version metadata over the latest website.
|
|
22
|
+
|
|
23
|
+
Run `pnpm generate:ai`, `pnpm check:ai-assets` and `pnpm check:ai`. AI tasks cap Node heap and use a single test worker. Templates can be saved as App.tsx in an application with library CSS loaded; replace local mocks with production APIs. Metadata is derived from public React exports, TypeScript props and documentation examples. Explicit behavior contracts supplement inferred types; absent defaults do not imply a particular runtime behavior.
|
package/AI.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# React KUI AI 辅助开发
|
|
2
|
+
|
|
3
|
+
用于帮助 AI **使用 react-kui 开发 React 应用**。支持 React 19.2+,npm 包名为 `react-kui`;不是 `kui-react`,也不是 Vue 插件。
|
|
4
|
+
|
|
5
|
+
## 接入
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add react-kui kui-icons
|
|
9
|
+
pnpm exec react-kui-ai init
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
初始化会追加项目 `AGENTS.md` 的 React KUI 使用约定,保留已有内容,重复执行不重复写入。Agent Skill 位于 `node_modules/react-kui/ai/skills/react-kui`,可按所用客户端的 Skill 安装方式接入。
|
|
13
|
+
|
|
14
|
+
在支持 stdio MCP 的客户端中添加服务,并将工作目录设置为已安装 react-kui 的应用目录:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"react-kui": {
|
|
20
|
+
"command": "pnpm",
|
|
21
|
+
"args": ["exec", "react-kui-mcp"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
不同客户端的配置位置不同;以上是服务启动参数,不要求编辑某个固定的全局配置文件。
|
|
28
|
+
|
|
29
|
+
## React 的使用约定
|
|
30
|
+
|
|
31
|
+
- 使用具名导入,并在入口引入一次 `react-kui/style/index.css`。
|
|
32
|
+
- 使用 JSX/TSX、`className` 和回调属性,不使用 Vue 的 `v-model`、插槽或 `app.use`。
|
|
33
|
+
- Input 的 `onChange` 接收值,不是 DOM Event;它采用同步本地状态机制,不要假设所有输入组件都等同于原生严格受控输入。
|
|
34
|
+
- Switch 使用 `checked/onChange`;Modal 使用 `open/onOpenChange`。
|
|
35
|
+
- Form 传入 `model` 后,需要在 `onChange(nextModel)` 中更新 React state。FormItem 的 `prop` 负责字段绑定。`onSubmit` 接收 `{ valid }`。
|
|
36
|
+
- Button 的原生表单类型是 `htmlType`;图片组件导出名为 `KImage`。
|
|
37
|
+
|
|
38
|
+
这些约定随版本发布在 `ai/behaviors.json` 和生成的元数据中。
|
|
39
|
+
|
|
40
|
+
## 查询和验证
|
|
41
|
+
|
|
42
|
+
MCP 提供分页搜索、按章节查询 API、单个示例读取和业务模板。默认 API 响应不包含全部示例源码和庞大的原生属性列表。
|
|
43
|
+
|
|
44
|
+
- `search_components({ query, offset?, limit? })`:默认 10 条,最多 20 条。
|
|
45
|
+
- `get_component_api({ name, section? })`:`all`、`props`、`events`、`renderProps`、`behavior`。
|
|
46
|
+
- `list_component_examples({ name })` → `get_component_example({ name, id })`:按需读取原有文档示例;相对导入按示例原目录解析。
|
|
47
|
+
- `list_templates()` → `get_template({ id })`:获取完整业务模板。
|
|
48
|
+
- `validate_kui_usage({ source })`:解析 JSX/TSX,检查已知组件导入、属性名、回调属性、字面量值、明确必填项和 Vue 写法误用,支持具名导入别名及命名空间导入。
|
|
49
|
+
|
|
50
|
+
校验器不会执行表达式,也不替代 TypeScript。`valid` 只表示未发现静态错误;`complete: false`、`skipped` 和 `nextStep` 会说明动态表达式、展开属性、自定义包装组件等限制。应用仍需运行 `tsc --noEmit` 和交互测试。
|
|
51
|
+
|
|
52
|
+
## 可运行的业务模板
|
|
53
|
+
|
|
54
|
+
`ai/templates/` 包含三个使用局部导入的 TSX 文件:
|
|
55
|
+
|
|
56
|
+
- `form`:必填/邮箱校验、保存、防重复提交、重置和禁用。
|
|
57
|
+
- `table`:搜索、分页、加载/错误状态和过期请求保护。
|
|
58
|
+
- `modal-editor`:新增/编辑、草稿隔离、校验、保存和取消。
|
|
59
|
+
|
|
60
|
+
入口引入样式后,可将模板保存为 `App.tsx` 直接运行。请求使用本地模拟,接入生产业务时替换为自己的 API。
|
|
61
|
+
|
|
62
|
+
## 版本化资源与维护
|
|
63
|
+
|
|
64
|
+
npm 导出:`react-kui/metadata`、`react-kui/metadata/schema`、`react-kui/skill`。
|
|
65
|
+
|
|
66
|
+
站点构建会发布 `llms.txt`、`llms-full.txt`、`kui-components.json` 和 `schema/kui-components.schema.json`。优先读取安装版本的资源,线上资源可能对应更新的版本。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pnpm generate:ai
|
|
70
|
+
pnpm check:ai-assets
|
|
71
|
+
pnpm check:ai
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
元数据从 React 的公开导出、TypeScript Props 和真实文档示例生成。默认表达式只在可确定提取时提供,不代表所有运行时默认行为。行为约定重点覆盖表单、输入、弹层、表格、分页、菜单等核心组件。
|
|
75
|
+
|
|
76
|
+
AI 生成与校验命令限制 Node 堆,测试按单工作进程运行,避免在低内存机器上并发启动重任务。无需运行完整构建即可更新 AI 资源。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Qiu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://react.k-ui.cn">
|
|
3
|
+
<img width="100" src="https://cdn.chuchur.com/img/logo-kui.svg" alt="KUI Logo">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<h1 align="center">React KUI</h1>
|
|
8
|
+
|
|
9
|
+
<div align="center">
|
|
10
|
+
|
|
11
|
+
基于 React 19.2+ 和 TypeScript 的桌面端 UI 组件库
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/react-kui)
|
|
14
|
+
[](https://www.npmjs.com/package/react-kui)
|
|
15
|
+
[](./LICENSE)
|
|
16
|
+
|
|
17
|
+
[English](README.md) · 简体中文
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
## 特性
|
|
24
|
+
|
|
25
|
+
- 基于 React 19.2+,使用现代 React API 构建
|
|
26
|
+
- 使用 TypeScript 开发,提供完整的组件类型声明
|
|
27
|
+
- 50+ 桌面端组件,覆盖通用、布局、导航、表单、数据展示和反馈场景
|
|
28
|
+
- 支持主题定制、暗色模式和多种组件尺寸
|
|
29
|
+
- 内置国际化能力及多语言资源
|
|
30
|
+
- 支持按需使用组件,适用于 Vite 等现代前端工程
|
|
31
|
+
- 支持现代浏览器和 Electron
|
|
32
|
+
|
|
33
|
+
## 文档
|
|
34
|
+
|
|
35
|
+
- [快速开始](https://react.k-ui.cn/guide/quick-started)
|
|
36
|
+
- [组件总览](https://react.k-ui.cn/guide/components)
|
|
37
|
+
- [暗色模式](https://react.k-ui.cn/guide/dark-mode)
|
|
38
|
+
- [国际化](https://react.k-ui.cn/guide/language)
|
|
39
|
+
- [更新日志](https://react.k-ui.cn/guide/change-log)
|
|
40
|
+
|
|
41
|
+
## 安装
|
|
42
|
+
|
|
43
|
+
使用 pnpm:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm add react-kui kui-icons
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
也可以使用 npm、Yarn 或 Bun:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install react-kui kui-icons
|
|
53
|
+
yarn add react-kui kui-icons
|
|
54
|
+
bun add react-kui kui-icons
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`react` 和 `react-dom` 是 peer dependencies,项目需要使用 React 19.2+。
|
|
58
|
+
|
|
59
|
+
## 快速开始
|
|
60
|
+
|
|
61
|
+
在应用入口引入组件库样式,然后直接使用组件:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import { createRoot } from "react-dom/client";
|
|
65
|
+
import { Button, Space, message } from "react-kui";
|
|
66
|
+
import "react-kui/style/index.css";
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
return (
|
|
70
|
+
<Space>
|
|
71
|
+
<Button type="primary" onClick={() => message.success("Hello React KUI!")}>
|
|
72
|
+
Primary
|
|
73
|
+
</Button>
|
|
74
|
+
<Button>Default</Button>
|
|
75
|
+
</Space>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
createRoot(document.getElementById("root")!).render(<App />);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
组件 Props 和事件都带有 TypeScript 类型,可直接获得编辑器提示:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { Cascader, type CascaderOption, type CascaderValue } from "react-kui";
|
|
86
|
+
import { useState } from "react";
|
|
87
|
+
|
|
88
|
+
const options: CascaderOption[] = [
|
|
89
|
+
{
|
|
90
|
+
value: "hubei",
|
|
91
|
+
label: "湖北省",
|
|
92
|
+
children: [{ value: "wuhan", label: "武汉市" }],
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
export default function Demo() {
|
|
97
|
+
const [value, setValue] = useState<CascaderValue>([]);
|
|
98
|
+
return <Cascader value={value} options={options} onChange={setValue} />;
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 本地开发
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git clone git@github.com:smallerqiu/kui-react.git
|
|
106
|
+
cd kui-react
|
|
107
|
+
pnpm install
|
|
108
|
+
pnpm dev
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
文档开发服务器默认运行在 [http://localhost:7006](http://localhost:7006)。
|
|
112
|
+
|
|
113
|
+
常用命令:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pnpm dev # 启动文档开发服务器
|
|
117
|
+
pnpm typecheck # TypeScript 类型检查
|
|
118
|
+
pnpm build:docs # 构建文档站
|
|
119
|
+
pnpm build # 构建组件库及样式
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 浏览器支持
|
|
123
|
+
|
|
124
|
+
支持主流现代浏览器的最近两个版本,包括 Chrome、Edge、Firefox 和 Safari;不支持 Internet Explorer。
|
|
125
|
+
|
|
126
|
+
## 参与贡献
|
|
127
|
+
|
|
128
|
+
欢迎提交 Issue 和 Pull Request。在提交代码前,请确保类型检查和相关构建能够通过。
|
|
129
|
+
|
|
130
|
+
- [GitHub 仓库](https://github.com/smallerqiu/kui-react)
|
|
131
|
+
- [Gitee 仓库](https://gitee.com/smallerqiu/kui-react)
|
|
132
|
+
- [问题反馈](https://gitee.com/smallerqiu/kui-react/issues)
|
|
133
|
+
|
|
134
|
+
## 开源协议
|
|
135
|
+
|
|
136
|
+
[MIT](./LICENSE)
|
|
137
|
+
|
|
138
|
+
Copyright © 2017-present Qiu
|
|
139
|
+
|
|
140
|
+
## AI 辅助开发
|
|
141
|
+
|
|
142
|
+
组件元数据、MCP、Skill 和可运行业务模板见 [AI 接入说明](./AI.md)。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Form": { "rules": ["When model is supplied, update React state with onChange(nextModel); the library does not mutate the caller's model object. Without model, Form keeps an internal model.", "FormItem prop selects a model field; supported child controls receive the field value and change handler automatically.", "onSubmit receives { valid }, not a DOM submit event. Save only when valid is true. Button htmlType=submit triggers validation.", "disabled and readOnly are inherited by supported form controls; explicit child props override inherited state.", "reset clears registered fields to null and emits onChange/onReset; it does not restore an original snapshot."], "methods": ["ref.current.validate(): Promise<{ valid: boolean }>", "ref.current.reset(): void", "ref.current.submit(): Promise<void>"] },
|
|
3
|
+
"FormItem": { "rules": ["Use inside Form. prop is the field path, not the field value. Do not copy Vue v-model bindings."] },
|
|
4
|
+
"Input": { "rules": ["Use value and onChange(nextValue). onChange receives a string, not a DOM event.", "Input uses synchronized local state: edits can stay local until the parent supplies a different value. Do not promise strict native controlled-input semantics. Keep application state updated through onChange."] },
|
|
5
|
+
"Button": { "rules": ["Use htmlType=submit/reset for form actions; type is visual intent, not native button type.", "icon takes an icon definition imported from kui-icons."] },
|
|
6
|
+
"Switch": { "rules": ["Use checked and onChange, or defaultChecked. When checked is supplied, the parent must update it.", "checked is boolean. onChange returns boolean/string/number according to valueType; default valueType is boolean."] },
|
|
7
|
+
"Modal": { "rules": ["Use open plus onOpenChange, or defaultOpen. When open is supplied, update it in the parent.", "onOk does not automatically save or close. Validate/save first, then set open=false. loading blocks user dismissal during saving.", "Use children or content and footer props, not Vue named slots."] },
|
|
8
|
+
"Drawer": { "rules": ["Use open plus onOpenChange for controlled visibility. Keep the state in React; do not use v-model."] },
|
|
9
|
+
"Page": { "rules": ["Pages are one-based. onChange(page, pageSize) reports both values. Update application page/pageSize state and fetch data explicitly."] },
|
|
10
|
+
"Table": { "rules": ["Pass data and columns. Set rowKey to a stable unique field; the default is key.", "The component does not call your backend. For remote paging, combine Page with explicit loading/error state and protect against stale responses.", "Use render callbacks/ReactNode props from the API; Vue slot syntax is invalid."] },
|
|
11
|
+
"Menu": { "rules": ["Use selectedKeys or value with onChange for selection; openKeys with onOpenChange controls expanded submenus. Do not use Vue update events."] },
|
|
12
|
+
"ConfigProvider": { "rules": ["Wrap children to supply locale, size, theme and shape. Explicit component props override provider values. Import locales from react-kui/locale/<locale>."] },
|
|
13
|
+
"Select": { "rules": ["Use value and onChange, not v-model. Multiple selection requires an array; consult the onChange signature for the value and option data."] },
|
|
14
|
+
"KImage": { "rules": ["The public React export is KImage, not the Vue Image component name."] },
|
|
15
|
+
"Space": { "rules": ["Use children and compact. Vertical compact layout supports Button groups. Use className, not class."] }
|
|
16
|
+
}
|
package/ai/cli.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
|
|
6
|
+
const command = process.argv[2] || "help";
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
const marker = "## React KUI\n";
|
|
9
|
+
const instructions = `${marker}
|
|
10
|
+
- This project uses React 19.2+ and React KUI. Prefer components and public APIs documented at https://react.k-ui.cn.
|
|
11
|
+
- Import components from \`react-kui\` and icons from \`kui-icons\`; import \`react-kui/style/index.css\` once.
|
|
12
|
+
- Read the installed \`react-kui/metadata\` before using unfamiliar props, callbacks, or render props. Do not invent component APIs. Use React state and callbacks, never Vue v-model or slots.
|
|
13
|
+
- Keep \`theme\`, \`size\`, and \`shape\` consistent and run typecheck/lint after edits.
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
if (command === "init") {
|
|
17
|
+
const target = path.join(cwd, "AGENTS.md");
|
|
18
|
+
const current = fs.existsSync(target) ? fs.readFileSync(target, "utf8") : "";
|
|
19
|
+
if (!current.includes(marker.trim())) {
|
|
20
|
+
fs.writeFileSync(target, `${current.trim()}${current.trim() ? "\n\n" : ""}${instructions}`);
|
|
21
|
+
console.log(`Added React KUI guidance to ${target}`);
|
|
22
|
+
} else {
|
|
23
|
+
console.log("React KUI guidance already exists in AGENTS.md");
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
console.log("Usage: react-kui-ai init");
|
|
27
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# AI 评测
|
|
2
|
+
|
|
3
|
+
本目录评测 `react-kui` 的 AI 辅助资料与生成代码。命令从仓库根目录运行,先安装开发依赖。评测器使用本地源码类型,不需要先发布 npm 包。
|
|
4
|
+
|
|
5
|
+
## 固定场景回归(CI)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm check:ai-evals
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
26 个用例包括常用组件及三个业务模板。检查完整源码、实际组件节点、静态 API 契约、TypeScript 类型;Vue 使用 vue-tsc 检查 script 与 template。参考代码必须通过,不允许使用 @ts-ignore / @ts-nocheck 等绕过检查。业务模板通过 sourceFile 引用真实文件,避免维护两份代码。
|
|
12
|
+
|
|
13
|
+
此命令已接入仓库完整验证。表单提交/重置、表格查询/分页、弹窗取消/保存的运行时回归由现有 `tests/ai-templates.test.*` 执行;`pnpm verify` 覆盖这些测试。`check:ai-evals` 本身不执行生成代码。
|
|
14
|
+
|
|
15
|
+
报告在 `.ai-eval-results/reference.json`,包含每例 API 问题、跳过项、类型诊断、通过率和源码。CI / Release 会保留报告 7 天。运行时行为通过不能从静态通过率推断。
|
|
16
|
+
|
|
17
|
+
## 按需模型评测
|
|
18
|
+
|
|
19
|
+
CI 不调用模型,也不需要模型密钥。模型、版本、接入工具由调用者选择,没有默认付费服务。
|
|
20
|
+
|
|
21
|
+
### 接入现有模型工具
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm eval:ai --generator /absolute/path/to/model-adapter --model your-model-version
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
adapter 是你自己维护的可信可执行文件,不是模型生成的命令。每例调用一次,无命令行参数:
|
|
28
|
+
|
|
29
|
+
- stdin:JSON,包含 `name`、`model`、`prompt`、`instructions`、`api`、`expectProps`。
|
|
30
|
+
- `instructions` 包含本库 Skill,`api` 包含该例相关组件的真实元数据;**不提供参考答案**。
|
|
31
|
+
- stdout:只输出完整 TSX / Vue SFC 源码(允许一层 Markdown 代码围栏)。日志写 stderr。
|
|
32
|
+
- 退出码非零或超过 180 秒视为生成失败,计入失败用例。adapter 自行读取凭证并调用模型,评测报告不收集其 stderr。
|
|
33
|
+
|
|
34
|
+
模型返回值只做解析和类型检查,绝不导入执行。当前模式是 `skill-and-api-injection`,不是多轮 MCP 工具调用评测。回调语义、视觉效果和真实请求正确性需要人工复核或在隔离环境补充行为测试。
|
|
35
|
+
|
|
36
|
+
### 使用已经生成的回答
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm eval:ai --export-prompts .ai-eval-results/prompts.json
|
|
40
|
+
pnpm eval:ai --responses /path/to/responses.json --model your-model-version
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
prompts.json 是供外部模型工具使用的输入,不包含参考源码。responses.json 是对象:每个 case name 对应一段完整源代码字符串;必须包含当前选择的全部用例,不能漏掉失败回答来抬高通过率。需要测试某一个场景时,在导出和评分命令中都加 `--case primary-action`。
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"primary-action": "完整源代码字符串"
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
上面的单例响应仅能配合 `--case primary-action` 使用。`--out /path/to/report.json` 可指定输出位置;默认模型报告为 `.ai-eval-results/model.json`,重复运行会覆盖,做版本对比时指定不同文件。
|
|
52
|
+
|
|
53
|
+
报告记录模型标识、组件库版本、场景/上下文 SHA-256、评测时间、耗时、生成状态、源码及各例结果。`passRate` 仅代表组件使用/API/类型门槛通过率,`runtimeEvaluated` 固定为 false;不伪造语义通过率、模型用量或费用。导入参考答案进行自检也不算真实模型实测。
|
|
54
|
+
|
|
55
|
+
## 增加用例
|
|
56
|
+
|
|
57
|
+
在 `cases.json` 添加唯一 name、明确 prompt、必用组件 components,以及完整 source 或 sourceFile。使用组件的规范名称,不使用导入别名;静态节点检查因此可重复。`expectProps` 可要求某组件的字面量属性,例如提交按钮的 htmlType=submit、多选 Select 的 multiple=true;这些是有限的结构要求,不是完整的业务语义评测。新用例应关注常见 API 误用或业务场景,不应只为增加数量。
|
|
58
|
+
|
|
59
|
+
先运行固定回归和相关模板交互测试,再运行模型评测。错误枚举、缺失组件、无效语法、类型检查绕过等反例由 `tests/ai-evals.test.mjs` 覆盖。
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "primary-action",
|
|
4
|
+
"prompt": "Create a primary submit button",
|
|
5
|
+
"components": ["Button"],
|
|
6
|
+
"source": "import { Button } from \"react-kui\";\nexport default function Example() { return (<Button type=\"primary\" htmlType=\"submit\">Submit</Button>); }\n",
|
|
7
|
+
"expectProps": [
|
|
8
|
+
{
|
|
9
|
+
"component": "Button",
|
|
10
|
+
"prop": "htmlType",
|
|
11
|
+
"value": "submit"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "login-form",
|
|
17
|
+
"prompt": "Create a login form",
|
|
18
|
+
"components": ["Form", "FormItem", "Input", "Button"],
|
|
19
|
+
"source": "import { Form, FormItem, Input, Button } from \"react-kui\";\nexport default function Example() { return (<Form><FormItem label=\"Email\"><Input /></FormItem><Button>Login</Button></Form>); }\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "modal-editor",
|
|
23
|
+
"prompt": "Create a modal editor",
|
|
24
|
+
"components": ["Modal", "Form", "Input"],
|
|
25
|
+
"source": "import { Modal, Form, Input } from \"react-kui\";\nexport default function Example() { return (<Modal open title=\"Edit\"><Form><Input /></Form></Modal>); }\n"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "data-table",
|
|
29
|
+
"prompt": "Create a striped data table",
|
|
30
|
+
"components": ["Table"],
|
|
31
|
+
"source": "import { Table } from \"react-kui\";\nexport default function Example() { return (<Table striped data={[]} columns={[]} />); }\n",
|
|
32
|
+
"expectProps": [
|
|
33
|
+
{
|
|
34
|
+
"component": "Table",
|
|
35
|
+
"prop": "striped",
|
|
36
|
+
"value": true
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "multiple-select",
|
|
42
|
+
"prompt": "Create a multiple select",
|
|
43
|
+
"components": ["Select"],
|
|
44
|
+
"source": "import { Select } from \"react-kui\";\nexport default function Example() { return (<Select multiple options={[]} />); }\n",
|
|
45
|
+
"expectProps": [
|
|
46
|
+
{
|
|
47
|
+
"component": "Select",
|
|
48
|
+
"prop": "multiple",
|
|
49
|
+
"value": true
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "tree-browser",
|
|
55
|
+
"prompt": "Create a checkable tree",
|
|
56
|
+
"components": ["Tree"],
|
|
57
|
+
"source": "import { Tree } from \"react-kui\";\nexport default function Example() { return (<Tree checkable data={[]} />); }\n",
|
|
58
|
+
"expectProps": [
|
|
59
|
+
{
|
|
60
|
+
"component": "Tree",
|
|
61
|
+
"prop": "checkable",
|
|
62
|
+
"value": true
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "file-upload",
|
|
68
|
+
"prompt": "Create a file uploader",
|
|
69
|
+
"components": ["Upload", "Button"],
|
|
70
|
+
"source": "import { Upload, Button } from \"react-kui\";\nexport default function Example() { return (<Upload><Button>Upload</Button></Upload>); }\n"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "pagination",
|
|
74
|
+
"prompt": "Create simple pagination",
|
|
75
|
+
"components": ["Page"],
|
|
76
|
+
"source": "import { Page } from \"react-kui\";\nexport default function Example() { return (<Page simple total={100} />); }\n",
|
|
77
|
+
"expectProps": [
|
|
78
|
+
{
|
|
79
|
+
"component": "Page",
|
|
80
|
+
"prop": "simple",
|
|
81
|
+
"value": true
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "drawer",
|
|
87
|
+
"prompt": "Create a settings drawer",
|
|
88
|
+
"components": ["Drawer"],
|
|
89
|
+
"source": "import { Drawer } from \"react-kui\";\nexport default function Example() { return (<Drawer open title=\"Settings\">Settings</Drawer>); }\n"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "tabs",
|
|
93
|
+
"prompt": "Create two tabs",
|
|
94
|
+
"components": ["Tabs", "TabPanel"],
|
|
95
|
+
"source": "import { Tabs, TabPanel } from \"react-kui\";\nexport default function Example() { return (<Tabs><TabPanel key=\"a\" title=\"A\">A</TabPanel><TabPanel key=\"b\" title=\"B\">B</TabPanel></Tabs>); }\n"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "steps",
|
|
99
|
+
"prompt": "Create a three-step flow",
|
|
100
|
+
"components": ["Steps"],
|
|
101
|
+
"source": "import { Steps } from \"react-kui\";\nexport default function Example() { return (<Steps items={[{ title: \"One\" }, { title: \"Two\" }, { title: \"Three\" }]} />); }\n"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "autocomplete",
|
|
105
|
+
"prompt": "Create autocomplete",
|
|
106
|
+
"components": ["AutoComplete"],
|
|
107
|
+
"source": "import { AutoComplete } from \"react-kui\";\nexport default function Example() { return (<AutoComplete options={[]} />); }\n"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "tags",
|
|
111
|
+
"prompt": "Create tag input",
|
|
112
|
+
"components": ["InputTag"],
|
|
113
|
+
"source": "import { InputTag } from \"react-kui\";\nexport default function Example() { return (<InputTag value={[]} />); }\n"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "mentions",
|
|
117
|
+
"prompt": "Create mentions input",
|
|
118
|
+
"components": ["Mentions"],
|
|
119
|
+
"source": "import { Mentions } from \"react-kui\";\nexport default function Example() { return (<Mentions options={[]} />); }\n"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "tour",
|
|
123
|
+
"prompt": "Create a guided tour",
|
|
124
|
+
"components": ["Tour"],
|
|
125
|
+
"source": "import { Tour } from \"react-kui\";\nexport default function Example() { return (<Tour steps={[]} />); }\n"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "date-picker",
|
|
129
|
+
"prompt": "Create a date picker",
|
|
130
|
+
"components": ["DatePicker"],
|
|
131
|
+
"source": "import { DatePicker } from \"react-kui\";\nexport default function Example() { return (<DatePicker />); }\n"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "transfer",
|
|
135
|
+
"prompt": "Create a transfer list",
|
|
136
|
+
"components": ["Transfer"],
|
|
137
|
+
"source": "import { Transfer } from \"react-kui\";\nexport default function Example() { return (<Transfer dataSource={[]} />); }\n"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "responsive-grid",
|
|
141
|
+
"prompt": "Create a responsive grid",
|
|
142
|
+
"components": ["Grid", "GridItem"],
|
|
143
|
+
"source": "import { Grid, GridItem } from \"react-kui\";\nexport default function Example() { return (<Grid cols={3}><GridItem>One</GridItem></Grid>); }\n"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "card",
|
|
147
|
+
"prompt": "Create a bordered card",
|
|
148
|
+
"components": ["Card"],
|
|
149
|
+
"source": "import { Card } from \"react-kui\";\nexport default function Example() { return (<Card bordered title=\"Profile\">Content</Card>); }\n",
|
|
150
|
+
"expectProps": [
|
|
151
|
+
{
|
|
152
|
+
"component": "Card",
|
|
153
|
+
"prop": "bordered",
|
|
154
|
+
"value": true
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "virtual-select",
|
|
160
|
+
"prompt": "Create a large virtual select",
|
|
161
|
+
"components": ["Select"],
|
|
162
|
+
"source": "import { Select } from \"react-kui\";\nexport default function Example() { return (<Select virtual options={[]} itemHeight={33} />); }\n",
|
|
163
|
+
"expectProps": [
|
|
164
|
+
{
|
|
165
|
+
"component": "Select",
|
|
166
|
+
"prop": "virtual",
|
|
167
|
+
"value": true
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "event-calendar",
|
|
173
|
+
"prompt": "Create a Chinese-localized monthly calendar with an empty event list.",
|
|
174
|
+
"components": ["Calendar", "ConfigProvider"],
|
|
175
|
+
"source": "import { Calendar, ConfigProvider } from \"react-kui\";\nimport zhCN from \"react-kui/locale/zh-CN\";\nexport default function Example() { return (<ConfigProvider locale={zhCN}><Calendar events={[]} /></ConfigProvider>); }\n"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "task-kanban",
|
|
179
|
+
"prompt": "Create a task kanban with empty columns and task data.",
|
|
180
|
+
"components": ["Kanban"],
|
|
181
|
+
"source": "import { Kanban } from \"react-kui\";\nexport default function Example() { return (<Kanban columns={[]} data={[]} />); }\n"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "page-heading",
|
|
185
|
+
"prompt": "Create a page heading with a primary action",
|
|
186
|
+
"components": ["PageHeader", "Button"],
|
|
187
|
+
"source": "import { PageHeader, Button } from \"react-kui\";\nexport default function Example() { return <PageHeader title=\"Projects\" actions={<Button type=\"primary\">Create</Button>} />; }\n"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "business-form",
|
|
191
|
+
"prompt": "Required/email validation, disabled state, submit, reset, loading and error handling. Use only local mocked requests.",
|
|
192
|
+
"components": ["Form", "FormItem", "Input", "Button", "Space"],
|
|
193
|
+
"sourceFile": "../templates/form.tsx"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "business-table",
|
|
197
|
+
"prompt": "Local asynchronous mock API, search, paging, loading, errors and stale response protection. Use only local mocked requests.",
|
|
198
|
+
"components": ["Table", "Page", "Input", "Button", "Space"],
|
|
199
|
+
"sourceFile": "../templates/table.tsx"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "business-modal-editor",
|
|
203
|
+
"prompt": "Isolated editing draft, validation, asynchronous save, cancel and loading state. Use only local mocked requests.",
|
|
204
|
+
"components": ["Modal", "Form", "FormItem", "Input", "Button", "Space"],
|
|
205
|
+
"sourceFile": "../templates/modal-editor.tsx"
|
|
206
|
+
}
|
|
207
|
+
]
|