@exxatdesignux/ui 0.2.19 → 0.3.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/CHANGELOG.md +60 -7
- package/bin/sync-extras.mjs +116 -29
- package/consumer-extras/README.md +42 -7
- package/consumer-extras/cursor-rules/exxat-accessibility.mdc +39 -0
- package/consumer-extras/cursor-rules/exxat-board-cards.mdc +26 -0
- package/consumer-extras/cursor-rules/exxat-breadcrumbs-no-back.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-card-vs-list-rows.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-centralized-list-dataset.mdc +44 -0
- package/consumer-extras/cursor-rules/exxat-collaboration-access.mdc +32 -0
- package/consumer-extras/cursor-rules/exxat-command-menu.mdc +22 -0
- package/consumer-extras/cursor-rules/exxat-dashboard-view-charts.mdc +53 -0
- package/consumer-extras/cursor-rules/exxat-data-tables.mdc +41 -0
- package/consumer-extras/cursor-rules/exxat-dedicated-search-surfaces.mdc +25 -0
- package/consumer-extras/cursor-rules/exxat-drawer-vs-dialog.mdc +22 -0
- package/consumer-extras/cursor-rules/exxat-ds-agents.mdc +56 -0
- package/consumer-extras/cursor-rules/exxat-fontawesome-icons.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-kbd-shortcuts.mdc +100 -0
- package/consumer-extras/cursor-rules/exxat-kpi-flat-band.mdc +28 -0
- package/consumer-extras/cursor-rules/exxat-kpi-max-four.mdc +21 -0
- package/consumer-extras/cursor-rules/exxat-kpi-trends.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-list-page-connected-views.mdc +24 -0
- package/consumer-extras/cursor-rules/exxat-list-page-view-shells.mdc +31 -0
- package/consumer-extras/cursor-rules/exxat-mono-ids.mdc +30 -0
- package/consumer-extras/cursor-rules/exxat-no-slds-leakage.mdc +78 -0
- package/consumer-extras/cursor-rules/exxat-no-toast.mdc +25 -0
- package/consumer-extras/cursor-rules/exxat-page-vs-drawer.mdc +23 -0
- package/consumer-extras/cursor-rules/exxat-person-identity-display.mdc +47 -0
- package/consumer-extras/cursor-rules/exxat-primary-nav-secondary-panel.mdc +52 -0
- package/consumer-extras/cursor-rules/exxat-question-bank-hub-header.mdc +28 -0
- package/consumer-extras/cursor-rules/exxat-reuse-before-custom.mdc +34 -0
- package/consumer-extras/cursor-rules/exxat-table-properties-drawer.mdc +77 -0
- package/consumer-extras/cursor-rules/exxat-token-discipline.mdc +103 -0
- package/consumer-extras/cursor-skills/exxat-accessibility/SKILL.md +1 -1
- package/consumer-extras/cursor-skills/exxat-board-cards/SKILL.md +2 -2
- package/consumer-extras/cursor-skills/exxat-centralized-list-dataset/SKILL.md +4 -15
- package/consumer-extras/cursor-skills/exxat-ds-skill/SKILL.md +13 -28
- package/consumer-extras/cursor-skills/exxat-ds-skill/references/data-table-pattern.md +1 -1
- package/consumer-extras/cursor-skills/exxat-primary-nav-secondary-panel/SKILL.md +2 -4
- package/consumer-extras/handbook/HANDBOOK.md +185 -0
- package/consumer-extras/handbook/glossary.md +57 -0
- package/consumer-extras/handbook/reference-implementations.md +126 -0
- package/consumer-extras/handbook/voice-and-tone.md +262 -0
- package/consumer-extras/patterns/command-menu-pattern.md +1 -1
- package/consumer-extras/patterns/consumer-upgrade-checklist.md +0 -20
- package/consumer-extras/patterns/data-views-pattern.md +17 -54
- package/consumer-extras/patterns/shell-surface-elevation-pattern.md +3 -5
- package/dist/components/data-table/filter-date-calendar.d.ts +10 -0
- package/dist/components/data-table/filter-date-calendar.js +280 -0
- package/dist/components/data-table/filter-date-calendar.js.map +1 -0
- package/dist/components/data-table/filter-text-value-input.d.ts +15 -0
- package/dist/components/data-table/filter-text-value-input.js +561 -0
- package/dist/components/data-table/filter-text-value-input.js.map +1 -0
- package/dist/components/data-table/index.d.ts +45 -0
- package/dist/components/data-table/index.js +3085 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/data-table/pagination.d.ts +28 -0
- package/dist/components/data-table/pagination.js +3264 -0
- package/dist/components/data-table/pagination.js.map +1 -0
- package/dist/components/data-table/types.d.ts +84 -0
- package/dist/components/data-table/types.js +3 -0
- package/dist/components/data-table/types.js.map +1 -0
- package/dist/components/data-table/use-table-state.d.ts +116 -0
- package/dist/components/data-table/use-table-state.js +670 -0
- package/dist/components/data-table/use-table-state.js.map +1 -0
- package/dist/components/data-views/board-card-primitives.d.ts +22 -0
- package/dist/components/data-views/board-card-primitives.js +84 -0
- package/dist/components/data-views/board-card-primitives.js.map +1 -0
- package/dist/components/data-views/data-row-list.d.ts +33 -0
- package/dist/components/data-views/data-row-list.js +106 -0
- package/dist/components/data-views/data-row-list.js.map +1 -0
- package/dist/components/data-views/finder-panel-view.d.ts +54 -0
- package/dist/components/data-views/finder-panel-view.js +388 -0
- package/dist/components/data-views/finder-panel-view.js.map +1 -0
- package/dist/components/data-views/folder-grid-view.d.ts +22 -0
- package/dist/components/data-views/folder-grid-view.js +58 -0
- package/dist/components/data-views/folder-grid-view.js.map +1 -0
- package/dist/components/data-views/hub-table.d.ts +167 -0
- package/dist/components/data-views/hub-table.js +5561 -0
- package/dist/components/data-views/hub-table.js.map +1 -0
- package/dist/components/data-views/index.d.ts +27 -0
- package/dist/components/data-views/index.js +6575 -0
- package/dist/components/data-views/index.js.map +1 -0
- package/dist/components/data-views/list-page-board-card.d.ts +72 -0
- package/dist/components/data-views/list-page-board-card.js +264 -0
- package/dist/components/data-views/list-page-board-card.js.map +1 -0
- package/dist/components/data-views/list-page-board-template.d.ts +24 -0
- package/dist/components/data-views/list-page-board-template.js +137 -0
- package/dist/components/data-views/list-page-board-template.js.map +1 -0
- package/dist/components/data-views/list-page-connected-view-body.d.ts +19 -0
- package/dist/components/data-views/list-page-connected-view-body.js +116 -0
- package/dist/components/data-views/list-page-connected-view-body.js.map +1 -0
- package/dist/components/data-views/list-page-split-details-placeholder.d.ts +14 -0
- package/dist/components/data-views/list-page-split-details-placeholder.js +38 -0
- package/dist/components/data-views/list-page-split-details-placeholder.js.map +1 -0
- package/dist/components/data-views/list-page-split-hub-chrome.d.ts +17 -0
- package/dist/components/data-views/list-page-split-hub-chrome.js +54 -0
- package/dist/components/data-views/list-page-split-hub-chrome.js.map +1 -0
- package/dist/components/data-views/list-page-split-hub-tokens.d.ts +12 -0
- package/dist/components/data-views/list-page-split-hub-tokens.js +8 -0
- package/dist/components/data-views/list-page-split-hub-tokens.js.map +1 -0
- package/dist/components/data-views/list-page-tree-column-header.d.ts +15 -0
- package/dist/components/data-views/list-page-tree-column-header.js +22 -0
- package/dist/components/data-views/list-page-tree-column-header.js.map +1 -0
- package/dist/components/data-views/list-page-tree-panel-shell.d.ts +25 -0
- package/dist/components/data-views/list-page-tree-panel-shell.js +146 -0
- package/dist/components/data-views/list-page-tree-panel-shell.js.map +1 -0
- package/dist/components/data-views/os-folder-glyph.d.ts +35 -0
- package/dist/components/data-views/os-folder-glyph.js +104 -0
- package/dist/components/data-views/os-folder-glyph.js.map +1 -0
- package/dist/components/data-views/outline-tree-menu.d.ts +36 -0
- package/dist/components/data-views/outline-tree-menu.js +131 -0
- package/dist/components/data-views/outline-tree-menu.js.map +1 -0
- package/dist/components/table-properties/column-row.d.ts +22 -0
- package/dist/components/table-properties/column-row.js +153 -0
- package/dist/components/table-properties/column-row.js.map +1 -0
- package/dist/components/table-properties/draggable-list.d.ts +24 -0
- package/dist/components/table-properties/draggable-list.js +53 -0
- package/dist/components/table-properties/draggable-list.js.map +1 -0
- package/dist/components/table-properties/drawer-button.d.ts +110 -0
- package/dist/components/table-properties/drawer-button.js +2748 -0
- package/dist/components/table-properties/drawer-button.js.map +1 -0
- package/dist/components/table-properties/drawer.d.ts +100 -0
- package/dist/components/table-properties/drawer.js +2595 -0
- package/dist/components/table-properties/drawer.js.map +1 -0
- package/dist/components/table-properties/filter-card.d.ts +24 -0
- package/dist/components/table-properties/filter-card.js +854 -0
- package/dist/components/table-properties/filter-card.js.map +1 -0
- package/dist/components/table-properties/index.d.ts +14 -0
- package/dist/components/table-properties/index.js +2768 -0
- package/dist/components/table-properties/index.js.map +1 -0
- package/dist/components/table-properties/sort-card.d.ts +20 -0
- package/dist/components/table-properties/sort-card.js +102 -0
- package/dist/components/table-properties/sort-card.js.map +1 -0
- package/dist/components/templates/dedicated-search-landing-template.d.ts +21 -0
- package/dist/components/templates/dedicated-search-landing-template.js +254 -0
- package/dist/components/templates/dedicated-search-landing-template.js.map +1 -0
- package/dist/components/templates/dedicated-search-results-template.d.ts +15 -0
- package/dist/components/templates/dedicated-search-results-template.js +16 -0
- package/dist/components/templates/dedicated-search-results-template.js.map +1 -0
- package/dist/components/templates/index.d.ts +9 -0
- package/dist/components/templates/index.js +2720 -0
- package/dist/components/templates/index.js.map +1 -0
- package/dist/components/templates/list-page.d.ts +83 -0
- package/dist/components/templates/list-page.js +2433 -0
- package/dist/components/templates/list-page.js.map +1 -0
- package/dist/components/templates/nested-secondary-panel-shell.d.ts +20 -0
- package/dist/components/templates/nested-secondary-panel-shell.js +54 -0
- package/dist/components/templates/nested-secondary-panel-shell.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +10 -0
- package/dist/components/ui/accordion.js +74 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +37 -0
- package/dist/components/ui/alert-dialog.js +201 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +84 -0
- package/dist/components/ui/avatar.js +328 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.js +49 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/banner.d.ts +62 -0
- package/dist/components/ui/banner.js +364 -0
- package/dist/components/ui/banner.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +14 -0
- package/dist/components/ui/breadcrumb.js +114 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.d.ts +16 -0
- package/dist/components/ui/button.js +59 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +13 -0
- package/dist/components/ui/calendar.js +238 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +14 -0
- package/dist/components/ui/card.js +102 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/chart.d.ts +58 -0
- package/dist/components/ui/chart.js +292 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +23 -0
- package/dist/components/ui/checkbox.js +155 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/coach-mark.d.ts +27 -0
- package/dist/components/ui/coach-mark.js +306 -0
- package/dist/components/ui/coach-mark.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.js +35 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +36 -0
- package/dist/components/ui/command.js +274 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +32 -0
- package/dist/components/ui/context-menu.js +245 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/date-picker-field.d.ts +38 -0
- package/dist/components/ui/date-picker-field.js +550 -0
- package/dist/components/ui/date-picker-field.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.js +200 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dot-pattern.d.ts +21 -0
- package/dist/components/ui/dot-pattern.js +139 -0
- package/dist/components/ui/dot-pattern.js.map +1 -0
- package/dist/components/ui/drag-handle-grip.d.ts +10 -0
- package/dist/components/ui/drag-handle-grip.js +15 -0
- package/dist/components/ui/drag-handle-grip.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +16 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +45 -0
- package/dist/components/ui/dropdown-menu.js +353 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/export-drawer.d.ts +11 -0
- package/dist/components/ui/export-drawer.js +1658 -0
- package/dist/components/ui/export-drawer.js.map +1 -0
- package/dist/components/ui/field.d.ts +30 -0
- package/dist/components/ui/field.js +249 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +28 -0
- package/dist/components/ui/form.js +110 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +9 -0
- package/dist/components/ui/hover-card.js +43 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +219 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-mask.d.ts +39 -0
- package/dist/components/ui/input-mask.js +118 -0
- package/dist/components/ui/input-mask.js.map +1 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +30 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +20 -0
- package/dist/components/ui/kbd.js +45 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/key-metrics-context.d.ts +19 -0
- package/dist/components/ui/key-metrics-context.js +26 -0
- package/dist/components/ui/key-metrics-context.js.map +1 -0
- package/dist/components/ui/key-metrics.d.ts +131 -0
- package/dist/components/ui/key-metrics.js +1015 -0
- package/dist/components/ui/key-metrics.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.js +28 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/list-page-view-frame.d.ts +22 -0
- package/dist/components/ui/list-page-view-frame.js +24 -0
- package/dist/components/ui/list-page-view-frame.js.map +1 -0
- package/dist/components/ui/page-header.d.ts +51 -0
- package/dist/components/ui/page-header.js +372 -0
- package/dist/components/ui/page-header.js.map +1 -0
- package/dist/components/ui/payment-card-fields.d.ts +10 -0
- package/dist/components/ui/payment-card-fields.js +80 -0
- package/dist/components/ui/payment-card-fields.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.js +47 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +29 -0
- package/dist/components/ui/radio-group.js +190 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +16 -0
- package/dist/components/ui/resizable.js +51 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +8 -0
- package/dist/components/ui/scroll-area.js +66 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +18 -0
- package/dist/components/ui/select.js +186 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/selection-tile-grid.d.ts +52 -0
- package/dist/components/ui/selection-tile-grid.js +347 -0
- package/dist/components/ui/selection-tile-grid.js.map +1 -0
- package/dist/components/ui/separator.d.ts +7 -0
- package/dist/components/ui/separator.js +33 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +18 -0
- package/dist/components/ui/sheet.js +181 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +94 -0
- package/dist/components/ui/sidebar.js +805 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +22 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +7 -0
- package/dist/components/ui/slider.js +66 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.js +38 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/status-badge.d.ts +38 -0
- package/dist/components/ui/status-badge.js +77 -0
- package/dist/components/ui/status-badge.js.map +1 -0
- package/dist/components/ui/table.d.ts +13 -0
- package/dist/components/ui/table.js +115 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +15 -0
- package/dist/components/ui/tabs.js +93 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.js +25 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tip.d.ts +12 -0
- package/dist/components/ui/tip.js +61 -0
- package/dist/components/ui/tip.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +14 -0
- package/dist/components/ui/toggle-group.js +104 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle-switch.d.ts +10 -0
- package/dist/components/ui/toggle-switch.js +33 -0
- package/dist/components/ui/toggle-switch.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.js +51 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.js +68 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/view-segmented-control.d.ts +31 -0
- package/dist/components/ui/view-segmented-control.js +167 -0
- package/dist/components/ui/view-segmented-control.js.map +1 -0
- package/dist/data-list-view-registry-CyBoBML4.d.ts +73 -0
- package/dist/hooks/use-app-theme.d.ts +24 -0
- package/dist/hooks/use-app-theme.js +286 -0
- package/dist/hooks/use-app-theme.js.map +1 -0
- package/dist/hooks/use-coach-mark.d.ts +86 -0
- package/dist/hooks/use-coach-mark.js +218 -0
- package/dist/hooks/use-coach-mark.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +29 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-mod-key-label.d.ts +6 -0
- package/dist/hooks/use-mod-key-label.js +25 -0
- package/dist/hooks/use-mod-key-label.js.map +1 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.js +13324 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/compose-refs.d.ts +6 -0
- package/dist/lib/compose-refs.js +17 -0
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/lib/conditional-rule-match.d.ts +30 -0
- package/dist/lib/conditional-rule-match.js +66 -0
- package/dist/lib/conditional-rule-match.js.map +1 -0
- package/dist/lib/data-list-display-options.d.ts +26 -0
- package/dist/lib/data-list-display-options.js +14 -0
- package/dist/lib/data-list-display-options.js.map +1 -0
- package/dist/lib/data-list-view-registry.d.ts +2 -0
- package/dist/lib/data-list-view-registry.js +102 -0
- package/dist/lib/data-list-view-registry.js.map +1 -0
- package/dist/lib/data-list-view-surface.d.ts +2 -0
- package/dist/lib/data-list-view-surface.js +80 -0
- package/dist/lib/data-list-view-surface.js.map +1 -0
- package/dist/lib/data-list-view.d.ts +21 -0
- package/dist/lib/data-list-view.js +25 -0
- package/dist/lib/data-list-view.js.map +1 -0
- package/dist/lib/date-filter.d.ts +22 -0
- package/dist/lib/date-filter.js +61 -0
- package/dist/lib/date-filter.js.map +1 -0
- package/dist/lib/dev-log.d.ts +8 -0
- package/dist/lib/dev-log.js +10 -0
- package/dist/lib/dev-log.js.map +1 -0
- package/dist/lib/dropdown-menu-surface.d.ts +14 -0
- package/dist/lib/dropdown-menu-surface.js +6 -0
- package/dist/lib/dropdown-menu-surface.js.map +1 -0
- package/dist/lib/editable-target.d.ts +12 -0
- package/dist/lib/editable-target.js +12 -0
- package/dist/lib/editable-target.js.map +1 -0
- package/dist/lib/list-page-table-properties.d.ts +35 -0
- package/dist/lib/list-page-table-properties.js +81 -0
- package/dist/lib/list-page-table-properties.js.map +1 -0
- package/dist/lib/raf-throttle.d.ts +23 -0
- package/dist/lib/raf-throttle.js +27 -0
- package/dist/lib/raf-throttle.js.map +1 -0
- package/dist/lib/row-height.d.ts +16 -0
- package/dist/lib/row-height.js +10 -0
- package/dist/lib/row-height.js.map +1 -0
- package/dist/lib/table-properties-types.d.ts +83 -0
- package/dist/lib/table-properties-types.js +19 -0
- package/dist/lib/table-properties-types.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +83 -19
- package/src/components/data-table/filter-date-calendar.tsx +38 -0
- package/src/components/data-table/filter-text-value-input.tsx +77 -0
- package/src/components/data-table/index.tsx +1678 -0
- package/src/components/data-table/pagination.tsx +255 -0
- package/src/components/data-table/types.ts +96 -0
- package/src/components/data-table/use-table-state.ts +767 -0
- package/src/components/data-views/board-card-primitives.tsx +93 -0
- package/src/components/data-views/data-row-list.tsx +183 -0
- package/src/components/data-views/finder-panel-view.tsx +405 -0
- package/src/components/data-views/folder-grid-view.tsx +86 -0
- package/src/components/data-views/hub-table.tsx +498 -0
- package/src/components/data-views/index.ts +28 -0
- package/src/components/data-views/list-page-board-card.tsx +192 -0
- package/src/components/data-views/list-page-board-template.tsx +122 -0
- package/src/components/data-views/list-page-connected-view-body.tsx +66 -0
- package/src/components/data-views/list-page-split-details-placeholder.tsx +39 -0
- package/src/components/data-views/list-page-split-hub-chrome.tsx +60 -0
- package/src/components/data-views/list-page-split-hub-tokens.ts +16 -0
- package/src/components/data-views/list-page-tree-column-header.tsx +31 -0
- package/src/components/data-views/list-page-tree-panel-shell.tsx +91 -0
- package/src/components/data-views/os-folder-glyph.tsx +141 -0
- package/src/components/data-views/outline-tree-menu.tsx +157 -0
- package/src/components/table-properties/column-row.tsx +90 -0
- package/src/components/table-properties/draggable-list.ts +54 -0
- package/src/components/table-properties/drawer-button.tsx +300 -0
- package/src/components/table-properties/drawer.tsx +1148 -0
- package/src/components/table-properties/filter-card.tsx +251 -0
- package/src/components/table-properties/index.ts +36 -0
- package/src/components/table-properties/sort-card.tsx +63 -0
- package/src/components/templates/dedicated-search-landing-template.tsx +124 -0
- package/src/components/templates/dedicated-search-results-template.tsx +19 -0
- package/src/components/templates/index.ts +33 -0
- package/src/components/templates/list-page.tsx +602 -0
- package/src/components/templates/nested-secondary-panel-shell.tsx +70 -0
- package/src/components/ui/accordion.tsx +92 -0
- package/src/components/ui/alert-dialog.tsx +221 -0
- package/src/components/ui/avatar.tsx +13 -2
- package/src/components/ui/banner.tsx +2 -2
- package/src/components/ui/button.tsx +4 -4
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/coach-mark.tsx +1 -1
- package/src/components/ui/context-menu.tsx +291 -0
- package/src/components/ui/date-picker-field.tsx +2 -2
- package/src/components/ui/dot-pattern.tsx +183 -0
- package/src/components/ui/export-drawer.tsx +375 -0
- package/src/components/ui/hover-card.tsx +66 -0
- package/src/components/ui/key-metrics-context.tsx +78 -0
- package/src/components/ui/key-metrics.tsx +1133 -0
- package/src/components/ui/list-page-view-frame.tsx +64 -0
- package/src/components/ui/page-header.tsx +244 -0
- package/src/components/ui/payment-card-fields.tsx +2 -2
- package/src/components/ui/resizable.tsx +68 -0
- package/src/components/ui/scroll-area.tsx +72 -0
- package/src/components/ui/selection-tile-grid.tsx +9 -2
- package/src/components/ui/sidebar.tsx +84 -12
- package/src/components/ui/slider.tsx +83 -0
- package/src/globals.css +2201 -7
- package/src/globals.d.ts +20 -0
- package/src/index.ts +68 -1
- package/src/lib/conditional-rule-match.ts +119 -0
- package/src/lib/data-list-display-options.ts +35 -0
- package/src/lib/data-list-view-registry.ts +104 -0
- package/src/lib/data-list-view-surface.ts +83 -0
- package/src/lib/data-list-view.ts +47 -0
- package/src/lib/dev-log.ts +10 -0
- package/src/lib/editable-target.ts +20 -0
- package/src/lib/list-page-table-properties.ts +48 -0
- package/src/lib/raf-throttle.ts +45 -0
- package/src/lib/row-height.ts +19 -0
- package/src/lib/table-properties-types.ts +98 -0
- package/template/.cursor/rules/exxat-command-menu.mdc +1 -1
- package/template/.cursor/rules/exxat-dashboard-view-charts.mdc +3 -3
- package/template/.cursor/rules/exxat-data-tables.mdc +1 -1
- package/template/.cursor/rules/exxat-ds-agents.mdc +2 -2
- package/template/.cursor/rules/exxat-kbd-shortcuts.mdc +2 -2
- package/template/.cursor/rules/exxat-table-properties-drawer.mdc +1 -1
- package/template/AGENTS.md +104 -78
- package/template/app/(app)/dashboard/loading.tsx +15 -3
- package/template/app/(app)/dashboard/page.tsx +14 -2
- package/template/app/(app)/examples/page.tsx +0 -2
- package/template/app/(app)/layout.tsx +17 -4
- package/template/app/(app)/loading.tsx +18 -1
- package/template/app/(app)/question-bank/find/page.tsx +1 -2
- package/template/app/(app)/question-bank/layout.tsx +1 -1
- package/template/app/(app)/question-bank/library/page.tsx +1 -2
- package/template/app/(app)/question-bank/list/page.tsx +1 -2
- package/template/app/(app)/question-bank/new/page.tsx +15 -20
- package/template/app/(app)/question-bank/page.tsx +1 -2
- package/template/app/(app)/settings/page.tsx +5 -4
- package/template/app/globals.css +14 -16
- package/template/components/ask-leo-sidebar.tsx +5 -1
- package/template/components/brand-color-picker.tsx +2 -2
- package/template/components/charts-overview.tsx +1 -1
- package/template/components/compliance-board-view.tsx +142 -0
- package/template/components/compliance-client.tsx +92 -0
- package/template/components/compliance-page-header.tsx +89 -0
- package/template/components/compliance-table.tsx +468 -0
- package/template/components/dashboard-report-charts.tsx +1 -1
- package/template/components/dashboard-tabs.tsx +1 -1
- package/template/components/data-table/filter-date-calendar.tsx +1 -38
- package/template/components/data-table/filter-text-value-input.tsx +1 -77
- package/template/components/data-table/index.tsx +1 -1634
- package/template/components/data-table/pagination.tsx +1 -255
- package/template/components/data-table/types.ts +1 -94
- package/template/components/data-table/use-table-state.test.ts +420 -0
- package/template/components/data-table/use-table-state.ts +1 -758
- package/template/components/data-view-dashboard-charts-compliance.tsx +963 -0
- package/template/components/data-view-dashboard-charts-team.tsx +971 -0
- package/template/components/data-view-dashboard-charts.tsx +1503 -0
- package/template/components/data-views/board-card-primitives.tsx +1 -93
- package/template/components/data-views/data-row-list.tsx +1 -183
- package/template/components/data-views/finder-panel-view.tsx +1 -405
- package/template/components/data-views/folder-grid-view.tsx +1 -86
- package/template/components/data-views/hub-table.tsx +1 -0
- package/template/components/data-views/index.ts +50 -37
- package/template/components/data-views/list-page-board-card.tsx +1 -192
- package/template/components/data-views/list-page-board-template.tsx +1 -122
- package/template/components/data-views/list-page-connected-view-body.tsx +1 -66
- package/template/components/data-views/list-page-split-details-placeholder.tsx +1 -39
- package/template/components/data-views/list-page-split-hub-chrome.tsx +1 -68
- package/template/components/data-views/list-page-split-hub-tokens.ts +1 -16
- package/template/components/data-views/list-page-tree-column-header.tsx +1 -31
- package/template/components/data-views/list-page-tree-panel-shell.tsx +1 -91
- package/template/components/data-views/list-page-view-frame.tsx +5 -53
- package/template/components/data-views/os-folder-glyph.tsx +1 -129
- package/template/components/data-views/outline-tree-menu.tsx +1 -157
- package/template/components/export-drawer.test.tsx +71 -0
- package/template/components/export-drawer.tsx +1 -375
- package/template/components/exxat-product-logo.tsx +5 -5
- package/template/components/hub-tree-panel-view.tsx +2 -2
- package/template/components/invite-collaborators-drawer.tsx +3 -3
- package/template/components/key-metrics-ask-leo-bridge.tsx +40 -0
- package/template/components/key-metrics.tsx +1 -1063
- package/template/components/leo-insight-indicator.tsx +2 -2
- package/template/components/new-placement-back-btn.tsx +28 -0
- package/template/components/new-placement-form.tsx +942 -0
- package/template/components/new-question-composer.tsx +456 -408
- package/template/components/onboarding/index.ts +9 -0
- package/template/components/onboarding/onboarding-01.tsx +1 -1
- package/template/components/onboarding/onboarding-02.tsx +1 -1
- package/template/components/onboarding/onboarding-03.tsx +1 -1
- package/template/components/onboarding/onboarding-04.tsx +1 -1
- package/template/components/page-header.tsx +8 -226
- package/template/components/placement-board-card.tsx +250 -0
- package/template/components/placement-detail.tsx +438 -0
- package/template/components/placements-board-view.tsx +397 -0
- package/template/components/placements-client.tsx +220 -0
- package/template/components/placements-list-view.tsx +124 -0
- package/template/components/placements-page-header.tsx +166 -0
- package/template/components/placements-table-cells.test.tsx +22 -0
- package/template/components/placements-table-cells.tsx +173 -0
- package/template/components/placements-table-columns.tsx +210 -0
- package/template/components/placements-table.tsx +934 -0
- package/template/components/product-switcher.tsx +3 -4
- package/template/components/product-wordmark.tsx +2 -1
- package/template/components/question-bank-client.tsx +5 -5
- package/template/components/question-bank-hub-client.tsx +1 -1
- package/template/components/question-bank-new-folder-sheet.tsx +2 -2
- package/template/components/question-bank-secondary-nav.tsx +3 -3
- package/template/components/question-bank-table.tsx +541 -431
- package/template/components/rotations-empty-state.tsx +50 -0
- package/template/components/rotations-panel-activator.tsx +8 -0
- package/template/components/settings-appearance-card.tsx +3 -4
- package/template/components/settings-client.tsx +15 -59
- package/template/components/settings-form-row.tsx +4 -9
- package/template/components/{app-sidebar-dynamic.tsx → sidebar/app-sidebar-dynamic.tsx} +1 -1
- package/template/components/{app-sidebar.tsx → sidebar/app-sidebar.tsx} +59 -74
- package/template/components/sidebar/index.ts +16 -0
- package/template/components/{secondary-nav.tsx → sidebar/secondary-nav.tsx} +2 -2
- package/template/components/{secondary-panel.tsx → sidebar/secondary-panel.tsx} +50 -7
- package/template/components/{sidebar-auto-collapse.tsx → sidebar/sidebar-auto-collapse.tsx} +6 -2
- package/template/components/{sidebar-shell.tsx → sidebar/sidebar-shell.tsx} +1 -1
- package/template/components/site-header.tsx +1 -1
- package/template/components/sites-board-view.tsx +67 -0
- package/template/components/sites-client.tsx +154 -0
- package/template/components/sites-table.tsx +249 -0
- package/template/components/table-properties/column-row.tsx +1 -90
- package/template/components/table-properties/draggable-list.ts +1 -49
- package/template/components/table-properties/drawer-button.tsx +1 -262
- package/template/components/table-properties/drawer.tsx +1 -1166
- package/template/components/table-properties/filter-card.tsx +1 -251
- package/template/components/table-properties/sort-card.tsx +1 -59
- package/template/components/table-properties/types.ts +28 -71
- package/template/components/team-board-view.tsx +122 -0
- package/template/components/team-client.tsx +100 -0
- package/template/components/team-page-header.tsx +92 -0
- package/template/components/team-table.tsx +553 -0
- package/template/components/templates/dedicated-search-landing-template.tsx +1 -124
- package/template/components/templates/dedicated-search-results-template.tsx +1 -19
- package/template/components/templates/list-page.tsx +1 -608
- package/template/components/templates/nested-secondary-panel-shell.tsx +1 -63
- package/template/components/templates/new-focus-template.tsx +659 -0
- package/template/components/templates/secondary-panel-hub-template.tsx +1 -1
- package/template/components/ui/accordion.tsx +1 -0
- package/template/components/ui/alert-dialog.tsx +1 -0
- package/template/components/ui/context-menu.tsx +1 -0
- package/template/components/ui/dot-pattern.tsx +1 -183
- package/template/components/ui/hover-card.tsx +1 -0
- package/template/components/ui/resizable.tsx +1 -68
- package/template/components/ui/scroll-area.tsx +1 -0
- package/template/components/ui/slider.tsx +1 -0
- package/template/docs/blueprints/README.md +86 -0
- package/template/docs/blueprints/_template.md +91 -0
- package/template/docs/blueprints/board-card.md +123 -0
- package/template/docs/blueprints/data-table.md +139 -0
- package/template/docs/blueprints/key-metrics.md +128 -0
- package/template/docs/blueprints/list-page-template.md +123 -0
- package/template/docs/blueprints/page-header.md +130 -0
- package/template/docs/command-menu-pattern.md +1 -1
- package/template/docs/component-selection-guide.md +224 -0
- package/template/docs/components-audit-2026-05.md +158 -0
- package/template/docs/data-views-pattern.md +17 -54
- package/template/docs/drawer-vs-dialog-pattern.md +1 -3
- package/template/docs/migrations/0001-brand-deep-alias-stabilization.md +95 -0
- package/template/docs/migrations/0002-exxat-token-namespace.md +154 -0
- package/template/docs/migrations/0003-globals-css-canonical.md +110 -0
- package/template/docs/migrations/README.md +100 -0
- package/template/docs/migrations/_template.md +64 -0
- package/template/docs/shell-surface-elevation-pattern.md +3 -5
- package/template/docs/token-taxonomy.md +416 -0
- package/template/eslint.config.mjs +27 -0
- package/template/hooks/use-secondary-panel-hub-nav.ts +1 -1
- package/template/lib/command-menu-config.ts +0 -1
- package/template/lib/command-menu-search-data.ts +27 -11
- package/template/lib/compliance-supported-views.ts +10 -0
- package/template/lib/conditional-rule-match.ts +6 -97
- package/template/lib/data-list-display-options.ts +1 -49
- package/template/lib/data-list-view-registry.ts +1 -104
- package/template/lib/data-list-view-surface.ts +1 -83
- package/template/lib/data-list-view.ts +1 -47
- package/template/lib/data-view-dashboard-placements-layout.ts +215 -0
- package/template/lib/data-view-dashboard-storage.ts +35 -38
- package/template/lib/dev-log.ts +1 -8
- package/template/lib/editable-target.ts +1 -10
- package/template/lib/list-page-table-properties.ts +1 -48
- package/template/lib/list-status-badges.ts +97 -4
- package/template/lib/mock/compliance-kpi.ts +61 -0
- package/template/lib/mock/compliance.ts +146 -0
- package/template/lib/mock/navigation.tsx +0 -9
- package/template/lib/mock/placements-kpi.ts +134 -0
- package/template/lib/mock/placements.ts +176 -0
- package/template/lib/mock/sites-directory.ts +16 -0
- package/template/lib/mock/sites-kpi.ts +25 -0
- package/template/lib/mock/team-kpi.ts +60 -0
- package/template/lib/mock/team.ts +118 -0
- package/template/lib/placement-board-card-layout.ts +79 -0
- package/template/lib/placements-supported-views.ts +12 -0
- package/template/lib/question-bank-supported-views.ts +0 -1
- package/template/lib/raf-throttle.ts +1 -45
- package/template/lib/row-height.ts +4 -10
- package/template/lib/sidebar-state-cookie.ts +11 -2
- package/template/lib/sites-supported-views.ts +10 -0
- package/template/lib/table-state-lifecycle.ts +2 -2
- package/template/lib/team-supported-views.ts +10 -0
- package/template/package.json +1 -0
- package/template/tests/setup.ts +25 -0
- package/consumer-extras/AGENTS.md +0 -76
- package/consumer-extras/cursor-skills/exxat-consumer-app/SKILL.md +0 -37
- package/consumer-extras/cursor-skills/exxat-focused-workflow-page/SKILL.md +0 -57
- package/consumer-extras/patterns/consumer-app-pattern.md +0 -39
- package/consumer-extras/patterns/focused-workflow-page-pattern.md +0 -84
- package/src/components/ui/button-group.tsx +0 -81
- package/src/theme.css +0 -16
- package/src/tokens/README.md +0 -15
- package/src/tokens/base.css +0 -337
- package/src/tokens/high-contrast.css +0 -1195
- package/src/tokens/layers.css +0 -224
- package/src/tokens/tailwind-bridge.css +0 -118
- package/src/tokens/themes.css +0 -201
- package/template/app/(app)/data-list/layout.tsx +0 -43
- package/template/app/(app)/data-list/page.tsx +0 -10
- package/template/app/(app)/examples/focused-workflow/page.tsx +0 -5
- package/template/components/app-route-loading.tsx +0 -14
- package/template/components/dashboard-onboarding-gallery.tsx +0 -13
- package/template/components/dashboard-onboarding.tsx +0 -21
- package/template/components/data-views/list-page-calendar-view.tsx +0 -593
- package/template/components/data-views/list-page-folder-columns-panel.tsx +0 -345
- package/template/components/examples/focused-workflow-showcase.tsx +0 -183
- package/template/components/list-hub-board-view.tsx +0 -68
- package/template/components/list-hub-client.tsx +0 -186
- package/template/components/list-hub-list-view.tsx +0 -36
- package/template/components/list-hub-panel-activator.tsx +0 -8
- package/template/components/list-hub-secondary-nav.tsx +0 -121
- package/template/components/list-hub-table.tsx +0 -336
- package/template/components/question-bank-folder-columns-panel.tsx +0 -104
- package/template/components/question-bank-list-view.tsx +0 -53
- package/template/components/secondary-panel/nav-link-rows.tsx +0 -83
- package/template/components/secondary-panels/list-hub-panel.tsx +0 -39
- package/template/components/secondary-panels/question-bank-panel.tsx +0 -39
- package/template/components/secondary-panels/registry.tsx +0 -15
- package/template/components/section-cards.tsx +0 -106
- package/template/components/templates/focused-workflow-layouts.tsx +0 -448
- package/template/components/templates/focused-workflow-page-template.tsx +0 -69
- package/template/components/templates/page-loading-shell.tsx +0 -262
- package/template/components/ui/button-group.tsx +0 -1
- package/template/docs/consumer-app-pattern.md +0 -39
- package/template/docs/focused-workflow-page-pattern.md +0 -84
- package/template/lib/list-hub-nav.ts +0 -121
- package/template/lib/mock/list-hub-directory.ts +0 -27
- package/template/lib/mock/list-hub-kpi.ts +0 -27
- package/template/lib/page-loading-variant.ts +0 -40
- /package/template/components/{getting-started.tsx → onboarding/getting-started.tsx} +0 -0
- /package/template/components/{nav-documents.tsx → sidebar/nav-documents.tsx} +0 -0
- /package/template/components/{nav-main.tsx → sidebar/nav-main.tsx} +0 -0
- /package/template/components/{nav-secondary.tsx → sidebar/nav-secondary.tsx} +0 -0
- /package/template/components/{nav-user.tsx → sidebar/nav-user.tsx} +0 -0
- /package/template/components/{sidebar-auto-open.tsx → sidebar/sidebar-auto-open.tsx} +0 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Question bank —
|
|
4
|
+
* Question bank — thin wrapper around the centralized `<HubTable>`. Owns column defs,
|
|
5
|
+
* folder/panel/tree-panel custom views, the new-folder + customize-folder sheet, and
|
|
6
|
+
* forwards URL search via `HubTable.syncedSearchFromUrl`.
|
|
7
|
+
*
|
|
8
|
+
* Single dataset rule: `HubTable` runs one `useTableState(tableSourceItems, columns, …)`.
|
|
9
|
+
* Every non-table renderer (list, board, folder, panel, tree-panel, dashboard) reads
|
|
10
|
+
* `state.rows` — the same filtered/sorted/searched bag as the grid.
|
|
5
11
|
*/
|
|
6
12
|
|
|
7
13
|
import * as React from "react"
|
|
8
14
|
import dynamic from "next/dynamic"
|
|
9
15
|
import { mailtoHref } from "@/lib/mailto"
|
|
10
|
-
import { DataTable, DataTableToolbar } from "@/components/data-table"
|
|
11
16
|
import type { DataListViewType } from "@/lib/data-list-view"
|
|
12
|
-
import type { OpenTablePropertiesHandle } from "@/lib/list-page-table-properties"
|
|
13
|
-
import { QUESTION_BANK_SUPPORTED_VIEWS } from "@/lib/question-bank-supported-views"
|
|
14
17
|
import type { ColumnDef } from "@/components/data-table/types"
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
import {
|
|
19
|
+
HubTable,
|
|
20
|
+
type HubTableHandle,
|
|
21
|
+
type HubTableRenderers,
|
|
22
|
+
type HubTableRendererArgs,
|
|
23
|
+
} from "@/components/data-views"
|
|
24
|
+
import { QUESTION_BANK_SUPPORTED_VIEWS } from "@/lib/question-bank-supported-views"
|
|
18
25
|
import { Button } from "@/components/ui/button"
|
|
19
26
|
import {
|
|
20
27
|
DropdownMenu,
|
|
@@ -24,13 +31,25 @@ import {
|
|
|
24
31
|
} from "@/components/ui/dropdown-menu"
|
|
25
32
|
import { Tip } from "@/components/ui/tip"
|
|
26
33
|
import { Skeleton } from "@/components/ui/skeleton"
|
|
27
|
-
import {
|
|
28
|
-
|
|
34
|
+
import {
|
|
35
|
+
ResizableHandle,
|
|
36
|
+
ResizablePanel,
|
|
37
|
+
ResizablePanelGroup,
|
|
38
|
+
} from "@/components/ui/resizable"
|
|
39
|
+
import {
|
|
40
|
+
Tooltip,
|
|
41
|
+
TooltipContent,
|
|
42
|
+
TooltipTrigger,
|
|
43
|
+
} from "@/components/ui/tooltip"
|
|
29
44
|
import { ListPageSplitHubChrome } from "@/components/data-views/list-page-split-hub-chrome"
|
|
30
|
-
import {
|
|
31
|
-
|
|
45
|
+
import {
|
|
46
|
+
LIST_PAGE_SPLIT_MILLER_DETAIL_PANEL_CLASS,
|
|
47
|
+
LIST_PAGE_SPLIT_RESIZABLE_HANDLE_CLASS,
|
|
48
|
+
LIST_PAGE_SPLIT_MILLER_COLUMN_PANEL_CLASS,
|
|
49
|
+
} from "@/components/data-views/list-page-split-hub-tokens"
|
|
50
|
+
import { ListPageTreeColumnHeader } from "@/components/data-views/list-page-tree-column-header"
|
|
32
51
|
import { QuestionBankBoardView, QUESTION_BANK_BOARD_GROUP_OPTIONS } from "@/components/question-bank-board-view"
|
|
33
|
-
import {
|
|
52
|
+
import { ListPageBoardCard } from "@/components/data-views/list-page-board-card"
|
|
34
53
|
import {
|
|
35
54
|
QuestionBankFavoriteButton,
|
|
36
55
|
QUESTION_BANK_FAVORITE_HOVER_GROUP,
|
|
@@ -49,17 +68,19 @@ import {
|
|
|
49
68
|
type QuestionBankItem,
|
|
50
69
|
type QuestionBankType,
|
|
51
70
|
} from "@/lib/mock/question-bank"
|
|
52
|
-
import
|
|
71
|
+
import {
|
|
72
|
+
type QuestionBankFolder,
|
|
73
|
+
QUESTION_BANK_FOLDER_COLOR_STYLES,
|
|
74
|
+
QUESTION_BANK_FOLDER_ICON_COLORS,
|
|
75
|
+
} from "@/lib/mock/question-bank-folders"
|
|
53
76
|
import {
|
|
54
77
|
toggleQuestionBankItemFavorite,
|
|
55
78
|
applyQuestionBankHubDisplayFilters,
|
|
56
79
|
type QuestionBankLandingFilterState,
|
|
57
80
|
type QuestionBankNavState,
|
|
58
81
|
} from "@/lib/question-bank-nav"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type DataListDisplayOptions,
|
|
62
|
-
} from "@/lib/data-list-display-options"
|
|
82
|
+
|
|
83
|
+
// ─── Dynamic dashboard charts section ────────────────────────────────────────
|
|
63
84
|
|
|
64
85
|
const QuestionBankDashboardChartsSection = dynamic(
|
|
65
86
|
() =>
|
|
@@ -91,6 +112,8 @@ const QuestionBankDashboardChartsSection = dynamic(
|
|
|
91
112
|
},
|
|
92
113
|
)
|
|
93
114
|
|
|
115
|
+
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
116
|
+
|
|
94
117
|
const TYPE_LABEL: Record<QuestionBankType, string> = {
|
|
95
118
|
multiple_choice: "Multiple choice",
|
|
96
119
|
true_false: "True / false",
|
|
@@ -103,21 +126,6 @@ const DIFFICULTY_LABEL: Record<QuestionBankDifficulty, string> = {
|
|
|
103
126
|
hard: "Hard",
|
|
104
127
|
}
|
|
105
128
|
|
|
106
|
-
function newQuestionBankItemId() {
|
|
107
|
-
return `q-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Folder id to use when adding a question from the root column (`parentId` null). */
|
|
111
|
-
function defaultFolderIdForColumnParent(parentId: string | null, folders: QuestionBankFolder[]): string | null {
|
|
112
|
-
if (parentId !== null) return parentId
|
|
113
|
-
const roots = [...folders].filter(f => f.parentId === null).sort((a, b) => a.name.localeCompare(b.name))
|
|
114
|
-
return roots[0]?.id ?? null
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function uniqueTopics(items: QuestionBankItem[]) {
|
|
118
|
-
return [...new Set(items.map(i => i.topic))].sort().map(t => ({ value: t, label: t }))
|
|
119
|
-
}
|
|
120
|
-
|
|
121
129
|
const TYPE_FILTER_OPTS = (Object.keys(TYPE_LABEL) as QuestionBankType[]).map(k => ({
|
|
122
130
|
value: k,
|
|
123
131
|
label: TYPE_LABEL[k],
|
|
@@ -128,26 +136,18 @@ const DIFFICULTY_FILTER_OPTS = (Object.keys(DIFFICULTY_LABEL) as QuestionBankDif
|
|
|
128
136
|
label: DIFFICULTY_LABEL[k],
|
|
129
137
|
}))
|
|
130
138
|
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
key: c.key,
|
|
140
|
-
label: c.label,
|
|
141
|
-
icon: f.icon ?? "fa-filter",
|
|
142
|
-
type: f.type,
|
|
143
|
-
operators: (f.operators ?? defaultOps) as FilterOperator[],
|
|
144
|
-
options: f.options,
|
|
145
|
-
...(f.textMask ? { textMask: f.textMask } : {}),
|
|
146
|
-
}
|
|
139
|
+
function newQuestionBankItemId() {
|
|
140
|
+
return `q-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function defaultFolderIdForColumnParent(parentId: string | null, folders: QuestionBankFolder[]): string | null {
|
|
144
|
+
if (parentId !== null) return parentId
|
|
145
|
+
const roots = [...folders].filter(f => f.parentId === null).sort((a, b) => a.name.localeCompare(b.name))
|
|
146
|
+
return roots[0]?.id ?? null
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
function
|
|
150
|
-
return
|
|
149
|
+
function uniqueTopics(items: QuestionBankItem[]) {
|
|
150
|
+
return [...new Set(items.map(i => i.topic))].sort().map(t => ({ value: t, label: t }))
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
function buildQuestionBankColumns(
|
|
@@ -156,18 +156,8 @@ function buildQuestionBankColumns(
|
|
|
156
156
|
): ColumnDef<QuestionBankItem>[] {
|
|
157
157
|
const topicOpts = uniqueTopics(items)
|
|
158
158
|
const { onToggleFavorite } = opts
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
key: "select",
|
|
162
|
-
label: "",
|
|
163
|
-
width: 40,
|
|
164
|
-
minWidth: 40,
|
|
165
|
-
defaultPin: "left",
|
|
166
|
-
lockPin: true,
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const cols: ColumnDef<QuestionBankItem>[] = [COLUMN_SELECT]
|
|
170
|
-
cols.push(
|
|
159
|
+
return [
|
|
160
|
+
{ key: "select", label: "", width: 40, minWidth: 40, defaultPin: "left", lockPin: true },
|
|
171
161
|
{
|
|
172
162
|
key: "stem",
|
|
173
163
|
label: "Question",
|
|
@@ -176,14 +166,10 @@ function buildQuestionBankColumns(
|
|
|
176
166
|
sortable: true,
|
|
177
167
|
sortKey: "stem",
|
|
178
168
|
defaultPin: "left",
|
|
179
|
-
filter: {
|
|
180
|
-
type: "text",
|
|
181
|
-
icon: "fa-file-lines",
|
|
182
|
-
operators: ["contains", "not_contains"],
|
|
183
|
-
},
|
|
169
|
+
filter: { type: "text", icon: "fa-file-lines", operators: ["contains", "not_contains"] },
|
|
184
170
|
cell: row => (
|
|
185
171
|
<div className={cn(QUESTION_BANK_FAVORITE_HOVER_GROUP, "flex min-w-0 items-start gap-2")}>
|
|
186
|
-
<div className="flex min-w-0 flex-1 flex-col gap-0.5
|
|
172
|
+
<div className="flex min-w-0 flex-1 flex-col gap-0.5 pe-1">
|
|
187
173
|
<span className="line-clamp-2 text-sm font-medium text-foreground">{row.stem}</span>
|
|
188
174
|
<span className="font-mono text-xs text-muted-foreground">{row.questionId}</span>
|
|
189
175
|
</div>
|
|
@@ -198,12 +184,7 @@ function buildQuestionBankColumns(
|
|
|
198
184
|
minWidth: 120,
|
|
199
185
|
sortable: true,
|
|
200
186
|
sortKey: "topic",
|
|
201
|
-
filter: {
|
|
202
|
-
type: "select",
|
|
203
|
-
icon: "fa-layer-group",
|
|
204
|
-
operators: ["is", "is_not"],
|
|
205
|
-
options: topicOpts,
|
|
206
|
-
},
|
|
187
|
+
filter: { type: "select", icon: "fa-layer-group", operators: ["is", "is_not"], options: topicOpts },
|
|
207
188
|
cell: row => <span className="text-sm text-foreground/90">{row.topic}</span>,
|
|
208
189
|
},
|
|
209
190
|
{
|
|
@@ -213,12 +194,7 @@ function buildQuestionBankColumns(
|
|
|
213
194
|
minWidth: 120,
|
|
214
195
|
sortable: true,
|
|
215
196
|
sortKey: "type",
|
|
216
|
-
filter: {
|
|
217
|
-
type: "select",
|
|
218
|
-
icon: "fa-list-check",
|
|
219
|
-
operators: ["is", "is_not"],
|
|
220
|
-
options: TYPE_FILTER_OPTS,
|
|
221
|
-
},
|
|
197
|
+
filter: { type: "select", icon: "fa-list-check", operators: ["is", "is_not"], options: TYPE_FILTER_OPTS },
|
|
222
198
|
cell: row => <span className="text-sm text-foreground/90">{TYPE_LABEL[row.type]}</span>,
|
|
223
199
|
},
|
|
224
200
|
{
|
|
@@ -228,15 +204,8 @@ function buildQuestionBankColumns(
|
|
|
228
204
|
minWidth: 96,
|
|
229
205
|
sortable: true,
|
|
230
206
|
sortKey: "difficulty",
|
|
231
|
-
filter: {
|
|
232
|
-
|
|
233
|
-
icon: "fa-signal",
|
|
234
|
-
operators: ["is", "is_not"],
|
|
235
|
-
options: DIFFICULTY_FILTER_OPTS,
|
|
236
|
-
},
|
|
237
|
-
cell: row => (
|
|
238
|
-
<span className="text-sm text-foreground/90">{DIFFICULTY_LABEL[row.difficulty]}</span>
|
|
239
|
-
),
|
|
207
|
+
filter: { type: "select", icon: "fa-signal", operators: ["is", "is_not"], options: DIFFICULTY_FILTER_OPTS },
|
|
208
|
+
cell: row => <span className="text-sm text-foreground/90">{DIFFICULTY_LABEL[row.difficulty]}</span>,
|
|
240
209
|
},
|
|
241
210
|
{
|
|
242
211
|
key: "updatedAt",
|
|
@@ -257,11 +226,7 @@ function buildQuestionBankColumns(
|
|
|
257
226
|
minWidth: 200,
|
|
258
227
|
sortable: true,
|
|
259
228
|
sortKey: "author",
|
|
260
|
-
filter: {
|
|
261
|
-
type: "text",
|
|
262
|
-
icon: "fa-user",
|
|
263
|
-
operators: ["contains", "not_contains"],
|
|
264
|
-
},
|
|
229
|
+
filter: { type: "text", icon: "fa-user", operators: ["contains", "not_contains"] },
|
|
265
230
|
cell: row => {
|
|
266
231
|
const initials = initialsFromDisplayName(row.author)
|
|
267
232
|
return (
|
|
@@ -312,168 +277,260 @@ function buildQuestionBankColumns(
|
|
|
312
277
|
</div>
|
|
313
278
|
),
|
|
314
279
|
},
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return cols
|
|
280
|
+
]
|
|
318
281
|
}
|
|
319
282
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
export const QuestionBankTable = React.forwardRef<
|
|
323
|
-
QuestionBankTableHandle,
|
|
324
|
-
{
|
|
325
|
-
items: QuestionBankItem[]
|
|
326
|
-
/** When set, table / board / tree rows are limited to this nav scope (secondary sidebar). */
|
|
327
|
-
navState?: QuestionBankNavState
|
|
328
|
-
/** URL toolbar search binding (`?q=`) — omit on search landing so hub `q` does not pre-fill the grid search. */
|
|
329
|
-
urlListSearch?: string
|
|
330
|
-
/** When true, dedicated search shell: hub landing row filters; table toolbar search stays independent of URL `q`. */
|
|
331
|
-
searchLanding?: boolean
|
|
332
|
-
/** Applied with nav filters before `useTableState` when {@link searchLanding} is true. */
|
|
333
|
-
landingFilters?: QuestionBankLandingFilterState | null
|
|
334
|
-
view?: DataListViewType
|
|
335
|
-
onViewChange?: (v: DataListViewType) => void
|
|
336
|
-
/** Aligns Properties view tiles with `ListPageTemplate` `supportedViewTypes`. */
|
|
337
|
-
supportedViewTypes?: readonly DataListViewType[]
|
|
338
|
-
folders: QuestionBankFolder[]
|
|
339
|
-
onFoldersChange: React.Dispatch<React.SetStateAction<QuestionBankFolder[]>>
|
|
340
|
-
onItemsChange: React.Dispatch<React.SetStateAction<QuestionBankItem[]>>
|
|
341
|
-
}
|
|
342
|
-
>(function QuestionBankTable(
|
|
343
|
-
{
|
|
344
|
-
items,
|
|
345
|
-
navState,
|
|
346
|
-
urlListSearch,
|
|
347
|
-
searchLanding,
|
|
348
|
-
landingFilters,
|
|
349
|
-
view = "table",
|
|
350
|
-
onViewChange,
|
|
351
|
-
supportedViewTypes = QUESTION_BANK_SUPPORTED_VIEWS,
|
|
352
|
-
folders,
|
|
353
|
-
onFoldersChange,
|
|
354
|
-
onItemsChange,
|
|
355
|
-
},
|
|
356
|
-
ref,
|
|
357
|
-
) {
|
|
358
|
-
const tableSourceItems = React.useMemo(() => {
|
|
359
|
-
const nav = navState ?? { scope: "all" as const, folderId: null }
|
|
360
|
-
const landing = searchLanding ? (landingFilters ?? null) : null
|
|
361
|
-
return applyQuestionBankHubDisplayFilters(items, folders, nav, landing)
|
|
362
|
-
}, [items, folders, navState, searchLanding, landingFilters])
|
|
363
|
-
|
|
364
|
-
const toggleFavorite = React.useCallback(
|
|
365
|
-
(row: QuestionBankItem) => {
|
|
366
|
-
onItemsChange(prev => prev.map(r => (r.id === row.id ? toggleQuestionBankItemFavorite(r) : r)))
|
|
367
|
-
},
|
|
368
|
-
[onItemsChange],
|
|
369
|
-
)
|
|
370
|
-
|
|
371
|
-
const columns = React.useMemo(
|
|
372
|
-
() => buildQuestionBankColumns(tableSourceItems, { onToggleFavorite: toggleFavorite }),
|
|
373
|
-
[tableSourceItems, toggleFavorite],
|
|
374
|
-
)
|
|
375
|
-
const filterFields = React.useMemo(() => columnsToFilterFields(columns), [columns])
|
|
376
|
-
const fieldDefinitionsForDrawer = React.useMemo(
|
|
377
|
-
() =>
|
|
378
|
-
columns
|
|
379
|
-
.filter(c => c.key !== "select" && c.key !== "favorite" && c.key !== "actions")
|
|
380
|
-
.map(c => ({ key: c.key, label: c.label, sortable: !!(c.sortable && (c.sortKey ?? c.key)) })),
|
|
381
|
-
[columns],
|
|
382
|
-
)
|
|
283
|
+
// ─── Folder columns panel (custom multi-column miller view) ─────────────────
|
|
383
284
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
)
|
|
285
|
+
interface HubFolderColumnsPanelProps {
|
|
286
|
+
folders: QuestionBankFolder[]
|
|
287
|
+
rows: QuestionBankItem[]
|
|
288
|
+
panelRenderDetail: (row: QuestionBankItem) => React.ReactNode
|
|
289
|
+
onAddFolder: (parentId: string | null) => void
|
|
290
|
+
onAddQuestion: (parentId: string | null) => void
|
|
291
|
+
onCustomizeFolder?: (folder: QuestionBankFolder) => void
|
|
292
|
+
}
|
|
388
293
|
|
|
389
|
-
|
|
390
|
-
const patchDisplay = React.useCallback((patch: Partial<DataListDisplayOptions>) => {
|
|
391
|
-
setDisplayOptions(prev => ({ ...prev, ...patch }))
|
|
392
|
-
}, [])
|
|
294
|
+
type HierarchyItem = QuestionBankFolder | QuestionBankItem
|
|
393
295
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
296
|
+
function isFolder(item: HierarchyItem): item is QuestionBankFolder {
|
|
297
|
+
return "parentId" in item
|
|
298
|
+
}
|
|
397
299
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}, [])
|
|
402
|
-
const removeConditionalRule = React.useCallback((id: string) => {
|
|
403
|
-
setConditionalRules(prev => prev.filter(r => r.id !== id))
|
|
404
|
-
}, [])
|
|
405
|
-
const updateConditionalRule = React.useCallback((id: string, patch: Partial<ConditionalRule>) => {
|
|
406
|
-
setConditionalRules(prev => prev.map(r => r.id === id ? { ...r, ...patch } : r))
|
|
407
|
-
}, [])
|
|
300
|
+
function isQuestion(item: HierarchyItem): item is QuestionBankItem {
|
|
301
|
+
return "stem" in item
|
|
302
|
+
}
|
|
408
303
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
304
|
+
function HubFolderColumnsPanel({
|
|
305
|
+
folders,
|
|
306
|
+
rows,
|
|
307
|
+
panelRenderDetail,
|
|
308
|
+
onAddFolder,
|
|
309
|
+
onAddQuestion,
|
|
310
|
+
onCustomizeFolder,
|
|
311
|
+
}: HubFolderColumnsPanelProps) {
|
|
312
|
+
const [selectedPath, setSelectedPath] = React.useState<HierarchyItem[]>(() => {
|
|
313
|
+
const rootFolders = folders
|
|
314
|
+
.filter(f => f.parentId === null)
|
|
315
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
316
|
+
if (rootFolders.length > 0) return [rootFolders[0]]
|
|
317
|
+
return []
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
const isFirstRenderRef = React.useRef(true)
|
|
321
|
+
|
|
322
|
+
const rootFolders = React.useMemo(
|
|
323
|
+
() => folders.filter(f => f.parentId === null).sort((a, b) => a.name.localeCompare(b.name)),
|
|
324
|
+
[folders],
|
|
415
325
|
)
|
|
416
326
|
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
setNewFolderOpen(true)
|
|
421
|
-
}, [])
|
|
327
|
+
const handleSelect = (item: HierarchyItem, depth: number) => {
|
|
328
|
+
setSelectedPath(prev => [...prev.slice(0, depth), item])
|
|
329
|
+
}
|
|
422
330
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
331
|
+
React.useEffect(() => {
|
|
332
|
+
if (isFirstRenderRef.current && selectedPath.length > 0) {
|
|
333
|
+
const lastItem = selectedPath[selectedPath.length - 1]
|
|
334
|
+
if (isFolder(lastItem)) {
|
|
335
|
+
const folder = lastItem as QuestionBankFolder
|
|
336
|
+
const subfolders = folders.filter(f => f.parentId === folder.id).sort((a, b) => a.name.localeCompare(b.name))
|
|
337
|
+
const questionsInFolder = rows.filter(r => r.folderId === folder.id)
|
|
338
|
+
const items: HierarchyItem[] = [...subfolders, ...questionsInFolder]
|
|
339
|
+
if (items.length > 0 && !selectedPath[selectedPath.length + 1]) {
|
|
340
|
+
setSelectedPath(prev => [...prev, items[0]])
|
|
341
|
+
isFirstRenderRef.current = false
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
426
346
|
}, [])
|
|
427
347
|
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
...
|
|
438
|
-
{
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
type: "short_answer",
|
|
444
|
-
difficulty: "medium",
|
|
445
|
-
author: "Demo user",
|
|
446
|
-
authorEmail: "demo.user@demo.exxat.io",
|
|
447
|
-
updatedAt: `${y}-${m}-${d}`,
|
|
448
|
-
folderId,
|
|
449
|
-
},
|
|
450
|
-
])
|
|
451
|
-
},
|
|
452
|
-
[folders, onItemsChange],
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
const renderFilterOptionValue = React.useCallback(
|
|
456
|
-
(fieldKey: string, value: string): React.ReactNode => {
|
|
457
|
-
const col = columns.find(c => c.key === fieldKey)
|
|
458
|
-
const opt = col?.filter?.options?.find(o => o.value === value)
|
|
459
|
-
return <span className="text-foreground">{opt?.label ?? value}</span>
|
|
460
|
-
},
|
|
461
|
-
[columns],
|
|
462
|
-
)
|
|
348
|
+
const columns: Array<{ items: HierarchyItem[]; depth: number; parentId?: string | null }> = React.useMemo(() => {
|
|
349
|
+
const cols: Array<{ items: HierarchyItem[]; depth: number; parentId?: string | null }> = [
|
|
350
|
+
{ items: rootFolders, depth: 0, parentId: null },
|
|
351
|
+
]
|
|
352
|
+
for (let i = 0; i < selectedPath.length; i++) {
|
|
353
|
+
const item = selectedPath[i]
|
|
354
|
+
if (isFolder(item)) {
|
|
355
|
+
const subfolders = folders.filter(f => f.parentId === item.id).sort((a, b) => a.name.localeCompare(b.name))
|
|
356
|
+
const questionsInFolder = rows.filter(r => r.folderId === item.id)
|
|
357
|
+
const items: HierarchyItem[] = [...subfolders, ...questionsInFolder]
|
|
358
|
+
if (items.length > 0) cols.push({ items, depth: i + 1, parentId: item.id })
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return cols
|
|
362
|
+
}, [selectedPath, rootFolders, folders, rows])
|
|
463
363
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
},
|
|
468
|
-
}), [tableState])
|
|
364
|
+
const selectedLeaf = selectedPath.length > 0 ? selectedPath.at(-1)! : null
|
|
365
|
+
const selectedQuestion = selectedLeaf && isQuestion(selectedLeaf) ? (selectedLeaf as QuestionBankItem) : null
|
|
366
|
+
const selectedFolderLeaf = selectedLeaf && isFolder(selectedLeaf) ? (selectedLeaf as QuestionBankFolder) : null
|
|
469
367
|
|
|
470
|
-
|
|
471
|
-
|
|
368
|
+
return (
|
|
369
|
+
<ResizablePanelGroup direction="horizontal" className="flex h-full min-h-0 w-full flex-1 overflow-hidden">
|
|
370
|
+
{columns.map(({ items, depth, parentId }, columnIdx) => (
|
|
371
|
+
<React.Fragment key={`col-${depth}`}>
|
|
372
|
+
{columnIdx > 0 && <ResizableHandle withHandle className={LIST_PAGE_SPLIT_RESIZABLE_HANDLE_CLASS} />}
|
|
373
|
+
<ResizablePanel
|
|
374
|
+
id={`col-${depth}`}
|
|
375
|
+
defaultSize={columnIdx === 0 ? 35 : columnIdx === 1 ? 35 : 30}
|
|
376
|
+
minSize={15}
|
|
377
|
+
className={LIST_PAGE_SPLIT_MILLER_COLUMN_PANEL_CLASS}
|
|
378
|
+
>
|
|
379
|
+
<ListPageTreeColumnHeader
|
|
380
|
+
title={
|
|
381
|
+
depth === 0
|
|
382
|
+
? "Categories"
|
|
383
|
+
: selectedPath[depth - 1] && isFolder(selectedPath[depth - 1])
|
|
384
|
+
? (selectedPath[depth - 1] as QuestionBankFolder).name
|
|
385
|
+
: "Items"
|
|
386
|
+
}
|
|
387
|
+
trailing={
|
|
388
|
+
<>
|
|
389
|
+
<span className="shrink-0 text-xs font-medium text-muted-foreground tabular-nums">{items.length}</span>
|
|
390
|
+
{depth < columns.length - 1 && items.length > 0 ? (
|
|
391
|
+
<div className="flex shrink-0 items-center gap-0.5">
|
|
392
|
+
<Tooltip>
|
|
393
|
+
<TooltipTrigger asChild>
|
|
394
|
+
<Button
|
|
395
|
+
size="icon-sm"
|
|
396
|
+
variant="ghost"
|
|
397
|
+
onClick={() => onAddFolder(parentId ?? null)}
|
|
398
|
+
aria-label="Add folder"
|
|
399
|
+
>
|
|
400
|
+
<i className="fa-light fa-folder-plus text-xs" aria-hidden="true" />
|
|
401
|
+
</Button>
|
|
402
|
+
</TooltipTrigger>
|
|
403
|
+
<TooltipContent side="top" sideOffset={4}>
|
|
404
|
+
Add folder
|
|
405
|
+
</TooltipContent>
|
|
406
|
+
</Tooltip>
|
|
407
|
+
<Tooltip>
|
|
408
|
+
<TooltipTrigger asChild>
|
|
409
|
+
<Button
|
|
410
|
+
size="icon-sm"
|
|
411
|
+
variant="ghost"
|
|
412
|
+
onClick={() => onAddQuestion(parentId ?? null)}
|
|
413
|
+
aria-label="Add question"
|
|
414
|
+
>
|
|
415
|
+
<i className="fa-light fa-plus text-xs" aria-hidden="true" />
|
|
416
|
+
</Button>
|
|
417
|
+
</TooltipTrigger>
|
|
418
|
+
<TooltipContent side="top" sideOffset={4}>
|
|
419
|
+
Add question
|
|
420
|
+
</TooltipContent>
|
|
421
|
+
</Tooltip>
|
|
422
|
+
</div>
|
|
423
|
+
) : null}
|
|
424
|
+
</>
|
|
425
|
+
}
|
|
426
|
+
/>
|
|
427
|
+
<div className="min-h-0 flex-1 overflow-y-auto py-1">
|
|
428
|
+
{items.map(item => {
|
|
429
|
+
const isSelected = selectedPath[depth]?.id === item.id
|
|
430
|
+
const isFolder_ = isFolder(item)
|
|
431
|
+
const folder = isFolder_ ? item : null
|
|
432
|
+
const question = isQuestion(item) ? item : null
|
|
433
|
+
const subfolderCount = isFolder_ ? folders.filter(f => f.parentId === item.id).length : 0
|
|
434
|
+
const questionCount = isFolder_ ? rows.filter(r => r.folderId === item.id).length : 0
|
|
435
|
+
const itemCount = subfolderCount + questionCount
|
|
436
|
+
return (
|
|
437
|
+
<div key={item.id} className="group flex items-center hover:bg-muted/50">
|
|
438
|
+
<button
|
|
439
|
+
onClick={() => handleSelect(item, depth)}
|
|
440
|
+
className={cn(
|
|
441
|
+
"flex flex-1 items-center gap-3 px-3 py-2 text-left text-sm transition-colors duration-75",
|
|
442
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
443
|
+
isSelected ? "bg-accent text-accent-foreground" : "text-foreground",
|
|
444
|
+
isFolder_ && !isSelected && folder?.colorKey && depth > 0
|
|
445
|
+
? QUESTION_BANK_FOLDER_COLOR_STYLES[folder.colorKey]?.tile
|
|
446
|
+
: "",
|
|
447
|
+
)}
|
|
448
|
+
aria-selected={isSelected}
|
|
449
|
+
role="option"
|
|
450
|
+
>
|
|
451
|
+
{isFolder_ ? (
|
|
452
|
+
<i
|
|
453
|
+
className={cn(
|
|
454
|
+
"fa-folder text-sm shrink-0",
|
|
455
|
+
isSelected ? "fa-solid" : "fa-light",
|
|
456
|
+
folder?.colorKey && QUESTION_BANK_FOLDER_ICON_COLORS[folder.colorKey],
|
|
457
|
+
)}
|
|
458
|
+
aria-hidden="true"
|
|
459
|
+
/>
|
|
460
|
+
) : (
|
|
461
|
+
<i className={cn("fa-file text-sm shrink-0", isSelected ? "fa-solid" : "fa-light")} aria-hidden="true" />
|
|
462
|
+
)}
|
|
463
|
+
<span className={cn("min-w-0 flex-1 truncate leading-tight", isSelected && "font-medium")}>
|
|
464
|
+
{isFolder_ ? folder?.name : question?.stem}
|
|
465
|
+
</span>
|
|
466
|
+
<span
|
|
467
|
+
className={cn(
|
|
468
|
+
"shrink-0 tabular-nums text-xs ms-auto",
|
|
469
|
+
isSelected ? "text-accent-foreground/70" : "text-muted-foreground",
|
|
470
|
+
)}
|
|
471
|
+
>
|
|
472
|
+
{isFolder_
|
|
473
|
+
? itemCount
|
|
474
|
+
: question?.type === "multiple_choice"
|
|
475
|
+
? "MCQ"
|
|
476
|
+
: question?.difficulty?.charAt(0).toUpperCase()}
|
|
477
|
+
</span>
|
|
478
|
+
</button>
|
|
479
|
+
{isFolder_ && folder && (
|
|
480
|
+
<DropdownMenu>
|
|
481
|
+
<DropdownMenuTrigger asChild>
|
|
482
|
+
<Button
|
|
483
|
+
type="button"
|
|
484
|
+
size="icon-xs"
|
|
485
|
+
variant="ghost"
|
|
486
|
+
aria-label={`Actions for folder ${folder.name}`}
|
|
487
|
+
className="shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"
|
|
488
|
+
>
|
|
489
|
+
<i className="fa-light fa-ellipsis text-xs" aria-hidden="true" />
|
|
490
|
+
</Button>
|
|
491
|
+
</DropdownMenuTrigger>
|
|
492
|
+
<DropdownMenuContent align="end">
|
|
493
|
+
<DropdownMenuItem onSelect={() => onCustomizeFolder?.(folder)}>
|
|
494
|
+
<i className="fa-light fa-wand-magic-sparkles text-xs" aria-hidden="true" />
|
|
495
|
+
Customize
|
|
496
|
+
</DropdownMenuItem>
|
|
497
|
+
</DropdownMenuContent>
|
|
498
|
+
</DropdownMenu>
|
|
499
|
+
)}
|
|
500
|
+
</div>
|
|
501
|
+
)
|
|
502
|
+
})}
|
|
503
|
+
</div>
|
|
504
|
+
</ResizablePanel>
|
|
505
|
+
</React.Fragment>
|
|
506
|
+
))}
|
|
507
|
+
{(selectedQuestion || selectedFolderLeaf) && (
|
|
508
|
+
<>
|
|
509
|
+
<ResizableHandle withHandle className={LIST_PAGE_SPLIT_RESIZABLE_HANDLE_CLASS} />
|
|
510
|
+
<ResizablePanel id="col-detail" defaultSize={30} minSize={20} className={LIST_PAGE_SPLIT_MILLER_DETAIL_PANEL_CLASS}>
|
|
511
|
+
{selectedQuestion ? (
|
|
512
|
+
<>
|
|
513
|
+
<ListPageTreeColumnHeader title="Details" className="px-4" />
|
|
514
|
+
<div className="min-h-0 flex-1 overflow-y-auto px-4 py-4">
|
|
515
|
+
{panelRenderDetail(selectedQuestion)}
|
|
516
|
+
</div>
|
|
517
|
+
</>
|
|
518
|
+
) : selectedFolderLeaf ? (
|
|
519
|
+
<div className="min-h-0 flex-1 overflow-hidden">
|
|
520
|
+
<FolderDetailsShell folder={selectedFolderLeaf} folders={folders} questions={rows} />
|
|
521
|
+
</div>
|
|
522
|
+
) : null}
|
|
523
|
+
</ResizablePanel>
|
|
524
|
+
</>
|
|
525
|
+
)}
|
|
526
|
+
</ResizablePanelGroup>
|
|
472
527
|
)
|
|
473
|
-
|
|
474
|
-
: "topic"
|
|
528
|
+
}
|
|
475
529
|
|
|
476
|
-
|
|
530
|
+
// ─── Detail renderer reused by panel + tree-panel ───────────────────────────
|
|
531
|
+
|
|
532
|
+
function questionBankPanelDetail(row: QuestionBankItem) {
|
|
533
|
+
return (
|
|
477
534
|
<div className="flex min-w-0 flex-col gap-4">
|
|
478
535
|
<div>
|
|
479
536
|
<h3 className="text-sm font-semibold text-foreground mb-2">Question</h3>
|
|
@@ -505,14 +562,11 @@ export const QuestionBankTable = React.forwardRef<
|
|
|
505
562
|
<span className="text-xs font-medium text-muted-foreground mt-0.5 shrink-0">
|
|
506
563
|
{String.fromCharCode(65 + idx)}.
|
|
507
564
|
</span>
|
|
508
|
-
<span className={cn(
|
|
509
|
-
"text-sm",
|
|
510
|
-
option.isCorrect ? "text-foreground font-medium" : "text-foreground/80"
|
|
511
|
-
)}>
|
|
565
|
+
<span className={cn("text-sm", option.isCorrect ? "text-foreground font-medium" : "text-foreground/80")}>
|
|
512
566
|
{option.text}
|
|
513
567
|
</span>
|
|
514
568
|
{option.isCorrect && (
|
|
515
|
-
<i className="fa-light fa-check text-emerald-600 text-sm
|
|
569
|
+
<i className="fa-light fa-check text-emerald-600 text-sm ms-auto shrink-0" aria-hidden="true" />
|
|
516
570
|
)}
|
|
517
571
|
</div>
|
|
518
572
|
))}
|
|
@@ -521,209 +575,265 @@ export const QuestionBankTable = React.forwardRef<
|
|
|
521
575
|
)}
|
|
522
576
|
</div>
|
|
523
577
|
)
|
|
578
|
+
}
|
|
524
579
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
580
|
+
// ─── Public component ───────────────────────────────────────────────────────
|
|
581
|
+
|
|
582
|
+
export type QuestionBankTableHandle = HubTableHandle
|
|
583
|
+
|
|
584
|
+
export interface QuestionBankTableProps {
|
|
585
|
+
items: QuestionBankItem[]
|
|
586
|
+
/** When set, table / board / tree rows are limited to this nav scope (secondary sidebar). */
|
|
587
|
+
navState?: QuestionBankNavState
|
|
588
|
+
/** URL toolbar search binding (`?q=`) — omit on search landing so hub `q` does not pre-fill the grid search. */
|
|
589
|
+
urlListSearch?: string
|
|
590
|
+
/** When true, dedicated search shell: hub landing row filters; table toolbar search stays independent of URL `q`. */
|
|
591
|
+
searchLanding?: boolean
|
|
592
|
+
/** Applied with nav filters before `useTableState` when {@link searchLanding} is true. */
|
|
593
|
+
landingFilters?: QuestionBankLandingFilterState | null
|
|
594
|
+
view?: DataListViewType
|
|
595
|
+
onViewChange?: (v: DataListViewType) => void
|
|
596
|
+
folders: QuestionBankFolder[]
|
|
597
|
+
onFoldersChange: React.Dispatch<React.SetStateAction<QuestionBankFolder[]>>
|
|
598
|
+
onItemsChange: React.Dispatch<React.SetStateAction<QuestionBankItem[]>>
|
|
599
|
+
}
|
|
543
600
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
renderFilterOptionValue,
|
|
558
|
-
toolbarSlot: (s: ReturnType<typeof useTableState<QuestionBankItem>>) => (
|
|
559
|
-
<TablePropertiesDrawerButton {...drawerToolbarProps} state={s} />
|
|
560
|
-
),
|
|
561
|
-
bulkActionsSlot: (selected: Set<string | number>) => {
|
|
562
|
-
const n = selected.size
|
|
563
|
-
if (n === 0) return null
|
|
564
|
-
return (
|
|
565
|
-
<>
|
|
566
|
-
<span className="sr-only">{n} selected</span>
|
|
567
|
-
<Tip label="Export selection (demo)">
|
|
568
|
-
<Button size="sm" variant="outline" type="button">
|
|
569
|
-
<i className="fa-light fa-arrow-down-to-line" aria-hidden="true" />
|
|
570
|
-
Export
|
|
571
|
-
</Button>
|
|
572
|
-
</Tip>
|
|
573
|
-
</>
|
|
574
|
-
)
|
|
601
|
+
export const QuestionBankTable = React.forwardRef<QuestionBankTableHandle, QuestionBankTableProps>(
|
|
602
|
+
function QuestionBankTable(
|
|
603
|
+
{
|
|
604
|
+
items,
|
|
605
|
+
navState,
|
|
606
|
+
urlListSearch,
|
|
607
|
+
searchLanding,
|
|
608
|
+
landingFilters,
|
|
609
|
+
view = "table",
|
|
610
|
+
onViewChange,
|
|
611
|
+
folders,
|
|
612
|
+
onFoldersChange,
|
|
613
|
+
onItemsChange,
|
|
575
614
|
},
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
{
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
(
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
615
|
+
ref,
|
|
616
|
+
) {
|
|
617
|
+
const tableSourceItems = React.useMemo(() => {
|
|
618
|
+
const nav = navState ?? { scope: "all" as const, folderId: null }
|
|
619
|
+
const landing = searchLanding ? (landingFilters ?? null) : null
|
|
620
|
+
return applyQuestionBankHubDisplayFilters(items, folders, nav, landing)
|
|
621
|
+
}, [items, folders, navState, searchLanding, landingFilters])
|
|
622
|
+
|
|
623
|
+
const toggleFavorite = React.useCallback(
|
|
624
|
+
(row: QuestionBankItem) => {
|
|
625
|
+
onItemsChange(prev => prev.map(r => (r.id === row.id ? toggleQuestionBankItemFavorite(r) : r)))
|
|
626
|
+
},
|
|
627
|
+
[onItemsChange],
|
|
628
|
+
)
|
|
629
|
+
|
|
630
|
+
const columns = React.useMemo(
|
|
631
|
+
() => buildQuestionBankColumns(tableSourceItems, { onToggleFavorite: toggleFavorite }),
|
|
632
|
+
[tableSourceItems, toggleFavorite],
|
|
633
|
+
)
|
|
634
|
+
|
|
635
|
+
// ─ New-folder / customize-folder modal state (shared by panel + tree-panel) ────
|
|
636
|
+
const [newFolderOpen, setNewFolderOpen] = React.useState(false)
|
|
637
|
+
const [newFolderParentId, setNewFolderParentId] = React.useState<string | null>(null)
|
|
638
|
+
const [customizingFolder, setCustomizingFolder] = React.useState<QuestionBankFolder | null>(null)
|
|
639
|
+
|
|
640
|
+
const openNewFolderForColumn = React.useCallback((parentId: string | null) => {
|
|
641
|
+
setNewFolderParentId(parentId)
|
|
642
|
+
setCustomizingFolder(null)
|
|
643
|
+
setNewFolderOpen(true)
|
|
644
|
+
}, [])
|
|
645
|
+
|
|
646
|
+
const openCustomizeFolderSheet = React.useCallback((folder: QuestionBankFolder) => {
|
|
647
|
+
setCustomizingFolder(folder)
|
|
648
|
+
setNewFolderOpen(true)
|
|
649
|
+
}, [])
|
|
650
|
+
|
|
651
|
+
const addQuestionInColumn = React.useCallback(
|
|
652
|
+
(parentId: string | null) => {
|
|
653
|
+
const folderId = defaultFolderIdForColumnParent(parentId, folders)
|
|
654
|
+
if (!folderId) return
|
|
655
|
+
const today = new Date()
|
|
656
|
+
const y = today.getFullYear()
|
|
657
|
+
const m = String(today.getMonth() + 1).padStart(2, "0")
|
|
658
|
+
const d = String(today.getDate()).padStart(2, "0")
|
|
659
|
+
onItemsChange(prev => [
|
|
614
660
|
...prev,
|
|
615
661
|
{
|
|
616
|
-
id:
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
662
|
+
id: newQuestionBankItemId(),
|
|
663
|
+
questionId: newQuestionBankQuestionId(),
|
|
664
|
+
stem: "New question",
|
|
665
|
+
topic: "General",
|
|
666
|
+
type: "short_answer",
|
|
667
|
+
difficulty: "medium",
|
|
668
|
+
author: "Demo user",
|
|
669
|
+
authorEmail: "demo.user@demo.exxat.io",
|
|
670
|
+
updatedAt: `${y}-${m}-${d}`,
|
|
671
|
+
folderId,
|
|
621
672
|
},
|
|
622
673
|
])
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
renderers={defineHubViewRenderers(QUESTION_BANK_SUPPORTED_VIEWS, {
|
|
646
|
-
"data-table": (
|
|
647
|
-
<div className="pb-6">
|
|
648
|
-
<DataTable<QuestionBankItem> {...tableProps} />
|
|
649
|
-
</div>
|
|
650
|
-
),
|
|
651
|
-
"list-with-toolbar": toolbarShell(
|
|
652
|
-
<QuestionBankListView
|
|
653
|
-
rows={rows}
|
|
654
|
-
onToggleFavorite={toggleFavorite}
|
|
655
|
-
onRowActivate={row => tableState.toggleRow(row.id)}
|
|
656
|
-
/>,
|
|
657
|
-
),
|
|
658
|
-
"board-with-toolbar": toolbarShell(
|
|
674
|
+
},
|
|
675
|
+
[folders, onItemsChange],
|
|
676
|
+
)
|
|
677
|
+
|
|
678
|
+
const renderFilterOptionValue = React.useCallback(
|
|
679
|
+
(fieldKey: string, value: string): React.ReactNode => {
|
|
680
|
+
const col = columns.find(c => c.key === fieldKey)
|
|
681
|
+
const opt = col?.filter?.options?.find(o => o.value === value)
|
|
682
|
+
return <span className="text-foreground">{opt?.label ?? value}</span>
|
|
683
|
+
},
|
|
684
|
+
[columns],
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
// ─ Renderers ──────────────────────────────────────────────────────────────
|
|
688
|
+
const renderers: HubTableRenderers<QuestionBankItem> = {
|
|
689
|
+
"board-with-toolbar": ({ state, toolbarShell, displayOptions }) => {
|
|
690
|
+
const boardGroupKey = QUESTION_BANK_BOARD_GROUP_OPTIONS.some(
|
|
691
|
+
o => o.key === displayOptions.boardGroupByColumnKey,
|
|
692
|
+
)
|
|
693
|
+
? displayOptions.boardGroupByColumnKey
|
|
694
|
+
: "topic"
|
|
695
|
+
return toolbarShell(
|
|
659
696
|
<QuestionBankBoardView
|
|
660
|
-
rows={rows}
|
|
661
|
-
groupByColumnKey={
|
|
697
|
+
rows={state.rows as QuestionBankItem[]}
|
|
698
|
+
groupByColumnKey={boardGroupKey}
|
|
662
699
|
onToggleFavorite={toggleFavorite}
|
|
663
|
-
onRowActivate={row =>
|
|
700
|
+
onRowActivate={row => state.toggleRow(row.id)}
|
|
664
701
|
/>,
|
|
665
|
-
)
|
|
666
|
-
|
|
702
|
+
)
|
|
703
|
+
},
|
|
704
|
+
"folder-with-toolbar": ({ state, toolbarShell }) =>
|
|
705
|
+
toolbarShell(
|
|
667
706
|
<QuestionBankOsFolderView
|
|
668
707
|
folders={folders}
|
|
669
708
|
onFoldersChange={onFoldersChange}
|
|
670
|
-
questions={rows}
|
|
709
|
+
questions={state.rows as QuestionBankItem[]}
|
|
671
710
|
onQuestionsChange={onItemsChange}
|
|
672
711
|
/>,
|
|
673
712
|
),
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
</ListPageSplitHubChrome>,
|
|
687
|
-
)}
|
|
688
|
-
{folderSheet}
|
|
689
|
-
</>
|
|
690
|
-
),
|
|
691
|
-
"tree-panel-with-toolbar": (
|
|
692
|
-
<>
|
|
693
|
-
{toolbarShell(
|
|
694
|
-
<div className="flex min-h-0 flex-1 flex-col">
|
|
695
|
-
<HubTreePanelView
|
|
696
|
-
items={rows}
|
|
697
|
-
folders={folders}
|
|
698
|
-
onItemsChange={onItemsChange}
|
|
699
|
-
onFoldersChange={onFoldersChange}
|
|
700
|
-
/>
|
|
701
|
-
</div>,
|
|
702
|
-
)}
|
|
703
|
-
{folderSheet}
|
|
704
|
-
</>
|
|
713
|
+
"panel-with-toolbar": ({ state, toolbarShell }) =>
|
|
714
|
+
toolbarShell(
|
|
715
|
+
<ListPageSplitHubChrome aria-label="Question bank folder columns">
|
|
716
|
+
<HubFolderColumnsPanel
|
|
717
|
+
folders={folders}
|
|
718
|
+
rows={state.rows as QuestionBankItem[]}
|
|
719
|
+
panelRenderDetail={questionBankPanelDetail}
|
|
720
|
+
onAddFolder={openNewFolderForColumn}
|
|
721
|
+
onAddQuestion={addQuestionInColumn}
|
|
722
|
+
onCustomizeFolder={openCustomizeFolderSheet}
|
|
723
|
+
/>
|
|
724
|
+
</ListPageSplitHubChrome>,
|
|
705
725
|
),
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
calendarMainView={displayOptions.calendarMainView}
|
|
717
|
-
onCalendarMainViewChange={v => patchDisplay({ calendarMainView: v })}
|
|
718
|
-
onEventActivate={row => tableState.toggleRow(row.id)}
|
|
719
|
-
/>,
|
|
720
|
-
),
|
|
721
|
-
"dashboard-with-toolbar": toolbarShell(
|
|
722
|
-
<QuestionBankDashboardChartsSection rows={rows} />,
|
|
726
|
+
"tree-panel-with-toolbar": ({ state, toolbarShell }) =>
|
|
727
|
+
toolbarShell(
|
|
728
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
729
|
+
<HubTreePanelView
|
|
730
|
+
items={state.rows as QuestionBankItem[]}
|
|
731
|
+
folders={folders}
|
|
732
|
+
onItemsChange={onItemsChange}
|
|
733
|
+
onFoldersChange={onFoldersChange}
|
|
734
|
+
/>
|
|
735
|
+
</div>,
|
|
723
736
|
),
|
|
724
|
-
})
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
737
|
+
"dashboard-with-toolbar": ({ state, toolbar }) => (
|
|
738
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
739
|
+
{toolbar}
|
|
740
|
+
<QuestionBankDashboardChartsSection rows={state.rows as QuestionBankItem[]} />
|
|
741
|
+
</div>
|
|
742
|
+
),
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
return (
|
|
746
|
+
<>
|
|
747
|
+
<HubTable<QuestionBankItem>
|
|
748
|
+
rows={tableSourceItems}
|
|
749
|
+
columns={columns}
|
|
750
|
+
view={view}
|
|
751
|
+
onViewChange={onViewChange}
|
|
752
|
+
supportedViewTypes={QUESTION_BANK_SUPPORTED_VIEWS}
|
|
753
|
+
hubLabel="Question bank"
|
|
754
|
+
lifecycleTabLabel="Question bank"
|
|
755
|
+
searchAriaLabel="Search questions"
|
|
756
|
+
getRowId={row => row.id}
|
|
757
|
+
getRowSelectionLabel={row => row.stem}
|
|
758
|
+
defaultSort={{ key: "updatedAt", dir: "desc" }}
|
|
759
|
+
emptyState={<p className="text-sm text-muted-foreground">No questions in the bank.</p>}
|
|
760
|
+
boardGroupByColumnOptions={[...QUESTION_BANK_BOARD_GROUP_OPTIONS]}
|
|
761
|
+
renderFilterOptionValue={renderFilterOptionValue}
|
|
762
|
+
syncedSearchFromUrl={searchLanding ? undefined : urlListSearch}
|
|
763
|
+
listAriaLabel="Questions"
|
|
764
|
+
listEmptyState="No questions match your filters."
|
|
765
|
+
renderListRow={row => (
|
|
766
|
+
<ListPageBoardCard
|
|
767
|
+
className={QUESTION_BANK_FAVORITE_HOVER_GROUP}
|
|
768
|
+
layout="row"
|
|
769
|
+
rowContainerClassName="flex w-full flex-col gap-1 sm:flex-row sm:items-center sm:gap-4"
|
|
770
|
+
rowEnd={
|
|
771
|
+
<div className="flex shrink-0 items-center gap-1">
|
|
772
|
+
<QuestionBankFavoriteButton row={row} onToggleFavorite={toggleFavorite} />
|
|
773
|
+
<i className="fa-light fa-chevron-right text-xs text-muted-foreground" aria-hidden="true" />
|
|
774
|
+
</div>
|
|
775
|
+
}
|
|
776
|
+
>
|
|
777
|
+
<div className="space-y-0.5">
|
|
778
|
+
<p className="line-clamp-2 text-sm font-semibold text-foreground">{row.stem}</p>
|
|
779
|
+
<p className="font-mono text-xs text-muted-foreground">{row.questionId}</p>
|
|
780
|
+
<p className="text-xs text-muted-foreground">
|
|
781
|
+
{row.topic} · Updated {formatDateUS(row.updatedAt)}
|
|
782
|
+
</p>
|
|
783
|
+
<p className="text-xs text-muted-foreground">{row.author}</p>
|
|
784
|
+
</div>
|
|
785
|
+
</ListPageBoardCard>
|
|
786
|
+
)}
|
|
787
|
+
bulkActionsSlot={selected => {
|
|
788
|
+
if (selected.size === 0) return null
|
|
789
|
+
return (
|
|
790
|
+
<>
|
|
791
|
+
<span className="sr-only">{selected.size} selected</span>
|
|
792
|
+
<Tip label="Export selection (demo)">
|
|
793
|
+
<Button size="sm" variant="outline" type="button">
|
|
794
|
+
<i className="fa-light fa-arrow-down-to-line" aria-hidden="true" />
|
|
795
|
+
Export
|
|
796
|
+
</Button>
|
|
797
|
+
</Tip>
|
|
798
|
+
</>
|
|
799
|
+
)
|
|
800
|
+
}}
|
|
801
|
+
renderers={renderers}
|
|
802
|
+
handleRef={ref}
|
|
803
|
+
/>
|
|
804
|
+
<QuestionBankNewFolderSheet
|
|
805
|
+
open={newFolderOpen}
|
|
806
|
+
onOpenChange={setNewFolderOpen}
|
|
807
|
+
parentFolderId={customizingFolder?.parentId ?? newFolderParentId}
|
|
808
|
+
customizingFolder={customizingFolder}
|
|
809
|
+
onCreated={(newFolder) => {
|
|
810
|
+
if (customizingFolder) {
|
|
811
|
+
onFoldersChange(prev =>
|
|
812
|
+
prev.map(f =>
|
|
813
|
+
f.id === customizingFolder.id
|
|
814
|
+
? { ...f, name: newFolder.name, icon: newFolder.icon, colorKey: newFolder.colorKey }
|
|
815
|
+
: f,
|
|
816
|
+
),
|
|
817
|
+
)
|
|
818
|
+
setCustomizingFolder(null)
|
|
819
|
+
} else {
|
|
820
|
+
onFoldersChange(prev => [
|
|
821
|
+
...prev,
|
|
822
|
+
{
|
|
823
|
+
id: `fld-${Date.now()}`,
|
|
824
|
+
name: newFolder.name,
|
|
825
|
+
icon: newFolder.icon,
|
|
826
|
+
colorKey: newFolder.colorKey,
|
|
827
|
+
parentId: newFolder.parentId,
|
|
828
|
+
},
|
|
829
|
+
])
|
|
830
|
+
}
|
|
831
|
+
setNewFolderOpen(false)
|
|
832
|
+
}}
|
|
833
|
+
/>
|
|
834
|
+
</>
|
|
835
|
+
)
|
|
836
|
+
},
|
|
837
|
+
)
|
|
728
838
|
|
|
729
839
|
QuestionBankTable.displayName = "QuestionBankTable"
|