@alepha/ui 0.28.0 → 0.29.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/README.md +31 -2
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +4 -1
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
- package/dist/components/account/account-delete-dialog.js +12 -15
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- package/dist/components/account/account-keys.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +22 -28
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.js +1 -4
- package/dist/components/account/account-mfa-dialog.js.map +1 -1
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +11 -14
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.js +3 -2
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router-options.d.ts +38 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -1
- package/dist/components/account/account-router-options.js.map +1 -1
- package/dist/components/account/account-router-page.d.ts +11 -1
- package/dist/components/account/account-router-page.d.ts.map +1 -1
- package/dist/components/account/account-router-page.js +11 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +11 -0
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +16 -5
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +91 -34
- 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 +6 -17
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +39 -8
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts +19 -0
- package/dist/components/admin/admin-jobs-payload-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js +33 -0
- package/dist/components/admin/admin-jobs-payload-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +5 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-notifications-channel-label.d.ts +14 -0
- package/dist/components/admin/admin-notifications-channel-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-channel-label.js +26 -0
- package/dist/components/admin/admin-notifications-channel-label.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications-preview-body.js +23 -13
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +11 -12
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +9 -7
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +12 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -1
- package/dist/components/admin/admin-router-options.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +5 -8
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +6 -29
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +9 -7
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js +5 -4
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js +7 -5
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.js +3 -2
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
- package/dist/components/admin/admin-users.d.ts.map +1 -1
- package/dist/components/admin/admin-users.js +6 -4
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/analytics/AnalyticsChartBars.js +2 -1
- package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +3 -2
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/alepha-table/alepha-table-bulk-menu.js +2 -1
- package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -1
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts +60 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js +88 -0
- package/dist/components/alepha-table/alepha-table-filter-dialog.js.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts +35 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js +54 -0
- package/dist/components/alepha-table/alepha-table-filter-menu.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +188 -3
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +551 -162
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/query-filters.d.ts +73 -0
- package/dist/components/alepha-table/query-filters.d.ts.map +1 -0
- package/dist/components/alepha-table/query-filters.js +118 -0
- package/dist/components/alepha-table/query-filters.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +21 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -1
- package/dist/components/app-actions/app-actions.js +11 -5
- package/dist/components/app-actions/app-actions.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +45 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +119 -16
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-register.js +31 -30
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +68 -30
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +39 -8
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-inbox/button-inbox.d.ts +66 -0
- package/dist/components/button-inbox/button-inbox.d.ts.map +1 -0
- package/dist/components/button-inbox/button-inbox.js +167 -0
- package/dist/components/button-inbox/button-inbox.js.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts +22 -0
- package/dist/components/button-inbox/inbox-unread-atom.d.ts.map +1 -0
- package/dist/components/button-inbox/inbox-unread-atom.js +29 -0
- package/dist/components/button-inbox/inbox-unread-atom.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +4 -3
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +8 -25
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +19 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +1 -1
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/control/control.d.ts +51 -0
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +49 -5
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.js +2 -1
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +27 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +15 -19
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-date/date-only.d.ts +18 -0
- package/dist/components/control-date/date-only.d.ts.map +1 -0
- package/dist/components/control-date/date-only.js +29 -0
- package/dist/components/control-date/date-only.js.map +1 -0
- package/dist/components/control-date-range/control-date-range.d.ts +56 -0
- package/dist/components/control-date-range/control-date-range.d.ts.map +1 -0
- package/dist/components/control-date-range/control-date-range.js +148 -0
- package/dist/components/control-date-range/control-date-range.js.map +1 -0
- package/dist/components/control-object/control-object.js +2 -1
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +177 -37
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +1 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts.map +1 -1
- package/dist/components/detail/detail-aside.js +4 -3
- package/dist/components/detail/detail-aside.js.map +1 -1
- package/dist/components/file-image/file-image.js +2 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/markdown-view/SpoilerSpan.d.ts +28 -0
- package/dist/components/markdown-view/SpoilerSpan.d.ts.map +1 -0
- package/dist/components/markdown-view/SpoilerSpan.js +53 -0
- package/dist/components/markdown-view/SpoilerSpan.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +13 -23
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -1
- package/dist/components/markdown-view/diagram/textMetrics.js +2 -2
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -1
- package/dist/components/markdown-view/markdown-view.css +44 -0
- package/dist/components/markdown-view/markdown-view.d.ts +12 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +22 -1
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/markdown-view/remarkSpoiler.d.ts +17 -0
- package/dist/components/markdown-view/remarkSpoiler.d.ts.map +1 -0
- package/dist/components/markdown-view/remarkSpoiler.js +117 -0
- package/dist/components/markdown-view/remarkSpoiler.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts +34 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js +109 -0
- package/dist/components/permission-matrix/permission-matrix-group-rows.js.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts +145 -0
- package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
- package/dist/components/permission-matrix/permission-matrix.js +113 -0
- package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
- package/dist/components/plate-layout/plate-layout.d.ts +5 -0
- package/dist/components/plate-layout/plate-layout.d.ts.map +1 -1
- package/dist/components/plate-layout/plate-layout.js +2 -1
- package/dist/components/plate-layout/plate-layout.js.map +1 -1
- package/dist/components/plate-layout/plate-tab-bar.d.ts +10 -0
- package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -1
- package/dist/components/plate-layout/plate-tab-bar.js +1 -1
- package/dist/components/plate-layout/plate-tab-bar.js.map +1 -1
- package/dist/components/settings/settings-nav.js +2 -1
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/time-ago/time-ago.d.ts +57 -0
- package/dist/components/time-ago/time-ago.d.ts.map +1 -0
- package/dist/components/time-ago/time-ago.js +60 -0
- package/dist/components/time-ago/time-ago.js.map +1 -0
- package/dist/components/tree-view/tree-model.d.ts +128 -0
- package/dist/components/tree-view/tree-model.d.ts.map +1 -0
- package/dist/components/tree-view/tree-model.js +226 -0
- package/dist/components/tree-view/tree-model.js.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts +31 -0
- package/dist/components/tree-view/tree-view-rename-input.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-rename-input.js +68 -0
- package/dist/components/tree-view/tree-view-rename-input.js.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts +38 -0
- package/dist/components/tree-view/tree-view-resizer.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-resizer.js +73 -0
- package/dist/components/tree-view/tree-view-resizer.js.map +1 -0
- package/dist/components/tree-view/tree-view-row.d.ts +177 -0
- package/dist/components/tree-view/tree-view-row.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view-row.js +241 -0
- package/dist/components/tree-view/tree-view-row.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +186 -0
- package/dist/components/tree-view/tree-view.d.ts.map +1 -0
- package/dist/components/tree-view/tree-view.js +112 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/components/tree-view/use-tree-state.d.ts +79 -0
- package/dist/components/tree-view/use-tree-state.d.ts.map +1 -0
- package/dist/components/tree-view/use-tree-state.js +93 -0
- package/dist/components/tree-view/use-tree-state.js.map +1 -0
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/select.d.ts +7 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +7 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +31 -47
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/lib/utils.d.ts +22 -2
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -5
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles.css +255 -0
- package/package.json +13 -14
- package/src/components/account/__tests__/account-router.spec.ts +95 -0
- package/src/components/account/account-connections.tsx +14 -1
- package/src/components/account/account-delete-dialog.tsx +3 -2
- package/src/components/account/account-keys.tsx +11 -4
- package/src/components/account/account-mfa-dialog.tsx +1 -1
- package/src/components/account/account-password-dialog.tsx +3 -2
- package/src/components/account/account-profile.tsx +1 -1
- package/src/components/account/account-router-options.tsx +45 -0
- package/src/components/account/account-router-page.tsx +11 -1
- package/src/components/account/account-router.tsx +23 -6
- package/src/components/admin/__tests__/admin-jobs-payload-dialog.browser.spec.tsx +68 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +20 -4
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +0 -31
- package/src/components/admin/admin-audits.tsx +99 -5
- package/src/components/admin/admin-files.tsx +7 -16
- package/src/components/admin/admin-jobs-executions-panel.tsx +152 -114
- package/src/components/admin/admin-jobs-payload-dialog.tsx +57 -0
- package/src/components/admin/admin-keys.tsx +7 -4
- package/src/components/admin/admin-notifications-channel-label.ts +18 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +7 -2
- package/src/components/admin/admin-notifications.tsx +19 -8
- package/src/components/admin/admin-payments.tsx +7 -4
- package/src/components/admin/admin-router-options.tsx +12 -0
- package/src/components/admin/admin-router.tsx +5 -27
- package/src/components/admin/admin-sessions.tsx +10 -6
- package/src/components/admin/admin-user-detail-audits-tab.tsx +7 -4
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +7 -4
- package/src/components/admin/admin-users-roles-picker.tsx +4 -0
- package/src/components/admin/admin-users.tsx +6 -3
- package/src/components/admin/parameter-history-item.tsx +4 -2
- package/src/components/alepha-table/__tests__/alepha-table-default-hidden.browser.spec.tsx +108 -0
- package/src/components/alepha-table/__tests__/alepha-table-empty-state.browser.spec.tsx +233 -0
- package/src/components/alepha-table/__tests__/alepha-table-persist-facets.browser.spec.tsx +177 -0
- package/src/components/alepha-table/__tests__/alepha-table-persisted-filters.browser.spec.tsx +182 -0
- package/src/components/alepha-table/__tests__/alepha-table-query-seed.browser.spec.tsx +170 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-checked.browser.spec.tsx +210 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-action-group.browser.spec.tsx +202 -0
- package/src/components/alepha-table/__tests__/alepha-table-scope.browser.spec.tsx +161 -0
- package/src/components/alepha-table/__tests__/alepha-table-share-filters.browser.spec.tsx +309 -0
- package/src/components/alepha-table/__tests__/query-filters.spec.ts +212 -0
- package/src/components/alepha-table/alepha-table-filter-dialog.tsx +162 -0
- package/src/components/alepha-table/alepha-table-filter-menu.tsx +77 -0
- package/src/components/alepha-table/alepha-table.tsx +1113 -207
- package/src/components/alepha-table/query-filters.ts +159 -0
- package/src/components/app-actions/app-actions.tsx +32 -3
- package/src/components/app-shell/__tests__/sidebar-nav-accordion.browser.spec.tsx +163 -0
- package/src/components/app-shell/app-shell.tsx +255 -12
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -1
- package/src/components/auto-form/auto-form.tsx +98 -30
- package/src/components/button-dark/button-dark.tsx +47 -8
- package/src/components/button-inbox/__tests__/button-inbox.browser.spec.tsx +247 -0
- package/src/components/button-inbox/button-inbox.tsx +303 -0
- package/src/components/button-inbox/inbox-unread-atom.ts +27 -0
- package/src/components/button-theme/button-theme.tsx +16 -29
- package/src/components/button-user/__tests__/button-user-avatar.browser.spec.tsx +88 -0
- package/src/components/button-user/button-user.tsx +24 -1
- package/src/components/control/__tests__/control-date-range.browser.spec.tsx +177 -0
- package/src/components/control/control.tsx +119 -12
- package/src/components/control-date/control-date.tsx +117 -22
- package/src/components/control-date/date-only.ts +26 -0
- package/src/components/control-date-range/control-date-range.tsx +250 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +129 -15
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +27 -6
- package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +204 -1
- package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +77 -1
- package/src/components/control-select/control-select.tsx +317 -83
- package/src/components/control-upload/control-upload.tsx +1 -10
- package/src/components/detail/detail-aside.tsx +30 -6
- package/src/components/markdown-view/SpoilerSpan.tsx +66 -0
- package/src/components/markdown-view/__tests__/markdown-view-spoiler.browser.spec.tsx +165 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +1 -1
- package/src/components/markdown-view/diagram/textMetrics.ts +2 -2
- package/src/components/markdown-view/markdown-view.css +44 -0
- package/src/components/markdown-view/markdown-view.tsx +37 -1
- package/src/components/markdown-view/remarkSpoiler.ts +150 -0
- package/src/components/permission-matrix/__tests__/permission-matrix.browser.spec.tsx +237 -0
- package/src/components/permission-matrix/permission-matrix-group-rows.tsx +240 -0
- package/src/components/permission-matrix/permission-matrix.tsx +286 -0
- package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +22 -0
- package/src/components/plate-layout/plate-layout.tsx +6 -0
- package/src/components/plate-layout/plate-tab-bar.tsx +27 -1
- package/src/components/time-ago/time-ago.browser.spec.tsx +110 -0
- package/src/components/time-ago/time-ago.tsx +80 -0
- package/src/components/tree-view/__tests__/tree-model.spec.ts +441 -0
- package/src/components/tree-view/__tests__/tree-view-drag.browser.spec.tsx +295 -0
- package/src/components/tree-view/__tests__/tree-view-rename.browser.spec.tsx +278 -0
- package/src/components/tree-view/__tests__/tree-view-resizer.browser.spec.tsx +112 -0
- package/src/components/tree-view/__tests__/tree-view.browser.spec.tsx +260 -0
- package/src/components/tree-view/__tests__/use-tree-state.browser.spec.tsx +238 -0
- package/src/components/tree-view/tree-model.ts +369 -0
- package/src/components/tree-view/tree-view-rename-input.tsx +95 -0
- package/src/components/tree-view/tree-view-resizer.tsx +83 -0
- package/src/components/tree-view/tree-view-row.tsx +414 -0
- package/src/components/tree-view/tree-view.tsx +300 -0
- package/src/components/tree-view/use-tree-state.ts +184 -0
- package/src/components/ui/button.tsx +79 -1
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/select.tsx +7 -0
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/lib/i18n-fr.ts +34 -51
- package/src/lib/utils.ts +32 -4
- package/src/styles.css +255 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +0 -11
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +0 -190
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +0 -9
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +0 -121
- package/dist/components/admin/admin-workflows-executions-panel.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +0 -12
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-badge.js +0 -30
- package/dist/components/admin/admin-workflows-status-badge.js.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +0 -19
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows-status-labels.js +0 -48
- package/dist/components/admin/admin-workflows-status-labels.js.map +0 -1
- package/dist/components/admin/admin-workflows.d.ts +0 -4
- package/dist/components/admin/admin-workflows.d.ts.map +0 -1
- package/dist/components/admin/admin-workflows.js +0 -145
- package/dist/components/admin/admin-workflows.js.map +0 -1
- package/src/components/admin/admin-workflows-execution-sheet.tsx +0 -285
- package/src/components/admin/admin-workflows-executions-panel.tsx +0 -169
- package/src/components/admin/admin-workflows-status-badge.tsx +0 -41
- package/src/components/admin/admin-workflows-status-labels.ts +0 -51
- package/src/components/admin/admin-workflows.tsx +0 -209
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
useFormState,
|
|
25
25
|
} from "alepha/react/form";
|
|
26
26
|
import { useI18n } from "alepha/react/i18n";
|
|
27
|
-
import { ListChecks, Loader2 } from "lucide-react";
|
|
27
|
+
import { ListChecks, Loader2, X } from "lucide-react";
|
|
28
28
|
import type { HTMLAttributes } from "react";
|
|
29
29
|
import { type ReactNode, useMemo, useRef, useState } from "react";
|
|
30
30
|
|
|
@@ -67,33 +67,72 @@ export type ControlSelectSize = "xs" | "sm" | "default";
|
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Per-size trigger geometry. Kept as one table rather than scattered
|
|
70
|
-
* conditionals so a new size is one row and the
|
|
70
|
+
* conditionals so a new size is one row and the axes cannot drift.
|
|
71
71
|
*
|
|
72
72
|
* `chevron` targets the trigger's own last SVG - the one `ComboboxTrigger`
|
|
73
73
|
* appends at a hardcoded `size-4`. That file is stock shadcn, refreshed
|
|
74
74
|
* wholesale by `yarn sync`, so it is sized from here rather than edited.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ `clear` and `clearGap` are in this table for the reason feedback #2113
|
|
77
|
+
* exists: they used to be the constants `right-8` and `mr-6`, tuned for the
|
|
78
|
+
* default size. `right-8` is the default's right padding (8px) plus its
|
|
79
|
+
* chevron (16px) plus a gap, so at `sm` and `xs` - where both shrink - the
|
|
80
|
+
* `x` stayed 32px from the edge while the chevron moved left, and it landed
|
|
81
|
+
* on the value. Anything positioned against the chevron belongs beside the
|
|
82
|
+
* chevron's own size.
|
|
83
|
+
*
|
|
84
|
+
* - `clear` is the button's offset from the trigger's right edge.
|
|
85
|
+
* - `clearGap` is the margin that stops the LABEL running under it. On the
|
|
86
|
+
* label rather than in the trigger's padding: the chevron is the trigger's
|
|
87
|
+
* last flex child under `justify-between`, so padding the trigger walks
|
|
88
|
+
* the chevron inwards and leaves the button hanging off its right.
|
|
75
89
|
*/
|
|
76
90
|
const SIZE_CLASSES: Record<
|
|
77
91
|
ControlSelectSize,
|
|
78
|
-
{
|
|
92
|
+
{
|
|
93
|
+
trigger: string;
|
|
94
|
+
icon: string;
|
|
95
|
+
chevron: string;
|
|
96
|
+
clear: string;
|
|
97
|
+
clearGap: string;
|
|
98
|
+
}
|
|
79
99
|
> = {
|
|
80
100
|
default: {
|
|
81
101
|
trigger: "h-8 gap-1.5 py-2 pr-2 pl-2.5 text-sm",
|
|
82
102
|
icon: "size-4",
|
|
83
103
|
chevron: "[&>svg]:size-4",
|
|
104
|
+
clear: "right-8",
|
|
105
|
+
clearGap: "mr-6",
|
|
84
106
|
},
|
|
85
107
|
sm: {
|
|
86
108
|
trigger: "h-7 gap-1.5 py-1 pr-1.5 pl-2 text-sm",
|
|
87
109
|
icon: "size-3.5",
|
|
88
110
|
chevron: "[&>svg]:size-3.5",
|
|
111
|
+
clear: "right-7",
|
|
112
|
+
clearGap: "mr-5",
|
|
89
113
|
},
|
|
90
114
|
xs: {
|
|
91
115
|
trigger: "h-6 gap-1 px-1 text-xs",
|
|
92
116
|
icon: "size-3",
|
|
93
117
|
chevron: "[&>svg]:size-3",
|
|
118
|
+
clear: "right-5",
|
|
119
|
+
clearGap: "mr-4",
|
|
94
120
|
},
|
|
95
121
|
};
|
|
96
122
|
|
|
123
|
+
/**
|
|
124
|
+
* What `minimal` does to the clear button's offset.
|
|
125
|
+
*
|
|
126
|
+
* `MINIMAL_CLASSES` carries `-mx-1`, so the trigger's right edge sits 4px
|
|
127
|
+
* PAST the wrapper the button is positioned against, taking the chevron with
|
|
128
|
+
* it. The button has to follow by the same 4px or it drifts left of where it
|
|
129
|
+
* belongs - a second copy of the bug this quest is about, one variant down.
|
|
130
|
+
*
|
|
131
|
+
* A translate rather than a second `right-*` per size, so the table stays one
|
|
132
|
+
* number per size and this stays one rule.
|
|
133
|
+
*/
|
|
134
|
+
const MINIMAL_CLEAR_SHIFT = "translate-x-1";
|
|
135
|
+
|
|
97
136
|
/**
|
|
98
137
|
* The bordered box, or nothing at all.
|
|
99
138
|
*
|
|
@@ -247,13 +286,6 @@ export interface ControlSelectProps {
|
|
|
247
286
|
icon?: IconComponent;
|
|
248
287
|
}
|
|
249
288
|
|
|
250
|
-
/**
|
|
251
|
-
* Internal sentinel for the `clearable` row. Picked to be unlikely to
|
|
252
|
-
* collide with a real option value; we translate it to `undefined` at
|
|
253
|
-
* the boundary so callers never see it.
|
|
254
|
-
*/
|
|
255
|
-
const CLEAR_VALUE = "__alepha_clear__";
|
|
256
|
-
|
|
257
289
|
/**
|
|
258
290
|
* Internal sentinel for the "select every match" row. Same reasoning as
|
|
259
291
|
* `CLEAR_VALUE`: it never reaches a caller, because it is expanded into the
|
|
@@ -288,8 +320,29 @@ const optIcon = (o: SelectOption): ReactNode =>
|
|
|
288
320
|
*/
|
|
289
321
|
const titlecase = (s: string) =>
|
|
290
322
|
s.replace(/[_-]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
291
|
-
|
|
292
|
-
|
|
323
|
+
/**
|
|
324
|
+
* What one segment shows.
|
|
325
|
+
*
|
|
326
|
+
* ⚠️ The option's `icon` is rendered HERE rather than dropped, which is what
|
|
327
|
+
* this path did until #Q2049. `SegmentedOption.label` is a `ReactNode`, so
|
|
328
|
+
* there was never a reason for it: an option list carrying icons for the
|
|
329
|
+
* dropdown carried them for the segments too, and dropping them silently
|
|
330
|
+
* made a caller choose between two shapes for one list.
|
|
331
|
+
*/
|
|
332
|
+
const segmentedLabel = (o: SelectOption): ReactNode => {
|
|
333
|
+
if (typeof o === "string") {
|
|
334
|
+
return titlecase(o);
|
|
335
|
+
}
|
|
336
|
+
if (!o.icon) {
|
|
337
|
+
return o.label;
|
|
338
|
+
}
|
|
339
|
+
return (
|
|
340
|
+
<span className="inline-flex items-center gap-1.5">
|
|
341
|
+
{o.icon}
|
|
342
|
+
{o.label}
|
|
343
|
+
</span>
|
|
344
|
+
);
|
|
345
|
+
};
|
|
293
346
|
|
|
294
347
|
export const ControlSelect = (props: ControlSelectProps) => {
|
|
295
348
|
const { tr } = useI18n();
|
|
@@ -335,7 +388,26 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
335
388
|
// Labels and `disabled` flags are part of the identity: keying on the
|
|
336
389
|
// joined values alone collided (`["ab","c"]` vs `["a","bc"]`) and kept a
|
|
337
390
|
// stale list when only the labels changed.
|
|
338
|
-
|
|
391
|
+
//
|
|
392
|
+
// ⚠️ `icon` is EXCLUDED, and it has to be. It is a `ReactNode`, and a
|
|
393
|
+
// rendered element holds a fiber that points back at its DOM node, so
|
|
394
|
+
// `JSON.stringify` on the raw option threw "Converting circular structure
|
|
395
|
+
// to JSON" - a documented prop that crashed the component the first time
|
|
396
|
+
// anyone used it (#Q2049). Two lists that differ only by icon share a key,
|
|
397
|
+
// which is right: the key exists to notice a changed VALUE or LABEL.
|
|
398
|
+
const enumKey = JSON.stringify(
|
|
399
|
+
enumValues.map((option) =>
|
|
400
|
+
typeof option === "string"
|
|
401
|
+
? option
|
|
402
|
+
: {
|
|
403
|
+
value: option.value,
|
|
404
|
+
label: option.label,
|
|
405
|
+
description: option.description,
|
|
406
|
+
tag: option.tag,
|
|
407
|
+
disabled: option.disabled,
|
|
408
|
+
},
|
|
409
|
+
),
|
|
410
|
+
);
|
|
339
411
|
const min = meta.constraints.minimum;
|
|
340
412
|
const max = meta.constraints.maximum;
|
|
341
413
|
// Derived, not stored: this is a pure function of the schema. As state
|
|
@@ -514,12 +586,19 @@ interface ComboboxProps {
|
|
|
514
586
|
*/
|
|
515
587
|
placeholder?: string;
|
|
516
588
|
/**
|
|
517
|
-
*
|
|
518
|
-
*
|
|
589
|
+
* Empty is a meaningful choice for this field, so say so and offer it: the
|
|
590
|
+
* trigger shows {@link clearLabel} while nothing is selected, and carries
|
|
591
|
+
* an `x` to get back there once something is.
|
|
592
|
+
*
|
|
593
|
+
* ⚠️ It used to PREPEND A ROW saying the same thing, which is why the two
|
|
594
|
+
* names still read that way at some call sites. That row was drawn as a
|
|
595
|
+
* pickable option with a check mark, so "All states" looked like a third
|
|
596
|
+
* state rather than the absence of a filter (feedback #2098).
|
|
519
597
|
*/
|
|
520
598
|
clearable?: boolean;
|
|
521
599
|
/**
|
|
522
|
-
*
|
|
600
|
+
* What empty is called on this field (e.g. "All zones"), shown as the
|
|
601
|
+
* trigger's placeholder.
|
|
523
602
|
*/
|
|
524
603
|
clearLabel?: string;
|
|
525
604
|
/**
|
|
@@ -550,10 +629,6 @@ interface ComboOption {
|
|
|
550
629
|
* Marks the synthetic "create new" row injected by `createNewEntry`.
|
|
551
630
|
*/
|
|
552
631
|
create?: boolean;
|
|
553
|
-
/**
|
|
554
|
-
* Marks the synthetic "clear" row injected by `clearable`.
|
|
555
|
-
*/
|
|
556
|
-
clear?: boolean;
|
|
557
632
|
/**
|
|
558
633
|
* Marks the synthetic "select every match" row a multi-select offers while
|
|
559
634
|
* a query is narrowing the list.
|
|
@@ -583,7 +658,7 @@ function Combobox(props: ComboboxProps) {
|
|
|
583
658
|
// `data` set — or for freshly created entries that never existed in `data`.
|
|
584
659
|
const labelCache = useRef(new Map<string, string>());
|
|
585
660
|
|
|
586
|
-
const
|
|
661
|
+
const dataOptions: ComboOption[] = props.data.map((o) => ({
|
|
587
662
|
value: optValue(o),
|
|
588
663
|
label: optLabel(o),
|
|
589
664
|
description: optDesc(o),
|
|
@@ -604,18 +679,72 @@ function Combobox(props: ComboboxProps) {
|
|
|
604
679
|
: [];
|
|
605
680
|
|
|
606
681
|
const labelFor = (val: string) =>
|
|
607
|
-
|
|
682
|
+
dataOptions.find((o) => o.value === val)?.label ??
|
|
608
683
|
labelCache.current.get(val) ??
|
|
609
684
|
val;
|
|
610
685
|
|
|
686
|
+
/**
|
|
687
|
+
* Rows for values that are selected and have no option to be selected FROM.
|
|
688
|
+
*
|
|
689
|
+
* ⚠️ Without these the popup lists strictly `props.data`, so a selected
|
|
690
|
+
* value absent from it is counted by the trigger, ticked nowhere, and
|
|
691
|
+
* **cannot be deselected from the list it is missing from** (feedback
|
|
692
|
+
* #2115). Two ways in, and the component was already half-aware of both -
|
|
693
|
+
* `labelCache` exists for exactly these values and says so:
|
|
694
|
+
*
|
|
695
|
+
* - **`createNewEntry`.** A created entry never existed in `data`, and the
|
|
696
|
+
* caller usually cannot add it: the common declaration is a static
|
|
697
|
+
* `items: [...]` inside a zod `.meta({ $control })`, which has no state
|
|
698
|
+
* to append to, and `useForm` anchors its schema at mount anyway. So the
|
|
699
|
+
* feature was broken by construction for every such caller rather than
|
|
700
|
+
* missing in one demo page.
|
|
701
|
+
* - **`onSearch` / server mode.** The upstream query narrows `data`, so
|
|
702
|
+
* picking A and then typing something that excludes it takes A's row away
|
|
703
|
+
* while the trigger still counts it.
|
|
704
|
+
*
|
|
705
|
+
* Labelled through `labelFor`, which is why the cache is read there and not
|
|
706
|
+
* here: a created value's label is whatever was typed, and a server-dropped
|
|
707
|
+
* one's is whatever it had when it was picked.
|
|
708
|
+
*
|
|
709
|
+
* **Pinned above the real options**, rather than interleaved: a created
|
|
710
|
+
* value has no place in the source list's order, and inventing one would
|
|
711
|
+
* imply an ordering `data` does not have.
|
|
712
|
+
*/
|
|
713
|
+
const orphans: ComboOption[] = selected
|
|
714
|
+
.filter((val) => !dataOptions.some((o) => o.value === val))
|
|
715
|
+
.map((val) => ({ value: val, label: labelFor(val) }));
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* What the popup may show: the orphans, then `props.data`.
|
|
719
|
+
*
|
|
720
|
+
* ⚠️ The injection is here rather than in `filtered`, and that is what makes
|
|
721
|
+
* `showCreate` stop offering a Create row for a value that has already been
|
|
722
|
+
* created - its guard reads `options`.
|
|
723
|
+
*/
|
|
724
|
+
const options: ComboOption[] = orphans.length
|
|
725
|
+
? [...orphans, ...dataOptions]
|
|
726
|
+
: dataOptions;
|
|
727
|
+
|
|
611
728
|
// Server mode (`onSearch`) filters upstream; for static lists we filter on
|
|
612
729
|
// the visible label — never the value/id (that was the cmdk bug).
|
|
613
730
|
const serverMode = Boolean(props.onSearch);
|
|
614
731
|
const q = query.trim().toLowerCase();
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
732
|
+
const matchesQuery = (o: ComboOption) => o.label.toLowerCase().includes(q);
|
|
733
|
+
|
|
734
|
+
// ⚠️ An orphan is filtered by the typed query like any other row, which is a
|
|
735
|
+
// DECISION rather than an accident of where the injection happens: a search
|
|
736
|
+
// that kept showing rows it did not match would stop being a search. With an
|
|
737
|
+
// empty query every orphan is shown, which is the case that matters - it is
|
|
738
|
+
// how a created value is deselected.
|
|
739
|
+
//
|
|
740
|
+
// And it is filtered HERE even in server mode. The server narrowed `data`
|
|
741
|
+
// and knows nothing about a row this component invented, so leaving orphans
|
|
742
|
+
// out of the local pass would make the same typed query mean two different
|
|
743
|
+
// things in one list.
|
|
744
|
+
const filtered = [
|
|
745
|
+
...(q ? orphans.filter(matchesQuery) : orphans),
|
|
746
|
+
...(serverMode || !q ? dataOptions : dataOptions.filter(matchesQuery)),
|
|
747
|
+
];
|
|
619
748
|
|
|
620
749
|
const showCreate =
|
|
621
750
|
Boolean(props.createNewEntry) &&
|
|
@@ -638,20 +767,22 @@ function Combobox(props: ComboboxProps) {
|
|
|
638
767
|
})()
|
|
639
768
|
: undefined;
|
|
640
769
|
|
|
641
|
-
//
|
|
642
|
-
//
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
//
|
|
653
|
-
//
|
|
654
|
-
|
|
770
|
+
// ⚠️ There is no synthetic "no selection" ROW any more.
|
|
771
|
+
//
|
|
772
|
+
// A `clearable` single-select used to inject one - "All states", "Everyone",
|
|
773
|
+
// "All sigils" - at the top of its list. It said the same thing the trigger
|
|
774
|
+
// already says when the field is empty, a second time, as a pickable option
|
|
775
|
+
// carrying a check mark, so "all" read as a third state a release could be
|
|
776
|
+
// in rather than as the absence of a filter (feedback #2092, then #2098).
|
|
777
|
+
//
|
|
778
|
+
// The empty state is now expressed ONCE, on the trigger, via `clearLabel`
|
|
779
|
+
// as its placeholder. Clearing a chosen value is re-clicking it, which
|
|
780
|
+
// `deselectable` already implements and
|
|
781
|
+
// `control-select-deselect.browser.spec.tsx` already covers.
|
|
782
|
+
//
|
|
783
|
+
// `clearable` therefore no longer adds a row. It still means "this field
|
|
784
|
+
// may be empty": it is what puts `clearLabel` on the trigger and what makes
|
|
785
|
+
// a REQUIRED field deselectable.
|
|
655
786
|
|
|
656
787
|
/**
|
|
657
788
|
* "Select every match" — the row that makes a typed prefix a filter clause
|
|
@@ -692,7 +823,6 @@ function Combobox(props: ComboboxProps) {
|
|
|
692
823
|
: undefined;
|
|
693
824
|
|
|
694
825
|
const items: ComboOption[] = [
|
|
695
|
-
...(showClear && clearRow ? [clearRow] : []),
|
|
696
826
|
...(selectAllRow ? [selectAllRow] : []),
|
|
697
827
|
...filtered,
|
|
698
828
|
...(createOption ? [createOption] : []),
|
|
@@ -711,9 +841,10 @@ function Combobox(props: ComboboxProps) {
|
|
|
711
841
|
? selected.map(toValueObject)
|
|
712
842
|
: selected[0]
|
|
713
843
|
? toValueObject(selected[0])
|
|
714
|
-
: // Empty
|
|
715
|
-
//
|
|
716
|
-
|
|
844
|
+
: // Empty is EMPTY. It used to resolve to the clear row so that row
|
|
845
|
+
// carried a check mark; with no such row, nothing is selected and the
|
|
846
|
+
// trigger shows `clearLabel` as its placeholder.
|
|
847
|
+
null;
|
|
717
848
|
|
|
718
849
|
const remember = (o: ComboOption) => {
|
|
719
850
|
if (o.create) labelCache.current.set(o.value, o.query ?? o.value);
|
|
@@ -721,7 +852,11 @@ function Combobox(props: ComboboxProps) {
|
|
|
721
852
|
};
|
|
722
853
|
|
|
723
854
|
const handleSingle = (o: ComboOption | null) => {
|
|
724
|
-
|
|
855
|
+
// `null` still arrives from Base UI's own clearing paths (Escape on an
|
|
856
|
+
// open popup, a controlled reset). There is no longer a synthetic clear
|
|
857
|
+
// ROW that could arrive here as an option - the label lives on the
|
|
858
|
+
// trigger and nowhere else since feedback #2098.
|
|
859
|
+
if (!o) {
|
|
725
860
|
props.onChange(undefined);
|
|
726
861
|
setQuery("");
|
|
727
862
|
return;
|
|
@@ -787,6 +922,58 @@ function Combobox(props: ComboboxProps) {
|
|
|
787
922
|
? labelFor(selected[0])
|
|
788
923
|
: emptyLabel;
|
|
789
924
|
|
|
925
|
+
/**
|
|
926
|
+
* The `x` that puts a `clearable` field back to empty in one click.
|
|
927
|
+
*
|
|
928
|
+
* ⚠️ This is the affordance the injected clear ROW used to be, moved to
|
|
929
|
+
* where it belongs (feedback #2098). Deleting the row made the empty state
|
|
930
|
+
* a placeholder rather than a third pickable value, which is what the
|
|
931
|
+
* report asked for.
|
|
932
|
+
*
|
|
933
|
+
* ## Why the `x` and not the row, stated properly
|
|
934
|
+
*
|
|
935
|
+
* An earlier version of this comment said the `x` had to exist because
|
|
936
|
+
* `epics.spec.ts` went red when the row was deleted. **That was circular
|
|
937
|
+
* and is corrected here.** The spec went red because its SELECTOR named a
|
|
938
|
+
* node that no longer existed; the fix could equally have been one line
|
|
939
|
+
* re-clicking the selected release. A broken locator is not a usability
|
|
940
|
+
* finding.
|
|
941
|
+
*
|
|
942
|
+
* The real reasons, none of which that argument gave:
|
|
943
|
+
*
|
|
944
|
+
* - **Re-click-to-deselect is counter-conventional, not merely quiet.** In
|
|
945
|
+
* a native `select`, and in almost every combobox people use daily,
|
|
946
|
+
* clicking the chosen option confirms and closes. No learned model says
|
|
947
|
+
* it removes the value, so it is neither discovered by accident nor
|
|
948
|
+
* retained after being shown once.
|
|
949
|
+
* - **"Reset filters" is not a fallback.** It is all or nothing. With
|
|
950
|
+
* status, area and release all set, dropping just the release is a
|
|
951
|
+
* different intent, and `AlephaTable`'s menu has no per-filter escape.
|
|
952
|
+
* - **It costs nothing at rest**, since `showClear` needs a selection.
|
|
953
|
+
*
|
|
954
|
+
* ## No row comes back, at any size
|
|
955
|
+
*
|
|
956
|
+
* Feedback #2113 proposed a `None` row for `minimal`/`xs`, and the owner
|
|
957
|
+
* dropped it the same day: this control had already been changed twice in
|
|
958
|
+
* opposite directions, and keeping the row out leaves that sweep intact.
|
|
959
|
+
* The `x` is the one answer everywhere it is drawn.
|
|
960
|
+
*
|
|
961
|
+
* ## `clearable`, not `deselectable`
|
|
962
|
+
*
|
|
963
|
+
* `deselectable` is `clearable || !meta.required`, so a large set of
|
|
964
|
+
* optional fields accept re-click-to-clear and show no `x`: the component
|
|
965
|
+
* holds both positions at once, that re-click suffices there and not here.
|
|
966
|
+
*
|
|
967
|
+
* That is a judgment call rather than a principle, and it is deliberate:
|
|
968
|
+
* `clearable` is the caller saying empty is a meaningful state worth
|
|
969
|
+
* ADVERTISING, so an ordinary optional field in a form keeps the trigger it
|
|
970
|
+
* has today rather than growing a control for a state nobody is looking
|
|
971
|
+
* for. Written down because it was previously undocumented, and an
|
|
972
|
+
* undocumented asymmetry reads as an oversight to whoever finds it next.
|
|
973
|
+
*/
|
|
974
|
+
const showClear =
|
|
975
|
+
Boolean(props.clearable) && selected.length > 0 && !props.disabled;
|
|
976
|
+
|
|
790
977
|
// The list (loading / empty / items) is identical for single and multi, and
|
|
791
978
|
// so is the trigger now, so render it once.
|
|
792
979
|
const popupBody = props.loading ? (
|
|
@@ -875,45 +1062,92 @@ function Combobox(props: ComboboxProps) {
|
|
|
875
1062
|
{/* One trigger for single AND multi. Multi used to render a bordered
|
|
876
1063
|
chips box instead, which made it a different-looking control for the
|
|
877
1064
|
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
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
props.
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
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)}
|
|
912
|
-
/>
|
|
1065
|
+
the chips input was the only way to open the popup.
|
|
1066
|
+
|
|
1067
|
+
Wrapped so the clear button below can sit ON the trigger without
|
|
1068
|
+
being INSIDE it: a button nested in a button is invalid, and Base
|
|
1069
|
+
UI renders this trigger as a real `<button>`. */}
|
|
1070
|
+
<div className="relative w-full">
|
|
1071
|
+
<ComboboxTrigger
|
|
1072
|
+
id={props.id}
|
|
1073
|
+
disabled={props.disabled}
|
|
1074
|
+
{...props.triggerProps}
|
|
1075
|
+
className={cn(
|
|
1076
|
+
"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",
|
|
1077
|
+
sizeClasses.trigger,
|
|
1078
|
+
sizeClasses.chevron,
|
|
1079
|
+
props.minimal && MINIMAL_CLASSES,
|
|
1080
|
+
// Muted means "nothing chosen yet", and now that is simply
|
|
1081
|
+
// "nothing selected" for every shape.
|
|
1082
|
+
//
|
|
1083
|
+
// It used to carve out `clearable` singles, because for those empty
|
|
1084
|
+
// WAS a selected value - the injected clear row - and muting it made
|
|
1085
|
+
// one filter look unset while its neighbour looked set for the same
|
|
1086
|
+
// meaning. That row is gone (see `items`), so empty is empty and
|
|
1087
|
+
// reads as a placeholder everywhere.
|
|
1088
|
+
selected.length === 0 && "text-muted-foreground",
|
|
1089
|
+
props.triggerClassName,
|
|
913
1090
|
)}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1091
|
+
>
|
|
1092
|
+
{/* The room for the clear button, per size - see `clearGap` in
|
|
1093
|
+
SIZE_CLASSES for why it is a margin here and not padding on the
|
|
1094
|
+
trigger. */}
|
|
1095
|
+
<span
|
|
1096
|
+
className={cn(
|
|
1097
|
+
"flex min-w-0 items-center gap-2",
|
|
1098
|
+
showClear && sizeClasses.clearGap,
|
|
1099
|
+
)}
|
|
1100
|
+
>
|
|
1101
|
+
{props.icon && (
|
|
1102
|
+
<props.icon
|
|
1103
|
+
className={cn(
|
|
1104
|
+
"text-muted-foreground shrink-0",
|
|
1105
|
+
sizeClasses.icon,
|
|
1106
|
+
)}
|
|
1107
|
+
/>
|
|
1108
|
+
)}
|
|
1109
|
+
<span className="truncate">{triggerLabel}</span>
|
|
1110
|
+
</span>
|
|
1111
|
+
</ComboboxTrigger>
|
|
1112
|
+
{showClear && (
|
|
1113
|
+
<button
|
|
1114
|
+
type="button"
|
|
1115
|
+
aria-label={String(
|
|
1116
|
+
tr("controlSelect.clear", { default: "Clear selection" }),
|
|
1117
|
+
)}
|
|
1118
|
+
className={cn(
|
|
1119
|
+
// ⚠️ Lighter than the chevron at rest, and it sharpens when
|
|
1120
|
+
// reached for. They are not peers: the chevron is decoration,
|
|
1121
|
+
// since the whole trigger opens the popup and nobody aims at
|
|
1122
|
+
// it, while this is the only element here with its own hit
|
|
1123
|
+
// target and its own action. Two equal grey glyphs side by
|
|
1124
|
+
// side make the eye separate them every time, and on a filter
|
|
1125
|
+
// rail with three filters set that is paid three times.
|
|
1126
|
+
//
|
|
1127
|
+
// Alpha on the TEXT COLOR, deliberately, and three things this
|
|
1128
|
+
// is not:
|
|
1129
|
+
//
|
|
1130
|
+
// - not a hover reveal. It must stay visible at rest: it is
|
|
1131
|
+
// the only discoverable way to clear, there is no hover on
|
|
1132
|
+
// touch, and an element appearing under the arriving pointer
|
|
1133
|
+
// makes the control feel twitchy.
|
|
1134
|
+
// - not `opacity` on the button, which would fade the focus
|
|
1135
|
+
// ring with it and weaken the keyboard state exactly when it
|
|
1136
|
+
// needs to be strongest.
|
|
1137
|
+
// - not a background. `styles.css` defines a single muted
|
|
1138
|
+
// tier, and alpha fades toward the trigger's own surface, so
|
|
1139
|
+
// it lightens in light mode and darkens in dark with no
|
|
1140
|
+
// per-theme override.
|
|
1141
|
+
"text-muted-foreground/60 hover:text-foreground focus-visible:text-foreground focus-visible:ring-ring/50 absolute top-1/2 -translate-y-1/2 rounded p-0.5 transition-colors outline-none focus-visible:ring-2",
|
|
1142
|
+
sizeClasses.clear,
|
|
1143
|
+
props.minimal && MINIMAL_CLEAR_SHIFT,
|
|
1144
|
+
)}
|
|
1145
|
+
onClick={() => props.onChange(props.multi ? [] : undefined)}
|
|
1146
|
+
>
|
|
1147
|
+
<X className="size-3.5" />
|
|
1148
|
+
</button>
|
|
1149
|
+
)}
|
|
1150
|
+
</div>
|
|
917
1151
|
<ComboboxContent>
|
|
918
1152
|
{props.searchable && (
|
|
919
1153
|
<ComboboxInput showTrigger={false} placeholder="Search…" />
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
TooltipTrigger,
|
|
18
18
|
} from "@alepha/ui/components/ui/tooltip";
|
|
19
19
|
import { useToast } from "@alepha/ui/components/use-toast/use-toast";
|
|
20
|
+
import { formatBytes } from "@alepha/ui/lib/utils";
|
|
20
21
|
import type { FileController } from "alepha/api/files";
|
|
21
22
|
import { useClient } from "alepha/react";
|
|
22
23
|
import {
|
|
@@ -495,13 +496,3 @@ const ItemThumb = (props: { url: string; alt: string }) => {
|
|
|
495
496
|
/>
|
|
496
497
|
);
|
|
497
498
|
};
|
|
498
|
-
|
|
499
|
-
const formatBytes = (n: number): string => {
|
|
500
|
-
if (!n) return "0 B";
|
|
501
|
-
const units = ["B", "KB", "MB", "GB"];
|
|
502
|
-
const i = Math.min(
|
|
503
|
-
units.length - 1,
|
|
504
|
-
Math.floor(Math.log(n) / Math.log(1024)),
|
|
505
|
-
);
|
|
506
|
-
return `${(n / 1024 ** i).toFixed(1)} ${units[i]}`;
|
|
507
|
-
};
|
|
@@ -145,13 +145,29 @@ export const DetailAside = (props: DetailAsideProps) => {
|
|
|
145
145
|
the rule floating in the gap rather than meeting the rows it
|
|
146
146
|
divides; `py-2.5` inside each row is what carries the rhythm now.
|
|
147
147
|
|
|
148
|
-
`overflow-hidden` for the corners:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
`overflow-hidden` for the corners: the card paints a background, so
|
|
149
|
+
the first and last rows sit in the rounded corners and would square
|
|
150
|
+
them off without it.
|
|
151
|
+
|
|
152
|
+
That background is the table header's - `bg-muted` under a
|
|
153
|
+
`--bevel` line - because this panel is the same kind of thing:
|
|
154
|
+
chrome that frames the page rather than body the reader is in. Two
|
|
155
|
+
adjacent lines of opposite polarity read as a fold, which is what
|
|
156
|
+
lifts the surface off the page instead of leaving it drawn onto it.
|
|
157
|
+
Same pair on `PlateTabBar`.
|
|
158
|
+
|
|
159
|
+
The bevel is on each ROW, not once on the card, so every row is its
|
|
160
|
+
own slab and the stack reads as slabs stacked rather than as one
|
|
161
|
+
slab ruled into sections. Each row already has the line the bevel
|
|
162
|
+
folds against: `divide-y` gives rows 2..n a `border-t`, and the
|
|
163
|
+
card's own border closes the first one, which is why the same class
|
|
164
|
+
on every row lands the same way on all of them. */}
|
|
165
|
+
<dl className="bg-muted flex flex-col divide-y overflow-hidden rounded-lg border text-sm">
|
|
153
166
|
{props.rows.map((row) => (
|
|
154
|
-
<div
|
|
167
|
+
<div
|
|
168
|
+
key={row.label}
|
|
169
|
+
className="flex flex-col gap-0.5 px-3 py-2.5 shadow-[inset_0_1px_0_0_var(--bevel)]"
|
|
170
|
+
>
|
|
155
171
|
<dt className="text-muted-foreground text-[11px] font-medium tracking-wide uppercase">
|
|
156
172
|
{row.label}
|
|
157
173
|
</dt>
|
|
@@ -177,6 +193,14 @@ export const DetailAside = (props: DetailAsideProps) => {
|
|
|
177
193
|
args: [row.label],
|
|
178
194
|
}),
|
|
179
195
|
)}
|
|
196
|
+
// No background override, even though `ghost` hovers to
|
|
197
|
+
// `bg-muted` and the card is now `bg-muted` too. That
|
|
198
|
+
// class does not resolve to the opaque token: `styles.css`
|
|
199
|
+
// redirects it to `--state-layer`, a 10% `--foreground`
|
|
200
|
+
// wash that DARKENS in light and lifts in dark, so it
|
|
201
|
+
// reads over whatever surface it lands on. A literal
|
|
202
|
+
// `hover:bg-background` here looked correct in dark and
|
|
203
|
+
// went white-on-grey in light.
|
|
180
204
|
className="text-muted-foreground hover:text-foreground shrink-0"
|
|
181
205
|
>
|
|
182
206
|
{copiedLabel === row.label ? (
|