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
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// The kit's icons: one inline sprite, no icon package to install. Every
|
|
2
|
-
// glyph is a 24-box stroke path
|
|
3
|
-
// `name` is
|
|
4
|
-
// check` names them).
|
|
2
|
+
// glyph is a 24-box stroke path (1.8 wide, round caps, currentColor); add
|
|
3
|
+
// one here, never an <svg> in a surface. `name` is a key below; unknown
|
|
4
|
+
// names render nothing (and `npm run check` names them).
|
|
5
|
+
//
|
|
6
|
+
// BRANDS holds the brand marks: google, github, apple, microsoft,
|
|
7
|
+
// x-logo (the X / Twitter mark; `x` is the close glyph), linkedin,
|
|
8
|
+
// instagram, youtube, facebook. Unlike PATHS they are FILLED shapes
|
|
9
|
+
// (currentColor, even-odd so letters and holes knock out), one colour,
|
|
10
|
+
// drawn by hand and simplified, never copied from an icon library.
|
|
5
11
|
|
|
6
12
|
const PATHS = {
|
|
7
13
|
plus: "M12 5v14M5 12h14",
|
|
@@ -11,8 +17,11 @@ const PATHS = {
|
|
|
11
17
|
"chevron-up": "m18 15-6-6-6 6",
|
|
12
18
|
"chevron-left": "m15 18-6-6 6-6",
|
|
13
19
|
"chevron-right": "m9 18 6-6-6-6",
|
|
20
|
+
"chevrons-up-down": "m7 15 5 5 5-5M7 9l5-5 5 5",
|
|
14
21
|
"arrow-left": "M19 12H5m7-7-7 7 7 7",
|
|
15
22
|
"arrow-right": "M5 12h14m-7-7 7 7-7 7",
|
|
23
|
+
"arrow-up": "M12 19V5m-7 7 7-7 7 7",
|
|
24
|
+
"arrow-down": "M12 5v14m7-7-7 7-7-7",
|
|
16
25
|
search: "M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14ZM21 21l-4.3-4.3",
|
|
17
26
|
trash: "M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14",
|
|
18
27
|
pencil: "M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z",
|
|
@@ -36,6 +45,7 @@ const PATHS = {
|
|
|
36
45
|
download: "M12 3v12m-5-5 5 5 5-5M4 21h16",
|
|
37
46
|
upload: "M12 21V9m-5 5 5-5 5 5M4 3h16",
|
|
38
47
|
eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm10-3a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z",
|
|
48
|
+
"eye-off": "M10.6 5.1A10 10 0 0 1 12 5c6 0 10 7 10 7a17 17 0 0 1-2.4 3.2M6.6 6.6C3.8 8.4 2 12 2 12s4 7 10 7a9.7 9.7 0 0 0 5.4-1.6M9.9 9.9a3 3 0 0 0 4.2 4.2M2 2l20 20",
|
|
39
49
|
send: "m22 2-7 20-4-9-9-4 20-7Z",
|
|
40
50
|
home: "m3 11 9-8 9 8v10h-6v-6H9v6H3V11Z",
|
|
41
51
|
settings: "M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8 4-1.5-.5.3-1.6 1.4-.9-1-1.7-1.6.5-1.2-1.2.5-1.6-1.7-1-.9 1.4-1.6-.3L12 4l-.5 1.5-1.6.3-.9-1.4-1.7 1 .5 1.6-1.2 1.2-1.6-.5-1 1.7 1.4.9.3 1.6L4 12l1.5.5-.3 1.6-1.4.9 1 1.7 1.6-.5 1.2 1.2-.5 1.6 1.7 1 .9-1.4 1.6.3L12 20l.5-1.5 1.6-.3.9 1.4 1.7-1-.5-1.6 1.2-1.2 1.6.5 1-1.7-1.4-.9-.3-1.6L20 12Z",
|
|
@@ -59,21 +69,133 @@ const PATHS = {
|
|
|
59
69
|
minus: "M5 12h14",
|
|
60
70
|
archive: "M3 4h18v4H3zM5 8v12h14V8M10 12h4",
|
|
61
71
|
inbox: "M3 13h5l2 3h4l2-3h5M3 13V5h18v8M3 13v6h18v-6",
|
|
72
|
+
pin: "M12 17v5M8 3h8M9 3v7l-3 4v3h12v-3l-3-4V3",
|
|
73
|
+
bold: "M7 4h6a4 4 0 0 1 0 8H7zM7 12h7a4 4 0 0 1 0 8H7z",
|
|
74
|
+
italic: "M19 4h-9M14 20H5M15 4 9 20",
|
|
75
|
+
underline: "M6 4v6a6 6 0 0 0 12 0V4M4 21h16",
|
|
76
|
+
list: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",
|
|
77
|
+
grid: "M3 3h7v7H3zM14 3h7v7h-7zM3 14h7v7H3zM14 14h7v7h-7z",
|
|
78
|
+
"align-left": "M3 6h18M3 12h12M3 18h16",
|
|
79
|
+
"align-center": "M3 6h18M6 12h12M4 18h16",
|
|
80
|
+
"align-right": "M3 6h18M9 12h12M5 18h16",
|
|
81
|
+
paperclip: "m21 11-9 9a6 6 0 0 1-8.5-8.5l8.6-8.6a4 4 0 0 1 5.7 5.7l-8.6 8.5a2 2 0 0 1-2.8-2.8L15 6.9",
|
|
82
|
+
stop: "M6 6h12v12H6z",
|
|
83
|
+
menu: "M4 6h16M4 12h16M4 18h16",
|
|
84
|
+
"panel-left": "M3 4h18v16H3zM9 4v16",
|
|
85
|
+
"log-out": "M9 21H4V3h5M16 17l5-5-5-5M21 12H9",
|
|
86
|
+
code: "m16 18 6-6-6-6M8 6l-6 6 6 6",
|
|
87
|
+
shield: "M12 3 4 6v6c0 5 3.4 8.2 8 9 4.6-.8 8-4 8-9V6l-8-3Z",
|
|
88
|
+
"shield-check": "M12 3 4 6v6c0 5 3.4 8.2 8 9 4.6-.8 8-4 8-9V6l-8-3ZM9 12l2 2 4-4",
|
|
89
|
+
"circle-check": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-4 9 3 3 5-5",
|
|
90
|
+
// The same glyph under its older name, so either one renders.
|
|
91
|
+
"check-circle": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-4 9 3 3 5-5",
|
|
92
|
+
"circle-x": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM15 9l-6 6M9 9l6 6",
|
|
93
|
+
"message-square": "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z",
|
|
94
|
+
"git-branch": "M6 3v12M18 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM6 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM18 9a9 9 0 0 1-9 9",
|
|
95
|
+
"git-pull-request": "M6 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM18 15a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM6 9v12M12 6h4a2 2 0 0 1 2 2v7m-3-12-3 3 3 3",
|
|
96
|
+
server: "M3 3h18v8H3zM3 13h18v8H3zM7 7h.01M7 17h.01",
|
|
97
|
+
leaf: "M5 19C5 10 10 4 20 4c0 10-6 15-15 15ZM3 21 14 10",
|
|
98
|
+
monitor: "M3 4h18v12H3zM12 16v4M8 20h8",
|
|
99
|
+
smartphone: "M8 3h8v18H8zM11 17.5h2",
|
|
100
|
+
video: "M3 6h12v12H3zM15 10l6-3v10l-6-3",
|
|
101
|
+
tablet: "M5 2h14v20H5zM11 18.5h2",
|
|
102
|
+
sun: "M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",
|
|
103
|
+
moon: "M20 14.5A8.5 8.5 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z",
|
|
104
|
+
database: "M4 6a8 3 0 1 0 16 0 8 3 0 1 0-16 0ZM4 6v12a8 3 0 0 0 16 0V6M4 12a8 3 0 0 0 16 0",
|
|
105
|
+
"git-commit": "M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM3 12h6M15 12h6",
|
|
106
|
+
lightbulb: "M12 3a6 6 0 0 0-3.5 10.9c.6.4.9 1.1.9 1.8V16h5.2v-.3c0-.7.3-1.4.9-1.8A6 6 0 0 0 12 3ZM9.5 19h5M10.5 22h3",
|
|
107
|
+
"life-buoy": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM5.6 5.6l3.6 3.6M14.8 14.8l3.6 3.6M18.4 5.6l-3.6 3.6M9.2 14.8l-3.6 3.6",
|
|
108
|
+
"log-in": "M15 3h5v18h-5M10 17l5-5-5-5M15 12H3",
|
|
109
|
+
"user-plus": "M2 21a7 7 0 0 1 14 0M9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8ZM19 8v6M16 11h6",
|
|
110
|
+
palette: "M12 3a9 9 0 0 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.3 0-1.1.9-1.9 2-1.9h2a4 4 0 0 0 4-4C21 6.4 17 3 12 3ZM7.5 11.5h.01M9 7.5h.01M14 6.5h.01M17.5 9.5h.01",
|
|
111
|
+
layers: "M12 3 2 8l10 5 10-5-10-5ZM2 12l10 5 10-5M2 16l10 5 10-5",
|
|
112
|
+
type: "M4 7V4h16v3M12 4v16M9 20h6",
|
|
113
|
+
package: "M12 2 3 7v10l9 5 9-5V7l-9-5ZM3 7l9 5 9-5M12 12v10M7.5 4.5l9 5",
|
|
114
|
+
// Task states: an empty ring is "to do", a broken ring is "doing".
|
|
115
|
+
circle: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z",
|
|
116
|
+
"circle-dashed": "M13.6 3.1A9 9 0 0 1 17.2 4.6M19.4 6.8A9 9 0 0 1 20.9 10.4M20.9 13.6A9 9 0 0 1 19.4 17.2M17.2 19.4A9 9 0 0 1 13.6 20.9M10.4 20.9A9 9 0 0 1 6.8 19.4M4.6 17.2A9 9 0 0 1 3.1 13.6M3.1 10.4A9 9 0 0 1 4.6 6.8M6.8 4.6A9 9 0 0 1 10.4 3.1",
|
|
117
|
+
loader: "M12 2v4M12 18v4M2 12h4M18 12h4M4.9 4.9l2.8 2.8M16.3 16.3l2.8 2.8M4.9 19.1l2.8-2.8M16.3 7.7l2.8-2.8",
|
|
118
|
+
"trending-up": "m3 17 6-6 4 4 8-8M15 7h6v6",
|
|
119
|
+
"trending-down": "m3 7 6 6 4-4 8 8M15 17h6v-6",
|
|
120
|
+
"message-circle": "M21 12a9 9 0 0 1-13.3 7.9L3 21l1.1-4.7A9 9 0 1 1 21 12Z",
|
|
121
|
+
"credit-card": "M2 5h20v14H2zM2 10h20M6 15h4",
|
|
122
|
+
"shopping-cart": "M2 3h3l2.4 12h11.2L21 7H5.8M8 19.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0ZM16 19.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0Z",
|
|
123
|
+
key: "M7.5 11a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9ZM10.7 12.3 21 2M16 7l3 3M18.5 4.5l2 2",
|
|
124
|
+
quote: "M4 18h5v-6H4v6Zm0-6c0-4 1.5-6 5-7M15 18h5v-6h-5v6Zm0-6c0-4 1.5-6 5-7",
|
|
125
|
+
truck: "M2 5h12v11H2zM14 9h4.5L21 12v4h-7M4 18a2 2 0 1 0 4 0 2 2 0 1 0-4 0ZM15 18a2 2 0 1 0 4 0 2 2 0 1 0-4 0Z",
|
|
126
|
+
laptop: "M4 5h16v11H4zM2 19h20",
|
|
127
|
+
receipt: "M5 3h14v18l-2.3-1.5-2.4 1.5-2.3-1.5-2.3 1.5-2.4-1.5L5 21V3ZM9 8h6M9 12h6M9 16h3",
|
|
128
|
+
mic: "M12 2a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3ZM5 11a7 7 0 0 0 14 0M12 18v4M8 22h8",
|
|
129
|
+
"thumbs-up": "M7 10v11H3V10h4Zm0 0 4-8a3 3 0 0 1 3 3v4h5.5a2 2 0 0 1 2 2.3l-1.4 8a2 2 0 0 1-2 1.7H7",
|
|
130
|
+
"thumbs-down": "M7 14V3H3v11h4Zm0 0 4 8a3 3 0 0 0 3-3v-4h5.5a2 2 0 0 0 2-2.3l-1.4-8a2 2 0 0 0-2-1.7H7",
|
|
131
|
+
history: "M3 12a9 9 0 1 0 2.6-6.4L3 8M3 3v5h5M12 7v5l3 2",
|
|
132
|
+
wand: "M3 21 14 10M16 3v4M14 5h4M20 9v3M18.5 10.5h3M9 3v2M8 4h2",
|
|
133
|
+
building: "M4 21V3h12v18M16 9h4v12M2 21h20M8 7h4M8 11h4M8 15h4",
|
|
134
|
+
// Canvas tools (flow-canvas): the rail, the zoom bar, the arrange buttons.
|
|
135
|
+
"mouse-pointer": "M5 3l5.8 16.5 2.4-6.8 6.8-2.4L5 3ZM13.2 12.7 19 18.5",
|
|
136
|
+
hand: "M8 12V5.5a1.5 1.5 0 0 1 3 0V11M11 10.5V4a1.5 1.5 0 0 1 3 0v6.5M14 10.5V5.5a1.5 1.5 0 0 1 3 0V14a7 7 0 0 1-7 7h-.4a6 6 0 0 1-4.7-2.3l-2.3-2.9a1.6 1.6 0 0 1 2.4-2.1L8 16",
|
|
137
|
+
"sticky-note": "M4 4h16v10l-6 6H4V4ZM14 20v-6h6",
|
|
138
|
+
square: "M4 4h16v16H4z",
|
|
139
|
+
frame: "M7 3v18M17 3v18M3 7h18M3 17h18",
|
|
140
|
+
connector: "M4 20C4 11 10 5 19 5m-4-3.5L19 5l-4 3.5M4 20h.01",
|
|
141
|
+
maximize: "M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5",
|
|
142
|
+
undo: "M9 14 4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3",
|
|
143
|
+
redo: "m15 14 5-5-5-5M20 9H9a5 5 0 0 0 0 10h3",
|
|
144
|
+
keyboard: "M2 6h20v12H2zM6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10",
|
|
145
|
+
// Sketch tools (sketch-canvas): the diamond shape and the eraser.
|
|
146
|
+
diamond: "M12 3 21 12 12 21 3 12Z",
|
|
147
|
+
eraser: "M20 20H8.5l-4-4a2 2 0 0 1 0-2.8l8.8-8.8a2 2 0 0 1 2.8 0l3.5 3.5a2 2 0 0 1 0 2.8L12 20M8.5 9.5l6 6",
|
|
148
|
+
highlighter: "m14.5 4.5 5 5-7.5 7.5H8.5L7 15.5v-3.5ZM11 8l5 5M7 15.5 4 18.5l2 1.5h5M14 21h6",
|
|
149
|
+
"lock-open": "M5 11h14v10H5zM8 11V7a4 4 0 0 1 7.7-1.5",
|
|
150
|
+
"bring-front": "M12 14V3M8 7l4-4 4 4M4 15l8 5 8-5",
|
|
151
|
+
"send-back": "M12 3v11M8 10l4 4 4-4M4 15l8 5 8-5",
|
|
152
|
+
// Column types (spreadsheet): a number field, a checkbox field.
|
|
153
|
+
hash: "M4 9h16M4 15h16M10 3 8 21M16 3l-2 18",
|
|
154
|
+
"square-check": "M4 4h16v16H4zM8 12l3 3 5-6",
|
|
155
|
+
target: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10ZM12 11a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",
|
|
156
|
+
flag: "M5 21V4m0 0h11l-2 4 2 4H5",
|
|
157
|
+
"circle-help": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM9.5 9.2a2.6 2.6 0 0 1 5 .9c0 1.7-2.5 2.3-2.5 3.9M12 17h.01",
|
|
158
|
+
// Playback (audio-player): skip back / forward, sound on / off.
|
|
159
|
+
"rotate-ccw": "M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5",
|
|
160
|
+
"rotate-cw": "M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5",
|
|
161
|
+
volume: "M11 5 6 9H2v6h4l5 4V5ZM15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14",
|
|
162
|
+
"volume-x": "M11 5 6 9H2v6h4l5 4V5ZM22 9l-6 6M16 9l6 6",
|
|
163
|
+
navigation: "M3 11 21 3l-8 18-2-8Z",
|
|
164
|
+
locate: "M12 5a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm0 4a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM12 2v3M12 19v3M2 12h3M19 12h3",
|
|
165
|
+
route: "M6 16a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM18 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",
|
|
166
|
+
// View kinds (work-views): a board's columns, a table's grid, a gantt's bars.
|
|
167
|
+
kanban: "M4 4h4v14H4zM10 4h4v9h-4zM16 4h4v16h-4z",
|
|
168
|
+
table: "M3 4h18v16H3zM3 10h18M3 15h18M9 10v10",
|
|
169
|
+
gantt: "M4 4v16h16M8 8h6M11 12h7M9 16h5",
|
|
62
170
|
};
|
|
63
171
|
|
|
64
|
-
|
|
172
|
+
const BRANDS = {
|
|
173
|
+
google: "M18.9 6.2A9 9 0 1 0 21 12v-1.8h-8.8v3.4h4.96A5.4 5.4 0 1 1 16.14 8.53Z",
|
|
174
|
+
github: "M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19ZM10 21.3v-2.9c-2.8-.4-4.5-2-4.5-5 0-1.1.4-2.1 1.1-2.9-.2-.7-.2-1.7.2-2.7 1 0 2 .5 2.8 1.1a8 8 0 0 1 4.8 0c.8-.6 1.8-1.1 2.8-1.1.4 1 .4 2 .2 2.7.7.8 1.1 1.8 1.1 2.9 0 3-1.7 4.6-4.5 5v2.9ZM10 20.2c-2.4.4-3.5-.5-4.3-2l1-.4c.6 1.1 1.4 1.7 3.3 1.3Z",
|
|
175
|
+
apple: "M12 7.8C10.5 6.8 8.8 6.6 7.4 7.4 4.8 8.9 4.4 12.8 5.9 16.2c1 2.4 2.5 4.4 4.1 4.4.9 0 1.3-.5 2-.5s1.1.5 2 .5c1.6 0 3-1.7 4-3.6.5-.8.9-1.4 1.3-2A3.2 3.2 0 0 1 18.3 9.3c-.8-1.2-2-2.1-3.5-2.2-1 0-1.9.3-2.8.7ZM12.2 6.3c0-1.8 1.3-3.2 3.1-3.3 0 1.8-1.3 3.2-3.1 3.3Z",
|
|
176
|
+
microsoft: "M3 3h8.5v8.5H3zM12.5 3H21v8.5h-8.5zM3 12.5h8.5V21H3zM12.5 12.5H21V21h-8.5z",
|
|
177
|
+
"x-logo": "M2.8 3h6l12.4 18h-6ZM5.3 4.3l10.6 15.4h2.8L8.1 4.3ZM19.3 3h1.9l-6.6 7.4-.8-1ZM4.7 21H2.8l6.6-7.4.8 1Z",
|
|
178
|
+
linkedin: "M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2ZM6.4 7.6a1.3 1.3 0 1 0 2.6 0 1.3 1.3 0 1 0-2.6 0ZM6.6 10h2.3v7.5H6.6ZM10.8 10H13v1.1c.5-.8 1.4-1.3 2.5-1.3 2 0 3 1.2 3 3.4v4.3h-2.3v-3.9c0-1.1-.4-1.8-1.4-1.8s-1.7.7-1.7 1.8v3.9h-2.3Z",
|
|
179
|
+
instagram: "M7.5 2.5h9a5 5 0 0 1 5 5v9a5 5 0 0 1-5 5h-9a5 5 0 0 1-5-5v-9a5 5 0 0 1 5-5ZM7.5 4.3a3.2 3.2 0 0 0-3.2 3.2v9a3.2 3.2 0 0 0 3.2 3.2h9a3.2 3.2 0 0 0 3.2-3.2v-9a3.2 3.2 0 0 0-3.2-3.2ZM12 7.3a4.7 4.7 0 1 0 0 9.4 4.7 4.7 0 0 0 0-9.4Zm0 1.8a2.9 2.9 0 1 1 0 5.8 2.9 2.9 0 0 1 0-5.8ZM16.2 6.7a1.1 1.1 0 1 0 2.2 0 1.1 1.1 0 1 0-2.2 0Z",
|
|
180
|
+
youtube: "M2.5 7.5c.2-1.6 1.2-2.6 2.8-2.7 2.1-.2 4.4-.3 6.7-.3s4.6.1 6.7.3c1.6.1 2.6 1.1 2.8 2.7.2 1.5.3 3 .3 4.5s-.1 3-.3 4.5c-.2 1.6-1.2 2.6-2.8 2.7-2.1.2-4.4.3-6.7.3s-4.6-.1-6.7-.3c-1.6-.1-2.6-1.1-2.8-2.7-.2-1.5-.3-3-.3-4.5s.1-3 .3-4.5ZM10 8.8v6.4l5.5-3.2Z",
|
|
181
|
+
facebook: "M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19ZM10.3 21.4v-7.6H8.4v-2.5h1.9V9.4c0-2.5 1.4-3.9 3.7-3.9.9 0 1.6.1 1.9.1v2.2h-1.3c-1 0-1.4.6-1.4 1.4v2.1h2.6l-.4 2.5h-2.2v7.6Z",
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const ICON_NAMES = [...Object.keys(PATHS), ...Object.keys(BRANDS)];
|
|
65
185
|
|
|
66
186
|
export function Icon({ name, size = 16, className, label }) {
|
|
67
|
-
const
|
|
187
|
+
const brand = BRANDS[name];
|
|
188
|
+
const d = PATHS[name] || brand;
|
|
68
189
|
if (!d) return null;
|
|
69
190
|
return (
|
|
70
191
|
<svg
|
|
71
192
|
width={size}
|
|
72
193
|
height={size}
|
|
73
194
|
viewBox="0 0 24 24"
|
|
74
|
-
fill="none"
|
|
75
|
-
|
|
76
|
-
|
|
195
|
+
fill={brand ? "currentColor" : "none"}
|
|
196
|
+
fillRule={brand ? "evenodd" : undefined}
|
|
197
|
+
stroke={brand ? "none" : "currentColor"}
|
|
198
|
+
strokeWidth={brand ? undefined : "1.8"}
|
|
77
199
|
strokeLinecap="round"
|
|
78
200
|
strokeLinejoin="round"
|
|
79
201
|
aria-hidden={label ? undefined : true}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { cx } from "./cx";
|
|
5
|
+
import { Icon } from "./icon";
|
|
6
|
+
import { Skeleton } from "./feedback";
|
|
7
|
+
|
|
8
|
+
// Image — a picture of a thing: a file's thumbnail, a product shot, a
|
|
9
|
+
// cover. The browser's own <img> (lazy loading, srcset, decoding) in a box
|
|
10
|
+
// with the workspace's look: rounded, a Skeleton while it loads, an image
|
|
11
|
+
// glyph on a muted fill when it fails or has no `src`. Never a raw <img>
|
|
12
|
+
// in a surface. A person's face is an Avatar.
|
|
13
|
+
//
|
|
14
|
+
// src, alt `alt` is required: what the picture shows, or "" when it
|
|
15
|
+
// only decorates what the text beside it already says
|
|
16
|
+
// ratio auto (the image's own shape; give `width` and `height` so
|
|
17
|
+
// the box holds its place while it loads) · square · video
|
|
18
|
+
// (16:9) · portrait (3:4) · photo (4:3) · wide (21:9), or a
|
|
19
|
+
// number (width / height, e.g. 2)
|
|
20
|
+
// fit cover (fills the box, cropped; the default) · contain (all
|
|
21
|
+
// of it, on a muted fill)
|
|
22
|
+
// rounded md (the default) · none · sm · lg · full (a circle, with a
|
|
23
|
+
// square ratio)
|
|
24
|
+
// loading lazy (the default: fetched as it nears the screen) · eager
|
|
25
|
+
// (above the fold, the page's main picture)
|
|
26
|
+
// fallback a node for the failed state, in place of the glyph
|
|
27
|
+
// className sizes the box (size-10, w-48, max-w-sm); every other prop
|
|
28
|
+
// (width, height, srcSet, sizes, onLoad…) goes to the <img>
|
|
29
|
+
//
|
|
30
|
+
// The box is the element that is sized and rounded; the <img> fills it.
|
|
31
|
+
|
|
32
|
+
const RATIOS = {
|
|
33
|
+
square: "aspect-square",
|
|
34
|
+
video: "aspect-video",
|
|
35
|
+
portrait: "aspect-3/4",
|
|
36
|
+
photo: "aspect-4/3",
|
|
37
|
+
wide: "aspect-21/9",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const ROUNDED = {
|
|
41
|
+
none: "rounded-none",
|
|
42
|
+
sm: "rounded-sm",
|
|
43
|
+
md: "rounded-md",
|
|
44
|
+
lg: "rounded-lg",
|
|
45
|
+
full: "rounded-full",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const FITS = {
|
|
49
|
+
cover: "object-cover",
|
|
50
|
+
contain: "object-contain",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export function Image({
|
|
54
|
+
src,
|
|
55
|
+
alt,
|
|
56
|
+
ratio = "auto",
|
|
57
|
+
fit = "cover",
|
|
58
|
+
rounded = "md",
|
|
59
|
+
loading = "lazy",
|
|
60
|
+
fallback,
|
|
61
|
+
className,
|
|
62
|
+
onLoad,
|
|
63
|
+
onError,
|
|
64
|
+
width,
|
|
65
|
+
height,
|
|
66
|
+
...rest
|
|
67
|
+
}) {
|
|
68
|
+
const img = useRef(null);
|
|
69
|
+
const noAlt = alt === undefined;
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (noAlt) console.warn('Image: `alt` is required — say what the picture shows, or alt="" when it only decorates.');
|
|
72
|
+
}, [noAlt]);
|
|
73
|
+
// "loading" · "loaded" · "failed", reset whenever src changes.
|
|
74
|
+
const [state, setState] = useState({ src, status: src ? "loading" : "failed" });
|
|
75
|
+
const status = state.src === src ? state.status : src ? "loading" : "failed";
|
|
76
|
+
if (state.src !== src) setState({ src, status });
|
|
77
|
+
|
|
78
|
+
// A server-rendered <img> can load or fail before React is listening.
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const el = img.current;
|
|
81
|
+
if (!el || !src || !el.complete) return;
|
|
82
|
+
setState({ src, status: el.naturalWidth > 0 ? "loaded" : "failed" });
|
|
83
|
+
}, [src]);
|
|
84
|
+
|
|
85
|
+
const auto = ratio === "auto" || ratio == null;
|
|
86
|
+
const named = typeof ratio === "string" ? RATIOS[ratio] : undefined;
|
|
87
|
+
const failed = status === "failed";
|
|
88
|
+
// An auto box has no shape of its own until the image arrives: borrow
|
|
89
|
+
// width / height, or a 4:3 box when a failed image has neither.
|
|
90
|
+
let aspect;
|
|
91
|
+
if (typeof ratio === "number" && ratio > 0) aspect = ratio;
|
|
92
|
+
else if (auto && width && height) aspect = `${width} / ${height}`;
|
|
93
|
+
else if (auto && failed) aspect = 4 / 3;
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<span
|
|
97
|
+
className={cx(
|
|
98
|
+
"relative block overflow-hidden bg-muted",
|
|
99
|
+
ROUNDED[rounded] ?? ROUNDED.md,
|
|
100
|
+
named,
|
|
101
|
+
className,
|
|
102
|
+
)}
|
|
103
|
+
style={aspect ? { aspectRatio: aspect } : undefined}
|
|
104
|
+
>
|
|
105
|
+
{src && !failed ? (
|
|
106
|
+
<img
|
|
107
|
+
ref={img}
|
|
108
|
+
src={src}
|
|
109
|
+
alt={alt ?? ""}
|
|
110
|
+
loading={loading}
|
|
111
|
+
decoding="async"
|
|
112
|
+
width={width}
|
|
113
|
+
height={height}
|
|
114
|
+
className={cx(
|
|
115
|
+
"block transition-opacity duration-200 motion-reduce:transition-none",
|
|
116
|
+
auto ? "h-auto w-full" : "absolute inset-0 size-full",
|
|
117
|
+
FITS[fit] ?? FITS.cover,
|
|
118
|
+
status === "loaded" ? "opacity-100" : "opacity-0",
|
|
119
|
+
)}
|
|
120
|
+
onLoad={(e) => {
|
|
121
|
+
setState({ src, status: "loaded" });
|
|
122
|
+
onLoad?.(e);
|
|
123
|
+
}}
|
|
124
|
+
onError={(e) => {
|
|
125
|
+
setState({ src, status: "failed" });
|
|
126
|
+
onError?.(e);
|
|
127
|
+
}}
|
|
128
|
+
{...rest}
|
|
129
|
+
/>
|
|
130
|
+
) : null}
|
|
131
|
+
{status === "loading" ? <Skeleton shape="rect" className="absolute inset-0 size-full" /> : null}
|
|
132
|
+
{failed ? (
|
|
133
|
+
<span
|
|
134
|
+
role={alt ? "img" : undefined}
|
|
135
|
+
aria-label={alt || undefined}
|
|
136
|
+
className="absolute inset-0 flex items-center justify-center text-muted-foreground"
|
|
137
|
+
>
|
|
138
|
+
{fallback ?? <Icon name="image" size={20} />}
|
|
139
|
+
</span>
|
|
140
|
+
) : null}
|
|
141
|
+
</span>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -4,9 +4,54 @@
|
|
|
4
4
|
export { cx } from "./cx";
|
|
5
5
|
export { Icon, ICON_NAMES } from "./icon";
|
|
6
6
|
export { Button, IconButton } from "./button";
|
|
7
|
-
export { Field, Input, Textarea, Select, Switch, Checkbox } from "./field";
|
|
7
|
+
export { Field, Input, TimeInput, Textarea, Select, Switch, Checkbox } from "./field";
|
|
8
8
|
export { Card, Notice, Badge, Kicker, Empty } from "./notice";
|
|
9
9
|
export { Sheet, Confirm } from "./sheet";
|
|
10
10
|
export { Tabs, TabPanel } from "./tabs";
|
|
11
|
-
export { Menu } from "./menu";
|
|
11
|
+
export { Menu, MenuPanel } from "./menu";
|
|
12
|
+
export { ContextMenu } from "./context-menu";
|
|
13
|
+
export { Popover, usePopoverPosition, panelClass } from "./popover";
|
|
14
|
+
export {
|
|
15
|
+
Calendar,
|
|
16
|
+
parseDate,
|
|
17
|
+
isDateString,
|
|
18
|
+
toDateString,
|
|
19
|
+
todayString,
|
|
20
|
+
addDays,
|
|
21
|
+
addMonths,
|
|
22
|
+
startOfMonth,
|
|
23
|
+
endOfMonth,
|
|
24
|
+
dayOfWeek,
|
|
25
|
+
formatDate,
|
|
26
|
+
firstDayOfWeek,
|
|
27
|
+
} from "./calendar";
|
|
28
|
+
export { DatePicker, DateInput, DATE_PRESETS } from "./date-picker";
|
|
29
|
+
export { Tooltip, HoverCard } from "./tooltip";
|
|
12
30
|
export { Depiction } from "./depiction";
|
|
31
|
+
export { toast, Toaster } from "./toast";
|
|
32
|
+
export { Carousel } from "./carousel";
|
|
33
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "./resizable";
|
|
34
|
+
export { Avatar, AvatarGroup } from "./avatar";
|
|
35
|
+
export { Breadcrumb } from "./breadcrumb";
|
|
36
|
+
export { Pagination } from "./pagination";
|
|
37
|
+
export { RadioGroup, Radio } from "./radio";
|
|
38
|
+
export { Toggle, ToggleGroup } from "./toggle";
|
|
39
|
+
export { ButtonGroup, ButtonGroupSeparator } from "./button-group";
|
|
40
|
+
export { Collapsible, Accordion } from "./collapsible";
|
|
41
|
+
export { Item, ItemGroup } from "./item";
|
|
42
|
+
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "./table";
|
|
43
|
+
export { Spinner, Skeleton, Progress } from "./feedback";
|
|
44
|
+
export { Distribution } from "./distribution";
|
|
45
|
+
export { Swatch } from "./swatch";
|
|
46
|
+
export { Stat, StatGroup, Delta, StatusDot, Legend, Meter } from "./stat";
|
|
47
|
+
export { Steps } from "./steps";
|
|
48
|
+
export { Separator, Kbd, KbdGroup, AspectRatio } from "./separator";
|
|
49
|
+
export { ScrollArea } from "./scroll-area";
|
|
50
|
+
export { Slider } from "./slider";
|
|
51
|
+
export { InputGroup, PasswordInput } from "./input-group";
|
|
52
|
+
export { Image } from "./image";
|
|
53
|
+
export { FileInput, FileDrop, fileMatches } from "./file-input";
|
|
54
|
+
export { InputOTP } from "./input-otp";
|
|
55
|
+
export { Command, CommandDialog, commandScore, commandFilter } from "./command";
|
|
56
|
+
export { Combobox } from "./combobox";
|
|
57
|
+
export { Rating } from "./rating";
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { isValidElement, useRef, useState } from "react";
|
|
4
|
+
import { cx } from "./cx";
|
|
5
|
+
import { Button, IconButton } from "./button";
|
|
6
|
+
import { Icon } from "./icon";
|
|
7
|
+
import { KbdGroup } from "./separator";
|
|
8
|
+
import { useAutoGrow } from "./field";
|
|
9
|
+
|
|
10
|
+
// InputGroup — an Input (or, multiline, a Textarea) with things attached: "https://" before it,
|
|
11
|
+
// "USD" after it, a search glyph, a ⌘K hint, a copy button. The group is
|
|
12
|
+
// the field: one border, one focus ring, one invalid red, one disabled
|
|
13
|
+
// state, so it reads as a single control and never as an input with
|
|
14
|
+
// stickers beside it. A native <input> inside, every prop not named here
|
|
15
|
+
// goes to it (type, value, onChange, placeholder, autoComplete…); wrap
|
|
16
|
+
// the group in <Field> and give it the same `id`. A press on an addon
|
|
17
|
+
// puts the caret in the input, as a press on the field would.
|
|
18
|
+
//
|
|
19
|
+
// icon a glyph from ./icon at the start (search, mail, globe)
|
|
20
|
+
// prefix text at the start, set close to what is typed ("https://")
|
|
21
|
+
// suffix text at the end ("USD", ".makersclaw.com", "/ month")
|
|
22
|
+
// kbd a shortcut hint at the end: "/" or ["⌘", "K"]. Shown from
|
|
23
|
+
// md up (a phone has no keyboard) and hidden from readers:
|
|
24
|
+
// pass aria-keyshortcuts="Meta+K" for them
|
|
25
|
+
// action the button at the end: { label, icon?, onClick?, type?,
|
|
26
|
+
// variant? } — with `icon` it is an IconButton and `label` is
|
|
27
|
+
// what a reader says; without, a small text button. Or any
|
|
28
|
+
// node, for something else.
|
|
29
|
+
// invalid marks the input aria-invalid; the whole group turns red
|
|
30
|
+
// multiline true: a <textarea> that grows with its text (from `minRows`,
|
|
31
|
+
// default 1, to `maxRows`, default 8, then it scrolls) — the
|
|
32
|
+
// chat composer, a comment box. The text takes the full width
|
|
33
|
+
// and the addons sit in a bar under it: icon, prefix and
|
|
34
|
+
// `tools` at the start, suffix, kbd and action at the end.
|
|
35
|
+
// `above` is a node inside the border over the text (the
|
|
36
|
+
// attached files). Keys are yours: onKeyDown goes to the
|
|
37
|
+
// textarea (Enter to send — mind e.nativeEvent.isComposing).
|
|
38
|
+
// tools (multiline) nodes at the start of the bar: attach, a model menu
|
|
39
|
+
// above (multiline) a node over the text, inside the one border
|
|
40
|
+
//
|
|
41
|
+
// The input draws no border of its own (it is not composed from <Input>,
|
|
42
|
+
// whose border and ring would draw a box inside the box); the group
|
|
43
|
+
// carries the same classes <Input> does, so the two sit in a form as
|
|
44
|
+
// equals.
|
|
45
|
+
|
|
46
|
+
const GROUP =
|
|
47
|
+
"flex w-full min-h-11 cursor-text items-center gap-2 rounded-md border border-input bg-background px-3 text-sm text-foreground " +
|
|
48
|
+
"has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-ring " +
|
|
49
|
+
"has-[input[aria-invalid=true]]:border-destructive " +
|
|
50
|
+
"has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50";
|
|
51
|
+
|
|
52
|
+
const FIELD =
|
|
53
|
+
"min-w-0 flex-1 self-stretch border-0 bg-transparent p-0 text-sm text-foreground outline-none " +
|
|
54
|
+
"placeholder:text-muted-foreground disabled:cursor-not-allowed";
|
|
55
|
+
|
|
56
|
+
const ADDON = "shrink-0 select-none whitespace-nowrap text-muted-foreground";
|
|
57
|
+
|
|
58
|
+
// The multi-line group: a column — above, the text, then the bar.
|
|
59
|
+
const MULTI =
|
|
60
|
+
"flex w-full cursor-text flex-col rounded-md border border-input bg-background text-sm text-foreground " +
|
|
61
|
+
"has-[textarea:focus-visible]:ring-2 has-[textarea:focus-visible]:ring-ring " +
|
|
62
|
+
"has-[textarea[aria-invalid=true]]:border-destructive " +
|
|
63
|
+
"has-[textarea:disabled]:cursor-not-allowed has-[textarea:disabled]:opacity-50";
|
|
64
|
+
|
|
65
|
+
const MULTI_FIELD =
|
|
66
|
+
"block w-full resize-none border-0 bg-transparent px-3 pt-3 pb-1 text-sm leading-5 text-foreground outline-none " +
|
|
67
|
+
"placeholder:text-muted-foreground disabled:cursor-not-allowed";
|
|
68
|
+
|
|
69
|
+
export function InputGroup({ multiline = false, ...props }) {
|
|
70
|
+
if (multiline) return <MultilineGroup {...props} />;
|
|
71
|
+
const { tools, above, minRows, maxRows, ...one } = props; // multiline only
|
|
72
|
+
return <SingleLineGroup {...one} />;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// The trailing button, from `action`.
|
|
76
|
+
function actionNode(action, disabled) {
|
|
77
|
+
if (action && typeof action === "object" && !isValidElement(action) && "label" in action) {
|
|
78
|
+
const { label, icon: glyph, variant, ...props } = action;
|
|
79
|
+
return glyph ? (
|
|
80
|
+
<IconButton icon={glyph} label={label} size="sm" variant={variant ?? "quiet"} disabled={disabled} {...props} />
|
|
81
|
+
) : (
|
|
82
|
+
<Button size="sm" variant={variant ?? "secondary"} disabled={disabled} {...props}>
|
|
83
|
+
{label}
|
|
84
|
+
</Button>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
return action || null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function MultilineGroup({ icon, prefix, suffix, kbd, action, tools, above, invalid, disabled, minRows = 1, maxRows = 8, onInput, className, ref, ...rest }) {
|
|
91
|
+
const grow = useAutoGrow({ minRows, maxRows, value: rest.value, outer: ref });
|
|
92
|
+
const area = useRef(null);
|
|
93
|
+
|
|
94
|
+
function focusText(e) {
|
|
95
|
+
if (e.target.closest("button, a, input, select, textarea, [role=button]")) return;
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
area.current?.focus();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const keys = kbd ? (Array.isArray(kbd) ? kbd : [kbd]) : null;
|
|
101
|
+
const end = actionNode(action, disabled);
|
|
102
|
+
const start = icon || prefix || tools;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className={cx(MULTI, className)} onMouseDown={focusText}>
|
|
106
|
+
{above ? <div className="min-w-0 cursor-default">{above}</div> : null}
|
|
107
|
+
<textarea
|
|
108
|
+
ref={(el) => {
|
|
109
|
+
area.current = el;
|
|
110
|
+
return grow.ref(el);
|
|
111
|
+
}}
|
|
112
|
+
rows={minRows}
|
|
113
|
+
disabled={disabled}
|
|
114
|
+
aria-invalid={invalid ? true : undefined}
|
|
115
|
+
className={MULTI_FIELD}
|
|
116
|
+
onInput={(e) => {
|
|
117
|
+
grow.fit();
|
|
118
|
+
onInput?.(e);
|
|
119
|
+
}}
|
|
120
|
+
{...rest}
|
|
121
|
+
/>
|
|
122
|
+
<div className="flex min-h-11 items-center gap-1 px-1.5 pb-1.5">
|
|
123
|
+
{start ? (
|
|
124
|
+
<div className="flex min-w-0 items-center gap-1">
|
|
125
|
+
{icon ? <Icon name={icon} className={cx(ADDON, "mx-1.5")} /> : null}
|
|
126
|
+
{prefix ? <span className={cx(ADDON, "px-1.5")}>{prefix}</span> : null}
|
|
127
|
+
{tools}
|
|
128
|
+
</div>
|
|
129
|
+
) : null}
|
|
130
|
+
<div className="min-w-0 flex-1" />
|
|
131
|
+
{suffix ? <span className={cx(ADDON, "px-1.5")}>{suffix}</span> : null}
|
|
132
|
+
{keys ? (
|
|
133
|
+
<span className="hidden shrink-0 px-1.5 md:inline-flex" aria-hidden="true">
|
|
134
|
+
<KbdGroup keys={keys} />
|
|
135
|
+
</span>
|
|
136
|
+
) : null}
|
|
137
|
+
{end ? <span className="flex shrink-0 items-center">{end}</span> : null}
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function SingleLineGroup({ icon, prefix, suffix, kbd, action, invalid, disabled, className, ref, ...rest }) {
|
|
144
|
+
const input = useRef(null);
|
|
145
|
+
|
|
146
|
+
function focusInput(e) {
|
|
147
|
+
if (e.target.closest("button, a, input, select, textarea")) return;
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
input.current?.focus();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const keys = kbd ? (Array.isArray(kbd) ? kbd : [kbd]) : null;
|
|
153
|
+
const end = actionNode(action, disabled);
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div className={cx(GROUP, end && "pr-1", className)} onMouseDown={focusInput}>
|
|
157
|
+
{icon ? <Icon name={icon} className={ADDON} /> : null}
|
|
158
|
+
{prefix ? <span className={cx(ADDON, "-mr-1.5")}>{prefix}</span> : null}
|
|
159
|
+
<input
|
|
160
|
+
ref={(el) => {
|
|
161
|
+
input.current = el;
|
|
162
|
+
if (typeof ref === "function") ref(el);
|
|
163
|
+
else if (ref) ref.current = el;
|
|
164
|
+
}}
|
|
165
|
+
disabled={disabled}
|
|
166
|
+
aria-invalid={invalid ? true : undefined}
|
|
167
|
+
className={FIELD}
|
|
168
|
+
{...rest}
|
|
169
|
+
/>
|
|
170
|
+
{suffix ? <span className={ADDON}>{suffix}</span> : null}
|
|
171
|
+
{keys ? (
|
|
172
|
+
<span className="hidden shrink-0 md:inline-flex" aria-hidden="true">
|
|
173
|
+
<KbdGroup keys={keys} />
|
|
174
|
+
</span>
|
|
175
|
+
) : null}
|
|
176
|
+
{end ? <span className="flex shrink-0 items-center">{end}</span> : null}
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A password field with a show/hide toggle: an InputGroup whose action is
|
|
183
|
+
* an IconButton (eye / eye-off) with aria-pressed, named "Show password"
|
|
184
|
+
* — its pressed state says whether the text is showing. Every other prop
|
|
185
|
+
* goes to the <input> as in InputGroup: `autoComplete` defaults to
|
|
186
|
+
* "current-password"; pass "new-password" on a sign-up or a reset so the
|
|
187
|
+
* browser offers to generate one. `icon`, `invalid`, `disabled`, `id`
|
|
188
|
+
* work as in InputGroup. `showLabel` renames the toggle.
|
|
189
|
+
*/
|
|
190
|
+
export function PasswordInput({ autoComplete = "current-password", showLabel = "Show password", disabled, ...rest }) {
|
|
191
|
+
const [shown, setShown] = useState(false);
|
|
192
|
+
return (
|
|
193
|
+
<InputGroup
|
|
194
|
+
{...rest}
|
|
195
|
+
type={shown ? "text" : "password"}
|
|
196
|
+
autoComplete={autoComplete}
|
|
197
|
+
autoCapitalize="off"
|
|
198
|
+
autoCorrect="off"
|
|
199
|
+
spellCheck={false}
|
|
200
|
+
disabled={disabled}
|
|
201
|
+
action={
|
|
202
|
+
<IconButton
|
|
203
|
+
icon={shown ? "eye-off" : "eye"}
|
|
204
|
+
label={showLabel}
|
|
205
|
+
aria-pressed={shown}
|
|
206
|
+
size="sm"
|
|
207
|
+
disabled={disabled}
|
|
208
|
+
onClick={() => setShown((v) => !v)}
|
|
209
|
+
/>
|
|
210
|
+
}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
}
|