@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { copyText as e } from "../lib/copy-text.js";
|
|
3
|
+
import { cn as t } from "../lib/utils.js";
|
|
4
|
+
import { buttonVariants as n } from "./button.variants.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
// src/components/copy-button.tsx
|
|
9
|
+
var s = ({ className: e }) => /* @__PURE__ */ o("svg", {
|
|
10
|
+
className: e,
|
|
11
|
+
width: "14",
|
|
12
|
+
height: "14",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
fill: "none",
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeWidth: "2",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round",
|
|
19
|
+
children: [/* @__PURE__ */ a("rect", {
|
|
20
|
+
width: "14",
|
|
21
|
+
height: "14",
|
|
22
|
+
x: "8",
|
|
23
|
+
y: "8",
|
|
24
|
+
rx: "2",
|
|
25
|
+
ry: "2"
|
|
26
|
+
}), /* @__PURE__ */ a("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
|
|
27
|
+
}), c = ({ className: e }) => /* @__PURE__ */ a("svg", {
|
|
28
|
+
className: e,
|
|
29
|
+
width: "14",
|
|
30
|
+
height: "14",
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "2",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
children: /* @__PURE__ */ a("polyline", { points: "20 6 9 17 4 12" })
|
|
38
|
+
}), l = ({ className: e }) => /* @__PURE__ */ o("svg", {
|
|
39
|
+
className: e,
|
|
40
|
+
width: "14",
|
|
41
|
+
height: "14",
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
children: [/* @__PURE__ */ a("circle", {
|
|
49
|
+
cx: "12",
|
|
50
|
+
cy: "12",
|
|
51
|
+
r: "10"
|
|
52
|
+
}), /* @__PURE__ */ a("path", { d: "M12 8v4M12 16h.01" })]
|
|
53
|
+
}), u = r.forwardRef(({ text: r, label: u = "Copy", successLabel: d = "Copied", errorLabel: f = "Failed", duration: p = 1500, iconOnly: m = !1, variant: h = "outline", size: g, className: _, onClick: v, ...y }, b) => {
|
|
54
|
+
let [x, S] = i("idle"), C = x === "copied", w = x === "error", T = async (t) => {
|
|
55
|
+
if (v?.(t), t.defaultPrevented) return;
|
|
56
|
+
let n = await e(r);
|
|
57
|
+
S(n ? "copied" : "error"), setTimeout(() => S("idle"), p);
|
|
58
|
+
}, E = C ? d : w ? f : u, D = m ? "size-3.5" : void 0;
|
|
59
|
+
return /* @__PURE__ */ o("button", {
|
|
60
|
+
ref: b,
|
|
61
|
+
type: "button",
|
|
62
|
+
className: t(n({
|
|
63
|
+
variant: h,
|
|
64
|
+
size: m ? "icon-sm" : g ?? "sm"
|
|
65
|
+
}), _),
|
|
66
|
+
onClick: T,
|
|
67
|
+
"aria-label": m ? E : void 0,
|
|
68
|
+
"data-slot": "copy-button",
|
|
69
|
+
"data-copied": C || void 0,
|
|
70
|
+
"data-error": w || void 0,
|
|
71
|
+
...y,
|
|
72
|
+
children: [a(C ? c : w ? l : s, { className: D }), !m && /* @__PURE__ */ o("span", {
|
|
73
|
+
className: "inline-grid",
|
|
74
|
+
"aria-live": "polite",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ a("span", {
|
|
77
|
+
className: t("col-start-1 row-start-1", x !== "idle" && "invisible"),
|
|
78
|
+
"aria-hidden": x !== "idle" || void 0,
|
|
79
|
+
children: u
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ a("span", {
|
|
82
|
+
className: t("col-start-1 row-start-1", !C && "invisible"),
|
|
83
|
+
"aria-hidden": !C || void 0,
|
|
84
|
+
children: d
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ a("span", {
|
|
87
|
+
className: t("col-start-1 row-start-1", !w && "invisible"),
|
|
88
|
+
"aria-hidden": !w || void 0,
|
|
89
|
+
children: f
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
u.displayName = "CopyButton";
|
|
96
|
+
export { u as CopyButton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CountProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
3
|
+
/** The quiet number beside a label: tabs, group headers, navigation rows. */
|
|
4
|
+
export declare const Count: React.ForwardRefExoticComponent<CountProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
//# sourceMappingURL=count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../src/components/count.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAE/D,6EAA6E;AAC7E,eAAO,MAAM,KAAK,oFASjB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
// src/components/count.tsx
|
|
5
|
+
var r = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("span", {
|
|
6
|
+
ref: i,
|
|
7
|
+
className: e("shrink-0 text-xs font-normal tabular-nums text-muted-foreground", t),
|
|
8
|
+
"data-slot": "count",
|
|
9
|
+
...r
|
|
10
|
+
}));
|
|
11
|
+
r.displayName = "Count";
|
|
12
|
+
export { r as Count };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DataTableDensity, DataTableGroupSlice } from './data-table.group.js';
|
|
2
|
+
import { SelectionState } from './data-table.selection.js';
|
|
3
|
+
import { DataTableColumn } from './data-table.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
export interface BodyOptions<T> {
|
|
6
|
+
columns: DataTableColumn<T>[];
|
|
7
|
+
density: DataTableDensity;
|
|
8
|
+
rowLines: 1 | 2;
|
|
9
|
+
rowKey?: (row: T, index: number) => string;
|
|
10
|
+
rowHref?: (row: T) => string | undefined;
|
|
11
|
+
onRowClick?: (row: T) => void;
|
|
12
|
+
rowActions?: (row: T) => React.ReactNode;
|
|
13
|
+
rowMenu?: (row: T) => React.ReactNode;
|
|
14
|
+
rowMenuLabel?: (row: T) => string;
|
|
15
|
+
isRowSelected?: (row: T) => boolean;
|
|
16
|
+
selection?: SelectionState;
|
|
17
|
+
/** Accessible name of a row, for its select checkbox. */
|
|
18
|
+
rowLabel?: (row: T) => string;
|
|
19
|
+
}
|
|
20
|
+
export interface GroupedBodyProps<T> extends BodyOptions<T> {
|
|
21
|
+
/** `null` renders the rows without group headers. */
|
|
22
|
+
groups: DataTableGroupSlice<T>[] | null;
|
|
23
|
+
rows: T[];
|
|
24
|
+
collapsed: string[];
|
|
25
|
+
onToggleGroup: (key: string) => void;
|
|
26
|
+
columnCount: number;
|
|
27
|
+
groupIcon?: (key: string) => React.ReactNode;
|
|
28
|
+
onAddToGroup?: (key: string) => void;
|
|
29
|
+
addToGroupLabel?: (label: string) => string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One flat list of sibling rows with group headers between them: a regroup or a sort moves the
|
|
33
|
+
* existing row nodes instead of re-creating them.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DataTableRows: <T>({ groups, rows, collapsed, onToggleGroup, columnCount, groupIcon, onAddToGroup, addToGroupLabel, ...o }: GroupedBodyProps<T>) => React.JSX.Element[];
|
|
36
|
+
//# sourceMappingURL=data-table.body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.body.d.ts","sourceRoot":"","sources":["../../src/components/data-table.body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAW,MAAM,oBAAoB,CAAC;AAI9F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAClC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;CAC/B;AA+GD,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACzD,qDAAqD;IACrD,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;IACxC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,yGAU/B,gBAAgB,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,EA4BzC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { isDense as t } from "./data-table.group.js";
|
|
4
|
+
import { GroupHeadRow as n } from "./data-table.group-head.js";
|
|
5
|
+
import { RowActivator as r } from "./data-table.parts.js";
|
|
6
|
+
import { Disclosure as i } from "./disclosure.js";
|
|
7
|
+
import { SelectBox as a } from "./data-table.selection.js";
|
|
8
|
+
import { RowMenu as o } from "./data-table.menu.js";
|
|
9
|
+
import { dataTableCellInnerVariants as s, dataTableCellVariants as c, dataTableRowVariants as l } from "./data-table.variants.js";
|
|
10
|
+
import { TableCell as u, TableRow as d } from "./table.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
13
|
+
// src/components/data-table.body.tsx
|
|
14
|
+
var m = (e, t) => e[t], h = (e) => e == null ? null : String(e), g = "[&_:is(a,button,input,select,textarea,[role=switch],[tabindex])]:relative [&_:is(a,button,input,select,textarea,[role=switch],[tabindex])]:z-10", _ = ({ row: n, rowId: _, shut: v, ...y }) => {
|
|
15
|
+
let b = t(y.density), x = y.rowHref?.(n), S = y.selection, C = S?.mode === "single", w = S?.selected.includes(_) ?? !1, T = y.onRowClick, E = T || C ? () => {
|
|
16
|
+
C && S?.setCurrent(_), T?.(n);
|
|
17
|
+
} : void 0, D = x !== void 0 || E !== void 0, O = y.columns.find((e) => e.hideBelow === void 0) ?? y.columns[0], k = (t) => e(c({
|
|
18
|
+
density: y.density,
|
|
19
|
+
align: t?.align,
|
|
20
|
+
nowrap: t?.nowrap
|
|
21
|
+
}), v && "h-0 py-0 group-data-[look=comfortable]/table:h-0 group-data-[look=comfortable]/table:py-0", t?.grow && "w-full max-w-0", t?.className), A = (e) => b ? s({
|
|
22
|
+
lines: y.rowLines,
|
|
23
|
+
align: e
|
|
24
|
+
}) : void 0;
|
|
25
|
+
return /* @__PURE__ */ p(d, {
|
|
26
|
+
className: l({
|
|
27
|
+
dense: b,
|
|
28
|
+
interactive: D,
|
|
29
|
+
shut: v,
|
|
30
|
+
current: C && w
|
|
31
|
+
}),
|
|
32
|
+
"data-slot": "data-table-row",
|
|
33
|
+
"data-state": y.isRowSelected?.(n) || S?.mode === "multi" && w ? "selected" : void 0,
|
|
34
|
+
"aria-current": C && w ? "true" : void 0,
|
|
35
|
+
inert: v,
|
|
36
|
+
children: [
|
|
37
|
+
S?.mode === "multi" && /* @__PURE__ */ f(u, {
|
|
38
|
+
className: k(),
|
|
39
|
+
"data-slot": "data-table-select-cell",
|
|
40
|
+
children: /* @__PURE__ */ f(i, {
|
|
41
|
+
open: !v,
|
|
42
|
+
fade: !0,
|
|
43
|
+
className: A(),
|
|
44
|
+
children: /* @__PURE__ */ f(a, {
|
|
45
|
+
checked: w,
|
|
46
|
+
label: `Select ${y.rowLabel?.(n) ?? "row"}`,
|
|
47
|
+
onToggle: (e) => S.toggle(_, e)
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
}),
|
|
51
|
+
y.columns.map((t) => {
|
|
52
|
+
let a = t.cell ? t.cell(n) : h(m(n, t.key)), o = t === O && D;
|
|
53
|
+
return /* @__PURE__ */ f(u, {
|
|
54
|
+
className: e(k(t), !o && D && g),
|
|
55
|
+
"data-col": t.key,
|
|
56
|
+
"data-slot": "data-table-cell",
|
|
57
|
+
children: /* @__PURE__ */ f(i, {
|
|
58
|
+
open: !v,
|
|
59
|
+
fade: !0,
|
|
60
|
+
shrink: t.grow,
|
|
61
|
+
className: A(t.align),
|
|
62
|
+
children: o ? /* @__PURE__ */ f(r, {
|
|
63
|
+
href: x,
|
|
64
|
+
onClick: E,
|
|
65
|
+
children: a
|
|
66
|
+
}) : a
|
|
67
|
+
})
|
|
68
|
+
}, t.key);
|
|
69
|
+
}),
|
|
70
|
+
(y.rowActions || y.rowMenu) && /* @__PURE__ */ f(u, {
|
|
71
|
+
className: e(k(), "relative z-10 text-right"),
|
|
72
|
+
"data-slot": "data-table-actions",
|
|
73
|
+
children: /* @__PURE__ */ p(i, {
|
|
74
|
+
open: !v,
|
|
75
|
+
fade: !0,
|
|
76
|
+
className: A("right"),
|
|
77
|
+
children: [y.rowActions?.(n), y.rowMenu && /* @__PURE__ */ f(o, {
|
|
78
|
+
label: y.rowMenuLabel?.(n) ?? "Row actions",
|
|
79
|
+
children: y.rowMenu(n)
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}, v = ({ groups: e, rows: t, collapsed: r, onToggleGroup: i, columnCount: a, groupIcon: o, onAddToGroup: s, addToGroupLabel: c, ...l }) => {
|
|
86
|
+
let u = (e, t) => l.rowKey ? l.rowKey(e, t) : String(t), d = (e, t, n) => {
|
|
87
|
+
let r = u(e, t);
|
|
88
|
+
return /* @__PURE__ */ f(_, {
|
|
89
|
+
row: e,
|
|
90
|
+
rowId: r,
|
|
91
|
+
shut: n,
|
|
92
|
+
...l
|
|
93
|
+
}, r);
|
|
94
|
+
};
|
|
95
|
+
if (!e) return t.map((e, t) => d(e, t, !1));
|
|
96
|
+
let p = 0;
|
|
97
|
+
return e.flatMap((e) => {
|
|
98
|
+
let t = r.includes(e.key), l = typeof e.label == "string" ? e.label : e.key;
|
|
99
|
+
return [/* @__PURE__ */ f(n, {
|
|
100
|
+
groupKey: e.key,
|
|
101
|
+
columnCount: a,
|
|
102
|
+
expanded: !t,
|
|
103
|
+
count: e.rows.length,
|
|
104
|
+
icon: o?.(e.key),
|
|
105
|
+
onToggle: () => i(e.key),
|
|
106
|
+
onAdd: s ? () => s(e.key) : void 0,
|
|
107
|
+
addLabel: c ? c(l) : `Add to ${l}`,
|
|
108
|
+
children: e.label
|
|
109
|
+
}, `group:${e.key}`), ...e.rows.map((e) => d(e, p++, t))];
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
export { v as DataTableRows };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataTableProps } from './data-table.types.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type { SortDirection, SortState } from '../lib/table-sort.js';
|
|
4
|
+
export type { DataTableDensity, DataTableGroup, DataTableGroupBy, DataTableGroupOrder, } from './data-table.group.js';
|
|
5
|
+
export { dataTableCellVariants, dataTableHeadVariants } from './data-table.variants.js';
|
|
6
|
+
export type { DataTableColumn, DataTableProps } from './data-table.types.js';
|
|
7
|
+
export type { DataTableSelection } from './data-table.selection.js';
|
|
8
|
+
/**
|
|
9
|
+
* Column-def driven table over the `Table` primitives: client-side sorting, densities, grouping,
|
|
10
|
+
* container-query column hiding, row links, a row menu, single or multi selection and Up/Down
|
|
11
|
+
* roving focus. Non-goal: virtualization; paginate large sets instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DataTable: <T>(props: DataTableProps<T>) => React.JSX.Element;
|
|
14
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACrF,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAcjE;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAG,OAAO,cAAc,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAyIlE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GroupHeadRowProps {
|
|
3
|
+
groupKey: string;
|
|
4
|
+
columnCount: number;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
count: number;
|
|
7
|
+
onToggle: () => void;
|
|
8
|
+
/** Leading 14 px glyph of the group value, for example a StatusGlyph. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** Shows a 24 px "+" at the right of the header. */
|
|
11
|
+
onAdd?: () => void;
|
|
12
|
+
addLabel?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** Sticky group header row: a GroupHeader across every column, optional add button. */
|
|
16
|
+
export declare const GroupHeadRow: ({ groupKey, columnCount, expanded, count, onToggle, icon, onAdd, addLabel, children, }: GroupHeadRowProps) => React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=data-table.group-head.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.group-head.d.ts","sourceRoot":"","sources":["../../src/components/data-table.group-head.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,yEAAyE;IACzE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAYD,uFAAuF;AACvF,eAAO,MAAM,YAAY,GAAI,wFAU1B,iBAAiB,KAAG,KAAK,CAAC,GAAG,CAAC,OA+BhC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { GroupHeader as e } from "./group-header.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
// src/components/data-table.group-head.tsx
|
|
6
|
+
var n = () => /* @__PURE__ */ t("svg", {
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
className: "size-3.5 fill-none stroke-current stroke-2",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
children: /* @__PURE__ */ t("path", {
|
|
11
|
+
d: "M12 5v14M5 12h14",
|
|
12
|
+
strokeLinecap: "round"
|
|
13
|
+
})
|
|
14
|
+
}), r = ({ groupKey: r, columnCount: i, expanded: a, count: o, onToggle: s, icon: c, onAdd: l, addLabel: u = "Add", children: d }) => /* @__PURE__ */ t("tr", {
|
|
15
|
+
"data-slot": "data-table-group",
|
|
16
|
+
"data-group": r,
|
|
17
|
+
children: /* @__PURE__ */ t("th", {
|
|
18
|
+
colSpan: i,
|
|
19
|
+
scope: "colgroup",
|
|
20
|
+
className: "sticky z-20 p-0 text-left font-semibold",
|
|
21
|
+
style: { top: "var(--dt-head, 0px)" },
|
|
22
|
+
children: /* @__PURE__ */ t(e, {
|
|
23
|
+
label: d,
|
|
24
|
+
icon: c,
|
|
25
|
+
count: o,
|
|
26
|
+
open: a,
|
|
27
|
+
onOpenChange: s,
|
|
28
|
+
actions: l && /* @__PURE__ */ t("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
"aria-label": u,
|
|
31
|
+
title: u,
|
|
32
|
+
onClick: l,
|
|
33
|
+
className: "grid size-6 shrink-0 place-items-center rounded-lg text-muted-foreground transition-colors duration-fast hover:bg-accent hover:text-foreground focus-ring",
|
|
34
|
+
"data-slot": "data-table-group-add",
|
|
35
|
+
children: /* @__PURE__ */ t(n, {})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
export { r as GroupHeadRow };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/** The one dense look; kept as a type so the cell variants stay keyed. */
|
|
3
|
+
export type DataTableDensity = 'dense';
|
|
4
|
+
export interface DataTableGroup {
|
|
5
|
+
key: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Leading 14 px glyph in the group header, for example a StatusGlyph. */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** A column key (grouped by its value) or a function returning the group of a row. */
|
|
11
|
+
export type DataTableGroupBy<T> = string | ((row: T) => DataTableGroup);
|
|
12
|
+
/** Explicit key order (unknown keys follow in first-seen order) or a comparator. */
|
|
13
|
+
export type DataTableGroupOrder = string[] | ((a: DataTableGroup, b: DataTableGroup) => number);
|
|
14
|
+
export interface DataTableGroupSlice<T> extends DataTableGroup {
|
|
15
|
+
rows: T[];
|
|
16
|
+
}
|
|
17
|
+
/** Splits sorted rows into groups, first-seen order unless `order` is given; empty only via `keep`. */
|
|
18
|
+
export declare const groupRows: <T>(rows: T[], groupBy: DataTableGroupBy<T>, order?: DataTableGroupOrder,
|
|
19
|
+
/** Groups that keep a header with a 0 count when no row falls in them, in this order. */
|
|
20
|
+
keep?: DataTableGroup[]) => DataTableGroupSlice<T>[];
|
|
21
|
+
/** One container query per `hideBelow` width: the column hides when the table is narrower. */
|
|
22
|
+
export declare const hideBelowCss: (scope: string, columns: {
|
|
23
|
+
key: string;
|
|
24
|
+
hideBelow?: number;
|
|
25
|
+
}[]) => string;
|
|
26
|
+
export declare const isDense: (density: DataTableDensity) => boolean;
|
|
27
|
+
//# sourceMappingURL=data-table.group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.group.d.ts","sourceRoot":"","sources":["../../src/components/data-table.group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC;AAExE,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,KAAK,MAAM,CAAC,CAAC;AAEhG,MAAM,WAAW,mBAAmB,CAAC,CAAC,CAAE,SAAQ,cAAc;IAC5D,IAAI,EAAE,CAAC,EAAE,CAAC;CACX;AAmBD,uGAAuG;AACvG,eAAO,MAAM,SAAS,GAAI,CAAC,EACzB,MAAM,CAAC,EAAE,EACT,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,mBAAmB;AAC3B,yFAAyF;AACzF,OAAO,cAAc,EAAE,KACtB,mBAAmB,CAAC,CAAC,CAAC,EAUxB,CAAC;AAIF,8FAA8F;AAC9F,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,KAC7C,MAOU,CAAC;AAEd,eAAO,MAAM,OAAO,GAAI,SAAS,gBAAgB,KAAG,OAA8B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/components/data-table.group.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
if (typeof t == "function") return t(e);
|
|
4
|
+
let n = e[t], r = n == null ? "" : String(n);
|
|
5
|
+
return {
|
|
6
|
+
key: r,
|
|
7
|
+
label: r
|
|
8
|
+
};
|
|
9
|
+
}, t = (e, t) => {
|
|
10
|
+
if (!t) return e;
|
|
11
|
+
if (typeof t == "function") return [...e].sort(t);
|
|
12
|
+
let n = (e) => {
|
|
13
|
+
let n = t.indexOf(e);
|
|
14
|
+
return n < 0 ? t.length : n;
|
|
15
|
+
};
|
|
16
|
+
return [...e].sort((e, t) => n(e.key) - n(t.key));
|
|
17
|
+
}, n = (n, r, i, a) => {
|
|
18
|
+
let o = /* @__PURE__ */ new Map();
|
|
19
|
+
for (let e of a ?? []) o.set(e.key, {
|
|
20
|
+
...e,
|
|
21
|
+
rows: []
|
|
22
|
+
});
|
|
23
|
+
for (let t of n) {
|
|
24
|
+
let n = e(t, r), i = o.get(n.key);
|
|
25
|
+
i ? i.rows.push(t) : o.set(n.key, {
|
|
26
|
+
...n,
|
|
27
|
+
rows: [t]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return t([...o.values()], i);
|
|
31
|
+
}, r = (e) => e.replace(/["\\]/g, "\\$&"), i = (e, t) => t.filter((e) => e.hideBelow !== void 0).map((t) => `@container (max-width: ${String((t.hideBelow ?? 0) - .02)}px){[data-dt="${e}"] [data-col="${r(t.key)}"]{display:none}}`).join(""), a = (e) => e === "dense";
|
|
32
|
+
export { n as groupRows, i as hideBelowCss, a as isDense };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { nextSortState as e } from "../lib/table-sort.js";
|
|
3
|
+
import { useControlled as t } from "../lib/use-controlled.js";
|
|
4
|
+
import { useRovingFocus as n } from "../lib/use-roving-focus.js";
|
|
5
|
+
import { cn as r } from "../lib/utils.js";
|
|
6
|
+
import { DataTableRows as i } from "./data-table.body.js";
|
|
7
|
+
import { groupRows as a, hideBelowCss as o } from "./data-table.group.js";
|
|
8
|
+
import { DataTableHeadCell as s } from "./data-table.parts.js";
|
|
9
|
+
import { SelectBox as c, useSelection as l } from "./data-table.selection.js";
|
|
10
|
+
import { sortRows as u, tableRows as d } from "./data-table.state.js";
|
|
11
|
+
import { TableBody as f, TableCell as p, TableHeader as m, TableRow as h } from "./table.js";
|
|
12
|
+
import { dataTableCellVariants as g, dataTableHeadVariants as _ } from "./data-table.variants.js";
|
|
13
|
+
import * as v from "react";
|
|
14
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
// src/components/data-table.tsx
|
|
16
|
+
var x = "[data-slot=\"data-table-activator\"], [data-slot=\"group-header-toggle\"]", S = (e, t) => v.useLayoutEffect(() => {
|
|
17
|
+
let n = t.current?.offsetHeight ?? 0;
|
|
18
|
+
e.current?.style.setProperty("--dt-head", `${String(n)}px`);
|
|
19
|
+
}), C = (g) => {
|
|
20
|
+
let { columns: _, sticky: C = !0, showHeader: w = !0 } = g, T = "dense", E = d(g), { groupBy: D, className: O, ref: k, selection: A } = g, [j, M] = t(g.sort, g.defaultSort ?? null, g.onSortChange), [N, P] = t(g.collapsedGroups, [], g.onCollapsedGroupsChange), F = A !== void 0 && !g.rowKey;
|
|
21
|
+
v.useEffect(() => {
|
|
22
|
+
F && console.warn("DataTable: `selection` needs `rowKey`; index keys move with the data.");
|
|
23
|
+
}, [F]);
|
|
24
|
+
let I = v.useRef(null), L = v.useRef(null), R = v.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
25
|
+
n(I, {
|
|
26
|
+
selector: x,
|
|
27
|
+
loop: !1
|
|
28
|
+
}), S(I, L);
|
|
29
|
+
let z = v.useMemo(() => u(E, _, j), [
|
|
30
|
+
E,
|
|
31
|
+
_,
|
|
32
|
+
j
|
|
33
|
+
]), B = v.useMemo(() => D ? a(z, D, g.groupOrder, g.emptyGroups) : null, [
|
|
34
|
+
z,
|
|
35
|
+
D,
|
|
36
|
+
g.groupOrder,
|
|
37
|
+
g.emptyGroups
|
|
38
|
+
]), V = v.useMemo(() => new Map(E.map((e, t) => [e, t])), [E]), H = (e) => {
|
|
39
|
+
let t = V.get(e) ?? 0;
|
|
40
|
+
return g.rowKey ? g.rowKey(e, t) : String(t);
|
|
41
|
+
}, U = (B ? B.filter((e) => !N.includes(e.key)).flatMap((e) => e.rows) : z).map(H), W = l(A, U, g.selectedKeys, g.defaultSelectedKeys, g.onSelectedKeysChange), G = A === "multi", K = !!(g.rowActions || g.rowMenu), q = _.length + +!!K + +!!G, J = o(R, _), Y = g.overflowX ?? (D ? "visible" : "auto");
|
|
42
|
+
return /* @__PURE__ */ b("div", {
|
|
43
|
+
ref: I,
|
|
44
|
+
className: r("@container relative w-full", Y === "auto" && "overflow-auto"),
|
|
45
|
+
"data-dt": R,
|
|
46
|
+
"data-slot": "data-table-container",
|
|
47
|
+
children: [J && /* @__PURE__ */ y("style", { children: J }), /* @__PURE__ */ b("table", {
|
|
48
|
+
ref: k,
|
|
49
|
+
className: r("group/table w-full text-ui", O),
|
|
50
|
+
"data-slot": "data-table",
|
|
51
|
+
"data-selection": A,
|
|
52
|
+
children: [w && /* @__PURE__ */ y(m, {
|
|
53
|
+
ref: L,
|
|
54
|
+
children: /* @__PURE__ */ b(h, {
|
|
55
|
+
className: "hover:bg-transparent",
|
|
56
|
+
children: [
|
|
57
|
+
G && /* @__PURE__ */ y(s, {
|
|
58
|
+
density: T,
|
|
59
|
+
sticky: C,
|
|
60
|
+
width: "34px",
|
|
61
|
+
children: /* @__PURE__ */ y(c, {
|
|
62
|
+
checked: W.all,
|
|
63
|
+
indeterminate: W.some,
|
|
64
|
+
label: "Select all rows",
|
|
65
|
+
onToggle: W.toggleAll
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
68
|
+
_.map((t) => /* @__PURE__ */ y(s, {
|
|
69
|
+
col: t.key,
|
|
70
|
+
align: t.align,
|
|
71
|
+
density: T,
|
|
72
|
+
sticky: C,
|
|
73
|
+
sortable: t.sortable,
|
|
74
|
+
direction: j?.key === t.key ? j.direction : null,
|
|
75
|
+
onSort: () => M(e(j, t.key)),
|
|
76
|
+
width: t.width,
|
|
77
|
+
className: r(t.grow && "w-full max-w-0", t.className),
|
|
78
|
+
children: t.header
|
|
79
|
+
}, t.key)),
|
|
80
|
+
K && /* @__PURE__ */ y(s, {
|
|
81
|
+
density: T,
|
|
82
|
+
sticky: C,
|
|
83
|
+
width: "2.8125rem"
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
}), /* @__PURE__ */ y(f, { children: z.length === 0 && !(B && B.length > 0) ? /* @__PURE__ */ y(h, { children: /* @__PURE__ */ y(p, {
|
|
88
|
+
colSpan: q,
|
|
89
|
+
className: "p-0",
|
|
90
|
+
"data-slot": "data-table-empty",
|
|
91
|
+
children: g.empty
|
|
92
|
+
}) }) : /* @__PURE__ */ y(i, {
|
|
93
|
+
columns: _,
|
|
94
|
+
rowKey: H,
|
|
95
|
+
onRowClick: g.onRowClick,
|
|
96
|
+
isRowSelected: g.isRowSelected,
|
|
97
|
+
rowActions: g.rowActions,
|
|
98
|
+
rowMenu: g.rowMenu,
|
|
99
|
+
rowMenuLabel: g.rowMenuLabel,
|
|
100
|
+
rowLabel: g.rowLabel,
|
|
101
|
+
selection: A ? W : void 0,
|
|
102
|
+
density: T,
|
|
103
|
+
rowLines: g.rowLines ?? 1,
|
|
104
|
+
groups: B,
|
|
105
|
+
rows: z,
|
|
106
|
+
collapsed: N,
|
|
107
|
+
onToggleGroup: (e) => P((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]),
|
|
108
|
+
columnCount: q,
|
|
109
|
+
groupIcon: g.groupIcon,
|
|
110
|
+
onAddToGroup: g.onAddToGroup
|
|
111
|
+
}) })]
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
export { C as DataTable, g as dataTableCellVariants, _ as dataTableHeadVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const RowMenuIcon: () => React.JSX.Element;
|
|
3
|
+
export interface RowMenuProps {
|
|
4
|
+
/** Accessible name of the 24 px trigger, for example "Actions for release-notes". */
|
|
5
|
+
label: string;
|
|
6
|
+
/** `DropdownMenuItem`s and friends. */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** 24 px "more" button that opens a DropdownMenu; for list rows and cards. */
|
|
11
|
+
export declare const RowMenu: ({ label, children, className }: RowMenuProps) => React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=data-table.menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.menu.d.ts","sourceRoot":"","sources":["../../src/components/data-table.menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,WAAW,QAAO,KAAK,CAAC,GAAG,CAAC,OAMxC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8EAA8E;AAC9E,eAAO,MAAM,OAAO,GAAI,gCAAgC,YAAY,KAAG,KAAK,CAAC,GAAG,CAAC,OAmBhF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { DropdownMenu as t } from "./dropdown-menu.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
// src/components/data-table.menu.tsx
|
|
7
|
+
var i = () => /* @__PURE__ */ r("svg", {
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
className: "size-4 fill-current",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ n("circle", {
|
|
13
|
+
cx: "5",
|
|
14
|
+
cy: "12",
|
|
15
|
+
r: "1.6"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ n("circle", {
|
|
18
|
+
cx: "12",
|
|
19
|
+
cy: "12",
|
|
20
|
+
r: "1.6"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ n("circle", {
|
|
23
|
+
cx: "19",
|
|
24
|
+
cy: "12",
|
|
25
|
+
r: "1.6"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}), a = ({ label: r, children: a, className: o }) => /* @__PURE__ */ n(t, {
|
|
29
|
+
trigger: /* @__PURE__ */ n("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
"aria-label": r,
|
|
32
|
+
title: r,
|
|
33
|
+
className: e("relative z-10 grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-ring aria-expanded:bg-accent aria-expanded:text-foreground", o),
|
|
34
|
+
"data-slot": "row-menu-trigger",
|
|
35
|
+
children: /* @__PURE__ */ n(i, {})
|
|
36
|
+
}),
|
|
37
|
+
children: a
|
|
38
|
+
});
|
|
39
|
+
export { a as RowMenu, i as RowMenuIcon };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SortDirection } from '../lib/table-sort.js';
|
|
2
|
+
import { DataTableDensity } from './data-table.group.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare const SortIndicator: ({ direction, }: {
|
|
5
|
+
direction?: SortDirection | null;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export interface DataTableHeadCellProps {
|
|
8
|
+
align?: 'left' | 'center' | 'right';
|
|
9
|
+
density?: DataTableDensity;
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
/** Column key, used by `hideBelow` container queries. */
|
|
12
|
+
col?: string;
|
|
13
|
+
sortable?: boolean;
|
|
14
|
+
direction?: SortDirection | null;
|
|
15
|
+
onSort?: () => void;
|
|
16
|
+
width?: number | string;
|
|
17
|
+
className?: string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const DataTableHeadCell: ({ align, density, sticky, sortable, direction, onSort, width, col, className, children, }: DataTableHeadCellProps) => React.JSX.Element;
|
|
21
|
+
export interface RowActivatorProps {
|
|
22
|
+
href?: string;
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** Stretched link/button: one real control per row, actions stay clickable above it (z-10). */
|
|
27
|
+
export declare const RowActivator: ({ href, onClick, children }: RowActivatorProps) => React.JSX.Element;
|
|
28
|
+
//# sourceMappingURL=data-table.parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.parts.d.ts","sourceRoot":"","sources":["../../src/components/data-table.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,eAAO,MAAM,aAAa,GAAI,gBAE3B;IACD,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAClC,KAAG,KAAK,CAAC,GAAG,CAAC,OAiBb,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAID,eAAO,MAAM,iBAAiB,GAAI,2FAW/B,sBAAsB,KAAG,KAAK,CAAC,GAAG,CAAC,OA0BrC,CAAC;AAIF,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,+FAA+F;AAC/F,eAAO,MAAM,YAAY,GAAI,6BAA6B,iBAAiB,KAAG,KAAK,CAAC,GAAG,CAAC,OAmBrF,CAAC"}
|