@exxatdesignux/ui 0.2.19 → 0.4.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 +662 -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 +43 -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-library-hub-header.mdc +28 -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-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 +3 -3
- package/consumer-extras/cursor-skills/exxat-centralized-list-dataset/SKILL.md +5 -16
- package/consumer-extras/cursor-skills/exxat-collaboration-access/SKILL.md +3 -3
- package/consumer-extras/cursor-skills/exxat-dedicated-search-surfaces/SKILL.md +2 -2
- package/consumer-extras/cursor-skills/exxat-ds-skill/SKILL.md +19 -34
- package/consumer-extras/cursor-skills/exxat-ds-skill/references/data-table-pattern.md +1 -1
- package/consumer-extras/cursor-skills/exxat-kpi-flat-band/SKILL.md +1 -1
- package/consumer-extras/cursor-skills/exxat-list-page-view-shells/SKILL.md +1 -1
- package/consumer-extras/cursor-skills/exxat-mono-ids/SKILL.md +4 -4
- package/consumer-extras/cursor-skills/exxat-primary-nav-secondary-panel/SKILL.md +10 -12
- package/consumer-extras/cursor-skills/exxat-token-economy/SKILL.md +277 -0
- package/consumer-extras/handbook/HANDBOOK.md +187 -0
- package/consumer-extras/handbook/glossary.md +58 -0
- package/consumer-extras/handbook/reference-implementations.md +153 -0
- package/consumer-extras/handbook/voice-and-tone.md +262 -0
- package/consumer-extras/patterns/collaboration-access-pattern.md +7 -7
- 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 +31 -66
- package/consumer-extras/patterns/kpi-flat-band-pattern.md +2 -2
- 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 +173 -0
- package/dist/components/data-views/hub-table.js +5783 -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 +6797 -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 +13421 -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 +259 -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 +606 -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/.claude/skills/exxat-ds-skill/SKILL.md +8 -7
- package/template/.cursor/rules/exxat-accessibility.mdc +1 -1
- package/template/.cursor/rules/exxat-command-menu.mdc +2 -2
- package/template/.cursor/rules/exxat-dashboard-view-charts.mdc +7 -7
- package/template/.cursor/rules/exxat-data-tables.mdc +3 -3
- package/template/.cursor/rules/exxat-ds-agents.mdc +2 -2
- package/template/.cursor/rules/exxat-kbd-shortcuts.mdc +7 -7
- package/template/.cursor/rules/exxat-mono-ids.mdc +1 -1
- package/template/.cursor/rules/exxat-page-vs-drawer.mdc +1 -1
- package/template/.cursor/rules/exxat-table-properties-drawer.mdc +1 -1
- package/template/AGENTS.md +135 -103
- package/template/app/(app)/columns/page.tsx +11 -0
- package/template/app/(app)/dashboard/loading.tsx +15 -3
- package/template/app/(app)/dashboard/page.tsx +14 -2
- package/template/app/(app)/layout.tsx +17 -4
- package/template/app/(app)/library/all/page.tsx +11 -0
- package/template/app/(app)/library/find/page.tsx +12 -0
- package/template/app/(app)/{question-bank → library}/layout.tsx +17 -17
- package/template/app/(app)/library/list/page.tsx +12 -0
- package/template/app/(app)/library/new/page.tsx +45 -0
- package/template/app/(app)/library/page.tsx +11 -0
- package/template/app/(app)/loading.tsx +18 -1
- package/template/app/(app)/settings/page.tsx +5 -4
- package/template/app/(app)/tokens-themes/page.tsx +11 -0
- package/template/app/globals.css +14 -16
- package/template/components/ask-leo-composer.tsx +2 -2
- 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/columns-client.tsx +158 -0
- package/template/components/columns-showcase.tsx +541 -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-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 +77 -38
- package/template/components/data-views/{question-bank-folder-tree-branch.tsx → library-folder-tree-branch.tsx} +19 -19
- 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/data-views/table-cells.tsx +673 -0
- 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/folder-details-shell.tsx +11 -11
- package/template/components/hub-tree-panel-view.tsx +26 -26
- 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/{question-bank-board-view.tsx → library-board-view.tsx} +44 -44
- package/template/components/{question-bank-client.tsx → library-client.tsx} +83 -83
- package/template/components/{question-bank-dashboard-charts.tsx → library-dashboard-charts.tsx} +14 -14
- package/template/components/{question-bank-favorite-button.tsx → library-favorite-button.tsx} +7 -7
- package/template/components/{question-bank-hub-client.tsx → library-hub-client.tsx} +44 -44
- package/template/components/{question-bank-new-folder-sheet.tsx → library-new-folder-sheet.tsx} +16 -16
- package/template/components/{question-bank-os-folder-view.tsx → library-os-folder-view.tsx} +31 -31
- package/template/components/{question-bank-page-header.tsx → library-page-header.tsx} +6 -6
- package/template/components/library-panel-activator.tsx +8 -0
- package/template/components/{question-bank-secondary-nav.tsx → library-secondary-nav.tsx} +63 -63
- package/template/components/library-table.tsx +839 -0
- package/template/components/list-hub-status-badge.tsx +2 -2
- package/template/components/{new-question-composer.tsx → new-library-item-form.tsx} +489 -441
- 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/product-switcher.tsx +3 -4
- package/template/components/product-wordmark.tsx +2 -1
- 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} +114 -73
- package/template/components/sidebar/index.ts +16 -0
- package/template/components/{secondary-nav.tsx → sidebar/secondary-nav.tsx} +2 -2
- package/template/components/sidebar/secondary-panel.tsx +316 -0
- package/template/components/sidebar/sidebar-auto-collapse.tsx +27 -0
- package/template/components/{sidebar-auto-open.tsx → sidebar/sidebar-auto-open.tsx} +2 -1
- package/template/components/{sidebar-shell.tsx → sidebar/sidebar-shell.tsx} +1 -1
- package/template/components/site-header.tsx +1 -1
- 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/templates/dedicated-search-landing-template.tsx +1 -124
- package/template/components/templates/dedicated-search-results-template.tsx +1 -19
- package/template/components/templates/discovery-hub-template.tsx +1 -1
- 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 +2 -2
- package/template/components/tokens-secondary-nav.tsx +192 -0
- package/template/components/tokens-themes-client.tsx +476 -0
- package/template/components/tokens-themes-section.tsx +386 -0
- 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/HANDBOOK.md +187 -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/collaboration-access-pattern.md +7 -7
- 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 +31 -66
- package/template/docs/drawer-vs-dialog-pattern.md +1 -3
- package/template/docs/glossary.md +58 -0
- package/template/docs/kpi-flat-band-pattern.md +3 -3
- package/template/docs/kpi-trend-pattern.md +18 -3
- package/template/docs/large-dataset-strategy.md +155 -0
- package/template/docs/library-hub-header-pattern.md +25 -0
- 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/reference-implementations.md +151 -0
- package/template/docs/shell-surface-elevation-pattern.md +3 -5
- package/template/docs/token-taxonomy.md +416 -0
- package/template/docs/voice-and-tone.md +262 -0
- package/template/eslint.config.mjs +27 -0
- package/template/hooks/use-secondary-panel-hub-nav.ts +11 -11
- package/template/lib/ask-leo-route-context.ts +6 -18
- package/template/lib/coach-mark-registry.ts +0 -16
- package/template/lib/command-menu-config.ts +5 -13
- package/template/lib/command-menu-search-data.ts +8 -23
- 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-storage.ts +35 -38
- package/template/lib/dev-log.ts +1 -8
- package/template/lib/editable-target.ts +1 -10
- package/template/lib/{question-bank-authoring.ts → library-authoring.ts} +89 -88
- package/template/lib/library-dedicated-search.ts +19 -0
- package/template/lib/library-hub-search.ts +90 -0
- package/template/lib/library-nav.ts +477 -0
- package/template/lib/library-recent-searches.ts +22 -0
- package/template/lib/{question-bank-supported-views.ts → library-supported-views.ts} +2 -3
- package/template/lib/list-page-table-properties.ts +1 -48
- package/template/lib/list-status-badges.ts +16 -11
- package/template/lib/mock/dashboard.ts +1 -1
- package/template/lib/mock/{question-bank-folders.ts → library-folders.ts} +30 -30
- package/template/lib/mock/library-header-collaborators.ts +54 -0
- package/template/lib/mock/{question-bank-inspector.ts → library-inspector.ts} +29 -29
- package/template/lib/mock/{question-bank-kpi.ts → library-kpi.ts} +20 -20
- package/template/lib/mock/library.ts +249 -0
- package/template/lib/mock/navigation.tsx +32 -35
- 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/table-state-lifecycle.ts +3 -3
- package/template/next.config.mjs +7 -4
- 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/app/(app)/examples/page.tsx +0 -43
- package/template/app/(app)/question-bank/find/page.tsx +0 -13
- package/template/app/(app)/question-bank/library/page.tsx +0 -12
- package/template/app/(app)/question-bank/list/page.tsx +0 -13
- package/template/app/(app)/question-bank/new/page.tsx +0 -50
- package/template/app/(app)/question-bank/page.tsx +0 -12
- 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/question-bank-panel-activator.tsx +0 -8
- package/template/components/question-bank-table.tsx +0 -729
- package/template/components/secondary-panel/nav-link-rows.tsx +0 -83
- package/template/components/secondary-panel.tsx +0 -220
- 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/sidebar-auto-collapse.tsx +0 -23
- 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/docs/question-bank-hub-header-pattern.md +0 -25
- 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/mock/question-bank-header-collaborators.ts +0 -54
- package/template/lib/mock/question-bank.ts +0 -249
- package/template/lib/page-loading-variant.ts +0 -40
- package/template/lib/question-bank-dedicated-search.ts +0 -19
- package/template/lib/question-bank-hub-search.ts +0 -90
- package/template/lib/question-bank-nav.ts +0 -477
- package/template/lib/question-bank-recent-searches.ts +0 -22
- /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
|
@@ -1,729 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Question bank — DataTable + TablePropertiesDrawer + connected views via `ListPageConnectedViewBody`.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as React from "react"
|
|
8
|
-
import dynamic from "next/dynamic"
|
|
9
|
-
import { mailtoHref } from "@/lib/mailto"
|
|
10
|
-
import { DataTable, DataTableToolbar } from "@/components/data-table"
|
|
11
|
-
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
|
-
import type { ColumnDef } from "@/components/data-table/types"
|
|
15
|
-
import { useTableState } from "@/components/data-table/use-table-state"
|
|
16
|
-
import { TablePropertiesDrawerButton } from "@/components/table-properties"
|
|
17
|
-
import type { ConditionalRule, FilterFieldDef, FilterOperator } from "@/components/table-properties/types"
|
|
18
|
-
import { Button } from "@/components/ui/button"
|
|
19
|
-
import {
|
|
20
|
-
DropdownMenu,
|
|
21
|
-
DropdownMenuContent,
|
|
22
|
-
DropdownMenuItem,
|
|
23
|
-
DropdownMenuTrigger,
|
|
24
|
-
} from "@/components/ui/dropdown-menu"
|
|
25
|
-
import { Tip } from "@/components/ui/tip"
|
|
26
|
-
import { Skeleton } from "@/components/ui/skeleton"
|
|
27
|
-
import { ListPageConnectedViewBody } from "@/components/data-views/list-page-connected-view-body"
|
|
28
|
-
import { ListPageCalendarView } from "@/components/data-views/list-page-calendar-view"
|
|
29
|
-
import { ListPageSplitHubChrome } from "@/components/data-views/list-page-split-hub-chrome"
|
|
30
|
-
import { defineHubViewRenderers } from "@/lib/hub-connected-view-renderers"
|
|
31
|
-
import { QuestionBankFolderColumnsPanel } from "@/components/question-bank-folder-columns-panel"
|
|
32
|
-
import { QuestionBankBoardView, QUESTION_BANK_BOARD_GROUP_OPTIONS } from "@/components/question-bank-board-view"
|
|
33
|
-
import { QuestionBankListView } from "@/components/question-bank-list-view"
|
|
34
|
-
import {
|
|
35
|
-
QuestionBankFavoriteButton,
|
|
36
|
-
QUESTION_BANK_FAVORITE_HOVER_GROUP,
|
|
37
|
-
} from "@/components/question-bank-favorite-button"
|
|
38
|
-
import { QuestionBankOsFolderView } from "@/components/question-bank-os-folder-view"
|
|
39
|
-
import { QuestionBankNewFolderSheet } from "@/components/question-bank-new-folder-sheet"
|
|
40
|
-
import { FolderDetailsShell } from "@/components/folder-details-shell"
|
|
41
|
-
import { HubTreePanelView } from "@/components/hub-tree-panel-view"
|
|
42
|
-
import { AvatarInitials } from "@/components/ui/avatar"
|
|
43
|
-
import { cn } from "@/lib/utils"
|
|
44
|
-
import { formatDateUS } from "@/lib/date-filter"
|
|
45
|
-
import { initialsFromDisplayName } from "@/lib/initials-from-name"
|
|
46
|
-
import {
|
|
47
|
-
newQuestionBankQuestionId,
|
|
48
|
-
type QuestionBankDifficulty,
|
|
49
|
-
type QuestionBankItem,
|
|
50
|
-
type QuestionBankType,
|
|
51
|
-
} from "@/lib/mock/question-bank"
|
|
52
|
-
import type { QuestionBankFolder } from "@/lib/mock/question-bank-folders"
|
|
53
|
-
import {
|
|
54
|
-
toggleQuestionBankItemFavorite,
|
|
55
|
-
applyQuestionBankHubDisplayFilters,
|
|
56
|
-
type QuestionBankLandingFilterState,
|
|
57
|
-
type QuestionBankNavState,
|
|
58
|
-
} from "@/lib/question-bank-nav"
|
|
59
|
-
import {
|
|
60
|
-
DEFAULT_DATA_LIST_DISPLAY_OPTIONS,
|
|
61
|
-
type DataListDisplayOptions,
|
|
62
|
-
} from "@/lib/data-list-display-options"
|
|
63
|
-
|
|
64
|
-
const QuestionBankDashboardChartsSection = dynamic(
|
|
65
|
-
() =>
|
|
66
|
-
import("@/components/question-bank-dashboard-charts").then(mod => ({
|
|
67
|
-
default: mod.QuestionBankDashboardChartsSection,
|
|
68
|
-
})),
|
|
69
|
-
{
|
|
70
|
-
ssr: false,
|
|
71
|
-
loading: () => (
|
|
72
|
-
<div className="flex min-h-0 flex-1 flex-col gap-4 pb-6">
|
|
73
|
-
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
|
74
|
-
<Skeleton className="h-20 w-full rounded-lg" />
|
|
75
|
-
<Skeleton className="h-20 w-full rounded-lg" />
|
|
76
|
-
<Skeleton className="h-20 w-full rounded-lg" />
|
|
77
|
-
<Skeleton className="h-20 w-full rounded-lg" />
|
|
78
|
-
</div>
|
|
79
|
-
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
|
80
|
-
<div className="flex flex-col gap-3 rounded-xl border border-border p-4">
|
|
81
|
-
<Skeleton className="h-5 w-32" />
|
|
82
|
-
<Skeleton className="min-h-[220px] w-full rounded-lg" />
|
|
83
|
-
</div>
|
|
84
|
-
<div className="flex flex-col gap-3 rounded-xl border border-border p-4">
|
|
85
|
-
<Skeleton className="h-5 w-28" />
|
|
86
|
-
<Skeleton className="min-h-[220px] w-full rounded-lg" />
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
),
|
|
91
|
-
},
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
const TYPE_LABEL: Record<QuestionBankType, string> = {
|
|
95
|
-
multiple_choice: "Multiple choice",
|
|
96
|
-
true_false: "True / false",
|
|
97
|
-
short_answer: "Short answer",
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const DIFFICULTY_LABEL: Record<QuestionBankDifficulty, string> = {
|
|
101
|
-
easy: "Easy",
|
|
102
|
-
medium: "Medium",
|
|
103
|
-
hard: "Hard",
|
|
104
|
-
}
|
|
105
|
-
|
|
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
|
-
const TYPE_FILTER_OPTS = (Object.keys(TYPE_LABEL) as QuestionBankType[]).map(k => ({
|
|
122
|
-
value: k,
|
|
123
|
-
label: TYPE_LABEL[k],
|
|
124
|
-
}))
|
|
125
|
-
|
|
126
|
-
const DIFFICULTY_FILTER_OPTS = (Object.keys(DIFFICULTY_LABEL) as QuestionBankDifficulty[]).map(k => ({
|
|
127
|
-
value: k,
|
|
128
|
-
label: DIFFICULTY_LABEL[k],
|
|
129
|
-
}))
|
|
130
|
-
|
|
131
|
-
function columnToFilterFieldDef(c: ColumnDef<QuestionBankItem>): FilterFieldDef | null {
|
|
132
|
-
if (!c.filter) return null
|
|
133
|
-
const f = c.filter
|
|
134
|
-
const defaultOps: FilterOperator[] =
|
|
135
|
-
f.type === "select" || f.type === "date"
|
|
136
|
-
? ["is", "is_not"]
|
|
137
|
-
: ["contains", "not_contains"]
|
|
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
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function columnsToFilterFields(cols: ColumnDef<QuestionBankItem>[]) {
|
|
150
|
-
return cols.map(columnToFilterFieldDef).filter((x): x is FilterFieldDef => x !== null)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function buildQuestionBankColumns(
|
|
154
|
-
items: QuestionBankItem[],
|
|
155
|
-
opts: { onToggleFavorite: (row: QuestionBankItem) => void },
|
|
156
|
-
): ColumnDef<QuestionBankItem>[] {
|
|
157
|
-
const topicOpts = uniqueTopics(items)
|
|
158
|
-
const { onToggleFavorite } = opts
|
|
159
|
-
|
|
160
|
-
const COLUMN_SELECT: ColumnDef<QuestionBankItem> = {
|
|
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(
|
|
171
|
-
{
|
|
172
|
-
key: "stem",
|
|
173
|
-
label: "Question",
|
|
174
|
-
width: 300,
|
|
175
|
-
minWidth: 160,
|
|
176
|
-
sortable: true,
|
|
177
|
-
sortKey: "stem",
|
|
178
|
-
defaultPin: "left",
|
|
179
|
-
filter: {
|
|
180
|
-
type: "text",
|
|
181
|
-
icon: "fa-file-lines",
|
|
182
|
-
operators: ["contains", "not_contains"],
|
|
183
|
-
},
|
|
184
|
-
cell: row => (
|
|
185
|
-
<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 pr-1">
|
|
187
|
-
<span className="line-clamp-2 text-sm font-medium text-foreground">{row.stem}</span>
|
|
188
|
-
<span className="font-mono text-xs text-muted-foreground">{row.questionId}</span>
|
|
189
|
-
</div>
|
|
190
|
-
<QuestionBankFavoriteButton row={row} onToggleFavorite={onToggleFavorite} />
|
|
191
|
-
</div>
|
|
192
|
-
),
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
key: "topic",
|
|
196
|
-
label: "Topic",
|
|
197
|
-
width: 160,
|
|
198
|
-
minWidth: 120,
|
|
199
|
-
sortable: true,
|
|
200
|
-
sortKey: "topic",
|
|
201
|
-
filter: {
|
|
202
|
-
type: "select",
|
|
203
|
-
icon: "fa-layer-group",
|
|
204
|
-
operators: ["is", "is_not"],
|
|
205
|
-
options: topicOpts,
|
|
206
|
-
},
|
|
207
|
-
cell: row => <span className="text-sm text-foreground/90">{row.topic}</span>,
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
key: "type",
|
|
211
|
-
label: "Type",
|
|
212
|
-
width: 140,
|
|
213
|
-
minWidth: 120,
|
|
214
|
-
sortable: true,
|
|
215
|
-
sortKey: "type",
|
|
216
|
-
filter: {
|
|
217
|
-
type: "select",
|
|
218
|
-
icon: "fa-list-check",
|
|
219
|
-
operators: ["is", "is_not"],
|
|
220
|
-
options: TYPE_FILTER_OPTS,
|
|
221
|
-
},
|
|
222
|
-
cell: row => <span className="text-sm text-foreground/90">{TYPE_LABEL[row.type]}</span>,
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
key: "difficulty",
|
|
226
|
-
label: "Difficulty",
|
|
227
|
-
width: 110,
|
|
228
|
-
minWidth: 96,
|
|
229
|
-
sortable: true,
|
|
230
|
-
sortKey: "difficulty",
|
|
231
|
-
filter: {
|
|
232
|
-
type: "select",
|
|
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
|
-
),
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
key: "updatedAt",
|
|
243
|
-
label: "Updated",
|
|
244
|
-
width: 120,
|
|
245
|
-
minWidth: 100,
|
|
246
|
-
sortable: true,
|
|
247
|
-
sortKey: "updatedAt",
|
|
248
|
-
filter: { type: "date", icon: "fa-calendar-days", operators: ["is", "is_not"] },
|
|
249
|
-
cell: row => (
|
|
250
|
-
<span className="text-sm tabular-nums text-foreground/90 whitespace-nowrap">{formatDateUS(row.updatedAt)}</span>
|
|
251
|
-
),
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
key: "author",
|
|
255
|
-
label: "Author",
|
|
256
|
-
width: 260,
|
|
257
|
-
minWidth: 200,
|
|
258
|
-
sortable: true,
|
|
259
|
-
sortKey: "author",
|
|
260
|
-
filter: {
|
|
261
|
-
type: "text",
|
|
262
|
-
icon: "fa-user",
|
|
263
|
-
operators: ["contains", "not_contains"],
|
|
264
|
-
},
|
|
265
|
-
cell: row => {
|
|
266
|
-
const initials = initialsFromDisplayName(row.author)
|
|
267
|
-
return (
|
|
268
|
-
<div className="flex min-w-0 items-center gap-2.5">
|
|
269
|
-
<AvatarInitials initials={initials} className="size-8 shrink-0 text-xs" />
|
|
270
|
-
<div className="flex min-w-0 flex-col gap-0.5">
|
|
271
|
-
<span className="truncate text-sm font-medium text-foreground">{row.author}</span>
|
|
272
|
-
{row.authorEmail ? (
|
|
273
|
-
<a
|
|
274
|
-
href={mailtoHref(row.authorEmail)}
|
|
275
|
-
className="truncate text-xs text-muted-foreground transition-colors hover:text-foreground hover:underline"
|
|
276
|
-
onClick={e => e.stopPropagation()}
|
|
277
|
-
>
|
|
278
|
-
{row.authorEmail}
|
|
279
|
-
</a>
|
|
280
|
-
) : null}
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
)
|
|
284
|
-
},
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
key: "actions",
|
|
288
|
-
label: "",
|
|
289
|
-
width: 48,
|
|
290
|
-
minWidth: 48,
|
|
291
|
-
defaultPin: "right",
|
|
292
|
-
lockPin: true,
|
|
293
|
-
cell: row => (
|
|
294
|
-
<div className="flex items-center justify-center">
|
|
295
|
-
<DropdownMenu>
|
|
296
|
-
<DropdownMenuTrigger asChild>
|
|
297
|
-
<Button size="icon-sm" variant="ghost" aria-label={`Actions for question ${row.id}`}>
|
|
298
|
-
<i className="fa-light fa-ellipsis text-sm" aria-hidden="true" />
|
|
299
|
-
</Button>
|
|
300
|
-
</DropdownMenuTrigger>
|
|
301
|
-
<DropdownMenuContent align="end">
|
|
302
|
-
<DropdownMenuItem disabled>
|
|
303
|
-
<i className="fa-light fa-eye" aria-hidden="true" />
|
|
304
|
-
Preview
|
|
305
|
-
</DropdownMenuItem>
|
|
306
|
-
<DropdownMenuItem disabled>
|
|
307
|
-
<i className="fa-light fa-pen" aria-hidden="true" />
|
|
308
|
-
Edit
|
|
309
|
-
</DropdownMenuItem>
|
|
310
|
-
</DropdownMenuContent>
|
|
311
|
-
</DropdownMenu>
|
|
312
|
-
</div>
|
|
313
|
-
),
|
|
314
|
-
},
|
|
315
|
-
)
|
|
316
|
-
|
|
317
|
-
return cols
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export type QuestionBankTableHandle = OpenTablePropertiesHandle
|
|
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
|
-
)
|
|
383
|
-
|
|
384
|
-
const resolveColumnLabel = React.useCallback(
|
|
385
|
-
(key: string) => columns.find(c => c.key === key)?.label ?? key,
|
|
386
|
-
[columns],
|
|
387
|
-
)
|
|
388
|
-
|
|
389
|
-
const [displayOptions, setDisplayOptions] = React.useState<DataListDisplayOptions>(DEFAULT_DATA_LIST_DISPLAY_OPTIONS)
|
|
390
|
-
const patchDisplay = React.useCallback((patch: Partial<DataListDisplayOptions>) => {
|
|
391
|
-
setDisplayOptions(prev => ({ ...prev, ...patch }))
|
|
392
|
-
}, [])
|
|
393
|
-
|
|
394
|
-
const [newFolderOpen, setNewFolderOpen] = React.useState(false)
|
|
395
|
-
const [newFolderParentId, setNewFolderParentId] = React.useState<string | null>(null)
|
|
396
|
-
const [customizingFolder, setCustomizingFolder] = React.useState<QuestionBankFolder | null>(null)
|
|
397
|
-
|
|
398
|
-
const [conditionalRules, setConditionalRules] = React.useState<ConditionalRule[]>([])
|
|
399
|
-
const addConditionalRule = React.useCallback((rule: Omit<ConditionalRule, "id">) => {
|
|
400
|
-
setConditionalRules(prev => [...prev, { ...rule, id: `cr-${Date.now()}` }])
|
|
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
|
-
}, [])
|
|
408
|
-
|
|
409
|
-
const tableState = useTableState(
|
|
410
|
-
tableSourceItems,
|
|
411
|
-
columns,
|
|
412
|
-
{ key: "updatedAt", dir: "desc" },
|
|
413
|
-
undefined,
|
|
414
|
-
searchLanding ? undefined : urlListSearch,
|
|
415
|
-
)
|
|
416
|
-
|
|
417
|
-
const openNewFolderForColumn = React.useCallback((parentId: string | null) => {
|
|
418
|
-
setNewFolderParentId(parentId)
|
|
419
|
-
setCustomizingFolder(null)
|
|
420
|
-
setNewFolderOpen(true)
|
|
421
|
-
}, [])
|
|
422
|
-
|
|
423
|
-
const openCustomizeFolderSheet = React.useCallback((folder: QuestionBankFolder) => {
|
|
424
|
-
setCustomizingFolder(folder)
|
|
425
|
-
setNewFolderOpen(true)
|
|
426
|
-
}, [])
|
|
427
|
-
|
|
428
|
-
const addQuestionInColumn = React.useCallback(
|
|
429
|
-
(parentId: string | null) => {
|
|
430
|
-
const folderId = defaultFolderIdForColumnParent(parentId, folders)
|
|
431
|
-
if (!folderId) return
|
|
432
|
-
const today = new Date()
|
|
433
|
-
const y = today.getFullYear()
|
|
434
|
-
const m = String(today.getMonth() + 1).padStart(2, "0")
|
|
435
|
-
const d = String(today.getDate()).padStart(2, "0")
|
|
436
|
-
onItemsChange(prev => [
|
|
437
|
-
...prev,
|
|
438
|
-
{
|
|
439
|
-
id: newQuestionBankItemId(),
|
|
440
|
-
questionId: newQuestionBankQuestionId(),
|
|
441
|
-
stem: "New question",
|
|
442
|
-
topic: "General",
|
|
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
|
-
)
|
|
463
|
-
|
|
464
|
-
React.useImperativeHandle(ref, () => ({
|
|
465
|
-
openPropertiesDrawer: () => {
|
|
466
|
-
tableState.setSheetOpen(true)
|
|
467
|
-
},
|
|
468
|
-
}), [tableState])
|
|
469
|
-
|
|
470
|
-
const questionBankBoardGroupKey = QUESTION_BANK_BOARD_GROUP_OPTIONS.some(
|
|
471
|
-
o => o.key === displayOptions.boardGroupByColumnKey,
|
|
472
|
-
)
|
|
473
|
-
? displayOptions.boardGroupByColumnKey
|
|
474
|
-
: "topic"
|
|
475
|
-
|
|
476
|
-
const panelRenderDetail = (row: QuestionBankItem) => (
|
|
477
|
-
<div className="flex min-w-0 flex-col gap-4">
|
|
478
|
-
<div>
|
|
479
|
-
<h3 className="text-sm font-semibold text-foreground mb-2">Question</h3>
|
|
480
|
-
<p className="text-sm text-foreground">{row.stem}</p>
|
|
481
|
-
<p className="mt-1 font-mono text-xs text-muted-foreground">{row.questionId}</p>
|
|
482
|
-
</div>
|
|
483
|
-
<div className="flex gap-3 flex-wrap">
|
|
484
|
-
<div className="flex flex-col gap-1">
|
|
485
|
-
<span className="text-xs font-medium text-muted-foreground">Type</span>
|
|
486
|
-
<span className="text-sm text-foreground">{TYPE_LABEL[row.type]}</span>
|
|
487
|
-
</div>
|
|
488
|
-
<div className="flex flex-col gap-1">
|
|
489
|
-
<span className="text-xs font-medium text-muted-foreground">Difficulty</span>
|
|
490
|
-
<span className="text-sm text-foreground">{DIFFICULTY_LABEL[row.difficulty]}</span>
|
|
491
|
-
</div>
|
|
492
|
-
</div>
|
|
493
|
-
{row.topic && (
|
|
494
|
-
<div>
|
|
495
|
-
<span className="text-xs font-medium text-muted-foreground">Topic</span>
|
|
496
|
-
<p className="text-sm text-foreground mt-1">{row.topic}</p>
|
|
497
|
-
</div>
|
|
498
|
-
)}
|
|
499
|
-
{row.type === "multiple_choice" && row.options && row.options.length > 0 && (
|
|
500
|
-
<div>
|
|
501
|
-
<span className="text-xs font-medium text-muted-foreground block mb-2">Options</span>
|
|
502
|
-
<div className="flex flex-col gap-2">
|
|
503
|
-
{row.options.map((option, idx) => (
|
|
504
|
-
<div key={idx} className="flex items-start gap-2 p-2 rounded bg-muted/30">
|
|
505
|
-
<span className="text-xs font-medium text-muted-foreground mt-0.5 shrink-0">
|
|
506
|
-
{String.fromCharCode(65 + idx)}.
|
|
507
|
-
</span>
|
|
508
|
-
<span className={cn(
|
|
509
|
-
"text-sm",
|
|
510
|
-
option.isCorrect ? "text-foreground font-medium" : "text-foreground/80"
|
|
511
|
-
)}>
|
|
512
|
-
{option.text}
|
|
513
|
-
</span>
|
|
514
|
-
{option.isCorrect && (
|
|
515
|
-
<i className="fa-light fa-check text-emerald-600 text-sm ml-auto shrink-0" aria-hidden="true" />
|
|
516
|
-
)}
|
|
517
|
-
</div>
|
|
518
|
-
))}
|
|
519
|
-
</div>
|
|
520
|
-
</div>
|
|
521
|
-
)}
|
|
522
|
-
</div>
|
|
523
|
-
)
|
|
524
|
-
|
|
525
|
-
const drawerToolbarProps = {
|
|
526
|
-
totalRows: tableSourceItems.length,
|
|
527
|
-
filterFields,
|
|
528
|
-
fieldDefinitions: fieldDefinitionsForDrawer,
|
|
529
|
-
resolveColumnLabel,
|
|
530
|
-
displayOptions,
|
|
531
|
-
onDisplayOptionsChange: patchDisplay,
|
|
532
|
-
conditionalRules,
|
|
533
|
-
onAddConditionalRule: addConditionalRule,
|
|
534
|
-
onRemoveConditionalRule: removeConditionalRule,
|
|
535
|
-
onUpdateConditionalRule: updateConditionalRule,
|
|
536
|
-
currentView: view,
|
|
537
|
-
onViewChange,
|
|
538
|
-
supportedViewTypes,
|
|
539
|
-
lifecycleTabLabel: "Question bank",
|
|
540
|
-
boardGroupByColumnOptions: [...QUESTION_BANK_BOARD_GROUP_OPTIONS],
|
|
541
|
-
renderFilterOptionValue,
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
const tableProps = {
|
|
545
|
-
data: tableSourceItems,
|
|
546
|
-
columns,
|
|
547
|
-
getRowId: (row: QuestionBankItem) => row.id,
|
|
548
|
-
getRowSelectionLabel: (row: QuestionBankItem) => row.stem,
|
|
549
|
-
selectable: true,
|
|
550
|
-
searchable: displayOptions.showToolbarSearch,
|
|
551
|
-
showColumnHeaders: displayOptions.showColumnLabels,
|
|
552
|
-
groupable: true,
|
|
553
|
-
defaultSort: { key: "updatedAt", dir: "desc" as const },
|
|
554
|
-
emptyState: <p className="text-sm text-muted-foreground">No questions in the bank.</p>,
|
|
555
|
-
conditionalRules,
|
|
556
|
-
state: tableState,
|
|
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
|
-
)
|
|
575
|
-
},
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
const sharedToolbar = (
|
|
579
|
-
<DataTableToolbar
|
|
580
|
-
state={tableState}
|
|
581
|
-
columns={columns}
|
|
582
|
-
searchable={displayOptions.showToolbarSearch}
|
|
583
|
-
searchAriaLabel="Search questions"
|
|
584
|
-
renderFilterOptionValue={renderFilterOptionValue}
|
|
585
|
-
toolbarSlot={s => <TablePropertiesDrawerButton {...drawerToolbarProps} state={s} />}
|
|
586
|
-
/>
|
|
587
|
-
)
|
|
588
|
-
|
|
589
|
-
const toolbarShell = (body: React.ReactNode) => (
|
|
590
|
-
<div className="flex min-h-0 flex-1 flex-col">
|
|
591
|
-
{sharedToolbar}
|
|
592
|
-
{body}
|
|
593
|
-
</div>
|
|
594
|
-
)
|
|
595
|
-
|
|
596
|
-
const handleFolderSheetCreated = React.useCallback(
|
|
597
|
-
(newFolder: {
|
|
598
|
-
name: string
|
|
599
|
-
icon: string
|
|
600
|
-
colorKey: QuestionBankFolder["colorKey"]
|
|
601
|
-
parentId: string | null
|
|
602
|
-
}) => {
|
|
603
|
-
if (customizingFolder) {
|
|
604
|
-
onFoldersChange(prev =>
|
|
605
|
-
prev.map(f =>
|
|
606
|
-
f.id === customizingFolder.id
|
|
607
|
-
? { ...f, name: newFolder.name, icon: newFolder.icon, colorKey: newFolder.colorKey }
|
|
608
|
-
: f,
|
|
609
|
-
),
|
|
610
|
-
)
|
|
611
|
-
setCustomizingFolder(null)
|
|
612
|
-
} else {
|
|
613
|
-
onFoldersChange(prev => [
|
|
614
|
-
...prev,
|
|
615
|
-
{
|
|
616
|
-
id: `fld-${Date.now()}`,
|
|
617
|
-
name: newFolder.name,
|
|
618
|
-
icon: newFolder.icon,
|
|
619
|
-
colorKey: newFolder.colorKey,
|
|
620
|
-
parentId: newFolder.parentId,
|
|
621
|
-
},
|
|
622
|
-
])
|
|
623
|
-
}
|
|
624
|
-
setNewFolderOpen(false)
|
|
625
|
-
},
|
|
626
|
-
[customizingFolder, onFoldersChange],
|
|
627
|
-
)
|
|
628
|
-
|
|
629
|
-
const folderSheet = (
|
|
630
|
-
<QuestionBankNewFolderSheet
|
|
631
|
-
open={newFolderOpen}
|
|
632
|
-
onOpenChange={setNewFolderOpen}
|
|
633
|
-
parentFolderId={customizingFolder?.parentId ?? newFolderParentId}
|
|
634
|
-
customizingFolder={customizingFolder}
|
|
635
|
-
onCreated={handleFolderSheetCreated}
|
|
636
|
-
/>
|
|
637
|
-
)
|
|
638
|
-
|
|
639
|
-
const rows = tableState.rows as QuestionBankItem[]
|
|
640
|
-
|
|
641
|
-
return (
|
|
642
|
-
<ListPageConnectedViewBody
|
|
643
|
-
view={view}
|
|
644
|
-
hubLabel="Question bank"
|
|
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(
|
|
659
|
-
<QuestionBankBoardView
|
|
660
|
-
rows={rows}
|
|
661
|
-
groupByColumnKey={questionBankBoardGroupKey}
|
|
662
|
-
onToggleFavorite={toggleFavorite}
|
|
663
|
-
onRowActivate={row => tableState.toggleRow(row.id)}
|
|
664
|
-
/>,
|
|
665
|
-
),
|
|
666
|
-
"folder-with-toolbar": toolbarShell(
|
|
667
|
-
<QuestionBankOsFolderView
|
|
668
|
-
folders={folders}
|
|
669
|
-
onFoldersChange={onFoldersChange}
|
|
670
|
-
questions={rows}
|
|
671
|
-
onQuestionsChange={onItemsChange}
|
|
672
|
-
/>,
|
|
673
|
-
),
|
|
674
|
-
"panel-with-toolbar": (
|
|
675
|
-
<>
|
|
676
|
-
{toolbarShell(
|
|
677
|
-
<ListPageSplitHubChrome aria-label="Question bank folder columns">
|
|
678
|
-
<QuestionBankFolderColumnsPanel
|
|
679
|
-
folders={folders}
|
|
680
|
-
rows={rows}
|
|
681
|
-
panelRenderDetail={panelRenderDetail}
|
|
682
|
-
onAddFolder={openNewFolderForColumn}
|
|
683
|
-
onAddQuestion={addQuestionInColumn}
|
|
684
|
-
onCustomizeFolder={openCustomizeFolderSheet}
|
|
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
|
-
</>
|
|
705
|
-
),
|
|
706
|
-
"calendar-with-toolbar": toolbarShell(
|
|
707
|
-
<ListPageCalendarView
|
|
708
|
-
rows={rows}
|
|
709
|
-
getRowId={row => row.id}
|
|
710
|
-
getEventDate={row => row.updatedAt}
|
|
711
|
-
getEventLabel={row => row.stem}
|
|
712
|
-
getEventMeta={row => row.topic}
|
|
713
|
-
emptyMonthLabel="No questions on this day."
|
|
714
|
-
ariaLabel="Question bank calendar"
|
|
715
|
-
showSummaryPanel={displayOptions.showCalendarSummaryPanel}
|
|
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} />,
|
|
723
|
-
),
|
|
724
|
-
})}
|
|
725
|
-
/>
|
|
726
|
-
)
|
|
727
|
-
})
|
|
728
|
-
|
|
729
|
-
QuestionBankTable.displayName = "QuestionBankTable"
|