@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,706 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
|
|
5
|
+
import { SidebarProvider, Sidebar, SidebarHeader, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton } from '../ui/sidebar';
|
|
6
|
+
import {
|
|
7
|
+
LayoutDashboard,
|
|
8
|
+
Users,
|
|
9
|
+
Settings,
|
|
10
|
+
FileText,
|
|
11
|
+
GalleryVerticalEnd,
|
|
12
|
+
Building2,
|
|
13
|
+
UserPlus,
|
|
14
|
+
TrendingUp
|
|
15
|
+
} from 'lucide-react';
|
|
16
|
+
|
|
17
|
+
/* --- MOCK DATA --- */
|
|
18
|
+
|
|
19
|
+
const DASHBOARD_DATA = {
|
|
20
|
+
revenue: "$45,231.89",
|
|
21
|
+
subscriptions: "+2350",
|
|
22
|
+
sales: "+12,234",
|
|
23
|
+
revenueGrowth: "+20.1% from last month",
|
|
24
|
+
subGrowth: "+180.1% from last month",
|
|
25
|
+
salesGrowth: "+19% from last month",
|
|
26
|
+
overview: [
|
|
27
|
+
{ name: "Jan", total: 1200 }, { name: "Feb", total: 1500 }, { name: "Mar", total: 1300 },
|
|
28
|
+
{ name: "Apr", total: 1800 }, { name: "May", total: 2200 }, { name: "Jun", total: 2600 }
|
|
29
|
+
],
|
|
30
|
+
// For view:simple list
|
|
31
|
+
recentSales: [
|
|
32
|
+
{ name: "Olivia Martin", email: "olivia.martin@email.com", amount: "+$1,999.00" },
|
|
33
|
+
// ... handled manually in schema for view:simple until we support loops
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const CONTACTS_DATA = {
|
|
38
|
+
contacts: [
|
|
39
|
+
{ id: 1, name: "Alice Johnson", company: "TechCorp", email: "alice@techcorp.com", status: "Active" },
|
|
40
|
+
{ id: 2, name: "Bob Smith", company: "SalesInc", email: "bob@salesinc.com", status: "Inactive" },
|
|
41
|
+
{ id: 3, name: "Charlie Davis", company: "StartupHub", email: "charlie@startuphub.com", status: "Lead" },
|
|
42
|
+
{ id: 4, name: "Dana Wilson", company: "Enterprise Ltd", email: "dana@enterprise.com", status: "Active" },
|
|
43
|
+
{ id: 5, name: "Evan Brown", company: "Innovate LLC", email: "evan@innovate.com", status: "Active" },
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const OPPORTUNITIES_DATA = {
|
|
48
|
+
opportunities: [
|
|
49
|
+
{ id: 101, name: "TechCorp License Renewal", amount: 50000, stage: "Negotiation", probability: "80%", closeDate: "2026-02-15", contact: "Alice Johnson" },
|
|
50
|
+
{ id: 102, name: "SalesInc New Deal", amount: 12000, stage: "Qualified", probability: "40%", closeDate: "2026-03-01", contact: "Bob Smith" },
|
|
51
|
+
{ id: 103, name: "StartupHub Seed", amount: 5000, stage: "Closed Won", probability: "100%", closeDate: "2026-01-20", contact: "Charlie Davis" },
|
|
52
|
+
{ id: 104, name: "Enterprise Ltd Expansion", amount: 150000, stage: "Proposal", probability: "60%", closeDate: "2026-02-28", contact: "Dana Wilson" }
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const ACCOUNTS_DATA = {
|
|
57
|
+
accounts: [
|
|
58
|
+
{ id: 1, name: "TechCorp", industry: "Technology", revenue: 5000000, employees: 250, status: "Active" },
|
|
59
|
+
{ id: 2, name: "SalesInc", industry: "Sales & Marketing", revenue: 1200000, employees: 50, status: "Active" },
|
|
60
|
+
{ id: 3, name: "StartupHub", industry: "Venture Capital", revenue: 500000, employees: 15, status: "Lead" },
|
|
61
|
+
{ id: 4, name: "Enterprise Ltd", industry: "Enterprise Software", revenue: 15000000, employees: 500, status: "Active" },
|
|
62
|
+
{ id: 5, name: "Innovate LLC", industry: "Innovation", revenue: 3000000, employees: 100, status: "Active" }
|
|
63
|
+
]
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const CONTACT_DETAIL_DATA = {
|
|
67
|
+
id: 1,
|
|
68
|
+
name: "Alice Johnson",
|
|
69
|
+
company: "TechCorp",
|
|
70
|
+
email: "alice@techcorp.com",
|
|
71
|
+
status: "Active"
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const OPPORTUNITY_DETAIL_DATA = {
|
|
75
|
+
id: 101,
|
|
76
|
+
name: "TechCorp License Renewal",
|
|
77
|
+
amount: 50000,
|
|
78
|
+
stage: "Negotiation",
|
|
79
|
+
probability: "80%",
|
|
80
|
+
closeDate: "2026-02-15",
|
|
81
|
+
contact: "Alice Johnson",
|
|
82
|
+
expectedRevenue: 40000,
|
|
83
|
+
daysToClose: 15
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/* --- SCHEMAS --- */
|
|
87
|
+
|
|
88
|
+
const dashboardSchema = {
|
|
89
|
+
type: "page",
|
|
90
|
+
props: { title: "Dashboard" },
|
|
91
|
+
children: [
|
|
92
|
+
{
|
|
93
|
+
type: "div",
|
|
94
|
+
className: "flex items-center justify-between mb-6",
|
|
95
|
+
children: [
|
|
96
|
+
{
|
|
97
|
+
type: "page:header",
|
|
98
|
+
props: { title: "Dashboard", description: "Overview of your business performance." },
|
|
99
|
+
className: "mb-0"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "div",
|
|
103
|
+
className: "flex gap-2",
|
|
104
|
+
children: [
|
|
105
|
+
{ type: "button", props: { variant: "outline", size: "sm", children: "Download Report" } },
|
|
106
|
+
{ type: "button", props: { size: "sm", children: "Refresh" } }
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "grid",
|
|
113
|
+
props: { cols: 4, gap: 4, className: "mb-8 mt-2" },
|
|
114
|
+
children: [
|
|
115
|
+
{ type: "card", title: "Total Revenue", description: "${data.revenueGrowth}", children: [{type: "text", content: "${data.revenue}", className: "text-2xl font-bold"}] },
|
|
116
|
+
{ type: "card", title: "Subscriptions", description: "${data.subGrowth}", children: [{type: "text", content: "${data.subscriptions}", className: "text-2xl font-bold"}] },
|
|
117
|
+
{ type: "card", title: "Sales", description: "${data.salesGrowth}", children: [{type: "text", content: "${data.sales}", className: "text-2xl font-bold"}] },
|
|
118
|
+
{ type: "card", title: "Active Now", description: "+201 since last hour", children: [{type: "text", content: "+573", className: "text-2xl font-bold"}] },
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "grid",
|
|
123
|
+
props: { cols: 7, gap: 4 },
|
|
124
|
+
children: [
|
|
125
|
+
{
|
|
126
|
+
type: "page:card",
|
|
127
|
+
props: { title: "Revenue Overview", className: "col-span-4" },
|
|
128
|
+
children: [{ type: "chart:bar", props: {
|
|
129
|
+
data: "${data.overview}",
|
|
130
|
+
index: "name",
|
|
131
|
+
categories: ["total"],
|
|
132
|
+
colors: ["blue"]
|
|
133
|
+
}}]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: "page:card",
|
|
137
|
+
props: { title: "Recent Sales", description: "You made 265 sales this month.", className: "col-span-3" },
|
|
138
|
+
children: [
|
|
139
|
+
{ type: "view:simple", children: [
|
|
140
|
+
{ type: "div", className: "flex items-center justify-between py-3 border-b hover:bg-muted/50 px-2 rounded transition-colors", children: [
|
|
141
|
+
{ type: "div", className: "flex items-center gap-3", children: [{type:"avatar", props:{fallback:"OM"}}, {type:"div", children:[{type:"text", content:"Olivia Martin", className:"font-medium block"}, {type:"text", content:"olivia.martin@email.com", className:"text-xs text-muted-foreground block"}]}] },
|
|
142
|
+
{ type: "text", content: "+$1,999.00", className: "font-medium" }
|
|
143
|
+
]},
|
|
144
|
+
{ type: "div", className: "flex items-center justify-between py-3 border-b hover:bg-muted/50 px-2 rounded transition-colors", children: [
|
|
145
|
+
{ type: "div", className: "flex items-center gap-3", children: [{type:"avatar", props:{fallback:"JL"}}, {type:"div", children:[{type:"text", content:"Jackson Lee", className:"font-medium block"}, {type:"text", content:"jackson.lee@email.com", className:"text-xs text-muted-foreground block"}]}] },
|
|
146
|
+
{ type: "text", content: "+$39.00", className: "font-medium" }
|
|
147
|
+
]},
|
|
148
|
+
{ type: "div", className: "flex items-center justify-between py-3 border-b hover:bg-muted/50 px-2 rounded transition-colors", children: [
|
|
149
|
+
{ type: "div", className: "flex items-center gap-3", children: [{type:"avatar", props:{fallback:"IN"}}, {type:"div", children:[{type:"text", content:"Isabella Nguyen", className:"font-medium block"}, {type:"text", content:"isabella.nguyen@email.com", className:"text-xs text-muted-foreground block"}]}] },
|
|
150
|
+
{ type: "text", content: "+$299.00", className: "font-medium" }
|
|
151
|
+
]},
|
|
152
|
+
{ type: "div", className: "flex items-center justify-between py-3 border-b hover:bg-muted/50 px-2 rounded transition-colors", children: [
|
|
153
|
+
{ type: "div", className: "flex items-center gap-3", children: [{type:"avatar", props:{fallback:"WK"}}, {type:"div", children:[{type:"text", content:"William Kim", className:"font-medium block"}, {type:"text", content:"will@email.com", className:"text-xs text-muted-foreground block"}]}] },
|
|
154
|
+
{ type: "text", content: "+$99.00", className: "font-medium" }
|
|
155
|
+
]},
|
|
156
|
+
{ type: "div", className: "flex items-center justify-between py-3 hover:bg-muted/50 px-2 rounded transition-colors", children: [
|
|
157
|
+
{ type: "div", className: "flex items-center gap-3", children: [{type:"avatar", props:{fallback:"SD"}}, {type:"div", children:[{type:"text", content:"Sofia Davis", className:"font-medium block"}, {type:"text", content:"sofia.davis@email.com", className:"text-xs text-muted-foreground block"}]}] },
|
|
158
|
+
{ type: "text", content: "+$39.00", className: "font-medium" }
|
|
159
|
+
]},
|
|
160
|
+
]}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const contactsSchema = {
|
|
169
|
+
type: "page",
|
|
170
|
+
props: { title: "Contacts" },
|
|
171
|
+
children: [
|
|
172
|
+
{
|
|
173
|
+
type: "page:header",
|
|
174
|
+
props: { title: "Contacts", description: "Manage your customers and leads." },
|
|
175
|
+
children: [
|
|
176
|
+
{ type: "button", props: { children: "New Contact" } }
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: "div",
|
|
181
|
+
className: "flex gap-2 mt-4",
|
|
182
|
+
children: [
|
|
183
|
+
{ type: "button", props: { variant: "outline", size: "sm", children: "All Contacts" } },
|
|
184
|
+
{ type: "button", props: { variant: "ghost", size: "sm", children: "Active" } },
|
|
185
|
+
{ type: "button", props: { variant: "ghost", size: "sm", children: "Inactive" } },
|
|
186
|
+
{ type: "button", props: { variant: "ghost", size: "sm", children: "Leads" } }
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: "page:card",
|
|
191
|
+
className: "mt-4",
|
|
192
|
+
children: [
|
|
193
|
+
{
|
|
194
|
+
type: "view:grid",
|
|
195
|
+
staticData: CONTACTS_DATA.contacts,
|
|
196
|
+
columns: [
|
|
197
|
+
{ key: "name", label: "Name", type: "text" },
|
|
198
|
+
{ key: "company", label: "Company", type: "text" },
|
|
199
|
+
{ key: "email", label: "Email", type: "text" },
|
|
200
|
+
{ key: "status", label: "Status", type: "text" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const opportunitiesSchema = {
|
|
209
|
+
type: "page",
|
|
210
|
+
props: { title: "Opportunities" },
|
|
211
|
+
children: [
|
|
212
|
+
{
|
|
213
|
+
type: "page:header",
|
|
214
|
+
props: { title: "Opportunities", description: "View and track sales deals." },
|
|
215
|
+
children: [
|
|
216
|
+
{ type: "button", props: { children: "New Opportunity", size: "sm" } }
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: "page:card",
|
|
221
|
+
className: "mt-6",
|
|
222
|
+
children: [
|
|
223
|
+
{
|
|
224
|
+
type: "view:grid",
|
|
225
|
+
staticData: OPPORTUNITIES_DATA.opportunities,
|
|
226
|
+
columns: [
|
|
227
|
+
{ key: "name", label: "Deal Name", type: "text" },
|
|
228
|
+
{ key: "contact", label: "Contact", type: "text" },
|
|
229
|
+
{ key: "stage", label: "Stage", type: "text" },
|
|
230
|
+
{ key: "amount", label: "Amount ($)", type: "number" },
|
|
231
|
+
{ key: "probability", label: "Probability", type: "text" },
|
|
232
|
+
{ key: "closeDate", label: "Close Date", type: "text" }
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const settingsSchema = {
|
|
241
|
+
type: "page",
|
|
242
|
+
props: { title: "Settings" },
|
|
243
|
+
children: [
|
|
244
|
+
{
|
|
245
|
+
type: "page:header",
|
|
246
|
+
props: { title: "Settings", description: "Manage your account settings and preferences." }
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: "div",
|
|
250
|
+
className: "grid grid-cols-1 md:grid-cols-3 gap-8 mt-6",
|
|
251
|
+
children: [
|
|
252
|
+
{
|
|
253
|
+
type: "div",
|
|
254
|
+
className: "col-span-1",
|
|
255
|
+
children: [
|
|
256
|
+
{ type: "text", content: "Profile Information", className: "text-lg font-semibold block mb-2" },
|
|
257
|
+
{ type: "text", content: "Update your account's profile information and email address.", className: "text-sm text-muted-foreground" },
|
|
258
|
+
{
|
|
259
|
+
type: "div",
|
|
260
|
+
className: "mt-4 flex flex-col gap-1",
|
|
261
|
+
children: [
|
|
262
|
+
{ type: "button", props: { variant: "ghost", className: "justify-start font-semibold bg-muted", children: "General" } },
|
|
263
|
+
{ type: "button", props: { variant: "ghost", className: "justify-start", children: "Security" } },
|
|
264
|
+
{ type: "button", props: { variant: "ghost", className: "justify-start", children: "Billing" } },
|
|
265
|
+
{ type: "button", props: { variant: "ghost", className: "justify-start", children: "Notifications" } },
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
type: "page:card",
|
|
272
|
+
className: "col-span-2",
|
|
273
|
+
children: [
|
|
274
|
+
{
|
|
275
|
+
type: "div", // Using div as form container for now
|
|
276
|
+
className: "space-y-4",
|
|
277
|
+
children: [
|
|
278
|
+
{ type: "field:text", props: { label: "Username", defaultValue: "${data.profile.name}", description: "This is your public display name." } },
|
|
279
|
+
{ type: "field:text", props: { label: "Email", defaultValue: "${data.profile.email}", description: "Please enter a valid email address." } },
|
|
280
|
+
{ type: "field:text", props: { label: "Role", defaultValue: "${data.profile.role}", readonly: true, disabled: true } },
|
|
281
|
+
{ type: "div", className: "pt-4 flex justify-end", children: [
|
|
282
|
+
{ type: "button", props: { children: "Save Changes" } }
|
|
283
|
+
]}
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const SETTINGS_DATA = {
|
|
294
|
+
profile: {
|
|
295
|
+
name: "Admin User",
|
|
296
|
+
email: "admin@objectui.dev",
|
|
297
|
+
role: "Administrator",
|
|
298
|
+
notifications: true
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const accountsSchema = {
|
|
303
|
+
type: "page",
|
|
304
|
+
props: { title: "Accounts" },
|
|
305
|
+
children: [
|
|
306
|
+
{
|
|
307
|
+
type: "page:header",
|
|
308
|
+
props: { title: "Accounts", description: "Manage your business accounts and companies." },
|
|
309
|
+
children: [
|
|
310
|
+
{ type: "button", props: { children: "New Account", size: "sm" } }
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
type: "page:card",
|
|
315
|
+
className: "mt-6",
|
|
316
|
+
children: [
|
|
317
|
+
{
|
|
318
|
+
type: "view:grid",
|
|
319
|
+
staticData: ACCOUNTS_DATA.accounts,
|
|
320
|
+
columns: [
|
|
321
|
+
{ key: "name", label: "Account Name", type: "text" },
|
|
322
|
+
{ key: "industry", label: "Industry", type: "text" },
|
|
323
|
+
{ key: "revenue", label: "Annual Revenue ($)", type: "number" },
|
|
324
|
+
{ key: "employees", label: "Employees", type: "number" },
|
|
325
|
+
{ key: "status", label: "Status", type: "text" }
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
const contactDetailSchema = {
|
|
334
|
+
type: "page",
|
|
335
|
+
props: { title: "Contact Details" },
|
|
336
|
+
children: [
|
|
337
|
+
{
|
|
338
|
+
type: "div",
|
|
339
|
+
className: "flex items-center justify-between mb-6",
|
|
340
|
+
children: [
|
|
341
|
+
{
|
|
342
|
+
type: "page:header",
|
|
343
|
+
props: {
|
|
344
|
+
title: "${data.name}",
|
|
345
|
+
description: "${data.company} • ${data.email}"
|
|
346
|
+
},
|
|
347
|
+
className: "mb-0"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
type: "div",
|
|
351
|
+
className: "flex gap-2",
|
|
352
|
+
children: [
|
|
353
|
+
{ type: "button", props: { variant: "outline", size: "sm", children: "Edit" } },
|
|
354
|
+
{ type: "button", props: { variant: "outline", size: "sm", children: "Delete" } }
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
type: "grid",
|
|
361
|
+
props: { cols: 3, gap: 6 },
|
|
362
|
+
children: [
|
|
363
|
+
{
|
|
364
|
+
type: "page:card",
|
|
365
|
+
props: { title: "Contact Information", className: "col-span-2" },
|
|
366
|
+
children: [
|
|
367
|
+
{
|
|
368
|
+
type: "div",
|
|
369
|
+
className: "grid grid-cols-2 gap-4",
|
|
370
|
+
children: [
|
|
371
|
+
{ type: "div", children: [
|
|
372
|
+
{ type: "text", content: "Name", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
373
|
+
{ type: "text", content: "${data.name}", className: "text-base" }
|
|
374
|
+
]},
|
|
375
|
+
{ type: "div", children: [
|
|
376
|
+
{ type: "text", content: "Email", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
377
|
+
{ type: "text", content: "${data.email}", className: "text-base" }
|
|
378
|
+
]},
|
|
379
|
+
{ type: "div", children: [
|
|
380
|
+
{ type: "text", content: "Company", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
381
|
+
{ type: "text", content: "${data.company}", className: "text-base" }
|
|
382
|
+
]},
|
|
383
|
+
{ type: "div", children: [
|
|
384
|
+
{ type: "text", content: "Status", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
385
|
+
{ type: "badge", props: { variant: "default" }, children: [{ type: "text", content: "${data.status}" }] }
|
|
386
|
+
]}
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
type: "page:card",
|
|
393
|
+
props: { title: "Quick Actions", className: "col-span-1" },
|
|
394
|
+
children: [
|
|
395
|
+
{
|
|
396
|
+
type: "div",
|
|
397
|
+
className: "flex flex-col gap-2",
|
|
398
|
+
children: [
|
|
399
|
+
{ type: "button", props: { variant: "outline", className: "justify-start", children: "Send Email" } },
|
|
400
|
+
{ type: "button", props: { variant: "outline", className: "justify-start", children: "Schedule Call" } },
|
|
401
|
+
{ type: "button", props: { variant: "outline", className: "justify-start", children: "Create Task" } }
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
}
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
type: "page:card",
|
|
410
|
+
props: { title: "Recent Activities", className: "mt-6" },
|
|
411
|
+
children: [
|
|
412
|
+
{
|
|
413
|
+
type: "div",
|
|
414
|
+
className: "space-y-3",
|
|
415
|
+
children: [
|
|
416
|
+
{ type: "div", className: "flex items-start gap-3 py-2", children: [
|
|
417
|
+
{ type: "div", className: "h-2 w-2 rounded-full bg-blue-500 mt-2" },
|
|
418
|
+
{ type: "div", children: [
|
|
419
|
+
{ type: "text", content: "Email sent", className: "font-medium block" },
|
|
420
|
+
{ type: "text", content: "Sent product demo information", className: "text-sm text-muted-foreground block" },
|
|
421
|
+
{ type: "text", content: "2 hours ago", className: "text-xs text-muted-foreground block mt-1" }
|
|
422
|
+
]}
|
|
423
|
+
]},
|
|
424
|
+
{ type: "div", className: "flex items-start gap-3 py-2", children: [
|
|
425
|
+
{ type: "div", className: "h-2 w-2 rounded-full bg-green-500 mt-2" },
|
|
426
|
+
{ type: "div", children: [
|
|
427
|
+
{ type: "text", content: "Meeting completed", className: "font-medium block" },
|
|
428
|
+
{ type: "text", content: "Discussed Q1 requirements", className: "text-sm text-muted-foreground block" },
|
|
429
|
+
{ type: "text", content: "1 day ago", className: "text-xs text-muted-foreground block mt-1" }
|
|
430
|
+
]}
|
|
431
|
+
]},
|
|
432
|
+
{ type: "div", className: "flex items-start gap-3 py-2", children: [
|
|
433
|
+
{ type: "div", className: "h-2 w-2 rounded-full bg-gray-400 mt-2" },
|
|
434
|
+
{ type: "div", children: [
|
|
435
|
+
{ type: "text", content: "Contact created", className: "font-medium block" },
|
|
436
|
+
{ type: "text", content: "Added to CRM system", className: "text-sm text-muted-foreground block" },
|
|
437
|
+
{ type: "text", content: "3 days ago", className: "text-xs text-muted-foreground block mt-1" }
|
|
438
|
+
]}
|
|
439
|
+
]}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
]
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
const opportunityDetailSchema = {
|
|
448
|
+
type: "page",
|
|
449
|
+
props: { title: "Opportunity Details" },
|
|
450
|
+
children: [
|
|
451
|
+
{
|
|
452
|
+
type: "div",
|
|
453
|
+
className: "flex items-center justify-between mb-6",
|
|
454
|
+
children: [
|
|
455
|
+
{
|
|
456
|
+
type: "page:header",
|
|
457
|
+
props: {
|
|
458
|
+
title: "${data.name}",
|
|
459
|
+
description: "Stage: ${data.stage} • Close Date: ${data.closeDate}"
|
|
460
|
+
},
|
|
461
|
+
className: "mb-0"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
type: "div",
|
|
465
|
+
className: "flex gap-2",
|
|
466
|
+
children: [
|
|
467
|
+
{ type: "button", props: { variant: "outline", size: "sm", children: "Edit" } },
|
|
468
|
+
{ type: "button", props: { size: "sm", children: "Mark as Won" } }
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
type: "grid",
|
|
475
|
+
props: { cols: 4, gap: 4, className: "mb-6" },
|
|
476
|
+
children: [
|
|
477
|
+
{
|
|
478
|
+
type: "card",
|
|
479
|
+
title: "Deal Amount",
|
|
480
|
+
children: [{ type: "text", content: "$${data.amount}", className: "text-2xl font-bold" }]
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
type: "card",
|
|
484
|
+
title: "Probability",
|
|
485
|
+
children: [{ type: "text", content: "${data.probability}", className: "text-2xl font-bold" }]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
type: "card",
|
|
489
|
+
title: "Expected Revenue",
|
|
490
|
+
children: [{ type: "text", content: "$${data.expectedRevenue}", className: "text-2xl font-bold" }]
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
type: "card",
|
|
494
|
+
title: "Days to Close",
|
|
495
|
+
children: [{ type: "text", content: "${data.daysToClose}", className: "text-2xl font-bold" }]
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
type: "grid",
|
|
501
|
+
props: { cols: 3, gap: 6 },
|
|
502
|
+
children: [
|
|
503
|
+
{
|
|
504
|
+
type: "page:card",
|
|
505
|
+
props: { title: "Opportunity Details", className: "col-span-2" },
|
|
506
|
+
children: [
|
|
507
|
+
{
|
|
508
|
+
type: "div",
|
|
509
|
+
className: "grid grid-cols-2 gap-4",
|
|
510
|
+
children: [
|
|
511
|
+
{ type: "div", children: [
|
|
512
|
+
{ type: "text", content: "Deal Name", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
513
|
+
{ type: "text", content: "${data.name}", className: "text-base" }
|
|
514
|
+
]},
|
|
515
|
+
{ type: "div", children: [
|
|
516
|
+
{ type: "text", content: "Contact", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
517
|
+
{ type: "text", content: "${data.contact}", className: "text-base" }
|
|
518
|
+
]},
|
|
519
|
+
{ type: "div", children: [
|
|
520
|
+
{ type: "text", content: "Stage", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
521
|
+
{ type: "badge", props: { variant: "default" }, children: [{ type: "text", content: "${data.stage}" }] }
|
|
522
|
+
]},
|
|
523
|
+
{ type: "div", children: [
|
|
524
|
+
{ type: "text", content: "Close Date", className: "text-sm font-medium text-muted-foreground block mb-1" },
|
|
525
|
+
{ type: "text", content: "${data.closeDate}", className: "text-base" }
|
|
526
|
+
]}
|
|
527
|
+
]
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
type: "page:card",
|
|
533
|
+
props: { title: "Stage Progress", className: "col-span-1" },
|
|
534
|
+
children: [
|
|
535
|
+
{
|
|
536
|
+
type: "div",
|
|
537
|
+
className: "space-y-2",
|
|
538
|
+
children: [
|
|
539
|
+
{ type: "div", className: "flex items-center justify-between", children: [
|
|
540
|
+
{ type: "text", content: "Prospecting", className: "text-sm" },
|
|
541
|
+
{ type: "text", content: "✓", className: "text-green-500" }
|
|
542
|
+
]},
|
|
543
|
+
{ type: "div", className: "flex items-center justify-between", children: [
|
|
544
|
+
{ type: "text", content: "Qualified", className: "text-sm" },
|
|
545
|
+
{ type: "text", content: "✓", className: "text-green-500" }
|
|
546
|
+
]},
|
|
547
|
+
{ type: "div", className: "flex items-center justify-between", children: [
|
|
548
|
+
{ type: "text", content: "Proposal", className: "text-sm font-medium" },
|
|
549
|
+
{ type: "text", content: "●", className: "text-blue-500" }
|
|
550
|
+
]},
|
|
551
|
+
{ type: "div", className: "flex items-center justify-between", children: [
|
|
552
|
+
{ type: "text", content: "Negotiation", className: "text-sm text-muted-foreground" },
|
|
553
|
+
{ type: "text", content: "○", className: "text-gray-300" }
|
|
554
|
+
]},
|
|
555
|
+
{ type: "div", className: "flex items-center justify-between", children: [
|
|
556
|
+
{ type: "text", content: "Closed", className: "text-sm text-muted-foreground" },
|
|
557
|
+
{ type: "text", content: "○", className: "text-gray-300" }
|
|
558
|
+
]}
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
}
|
|
565
|
+
]
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
/* --- APP COMPONENT --- */
|
|
569
|
+
|
|
570
|
+
const CRMStoryApp = () => {
|
|
571
|
+
const [activePage, setActivePage] = useState("dashboard");
|
|
572
|
+
|
|
573
|
+
const renderContent = () => {
|
|
574
|
+
switch(activePage) {
|
|
575
|
+
case "dashboard":
|
|
576
|
+
return <SchemaRendererProvider dataSource={DASHBOARD_DATA}><SchemaRenderer schema={dashboardSchema} /></SchemaRendererProvider>;
|
|
577
|
+
case "contacts":
|
|
578
|
+
return <SchemaRendererProvider dataSource={CONTACTS_DATA}><SchemaRenderer schema={contactsSchema} /></SchemaRendererProvider>;
|
|
579
|
+
case "contact-detail":
|
|
580
|
+
return <SchemaRendererProvider dataSource={CONTACT_DETAIL_DATA}><SchemaRenderer schema={contactDetailSchema} /></SchemaRendererProvider>;
|
|
581
|
+
case "accounts":
|
|
582
|
+
return <SchemaRendererProvider dataSource={ACCOUNTS_DATA}><SchemaRenderer schema={accountsSchema} /></SchemaRendererProvider>;
|
|
583
|
+
case "opportunities":
|
|
584
|
+
return <SchemaRendererProvider dataSource={OPPORTUNITIES_DATA}><SchemaRenderer schema={opportunitiesSchema} /></SchemaRendererProvider>;
|
|
585
|
+
case "opportunity-detail":
|
|
586
|
+
return <SchemaRendererProvider dataSource={OPPORTUNITY_DETAIL_DATA}><SchemaRenderer schema={opportunityDetailSchema} /></SchemaRendererProvider>;
|
|
587
|
+
case "settings":
|
|
588
|
+
return <SchemaRendererProvider dataSource={SETTINGS_DATA}><SchemaRenderer schema={settingsSchema} /></SchemaRendererProvider>;
|
|
589
|
+
default:
|
|
590
|
+
return (
|
|
591
|
+
<div className="p-8">
|
|
592
|
+
<h2 className="text-2xl font-bold">Work in progress</h2>
|
|
593
|
+
<p className="text-muted-foreground mt-2">This page ({activePage}) is under construction.</p>
|
|
594
|
+
</div>
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
return (
|
|
600
|
+
<SidebarProvider>
|
|
601
|
+
<Sidebar collapsible="icon">
|
|
602
|
+
<SidebarHeader>
|
|
603
|
+
<div className="flex items-center gap-2 px-2 py-3 text-sidebar-foreground">
|
|
604
|
+
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
|
|
605
|
+
<GalleryVerticalEnd className="size-4" />
|
|
606
|
+
</div>
|
|
607
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
608
|
+
<span className="truncate font-semibold">Object UI</span>
|
|
609
|
+
<span className="truncate text-xs">CRM Demo</span>
|
|
610
|
+
</div>
|
|
611
|
+
</div>
|
|
612
|
+
</SidebarHeader>
|
|
613
|
+
<SidebarContent>
|
|
614
|
+
<SidebarGroup>
|
|
615
|
+
<SidebarGroupLabel>Platform</SidebarGroupLabel>
|
|
616
|
+
<SidebarGroupContent>
|
|
617
|
+
<SidebarMenu>
|
|
618
|
+
<SidebarMenuButton
|
|
619
|
+
isActive={activePage === "dashboard"}
|
|
620
|
+
onClick={() => setActivePage("dashboard")}
|
|
621
|
+
tooltip="Dashboard"
|
|
622
|
+
>
|
|
623
|
+
<LayoutDashboard />
|
|
624
|
+
<span>Dashboard</span>
|
|
625
|
+
</SidebarMenuButton>
|
|
626
|
+
<SidebarMenuButton
|
|
627
|
+
isActive={activePage === "contacts"}
|
|
628
|
+
onClick={() => setActivePage("contacts")}
|
|
629
|
+
tooltip="Contacts"
|
|
630
|
+
>
|
|
631
|
+
<Users />
|
|
632
|
+
<span>Contacts</span>
|
|
633
|
+
</SidebarMenuButton>
|
|
634
|
+
<SidebarMenuButton
|
|
635
|
+
isActive={activePage === "accounts"}
|
|
636
|
+
onClick={() => setActivePage("accounts")}
|
|
637
|
+
tooltip="Accounts"
|
|
638
|
+
>
|
|
639
|
+
<Building2 />
|
|
640
|
+
<span>Accounts</span>
|
|
641
|
+
</SidebarMenuButton>
|
|
642
|
+
<SidebarMenuButton
|
|
643
|
+
isActive={activePage === "opportunities"}
|
|
644
|
+
onClick={() => setActivePage("opportunities")}
|
|
645
|
+
tooltip="Opportunities"
|
|
646
|
+
>
|
|
647
|
+
<TrendingUp />
|
|
648
|
+
<span>Opportunities</span>
|
|
649
|
+
</SidebarMenuButton>
|
|
650
|
+
<SidebarMenuButton
|
|
651
|
+
isActive={activePage === "settings"}
|
|
652
|
+
onClick={() => setActivePage("settings")}
|
|
653
|
+
tooltip="Settings"
|
|
654
|
+
>
|
|
655
|
+
<Settings />
|
|
656
|
+
<span>Settings</span>
|
|
657
|
+
</SidebarMenuButton>
|
|
658
|
+
</SidebarMenu>
|
|
659
|
+
</SidebarGroupContent>
|
|
660
|
+
</SidebarGroup>
|
|
661
|
+
<SidebarGroup>
|
|
662
|
+
<SidebarGroupLabel>Examples</SidebarGroupLabel>
|
|
663
|
+
<SidebarGroupContent>
|
|
664
|
+
<SidebarMenu>
|
|
665
|
+
<SidebarMenuButton
|
|
666
|
+
isActive={activePage === "contact-detail"}
|
|
667
|
+
onClick={() => setActivePage("contact-detail")}
|
|
668
|
+
tooltip="Contact Detail View"
|
|
669
|
+
>
|
|
670
|
+
<UserPlus />
|
|
671
|
+
<span>Contact Detail</span>
|
|
672
|
+
</SidebarMenuButton>
|
|
673
|
+
<SidebarMenuButton
|
|
674
|
+
isActive={activePage === "opportunity-detail"}
|
|
675
|
+
onClick={() => setActivePage("opportunity-detail")}
|
|
676
|
+
tooltip="Opportunity Detail View"
|
|
677
|
+
>
|
|
678
|
+
<FileText />
|
|
679
|
+
<span>Deal Detail</span>
|
|
680
|
+
</SidebarMenuButton>
|
|
681
|
+
</SidebarMenu>
|
|
682
|
+
</SidebarGroupContent>
|
|
683
|
+
</SidebarGroup>
|
|
684
|
+
</SidebarContent>
|
|
685
|
+
</Sidebar>
|
|
686
|
+
|
|
687
|
+
<div className="flex flex-1 flex-col h-screen overflow-hidden bg-gray-50/50">
|
|
688
|
+
<div className="flex-1 overflow-y-auto p-4 md:p-8">
|
|
689
|
+
{renderContent()}
|
|
690
|
+
</div>
|
|
691
|
+
</div>
|
|
692
|
+
</SidebarProvider>
|
|
693
|
+
);
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
const meta: Meta = {
|
|
697
|
+
title: 'Apps/CRM',
|
|
698
|
+
component: CRMStoryApp,
|
|
699
|
+
parameters: {
|
|
700
|
+
layout: 'fullscreen',
|
|
701
|
+
},
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
export default meta;
|
|
705
|
+
|
|
706
|
+
export const Default: StoryObj = {};
|