@alepha/ui 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/account-layout.d.ts.map +1 -1
- package/dist/components/account/account-layout.js +8 -2
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +34 -5
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +69 -51
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +14 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +35 -8
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +2 -1
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +1 -1
- package/dist/components/admin/admin-jobs.js +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +2 -1
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-notifications.js +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +108 -14
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.js +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +126 -4
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-avatar-control.d.ts +24 -0
- package/dist/components/admin/admin-user-avatar-control.d.ts.map +1 -0
- package/dist/components/admin/admin-user-avatar-control.js +84 -0
- package/dist/components/admin/admin-user-avatar-control.js.map +1 -0
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +13 -2
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users.js +1 -1
- package/dist/components/admin/admin-workflows.js +1 -1
- package/dist/components/admin/analytics/AdvancedSection.d.ts +26 -0
- package/dist/components/admin/analytics/AdvancedSection.d.ts.map +1 -0
- package/dist/components/admin/analytics/AdvancedSection.js +143 -0
- package/dist/components/admin/analytics/AdvancedSection.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChart.d.ts +20 -0
- package/dist/components/admin/analytics/AnalyticsChart.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChart.js +60 -0
- package/dist/components/admin/analytics/AnalyticsChart.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.d.ts +19 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.js +42 -0
- package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.d.ts +11 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.js +78 -0
- package/dist/components/admin/analytics/AnalyticsChartDonut.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.d.ts +20 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.js +105 -0
- package/dist/components/admin/analytics/AnalyticsChartHeader.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.d.ts +10 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.js +58 -0
- package/dist/components/admin/analytics/AnalyticsChartHeat.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.d.ts +9 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.js +21 -0
- package/dist/components/admin/analytics/AnalyticsChartLegend.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.js +36 -0
- package/dist/components/admin/analytics/AnalyticsChartLine.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.js +41 -0
- package/dist/components/admin/analytics/AnalyticsChartRank.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.d.ts +13 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.js +26 -0
- package/dist/components/admin/analytics/AnalyticsChartTicks.js.map +1 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.d.ts +16 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.d.ts.map +1 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.js +32 -0
- package/dist/components/admin/analytics/AnalyticsEmpty.js.map +1 -0
- package/dist/components/admin/analytics/ClauseLabel.d.ts +15 -0
- package/dist/components/admin/analytics/ClauseLabel.d.ts.map +1 -0
- package/dist/components/admin/analytics/ClauseLabel.js +19 -0
- package/dist/components/admin/analytics/ClauseLabel.js.map +1 -0
- package/dist/components/admin/analytics/CompareNote.d.ts +16 -0
- package/dist/components/admin/analytics/CompareNote.d.ts.map +1 -0
- package/dist/components/admin/analytics/CompareNote.js +33 -0
- package/dist/components/admin/analytics/CompareNote.js.map +1 -0
- package/dist/components/admin/analytics/DatasetSelect.d.ts +20 -0
- package/dist/components/admin/analytics/DatasetSelect.d.ts.map +1 -0
- package/dist/components/admin/analytics/DatasetSelect.js +63 -0
- package/dist/components/admin/analytics/DatasetSelect.js.map +1 -0
- package/dist/components/admin/analytics/FilterEditor.d.ts +24 -0
- package/dist/components/admin/analytics/FilterEditor.d.ts.map +1 -0
- package/dist/components/admin/analytics/FilterEditor.js +129 -0
- package/dist/components/admin/analytics/FilterEditor.js.map +1 -0
- package/dist/components/admin/analytics/FilterValuePicker.d.ts +19 -0
- package/dist/components/admin/analytics/FilterValuePicker.d.ts.map +1 -0
- package/dist/components/admin/analytics/FilterValuePicker.js +131 -0
- package/dist/components/admin/analytics/FilterValuePicker.js.map +1 -0
- package/dist/components/admin/analytics/GroupByChips.d.ts +26 -0
- package/dist/components/admin/analytics/GroupByChips.d.ts.map +1 -0
- package/dist/components/admin/analytics/GroupByChips.js +71 -0
- package/dist/components/admin/analytics/GroupByChips.js.map +1 -0
- package/dist/components/admin/analytics/MeasureChips.d.ts +18 -0
- package/dist/components/admin/analytics/MeasureChips.d.ts.map +1 -0
- package/dist/components/admin/analytics/MeasureChips.js +46 -0
- package/dist/components/admin/analytics/MeasureChips.js.map +1 -0
- package/dist/components/admin/analytics/QueryPanel.d.ts +27 -0
- package/dist/components/admin/analytics/QueryPanel.d.ts.map +1 -0
- package/dist/components/admin/analytics/QueryPanel.js +92 -0
- package/dist/components/admin/analytics/QueryPanel.js.map +1 -0
- package/dist/components/admin/analytics/RangeControl.d.ts +17 -0
- package/dist/components/admin/analytics/RangeControl.d.ts.map +1 -0
- package/dist/components/admin/analytics/RangeControl.js +43 -0
- package/dist/components/admin/analytics/RangeControl.js.map +1 -0
- package/dist/components/admin/analytics/RequestDialog.d.ts +24 -0
- package/dist/components/admin/analytics/RequestDialog.d.ts.map +1 -0
- package/dist/components/admin/analytics/RequestDialog.js +67 -0
- package/dist/components/admin/analytics/RequestDialog.js.map +1 -0
- package/dist/components/admin/analytics/ResultsPane.d.ts +15 -0
- package/dist/components/admin/analytics/ResultsPane.d.ts.map +1 -0
- package/dist/components/admin/analytics/ResultsPane.js +161 -0
- package/dist/components/admin/analytics/ResultsPane.js.map +1 -0
- package/dist/components/admin/analytics/ResultsTable.d.ts +17 -0
- package/dist/components/admin/analytics/ResultsTable.d.ts.map +1 -0
- package/dist/components/admin/analytics/ResultsTable.js +113 -0
- package/dist/components/admin/analytics/ResultsTable.js.map +1 -0
- package/dist/components/admin/analytics/RunFooter.d.ts +18 -0
- package/dist/components/admin/analytics/RunFooter.d.ts.map +1 -0
- package/dist/components/admin/analytics/RunFooter.js +78 -0
- package/dist/components/admin/analytics/RunFooter.js.map +1 -0
- package/dist/components/admin/analytics/SamplingBadge.d.ts +18 -0
- package/dist/components/admin/analytics/SamplingBadge.d.ts.map +1 -0
- package/dist/components/admin/analytics/SamplingBadge.js +35 -0
- package/dist/components/admin/analytics/SamplingBadge.js.map +1 -0
- package/dist/components/admin/analytics/ToggleChip.d.ts +28 -0
- package/dist/components/admin/analytics/ToggleChip.d.ts.map +1 -0
- package/dist/components/admin/analytics/ToggleChip.js +35 -0
- package/dist/components/admin/analytics/ToggleChip.js.map +1 -0
- package/dist/components/admin/analytics/TotalsCards.d.ts +19 -0
- package/dist/components/admin/analytics/TotalsCards.d.ts.map +1 -0
- package/dist/components/admin/analytics/TotalsCards.js +75 -0
- package/dist/components/admin/analytics/TotalsCards.js.map +1 -0
- package/dist/components/admin/analytics/TruncationBanner.d.ts +15 -0
- package/dist/components/admin/analytics/TruncationBanner.d.ts.map +1 -0
- package/dist/components/admin/analytics/TruncationBanner.js +52 -0
- package/dist/components/admin/analytics/TruncationBanner.js.map +1 -0
- package/dist/components/admin/analytics/analyticsModel.d.ts +98 -0
- package/dist/components/admin/analytics/analyticsModel.d.ts.map +1 -0
- package/dist/components/admin/analytics/analyticsModel.js +184 -0
- package/dist/components/admin/analytics/analyticsModel.js.map +1 -0
- package/dist/components/admin/analytics/analyticsTypes.d.ts +116 -0
- package/dist/components/admin/analytics/analyticsTypes.d.ts.map +1 -0
- package/dist/components/admin/analytics/analyticsTypes.js +0 -0
- package/dist/components/admin/analytics/chartModel.d.ts +149 -0
- package/dist/components/admin/analytics/chartModel.d.ts.map +1 -0
- package/dist/components/admin/analytics/chartModel.js +278 -0
- package/dist/components/admin/analytics/chartModel.js.map +1 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.d.ts +62 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.d.ts.map +1 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.js +257 -0
- package/dist/components/admin/analytics/useAnalyticsQuery.js.map +1 -0
- package/dist/components/admin/analytics/useDismissable.d.ts +18 -0
- package/dist/components/admin/analytics/useDismissable.d.ts.map +1 -0
- package/dist/components/admin/analytics/useDismissable.js +37 -0
- package/dist/components/admin/analytics/useDismissable.js.map +1 -0
- package/dist/components/admin/analytics/useFilterValues.d.ts +37 -0
- package/dist/components/admin/analytics/useFilterValues.d.ts.map +1 -0
- package/dist/components/admin/analytics/useFilterValues.js +78 -0
- package/dist/components/admin/analytics/useFilterValues.js.map +1 -0
- package/dist/components/admin/analytics/usePanelWidth.d.ts +26 -0
- package/dist/components/admin/analytics/usePanelWidth.d.ts.map +1 -0
- package/dist/components/admin/analytics/usePanelWidth.js +61 -0
- package/dist/components/admin/analytics/usePanelWidth.js.map +1 -0
- package/dist/components/admin/analytics/useShapeLabels.d.ts +24 -0
- package/dist/components/admin/analytics/useShapeLabels.d.ts.map +1 -0
- package/dist/components/admin/analytics/useShapeLabels.js +41 -0
- package/dist/components/admin/analytics/useShapeLabels.js.map +1 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.d.ts +22 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.js +117 -0
- package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +148 -13
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +84 -17
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +30 -11
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +75 -67
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/app-shell/navigation-progress.d.ts +40 -0
- package/dist/components/app-shell/navigation-progress.d.ts.map +1 -0
- package/dist/components/app-shell/navigation-progress.js +86 -0
- package/dist/components/app-shell/navigation-progress.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +12 -8
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auto-form/auto-form.js +20 -17
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/control/control.d.ts +39 -10
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +10 -4
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +8 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +25 -9
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +57 -6
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +112 -32
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/detail/detail-layout.d.ts.map +1 -1
- package/dist/components/detail/detail-layout.js +9 -6
- package/dist/components/detail/detail-layout.js.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.js +1 -15
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
- package/dist/components/markdown-view/diagram/diagramKind.d.ts +18 -0
- package/dist/components/markdown-view/diagram/diagramKind.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/diagramKind.js +27 -0
- package/dist/components/markdown-view/diagram/diagramKind.js.map +1 -0
- package/dist/components/plate-layout/plate-layout.d.ts +50 -0
- package/dist/components/plate-layout/plate-layout.d.ts.map +1 -0
- package/dist/components/plate-layout/plate-layout.js +37 -0
- package/dist/components/plate-layout/plate-layout.js.map +1 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts +55 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -0
- package/dist/components/plate-layout/plate-tab-bar.js +52 -0
- package/dist/components/plate-layout/plate-tab-bar.js.map +1 -0
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +7 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -1
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +110 -7
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/styles.css +45 -21
- package/package.json +9 -8
- package/src/components/account/__tests__/account-layout.browser.spec.tsx +127 -0
- package/src/components/account/account-layout.tsx +32 -2
- package/src/components/admin/__tests__/admin-audits-action-filter.browser.spec.tsx +53 -0
- package/src/components/admin/admin-analytics.tsx +97 -83
- package/src/components/admin/admin-audits.tsx +50 -8
- package/src/components/admin/admin-files.tsx +3 -0
- package/src/components/admin/admin-keys.tsx +2 -0
- package/src/components/admin/admin-parameters.tsx +165 -12
- package/src/components/admin/admin-sessions.tsx +164 -4
- package/src/components/admin/admin-user-avatar-control.tsx +130 -0
- package/src/components/admin/admin-user-detail.tsx +25 -3
- package/src/components/admin/analytics/AdvancedSection.tsx +162 -0
- package/src/components/admin/analytics/AnalyticsChart.tsx +69 -0
- package/src/components/admin/analytics/AnalyticsChartBars.tsx +86 -0
- package/src/components/admin/analytics/AnalyticsChartDonut.tsx +78 -0
- package/src/components/admin/analytics/AnalyticsChartHeader.tsx +135 -0
- package/src/components/admin/analytics/AnalyticsChartHeat.tsx +57 -0
- package/src/components/admin/analytics/AnalyticsChartLegend.tsx +26 -0
- package/src/components/admin/analytics/AnalyticsChartLine.tsx +37 -0
- package/src/components/admin/analytics/AnalyticsChartRank.tsx +43 -0
- package/src/components/admin/analytics/AnalyticsChartTicks.tsx +38 -0
- package/src/components/admin/analytics/AnalyticsEmpty.tsx +37 -0
- package/src/components/admin/analytics/ClauseLabel.tsx +26 -0
- package/src/components/admin/analytics/CompareNote.tsx +50 -0
- package/src/components/admin/analytics/DatasetSelect.tsx +79 -0
- package/src/components/admin/analytics/FilterEditor.tsx +173 -0
- package/src/components/admin/analytics/FilterValuePicker.tsx +154 -0
- package/src/components/admin/analytics/GroupByChips.tsx +82 -0
- package/src/components/admin/analytics/MeasureChips.tsx +53 -0
- package/src/components/admin/analytics/QueryPanel.tsx +113 -0
- package/src/components/admin/analytics/RangeControl.tsx +42 -0
- package/src/components/admin/analytics/RequestDialog.tsx +91 -0
- package/src/components/admin/analytics/ResultsPane.tsx +224 -0
- package/src/components/admin/analytics/ResultsTable.tsx +176 -0
- package/src/components/admin/analytics/RunFooter.tsx +90 -0
- package/src/components/admin/analytics/SamplingBadge.tsx +46 -0
- package/src/components/admin/analytics/ToggleChip.tsx +57 -0
- package/src/components/admin/analytics/TotalsCards.tsx +79 -0
- package/src/components/admin/analytics/TruncationBanner.tsx +60 -0
- package/src/components/admin/analytics/analyticsModel.spec.ts +266 -0
- package/src/components/admin/analytics/analyticsModel.ts +263 -0
- package/src/components/admin/analytics/analyticsTypes.ts +139 -0
- package/src/components/admin/analytics/chartModel.spec.ts +240 -0
- package/src/components/admin/analytics/chartModel.ts +427 -0
- package/src/components/admin/analytics/useAnalyticsQuery.ts +401 -0
- package/src/components/admin/analytics/useDismissable.ts +48 -0
- package/src/components/admin/analytics/useFilterValues.ts +113 -0
- package/src/components/admin/analytics/usePanelWidth.ts +85 -0
- package/src/components/admin/analytics/useShapeLabels.ts +73 -0
- package/src/components/alepha-table/__tests__/alepha-table-actions.browser.spec.tsx +117 -0
- package/src/components/alepha-table/__tests__/alepha-table-bulk-menu.browser.spec.tsx +177 -0
- package/src/components/alepha-table/__tests__/alepha-table-bulk-visible.browser.spec.tsx +125 -0
- package/src/components/alepha-table/alepha-table-bulk-menu.tsx +170 -0
- package/src/components/alepha-table/alepha-table.tsx +294 -55
- package/src/components/app-shell/__tests__/navigation-progress.browser.spec.tsx +122 -0
- package/src/components/app-shell/__tests__/sidebar-nav-auto-close.browser.spec.tsx +170 -0
- package/src/components/app-shell/app-shell.tsx +135 -110
- package/src/components/app-shell/navigation-progress.tsx +110 -0
- package/src/components/auth/auth-register.tsx +72 -9
- package/src/components/auto-form/__tests__/auto-form-fill-groups.browser.spec.tsx +104 -0
- package/src/components/auto-form/auto-form.tsx +13 -3
- package/src/components/control/control.tsx +63 -14
- package/src/components/control-date/control-date.tsx +55 -16
- package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +196 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +5 -1
- package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +119 -0
- package/src/components/control-select/__tests__/control-select-trigger-props.browser.spec.tsx +89 -0
- package/src/components/control-select/control-select.tsx +294 -97
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +46 -0
- package/src/components/detail/detail-layout.tsx +37 -7
- package/src/components/markdown-view/diagram/MermaidFence.tsx +1 -23
- package/src/components/markdown-view/diagram/diagramKind.ts +31 -0
- package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +167 -0
- package/src/components/plate-layout/plate-layout.tsx +78 -0
- package/src/components/plate-layout/plate-tab-bar.tsx +122 -0
- package/src/components/ui/button.tsx +1 -1
- package/src/components/use-dialog/use-dialog.tsx +10 -0
- package/src/lib/i18n-fr.ts +121 -7
- package/src/styles.css +45 -21
- package/dist/components/admin/admin-analytics-query-panel.d.ts +0 -16
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +0 -1
- package/dist/components/admin/admin-analytics-query-panel.js +0 -117
- package/dist/components/admin/admin-analytics-query-panel.js.map +0 -1
- package/dist/components/admin/admin-analytics-results.d.ts +0 -15
- package/dist/components/admin/admin-analytics-results.d.ts.map +0 -1
- package/dist/components/admin/admin-analytics-results.js +0 -56
- package/dist/components/admin/admin-analytics-results.js.map +0 -1
- package/src/components/admin/admin-analytics-query-panel.tsx +0 -150
- package/src/components/admin/admin-analytics-results.tsx +0 -95
|
@@ -5,9 +5,6 @@ void React;
|
|
|
5
5
|
import { FormField } from "@alepha/ui/components/control-base/form-field";
|
|
6
6
|
import type { IconComponent } from "@alepha/ui/components/control-base/icon-hint";
|
|
7
7
|
import {
|
|
8
|
-
ComboboxChip,
|
|
9
|
-
ComboboxChips,
|
|
10
|
-
ComboboxChipsInput,
|
|
11
8
|
ComboboxContent,
|
|
12
9
|
ComboboxEmpty,
|
|
13
10
|
ComboboxInput,
|
|
@@ -15,7 +12,6 @@ import {
|
|
|
15
12
|
ComboboxList,
|
|
16
13
|
Combobox as ComboboxRoot,
|
|
17
14
|
ComboboxTrigger,
|
|
18
|
-
useComboboxAnchor,
|
|
19
15
|
} from "@alepha/ui/components/ui/combobox";
|
|
20
16
|
import { Segmented } from "@alepha/ui/components/ui/segmented";
|
|
21
17
|
import { cn } from "@alepha/ui/lib/utils";
|
|
@@ -28,7 +24,8 @@ import {
|
|
|
28
24
|
useFormState,
|
|
29
25
|
} from "alepha/react/form";
|
|
30
26
|
import { useI18n } from "alepha/react/i18n";
|
|
31
|
-
import { Loader2 } from "lucide-react";
|
|
27
|
+
import { ListChecks, Loader2 } from "lucide-react";
|
|
28
|
+
import type { HTMLAttributes } from "react";
|
|
32
29
|
import { type ReactNode, useMemo, useRef, useState } from "react";
|
|
33
30
|
|
|
34
31
|
export type SelectOption =
|
|
@@ -59,6 +56,54 @@ export type SelectOption =
|
|
|
59
56
|
|
|
60
57
|
type LoaderMode = "static" | "short" | "long";
|
|
61
58
|
|
|
59
|
+
/**
|
|
60
|
+
* How tall and how loud a select trigger is.
|
|
61
|
+
*
|
|
62
|
+
* `xs` exists for a control that sits ON a row of text rather than in a form:
|
|
63
|
+
* the quest rail's Release field beside its Assigned picker, where a
|
|
64
|
+
* default-height boxed select reads as heavier than every line around it.
|
|
65
|
+
*/
|
|
66
|
+
export type ControlSelectSize = "xs" | "sm" | "default";
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Per-size trigger geometry. Kept as one table rather than scattered
|
|
70
|
+
* conditionals so a new size is one row and the three axes cannot drift.
|
|
71
|
+
*
|
|
72
|
+
* `chevron` targets the trigger's own last SVG - the one `ComboboxTrigger`
|
|
73
|
+
* appends at a hardcoded `size-4`. That file is stock shadcn, refreshed
|
|
74
|
+
* wholesale by `yarn sync`, so it is sized from here rather than edited.
|
|
75
|
+
*/
|
|
76
|
+
const SIZE_CLASSES: Record<
|
|
77
|
+
ControlSelectSize,
|
|
78
|
+
{ trigger: string; icon: string; chevron: string }
|
|
79
|
+
> = {
|
|
80
|
+
default: {
|
|
81
|
+
trigger: "h-8 gap-1.5 py-2 pr-2 pl-2.5 text-sm",
|
|
82
|
+
icon: "size-4",
|
|
83
|
+
chevron: "[&>svg]:size-4",
|
|
84
|
+
},
|
|
85
|
+
sm: {
|
|
86
|
+
trigger: "h-7 gap-1.5 py-1 pr-1.5 pl-2 text-sm",
|
|
87
|
+
icon: "size-3.5",
|
|
88
|
+
chevron: "[&>svg]:size-3.5",
|
|
89
|
+
},
|
|
90
|
+
xs: {
|
|
91
|
+
trigger: "h-6 gap-1 px-1 text-xs",
|
|
92
|
+
icon: "size-3",
|
|
93
|
+
chevron: "[&>svg]:size-3",
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The bordered box, or nothing at all.
|
|
99
|
+
*
|
|
100
|
+
* `minimal` drops the border, the background and the shadow, and pulls the
|
|
101
|
+
* trigger left by its own padding so its text aligns with plain rows beside
|
|
102
|
+
* it. The hover tint is what keeps it discoverable as a control.
|
|
103
|
+
*/
|
|
104
|
+
const MINIMAL_CLASSES =
|
|
105
|
+
"-mx-1 border-transparent bg-transparent shadow-none hover:bg-muted dark:bg-transparent dark:hover:bg-input/50";
|
|
106
|
+
|
|
62
107
|
export interface ControlSelectProps {
|
|
63
108
|
/**
|
|
64
109
|
* Bound `InputField` from `useForm`. Single or multi value depending on schema.
|
|
@@ -83,10 +128,14 @@ export interface ControlSelectProps {
|
|
|
83
128
|
*/
|
|
84
129
|
combobox?: boolean;
|
|
85
130
|
/**
|
|
86
|
-
* Whether the dropdown carries a search input. Defaults to "auto": on for
|
|
87
|
-
*
|
|
131
|
+
* Whether the dropdown carries a search input. Defaults to "auto": on for a
|
|
132
|
+
* long-mode `loader` (the rows are not all here), when `createNewEntry` is
|
|
133
|
+
* set (typing IS how an entry is made), and for lists longer than
|
|
88
134
|
* `SEARCH_THRESHOLD`. Set explicitly to search a short list or to drop the
|
|
89
135
|
* search field from a long one.
|
|
136
|
+
*
|
|
137
|
+
* Multi-select obeys the same rule as everything else; it used to force the
|
|
138
|
+
* field on because its chips box doubled as the search input.
|
|
90
139
|
*/
|
|
91
140
|
searchable?: boolean;
|
|
92
141
|
/**
|
|
@@ -145,12 +194,50 @@ export interface ControlSelectProps {
|
|
|
145
194
|
*/
|
|
146
195
|
clearLabel?: string;
|
|
147
196
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
197
|
+
* Trigger text for a multi-select holding two or more values, e.g.
|
|
198
|
+
* `(n) => \`${n} status\``. One selection always shows the value itself, so
|
|
199
|
+
* this is only ever asked for the collapsed case. Defaults to
|
|
200
|
+
* `"{n} selected"`.
|
|
201
|
+
*/
|
|
202
|
+
countLabel?: (count: number) => string;
|
|
203
|
+
/**
|
|
204
|
+
* Trigger text when nothing is selected, e.g. "Pick an epic…". Defaults to
|
|
205
|
+
* the `clearLabel` on a `clearable` or multi field (where empty IS a
|
|
206
|
+
* meaningful state to name), and to "Select…" otherwise.
|
|
207
|
+
*
|
|
208
|
+
* Set it when the empty trigger has a job to do - a picker whose whole
|
|
209
|
+
* purpose is the choice it prompts for reads as a dead "Select…" without
|
|
210
|
+
* it, which is why the surfaces that needed one stayed on the raw `Select`.
|
|
211
|
+
*/
|
|
212
|
+
placeholder?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Extra className applied to the visible trigger: the combobox button or
|
|
215
|
+
* the segmented control, whichever this field renders. Useful for sizing
|
|
216
|
+
* filter chips (`"w-40"`, `"w-72"`, etc.) without wrapping the whole
|
|
217
|
+
* `FormField` in an extra div.
|
|
152
218
|
*/
|
|
153
219
|
triggerClassName?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Trigger height and type scale. Defaults to `default`.
|
|
222
|
+
*/
|
|
223
|
+
size?: ControlSelectSize;
|
|
224
|
+
/**
|
|
225
|
+
* Render the trigger borderless and transparent, so it reads as the row it
|
|
226
|
+
* sits on rather than as a form field.
|
|
227
|
+
*/
|
|
228
|
+
minimal?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Extra attributes for whichever trigger this field renders, forwarded from
|
|
231
|
+
* `Control`'s `inputProps`.
|
|
232
|
+
*
|
|
233
|
+
* The accessible name usually lives here, because a filter is routinely
|
|
234
|
+
* rendered with `label=""` next to its own heading: with no `<label>` to
|
|
235
|
+
* borrow a name from, a `role=combobox` button or a radiogroup has no name
|
|
236
|
+
* at all. That is both an a11y hole and unaddressable from a
|
|
237
|
+
* test, and it was silent, since `Control` accepted `inputProps` and then
|
|
238
|
+
* dropped it on every select-shaped branch.
|
|
239
|
+
*/
|
|
240
|
+
triggerProps?: HTMLAttributes<HTMLElement>;
|
|
154
241
|
/**
|
|
155
242
|
* Leading icon rendered on the left of the trigger, matching the
|
|
156
243
|
* text-input controls. Resolved by the parent `Control` from its `icon`
|
|
@@ -167,12 +254,22 @@ export interface ControlSelectProps {
|
|
|
167
254
|
*/
|
|
168
255
|
const CLEAR_VALUE = "__alepha_clear__";
|
|
169
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Internal sentinel for the "select every match" row. Same reasoning as
|
|
259
|
+
* `CLEAR_VALUE`: it never reaches a caller, because it is expanded into the
|
|
260
|
+
* matching values before `onChange` is called.
|
|
261
|
+
*/
|
|
262
|
+
const SELECT_ALL_VALUE = "__alepha_select_all__";
|
|
263
|
+
|
|
170
264
|
/**
|
|
171
265
|
* Static option count above which the dropdown grows a search input. Below it
|
|
172
266
|
* the very same combobox renders without one — the threshold decides whether
|
|
173
267
|
* you can type, never which control you get.
|
|
174
268
|
*/
|
|
175
|
-
|
|
269
|
+
// Past this many rows, scanning by eye stops being realistic and the popup
|
|
270
|
+
// grows a search field. Raised 20 -> 50 with the multi-select rework: the old
|
|
271
|
+
// value put a search box on lists a reader takes in at a glance.
|
|
272
|
+
const SEARCH_THRESHOLD = 50;
|
|
176
273
|
|
|
177
274
|
const optValue = (o: SelectOption) => (typeof o === "string" ? o : o.value);
|
|
178
275
|
const optLabel = (o: SelectOption) => (typeof o === "string" ? o : o.label);
|
|
@@ -285,6 +382,13 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
285
382
|
error={meta.error}
|
|
286
383
|
required={meta.required}
|
|
287
384
|
>
|
|
385
|
+
{/* `triggerProps` is deliberately NOT spread here. `Segmented`
|
|
386
|
+
redeclares two attributes that `HTMLAttributes` also has, with
|
|
387
|
+
narrower types (`defaultValue` is string-only, `onChange` takes a
|
|
388
|
+
value rather than an event), so a blanket spread neither typechecks
|
|
389
|
+
nor is safe. A segmented field also renders every option as visible
|
|
390
|
+
text, so it is the one branch that is not nameless without a label.
|
|
391
|
+
Name it with `label` if it needs one. */}
|
|
288
392
|
<Segmented
|
|
289
393
|
value={value != null ? String(value) : undefined}
|
|
290
394
|
onChange={(v) => setValue(coerce(v))}
|
|
@@ -307,11 +411,20 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
307
411
|
// The native `Select` path this replaced silently dropped `description`,
|
|
308
412
|
// `tag`, per-option `disabled` and `deselectable`, and styled its trigger
|
|
309
413
|
// differently, purely because a list happened to be short.
|
|
310
|
-
//
|
|
414
|
+
// A search field is offered only when scanning the list by eye stops being
|
|
415
|
+
// realistic: a server-driven list (whose rows are not all here), one past
|
|
416
|
+
// `SEARCH_THRESHOLD`, or one where typing is how a new entry is made.
|
|
417
|
+
//
|
|
418
|
+
// Multi-select used to force it on unconditionally, because the chips box
|
|
419
|
+
// WAS the search input and there was no other way to open the popup. The
|
|
420
|
+
// trigger is a button now, so multi obeys the same rule as everything else
|
|
421
|
+
// and a four-row status filter no longer opens onto a search field.
|
|
311
422
|
const searchable =
|
|
312
|
-
|
|
313
|
-
(props.
|
|
314
|
-
|
|
423
|
+
props.searchable ??
|
|
424
|
+
(props.combobox ||
|
|
425
|
+
mode === "long" ||
|
|
426
|
+
Boolean(props.createNewEntry) ||
|
|
427
|
+
data.length > SEARCH_THRESHOLD);
|
|
315
428
|
|
|
316
429
|
return (
|
|
317
430
|
<FormField
|
|
@@ -337,18 +450,29 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
337
450
|
// Used to be dropped on this path, so a filter chip sized `w-40` lost
|
|
338
451
|
// its width as soon as its list crossed the threshold.
|
|
339
452
|
triggerClassName={props.triggerClassName}
|
|
453
|
+
triggerProps={props.triggerProps}
|
|
454
|
+
size={props.size}
|
|
455
|
+
minimal={props.minimal}
|
|
340
456
|
// `clearable` used to reach this path as a placeholder and nothing
|
|
341
457
|
// else, so a filter chip that had switched to the combobox (>20
|
|
342
458
|
// options) could be set but never put back to "All …".
|
|
343
459
|
clearable={props.clearable}
|
|
344
460
|
clearLabel={clearLabel}
|
|
461
|
+
countLabel={props.countLabel}
|
|
345
462
|
// An optional field must also be able to go back to empty without a
|
|
346
463
|
// dedicated row: Base UI never emits `null`, so re-pressing the
|
|
347
464
|
// selected row deselects (see `handleSingle`). A required field keeps
|
|
348
465
|
// its value — clearing it would only produce a validation error the
|
|
349
466
|
// user cannot see yet.
|
|
350
467
|
deselectable={props.clearable || !meta.required}
|
|
351
|
-
|
|
468
|
+
// Multi shows this muted when nothing is picked, so it reaches the
|
|
469
|
+
// trigger whether or not the field is `clearable` — a multi-select
|
|
470
|
+
// has no clear ROW (it clears by deselecting), and without this its
|
|
471
|
+
// empty trigger fell back to a bare "Select…".
|
|
472
|
+
placeholder={
|
|
473
|
+
props.placeholder ??
|
|
474
|
+
(props.clearable || isArray ? clearLabel : undefined)
|
|
475
|
+
}
|
|
352
476
|
/>
|
|
353
477
|
</FormField>
|
|
354
478
|
);
|
|
@@ -373,6 +497,16 @@ interface ComboboxProps {
|
|
|
373
497
|
createNewEntry?: ControlSelectProps["createNewEntry"];
|
|
374
498
|
icon?: IconComponent;
|
|
375
499
|
triggerClassName?: string;
|
|
500
|
+
/**
|
|
501
|
+
* Trigger height and type scale. Defaults to `default`.
|
|
502
|
+
*/
|
|
503
|
+
size?: ControlSelectSize;
|
|
504
|
+
/**
|
|
505
|
+
* Render the trigger borderless and transparent, so it reads as the row it
|
|
506
|
+
* sits on rather than as a form field.
|
|
507
|
+
*/
|
|
508
|
+
minimal?: boolean;
|
|
509
|
+
triggerProps?: HTMLAttributes<HTMLElement>;
|
|
376
510
|
/**
|
|
377
511
|
* Trigger text when nothing is selected. Mirrors the native-Select path,
|
|
378
512
|
* where a `clearable` field shows its `clearLabel` (e.g. "All zones") as the
|
|
@@ -388,6 +522,10 @@ interface ComboboxProps {
|
|
|
388
522
|
* Label of the `clearable` row (e.g. "All zones").
|
|
389
523
|
*/
|
|
390
524
|
clearLabel?: string;
|
|
525
|
+
/**
|
|
526
|
+
* See `ControlSelectProps.countLabel`.
|
|
527
|
+
*/
|
|
528
|
+
countLabel?: (count: number) => string;
|
|
391
529
|
/**
|
|
392
530
|
* Allow the single-select value to be unset by pressing the row that is
|
|
393
531
|
* already selected. Set for optional (and `clearable`) fields only.
|
|
@@ -416,6 +554,11 @@ interface ComboOption {
|
|
|
416
554
|
* Marks the synthetic "clear" row injected by `clearable`.
|
|
417
555
|
*/
|
|
418
556
|
clear?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Marks the synthetic "select every match" row a multi-select offers while
|
|
559
|
+
* a query is narrowing the list.
|
|
560
|
+
*/
|
|
561
|
+
selectAll?: boolean;
|
|
419
562
|
/**
|
|
420
563
|
* The raw query that produced a `create` row (used as the new entry's label).
|
|
421
564
|
*/
|
|
@@ -433,14 +576,12 @@ interface ComboOption {
|
|
|
433
576
|
*/
|
|
434
577
|
function Combobox(props: ComboboxProps) {
|
|
435
578
|
const { tr } = useI18n();
|
|
579
|
+
const sizeClasses = SIZE_CLASSES[props.size ?? "default"];
|
|
436
580
|
const [query, setQuery] = useState("");
|
|
437
581
|
// Remembers labels for values the user has picked, so the trigger/chips keep
|
|
438
582
|
// a human label even after the source option drops out of a server-filtered
|
|
439
583
|
// `data` set — or for freshly created entries that never existed in `data`.
|
|
440
584
|
const labelCache = useRef(new Map<string, string>());
|
|
441
|
-
// Positioning anchor for the multi-select chips box (the popup is anchored to
|
|
442
|
-
// the chips container rather than the inline input).
|
|
443
|
-
const anchor = useComboboxAnchor();
|
|
444
585
|
|
|
445
586
|
const options: ComboOption[] = props.data.map((o) => ({
|
|
446
587
|
value: optValue(o),
|
|
@@ -467,9 +608,6 @@ function Combobox(props: ComboboxProps) {
|
|
|
467
608
|
labelCache.current.get(val) ??
|
|
468
609
|
val;
|
|
469
610
|
|
|
470
|
-
const disabledFor = (val: string) =>
|
|
471
|
-
options.find((o) => o.value === val)?.disabled ?? false;
|
|
472
|
-
|
|
473
611
|
// Server mode (`onSearch`) filters upstream; for static lists we filter on
|
|
474
612
|
// the visible label — never the value/id (that was the cmdk bug).
|
|
475
613
|
const serverMode = Boolean(props.onSearch);
|
|
@@ -515,8 +653,47 @@ function Combobox(props: ComboboxProps) {
|
|
|
515
653
|
// leave "All zones" stranded at the top of a list it doesn't match.
|
|
516
654
|
const showClear = clearRow && clearRow.label.toLowerCase().includes(q);
|
|
517
655
|
|
|
656
|
+
/**
|
|
657
|
+
* "Select every match" — the row that makes a typed prefix a filter clause
|
|
658
|
+
* rather than a way to find one item.
|
|
659
|
+
*
|
|
660
|
+
* Areas are named by import path (`lore/quests`, `lore/folios`, `lore/ui`),
|
|
661
|
+
* so the prefix is the meaningful unit and "everything under lore/" took
|
|
662
|
+
* eight separate picks (feedback #2009). Typing `lore/` and pressing one row
|
|
663
|
+
* is the whole feature.
|
|
664
|
+
*
|
|
665
|
+
* ⚠️ It resolves to the individual values, deliberately, rather than
|
|
666
|
+
* becoming a pattern the query carries. Two consequences, and both are the
|
|
667
|
+
* point: the caller's schema and endpoint are untouched (a list of values is
|
|
668
|
+
* what they already take), and the chips stay honest - what is filtered is
|
|
669
|
+
* exactly what is shown, so removing one of the eight is an ordinary
|
|
670
|
+
* gesture rather than an escape from a prefix.
|
|
671
|
+
*
|
|
672
|
+
* Only when it would do something: multi-select, a non-empty query, and at
|
|
673
|
+
* least two matches that are not already selected. One match is what
|
|
674
|
+
* pressing the row itself does.
|
|
675
|
+
*/
|
|
676
|
+
const unselectedMatches = props.multi
|
|
677
|
+
? filtered.filter((o) => !o.disabled && !selected.includes(o.value))
|
|
678
|
+
: [];
|
|
679
|
+
|
|
680
|
+
const selectAllRow: ComboOption | undefined =
|
|
681
|
+
props.multi && q.length > 0 && unselectedMatches.length > 1
|
|
682
|
+
? {
|
|
683
|
+
value: SELECT_ALL_VALUE,
|
|
684
|
+
label: String(
|
|
685
|
+
tr("controlSelect.selectAll", {
|
|
686
|
+
default: `Select ${unselectedMatches.length} matching "${query}"`,
|
|
687
|
+
args: [String(unselectedMatches.length), query],
|
|
688
|
+
}),
|
|
689
|
+
),
|
|
690
|
+
selectAll: true,
|
|
691
|
+
}
|
|
692
|
+
: undefined;
|
|
693
|
+
|
|
518
694
|
const items: ComboOption[] = [
|
|
519
695
|
...(showClear && clearRow ? [clearRow] : []),
|
|
696
|
+
...(selectAllRow ? [selectAllRow] : []),
|
|
520
697
|
...filtered,
|
|
521
698
|
...(createOption ? [createOption] : []),
|
|
522
699
|
];
|
|
@@ -565,17 +742,53 @@ function Combobox(props: ComboboxProps) {
|
|
|
565
742
|
};
|
|
566
743
|
|
|
567
744
|
const handleMulti = (list: ComboOption[]) => {
|
|
568
|
-
|
|
569
|
-
|
|
745
|
+
// The "select every match" row arrives here as one more selected item.
|
|
746
|
+
// Swap it for the values it stands for, so the sentinel never leaves this
|
|
747
|
+
// component and the chips show the real areas rather than a prefix.
|
|
748
|
+
const expanded = list.flatMap((o) =>
|
|
749
|
+
o.selectAll ? unselectedMatches : [o],
|
|
750
|
+
);
|
|
751
|
+
// Base UI can hand the same option back twice when the expansion overlaps
|
|
752
|
+
// something already selected.
|
|
753
|
+
const seen = new Set<string>();
|
|
754
|
+
const unique = expanded.filter((o) =>
|
|
755
|
+
seen.has(o.value) ? false : (seen.add(o.value), true),
|
|
756
|
+
);
|
|
757
|
+
for (const o of unique) remember(o);
|
|
758
|
+
props.onChange(unique.map((o) => props.coerce(o.value)));
|
|
570
759
|
setQuery("");
|
|
571
760
|
};
|
|
572
761
|
|
|
573
762
|
const emptyLabel =
|
|
574
763
|
props.placeholder ?? tr("controlSelect.select", { default: "Select…" });
|
|
575
|
-
const triggerLabel = selected[0] ? labelFor(selected[0]) : emptyLabel;
|
|
576
764
|
|
|
577
|
-
|
|
578
|
-
|
|
765
|
+
/**
|
|
766
|
+
* Value, then count.
|
|
767
|
+
*
|
|
768
|
+
* One selection names itself; two or more collapse to a count. That is what
|
|
769
|
+
* keeps a filter row at a FIXED width: chips grew the trigger with every
|
|
770
|
+
* pick and then truncated, so the control both moved its neighbours and
|
|
771
|
+
* stopped saying what it was filtering on. A count does neither, and the
|
|
772
|
+
* single-selection case — much the commonest — still reads as the value.
|
|
773
|
+
*/
|
|
774
|
+
const triggerLabel = props.multi
|
|
775
|
+
? selected.length === 0
|
|
776
|
+
? emptyLabel
|
|
777
|
+
: selected.length === 1
|
|
778
|
+
? labelFor(selected[0])
|
|
779
|
+
: (props.countLabel?.(selected.length) ??
|
|
780
|
+
String(
|
|
781
|
+
tr("controlSelect.count", {
|
|
782
|
+
default: `${selected.length} selected`,
|
|
783
|
+
args: [String(selected.length)],
|
|
784
|
+
}),
|
|
785
|
+
))
|
|
786
|
+
: selected[0]
|
|
787
|
+
? labelFor(selected[0])
|
|
788
|
+
: emptyLabel;
|
|
789
|
+
|
|
790
|
+
// The list (loading / empty / items) is identical for single and multi, and
|
|
791
|
+
// so is the trigger now, so render it once.
|
|
579
792
|
const popupBody = props.loading ? (
|
|
580
793
|
<div className="text-muted-foreground flex items-center justify-center gap-2 p-4 text-sm">
|
|
581
794
|
<Loader2 className="size-4 animate-spin" />{" "}
|
|
@@ -590,7 +803,12 @@ function Combobox(props: ComboboxProps) {
|
|
|
590
803
|
</ComboboxEmpty>
|
|
591
804
|
<ComboboxList>
|
|
592
805
|
{(opt: ComboOption) =>
|
|
593
|
-
opt.
|
|
806
|
+
opt.selectAll ? (
|
|
807
|
+
<ComboboxItem key="__select_all__" value={opt}>
|
|
808
|
+
<ListChecks className="mr-2 size-4 shrink-0" />
|
|
809
|
+
<span className="truncate font-medium">{opt.label}</span>
|
|
810
|
+
</ComboboxItem>
|
|
811
|
+
) : opt.create ? (
|
|
594
812
|
<ComboboxItem key={`__create__${opt.value}`} value={opt}>
|
|
595
813
|
<span className="mr-2">+</span>
|
|
596
814
|
{tr("controlSelect.create", {
|
|
@@ -654,75 +872,54 @@ function Combobox(props: ComboboxProps) {
|
|
|
654
872
|
props.onSearch?.(v);
|
|
655
873
|
}}
|
|
656
874
|
>
|
|
657
|
-
{
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
875
|
+
{/* One trigger for single AND multi. Multi used to render a bordered
|
|
876
|
+
chips box instead, which made it a different-looking control for the
|
|
877
|
+
same job, grew with every pick, and forced a search field on because
|
|
878
|
+
the chips input was the only way to open the popup. */}
|
|
879
|
+
<ComboboxTrigger
|
|
880
|
+
id={props.id}
|
|
881
|
+
disabled={props.disabled}
|
|
882
|
+
{...props.triggerProps}
|
|
883
|
+
className={cn(
|
|
884
|
+
"border-input focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between rounded-lg border bg-transparent whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50",
|
|
885
|
+
sizeClasses.trigger,
|
|
886
|
+
sizeClasses.chevron,
|
|
887
|
+
props.minimal && MINIMAL_CLASSES,
|
|
888
|
+
// Muted means "nothing chosen yet".
|
|
889
|
+
//
|
|
890
|
+
// For MULTI that is simply "no selection": there is no clear row to
|
|
891
|
+
// stand in for it, so empty is empty and the placeholder is shown in
|
|
892
|
+
// placeholder colour.
|
|
893
|
+
//
|
|
894
|
+
// For SINGLE it is only true without a clear row. WITH one, empty is
|
|
895
|
+
// a selected value — the popup already puts the check mark on it
|
|
896
|
+
// (see `cbValue`), and the native `Select` path renders the same
|
|
897
|
+
// state in full contrast because it makes the clear label a genuine
|
|
898
|
+
// `selectedValue`. Muting there made one `clearable` filter look
|
|
899
|
+
// unset and its neighbour look set for the same meaning, purely
|
|
900
|
+
// because the option count crossed the threshold that picks between
|
|
901
|
+
// the two paths.
|
|
902
|
+
selected.length === 0 &&
|
|
903
|
+
(props.multi || !props.clearable) &&
|
|
904
|
+
"text-muted-foreground",
|
|
905
|
+
props.triggerClassName,
|
|
906
|
+
)}
|
|
907
|
+
>
|
|
908
|
+
<span className="flex min-w-0 items-center gap-2">
|
|
909
|
+
{props.icon && (
|
|
910
|
+
<props.icon
|
|
911
|
+
className={cn("text-muted-foreground shrink-0", sizeClasses.icon)}
|
|
684
912
|
/>
|
|
685
|
-
|
|
686
|
-
<
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
className={cn(
|
|
696
|
-
"border-input focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 dark:hover:bg-input/50 flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50",
|
|
697
|
-
// Muted means "nothing chosen yet", which is only true without
|
|
698
|
-
// a clear row. WITH one, empty is a selected value — the popup
|
|
699
|
-
// already puts the check mark on it (see `cbValue`), and the
|
|
700
|
-
// native `Select` path renders the same state in full contrast
|
|
701
|
-
// because it makes the clear label a genuine `selectedValue`.
|
|
702
|
-
// Muting here made one `clearable` filter look unset and its
|
|
703
|
-
// neighbour look set for the same meaning, purely because the
|
|
704
|
-
// option count crossed the 20 that picks between the two paths.
|
|
705
|
-
selected.length === 0 &&
|
|
706
|
-
!props.clearable &&
|
|
707
|
-
"text-muted-foreground",
|
|
708
|
-
props.triggerClassName,
|
|
709
|
-
)}
|
|
710
|
-
>
|
|
711
|
-
<span className="flex min-w-0 items-center gap-2">
|
|
712
|
-
{props.icon && (
|
|
713
|
-
<props.icon className="text-muted-foreground size-4 shrink-0" />
|
|
714
|
-
)}
|
|
715
|
-
<span className="truncate">{triggerLabel}</span>
|
|
716
|
-
</span>
|
|
717
|
-
</ComboboxTrigger>
|
|
718
|
-
<ComboboxContent>
|
|
719
|
-
{props.searchable && (
|
|
720
|
-
<ComboboxInput showTrigger={false} placeholder="Search…" />
|
|
721
|
-
)}
|
|
722
|
-
{popupBody}
|
|
723
|
-
</ComboboxContent>
|
|
724
|
-
</>
|
|
725
|
-
)}
|
|
913
|
+
)}
|
|
914
|
+
<span className="truncate">{triggerLabel}</span>
|
|
915
|
+
</span>
|
|
916
|
+
</ComboboxTrigger>
|
|
917
|
+
<ComboboxContent>
|
|
918
|
+
{props.searchable && (
|
|
919
|
+
<ComboboxInput showTrigger={false} placeholder="Search…" />
|
|
920
|
+
)}
|
|
921
|
+
{popupBody}
|
|
922
|
+
</ComboboxContent>
|
|
726
923
|
</ComboboxRoot>
|
|
727
924
|
);
|
|
728
925
|
}
|
|
@@ -161,6 +161,52 @@ describe("DetailLayout", () => {
|
|
|
161
161
|
expect(column?.className).toContain("min-h-0");
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
/**
|
|
165
|
+
* The toolbar splits its shortfall: the tab strip scrolls, the actions do
|
|
166
|
+
* not shrink.
|
|
167
|
+
*
|
|
168
|
+
* The row is a non-wrapping flex line whose items are `whitespace-nowrap`,
|
|
169
|
+
* so they refuse to shrink below their min-content width, while the shell
|
|
170
|
+
* row two levels up is `overflow-hidden` and this row is
|
|
171
|
+
* `overflow-x: visible`. Anything past the right edge was therefore clipped
|
|
172
|
+
* with no scrollbar and no way to reach it.
|
|
173
|
+
*
|
|
174
|
+
* ⚠️ jsdom does no layout, so this can only pin the classes. The
|
|
175
|
+
* measurement that proves the behaviour was taken in a real browser, on the
|
|
176
|
+
* Lore epic view at 411x845: the row was `clientWidth 409` /
|
|
177
|
+
* `scrollWidth 648`, with `Folios`, `Edit` and `Begin the Epic` off-screen
|
|
178
|
+
* and unclickable. With these classes the row is 409/409, `Edit` sits at
|
|
179
|
+
* 200-270 and `Begin the Epic` at 278-394 - both inside the viewport - and
|
|
180
|
+
* the tab wrapper scrolls 0 to 255 to bring `Folios` back to 81-189.
|
|
181
|
+
*/
|
|
182
|
+
it("scrolls the tab strip and keeps the actions at full width", async () => {
|
|
183
|
+
const { container } = await mount(
|
|
184
|
+
<DetailLayout
|
|
185
|
+
aside={<p>identity panel</p>}
|
|
186
|
+
tabs={tabs}
|
|
187
|
+
tab="overview"
|
|
188
|
+
onTabChange={() => {}}
|
|
189
|
+
actions={<button type="button">Publish</button>}
|
|
190
|
+
>
|
|
191
|
+
<p>overview body</p>
|
|
192
|
+
</DetailLayout>,
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
const segmented = container.querySelector('[data-slot="segmented"]');
|
|
196
|
+
const tabWrapper = segmented?.parentElement;
|
|
197
|
+
|
|
198
|
+
expect(tabWrapper?.className).toContain("overflow-x-auto");
|
|
199
|
+
// Without it the wrapper's `min-width: auto` is the strip's min-content
|
|
200
|
+
// width, so it never shrinks and never scrolls.
|
|
201
|
+
expect(tabWrapper?.className).toContain("min-w-0");
|
|
202
|
+
|
|
203
|
+
const actions = screen.getByRole("button", {
|
|
204
|
+
name: "Publish",
|
|
205
|
+
}).parentElement;
|
|
206
|
+
|
|
207
|
+
expect(actions?.className).toContain("shrink-0");
|
|
208
|
+
});
|
|
209
|
+
|
|
164
210
|
/**
|
|
165
211
|
* `loading` wins over `notFound`. A page computes "not found" as "no record",
|
|
166
212
|
* which is also true on the very first render — ordering it the other way
|
|
@@ -181,14 +181,44 @@ export const DetailLayout = (props: DetailLayoutProps) => {
|
|
|
181
181
|
and `actions` is caller JSX this component cannot size, so any
|
|
182
182
|
increase here breaks it. Both are centred in a 56px bar, which
|
|
183
183
|
is why 8px of difference does not show. */}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
{/* ⚠️ `min-w-0 overflow-x-auto` around the tab strip, and `shrink-0`
|
|
185
|
+
on the actions. Without them the row is a non-wrapping flex line
|
|
186
|
+
whose items refuse to shrink below their `whitespace-nowrap`
|
|
187
|
+
min-content width, while the ancestor two levels up is
|
|
188
|
+
`overflow-hidden` (deliberately, see the comment above it) and
|
|
189
|
+
this row is `overflow-x: visible`. Everything past the right edge
|
|
190
|
+
was therefore CLIPPED, with no scrollbar and no way to reach it.
|
|
191
|
+
|
|
192
|
+
Measured on the epic view at 411x845: the row was 409 wide with a
|
|
193
|
+
648 scrollWidth, and `Folios`, `Edit` and `Begin the Epic` - the
|
|
194
|
+
page's primary action - were all off-screen and unclickable. 768px
|
|
195
|
+
was worse, not better, because the 288px aside returns at `md`.
|
|
196
|
+
|
|
197
|
+
The two classes split the row's shortfall deliberately. The tab
|
|
198
|
+
strip is a bounded list this component owns, so it takes the
|
|
199
|
+
scrolling; the actions are caller JSX this component cannot size
|
|
200
|
+
(as the comment above already says), so they keep their full width
|
|
201
|
+
and stay clickable. A tab strip that scrolls is a known phone
|
|
202
|
+
pattern; a primary action hidden behind a scroll is not.
|
|
203
|
+
|
|
204
|
+
The `no-scrollbar` class used elsewhere in this package is not
|
|
205
|
+
defined anywhere in the repo, so the thin scrollbar shows - which
|
|
206
|
+
is the affordance saying there is more to the right.
|
|
207
|
+
|
|
208
|
+
`py-1` is not spacing: `overflow-x: auto` makes the computed
|
|
209
|
+
`overflow-y` `auto` too, and without 4px of slack the segment's
|
|
210
|
+
3px focus ring is clipped top and bottom. The row is
|
|
211
|
+
`items-center` in a fixed 56px bar, so it costs no height. */}
|
|
212
|
+
<div className="min-w-0 overflow-x-auto py-1">
|
|
213
|
+
<Segmented
|
|
214
|
+
size="lg"
|
|
215
|
+
options={options}
|
|
216
|
+
value={props.tab}
|
|
217
|
+
onChange={props.onTabChange}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
190
220
|
{props.actions ? (
|
|
191
|
-
<div className="ml-auto flex items-center gap-2">
|
|
221
|
+
<div className="ml-auto flex shrink-0 items-center gap-2">
|
|
192
222
|
{props.actions}
|
|
193
223
|
</div>
|
|
194
224
|
) : null}
|