makersclaw 0.2.0 → 0.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/THIRD-PARTY-NOTICES.md +180 -0
- package/package.json +3 -2
- package/r/annotate.json +62 -0
- package/r/approval-request.json +52 -0
- package/r/audio-player.json +74 -0
- package/r/auth-form.json +55 -0
- package/r/board.json +10 -6
- package/r/calendar-view.json +105 -0
- package/r/cart.json +62 -0
- package/r/chart.json +83 -0
- package/r/chat.json +95 -0
- package/r/code-editor.json +94 -0
- package/r/comment-box.json +64 -0
- package/r/contact-section.json +53 -0
- package/r/core.json +205 -8
- package/r/csv-import.json +63 -0
- package/r/data-table.json +69 -0
- package/r/diagram.json +74 -0
- package/r/doc-editor.json +82 -0
- package/r/doc-page.json +61 -0
- package/r/email-render.json +73 -0
- package/r/faq.json +50 -0
- package/r/file-upload.json +54 -0
- package/r/flow-canvas.json +93 -0
- package/r/footer.json +52 -0
- package/r/gantt.json +70 -0
- package/r/job-panel.json +12 -7
- package/r/json-editor.json +66 -0
- package/r/map.json +89 -0
- package/r/menubar.json +52 -0
- package/r/mind-map.json +67 -0
- package/r/navigation-menu.json +52 -0
- package/r/order-detail.json +54 -0
- package/r/org-chart.json +66 -0
- package/r/page-builder.json +105 -0
- package/r/payment-methods.json +51 -0
- package/r/pdf-document.json +79 -0
- package/r/pdf-viewer.json +88 -0
- package/r/product-detail.json +76 -0
- package/r/product-grid.json +65 -0
- package/r/record-form.json +67 -0
- package/r/record-notes.json +55 -0
- package/r/registry.json +3411 -29
- package/r/search-dialog.json +51 -0
- package/r/settings-list.json +66 -0
- package/r/setup-checklist.json +51 -0
- package/r/share-dialog.json +52 -0
- package/r/sidebar.json +69 -0
- package/r/signature-pad.json +72 -0
- package/r/sketch-canvas.json +99 -0
- package/r/spreadsheet.json +90 -0
- package/r/stat-cards.json +66 -0
- package/r/task-list.json +63 -0
- package/r/task-model.json +98 -0
- package/r/testimonials.json +52 -0
- package/r/transaction-list.json +53 -0
- package/r/whiteboard.json +66 -0
- package/registry/blocks/annotate/README.md +179 -0
- package/registry/blocks/annotate/annotate-data.js +250 -0
- package/registry/blocks/annotate/annotate.jsx +646 -0
- package/registry/blocks/annotate/block.json +10 -0
- package/registry/blocks/annotate/demo.jsx +135 -0
- package/registry/blocks/annotate/index.js +15 -0
- package/registry/blocks/approval-request/README.md +116 -0
- package/registry/blocks/approval-request/approval-request.jsx +386 -0
- package/registry/blocks/approval-request/block.json +10 -0
- package/registry/blocks/approval-request/demo.jsx +127 -0
- package/registry/blocks/approval-request/index.js +4 -0
- package/registry/blocks/audio-player/README.md +167 -0
- package/registry/blocks/audio-player/audio-player.jsx +623 -0
- package/registry/blocks/audio-player/block.json +14 -0
- package/registry/blocks/audio-player/colors.js +109 -0
- package/registry/blocks/audio-player/demo.jsx +209 -0
- package/registry/blocks/audio-player/index.js +6 -0
- package/registry/blocks/audio-player/time.js +67 -0
- package/registry/blocks/audio-player/wavesurfer.js +9 -0
- package/registry/blocks/auth-form/README.md +126 -0
- package/registry/blocks/auth-form/auth-form.jsx +568 -0
- package/registry/blocks/auth-form/block.json +10 -0
- package/registry/blocks/auth-form/demo.jsx +131 -0
- package/registry/blocks/auth-form/index.js +3 -0
- package/registry/blocks/board/README.md +55 -5
- package/registry/blocks/board/block.json +2 -2
- package/registry/blocks/board/board.jsx +230 -86
- package/registry/blocks/board/demo.jsx +103 -24
- package/registry/blocks/calendar-view/README.md +180 -0
- package/registry/blocks/calendar-view/agenda.jsx +147 -0
- package/registry/blocks/calendar-view/block.json +76 -0
- package/registry/blocks/calendar-view/calendar-model.js +442 -0
- package/registry/blocks/calendar-view/calendar.jsx +627 -0
- package/registry/blocks/calendar-view/demo.jsx +195 -0
- package/registry/blocks/calendar-view/draft.jsx +49 -0
- package/registry/blocks/calendar-view/index.js +39 -0
- package/registry/blocks/calendar-view/month.jsx +346 -0
- package/registry/blocks/calendar-view/paint.js +69 -0
- package/registry/blocks/calendar-view/time-grid.jsx +527 -0
- package/registry/blocks/calendar-view/tray.jsx +87 -0
- package/registry/blocks/cart/README.md +146 -0
- package/registry/blocks/cart/block.json +10 -0
- package/registry/blocks/cart/cart.jsx +597 -0
- package/registry/blocks/cart/demo.jsx +98 -0
- package/registry/blocks/cart/index.js +4 -0
- package/registry/blocks/cart/money.js +28 -0
- package/registry/blocks/chart/README.md +316 -0
- package/registry/blocks/chart/block.json +10 -0
- package/registry/blocks/chart/cartesian.jsx +642 -0
- package/registry/blocks/chart/core.jsx +262 -0
- package/registry/blocks/chart/demo.jsx +357 -0
- package/registry/blocks/chart/heatmap.jsx +336 -0
- package/registry/blocks/chart/index.js +8 -0
- package/registry/blocks/chart/pie.jsx +245 -0
- package/registry/blocks/chart/sparkline.jsx +88 -0
- package/registry/blocks/chat/README.md +273 -0
- package/registry/blocks/chat/attachment.jsx +95 -0
- package/registry/blocks/chat/block.json +10 -0
- package/registry/blocks/chat/chat.jsx +132 -0
- package/registry/blocks/chat/composer.jsx +364 -0
- package/registry/blocks/chat/demo.jsx +578 -0
- package/registry/blocks/chat/header.jsx +34 -0
- package/registry/blocks/chat/index.js +9 -0
- package/registry/blocks/chat/message.jsx +450 -0
- package/registry/blocks/chat/scroller.jsx +247 -0
- package/registry/blocks/chat/text.jsx +104 -0
- package/registry/blocks/code-editor/README.md +210 -0
- package/registry/blocks/code-editor/block.json +22 -0
- package/registry/blocks/code-editor/code-editor.jsx +534 -0
- package/registry/blocks/code-editor/codemirror.js +38 -0
- package/registry/blocks/code-editor/demo.jsx +205 -0
- package/registry/blocks/code-editor/index.js +8 -0
- package/registry/blocks/code-editor/json.js +317 -0
- package/registry/blocks/code-editor/sql.js +136 -0
- package/registry/blocks/code-editor/text.js +101 -0
- package/registry/blocks/code-editor/theme.js +186 -0
- package/registry/blocks/comment-box/README.md +123 -0
- package/registry/blocks/comment-box/block.json +10 -0
- package/registry/blocks/comment-box/comment-body.jsx +217 -0
- package/registry/blocks/comment-box/comment-box.jsx +198 -0
- package/registry/blocks/comment-box/comment-time.jsx +77 -0
- package/registry/blocks/comment-box/demo.jsx +141 -0
- package/registry/blocks/comment-box/index.js +8 -0
- package/registry/blocks/contact-section/README.md +152 -0
- package/registry/blocks/contact-section/block.json +11 -0
- package/registry/blocks/contact-section/contact-section.jsx +509 -0
- package/registry/blocks/contact-section/demo.jsx +93 -0
- package/registry/blocks/contact-section/index.js +4 -0
- package/registry/blocks/csv-import/README.md +133 -0
- package/registry/blocks/csv-import/block.json +13 -0
- package/registry/blocks/csv-import/csv-import.jsx +479 -0
- package/registry/blocks/csv-import/demo.jsx +106 -0
- package/registry/blocks/csv-import/import.js +200 -0
- package/registry/blocks/csv-import/index.js +7 -0
- package/registry/blocks/data-table/README.md +386 -0
- package/registry/blocks/data-table/block.json +10 -0
- package/registry/blocks/data-table/data-table.jsx +1164 -0
- package/registry/blocks/data-table/demo.jsx +588 -0
- package/registry/blocks/data-table/index.js +5 -0
- package/registry/blocks/data-table/model.js +169 -0
- package/registry/blocks/diagram/README.md +108 -0
- package/registry/blocks/diagram/block.json +13 -0
- package/registry/blocks/diagram/demo.jsx +113 -0
- package/registry/blocks/diagram/diagram.jsx +481 -0
- package/registry/blocks/diagram/index.js +7 -0
- package/registry/blocks/diagram/mermaid.js +52 -0
- package/registry/blocks/diagram/palette.js +313 -0
- package/registry/blocks/diagram/source.js +98 -0
- package/registry/blocks/doc-editor/README.md +215 -0
- package/registry/blocks/doc-editor/block.json +15 -0
- package/registry/blocks/doc-editor/demo.jsx +225 -0
- package/registry/blocks/doc-editor/doc-editor.jsx +291 -0
- package/registry/blocks/doc-editor/doc.js +309 -0
- package/registry/blocks/doc-editor/index.js +7 -0
- package/registry/blocks/doc-editor/schema.jsx +56 -0
- package/registry/blocks/doc-editor/shadcn-classes.js +110 -0
- package/registry/blocks/doc-editor/theme.js +82 -0
- package/registry/blocks/doc-page/README.md +119 -0
- package/registry/blocks/doc-page/autosave.js +104 -0
- package/registry/blocks/doc-page/block.json +10 -0
- package/registry/blocks/doc-page/demo.jsx +137 -0
- package/registry/blocks/doc-page/doc-page.jsx +276 -0
- package/registry/blocks/doc-page/index.js +4 -0
- package/registry/blocks/email-render/README.md +151 -0
- package/registry/blocks/email-render/block.json +14 -0
- package/registry/blocks/email-render/demo.jsx +153 -0
- package/registry/blocks/email-render/doc-email.jsx +210 -0
- package/registry/blocks/email-render/email.jsx +221 -0
- package/registry/blocks/email-render/index.js +10 -0
- package/registry/blocks/email-render/render.js +50 -0
- package/registry/blocks/email-render/theme.js +215 -0
- package/registry/blocks/faq/README.md +101 -0
- package/registry/blocks/faq/block.json +11 -0
- package/registry/blocks/faq/demo.jsx +89 -0
- package/registry/blocks/faq/faq.jsx +220 -0
- package/registry/blocks/faq/index.js +4 -0
- package/registry/blocks/file-upload/README.md +138 -0
- package/registry/blocks/file-upload/block.json +10 -0
- package/registry/blocks/file-upload/demo.jsx +204 -0
- package/registry/blocks/file-upload/file-upload.jsx +635 -0
- package/registry/blocks/file-upload/index.js +4 -0
- package/registry/blocks/flow-canvas/README.md +420 -0
- package/registry/blocks/flow-canvas/block.json +13 -0
- package/registry/blocks/flow-canvas/board.js +819 -0
- package/registry/blocks/flow-canvas/chrome.jsx +649 -0
- package/registry/blocks/flow-canvas/context.jsx +35 -0
- package/registry/blocks/flow-canvas/demo.jsx +249 -0
- package/registry/blocks/flow-canvas/edges.jsx +107 -0
- package/registry/blocks/flow-canvas/flow-canvas.jsx +1329 -0
- package/registry/blocks/flow-canvas/index.js +41 -0
- package/registry/blocks/flow-canvas/nodes.jsx +392 -0
- package/registry/blocks/flow-canvas/theme.js +174 -0
- package/registry/blocks/footer/README.md +133 -0
- package/registry/blocks/footer/block.json +11 -0
- package/registry/blocks/footer/demo.jsx +119 -0
- package/registry/blocks/footer/footer.jsx +406 -0
- package/registry/blocks/footer/index.js +4 -0
- package/registry/blocks/gantt/README.md +220 -0
- package/registry/blocks/gantt/block.json +10 -0
- package/registry/blocks/gantt/demo.jsx +148 -0
- package/registry/blocks/gantt/gantt.jsx +923 -0
- package/registry/blocks/gantt/index.js +7 -0
- package/registry/blocks/gantt/rows.jsx +468 -0
- package/registry/blocks/gantt/schedule.js +278 -0
- package/registry/blocks/job-panel/README.md +80 -0
- package/registry/blocks/job-panel/block.json +3 -3
- package/registry/blocks/job-panel/demo.jsx +230 -3
- package/registry/blocks/job-panel/job-panel.jsx +169 -3
- package/registry/blocks/json-editor/README.md +133 -0
- package/registry/blocks/json-editor/block.json +10 -0
- package/registry/blocks/json-editor/demo.jsx +92 -0
- package/registry/blocks/json-editor/index.js +7 -0
- package/registry/blocks/json-editor/json-editor.jsx +305 -0
- package/registry/blocks/json-editor/json-tree.jsx +393 -0
- package/registry/blocks/json-editor/tree.js +225 -0
- package/registry/blocks/map/README.md +221 -0
- package/registry/blocks/map/block.json +14 -0
- package/registry/blocks/map/demo.jsx +201 -0
- package/registry/blocks/map/geo.js +198 -0
- package/registry/blocks/map/index.js +8 -0
- package/registry/blocks/map/list.jsx +128 -0
- package/registry/blocks/map/map-view.jsx +715 -0
- package/registry/blocks/map/maplibre.js +30 -0
- package/registry/blocks/map/marks.jsx +146 -0
- package/registry/blocks/map/theme.js +142 -0
- package/registry/blocks/menubar/README.md +109 -0
- package/registry/blocks/menubar/block.json +10 -0
- package/registry/blocks/menubar/demo.jsx +128 -0
- package/registry/blocks/menubar/index.js +4 -0
- package/registry/blocks/menubar/menubar.jsx +199 -0
- package/registry/blocks/mind-map/README.md +206 -0
- package/registry/blocks/mind-map/block.json +10 -0
- package/registry/blocks/mind-map/demo.jsx +103 -0
- package/registry/blocks/mind-map/index.js +31 -0
- package/registry/blocks/mind-map/mind-map.jsx +1125 -0
- package/registry/blocks/mind-map/topic.jsx +143 -0
- package/registry/blocks/mind-map/tree.js +645 -0
- package/registry/blocks/navigation-menu/README.md +124 -0
- package/registry/blocks/navigation-menu/block.json +10 -0
- package/registry/blocks/navigation-menu/demo.jsx +84 -0
- package/registry/blocks/navigation-menu/index.js +4 -0
- package/registry/blocks/navigation-menu/navigation-menu.jsx +448 -0
- package/registry/blocks/order-detail/README.md +109 -0
- package/registry/blocks/order-detail/block.json +10 -0
- package/registry/blocks/order-detail/demo.jsx +88 -0
- package/registry/blocks/order-detail/index.js +4 -0
- package/registry/blocks/order-detail/order-detail.jsx +354 -0
- package/registry/blocks/org-chart/README.md +145 -0
- package/registry/blocks/org-chart/block.json +10 -0
- package/registry/blocks/org-chart/demo.jsx +94 -0
- package/registry/blocks/org-chart/index.js +7 -0
- package/registry/blocks/org-chart/org-chart.jsx +631 -0
- package/registry/blocks/org-chart/org.js +245 -0
- package/registry/blocks/org-chart/person.jsx +96 -0
- package/registry/blocks/page-builder/README.md +257 -0
- package/registry/blocks/page-builder/block.json +14 -0
- package/registry/blocks/page-builder/demo.jsx +145 -0
- package/registry/blocks/page-builder/grapes.js +18 -0
- package/registry/blocks/page-builder/index.js +11 -0
- package/registry/blocks/page-builder/page-builder.jsx +704 -0
- package/registry/blocks/page-builder/page-view.jsx +33 -0
- package/registry/blocks/page-builder/page.js +118 -0
- package/registry/blocks/page-builder/panels.jsx +588 -0
- package/registry/blocks/page-builder/sections.js +209 -0
- package/registry/blocks/page-builder/theme.js +87 -0
- package/registry/blocks/page-builder/thumbs.jsx +189 -0
- package/registry/blocks/page-builder/tokens.js +329 -0
- package/registry/blocks/payment-methods/README.md +104 -0
- package/registry/blocks/payment-methods/block.json +10 -0
- package/registry/blocks/payment-methods/demo.jsx +71 -0
- package/registry/blocks/payment-methods/index.js +4 -0
- package/registry/blocks/payment-methods/payment-methods.jsx +302 -0
- package/registry/blocks/pdf-document/README.md +213 -0
- package/registry/blocks/pdf-document/block.json +13 -0
- package/registry/blocks/pdf-document/demo.jsx +136 -0
- package/registry/blocks/pdf-document/index.js +33 -0
- package/registry/blocks/pdf-document/money.js +83 -0
- package/registry/blocks/pdf-document/pdf-document.jsx +144 -0
- package/registry/blocks/pdf-document/primitives.jsx +271 -0
- package/registry/blocks/pdf-document/quote.jsx +179 -0
- package/registry/blocks/pdf-document/theme.js +193 -0
- package/registry/blocks/pdf-viewer/README.md +191 -0
- package/registry/blocks/pdf-viewer/block.json +14 -0
- package/registry/blocks/pdf-viewer/demo.jsx +252 -0
- package/registry/blocks/pdf-viewer/helpers.js +270 -0
- package/registry/blocks/pdf-viewer/index.js +8 -0
- package/registry/blocks/pdf-viewer/notes.jsx +195 -0
- package/registry/blocks/pdf-viewer/pdf-viewer.jsx +1368 -0
- package/registry/blocks/pdf-viewer/pdfjs.js +37 -0
- package/registry/blocks/pdf-viewer/ssr-shim-end.js +6 -0
- package/registry/blocks/pdf-viewer/ssr-shim.js +44 -0
- package/registry/blocks/product-detail/README.md +217 -0
- package/registry/blocks/product-detail/block.json +10 -0
- package/registry/blocks/product-detail/demo.jsx +233 -0
- package/registry/blocks/product-detail/index.js +7 -0
- package/registry/blocks/product-detail/price.jsx +115 -0
- package/registry/blocks/product-detail/product-detail.jsx +348 -0
- package/registry/blocks/product-detail/product-media.jsx +102 -0
- package/registry/blocks/product-detail/product-options.jsx +144 -0
- package/registry/blocks/product-grid/README.md +162 -0
- package/registry/blocks/product-grid/block.json +10 -0
- package/registry/blocks/product-grid/demo.jsx +255 -0
- package/registry/blocks/product-grid/index.js +5 -0
- package/registry/blocks/product-grid/product-card.jsx +232 -0
- package/registry/blocks/product-grid/product-grid.jsx +235 -0
- package/registry/blocks/record-form/README.md +196 -0
- package/registry/blocks/record-form/block.json +10 -0
- package/registry/blocks/record-form/demo.jsx +525 -0
- package/registry/blocks/record-form/index.js +4 -0
- package/registry/blocks/record-form/record-fields.jsx +457 -0
- package/registry/blocks/record-form/record-form.jsx +415 -0
- package/registry/blocks/record-form/rules.js +81 -0
- package/registry/blocks/record-notes/README.md +139 -0
- package/registry/blocks/record-notes/block.json +10 -0
- package/registry/blocks/record-notes/demo.jsx +179 -0
- package/registry/blocks/record-notes/index.js +4 -0
- package/registry/blocks/record-notes/record-notes.jsx +266 -0
- package/registry/blocks/search-dialog/README.md +108 -0
- package/registry/blocks/search-dialog/block.json +10 -0
- package/registry/blocks/search-dialog/demo.jsx +116 -0
- package/registry/blocks/search-dialog/index.js +3 -0
- package/registry/blocks/search-dialog/search-dialog.jsx +235 -0
- package/registry/blocks/settings-list/README.md +171 -0
- package/registry/blocks/settings-list/block.json +10 -0
- package/registry/blocks/settings-list/demo.jsx +333 -0
- package/registry/blocks/settings-list/index.js +4 -0
- package/registry/blocks/settings-list/row-state.jsx +93 -0
- package/registry/blocks/settings-list/settings-list.jsx +349 -0
- package/registry/blocks/settings-list/settings-matrix.jsx +118 -0
- package/registry/blocks/setup-checklist/README.md +142 -0
- package/registry/blocks/setup-checklist/block.json +10 -0
- package/registry/blocks/setup-checklist/demo.jsx +159 -0
- package/registry/blocks/setup-checklist/index.js +4 -0
- package/registry/blocks/setup-checklist/setup-checklist.jsx +446 -0
- package/registry/blocks/share-dialog/README.md +113 -0
- package/registry/blocks/share-dialog/block.json +10 -0
- package/registry/blocks/share-dialog/demo.jsx +140 -0
- package/registry/blocks/share-dialog/index.js +3 -0
- package/registry/blocks/share-dialog/share-dialog.jsx +384 -0
- package/registry/blocks/sidebar/README.md +190 -0
- package/registry/blocks/sidebar/block.json +43 -0
- package/registry/blocks/sidebar/demo.jsx +577 -0
- package/registry/blocks/sidebar/index.js +4 -0
- package/registry/blocks/sidebar/sidebar-panel.jsx +149 -0
- package/registry/blocks/sidebar/sidebar.jsx +864 -0
- package/registry/blocks/signature-pad/README.md +137 -0
- package/registry/blocks/signature-pad/block.json +13 -0
- package/registry/blocks/signature-pad/colors.js +115 -0
- package/registry/blocks/signature-pad/demo.jsx +94 -0
- package/registry/blocks/signature-pad/index.js +6 -0
- package/registry/blocks/signature-pad/pad.js +7 -0
- package/registry/blocks/signature-pad/signature-pad.jsx +434 -0
- package/registry/blocks/signature-pad/signature.js +68 -0
- package/registry/blocks/sketch-canvas/README.md +280 -0
- package/registry/blocks/sketch-canvas/block.json +13 -0
- package/registry/blocks/sketch-canvas/demo.jsx +159 -0
- package/registry/blocks/sketch-canvas/excalidraw.js +40 -0
- package/registry/blocks/sketch-canvas/index.js +9 -0
- package/registry/blocks/sketch-canvas/palette.js +226 -0
- package/registry/blocks/sketch-canvas/sketch-canvas.jsx +1188 -0
- package/registry/blocks/sketch-canvas/sketch.js +179 -0
- package/registry/blocks/sketch-canvas/ssr-shim-end.js +6 -0
- package/registry/blocks/sketch-canvas/ssr-shim.js +45 -0
- package/registry/blocks/sketch-canvas/stamps.js +104 -0
- package/registry/blocks/sketch-canvas/theme.js +131 -0
- package/registry/blocks/spreadsheet/README.md +307 -0
- package/registry/blocks/spreadsheet/block.json +13 -0
- package/registry/blocks/spreadsheet/cells.jsx +455 -0
- package/registry/blocks/spreadsheet/chrome.jsx +325 -0
- package/registry/blocks/spreadsheet/demo.jsx +177 -0
- package/registry/blocks/spreadsheet/grid.js +387 -0
- package/registry/blocks/spreadsheet/index.js +34 -0
- package/registry/blocks/spreadsheet/spreadsheet.jsx +1732 -0
- package/registry/blocks/spreadsheet/types.js +473 -0
- package/registry/blocks/stat-cards/README.md +173 -0
- package/registry/blocks/stat-cards/block.json +10 -0
- package/registry/blocks/stat-cards/demo.jsx +257 -0
- package/registry/blocks/stat-cards/index.js +4 -0
- package/registry/blocks/stat-cards/stat-cards.jsx +307 -0
- package/registry/blocks/stat-cards/usage.jsx +243 -0
- package/registry/blocks/task-list/README.md +176 -0
- package/registry/blocks/task-list/block.json +10 -0
- package/registry/blocks/task-list/demo.jsx +134 -0
- package/registry/blocks/task-list/index.js +5 -0
- package/registry/blocks/task-list/task-list.jsx +907 -0
- package/registry/blocks/task-model/README.md +455 -0
- package/registry/blocks/task-model/block.json +167 -0
- package/registry/blocks/task-model/changes.js +89 -0
- package/registry/blocks/task-model/dates.js +371 -0
- package/registry/blocks/task-model/demo.jsx +215 -0
- package/registry/blocks/task-model/dnd.jsx +240 -0
- package/registry/blocks/task-model/index.js +97 -0
- package/registry/blocks/task-model/model.js +919 -0
- package/registry/blocks/task-model/parts.jsx +449 -0
- package/registry/blocks/task-model/toolbar.jsx +271 -0
- package/registry/blocks/testimonials/README.md +139 -0
- package/registry/blocks/testimonials/block.json +11 -0
- package/registry/blocks/testimonials/demo.jsx +137 -0
- package/registry/blocks/testimonials/index.js +4 -0
- package/registry/blocks/testimonials/testimonials.jsx +430 -0
- package/registry/blocks/transaction-list/README.md +126 -0
- package/registry/blocks/transaction-list/block.json +10 -0
- package/registry/blocks/transaction-list/demo.jsx +79 -0
- package/registry/blocks/transaction-list/index.js +4 -0
- package/registry/blocks/transaction-list/transaction-list.jsx +383 -0
- package/registry/blocks/whiteboard/README.md +179 -0
- package/registry/blocks/whiteboard/block.json +10 -0
- package/registry/blocks/whiteboard/demo.jsx +169 -0
- package/registry/blocks/whiteboard/index.js +6 -0
- package/registry/blocks/whiteboard/templates.js +150 -0
- package/registry/blocks/whiteboard/whiteboard.jsx +721 -0
- package/src/cli.mjs +19 -6
- package/src/install.mjs +18 -0
- package/src/registry.mjs +38 -4
- package/src/shadcn.mjs +14 -1
- package/templates/next/files/README.md +145 -11
- package/templates/next/files/app/globals.css +55 -4
- package/templates/next/files/check/run.mjs +3 -3
- package/templates/next/files/components/ui/avatar.jsx +141 -0
- package/templates/next/files/components/ui/breadcrumb.jsx +149 -0
- package/templates/next/files/components/ui/button-group.jsx +70 -0
- package/templates/next/files/components/ui/button.jsx +132 -12
- package/templates/next/files/components/ui/calendar.jsx +609 -0
- package/templates/next/files/components/ui/carousel.jsx +281 -0
- package/templates/next/files/components/ui/collapsible.jsx +208 -0
- package/templates/next/files/components/ui/combobox.jsx +608 -0
- package/templates/next/files/components/ui/command.jsx +577 -0
- package/templates/next/files/components/ui/context-menu.jsx +191 -0
- package/templates/next/files/components/ui/date-picker.jsx +360 -0
- package/templates/next/files/components/ui/distribution.jsx +117 -0
- package/templates/next/files/components/ui/feedback.jsx +143 -0
- package/templates/next/files/components/ui/field.jsx +115 -3
- package/templates/next/files/components/ui/file-input.jsx +234 -0
- package/templates/next/files/components/ui/icon.jsx +130 -8
- package/templates/next/files/components/ui/image.jsx +143 -0
- package/templates/next/files/components/ui/index.js +47 -2
- package/templates/next/files/components/ui/input-group.jsx +213 -0
- package/templates/next/files/components/ui/input-otp.jsx +170 -0
- package/templates/next/files/components/ui/item.jsx +206 -0
- package/templates/next/files/components/ui/menu.jsx +454 -82
- package/templates/next/files/components/ui/notice.jsx +126 -14
- package/templates/next/files/components/ui/pagination.jsx +156 -0
- package/templates/next/files/components/ui/popover.jsx +284 -0
- package/templates/next/files/components/ui/radio.jsx +193 -0
- package/templates/next/files/components/ui/rating.jsx +131 -0
- package/templates/next/files/components/ui/resizable.jsx +338 -0
- package/templates/next/files/components/ui/scroll-area.jsx +123 -0
- package/templates/next/files/components/ui/separator.jsx +119 -0
- package/templates/next/files/components/ui/sheet.jsx +96 -11
- package/templates/next/files/components/ui/slider.jsx +174 -0
- package/templates/next/files/components/ui/stat.jsx +574 -0
- package/templates/next/files/components/ui/steps.jsx +338 -0
- package/templates/next/files/components/ui/swatch.jsx +33 -0
- package/templates/next/files/components/ui/table.jsx +130 -0
- package/templates/next/files/components/ui/toast.jsx +440 -0
- package/templates/next/files/components/ui/toggle.jsx +195 -0
- package/templates/next/files/components/ui/tooltip.jsx +270 -0
- package/templates/next/template.json +264 -8
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Gantt
|
|
2
|
+
|
|
3
|
+
The Gantt view of work, like Linear's timeline or TeamGantt. The task list
|
|
4
|
+
sits on the left — groups that fold, subtasks indented under their parent
|
|
5
|
+
— and the timeline on the right, under a two-tier date header (months over
|
|
6
|
+
days, or years over months). Each task is a bar in its project's colour,
|
|
7
|
+
filled as far as it is done; a parent is a summary bracket over its
|
|
8
|
+
subtasks; a milestone is a diamond on its day; arrows run from each task to
|
|
9
|
+
the ones waiting on it, red and dashed when the dates disagree. A line marks
|
|
10
|
+
today; weekends are shaded.
|
|
11
|
+
|
|
12
|
+
Drag a bar to move it, an edge to change its start or end, and the dot past
|
|
13
|
+
its end onto another bar to make that one wait on it. Every task waiting on
|
|
14
|
+
a moved one slides along *while you drag*, and "Finishes Fri, Oct 16 +3
|
|
15
|
+
days" at the top says what the move cost. Zoom by day, week, month or
|
|
16
|
+
quarter; switch on the critical path and the chain that sets the finish
|
|
17
|
+
lights up while the rest fades. A task with no dates shows a ghost bar under
|
|
18
|
+
the pointer: click to schedule it there. Search, filters, group and sort
|
|
19
|
+
live in the shared toolbar above.
|
|
20
|
+
|
|
21
|
+
Every change saves through one async `onChange` and shows at once; when the
|
|
22
|
+
save fails the timeline puts it back and says why.
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
import { Gantt } from "../components/blocks/gantt"; // a Makersclaw app ("./blocks/gantt" from components/)
|
|
26
|
+
import { Gantt } from "@/components/makersclaw/blocks/gantt"; // a shadcn project
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
It is a client component: render it from a `"use client"` component, and
|
|
30
|
+
load the tasks in the server surface (README §4). It is built on
|
|
31
|
+
`task-model` (added with it): the task shape, the change shapes and the
|
|
32
|
+
helpers are documented there.
|
|
33
|
+
|
|
34
|
+
## The data
|
|
35
|
+
|
|
36
|
+
Tasks in task-model's shape — `{ id, title, status, assignees, start?,
|
|
37
|
+
due?, progress?, parentId?, dependsOn?, project?, … }` — with the statuses,
|
|
38
|
+
people and projects they refer to. What the gantt reads:
|
|
39
|
+
|
|
40
|
+
- `start` · `due` — the bar runs from start to due, both days included. One
|
|
41
|
+
of them alone is a one-day bar; neither is an undated task (a row with no
|
|
42
|
+
bar, scheduled by a click).
|
|
43
|
+
- `milestone: true` (or `type: "milestone"`) — a diamond on its `due` day
|
|
44
|
+
(else its `start`).
|
|
45
|
+
- `dependsOn: ["t7"]` — this task waits on t7: an arrow from t7's end to
|
|
46
|
+
its start (finish to start).
|
|
47
|
+
- `progress` (0–100) — the bar's fill; without it, 100 when done, else
|
|
48
|
+
from its subtasks (task-model's `progressOf`).
|
|
49
|
+
- `parentId` — a subtask, drawn under its parent; the parent's bar is a
|
|
50
|
+
summary bracket over all of them and moves them together.
|
|
51
|
+
- `project` — the bar's colour (the project's `hue`, chart-1…5) when
|
|
52
|
+
`colorBy` is `"project"`.
|
|
53
|
+
|
|
54
|
+
A drag saves only `start` and `due` (and, for a link, `dependsOn`).
|
|
55
|
+
|
|
56
|
+
## Props
|
|
57
|
+
|
|
58
|
+
- `tasks` — the tasks. Pass `useFixture(rows, SAMPLE).rows` and the
|
|
59
|
+
examples change on screen and save nothing (they are not rows).
|
|
60
|
+
- `statuses` — `[{ id, label, tone?, hue?, done? }]` in order. Default: To
|
|
61
|
+
do, In progress, In review, Done.
|
|
62
|
+
- `people` — `[{ id, name, src? }]`.
|
|
63
|
+
- `projects` — `[{ id, name, hue? }]`: `hue` 1–5 colours the bars.
|
|
64
|
+
- `fields` — custom fields (`{ key, label, kind, options? }`), for the
|
|
65
|
+
toolbar's filters and grouping.
|
|
66
|
+
- `onChange(change)` — save a change; return `{ ok: true }` or
|
|
67
|
+
`{ ok: false, error }` (a throw counts as failed). A move that pushes
|
|
68
|
+
waiting tasks is one `batch` change; a link is an `update` of
|
|
69
|
+
`dependsOn`. In a Makersclaw app, loop over `changeWrites(change)` into
|
|
70
|
+
insertRow / updateRow / deleteRow (task-model README, "A change").
|
|
71
|
+
Without `onChange` the timeline only shows: no drag, links, quick-add or
|
|
72
|
+
menus beyond Open.
|
|
73
|
+
- `onOpen(task)` — a click on a bar or a title (Enter on a focused bar),
|
|
74
|
+
and "Open" in the row's menu: open your `Sheet` with the task.
|
|
75
|
+
- `view` · `defaultView` · `onViewChange(view)` — search, filters, group
|
|
76
|
+
and sort (task-model's view). The gantt's default: grouped by project,
|
|
77
|
+
sorted by start date. Group by project, status, assignee, priority or
|
|
78
|
+
none.
|
|
79
|
+
- `zoom` · `defaultZoom` (`"week"`) · `onZoomChange(zoom)` — `"day"` ·
|
|
80
|
+
`"week"` · `"month"` · `"quarter"`.
|
|
81
|
+
- `colorBy` — `"project"` (default; the project's hue, else the primary
|
|
82
|
+
colour) · `"status"` (the status's tone) · `"none"`.
|
|
83
|
+
- `pushDependents` — default true: moving or stretching a task later slides
|
|
84
|
+
every task waiting on it (and theirs) just far enough to start the day
|
|
85
|
+
after it ends, keeping their lengths. Nothing is pulled earlier. False:
|
|
86
|
+
only the dragged task moves, and conflicts show as red arrows.
|
|
87
|
+
- `defaultCritical` — default false: start with the critical path on.
|
|
88
|
+
- `newTaskLength` — default 3: the days a quick-added or click-scheduled
|
|
89
|
+
task spans (a quick-added task starts today).
|
|
90
|
+
- `today` — `"YYYY-MM-DD"`: the today line and where the timeline opens.
|
|
91
|
+
Default the browser's today; fix it in a demo.
|
|
92
|
+
- `weekStartsOn` (default 1, Monday) · `weekend` (default `[0, 6]`) ·
|
|
93
|
+
`holidays` — the header's weeks and the shaded days.
|
|
94
|
+
- `toolbar` — default true; false hides search, filter, group, sort and
|
|
95
|
+
"Add task". `toolbarExtra` — your controls before "Add task".
|
|
96
|
+
- `addLabel` — default `"Add task"`.
|
|
97
|
+
- `starters` — plans the empty state offers:
|
|
98
|
+
`[{ label, icon?, tasks: [{ title, days?, milestone?, parallel? }] }]`.
|
|
99
|
+
Tasks run one after another from today, each waiting on the one before;
|
|
100
|
+
`parallel: true` starts with the previous one instead. One press
|
|
101
|
+
creates them all in one change.
|
|
102
|
+
- `emptyTitle` · `emptyBody` — the empty state's words.
|
|
103
|
+
- `height` — default 560: the timeline's most height in pixels (never
|
|
104
|
+
more than 75% of the window); it scrolls inside.
|
|
105
|
+
- `loading` — skeleton bars in place of the timeline.
|
|
106
|
+
- `error` — a danger Notice above it (a failed read).
|
|
107
|
+
- `label` — what it is called to a screen reader, default `"Timeline"`.
|
|
108
|
+
- `locale` — dates in the header and labels; default the browser's.
|
|
109
|
+
- `className` — layout around it (width, margin). Never colour.
|
|
110
|
+
|
|
111
|
+
The helpers it draws with are exported for a view of your own:
|
|
112
|
+
`ZOOMS`, `ganttRange(tasks, zoom, today)`, `headerTiers(from, to, zoom)`,
|
|
113
|
+
`planMove(tasks, id, "move" | "start" | "end", days, { push })` (what a
|
|
114
|
+
drag saves, as `[{ id, patch }]`), `afterBlockersPatch(task, tasks)`,
|
|
115
|
+
`isMilestone`, `summarySpan`, `arrowPath(boxA, boxB)`.
|
|
116
|
+
|
|
117
|
+
## What it does, precisely
|
|
118
|
+
|
|
119
|
+
- Moving snaps to whole days at every zoom; the dates show beside the bar
|
|
120
|
+
while it moves. Resizing never crosses the other edge (a bar is at least
|
|
121
|
+
one day). A milestone and a summary bracket move but do not resize; a
|
|
122
|
+
summary moves its whole family.
|
|
123
|
+
- Linking: drag the dot past a bar's end onto another row. A link that
|
|
124
|
+
would loop is refused with a notice. The row menu's "Waits on" ticks and
|
|
125
|
+
unticks links from the keyboard.
|
|
126
|
+
- A red, dashed arrow means the waiting task starts before the other ends;
|
|
127
|
+
its row shows a warning and its menu offers "Start after what it waits
|
|
128
|
+
on".
|
|
129
|
+
- The critical path is the longest chain of linked, dated work
|
|
130
|
+
(task-model's `criticalPath`): its bars ring in the primary colour, its
|
|
131
|
+
arrows thicken, everything else fades, and a line under the chart says
|
|
132
|
+
how long it is.
|
|
133
|
+
- A task in two groups (two assignees, grouped by person) shows in both;
|
|
134
|
+
the first row drags, the second only opens.
|
|
135
|
+
- Keyboard: Tab reaches the titles, menus and bars. On a bar, ← → move it a
|
|
136
|
+
day, Shift + ← → change its end, Alt + ← → its start; the move saves when
|
|
137
|
+
the keys rest (or on Enter); Escape drops it. Enter opens a bar at rest.
|
|
138
|
+
- On a phone the list pane starts hidden (the bars carry their titles);
|
|
139
|
+
the list button in the chart's bar shows it at 176px. Zoom takes its own
|
|
140
|
+
line. Bars scroll under a finger and drag after a short press; edge grips
|
|
141
|
+
and the link dot are pointer-only (the keyboard and the menu cover them).
|
|
142
|
+
- Delete (row menu) takes the subtasks too; Undo in the toast brings them
|
|
143
|
+
back. A move that pushed other tasks also offers Undo.
|
|
144
|
+
|
|
145
|
+
## Example
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
// surfaces/plan.jsx — server: load, hand over
|
|
149
|
+
import { loadRows } from "../lib/data";
|
|
150
|
+
import Plan from "../components/Plan";
|
|
151
|
+
|
|
152
|
+
export default async function PlanSurface() {
|
|
153
|
+
const { rows, error } = await loadRows({ source: "public.tasks", orderBy: "start asc" });
|
|
154
|
+
const people = await loadRows({ source: "public.people" });
|
|
155
|
+
const projects = await loadRows({ source: "public.projects" });
|
|
156
|
+
return <Plan tasks={rows} people={people.rows} projects={projects.rows} error={error} />;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```jsx
|
|
161
|
+
// components/Plan.jsx — client: the timeline, the task sheet
|
|
162
|
+
"use client";
|
|
163
|
+
import { useState } from "react";
|
|
164
|
+
import { deleteRow, insertRow, updateRow } from "../lib/actions";
|
|
165
|
+
import { Sheet } from "./ui";
|
|
166
|
+
import { Gantt } from "./blocks/gantt";
|
|
167
|
+
import { changeWrites } from "./blocks/task-model";
|
|
168
|
+
|
|
169
|
+
const COLUMNS = ["id", "title", "status", "assignees", "start", "due", "progress", "parentId", "dependsOn", "project", "milestone"];
|
|
170
|
+
|
|
171
|
+
async function save(change) {
|
|
172
|
+
for (const w of changeWrites(change, { columns: COLUMNS, keepNewIds: false })) {
|
|
173
|
+
const r =
|
|
174
|
+
w.op === "insert" ? await insertRow({ source: "public.tasks", values: w.values, detail: w.values.title })
|
|
175
|
+
: w.op === "update" ? await updateRow({ source: "public.tasks", id: w.id, patch: w.patch })
|
|
176
|
+
: await deleteRow({ source: "public.tasks", id: w.id });
|
|
177
|
+
if (r?.ok === false) return r;
|
|
178
|
+
}
|
|
179
|
+
return { ok: true };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default function Plan({ tasks, people, projects, error }) {
|
|
183
|
+
const [open, setOpen] = useState(null);
|
|
184
|
+
return (
|
|
185
|
+
<>
|
|
186
|
+
<Gantt tasks={tasks} people={people} projects={projects} onChange={save} onOpen={setOpen} error={error}
|
|
187
|
+
starters={[{ label: "Product launch", tasks: [{ title: "Scope", days: 2 }, { title: "Build", days: 10 }, { title: "Launch", milestone: true }] }]} />
|
|
188
|
+
<Sheet open={Boolean(open)} onClose={() => setOpen(null)} title={open?.title}>{/* the task's fields */}</Sheet>
|
|
189
|
+
</>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`keepNewIds: false` lets the table make a new task's id. A link made
|
|
195
|
+
between two tasks created in the same change (a starter) refers to their
|
|
196
|
+
client ids: keep them (`keepNewIds: true`, a text id column) when you
|
|
197
|
+
offer starters.
|
|
198
|
+
|
|
199
|
+
By person, zoomed to days, coloured by status:
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
<Gantt tasks={tasks} people={people} onChange={save} defaultZoom="day" colorBy="status" defaultView={{ groupBy: "assignees" }} />
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## What it will not do
|
|
206
|
+
|
|
207
|
+
- Start-to-start, finish-to-finish or lag on links: every link is finish to
|
|
208
|
+
start, the next day.
|
|
209
|
+
- Count working days: a bar spans calendar days; weekends are shaded, not
|
|
210
|
+
skipped.
|
|
211
|
+
- Baselines, resource levelling or costs.
|
|
212
|
+
- Reorder rows by drag: the order is the view's sort (start date by
|
|
213
|
+
default); change it in the toolbar.
|
|
214
|
+
- Virtualise thousands of rows: filter, or page them in the surface.
|
|
215
|
+
- Fetch: tasks come in as props; the page re-reads after a save.
|
|
216
|
+
|
|
217
|
+
A timeline it cannot be is your own component in `components/`, built
|
|
218
|
+
from task-model's parts and helpers and the ones above — not an edit to
|
|
219
|
+
this block. Its files are fixed: `npm run check` refuses a change, and
|
|
220
|
+
`makersclaw add gantt` restores them.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gantt",
|
|
3
|
+
"title": "Gantt",
|
|
4
|
+
"description": "The Gantt view of work, like Linear's timeline or TeamGantt: a task list on the left (groups that fold, subtasks indented under a summary bar) beside a timeline with a two-tier date header, bars coloured by project or status with their progress, milestones as diamonds, dependency arrows (red when the dates disagree), a today line and weekend shading. Drag a bar to move it, an edge to change its start or end, the dot past its end onto another bar to link them; tasks waiting on a moved one slide along while you drag and the finish date shows what the move cost. Zoom day, week, month or quarter; highlight the critical path; click an empty row to schedule an undated task; quick-add per group; arrow keys move a focused bar; search, filters, group and sort from the shared toolbar. One async onChange saves every change; failures roll back with a notice.",
|
|
5
|
+
"useWhen": "A screen that plans dated work and shows what waits on what: a launch plan, a project schedule, a content calendar with lead times, an office move, a release. Not for an undated to-do list (task-list), stage columns (board), or days on a month grid (calendar).",
|
|
6
|
+
"tags": ["gantt", "timeline", "schedule", "project plan", "roadmap", "dependencies", "critical path", "milestones", "teamgantt", "linear", "clickup", "ms project", "drag", "resize", "zoom", "tasks", "project management"],
|
|
7
|
+
"exports": ["Gantt", "ZOOMS", "ganttRange", "headerTiers", "planMove", "afterBlockersPatch", "isMilestone", "summarySpan", "arrowPath"],
|
|
8
|
+
"files": ["index.js", "gantt.jsx", "rows.jsx", "schedule.js"],
|
|
9
|
+
"requires": ["task-model"]
|
|
10
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// Gantt three ways — the gallery's and the smoke test's surface. Not
|
|
4
|
+
// installed into apps: `makersclaw add gantt` lays index.js, gantt.jsx,
|
|
5
|
+
// rows.jsx and schedule.js only.
|
|
6
|
+
// Plan a website relaunch and a campaign: bars, subtasks under a
|
|
7
|
+
// summary, links (one in conflict), a milestone, an undated
|
|
8
|
+
// task; saves in memory (a switch makes them fail, to show the
|
|
9
|
+
// rollback); a bar or a title opens a sheet.
|
|
10
|
+
// Empty no tasks yet: name the first one, or start from a plan.
|
|
11
|
+
// Read-only the same plan by person, zoomed to days, no onChange.
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
import { Sheet, Switch, TabPanel, Tabs } from "../components/ui";
|
|
14
|
+
import { Gantt } from "../components/blocks/gantt";
|
|
15
|
+
import { applyChange, formatDay } from "../components/blocks/task-model";
|
|
16
|
+
|
|
17
|
+
const TODAY = "2026-09-23";
|
|
18
|
+
|
|
19
|
+
const STATUSES = [
|
|
20
|
+
{ id: "todo", label: "To do", tone: "neutral" },
|
|
21
|
+
{ id: "doing", label: "In progress", tone: "info" },
|
|
22
|
+
{ id: "review", label: "In review", tone: "warning" },
|
|
23
|
+
{ id: "done", label: "Done", tone: "success", done: true },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const PEOPLE = [
|
|
27
|
+
{ id: "maya", name: "Maya Chen" },
|
|
28
|
+
{ id: "leo", name: "Leo Park" },
|
|
29
|
+
{ id: "priya", name: "Priya Nair" },
|
|
30
|
+
{ id: "sam", name: "Sam Okafor" },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const PROJECTS = [
|
|
34
|
+
{ id: "site", name: "Website relaunch", hue: 1 },
|
|
35
|
+
{ id: "q4", name: "Q4 campaign", hue: 3 },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const PLAN = [
|
|
39
|
+
{ id: "s1", title: "Content audit", status: "done", assignees: ["maya"], project: "site", start: "2026-09-07", due: "2026-09-11" },
|
|
40
|
+
{ id: "s2", title: "Design the new pages", status: "doing", assignees: ["priya"], project: "site", start: "2026-09-14", due: "2026-09-25", dependsOn: ["s1"] },
|
|
41
|
+
{ id: "s2a", title: "Home and pricing", status: "done", parentId: "s2", assignees: ["priya"], project: "site", start: "2026-09-14", due: "2026-09-18" },
|
|
42
|
+
{ id: "s2b", title: "Product pages", status: "doing", parentId: "s2", assignees: ["priya"], project: "site", start: "2026-09-21", due: "2026-09-25", progress: 40 },
|
|
43
|
+
{ id: "s3", title: "Build the templates", status: "todo", assignees: ["leo"], project: "site", start: "2026-09-28", due: "2026-10-09", dependsOn: ["s2"] },
|
|
44
|
+
{ id: "s4", title: "Write the page copy", status: "doing", assignees: ["maya"], project: "site", start: "2026-09-21", due: "2026-10-02", progress: 60 },
|
|
45
|
+
{ id: "s5", title: "Redirects and SEO checks", status: "todo", assignees: ["leo"], project: "site", start: "2026-10-12", due: "2026-10-14", dependsOn: ["s3"] },
|
|
46
|
+
{ id: "s6", title: "Site goes live", status: "todo", assignees: ["sam"], project: "site", due: "2026-10-16", milestone: true, dependsOn: ["s5", "s4"] },
|
|
47
|
+
{ id: "c1", title: "Brief the agency", status: "done", assignees: ["sam"], project: "q4", start: "2026-09-15", due: "2026-09-17" },
|
|
48
|
+
{ id: "c2", title: "Shoot the product photos", status: "todo", assignees: ["leo", "priya"], project: "q4", start: "2026-09-29", due: "2026-10-01", dependsOn: ["c1"] },
|
|
49
|
+
{ id: "c3", title: "Launch email and ads", status: "todo", assignees: ["sam"], project: "q4", start: "2026-09-30", due: "2026-10-07", dependsOn: ["c2"] },
|
|
50
|
+
{ id: "c4", title: "Customer story with Northwind", status: "todo", assignees: [], project: "q4" },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const STARTERS = [
|
|
54
|
+
{
|
|
55
|
+
label: "Product launch",
|
|
56
|
+
icon: "sparkles",
|
|
57
|
+
tasks: [
|
|
58
|
+
{ title: "Agree the launch date and scope", days: 2 },
|
|
59
|
+
{ title: "Write the announcement", days: 4 },
|
|
60
|
+
{ title: "Record the demo video", days: 3, parallel: true },
|
|
61
|
+
{ title: "Line up three customer quotes", days: 5 },
|
|
62
|
+
{ title: "Launch day", milestone: true },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "Hiring round",
|
|
67
|
+
icon: "users",
|
|
68
|
+
tasks: [
|
|
69
|
+
{ title: "Write the job description", days: 2 },
|
|
70
|
+
{ title: "Source candidates", days: 10 },
|
|
71
|
+
{ title: "First interviews", days: 7 },
|
|
72
|
+
{ title: "Offer out", milestone: true },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
function usePlan(start, failRef) {
|
|
78
|
+
const [tasks, setTasks] = useState(start);
|
|
79
|
+
const onChange = async (change) => {
|
|
80
|
+
await new Promise((r) => setTimeout(r, 350));
|
|
81
|
+
if (failRef?.current) return { ok: false, error: "the server did not answer" };
|
|
82
|
+
setTasks((all) => applyChange(all, change));
|
|
83
|
+
return { ok: true };
|
|
84
|
+
};
|
|
85
|
+
return [tasks, onChange];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default function GanttDemo() {
|
|
89
|
+
const [fail, setFail] = useState(false);
|
|
90
|
+
const failRef = { current: fail };
|
|
91
|
+
const [tasks, onChange] = usePlan(PLAN, failRef);
|
|
92
|
+
const [none, onChangeNone] = usePlan([]);
|
|
93
|
+
const [open, setOpen] = useState(null);
|
|
94
|
+
const [tab, setTab] = useState("plan");
|
|
95
|
+
return (
|
|
96
|
+
<div className="grid gap-4">
|
|
97
|
+
<Tabs
|
|
98
|
+
aria-label="Gantt examples"
|
|
99
|
+
value={tab}
|
|
100
|
+
onChange={setTab}
|
|
101
|
+
tabs={[
|
|
102
|
+
{ key: "plan", label: "Plan" },
|
|
103
|
+
{ key: "empty", label: "Empty" },
|
|
104
|
+
{ key: "read", label: "Read-only" },
|
|
105
|
+
]}
|
|
106
|
+
/>
|
|
107
|
+
<TabPanel tab="plan" value={tab}>
|
|
108
|
+
<div className="grid gap-4">
|
|
109
|
+
<Switch id="gantt-fail" label="Make saves fail" checked={fail} onChange={(e) => setFail(e.target.checked)} />
|
|
110
|
+
<Gantt
|
|
111
|
+
label="Relaunch plan"
|
|
112
|
+
tasks={tasks}
|
|
113
|
+
statuses={STATUSES}
|
|
114
|
+
people={PEOPLE}
|
|
115
|
+
projects={PROJECTS}
|
|
116
|
+
today={TODAY}
|
|
117
|
+
onChange={onChange}
|
|
118
|
+
onOpen={setOpen}
|
|
119
|
+
/>
|
|
120
|
+
<Sheet
|
|
121
|
+
open={Boolean(open)}
|
|
122
|
+
onClose={() => setOpen(null)}
|
|
123
|
+
title={open?.title}
|
|
124
|
+
description={open?.due ? `Due ${formatDay(open.due, TODAY)}` : "No dates yet"}
|
|
125
|
+
>
|
|
126
|
+
<p className="text-sm text-muted-foreground">The task's own page goes here: its description, comments and history.</p>
|
|
127
|
+
</Sheet>
|
|
128
|
+
</div>
|
|
129
|
+
</TabPanel>
|
|
130
|
+
<TabPanel tab="empty" value={tab}>
|
|
131
|
+
<Gantt label="New plan" tasks={none} statuses={STATUSES} people={PEOPLE} today={TODAY} onChange={onChangeNone} starters={STARTERS} />
|
|
132
|
+
</TabPanel>
|
|
133
|
+
<TabPanel tab="read" value={tab}>
|
|
134
|
+
<Gantt
|
|
135
|
+
label="Plan by person"
|
|
136
|
+
tasks={tasks}
|
|
137
|
+
statuses={STATUSES}
|
|
138
|
+
people={PEOPLE}
|
|
139
|
+
projects={PROJECTS}
|
|
140
|
+
today={TODAY}
|
|
141
|
+
defaultZoom="day"
|
|
142
|
+
colorBy="status"
|
|
143
|
+
defaultView={{ groupBy: "assignees" }}
|
|
144
|
+
/>
|
|
145
|
+
</TabPanel>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|