@nadicodeai/ui 12.1.96 → 12.1.97
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/AGENTS.md +5 -1
- package/dist/components/accordion.d.ts +13 -0
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +13 -0
- package/dist/components/account-menu.d.ts +62 -18
- package/dist/components/account-menu.d.ts.map +1 -1
- package/dist/components/account-menu.js +32 -8
- package/dist/components/action-menu.d.ts +61 -5
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/action-menu.js +31 -2
- package/dist/components/action-status.d.ts +13 -3
- package/dist/components/action-status.d.ts.map +1 -1
- package/dist/components/action-status.js +13 -3
- package/dist/components/activity-calendar.d.ts +14 -0
- package/dist/components/activity-calendar.d.ts.map +1 -1
- package/dist/components/activity-calendar.js +14 -0
- package/dist/components/activity-feed.d.ts +62 -0
- package/dist/components/activity-feed.d.ts.map +1 -0
- package/dist/components/activity-feed.js +54 -0
- package/dist/components/agent-card.d.ts +15 -0
- package/dist/components/agent-card.d.ts.map +1 -1
- package/dist/components/agent-card.js +15 -0
- package/dist/components/agent-list-row.d.ts +11 -7
- package/dist/components/agent-list-row.d.ts.map +1 -1
- package/dist/components/agent-list-row.js +10 -8
- package/dist/components/agent-orb.d.ts +16 -0
- package/dist/components/agent-orb.d.ts.map +1 -1
- package/dist/components/agent-orb.js +16 -0
- package/dist/components/agent-profile.d.ts +39 -10
- package/dist/components/agent-profile.d.ts.map +1 -1
- package/dist/components/agent-profile.js +39 -10
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +14 -0
- package/dist/components/alert.d.ts +14 -0
- package/dist/components/alert.d.ts.map +1 -1
- package/dist/components/alert.js +14 -0
- package/dist/components/app-mark.d.ts +14 -4
- package/dist/components/app-mark.d.ts.map +1 -1
- package/dist/components/app-mark.js +13 -3
- package/dist/components/approval-row.d.ts +15 -2
- package/dist/components/approval-row.d.ts.map +1 -1
- package/dist/components/approval-row.js +15 -2
- package/dist/components/aspect-ratio.d.ts +10 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +10 -0
- package/dist/components/avatar.d.ts +15 -0
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +15 -0
- package/dist/components/badge.d.ts +11 -1
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +10 -5
- package/dist/components/brand-field.d.ts +10 -0
- package/dist/components/brand-field.d.ts.map +1 -1
- package/dist/components/brand-field.js +10 -0
- package/dist/components/brand.d.ts +14 -0
- package/dist/components/brand.d.ts.map +1 -1
- package/dist/components/brand.js +14 -0
- package/dist/components/breadcrumb.d.ts +20 -2
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb.js +13 -3
- package/dist/components/button-group.d.ts +21 -0
- package/dist/components/button-group.d.ts.map +1 -1
- package/dist/components/button-group.js +21 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +20 -0
- package/dist/components/calendar.d.ts +15 -0
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +15 -0
- package/dist/components/card-row.d.ts +15 -5
- package/dist/components/card-row.d.ts.map +1 -1
- package/dist/components/card-row.js +15 -5
- package/dist/components/card.d.ts +16 -0
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +16 -0
- package/dist/components/carousel.d.ts +12 -0
- package/dist/components/carousel.d.ts.map +1 -1
- package/dist/components/carousel.js +12 -0
- package/dist/components/catalog-drawer.d.ts +29 -0
- package/dist/components/catalog-drawer.d.ts.map +1 -0
- package/dist/components/catalog-drawer.js +31 -0
- package/dist/components/catalog-entry.d.ts +49 -26
- package/dist/components/catalog-entry.d.ts.map +1 -1
- package/dist/components/catalog-entry.js +5 -27
- package/dist/components/channel-view.d.ts +23 -0
- package/dist/components/channel-view.d.ts.map +1 -1
- package/dist/components/channel-view.js +13 -4
- package/dist/components/chart-area-stacked.d.ts +11 -1
- package/dist/components/chart-area-stacked.d.ts.map +1 -1
- package/dist/components/chart-area-stacked.js +12 -2
- package/dist/components/chart-bar-horizontal.d.ts +11 -1
- package/dist/components/chart-bar-horizontal.d.ts.map +1 -1
- package/dist/components/chart-bar-horizontal.js +12 -2
- package/dist/components/chart-bar-multiple.d.ts +9 -4
- package/dist/components/chart-bar-multiple.d.ts.map +1 -1
- package/dist/components/chart-bar-multiple.js +10 -5
- package/dist/components/chart-bar-stacked.d.ts +11 -1
- package/dist/components/chart-bar-stacked.d.ts.map +1 -1
- package/dist/components/chart-bar-stacked.js +12 -2
- package/dist/components/chart-card.d.ts +33 -20
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +18 -4
- package/dist/components/chart-date-range-control.d.ts +15 -10
- package/dist/components/chart-date-range-control.d.ts.map +1 -1
- package/dist/components/chart-date-range-control.js +14 -10
- package/dist/components/chart-date-range.d.ts.map +1 -1
- package/dist/components/chart-entity-colors.d.ts +7 -0
- package/dist/components/chart-entity-colors.d.ts.map +1 -1
- package/dist/components/chart-entity-colors.js +7 -0
- package/dist/components/chart-sparkline.d.ts +10 -0
- package/dist/components/chart-sparkline.d.ts.map +1 -1
- package/dist/components/chart-sparkline.js +8 -7
- package/dist/components/chart.d.ts +10 -0
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +10 -0
- package/dist/components/checkbox.d.ts +15 -0
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +15 -0
- package/dist/components/code-block.d.ts +15 -0
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +15 -0
- package/dist/components/collapsible.d.ts +12 -0
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +12 -0
- package/dist/components/collection-filters.d.ts +15 -2
- package/dist/components/collection-filters.d.ts.map +1 -1
- package/dist/components/collection-filters.js +13 -1
- package/dist/components/collection-page.d.ts +29 -115
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +24 -140
- package/dist/components/collection-search.d.ts +14 -0
- package/dist/components/collection-search.d.ts.map +1 -1
- package/dist/components/collection-search.js +14 -0
- package/dist/components/collection-sort.d.ts +13 -3
- package/dist/components/collection-sort.d.ts.map +1 -1
- package/dist/components/collection-sort.js +13 -3
- package/dist/components/collection-toolbar.d.ts +13 -0
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +13 -0
- package/dist/components/combobox.d.ts +17 -0
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +17 -0
- package/dist/components/command.d.ts +16 -0
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +16 -0
- package/dist/components/company-card.d.ts +16 -4
- package/dist/components/company-card.d.ts.map +1 -1
- package/dist/components/company-card.js +16 -4
- package/dist/components/confirm-dialog.d.ts +24 -14
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +16 -10
- package/dist/components/context-menu.d.ts +10 -0
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +10 -0
- package/dist/components/copy-button.d.ts +10 -0
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button.js +10 -0
- package/dist/components/dashboard-shell.d.ts +14 -0
- package/dist/components/dashboard-shell.d.ts.map +1 -1
- package/dist/components/dashboard-shell.js +14 -0
- package/dist/components/data-table.d.ts +20 -0
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +23 -2
- package/dist/components/desktop-shell.d.ts +15 -0
- package/dist/components/desktop-shell.d.ts.map +1 -1
- package/dist/components/desktop-shell.js +15 -0
- package/dist/components/dialog.d.ts +16 -0
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +16 -0
- package/dist/components/diff-count.d.ts +11 -0
- package/dist/components/diff-count.d.ts.map +1 -1
- package/dist/components/diff-count.js +11 -0
- package/dist/components/disclosure-row.d.ts +12 -0
- package/dist/components/disclosure-row.d.ts.map +1 -1
- package/dist/components/disclosure-row.js +12 -0
- package/dist/components/disclosure.d.ts +15 -5
- package/dist/components/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure.js +15 -5
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +13 -0
- package/dist/components/dropdown-menu.d.ts +17 -5
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +20 -7
- package/dist/components/empty-art.d.ts +1 -1
- package/dist/components/empty-art.d.ts.map +1 -1
- package/dist/components/empty-art.js +6 -0
- package/dist/components/empty-state.d.ts +24 -10
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state.js +23 -1
- package/dist/components/entry-scene.d.ts +33 -20
- package/dist/components/entry-scene.d.ts.map +1 -1
- package/dist/components/entry-scene.js +34 -7
- package/dist/components/expandable-block.d.ts +10 -0
- package/dist/components/expandable-block.d.ts.map +1 -1
- package/dist/components/expandable-block.js +10 -0
- package/dist/components/field.d.ts +17 -0
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +17 -0
- package/dist/components/file-diff.d.ts +12 -0
- package/dist/components/file-diff.d.ts.map +1 -1
- package/dist/components/file-diff.js +12 -0
- package/dist/components/file-type-icon.d.ts +12 -0
- package/dist/components/file-type-icon.d.ts.map +1 -1
- package/dist/components/file-type-icon.js +12 -0
- package/dist/components/footer.d.ts +14 -0
- package/dist/components/footer.d.ts.map +1 -1
- package/dist/components/footer.js +14 -0
- package/dist/components/form-dialog.d.ts +10 -0
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +10 -0
- package/dist/components/form-drawer.d.ts +24 -11
- package/dist/components/form-drawer.d.ts.map +1 -1
- package/dist/components/form-drawer.js +13 -3
- package/dist/components/form.d.ts +17 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +17 -0
- package/dist/components/glass-control.d.ts +13 -0
- package/dist/components/glass-control.d.ts.map +1 -1
- package/dist/components/glass-control.js +13 -0
- package/dist/components/hive-scene.d.ts +14 -0
- package/dist/components/hive-scene.d.ts.map +1 -1
- package/dist/components/hive-scene.js +14 -0
- package/dist/components/house-icons.d.ts +15 -0
- package/dist/components/house-icons.d.ts.map +1 -1
- package/dist/components/house-icons.js +15 -0
- package/dist/components/hover-card.d.ts +15 -0
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +15 -0
- package/dist/components/identity-mark.d.ts +55 -0
- package/dist/components/identity-mark.d.ts.map +1 -0
- package/dist/components/identity-mark.js +66 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.d.ts.map +1 -1
- package/dist/components/input-group.js +16 -0
- package/dist/components/input-otp.d.ts +15 -0
- package/dist/components/input-otp.d.ts.map +1 -1
- package/dist/components/input-otp.js +15 -0
- package/dist/components/input.d.ts +15 -0
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +15 -0
- package/dist/components/item.d.ts +16 -0
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +16 -0
- package/dist/components/kbd.d.ts +14 -0
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +14 -0
- package/dist/components/kpi-card.d.ts +21 -13
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +14 -3
- package/dist/components/label-system.d.ts +12 -0
- package/dist/components/label-system.d.ts.map +1 -1
- package/dist/components/label-system.js +12 -0
- package/dist/components/label.d.ts +15 -0
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +15 -0
- package/dist/components/library-shelf.d.ts +35 -0
- package/dist/components/library-shelf.d.ts.map +1 -0
- package/dist/components/library-shelf.js +40 -0
- package/dist/components/memory-item.d.ts +12 -0
- package/dist/components/memory-item.d.ts.map +1 -1
- package/dist/components/memory-item.js +12 -0
- package/dist/components/menu-choice-row.d.ts +13 -5
- package/dist/components/menu-choice-row.d.ts.map +1 -1
- package/dist/components/menu-choice-row.js +12 -6
- package/dist/components/menubar.d.ts +13 -0
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +13 -0
- package/dist/components/message-notice.d.ts +16 -0
- package/dist/components/message-notice.d.ts.map +1 -1
- package/dist/components/message-notice.js +18 -2
- package/dist/components/model-identity.d.ts +16 -3
- package/dist/components/model-identity.d.ts.map +1 -1
- package/dist/components/model-identity.js +16 -3
- package/dist/components/model-mark.d.ts +15 -2
- package/dist/components/model-mark.d.ts.map +1 -1
- package/dist/components/model-mark.js +15 -2
- package/dist/components/nadia-presence.d.ts +10 -4
- package/dist/components/nadia-presence.d.ts.map +1 -1
- package/dist/components/nadia-presence.js +10 -4
- package/dist/components/native-select.d.ts +16 -0
- package/dist/components/native-select.d.ts.map +1 -1
- package/dist/components/native-select.js +16 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +14 -0
- package/dist/components/notice-banner.d.ts +10 -3
- package/dist/components/notice-banner.d.ts.map +1 -1
- package/dist/components/notice-banner.js +9 -3
- package/dist/components/numbered-steps.d.ts +33 -0
- package/dist/components/numbered-steps.d.ts.map +1 -0
- package/dist/components/numbered-steps.js +23 -0
- package/dist/components/object-page.d.ts +37 -0
- package/dist/components/object-page.d.ts.map +1 -0
- package/dist/components/object-page.js +19 -0
- package/dist/components/object-workspace.d.ts +26 -36
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +27 -24
- package/dist/components/overview-page.d.ts +24 -0
- package/dist/components/overview-page.d.ts.map +1 -0
- package/dist/components/overview-page.js +26 -0
- package/dist/components/page-actions.d.ts +28 -23
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +20 -14
- package/dist/components/page-header.d.ts +11 -5
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +11 -5
- package/dist/components/pagination.d.ts +15 -0
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +15 -0
- package/dist/components/pairing-code.d.ts +15 -4
- package/dist/components/pairing-code.d.ts.map +1 -1
- package/dist/components/pairing-code.js +15 -4
- package/dist/components/pending-label.d.ts +12 -4
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +12 -4
- package/dist/components/picture-label.d.ts +15 -7
- package/dist/components/picture-label.d.ts.map +1 -1
- package/dist/components/picture-label.js +15 -7
- package/dist/components/platform-mark.d.ts +12 -3
- package/dist/components/platform-mark.d.ts.map +1 -1
- package/dist/components/platform-mark.js +12 -3
- package/dist/components/plugin-slot-boundary.d.ts +15 -0
- package/dist/components/plugin-slot-boundary.d.ts.map +1 -1
- package/dist/components/plugin-slot-boundary.js +15 -0
- package/dist/components/popover.d.ts +15 -0
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +15 -0
- package/dist/components/portal-sidebar-frame.d.ts +26 -12
- package/dist/components/portal-sidebar-frame.d.ts.map +1 -1
- package/dist/components/portal-sidebar-frame.js +26 -0
- package/dist/components/progress.d.ts +10 -8
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +11 -9
- package/dist/components/qr-code.d.ts +9 -3
- package/dist/components/qr-code.d.ts.map +1 -1
- package/dist/components/qr-code.js +9 -3
- package/dist/components/radio-group.d.ts +15 -0
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +15 -0
- package/dist/components/reading-column.d.ts +11 -0
- package/dist/components/reading-column.d.ts.map +1 -1
- package/dist/components/reading-column.js +11 -0
- package/dist/components/record-identity.d.ts +12 -7
- package/dist/components/record-identity.d.ts.map +1 -1
- package/dist/components/record-identity.js +11 -7
- package/dist/components/record-list.d.ts +119 -0
- package/dist/components/record-list.d.ts.map +1 -0
- package/dist/components/record-list.js +161 -0
- package/dist/components/record-sheet.d.ts +36 -0
- package/dist/components/record-sheet.d.ts.map +1 -0
- package/dist/components/record-sheet.js +19 -0
- package/dist/components/record-time.d.ts +27 -11
- package/dist/components/record-time.d.ts.map +1 -1
- package/dist/components/record-time.js +34 -12
- package/dist/components/resizable.d.ts +10 -0
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +10 -0
- package/dist/components/row-edit-form.d.ts +8 -5
- package/dist/components/row-edit-form.d.ts.map +1 -1
- package/dist/components/row-edit-form.js +8 -5
- package/dist/components/run-timeline.d.ts +24 -11
- package/dist/components/run-timeline.d.ts.map +1 -1
- package/dist/components/run-timeline.js +13 -6
- package/dist/components/scope-switcher.d.ts +11 -0
- package/dist/components/scope-switcher.d.ts.map +1 -1
- package/dist/components/scope-switcher.js +20 -9
- package/dist/components/scroll-area.d.ts +12 -0
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +12 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +16 -0
- package/dist/components/separator.d.ts +11 -0
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +11 -0
- package/dist/components/settings-facts.d.ts +18 -1
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +20 -1
- package/dist/components/settings-page.d.ts +20 -0
- package/dist/components/settings-page.d.ts.map +1 -0
- package/dist/components/settings-page.js +16 -0
- package/dist/components/settings-section.d.ts +38 -8
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +33 -7
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar-sections.d.ts +40 -0
- package/dist/components/sidebar-sections.d.ts.map +1 -0
- package/dist/components/sidebar-sections.js +35 -0
- package/dist/components/sidebar.d.ts +14 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +13 -2
- package/dist/components/skeleton.d.ts +10 -0
- package/dist/components/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton.js +11 -1
- package/dist/components/slider.d.ts +14 -0
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +14 -0
- package/dist/components/sonner.d.ts +18 -0
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/sonner.js +18 -0
- package/dist/components/status-badge.d.ts +13 -2
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/status-badge.js +21 -9
- package/dist/components/status-dot.d.ts +12 -0
- package/dist/components/status-dot.d.ts.map +1 -1
- package/dist/components/status-dot.js +12 -0
- package/dist/components/status-row.d.ts +14 -0
- package/dist/components/status-row.d.ts.map +1 -1
- package/dist/components/status-row.js +14 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +15 -0
- package/dist/components/table-card.d.ts +16 -3
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +16 -3
- package/dist/components/table-value.d.ts +24 -2
- package/dist/components/table-value.d.ts.map +1 -1
- package/dist/components/table-value.js +25 -3
- package/dist/components/table.d.ts +16 -0
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +17 -1
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +27 -0
- package/dist/components/tag.d.ts +12 -2
- package/dist/components/tag.d.ts.map +1 -1
- package/dist/components/tag.js +12 -2
- package/dist/components/text-link.d.ts +17 -0
- package/dist/components/text-link.d.ts.map +1 -1
- package/dist/components/text-link.js +17 -0
- package/dist/components/textarea.d.ts +14 -0
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +14 -0
- package/dist/components/theme-mode-switcher.d.ts +21 -0
- package/dist/components/theme-mode-switcher.d.ts.map +1 -1
- package/dist/components/theme-mode-switcher.js +23 -1
- package/dist/components/toggle-group.d.ts +13 -0
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +13 -0
- package/dist/components/toggle.d.ts +14 -0
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +14 -0
- package/dist/components/tool-icon.d.ts +14 -4
- package/dist/components/tool-icon.d.ts.map +1 -1
- package/dist/components/tool-icon.js +27 -42
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +15 -0
- package/dist/components/trend-badge.d.ts +16 -1
- package/dist/components/trend-badge.d.ts.map +1 -1
- package/dist/components/trend-badge.js +16 -7
- package/dist/components/update-card.d.ts +36 -0
- package/dist/components/update-card.d.ts.map +1 -0
- package/dist/components/update-card.js +28 -0
- package/dist/components/usage-meter.d.ts +15 -0
- package/dist/components/usage-meter.d.ts.map +1 -1
- package/dist/components/usage-meter.js +15 -0
- package/dist/components/waiting-line.d.ts +13 -10
- package/dist/components/waiting-line.d.ts.map +1 -1
- package/dist/components/waiting-line.js +13 -10
- package/dist/eslint/index.js +8 -0
- package/dist/eslint/rules/empty-state-owner.js +145 -0
- package/dist/eslint/rules/menu-owner.js +75 -0
- package/dist/eslint/rules/no-decorative-icon.js +164 -0
- package/dist/eslint/rules/page-composition.js +232 -0
- package/dist/eslint/rules/rendered-import.js +121 -0
- package/dist/eslint/strict-design-system.js +1 -1
- package/dist/hooks/use-hydrated.d.ts +2 -0
- package/dist/hooks/use-hydrated.d.ts.map +1 -0
- package/dist/hooks/use-hydrated.js +7 -0
- package/dist/index.d.ts +15 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -10
- package/dist/internal/catalog-list.d.ts +14 -0
- package/dist/internal/catalog-list.d.ts.map +1 -0
- package/dist/internal/catalog-list.js +53 -0
- package/dist/internal/empty.d.ts +6 -9
- package/dist/internal/empty.d.ts.map +1 -1
- package/dist/internal/empty.js +24 -22
- package/dist/internal/footer-strip.d.ts +0 -4
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +0 -4
- package/dist/internal/record-menu-items.d.ts +19 -0
- package/dist/internal/record-menu-items.d.ts.map +1 -0
- package/dist/internal/record-menu-items.js +20 -0
- package/dist/internal/settings-save.d.ts +43 -0
- package/dist/internal/settings-save.d.ts.map +1 -0
- package/dist/internal/settings-save.js +147 -0
- package/dist/lib/theme-mode.d.ts +1 -1
- package/dist/lib/theme-mode.js +1 -1
- package/dist/showcase/assets.d.ts +8 -0
- package/dist/showcase/assets.d.ts.map +1 -0
- package/dist/showcase/assets.js +13 -0
- package/dist/showcase/foundations.d.ts +2 -0
- package/dist/showcase/foundations.d.ts.map +1 -0
- package/dist/showcase/foundations.js +61 -0
- package/dist/showcase/samples.d.ts +21 -0
- package/dist/showcase/samples.d.ts.map +1 -0
- package/dist/showcase/samples.js +48 -0
- package/dist/showcase/showcase.d.ts +10 -0
- package/dist/showcase/showcase.d.ts.map +1 -0
- package/dist/showcase/showcase.js +44 -0
- package/dist/showcase/specimens/actions.d.ts +7 -0
- package/dist/showcase/specimens/actions.d.ts.map +1 -0
- package/dist/showcase/specimens/actions.js +15 -0
- package/dist/showcase/specimens/charts.d.ts +17 -0
- package/dist/showcase/specimens/charts.d.ts.map +1 -0
- package/dist/showcase/specimens/charts.js +104 -0
- package/dist/showcase/specimens/choices.d.ts +21 -0
- package/dist/showcase/specimens/choices.d.ts.map +1 -0
- package/dist/showcase/specimens/choices.js +68 -0
- package/dist/showcase/specimens/compositions.d.ts +39 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -0
- package/dist/showcase/specimens/compositions.js +270 -0
- package/dist/showcase/specimens/data.d.ts +31 -0
- package/dist/showcase/specimens/data.d.ts.map +1 -0
- package/dist/showcase/specimens/data.js +111 -0
- package/dist/showcase/specimens/feedback.d.ts +23 -0
- package/dist/showcase/specimens/feedback.d.ts.map +1 -0
- package/dist/showcase/specimens/feedback.js +64 -0
- package/dist/showcase/specimens/index.d.ts +164 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -0
- package/dist/showcase/specimens/index.js +24 -0
- package/dist/showcase/specimens/inputs.d.ts +22 -0
- package/dist/showcase/specimens/inputs.d.ts.map +1 -0
- package/dist/showcase/specimens/inputs.js +60 -0
- package/dist/showcase/specimens/menus.d.ts +20 -0
- package/dist/showcase/specimens/menus.d.ts.map +1 -0
- package/dist/showcase/specimens/menus.js +65 -0
- package/dist/showcase/specimens/navigation.d.ts +22 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -0
- package/dist/showcase/specimens/navigation.js +103 -0
- package/dist/showcase/specimens/other.d.ts +26 -0
- package/dist/showcase/specimens/other.d.ts.map +1 -0
- package/dist/showcase/specimens/other.js +73 -0
- package/dist/showcase/specimens/specimen.d.ts +5 -0
- package/dist/showcase/specimens/specimen.d.ts.map +1 -0
- package/dist/showcase/specimens/specimen.js +1 -0
- package/dist/showcase/specimens/status.d.ts +22 -0
- package/dist/showcase/specimens/status.d.ts.map +1 -0
- package/dist/showcase/specimens/status.js +44 -0
- package/dist/showcase/usage.generated.d.ts +16 -0
- package/dist/showcase/usage.generated.d.ts.map +1 -0
- package/dist/showcase/usage.generated.js +1788 -0
- package/dist/standalone/index.js +1 -1
- package/dist/styles/components.css +21 -0
- package/package.json +8 -3
- package/dist/components/automation-section.d.ts +0 -78
- package/dist/components/automation-section.d.ts.map +0 -1
- package/dist/components/automation-section.js +0 -75
- package/dist/components/catalog-tile.d.ts +0 -19
- package/dist/components/catalog-tile.d.ts.map +0 -1
- package/dist/components/catalog-tile.js +0 -13
- package/dist/components/feedback-state.d.ts +0 -14
- package/dist/components/feedback-state.d.ts.map +0 -1
- package/dist/components/feedback-state.js +0 -65
- package/dist/components/installer-shell.d.ts +0 -25
- package/dist/components/installer-shell.d.ts.map +0 -1
- package/dist/components/installer-shell.js +0 -32
- package/dist/components/settings-form.d.ts +0 -9
- package/dist/components/settings-form.d.ts.map +0 -1
- package/dist/components/settings-form.js +0 -83
package/AGENTS.md
CHANGED
|
@@ -6,7 +6,8 @@ product compositions. Source lives in `src/`; consumers receive `dist/` through
|
|
|
6
6
|
|
|
7
7
|
Every design rule a component follows is in `../design-system/DESIGN.md`:
|
|
8
8
|
tokens, roles, materials, glass, motion, status, activity, Agent orbs, marks and
|
|
9
|
-
the component rules in its "Components" section.
|
|
9
|
+
the component rules in its "Components" section. A component change a person
|
|
10
|
+
can see goes through `product-design` first. This file holds only how the
|
|
10
11
|
package is kept.
|
|
11
12
|
|
|
12
13
|
- **Styling.** A component uses the semantic roles and the generated tokens, and
|
|
@@ -29,6 +30,9 @@ package is kept.
|
|
|
29
30
|
package ships no auth abstraction. A value or function an app's server code
|
|
30
31
|
calls lives in a module without `"use client"`, and only the Portal's
|
|
31
32
|
production build (`npm run build -w @nadicodeai/portal`) proves it.
|
|
33
|
+
- **Usage.** The main export's TSDoc carries `@family`, `@when`, `@instead`,
|
|
34
|
+
`@behaviour`, `@words` and `@access`; `generate:usage` refreshes the
|
|
35
|
+
showcase's index from it, and `lint` fails until it runs.
|
|
32
36
|
- **Agents.** `@nadicodeai/ui/agents` re-exports assistant-ui and our reviewed
|
|
33
37
|
compositions; `@nadicodeai/ui/agent-orb` is the React-free entry a native
|
|
34
38
|
startup screen paints an orb with before React loads.
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
2
|
+
/**
|
|
3
|
+
* Sections that open and close under their headings.
|
|
4
|
+
*
|
|
5
|
+
* @family Other
|
|
6
|
+
* @when Optional or advanced content in named sections, such as the questions of a help page.
|
|
7
|
+
* @instead One piece of supporting detail is `Disclosure`. A long block cut short is
|
|
8
|
+
* `ExpandableBlock`. The page's main answer is never hidden in one.
|
|
9
|
+
* @behaviour Related sections may stay open together; exclusive ones open one at a time. The
|
|
10
|
+
* trigger's chevron turns when open.
|
|
11
|
+
* @words Each trigger names its topic as a noun phrase or a question a person asks.
|
|
12
|
+
* @access Each trigger is a `button` with `aria-expanded` controlling its panel; headings keep the
|
|
13
|
+
* page's outline.
|
|
14
|
+
*/
|
|
2
15
|
declare function Accordion({ className, ...props }: AccordionPrimitive.Root.Props): import("react").JSX.Element;
|
|
3
16
|
declare function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props): import("react").JSX.Element;
|
|
4
17
|
declare function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK3E,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,+BAQxE;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,+BAQ5E;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,+BAmB5F;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,+BAiB1F;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/components/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK3E;;;;;;;;;;;;GAYG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,+BAQxE;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,+BAQ5E;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,+BAmB5F;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,+BAiB1F;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -2,6 +2,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
/**
|
|
6
|
+
* Sections that open and close under their headings.
|
|
7
|
+
*
|
|
8
|
+
* @family Other
|
|
9
|
+
* @when Optional or advanced content in named sections, such as the questions of a help page.
|
|
10
|
+
* @instead One piece of supporting detail is `Disclosure`. A long block cut short is
|
|
11
|
+
* `ExpandableBlock`. The page's main answer is never hidden in one.
|
|
12
|
+
* @behaviour Related sections may stay open together; exclusive ones open one at a time. The
|
|
13
|
+
* trigger's chevron turns when open.
|
|
14
|
+
* @words Each trigger names its topic as a noun phrase or a question a person asks.
|
|
15
|
+
* @access Each trigger is a `button` with `aria-expanded` controlling its panel; headings keep the
|
|
16
|
+
* page's outline.
|
|
17
|
+
*/
|
|
5
18
|
function Accordion({ className, ...props }) {
|
|
6
19
|
return (_jsx(AccordionPrimitive.Root, { "data-slot": "accordion", className: cn("flex w-full flex-col", className), ...props }));
|
|
7
20
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from "react";
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { MenuCommand } from "./action-menu.js";
|
|
3
|
+
import { type MenuChoiceRowProps } from "./menu-choice-row.js";
|
|
4
|
+
import type { PageCommandAction } from "./page-actions.js";
|
|
5
|
+
import { type ResolvedMessage } from "./product-message.js";
|
|
6
|
+
import { ThemeModeMenu } from "./theme-mode-switcher.js";
|
|
2
7
|
/** Whose account it is: the name people recognise, the picture, and the lines under it. */
|
|
3
8
|
export type AccountIdentity = {
|
|
4
9
|
/**
|
|
@@ -31,34 +36,73 @@ export type AccountMenuIdentityProps = {
|
|
|
31
36
|
* same block in both places.
|
|
32
37
|
*/
|
|
33
38
|
export declare function AccountMenuIdentity({ className, identity, pictureOnly, size, }: AccountMenuIdentityProps): import("react").JSX.Element;
|
|
39
|
+
export type AccountMenuCommand = MenuCommand & {
|
|
40
|
+
/** A reading at the row's end: "62% left". */
|
|
41
|
+
value?: ReactNode;
|
|
42
|
+
};
|
|
43
|
+
/** A product's own exclusive setting, in a submenu: Alveare's presence. */
|
|
44
|
+
export type AccountMenuChoice = {
|
|
45
|
+
label: string;
|
|
46
|
+
icon: ReactElement;
|
|
47
|
+
value: string;
|
|
48
|
+
/** Each option's name, its mark, and one muted line under the name when the name alone does not say what it is. */
|
|
49
|
+
options: readonly {
|
|
50
|
+
value: string;
|
|
51
|
+
label: string;
|
|
52
|
+
mark?: ReactNode;
|
|
53
|
+
detail?: string;
|
|
54
|
+
}[];
|
|
55
|
+
onValueChange: (value: string) => void;
|
|
56
|
+
};
|
|
57
|
+
export type AccountMenuSignOut = {
|
|
58
|
+
/** "Sign out". */
|
|
59
|
+
label: string;
|
|
60
|
+
/** "Signing out". */
|
|
61
|
+
pendingLabel: string;
|
|
62
|
+
pending: boolean;
|
|
63
|
+
failure?: ResolvedMessage | null;
|
|
64
|
+
onSignOut: () => void;
|
|
65
|
+
/** Sign out opens the product's own confirmation, so the menu closes and leaves focus to it. */
|
|
66
|
+
confirms?: boolean;
|
|
67
|
+
};
|
|
34
68
|
export type AccountMenuProps = {
|
|
35
|
-
/** Where the menu sits against its trigger. */
|
|
36
|
-
align?: "center" | "end" | "start";
|
|
37
|
-
/** The groups under the header: what this account can do, ending in the way out. */
|
|
38
|
-
children: ReactNode;
|
|
39
|
-
className?: string;
|
|
40
|
-
/** Closes the trigger to further presses while the account is leaving. */
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
/** Sits beside the header, for a single icon-only action on the account itself. */
|
|
43
|
-
headerAction?: ReactNode;
|
|
44
69
|
identity: AccountIdentity;
|
|
45
|
-
/**
|
|
70
|
+
/** Names the trigger and the menu: "Account" reads "Account: Ada Rossi". */
|
|
46
71
|
label: string;
|
|
47
|
-
/**
|
|
48
|
-
|
|
72
|
+
/** The gear beside the identity, to the account's settings. */
|
|
73
|
+
settings?: PageCommandAction & {
|
|
74
|
+
label: string;
|
|
75
|
+
};
|
|
76
|
+
/** Applies at once and keeps the menu open. */
|
|
77
|
+
theme: ComponentProps<typeof ThemeModeMenu>;
|
|
78
|
+
language?: MenuChoiceRowProps<string> & {
|
|
79
|
+
icon: ReactElement;
|
|
80
|
+
};
|
|
81
|
+
choices?: readonly AccountMenuChoice[];
|
|
82
|
+
commands?: readonly AccountMenuCommand[];
|
|
83
|
+
signOut: AccountMenuSignOut;
|
|
49
84
|
/**
|
|
50
85
|
* The trigger shows the picture alone, for a navigation rail drawn too narrow
|
|
51
86
|
* for the name; the menu still opens on the whole identity.
|
|
52
87
|
*/
|
|
53
88
|
pictureOnly?: boolean;
|
|
54
|
-
side?: "bottom" | "left" | "right" | "top";
|
|
55
89
|
/** The element the trigger renders as, when a shell has its own button. */
|
|
56
90
|
triggerRender?: ReactElement;
|
|
91
|
+
align?: "center" | "end" | "start";
|
|
92
|
+
side?: "bottom" | "left" | "right" | "top";
|
|
93
|
+
/** Runs when the menu opens or closes, for a shell that records where it was. */
|
|
94
|
+
onOpenChange?: (open: boolean) => void;
|
|
57
95
|
};
|
|
58
96
|
/**
|
|
59
|
-
* The account menu at the foot of a shell's navigation:
|
|
60
|
-
*
|
|
61
|
-
*
|
|
97
|
+
* The account menu at the foot of a shell's navigation: whose account it is,
|
|
98
|
+
* and the menu opening on that same identity with what they can do beneath it.
|
|
99
|
+
*
|
|
100
|
+
* @family Menus
|
|
101
|
+
* @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the gear to the account's settings, Theme, Language, a product's own settings, its commands, and Sign out.
|
|
102
|
+
* @instead A record's or a page's commands are an ActionMenu; a setting with more than a few options or one that needs a Save belongs on a SettingsPage.
|
|
103
|
+
* @behaviour The menu opens upward on the identity. In order: the gear, Theme, Language, the product's choices as submenus, its commands with any reading at their end, and Sign out last in the error colour. Theme and Language apply at once and keep the menu open. While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation.
|
|
104
|
+
* @words The menu's name ("Account"), the person's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Sign out" and "Signing out".
|
|
105
|
+
* @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out is aria-busy and announced through a status; a failure is an alert.
|
|
62
106
|
*/
|
|
63
|
-
export declare function AccountMenu({ align,
|
|
107
|
+
export declare function AccountMenu({ align, choices, commands, identity, label, language, onOpenChange, pictureOnly, settings, side, signOut, theme, triggerRender, }: AccountMenuProps): import("react").JSX.Element;
|
|
64
108
|
//# sourceMappingURL=account-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-menu.d.ts","sourceRoot":"","sources":["../../src/components/account-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"account-menu.d.ts","sourceRoot":"","sources":["../../src/components/account-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,KAA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F,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAe,EACf,OAAY,EACZ,QAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,WAAmB,EACnB,QAAQ,EACR,IAAY,EACZ,OAAO,EACP,KAAK,EACL,aAAa,GACd,EAAE,gBAAgB,+BAgGlB"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ChevronsUpDown, UserRound } from "lucide-react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronsUpDown, LogOut, Settings, UserRound } from "lucide-react";
|
|
4
4
|
import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuSeparator, DropdownMenuTrigger, } from "./dropdown-menu.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuCommand, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./dropdown-menu.js";
|
|
6
|
+
import { FieldError } from "./field.js";
|
|
7
|
+
import { MenuChoiceRow } from "./menu-choice-row.js";
|
|
8
|
+
import { PendingLabel } from "./pending-label.js";
|
|
9
|
+
import { bodyBeyondTitle } from "./product-message.js";
|
|
10
|
+
import { ThemeModeMenu } from "./theme-mode-switcher.js";
|
|
11
|
+
import { MenuCommandRow, menuItemAction } from "../internal/record-menu-items.js";
|
|
6
12
|
import { cn } from "../lib/utils.js";
|
|
7
13
|
/**
|
|
8
14
|
* The account's avatar beside its name and lines. The trigger shows it with the
|
|
@@ -13,10 +19,28 @@ export function AccountMenuIdentity({ className, identity, pictureOnly = false,
|
|
|
13
19
|
return (_jsxs("span", { className: cn("flex min-w-0 items-center gap-2 text-left text-sm", className), "data-slot": "account-menu-identity", children: [_jsxs(Avatar, { "aria-hidden": "true", size: size === "lg" ? "default" : "sm", children: [identity.image ? _jsx(AvatarImage, { alt: "", src: identity.image }) : null, _jsx(AvatarFallback, { children: identity.initials || _jsx(UserRound, { "aria-hidden": "true", className: "size-3/5" }) })] }), pictureOnly ? null : (_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 leading-tight", children: [_jsx("span", { className: "truncate font-medium text-foreground", children: identity.name }), (size === "lg" ? identity.lines : identity.lines?.slice(0, 1))?.map((line, index) => (_jsx("span", { className: "truncate text-xs font-normal text-muted-foreground", children: line }, index)))] }))] }));
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
|
-
* The account menu at the foot of a shell's navigation:
|
|
17
|
-
*
|
|
18
|
-
*
|
|
22
|
+
* The account menu at the foot of a shell's navigation: whose account it is,
|
|
23
|
+
* and the menu opening on that same identity with what they can do beneath it.
|
|
24
|
+
*
|
|
25
|
+
* @family Menus
|
|
26
|
+
* @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the gear to the account's settings, Theme, Language, a product's own settings, its commands, and Sign out.
|
|
27
|
+
* @instead A record's or a page's commands are an ActionMenu; a setting with more than a few options or one that needs a Save belongs on a SettingsPage.
|
|
28
|
+
* @behaviour The menu opens upward on the identity. In order: the gear, Theme, Language, the product's choices as submenus, its commands with any reading at their end, and Sign out last in the error colour. Theme and Language apply at once and keep the menu open. While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation.
|
|
29
|
+
* @words The menu's name ("Account"), the person's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Sign out" and "Signing out".
|
|
30
|
+
* @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out is aria-busy and announced through a status; a failure is an alert.
|
|
19
31
|
*/
|
|
20
|
-
export function AccountMenu({ align = "start",
|
|
21
|
-
|
|
32
|
+
export function AccountMenu({ align = "start", choices = [], commands = [], identity, label, language, onOpenChange, pictureOnly = false, settings, side = "top", signOut, theme, triggerRender, }) {
|
|
33
|
+
const name = `${label}: ${identity.name}`;
|
|
34
|
+
return (_jsxs(DropdownMenu, { onOpenChange: onOpenChange, children: [_jsxs(DropdownMenuTrigger, { "aria-label": name, disabled: signOut.pending, render: triggerRender ?? (_jsx("button", { className: "flex w-full min-w-0 items-center gap-2 rounded-sm p-1.5 text-left outline-none hover:bg-accent focus-visible:nc-focus-outline focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 data-[popup-open]:bg-accent", type: "button" })), children: [_jsx(AccountMenuIdentity, { className: pictureOnly ? undefined : "flex-1", identity: identity, pictureOnly: pictureOnly }), pictureOnly ? null : (_jsx(ChevronsUpDown, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 text-muted-foreground" }))] }), _jsxs(DropdownMenuContent, { align: align, "aria-label": name, className: "w-72 max-w-[calc(100vw-2rem)]", density: "comfortable", side: side, sideOffset: 8, children: [_jsxs(DropdownMenuGroup, { className: "flex min-w-0 items-center gap-1 pr-1.5", children: [_jsx(AccountMenuIdentity, { className: "min-w-0 flex-1 px-2 py-2", identity: identity, size: "lg" }), settings ? (_jsx(DropdownMenuItem, { "aria-label": settings.label, iconOnly: true, ...menuItemAction(settings), children: _jsx(Settings, { "aria-hidden": "true" }) })) : null] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(ThemeModeMenu, { ...theme }), language ? _jsx(MenuChoiceRow, { ...language }) : null, choices.map((choice) => (_jsx(AccountMenuChoiceRow, { choice: choice }, choice.label)))] }), commands.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuGroup, { children: commands.map(({ value, ...command }) => (_jsx(MenuCommandRow, { command: command, value: value }, command.label))) })] })) : null, _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuCommand, { "aria-busy": signOut.pending || undefined, closeOnClick: signOut.confirms === true, disabled: signOut.pending, icon: _jsx(LogOut, {}), onClick: () => {
|
|
35
|
+
if (!signOut.pending)
|
|
36
|
+
signOut.onSignOut();
|
|
37
|
+
}, variant: "destructive", children: _jsx(PendingLabel, { pending: signOut.pending, pendingLabel: signOut.pendingLabel, children: signOut.label }) }), signOut.pending ? (_jsx("span", { className: "sr-only", role: "status", children: signOut.pendingLabel })) : null, signOut.failure ? (_jsxs(FieldError, { className: "mx-3 mb-1 break-words", "data-message-code": signOut.failure.code, children: [_jsx("span", { className: "block font-medium", children: signOut.failure.title }), bodyBeyondTitle(signOut.failure) ? (_jsx("span", { className: "block", children: bodyBeyondTitle(signOut.failure) })) : null] })) : null] })] })] }));
|
|
38
|
+
}
|
|
39
|
+
function AccountMenuChoiceRow({ choice }) {
|
|
40
|
+
const current = choice.options.find((option) => option.value === choice.value);
|
|
41
|
+
return (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { className: "gap-2.5", children: [_jsx("span", { "aria-hidden": "true", className: "flex shrink-0 items-center text-muted-foreground", children: choice.icon }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: choice.label }), current ? (_jsx(DropdownMenuShortcut, { className: "ml-0", children: current.label })) : null] }), _jsx(DropdownMenuSubContent, { children: _jsx(DropdownMenuRadioGroup, { "aria-label": choice.label, onValueChange: (next) => {
|
|
42
|
+
const selected = choice.options.find((option) => option.value === next);
|
|
43
|
+
if (selected)
|
|
44
|
+
choice.onValueChange(selected.value);
|
|
45
|
+
}, value: choice.value, children: choice.options.map((option) => (_jsxs(DropdownMenuRadioItem, { closeOnClick: false, value: option.value, children: [option.mark, option.detail ? (_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 leading-tight", children: [_jsx("span", { className: "truncate", children: option.label }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: option.detail })] })) : (option.label)] }, option.value))) }) })] }));
|
|
22
46
|
}
|
|
@@ -1,8 +1,64 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { DropdownMenuContent } from "./dropdown-menu.js";
|
|
3
|
+
import type { PageCommandAction } from "./page-actions.js";
|
|
4
|
+
/** One command in a menu: its icon first, then its label. */
|
|
5
|
+
export type MenuCommand = PageCommandAction & {
|
|
3
6
|
label: string;
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
icon: ReactElement;
|
|
8
|
+
/** Read instead of the label when the label alone does not name the target: "Let Sofia use Gmail". */
|
|
9
|
+
accessibleName?: string | undefined;
|
|
10
|
+
/** Drawn last, after the divider, in the error colour. */
|
|
11
|
+
destructive?: boolean | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
/** The value it acts on, in mono under its label: the address Copy address copies. */
|
|
14
|
+
detail?: string | undefined;
|
|
15
|
+
/** Why it cannot run now, read under its label; a disabled command keeps it visible. */
|
|
16
|
+
reason?: ReactNode;
|
|
6
17
|
};
|
|
7
|
-
|
|
18
|
+
/** A record's menu: whose it is, and what can be done to it. */
|
|
19
|
+
export type RecordMenu = {
|
|
20
|
+
/** The trigger's accessible name, from the catalogue: "More for pec@acme.it". */
|
|
21
|
+
label: string;
|
|
22
|
+
/** The record the menu acts on, its first line: "pec@acme.it". */
|
|
23
|
+
record: string;
|
|
24
|
+
commands: readonly MenuCommand[];
|
|
25
|
+
};
|
|
26
|
+
export type ActionMenuProps = RecordMenu & {
|
|
27
|
+
triggerId?: string | undefined;
|
|
28
|
+
/** Controlled, for a host that stays visible while the menu is open (a message's hover bar). */
|
|
29
|
+
open?: boolean | undefined;
|
|
30
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
31
|
+
/** false keeps the page interactive while the menu is open. */
|
|
32
|
+
modal?: boolean | undefined;
|
|
33
|
+
side?: "bottom" | "top" | undefined;
|
|
34
|
+
/** Where focus goes when the menu closes, when not its trigger: Edit hands it to a composer. */
|
|
35
|
+
finalFocus?: ComponentProps<typeof DropdownMenuContent>["finalFocus"];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A record's three dots: the menu of its secondary commands, headed by the record's name.
|
|
39
|
+
*
|
|
40
|
+
* @family Menus
|
|
41
|
+
* @when The secondary commands of one record from a visible trigger: the row's three dots, or the page's, which comes last in the title row.
|
|
42
|
+
* @instead For a record's main task use a visible button (Edit opens the row). For finding across everything use `CommandDialog`. For a value to choose use `Select`. For right-click use the mirror, `ActionContextMenu`.
|
|
43
|
+
* @behaviour Ghost 36 px trigger that keeps its fill while open. The menu opens aligned to the trigger's end, 6 px below: the record's name, the commands with their icons first and the value one acts on in mono under it, then the destructive ones after a divider in the error colour. Typeahead, arrows, Escape returns focus. A disabled command stays, greyed, with its reason under it. Nothing renders with no command.
|
|
44
|
+
* @words The trigger reads "More for {record}"; the header is the record's name. Commands are verb and noun in sentence case, "Remove mailbox", never a bare "Delete". About ten at most; rows wrap, never truncate.
|
|
45
|
+
* @access The trigger is a ghost icon button named by `label`, `aria-expanded` while open. `role="menu"`, items `menuitem` in a group named by the record; the value a command acts on and its reason are the item's description; icons hidden.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ActionMenu({ label, record, commands, triggerId, open, onOpenChange, modal, side, finalFocus, }: ActionMenuProps): import("react").JSX.Element | null;
|
|
48
|
+
/** The same commands on a right-click, Shift+F10 or the Menu key of the record's row. */
|
|
49
|
+
export type ActionContextMenuProps = RecordMenu & {
|
|
50
|
+
/** The record's row, which keeps its own element and opens the menu. */
|
|
51
|
+
children: ReactElement;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* A record's menu opened from its row by a right-click: the mirror of its `ActionMenu`.
|
|
55
|
+
*
|
|
56
|
+
* @family Menus
|
|
57
|
+
* @when A right-click or long-press convenience on a record that already has a visible menu with the same commands.
|
|
58
|
+
* @instead For anything a person must find use the visible three dots or a button: a context menu is never the only way. For global search use `CommandDialog`.
|
|
59
|
+
* @behaviour The dropdown's surface and rows exactly, opening at the pointer. The same commands in the same order, the same disabled reasons, destructive last after a divider. With no command the row renders alone.
|
|
60
|
+
* @words Identical to the visible menu's, in the same order; a command reached two ways reads the same both ways.
|
|
61
|
+
* @access The Menu key and Shift+F10 open it on the focused row. The menu is named by `label`; Escape closes it and returns focus to the row.
|
|
62
|
+
*/
|
|
63
|
+
export declare function ActionContextMenu({ label, record, commands, children }: ActionContextMenuProps): import("react").JSX.Element;
|
|
8
64
|
//# sourceMappingURL=action-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu.d.ts","sourceRoot":"","sources":["../../src/components/action-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"action-menu.d.ts","sourceRoot":"","sources":["../../src/components/action-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrE,OAAO,EAAgB,mBAAmB,EAAuB,MAAM,4BAA4B,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,sFAAsF;IACtF,MAAM,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jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { EllipsisIcon } from "lucide-react";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
|
+
import { ContextMenu, ContextMenuContent, ContextMenuTrigger } from "./context-menu.js";
|
|
5
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import { RecordMenuItems } from "../internal/record-menu-items.js";
|
|
8
|
+
/**
|
|
9
|
+
* A record's three dots: the menu of its secondary commands, headed by the record's name.
|
|
10
|
+
*
|
|
11
|
+
* @family Menus
|
|
12
|
+
* @when The secondary commands of one record from a visible trigger: the row's three dots, or the page's, which comes last in the title row.
|
|
13
|
+
* @instead For a record's main task use a visible button (Edit opens the row). For finding across everything use `CommandDialog`. For a value to choose use `Select`. For right-click use the mirror, `ActionContextMenu`.
|
|
14
|
+
* @behaviour Ghost 36 px trigger that keeps its fill while open. The menu opens aligned to the trigger's end, 6 px below: the record's name, the commands with their icons first and the value one acts on in mono under it, then the destructive ones after a divider in the error colour. Typeahead, arrows, Escape returns focus. A disabled command stays, greyed, with its reason under it. Nothing renders with no command.
|
|
15
|
+
* @words The trigger reads "More for {record}"; the header is the record's name. Commands are verb and noun in sentence case, "Remove mailbox", never a bare "Delete". About ten at most; rows wrap, never truncate.
|
|
16
|
+
* @access The trigger is a ghost icon button named by `label`, `aria-expanded` while open. `role="menu"`, items `menuitem` in a group named by the record; the value a command acts on and its reason are the item's description; icons hidden.
|
|
17
|
+
*/
|
|
18
|
+
export function ActionMenu({ label, record, commands, triggerId, open, onOpenChange, modal, side = "bottom", finalFocus, }) {
|
|
19
|
+
if (commands.length === 0)
|
|
20
|
+
return null;
|
|
21
|
+
return (_jsxs(DropdownMenu, { modal: modal, onOpenChange: onOpenChange ? (next) => onOpenChange(next) : undefined, open: open, children: [_jsx(DropdownMenuTrigger, { id: triggerId, "aria-label": label, render: _jsx(Button, { variant: "ghost", size: "icon" }), children: _jsx(EllipsisIcon, { "aria-hidden": "true" }) }), _jsx(DropdownMenuContent, { align: "end", finalFocus: finalFocus, side: side, children: _jsx(RecordMenuItems, { commands: commands, record: record }) })] }));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A record's menu opened from its row by a right-click: the mirror of its `ActionMenu`.
|
|
25
|
+
*
|
|
26
|
+
* @family Menus
|
|
27
|
+
* @when A right-click or long-press convenience on a record that already has a visible menu with the same commands.
|
|
28
|
+
* @instead For anything a person must find use the visible three dots or a button: a context menu is never the only way. For global search use `CommandDialog`.
|
|
29
|
+
* @behaviour The dropdown's surface and rows exactly, opening at the pointer. The same commands in the same order, the same disabled reasons, destructive last after a divider. With no command the row renders alone.
|
|
30
|
+
* @words Identical to the visible menu's, in the same order; a command reached two ways reads the same both ways.
|
|
31
|
+
* @access The Menu key and Shift+F10 open it on the focused row. The menu is named by `label`; Escape closes it and returns focus to the row.
|
|
32
|
+
*/
|
|
33
|
+
export function ActionContextMenu({ label, record, commands, children }) {
|
|
34
|
+
if (commands.length === 0)
|
|
35
|
+
return children;
|
|
36
|
+
return (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { render: children }), _jsx(ContextMenuContent, { "aria-label": label, children: _jsx(RecordMenuItems, { commands: commands, record: record }) })] }));
|
|
8
37
|
}
|
|
@@ -7,9 +7,19 @@ interface ActionStatusProps {
|
|
|
7
7
|
idleIcon?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* A control's three words on one action: what it does, what it is doing, what
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* A control's three words on one action: what it does, what it is doing, what it did.
|
|
11
|
+
*
|
|
12
|
+
* @family Status
|
|
13
|
+
* @when A control that reports its own action: what it does, what it is doing, what it did. Waits
|
|
14
|
+
* under about a second.
|
|
15
|
+
* @instead The record's resulting state is a `StatusBadge`. A wait past a second adds one waiting
|
|
16
|
+
* line beside the work. An Agent's work is her orb.
|
|
17
|
+
* @behaviour Saving keeps the idle icon, the size and the place; only the word changes. The caller
|
|
18
|
+
* sets `disabled` and `aria-busy`. Done shows the check.
|
|
19
|
+
* @words Verb and noun idle (*Save changes*), the verb in progress (*Saving*), the result
|
|
20
|
+
* (*Saved*). No ellipsis. Italian: *Salva modifiche*, *Salvataggio*, *Salvato*.
|
|
21
|
+
* @access The button's name is the current word. The result is announced once in a `role="status"`
|
|
22
|
+
* region; a failure as an alert.
|
|
13
23
|
*/
|
|
14
24
|
declare function ActionStatus({ state, idle, busy, done, idleIcon }: ActionStatusProps): import("react").JSX.Element;
|
|
15
25
|
export { ActionStatus };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-status.d.ts","sourceRoot":"","sources":["../../src/components/action-status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AACD
|
|
1
|
+
{"version":3,"file":"action-status.d.ts","sourceRoot":"","sources":["../../src/components/action-status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AACD;;;;;;;;;;;;;;GAcG;AACH,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAe,EAAE,EAAE,iBAAiB,+BAOpF;AACD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CheckIcon } from "lucide-react";
|
|
3
3
|
/**
|
|
4
|
-
* A control's three words on one action: what it does, what it is doing, what
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* A control's three words on one action: what it does, what it is doing, what it did.
|
|
5
|
+
*
|
|
6
|
+
* @family Status
|
|
7
|
+
* @when A control that reports its own action: what it does, what it is doing, what it did. Waits
|
|
8
|
+
* under about a second.
|
|
9
|
+
* @instead The record's resulting state is a `StatusBadge`. A wait past a second adds one waiting
|
|
10
|
+
* line beside the work. An Agent's work is her orb.
|
|
11
|
+
* @behaviour Saving keeps the idle icon, the size and the place; only the word changes. The caller
|
|
12
|
+
* sets `disabled` and `aria-busy`. Done shows the check.
|
|
13
|
+
* @words Verb and noun idle (*Save changes*), the verb in progress (*Saving*), the result
|
|
14
|
+
* (*Saved*). No ellipsis. Italian: *Salva modifiche*, *Salvataggio*, *Salvato*.
|
|
15
|
+
* @access The button's name is the current word. The result is announced once in a `role="status"`
|
|
16
|
+
* region; a failure as an alert.
|
|
7
17
|
*/
|
|
8
18
|
function ActionStatus({ state, idle, busy, done, idleIcon = null }) {
|
|
9
19
|
return (_jsxs(_Fragment, { children: [state === "done" ? _jsx(CheckIcon, { "aria-hidden": "true", "data-icon": "inline-start" }) : idleIcon, state === "saving" ? busy : state === "done" ? done : idle] }));
|
|
@@ -21,6 +21,20 @@ type ActivityCalendarProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> &
|
|
|
21
21
|
valueFormatter?: (value: number) => string;
|
|
22
22
|
};
|
|
23
23
|
declare function activityCalendarData(data: readonly ActivityCalendarDatum[], from: string, to: string): Activity[];
|
|
24
|
+
/**
|
|
25
|
+
* On which days activity happened, as a year of cells.
|
|
26
|
+
*
|
|
27
|
+
* @family Charts
|
|
28
|
+
* @when On which measured days activity happened, over the window the data covers, up to the last
|
|
29
|
+
* 365 days.
|
|
30
|
+
* @instead Never added to fill a row. Amounts over time are a bar or area chart. It follows the
|
|
31
|
+
* selected metric and names its own from-to window.
|
|
32
|
+
* @behaviour One hue, chart-1, at four steps of opacity over an empty day; a legend from Less to
|
|
33
|
+
* More. Only measured history: unknown coverage stays unknown, never zero.
|
|
34
|
+
* @words The window as dates in the description. Each day's label: *8 October 2026: 42 requests*.
|
|
35
|
+
* @access Every day is a named cell for assistive technology; the legend steps are named too.
|
|
36
|
+
* Colour is never the only reading: the value is in each label.
|
|
37
|
+
*/
|
|
24
38
|
declare function ActivityCalendar({ data, from, to, locale, labels, valueFormatter, className, ...props }: ActivityCalendarProps): import("react").JSX.Element;
|
|
25
39
|
export { ActivityCalendar, activityCalendarData };
|
|
26
40
|
export type { ActivityCalendarDatum, ActivityCalendarLabels, ActivityCalendarProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-calendar.d.ts","sourceRoot":"","sources":["../../src/components/activity-calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAML,KAAK,QAAQ,EACd,MAAM,uCAAuC,CAAC;AAG/C,KAAK,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9E,IAAI,EAAE,SAAS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,CAAC,GAAG;IAC9E,IAAI,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C,CAAC;AAwBF,iBAAS,oBAAoB,CAC3B,IAAI,EAAE,SAAS,qBAAqB,EAAE,EACtC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,QAAQ,EAAE,CAKZ;AAeD;;;;;;;;;;;;;GAaG;AACH,iBAAS,gBAAgB,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,EAAE,EACF,MAAM,EACN,MAAM,EACN,cAAuE,EACvE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAwCvB;AAED,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -32,6 +32,20 @@ function localizedCalendarLabels(locale) {
|
|
|
32
32
|
weekdays: Array.from({ length: 7 }, (_, day) => weekdays.format(new Date(Date.UTC(2024, 0, 7 + day)))),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* On which days activity happened, as a year of cells.
|
|
37
|
+
*
|
|
38
|
+
* @family Charts
|
|
39
|
+
* @when On which measured days activity happened, over the window the data covers, up to the last
|
|
40
|
+
* 365 days.
|
|
41
|
+
* @instead Never added to fill a row. Amounts over time are a bar or area chart. It follows the
|
|
42
|
+
* selected metric and names its own from-to window.
|
|
43
|
+
* @behaviour One hue, chart-1, at four steps of opacity over an empty day; a legend from Less to
|
|
44
|
+
* More. Only measured history: unknown coverage stays unknown, never zero.
|
|
45
|
+
* @words The window as dates in the description. Each day's label: *8 October 2026: 42 requests*.
|
|
46
|
+
* @access Every day is a named cell for assistive technology; the legend steps are named too.
|
|
47
|
+
* Colour is never the only reading: the value is in each label.
|
|
48
|
+
*/
|
|
35
49
|
function ActivityCalendar({ data, from, to, locale, labels, valueFormatter = (value) => new Intl.NumberFormat(locale).format(value), className, ...props }) {
|
|
36
50
|
const calendarData = activityCalendarData(data, from, to);
|
|
37
51
|
const dateFormatter = new Intl.DateTimeFormat(locale, {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { DateRangeControl } from "./chart-date-range-control.js";
|
|
3
|
+
import { type CollectionFiltersProps } from "./collection-filters.js";
|
|
4
|
+
import { type CollectionSearchProps } from "./collection-search.js";
|
|
5
|
+
import { type EmptyStateKind } from "./empty-state.js";
|
|
6
|
+
import { type IdentityMarkProps } from "./identity-mark.js";
|
|
7
|
+
import { type PageCommand } from "./page-actions.js";
|
|
8
|
+
import type { RecordStatus } from "./record-list.js";
|
|
9
|
+
export type ActivityEvent = {
|
|
10
|
+
id: string;
|
|
11
|
+
/** Shown as the time of day in the viewer's zone; UTC and local on hover. */
|
|
12
|
+
at: Date | number | string;
|
|
13
|
+
/** Who did it, at 24: a person's initials, an Agent's orb, an Installation's tile. The system's own work has none. */
|
|
14
|
+
actor?: IdentityMarkProps;
|
|
15
|
+
/** The sentence: the actor's name in <strong>, the action, the object as a value link. */
|
|
16
|
+
summary: ReactNode;
|
|
17
|
+
/** Only for the exception: a revocation, a failure. */
|
|
18
|
+
status?: RecordStatus | null;
|
|
19
|
+
/** One muted line. */
|
|
20
|
+
detail?: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export type ActivityDay = {
|
|
23
|
+
id: string;
|
|
24
|
+
/** "Today" */
|
|
25
|
+
title: string;
|
|
26
|
+
/** "14 October" */
|
|
27
|
+
date: string;
|
|
28
|
+
/** Newest first. */
|
|
29
|
+
events: readonly ActivityEvent[];
|
|
30
|
+
};
|
|
31
|
+
export type ActivityFeedProps = {
|
|
32
|
+
label: string;
|
|
33
|
+
/** Newest day first; undefined while they load. */
|
|
34
|
+
days: readonly ActivityDay[] | undefined;
|
|
35
|
+
locale?: string;
|
|
36
|
+
/** The viewer's zone, which a page rendered on a server passes: each event's time of day is written in it. */
|
|
37
|
+
timeZone?: string;
|
|
38
|
+
/** Right above the rows; the product keeps them in the URL. */
|
|
39
|
+
search?: CollectionSearchProps;
|
|
40
|
+
filters?: CollectionFiltersProps;
|
|
41
|
+
range?: ComponentProps<typeof DateRangeControl>;
|
|
42
|
+
/** "Show older events"; never a page count. */
|
|
43
|
+
older?: PageCommand;
|
|
44
|
+
loadingLabel: string;
|
|
45
|
+
empty: EmptyStateKind<"nothingYet">;
|
|
46
|
+
/** Given only while a search or filter is set: "No events match these filters." with Clear filters. */
|
|
47
|
+
noMatch?: Omit<EmptyStateKind<"noResults">, "kind">;
|
|
48
|
+
failed?: EmptyStateKind<"failed">;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* What happened to a record, and when: one row per event under its day,
|
|
52
|
+
* newest first.
|
|
53
|
+
*
|
|
54
|
+
* @family Compositions
|
|
55
|
+
* @when A record's history: a Customer's, a Partner's or an Installation's Activity tab in the Portal, the company wiki's updates in Nadia. Each answers "what happened, and when?".
|
|
56
|
+
* @instead The steps of one Agent run, read in order, are a RunTimeline; a list of records a person finds and acts on is a CollectionPage; a single "last changed" fact is a RecordTime.
|
|
57
|
+
* @behaviour The search, filters and window sit right above the rows, kept in the URL by the product. Days stand newest first, each a title and a muted date over one card of rows; a row is the time of day, the actor's 24 px mark, the sentence with a status badge only for an exception, and one muted line of detail. "Show older events" follows the last day; there is never a page count. States, first that holds: failed, loading (still rows in the row's shape), no match with Clear filters, nothing yet in one line, the days. Under 900 px the time moves under the sentence. It draws no card header: the tab is the title.
|
|
58
|
+
* @words The sentence names the actor in `<strong>`, the action in the past tense and the object as a link that keeps the text's colour: "Marco Rinaldi created the Agent Acme Quotes". Day titles are "Today", "Yesterday", then the weekday; dates are the product's own ("14 October"). Nothing yet: "No events yet." and what will appear. No match: "No events match these filters.".
|
|
59
|
+
* @access The toolbar is named by `label`; each day's title is a level-3 heading over a list of its events; while loading, one status named by `loadingLabel` stands for the rows; each time is a `<time>` with its exact moment for assistive technology. A system event has no mark, so nothing empty is announced.
|
|
60
|
+
*/
|
|
61
|
+
export declare function ActivityFeed({ label, days, locale, timeZone, search, filters, range, older, loadingLabel, empty, noMatch, failed, }: ActivityFeedProps): import("react").JSX.Element;
|
|
62
|
+
//# sourceMappingURL=activity-feed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-feed.d.ts","sourceRoot":"","sources":["../../src/components/activity-feed.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,EAAE,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3B,sHAAsH;IACtH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,0FAA0F;IAC1F,OAAO,EAAE,SAAS,CAAC;IACnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,YAAY,GAAG,IAA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sx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Card } from "./card.js";
|
|
4
|
+
import { DateRangeControl } from "./chart-date-range-control.js";
|
|
5
|
+
import { CollectionFilters } from "./collection-filters.js";
|
|
6
|
+
import { CollectionSearch } from "./collection-search.js";
|
|
7
|
+
import { CollectionToolbar } from "./collection-toolbar.js";
|
|
8
|
+
import { EmptyState } from "./empty-state.js";
|
|
9
|
+
import { IdentityMark } from "./identity-mark.js";
|
|
10
|
+
import { PageCommandButton } from "./page-actions.js";
|
|
11
|
+
import { RecordTime } from "./record-time.js";
|
|
12
|
+
import { Skeleton } from "./skeleton.js";
|
|
13
|
+
import { StatusBadge } from "./status-badge.js";
|
|
14
|
+
const ROW = "grid grid-cols-[72px_24px_minmax(0,1fr)] items-start gap-3 px-4 py-3 max-[900px]:grid-cols-[24px_minmax(0,1fr)]";
|
|
15
|
+
const UNDER_TEXT = "max-[900px]:col-start-2 max-[900px]:row-start-2";
|
|
16
|
+
const MARK_CELL = "max-[900px]:col-start-1 max-[900px]:row-start-1";
|
|
17
|
+
const TEXT_CELL = "max-[900px]:col-start-2 max-[900px]:row-start-1";
|
|
18
|
+
const LOADING_ROWS = ["first", "second", "third"];
|
|
19
|
+
function EventRow({ event, locale, timeZone }) {
|
|
20
|
+
return (_jsxs("li", { className: ROW, "data-slot": "activity-event", children: [_jsx("div", { className: `text-label-sm leading-5 ${UNDER_TEXT}`, "data-slot": "activity-event-time", children: _jsx(RecordTime, { at: event.at, locale: locale, mode: "clock", timeZone: timeZone }) }), _jsx("div", { className: `flex h-5 items-center ${MARK_CELL}`, children: event.actor ? _jsx(IdentityMark, { ...event.actor, size: 24 }) : null }), _jsxs("div", { className: `min-w-0 ${TEXT_CELL}`, children: [_jsxs("div", { className: "text-body-sm text-muted-foreground [&_strong]:font-medium [&_strong]:text-foreground", children: [event.summary, event.status ? (_jsx(StatusBadge, { className: "ml-1.5 align-middle", label: event.status.label, tone: event.status.tone })) : null] }), event.detail ? (_jsx("div", { className: "mt-0.5 text-label-sm text-muted-foreground", children: event.detail })) : null] })] }));
|
|
21
|
+
}
|
|
22
|
+
function LoadingRows({ label }) {
|
|
23
|
+
return (_jsx("div", { "aria-busy": "true", "aria-label": label, role: "status", children: _jsx(Card, { className: "gap-0 divide-y divide-border py-0", surface: "resting", children: LOADING_ROWS.map((row) => (_jsxs("div", { "aria-hidden": "true", className: ROW, children: [_jsx(Skeleton, { className: `mt-1 h-2.5 w-12 ${UNDER_TEXT}` }), _jsx(Skeleton, { className: `size-6 ${MARK_CELL}`, shape: "circle" }), _jsxs("div", { className: `grid gap-2 pt-1 ${TEXT_CELL}`, children: [_jsx(Skeleton, { className: "h-2.5 w-4/5" }), _jsx(Skeleton, { className: "h-2.5 w-3/5" })] })] }, row))) }) }));
|
|
24
|
+
}
|
|
25
|
+
function Days({ days, locale, timeZone, older, }) {
|
|
26
|
+
return (_jsxs(_Fragment, { children: [days.map((day) => (_jsxs("div", { className: "flex flex-col gap-2", "data-slot": "activity-day", children: [_jsxs("h3", { className: "text-body-sm font-medium text-foreground", children: [day.title, " ", _jsx("span", { className: "text-muted-foreground", children: day.date })] }), _jsx(Card, { className: "gap-0 divide-y divide-border py-0", render: _jsx("ul", {}), surface: "resting", children: day.events.map((event) => (_jsx(EventRow, { event: event, locale: locale, timeZone: timeZone }, event.id))) })] }, day.id))), older ? (_jsx("div", { className: "flex justify-center", children: _jsx(PageCommandButton, { command: older, variant: "outline" }) })) : null] }));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What happened to a record, and when: one row per event under its day,
|
|
30
|
+
* newest first.
|
|
31
|
+
*
|
|
32
|
+
* @family Compositions
|
|
33
|
+
* @when A record's history: a Customer's, a Partner's or an Installation's Activity tab in the Portal, the company wiki's updates in Nadia. Each answers "what happened, and when?".
|
|
34
|
+
* @instead The steps of one Agent run, read in order, are a RunTimeline; a list of records a person finds and acts on is a CollectionPage; a single "last changed" fact is a RecordTime.
|
|
35
|
+
* @behaviour The search, filters and window sit right above the rows, kept in the URL by the product. Days stand newest first, each a title and a muted date over one card of rows; a row is the time of day, the actor's 24 px mark, the sentence with a status badge only for an exception, and one muted line of detail. "Show older events" follows the last day; there is never a page count. States, first that holds: failed, loading (still rows in the row's shape), no match with Clear filters, nothing yet in one line, the days. Under 900 px the time moves under the sentence. It draws no card header: the tab is the title.
|
|
36
|
+
* @words The sentence names the actor in `<strong>`, the action in the past tense and the object as a link that keeps the text's colour: "Marco Rinaldi created the Agent Acme Quotes". Day titles are "Today", "Yesterday", then the weekday; dates are the product's own ("14 October"). Nothing yet: "No events yet." and what will appear. No match: "No events match these filters.".
|
|
37
|
+
* @access The toolbar is named by `label`; each day's title is a level-3 heading over a list of its events; while loading, one status named by `loadingLabel` stands for the rows; each time is a `<time>` with its exact moment for assistive technology. A system event has no mark, so nothing empty is announced.
|
|
38
|
+
*/
|
|
39
|
+
export function ActivityFeed({ label, days, locale, timeZone, search, filters, range, older, loadingLabel, empty, noMatch, failed, }) {
|
|
40
|
+
const nothingYet = !failed && days?.length === 0 && !noMatch;
|
|
41
|
+
const toolbar = !nothingYet && (search || filters || range) ? (_jsx(CollectionToolbar, { actions: filters || range ? (_jsxs(_Fragment, { children: [filters ? _jsx(CollectionFilters, { ...filters }) : null, range ? _jsx(DateRangeControl, { ...range }) : null] })) : undefined, label: label, search: search ? _jsx(CollectionSearch, { ...search }) : undefined, surface: "plain" })) : null;
|
|
42
|
+
let body;
|
|
43
|
+
if (failed)
|
|
44
|
+
body = _jsx(EmptyState, { ...failed, scope: "region" });
|
|
45
|
+
else if (days === undefined)
|
|
46
|
+
body = _jsx(LoadingRows, { label: loadingLabel });
|
|
47
|
+
else if (days.length === 0 && noMatch)
|
|
48
|
+
body = _jsx(EmptyState, { ...noMatch, kind: "noResults", scope: "region" });
|
|
49
|
+
else if (days.length === 0)
|
|
50
|
+
body = _jsx(EmptyState, { ...empty, scope: "region" });
|
|
51
|
+
else
|
|
52
|
+
body = _jsx(Days, { days: days, locale: locale, older: older, timeZone: timeZone });
|
|
53
|
+
return (_jsxs("div", { className: "flex min-w-0 flex-col gap-4", "data-slot": "activity-feed", children: [toolbar, body] }));
|
|
54
|
+
}
|