@cosmicdrift/kumiko-renderer 0.413.1 → 0.415.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/dist/app/action-form-support.js +4 -0
- package/dist/app/content-previews.d.ts +39 -0
- package/dist/app/content-previews.js +28 -0
- package/dist/app/entity-edit-screen.js +2 -5
- package/dist/app/entity-list-screen.js +42 -59
- package/dist/app/form-schema.d.ts +1 -0
- package/dist/app/form-schema.js +24 -0
- package/dist/app/list-facets.d.ts +1 -0
- package/dist/app/list-facets.js +10 -1
- package/dist/app/list-sort-options.d.ts +4 -0
- package/dist/app/list-sort-options.js +11 -0
- package/dist/app/named-filter-facet.d.ts +16 -3
- package/dist/app/named-filter-facet.js +97 -5
- package/dist/app/projection-detail-body.d.ts +2 -4
- package/dist/app/projection-detail-body.js +7 -1
- package/dist/app/projection-detail-guidance-data.d.ts +7 -0
- package/dist/app/projection-detail-guidance-data.js +103 -0
- package/dist/app/projection-detail-guidance.d.ts +13 -0
- package/dist/app/projection-detail-guidance.js +197 -0
- package/dist/app/projection-detail-header-model.d.ts +1 -3
- package/dist/app/projection-detail-header-model.js +4 -8
- package/dist/app/projection-detail-header-region.d.ts +2 -1
- package/dist/app/projection-detail-header-region.js +63 -23
- package/dist/app/projection-detail-header.d.ts +6 -1
- package/dist/app/projection-detail-header.js +76 -18
- package/dist/app/projection-detail-navigation.d.ts +2 -0
- package/dist/app/projection-detail-navigation.js +13 -3
- package/dist/app/projection-detail-states.d.ts +3 -3
- package/dist/app/projection-list-body.js +4 -2
- package/dist/app/projection-list-render.js +3 -1
- package/dist/app/projection-list-shim.d.ts +4 -1
- package/dist/app/projection-list-shim.js +35 -8
- package/dist/app/reference-link.d.ts +3 -2
- package/dist/app/reference-link.js +19 -4
- package/dist/app/row-actions.js +3 -3
- package/dist/app/screen-access.d.ts +4 -0
- package/dist/app/screen-access.js +18 -0
- package/dist/app/screen-shared.js +3 -1
- package/dist/app/unique-label-keys.d.ts +1 -0
- package/dist/app/unique-label-keys.js +9 -0
- package/dist/app/use-entity-list-payload.d.ts +26 -0
- package/dist/app/use-entity-list-payload.js +59 -0
- package/dist/app/use-entity-range-facets.js +2 -3
- package/dist/app/use-facet-counts.d.ts +5 -0
- package/dist/app/use-facet-counts.js +7 -0
- package/dist/app/use-list-summary-row.d.ts +10 -0
- package/dist/app/use-list-summary-row.js +33 -0
- package/dist/app/use-named-filter-queue.d.ts +20 -0
- package/dist/app/use-named-filter-queue.js +9 -0
- package/dist/app/use-projection-detail-actions.d.ts +5 -4
- package/dist/app/use-projection-detail-actions.js +42 -1
- package/dist/app/use-projection-list-data.d.ts +5 -0
- package/dist/app/use-projection-list-data.js +35 -6
- package/dist/app/use-projection-list-query.d.ts +2 -0
- package/dist/app/use-projection-list-query.js +29 -16
- package/dist/app/use-related-list-tab-counts.js +5 -1
- package/dist/app/use-row-decoration.d.ts +13 -0
- package/dist/app/use-row-decoration.js +103 -0
- package/dist/app/use-screen-list-rows.d.ts +4 -1
- package/dist/app/use-screen-list-rows.js +14 -5
- package/dist/app/use-screen-list-table.d.ts +3 -1
- package/dist/app/use-screen-list-table.js +10 -1
- package/dist/app/write-failed-error.d.ts +1 -0
- package/dist/app/write-failed-error.js +10 -0
- package/dist/card-options.d.ts +25 -0
- package/dist/card-options.js +1 -0
- package/dist/compact-tap-classes.d.ts +1 -0
- package/dist/compact-tap-classes.js +3 -0
- package/dist/components/embedded-list-field.js +13 -12
- package/dist/components/list-empty-state.d.ts +13 -1
- package/dist/components/list-empty-state.js +20 -1
- package/dist/components/list-group-page-bridges.d.ts +1 -1
- package/dist/components/list-group-page-bridges.js +2 -2
- package/dist/components/related-list-section.js +4 -22
- package/dist/components/render-edit-action-button.d.ts +3 -1
- package/dist/components/render-edit-action-button.js +5 -3
- package/dist/components/render-edit-render-model.d.ts +2 -2
- package/dist/components/render-edit-types.d.ts +4 -2
- package/dist/components/render-edit.js +3 -1
- package/dist/components/render-list-hint-columns.d.ts +9 -0
- package/dist/components/render-list-hint-columns.js +87 -0
- package/dist/components/render-list-reference-columns.js +4 -2
- package/dist/components/render-list-row-tone.d.ts +3 -0
- package/dist/components/render-list-row-tone.js +10 -0
- package/dist/components/render-list-table-props.d.ts +9 -1
- package/dist/components/render-list-table-props.js +4 -1
- package/dist/components/render-list-toolbar-action.d.ts +1 -2
- package/dist/components/render-list-toolbar-model.d.ts +4 -1
- package/dist/components/render-list-toolbar-model.js +21 -6
- package/dist/components/render-list-toolbar.d.ts +3 -2
- package/dist/components/render-list-toolbar.js +8 -6
- package/dist/components/render-list-types.d.ts +6 -1
- package/dist/components/render-list.js +26 -7
- package/dist/components/use-render-edit-controlled-sync.js +3 -5
- package/dist/components/use-render-edit-draft-save.js +7 -9
- package/dist/components/use-render-edit-schema.d.ts +3 -0
- package/dist/components/use-render-edit-schema.js +15 -0
- package/dist/components/use-render-edit-state.d.ts +1 -0
- package/dist/components/use-render-edit-state.js +4 -1
- package/dist/components/use-render-edit-steps.js +2 -3
- package/dist/components/use-render-list-columns.d.ts +3 -1
- package/dist/components/use-render-list-columns.js +22 -10
- package/dist/context/screen-focus-context.d.ts +14 -0
- package/dist/context/screen-focus-context.js +28 -0
- package/dist/data-table-facet-types.d.ts +6 -0
- package/dist/data-table-view-types.d.ts +20 -1
- package/dist/headless/form/form-controller.js +3 -1
- package/dist/headless/form/zod-bridge.d.ts +7 -1
- package/dist/headless/form/zod-bridge.js +10 -0
- package/dist/headless/index.d.ts +2 -1
- package/dist/headless/index.js +1 -0
- package/dist/headless/pwa-service-worker-meta.d.ts +4 -0
- package/dist/headless/pwa-service-worker-meta.js +13 -0
- package/dist/headless/view-model/index.d.ts +1 -1
- package/dist/headless/view-model/list-file-display.js +3 -2
- package/dist/headless/view-model/list.js +16 -0
- package/dist/headless/view-model/types.d.ts +37 -0
- package/dist/hooks/list-column-layout.js +2 -1
- package/dist/hooks/list-server-groups.js +14 -1
- package/dist/hooks/list-state-schema.d.ts +1 -0
- package/dist/hooks/list-state-schema.js +9 -1
- package/dist/hooks/use-debounced-value.d.ts +1 -0
- package/dist/hooks/use-debounced-value.js +11 -0
- package/dist/hooks/use-list-aggregates.d.ts +5 -1
- package/dist/hooks/use-list-aggregates.js +9 -5
- package/dist/hooks/use-list-table.d.ts +2 -1
- package/dist/hooks/use-list-table.js +3 -9
- package/dist/hooks/use-list-url-state.d.ts +2 -0
- package/dist/hooks/use-list-url-state.js +12 -4
- package/dist/hooks/use-list-view-state.js +23 -3
- package/dist/hooks/use-reference-lookup.js +7 -2
- package/dist/hooks/use-remembered-list-params.d.ts +6 -2
- package/dist/hooks/use-remembered-list-params.js +18 -3
- package/dist/hooks/use-store.js +0 -1
- package/dist/i18n-defaults.js +39 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +4 -1
- package/dist/live/dispatcher-live.js +2 -0
- package/dist/metric-types.d.ts +4 -0
- package/dist/primitives-record-guidance.d.ts +55 -0
- package/dist/primitives-record-guidance.js +1 -0
- package/dist/primitives.d.ts +47 -54
- package/dist/server-clock.d.ts +6 -0
- package/dist/server-clock.js +20 -0
- package/dist/session/session-ended.d.ts +1 -0
- package/dist/session/session-ended.js +2 -2
- package/dist/status-tone.d.ts +1 -0
- package/dist/status-tone.js +5 -0
- package/dist/web/app/browser-locale.js +1 -1
- package/dist/web/app/client-plugin.d.ts +6 -1
- package/dist/web/app/create-app.d.ts +2 -1
- package/dist/web/app/create-app.js +15 -5
- package/dist/web/app/dashboard-body.js +25 -11
- package/dist/web/app/dashboard-header.d.ts +2 -1
- package/dist/web/app/dashboard-header.js +19 -7
- package/dist/web/app/dashboard-list-panel.d.ts +12 -0
- package/dist/web/app/dashboard-list-panel.js +144 -0
- package/dist/web/app/dashboard-narrow-gate.d.ts +6 -0
- package/dist/web/app/dashboard-narrow-gate.js +6 -0
- package/dist/web/app/dashboard-narrow-order.d.ts +3 -0
- package/dist/web/app/dashboard-narrow-order.js +6 -0
- package/dist/web/app/dashboard-navigation-link.d.ts +12 -0
- package/dist/web/app/dashboard-navigation-link.js +21 -0
- package/dist/web/app/dashboard-panels.d.ts +7 -23
- package/dist/web/app/dashboard-panels.js +55 -123
- package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
- package/dist/web/app/dashboard-reference-list-table.js +13 -4
- package/dist/web/app/dashboard-shared.d.ts +23 -7
- package/dist/web/app/dashboard-shared.js +45 -17
- package/dist/web/app/dashboard-stat-group-panel.d.ts +14 -0
- package/dist/web/app/dashboard-stat-group-panel.js +74 -0
- package/dist/web/app/dashboard-text-panel.d.ts +12 -0
- package/dist/web/app/dashboard-text-panel.js +167 -0
- package/dist/web/app/dashboard-text.d.ts +2 -0
- package/dist/web/app/dashboard-text.js +1 -1
- package/dist/web/app/dashboard-visibility.js +1 -1
- package/dist/web/app/relative-time.js +2 -1
- package/dist/web/drawn-icons.d.ts +6 -0
- package/dist/web/drawn-icons.js +30 -0
- package/dist/web/editor/editor-footer.d.ts +28 -0
- package/dist/web/editor/editor-footer.js +23 -0
- package/dist/web/editor/editor-frame.d.ts +23 -0
- package/dist/web/editor/editor-frame.js +24 -0
- package/dist/web/editor/editor-header.d.ts +36 -0
- package/dist/web/editor/editor-header.js +30 -0
- package/dist/web/editor/editor-rail.d.ts +32 -0
- package/dist/web/editor/editor-rail.js +37 -0
- package/dist/web/editor/editor-workbench.d.ts +34 -0
- package/dist/web/editor/editor-workbench.js +19 -0
- package/dist/web/editor/index.d.ts +6 -0
- package/dist/web/editor/index.js +6 -0
- package/dist/web/editor/relative-when.d.ts +1 -0
- package/dist/web/editor/relative-when.js +18 -0
- package/dist/web/icons.js +6 -5
- package/dist/web/index.d.ts +9 -1
- package/dist/web/index.js +7 -1
- package/dist/web/layout/default-app-shell.js +6 -4
- package/dist/web/layout/focus-aware-sidebar.d.ts +4 -7
- package/dist/web/layout/focus-aware-sidebar.js +5 -7
- package/dist/web/layout/header-action-pinned.d.ts +8 -0
- package/dist/web/layout/header-action-pinned.js +25 -0
- package/dist/web/layout/nav-collapse-state.d.ts +7 -0
- package/dist/web/layout/nav-collapse-state.js +76 -0
- package/dist/web/layout/nav-tree.js +71 -28
- package/dist/web/layout/notification-bell.d.ts +7 -2
- package/dist/web/layout/notification-bell.js +16 -5
- package/dist/web/layout/page-header-slot.d.ts +2 -0
- package/dist/web/layout/page-header-slot.js +4 -0
- package/dist/web/layout/screen-focus.d.ts +8 -0
- package/dist/web/layout/screen-focus.js +42 -0
- package/dist/web/layout/shell-focus.d.ts +5 -4
- package/dist/web/layout/shell-focus.js +14 -7
- package/dist/web/layout/shell-header.d.ts +2 -1
- package/dist/web/layout/shell-header.js +84 -27
- package/dist/web/layout/shell-style.d.ts +3 -0
- package/dist/web/layout/shell-style.js +6 -0
- package/dist/web/layout/sidebar-open-state.d.ts +6 -0
- package/dist/web/layout/sidebar-open-state.js +28 -0
- package/dist/web/layout/uniform-bar-controls.d.ts +2 -2
- package/dist/web/layout/uniform-bar-controls.js +4 -3
- package/dist/web/layout/use-in-app-inbox.js +8 -1
- package/dist/web/layout/workspace-shell.d.ts +11 -1
- package/dist/web/layout/workspace-shell.js +9 -5
- package/dist/web/lib/upload-file-ref.d.ts +2 -2
- package/dist/web/lib/upload-file-ref.js +4 -9
- package/dist/web/presence/use-presence.js +7 -2
- package/dist/web/primitives/banner.d.ts +1 -1
- package/dist/web/primitives/banner.js +22 -9
- package/dist/web/primitives/calendar-day-picker.js +24 -5
- package/dist/web/primitives/card.js +18 -8
- package/dist/web/primitives/code-input.js +6 -1
- package/dist/web/primitives/data-table/actions-column.d.ts +2 -1
- package/dist/web/primitives/data-table/actions-column.js +7 -3
- package/dist/web/primitives/data-table/card-body.d.ts +6 -1
- package/dist/web/primitives/data-table/card-body.js +53 -6
- package/dist/web/primitives/data-table/card-frame.d.ts +8 -0
- package/dist/web/primitives/data-table/card-frame.js +9 -0
- package/dist/web/primitives/data-table/card-row.js +44 -7
- package/dist/web/primitives/data-table/card-sort-select.d.ts +6 -2
- package/dist/web/primitives/data-table/card-sort-select.js +10 -7
- package/dist/web/primitives/data-table/card-view.js +12 -2
- package/dist/web/primitives/data-table/column-picker-section.js +9 -2
- package/dist/web/primitives/data-table/column-resize-handle.js +3 -4
- package/dist/web/primitives/data-table/column-role.d.ts +1 -0
- package/dist/web/primitives/data-table/column-role.js +1 -0
- package/dist/web/primitives/data-table/data-cell-props.d.ts +5 -0
- package/dist/web/primitives/data-table/data-cell-props.js +5 -0
- package/dist/web/primitives/data-table/density.js +1 -0
- package/dist/web/primitives/data-table/facet-cluster.d.ts +2 -1
- package/dist/web/primitives/data-table/facet-cluster.js +2 -2
- package/dist/web/primitives/data-table/group-band.js +4 -0
- package/dist/web/primitives/data-table/hint-cell.d.ts +14 -0
- package/dist/web/primitives/data-table/hint-cell.js +68 -0
- package/dist/web/primitives/data-table/hint-column-width.d.ts +3 -0
- package/dist/web/primitives/data-table/hint-column-width.js +11 -0
- package/dist/web/primitives/data-table/measure-value.js +2 -3
- package/dist/web/primitives/data-table/row-action-column.d.ts +3 -0
- package/dist/web/primitives/data-table/row-action-column.js +4 -0
- package/dist/web/primitives/data-table/row-render-parts.d.ts +1 -1
- package/dist/web/primitives/data-table/row-render-parts.js +3 -2
- package/dist/web/primitives/data-table/sort-options-select.d.ts +22 -0
- package/dist/web/primitives/data-table/sort-options-select.js +46 -0
- package/dist/web/primitives/data-table/sortable-header.d.ts +3 -1
- package/dist/web/primitives/data-table/sortable-header.js +5 -3
- package/dist/web/primitives/data-table/table-body.d.ts +1 -1
- package/dist/web/primitives/data-table/table-body.js +5 -3
- package/dist/web/primitives/data-table/table-chrome.js +3 -1
- package/dist/web/primitives/data-table/table-content.js +12 -7
- package/dist/web/primitives/data-table/table-data-cell.js +9 -3
- package/dist/web/primitives/data-table/table-header-row.js +5 -2
- package/dist/web/primitives/data-table/table-view.js +22 -3
- package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
- package/dist/web/primitives/data-table/toolbar.d.ts +2 -0
- package/dist/web/primitives/data-table/toolbar.js +70 -7
- package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
- package/dist/web/primitives/data-table/totals-footer.js +41 -9
- package/dist/web/primitives/data-table/use-bulk-selection.js +2 -1
- package/dist/web/primitives/data-table/use-column-pins.js +4 -0
- package/dist/web/primitives/data-table/use-data-table-state.d.ts +1 -0
- package/dist/web/primitives/data-table/use-data-table-state.js +9 -5
- package/dist/web/primitives/data-table/use-measured-column-widths.js +5 -4
- package/dist/web/primitives/data-table/use-row-selection.js +22 -11
- package/dist/web/primitives/data-table/view-menu.js +7 -1
- package/dist/web/primitives/data-table-cell.d.ts +21 -2
- package/dist/web/primitives/data-table-cell.js +129 -26
- package/dist/web/primitives/embedded-file-cell.js +3 -2
- package/dist/web/primitives/embedded-list-cards.js +3 -4
- package/dist/web/primitives/facet-filter.d.ts +5 -3
- package/dist/web/primitives/facet-filter.js +36 -5
- package/dist/web/primitives/facet-search-filter.d.ts +2 -1
- package/dist/web/primitives/facet-search-filter.js +3 -2
- package/dist/web/primitives/facet-trigger-label.d.ts +8 -0
- package/dist/web/primitives/facet-trigger-label.js +9 -0
- package/dist/web/primitives/file-thumbnail.d.ts +6 -2
- package/dist/web/primitives/file-thumbnail.js +13 -6
- package/dist/web/primitives/file-upload.js +3 -2
- package/dist/web/primitives/file-view-action.d.ts +6 -0
- package/dist/web/primitives/file-view-action.js +22 -0
- package/dist/web/primitives/files-dropzone.js +20 -9
- package/dist/web/primitives/form-footer-parts.d.ts +0 -1
- package/dist/web/primitives/form.js +0 -1
- package/dist/web/primitives/hint-reason-row.d.ts +32 -0
- package/dist/web/primitives/hint-reason-row.js +45 -0
- package/dist/web/primitives/index.js +6 -0
- package/dist/web/primitives/layout-elements.d.ts +1 -1
- package/dist/web/primitives/layout-elements.js +3 -3
- package/dist/web/primitives/metric.js +20 -6
- package/dist/web/primitives/page-header.d.ts +1 -1
- package/dist/web/primitives/page-header.js +10 -2
- package/dist/web/primitives/pager.d.ts +3 -2
- package/dist/web/primitives/pager.js +31 -24
- package/dist/web/primitives/reason-box.d.ts +20 -0
- package/dist/web/primitives/reason-box.js +13 -0
- package/dist/web/primitives/record-breadcrumb.d.ts +3 -0
- package/dist/web/primitives/record-breadcrumb.js +11 -0
- package/dist/web/primitives/record-steps.d.ts +3 -0
- package/dist/web/primitives/record-steps.js +50 -0
- package/dist/web/primitives/record-summary.d.ts +3 -0
- package/dist/web/primitives/record-summary.js +18 -0
- package/dist/web/primitives/row-actions.d.ts +3 -1
- package/dist/web/primitives/row-actions.js +14 -5
- package/dist/web/primitives/segmented-select.js +10 -9
- package/dist/web/primitives/tabs.js +6 -1
- package/dist/web/pwa/pwa-support.d.ts +4 -0
- package/dist/web/pwa/pwa-support.js +131 -0
- package/dist/web/sse/live-events.js +2 -2
- package/dist/web/tokens.js +0 -3
- package/dist/web/ui/sidebar.d.ts +2 -1
- package/dist/web/ui/sidebar.js +4 -3
- package/dist/web/widgets/ai-text-field.js +3 -2
- package/dist/web/widgets/chart-parts.d.ts +7 -1
- package/dist/web/widgets/chart-parts.js +10 -4
- package/dist/web/widgets/collapsible-section.js +1 -1
- package/dist/web/widgets/dashboard-list-cards.d.ts +17 -0
- package/dist/web/widgets/dashboard-list-cards.js +46 -0
- package/dist/web/widgets/dashboard-list.d.ts +45 -5
- package/dist/web/widgets/dashboard-list.js +126 -25
- package/dist/web/widgets/drawer-panel-class.d.ts +1 -0
- package/dist/web/widgets/drawer-panel-class.js +9 -1
- package/dist/web/widgets/drawer-sizing.js +1 -1
- package/dist/web/widgets/drawer.js +2 -2
- package/dist/web/widgets/floating-panel.js +4 -2
- package/dist/web/widgets/index.d.ts +2 -0
- package/dist/web/widgets/index.js +2 -0
- package/dist/web/widgets/infinity-list.js +18 -11
- package/dist/web/widgets/pdf-viewer-toolbar.js +3 -2
- package/dist/web/widgets/preview-width-frame.d.ts +7 -0
- package/dist/web/widgets/preview-width-frame.js +10 -0
- package/dist/web/widgets/section-card.d.ts +1 -1
- package/dist/web/widgets/sheet-parts.js +3 -1
- package/dist/web/widgets/stacked-area-chrome.js +3 -3
- package/dist/web/widgets/stacked-area-tooltip.js +2 -10
- package/dist/web/widgets/stat-box-cell.d.ts +19 -0
- package/dist/web/widgets/stat-box-cell.js +10 -0
- package/dist/web/widgets/stat.d.ts +16 -1
- package/dist/web/widgets/stat.js +24 -7
- package/dist/web/widgets/status-badge.d.ts +7 -5
- package/dist/web/widgets/status-badge.js +2 -2
- package/dist/web/widgets/step-bar.d.ts +1 -1
- package/dist/web/widgets/step-bar.js +37 -7
- package/dist/web/widgets/step-list-row.d.ts +4 -0
- package/dist/web/widgets/step-list-row.js +22 -14
- package/dist/web/widgets/step-list.d.ts +12 -4
- package/dist/web/widgets/step-list.js +38 -20
- package/dist/web/widgets/upload-zone.d.ts +8 -1
- package/dist/web/widgets/upload-zone.js +13 -3
- package/package.json +5 -5
- package/src/changes.json +289 -0
- package/src/web/styles.css +15 -0
|
@@ -1,47 +1,148 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowUpRight, ChevronRight } from "lucide-react";
|
|
3
|
+
import { EMPTY_VALUE_PLACEHOLDER, } from "../../headless/index.js";
|
|
4
|
+
import { isSelectOptionTone } from "../../status-tone.js";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { HintCell } from "../primitives/data-table/hint-cell.js";
|
|
7
|
+
import { CellTextLink, LINK_BUTTON_CLASS, LIST_BADGE_TONE, rowToneClass, toneDotClass, } from "../primitives/data-table-cell.js";
|
|
8
|
+
import { HintReasonRowScope, hintReasonOf } from "../primitives/hint-reason-row.js";
|
|
3
9
|
import { StatusBadge } from "./status-badge.js";
|
|
4
|
-
const BADGE_TONE = {
|
|
5
|
-
positive: "ok",
|
|
6
|
-
warn: "warn",
|
|
7
|
-
negative: "bad",
|
|
8
|
-
neutral: "muted",
|
|
9
|
-
};
|
|
10
10
|
function fractionOf(raw) {
|
|
11
11
|
return typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.min(1, raw)) : 0;
|
|
12
12
|
}
|
|
13
13
|
// Rows may carry i18n keys (quota labels, failure reasons); translate falls back to the key itself.
|
|
14
14
|
const I18N_KEY_SHAPE = /^[a-z][\w-]*(?:[:.][\w-]+)+$/i;
|
|
15
|
-
function
|
|
15
|
+
function timestampMsOf(raw) {
|
|
16
|
+
return typeof raw === "number" ? raw : typeof raw === "string" ? Date.parse(raw) : Number.NaN;
|
|
17
|
+
}
|
|
18
|
+
/** Plain-text form of a cell value, for places that cannot render the cell itself (phone line). */
|
|
19
|
+
export function dashboardListCellText(column, row, field, formats, translate) {
|
|
20
|
+
const raw = row[field];
|
|
21
|
+
if (column.display === "bar")
|
|
22
|
+
return formats.formatPercent(fractionOf(raw));
|
|
23
|
+
if (column.display === "datetime") {
|
|
24
|
+
const atMs = timestampMsOf(raw);
|
|
25
|
+
return Number.isFinite(atMs) ? formats.formatDateTime(atMs) : undefined;
|
|
26
|
+
}
|
|
27
|
+
if (raw === undefined || raw === null || raw === "")
|
|
28
|
+
return undefined;
|
|
29
|
+
if (column.renderValue === undefined && typeof raw === "number")
|
|
30
|
+
return formats.formatNumber(raw);
|
|
31
|
+
const text = column.renderValue !== undefined
|
|
32
|
+
? column.renderValue(raw, row)
|
|
33
|
+
: typeof raw === "string"
|
|
34
|
+
? raw
|
|
35
|
+
: undefined;
|
|
36
|
+
if (text === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
return I18N_KEY_SHAPE.test(text) ? translate(text) : text;
|
|
39
|
+
}
|
|
40
|
+
export function DashboardListCell({ column, row, formatPercent, formatNumber, formatDateTime, translate, leading, }) {
|
|
16
41
|
const raw = row[column.field];
|
|
42
|
+
const empty = column.emptyPlaceholder === false ? "" : EMPTY_VALUE_PLACEHOLDER;
|
|
43
|
+
if (column.hint !== undefined) {
|
|
44
|
+
return _jsx(HintCell, { value: raw, row: row, hint: column.hint, leading: leading });
|
|
45
|
+
}
|
|
17
46
|
if (column.display === "bar") {
|
|
18
47
|
const fraction = fractionOf(raw);
|
|
19
48
|
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { role: "progressbar", "aria-valuenow": Math.round(fraction * 100), "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": column.label, className: "h-1 min-w-16 flex-1 overflow-hidden rounded-full bg-border", children: _jsx("div", { className: "h-full rounded-full bg-status-active", style: { width: `${fraction * 100}%` } }) }), _jsx("span", { className: "w-10 shrink-0 text-right tabular-nums text-muted-foreground", children: formatPercent(fraction) })] }));
|
|
20
49
|
}
|
|
21
50
|
if (column.display === "badge") {
|
|
22
51
|
if (raw === undefined || raw === null || raw === "")
|
|
23
|
-
return
|
|
52
|
+
return empty;
|
|
24
53
|
const toneKey = column.badgeToneField !== undefined ? row[column.badgeToneField] : undefined;
|
|
25
|
-
const tone = (typeof toneKey === "string" ?
|
|
26
|
-
return _jsx(StatusBadge, { tone: tone, children: String(raw) });
|
|
54
|
+
const tone = (typeof toneKey === "string" ? LIST_BADGE_TONE[toneKey] : undefined) ?? "muted";
|
|
55
|
+
return (_jsx(StatusBadge, { tone: tone, dot: column.badgeDot !== false, children: String(raw) }));
|
|
27
56
|
}
|
|
28
57
|
if (column.display === "datetime") {
|
|
29
|
-
const atMs =
|
|
58
|
+
const atMs = timestampMsOf(raw);
|
|
30
59
|
if (!Number.isFinite(atMs))
|
|
31
|
-
return
|
|
32
|
-
return _jsx("span", { className: "tabular-nums", children: formatDateTime(atMs) });
|
|
60
|
+
return empty;
|
|
61
|
+
return _jsx("span", { className: "font-mono text-[12.5px] tabular-nums", children: formatDateTime(atMs) });
|
|
62
|
+
}
|
|
63
|
+
if (column.display === "button") {
|
|
64
|
+
const link = column.linkFor?.(raw, row);
|
|
65
|
+
if (raw === undefined || raw === null || raw === "")
|
|
66
|
+
return empty;
|
|
67
|
+
const text = column.renderValue?.(raw, row) ?? String(raw);
|
|
68
|
+
const label = I18N_KEY_SHAPE.test(text) ? translate(text) : text;
|
|
69
|
+
return link === undefined ? (label) : (_jsx(CellTextLink, { link: link, className: LINK_BUTTON_CLASS, children: label }));
|
|
70
|
+
}
|
|
71
|
+
if (column.renderValue !== undefined) {
|
|
72
|
+
const text = column.renderValue(raw, row);
|
|
73
|
+
const link = column.linkFor?.(raw, row);
|
|
74
|
+
return link === undefined ? text : _jsx(CellTextLink, { link: link, children: text });
|
|
75
|
+
}
|
|
76
|
+
const link = column.linkFor?.(raw, row);
|
|
77
|
+
if (typeof raw === "number") {
|
|
78
|
+
const number = _jsx("span", { className: "tabular-nums", children: formatNumber(raw) });
|
|
79
|
+
return link === undefined ? number : _jsx(CellTextLink, { link: link, children: number });
|
|
33
80
|
}
|
|
34
|
-
if (column.renderValue !== undefined)
|
|
35
|
-
return column.renderValue(raw, row);
|
|
36
|
-
if (typeof raw === "number")
|
|
37
|
-
return _jsx("span", { className: "tabular-nums", children: formatNumber(raw) });
|
|
38
81
|
if (raw === undefined || raw === null || raw === "")
|
|
39
|
-
return
|
|
82
|
+
return empty;
|
|
40
83
|
const text = String(raw);
|
|
41
|
-
|
|
84
|
+
const shown = I18N_KEY_SHAPE.test(text) ? translate(text) : text;
|
|
85
|
+
return link === undefined ? shown : _jsx(CellTextLink, { link: link, children: shown });
|
|
86
|
+
}
|
|
87
|
+
export function rowToneOf(row, rowToneField) {
|
|
88
|
+
const value = rowToneField === undefined ? undefined : row[rowToneField];
|
|
89
|
+
return isSelectOptionTone(value) ? value : undefined;
|
|
90
|
+
}
|
|
91
|
+
function RowLinkIcon({ link, icon, label, }) {
|
|
92
|
+
if (link === undefined)
|
|
93
|
+
return null;
|
|
94
|
+
const Glyph = icon === "chevron" ? ChevronRight : ArrowUpRight;
|
|
95
|
+
return (_jsxs(CellTextLink, { link: link, className: "inline-flex text-muted-foreground hover:text-foreground", children: [_jsx(Glyph, { className: "size-4", "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: label })] }));
|
|
96
|
+
}
|
|
97
|
+
const INTERACTIVE_DESCENDANT_SELECTOR = "a, button";
|
|
98
|
+
function pressRowLink(event, link) {
|
|
99
|
+
if (link === undefined)
|
|
100
|
+
return;
|
|
101
|
+
if (event.target instanceof Element && event.target.closest(INTERACTIVE_DESCENDANT_SELECTOR)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
link.onPress();
|
|
105
|
+
}
|
|
106
|
+
function ToneDot({ tone }) {
|
|
107
|
+
return (_jsx("span", { "aria-hidden": "true", "data-testid": "dashboard-list-tone-dot", className: cn("inline-block size-2 shrink-0 rounded-full", toneDotClass(tone)) }));
|
|
108
|
+
}
|
|
109
|
+
// Badges in front of the "to do" column belong to its line: they sit inline before the sentence.
|
|
110
|
+
function leadingBadgeColumnsOf(columns) {
|
|
111
|
+
const hintIndex = columns.findIndex((column) => column.hint !== undefined);
|
|
112
|
+
return columns.slice(0, Math.max(hintIndex, 0)).filter((column) => column.display === "badge");
|
|
42
113
|
}
|
|
43
|
-
/** Compact
|
|
44
|
-
*
|
|
45
|
-
export function DashboardListTable({ columns, rows, formatPercent, formatNumber, formatDateTime, translate, testId, }) {
|
|
46
|
-
|
|
114
|
+
/** Compact table for dashboard lists with optional bar/badge columns. Badge columns in front of a
|
|
115
|
+
* `hint` column join the hint's first line; rows with a tone get 12px of padding above and below. */
|
|
116
|
+
export function DashboardListTable({ columns: allColumns, rows, formatPercent, formatNumber, formatDateTime, translate, testId, rowToneField, rowToneMarker = "bar", showHeader = true, rowLink, }) {
|
|
117
|
+
const visibleColumns = allColumns.filter((column) => column.narrowOnly !== true);
|
|
118
|
+
const leadingBadgeColumns = leadingBadgeColumnsOf(visibleColumns);
|
|
119
|
+
const columns = visibleColumns.filter((column) => !leadingBadgeColumns.includes(column));
|
|
120
|
+
const hintColumn = columns.find((column) => column.hint !== undefined);
|
|
121
|
+
const padded = rowToneField !== undefined || leadingBadgeColumns.length > 0;
|
|
122
|
+
const cellProps = { formatPercent, formatNumber, formatDateTime, translate };
|
|
123
|
+
return (_jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { "data-testid": testId, className: "w-full text-sm", children: [showHeader && (_jsx("thead", { children: _jsxs("tr", { className: "h-9 border-b border-border-row text-left text-xs text-muted-foreground", children: [columns.map((column) => (_jsx("th", { scope: "col", className: cn("px-4 font-medium", column.display === "button" && "text-right"), children: column.label }, column.field))), rowLink !== undefined && _jsx("th", { scope: "col", className: "w-8" })] }) })), _jsx("tbody", { children: rows.map((row, index) => {
|
|
124
|
+
const rowTarget = rowLink?.linkFor(row);
|
|
125
|
+
const tone = rowToneOf(row, rowToneField);
|
|
126
|
+
const dot = rowToneMarker === "dot" && tone !== undefined ? _jsx(ToneDot, { tone: tone }) : null;
|
|
127
|
+
const leadingFor = (column, columnIndex) => {
|
|
128
|
+
const badges = column === hintColumn ? leadingBadgeColumns : [];
|
|
129
|
+
const front = columnIndex === 0 ? dot : null;
|
|
130
|
+
if (front === null && badges.length === 0)
|
|
131
|
+
return undefined;
|
|
132
|
+
return (_jsxs(_Fragment, { children: [front, badges.map((badge) => (_jsx(DashboardListCell, { column: badge, row: row, ...cellProps }, badge.field)))] }));
|
|
133
|
+
};
|
|
134
|
+
const rowKey = typeof row["id"] === "string" ? row["id"] : index;
|
|
135
|
+
const rowElement = (_jsxs("tr", { ...(rowTarget !== undefined && {
|
|
136
|
+
onClick: (event) => pressRowLink(event, rowTarget),
|
|
137
|
+
}), className: cn("h-10 border-b border-border-row last:border-b-0 [&:has(+[data-reason-row])]:border-b-0", rowTarget !== undefined && "cursor-pointer", padded && "sm:[&>td]:py-3",
|
|
138
|
+
// Without a header row nothing labels the columns, so narrow screens stack them.
|
|
139
|
+
!showHeader &&
|
|
140
|
+
"max-sm:grid max-sm:h-auto max-sm:grid-cols-1 max-sm:gap-1 max-sm:py-2", rowToneMarker === "bar" && rowToneClass(tone)), children: [columns.map((column, columnIndex) => {
|
|
141
|
+
const leading = leadingFor(column, columnIndex);
|
|
142
|
+
const cell = (_jsx(DashboardListCell, { column: column, row: row, ...cellProps, ...(column.hint !== undefined && { leading }) }));
|
|
143
|
+
return (_jsx("td", { className: cn("px-4", column.display === "button" && "text-right", !showHeader && "max-sm:block"), children: column.hint === undefined && dot !== null && columnIndex === 0 ? (_jsxs("span", { className: "flex items-center gap-2", children: [dot, cell] })) : (cell) }, column.field));
|
|
144
|
+
}), rowLink !== undefined && (_jsx("td", { className: "w-8 px-2 text-right", children: _jsx(RowLinkIcon, { link: rowTarget, icon: rowLink.icon, label: translate("kumiko.dashboard.list.open-row") }) }))] }, rowKey));
|
|
145
|
+
const reasonHint = columns.find((column) => column.hint !== undefined && hintReasonOf(column.hint, row) !== undefined)?.hint;
|
|
146
|
+
return (_jsx(HintReasonRowScope, { hint: reasonHint, row: row, renderBoxRow: (box) => (_jsx("tr", { "data-reason-row": "true", className: "border-b border-border-row last:border-b-0", children: _jsx("td", { colSpan: columns.length + (rowLink !== undefined ? 1 : 0), className: "px-4 pb-3", children: box }) })), children: rowElement }, rowKey));
|
|
147
|
+
}) })] }) }));
|
|
47
148
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type DrawerSide = "left" | "right" | "top" | "bottom";
|
|
2
2
|
export declare const MAX_VIEWPORT_WIDTH = "85vw";
|
|
3
|
+
export declare function isNarrowFullscreen(side: DrawerSide, narrow: boolean): boolean;
|
|
3
4
|
export declare function sidePanelClass(side: DrawerSide, narrow: boolean, variant: "floating" | "flush", belowHeader: boolean): string;
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
// Same cap as WIDTH_CLASS: an explicit `width` must not outgrow the viewport.
|
|
5
5
|
export const MAX_VIEWPORT_WIDTH = "85vw";
|
|
6
6
|
const WIDTH_CLASS = "w-[max(600px,37.5vw)] max-w-[85vw] sm:max-w-[max(600px,37.5vw)]";
|
|
7
|
+
// A bottom sheet stays docked on a phone: it holds a short choice and the page stays visible behind it.
|
|
8
|
+
export function isNarrowFullscreen(side, narrow) {
|
|
9
|
+
return narrow && side !== "bottom";
|
|
10
|
+
}
|
|
7
11
|
// "floating": 32px margin + 32px radius so the panel reads as detached from
|
|
8
12
|
// the viewport edge, unlike the sheet primitive's flush-edge default.
|
|
9
13
|
// "flush" docks it back to that flush-edge default instead, borrowing the
|
|
@@ -12,8 +16,12 @@ const WIDTH_CLASS = "w-[max(600px,37.5vw)] max-w-[85vw] sm:max-w-[max(600px,37.5
|
|
|
12
16
|
// decides, not a `sm:` Tailwind prefix, since the resize width below already
|
|
13
17
|
// comes from JS and two decision sources is the bug this avoids.
|
|
14
18
|
export function sidePanelClass(side, narrow, variant, belowHeader) {
|
|
15
|
-
if (narrow)
|
|
19
|
+
if (isNarrowFullscreen(side, narrow)) {
|
|
16
20
|
return "inset-0 h-full w-full max-w-none rounded-none border-0 overflow-hidden";
|
|
21
|
+
}
|
|
22
|
+
if (narrow) {
|
|
23
|
+
return "inset-x-0 bottom-0 h-auto max-h-[85vh] w-full max-w-none rounded-t-[2rem] border-t overflow-hidden";
|
|
24
|
+
}
|
|
17
25
|
if (variant === "flush") {
|
|
18
26
|
switch (side) {
|
|
19
27
|
// h-full would pin height to 100vh despite the shifted top; h-auto lets inset-y-0 size it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MAX_VIEWPORT_WIDTH } from "./drawer-panel-class.js";
|
|
2
2
|
export const MIN_WIDTH_PX = 320;
|
|
3
3
|
export const MAX_WIDTH_PX = 1000;
|
|
4
|
-
// Must match the static `max(600px,37.5vw)` in
|
|
4
|
+
// Must match the static `max(600px,37.5vw)` in WIDTH_CLASS (drawer-panel-class.ts) — Tailwind's
|
|
5
5
|
// JIT can't read these at runtime, so the two are kept in sync by hand.
|
|
6
6
|
// 600px (vs. the old 520px floor) gives a two-column field row (e.g.
|
|
7
7
|
// street/number, zip/city) room to breathe, while staying well under half
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from "../../index.js";
|
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
5
|
import { useIsNarrowViewport } from "../primitives/use-narrow-viewport.js";
|
|
6
6
|
import { Sheet, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
7
|
-
import { sidePanelClass } from "./drawer-panel-class.js";
|
|
7
|
+
import { isNarrowFullscreen, sidePanelClass } from "./drawer-panel-class.js";
|
|
8
8
|
import { renderMaximizeButton, renderResizeHandle } from "./drawer-resize-controls.js";
|
|
9
9
|
import { buildOverlayStyle, buildSheetStyle } from "./drawer-sizing.js";
|
|
10
10
|
import { DrawerSheetContent } from "./sheet-parts.js";
|
|
@@ -74,5 +74,5 @@ export function Drawer({ open, onOpenChange, side = "right", title, description,
|
|
|
74
74
|
// Radix already drops the overlay and the focus trap for a
|
|
75
75
|
// non-modal Root; only the dismiss-on-outside-interaction is left
|
|
76
76
|
// to suppress, so a click into the page behind keeps the panel open.
|
|
77
|
-
onInteractOutside: modal ? undefined : (event) => event.preventDefault(), showCloseButton: showCloseButton, closeLabel: t("kumiko.dialog.close"), className: cn(sidePanelClass(side, narrow, variant, belowHeader), fillBody && "gap-0", !narrow && panelClassName), style: sheetStyle, children: [canResize && !narrow && renderMaximizeButton(resizeControls), (title !== undefined || description !== undefined) && (_jsxs(SheetHeader, { children: [title !== undefined && _jsx(SheetTitle, { children: title }), description !== undefined && _jsx(SheetDescription, { children: description })] })), _jsx("div", { className: fillBody ? "flex min-h-0 flex-1 flex-col" : "flex-1 overflow-y-auto px-4", children: children }), footer !== undefined && (_jsx(SheetFooter, { className: DRAWER_FOOTER_CLASS, children: footer })), canResize && !narrow && renderResizeHandle(resizeControls)] }) }));
|
|
77
|
+
onInteractOutside: modal ? undefined : (event) => event.preventDefault(), showCloseButton: showCloseButton, closeLabel: t("kumiko.dialog.close"), className: cn(sidePanelClass(side, narrow, variant, belowHeader), fillBody && "gap-0", !isNarrowFullscreen(side, narrow) && panelClassName), style: sheetStyle, children: [canResize && !narrow && renderMaximizeButton(resizeControls), (title !== undefined || description !== undefined) && (_jsxs(SheetHeader, { children: [title !== undefined && _jsx(SheetTitle, { children: title }), description !== undefined && _jsx(SheetDescription, { children: description })] })), _jsx("div", { className: fillBody ? "flex min-h-0 flex-1 flex-col" : "flex-1 overflow-y-auto px-4", children: children }), footer !== undefined && (_jsx(SheetFooter, { className: DRAWER_FOOTER_CLASS, children: footer })), canResize && !narrow && renderResizeHandle(resizeControls)] }) }));
|
|
78
78
|
}
|
|
@@ -172,8 +172,10 @@ export function FloatingPanel({ title, headerActions, children, storageKey, defa
|
|
|
172
172
|
return createPortal(_jsxs("div", { role: "dialog", "aria-modal": "false", "aria-labelledby": titleId, "data-testid": testId, className: cn("fixed z-50 flex flex-col overflow-hidden rounded-lg border text-foreground shadow-2xl", aiSurface ? "bg-ai-surface" : "bg-background"), style: {
|
|
173
173
|
right: fixedPlacement.rightPx,
|
|
174
174
|
bottom: fixedPlacement.bottomPx,
|
|
175
|
-
width:
|
|
176
|
-
|
|
175
|
+
width: fixedPlacement.widthPx,
|
|
176
|
+
maxWidth: `calc(100vw - ${fixedPlacement.rightPx + FLOATING_PANEL_MARGIN_PX}px)`,
|
|
177
|
+
height: fixedPlacement.heightPx,
|
|
178
|
+
maxHeight: `calc(100vh - ${fixedPlacement.bottomPx + FLOATING_PANEL_MARGIN_PX}px)`,
|
|
177
179
|
}, children: [_jsxs("div", { className: cn("flex shrink-0 items-center gap-2 border-b px-3 py-2", aiSurface ? "bg-ai-surface" : "bg-muted"), children: [_jsx("div", { id: titleId, className: "min-w-0 flex-1 truncate font-medium", children: title }), headerActions] }), _jsx("div", { className: bodyClass, children: children })] }), document.body);
|
|
178
180
|
}
|
|
179
181
|
const limits = getLimits();
|
|
@@ -14,6 +14,7 @@ export { Drawer, type DrawerProps } from "./drawer.tsx";
|
|
|
14
14
|
export { FeedList, type FeedRow } from "./feed-list.tsx";
|
|
15
15
|
export { FloatingPanel, type FloatingPanelGeometry, type FloatingPanelPlacement, type FloatingPanelProps, } from "./floating-panel.tsx";
|
|
16
16
|
export { BooleanField, type BooleanFieldProps, DateField, type DateFieldProps, FileField, type FileFieldProps, MoneyField, NumberField, type NumberFieldProps, PercentField, RangeField, type RangeFieldProps, SelectField, type SelectFieldProps, TextareaField, type TextareaFieldProps, TextField, type TextFieldProps, } from "./form-fields.tsx";
|
|
17
|
+
export { HtmlMailFrame } from "./html-mail-frame.tsx";
|
|
17
18
|
export { InfinityList, type InfinityListProps, type InfinityListSelection, } from "./infinity-list.tsx";
|
|
18
19
|
export { MessageReader } from "./message-reader.tsx";
|
|
19
20
|
export { type MessageAttachment, type MessageBody, type MessageReaderProps, type MessageReaderTab, MessageThread, type MessageThreadProps, type ThreadMessage, } from "./message-thread.tsx";
|
|
@@ -22,6 +23,7 @@ export { ModeSwitch, type ModeSwitchVariant } from "./mode-switch.tsx";
|
|
|
22
23
|
export { type PdfMatchInfo, PdfPreview, type PdfPreviewProps, type PdfPreviewSource, } from "./pdf-preview.tsx";
|
|
23
24
|
export { type PhotoSlotSpec, PhotoSlots, type PhotoSlotsProps } from "./photo-slots.tsx";
|
|
24
25
|
export { PlanCard, type PlanCardActionSlot, type PlanCardLinkSlot, type PlanCardPrice, type PlanCardProps, PlanGrid, type PlanGridProps, } from "./plan-card.tsx";
|
|
26
|
+
export { type PreviewDevice, PreviewWidthFrame } from "./preview-width-frame.tsx";
|
|
25
27
|
export { ProgressBar } from "./progress-bar.tsx";
|
|
26
28
|
export { ProgressList, type ProgressListRow } from "./progress-list.tsx";
|
|
27
29
|
export { PublicShell, type PublicShellProps, type PublicShellVariant } from "./public-shell.tsx";
|
|
@@ -16,6 +16,7 @@ export { Drawer } from "./drawer.js";
|
|
|
16
16
|
export { FeedList } from "./feed-list.js";
|
|
17
17
|
export { FloatingPanel, } from "./floating-panel.js";
|
|
18
18
|
export { BooleanField, DateField, FileField, MoneyField, NumberField, PercentField, RangeField, SelectField, TextareaField, TextField, } from "./form-fields.js";
|
|
19
|
+
export { HtmlMailFrame } from "./html-mail-frame.js";
|
|
19
20
|
export { InfinityList, } from "./infinity-list.js";
|
|
20
21
|
export { MessageReader } from "./message-reader.js";
|
|
21
22
|
export { MessageThread, } from "./message-thread.js";
|
|
@@ -24,6 +25,7 @@ export { ModeSwitch } from "./mode-switch.js";
|
|
|
24
25
|
export { PdfPreview, } from "./pdf-preview.js";
|
|
25
26
|
export { PhotoSlots } from "./photo-slots.js";
|
|
26
27
|
export { PlanCard, PlanGrid, } from "./plan-card.js";
|
|
28
|
+
export { PreviewWidthFrame } from "./preview-width-frame.js";
|
|
27
29
|
export { ProgressBar } from "./progress-bar.js";
|
|
28
30
|
export { ProgressList } from "./progress-list.js";
|
|
29
31
|
export { PublicShell } from "./public-shell.js";
|
|
@@ -88,8 +88,6 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
88
88
|
// into one query per event. A refresh already running schedules
|
|
89
89
|
// exactly one trailing pass after it settles.
|
|
90
90
|
const liveTimerRef = useRef(null);
|
|
91
|
-
const liveInFlightRef = useRef(false);
|
|
92
|
-
const liveTrailingRef = useRef(false);
|
|
93
91
|
// Live-mode: on an SSE event for the query's entity, refetch only the
|
|
94
92
|
// first page and merge it in — rows the fresh page still contains move
|
|
95
93
|
// to the front (newest-first feeds), rows it dropped (edited/deleted
|
|
@@ -97,7 +95,7 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
97
95
|
// A full reload would collapse already-accumulated pages and jump the
|
|
98
96
|
// scroll position.
|
|
99
97
|
// biome-ignore lint/correctness/useExhaustiveDependencies: payload goes through payloadKey
|
|
100
|
-
const refreshFirstPage = useCallback(async () => {
|
|
98
|
+
const refreshFirstPage = useCallback(async (onSuperseded) => {
|
|
101
99
|
// Read, don't bump at the start: a concurrent load() (e.g. the mount
|
|
102
100
|
// fetch still in flight) must not be discarded by a refresh that then
|
|
103
101
|
// fails or is superseded. Only a refresh that actually delivers fresh
|
|
@@ -107,7 +105,7 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
107
105
|
if (seqAtStart !== requestSeq.current) {
|
|
108
106
|
// A load-more bumps the sequence without covering page 1, so the signal that
|
|
109
107
|
// triggered this refresh would otherwise be lost.
|
|
110
|
-
|
|
108
|
+
onSuperseded();
|
|
111
109
|
return;
|
|
112
110
|
}
|
|
113
111
|
// skip: background live refresh failed, keep showing the current rows
|
|
@@ -154,12 +152,20 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
154
152
|
// skip: no entity to listen on, nothing to subscribe to
|
|
155
153
|
if (liveEntities.length === 0)
|
|
156
154
|
return;
|
|
155
|
+
// In-flight and trailing flags belong to this effect: a payload change starts a fresh pair, so
|
|
156
|
+
// an event for the new payload is never parked behind the old payload's refresh, and a torn-down
|
|
157
|
+
// effect never runs a pass through its stale refreshFirstPage.
|
|
158
|
+
let disposed = false;
|
|
159
|
+
let inFlight = false;
|
|
160
|
+
let trailing = false;
|
|
157
161
|
const runRefresh = () => {
|
|
158
|
-
|
|
159
|
-
void refreshFirstPage(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
inFlight = true;
|
|
163
|
+
void refreshFirstPage(() => {
|
|
164
|
+
trailing = true;
|
|
165
|
+
}).finally(() => {
|
|
166
|
+
inFlight = false;
|
|
167
|
+
if (!disposed && trailing) {
|
|
168
|
+
trailing = false;
|
|
163
169
|
runRefresh();
|
|
164
170
|
}
|
|
165
171
|
});
|
|
@@ -169,8 +175,8 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
169
175
|
clearTimeout(liveTimerRef.current);
|
|
170
176
|
liveTimerRef.current = setTimeout(() => {
|
|
171
177
|
liveTimerRef.current = null;
|
|
172
|
-
if (
|
|
173
|
-
|
|
178
|
+
if (inFlight) {
|
|
179
|
+
trailing = true;
|
|
174
180
|
return;
|
|
175
181
|
}
|
|
176
182
|
runRefresh();
|
|
@@ -178,6 +184,7 @@ export function InfinityList({ query, payload, pageSize = 50, rows, nextCursor,
|
|
|
178
184
|
};
|
|
179
185
|
const unsubscribe = subscribeToEntities(subscribeLive, liveEntities, scheduleRefresh);
|
|
180
186
|
return () => {
|
|
187
|
+
disposed = true;
|
|
181
188
|
unsubscribe();
|
|
182
189
|
if (liveTimerRef.current !== null) {
|
|
183
190
|
clearTimeout(liveTimerRef.current);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronDown, ChevronUp
|
|
2
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { usePrimitives, useTranslation } from "../../index.js";
|
|
5
|
+
import { DrawnSearch } from "../drawn-icons.js";
|
|
5
6
|
const INPUT_CLASS = "h-[26px] rounded border border-input bg-transparent px-1.5 text-center text-sm text-foreground";
|
|
6
7
|
// Bordered like the page input beside them, so the toolbar reads as controls of the document.
|
|
7
8
|
const TOOL_BUTTON_CLASS = "size-7";
|
|
@@ -31,5 +32,5 @@ function SearchControls({ search, onTermChange, onStepMatch, }) {
|
|
|
31
32
|
export function PdfViewerToolbar(props) {
|
|
32
33
|
const t = useTranslation();
|
|
33
34
|
const { Button } = usePrimitives();
|
|
34
|
-
return (_jsxs("div", { "data-testid": "pdf-toolbar", className: "flex h-10 shrink-0 items-center gap-2 border-b border-border bg-card px-2.5 text-[13px]", children: [_jsx(PageNumberInput, { currentPage: props.currentPage, onGoToPage: props.onGoToPage }), _jsx("span", { className: "text-muted-foreground", children: t("kumiko.widget.pdf-preview.pageCount", { pages: props.pageCount }) }), _jsx("span", { className: "grow" }), props.search.open && props.hideSearch !== true && (_jsx(SearchControls, { search: props.search, onTermChange: props.onTermChange, onStepMatch: props.onStepMatch })), _jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, ariaLabel: t("kumiko.widget.pdf-preview.zoomOut"), onClick: props.onZoomOut, children: "\u2212" }), _jsxs("span", { className: "min-w-11 whitespace-nowrap text-center text-muted-foreground", "data-testid": "pdf-zoom", children: [Math.round(props.zoom * 100), " %"] }), _jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, ariaLabel: t("kumiko.widget.pdf-preview.zoomIn"), onClick: props.onZoomIn, children: "+" }), props.hideSearch !== true && (_jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, pressed: props.search.open, ariaLabel: t("kumiko.widget.pdf-preview.search"), onClick: props.onToggleSearch, children: _jsx(
|
|
35
|
+
return (_jsxs("div", { "data-testid": "pdf-toolbar", className: "flex h-10 shrink-0 items-center gap-2 border-b border-border bg-card px-2.5 text-[13px]", children: [_jsx(PageNumberInput, { currentPage: props.currentPage, onGoToPage: props.onGoToPage }), _jsx("span", { className: "text-muted-foreground", children: t("kumiko.widget.pdf-preview.pageCount", { pages: props.pageCount }) }), _jsx("span", { className: "grow" }), props.search.open && props.hideSearch !== true && (_jsx(SearchControls, { search: props.search, onTermChange: props.onTermChange, onStepMatch: props.onStepMatch })), _jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, ariaLabel: t("kumiko.widget.pdf-preview.zoomOut"), onClick: props.onZoomOut, children: "\u2212" }), _jsxs("span", { className: "min-w-11 whitespace-nowrap text-center text-muted-foreground", "data-testid": "pdf-zoom", children: [Math.round(props.zoom * 100), " %"] }), _jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, ariaLabel: t("kumiko.widget.pdf-preview.zoomIn"), onClick: props.onZoomIn, children: "+" }), props.hideSearch !== true && (_jsx(Button, { size: "icon", variant: "secondary", className: TOOL_BUTTON_CLASS, pressed: props.search.open, ariaLabel: t("kumiko.widget.pdf-preview.search"), onClick: props.onToggleSearch, children: _jsx(DrawnSearch, { "aria-hidden": "true", className: "size-3.5" }) }))] }));
|
|
35
36
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type PreviewDevice = "desktop" | "mobile";
|
|
3
|
+
export declare function PreviewWidthFrame({ device, children, testId, }: {
|
|
4
|
+
readonly device: PreviewDevice;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
readonly testId?: string;
|
|
7
|
+
}): ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Page widths of a rendered preview live here, inside the Tailwind scan surface, so feature code
|
|
3
|
+
// picks a device instead of carrying its own max-w classes.
|
|
4
|
+
const PREVIEW_WIDTH_CLASS = {
|
|
5
|
+
desktop: "mx-auto w-full max-w-[760px]",
|
|
6
|
+
mobile: "mx-auto w-full max-w-[375px]",
|
|
7
|
+
};
|
|
8
|
+
export function PreviewWidthFrame({ device, children, testId, }) {
|
|
9
|
+
return (_jsx("div", { className: PREVIEW_WIDTH_CLASS[device], "data-testid": testId, "data-device": device, children: children }));
|
|
10
|
+
}
|
|
@@ -3,7 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
* replaces repeated `<section className={CARD}>…<h2>` blocks in
|
|
4
4
|
* custom screens. Thin wrapper around the Card primitive. */
|
|
5
5
|
export declare function SectionCard({ title, subtitle, action, footer, children, testId, }: {
|
|
6
|
-
readonly title
|
|
6
|
+
readonly title?: string;
|
|
7
7
|
readonly subtitle?: string;
|
|
8
8
|
readonly action?: ReactNode;
|
|
9
9
|
readonly footer?: ReactNode;
|
|
@@ -3,7 +3,9 @@ import { XIcon } from "lucide-react";
|
|
|
3
3
|
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
5
|
export function DrawerSheetContent({ className, overlayStyle, children, side = "right", showCloseButton = true, closeLabel, ...props }) {
|
|
6
|
-
return (_jsxs(SheetPrimitive.Portal, { "data-slot": "sheet-portal", children: [_jsx(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", style: overlayStyle, className: "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), _jsxs(SheetPrimitive.Content, { "data-slot": "sheet-content",
|
|
6
|
+
return (_jsxs(SheetPrimitive.Portal, { "data-slot": "sheet-portal", children: [_jsx(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", style: overlayStyle, onClick: (event) => event.stopPropagation(), className: "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), _jsxs(SheetPrimitive.Content, { "data-slot": "sheet-content",
|
|
7
|
+
// The portal escapes the DOM tree, not the fiber tree: without this a click in the drawer reaches an ancestor's onClick (e.g. the table row it was opened from).
|
|
8
|
+
onClick: (event) => event.stopPropagation(), className: cn("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500", side === "right" &&
|
|
7
9
|
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", side === "left" &&
|
|
8
10
|
"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", side === "top" &&
|
|
9
11
|
"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", side === "bottom" &&
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import { chartColor, seriesTotal
|
|
3
|
+
import { chartColor, seriesTotal } from "./chart-data.js";
|
|
4
4
|
import { MarkerLegend, markerLegendItems } from "./chart-markers.js";
|
|
5
5
|
import { ChartLegend, YTicks } from "./chart-parts.js";
|
|
6
6
|
import { ModeSwitch } from "./mode-switch.js";
|
|
7
7
|
import { StackedAreaBrush } from "./stacked-area-brush.js";
|
|
8
|
-
import { STACKED_AREA_PLOT_HEIGHT_CLASS } from "./stacked-area-geometry.js";
|
|
8
|
+
import { bucketTotals, STACKED_AREA_PLOT_HEIGHT_CLASS } from "./stacked-area-geometry.js";
|
|
9
9
|
import { renderStackedAreaPlot } from "./stacked-area-plot.js";
|
|
10
10
|
const SCROLLABLE_BUCKET_WIDTH_PX = 48;
|
|
11
11
|
export function renderRangeSwitch(m) {
|
|
@@ -23,7 +23,7 @@ export function renderBrushBar(m) {
|
|
|
23
23
|
const { allTimes, visibleWindow, changeSelection } = m.win;
|
|
24
24
|
if (!brush || allTimes.length < 2)
|
|
25
25
|
return undefined;
|
|
26
|
-
return (_jsx(StackedAreaBrush, { times: allTimes, totals: allTimes
|
|
26
|
+
return (_jsx(StackedAreaBrush, { times: allTimes, totals: bucketTotals(allTimes, allSeries), window: visibleWindow, labels: brushLabels, onChange: (next) => changeSelection({ kind: "brush", startMs: next.startMs, endMs: next.endMs }), testId: `${testId ?? "stacked-area"}-brush` }));
|
|
27
27
|
}
|
|
28
28
|
function renderPlotArea(m, scrollRef) {
|
|
29
29
|
const plot = renderStackedAreaPlot(m);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { chartColor, percent, valueAt } from "./chart-data.js";
|
|
4
|
+
import { ChartSwatch } from "./chart-parts.js";
|
|
4
5
|
import { bucketIndexAtFraction } from "./chart-window.js";
|
|
5
6
|
import { STACKED_AREA_PLOT_HEIGHT_CLASS } from "./stacked-area-geometry.js";
|
|
6
7
|
const TOOLTIP_WIDTH_REM = 14;
|
|
@@ -35,15 +36,6 @@ function buildTooltipRows(m, tooltipAtMs) {
|
|
|
35
36
|
}),
|
|
36
37
|
];
|
|
37
38
|
}
|
|
38
|
-
function renderTooltipSwatch(row) {
|
|
39
|
-
if (row.swatch === "area") {
|
|
40
|
-
return (_jsx("span", { "aria-hidden": "true", className: "size-2 shrink-0 rounded-[2px]", style: { backgroundColor: row.color } }));
|
|
41
|
-
}
|
|
42
|
-
return (_jsx("span", { "aria-hidden": "true", className: "w-3 shrink-0 border-t-2", style: {
|
|
43
|
-
borderColor: row.color,
|
|
44
|
-
borderTopStyle: row.swatch === "dashed-line" ? "dashed" : "solid",
|
|
45
|
-
} }));
|
|
46
|
-
}
|
|
47
39
|
function renderTooltipCard(m, tooltipAtMs) {
|
|
48
40
|
const tooltipFraction = m.win.fractionOf(tooltipAtMs);
|
|
49
41
|
const tooltipOnLeft = tooltipFraction > 0.5;
|
|
@@ -51,7 +43,7 @@ function renderTooltipCard(m, tooltipAtMs) {
|
|
|
51
43
|
const tooltipLeft = tooltipOnLeft
|
|
52
44
|
? `max(0px, calc(${tooltipEdge} - ${TOOLTIP_WIDTH_REM}rem))`
|
|
53
45
|
: `max(0px, min(calc(${tooltipEdge}), calc(100% - ${TOOLTIP_WIDTH_REM}rem)))`;
|
|
54
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-y-0 w-px bg-foreground/40", style: { left: percent(tooltipFraction) } }), _jsxs("div", { "data-testid": "chart-tooltip", "data-side": tooltipOnLeft ? "left" : "right", className: "pointer-events-none absolute top-2 rounded-md border bg-popover p-2 text-xs text-popover-foreground shadow-sm", style: { left: tooltipLeft, width: `min(${TOOLTIP_WIDTH_REM}rem, 100%)` }, children: [_jsx("div", { className: "mb-1 font-medium", children: m.win.formatBucket(tooltipAtMs) }), buildTooltipRows(m, tooltipAtMs).map((row) => (_jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
46
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-y-0 w-px bg-foreground/40", style: { left: percent(tooltipFraction) } }), _jsxs("div", { "data-testid": "chart-tooltip", "data-side": tooltipOnLeft ? "left" : "right", className: "pointer-events-none absolute top-2 rounded-md border bg-popover p-2 text-xs text-popover-foreground shadow-sm", style: { left: tooltipLeft, width: `min(${TOOLTIP_WIDTH_REM}rem, 100%)` }, children: [_jsx("div", { className: "mb-1 font-medium", children: m.win.formatBucket(tooltipAtMs) }), buildTooltipRows(m, tooltipAtMs).map((row) => (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(ChartSwatch, { color: row.color, swatch: row.swatch, className: "shrink-0" }), _jsx("span", { className: "min-w-0 truncate text-muted-foreground", children: row.label }), _jsx("span", { className: "ml-auto tabular-nums", children: m.props.formatAxisValue(row.value) })] }, row.key)))] })] }));
|
|
55
47
|
}
|
|
56
48
|
function bucketAtMsUnderPointer(m, event) {
|
|
57
49
|
const { times, visibleWindow } = m.win;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type StatDelta, type StatLink, type StatTone } from "./stat.tsx";
|
|
3
|
+
type StatBoxCellProps = {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
/** Replaces `label` in the one-line phone variant. */
|
|
6
|
+
readonly narrowLabel?: string;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly sub?: string;
|
|
9
|
+
readonly tone?: StatTone;
|
|
10
|
+
readonly icon?: ReactNode;
|
|
11
|
+
readonly delta?: StatDelta;
|
|
12
|
+
readonly spark?: readonly number[];
|
|
13
|
+
readonly testId?: string;
|
|
14
|
+
readonly link?: StatLink;
|
|
15
|
+
};
|
|
16
|
+
/** Cell of a titled stat strip. From `sm` a box: the number large on the left, label bold and
|
|
17
|
+
* sub line small beside it. Below `sm` plain text "<number> <label>" that joins the strip's single line. */
|
|
18
|
+
export declare function StatBoxCell({ label, narrowLabel, value, sub, tone, icon, delta, spark, testId, link, }: StatBoxCellProps): ReactNode;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useIsBelowSmViewport } from "../primitives/use-narrow-viewport.js";
|
|
4
|
+
import { Sparkline, StatLinkFrame, TONE_VALUE, } from "./stat.js";
|
|
5
|
+
/** Cell of a titled stat strip. From `sm` a box: the number large on the left, label bold and
|
|
6
|
+
* sub line small beside it. Below `sm` plain text "<number> <label>" that joins the strip's single line. */
|
|
7
|
+
export function StatBoxCell({ label, narrowLabel, value, sub, tone = "default", icon, delta, spark, testId, link, }) {
|
|
8
|
+
const belowSm = useIsBelowSmViewport();
|
|
9
|
+
return (_jsx(StatLinkFrame, { link: link, testId: testId, children: belowSm ? (_jsxs("span", { "data-testid": testId, className: "whitespace-nowrap text-sm", children: [_jsx("span", { className: "tabular-nums text-foreground", children: value }), " ", _jsx("span", { className: "text-foreground", children: narrowLabel ?? label })] })) : (_jsxs("div", { "data-testid": testId, className: "flex min-w-0 items-center gap-3 rounded-lg border border-border bg-background px-3 py-2.5", children: [icon, _jsx("span", { className: cn("text-2xl font-semibold leading-none tabular-nums", TONE_VALUE[tone]), children: value }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: label }), sub !== undefined && (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: sub }))] }), delta !== undefined && (_jsxs("span", { className: "whitespace-nowrap text-xs font-medium tabular-nums text-muted-foreground", children: [delta.direction === "up" ? "↑" : "↓", delta.value] })), spark !== undefined && (_jsx(Sparkline, { points: spark, className: cn("h-6 w-16 shrink-0", TONE_VALUE[tone]) }))] })) }));
|
|
10
|
+
}
|
|
@@ -2,11 +2,17 @@ import type { DashboardStatTone } from "@cosmicdrift/kumiko-types/screen";
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
export type StatTone = DashboardStatTone;
|
|
4
4
|
export declare const STAT_CARD_GRID_CLASSES = "grid grid-cols-[repeat(auto-fit,minmax(min(12rem,100%),1fr))] gap-3";
|
|
5
|
+
export declare const TONE_VALUE: Record<StatTone, string>;
|
|
5
6
|
/** Makes a tile a link; `onPress` is the SPA navigation, `href` serves modified clicks and a11y. */
|
|
6
7
|
export type StatLink = {
|
|
7
8
|
readonly href: string;
|
|
8
9
|
readonly onPress: () => void;
|
|
9
10
|
};
|
|
11
|
+
export declare function StatLinkFrame({ link, testId, children, }: {
|
|
12
|
+
readonly link: StatLink | undefined;
|
|
13
|
+
readonly testId: string | undefined;
|
|
14
|
+
readonly children: ReactNode;
|
|
15
|
+
}): ReactNode;
|
|
10
16
|
export type StatDelta = {
|
|
11
17
|
readonly value: string;
|
|
12
18
|
readonly direction: "up" | "down";
|
|
@@ -18,10 +24,11 @@ export declare function Sparkline({ points, className, }: {
|
|
|
18
24
|
}): ReactNode;
|
|
19
25
|
/** Icon-bearing metric tile with an optional delta chip, trend line,
|
|
20
26
|
* and sparkline. `icon` is a ready-made node (the app supplies its SVG). */
|
|
21
|
-
export declare function StatCard({ icon, label, value, sub, tone, accentColor, delta, trend, spark, testId, link, children, }: {
|
|
27
|
+
export declare function StatCard({ icon, label, value, sub, tone, accentColor, delta, trend, spark, testId, link, navigable, inset, subBelow, boardPadding, children, }: {
|
|
22
28
|
readonly icon?: ReactNode;
|
|
23
29
|
readonly label: string;
|
|
24
30
|
readonly value: string;
|
|
31
|
+
/** Small text on the baseline right behind the value. */
|
|
25
32
|
readonly sub?: string;
|
|
26
33
|
readonly tone?: StatTone;
|
|
27
34
|
readonly accentColor?: string;
|
|
@@ -30,6 +37,14 @@ export declare function StatCard({ icon, label, value, sub, tone, accentColor, d
|
|
|
30
37
|
readonly spark?: readonly number[];
|
|
31
38
|
readonly testId?: string;
|
|
32
39
|
readonly link?: StatLink;
|
|
40
|
+
/** Draws a small arrow top right: the tile leads somewhere. Implied by `link`. */
|
|
41
|
+
readonly navigable?: boolean;
|
|
42
|
+
/** Tile inside a panel: page-coloured fill, no shadow, tighter padding (dashboard board look). */
|
|
43
|
+
readonly inset?: boolean;
|
|
44
|
+
/** Puts `sub` on its own line under the value instead of beside it. */
|
|
45
|
+
readonly subBelow?: boolean;
|
|
46
|
+
/** Detail metric tile spacing: 12px/14px padding, 10px/12px and a 17px value below `sm`. */
|
|
47
|
+
readonly boardPadding?: boolean;
|
|
33
48
|
/** Extra content below the built-in fields (e.g. a usage meter) — kept
|
|
34
49
|
* inside the same card chrome instead of stacking a second bordered box. */
|
|
35
50
|
readonly children?: ReactNode;
|