@object-ui/components 3.3.0 → 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 +20 -0
- package/README.md +21 -1
- package/dist/index.css +6339 -2
- package/dist/index.js +17600 -17481
- package/dist/index.umd.cjs +36 -36
- package/dist/packages/components/src/custom/empty.d.ts +12 -1
- package/dist/packages/components/src/renderers/action/action-bar.d.ts +12 -1
- package/dist/packages/components/src/ui/chart.d.ts +10 -29
- package/package.json +65 -44
- package/.turbo/turbo-build.log +0 -84
- package/README_SHADCN_SYNC.md +0 -281
- package/TESTING.md +0 -335
- 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 -245
- 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 -540
- 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 -349
- 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 -64
- 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 -377
- 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 -130
- 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 -150
- package/src/ui/sidebar.tsx +0 -781
- package/src/ui/skeleton.tsx +0 -23
- package/src/ui/slider.tsx +0 -39
- 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 -71
- package/vitest.config.ts +0 -5
|
@@ -1,117 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,123 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,295 +0,0 @@
|
|
|
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
|
-
};
|