@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
|
@@ -69,8 +69,10 @@ import { useSidebarState } from "alepha/react/ui";
|
|
|
69
69
|
import {
|
|
70
70
|
ChevronRight,
|
|
71
71
|
Lock,
|
|
72
|
+
Minus,
|
|
72
73
|
PanelLeftClose,
|
|
73
74
|
PanelLeftOpen,
|
|
75
|
+
Plus,
|
|
74
76
|
} from "lucide-react";
|
|
75
77
|
import type { ComponentType, ReactNode, SVGProps } from "react";
|
|
76
78
|
import { Fragment, useState } from "react";
|
|
@@ -208,6 +210,66 @@ function hasActiveDescendant(item: NavItem): boolean {
|
|
|
208
210
|
return (item.children ?? []).some(hasActiveDescendant);
|
|
209
211
|
}
|
|
210
212
|
|
|
213
|
+
/**
|
|
214
|
+
* The one open branch of the nav tree, when `navAccordion` is on.
|
|
215
|
+
*
|
|
216
|
+
* A single path rather than a set of open ids, because "one group open" has to
|
|
217
|
+
* mean one group open PER LEVEL: a nested group closing its own parent to open
|
|
218
|
+
* itself would be a bug, not exclusivity. A path says both things at once - a
|
|
219
|
+
* group is open exactly when its path is a prefix of this one, so opening a
|
|
220
|
+
* sibling replaces the path (the sibling closes) while opening a child extends
|
|
221
|
+
* it (the parent stays).
|
|
222
|
+
*
|
|
223
|
+
* Paths are indices into `nav`: `[groupIndex, itemIndex, ...childIndex]`.
|
|
224
|
+
*/
|
|
225
|
+
interface NavAccordion {
|
|
226
|
+
openPath: number[];
|
|
227
|
+
setOpenPath: (path: number[]) => void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function isOpenPathPrefix(path: number[], openPath: number[]): boolean {
|
|
231
|
+
if (path.length === 0 || path.length > openPath.length) return false;
|
|
232
|
+
return path.every((index, depth) => openPath[depth] === index);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function samePath(a: number[], b: number[]): boolean {
|
|
236
|
+
return a.length === b.length && a.every((index, i) => b[i] === index);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The path the accordion should be showing: the DEEPEST group holding the
|
|
241
|
+
* active page, or failing that the first group asking for `defaultOpen`.
|
|
242
|
+
*
|
|
243
|
+
* Computed here, from the tree, rather than reported upwards by the item that
|
|
244
|
+
* notices it is active. An item cannot set its parent's state during render
|
|
245
|
+
* (React refuses to update another component mid-render), and doing it in an
|
|
246
|
+
* effect costs a frame of the wrong group being open on every navigation.
|
|
247
|
+
*/
|
|
248
|
+
function findOpenPath(nav: NavGroup[]): number[] {
|
|
249
|
+
let fallback: number[] = [];
|
|
250
|
+
|
|
251
|
+
const walk = (item: NavItem, path: number[]): number[] | undefined => {
|
|
252
|
+
const children = item.children ?? [];
|
|
253
|
+
if (children.length === 0) return undefined;
|
|
254
|
+
for (let ci = 0; ci < children.length; ci++) {
|
|
255
|
+
const deeper = walk(children[ci]!, [...path, ci]);
|
|
256
|
+
if (deeper) return deeper;
|
|
257
|
+
}
|
|
258
|
+
if (hasActiveDescendant(item)) return path;
|
|
259
|
+
if (fallback.length === 0 && item.defaultOpen) fallback = path;
|
|
260
|
+
return undefined;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
for (let gi = 0; gi < nav.length; gi++) {
|
|
264
|
+
const items = nav[gi]?.items ?? [];
|
|
265
|
+
for (let ii = 0; ii < items.length; ii++) {
|
|
266
|
+
const found = walk(items[ii]!, [gi, ii]);
|
|
267
|
+
if (found) return found;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return fallback;
|
|
271
|
+
}
|
|
272
|
+
|
|
211
273
|
/**
|
|
212
274
|
* Render a NavItem icon. An already-created element (e.g. `<Users />`, which
|
|
213
275
|
* `React.isValidElement` recognises) is returned as-is; anything else is
|
|
@@ -233,24 +295,103 @@ function renderNavIcon(icon: NavItem["icon"], className: string): ReactNode {
|
|
|
233
295
|
return <Icon className={className} />;
|
|
234
296
|
}
|
|
235
297
|
|
|
236
|
-
|
|
237
|
-
|
|
298
|
+
/**
|
|
299
|
+
* The open/close animation for a nav group.
|
|
300
|
+
*
|
|
301
|
+
* `grid-template-rows: 0fr -> 1fr` on a wrapper whose child is
|
|
302
|
+
* `overflow: hidden`. That is the one way to transition to an INTRINSIC
|
|
303
|
+
* height in CSS alone: `height: auto` is not interpolable, so the usual
|
|
304
|
+
* alternatives are a hardcoded max-height (which either clips a long group or
|
|
305
|
+
* makes a short one crawl through empty space) or measuring the subtree in an
|
|
306
|
+
* effect (a layout read on every toggle, and a frame of the wrong height).
|
|
307
|
+
*
|
|
308
|
+
* ⚠️ The children stay MOUNTED while closed, which is what makes the height
|
|
309
|
+
* animatable, so something has to do what unmounting used to: clipped content
|
|
310
|
+
* is invisible but still focusable and still read aloud. `inert` does it, and
|
|
311
|
+
* it is the right tool rather than `visibility: hidden` because it needs no
|
|
312
|
+
* animation of its own - the clipping already hides the group, so the only
|
|
313
|
+
* job left is taking it out of the tab order and the a11y tree, which is a
|
|
314
|
+
* state rather than a transition.
|
|
315
|
+
*
|
|
316
|
+
* `min-h-0` on the inner element is load-bearing, not tidiness: a grid item's
|
|
317
|
+
* automatic minimum size is its content, so without it the row never shrinks
|
|
318
|
+
* below the subtree's natural height and nothing appears to animate.
|
|
319
|
+
*/
|
|
320
|
+
const NavCollapse = (props: {
|
|
321
|
+
open: boolean;
|
|
322
|
+
animate: boolean;
|
|
323
|
+
children: ReactNode;
|
|
324
|
+
}) => (
|
|
325
|
+
<div
|
|
326
|
+
data-state={props.open ? "open" : "closed"}
|
|
327
|
+
inert={!props.open}
|
|
328
|
+
className={cn(
|
|
329
|
+
"grid grid-rows-[0fr] data-[state=open]:grid-rows-[1fr]",
|
|
330
|
+
props.animate &&
|
|
331
|
+
"transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
332
|
+
)}
|
|
333
|
+
>
|
|
334
|
+
<div className="min-h-0 overflow-hidden">{props.children}</div>
|
|
335
|
+
</div>
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
const SidebarNavItem = (props: {
|
|
339
|
+
item: NavItem;
|
|
340
|
+
/**
|
|
341
|
+
* This item's position in `nav`, used only by the accordion. See
|
|
342
|
+
* {@link NavAccordion}.
|
|
343
|
+
*/
|
|
344
|
+
path: number[];
|
|
345
|
+
/**
|
|
346
|
+
* Present when `navAccordion` is on, and then it OWNS the open state: the
|
|
347
|
+
* local `useState` below is still declared (hooks cannot be conditional) but
|
|
348
|
+
* nothing reads it.
|
|
349
|
+
*/
|
|
350
|
+
accordion?: NavAccordion;
|
|
351
|
+
/**
|
|
352
|
+
* `navAnimate`, threaded down so a nested group animates like its parent.
|
|
353
|
+
*/
|
|
354
|
+
animate: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* `navToggleIcon`, threaded down for the same reason.
|
|
357
|
+
*/
|
|
358
|
+
toggleIcon: "caret" | "plusMinus";
|
|
359
|
+
}) => {
|
|
360
|
+
const { item, path, accordion, animate, toggleIcon } = props;
|
|
238
361
|
const { state, isMobile } = useSidebar();
|
|
239
362
|
const children = item.children;
|
|
240
363
|
const isGroup = !!children && children.length > 0;
|
|
241
364
|
const hasActive = isGroup && hasActiveDescendant(item);
|
|
242
|
-
const [
|
|
365
|
+
const [localOpen, setLocalOpen] = useState(item.defaultOpen ?? hasActive);
|
|
243
366
|
// Reveal a collapsed group when navigation makes one of its descendants
|
|
244
367
|
// active — SPA nav, spotlight (⌘K), breadcrumb, or a deep-link that doesn't
|
|
245
368
|
// remount this item (useState's initializer runs only at mount, so without
|
|
246
369
|
// this the group stays stuck closed and the active page is hidden — petition
|
|
247
370
|
// #4). Only OPENS; never auto-collapses, so a manual toggle is preserved.
|
|
371
|
+
//
|
|
372
|
+
// Accordion mode does the same job in `AppShell` instead, from the tree, and
|
|
373
|
+
// skips this: the state lives there, and a child cannot write it mid-render.
|
|
248
374
|
const [wasActive, setWasActive] = useState(hasActive);
|
|
249
|
-
if (hasActive !== wasActive) {
|
|
375
|
+
if (!accordion && hasActive !== wasActive) {
|
|
250
376
|
setWasActive(hasActive);
|
|
251
|
-
if (hasActive)
|
|
377
|
+
if (hasActive) setLocalOpen(true);
|
|
252
378
|
}
|
|
253
379
|
|
|
380
|
+
const open = accordion
|
|
381
|
+
? isOpenPathPrefix(path, accordion.openPath)
|
|
382
|
+
: localOpen;
|
|
383
|
+
|
|
384
|
+
// Closing means handing the branch back to this item's PARENT, not clearing
|
|
385
|
+
// it: a nested group that closed itself by emptying the path would collapse
|
|
386
|
+
// every ancestor along with it.
|
|
387
|
+
const toggle = () => {
|
|
388
|
+
if (accordion) {
|
|
389
|
+
accordion.setOpenPath(open ? path.slice(0, -1) : path);
|
|
390
|
+
} else {
|
|
391
|
+
setLocalOpen((v) => !v);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
254
395
|
if (!isGroup) {
|
|
255
396
|
// Disabled rows render with a muted, dashed-border treatment plus a
|
|
256
397
|
// Lock affordance on the trailing edge. Clicks are swallowed. When a
|
|
@@ -371,22 +512,42 @@ const SidebarNavItem = (props: { item: NavItem }) => {
|
|
|
371
512
|
return (
|
|
372
513
|
<SidebarMenuItem>
|
|
373
514
|
<SidebarMenuButton
|
|
374
|
-
onClick={
|
|
515
|
+
onClick={toggle}
|
|
375
516
|
isActive={item.active}
|
|
376
517
|
tooltip={typeof item.label === "string" ? item.label : undefined}
|
|
377
518
|
>
|
|
378
519
|
{renderNavIcon(item.icon, "size-4")}
|
|
379
520
|
<span className="flex-1 text-left">{item.label}</span>
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
521
|
+
{/*
|
|
522
|
+
Plus and minus are SWAPPED, never rotated: a plus turned 45° is a
|
|
523
|
+
close button, which is a different promise. The caret is the one
|
|
524
|
+
that turns, and it stays the default because it is what every app
|
|
525
|
+
using this shell already had.
|
|
526
|
+
*/}
|
|
527
|
+
{toggleIcon === "plusMinus" ? (
|
|
528
|
+
open ? (
|
|
529
|
+
<Minus className="size-4" />
|
|
530
|
+
) : (
|
|
531
|
+
<Plus className="size-4" />
|
|
532
|
+
)
|
|
533
|
+
) : (
|
|
534
|
+
<ChevronRight
|
|
535
|
+
className={`size-4 transition-transform ${open ? "rotate-90" : ""}`}
|
|
536
|
+
/>
|
|
537
|
+
)}
|
|
383
538
|
</SidebarMenuButton>
|
|
384
|
-
{open
|
|
539
|
+
<NavCollapse open={open} animate={animate}>
|
|
385
540
|
<SidebarMenuSub>
|
|
386
541
|
{children.map((child, ci) => (
|
|
387
542
|
<SidebarMenuSubItem key={child.href ?? ci}>
|
|
388
543
|
{child.children && child.children.length > 0 ? (
|
|
389
|
-
<SidebarNavItem
|
|
544
|
+
<SidebarNavItem
|
|
545
|
+
item={child}
|
|
546
|
+
path={[...path, ci]}
|
|
547
|
+
accordion={accordion}
|
|
548
|
+
animate={animate}
|
|
549
|
+
toggleIcon={toggleIcon}
|
|
550
|
+
/>
|
|
390
551
|
) : (
|
|
391
552
|
<SidebarMenuSubButton
|
|
392
553
|
isActive={child.active}
|
|
@@ -399,7 +560,7 @@ const SidebarNavItem = (props: { item: NavItem }) => {
|
|
|
399
560
|
</SidebarMenuSubItem>
|
|
400
561
|
))}
|
|
401
562
|
</SidebarMenuSub>
|
|
402
|
-
|
|
563
|
+
</NavCollapse>
|
|
403
564
|
</SidebarMenuItem>
|
|
404
565
|
);
|
|
405
566
|
};
|
|
@@ -479,6 +640,51 @@ export interface AppShellProps {
|
|
|
479
640
|
* Sidebar navigation groups.
|
|
480
641
|
*/
|
|
481
642
|
nav?: NavGroup[];
|
|
643
|
+
/**
|
|
644
|
+
* Keep at most ONE nav group open at a time. Defaults to `true`.
|
|
645
|
+
*
|
|
646
|
+
* Opening a group closes the one that was open beside it, the way an
|
|
647
|
+
* accordion does. Exclusivity is per level, so a nested group opens inside
|
|
648
|
+
* its parent rather than replacing it, and the open branch always runs from
|
|
649
|
+
* the root to the deepest open group.
|
|
650
|
+
*
|
|
651
|
+
* On means the sidebar owns the open state, so `NavItem.defaultOpen` seeds
|
|
652
|
+
* the branch rather than opening a group of its own: the first item asking
|
|
653
|
+
* for it wins, and only when nothing is active. Pass `false` for the older
|
|
654
|
+
* behaviour, where every group keeps its own state and any number can be
|
|
655
|
+
* open at once.
|
|
656
|
+
*
|
|
657
|
+
* ⚠️ Nothing changes in the icon rail. Collapsed to icons a group is a
|
|
658
|
+
* dropdown, and one dropdown at a time is already all a menu can do.
|
|
659
|
+
*/
|
|
660
|
+
navAccordion?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* Slide a nav group open and shut instead of swapping it in. Defaults to
|
|
663
|
+
* `true`.
|
|
664
|
+
*
|
|
665
|
+
* `false` is a snap, not a shorter animation: an app that wants a different
|
|
666
|
+
* duration or curve should style
|
|
667
|
+
* `[data-slot=sidebar-menu-item] [data-state]` rather than turn this off.
|
|
668
|
+
*
|
|
669
|
+
* ⚠️ Honours `prefers-reduced-motion` on its own, so this is not the switch
|
|
670
|
+
* for accessibility. It exists for a shell embedded somewhere that owns its
|
|
671
|
+
* own motion, and for a test that would rather not wait 200ms.
|
|
672
|
+
*/
|
|
673
|
+
navAnimate?: boolean;
|
|
674
|
+
/**
|
|
675
|
+
* Which glyph a collapsible nav group carries. Defaults to `"caret"`.
|
|
676
|
+
*
|
|
677
|
+
* - `"caret"` - a chevron that turns a quarter clockwise when the group
|
|
678
|
+
* opens. One glyph, and the rotation is the state.
|
|
679
|
+
* - `"plusMinus"` - a plus when shut, a minus when open. Two glyphs that
|
|
680
|
+
* name the two states outright, where a caret only points and leaves the
|
|
681
|
+
* reader to learn which direction means open.
|
|
682
|
+
*
|
|
683
|
+
* ⚠️ Nothing in the icon rail. Collapsed, a group is a dropdown that opens
|
|
684
|
+
* to the RIGHT, so its chevron is a direction rather than a state and there
|
|
685
|
+
* is no minus that could answer it.
|
|
686
|
+
*/
|
|
687
|
+
navToggleIcon?: "caret" | "plusMinus";
|
|
482
688
|
/**
|
|
483
689
|
* Content rendered at the bottom of the sidebar (user menu, etc.).
|
|
484
690
|
*/
|
|
@@ -552,6 +758,25 @@ export interface AppShellProps {
|
|
|
552
758
|
export const AppShell = (props: AppShellProps) => {
|
|
553
759
|
const { collapsed, setCollapsed } = useSidebarState();
|
|
554
760
|
const nav = props.nav ?? [];
|
|
761
|
+
|
|
762
|
+
// The accordion's one open branch. Held here because exclusivity is a
|
|
763
|
+
// question about SIBLINGS, and no nav item can see its own.
|
|
764
|
+
const navAccordion = props.navAccordion ?? true;
|
|
765
|
+
const navAnimate = props.navAnimate ?? true;
|
|
766
|
+
const navToggleIcon = props.navToggleIcon ?? "caret";
|
|
767
|
+
const wantedOpenPath = findOpenPath(nav);
|
|
768
|
+
const [openPath, setOpenPath] = useState(wantedOpenPath);
|
|
769
|
+
// Follow the active page. Set during render of THIS component, which is the
|
|
770
|
+
// supported way to react to changed input without a wasted frame; the same
|
|
771
|
+
// pattern a nav item uses for its own state when the accordion is off.
|
|
772
|
+
// Only ever opens: `findOpenPath` returns an empty path when nothing is
|
|
773
|
+
// active and nothing asked for `defaultOpen`, and adopting that would slam
|
|
774
|
+
// the branch shut on every navigation to a top-level page.
|
|
775
|
+
const [lastWanted, setLastWanted] = useState(wantedOpenPath);
|
|
776
|
+
if (!samePath(wantedOpenPath, lastWanted)) {
|
|
777
|
+
setLastWanted(wantedOpenPath);
|
|
778
|
+
if (wantedOpenPath.length > 0) setOpenPath(wantedOpenPath);
|
|
779
|
+
}
|
|
555
780
|
const variant = props.variant ?? "sidebar";
|
|
556
781
|
const progress = props.progress ?? true;
|
|
557
782
|
const headerOutside = !!props.headerOutside && variant === "inset";
|
|
@@ -631,9 +856,21 @@ export const AppShell = (props: AppShellProps) => {
|
|
|
631
856
|
// header stays sticky, body scrolls, no page-level scrollbar.
|
|
632
857
|
// - For non-fill pages there's no height bound, so this collapses
|
|
633
858
|
// to "scroll whatever overflows" without further config.
|
|
859
|
+
//
|
|
860
|
+
// `relative` is load-bearing in BOTH branches, and it is the whole of
|
|
861
|
+
// #1849: an `overflow` declared on a STATIC element does not clip an
|
|
862
|
+
// absolutely positioned descendant whose containing block resolves above
|
|
863
|
+
// it. Base UI gives every named form control a 1×1 hidden `<input>`
|
|
864
|
+
// styled `position: absolute` with no offsets, so on a page whose fields
|
|
865
|
+
// live inside an inner scroller each of those inputs escaped this `main`,
|
|
866
|
+
// resolved against the positioned `SidebarInset` and pinned the document
|
|
867
|
+
// open at its own static offset — a page that scrolled 1271px into empty
|
|
868
|
+
// background beneath a shell that had not moved. Positioning `main` makes
|
|
869
|
+
// its overflow bound real, whatever a page renders inside it.
|
|
634
870
|
<main
|
|
635
871
|
className={cn(
|
|
636
872
|
props.mainClassName,
|
|
873
|
+
"relative",
|
|
637
874
|
props.fill
|
|
638
875
|
? "flex min-h-0 flex-1 flex-col overflow-hidden"
|
|
639
876
|
: "flex-1 overflow-auto",
|
|
@@ -681,6 +918,12 @@ export const AppShell = (props: AppShellProps) => {
|
|
|
681
918
|
<SidebarNavItem
|
|
682
919
|
key={item.href ?? `${gi}-${ii}`}
|
|
683
920
|
item={item}
|
|
921
|
+
path={[gi, ii]}
|
|
922
|
+
accordion={
|
|
923
|
+
navAccordion ? { openPath, setOpenPath } : undefined
|
|
924
|
+
}
|
|
925
|
+
animate={navAnimate}
|
|
926
|
+
toggleIcon={navToggleIcon}
|
|
684
927
|
/>
|
|
685
928
|
))}
|
|
686
929
|
</SidebarMenu>
|
|
@@ -148,7 +148,7 @@ describe("AutoForm settings-card layout", () => {
|
|
|
148
148
|
/>,
|
|
149
149
|
);
|
|
150
150
|
|
|
151
|
-
//
|
|
151
|
+
// `cn` merging, not both classes landing on the element: at `sm` the
|
|
152
152
|
// caller's width has to be the only one that applies.
|
|
153
153
|
// `getByRole`, not `getByLabelText`: `username` is required here, and the
|
|
154
154
|
// marker `FormField` renders for that puts a literal "*" in the label's
|
|
@@ -12,6 +12,8 @@ import { iconFor } from "@alepha/ui/components/control-base/icon-hint";
|
|
|
12
12
|
import {
|
|
13
13
|
Control,
|
|
14
14
|
type ControlProps,
|
|
15
|
+
readSchemaControl,
|
|
16
|
+
useDynamicControlRefresh,
|
|
15
17
|
} from "@alepha/ui/components/control/control";
|
|
16
18
|
import { SettingsHeading } from "@alepha/ui/components/settings/settings-heading";
|
|
17
19
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
@@ -34,9 +36,11 @@ import {
|
|
|
34
36
|
type BaseInputField,
|
|
35
37
|
type FormModel,
|
|
36
38
|
isObjectOrUnionOfObjects,
|
|
39
|
+
useFieldValue,
|
|
37
40
|
useFormState,
|
|
38
41
|
} from "alepha/react/form";
|
|
39
42
|
import { useI18n } from "alepha/react/i18n";
|
|
43
|
+
import { resolveSchemaControl } from "alepha/react/ui";
|
|
40
44
|
import { AlertCircle, X } from "lucide-react";
|
|
41
45
|
import { type ReactNode, useEffect, useMemo, useState } from "react";
|
|
42
46
|
|
|
@@ -514,7 +518,13 @@ export function AutoForm<T extends ZObject>(props: AutoFormProps<T>) {
|
|
|
514
518
|
<CardContent
|
|
515
519
|
className={cn(
|
|
516
520
|
"flex flex-col gap-4",
|
|
517
|
-
|
|
521
|
+
// `relative` alongside the scroller, not decoration: Base UI
|
|
522
|
+
// gives every named control a 1×1 hidden `<input>` positioned
|
|
523
|
+
// `absolute` with no offsets, and a scroller that is not itself
|
|
524
|
+
// a containing block neither clips those inputs nor scrolls
|
|
525
|
+
// them with the field they belong to — so a native validation
|
|
526
|
+
// bubble would point at where the field used to be. #1849.
|
|
527
|
+
props.fill && "relative min-h-0 flex-1 overflow-y-auto",
|
|
518
528
|
)}
|
|
519
529
|
>
|
|
520
530
|
{fieldGroups}
|
|
@@ -570,6 +580,12 @@ export function AutoForm<T extends ZObject>(props: AutoFormProps<T>) {
|
|
|
570
580
|
|
|
571
581
|
// ──────────────────────────────────────────────────────────────────────
|
|
572
582
|
|
|
583
|
+
interface GroupItem {
|
|
584
|
+
name: string;
|
|
585
|
+
input: BaseInputField;
|
|
586
|
+
props: Partial<ControlProps>;
|
|
587
|
+
}
|
|
588
|
+
|
|
573
589
|
interface GroupBlockProps {
|
|
574
590
|
group: AutoFormGroup;
|
|
575
591
|
inputs: Record<string, never>;
|
|
@@ -587,6 +603,81 @@ interface GroupBlockProps {
|
|
|
587
603
|
bottomBar?: ReactNode;
|
|
588
604
|
}
|
|
589
605
|
|
|
606
|
+
/**
|
|
607
|
+
* One field of the grid: the cell, sized, and the control inside it.
|
|
608
|
+
*
|
|
609
|
+
* ⚠️ Its own component rather than a `<div>` in `GroupBlock`'s loop, and that
|
|
610
|
+
* is the whole point of it. Sizing a cell means ASKING the field's `$control`
|
|
611
|
+
* how wide it wants to be, and a function-form `$control` can only be asked
|
|
612
|
+
* with `{ form, value }` and re-asked when another field changes - two hooks,
|
|
613
|
+
* which cannot be called inside a `.map`.
|
|
614
|
+
*
|
|
615
|
+
* Before this, the grid was computed from the STATIC schema while `Control`
|
|
616
|
+
* resolved the same `$control` DYNAMICALLY, and the two disagreed in both
|
|
617
|
+
* directions: a field whose width came from a function silently fell back to
|
|
618
|
+
* the 33% default (`widthFor` reads `.width` off the raw value, and a function
|
|
619
|
+
* has none), and a field the function had hidden left its cell behind, holding
|
|
620
|
+
* columns for a control that rendered nothing.
|
|
621
|
+
*/
|
|
622
|
+
const GroupGridField = (props: {
|
|
623
|
+
item: GroupItem;
|
|
624
|
+
gridClassName?: string;
|
|
625
|
+
disabled?: boolean;
|
|
626
|
+
}) => {
|
|
627
|
+
const { item } = props;
|
|
628
|
+
const [value] = useFieldValue(item.input);
|
|
629
|
+
useDynamicControlRefresh(item.input);
|
|
630
|
+
|
|
631
|
+
const resolved = resolveSchemaControl(readSchemaControl(item.input), {
|
|
632
|
+
form: item.input.form,
|
|
633
|
+
value,
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
// `null` is the field saying it is not here AT ALL, so the cell goes with
|
|
637
|
+
// it and the grid repacks.
|
|
638
|
+
if (resolved === null) return null;
|
|
639
|
+
|
|
640
|
+
// `resolved.width` first, matching the precedence `Control` applies when it
|
|
641
|
+
// merges `{ ...props, ...resolved }`: what the schema asks for beats what a
|
|
642
|
+
// `fields` entry passed in.
|
|
643
|
+
const width = widthFor(
|
|
644
|
+
item.input,
|
|
645
|
+
(resolved.width ?? item.props.width) as number | undefined,
|
|
646
|
+
);
|
|
647
|
+
|
|
648
|
+
// `hidden` is the other answer: the field is here, it just draws nothing.
|
|
649
|
+
// The cell stays, at its own width, so the fields around it do not move
|
|
650
|
+
// while it comes and goes. That is the whole difference from `false`, and
|
|
651
|
+
// it is why the width has to survive the resolve.
|
|
652
|
+
const hidden = !!resolved.hidden;
|
|
653
|
+
|
|
654
|
+
return (
|
|
655
|
+
<div
|
|
656
|
+
className={
|
|
657
|
+
// Responsive grid: each field is one cell. Default: 12-col span from
|
|
658
|
+
// width heuristics. A caller-supplied grid keeps its own column count
|
|
659
|
+
// for scalars, but COMPLEX fields (an object card, a list of object
|
|
660
|
+
// editors) still claim the whole row — squeezing one into a third of a
|
|
661
|
+
// row is unreadable, and the heuristic already knows which those are
|
|
662
|
+
// (width 100).
|
|
663
|
+
props.gridClassName
|
|
664
|
+
? width >= 100
|
|
665
|
+
? "col-span-full"
|
|
666
|
+
: undefined
|
|
667
|
+
: spanClass(width)
|
|
668
|
+
}
|
|
669
|
+
>
|
|
670
|
+
{hidden ? null : (
|
|
671
|
+
<Control
|
|
672
|
+
input={item.input}
|
|
673
|
+
{...item.props}
|
|
674
|
+
disabled={props.disabled || item.props.disabled}
|
|
675
|
+
/>
|
|
676
|
+
)}
|
|
677
|
+
</div>
|
|
678
|
+
);
|
|
679
|
+
};
|
|
680
|
+
|
|
590
681
|
const GroupBlock = (props: GroupBlockProps) => {
|
|
591
682
|
const { group } = props;
|
|
592
683
|
const { tr } = useI18n();
|
|
@@ -628,11 +719,7 @@ const GroupBlock = (props: GroupBlockProps) => {
|
|
|
628
719
|
}
|
|
629
720
|
return { name, input, props: merged };
|
|
630
721
|
})
|
|
631
|
-
.filter(Boolean) as
|
|
632
|
-
name: string;
|
|
633
|
-
input: BaseInputField;
|
|
634
|
-
props: Partial<ControlProps>;
|
|
635
|
-
}>;
|
|
722
|
+
.filter(Boolean) as GroupItem[];
|
|
636
723
|
|
|
637
724
|
// `!props.bottomBar`: a group carrying the action bar still renders when it
|
|
638
725
|
// has no resolvable fields, or the form would silently lose its submit
|
|
@@ -715,31 +802,12 @@ const GroupBlock = (props: GroupBlockProps) => {
|
|
|
715
802
|
)}
|
|
716
803
|
>
|
|
717
804
|
{items.map((it) => (
|
|
718
|
-
<
|
|
805
|
+
<GroupGridField
|
|
719
806
|
key={it.name}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
// a list of object editors) still claim the whole row —
|
|
725
|
-
// squeezing one into a third of a row is unreadable, and the
|
|
726
|
-
// heuristic already knows which those are (width 100).
|
|
727
|
-
props.gridClassName
|
|
728
|
-
? widthFor(it.input, it.props.width as number | undefined) >=
|
|
729
|
-
100
|
|
730
|
-
? "col-span-full"
|
|
731
|
-
: undefined
|
|
732
|
-
: spanClass(
|
|
733
|
-
widthFor(it.input, it.props.width as number | undefined),
|
|
734
|
-
)
|
|
735
|
-
}
|
|
736
|
-
>
|
|
737
|
-
<Control
|
|
738
|
-
input={it.input}
|
|
739
|
-
{...it.props}
|
|
740
|
-
disabled={props.disabled || it.props.disabled}
|
|
741
|
-
/>
|
|
742
|
-
</div>
|
|
807
|
+
item={it}
|
|
808
|
+
gridClassName={props.gridClassName}
|
|
809
|
+
disabled={props.disabled}
|
|
810
|
+
/>
|
|
743
811
|
))}
|
|
744
812
|
</div>
|
|
745
813
|
</div>
|
|
@@ -30,18 +30,58 @@ export interface ButtonDarkProps {
|
|
|
30
30
|
variant?: "ghost" | "outline";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const ICON: Record<"light" | "dark" | "system", ReactNode> = {
|
|
34
|
-
light: <Sun className="size-4" />,
|
|
35
|
-
dark: <Moon className="size-4" />,
|
|
36
|
-
system: <Monitor className="size-4" />,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
33
|
const NEXT: Record<"light" | "dark" | "system", "light" | "dark" | "system"> = {
|
|
40
34
|
light: "dark",
|
|
41
35
|
dark: "system",
|
|
42
36
|
system: "light",
|
|
43
37
|
};
|
|
44
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Every icon the button can show, all rendered, with CSS revealing one.
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ This is the point of the component, not a styling flourish. It used to
|
|
43
|
+
* render ONE icon chosen from the color mode DURING RENDER, which is a
|
|
44
|
+
* hydration mismatch on any PRERENDERED page: the HTML is built with the
|
|
45
|
+
* default preference and the client renders the visitor's. React reported #418
|
|
46
|
+
* on every cold load for anyone who had ever picked a mode, then threw the
|
|
47
|
+
* prerendered tree away and re-rendered from scratch - most of what
|
|
48
|
+
* prerendering was buying.
|
|
49
|
+
*
|
|
50
|
+
* `apps/docs` had already solved this by hand and wrote the rule down: the
|
|
51
|
+
* theme is "a paint, not a render". The markup here is identical for every
|
|
52
|
+
* visitor, and `.dark` / `data-color-mode` on `<html>` - both outside React's
|
|
53
|
+
* tree, both set by `ColorScheme` - decide which copy shows.
|
|
54
|
+
*
|
|
55
|
+
* A mount gate would be the other way round, and it is wrong here: an app that
|
|
56
|
+
* genuinely SSRs (Lore) already emits the right icon from the request's
|
|
57
|
+
* cookie, so deferring to a mount would INTRODUCE the mismatch it is meant to
|
|
58
|
+
* prevent. `withSystem` is a prop, identical on both sides, so branching on it
|
|
59
|
+
* is safe.
|
|
60
|
+
*/
|
|
61
|
+
const TWO_STATE_ICONS: ReactNode = (
|
|
62
|
+
<>
|
|
63
|
+
<Sun className="size-4 dark:hidden" />
|
|
64
|
+
<Moon className="hidden size-4 dark:block" />
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The three-state cycle needs the UNRESOLVED preference, which `.dark` cannot
|
|
70
|
+
* express: "system, resolved to dark" and "dark, chosen" carry the same class.
|
|
71
|
+
* `data-color-mode` carries it.
|
|
72
|
+
*
|
|
73
|
+
* The system icon is the one that shows when the attribute is ABSENT, which is
|
|
74
|
+
* every first paint and every prerendered document - and `system` is also the
|
|
75
|
+
* default mode, so the fallback is the correct answer rather than a guess.
|
|
76
|
+
*/
|
|
77
|
+
const THREE_STATE_ICONS: ReactNode = (
|
|
78
|
+
<>
|
|
79
|
+
<Sun className="hidden size-4 [[data-color-mode='light']_&]:block" />
|
|
80
|
+
<Moon className="hidden size-4 [[data-color-mode='dark']_&]:block" />
|
|
81
|
+
<Monitor className="size-4 [[data-color-mode='dark']_&]:hidden [[data-color-mode='light']_&]:hidden" />
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
|
|
45
85
|
/**
|
|
46
86
|
* Color-mode toggle. Default is a two-state Sun ↔ Moon flip; opt into the
|
|
47
87
|
* three-state `light → dark → system` cycle with `withSystem`.
|
|
@@ -56,7 +96,6 @@ export const ButtonDark = (props: ButtonDarkProps) => {
|
|
|
56
96
|
setMode(resolved === "dark" ? "light" : "dark");
|
|
57
97
|
}
|
|
58
98
|
};
|
|
59
|
-
const iconKey = props.withSystem ? mode : resolved;
|
|
60
99
|
const label = props.label ?? "Toggle color mode";
|
|
61
100
|
return (
|
|
62
101
|
<Tooltip>
|
|
@@ -70,7 +109,7 @@ export const ButtonDark = (props: ButtonDarkProps) => {
|
|
|
70
109
|
/>
|
|
71
110
|
}
|
|
72
111
|
>
|
|
73
|
-
{
|
|
112
|
+
{props.withSystem ? THREE_STATE_ICONS : TWO_STATE_ICONS}
|
|
74
113
|
</TooltipTrigger>
|
|
75
114
|
<TooltipContent>{label}</TooltipContent>
|
|
76
115
|
</Tooltip>
|