-
Notifications
You must be signed in to change notification settings - Fork 0
Fix table and form demo rendering in documentation pages #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4665251
10e9242
1e8ceaf
87dacb3
3853e1f
73a236e
3796bd3
7454abd
ebfd6a5
8b1dea8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,12 +11,75 @@ The Sidebar component provides a collapsible navigation sidebar for applications | |
|
|
||
| <ComponentDemo | ||
| schema={{ | ||
| type: 'sidebar', | ||
| items: [ | ||
| { label: 'Dashboard', icon: 'home', href: '/' }, | ||
| { label: 'Projects', icon: 'folder', href: '/projects' }, | ||
| { label: 'Team', icon: 'users', href: '/team' }, | ||
| { label: 'Settings', icon: 'settings', href: '/settings' } | ||
| type: 'sidebar-provider', | ||
| body: [ | ||
| { | ||
| type: 'sidebar', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-content', | ||
|
Comment on lines
+14
to
+20
|
||
| body: [ | ||
| { | ||
| type: 'sidebar-group', | ||
| label: 'Menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Dashboard' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Projects' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Team' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Settings' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-inset', | ||
| body: [ | ||
| { | ||
| type: 'div', | ||
| className: 'p-4', | ||
| body: [{ type: 'text', content: 'Main content area' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }} | ||
| title="Basic Sidebar" | ||
|
|
@@ -26,20 +89,84 @@ The Sidebar component provides a collapsible navigation sidebar for applications | |
|
|
||
| <ComponentDemo | ||
| schema={{ | ||
| type: 'sidebar', | ||
| groups: [ | ||
| type: 'sidebar-provider', | ||
| body: [ | ||
| { | ||
| title: 'Main', | ||
| items: [ | ||
| { label: 'Dashboard', icon: 'home', href: '/' }, | ||
| { label: 'Analytics', icon: 'bar-chart', href: '/analytics' } | ||
| type: 'sidebar', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-content', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-group', | ||
| label: 'Main', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Dashboard' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Analytics' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-group', | ||
| label: 'Management', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Projects' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Team' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| title: 'Management', | ||
| items: [ | ||
| { label: 'Projects', icon: 'folder', href: '/projects' }, | ||
| { label: 'Team', icon: 'users', href: '/team' } | ||
| type: 'sidebar-inset', | ||
| body: [ | ||
| { | ||
| type: 'div', | ||
| className: 'p-4', | ||
| body: [{ type: 'text', content: 'Main content area' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
|
|
@@ -51,13 +178,69 @@ The Sidebar component provides a collapsible navigation sidebar for applications | |
|
|
||
| <ComponentDemo | ||
| schema={{ | ||
| type: 'sidebar', | ||
| collapsible: true, | ||
| defaultCollapsed: false, | ||
| items: [ | ||
| { label: 'Home', icon: 'home', href: '/' }, | ||
| { label: 'Files', icon: 'folder', href: '/files' }, | ||
| { label: 'Settings', icon: 'settings', href: '/settings' } | ||
| type: 'sidebar-provider', | ||
| body: [ | ||
| { | ||
| type: 'sidebar', | ||
| collapsible: 'icon', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-content', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-group', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Home' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Files' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Settings' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-inset', | ||
| body: [ | ||
| { | ||
| type: 'div', | ||
| className: 'p-4', | ||
| body: [ | ||
| { type: 'sidebar-trigger' }, | ||
| { type: 'text', content: 'Main content area' } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }} | ||
| title="Collapsible Sidebar" | ||
|
|
@@ -97,12 +280,80 @@ interface SidebarSchema { | |
|
|
||
| <ComponentDemo | ||
| schema={{ | ||
| type: 'sidebar', | ||
| items: [ | ||
| { label: 'Inbox', icon: 'inbox', href: '/inbox', badge: 12 }, | ||
| { label: 'Drafts', icon: 'file-text', href: '/drafts', badge: 3 }, | ||
| { label: 'Sent', icon: 'send', href: '/sent' }, | ||
| { label: 'Trash', icon: 'trash', href: '/trash' } | ||
| type: 'sidebar-provider', | ||
| body: [ | ||
| { | ||
| type: 'sidebar', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-content', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-group', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [ | ||
| { type: 'text', content: 'Inbox' }, | ||
| { type: 'badge', content: '12', className: 'ml-auto' } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [ | ||
| { type: 'text', content: 'Drafts' }, | ||
| { type: 'badge', content: '3', className: 'ml-auto' } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Sent' }] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-menu-item', | ||
| body: [ | ||
| { | ||
| type: 'sidebar-menu-button', | ||
| body: [{ type: 'text', content: 'Trash' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| type: 'sidebar-inset', | ||
| body: [ | ||
| { | ||
| type: 'div', | ||
| className: 'p-4', | ||
| body: [{ type: 'text', content: 'Main content area' }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }} | ||
| title="Sidebar with Badges" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import { | |
| } from '../../ui/table'; | ||
| import { cn } from '../../lib/utils'; | ||
|
|
||
| export const SimpleTableRenderer = ({ schema, className, ..._props }: any) => { | ||
| export const SimpleTableRenderer = ({ schema, className }: any) => { | ||
| const data = useDataScope(schema.bind); | ||
| const columns = schema.props?.columns || []; | ||
|
|
||
|
Comment on lines
+22
to
25
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectUIProvidercurrently logs registered component types viaconsole.logon asetTimeoutinuseEffect. Wrapping the entire site in this provider will spam the console in production and the timeout has no cleanup. Consider removing the log/timeout or gating it behindprocess.env.NODE_ENV !== 'production'and clearing the timeout in the effect cleanup.