@agentage/components 0.0.0-stage → 0.21.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/LICENSE +21 -0
- package/README.md +207 -2
- package/dist/components/accordion.context.d.ts +17 -0
- package/dist/components/accordion.context.d.ts.map +1 -0
- package/dist/components/accordion.context.js +14 -0
- package/dist/components/accordion.d.ts +27 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +90 -0
- package/dist/components/accordion.trigger.d.ts +11 -0
- package/dist/components/accordion.trigger.d.ts.map +1 -0
- package/dist/components/accordion.trigger.js +57 -0
- package/dist/components/action-bar.d.ts +29 -0
- package/dist/components/action-bar.d.ts.map +1 -0
- package/dist/components/action-bar.js +119 -0
- package/dist/components/action-bar.parts.d.ts +23 -0
- package/dist/components/action-bar.parts.d.ts.map +1 -0
- package/dist/components/action-bar.parts.js +117 -0
- package/dist/components/alert.d.ts +17 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +73 -0
- package/dist/components/avatar.d.ts +22 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +82 -0
- package/dist/components/badge.d.ts +20 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +32 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +70 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +43 -0
- package/dist/components/button.variants.d.ts +5 -0
- package/dist/components/button.variants.d.ts.map +1 -0
- package/dist/components/button.variants.js +26 -0
- package/dist/components/card-base.d.ts +10 -0
- package/dist/components/card-base.d.ts.map +1 -0
- package/dist/components/card-base.js +10 -0
- package/dist/components/card-state.d.ts +45 -0
- package/dist/components/card-state.d.ts.map +1 -0
- package/dist/components/card-state.js +137 -0
- package/dist/components/card.d.ts +25 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +62 -0
- package/dist/components/card.parts.d.ts +9 -0
- package/dist/components/card.parts.d.ts.map +1 -0
- package/dist/components/card.parts.js +37 -0
- package/dist/components/check-list.d.ts +30 -0
- package/dist/components/check-list.d.ts.map +1 -0
- package/dist/components/check-list.js +88 -0
- package/dist/components/check-list.parts.d.ts +17 -0
- package/dist/components/check-list.parts.d.ts.map +1 -0
- package/dist/components/check-list.parts.js +40 -0
- package/dist/components/checkbox.d.ts +24 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +103 -0
- package/dist/components/chip.d.ts +17 -0
- package/dist/components/chip.d.ts.map +1 -0
- package/dist/components/chip.js +93 -0
- package/dist/components/code-block.d.ts +15 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +87 -0
- package/dist/components/collapsible.d.ts +27 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +81 -0
- package/dist/components/command.context.d.ts +16 -0
- package/dist/components/command.context.d.ts.map +1 -0
- package/dist/components/command.context.js +13 -0
- package/dist/components/command.d.ts +19 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +125 -0
- package/dist/components/command.parts.d.ts +18 -0
- package/dist/components/command.parts.d.ts.map +1 -0
- package/dist/components/command.parts.js +77 -0
- package/dist/components/command.variants.d.ts +6 -0
- package/dist/components/command.variants.d.ts.map +1 -0
- package/dist/components/command.variants.js +23 -0
- package/dist/components/content-block.d.ts +24 -0
- package/dist/components/content-block.d.ts.map +1 -0
- package/dist/components/content-block.diff.d.ts +26 -0
- package/dist/components/content-block.diff.d.ts.map +1 -0
- package/dist/components/content-block.diff.js +110 -0
- package/dist/components/content-block.js +61 -0
- package/dist/components/content-block.parts.d.ts +12 -0
- package/dist/components/content-block.parts.d.ts.map +1 -0
- package/dist/components/content-block.parts.js +52 -0
- package/dist/components/content-blocks.d.ts +61 -0
- package/dist/components/content-blocks.d.ts.map +1 -0
- package/dist/components/content-blocks.js +99 -0
- package/dist/components/content-blocks.meta.d.ts +21 -0
- package/dist/components/content-blocks.meta.d.ts.map +1 -0
- package/dist/components/content-blocks.meta.js +56 -0
- package/dist/components/control.variants.d.ts +10 -0
- package/dist/components/control.variants.d.ts.map +1 -0
- package/dist/components/control.variants.js +25 -0
- package/dist/components/copy-button.d.ts +15 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +96 -0
- package/dist/components/count.d.ts +5 -0
- package/dist/components/count.d.ts.map +1 -0
- package/dist/components/count.js +12 -0
- package/dist/components/data-table.body.d.ts +36 -0
- package/dist/components/data-table.body.d.ts.map +1 -0
- package/dist/components/data-table.body.js +112 -0
- package/dist/components/data-table.d.ts +14 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.group-head.d.ts +17 -0
- package/dist/components/data-table.group-head.d.ts.map +1 -0
- package/dist/components/data-table.group-head.js +40 -0
- package/dist/components/data-table.group.d.ts +27 -0
- package/dist/components/data-table.group.d.ts.map +1 -0
- package/dist/components/data-table.group.js +32 -0
- package/dist/components/data-table.js +115 -0
- package/dist/components/data-table.menu.d.ts +12 -0
- package/dist/components/data-table.menu.d.ts.map +1 -0
- package/dist/components/data-table.menu.js +39 -0
- package/dist/components/data-table.parts.d.ts +28 -0
- package/dist/components/data-table.parts.d.ts.map +1 -0
- package/dist/components/data-table.parts.js +54 -0
- package/dist/components/data-table.selection.d.ts +27 -0
- package/dist/components/data-table.selection.d.ts.map +1 -0
- package/dist/components/data-table.selection.js +42 -0
- package/dist/components/data-table.state.d.ts +8 -0
- package/dist/components/data-table.state.d.ts.map +1 -0
- package/dist/components/data-table.state.js +11 -0
- package/dist/components/data-table.types.d.ts +71 -0
- package/dist/components/data-table.types.d.ts.map +1 -0
- package/dist/components/data-table.types.js +0 -0
- package/dist/components/data-table.variants.d.ts +22 -0
- package/dist/components/data-table.variants.d.ts.map +1 -0
- package/dist/components/data-table.variants.js +91 -0
- package/dist/components/data-tree.d.ts +20 -0
- package/dist/components/data-tree.d.ts.map +1 -0
- package/dist/components/data-tree.js +75 -0
- package/dist/components/data-tree.model.d.ts +35 -0
- package/dist/components/data-tree.model.d.ts.map +1 -0
- package/dist/components/data-tree.model.js +70 -0
- package/dist/components/data-tree.row.d.ts +23 -0
- package/dist/components/data-tree.row.d.ts.map +1 -0
- package/dist/components/data-tree.row.js +109 -0
- package/dist/components/data-view.board-card.d.ts +18 -0
- package/dist/components/data-view.board-card.d.ts.map +1 -0
- package/dist/components/data-view.board-card.js +74 -0
- package/dist/components/data-view.board-head.d.ts +14 -0
- package/dist/components/data-view.board-head.d.ts.map +1 -0
- package/dist/components/data-view.board-head.js +61 -0
- package/dist/components/data-view.board.d.ts +31 -0
- package/dist/components/data-view.board.d.ts.map +1 -0
- package/dist/components/data-view.board.js +120 -0
- package/dist/components/data-view.config.d.ts +70 -0
- package/dist/components/data-view.config.d.ts.map +1 -0
- package/dist/components/data-view.config.js +68 -0
- package/dist/components/data-view.d.ts +10 -0
- package/dist/components/data-view.d.ts.map +1 -0
- package/dist/components/data-view.hooks.d.ts +23 -0
- package/dist/components/data-view.hooks.d.ts.map +1 -0
- package/dist/components/data-view.hooks.js +104 -0
- package/dist/components/data-view.js +117 -0
- package/dist/components/data-view.parts.d.ts +22 -0
- package/dist/components/data-view.parts.d.ts.map +1 -0
- package/dist/components/data-view.parts.js +29 -0
- package/dist/components/data-view.toolbar.d.ts +34 -0
- package/dist/components/data-view.toolbar.d.ts.map +1 -0
- package/dist/components/data-view.toolbar.js +134 -0
- package/dist/components/data-view.types.d.ts +53 -0
- package/dist/components/data-view.types.d.ts.map +1 -0
- package/dist/components/data-view.types.js +0 -0
- package/dist/components/date-picker.d.ts +27 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +123 -0
- package/dist/components/date-picker.range.d.ts +18 -0
- package/dist/components/date-picker.range.d.ts.map +1 -0
- package/dist/components/date-picker.range.js +97 -0
- package/dist/components/date-picker.range.parts.d.ts +12 -0
- package/dist/components/date-picker.range.parts.d.ts.map +1 -0
- package/dist/components/date-picker.range.parts.js +80 -0
- package/dist/components/description-list.d.ts +33 -0
- package/dist/components/description-list.d.ts.map +1 -0
- package/dist/components/description-list.js +75 -0
- package/dist/components/description-list.property.d.ts +25 -0
- package/dist/components/description-list.property.d.ts.map +1 -0
- package/dist/components/description-list.property.js +36 -0
- package/dist/components/description-list.variants.d.ts +8 -0
- package/dist/components/description-list.variants.d.ts.map +1 -0
- package/dist/components/description-list.variants.js +74 -0
- package/dist/components/dialog-shell.d.ts +36 -0
- package/dist/components/dialog-shell.d.ts.map +1 -0
- package/dist/components/dialog-shell.js +69 -0
- package/dist/components/dialog.confirm.d.ts +8 -0
- package/dist/components/dialog.confirm.d.ts.map +1 -0
- package/dist/components/dialog.confirm.js +91 -0
- package/dist/components/dialog.d.ts +27 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +53 -0
- package/dist/components/dialog.phrase.d.ts +9 -0
- package/dist/components/dialog.phrase.d.ts.map +1 -0
- package/dist/components/dialog.phrase.js +43 -0
- package/dist/components/dirty-bar.d.ts +30 -0
- package/dist/components/dirty-bar.d.ts.map +1 -0
- package/dist/components/dirty-bar.js +109 -0
- package/dist/components/disclosure.d.ts +24 -0
- package/dist/components/disclosure.d.ts.map +1 -0
- package/dist/components/disclosure.js +34 -0
- package/dist/components/dropdown-menu.d.ts +16 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.items.d.ts +15 -0
- package/dist/components/dropdown-menu.items.d.ts.map +1 -0
- package/dist/components/dropdown-menu.items.js +25 -0
- package/dist/components/dropdown-menu.js +80 -0
- package/dist/components/dropdown-menu.variants.d.ts +2 -0
- package/dist/components/dropdown-menu.variants.d.ts.map +1 -0
- package/dist/components/dropdown-menu.variants.js +1 -0
- package/dist/components/empty-state.d.ts +11 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +33 -0
- package/dist/components/entity-card.d.ts +34 -0
- package/dist/components/entity-card.d.ts.map +1 -0
- package/dist/components/entity-card.js +87 -0
- package/dist/components/entity-list.d.ts +30 -0
- package/dist/components/entity-list.d.ts.map +1 -0
- package/dist/components/entity-list.items.d.ts +20 -0
- package/dist/components/entity-list.items.d.ts.map +1 -0
- package/dist/components/entity-list.items.js +59 -0
- package/dist/components/entity-list.js +61 -0
- package/dist/components/entity-list.parts.d.ts +35 -0
- package/dist/components/entity-list.parts.d.ts.map +1 -0
- package/dist/components/entity-list.parts.js +86 -0
- package/dist/components/entity-list.row.d.ts +14 -0
- package/dist/components/entity-list.row.d.ts.map +1 -0
- package/dist/components/entity-list.row.js +58 -0
- package/dist/components/form-field.d.ts +13 -0
- package/dist/components/form-field.d.ts.map +1 -0
- package/dist/components/form-field.js +65 -0
- package/dist/components/form-field.live.d.ts +6 -0
- package/dist/components/form-field.live.d.ts.map +1 -0
- package/dist/components/form-field.live.js +19 -0
- package/dist/components/group-header.d.ts +23 -0
- package/dist/components/group-header.d.ts.map +1 -0
- package/dist/components/group-header.js +81 -0
- package/dist/components/highlight.d.ts +4 -0
- package/dist/components/highlight.d.ts.map +1 -0
- package/dist/components/highlight.js +14 -0
- package/dist/components/icon-button.d.ts +15 -0
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +25 -0
- package/dist/components/index.d.ts +155 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +95 -0
- package/dist/components/inline-edit.d.ts +24 -0
- package/dist/components/inline-edit.d.ts.map +1 -0
- package/dist/components/inline-edit.js +68 -0
- package/dist/components/input.d.ts +35 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +101 -0
- package/dist/components/kbd.d.ts +5 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +12 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +16 -0
- package/dist/components/list-toolbar.d.ts +37 -0
- package/dist/components/list-toolbar.d.ts.map +1 -0
- package/dist/components/list-toolbar.filter.d.ts +13 -0
- package/dist/components/list-toolbar.filter.d.ts.map +1 -0
- package/dist/components/list-toolbar.filter.js +65 -0
- package/dist/components/list-toolbar.fit.d.ts +24 -0
- package/dist/components/list-toolbar.fit.d.ts.map +1 -0
- package/dist/components/list-toolbar.fit.js +69 -0
- package/dist/components/list-toolbar.icons.d.ts +10 -0
- package/dist/components/list-toolbar.icons.d.ts.map +1 -0
- package/dist/components/list-toolbar.icons.js +21 -0
- package/dist/components/list-toolbar.js +68 -0
- package/dist/components/list-toolbar.menus.d.ts +26 -0
- package/dist/components/list-toolbar.menus.d.ts.map +1 -0
- package/dist/components/list-toolbar.menus.js +98 -0
- package/dist/components/list-toolbar.parts.d.ts +25 -0
- package/dist/components/list-toolbar.parts.d.ts.map +1 -0
- package/dist/components/list-toolbar.parts.js +72 -0
- package/dist/components/list-toolbar.search.d.ts +8 -0
- package/dist/components/list-toolbar.search.d.ts.map +1 -0
- package/dist/components/list-toolbar.search.js +54 -0
- package/dist/components/list-toolbar.variants.d.ts +11 -0
- package/dist/components/list-toolbar.variants.d.ts.map +1 -0
- package/dist/components/list-toolbar.variants.js +9 -0
- package/dist/components/log-view.d.ts +25 -0
- package/dist/components/log-view.d.ts.map +1 -0
- package/dist/components/log-view.hooks.d.ts +40 -0
- package/dist/components/log-view.hooks.d.ts.map +1 -0
- package/dist/components/log-view.hooks.js +87 -0
- package/dist/components/log-view.js +110 -0
- package/dist/components/log-view.model.d.ts +35 -0
- package/dist/components/log-view.model.d.ts.map +1 -0
- package/dist/components/log-view.model.js +56 -0
- package/dist/components/log-view.row.d.ts +31 -0
- package/dist/components/log-view.row.d.ts.map +1 -0
- package/dist/components/log-view.row.js +127 -0
- package/dist/components/menu.parts.d.ts +26 -0
- package/dist/components/menu.parts.d.ts.map +1 -0
- package/dist/components/menu.parts.js +59 -0
- package/dist/components/menu.selectable.d.ts +24 -0
- package/dist/components/menu.selectable.d.ts.map +1 -0
- package/dist/components/menu.selectable.js +66 -0
- package/dist/components/menu.variants.d.ts +9 -0
- package/dist/components/menu.variants.d.ts.map +1 -0
- package/dist/components/menu.variants.js +16 -0
- package/dist/components/nav-tree.d.ts +22 -0
- package/dist/components/nav-tree.d.ts.map +1 -0
- package/dist/components/nav-tree.js +95 -0
- package/dist/components/nav-tree.variants.d.ts +13 -0
- package/dist/components/nav-tree.variants.d.ts.map +1 -0
- package/dist/components/nav-tree.variants.js +9 -0
- package/dist/components/page-header.d.ts +34 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +115 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +114 -0
- package/dist/components/popover.d.ts +18 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +64 -0
- package/dist/components/priority-glyph.d.ts +11 -0
- package/dist/components/priority-glyph.d.ts.map +1 -0
- package/dist/components/priority-glyph.js +75 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +87 -0
- package/dist/components/progress.meter.d.ts +36 -0
- package/dist/components/progress.meter.d.ts.map +1 -0
- package/dist/components/progress.meter.js +64 -0
- package/dist/components/progress.segments.d.ts +28 -0
- package/dist/components/progress.segments.d.ts.map +1 -0
- package/dist/components/progress.segments.js +59 -0
- package/dist/components/property-date.d.ts +11 -0
- package/dist/components/property-date.d.ts.map +1 -0
- package/dist/components/property-date.format.d.ts +3 -0
- package/dist/components/property-date.format.d.ts.map +1 -0
- package/dist/components/property-date.format.js +7 -0
- package/dist/components/property-date.js +142 -0
- package/dist/components/property-select.d.ts +28 -0
- package/dist/components/property-select.d.ts.map +1 -0
- package/dist/components/property-select.js +68 -0
- package/dist/components/prose.d.ts +6 -0
- package/dist/components/prose.d.ts.map +1 -0
- package/dist/components/prose.js +13 -0
- package/dist/components/radio-group.d.ts +23 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +116 -0
- package/dist/components/relative-time.d.ts +12 -0
- package/dist/components/relative-time.d.ts.map +1 -0
- package/dist/components/relative-time.js +30 -0
- package/dist/components/resizable-split-prepaint.d.ts +12 -0
- package/dist/components/resizable-split-prepaint.d.ts.map +1 -0
- package/dist/components/resizable-split-prepaint.js +5 -0
- package/dist/components/resizable-split.context.d.ts +11 -0
- package/dist/components/resizable-split.context.d.ts.map +1 -0
- package/dist/components/resizable-split.context.js +9 -0
- package/dist/components/resizable-split.d.ts +30 -0
- package/dist/components/resizable-split.d.ts.map +1 -0
- package/dist/components/resizable-split.js +85 -0
- package/dist/components/resizable.d.ts +21 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +90 -0
- package/dist/components/resizable.model.d.ts +18 -0
- package/dist/components/resizable.model.d.ts.map +1 -0
- package/dist/components/resizable.model.js +11 -0
- package/dist/components/resizable.parts.d.ts +20 -0
- package/dist/components/resizable.parts.d.ts.map +1 -0
- package/dist/components/resizable.parts.js +36 -0
- package/dist/components/resizable.variants.d.ts +16 -0
- package/dist/components/resizable.variants.d.ts.map +1 -0
- package/dist/components/resizable.variants.js +41 -0
- package/dist/components/row.variants.d.ts +10 -0
- package/dist/components/row.variants.d.ts.map +1 -0
- package/dist/components/row.variants.js +36 -0
- package/dist/components/secret-input.d.ts +20 -0
- package/dist/components/secret-input.d.ts.map +1 -0
- package/dist/components/secret-input.js +94 -0
- package/dist/components/section-index.d.ts +23 -0
- package/dist/components/section-index.d.ts.map +1 -0
- package/dist/components/section-index.js +51 -0
- package/dist/components/section.d.ts +19 -0
- package/dist/components/section.d.ts.map +1 -0
- package/dist/components/section.js +42 -0
- package/dist/components/select.d.ts +28 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +120 -0
- package/dist/components/select.keys.d.ts +6 -0
- package/dist/components/select.keys.d.ts.map +1 -0
- package/dist/components/select.keys.js +20 -0
- package/dist/components/select.list.d.ts +26 -0
- package/dist/components/select.list.d.ts.map +1 -0
- package/dist/components/select.list.js +50 -0
- package/dist/components/select.parts.d.ts +53 -0
- package/dist/components/select.parts.d.ts.map +1 -0
- package/dist/components/select.parts.js +95 -0
- package/dist/components/select.variants.d.ts +13 -0
- package/dist/components/select.variants.d.ts.map +1 -0
- package/dist/components/select.variants.js +54 -0
- package/dist/components/sheet.d.ts +27 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.docked.d.ts +8 -0
- package/dist/components/sheet.docked.d.ts.map +1 -0
- package/dist/components/sheet.docked.js +106 -0
- package/dist/components/sheet.js +61 -0
- package/dist/components/sheet.narrow.d.ts +3 -0
- package/dist/components/sheet.narrow.d.ts.map +1 -0
- package/dist/components/sheet.narrow.js +9 -0
- package/dist/components/sidebar.d.ts +14 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +48 -0
- package/dist/components/skeleton.d.ts +10 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +21 -0
- package/dist/components/sparkline.d.ts +26 -0
- package/dist/components/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline.js +83 -0
- package/dist/components/spinner.d.ts +10 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +38 -0
- package/dist/components/stat-card.d.ts +9 -0
- package/dist/components/stat-card.d.ts.map +1 -0
- package/dist/components/stat-card.header.d.ts +19 -0
- package/dist/components/stat-card.header.d.ts.map +1 -0
- package/dist/components/stat-card.header.js +43 -0
- package/dist/components/stat-card.js +84 -0
- package/dist/components/stat-card.parts.d.ts +10 -0
- package/dist/components/stat-card.parts.d.ts.map +1 -0
- package/dist/components/stat-card.parts.js +35 -0
- package/dist/components/stat-card.state.d.ts +9 -0
- package/dist/components/stat-card.state.d.ts.map +1 -0
- package/dist/components/stat-card.state.js +51 -0
- package/dist/components/stat-card.types.d.ts +28 -0
- package/dist/components/stat-card.types.d.ts.map +1 -0
- package/dist/components/stat-card.types.js +0 -0
- package/dist/components/status-bar.d.ts +32 -0
- package/dist/components/status-bar.d.ts.map +1 -0
- package/dist/components/status-bar.js +114 -0
- package/dist/components/status-bar.variants.d.ts +12 -0
- package/dist/components/status-bar.variants.d.ts.map +1 -0
- package/dist/components/status-bar.variants.js +63 -0
- package/dist/components/status-glyph.d.ts +15 -0
- package/dist/components/status-glyph.d.ts.map +1 -0
- package/dist/components/status-glyph.js +118 -0
- package/dist/components/status-glyph.status.d.ts +11 -0
- package/dist/components/status-glyph.status.d.ts.map +1 -0
- package/dist/components/status-glyph.status.js +33 -0
- package/dist/components/step-list.d.ts +28 -0
- package/dist/components/step-list.d.ts.map +1 -0
- package/dist/components/step-list.js +70 -0
- package/dist/components/step-list.parts.d.ts +34 -0
- package/dist/components/step-list.parts.d.ts.map +1 -0
- package/dist/components/step-list.parts.js +74 -0
- package/dist/components/switch.d.ts +22 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +93 -0
- package/dist/components/table.d.ts +19 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +73 -0
- package/dist/components/tabs.context.d.ts +19 -0
- package/dist/components/tabs.context.d.ts.map +1 -0
- package/dist/components/tabs.context.js +15 -0
- package/dist/components/tabs.d.ts +23 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +61 -0
- package/dist/components/tabs.trigger.d.ts +12 -0
- package/dist/components/tabs.trigger.d.ts.map +1 -0
- package/dist/components/tabs.trigger.js +69 -0
- package/dist/components/tabs.variants.d.ts +10 -0
- package/dist/components/tabs.variants.d.ts.map +1 -0
- package/dist/components/tabs.variants.js +33 -0
- package/dist/components/toast.d.ts +21 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +125 -0
- package/dist/components/toggle-group.d.ts +36 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +68 -0
- package/dist/components/toggle-group.variants.d.ts +13 -0
- package/dist/components/toggle-group.variants.d.ts.map +1 -0
- package/dist/components/toggle-group.variants.js +71 -0
- package/dist/components/tooltip.d.ts +10 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +49 -0
- package/dist/components/tree-select.d.ts +26 -0
- package/dist/components/tree-select.d.ts.map +1 -0
- package/dist/components/tree-select.js +102 -0
- package/dist/components/tree-select.model.d.ts +30 -0
- package/dist/components/tree-select.model.d.ts.map +1 -0
- package/dist/components/tree-select.model.js +33 -0
- package/dist/components/tree-select.rows.d.ts +18 -0
- package/dist/components/tree-select.rows.d.ts.map +1 -0
- package/dist/components/tree-select.rows.js +39 -0
- package/dist/components/truncate.d.ts +9 -0
- package/dist/components/truncate.d.ts.map +1 -0
- package/dist/components/truncate.js +31 -0
- package/dist/components/use-split-state.d.ts +17 -0
- package/dist/components/use-split-state.d.ts.map +1 -0
- package/dist/components/use-split-state.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/lib/aria.d.ts +4 -0
- package/dist/lib/aria.d.ts.map +1 -0
- package/dist/lib/aria.js +4 -0
- package/dist/lib/copy-text.d.ts +3 -0
- package/dist/lib/copy-text.d.ts.map +1 -0
- package/dist/lib/copy-text.js +20 -0
- package/dist/lib/cron.d.ts +13 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +131 -0
- package/dist/lib/cron.next.d.ts +9 -0
- package/dist/lib/cron.next.d.ts.map +1 -0
- package/dist/lib/cron.next.js +49 -0
- package/dist/lib/cron.text.d.ts +3 -0
- package/dist/lib/cron.text.d.ts.map +1 -0
- package/dist/lib/cron.text.js +61 -0
- package/dist/lib/drag-reorder.d.ts +33 -0
- package/dist/lib/drag-reorder.d.ts.map +1 -0
- package/dist/lib/drag-reorder.js +61 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/list-controls-storage.d.ts +7 -0
- package/dist/lib/list-controls-storage.d.ts.map +1 -0
- package/dist/lib/list-controls-storage.js +25 -0
- package/dist/lib/list-controls.d.ts +49 -0
- package/dist/lib/list-controls.d.ts.map +1 -0
- package/dist/lib/list-controls.js +44 -0
- package/dist/lib/list-navigation.d.ts +3 -0
- package/dist/lib/list-navigation.d.ts.map +1 -0
- package/dist/lib/list-navigation.js +7 -0
- package/dist/lib/overlay-layer.d.ts +32 -0
- package/dist/lib/overlay-layer.d.ts.map +1 -0
- package/dist/lib/overlay-layer.js +37 -0
- package/dist/lib/panel-sizes.d.ts +18 -0
- package/dist/lib/panel-sizes.d.ts.map +1 -0
- package/dist/lib/panel-sizes.js +25 -0
- package/dist/lib/relative-range.d.ts +23 -0
- package/dist/lib/relative-range.d.ts.map +1 -0
- package/dist/lib/relative-range.js +130 -0
- package/dist/lib/relative-time-format.d.ts +6 -0
- package/dist/lib/relative-time-format.d.ts.map +1 -0
- package/dist/lib/relative-time-format.js +21 -0
- package/dist/lib/split-px.d.ts +23 -0
- package/dist/lib/split-px.d.ts.map +1 -0
- package/dist/lib/split-px.js +30 -0
- package/dist/lib/table-sort.d.ts +11 -0
- package/dist/lib/table-sort.d.ts.map +1 -0
- package/dist/lib/table-sort.js +17 -0
- package/dist/lib/usage-level.d.ts +13 -0
- package/dist/lib/usage-level.d.ts.map +1 -0
- package/dist/lib/usage-level.js +12 -0
- package/dist/lib/use-anchor-position.d.ts +22 -0
- package/dist/lib/use-anchor-position.d.ts.map +1 -0
- package/dist/lib/use-anchor-position.js +41 -0
- package/dist/lib/use-announce.d.ts +6 -0
- package/dist/lib/use-announce.d.ts.map +1 -0
- package/dist/lib/use-announce.js +20 -0
- package/dist/lib/use-cell-stack.d.ts +8 -0
- package/dist/lib/use-cell-stack.d.ts.map +1 -0
- package/dist/lib/use-cell-stack.js +23 -0
- package/dist/lib/use-controlled.d.ts +8 -0
- package/dist/lib/use-controlled.d.ts.map +1 -0
- package/dist/lib/use-controlled.js +22 -0
- package/dist/lib/use-drag-reorder.d.ts +28 -0
- package/dist/lib/use-drag-reorder.d.ts.map +1 -0
- package/dist/lib/use-drag-reorder.js +100 -0
- package/dist/lib/use-flip.d.ts +8 -0
- package/dist/lib/use-flip.d.ts.map +1 -0
- package/dist/lib/use-flip.js +28 -0
- package/dist/lib/use-focus-origin.d.ts +9 -0
- package/dist/lib/use-focus-origin.d.ts.map +1 -0
- package/dist/lib/use-focus-origin.js +15 -0
- package/dist/lib/use-focus-restore.d.ts +7 -0
- package/dist/lib/use-focus-restore.d.ts.map +1 -0
- package/dist/lib/use-focus-restore.js +15 -0
- package/dist/lib/use-focus-trap.d.ts +5 -0
- package/dist/lib/use-focus-trap.d.ts.map +1 -0
- package/dist/lib/use-focus-trap.js +32 -0
- package/dist/lib/use-keep-focus.d.ts +4 -0
- package/dist/lib/use-keep-focus.d.ts.map +1 -0
- package/dist/lib/use-keep-focus.js +20 -0
- package/dist/lib/use-list-controls.d.ts +28 -0
- package/dist/lib/use-list-controls.d.ts.map +1 -0
- package/dist/lib/use-list-controls.js +72 -0
- package/dist/lib/use-mounted.d.ts +3 -0
- package/dist/lib/use-mounted.d.ts.map +1 -0
- package/dist/lib/use-mounted.js +8 -0
- package/dist/lib/use-persisted-state.d.ts +21 -0
- package/dist/lib/use-persisted-state.d.ts.map +1 -0
- package/dist/lib/use-persisted-state.js +52 -0
- package/dist/lib/use-roving-focus.d.ts +14 -0
- package/dist/lib/use-roving-focus.d.ts.map +1 -0
- package/dist/lib/use-roving-focus.js +36 -0
- package/dist/lib/use-scroll-lock.d.ts +6 -0
- package/dist/lib/use-scroll-lock.d.ts.map +1 -0
- package/dist/lib/use-scroll-lock.js +23 -0
- package/dist/lib/use-scroll-spy.d.ts +12 -0
- package/dist/lib/use-scroll-spy.d.ts.map +1 -0
- package/dist/lib/use-scroll-spy.js +34 -0
- package/dist/lib/utils.d.ts +12 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/package.json +457 -4
- package/src/styles/base.css +98 -0
- package/src/styles/primitives.css +143 -0
- package/src/styles/theme.css +10 -0
- package/src/styles/tokens.css +344 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Volodymyr Vreshch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,208 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agentage/components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
OKLCH design tokens and about 60 accessible React 19 components in one package. Install it, import
|
|
6
|
+
the theme, and you have a coherent dark/light UI kit - buttons through data views, stat cards,
|
|
7
|
+
dialogs and command palettes.
|
|
8
|
+
|
|
9
|
+
Browse every component live at **[ds.agentage.io](https://ds.agentage.io)**.
|
|
10
|
+
|
|
11
|
+
## Moving from `@agentage/design-system`
|
|
12
|
+
|
|
13
|
+
`@agentage/design-system` is frozen at 0.20.2 for the apps that still use it. To move to
|
|
14
|
+
`@agentage/components`:
|
|
15
|
+
|
|
16
|
+
1. Swap the package: `npm uninstall @agentage/design-system && npm install @agentage/components`.
|
|
17
|
+
2. Replace `@agentage/design-system` with `@agentage/components` in imports, in the CSS import
|
|
18
|
+
(`@agentage/components/theme.css`) and in the Tailwind `@source` glob
|
|
19
|
+
(`node_modules/@agentage/components/dist/**/*.js`). Subpaths keep their names.
|
|
20
|
+
3. Expect the denser look: 28 px buttons, 30 px fields, 36 px rows, flat 12/14 px cards. The
|
|
21
|
+
"Catalog review" page in the showcase lists every visual change.
|
|
22
|
+
4. The new package is smaller than 0.20.2: there are no deprecated names and no aliases. Replace
|
|
23
|
+
removed components as below; the "Catalog review" page lists every removed and renamed export.
|
|
24
|
+
|
|
25
|
+
| 0.20.2 | Use now |
|
|
26
|
+
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| `Modal`, `AlertDialog`, `ConfirmByTyping`, `DangerZone` | `Dialog` (`onConfirm`, `tone="destructive"`, `confirmText`), in a `Card` |
|
|
28
|
+
| `InspectorPanel` | `<Sheet mode="docked">` |
|
|
29
|
+
| `Combobox`, the Radix `Select` parts | `Select` with `options` (`searchable` for the search box) |
|
|
30
|
+
| `DataTable`, `EntityCard` | `DataView` (or `Table` parts); the Item card composition on the Card page |
|
|
31
|
+
| `EntityList` | `List` |
|
|
32
|
+
| `StatCard` `period`, `comparison`, `chart`, `facts` and co. | `hint`, `trend`, and children: `Sparkline`, `DescriptionList variant="inline"`, `Progress`, `StatusBar`; `CardMeta` in `footer` |
|
|
33
|
+
| `IconContainer` | `<Avatar shape="square" icon tone>` |
|
|
34
|
+
| Chart cards (Gauge, Donut, Score, Funnel, Heatmap and co.) | `StatCard` with `Sparkline` or `MiniBars` |
|
|
35
|
+
| `FilterBar`, `NavLink`, `PageLayout`, `StatusDot`, `UsageMeter` | `ListToolbar`, `NavRow`, `PageHeader`, `StatusGlyph`, `Progress meter` |
|
|
36
|
+
| `HoverCard`, `ContextMenu`, `Slider`, `QuotaBanner`, `ScrollArea`, `Separator`, `Heading` | `Popover`, `DropdownMenu`, `Input type="number"`, `Alert` with `Progress`, native overflow, a 1 px div, plain headings |
|
|
37
|
+
| `Footer`, `TopBar`, `DocSidebar`, `MarkdownRenderer`, the `./charts` and `./site` entries | removed (docs-site chrome); `CopyButton` stays |
|
|
38
|
+
|
|
39
|
+
## What is this?
|
|
40
|
+
|
|
41
|
+
The component library behind the Agentage dashboard, admin console and public sites, published as a
|
|
42
|
+
plain npm package so anything can use it.
|
|
43
|
+
|
|
44
|
+
It is deliberately unopinionated about your framework. It ships **standard ESM with one file per
|
|
45
|
+
component**, so tree-shaking works, and every interactive component already carries `'use client'`,
|
|
46
|
+
so it drops into a Next.js App Router server tree without wrappers or `dynamic()` tricks. Colors
|
|
47
|
+
are defined in [OKLCH](https://oklch.com), so the light and dark themes are perceptually matched
|
|
48
|
+
rather than hand-tuned, and contrast holds up under WCAG AA.
|
|
49
|
+
|
|
50
|
+
## Get started
|
|
51
|
+
|
|
52
|
+
### 1. Install
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install @agentage/components
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Peers: `react` and `react-dom` >= 19. `tailwindcss` >= 4 is an optional peer - the components
|
|
59
|
+
carry Tailwind utility classes, so you need it unless you ship your own compiled CSS.
|
|
60
|
+
|
|
61
|
+
### 2. Load the theme
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
// app/layout.tsx (or your root entry)
|
|
65
|
+
import '@agentage/components/theme.css';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Point Tailwind at the shipped bundle
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
/* globals.css - Tailwind v4, CSS-first config */
|
|
72
|
+
@import 'tailwindcss';
|
|
73
|
+
@import '@agentage/components/theme.css';
|
|
74
|
+
|
|
75
|
+
@source "../../node_modules/@agentage/components/dist/**/*.js";
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> Tailwind must scan the **shipped JS**, not the source, or every component class is
|
|
79
|
+
> tree-shaken out of your build. The glob has to resolve to wherever npm actually hoisted the
|
|
80
|
+
> package - in a workspace that is the repo-root `node_modules`, not the package-local one. This
|
|
81
|
+
> is the single most common cause of "the components render unstyled".
|
|
82
|
+
|
|
83
|
+
### 4. Use it
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { Button, Card, CardHeader, CardTitle, StatCard } from '@agentage/components';
|
|
87
|
+
|
|
88
|
+
export const Panel = () => (
|
|
89
|
+
<Card>
|
|
90
|
+
<CardHeader>
|
|
91
|
+
<CardTitle>Storage</CardTitle>
|
|
92
|
+
</CardHeader>
|
|
93
|
+
<StatCard title="Stored" value="12,480" hint="64% of the plan" />
|
|
94
|
+
<Button>Open</Button>
|
|
95
|
+
</Card>
|
|
96
|
+
);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Full walkthrough: [ds.agentage.io/install](https://ds.agentage.io/install).
|
|
100
|
+
|
|
101
|
+
## What's in it
|
|
102
|
+
|
|
103
|
+
56 documented component pages in seven categories plus 11 patterns, each with props generated from
|
|
104
|
+
the source. The **Core** set (Button, Card, Input, Select, List, DataView, Dialog, Toast and more)
|
|
105
|
+
sits at the top of the docs sidebar.
|
|
106
|
+
|
|
107
|
+
| Category | What's there |
|
|
108
|
+
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
109
|
+
| [Foundations](https://ds.agentage.io/components/foundations) (10) | Button, IconButton, Badge, Chip, Avatar, Kbd, Skeleton and Spinner, StatusGlyph and PriorityGlyph, Prose, CopyButton |
|
|
110
|
+
| [Forms](https://ds.agentage.io/components/forms) (11) | Input and Textarea, SecretInput, Select, TreeSelect, DatePicker, Checkbox and Switch, RadioGroup, ToggleGroup, FormField and Label, Section, InlineEdit |
|
|
111
|
+
| [Navigation](https://ds.agentage.io/components/navigation) (6) | NavRow and NavTree, Sidebar, Tabs, Breadcrumb, SectionIndex, PageHeader |
|
|
112
|
+
| [Lists and data](https://ds.agentage.io/components/lists) (6) | List (with GroupHeader), Table and Pagination, DataView, ListToolbar, LogView, DataTree |
|
|
113
|
+
| [Display](https://ds.agentage.io/components/display) (12) | Card, StatCard, Sparkline, DescriptionList, Progress, StatusBar, RelativeTime, CodeBlock, ContentBlocks, EmptyState, Accordion and Collapsible, StepList and CheckList |
|
|
114
|
+
| [Overlays](https://ds.agentage.io/components/overlays) (7) | Dialog, Sheet, Popover, Tooltip, DropdownMenu, Command palette, Resizable panels |
|
|
115
|
+
| [Feedback](https://ds.agentage.io/components/feedback) (4) | Alert, Toast, DirtyBar, ActionBar |
|
|
116
|
+
| [Patterns](https://ds.agentage.io/components/patterns) (11) | List page, card grid, catalog with views, board, master and detail, detail view, history, settings form, logs explorer, file browser, monitoring |
|
|
117
|
+
|
|
118
|
+
Beside the pages, composable parts (`CardHeader`, `TableRow`, `CommandItem` and friends) are
|
|
119
|
+
exported too. Only the modules the barrel re-exports have a subpath in the
|
|
120
|
+
[exports map](./package.json); parts files and helpers stay internal.
|
|
121
|
+
|
|
122
|
+
## Server components
|
|
123
|
+
|
|
124
|
+
Every interactive component ships `'use client'` as line 1 of its emitted module, and the build
|
|
125
|
+
preserves one output file per source module. So the barrel is safe to import from a React Server
|
|
126
|
+
Component - only the components you actually use that need the client runtime cross the boundary.
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { Card } from '@agentage/components/card'; // server-safe
|
|
130
|
+
import { Dialog } from '@agentage/components/dialog'; // 'use client', already declared
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
No server-safe module transitively imports a client module, so importing `Card` never drags a
|
|
134
|
+
client boundary into your server tree. Per-component subpaths exist for consumers who want to keep
|
|
135
|
+
that graph explicit; the barrel works too.
|
|
136
|
+
|
|
137
|
+
## Theming
|
|
138
|
+
|
|
139
|
+
Three tiers, composed by `theme.css`:
|
|
140
|
+
|
|
141
|
+
| Layer | Import | What it holds |
|
|
142
|
+
| ---------------- | ------------------------------------- | --------------------------------------------------- |
|
|
143
|
+
| `primitives.css` | `@agentage/components/primitives.css` | Raw OKLCH scales - 11 stops each, theme-independent |
|
|
144
|
+
| `tokens.css` | via `theme.css` | Semantic tokens, typography, shadows |
|
|
145
|
+
| `base.css` | via `theme.css` | Element resets |
|
|
146
|
+
|
|
147
|
+
Dark is the default. Switch with one attribute on `<html>`:
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
document.documentElement.setAttribute('data-theme', 'light'); // dark | light | system
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`system` follows `prefers-color-scheme`. Override any semantic token in your own CSS to rebrand
|
|
154
|
+
without forking - see [ds.agentage.io/theming](https://ds.agentage.io/theming).
|
|
155
|
+
|
|
156
|
+
## Requirements
|
|
157
|
+
|
|
158
|
+
| Requirement | Version | Note |
|
|
159
|
+
| ----------- | ------- | --------------------------------------------------- |
|
|
160
|
+
| React | >= 19 | Peer, required |
|
|
161
|
+
| React DOM | >= 19 | Peer, required |
|
|
162
|
+
| Tailwind | >= 4 | Optional peer - needed unless you ship your own CSS |
|
|
163
|
+
| Node | >= 22 | Build/dev only; the package itself is browser code |
|
|
164
|
+
|
|
165
|
+
Ships ESM only, with a `.d.ts` beside every module.
|
|
166
|
+
|
|
167
|
+
## Develop
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm install
|
|
171
|
+
npm run dev # component showcase (Vite) on :5174
|
|
172
|
+
npm run verify # type-check + lint + format + exports:check + test + build
|
|
173
|
+
npm run test:e2e # Playwright: axe WCAG A/AA scan + screenshot baselines
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
- `src/components` - the components, barrel-exported from `src/index.ts`. Add `'use client'` as
|
|
177
|
+
line 1 to anything using state, effects, refs, context, portals, DOM APIs or event handlers.
|
|
178
|
+
- `src/styles` - the OKLCH token and base-style CSS.
|
|
179
|
+
- `src/lib` - `cn` and helpers.
|
|
180
|
+
- `dev/` - the showcase deployed to ds.agentage.io.
|
|
181
|
+
|
|
182
|
+
Run `npm run exports:generate` after adding or renaming a component; `exports:check` fails
|
|
183
|
+
`verify` when the exports map drifts.
|
|
184
|
+
|
|
185
|
+
Regenerate Playwright screenshot baselines inside the CI image, never on the host - font metrics
|
|
186
|
+
must match:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
docker run --rm --ipc=host -v "$PWD":/work -w /work -u "$(id -u):$(id -g)" -e HOME=/tmp \
|
|
190
|
+
mcr.microsoft.com/playwright:v1.65.1-noble npx playwright test --update-snapshots
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Release
|
|
194
|
+
|
|
195
|
+
`prepare-release.yml` (dispatched, or run by hand) opens a `chore(release): X.Y.Z` PR and arms
|
|
196
|
+
auto-merge; on the merge `release.yml` runs `verify`, publishes with
|
|
197
|
+
`npm publish --access public --provenance` through npm trusted publishing (OIDC, no token) and tags
|
|
198
|
+
`vX.Y.Z`.
|
|
199
|
+
|
|
200
|
+
## Contributing
|
|
201
|
+
|
|
202
|
+
Issues and PRs welcome at
|
|
203
|
+
[github.com/agentage/components](https://github.com/agentage/components). Branch off
|
|
204
|
+
`master`, keep `npm run verify` green, and add a test when you change interactive behavior.
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT - see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AccordionContextValue {
|
|
2
|
+
openItems: string[];
|
|
3
|
+
toggle: (value: string) => void;
|
|
4
|
+
variant: 'default' | 'section';
|
|
5
|
+
level?: 2 | 3 | 4;
|
|
6
|
+
/** True for the frame a stored value is applied: bodies skip the collapse animation. */
|
|
7
|
+
restoring?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const AccordionContext: import('react').Context<AccordionContextValue>;
|
|
10
|
+
export interface AccordionItemContextValue {
|
|
11
|
+
value: string;
|
|
12
|
+
triggerId: string;
|
|
13
|
+
contentId: string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const AccordionItemContext: import('react').Context<AccordionItemContextValue>;
|
|
17
|
+
//# sourceMappingURL=accordion.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.context.d.ts","sourceRoot":"","sources":["../../src/components/accordion.context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,gDAI3B,CAAC;AAEH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,oDAK/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e } from "react";
|
|
3
|
+
// src/components/accordion.context.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
openItems: [],
|
|
6
|
+
toggle: () => {},
|
|
7
|
+
variant: "default"
|
|
8
|
+
}), n = e({
|
|
9
|
+
value: "",
|
|
10
|
+
triggerId: "",
|
|
11
|
+
contentId: "",
|
|
12
|
+
disabled: !1
|
|
13
|
+
});
|
|
14
|
+
export { t as AccordionContext, n as AccordionItemContext };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export { AccordionTrigger } from './accordion.trigger.js';
|
|
3
|
+
export type { AccordionTriggerProps } from './accordion.trigger.js';
|
|
4
|
+
export interface AccordionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
|
|
5
|
+
/** `single` keeps at most one item open; `multiple` any number. Defaults to `single`. */
|
|
6
|
+
type?: 'single' | 'multiple';
|
|
7
|
+
/** Item values open at first. */
|
|
8
|
+
defaultValue?: string[];
|
|
9
|
+
/** Keep the open items in localStorage under this key. */
|
|
10
|
+
storageKey?: string;
|
|
11
|
+
/** `default` rows divided by rules; `section` 32 px section headers (icon, title, summary). */
|
|
12
|
+
variant?: 'default' | 'section';
|
|
13
|
+
/** Wraps each trigger in a heading of this level; the look stays the same. */
|
|
14
|
+
level?: 2 | 3 | 4;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/** A set of collapsible items, one or many open; Up, Down, Home and End move between headers. */
|
|
18
|
+
export declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
value: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const AccordionItem: ({ value, children, className, disabled, ...props }: AccordionItemProps) => React.JSX.Element;
|
|
25
|
+
export type AccordionContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
26
|
+
export declare const AccordionContent: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAOjE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChG,yFAAyF;IACzF,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkBD,iGAAiG;AACjG,eAAO,MAAM,SAAS,uFA6DrB,CAAC;AAGF,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,oDAM3B,kBAAkB,KAAG,KAAK,CAAC,GAAG,CAAC,OAwBjC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEzE,eAAO,MAAM,gBAAgB,8FA2B5B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { AccordionContext as e, AccordionItemContext as t } from "./accordion.context.js";
|
|
3
|
+
import { nextListIndex as n } from "../lib/list-navigation.js";
|
|
4
|
+
import { useControlled as r } from "../lib/use-controlled.js";
|
|
5
|
+
import { cn as i } from "../lib/utils.js";
|
|
6
|
+
import { Disclosure as a } from "./disclosure.js";
|
|
7
|
+
import { AccordionTrigger as o } from "./accordion.trigger.js";
|
|
8
|
+
import * as s from "react";
|
|
9
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
10
|
+
// src/components/accordion.tsx
|
|
11
|
+
var l = (e) => Array.isArray(e) && e.every((e) => typeof e == "string"), u = "[data-slot=\"accordion-trigger\"]:not(:disabled)", d = (e) => Array.from(e.querySelectorAll(u)).filter((t) => t.closest("[data-slot=\"accordion\"]") === e && !t.closest("[inert]")), f = (e, t) => {
|
|
12
|
+
let r = t.target;
|
|
13
|
+
if (t.defaultPrevented || !r.matches(u)) return;
|
|
14
|
+
let i = d(e), a = n(t.key, i.indexOf(r), i.length, !1);
|
|
15
|
+
a !== null && i.includes(r) && (t.preventDefault(), i[a]?.focus());
|
|
16
|
+
}, p = s.forwardRef(({ type: t = "single", defaultValue: n = [], storageKey: a, variant: o = "default", level: u, className: d, children: p, ...m }, h) => {
|
|
17
|
+
let g = s.useRef(null);
|
|
18
|
+
s.useImperativeHandle(h, () => g.current), s.useEffect(() => {
|
|
19
|
+
let e = g.current;
|
|
20
|
+
if (!e) return;
|
|
21
|
+
let t = (t) => f(e, t);
|
|
22
|
+
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
23
|
+
}, []);
|
|
24
|
+
let [_, v, y] = r(void 0, n, void 0, a, l), b = s.useCallback((e) => {
|
|
25
|
+
let n = _.includes(e);
|
|
26
|
+
v(t === "single" ? n ? [] : [e] : n ? _.filter((t) => t !== e) : [..._, e]);
|
|
27
|
+
}, [
|
|
28
|
+
t,
|
|
29
|
+
_,
|
|
30
|
+
v
|
|
31
|
+
]), x = s.useMemo(() => ({
|
|
32
|
+
openItems: _,
|
|
33
|
+
toggle: b,
|
|
34
|
+
variant: o,
|
|
35
|
+
level: u,
|
|
36
|
+
restoring: y
|
|
37
|
+
}), [
|
|
38
|
+
_,
|
|
39
|
+
b,
|
|
40
|
+
o,
|
|
41
|
+
u,
|
|
42
|
+
y
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ c(e.Provider, {
|
|
45
|
+
value: x,
|
|
46
|
+
children: /* @__PURE__ */ c("div", {
|
|
47
|
+
ref: g,
|
|
48
|
+
className: i(o === "section" ? "border-t border-border" : "divide-y divide-border", d),
|
|
49
|
+
"data-slot": "accordion",
|
|
50
|
+
"data-variant": o === "section" ? "section" : void 0,
|
|
51
|
+
...m,
|
|
52
|
+
children: p
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
p.displayName = "Accordion";
|
|
57
|
+
var m = ({ value: n, children: r, className: a, disabled: o = !1, ...l }) => {
|
|
58
|
+
let { openItems: u, variant: d } = s.useContext(e), f = u.includes(n), p = s.useId();
|
|
59
|
+
return /* @__PURE__ */ c(t.Provider, {
|
|
60
|
+
value: {
|
|
61
|
+
value: n,
|
|
62
|
+
disabled: o,
|
|
63
|
+
triggerId: `${p}-trigger`,
|
|
64
|
+
contentId: `${p}-content`
|
|
65
|
+
},
|
|
66
|
+
children: /* @__PURE__ */ c("div", {
|
|
67
|
+
className: i(d === "section" && "border-b border-border", a),
|
|
68
|
+
"data-state": f ? "open" : "closed",
|
|
69
|
+
"data-slot": "accordion-item",
|
|
70
|
+
...l,
|
|
71
|
+
children: r
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}, h = s.forwardRef(({ className: n, children: r, ...o }, l) => {
|
|
75
|
+
let { openItems: u, variant: d, restoring: f } = s.useContext(e), { value: p, triggerId: m, contentId: h } = s.useContext(t), g = u.includes(p);
|
|
76
|
+
return /* @__PURE__ */ c(a, {
|
|
77
|
+
ref: l,
|
|
78
|
+
open: g,
|
|
79
|
+
bodyClassName: f ? "transition-none" : void 0,
|
|
80
|
+
id: h || void 0,
|
|
81
|
+
role: "region",
|
|
82
|
+
"aria-labelledby": m || void 0,
|
|
83
|
+
className: i(d === "section" ? "flex flex-col gap-2.5 px-1 pb-4 pt-0.5 text-ui" : "px-2 pb-3 text-ui text-muted-foreground", n),
|
|
84
|
+
"data-slot": "accordion-content",
|
|
85
|
+
...o,
|
|
86
|
+
children: r
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
h.displayName = "AccordionContent";
|
|
90
|
+
export { p as Accordion, h as AccordionContent, m as AccordionItem, o as AccordionTrigger };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface AccordionTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** Quiet count after the label. */
|
|
4
|
+
count?: React.ReactNode;
|
|
5
|
+
/** Leading 14 px glyph after the chevron. */
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
/** Right-aligned muted text: a path, a version, "3 items". */
|
|
8
|
+
summary?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
//# sourceMappingURL=accordion.trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.trigger.d.ts","sourceRoot":"","sources":["../../src/components/accordion.trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC1F,mCAAmC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAaD,eAAO,MAAM,gBAAgB,iGAwC5B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { AccordionContext as e, AccordionItemContext as t } from "./accordion.context.js";
|
|
3
|
+
import { cn as n } from "../lib/utils.js";
|
|
4
|
+
import { Count as r } from "./count.js";
|
|
5
|
+
import { DisclosureChevron as i } from "./disclosure.js";
|
|
6
|
+
import * as a from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
// src/components/accordion.trigger.tsx
|
|
9
|
+
var c = [
|
|
10
|
+
"flex w-full items-center gap-2 rounded-md text-ui text-foreground cursor-pointer text-left",
|
|
11
|
+
"transition-colors duration-fast hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",
|
|
12
|
+
"hover:[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]",
|
|
13
|
+
"focus-ring"
|
|
14
|
+
], l = {
|
|
15
|
+
default: "min-h-9 px-2 py-1.5 font-medium",
|
|
16
|
+
section: "h-8 px-1 font-semibold"
|
|
17
|
+
}, u = a.forwardRef(({ className: u, children: d, count: f, icon: p, summary: m, disabled: h, ...g }, _) => {
|
|
18
|
+
let { toggle: v, openItems: y, variant: b, level: x } = a.useContext(e), S = a.useContext(t), C = y.includes(S.value), w = /* @__PURE__ */ s("button", {
|
|
19
|
+
ref: _,
|
|
20
|
+
type: "button",
|
|
21
|
+
id: S.triggerId || void 0,
|
|
22
|
+
onClick: () => v(S.value),
|
|
23
|
+
"aria-expanded": C,
|
|
24
|
+
"aria-controls": S.contentId || void 0,
|
|
25
|
+
disabled: h ?? S.disabled,
|
|
26
|
+
className: n(c, l[b], u),
|
|
27
|
+
"data-slot": "accordion-trigger",
|
|
28
|
+
...g,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ o(i, { open: C }),
|
|
31
|
+
p && /* @__PURE__ */ o("span", {
|
|
32
|
+
className: "flex shrink-0 text-muted-foreground [&_svg]:size-3.5",
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
children: p
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ s("span", {
|
|
37
|
+
className: n("min-w-0 flex-1", b === "section" && "truncate"),
|
|
38
|
+
children: [d, f !== void 0 && /* @__PURE__ */ o(r, {
|
|
39
|
+
className: "ml-2",
|
|
40
|
+
children: f
|
|
41
|
+
})]
|
|
42
|
+
}),
|
|
43
|
+
m !== void 0 && /* @__PURE__ */ o("span", {
|
|
44
|
+
className: "min-w-0 shrink truncate pl-2 text-xs font-medium text-muted-foreground",
|
|
45
|
+
children: m
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
if (!x) return w;
|
|
50
|
+
let T = `h${String(x)}`;
|
|
51
|
+
return /* @__PURE__ */ o(T, {
|
|
52
|
+
className: "m-0 text-[length:inherit] font-[inherit]",
|
|
53
|
+
children: w
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
u.displayName = "AccordionTrigger";
|
|
57
|
+
export { u as AccordionTrigger };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ActionBarAction } from './action-bar.parts.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type { ActionBarAction } from './action-bar.parts.js';
|
|
4
|
+
export interface ActionBarMenu {
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
kbd?: string;
|
|
8
|
+
/** DropdownMenu items. */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface ActionBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
|
+
/** Main actions in order; the first one never collapses. */
|
|
13
|
+
actions: ActionBarAction[];
|
|
14
|
+
/** One action that opens a menu, for example Assign. */
|
|
15
|
+
menu?: ActionBarMenu;
|
|
16
|
+
/** Quiet actions pushed to the right edge; the first to collapse into More. */
|
|
17
|
+
tail?: ActionBarAction[];
|
|
18
|
+
/** Listen for the `kbd` keys (ignored while typing): in `hotkeyScope` when given, else the document. */
|
|
19
|
+
hotkeys?: boolean;
|
|
20
|
+
/** Element whose key presses trigger the actions, for example the pane; keeps keys local. */
|
|
21
|
+
hotkeyScope?: React.RefObject<HTMLElement | null>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The 51 px action row at the bottom of a pane: actions with key hints, a menu action and a
|
|
25
|
+
* right-aligned tail. When the pane is narrow, the tail, then the secondary actions, then the menu
|
|
26
|
+
* action move into a More menu; the row never wraps.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ActionBar: React.ForwardRefExoticComponent<ActionBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
//# sourceMappingURL=action-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../src/components/action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAS5B,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5F,4DAA4D;IAC5D,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,wDAAwD;IACxD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,eAAe,EAAE,CAAC;IACzB,wGAAwG;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACnD;AAuBD;;;;GAIG;AACH,eAAO,MAAM,SAAS,uFA6FrB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { ActionButton as t, ActionKbd as n, useFitLevel as r, useHotkeys as i } from "./action-bar.parts.js";
|
|
4
|
+
import { DropdownMenuItem as a, DropdownMenuLabel as o, DropdownMenuSeparator as s } from "./dropdown-menu.items.js";
|
|
5
|
+
import { Button as c } from "./button.js";
|
|
6
|
+
import { DropdownMenu as l } from "./dropdown-menu.js";
|
|
7
|
+
import * as u from "react";
|
|
8
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
// src/components/action-bar.tsx
|
|
10
|
+
var m = () => /* @__PURE__ */ p("svg", {
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
className: "fill-current",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ f("circle", {
|
|
16
|
+
cx: "5",
|
|
17
|
+
cy: "12",
|
|
18
|
+
r: "1.6"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ f("circle", {
|
|
21
|
+
cx: "12",
|
|
22
|
+
cy: "12",
|
|
23
|
+
r: "1.6"
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ f("circle", {
|
|
26
|
+
cx: "19",
|
|
27
|
+
cy: "12",
|
|
28
|
+
r: "1.6"
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}), h = (e, t) => /* @__PURE__ */ p(a, {
|
|
32
|
+
icon: e.icon,
|
|
33
|
+
disabled: e.disabled,
|
|
34
|
+
onClick: e.onSelect,
|
|
35
|
+
variant: e.variant === "destructive" ? "destructive" : "default",
|
|
36
|
+
children: [/* @__PURE__ */ f("span", {
|
|
37
|
+
className: "flex-1 text-left",
|
|
38
|
+
children: e.label
|
|
39
|
+
}), t && e.kbd && /* @__PURE__ */ f(n, { children: e.kbd })]
|
|
40
|
+
}, e.id), g = u.forwardRef(({ actions: a, menu: g, tail: _ = [], hotkeys: v = !1, hotkeyScope: y, className: b, ...x }, S) => {
|
|
41
|
+
let C = u.useRef(null);
|
|
42
|
+
u.useImperativeHandle(S, () => C.current);
|
|
43
|
+
let w = [...a, ..._].map((e) => `${e.id}:${e.label}`).join(","), T = r(C, `${w}|${g?.label ?? ""}`), [E, D] = u.useState(!1), O = g?.kbd && T < 3 ? [{
|
|
44
|
+
id: "action-bar-menu",
|
|
45
|
+
label: g.label,
|
|
46
|
+
kbd: g.kbd,
|
|
47
|
+
onSelect: () => D(!0)
|
|
48
|
+
}] : [];
|
|
49
|
+
i(v, [
|
|
50
|
+
...a,
|
|
51
|
+
..._,
|
|
52
|
+
...O
|
|
53
|
+
], y, C);
|
|
54
|
+
let k = v ? g?.kbd : void 0, [A, ...j] = a, M = T >= 2 ? [] : j, N = T >= 1 ? [] : _, P = [...T >= 2 ? j : [], ...T >= 1 ? _ : []];
|
|
55
|
+
return /* @__PURE__ */ p("div", {
|
|
56
|
+
ref: C,
|
|
57
|
+
role: "toolbar",
|
|
58
|
+
"aria-label": x["aria-label"] ?? "Actions",
|
|
59
|
+
className: e("sticky bottom-0 flex h-[51px] flex-none flex-nowrap items-center gap-2 overflow-hidden border-t border-border bg-background px-4 py-2.5", b),
|
|
60
|
+
"data-slot": "action-bar",
|
|
61
|
+
"data-level": T,
|
|
62
|
+
...x,
|
|
63
|
+
children: [
|
|
64
|
+
A && /* @__PURE__ */ f(t, {
|
|
65
|
+
action: A,
|
|
66
|
+
hotkeys: v
|
|
67
|
+
}),
|
|
68
|
+
M.map((e) => /* @__PURE__ */ f(t, {
|
|
69
|
+
action: e,
|
|
70
|
+
hotkeys: v
|
|
71
|
+
}, e.id)),
|
|
72
|
+
g && T < 3 && /* @__PURE__ */ f(l, {
|
|
73
|
+
align: "start",
|
|
74
|
+
side: "top",
|
|
75
|
+
open: E,
|
|
76
|
+
onOpenChange: D,
|
|
77
|
+
trigger: /* @__PURE__ */ p(c, {
|
|
78
|
+
variant: "outline",
|
|
79
|
+
"aria-keyshortcuts": k,
|
|
80
|
+
className: "flex-none",
|
|
81
|
+
children: [
|
|
82
|
+
g.icon,
|
|
83
|
+
g.label,
|
|
84
|
+
k && /* @__PURE__ */ f(n, { children: k })
|
|
85
|
+
]
|
|
86
|
+
}),
|
|
87
|
+
children: g.children
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ p("div", {
|
|
90
|
+
className: "ml-auto flex flex-none items-center gap-1",
|
|
91
|
+
"data-slot": "action-bar-tail",
|
|
92
|
+
children: [N.map((e) => /* @__PURE__ */ f(t, {
|
|
93
|
+
action: {
|
|
94
|
+
variant: "ghost",
|
|
95
|
+
...e
|
|
96
|
+
},
|
|
97
|
+
hotkeys: v
|
|
98
|
+
}, e.id)), (P.length > 0 || g && T >= 3) && /* @__PURE__ */ p(l, {
|
|
99
|
+
side: "top",
|
|
100
|
+
"aria-label": "More",
|
|
101
|
+
trigger: /* @__PURE__ */ f(c, {
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
size: "icon",
|
|
104
|
+
"aria-label": "More",
|
|
105
|
+
title: "More",
|
|
106
|
+
children: /* @__PURE__ */ f(m, {})
|
|
107
|
+
}),
|
|
108
|
+
children: [g && T >= 3 && /* @__PURE__ */ p(d, { children: [
|
|
109
|
+
/* @__PURE__ */ f(o, { children: g.label }),
|
|
110
|
+
g.children,
|
|
111
|
+
/* @__PURE__ */ f(s, {})
|
|
112
|
+
] }), P.map((e, t) => /* @__PURE__ */ p(u.Fragment, { children: [t > 0 && T >= 2 && t === j.length && /* @__PURE__ */ f(s, {}), h(e, v)] }, e.id))]
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
g.displayName = "ActionBar";
|
|
119
|
+
export { g as ActionBar };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ActionBarAction {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onSelect?: () => void;
|
|
6
|
+
/** Key hint drawn in the button, for example "A"; also set as `aria-keyshortcuts`. */
|
|
7
|
+
kbd?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** `primary` filled, `default` bordered, `destructive` bordered red text, `ghost` quiet. */
|
|
10
|
+
variant?: 'primary' | 'default' | 'destructive' | 'ghost';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Key hint inside a button: the one Kbd size; only colour and border follow the button. */
|
|
14
|
+
export declare const ActionKbd: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
15
|
+
export declare const ActionButton: React.ForwardRefExoticComponent<{
|
|
16
|
+
action: ActionBarAction;
|
|
17
|
+
hotkeys?: boolean;
|
|
18
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
/** Collapse level that fits: 0 all shown, 1 tail in More, 2 also secondary actions, 3 also the menu. */
|
|
20
|
+
export declare const useFitLevel: (ref: React.RefObject<HTMLDivElement | null>, key: string) => number;
|
|
21
|
+
/** Single-key shortcuts for the bar's actions; ignored while typing, in menus and on key repeat. */
|
|
22
|
+
export declare const useHotkeys: (enabled: boolean, actions: ActionBarAction[], scope?: React.RefObject<HTMLElement | null>, owner?: React.RefObject<HTMLElement | null>) => void;
|
|
23
|
+
//# sourceMappingURL=action-bar.parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-bar.parts.d.ts","sourceRoot":"","sources":["../../src/components/action-bar.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AASD,4FAA4F;AAC5F,eAAO,MAAM,SAAS,uGASrB,CAAC;AAGF,eAAO,MAAM,YAAY;YAEb,eAAe;cAAY,OAAO;2FAqB5C,CAAC;AAYH,wGAAwG;AACxG,eAAO,MAAM,WAAW,GAAI,KAAK,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,KAAK,MAAM,WA2BnF,CAAC;AAaF,oGAAoG;AACpG,eAAO,MAAM,UAAU,GACrB,SAAS,OAAO,EAChB,SAAS,eAAe,EAAE,EAC1B,QAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3C,QAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,SAoB5C,CAAC"}
|