@object-ui/components 0.3.0 → 0.5.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/.turbo/turbo-build.log +47 -0
- package/CHANGELOG.md +10 -0
- package/README.md +32 -1
- package/README_SHADCN_SYNC.md +281 -0
- package/TESTING.md +335 -0
- package/dist/index.css +1 -1
- package/dist/index.js +45067 -34357
- package/dist/index.umd.cjs +54 -42
- package/dist/src/SchemaRenderer.d.ts +3 -0
- package/dist/src/{ui → custom}/button-group.d.ts +1 -1
- package/dist/src/custom/combobox.d.ts +22 -0
- package/dist/src/custom/date-picker.d.ts +15 -0
- package/dist/src/custom/field.d.ts +19 -0
- package/dist/src/{ui → custom}/filter-builder.d.ts +7 -0
- package/dist/src/custom/index.d.ts +12 -0
- package/dist/src/custom/input-group.d.ts +14 -0
- package/dist/src/{ui → custom}/item.d.ts +8 -1
- package/dist/src/{ui → custom}/kbd.d.ts +7 -0
- package/dist/src/custom/native-select.d.ts +12 -0
- package/dist/src/custom/sort-builder.d.ts +22 -0
- package/dist/src/custom/spinner.d.ts +10 -0
- package/dist/src/hooks/use-mobile.d.ts +7 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/renderers/basic/button-group.d.ts +8 -0
- package/dist/src/renderers/basic/div.d.ts +7 -0
- package/dist/src/renderers/basic/html.d.ts +7 -0
- package/dist/src/renderers/basic/icon.d.ts +7 -0
- package/dist/src/renderers/basic/image.d.ts +7 -0
- package/dist/src/renderers/basic/navigation-menu.d.ts +8 -0
- package/dist/src/renderers/basic/pagination.d.ts +8 -0
- package/dist/src/renderers/basic/separator.d.ts +7 -0
- package/dist/src/renderers/basic/span.d.ts +7 -0
- package/dist/src/renderers/basic/text.d.ts +7 -0
- package/dist/src/renderers/complex/carousel.d.ts +7 -0
- package/dist/src/renderers/complex/data-table.d.ts +7 -0
- package/dist/src/renderers/complex/filter-builder.d.ts +7 -0
- package/dist/src/renderers/complex/resizable.d.ts +7 -0
- package/dist/src/renderers/complex/scroll-area.d.ts +7 -0
- package/dist/src/renderers/complex/table.d.ts +7 -0
- package/dist/src/renderers/data-display/alert.d.ts +7 -0
- package/dist/src/renderers/data-display/avatar.d.ts +7 -0
- package/dist/src/renderers/data-display/badge.d.ts +7 -0
- package/dist/src/renderers/data-display/breadcrumb.d.ts +8 -0
- package/dist/src/renderers/data-display/kbd.d.ts +8 -0
- package/dist/src/renderers/data-display/list.d.ts +7 -0
- package/dist/src/renderers/data-display/statistic.d.ts +7 -0
- package/dist/src/renderers/data-display/table.d.ts +8 -0
- package/dist/src/renderers/data-display/tree-view.d.ts +7 -0
- package/dist/src/renderers/disclosure/accordion.d.ts +7 -0
- package/dist/src/renderers/disclosure/collapsible.d.ts +7 -0
- package/dist/src/renderers/disclosure/toggle-group.d.ts +8 -0
- package/dist/src/renderers/feedback/empty.d.ts +8 -0
- package/dist/src/renderers/feedback/loading.d.ts +7 -0
- package/dist/src/renderers/feedback/progress.d.ts +7 -0
- package/dist/src/renderers/feedback/skeleton.d.ts +7 -0
- package/dist/src/renderers/feedback/sonner.d.ts +8 -0
- package/dist/src/renderers/feedback/spinner.d.ts +8 -0
- package/dist/src/renderers/feedback/toast.d.ts +8 -0
- package/dist/src/renderers/feedback/toaster.d.ts +7 -0
- package/dist/src/renderers/form/button.d.ts +7 -0
- package/dist/src/renderers/form/calendar.d.ts +7 -0
- package/dist/src/renderers/form/checkbox.d.ts +7 -0
- package/dist/src/renderers/form/combobox.d.ts +8 -0
- package/dist/src/renderers/form/command.d.ts +8 -0
- package/dist/src/renderers/form/date-picker.d.ts +7 -0
- package/dist/src/renderers/form/file-upload.d.ts +7 -0
- package/dist/src/renderers/form/form.d.ts +7 -0
- package/dist/src/renderers/form/input-otp.d.ts +7 -0
- package/dist/src/renderers/form/input.d.ts +7 -0
- package/dist/src/renderers/form/label.d.ts +7 -0
- package/dist/src/renderers/form/radio-group.d.ts +7 -0
- package/dist/src/renderers/form/select.d.ts +7 -0
- package/dist/src/renderers/form/slider.d.ts +7 -0
- package/dist/src/renderers/form/switch.d.ts +7 -0
- package/dist/src/renderers/form/textarea.d.ts +7 -0
- package/dist/src/renderers/form/toggle.d.ts +7 -0
- package/dist/src/renderers/layout/aspect-ratio.d.ts +8 -0
- package/dist/src/renderers/layout/card.d.ts +7 -0
- package/dist/src/renderers/layout/container.d.ts +7 -0
- package/dist/src/renderers/layout/flex.d.ts +7 -0
- package/dist/src/renderers/layout/grid.d.ts +7 -0
- package/dist/src/renderers/layout/page.d.ts +1 -1
- package/dist/src/renderers/layout/semantic.d.ts +7 -0
- package/dist/src/renderers/layout/stack.d.ts +7 -0
- package/dist/src/renderers/layout/tabs.d.ts +7 -0
- package/dist/src/renderers/navigation/header-bar.d.ts +7 -0
- package/dist/src/renderers/navigation/sidebar.d.ts +7 -0
- package/dist/src/renderers/overlay/alert-dialog.d.ts +7 -0
- package/dist/src/renderers/overlay/context-menu.d.ts +7 -0
- package/dist/src/renderers/overlay/dialog.d.ts +7 -0
- package/dist/src/renderers/overlay/drawer.d.ts +7 -0
- package/dist/src/renderers/overlay/dropdown-menu.d.ts +7 -0
- package/dist/src/renderers/overlay/hover-card.d.ts +7 -0
- package/dist/src/renderers/overlay/menubar.d.ts +8 -0
- package/dist/src/renderers/overlay/popover.d.ts +7 -0
- package/dist/src/renderers/overlay/sheet.d.ts +7 -0
- package/dist/src/renderers/overlay/tooltip.d.ts +7 -0
- package/dist/src/renderers/placeholders.d.ts +9 -0
- package/dist/src/ui/accordion.d.ts +11 -4
- package/dist/src/ui/alert-dialog.d.ts +24 -11
- package/dist/src/ui/alert.d.ts +11 -5
- package/dist/src/ui/aspect-ratio.d.ts +8 -1
- package/dist/src/ui/avatar.d.ts +10 -3
- package/dist/src/ui/badge.d.ts +10 -3
- package/dist/src/ui/breadcrumb.d.ts +23 -8
- package/dist/src/ui/button.d.ts +10 -5
- package/dist/src/ui/calendar.d.ts +8 -1
- package/dist/src/ui/card.d.ts +14 -8
- package/dist/src/ui/carousel.d.ts +12 -6
- package/dist/src/ui/chart.d.ts +62 -0
- package/dist/src/ui/checkbox.d.ts +8 -1
- package/dist/src/ui/collapsible.d.ts +10 -3
- package/dist/src/ui/command.d.ts +85 -16
- package/dist/src/ui/context-menu.d.ts +21 -12
- package/dist/src/ui/dialog.d.ts +24 -13
- package/dist/src/ui/drawer.d.ts +26 -10
- package/dist/src/ui/dropdown-menu.d.ts +27 -18
- package/dist/src/ui/form.d.ts +13 -7
- package/dist/src/ui/hover-card.d.ts +10 -3
- package/dist/src/ui/index.d.ts +10 -11
- package/dist/src/ui/input-otp.d.ts +37 -7
- package/dist/src/ui/input.d.ts +7 -0
- package/dist/src/ui/label.d.ts +9 -1
- package/dist/src/ui/menubar.d.ts +26 -17
- package/dist/src/ui/navigation-menu.d.ts +16 -11
- package/dist/src/ui/pagination.d.ts +32 -10
- package/dist/src/ui/popover.d.ts +11 -5
- package/dist/src/ui/progress.d.ts +8 -1
- package/dist/src/ui/radio-group.d.ts +9 -2
- package/dist/src/ui/resizable.d.ts +12 -8
- package/dist/src/ui/scroll-area.d.ts +9 -2
- package/dist/src/ui/select.d.ts +18 -13
- package/dist/src/ui/separator.d.ts +7 -0
- package/dist/src/ui/sheet.d.ts +30 -11
- package/dist/src/ui/sidebar.d.ts +41 -38
- package/dist/src/ui/skeleton.d.ts +8 -1
- package/dist/src/ui/slider.d.ts +8 -1
- package/dist/src/ui/sonner.d.ts +2 -1
- package/dist/src/ui/switch.d.ts +9 -2
- package/dist/src/ui/table.d.ts +15 -8
- package/dist/src/ui/tabs.d.ts +8 -1
- package/dist/src/ui/textarea.d.ts +8 -1
- package/dist/src/ui/toast.d.ts +22 -0
- package/dist/src/ui/toggle-group.d.ts +15 -5
- package/dist/src/ui/toggle.d.ts +11 -1
- package/dist/src/ui/tooltip.d.ts +11 -4
- package/dist/src/ui/typography.d.ts +21 -0
- package/metadata/ObjectGrid.component.yml +72 -0
- package/package.json +35 -13
- package/postcss.config.js +9 -1
- package/shadcn-components.json +315 -0
- package/src/SchemaRenderer.tsx +28 -0
- package/src/__tests__/PageRendererRegions.test.tsx +59 -0
- package/src/__tests__/README.md +124 -0
- package/src/__tests__/Registry.test.ts +21 -0
- package/src/__tests__/basic-renderers.test.tsx +255 -0
- package/src/__tests__/complex-disclosure-renderers.test.tsx +302 -0
- package/src/__tests__/feedback-overlay-renderers.test.tsx +349 -0
- package/src/__tests__/form-renderers.test.tsx +364 -0
- package/src/__tests__/layout-data-renderers.test.tsx +340 -0
- package/src/__tests__/test-utils.tsx +190 -0
- package/src/{ui → custom}/button-group.tsx +9 -1
- package/src/custom/combobox.tsx +104 -0
- package/src/custom/date-picker.tsx +61 -0
- package/src/{ui → custom}/empty.tsx +8 -0
- package/src/custom/field.tsx +81 -0
- package/src/{ui → custom}/filter-builder.tsx +11 -3
- package/src/custom/index.ts +12 -0
- package/src/custom/input-group.tsx +53 -0
- package/src/{ui → custom}/item.tsx +9 -1
- package/src/{ui → custom}/kbd.tsx +8 -0
- package/src/custom/native-select.tsx +33 -0
- package/src/custom/sort-builder.tsx +129 -0
- package/src/custom/spinner.tsx +26 -0
- package/src/hooks/use-mobile.tsx +8 -0
- package/src/index.css +105 -54
- package/src/index.test.ts +8 -0
- package/src/index.ts +22 -1
- package/src/lib/utils.tsx +8 -0
- package/src/new-components.test.ts +8 -9
- package/src/renderers/basic/button-group.tsx +79 -0
- package/src/renderers/basic/div.tsx +21 -2
- package/src/renderers/basic/html.tsx +9 -0
- package/src/renderers/basic/icon.tsx +67 -3
- package/src/renderers/basic/image.tsx +13 -1
- package/src/renderers/basic/index.ts +11 -0
- package/src/renderers/basic/navigation-menu.tsx +81 -0
- package/src/renderers/basic/pagination.tsx +109 -0
- package/src/renderers/basic/separator.tsx +10 -1
- package/src/renderers/basic/span.tsx +21 -2
- package/src/renderers/basic/text.tsx +12 -2
- package/src/renderers/complex/__tests__/data-table.test.ts +8 -0
- package/src/renderers/complex/carousel.tsx +12 -3
- package/src/renderers/complex/data-table.tsx +150 -96
- package/src/renderers/complex/filter-builder.tsx +10 -1
- package/src/renderers/complex/index.ts +9 -3
- package/src/renderers/complex/resizable.tsx +10 -1
- package/src/renderers/complex/scroll-area.tsx +33 -7
- package/src/renderers/complex/table.tsx +11 -2
- package/src/renderers/data-display/alert.tsx +9 -0
- package/src/renderers/data-display/avatar.tsx +9 -0
- package/src/renderers/data-display/badge.tsx +9 -0
- package/src/renderers/data-display/breadcrumb.tsx +60 -0
- package/src/renderers/data-display/index.ts +12 -0
- package/src/renderers/data-display/kbd.tsx +50 -0
- package/src/renderers/data-display/list.tsx +29 -49
- package/src/renderers/data-display/statistic.tsx +45 -48
- package/src/renderers/data-display/table.tsx +78 -0
- package/src/renderers/data-display/tree-view.tsx +32 -37
- package/src/renderers/disclosure/accordion.tsx +9 -0
- package/src/renderers/disclosure/collapsible.tsx +9 -0
- package/src/renderers/disclosure/index.ts +9 -0
- package/src/renderers/disclosure/toggle-group.tsx +79 -0
- package/src/renderers/feedback/empty.tsx +49 -0
- package/src/renderers/feedback/index.ts +12 -0
- package/src/renderers/feedback/loading.tsx +10 -1
- package/src/renderers/feedback/progress.tsx +9 -0
- package/src/renderers/feedback/skeleton.tsx +9 -0
- package/src/renderers/feedback/sonner.tsx +56 -0
- package/src/renderers/feedback/spinner.tsx +55 -0
- package/src/renderers/feedback/toast.tsx +59 -0
- package/src/renderers/feedback/toaster.tsx +14 -17
- package/src/renderers/form/button.tsx +43 -1
- package/src/renderers/form/calendar.tsx +9 -0
- package/src/renderers/form/checkbox.tsx +46 -16
- package/src/renderers/form/combobox.tsx +48 -0
- package/src/renderers/form/command.tsx +58 -0
- package/src/renderers/form/date-picker.tsx +11 -2
- package/src/renderers/form/file-upload.tsx +11 -2
- package/src/renderers/form/form.tsx +104 -18
- package/src/renderers/form/index.ts +10 -0
- package/src/renderers/form/input-otp.tsx +35 -15
- package/src/renderers/form/input.tsx +92 -50
- package/src/renderers/form/label.tsx +9 -0
- package/src/renderers/form/radio-group.tsx +9 -0
- package/src/renderers/form/select.tsx +43 -15
- package/src/renderers/form/slider.tsx +17 -1
- package/src/renderers/form/switch.tsx +9 -0
- package/src/renderers/form/textarea.tsx +58 -27
- package/src/renderers/form/toggle.tsx +11 -45
- package/src/renderers/index.ts +8 -0
- package/src/renderers/layout/aspect-ratio.tsx +51 -0
- package/src/renderers/layout/card.tsx +18 -2
- package/src/renderers/layout/container.tsx +21 -12
- package/src/renderers/layout/flex.tsx +17 -8
- package/src/renderers/layout/grid.tsx +31 -8
- package/src/renderers/layout/index.ts +9 -0
- package/src/renderers/layout/page.tsx +44 -24
- package/src/renderers/layout/semantic.tsx +9 -0
- package/src/renderers/layout/stack.tsx +18 -9
- package/src/renderers/layout/tabs.tsx +51 -17
- package/src/renderers/navigation/header-bar.tsx +10 -1
- package/src/renderers/navigation/index.ts +8 -0
- package/src/renderers/navigation/sidebar.tsx +13 -0
- package/src/renderers/overlay/alert-dialog.tsx +9 -0
- package/src/renderers/overlay/context-menu.tsx +10 -1
- package/src/renderers/overlay/dialog.tsx +9 -0
- package/src/renderers/overlay/drawer.tsx +9 -0
- package/src/renderers/overlay/dropdown-menu.tsx +9 -0
- package/src/renderers/overlay/hover-card.tsx +9 -0
- package/src/renderers/overlay/index.ts +9 -0
- package/src/renderers/overlay/menubar.tsx +76 -0
- package/src/renderers/overlay/popover.tsx +9 -0
- package/src/renderers/overlay/sheet.tsx +9 -0
- package/src/renderers/overlay/tooltip.tsx +9 -0
- package/src/renderers/placeholders.tsx +107 -0
- package/src/stories/CRMApp.stories.tsx +706 -0
- package/src/stories/Guide.mdx +55 -0
- package/src/stories/Introduction.mdx +34 -0
- package/src/stories/MockedData.stories.tsx +71 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/stories-json/accordion.stories.tsx +43 -0
- package/src/stories-json/aggrid.stories.tsx +103 -0
- package/src/stories-json/alert.stories.tsx +39 -0
- package/src/stories-json/aspect-ratio.stories.tsx +34 -0
- package/src/stories-json/avatar.stories.tsx +38 -0
- package/src/stories-json/badge.stories.tsx +53 -0
- package/src/stories-json/breadcrumb.stories.tsx +30 -0
- package/src/stories-json/button-group.stories.tsx +43 -0
- package/src/stories-json/button.stories.tsx +73 -0
- package/src/stories-json/calendar.stories.tsx +85 -0
- package/src/stories-json/card.stories.tsx +48 -0
- package/src/stories-json/carousel.stories.tsx +33 -0
- package/src/stories-json/charts.stories.tsx +195 -0
- package/src/stories-json/chatbot.stories.tsx +248 -0
- package/src/stories-json/code-editor.stories.tsx +92 -0
- package/src/stories-json/collapsible.stories.tsx +40 -0
- package/src/stories-json/controls.stories.tsx +36 -0
- package/src/stories-json/dashboard.stories.tsx +318 -0
- package/src/stories-json/data-table.stories.tsx +60 -0
- package/src/stories-json/data_display_extras.stories.tsx +102 -0
- package/src/stories-json/date-picker.stories.tsx +28 -0
- package/src/stories-json/detail-view.stories.tsx +258 -0
- package/src/stories-json/dialog.stories.tsx +43 -0
- package/src/stories-json/feedback_extras.stories.tsx +40 -0
- package/src/stories-json/feedback_others.stories.tsx +46 -0
- package/src/stories-json/form_advanced.stories.tsx +117 -0
- package/src/stories-json/form_extras.stories.tsx +123 -0
- package/src/stories-json/grid.stories.tsx +56 -0
- package/src/stories-json/icon.stories.tsx +36 -0
- package/src/stories-json/input.stories.tsx +52 -0
- package/src/stories-json/kanban.stories.tsx +295 -0
- package/src/stories-json/layout_extended.stories.tsx +76 -0
- package/src/stories-json/layout_flex.stories.tsx +107 -0
- package/src/stories-json/list-view.stories.tsx +97 -0
- package/src/stories-json/markdown.stories.tsx +129 -0
- package/src/stories-json/menus.stories.tsx +63 -0
- package/src/stories-json/metric-card.stories.tsx +143 -0
- package/src/stories-json/navigation-menu.stories.tsx +37 -0
- package/src/stories-json/object-aggrid.stories.tsx +252 -0
- package/src/stories-json/object-form.stories.tsx +130 -0
- package/src/stories-json/object-gantt.stories.tsx +114 -0
- package/src/stories-json/object-grid.stories.tsx +157 -0
- package/src/stories-json/object-map.stories.tsx +116 -0
- package/src/stories-json/object-view.stories.tsx +118 -0
- package/src/stories-json/overlay_extras.stories.tsx +113 -0
- package/src/stories-json/overlay_others.stories.tsx +76 -0
- package/src/stories-json/page.stories.tsx +55 -0
- package/src/stories-json/reports.stories.tsx +163 -0
- package/src/stories-json/resizable.stories.tsx +44 -0
- package/src/stories-json/select.stories.tsx +34 -0
- package/src/stories-json/separator.stories.tsx +41 -0
- package/src/stories-json/sidebar.stories.tsx +147 -0
- package/src/stories-json/statistic.stories.tsx +44 -0
- package/src/stories-json/tabs.stories.tsx +51 -0
- package/src/stories-json/timeline.stories.tsx +188 -0
- package/src/stories-json/typography.stories.tsx +45 -0
- package/src/ui/accordion.tsx +55 -53
- package/src/ui/alert-dialog.tsx +111 -117
- package/src/ui/alert.tsx +46 -57
- package/src/ui/aspect-ratio.tsx +9 -5
- package/src/ui/avatar.tsx +49 -42
- package/src/ui/badge.tsx +18 -20
- package/src/ui/breadcrumb.tsx +89 -75
- package/src/ui/button.tsx +38 -37
- package/src/ui/calendar.tsx +37 -53
- package/src/ui/card.tsx +59 -110
- package/src/ui/carousel.tsx +144 -113
- package/src/ui/chart.tsx +367 -0
- package/src/ui/checkbox.tsx +28 -22
- package/src/ui/collapsible.tsx +13 -25
- package/src/ui/command.tsx +114 -135
- package/src/ui/context-menu.tsx +77 -116
- package/src/ui/dialog.tsx +102 -113
- package/src/ui/drawer.tsx +90 -99
- package/src/ui/dropdown-menu.tsx +142 -188
- package/src/ui/form.tsx +59 -40
- package/src/ui/hover-card.tsx +26 -33
- package/src/ui/index.ts +11 -11
- package/src/ui/input-otp.tsx +53 -55
- package/src/ui/input.tsx +21 -15
- package/src/ui/label.tsx +25 -15
- package/src/ui/menubar.tsx +196 -206
- package/src/ui/navigation-menu.tsx +104 -136
- package/src/ui/pagination.tsx +94 -96
- package/src/ui/popover.tsx +29 -38
- package/src/ui/progress.tsx +29 -34
- package/src/ui/radio-group.tsx +27 -20
- package/src/ui/resizable.tsx +40 -42
- package/src/ui/scroll-area.tsx +46 -48
- package/src/ui/select.tsx +140 -160
- package/src/ui/separator.tsx +10 -2
- package/src/ui/sheet.tsx +118 -107
- package/src/ui/sidebar.tsx +471 -418
- package/src/ui/skeleton.tsx +14 -11
- package/src/ui/slider.tsx +27 -54
- package/src/ui/sonner.tsx +29 -19
- package/src/ui/switch.tsx +27 -21
- package/src/ui/table.tsx +102 -97
- package/src/ui/tabs.tsx +14 -37
- package/src/ui/textarea.tsx +16 -4
- package/src/ui/toast.tsx +137 -0
- package/src/ui/toggle-group.tsx +37 -55
- package/src/ui/toggle.tsx +30 -27
- package/src/ui/tooltip.tsx +29 -52
- package/src/ui/typography.tsx +85 -0
- package/tsconfig.json +2 -1
- package/vite.config.ts +20 -2
- package/vitest.config.ts +5 -0
- package/dist/src/index.test.d.ts +0 -1
- package/dist/src/new-components.test.d.ts +0 -1
- package/dist/src/renderers/complex/__tests__/data-table.test.d.ts +0 -0
- package/dist/src/renderers/complex/calendar-view.d.ts +0 -1
- package/dist/src/renderers/complex/chatbot.d.ts +0 -1
- package/dist/src/renderers/complex/chatbot.test.d.ts +0 -1
- package/dist/src/renderers/complex/timeline.d.ts +0 -1
- package/dist/src/ui/calendar-view.d.ts +0 -21
- package/dist/src/ui/chatbot.d.ts +0 -36
- package/dist/src/ui/field.d.ts +0 -24
- package/dist/src/ui/input-group.d.ts +0 -16
- package/dist/src/ui/spinner.d.ts +0 -3
- package/dist/src/ui/timeline.d.ts +0 -25
- package/metadata/ObjectTable.component.yml +0 -41
- package/src/renderers/complex/calendar-view.tsx +0 -219
- package/src/renderers/complex/chatbot.test.ts +0 -44
- package/src/renderers/complex/chatbot.tsx +0 -185
- package/src/renderers/complex/timeline.tsx +0 -466
- package/src/ui/calendar-view.tsx +0 -503
- package/src/ui/chatbot.tsx +0 -240
- package/src/ui/field.tsx +0 -246
- package/src/ui/input-group.tsx +0 -170
- package/src/ui/spinner.tsx +0 -38
- package/src/ui/timeline.tsx +0 -266
- package/tailwind.config.js +0 -75
- /package/dist/src/{ui → custom}/empty.d.ts +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
> @object-ui/components@0.5.0 prebuild /home/runner/work/objectui/objectui/packages/components
|
|
3
|
+
> pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @object-ui/types@0.5.0 build /home/runner/work/objectui/objectui/packages/types
|
|
7
|
+
> tsc
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
> @object-ui/core@0.5.0 build /home/runner/work/objectui/objectui/packages/core
|
|
11
|
+
> tsc
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
> @object-ui/react@0.5.0 build /home/runner/work/objectui/objectui/packages/react
|
|
15
|
+
> tsc
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
> @object-ui/components@0.5.0 build /home/runner/work/objectui/objectui/packages/components
|
|
19
|
+
> vite build
|
|
20
|
+
|
|
21
|
+
[36mvite v7.3.1 [32mbuilding client environment for production...[36m[39m
|
|
22
|
+
transforming...
|
|
23
|
+
[32m✓[39m 3526 modules transformed.
|
|
24
|
+
rendering chunks...
|
|
25
|
+
[32m
|
|
26
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
27
|
+
[96msrc/renderers/complex/data-table.tsx[0m:[93m494[0m:[93m25[0m - [91merror[0m[90m TS2578: [0mUnused '@ts-expect-error' directive.
|
|
28
|
+
|
|
29
|
+
[7m494[0m // @ts-expect-error - onRowClick might not be in schema type definition
|
|
30
|
+
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
31
|
+
[96msrc/renderers/complex/data-table.tsx[0m:[93m498[0m:[93m25[0m - [91merror[0m[90m TS2578: [0mUnused '@ts-expect-error' directive.
|
|
32
|
+
|
|
33
|
+
[7m498[0m // @ts-expect-error - onRowClick might not be in schema type definition
|
|
34
|
+
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
35
|
+
[96msrc/renderers/complex/data-table.tsx[0m:[93m505[0m:[93m28[0m - [91merror[0m[90m TS2578: [0mUnused '@ts-expect-error' directive.
|
|
36
|
+
|
|
37
|
+
[7m505[0m // @ts-expect-error - onRowClick might not be in schema type definition
|
|
38
|
+
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
39
|
+
|
|
40
|
+
computing gzip size...
|
|
41
|
+
[2mdist/[22m[35mindex.css [39m[1m[2m 105.80 kB[22m[1m[22m[2m │ gzip: 17.37 kB[22m
|
|
42
|
+
[2mdist/[22m[36mindex.js [39m[1m[33m1,813.35 kB[39m[22m[2m │ gzip: 425.87 kB[22m
|
|
43
|
+
[32m[36m[vite:dts][32m Declaration files built in 6799ms.
|
|
44
|
+
[39m
|
|
45
|
+
[2mdist/[22m[35mindex.css [39m[1m[2m 105.80 kB[22m[1m[22m[2m │ gzip: 17.37 kB[22m
|
|
46
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m1,310.74 kB[39m[22m[2m │ gzip: 363.70 kB[22m
|
|
47
|
+
[32m✓ built in 15.06s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @object-ui/components
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Maintenance release - Documentation and build improvements
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @object-ui/types@0.3.1
|
|
10
|
+
- @object-ui/core@0.3.1
|
|
11
|
+
- @object-ui/react@0.3.1
|
|
12
|
+
|
|
3
13
|
## 0.3.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -6,10 +6,41 @@ Standard UI component library for Object UI, built with Shadcn UI + Tailwind CSS
|
|
|
6
6
|
|
|
7
7
|
- 🎨 **Tailwind Native** - Built entirely with Tailwind CSS utility classes
|
|
8
8
|
- 🧩 **Shadcn UI** - Based on Radix UI primitives for accessibility
|
|
9
|
-
- 📦 **
|
|
9
|
+
- 📦 **60+ Components** - Complete set of UI components (46 from Shadcn + 14 custom)
|
|
10
10
|
- ♿ **Accessible** - WCAG compliant components
|
|
11
11
|
- 🎯 **Type-Safe** - Full TypeScript support
|
|
12
12
|
- 🔌 **Extensible** - Easy to customize and extend
|
|
13
|
+
- � **Storybook** - Interactive component showcase and development environment
|
|
14
|
+
- 🔄 **Sync Tools** - Scripts to keep components updated with latest Shadcn
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
We use Storybook for component development and testing.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Start Storybook
|
|
22
|
+
pnpm storybook
|
|
23
|
+
|
|
24
|
+
# Build Storybook
|
|
25
|
+
pnpm build-storybook
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Keeping Components Updated
|
|
29
|
+
|
|
30
|
+
ObjectUI provides tools to sync components with the latest Shadcn UI versions:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Analyze components (offline)
|
|
34
|
+
pnpm shadcn:analyze
|
|
35
|
+
|
|
36
|
+
# Check for updates (online)
|
|
37
|
+
pnpm shadcn:check
|
|
38
|
+
|
|
39
|
+
# Update a component
|
|
40
|
+
pnpm shadcn:update button --backup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**📚 See [SHADCN_SYNC.md](../../docs/SHADCN_SYNC.md) for the complete guide.**
|
|
13
44
|
|
|
14
45
|
## Installation
|
|
15
46
|
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Shadcn Components Synchronization
|
|
2
|
+
|
|
3
|
+
This directory contains tools for keeping ObjectUI components in sync with Shadcn UI.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `shadcn-components.json` - Component manifest tracking Shadcn components and custom ObjectUI components
|
|
8
|
+
- `shadcn-sync.js` - Automated sync script (requires network access to ui.shadcn.com)
|
|
9
|
+
|
|
10
|
+
## Component Categories
|
|
11
|
+
|
|
12
|
+
### Shadcn Components (46)
|
|
13
|
+
|
|
14
|
+
These components come from Shadcn UI and can be updated from the registry:
|
|
15
|
+
|
|
16
|
+
**Form Controls:**
|
|
17
|
+
- input, textarea, select, checkbox, radio-group, switch, form, label, input-otp
|
|
18
|
+
|
|
19
|
+
**Layout:**
|
|
20
|
+
- card, tabs, accordion, separator, scroll-area, resizable
|
|
21
|
+
|
|
22
|
+
**Overlays:**
|
|
23
|
+
- dialog, popover, tooltip, hover-card, sheet, drawer, alert-dialog
|
|
24
|
+
|
|
25
|
+
**Navigation:**
|
|
26
|
+
- button, breadcrumb, navigation-menu, dropdown-menu, context-menu, menubar, pagination
|
|
27
|
+
|
|
28
|
+
**Data Display:**
|
|
29
|
+
- table, avatar, badge, skeleton, progress, slider
|
|
30
|
+
|
|
31
|
+
**Feedback:**
|
|
32
|
+
- alert, toast, sonner
|
|
33
|
+
|
|
34
|
+
**Advanced:**
|
|
35
|
+
- command, carousel, sidebar, collapsible, calendar, aspect-ratio, toggle, toggle-group
|
|
36
|
+
|
|
37
|
+
### Custom ObjectUI Components (14)
|
|
38
|
+
|
|
39
|
+
These are custom to ObjectUI and should NOT be auto-updated:
|
|
40
|
+
|
|
41
|
+
- `button-group` - Button group wrapper
|
|
42
|
+
- `calendar-view` - Full calendar implementation
|
|
43
|
+
- `chatbot` - Chatbot UI interface
|
|
44
|
+
- `combobox` - Combined select/input component
|
|
45
|
+
- `date-picker` - Date picker with calendar
|
|
46
|
+
- `empty` - Empty state component
|
|
47
|
+
- `field` - Form field wrapper with validation
|
|
48
|
+
- `filter-builder` - Advanced query builder
|
|
49
|
+
- `input-group` - Input with prefix/suffix
|
|
50
|
+
- `item` - Generic item display
|
|
51
|
+
- `kbd` - Keyboard shortcut display
|
|
52
|
+
- `spinner` - Loading spinner
|
|
53
|
+
- `timeline` - Timeline/activity feed
|
|
54
|
+
- `toaster` - Toast notification manager
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### Automated Sync (Requires Internet)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Check component status
|
|
62
|
+
pnpm shadcn:check
|
|
63
|
+
|
|
64
|
+
# Update a specific component
|
|
65
|
+
pnpm shadcn:update button
|
|
66
|
+
|
|
67
|
+
# Update all components
|
|
68
|
+
pnpm shadcn:update-all
|
|
69
|
+
|
|
70
|
+
# Show diff for a component
|
|
71
|
+
pnpm shadcn:diff button
|
|
72
|
+
|
|
73
|
+
# List all components
|
|
74
|
+
pnpm shadcn:list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Manual Sync Process
|
|
78
|
+
|
|
79
|
+
If you don't have network access or prefer manual control:
|
|
80
|
+
|
|
81
|
+
1. **Visit Shadcn UI Documentation**
|
|
82
|
+
- Go to https://ui.shadcn.com/docs/components/[component-name]
|
|
83
|
+
- Click "View Code" to see the latest implementation
|
|
84
|
+
|
|
85
|
+
2. **Compare with Local Version**
|
|
86
|
+
```bash
|
|
87
|
+
# View local component
|
|
88
|
+
cat packages/components/src/ui/button.tsx
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
3. **Copy Latest Version**
|
|
92
|
+
- Copy the component code from Shadcn docs
|
|
93
|
+
- Paste into a temporary file
|
|
94
|
+
|
|
95
|
+
4. **Adjust Imports**
|
|
96
|
+
Replace Shadcn imports:
|
|
97
|
+
```typescript
|
|
98
|
+
// FROM:
|
|
99
|
+
import { cn } from "@/lib/utils"
|
|
100
|
+
import { Button } from "@/components/ui/button"
|
|
101
|
+
|
|
102
|
+
// TO:
|
|
103
|
+
import { cn } from "../lib/utils"
|
|
104
|
+
import { Button } from "./button"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
5. **Add ObjectUI Header**
|
|
108
|
+
```typescript
|
|
109
|
+
/**
|
|
110
|
+
* ObjectUI
|
|
111
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the MIT license found in the
|
|
114
|
+
* LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
6. **Preserve Customizations**
|
|
119
|
+
- Keep any `data-slot` attributes
|
|
120
|
+
- Keep ObjectUI-specific variants
|
|
121
|
+
- Keep dark mode enhancements
|
|
122
|
+
- Keep accessibility improvements
|
|
123
|
+
|
|
124
|
+
7. **Test the Component**
|
|
125
|
+
```bash
|
|
126
|
+
pnpm --filter @object-ui/components build
|
|
127
|
+
pnpm --filter @object-ui/components test
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Using Official Shadcn CLI
|
|
131
|
+
|
|
132
|
+
You can also use the official Shadcn CLI:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Install Shadcn CLI
|
|
136
|
+
npm install -g shadcn@latest
|
|
137
|
+
|
|
138
|
+
# Initialize (if not done)
|
|
139
|
+
cd packages/components
|
|
140
|
+
npx shadcn@latest init
|
|
141
|
+
|
|
142
|
+
# Add/update a component
|
|
143
|
+
npx shadcn@latest add button --overwrite
|
|
144
|
+
|
|
145
|
+
# Add all components
|
|
146
|
+
npx shadcn@latest add --all --overwrite
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**⚠️ Warning:** This will overwrite all ObjectUI customizations! You'll need to:
|
|
150
|
+
|
|
151
|
+
1. Review the diff carefully: `git diff src/ui/`
|
|
152
|
+
2. Restore ObjectUI copyright headers
|
|
153
|
+
3. Re-add any custom variants or styling
|
|
154
|
+
4. Re-add data-slot attributes
|
|
155
|
+
5. Test thoroughly
|
|
156
|
+
|
|
157
|
+
## Checking for Updates
|
|
158
|
+
|
|
159
|
+
### Manual Check
|
|
160
|
+
|
|
161
|
+
1. Visit [Shadcn UI GitHub](https://github.com/shadcn-ui/ui/tree/main/apps/www/registry/default/ui)
|
|
162
|
+
2. Compare file dates with last update
|
|
163
|
+
3. Check [Shadcn Releases](https://github.com/shadcn-ui/ui/releases) for changelog
|
|
164
|
+
|
|
165
|
+
### Compare Dependencies
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Check Radix UI versions
|
|
169
|
+
cat packages/components/package.json | grep @radix-ui
|
|
170
|
+
|
|
171
|
+
# Check latest versions
|
|
172
|
+
npm view @radix-ui/react-dialog version
|
|
173
|
+
npm view @radix-ui/react-select version
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Review Breaking Changes
|
|
177
|
+
|
|
178
|
+
Check Shadcn's changelog:
|
|
179
|
+
- [UI Changelog](https://github.com/shadcn-ui/ui/releases)
|
|
180
|
+
- [Radix UI Releases](https://github.com/radix-ui/primitives/releases)
|
|
181
|
+
|
|
182
|
+
## Common Customizations in ObjectUI
|
|
183
|
+
|
|
184
|
+
When updating components, preserve these ObjectUI patterns:
|
|
185
|
+
|
|
186
|
+
### 1. Copyright Headers
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
/**
|
|
190
|
+
* ObjectUI
|
|
191
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the MIT license found in the
|
|
194
|
+
* LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 2. Data Slot Attributes
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
<div data-slot="card-header" className={...}>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 3. Additional Variants
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
const buttonVariants = cva(
|
|
208
|
+
"...",
|
|
209
|
+
{
|
|
210
|
+
variants: {
|
|
211
|
+
// ObjectUI-specific variants
|
|
212
|
+
size: {
|
|
213
|
+
"icon-sm": "h-8 w-8", // Extra size variant
|
|
214
|
+
"icon-lg": "h-10 w-10", // Extra size variant
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 4. Enhanced Dark Mode
|
|
222
|
+
|
|
223
|
+
ObjectUI may have enhanced dark mode styles:
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
className="... dark:bg-background/95 dark:backdrop-blur-sm"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Testing After Updates
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Type check
|
|
233
|
+
pnpm --filter @object-ui/components type-check
|
|
234
|
+
|
|
235
|
+
# Build
|
|
236
|
+
pnpm --filter @object-ui/components build
|
|
237
|
+
|
|
238
|
+
# Run tests
|
|
239
|
+
pnpm --filter @object-ui/components test
|
|
240
|
+
|
|
241
|
+
# Visual regression (if available)
|
|
242
|
+
pnpm --filter @object-ui/components storybook
|
|
243
|
+
|
|
244
|
+
# Integration test
|
|
245
|
+
pnpm test
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Rollback
|
|
249
|
+
|
|
250
|
+
If an update causes issues:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Revert specific file
|
|
254
|
+
git checkout HEAD -- packages/components/src/ui/button.tsx
|
|
255
|
+
|
|
256
|
+
# Revert all UI components
|
|
257
|
+
git checkout HEAD -- packages/components/src/ui/
|
|
258
|
+
|
|
259
|
+
# Restore from backup (if created)
|
|
260
|
+
cp packages/components/.backup/button.tsx.* packages/components/src/ui/button.tsx
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Contributing
|
|
264
|
+
|
|
265
|
+
When you update a component:
|
|
266
|
+
|
|
267
|
+
1. Document the changes in CHANGELOG.md
|
|
268
|
+
2. Update the version in shadcn-components.json (add lastUpdated field)
|
|
269
|
+
3. Test with all examples
|
|
270
|
+
4. Create a PR with:
|
|
271
|
+
- Component name in title
|
|
272
|
+
- Reason for update
|
|
273
|
+
- Breaking changes (if any)
|
|
274
|
+
- Screenshots (if visual changes)
|
|
275
|
+
|
|
276
|
+
## Resources
|
|
277
|
+
|
|
278
|
+
- [Shadcn UI Docs](https://ui.shadcn.com)
|
|
279
|
+
- [Radix UI Docs](https://www.radix-ui.com)
|
|
280
|
+
- [Tailwind CSS Docs](https://tailwindcss.com)
|
|
281
|
+
- [CVA (Class Variance Authority)](https://cva.style)
|
package/TESTING.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
# Component and Renderer Testing Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This document describes the comprehensive automated testing infrastructure for ObjectUI components and renderers. The tests are designed to automatically discover display, accessibility, and structural issues in UI components.
|
|
6
|
+
|
|
7
|
+
## Test Architecture
|
|
8
|
+
|
|
9
|
+
### Test Utilities (`test-utils.tsx`)
|
|
10
|
+
|
|
11
|
+
A suite of helper functions that provide automated checks for common display issues:
|
|
12
|
+
|
|
13
|
+
#### `renderComponent(schema, options)`
|
|
14
|
+
Renders a component from its schema definition for testing.
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const { container } = renderComponent({
|
|
18
|
+
type: 'button',
|
|
19
|
+
label: 'Click Me',
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
#### `checkAccessibility(element)`
|
|
24
|
+
Validates accessibility attributes and identifies common a11y issues:
|
|
25
|
+
- Missing ARIA labels on interactive elements
|
|
26
|
+
- Missing form labels
|
|
27
|
+
- Missing alt attributes on images
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
```typescript
|
|
31
|
+
{
|
|
32
|
+
hasRole: boolean;
|
|
33
|
+
hasAriaLabel: boolean;
|
|
34
|
+
hasAriaDescribedBy: boolean;
|
|
35
|
+
issues: string[]; // List of detected issues
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### `checkDOMStructure(container)`
|
|
40
|
+
Analyzes DOM structure for potential issues:
|
|
41
|
+
- Empty components
|
|
42
|
+
- Excessive nesting (>20 levels)
|
|
43
|
+
- Missing content
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
```typescript
|
|
47
|
+
{
|
|
48
|
+
hasContent: boolean;
|
|
49
|
+
isEmpty: boolean;
|
|
50
|
+
hasChildren: boolean;
|
|
51
|
+
nestedDepth: number;
|
|
52
|
+
issues: string[]; // List of detected issues
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### `checkStyling(element)`
|
|
57
|
+
Validates component styling:
|
|
58
|
+
- Class presence
|
|
59
|
+
- Tailwind CSS usage
|
|
60
|
+
- Inline styles
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
```typescript
|
|
64
|
+
{
|
|
65
|
+
hasClasses: boolean;
|
|
66
|
+
hasTailwindClasses: boolean;
|
|
67
|
+
hasInlineStyles: boolean;
|
|
68
|
+
classes: string[];
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### `validateComponentRegistration(componentType)`
|
|
73
|
+
Verifies component registration in ComponentRegistry:
|
|
74
|
+
- Component is registered
|
|
75
|
+
- Has configuration
|
|
76
|
+
- Has renderer function
|
|
77
|
+
- Has label and inputs
|
|
78
|
+
- Has default props
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
```typescript
|
|
82
|
+
{
|
|
83
|
+
isRegistered: boolean;
|
|
84
|
+
hasConfig: boolean;
|
|
85
|
+
hasRenderer: boolean;
|
|
86
|
+
hasLabel: boolean;
|
|
87
|
+
hasInputs: boolean;
|
|
88
|
+
hasDefaultProps: boolean;
|
|
89
|
+
config: any;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### `getAllDisplayIssues(container)`
|
|
94
|
+
Comprehensive check that runs all validation checks and returns aggregated issues:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
const issues = getAllDisplayIssues(container);
|
|
98
|
+
// Returns array of issue descriptions
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Test Coverage
|
|
102
|
+
|
|
103
|
+
### Component Categories
|
|
104
|
+
|
|
105
|
+
The test suite covers all major component categories:
|
|
106
|
+
|
|
107
|
+
1. **Basic Components** (`basic-renderers.test.tsx`)
|
|
108
|
+
- Text, Div, Span, Image, Icon, Separator, HTML
|
|
109
|
+
|
|
110
|
+
2. **Form Components** (`form-renderers.test.tsx`)
|
|
111
|
+
- Button, Input, Textarea, Select, Checkbox, Switch
|
|
112
|
+
- Radio Group, Slider, Label, Email, Password
|
|
113
|
+
|
|
114
|
+
3. **Layout Components** (`layout-data-renderers.test.tsx`)
|
|
115
|
+
- Container, Grid, Flex
|
|
116
|
+
|
|
117
|
+
4. **Data Display Components** (`layout-data-renderers.test.tsx`)
|
|
118
|
+
- List, Tree View, Badge, Avatar, Alert
|
|
119
|
+
- Breadcrumb, Statistic, Kbd
|
|
120
|
+
|
|
121
|
+
5. **Feedback Components** (`feedback-overlay-renderers.test.tsx`)
|
|
122
|
+
- Loading, Spinner, Progress, Skeleton, Empty, Toast
|
|
123
|
+
|
|
124
|
+
6. **Overlay Components** (`feedback-overlay-renderers.test.tsx`)
|
|
125
|
+
- Dialog, Alert Dialog, Sheet, Drawer
|
|
126
|
+
- Popover, Tooltip, Dropdown Menu, Context Menu
|
|
127
|
+
- Hover Card, Menubar
|
|
128
|
+
|
|
129
|
+
7. **Disclosure Components** (`complex-disclosure-renderers.test.tsx`)
|
|
130
|
+
- Accordion, Collapsible, Toggle Group
|
|
131
|
+
|
|
132
|
+
8. **Complex Components** (`complex-disclosure-renderers.test.tsx`)
|
|
133
|
+
- Timeline, Data Table, Chatbot, Carousel
|
|
134
|
+
- Scroll Area, Resizable, Filter Builder, Calendar View, Table
|
|
135
|
+
|
|
136
|
+
## What the Tests Check
|
|
137
|
+
|
|
138
|
+
### 1. Component Registration
|
|
139
|
+
Every component should be properly registered:
|
|
140
|
+
```typescript
|
|
141
|
+
it('should be properly registered', () => {
|
|
142
|
+
const validation = validateComponentRegistration('button');
|
|
143
|
+
expect(validation.isRegistered).toBe(true);
|
|
144
|
+
expect(validation.hasConfig).toBe(true);
|
|
145
|
+
expect(validation.hasLabel).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 2. Rendering Without Errors
|
|
150
|
+
Components should render without throwing errors:
|
|
151
|
+
```typescript
|
|
152
|
+
it('should render without issues', () => {
|
|
153
|
+
const { container } = renderComponent({
|
|
154
|
+
type: 'button',
|
|
155
|
+
label: 'Test',
|
|
156
|
+
});
|
|
157
|
+
expect(container).toBeDefined();
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 3. Accessibility
|
|
162
|
+
Components should be accessible:
|
|
163
|
+
```typescript
|
|
164
|
+
it('should have proper accessibility', () => {
|
|
165
|
+
const { container } = renderComponent({
|
|
166
|
+
type: 'button',
|
|
167
|
+
label: 'Click Me',
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const issues = getAllDisplayIssues(container);
|
|
171
|
+
const a11yIssues = issues.filter(i => i.includes('accessible'));
|
|
172
|
+
expect(a11yIssues).toHaveLength(0);
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 4. DOM Structure
|
|
177
|
+
Components should have valid DOM structure:
|
|
178
|
+
```typescript
|
|
179
|
+
it('should have valid structure', () => {
|
|
180
|
+
const { container } = renderComponent({
|
|
181
|
+
type: 'container',
|
|
182
|
+
body: [{ type: 'text', content: 'Content' }],
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const domCheck = checkDOMStructure(container);
|
|
186
|
+
expect(domCheck.hasContent).toBe(true);
|
|
187
|
+
expect(domCheck.isEmpty).toBe(false);
|
|
188
|
+
expect(domCheck.nestedDepth).toBeLessThan(20);
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 5. Props and Variants
|
|
193
|
+
Components should support their documented props:
|
|
194
|
+
```typescript
|
|
195
|
+
it('should support variants', () => {
|
|
196
|
+
const variants = ['default', 'secondary', 'destructive'];
|
|
197
|
+
|
|
198
|
+
variants.forEach(variant => {
|
|
199
|
+
const { container } = renderComponent({
|
|
200
|
+
type: 'button',
|
|
201
|
+
label: 'Test',
|
|
202
|
+
variant,
|
|
203
|
+
});
|
|
204
|
+
expect(container).toBeDefined();
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Running Tests
|
|
210
|
+
|
|
211
|
+
### Run All Tests
|
|
212
|
+
```bash
|
|
213
|
+
pnpm test
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Run Component Tests Only
|
|
217
|
+
```bash
|
|
218
|
+
pnpm vitest run packages/components/src/__tests__/
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Run Specific Test File
|
|
222
|
+
```bash
|
|
223
|
+
pnpm vitest run packages/components/src/__tests__/form-renderers.test.tsx
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Watch Mode
|
|
227
|
+
```bash
|
|
228
|
+
pnpm test:watch
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Coverage Report
|
|
232
|
+
```bash
|
|
233
|
+
pnpm test:coverage
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Interactive UI
|
|
237
|
+
```bash
|
|
238
|
+
pnpm test:ui
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Test Results
|
|
242
|
+
|
|
243
|
+
Current test coverage:
|
|
244
|
+
- **150 total tests** across all component categories
|
|
245
|
+
- **140 passing** (93% pass rate)
|
|
246
|
+
- **10 failing** - identifying real schema/prop mismatches that need fixing
|
|
247
|
+
|
|
248
|
+
The failing tests are valuable as they automatically discovered:
|
|
249
|
+
- Components with missing props
|
|
250
|
+
- Schema mismatches (e.g., `content` vs `html`, `text` vs `content`)
|
|
251
|
+
- Missing default values
|
|
252
|
+
- Incorrect prop expectations
|
|
253
|
+
|
|
254
|
+
## Adding New Tests
|
|
255
|
+
|
|
256
|
+
### For New Components
|
|
257
|
+
|
|
258
|
+
When adding a new component, create tests following this pattern:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
describe('MyComponent Renderer', () => {
|
|
262
|
+
it('should be properly registered', () => {
|
|
263
|
+
const validation = validateComponentRegistration('my-component');
|
|
264
|
+
expect(validation.isRegistered).toBe(true);
|
|
265
|
+
expect(validation.hasConfig).toBe(true);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('should render without issues', () => {
|
|
269
|
+
const { container } = renderComponent({
|
|
270
|
+
type: 'my-component',
|
|
271
|
+
// ... required props
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
expect(container).toBeDefined();
|
|
275
|
+
const issues = getAllDisplayIssues(container);
|
|
276
|
+
expect(issues).toHaveLength(0);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('should support required props', () => {
|
|
280
|
+
const { container } = renderComponent({
|
|
281
|
+
type: 'my-component',
|
|
282
|
+
requiredProp: 'value',
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
expect(container.textContent).toContain('value');
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### For Display Issue Detection
|
|
291
|
+
|
|
292
|
+
Add specific checks for known issues:
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
it('should not have excessive nesting', () => {
|
|
296
|
+
const { container } = renderComponent({
|
|
297
|
+
type: 'complex-component',
|
|
298
|
+
data: complexData,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
const domCheck = checkDOMStructure(container);
|
|
302
|
+
expect(domCheck.nestedDepth).toBeLessThan(20);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('should have proper ARIA attributes', () => {
|
|
306
|
+
const { container } = renderComponent({
|
|
307
|
+
type: 'interactive-component',
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
const button = container.querySelector('button');
|
|
311
|
+
const a11y = checkAccessibility(button);
|
|
312
|
+
expect(a11y.issues).toHaveLength(0);
|
|
313
|
+
});
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Benefits
|
|
317
|
+
|
|
318
|
+
This testing infrastructure provides:
|
|
319
|
+
|
|
320
|
+
1. **Automated Issue Detection** - Tests automatically find display and accessibility issues
|
|
321
|
+
2. **Regression Prevention** - Catches breaking changes in component rendering
|
|
322
|
+
3. **Documentation** - Tests serve as examples of how components should be used
|
|
323
|
+
4. **Confidence** - High test coverage ensures components work as expected
|
|
324
|
+
5. **Quick Feedback** - Fast test execution helps during development
|
|
325
|
+
|
|
326
|
+
## Future Enhancements
|
|
327
|
+
|
|
328
|
+
Potential improvements:
|
|
329
|
+
|
|
330
|
+
1. Visual regression testing with screenshot comparison
|
|
331
|
+
2. Performance benchmarking for complex components
|
|
332
|
+
3. Cross-browser testing
|
|
333
|
+
4. Responsive design testing
|
|
334
|
+
5. Theme variation testing
|
|
335
|
+
6. Integration tests with SchemaRenderer
|