@object-ui/components 3.1.5 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +21 -1
- package/dist/index.css +6339 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31896 -31523
- package/dist/index.umd.cjs +40 -40
- package/dist/{src → packages/components/src}/custom/empty.d.ts +12 -1
- package/dist/{src → packages/components/src}/custom/mobile-dialog-content.d.ts +1 -1
- package/dist/{src → packages/components/src}/renderers/action/action-bar.d.ts +12 -1
- package/dist/{src → packages/components/src}/ui/accordion.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/alert-dialog.d.ts +1 -1
- package/dist/packages/components/src/ui/aspect-ratio.d.ts +10 -0
- package/dist/{src → packages/components/src}/ui/avatar.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/button.d.ts +1 -1
- package/dist/packages/components/src/ui/chart.d.ts +56 -0
- package/dist/{src → packages/components/src}/ui/checkbox.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/collapsible.d.ts +8 -1
- package/dist/{src → packages/components/src}/ui/command.d.ts +2 -2
- package/dist/{src → packages/components/src}/ui/context-menu.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/dialog.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/drawer.d.ts +6 -10
- package/dist/{src → packages/components/src}/ui/dropdown-menu.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/form.d.ts +2 -2
- package/dist/{src → packages/components/src}/ui/hover-card.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/label.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/menubar.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/navigation-menu.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/popover.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/progress.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/radio-group.d.ts +1 -1
- package/dist/packages/components/src/ui/resizable.d.ts +7 -0
- package/dist/{src → packages/components/src}/ui/scroll-area.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/select.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/separator.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/sheet.d.ts +1 -2
- package/dist/{src → packages/components/src}/ui/sidebar.d.ts +1 -8
- package/dist/{src → packages/components/src}/ui/slider.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/switch.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/tabs.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/toast.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/toggle-group.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/toggle.d.ts +1 -1
- package/dist/{src → packages/components/src}/ui/tooltip.d.ts +1 -1
- package/package.json +68 -20
- package/.turbo/turbo-build.log +0 -64
- package/README_SHADCN_SYNC.md +0 -281
- package/TESTING.md +0 -335
- package/dist/src/ui/aspect-ratio.d.ts +0 -3
- package/dist/src/ui/chart.d.ts +0 -68
- package/dist/src/ui/resizable.d.ts +0 -14
- package/docs/FilterBuilder.md +0 -268
- package/metadata/Chart.component.yml +0 -30
- package/metadata/FilterBuilder.component.yml +0 -39
- package/metadata/GridLayout.component.yml +0 -27
- package/metadata/Menu.component.yml +0 -31
- package/metadata/ObjectForm.component.yml +0 -34
- package/metadata/ObjectGrid.component.yml +0 -72
- package/metadata/Page.component.yml +0 -24
- package/postcss.config.js +0 -14
- package/shadcn-components.json +0 -440
- package/src/SchemaRenderer.tsx +0 -28
- package/src/__tests__/PageRendererRegions.test.tsx +0 -668
- package/src/__tests__/README.md +0 -124
- package/src/__tests__/__snapshots__/snapshot-critical.test.tsx.snap +0 -811
- package/src/__tests__/__snapshots__/snapshot.test.tsx.snap +0 -327
- package/src/__tests__/accessibility.test.tsx +0 -137
- package/src/__tests__/action-bar.test.tsx +0 -206
- package/src/__tests__/api-consistency.test.tsx +0 -596
- package/src/__tests__/basic-renderers.test.tsx +0 -255
- package/src/__tests__/color-contrast.test.tsx +0 -212
- package/src/__tests__/complex-disclosure-renderers.test.tsx +0 -302
- package/src/__tests__/compliance.test.tsx +0 -72
- package/src/__tests__/config-field-renderer.test.tsx +0 -307
- package/src/__tests__/config-panel-renderer.test.tsx +0 -580
- package/src/__tests__/config-primitives.test.tsx +0 -106
- package/src/__tests__/edge-cases.test.tsx +0 -285
- package/src/__tests__/feedback-overlay-renderers.test.tsx +0 -349
- package/src/__tests__/filter-builder.test.tsx +0 -409
- package/src/__tests__/form-renderers.test.tsx +0 -364
- package/src/__tests__/layout-data-renderers.test.tsx +0 -340
- package/src/__tests__/mobile-accessibility.test.tsx +0 -120
- package/src/__tests__/navigation-overlay.test.tsx +0 -370
- package/src/__tests__/snapshot-critical.test.tsx +0 -317
- package/src/__tests__/snapshot.test.tsx +0 -205
- package/src/__tests__/test-utils.tsx +0 -190
- package/src/__tests__/use-config-draft.test.tsx +0 -295
- package/src/__tests__/view-compliance.test.tsx +0 -153
- package/src/__tests__/wcag-audit.test.tsx +0 -493
- package/src/custom/action-param-dialog.tsx +0 -264
- package/src/custom/button-group.tsx +0 -91
- package/src/custom/combobox.tsx +0 -104
- package/src/custom/config-field-renderer.tsx +0 -276
- package/src/custom/config-panel-renderer.tsx +0 -306
- package/src/custom/config-row.tsx +0 -50
- package/src/custom/date-picker.tsx +0 -61
- package/src/custom/empty.tsx +0 -112
- package/src/custom/field.tsx +0 -81
- package/src/custom/filter-builder.tsx +0 -418
- package/src/custom/index.ts +0 -21
- package/src/custom/input-group.tsx +0 -53
- package/src/custom/item.tsx +0 -201
- package/src/custom/kbd.tsx +0 -36
- package/src/custom/mobile-dialog-content.tsx +0 -67
- package/src/custom/native-select.tsx +0 -33
- package/src/custom/navigation-overlay.tsx +0 -334
- package/src/custom/section-header.tsx +0 -68
- package/src/custom/sort-builder.tsx +0 -129
- package/src/custom/spinner.tsx +0 -26
- package/src/custom/view-skeleton.tsx +0 -243
- package/src/custom/view-states.tsx +0 -153
- package/src/debug/DebugPanel.tsx +0 -313
- package/src/debug/__tests__/DebugPanel.test.tsx +0 -134
- package/src/debug/index.ts +0 -10
- package/src/hooks/use-config-draft.ts +0 -127
- package/src/hooks/use-mobile.tsx +0 -27
- package/src/index.css +0 -131
- package/src/index.ts +0 -47
- package/src/lib/use-sync-external-store-shim.ts +0 -10
- package/src/lib/use-sync-external-store-with-selector-shim.ts +0 -90
- package/src/lib/utils.tsx +0 -35
- package/src/new-components.test.ts +0 -73
- package/src/renderers/action/action-bar.tsx +0 -221
- package/src/renderers/action/action-button.tsx +0 -158
- package/src/renderers/action/action-group.tsx +0 -270
- package/src/renderers/action/action-icon.tsx +0 -150
- package/src/renderers/action/action-menu.tsx +0 -203
- package/src/renderers/action/index.ts +0 -19
- package/src/renderers/action/resolve-icon.ts +0 -35
- package/src/renderers/basic/button-group.tsx +0 -79
- package/src/renderers/basic/div.tsx +0 -60
- package/src/renderers/basic/html.tsx +0 -43
- package/src/renderers/basic/icon.tsx +0 -89
- package/src/renderers/basic/image.tsx +0 -49
- package/src/renderers/basic/index.ts +0 -18
- package/src/renderers/basic/navigation-menu.tsx +0 -81
- package/src/renderers/basic/pagination.tsx +0 -109
- package/src/renderers/basic/separator.tsx +0 -57
- package/src/renderers/basic/span.tsx +0 -63
- package/src/renderers/basic/text.tsx +0 -52
- package/src/renderers/complex/README-KANBAN.md +0 -208
- package/src/renderers/complex/TIMELINE.md +0 -353
- package/src/renderers/complex/__tests__/data-table-airtable-ux.test.tsx +0 -239
- package/src/renderers/complex/__tests__/data-table-batch-editing.test.tsx +0 -275
- package/src/renderers/complex/__tests__/data-table-cell-renderer.test.tsx +0 -120
- package/src/renderers/complex/__tests__/data-table-editing.test.tsx +0 -221
- package/src/renderers/complex/__tests__/data-table.test.ts +0 -76
- package/src/renderers/complex/carousel.tsx +0 -69
- package/src/renderers/complex/data-table.tsx +0 -1243
- package/src/renderers/complex/filter-builder.tsx +0 -77
- package/src/renderers/complex/index.ts +0 -16
- package/src/renderers/complex/resizable.tsx +0 -66
- package/src/renderers/complex/scroll-area.tsx +0 -58
- package/src/renderers/complex/table.tsx +0 -95
- package/src/renderers/data-display/alert.tsx +0 -46
- package/src/renderers/data-display/avatar.tsx +0 -38
- package/src/renderers/data-display/badge.tsx +0 -55
- package/src/renderers/data-display/breadcrumb.tsx +0 -61
- package/src/renderers/data-display/index.ts +0 -18
- package/src/renderers/data-display/kbd.tsx +0 -50
- package/src/renderers/data-display/list.tsx +0 -75
- package/src/renderers/data-display/statistic.tsx +0 -95
- package/src/renderers/data-display/table.tsx +0 -78
- package/src/renderers/data-display/tree-view.tsx +0 -176
- package/src/renderers/disclosure/accordion.tsx +0 -69
- package/src/renderers/disclosure/collapsible.tsx +0 -53
- package/src/renderers/disclosure/index.ts +0 -11
- package/src/renderers/disclosure/toggle-group.tsx +0 -79
- package/src/renderers/feedback/empty.tsx +0 -49
- package/src/renderers/feedback/index.ts +0 -16
- package/src/renderers/feedback/loading.tsx +0 -78
- package/src/renderers/feedback/progress.tsx +0 -29
- package/src/renderers/feedback/skeleton.tsx +0 -31
- package/src/renderers/feedback/sonner.tsx +0 -56
- package/src/renderers/feedback/spinner.tsx +0 -55
- package/src/renderers/feedback/toast.tsx +0 -59
- package/src/renderers/feedback/toaster.tsx +0 -23
- package/src/renderers/form/button.tsx +0 -103
- package/src/renderers/form/calendar.tsx +0 -34
- package/src/renderers/form/checkbox.tsx +0 -71
- package/src/renderers/form/combobox.tsx +0 -48
- package/src/renderers/form/command.tsx +0 -58
- package/src/renderers/form/date-picker.tsx +0 -84
- package/src/renderers/form/file-upload.tsx +0 -184
- package/src/renderers/form/form.tsx +0 -533
- package/src/renderers/form/index.ts +0 -26
- package/src/renderers/form/input-otp.tsx +0 -51
- package/src/renderers/form/input.tsx +0 -121
- package/src/renderers/form/label.tsx +0 -45
- package/src/renderers/form/radio-group.tsx +0 -63
- package/src/renderers/form/select.tsx +0 -94
- package/src/renderers/form/slider.tsx +0 -61
- package/src/renderers/form/switch.tsx +0 -48
- package/src/renderers/form/textarea.tsx +0 -76
- package/src/renderers/form/toggle.tsx +0 -42
- package/src/renderers/index.ts +0 -18
- package/src/renderers/layout/aspect-ratio.tsx +0 -51
- package/src/renderers/layout/card.tsx +0 -85
- package/src/renderers/layout/container.tsx +0 -122
- package/src/renderers/layout/flex.tsx +0 -132
- package/src/renderers/layout/grid.tsx +0 -178
- package/src/renderers/layout/index.ts +0 -19
- package/src/renderers/layout/page.tsx +0 -466
- package/src/renderers/layout/semantic.tsx +0 -48
- package/src/renderers/layout/stack.tsx +0 -132
- package/src/renderers/layout/tabs.tsx +0 -97
- package/src/renderers/navigation/header-bar.tsx +0 -118
- package/src/renderers/navigation/index.ts +0 -10
- package/src/renderers/navigation/sidebar.tsx +0 -208
- package/src/renderers/overlay/alert-dialog.tsx +0 -72
- package/src/renderers/overlay/context-menu.tsx +0 -100
- package/src/renderers/overlay/dialog.tsx +0 -77
- package/src/renderers/overlay/drawer.tsx +0 -77
- package/src/renderers/overlay/dropdown-menu.tsx +0 -99
- package/src/renderers/overlay/hover-card.tsx +0 -55
- package/src/renderers/overlay/index.ts +0 -18
- package/src/renderers/overlay/menubar.tsx +0 -76
- package/src/renderers/overlay/popover.tsx +0 -56
- package/src/renderers/overlay/sheet.tsx +0 -77
- package/src/renderers/overlay/tooltip.tsx +0 -67
- package/src/renderers/placeholders.tsx +0 -107
- package/src/stories/CRMApp.stories.tsx +0 -706
- package/src/stories/ConfigPanel.stories.tsx +0 -232
- package/src/stories/Guide.mdx +0 -55
- package/src/stories/MockedData.stories.tsx +0 -121
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- 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 +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- 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 +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
- package/src/stories-json/Accessibility.mdx +0 -297
- package/src/stories-json/EdgeCases.stories.tsx +0 -160
- package/src/stories-json/GettingStarted.mdx +0 -89
- package/src/stories-json/Introduction.mdx +0 -127
- package/src/stories-json/accordion.stories.tsx +0 -43
- package/src/stories-json/aggrid.stories.tsx +0 -103
- package/src/stories-json/alert.stories.tsx +0 -39
- package/src/stories-json/aspect-ratio.stories.tsx +0 -34
- package/src/stories-json/avatar.stories.tsx +0 -38
- package/src/stories-json/badge.stories.tsx +0 -53
- package/src/stories-json/breadcrumb.stories.tsx +0 -30
- package/src/stories-json/button-group.stories.tsx +0 -43
- package/src/stories-json/button.stories.tsx +0 -73
- package/src/stories-json/calendar.stories.tsx +0 -85
- package/src/stories-json/card.stories.tsx +0 -48
- package/src/stories-json/carousel.stories.tsx +0 -33
- package/src/stories-json/charts.stories.tsx +0 -195
- package/src/stories-json/chatbot.stories.tsx +0 -248
- package/src/stories-json/code-editor.stories.tsx +0 -92
- package/src/stories-json/collapsible.stories.tsx +0 -40
- package/src/stories-json/controls.stories.tsx +0 -36
- package/src/stories-json/crm-live-data.stories.tsx +0 -154
- package/src/stories-json/dashboard.stories.tsx +0 -318
- package/src/stories-json/data-table.stories.tsx +0 -136
- package/src/stories-json/data_display_extras.stories.tsx +0 -102
- package/src/stories-json/date-picker.stories.tsx +0 -28
- package/src/stories-json/detail-view.stories.tsx +0 -258
- package/src/stories-json/dialog.stories.tsx +0 -43
- package/src/stories-json/feedback_extras.stories.tsx +0 -40
- package/src/stories-json/feedback_others.stories.tsx +0 -46
- package/src/stories-json/form-variants.stories.tsx +0 -210
- package/src/stories-json/form_advanced.stories.tsx +0 -117
- package/src/stories-json/form_extras.stories.tsx +0 -123
- package/src/stories-json/grid.stories.tsx +0 -56
- package/src/stories-json/icon.stories.tsx +0 -36
- package/src/stories-json/input.stories.tsx +0 -52
- package/src/stories-json/kanban.stories.tsx +0 -295
- package/src/stories-json/layout_extended.stories.tsx +0 -76
- package/src/stories-json/layout_flex.stories.tsx +0 -107
- package/src/stories-json/list-view.stories.tsx +0 -97
- package/src/stories-json/markdown.stories.tsx +0 -129
- package/src/stories-json/menus.stories.tsx +0 -63
- package/src/stories-json/metric-card.stories.tsx +0 -143
- package/src/stories-json/navigation-menu.stories.tsx +0 -37
- package/src/stories-json/object-aggrid-advanced.stories.tsx +0 -389
- package/src/stories-json/object-aggrid.stories.tsx +0 -252
- package/src/stories-json/object-form.stories.tsx +0 -130
- package/src/stories-json/object-gantt.stories.tsx +0 -114
- package/src/stories-json/object-grid.stories.tsx +0 -315
- package/src/stories-json/object-map.stories.tsx +0 -116
- package/src/stories-json/object-view.stories.tsx +0 -118
- package/src/stories-json/overlay_extras.stories.tsx +0 -113
- package/src/stories-json/overlay_others.stories.tsx +0 -76
- package/src/stories-json/page.stories.tsx +0 -55
- package/src/stories-json/reports.stories.tsx +0 -163
- package/src/stories-json/resizable.stories.tsx +0 -44
- package/src/stories-json/select.stories.tsx +0 -34
- package/src/stories-json/separator.stories.tsx +0 -41
- package/src/stories-json/sidebar.stories.tsx +0 -147
- package/src/stories-json/statistic.stories.tsx +0 -44
- package/src/stories-json/tabs.stories.tsx +0 -51
- package/src/stories-json/timeline.stories.tsx +0 -188
- package/src/stories-json/typography.stories.tsx +0 -45
- package/src/types/config-panel.ts +0 -101
- package/src/ui/accordion.tsx +0 -66
- package/src/ui/alert-dialog.tsx +0 -149
- package/src/ui/alert.tsx +0 -67
- package/src/ui/aspect-ratio.tsx +0 -15
- package/src/ui/avatar.tsx +0 -58
- package/src/ui/badge.tsx +0 -44
- package/src/ui/breadcrumb.tsx +0 -123
- package/src/ui/button.tsx +0 -66
- package/src/ui/calendar.tsx +0 -221
- package/src/ui/card.tsx +0 -87
- package/src/ui/carousel.tsx +0 -270
- package/src/ui/chart.tsx +0 -367
- package/src/ui/checkbox.tsx +0 -38
- package/src/ui/collapsible.tsx +0 -19
- package/src/ui/command.tsx +0 -161
- package/src/ui/context-menu.tsx +0 -208
- package/src/ui/dialog.tsx +0 -147
- package/src/ui/drawer.tsx +0 -126
- package/src/ui/dropdown-menu.tsx +0 -208
- package/src/ui/form.tsx +0 -186
- package/src/ui/hover-card.tsx +0 -37
- package/src/ui/index.ts +0 -56
- package/src/ui/input-otp.tsx +0 -79
- package/src/ui/input.tsx +0 -30
- package/src/ui/label.tsx +0 -34
- package/src/ui/menubar.tsx +0 -264
- package/src/ui/navigation-menu.tsx +0 -136
- package/src/ui/pagination.tsx +0 -125
- package/src/ui/popover.tsx +0 -39
- package/src/ui/progress.tsx +0 -36
- package/src/ui/radio-group.tsx +0 -52
- package/src/ui/resizable.tsx +0 -53
- package/src/ui/scroll-area.tsx +0 -56
- package/src/ui/select.tsx +0 -168
- package/src/ui/separator.tsx +0 -39
- package/src/ui/sheet.tsx +0 -151
- package/src/ui/sidebar.tsx +0 -866
- package/src/ui/skeleton.tsx +0 -23
- package/src/ui/slider.tsx +0 -40
- package/src/ui/sonner.tsx +0 -53
- package/src/ui/switch.tsx +0 -37
- package/src/ui/table.tsx +0 -125
- package/src/ui/tabs.tsx +0 -63
- package/src/ui/textarea.tsx +0 -30
- package/src/ui/toast.tsx +0 -137
- package/src/ui/toggle-group.tsx +0 -69
- package/src/ui/toggle.tsx +0 -53
- package/src/ui/tooltip.tsx +0 -38
- package/src/ui/typography.tsx +0 -85
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -70
- package/vitest.config.ts +0 -5
- /package/dist/{src → packages/components/src}/SchemaRenderer.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/action-param-dialog.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/button-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/combobox.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/config-field-renderer.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/config-panel-renderer.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/config-row.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/date-picker.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/field.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/filter-builder.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/input-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/item.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/kbd.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/native-select.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/navigation-overlay.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/section-header.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/sort-builder.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/spinner.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/view-skeleton.d.ts +0 -0
- /package/dist/{src → packages/components/src}/custom/view-states.d.ts +0 -0
- /package/dist/{src → packages/components/src}/debug/DebugPanel.d.ts +0 -0
- /package/dist/{src → packages/components/src}/debug/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/hooks/use-config-draft.d.ts +0 -0
- /package/dist/{src → packages/components/src}/hooks/use-mobile.d.ts +0 -0
- /package/dist/{src → packages/components/src}/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/lib/use-sync-external-store-shim.d.ts +0 -0
- /package/dist/{src → packages/components/src}/lib/use-sync-external-store-with-selector-shim.d.ts +0 -0
- /package/dist/{src → packages/components/src}/lib/utils.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/action-button.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/action-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/action-icon.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/action-menu.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/action/resolve-icon.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/button-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/div.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/html.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/icon.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/image.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/navigation-menu.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/pagination.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/separator.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/span.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/basic/text.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/carousel.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/data-table.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/filter-builder.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/resizable.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/scroll-area.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/complex/table.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/alert.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/avatar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/badge.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/breadcrumb.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/kbd.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/list.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/statistic.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/table.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/data-display/tree-view.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/disclosure/accordion.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/disclosure/collapsible.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/disclosure/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/disclosure/toggle-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/empty.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/loading.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/progress.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/skeleton.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/sonner.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/spinner.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/toast.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/feedback/toaster.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/button.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/calendar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/checkbox.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/combobox.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/command.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/date-picker.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/file-upload.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/form.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/input-otp.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/input.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/label.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/radio-group.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/select.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/slider.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/switch.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/textarea.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/form/toggle.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/aspect-ratio.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/card.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/container.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/flex.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/grid.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/page.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/semantic.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/stack.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/layout/tabs.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/navigation/header-bar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/navigation/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/navigation/sidebar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/alert-dialog.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/context-menu.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/dialog.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/drawer.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/dropdown-menu.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/hover-card.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/menubar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/popover.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/sheet.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/overlay/tooltip.d.ts +0 -0
- /package/dist/{src → packages/components/src}/renderers/placeholders.d.ts +0 -0
- /package/dist/{src → packages/components/src}/types/config-panel.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/alert.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/badge.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/breadcrumb.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/calendar.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/card.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/carousel.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/index.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/input-otp.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/input.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/pagination.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/skeleton.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/sonner.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/table.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/textarea.d.ts +0 -0
- /package/dist/{src → packages/components/src}/ui/typography.d.ts +0 -0
package/src/index.css
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
/* Scan sources for Tailwind classes */
|
|
4
|
-
@source '../src/**/*.{ts,tsx}';
|
|
5
|
-
|
|
6
|
-
/* Tailwind plugin for animations */
|
|
7
|
-
@plugin 'tailwindcss-animate';
|
|
8
|
-
|
|
9
|
-
/* Define theme colors for Tailwind 4 */
|
|
10
|
-
@theme {
|
|
11
|
-
/* Border radius tokens */
|
|
12
|
-
--radius-lg: var(--radius);
|
|
13
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
14
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
15
|
-
|
|
16
|
-
/* Color tokens mapped to CSS variables */
|
|
17
|
-
--color-border: hsl(var(--border));
|
|
18
|
-
--color-input: hsl(var(--input));
|
|
19
|
-
--color-ring: hsl(var(--ring));
|
|
20
|
-
--color-background: hsl(var(--background));
|
|
21
|
-
--color-foreground: hsl(var(--foreground));
|
|
22
|
-
--color-primary: hsl(var(--primary));
|
|
23
|
-
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
24
|
-
--color-secondary: hsl(var(--secondary));
|
|
25
|
-
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
26
|
-
--color-destructive: hsl(var(--destructive));
|
|
27
|
-
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
28
|
-
--color-muted: hsl(var(--muted));
|
|
29
|
-
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
30
|
-
--color-accent: hsl(var(--accent));
|
|
31
|
-
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
32
|
-
--color-popover: hsl(var(--popover));
|
|
33
|
-
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
34
|
-
--color-card: hsl(var(--card));
|
|
35
|
-
--color-card-foreground: hsl(var(--card-foreground));
|
|
36
|
-
|
|
37
|
-
/* Chart colors */
|
|
38
|
-
--color-chart-1: hsl(var(--chart-1));
|
|
39
|
-
--color-chart-2: hsl(var(--chart-2));
|
|
40
|
-
--color-chart-3: hsl(var(--chart-3));
|
|
41
|
-
--color-chart-4: hsl(var(--chart-4));
|
|
42
|
-
--color-chart-5: hsl(var(--chart-5));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* CSS custom properties for theme */
|
|
46
|
-
:root {
|
|
47
|
-
--background: 0 0% 100%;
|
|
48
|
-
--foreground: 222.2 84% 4.9%;
|
|
49
|
-
|
|
50
|
-
--card: 0 0% 100%;
|
|
51
|
-
--card-foreground: 222.2 84% 4.9%;
|
|
52
|
-
|
|
53
|
-
--popover: 0 0% 100%;
|
|
54
|
-
--popover-foreground: 222.2 84% 4.9%;
|
|
55
|
-
|
|
56
|
-
--primary: 222.2 47.4% 11.2%;
|
|
57
|
-
--primary-foreground: 210 40% 98%;
|
|
58
|
-
|
|
59
|
-
--secondary: 210 40% 96.1%;
|
|
60
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
61
|
-
|
|
62
|
-
--muted: 210 40% 96.1%;
|
|
63
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
64
|
-
|
|
65
|
-
--accent: 210 40% 96.1%;
|
|
66
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
67
|
-
|
|
68
|
-
--destructive: 0 84.2% 60.2%;
|
|
69
|
-
--destructive-foreground: 210 40% 98%;
|
|
70
|
-
|
|
71
|
-
--border: 214.3 31.8% 91.4%;
|
|
72
|
-
--input: 214.3 31.8% 91.4%;
|
|
73
|
-
--ring: 222.2 84% 4.9%;
|
|
74
|
-
|
|
75
|
-
--radius: 0.5rem;
|
|
76
|
-
|
|
77
|
-
--config-panel-width: 320px;
|
|
78
|
-
|
|
79
|
-
--chart-1: 12 76% 61%;
|
|
80
|
-
--chart-2: 173 58% 39%;
|
|
81
|
-
--chart-3: 197 37% 24%;
|
|
82
|
-
--chart-4: 43 74% 66%;
|
|
83
|
-
--chart-5: 27 87% 67%;
|
|
84
|
-
|
|
85
|
-
font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.dark {
|
|
89
|
-
--background: 222.2 84% 4.9%;
|
|
90
|
-
--foreground: 210 40% 98%;
|
|
91
|
-
|
|
92
|
-
--card: 222.2 84% 4.9%;
|
|
93
|
-
--card-foreground: 210 40% 98%;
|
|
94
|
-
|
|
95
|
-
--popover: 222.2 84% 4.9%;
|
|
96
|
-
--popover-foreground: 210 40% 98%;
|
|
97
|
-
|
|
98
|
-
--primary: 210 40% 98%;
|
|
99
|
-
--primary-foreground: 222.2 47.4% 11.2%;
|
|
100
|
-
|
|
101
|
-
--secondary: 217.2 32.6% 17.5%;
|
|
102
|
-
--secondary-foreground: 210 40% 98%;
|
|
103
|
-
|
|
104
|
-
--muted: 217.2 32.6% 17.5%;
|
|
105
|
-
--muted-foreground: 215 20.2% 65.1%;
|
|
106
|
-
|
|
107
|
-
--accent: 217.2 32.6% 17.5%;
|
|
108
|
-
--accent-foreground: 210 40% 98%;
|
|
109
|
-
|
|
110
|
-
--destructive: 0 62.8% 30.6%;
|
|
111
|
-
--destructive-foreground: 210 40% 98%;
|
|
112
|
-
|
|
113
|
-
--border: 217.2 32.6% 17.5%;
|
|
114
|
-
--input: 217.2 32.6% 17.5%;
|
|
115
|
-
--ring: 212.7 26.8% 83.9%;
|
|
116
|
-
|
|
117
|
-
--chart-1: 220 70% 50%;
|
|
118
|
-
--chart-2: 160 60% 45%;
|
|
119
|
-
--chart-3: 30 80% 55%;
|
|
120
|
-
--chart-4: 280 65% 60%;
|
|
121
|
-
--chart-5: 340 75% 55%;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
* {
|
|
125
|
-
border-color: hsl(var(--border));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
body {
|
|
129
|
-
background-color: hsl(var(--background));
|
|
130
|
-
color: hsl(var(--foreground));
|
|
131
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import './index.css';
|
|
10
|
-
|
|
11
|
-
// Register all ObjectUI renderers (side-effects)
|
|
12
|
-
import './renderers';
|
|
13
|
-
|
|
14
|
-
// Export utils
|
|
15
|
-
export { cn } from './lib/utils';
|
|
16
|
-
export { renderChildren } from './lib/utils';
|
|
17
|
-
export { cva } from 'class-variance-authority';
|
|
18
|
-
|
|
19
|
-
// Export placeholder registration
|
|
20
|
-
export { registerPlaceholders } from './renderers/placeholders';
|
|
21
|
-
|
|
22
|
-
// Export raw Shadcn UI components
|
|
23
|
-
export * from './ui';
|
|
24
|
-
export * from './custom';
|
|
25
|
-
|
|
26
|
-
// Export hooks
|
|
27
|
-
export { useConfigDraft } from './hooks/use-config-draft';
|
|
28
|
-
export type { UseConfigDraftOptions, UseConfigDraftReturn } from './hooks/use-config-draft';
|
|
29
|
-
|
|
30
|
-
// Export config panel types
|
|
31
|
-
export type {
|
|
32
|
-
ControlType,
|
|
33
|
-
ConfigField,
|
|
34
|
-
ConfigSection,
|
|
35
|
-
ConfigPanelSchema,
|
|
36
|
-
} from './types/config-panel';
|
|
37
|
-
|
|
38
|
-
// Export an init function to ensure components are registered
|
|
39
|
-
// This is a workaround for bundlers that might tree-shake side-effect imports
|
|
40
|
-
export function initializeComponents() {
|
|
41
|
-
// This function exists to ensure the import side-effects above are executed
|
|
42
|
-
// Simply importing this module should register all components
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Debug panel (tree-shakeable — only included when imported)
|
|
47
|
-
export * from './debug';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESM re-export of useSyncExternalStore from React.
|
|
3
|
-
*
|
|
4
|
-
* React 18+ ships useSyncExternalStore natively. The CJS shim package
|
|
5
|
-
* (`use-sync-external-store/shim`) uses `require("react")` which
|
|
6
|
-
* produces a Rolldown `require` polyfill incompatible with Next.js
|
|
7
|
-
* Turbopack SSR. This module provides the same API surface using a
|
|
8
|
-
* static ESM import instead.
|
|
9
|
-
*/
|
|
10
|
-
export { useSyncExternalStore } from 'react';
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESM re-export of useSyncExternalStoreWithSelector.
|
|
3
|
-
*
|
|
4
|
-
* The CJS shim package uses `require("react")` which produces a
|
|
5
|
-
* Rolldown `require` polyfill incompatible with Next.js Turbopack SSR.
|
|
6
|
-
* This module provides a pure-ESM implementation using React 18+
|
|
7
|
-
* native useSyncExternalStore.
|
|
8
|
-
*/
|
|
9
|
-
import { useRef, useEffect, useMemo, useDebugValue, useSyncExternalStore } from 'react';
|
|
10
|
-
|
|
11
|
-
function is(x: unknown, y: unknown): boolean {
|
|
12
|
-
return (x === y && (0 !== x || 1 / (x as number) === 1 / (y as number))) || (x !== x && y !== y);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const objectIs: (x: unknown, y: unknown) => boolean =
|
|
16
|
-
typeof Object.is === 'function' ? Object.is : is;
|
|
17
|
-
|
|
18
|
-
export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
|
|
19
|
-
subscribe: (onStoreChange: () => void) => () => void,
|
|
20
|
-
getSnapshot: () => Snapshot,
|
|
21
|
-
getServerSnapshot: undefined | null | (() => Snapshot),
|
|
22
|
-
selector: (snapshot: Snapshot) => Selection,
|
|
23
|
-
isEqual?: (a: Selection, b: Selection) => boolean,
|
|
24
|
-
): Selection {
|
|
25
|
-
const instRef = useRef<{
|
|
26
|
-
hasValue: boolean;
|
|
27
|
-
value: Selection;
|
|
28
|
-
} | null>(null);
|
|
29
|
-
let inst: { hasValue: boolean; value: Selection };
|
|
30
|
-
if (instRef.current === null) {
|
|
31
|
-
inst = { hasValue: false, value: null as Selection };
|
|
32
|
-
instRef.current = inst;
|
|
33
|
-
} else {
|
|
34
|
-
inst = instRef.current;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const [getSelection, getServerSelection] = useMemo(() => {
|
|
38
|
-
let hasMemo = false;
|
|
39
|
-
let memoizedSnapshot: Snapshot;
|
|
40
|
-
let memoizedSelection: Selection;
|
|
41
|
-
const memoizedSelector = (nextSnapshot: Snapshot): Selection => {
|
|
42
|
-
if (!hasMemo) {
|
|
43
|
-
hasMemo = true;
|
|
44
|
-
memoizedSnapshot = nextSnapshot;
|
|
45
|
-
const nextSelection = selector(nextSnapshot);
|
|
46
|
-
if (isEqual !== undefined) {
|
|
47
|
-
if (inst.hasValue) {
|
|
48
|
-
const currentSelection = inst.value;
|
|
49
|
-
if (isEqual(currentSelection, nextSelection)) {
|
|
50
|
-
memoizedSelection = currentSelection;
|
|
51
|
-
return currentSelection;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
memoizedSelection = nextSelection;
|
|
56
|
-
return nextSelection;
|
|
57
|
-
}
|
|
58
|
-
const prevSnapshot = memoizedSnapshot;
|
|
59
|
-
const prevSelection = memoizedSelection;
|
|
60
|
-
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
61
|
-
return prevSelection;
|
|
62
|
-
}
|
|
63
|
-
const nextSelection = selector(nextSnapshot);
|
|
64
|
-
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
65
|
-
memoizedSnapshot = nextSnapshot;
|
|
66
|
-
return prevSelection;
|
|
67
|
-
}
|
|
68
|
-
memoizedSnapshot = nextSnapshot;
|
|
69
|
-
memoizedSelection = nextSelection;
|
|
70
|
-
return nextSelection;
|
|
71
|
-
};
|
|
72
|
-
const maybeGetServerSelection =
|
|
73
|
-
getServerSnapshot === undefined || getServerSnapshot === null
|
|
74
|
-
? undefined
|
|
75
|
-
: () => memoizedSelector(getServerSnapshot());
|
|
76
|
-
return [() => memoizedSelector(getSnapshot()), maybeGetServerSelection];
|
|
77
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
|
-
}, [getSnapshot, getServerSnapshot, selector, isEqual]);
|
|
79
|
-
|
|
80
|
-
const value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
81
|
-
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
inst.hasValue = true;
|
|
84
|
-
inst.value = value;
|
|
85
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
|
-
}, [value]);
|
|
87
|
-
|
|
88
|
-
useDebugValue(value);
|
|
89
|
-
return value;
|
|
90
|
-
}
|
package/src/lib/utils.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { clsx, type ClassValue } from "clsx"
|
|
10
|
-
import { twMerge } from "tailwind-merge"
|
|
11
|
-
import { SchemaRenderer } from "@object-ui/react"
|
|
12
|
-
import React from "react"
|
|
13
|
-
|
|
14
|
-
export function cn(...inputs: ClassValue[]) {
|
|
15
|
-
return twMerge(clsx(inputs))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function renderChildren(children: any): React.ReactNode {
|
|
19
|
-
if (!children) return null;
|
|
20
|
-
if (typeof children === 'string' || typeof children === 'number') {
|
|
21
|
-
return children;
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(children)) {
|
|
24
|
-
if (children.length === 0) return null;
|
|
25
|
-
// Unwrap single child to support Radix UI 'asChild' pattern which expects a single ReactElement, not an array
|
|
26
|
-
if (children.length === 1) {
|
|
27
|
-
return <SchemaRenderer schema={children[0]} />;
|
|
28
|
-
}
|
|
29
|
-
return children.map((child, index) => (
|
|
30
|
-
<SchemaRenderer key={child.id || index} schema={child} />
|
|
31
|
-
));
|
|
32
|
-
}
|
|
33
|
-
return <SchemaRenderer schema={children} />;
|
|
34
|
-
}
|
|
35
|
-
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { describe, it, expect, beforeAll } from 'vitest';
|
|
10
|
-
import { ComponentRegistry } from '@object-ui/core';
|
|
11
|
-
|
|
12
|
-
describe('New Components Registration', () => {
|
|
13
|
-
// Import all renderers to register them
|
|
14
|
-
beforeAll(async () => {
|
|
15
|
-
await import('./renderers');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('Form Components', () => {
|
|
19
|
-
it('should register date-picker component', () => {
|
|
20
|
-
const component = ComponentRegistry.getConfig('date-picker');
|
|
21
|
-
expect(component).toBeDefined();
|
|
22
|
-
expect(component?.label).toBe('Date Picker');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should register file-upload component', () => {
|
|
26
|
-
const component = ComponentRegistry.getConfig('file-upload');
|
|
27
|
-
expect(component).toBeDefined();
|
|
28
|
-
expect(component?.label).toBe('File Upload');
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe('Data Display Components', () => {
|
|
33
|
-
it('should register list component', () => {
|
|
34
|
-
const component = ComponentRegistry.getConfig('list');
|
|
35
|
-
expect(component).toBeDefined();
|
|
36
|
-
expect(component?.label).toBe('List');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should register tree-view component', () => {
|
|
40
|
-
const component = ComponentRegistry.getConfig('tree-view');
|
|
41
|
-
expect(component).toBeDefined();
|
|
42
|
-
expect(component?.label).toBe('Tree View');
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('Layout Components', () => {
|
|
47
|
-
it('should register grid component', () => {
|
|
48
|
-
const component = ComponentRegistry.getConfig('grid');
|
|
49
|
-
expect(component).toBeDefined();
|
|
50
|
-
expect(component?.label).toBe('Grid Layout');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should register flex component', () => {
|
|
54
|
-
const component = ComponentRegistry.getConfig('flex');
|
|
55
|
-
expect(component).toBeDefined();
|
|
56
|
-
expect(component?.label).toBe('Flex Layout');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should register container component', () => {
|
|
60
|
-
const component = ComponentRegistry.getConfig('container');
|
|
61
|
-
expect(component).toBeDefined();
|
|
62
|
-
expect(component?.label).toBe('Container');
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('Feedback Components', () => {
|
|
67
|
-
it('should register loading component', () => {
|
|
68
|
-
const component = ComponentRegistry.getConfig('loading');
|
|
69
|
-
expect(component).toBeDefined();
|
|
70
|
-
expect(component?.label).toBe('Loading');
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ObjectUI
|
|
3
|
-
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* action:bar — Location-aware action toolbar.
|
|
11
|
-
*
|
|
12
|
-
* Renders a set of ActionSchema items filtered by a given location.
|
|
13
|
-
* Each action is rendered using its `component` type (action:button, action:icon,
|
|
14
|
-
* action:menu, action:group) via the ComponentRegistry. Actions beyond the
|
|
15
|
-
* `maxVisible` threshold are grouped into an overflow "More" dropdown.
|
|
16
|
-
*
|
|
17
|
-
* This is the "bridge" component that connects ActionSchema metadata to the UI,
|
|
18
|
-
* enabling server-driven action rendering at list_toolbar, record_header,
|
|
19
|
-
* list_item, record_more, record_related, and global_nav locations.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <SchemaRenderer schema={{
|
|
24
|
-
* type: 'action:bar',
|
|
25
|
-
* location: 'record_header',
|
|
26
|
-
* actions: [
|
|
27
|
-
* { name: 'mark_complete', label: 'Mark Complete', type: 'script', icon: 'check', component: 'action:button' },
|
|
28
|
-
* { name: 'delete', label: 'Delete', type: 'api', icon: 'trash-2', variant: 'destructive', component: 'action:button' },
|
|
29
|
-
* ],
|
|
30
|
-
* }} />
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
import React, { forwardRef, useMemo } from 'react';
|
|
35
|
-
import { ComponentRegistry } from '@object-ui/core';
|
|
36
|
-
import type { ActionSchema, ActionLocation, ActionComponent } from '@object-ui/types';
|
|
37
|
-
import { useCondition } from '@object-ui/react';
|
|
38
|
-
import { cn } from '../../lib/utils';
|
|
39
|
-
import { useIsMobile } from '../../hooks/use-mobile';
|
|
40
|
-
|
|
41
|
-
export interface ActionBarSchema {
|
|
42
|
-
type: 'action:bar';
|
|
43
|
-
/** Actions to render */
|
|
44
|
-
actions?: ActionSchema[];
|
|
45
|
-
/** Filter actions by this location */
|
|
46
|
-
location?: ActionLocation;
|
|
47
|
-
/** Maximum visible inline actions before overflow into "More" menu (default: 3) */
|
|
48
|
-
maxVisible?: number;
|
|
49
|
-
/** Maximum visible inline actions on mobile devices (default: 1). Desktop uses maxVisible instead. */
|
|
50
|
-
mobileMaxVisible?: number;
|
|
51
|
-
/** Visibility condition expression */
|
|
52
|
-
visible?: string;
|
|
53
|
-
/** Layout direction */
|
|
54
|
-
direction?: 'horizontal' | 'vertical';
|
|
55
|
-
/** Gap between items (Tailwind gap class, default: 'gap-2') */
|
|
56
|
-
gap?: string;
|
|
57
|
-
/** Button variant for all actions (can be overridden per-action) */
|
|
58
|
-
variant?: string;
|
|
59
|
-
/** Button size for all actions (can be overridden per-action) */
|
|
60
|
-
size?: string;
|
|
61
|
-
/** Custom CSS class */
|
|
62
|
-
className?: string;
|
|
63
|
-
[key: string]: any;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const ActionBarRenderer = forwardRef<HTMLDivElement, { schema: ActionBarSchema; [key: string]: any }>(
|
|
67
|
-
({ schema, className, ...props }, ref) => {
|
|
68
|
-
const {
|
|
69
|
-
'data-obj-id': dataObjId,
|
|
70
|
-
'data-obj-type': dataObjType,
|
|
71
|
-
style,
|
|
72
|
-
data,
|
|
73
|
-
...rest
|
|
74
|
-
} = props;
|
|
75
|
-
|
|
76
|
-
const isVisible = useCondition(schema.visible ? `\${${schema.visible}}` : undefined);
|
|
77
|
-
const isMobile = useIsMobile();
|
|
78
|
-
|
|
79
|
-
// Filter actions by location and deduplicate by name
|
|
80
|
-
const filteredActions = useMemo(() => {
|
|
81
|
-
const actions = schema.actions || [];
|
|
82
|
-
const located = !schema.location
|
|
83
|
-
? actions
|
|
84
|
-
: actions.filter(
|
|
85
|
-
a => !a.locations || a.locations.length === 0 || a.locations.includes(schema.location!),
|
|
86
|
-
);
|
|
87
|
-
// Deduplicate by action name — keep first occurrence
|
|
88
|
-
const seen = new Set<string>();
|
|
89
|
-
return located.filter(a => {
|
|
90
|
-
if (!a.name) return true;
|
|
91
|
-
if (seen.has(a.name)) return false;
|
|
92
|
-
seen.add(a.name);
|
|
93
|
-
return true;
|
|
94
|
-
});
|
|
95
|
-
}, [schema.actions, schema.location]);
|
|
96
|
-
|
|
97
|
-
// Split into visible inline actions and overflow
|
|
98
|
-
// On mobile, show fewer actions inline (default: 1)
|
|
99
|
-
const maxVisible = isMobile
|
|
100
|
-
? (schema.mobileMaxVisible ?? 1)
|
|
101
|
-
: (schema.maxVisible ?? 3);
|
|
102
|
-
const { inlineActions, overflowActions } = useMemo(() => {
|
|
103
|
-
if (filteredActions.length <= maxVisible) {
|
|
104
|
-
return { inlineActions: filteredActions, overflowActions: [] as ActionSchema[] };
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
inlineActions: filteredActions.slice(0, maxVisible),
|
|
108
|
-
overflowActions: filteredActions.slice(maxVisible),
|
|
109
|
-
};
|
|
110
|
-
}, [filteredActions, maxVisible]);
|
|
111
|
-
|
|
112
|
-
if (schema.visible && !isVisible) return null;
|
|
113
|
-
if (filteredActions.length === 0) return null;
|
|
114
|
-
|
|
115
|
-
const direction = schema.direction || 'horizontal';
|
|
116
|
-
const gap = schema.gap || 'gap-2';
|
|
117
|
-
|
|
118
|
-
// Render overflow menu for excess actions
|
|
119
|
-
const MenuRenderer = overflowActions.length > 0 ? ComponentRegistry.get('action:menu') : null;
|
|
120
|
-
const overflowMenu = MenuRenderer ? (
|
|
121
|
-
<MenuRenderer
|
|
122
|
-
schema={{
|
|
123
|
-
type: 'action:menu' as const,
|
|
124
|
-
actions: overflowActions,
|
|
125
|
-
variant: schema.variant || 'ghost',
|
|
126
|
-
size: schema.size || 'sm',
|
|
127
|
-
}}
|
|
128
|
-
/>
|
|
129
|
-
) : null;
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<div
|
|
133
|
-
ref={ref}
|
|
134
|
-
className={cn(
|
|
135
|
-
'flex items-center',
|
|
136
|
-
direction === 'vertical' ? 'flex-col items-stretch' : 'flex-row flex-wrap',
|
|
137
|
-
gap,
|
|
138
|
-
schema.className,
|
|
139
|
-
className,
|
|
140
|
-
)}
|
|
141
|
-
role="toolbar"
|
|
142
|
-
aria-label="Actions"
|
|
143
|
-
{...rest}
|
|
144
|
-
{...{ 'data-obj-id': dataObjId, 'data-obj-type': dataObjType, style }}
|
|
145
|
-
>
|
|
146
|
-
{inlineActions.map((action) => {
|
|
147
|
-
const componentType: ActionComponent = action.component || 'action:button';
|
|
148
|
-
const Renderer = ComponentRegistry.get(componentType);
|
|
149
|
-
if (!Renderer) return null;
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<Renderer
|
|
153
|
-
key={action.name}
|
|
154
|
-
schema={{
|
|
155
|
-
...action,
|
|
156
|
-
type: componentType,
|
|
157
|
-
actionType: action.type,
|
|
158
|
-
variant: action.variant || schema.variant,
|
|
159
|
-
size: action.size || schema.size,
|
|
160
|
-
}}
|
|
161
|
-
data={data}
|
|
162
|
-
/>
|
|
163
|
-
);
|
|
164
|
-
})}
|
|
165
|
-
|
|
166
|
-
{overflowActions.length > 0 && overflowMenu}
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
ActionBarRenderer.displayName = 'ActionBarRenderer';
|
|
173
|
-
|
|
174
|
-
ComponentRegistry.register('action:bar', ActionBarRenderer, {
|
|
175
|
-
namespace: 'action',
|
|
176
|
-
label: 'Action Bar',
|
|
177
|
-
inputs: [
|
|
178
|
-
{ name: 'actions', type: 'object', label: 'Actions' },
|
|
179
|
-
{
|
|
180
|
-
name: 'location',
|
|
181
|
-
type: 'enum',
|
|
182
|
-
label: 'Location',
|
|
183
|
-
enum: ['list_toolbar', 'list_item', 'record_header', 'record_more', 'record_related', 'global_nav'],
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: 'maxVisible',
|
|
187
|
-
type: 'number',
|
|
188
|
-
label: 'Max Visible Actions',
|
|
189
|
-
defaultValue: 3,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'direction',
|
|
193
|
-
type: 'enum',
|
|
194
|
-
label: 'Direction',
|
|
195
|
-
enum: ['horizontal', 'vertical'],
|
|
196
|
-
defaultValue: 'horizontal',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
name: 'variant',
|
|
200
|
-
type: 'enum',
|
|
201
|
-
label: 'Default Variant',
|
|
202
|
-
enum: ['default', 'secondary', 'outline', 'ghost'],
|
|
203
|
-
defaultValue: 'outline',
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: 'size',
|
|
207
|
-
type: 'enum',
|
|
208
|
-
label: 'Default Size',
|
|
209
|
-
enum: ['sm', 'md', 'lg'],
|
|
210
|
-
defaultValue: 'sm',
|
|
211
|
-
},
|
|
212
|
-
{ name: 'className', type: 'string', label: 'CSS Class', advanced: true },
|
|
213
|
-
],
|
|
214
|
-
defaultProps: {
|
|
215
|
-
maxVisible: 3,
|
|
216
|
-
direction: 'horizontal',
|
|
217
|
-
variant: 'outline',
|
|
218
|
-
size: 'sm',
|
|
219
|
-
actions: [],
|
|
220
|
-
},
|
|
221
|
-
});
|