@agentage/components 0.0.0-stage → 0.21.0
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 +24 -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 +51 -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,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { dataTableHeadVariants as t } from "./data-table.variants.js";
|
|
4
|
+
import { TableHead as n } from "./table.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
7
|
+
// src/components/data-table.parts.tsx
|
|
8
|
+
var a = ({ direction: t }) => /* @__PURE__ */ i("svg", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
width: "12",
|
|
11
|
+
height: "12",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
strokeWidth: "2",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round",
|
|
18
|
+
className: e("shrink-0", !t && "opacity-40"),
|
|
19
|
+
"data-slot": "data-table-sort-indicator",
|
|
20
|
+
children: [t !== "desc" && /* @__PURE__ */ r("path", { d: "m6 15 6-6 6 6" }), t !== "asc" && /* @__PURE__ */ r("path", { d: "m6 9 6 6 6-6" })]
|
|
21
|
+
}), o = {
|
|
22
|
+
asc: "ascending",
|
|
23
|
+
desc: "descending"
|
|
24
|
+
}, s = ({ align: s, density: c, sticky: l, sortable: u = !1, direction: d, onSort: f, width: p, col: m, className: h, children: g }) => /* @__PURE__ */ r(n, {
|
|
25
|
+
sticky: l,
|
|
26
|
+
"data-col": m,
|
|
27
|
+
"aria-sort": u ? d ? o[d] : "none" : void 0,
|
|
28
|
+
style: p === void 0 ? void 0 : { width: p },
|
|
29
|
+
className: e(t({
|
|
30
|
+
density: c,
|
|
31
|
+
align: s
|
|
32
|
+
}), h),
|
|
33
|
+
"data-slot": "data-table-head",
|
|
34
|
+
children: u ? /* @__PURE__ */ i("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: f,
|
|
37
|
+
className: e("inline-flex items-center gap-1 rounded-sm transition-colors duration-fast hover:text-foreground focus-ring", d && "text-foreground"),
|
|
38
|
+
"data-slot": "data-table-sort-button",
|
|
39
|
+
children: [g, /* @__PURE__ */ r(a, { direction: d })]
|
|
40
|
+
}) : g
|
|
41
|
+
}), c = "after:absolute after:inset-0 focus-ring", l = ({ href: t, onClick: n, children: i }) => t === void 0 ? /* @__PURE__ */ r("button", {
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: n,
|
|
44
|
+
className: e(c, "min-w-0 text-left"),
|
|
45
|
+
"data-slot": "data-table-activator",
|
|
46
|
+
children: i
|
|
47
|
+
}) : /* @__PURE__ */ r("a", {
|
|
48
|
+
href: t,
|
|
49
|
+
onClick: n,
|
|
50
|
+
className: e(c, "block min-w-0"),
|
|
51
|
+
"data-slot": "data-table-activator",
|
|
52
|
+
children: i
|
|
53
|
+
});
|
|
54
|
+
export { s as DataTableHeadCell, l as RowActivator, a as SortIndicator };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type DataTableSelection = 'single' | 'multi';
|
|
3
|
+
export interface SelectionState {
|
|
4
|
+
mode?: DataTableSelection;
|
|
5
|
+
selected: string[];
|
|
6
|
+
/** Click or Space on a row checkbox; `range` extends from the last toggled row (Shift). */
|
|
7
|
+
toggle: (key: string, range: boolean) => void;
|
|
8
|
+
/** Single selection: makes this row the current one. */
|
|
9
|
+
setCurrent: (key: string) => void;
|
|
10
|
+
/** Header checkbox: selects every displayed row, or clears them when all are selected. */
|
|
11
|
+
toggleAll: () => void;
|
|
12
|
+
all: boolean;
|
|
13
|
+
some: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Selection over the displayed order (after sort and grouping), so a Shift range follows the screen. */
|
|
16
|
+
export declare const useSelection: (mode: DataTableSelection | undefined, order: string[], controlled: string[] | undefined, initial: string[] | undefined, onChange?: (keys: string[]) => void) => SelectionState;
|
|
17
|
+
export interface SelectBoxProps {
|
|
18
|
+
checked: boolean;
|
|
19
|
+
indeterminate?: boolean;
|
|
20
|
+
label: string;
|
|
21
|
+
onToggle: (range: boolean) => void;
|
|
22
|
+
}
|
|
23
|
+
/** 13 px checkbox of the select column; lifted above the stretched row activator. */
|
|
24
|
+
export declare const SelectBox: ({ checked, indeterminate, label, onToggle }: SelectBoxProps) => React.JSX.Element;
|
|
25
|
+
/** Width of the select column: 16 px edge padding + 13 px box + 5 px gap. */
|
|
26
|
+
export declare const SELECT_COLUMN_WIDTH = "34px";
|
|
27
|
+
//# sourceMappingURL=data-table.selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.selection.d.ts","sourceRoot":"","sources":["../../src/components/data-table.selection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2FAA2F;IAC3F,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,wDAAwD;IACxD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,0FAA0F;IAC1F,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACf;AAED,yGAAyG;AACzG,eAAO,MAAM,YAAY,GACvB,MAAM,kBAAkB,GAAG,SAAS,EACpC,OAAO,MAAM,EAAE,EACf,YAAY,MAAM,EAAE,GAAG,SAAS,EAChC,SAAS,MAAM,EAAE,GAAG,SAAS,EAC7B,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,KAClC,cAgCF,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,qFAAqF;AACrF,eAAO,MAAM,SAAS,GAAI,6CAA6C,cAAc,sBAoBpF,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,SAAS,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Checkbox as e } from "./checkbox.js";
|
|
3
|
+
import { useControlled as t } from "../lib/use-controlled.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
// src/components/data-table.selection.tsx
|
|
7
|
+
var i = (e, r, i, a, o) => {
|
|
8
|
+
let [s, c] = t(i, a ?? [], o), l = n.useRef(null), u = new Set(r), d = s.filter((e) => u.has(e)).length;
|
|
9
|
+
return {
|
|
10
|
+
mode: e,
|
|
11
|
+
selected: s,
|
|
12
|
+
toggle: (e, t) => {
|
|
13
|
+
let n = l.current === null ? -1 : r.indexOf(l.current), i = r.indexOf(e);
|
|
14
|
+
if (l.current = e, t && n >= 0 && i >= 0) {
|
|
15
|
+
let e = r.slice(Math.min(n, i), Math.max(n, i) + 1);
|
|
16
|
+
c([.../* @__PURE__ */ new Set([...s, ...e])]);
|
|
17
|
+
} else c(s.includes(e) ? s.filter((t) => t !== e) : [...s, e]);
|
|
18
|
+
},
|
|
19
|
+
setCurrent: (e) => c([e]),
|
|
20
|
+
toggleAll: () => c(d === r.length && r.length > 0 ? s.filter((e) => !u.has(e)) : [.../* @__PURE__ */ new Set([...s, ...r])]),
|
|
21
|
+
all: r.length > 0 && d === r.length,
|
|
22
|
+
some: d > 0 && d < r.length
|
|
23
|
+
};
|
|
24
|
+
}, a = ({ checked: t, indeterminate: i, label: a, onToggle: o }) => {
|
|
25
|
+
let s = n.useRef(!1);
|
|
26
|
+
return /* @__PURE__ */ r(e, {
|
|
27
|
+
size: "sm",
|
|
28
|
+
checked: t,
|
|
29
|
+
indeterminate: i,
|
|
30
|
+
"aria-label": a,
|
|
31
|
+
className: "relative z-10",
|
|
32
|
+
"data-slot": "data-table-select",
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
s.current = e.shiftKey, e.stopPropagation();
|
|
35
|
+
},
|
|
36
|
+
onKeyDown: (e) => {
|
|
37
|
+
s.current = e.shiftKey;
|
|
38
|
+
},
|
|
39
|
+
onCheckedChange: () => o(s.current)
|
|
40
|
+
});
|
|
41
|
+
}, o = "34px";
|
|
42
|
+
export { o as SELECT_COLUMN_WIDTH, a as SelectBox, i as useSelection };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SortState } from '../lib/table-sort.js';
|
|
2
|
+
import { DataTableColumn } from './data-table.js';
|
|
3
|
+
import { DataTableProps } from './data-table.types.js';
|
|
4
|
+
/** A stable empty array keeps the memos warm. */
|
|
5
|
+
export declare const tableRows: <T>(props: Pick<DataTableProps<T>, "rows">) => T[];
|
|
6
|
+
export declare const sortRows: <T>(data: T[], columns: DataTableColumn<T>[], active: SortState | null) => T[];
|
|
7
|
+
export { useControlled } from '../lib/use-controlled.js';
|
|
8
|
+
//# sourceMappingURL=data-table.state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.state.d.ts","sourceRoot":"","sources":["../../src/components/data-table.state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,iDAAiD;AACjD,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAG,CAAC,EAAyB,CAAC;AAKjG,eAAO,MAAM,QAAQ,GAAI,CAAC,EACxB,MAAM,CAAC,EAAE,EACT,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,EAC7B,QAAQ,SAAS,GAAG,IAAI,KACvB,CAAC,EAUH,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { compareValues as e } from "../lib/table-sort.js";
|
|
3
|
+
import { useControlled as t } from "../lib/use-controlled.js";
|
|
4
|
+
// src/components/data-table.state.ts
|
|
5
|
+
var n = [], r = (e) => e.rows ?? n, i = (e, t) => e[t], a = (t, n, r) => {
|
|
6
|
+
let a = r && n.find((e) => e.key === r.key);
|
|
7
|
+
if (!r || !a) return t;
|
|
8
|
+
let o = r.direction === "asc" ? 1 : -1, { compare: s } = a, c = (e) => a.sortValue ? a.sortValue(e) : i(e, a.key);
|
|
9
|
+
return [...t].sort((t, n) => s ? o * s(t, n) : e(c(t), c(n), r.direction));
|
|
10
|
+
};
|
|
11
|
+
export { a as sortRows, r as tableRows, t as useControlled };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SortableValue, SortState } from '../lib/table-sort.js';
|
|
2
|
+
import { DataTableGroup, DataTableGroupBy, DataTableGroupOrder } from './data-table.group.js';
|
|
3
|
+
import { DataTableSelection } from './data-table.selection.js';
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
export interface DataTableColumn<T> {
|
|
6
|
+
key: string;
|
|
7
|
+
header: React.ReactNode;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
align?: 'left' | 'center' | 'right';
|
|
10
|
+
nowrap?: boolean;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
cell?: (row: T) => React.ReactNode;
|
|
13
|
+
/** Sort key when the displayed cell is not what you sort on. */
|
|
14
|
+
sortValue?: (row: T) => SortableValue;
|
|
15
|
+
/** Full comparator; wins over `sortValue`. */
|
|
16
|
+
compare?: (a: T, b: T) => number;
|
|
17
|
+
/** Hide the column when the table is narrower than this many px (container query). */
|
|
18
|
+
hideBelow?: number;
|
|
19
|
+
/** Extra classes on the header and body cells. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Takes the free width and truncates its content (one per table, for example a title). */
|
|
22
|
+
grow?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface DataTableProps<T> {
|
|
25
|
+
columns: DataTableColumn<T>[];
|
|
26
|
+
rows?: T[];
|
|
27
|
+
/** 2 gives the 52 px two-line row (name over a muted description); dense only. */
|
|
28
|
+
rowLines?: 1 | 2;
|
|
29
|
+
/** Pin the header row while the container scrolls. */
|
|
30
|
+
sticky?: boolean;
|
|
31
|
+
showHeader?: boolean;
|
|
32
|
+
/** `visible` lets the header and group rows stick to a page or pane scroller. */
|
|
33
|
+
overflowX?: 'auto' | 'visible';
|
|
34
|
+
/** Controlled sort; omit for the internal state seeded by `defaultSort`. */
|
|
35
|
+
sort?: SortState | null;
|
|
36
|
+
defaultSort?: SortState | null;
|
|
37
|
+
onSortChange?: (sort: SortState | null) => void;
|
|
38
|
+
/** Sticky, collapsible group headers with a count; rows keep the current sort inside a group. */
|
|
39
|
+
groupBy?: DataTableGroupBy<T> | null;
|
|
40
|
+
groupOrder?: DataTableGroupOrder;
|
|
41
|
+
/** Show these groups even when empty (header with a 0 count), for "Show empty groups". */
|
|
42
|
+
emptyGroups?: DataTableGroup[];
|
|
43
|
+
collapsedGroups?: string[];
|
|
44
|
+
onCollapsedGroupsChange?: (keys: string[]) => void;
|
|
45
|
+
rowKey?: (row: T, index: number) => string;
|
|
46
|
+
onRowClick?: (row: T) => void;
|
|
47
|
+
isRowSelected?: (row: T) => boolean;
|
|
48
|
+
rowActions?: (row: T) => React.ReactNode;
|
|
49
|
+
/** Items of a 24 px row menu (DropdownMenuItem and friends). */
|
|
50
|
+
rowMenu?: (row: T) => React.ReactNode;
|
|
51
|
+
rowMenuLabel?: (row: T) => string;
|
|
52
|
+
/** Accessible name of a row, used by its select checkbox ("Select <name>"). */
|
|
53
|
+
rowLabel?: (row: T) => string;
|
|
54
|
+
/**
|
|
55
|
+
* `single`: a click makes the row current (accent tint, 2 px bar, `aria-current`).
|
|
56
|
+
* `multi`: a 13 px checkbox column, select all with a mixed state, Shift-click ranges.
|
|
57
|
+
* Both need `rowKey`.
|
|
58
|
+
*/
|
|
59
|
+
selection?: DataTableSelection;
|
|
60
|
+
selectedKeys?: string[];
|
|
61
|
+
defaultSelectedKeys?: string[];
|
|
62
|
+
onSelectedKeysChange?: (keys: string[]) => void;
|
|
63
|
+
/** Leading glyph in a group header, by group key. */
|
|
64
|
+
groupIcon?: (key: string) => React.ReactNode;
|
|
65
|
+
/** Shows a "+" in each group header. */
|
|
66
|
+
onAddToGroup?: (key: string) => void;
|
|
67
|
+
empty?: React.ReactNode;
|
|
68
|
+
className?: string;
|
|
69
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=data-table.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.types.d.ts","sourceRoot":"","sources":["../../src/components/data-table.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACnC,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,aAAa,CAAC;IACtC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IACjC,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,kFAAkF;IAClF,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,iGAAiG;IACjG,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,0FAA0F;IAC1F,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IACpC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACzC,gEAAgE;IAChE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;IAC9B;;;;OAIG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD,qDAAqD;IACrD,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7C,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC"}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const dataTableHeadVariants: (props?: ({
|
|
2
|
+
density?: "dense" | null | undefined;
|
|
3
|
+
align?: "left" | "right" | "center" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export declare const dataTableCellVariants: (props?: ({
|
|
6
|
+
density?: "dense" | null | undefined;
|
|
7
|
+
align?: "left" | "right" | "center" | null | undefined;
|
|
8
|
+
nowrap?: boolean | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
/** Inner box of a dense cell: it owns the row height so a collapsed group can shrink it to 0. */
|
|
11
|
+
export declare const dataTableCellInnerVariants: (props?: ({
|
|
12
|
+
dense?: boolean | null | undefined;
|
|
13
|
+
lines?: 1 | 2 | null | undefined;
|
|
14
|
+
align?: "left" | "right" | "center" | null | undefined;
|
|
15
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
16
|
+
export declare const dataTableRowVariants: (props?: ({
|
|
17
|
+
dense?: boolean | null | undefined;
|
|
18
|
+
interactive?: boolean | null | undefined;
|
|
19
|
+
shut?: boolean | null | undefined;
|
|
20
|
+
current?: boolean | null | undefined;
|
|
21
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
22
|
+
//# sourceMappingURL=data-table.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.variants.d.ts","sourceRoot":"","sources":["../../src/components/data-table.variants.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,qBAAqB;;;8EAchC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;8EAgBhC,CAAC;AAEH,iGAAiG;AACjG,eAAO,MAAM,0BAA0B;;;;8EAWrC,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;8EAsB/B,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { MUTED_ON_ACCENT as e } from "../lib/utils.js";
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
// src/components/data-table.variants.ts
|
|
4
|
+
var n = {
|
|
5
|
+
left: "text-left",
|
|
6
|
+
center: "text-center",
|
|
7
|
+
right: "text-right"
|
|
8
|
+
}, r = "px-[5px] first:pl-4 last:pr-4", i = t("", {
|
|
9
|
+
variants: {
|
|
10
|
+
density: { dense: ["z-30 h-8 bg-background text-xs font-normal normal-case tracking-normal whitespace-nowrap", r] },
|
|
11
|
+
align: n
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
density: "dense",
|
|
15
|
+
align: "left"
|
|
16
|
+
}
|
|
17
|
+
}), a = t("", {
|
|
18
|
+
variants: {
|
|
19
|
+
density: { dense: ["py-0 text-ui whitespace-nowrap", r] },
|
|
20
|
+
align: n,
|
|
21
|
+
nowrap: {
|
|
22
|
+
true: "whitespace-nowrap",
|
|
23
|
+
false: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
density: "dense",
|
|
28
|
+
align: "left",
|
|
29
|
+
nowrap: !1
|
|
30
|
+
}
|
|
31
|
+
}), o = t("", {
|
|
32
|
+
variants: {
|
|
33
|
+
dense: {
|
|
34
|
+
true: "flex min-w-0 items-center gap-1.5",
|
|
35
|
+
false: ""
|
|
36
|
+
},
|
|
37
|
+
lines: {
|
|
38
|
+
1: "",
|
|
39
|
+
2: ""
|
|
40
|
+
},
|
|
41
|
+
align: {
|
|
42
|
+
left: "",
|
|
43
|
+
center: "justify-center",
|
|
44
|
+
right: "justify-end"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
compoundVariants: [{
|
|
48
|
+
dense: !0,
|
|
49
|
+
lines: 1,
|
|
50
|
+
class: "min-h-[35px]"
|
|
51
|
+
}, {
|
|
52
|
+
dense: !0,
|
|
53
|
+
lines: 2,
|
|
54
|
+
class: "min-h-[51px]"
|
|
55
|
+
}],
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
dense: !0,
|
|
58
|
+
lines: 1,
|
|
59
|
+
align: "left"
|
|
60
|
+
}
|
|
61
|
+
}), s = t("data-[state=selected]:[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]", {
|
|
62
|
+
variants: {
|
|
63
|
+
dense: {
|
|
64
|
+
true: ["hover:bg-accent", "hover:[--color-muted-foreground:color-mix(in_oklab,var(--color-foreground)_72%,var(--color-accent))]"],
|
|
65
|
+
false: ""
|
|
66
|
+
},
|
|
67
|
+
interactive: {
|
|
68
|
+
true: "relative",
|
|
69
|
+
false: ""
|
|
70
|
+
},
|
|
71
|
+
shut: {
|
|
72
|
+
true: "border-b-0",
|
|
73
|
+
false: ""
|
|
74
|
+
},
|
|
75
|
+
current: {
|
|
76
|
+
true: [
|
|
77
|
+
"bg-accent hover:bg-accent",
|
|
78
|
+
e,
|
|
79
|
+
"[&>td:first-child]:relative [&>td:first-child]:before:absolute [&>td:first-child]:before:inset-y-0 [&>td:first-child]:before:left-0 [&>td:first-child]:before:w-0.5 [&>td:first-child]:before:bg-primary"
|
|
80
|
+
],
|
|
81
|
+
false: ""
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
defaultVariants: {
|
|
85
|
+
dense: !0,
|
|
86
|
+
interactive: !1,
|
|
87
|
+
shut: !1,
|
|
88
|
+
current: !1
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export { o as dataTableCellInnerVariants, a as dataTableCellVariants, i as dataTableHeadVariants, s as dataTableRowVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type { DataKind } from './data-tree.model.js';
|
|
3
|
+
export interface DataTreeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Any JSON-like value: objects and arrays are branches, the rest are leaves. */
|
|
5
|
+
value: unknown;
|
|
6
|
+
/** Levels open on first render; 1 opens the root only. Default 1. */
|
|
7
|
+
defaultExpandDepth?: number;
|
|
8
|
+
/** Marks matching keys and values and opens the branches that hold them. */
|
|
9
|
+
highlight?: string;
|
|
10
|
+
/** Children shown per branch before a "Show n more" row. Default 100. */
|
|
11
|
+
itemLimit?: number;
|
|
12
|
+
/** Strings longer than this cut with a "+n" toggle. Default 80. */
|
|
13
|
+
maxStringLength?: number;
|
|
14
|
+
/** Shows the root object as its own row. */
|
|
15
|
+
showRoot?: boolean;
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Hierarchical data viewer on NavTree rows: JSON keys and values coloured by type. */
|
|
19
|
+
export declare const DataTree: React.ForwardRefExoticComponent<DataTreeProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
//# sourceMappingURL=data-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-tree.d.ts","sourceRoot":"","sources":["../../src/components/data-tree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,iFAAiF;IACjF,KAAK,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD,uFAAuF;AACvF,eAAO,MAAM,QAAQ,sFA+FpB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { ancestorsOf as t, defaultOpen as n, flatten as r, matchPaths as i } from "./data-tree.model.js";
|
|
4
|
+
import { DataTreeRow as a } from "./data-tree.row.js";
|
|
5
|
+
import { NavTree as o } from "./nav-tree.js";
|
|
6
|
+
import * as s from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
// src/components/data-tree.tsx
|
|
9
|
+
var u = "flex h-7 w-full items-center rounded-md px-2 text-left text-xs text-muted-foreground transition-colors duration-fast hover:bg-accent hover:text-foreground focus-ring", d = s.forwardRef(({ value: d, defaultExpandDepth: f = 1, highlight: p, itemLimit: m = 100, maxStringLength: h = 80, showRoot: g = !1, className: _, ...v }, y) => {
|
|
10
|
+
let [b, x] = s.useState(() => {
|
|
11
|
+
let e = n(d, f);
|
|
12
|
+
return e.add("$"), e;
|
|
13
|
+
}), [S, C] = s.useState({}), w = s.useMemo(() => i(d, p ?? ""), [d, p]), [T, E] = s.useState({
|
|
14
|
+
q: p,
|
|
15
|
+
paths: /* @__PURE__ */ new Set()
|
|
16
|
+
}), D = s.useMemo(() => T.q === p ? T.paths : /* @__PURE__ */ new Set(), [T, p]), O = s.useMemo(() => {
|
|
17
|
+
if (w.size === 0) return b;
|
|
18
|
+
let e = /* @__PURE__ */ new Set([...b, ...t(w)]);
|
|
19
|
+
for (let t of D) e.delete(t);
|
|
20
|
+
return e;
|
|
21
|
+
}, [
|
|
22
|
+
b,
|
|
23
|
+
w,
|
|
24
|
+
D
|
|
25
|
+
]), k = r(d, O, S, m), A = g ? k : k.slice(1), j = +!g, M = (e) => {
|
|
26
|
+
let t = O.has(e);
|
|
27
|
+
x((n) => {
|
|
28
|
+
let r = new Set(n);
|
|
29
|
+
return t ? r.delete(e) : r.add(e), r;
|
|
30
|
+
});
|
|
31
|
+
let n = new Set(D);
|
|
32
|
+
t ? n.add(e) : n.delete(e), E({
|
|
33
|
+
q: p,
|
|
34
|
+
paths: n
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ c(o, {
|
|
38
|
+
ref: y,
|
|
39
|
+
className: e("px-0", _),
|
|
40
|
+
"data-slot": "data-tree",
|
|
41
|
+
"data-match-count": w.size,
|
|
42
|
+
...v,
|
|
43
|
+
children: A.map((e) => e.type === "more" ? /* @__PURE__ */ l("div", {
|
|
44
|
+
role: "treeitem",
|
|
45
|
+
tabIndex: -1,
|
|
46
|
+
"aria-level": e.depth - j + 1,
|
|
47
|
+
"aria-selected": !1,
|
|
48
|
+
style: { paddingLeft: `${String(1.375 + (e.depth - j) * .875)}rem` },
|
|
49
|
+
className: u,
|
|
50
|
+
onClick: () => C((t) => ({
|
|
51
|
+
...t,
|
|
52
|
+
[e.path]: (t[e.path] ?? m) + m
|
|
53
|
+
})),
|
|
54
|
+
onKeyDown: (e) => {
|
|
55
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
"Show ",
|
|
59
|
+
Math.min(e.hidden, m),
|
|
60
|
+
" more of ",
|
|
61
|
+
e.hidden
|
|
62
|
+
]
|
|
63
|
+
}, `${e.path}#more`) : /* @__PURE__ */ c(a, {
|
|
64
|
+
node: e,
|
|
65
|
+
depth: e.depth - j,
|
|
66
|
+
open: O.has(e.path),
|
|
67
|
+
highlight: p,
|
|
68
|
+
matched: w.has(e.path),
|
|
69
|
+
maxStringLength: h,
|
|
70
|
+
onToggle: () => M(e.path)
|
|
71
|
+
}, e.path))
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
d.displayName = "DataTree";
|
|
75
|
+
export { d as DataTree };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type DataKind = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null' | 'other';
|
|
2
|
+
export interface DataNode {
|
|
3
|
+
/** Path such as `user.roles[0]`; `$` is the root. */
|
|
4
|
+
path: string;
|
|
5
|
+
key: string | number | null;
|
|
6
|
+
value: unknown;
|
|
7
|
+
kind: DataKind;
|
|
8
|
+
depth: number;
|
|
9
|
+
/** Child count of an object or array. */
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export type DataRow = ({
|
|
13
|
+
type: 'node';
|
|
14
|
+
} & DataNode) | {
|
|
15
|
+
type: 'more';
|
|
16
|
+
path: string;
|
|
17
|
+
depth: number;
|
|
18
|
+
hidden: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const kindOf: (value: unknown) => DataKind;
|
|
21
|
+
export declare const childPath: (parent: string, key: string | number) => string;
|
|
22
|
+
export declare const entriesOf: (value: unknown) => [string | number, unknown][];
|
|
23
|
+
export declare const formatScalar: (value: unknown, kind: DataKind) => string;
|
|
24
|
+
/** JSON text that never throws: a cycle becomes "[Circular]", a BigInt its digits. */
|
|
25
|
+
export declare const safeJson: (value: unknown) => string;
|
|
26
|
+
export declare const valueText: (value: unknown) => string;
|
|
27
|
+
/** Paths of every node whose key or scalar value contains `query`, case-insensitive. */
|
|
28
|
+
export declare const matchPaths: (value: unknown, query: string) => Set<string>;
|
|
29
|
+
/** Every ancestor path of the given paths, so a match is never hidden in a shut branch. */
|
|
30
|
+
export declare const ancestorsOf: (paths: Set<string>) => Set<string>;
|
|
31
|
+
/** Paths open by default: every branch above `depth`. */
|
|
32
|
+
export declare const defaultOpen: (value: unknown, depth: number) => Set<string>;
|
|
33
|
+
/** Visible rows in order; a branch shows `limit` children, then a "show more" row. */
|
|
34
|
+
export declare const flatten: (value: unknown, open: Set<string>, limits: Record<string, number>, limit: number) => DataRow[];
|
|
35
|
+
//# sourceMappingURL=data-tree.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-tree.model.d.ts","sourceRoot":"","sources":["../../src/components/data-tree.model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/F,MAAM,WAAW,QAAQ;IACvB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,OAAO,GACjB,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,KAAG,QAOvC,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,KAAK,MAAM,GAAG,MAAM,KAAG,MAKhE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAGf,CAAC;AAEvD,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,EAAE,MAAM,QAAQ,KAAG,MAI7D,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,MAczC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,MAK1C,CAAC;AAIF,wFAAwF;AACxF,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,KAAG,GAAG,CAAC,MAAM,CAiBpE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,CAAC,MAAM,CAAC,KAAG,GAAG,CAAC,MAAM,CAQ1D,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,KAAG,GAAG,CAAC,MAAM,CAUrE,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,OAAO,GAClB,OAAO,OAAO,EACd,MAAM,GAAG,CAAC,MAAM,CAAC,EACjB,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,MAAM,KACZ,OAAO,EAuBT,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/components/data-tree.model.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
if (e == null) return "null";
|
|
4
|
+
if (Array.isArray(e)) return "array";
|
|
5
|
+
let t = typeof e;
|
|
6
|
+
return t === "object" ? "object" : t === "string" || t === "number" || t === "boolean" ? t : "other";
|
|
7
|
+
}, t = /^[A-Za-z_$][\w$]*$/, n = (e, n) => {
|
|
8
|
+
if (typeof n == "number") return `${e}[${String(n)}]`;
|
|
9
|
+
let r = t.test(n) ? n : `[${JSON.stringify(n)}]`;
|
|
10
|
+
return e === "$" ? r.startsWith("[") ? `$${r}` : r : r.startsWith("[") ? `${e}${r}` : `${e}.${r}`;
|
|
11
|
+
}, r = (e) => Array.isArray(e) ? e.map((e, t) => [t, e]) : Object.entries(e), i = (e, t) => t === "string" ? JSON.stringify(e) : t === "null" ? e === void 0 ? "undefined" : "null" : String(e), a = (e) => {
|
|
12
|
+
let t = [];
|
|
13
|
+
return JSON.stringify(e, function(e, n) {
|
|
14
|
+
if (typeof n == "bigint") return String(n);
|
|
15
|
+
if (typeof n != "object" || !n) return n;
|
|
16
|
+
for (; t.length > 0 && t[t.length - 1] !== this;) t.pop();
|
|
17
|
+
return t.includes(n) ? "[Circular]" : (t.push(n), n);
|
|
18
|
+
}, 2);
|
|
19
|
+
}, o = (t) => {
|
|
20
|
+
let n = e(t);
|
|
21
|
+
return n === "string" ? t : n === "object" || n === "array" ? a(t) : i(t, n);
|
|
22
|
+
}, s = (e) => e.toLowerCase(), c = (t, a) => {
|
|
23
|
+
let o = /* @__PURE__ */ new Set(), c = s(a.trim());
|
|
24
|
+
if (!c) return o;
|
|
25
|
+
let l = /* @__PURE__ */ new Set(), u = (t, a, d) => {
|
|
26
|
+
let f = e(t), p = d !== null && s(String(d)).includes(c), m = f !== "object" && f !== "array";
|
|
27
|
+
if ((p || m && s(i(t, f)).includes(c)) && o.add(a), !(m || l.has(t))) {
|
|
28
|
+
l.add(t);
|
|
29
|
+
for (let [e, i] of r(t)) u(i, n(a, e), e);
|
|
30
|
+
l.delete(t);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return u(t, "$", null), o;
|
|
34
|
+
}, l = (e) => {
|
|
35
|
+
let t = /* @__PURE__ */ new Set(["$"]);
|
|
36
|
+
for (let n of e) for (let e = n.length - 1; e > 0; e--) (n[e] === "." || n[e] === "[") && t.add(n.slice(0, e));
|
|
37
|
+
return t;
|
|
38
|
+
}, u = (t, i) => {
|
|
39
|
+
let a = /* @__PURE__ */ new Set(), o = (t, s, c) => {
|
|
40
|
+
let l = e(t);
|
|
41
|
+
if (!(l !== "object" && l !== "array" || c >= i)) {
|
|
42
|
+
a.add(s);
|
|
43
|
+
for (let [e, i] of r(t)) o(i, n(s, e), c + 1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return o(t, "$", 0), a;
|
|
47
|
+
}, d = (t, i, a, o) => {
|
|
48
|
+
let s = [], c = (t, l, u, d) => {
|
|
49
|
+
let f = e(t), p = f === "object" || f === "array", m = p ? r(t) : [];
|
|
50
|
+
if (s.push({
|
|
51
|
+
type: "node",
|
|
52
|
+
path: l,
|
|
53
|
+
key: u,
|
|
54
|
+
value: t,
|
|
55
|
+
kind: f,
|
|
56
|
+
depth: d,
|
|
57
|
+
size: p ? m.length : void 0
|
|
58
|
+
}), !p || !i.has(l)) return;
|
|
59
|
+
let h = a[l] ?? o;
|
|
60
|
+
for (let [e, t] of m.slice(0, h)) c(t, n(l, e), e, d + 1);
|
|
61
|
+
m.length > h && s.push({
|
|
62
|
+
type: "more",
|
|
63
|
+
path: l,
|
|
64
|
+
depth: d + 1,
|
|
65
|
+
hidden: m.length - h
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return c(t, "$", null, 0), s;
|
|
69
|
+
};
|
|
70
|
+
export { l as ancestorsOf, n as childPath, u as defaultOpen, r as entriesOf, d as flatten, i as formatScalar, e as kindOf, c as matchPaths, a as safeJson, o as valueText };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataNode } from './data-tree.model.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** Ctrl or Cmd plus C, only when no text is selected, so a native copy of a selection wins. */
|
|
4
|
+
export declare const isCopyKey: (e: React.KeyboardEvent) => boolean;
|
|
5
|
+
export interface LazyCopyProps {
|
|
6
|
+
get: () => string;
|
|
7
|
+
label: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** CopyButton whose text is built on hover or focus, not on every render. */
|
|
11
|
+
export declare const LazyCopy: ({ get, label, className }: LazyCopyProps) => React.JSX.Element;
|
|
12
|
+
export interface DataTreeRowProps {
|
|
13
|
+
node: DataNode;
|
|
14
|
+
depth: number;
|
|
15
|
+
open: boolean;
|
|
16
|
+
highlight?: string;
|
|
17
|
+
matched: boolean;
|
|
18
|
+
maxStringLength: number;
|
|
19
|
+
onToggle: () => void;
|
|
20
|
+
}
|
|
21
|
+
/** One key and value row. Ctrl+C copies the value, Ctrl+Alt+C the path; Right shows a cut string. */
|
|
22
|
+
export declare const DataTreeRow: ({ node, depth, open, highlight, matched, maxStringLength, onToggle, }: DataTreeRowProps) => React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=data-tree.row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-tree.row.d.ts","sourceRoot":"","sources":["../../src/components/data-tree.row.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAA0C,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAqB1F,+FAA+F;AAC/F,eAAO,MAAM,SAAS,GAAI,GAAG,KAAK,CAAC,aAAa,KAAG,OAG8B,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,eAAO,MAAM,QAAQ,GAAI,2BAA2B,aAAa,sBAqBhE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,qGAAqG;AACrG,eAAO,MAAM,WAAW,GAAI,uEAQzB,gBAAgB,sBAsFlB,CAAC"}
|