Skip to content

Commit 9cd03fc

Browse files
committed
Refactor Storybook structure and update titles for consistency
- Changed titles in various story files to follow a new naming convention under 'Primitives' and 'Plugins'. - Updated the Introduction.md file to enhance clarity and organization. - Added new stories for live data fetching from MSW for CRM-related entities. - Introduced new form variants including Sectioned, Tabbed, Wizard, and Simple forms. - Created a custom Storybook theme for better visual consistency.
1 parent a117c04 commit 9cd03fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+631
-121
lines changed

.storybook/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ const config: StorybookConfig = {
3838
'@object-ui/plugin-charts': path.resolve(__dirname, '../packages/plugin-charts/src/index.tsx'),
3939
'@object-ui/plugin-chatbot': path.resolve(__dirname, '../packages/plugin-chatbot/src/index.tsx'),
4040
'@object-ui/plugin-dashboard': path.resolve(__dirname, '../packages/plugin-dashboard/src/index.tsx'),
41+
'@object-ui/plugin-detail': path.resolve(__dirname, '../packages/plugin-detail/src/index.tsx'),
4142
'@object-ui/plugin-editor': path.resolve(__dirname, '../packages/plugin-editor/src/index.tsx'),
4243
'@object-ui/plugin-form': path.resolve(__dirname, '../packages/plugin-form/src/index.tsx'),
4344
'@object-ui/plugin-gantt': path.resolve(__dirname, '../packages/plugin-gantt/src/index.tsx'),
4445
'@object-ui/plugin-grid': path.resolve(__dirname, '../packages/plugin-grid/src/index.tsx'),
4546
'@object-ui/plugin-kanban': path.resolve(__dirname, '../packages/plugin-kanban/src/index.tsx'),
47+
'@object-ui/plugin-list': path.resolve(__dirname, '../packages/plugin-list/src/index.tsx'),
4648
'@object-ui/plugin-map': path.resolve(__dirname, '../packages/plugin-map/src/index.tsx'),
4749
'@object-ui/plugin-markdown': path.resolve(__dirname, '../packages/plugin-markdown/src/index.tsx'),
50+
'@object-ui/plugin-report': path.resolve(__dirname, '../packages/plugin-report/src/index.tsx'),
4851
'@object-ui/plugin-timeline': path.resolve(__dirname, '../packages/plugin-timeline/src/index.tsx'),
4952
'@object-ui/plugin-view': path.resolve(__dirname, '../packages/plugin-view/src/index.tsx'),
5053
},

.storybook/manager.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { addons } from '@storybook/manager-api';
2+
import { create } from '@storybook/theming/create';
3+
4+
const objectUITheme = create({
5+
base: 'light',
6+
7+
// Brand
8+
brandTitle: 'ObjectUI — Server-Driven UI Engine',
9+
brandUrl: 'https://github.com/objectstack-ai/objectui',
10+
brandTarget: '_self',
11+
12+
// Colors
13+
colorPrimary: '#6366f1',
14+
colorSecondary: '#6366f1',
15+
16+
// UI
17+
appBg: '#fafafa',
18+
appContentBg: '#ffffff',
19+
appPreviewBg: '#ffffff',
20+
appBorderColor: '#e5e7eb',
21+
appBorderRadius: 8,
22+
23+
// Text
24+
textColor: '#1f2937',
25+
textInverseColor: '#ffffff',
26+
textMutedColor: '#6b7280',
27+
28+
// Toolbar
29+
barTextColor: '#6b7280',
30+
barSelectedColor: '#6366f1',
31+
barHoverColor: '#4f46e5',
32+
barBg: '#ffffff',
33+
34+
// Form
35+
inputBg: '#ffffff',
36+
inputBorder: '#d1d5db',
37+
inputTextColor: '#1f2937',
38+
inputBorderRadius: 6,
39+
40+
// Font
41+
fontBase: '"Inter", "Segoe UI", system-ui, -apple-system, sans-serif',
42+
fontCode: '"JetBrains Mono", "Fira Code", monospace',
43+
});
44+
45+
addons.setConfig({
46+
theme: objectUITheme,
47+
sidebar: {
48+
showRoots: true,
49+
collapsedRoots: ['apps'],
50+
},
51+
toolbar: {
52+
zoom: { hidden: false },
53+
eject: { hidden: false },
54+
copy: { hidden: false },
55+
},
56+
});

.storybook/preview.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,16 @@ import '@object-ui/plugin-calendar';
5959
import '@object-ui/plugin-charts';
6060
import '@object-ui/plugin-chatbot';
6161
import '@object-ui/plugin-dashboard';
62+
import '@object-ui/plugin-detail';
6263
import '@object-ui/plugin-editor';
6364
import '@object-ui/plugin-form';
6465
import '@object-ui/plugin-gantt';
6566
import '@object-ui/plugin-grid';
6667
import '@object-ui/plugin-kanban';
68+
import '@object-ui/plugin-list';
6769
import '@object-ui/plugin-map';
6870
import '@object-ui/plugin-markdown';
71+
import '@object-ui/plugin-report';
6972
import '@object-ui/plugin-timeline';
7073
import '@object-ui/plugin-view';
7174
import '@object-ui/layout';
@@ -81,11 +84,18 @@ const preview: Preview = {
8184
storySort: {
8285
method: 'alphabetical',
8386
order: [
84-
'Introduction',
85-
'Guide',
86-
'Primitives',
87-
'Schema',
88-
['Actions', 'Inputs', 'Layout', 'Data Display', 'Navigation', 'Feedback', 'Plugins']
87+
'Getting Started',
88+
['Introduction', 'Data Binding'],
89+
'Primitives',
90+
['General', 'Data Display', 'Data Entry', 'Navigation', 'Feedback', 'Overlay', 'Layout'],
91+
'Fields',
92+
['Gallery'],
93+
'Plugins',
94+
['Data Views', 'Forms', 'Scheduling', 'Rich Content'],
95+
'Templates',
96+
['Dashboard', 'Page', 'Reports', 'Sidebar'],
97+
'Apps',
98+
['CRM'],
8999
],
90100
},
91101
},

packages/components/src/stories-json/accordion.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Accordion',
6+
title: 'Primitives/Data Display/Accordion',
77
component: SchemaRenderer,
88
parameters: { layout: 'padded' },
99
tags: ['autodocs'],

packages/components/src/stories-json/aggrid.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Views/Data Grid (AgGrid)',
6+
title: 'Plugins/Data Views/AgGrid',
77
component: SchemaRenderer,
88
parameters: {
99
layout: 'padded',

packages/components/src/stories-json/alert.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Alert',
6+
title: 'Primitives/Feedback/Alert',
77
component: SchemaRenderer,
88
parameters: { layout: 'padded' },
99
tags: ['autodocs'],

packages/components/src/stories-json/aspect-ratio.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Aspect Ratio',
6+
title: 'Primitives/Data Display/Aspect Ratio',
77
component: SchemaRenderer,
88
parameters: { layout: 'centered' },
99
tags: ['autodocs'],

packages/components/src/stories-json/avatar.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Avatar',
6+
title: 'Primitives/Data Display/Avatar',
77
component: SchemaRenderer,
88
parameters: { layout: 'centered' },
99
tags: ['autodocs'],

packages/components/src/stories-json/badge.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Badge',
6+
title: 'Primitives/Data Display/Badge',
77
component: SchemaRenderer,
88
parameters: { layout: 'centered' },
99
tags: ['autodocs'],

packages/components/src/stories-json/breadcrumb.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SchemaRenderer } from '../SchemaRenderer';
33
import type { BaseSchema } from '@object-ui/types';
44

55
const meta = {
6-
title: 'Components/Breadcrumb',
6+
title: 'Primitives/Navigation/Breadcrumb',
77
component: SchemaRenderer,
88
parameters: { layout: 'centered' },
99
tags: ['autodocs'],

0 commit comments

Comments
 (0)