@object-ui/components 0.3.1 → 2.0.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 +34 -0
- package/CHANGELOG.md +13 -0
- package/README.md +13 -0
- package/dist/index.css +1 -1
- package/dist/index.js +36430 -25529
- package/dist/index.umd.cjs +53 -32
- package/dist/src/SchemaRenderer.d.ts +3 -0
- package/dist/src/custom/action-param-dialog.d.ts +21 -0
- package/dist/src/{ui → custom}/button-group.d.ts +1 -1
- package/dist/src/custom/field.d.ts +19 -0
- package/dist/src/custom/index.d.ts +14 -0
- package/dist/src/custom/input-group.d.ts +14 -0
- package/dist/src/{ui → custom}/item.d.ts +1 -1
- package/dist/src/custom/native-select.d.ts +12 -0
- package/dist/src/custom/navigation-overlay.d.ts +50 -0
- package/dist/src/custom/sort-builder.d.ts +22 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/renderers/action/action-button.d.ts +11 -0
- package/dist/src/renderers/action/action-group.d.ts +25 -0
- package/dist/src/renderers/action/action-icon.d.ts +10 -0
- package/dist/src/renderers/action/action-menu.d.ts +19 -0
- package/dist/src/renderers/action/index.d.ts +0 -0
- package/dist/src/renderers/action/resolve-icon.d.ts +6 -0
- package/dist/src/renderers/data-display/table.d.ts +1 -1
- package/dist/src/renderers/layout/page.d.ts +1 -1
- package/dist/src/renderers/placeholders.d.ts +1 -1
- package/dist/src/ui/accordion.d.ts +4 -4
- package/dist/src/ui/alert-dialog.d.ts +17 -11
- package/dist/src/ui/alert.d.ts +4 -5
- package/dist/src/ui/aspect-ratio.d.ts +1 -1
- package/dist/src/ui/avatar.d.ts +3 -3
- package/dist/src/ui/badge.d.ts +3 -3
- package/dist/src/ui/breadcrumb.d.ts +16 -8
- package/dist/src/ui/calendar.d.ts +7 -7
- package/dist/src/ui/card.d.ts +7 -8
- package/dist/src/ui/carousel.d.ts +5 -6
- package/dist/src/ui/chart.d.ts +62 -0
- package/dist/src/ui/checkbox.d.ts +1 -1
- package/dist/src/ui/collapsible.d.ts +3 -3
- package/dist/src/ui/command.d.ts +78 -16
- package/dist/src/ui/context-menu.d.ts +14 -12
- package/dist/src/ui/dialog.d.ts +17 -13
- package/dist/src/ui/drawer.d.ts +19 -10
- package/dist/src/ui/dropdown-menu.d.ts +20 -18
- package/dist/src/ui/form.d.ts +6 -7
- package/dist/src/ui/hover-card.d.ts +3 -3
- package/dist/src/ui/index.d.ts +2 -8
- package/dist/src/ui/input-otp.d.ts +30 -7
- package/dist/src/ui/label.d.ts +2 -1
- package/dist/src/ui/menubar.d.ts +19 -17
- package/dist/src/ui/navigation-menu.d.ts +9 -11
- package/dist/src/ui/pagination.d.ts +25 -10
- package/dist/src/ui/popover.d.ts +4 -5
- package/dist/src/ui/progress.d.ts +1 -1
- package/dist/src/ui/radio-group.d.ts +2 -2
- package/dist/src/ui/resizable.d.ts +5 -8
- package/dist/src/ui/scroll-area.d.ts +2 -2
- package/dist/src/ui/select.d.ts +11 -13
- package/dist/src/ui/sheet.d.ts +23 -11
- package/dist/src/ui/sidebar.d.ts +27 -29
- package/dist/src/ui/skeleton.d.ts +1 -1
- package/dist/src/ui/slider.d.ts +1 -1
- package/dist/src/ui/sonner.d.ts +2 -1
- package/dist/src/ui/switch.d.ts +2 -2
- package/dist/src/ui/tabs.d.ts +1 -1
- package/dist/src/ui/textarea.d.ts +1 -1
- package/dist/src/ui/toast.d.ts +22 -0
- package/dist/src/ui/toggle-group.d.ts +8 -3
- package/dist/src/ui/toggle.d.ts +4 -1
- package/dist/src/ui/tooltip.d.ts +4 -4
- package/dist/src/ui/typography.d.ts +21 -0
- package/package.json +20 -9
- package/shadcn-components.json +52 -47
- package/src/SchemaRenderer.tsx +28 -0
- package/src/__tests__/PageRendererRegions.test.tsx +668 -0
- package/src/__tests__/Registry.test.ts +21 -0
- package/src/__tests__/basic-renderers.test.tsx +1 -1
- package/src/__tests__/complex-disclosure-renderers.test.tsx +3 -2
- package/src/__tests__/compliance.test.tsx +72 -0
- package/src/__tests__/feedback-overlay-renderers.test.tsx +1 -1
- package/src/__tests__/form-renderers.test.tsx +1 -1
- package/src/__tests__/layout-data-renderers.test.tsx +1 -1
- package/src/__tests__/navigation-overlay.test.tsx +273 -0
- package/src/__tests__/view-compliance.test.tsx +153 -0
- package/src/custom/action-param-dialog.tsx +264 -0
- package/src/{ui → custom}/button-group.tsx +1 -1
- package/src/{ui → custom}/combobox.tsx +3 -3
- package/src/{ui → custom}/date-picker.tsx +3 -3
- package/src/custom/field.tsx +81 -0
- package/src/{ui → custom}/filter-builder.tsx +3 -3
- package/src/custom/index.ts +14 -0
- package/src/custom/input-group.tsx +53 -0
- package/src/{ui → custom}/item.tsx +1 -1
- package/src/custom/native-select.tsx +33 -0
- package/src/custom/navigation-overlay.tsx +296 -0
- package/src/custom/sort-builder.tsx +129 -0
- package/src/index.css +20 -1
- package/src/index.ts +2 -0
- package/src/renderers/action/action-button.tsx +147 -0
- package/src/renderers/action/action-group.tsx +270 -0
- package/src/renderers/action/action-icon.tsx +150 -0
- package/src/renderers/action/action-menu.tsx +203 -0
- package/src/renderers/action/index.ts +18 -0
- package/src/renderers/action/resolve-icon.ts +35 -0
- package/src/renderers/basic/button-group.tsx +1 -0
- package/src/renderers/basic/div.tsx +12 -1
- package/src/renderers/basic/html.tsx +1 -0
- package/src/renderers/basic/icon.tsx +1 -0
- package/src/renderers/basic/image.tsx +1 -0
- package/src/renderers/basic/navigation-menu.tsx +1 -0
- package/src/renderers/basic/pagination.tsx +31 -4
- package/src/renderers/basic/separator.tsx +1 -0
- package/src/renderers/basic/span.tsx +12 -1
- package/src/renderers/basic/text.tsx +4 -2
- package/src/renderers/complex/__tests__/data-table-batch-editing.test.tsx +275 -0
- package/src/renderers/complex/__tests__/data-table-cell-renderer.test.tsx +120 -0
- package/src/renderers/complex/__tests__/data-table-editing.test.tsx +221 -0
- package/src/renderers/complex/carousel.tsx +1 -0
- package/src/renderers/complex/data-table.tsx +355 -95
- package/src/renderers/complex/filter-builder.tsx +2 -1
- package/src/renderers/complex/resizable.tsx +2 -1
- package/src/renderers/complex/scroll-area.tsx +25 -7
- package/src/renderers/complex/table.tsx +1 -0
- package/src/renderers/data-display/alert.tsx +1 -0
- package/src/renderers/data-display/avatar.tsx +1 -0
- package/src/renderers/data-display/badge.tsx +1 -0
- package/src/renderers/data-display/breadcrumb.tsx +1 -0
- package/src/renderers/data-display/kbd.tsx +1 -0
- package/src/renderers/data-display/list.tsx +21 -49
- package/src/renderers/data-display/statistic.tsx +21 -5
- package/src/renderers/data-display/table.tsx +21 -11
- package/src/renderers/data-display/tree-view.tsx +7 -1
- package/src/renderers/disclosure/accordion.tsx +1 -0
- package/src/renderers/disclosure/collapsible.tsx +1 -0
- package/src/renderers/disclosure/toggle-group.tsx +2 -0
- package/src/renderers/feedback/empty.tsx +1 -0
- package/src/renderers/feedback/loading.tsx +2 -1
- package/src/renderers/feedback/progress.tsx +1 -0
- package/src/renderers/feedback/skeleton.tsx +1 -0
- package/src/renderers/feedback/sonner.tsx +1 -0
- package/src/renderers/feedback/spinner.tsx +1 -0
- package/src/renderers/feedback/toast.tsx +1 -0
- package/src/renderers/feedback/toaster.tsx +1 -0
- package/src/renderers/form/button.tsx +35 -1
- package/src/renderers/form/calendar.tsx +1 -0
- package/src/renderers/form/checkbox.tsx +38 -16
- package/src/renderers/form/combobox.tsx +2 -1
- package/src/renderers/form/command.tsx +1 -0
- package/src/renderers/form/date-picker.tsx +1 -0
- package/src/renderers/form/file-upload.tsx +1 -0
- package/src/renderers/form/form.tsx +115 -19
- package/src/renderers/form/input-otp.tsx +1 -0
- package/src/renderers/form/input.tsx +3 -0
- package/src/renderers/form/label.tsx +1 -0
- package/src/renderers/form/radio-group.tsx +1 -0
- package/src/renderers/form/select.tsx +35 -15
- package/src/renderers/form/slider.tsx +1 -0
- package/src/renderers/form/switch.tsx +1 -0
- package/src/renderers/form/textarea.tsx +50 -27
- package/src/renderers/form/toggle.tsx +3 -45
- package/src/renderers/index.ts +1 -0
- package/src/renderers/layout/aspect-ratio.tsx +2 -1
- package/src/renderers/layout/card.tsx +10 -2
- package/src/renderers/layout/container.tsx +1 -0
- package/src/renderers/layout/flex.tsx +1 -0
- package/src/renderers/layout/grid.tsx +23 -8
- package/src/renderers/layout/page.tsx +433 -57
- package/src/renderers/layout/semantic.tsx +1 -0
- package/src/renderers/layout/stack.tsx +2 -1
- package/src/renderers/layout/tabs.tsx +43 -17
- package/src/renderers/navigation/header-bar.tsx +1 -0
- package/src/renderers/navigation/sidebar.tsx +11 -0
- package/src/renderers/overlay/alert-dialog.tsx +1 -0
- package/src/renderers/overlay/context-menu.tsx +1 -0
- package/src/renderers/overlay/dialog.tsx +1 -0
- package/src/renderers/overlay/drawer.tsx +1 -0
- package/src/renderers/overlay/dropdown-menu.tsx +1 -0
- package/src/renderers/overlay/hover-card.tsx +1 -0
- package/src/renderers/overlay/menubar.tsx +1 -0
- package/src/renderers/overlay/popover.tsx +1 -0
- package/src/renderers/overlay/sheet.tsx +1 -0
- package/src/renderers/overlay/tooltip.tsx +1 -0
- package/src/renderers/placeholders.tsx +4 -4
- package/src/stories/CRMApp.stories.tsx +706 -0
- package/src/stories/Guide.mdx +55 -0
- package/src/stories/Introduction.mdx +61 -0
- package/src/stories/MockedData.stories.tsx +121 -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/crm-live-data.stories.tsx +154 -0
- package/src/stories-json/dashboard.stories.tsx +318 -0
- package/src/stories-json/data-table.stories.tsx +136 -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-variants.stories.tsx +210 -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-advanced.stories.tsx +389 -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 +315 -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 +47 -53
- package/src/ui/alert-dialog.tsx +103 -117
- package/src/ui/alert.tsx +35 -36
- package/src/ui/aspect-ratio.tsx +1 -5
- package/src/ui/avatar.tsx +41 -42
- package/src/ui/badge.tsx +6 -15
- package/src/ui/breadcrumb.tsx +81 -75
- package/src/ui/button.tsx +10 -11
- package/src/ui/calendar.tsx +178 -51
- package/src/ui/card.tsx +51 -110
- package/src/ui/carousel.tsx +136 -113
- package/src/ui/chart.tsx +367 -0
- package/src/ui/checkbox.tsx +20 -22
- package/src/ui/collapsible.tsx +5 -25
- package/src/ui/command.tsx +106 -135
- package/src/ui/context-menu.tsx +69 -116
- package/src/ui/dialog.tsx +94 -113
- package/src/ui/drawer.tsx +82 -99
- package/src/ui/dropdown-menu.tsx +134 -188
- package/src/ui/form.tsx +51 -40
- package/src/ui/hover-card.tsx +18 -33
- package/src/ui/index.ts +2 -8
- package/src/ui/input-otp.tsx +42 -52
- package/src/ui/input.tsx +13 -15
- package/src/ui/label.tsx +17 -15
- package/src/ui/menubar.tsx +188 -206
- package/src/ui/navigation-menu.tsx +96 -136
- package/src/ui/pagination.tsx +86 -96
- package/src/ui/popover.tsx +24 -41
- package/src/ui/progress.tsx +21 -22
- package/src/ui/radio-group.tsx +19 -20
- package/src/ui/resizable.tsx +32 -42
- package/src/ui/scroll-area.tsx +38 -48
- package/src/ui/select.tsx +129 -157
- package/src/ui/separator.tsx +2 -2
- package/src/ui/sheet.tsx +110 -107
- package/src/ui/sidebar.tsx +442 -408
- package/src/ui/skeleton.tsx +6 -11
- package/src/ui/slider.tsx +19 -54
- package/src/ui/sonner.tsx +19 -1
- package/src/ui/switch.tsx +19 -21
- package/src/ui/tabs.tsx +6 -37
- package/src/ui/textarea.tsx +8 -4
- package/src/ui/toast.tsx +137 -0
- package/src/ui/toggle-group.tsx +28 -37
- package/src/ui/toggle.tsx +19 -19
- package/src/ui/tooltip.tsx +21 -52
- package/src/ui/typography.tsx +85 -0
- package/tsconfig.json +1 -1
- package/vite.config.ts +9 -1
- package/vitest.config.ts +5 -0
- package/ISSUES_FOUND.md +0 -128
- /package/dist/src/{ui → custom}/combobox.d.ts +0 -0
- /package/dist/src/{ui → custom}/date-picker.d.ts +0 -0
- /package/dist/src/{ui → custom}/empty.d.ts +0 -0
- /package/dist/src/{ui → custom}/filter-builder.d.ts +0 -0
- /package/dist/src/{ui → custom}/kbd.d.ts +0 -0
- /package/dist/src/{ui → custom}/spinner.d.ts +0 -0
- /package/src/{ui → custom}/empty.tsx +0 -0
- /package/src/{ui → custom}/kbd.tsx +0 -0
- /package/src/{ui → custom}/spinner.tsx +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
import type { BaseSchema } from '@object-ui/types';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Primitives/Data Entry/Form Advanced',
|
|
7
|
+
component: SchemaRenderer,
|
|
8
|
+
parameters: { layout: 'centered' },
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
schema: { table: { disable: true } }
|
|
12
|
+
}
|
|
13
|
+
} satisfies Meta<typeof SchemaRenderer>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const renderStory = (args: any) => <SchemaRenderer schema={args as unknown as BaseSchema} />;
|
|
19
|
+
|
|
20
|
+
export const RadioGroup: Story = {
|
|
21
|
+
render: renderStory,
|
|
22
|
+
args: {
|
|
23
|
+
type: 'radio-group',
|
|
24
|
+
defaultValue: 'option-one',
|
|
25
|
+
id: 'r1',
|
|
26
|
+
options: [
|
|
27
|
+
{ label: 'Option One', value: 'option-one' },
|
|
28
|
+
{ label: 'Option Two', value: 'option-two' },
|
|
29
|
+
{ label: 'Option Three', value: 'option-three' }
|
|
30
|
+
]
|
|
31
|
+
} as any,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Slider: Story = {
|
|
35
|
+
render: renderStory,
|
|
36
|
+
args: {
|
|
37
|
+
type: 'slider',
|
|
38
|
+
defaultValue: [33],
|
|
39
|
+
max: 100,
|
|
40
|
+
step: 1,
|
|
41
|
+
className: 'w-[300px]'
|
|
42
|
+
} as any,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const InputOTP: Story = {
|
|
46
|
+
render: renderStory,
|
|
47
|
+
args: {
|
|
48
|
+
type: 'input-otp',
|
|
49
|
+
maxLength: 6,
|
|
50
|
+
value: "123"
|
|
51
|
+
} as any,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Combobox: Story = {
|
|
55
|
+
render: renderStory,
|
|
56
|
+
args: {
|
|
57
|
+
type: 'combobox',
|
|
58
|
+
placeholder: 'Select framework...',
|
|
59
|
+
className: 'w-[300px]',
|
|
60
|
+
options: [
|
|
61
|
+
{ label: 'Next.js', value: 'next.js' },
|
|
62
|
+
{ label: 'SvelteKit', value: 'sveltekit' },
|
|
63
|
+
{ label: 'Nuxt.js', value: 'nuxt.js' },
|
|
64
|
+
{ label: 'Remix', value: 'remix' },
|
|
65
|
+
{ label: 'Astro', value: 'astro' }
|
|
66
|
+
]
|
|
67
|
+
} as any,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const Command: Story = {
|
|
71
|
+
render: renderStory,
|
|
72
|
+
args: {
|
|
73
|
+
type: 'command',
|
|
74
|
+
placeholder: 'Search documentation...',
|
|
75
|
+
className: 'rounded-lg border shadow-md w-[450px]',
|
|
76
|
+
groups: [
|
|
77
|
+
{
|
|
78
|
+
heading: 'Suggestions',
|
|
79
|
+
items: [
|
|
80
|
+
{ value: 'cal', label: 'Calendar' },
|
|
81
|
+
{ value: 'em', label: 'Search Emoji' },
|
|
82
|
+
{ value: 'calc', label: 'Calculator' }
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
heading: 'Settings',
|
|
87
|
+
items: [
|
|
88
|
+
{ value: 'prof', label: 'Profile' },
|
|
89
|
+
{ value: 'bill', label: 'Billing' },
|
|
90
|
+
{ value: 'set', label: 'Settings' }
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
} as any,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const FilterBuilder: Story = {
|
|
98
|
+
render: renderStory,
|
|
99
|
+
args: {
|
|
100
|
+
type: 'filter-builder',
|
|
101
|
+
name: 'user_filters',
|
|
102
|
+
label: 'User Filters',
|
|
103
|
+
fields: [
|
|
104
|
+
{ value: 'name', label: 'Name', type: 'text' },
|
|
105
|
+
{ value: 'email', label: 'Email', type: 'text' },
|
|
106
|
+
{ value: 'age', label: 'Age', type: 'number' },
|
|
107
|
+
{ value: 'status', label: 'Status', type: 'select', options: ['active', 'inactive'] }
|
|
108
|
+
],
|
|
109
|
+
value: {
|
|
110
|
+
id: 'root',
|
|
111
|
+
logic: 'and',
|
|
112
|
+
conditions: [
|
|
113
|
+
{ field: 'age', operator: 'gt', value: 18 }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
} as any,
|
|
117
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
|
|
4
|
+
const meta: Meta = {
|
|
5
|
+
title: 'Primitives/Data Entry/Form Extras',
|
|
6
|
+
component: SchemaRenderer,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
// Schema properties
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
|
|
16
|
+
export const Toggle: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
type: 'toggle',
|
|
19
|
+
ariaLabel: 'Toggle italic',
|
|
20
|
+
variant: 'outline',
|
|
21
|
+
children: [
|
|
22
|
+
{ type: 'icon', name: 'italic', className: 'h-4 w-4' }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ToggleGroup: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
type: 'toggle-group',
|
|
31
|
+
selectionType: 'multiple',
|
|
32
|
+
variant: 'outline',
|
|
33
|
+
items: [
|
|
34
|
+
{ value: 'bold', label: 'Bold', icon: <SchemaRenderer schema={{ type: 'icon', name: 'bold', className: 'h-4 w-4' }} /> },
|
|
35
|
+
{ value: 'italic', label: 'Italic', icon: <SchemaRenderer schema={{ type: 'icon', name: 'italic', className: 'h-4 w-4' }} /> },
|
|
36
|
+
{ value: 'underline', label: 'Underline', icon: <SchemaRenderer schema={{ type: 'icon', name: 'underline', className: 'h-4 w-4' }} /> }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
// Note: SchemaRenderer in icon prop might not work if items expects pure objects.
|
|
40
|
+
// Let's check implementation. The implementation just renders {item.icon || item.label}.
|
|
41
|
+
// It expects item.icon to be a ReactNode. We can't pass ReactNode in JSON.
|
|
42
|
+
// Wait, if I am passing generic args, I can. But if this is strict JSON, I can't.
|
|
43
|
+
// The renderer maps `items.map(...)`.
|
|
44
|
+
// Let's try passing text first.
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const ToggleGroupText: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
type: 'toggle-group',
|
|
50
|
+
selectionType: 'single',
|
|
51
|
+
variant: 'outline',
|
|
52
|
+
items: [
|
|
53
|
+
{ value: 'left', label: 'Left' },
|
|
54
|
+
{ value: 'center', label: 'Center' },
|
|
55
|
+
{ value: 'right', label: 'Right' }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const FileUpload: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
type: 'file-upload',
|
|
64
|
+
id: 'documents-upload',
|
|
65
|
+
label: 'Upload Documents',
|
|
66
|
+
buttonText: 'Drop files here',
|
|
67
|
+
multiple: true,
|
|
68
|
+
accept: 'image/*'
|
|
69
|
+
},
|
|
70
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Calendar: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
type: 'calendar',
|
|
76
|
+
mode: 'single',
|
|
77
|
+
className: 'rounded-md border shadow'
|
|
78
|
+
},
|
|
79
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const FormConfigured: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
type: 'form',
|
|
85
|
+
label: 'User Registration',
|
|
86
|
+
submitLabel: 'Create Account',
|
|
87
|
+
columns: 2,
|
|
88
|
+
fields: [
|
|
89
|
+
{ name: 'firstName', label: 'First Name', required: true, placeholder: 'John' },
|
|
90
|
+
{ name: 'lastName', label: 'Last Name', required: true, placeholder: 'Doe' },
|
|
91
|
+
{ name: 'email', label: 'Email Address', inputType: 'email', required: true, className: 'col-span-2' },
|
|
92
|
+
{ name: 'role', label: 'Role', type: 'select', options: [{label: 'Admin', value: 'admin'}, {label: 'User', value: 'user'}], defaultValue: 'user' },
|
|
93
|
+
{ name: 'notifications', label: 'Receive Notifications', type: 'checkbox', className: 'flex flex-row items-center space-x-3 space-y-0 p-4' }
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const FormComposed: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
type: 'form',
|
|
102
|
+
submitLabel: 'Sign In',
|
|
103
|
+
children: [
|
|
104
|
+
{
|
|
105
|
+
type: 'div',
|
|
106
|
+
className: 'space-y-2',
|
|
107
|
+
children: [
|
|
108
|
+
{ type: 'label', content: 'Username' },
|
|
109
|
+
{ type: 'input', placeholder: 'user@example.com' }
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'div',
|
|
114
|
+
className: 'space-y-2',
|
|
115
|
+
children: [
|
|
116
|
+
{ type: 'label', content: 'Password' },
|
|
117
|
+
{ type: 'input', inputType: 'password' }
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
render: (args) => <SchemaRenderer schema={args} />
|
|
123
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
import type { BaseSchema } from '@object-ui/types';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Primitives/Layout/Grid',
|
|
7
|
+
component: SchemaRenderer,
|
|
8
|
+
parameters: { layout: 'padded' },
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
schema: { table: { disable: true } }
|
|
12
|
+
}
|
|
13
|
+
} satisfies Meta<typeof SchemaRenderer>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const renderStory = (args: any) => <SchemaRenderer schema={args as unknown as BaseSchema} />;
|
|
19
|
+
|
|
20
|
+
export const Grid: Story = {
|
|
21
|
+
render: renderStory,
|
|
22
|
+
args: {
|
|
23
|
+
type: 'grid',
|
|
24
|
+
props: {
|
|
25
|
+
cols: 2,
|
|
26
|
+
gap: 4
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
{ type: 'card', className: 'p-4 bg-gray-100', children: [{type:'text', content: 'Column 1'}] },
|
|
30
|
+
{ type: 'card', className: 'p-4 bg-gray-100', children: [{type:'text', content: 'Column 2'}] },
|
|
31
|
+
{ type: 'card', className: 'p-4 bg-gray-100', children: [{type:'text', content: 'Column 3'}] },
|
|
32
|
+
{ type: 'card', className: 'p-4 bg-gray-100', children: [{type:'text', content: 'Column 4'}] }
|
|
33
|
+
]
|
|
34
|
+
} as any,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Responsive: Story = {
|
|
38
|
+
render: renderStory,
|
|
39
|
+
args: {
|
|
40
|
+
type: 'grid',
|
|
41
|
+
props: {
|
|
42
|
+
cols: {
|
|
43
|
+
base: 1,
|
|
44
|
+
md: 2,
|
|
45
|
+
lg: 4
|
|
46
|
+
},
|
|
47
|
+
gap: 4
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
{ type: 'card', className: 'p-4 bg-red-100', children: [{type:'text', content: '1'}] },
|
|
51
|
+
{ type: 'card', className: 'p-4 bg-blue-100', children: [{type:'text', content: '2'}] },
|
|
52
|
+
{ type: 'card', className: 'p-4 bg-green-100', children: [{type:'text', content: '3'}] },
|
|
53
|
+
{ type: 'card', className: 'p-4 bg-yellow-100', children: [{type:'text', content: '4'}] }
|
|
54
|
+
]
|
|
55
|
+
} as any,
|
|
56
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
import type { BaseSchema } from '@object-ui/types';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Primitives/General/Icon',
|
|
7
|
+
component: SchemaRenderer,
|
|
8
|
+
parameters: { layout: 'centered' },
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
schema: { table: { disable: true } }
|
|
12
|
+
}
|
|
13
|
+
} satisfies Meta<typeof SchemaRenderer>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const renderStory = (args: any) => <SchemaRenderer schema={args as unknown as BaseSchema} />;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
render: renderStory,
|
|
22
|
+
args: {
|
|
23
|
+
type: 'icon',
|
|
24
|
+
name: 'calendar',
|
|
25
|
+
className: 'h-10 w-10 text-primary'
|
|
26
|
+
} as any,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Colored: Story = {
|
|
30
|
+
render: renderStory,
|
|
31
|
+
args: {
|
|
32
|
+
type: 'icon',
|
|
33
|
+
name: 'heart',
|
|
34
|
+
className: 'h-10 w-10 text-red-500 fill-red-500'
|
|
35
|
+
} as any,
|
|
36
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
import type { BaseSchema } from '@object-ui/types';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Primitives/Data Entry/Input',
|
|
7
|
+
component: SchemaRenderer,
|
|
8
|
+
parameters: { layout: 'centered' },
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
schema: { table: { disable: true } }
|
|
12
|
+
}
|
|
13
|
+
} satisfies Meta<typeof SchemaRenderer>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const renderStory = (args: any) => <SchemaRenderer schema={args as unknown as BaseSchema} />;
|
|
19
|
+
|
|
20
|
+
export const Input: Story = {
|
|
21
|
+
render: renderStory,
|
|
22
|
+
args: {
|
|
23
|
+
type: 'input',
|
|
24
|
+
label: 'Email Address',
|
|
25
|
+
placeholder: 'Enter your email',
|
|
26
|
+
inputType: 'email',
|
|
27
|
+
description: 'We will never share your email.',
|
|
28
|
+
wrapperClass: 'w-[300px]'
|
|
29
|
+
} as any,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const WithError: Story = {
|
|
33
|
+
render: renderStory,
|
|
34
|
+
args: {
|
|
35
|
+
type: 'input',
|
|
36
|
+
label: 'Username',
|
|
37
|
+
placeholder: 'jdoe',
|
|
38
|
+
value: 'invalid name',
|
|
39
|
+
error: 'Username is already taken',
|
|
40
|
+
wrapperClass: 'w-[300px]'
|
|
41
|
+
} as any,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Textarea: Story = {
|
|
45
|
+
render: renderStory,
|
|
46
|
+
args: {
|
|
47
|
+
type: 'textarea',
|
|
48
|
+
label: 'Bio',
|
|
49
|
+
placeholder: 'Tell us a little bit about yourself',
|
|
50
|
+
wrapperClass: 'w-[300px]'
|
|
51
|
+
} as any,
|
|
52
|
+
};
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SchemaRenderer } from '../SchemaRenderer';
|
|
3
|
+
import type { BaseSchema } from '@object-ui/types';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Plugins/Scheduling/Kanban',
|
|
7
|
+
component: SchemaRenderer,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'padded',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
schema: { table: { disable: true } },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<any>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
const renderStory = (args: any) => <SchemaRenderer schema={args as unknown as BaseSchema} />;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render: renderStory,
|
|
24
|
+
args: {
|
|
25
|
+
type: 'kanban',
|
|
26
|
+
columns: [
|
|
27
|
+
{
|
|
28
|
+
id: 'todo',
|
|
29
|
+
title: 'Schema/Plugins/To Do',
|
|
30
|
+
cards: [
|
|
31
|
+
{
|
|
32
|
+
id: 'card-1',
|
|
33
|
+
title: 'Schema/Plugins/Task 1',
|
|
34
|
+
description: 'This is the first task',
|
|
35
|
+
badges: [
|
|
36
|
+
{ label: 'High Priority', variant: 'destructive' },
|
|
37
|
+
{ label: 'Feature', variant: 'default' }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'card-2',
|
|
42
|
+
title: 'Schema/Plugins/Task 2',
|
|
43
|
+
description: 'This is the second task',
|
|
44
|
+
badges: [
|
|
45
|
+
{ label: 'Bug', variant: 'destructive' }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'in-progress',
|
|
52
|
+
title: 'Schema/Plugins/In Progress',
|
|
53
|
+
limit: 3,
|
|
54
|
+
cards: [
|
|
55
|
+
{
|
|
56
|
+
id: 'card-3',
|
|
57
|
+
title: 'Schema/Plugins/Task 3',
|
|
58
|
+
description: 'Currently working on this',
|
|
59
|
+
badges: [
|
|
60
|
+
{ label: 'In Progress', variant: 'default' }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'done',
|
|
67
|
+
title: 'Schema/Plugins/Done',
|
|
68
|
+
cards: [
|
|
69
|
+
{
|
|
70
|
+
id: 'card-4',
|
|
71
|
+
title: 'Schema/Plugins/Task 4',
|
|
72
|
+
description: 'This task is completed',
|
|
73
|
+
badges: [
|
|
74
|
+
{ label: 'Completed', variant: 'outline' }
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'card-5',
|
|
79
|
+
title: 'Schema/Plugins/Task 5',
|
|
80
|
+
description: 'Another completed task',
|
|
81
|
+
badges: [
|
|
82
|
+
{ label: 'Completed', variant: 'outline' }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
className: 'w-full'
|
|
89
|
+
} as any,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const ProjectManagement: Story = {
|
|
93
|
+
render: renderStory,
|
|
94
|
+
args: {
|
|
95
|
+
type: 'kanban',
|
|
96
|
+
columns: [
|
|
97
|
+
{
|
|
98
|
+
id: 'backlog',
|
|
99
|
+
title: 'Schema/Plugins/Backlog',
|
|
100
|
+
cards: [
|
|
101
|
+
{
|
|
102
|
+
id: 'task-1',
|
|
103
|
+
title: 'Schema/Plugins/Implement dark mode',
|
|
104
|
+
description: 'Add support for dark theme across the application',
|
|
105
|
+
badges: [
|
|
106
|
+
{ label: 'Enhancement', variant: 'default' },
|
|
107
|
+
{ label: 'Low Priority', variant: 'secondary' }
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'task-2',
|
|
112
|
+
title: 'Schema/Plugins/Performance optimization',
|
|
113
|
+
description: 'Optimize bundle size and loading time',
|
|
114
|
+
badges: [
|
|
115
|
+
{ label: 'Performance', variant: 'default' }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'in-progress',
|
|
122
|
+
title: 'Schema/Plugins/In Progress',
|
|
123
|
+
limit: 2,
|
|
124
|
+
cards: [
|
|
125
|
+
{
|
|
126
|
+
id: 'task-3',
|
|
127
|
+
title: 'Schema/Plugins/User authentication',
|
|
128
|
+
description: 'Implement JWT-based authentication',
|
|
129
|
+
badges: [
|
|
130
|
+
{ label: 'Feature', variant: 'default' },
|
|
131
|
+
{ label: 'High Priority', variant: 'destructive' }
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'review',
|
|
138
|
+
title: 'Schema/Plugins/In Review',
|
|
139
|
+
cards: [
|
|
140
|
+
{
|
|
141
|
+
id: 'task-4',
|
|
142
|
+
title: 'Schema/Plugins/API integration',
|
|
143
|
+
description: 'Connect to REST API endpoints',
|
|
144
|
+
badges: [
|
|
145
|
+
{ label: 'Feature', variant: 'default' }
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'completed',
|
|
152
|
+
title: 'Schema/Plugins/Completed',
|
|
153
|
+
cards: [
|
|
154
|
+
{
|
|
155
|
+
id: 'task-5',
|
|
156
|
+
title: 'Schema/Plugins/Initial setup',
|
|
157
|
+
description: 'Project scaffolding and configuration',
|
|
158
|
+
badges: [
|
|
159
|
+
{ label: 'Done', variant: 'outline' }
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
className: 'w-full'
|
|
166
|
+
} as any,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const WithVirtualScrolling: Story = {
|
|
170
|
+
render: renderStory,
|
|
171
|
+
args: {
|
|
172
|
+
type: 'kanban',
|
|
173
|
+
enableVirtualScrolling: true,
|
|
174
|
+
columns: [
|
|
175
|
+
{
|
|
176
|
+
id: 'backlog',
|
|
177
|
+
title: 'Backlog',
|
|
178
|
+
cards: Array.from({ length: 100 }, (_, i) => ({
|
|
179
|
+
id: `card-${i}`,
|
|
180
|
+
title: `Task ${i + 1}`,
|
|
181
|
+
description: `Description for task ${i + 1}`,
|
|
182
|
+
badges: [
|
|
183
|
+
{ label: i % 3 === 0 ? 'Bug' : i % 2 === 0 ? 'Feature' : 'Enhancement', variant: 'default' }
|
|
184
|
+
]
|
|
185
|
+
}))
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'in-progress',
|
|
189
|
+
title: 'In Progress',
|
|
190
|
+
limit: 5,
|
|
191
|
+
cards: []
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: 'done',
|
|
195
|
+
title: 'Done',
|
|
196
|
+
cards: []
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
className: 'w-full'
|
|
200
|
+
} as any,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const WithColumnLimits: Story = {
|
|
204
|
+
render: renderStory,
|
|
205
|
+
args: {
|
|
206
|
+
type: 'kanban',
|
|
207
|
+
columns: [
|
|
208
|
+
{
|
|
209
|
+
id: 'todo',
|
|
210
|
+
title: 'To Do',
|
|
211
|
+
cards: [
|
|
212
|
+
{ id: '1', title: 'Task 1', badges: [{ label: 'P1', variant: 'destructive' }] },
|
|
213
|
+
{ id: '2', title: 'Task 2', badges: [{ label: 'P2', variant: 'default' }] },
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'in-progress',
|
|
218
|
+
title: 'In Progress (80% Full)',
|
|
219
|
+
limit: 5,
|
|
220
|
+
cards: [
|
|
221
|
+
{ id: '3', title: 'Task 3', description: 'Working on this' },
|
|
222
|
+
{ id: '4', title: 'Task 4', description: 'Almost done' },
|
|
223
|
+
{ id: '5', title: 'Task 5', description: 'In review' },
|
|
224
|
+
{ id: '6', title: 'Task 6', description: 'Testing' },
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'blocked',
|
|
229
|
+
title: 'Blocked (Over Limit)',
|
|
230
|
+
limit: 2,
|
|
231
|
+
cards: [
|
|
232
|
+
{ id: '7', title: 'Task 7', description: 'Waiting for API', badges: [{ label: 'Blocked', variant: 'destructive' }] },
|
|
233
|
+
{ id: '8', title: 'Task 8', description: 'Dependency issue', badges: [{ label: 'Blocked', variant: 'destructive' }] },
|
|
234
|
+
{ id: '9', title: 'Task 9', description: 'Needs approval', badges: [{ label: 'Blocked', variant: 'destructive' }] },
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: 'done',
|
|
239
|
+
title: 'Done',
|
|
240
|
+
cards: [
|
|
241
|
+
{ id: '10', title: 'Task 10', badges: [{ label: 'Completed', variant: 'outline' }] },
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
className: 'w-full'
|
|
246
|
+
} as any,
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export const WithCollapsibleColumns: Story = {
|
|
250
|
+
render: renderStory,
|
|
251
|
+
args: {
|
|
252
|
+
type: 'kanban',
|
|
253
|
+
enableCollapse: true,
|
|
254
|
+
columns: [
|
|
255
|
+
{
|
|
256
|
+
id: 'backlog',
|
|
257
|
+
title: 'Backlog',
|
|
258
|
+
collapsed: false,
|
|
259
|
+
cards: [
|
|
260
|
+
{ id: '1', title: 'Feature Request 1', description: 'Add dark mode support' },
|
|
261
|
+
{ id: '2', title: 'Feature Request 2', description: 'Export to PDF' },
|
|
262
|
+
{ id: '3', title: 'Bug Fix 1', description: 'Fix login issue' },
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: 'todo',
|
|
267
|
+
title: 'To Do',
|
|
268
|
+
collapsed: false,
|
|
269
|
+
cards: [
|
|
270
|
+
{ id: '4', title: 'Update documentation', badges: [{ label: 'Docs', variant: 'secondary' }] },
|
|
271
|
+
{ id: '5', title: 'Write tests', badges: [{ label: 'Testing', variant: 'default' }] },
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: 'in-progress',
|
|
276
|
+
title: 'In Progress',
|
|
277
|
+
collapsed: false,
|
|
278
|
+
cards: [
|
|
279
|
+
{ id: '6', title: 'Implement API', description: 'RESTful endpoints' },
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: 'done',
|
|
284
|
+
title: 'Done',
|
|
285
|
+
collapsed: true,
|
|
286
|
+
cards: [
|
|
287
|
+
{ id: '7', title: 'Setup project', badges: [{ label: 'Done', variant: 'outline' }] },
|
|
288
|
+
{ id: '8', title: 'Configure CI/CD', badges: [{ label: 'Done', variant: 'outline' }] },
|
|
289
|
+
{ id: '9', title: 'Deploy to staging', badges: [{ label: 'Done', variant: 'outline' }] },
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
className: 'w-full'
|
|
294
|
+
} as any,
|
|
295
|
+
};
|