@alepha/ui 0.26.0 → 0.27.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 +86 -12
- package/dist/components/account/account-connections.js +5 -5
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.js +4 -4
- package/dist/components/account/account-header.d.ts.map +1 -1
- package/dist/components/account/account-header.js +3 -1
- package/dist/components/account/account-header.js.map +1 -1
- package/dist/components/account/account-keys.js +7 -7
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-layout.d.ts.map +1 -1
- package/dist/components/account/account-layout.js +7 -4
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/account/account-password-dialog.js +3 -3
- package/dist/components/account/account-profile.js +8 -8
- package/dist/components/account/account-profile.js.map +1 -1
- 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.map +1 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +3 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +4 -3
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +6 -6
- package/dist/components/account/account-security.js.map +1 -1
- package/dist/components/account/account-sessions.d.ts.map +1 -1
- package/dist/components/account/account-sessions.js +19 -6
- package/dist/components/account/account-sessions.js.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.js +5 -5
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-results.js +2 -2
- package/dist/components/admin/admin-analytics-results.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +1 -1
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +3 -3
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +4 -4
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-dashboard-card.d.ts +42 -0
- package/dist/components/admin/admin-dashboard-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-card.js +0 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts +34 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-count-card.js +42 -0
- package/dist/components/admin/admin-dashboard-count-card.js.map +1 -0
- package/dist/components/admin/admin-dashboard.d.ts +20 -0
- package/dist/components/admin/admin-dashboard.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard.js +32 -0
- package/dist/components/admin/admin-dashboard.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +3 -3
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +16 -31
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +2 -2
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs.d.ts +1 -1
- package/dist/components/admin/admin-jobs.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs.js +5 -5
- package/dist/components/admin/admin-jobs.js.map +1 -1
- package/dist/components/admin/admin-keys-token-dialog.js +3 -3
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -1
- package/dist/components/admin/admin-keys.d.ts +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +4 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +1 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +3 -3
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-parameters.d.ts +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +10 -10
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +3 -3
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +13 -10
- 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-page.d.ts +7 -5
- package/dist/components/admin/admin-router-page.d.ts.map +1 -1
- package/dist/components/admin/admin-router-page.js +7 -5
- package/dist/components/admin/admin-router-page.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +72 -27
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +103 -40
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +12 -4
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +4 -3
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.js +13 -69
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +2 -2
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +68 -111
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts +6 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js +11 -8
- 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 +9 -12
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +2 -2
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +10 -10
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +20 -44
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +2 -2
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows.d.ts +1 -1
- package/dist/components/admin/admin-workflows.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows.js +5 -5
- package/dist/components/admin/admin-workflows.js.map +1 -1
- package/dist/components/admin/diff-lines.js +1 -1
- package/dist/components/admin/diff-lines.js.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.js +1 -1
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +4 -4
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/admin/parameter-json-dialog.js +1 -1
- package/dist/components/admin/parameter-save-dialog.js +2 -2
- package/dist/components/admin/use-confirmed-action.js +1 -1
- package/dist/components/alepha-table/alepha-table.d.ts +103 -8
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +128 -26
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/paginate-local.d.ts +43 -0
- package/dist/components/alepha-table/paginate-local.d.ts.map +1 -0
- package/dist/components/alepha-table/paginate-local.js +84 -0
- package/dist/components/alepha-table/paginate-local.js.map +1 -0
- package/dist/components/app-actions/app-actions.js +1 -1
- package/dist/components/app-shell/app-shell.d.ts +10 -1
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +27 -20
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +7 -18
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-register.d.ts +1 -1
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +20 -21
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.d.ts +1 -1
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -1
- package/dist/components/auth/auth-reset-password.js +16 -13
- package/dist/components/auth/auth-reset-password.js.map +1 -1
- package/dist/components/auth/auth-router.d.ts +3 -3
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/auth-router.js +3 -3
- package/dist/components/auth/auth-router.js.map +1 -1
- package/dist/components/auth/auth-verify-email.d.ts +1 -1
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -1
- package/dist/components/auth/auth-verify-email.js +8 -8
- package/dist/components/auth/auth-verify-email.js.map +1 -1
- package/dist/components/auth/safe-redirect.d.ts +9 -0
- package/dist/components/auth/safe-redirect.d.ts.map +1 -0
- package/dist/components/auth/safe-redirect.js +19 -0
- package/dist/components/auth/safe-redirect.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +32 -32
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -1
- package/dist/components/brand-icon/brand-icon.js +2 -2
- package/dist/components/brand-icon/brand-icon.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +2 -2
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-language/button-language.d.ts +1 -1
- package/dist/components/button-language/button-language.d.ts.map +1 -1
- package/dist/components/button-language/button-language.js +2 -2
- package/dist/components/button-language/button-language.js.map +1 -1
- package/dist/components/button-theme/button-theme.d.ts +1 -1
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +3 -3
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +2 -20
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +3 -3
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/captcha/turnstile-widget.d.ts +2 -2
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -1
- package/dist/components/captcha/turnstile-widget.js +5 -4
- package/dist/components/captcha/turnstile-widget.js.map +1 -1
- package/dist/components/control/control.d.ts +1 -1
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +8 -11
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +23 -16
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-base/field-i18n.d.ts +5 -3
- package/dist/components/control-base/field-i18n.d.ts.map +1 -1
- package/dist/components/control-base/field-i18n.js +4 -2
- package/dist/components/control-base/field-i18n.js.map +1 -1
- package/dist/components/control-base/form-field.d.ts +7 -7
- package/dist/components/control-base/form-field.d.ts.map +1 -1
- package/dist/components/control-base/form-field.js +10 -10
- package/dist/components/control-base/form-field.js.map +1 -1
- package/dist/components/control-base/icon-hint.d.ts +1 -1
- package/dist/components/control-base/icon-hint.d.ts.map +1 -1
- package/dist/components/control-base/icon-hint.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +1 -1
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +23 -7
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +2 -2
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +3 -3
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +4 -2
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- package/dist/components/control-object/control-object.js +8 -8
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-password/control-password.js +2 -3
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +2 -2
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +17 -17
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +11 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts +58 -0
- package/dist/components/detail/detail-aside.d.ts.map +1 -0
- package/dist/components/detail/detail-aside.js +95 -0
- package/dist/components/detail/detail-aside.js.map +1 -0
- package/dist/components/detail/detail-layout.d.ts +90 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -0
- package/dist/components/detail/detail-layout.js +102 -0
- package/dist/components/detail/detail-layout.js.map +1 -0
- package/dist/components/detail/use-detail-tab.d.ts +15 -0
- package/dist/components/detail/use-detail-tab.d.ts.map +1 -0
- package/dist/components/detail/use-detail-tab.js +37 -0
- package/dist/components/detail/use-detail-tab.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -1
- package/dist/components/language-toggle/language-toggle.js +2 -2
- package/dist/components/language-toggle/language-toggle.js.map +1 -1
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts +28 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js +25 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +44 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +98 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts +14 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +45 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts +19 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +69 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +23 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js +34 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts +17 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +63 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts +18 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js +370 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts +67 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.js +0 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts +109 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js +185 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts +63 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.js +228 -0
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.d.ts +32 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +85 -9
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-shell.js +1 -1
- package/dist/components/nav-shell/nav-shell.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +15 -5
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +1 -1
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/settings/settings-card-edge.d.ts +25 -0
- package/dist/components/settings/settings-card-edge.d.ts.map +1 -0
- package/dist/components/settings/settings-card-edge.js +29 -0
- package/dist/components/settings/settings-card-edge.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -1
- package/dist/components/settings/settings-danger-section.js +2 -1
- package/dist/components/settings/settings-danger-section.js.map +1 -1
- package/dist/components/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/settings/settings-layout.js +1 -1
- package/dist/components/settings/settings-layout.js.map +1 -1
- package/dist/components/settings/settings-nav.d.ts.map +1 -1
- package/dist/components/settings/settings-nav.js +3 -3
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/settings/settings-row.js +2 -2
- package/dist/components/settings/settings-row.js.map +1 -1
- package/dist/components/settings/settings-section.d.ts.map +1 -1
- package/dist/components/settings/settings-section.js +3 -2
- package/dist/components/settings/settings-section.js.map +1 -1
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +5 -5
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +13 -2
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +51 -12
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +3 -3
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.js +2 -2
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +8 -8
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +20 -10
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +7 -6
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +8 -8
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +6 -6
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js +8 -8
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +4 -4
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +9 -9
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js +9 -9
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +3 -3
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +1 -1
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +3 -3
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.js +17 -17
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +5 -5
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +13 -7
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -3
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +2 -2
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -6
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/components/use-toast/use-toast.d.ts +9 -3
- package/dist/components/use-toast/use-toast.d.ts.map +1 -1
- package/dist/components/use-toast/use-toast.js +23 -22
- package/dist/components/use-toast/use-toast.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +10 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +19 -12
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts +3 -3
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +13 -8
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/styles.css +5 -5
- package/package.json +46 -45
- package/src/components/account/__tests__/account-router.spec.ts +4 -2
- package/src/components/account/account-connections.tsx +1 -1
- package/src/components/account/account-header.tsx +6 -1
- package/src/components/account/account-keys.tsx +1 -1
- package/src/components/account/account-layout.tsx +8 -1
- package/src/components/account/account-profile.tsx +3 -3
- package/src/components/account/account-router-options.tsx +1 -0
- package/src/components/account/account-router-page.tsx +1 -0
- package/src/components/account/account-router.tsx +4 -2
- package/src/components/account/account-security.tsx +1 -0
- package/src/components/account/account-sessions.tsx +21 -4
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +2 -1
- package/src/components/admin/__tests__/admin-router-page.spec.ts +2 -1
- package/src/components/admin/__tests__/admin-router.spec.ts +57 -1
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +1 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +4 -3
- package/src/components/admin/admin-analytics-results.tsx +2 -2
- package/src/components/admin/admin-analytics.tsx +3 -3
- package/src/components/admin/admin-audits.tsx +3 -3
- package/src/components/admin/admin-dashboard-card.tsx +45 -0
- package/src/components/admin/admin-dashboard-count-card.tsx +89 -0
- package/src/components/admin/admin-dashboard.tsx +60 -0
- package/src/components/admin/admin-files.tsx +2 -2
- package/src/components/admin/admin-jobs-executions-panel.tsx +19 -12
- package/src/components/admin/admin-jobs-status-badge.tsx +2 -2
- package/src/components/admin/admin-jobs.tsx +4 -4
- package/src/components/admin/admin-keys-token-dialog.tsx +2 -2
- package/src/components/admin/admin-keys.tsx +2 -2
- package/src/components/admin/admin-layout.tsx +1 -2
- package/src/components/admin/admin-notifications.tsx +2 -2
- package/src/components/admin/admin-parameters.tsx +16 -9
- package/src/components/admin/admin-payments.tsx +2 -2
- package/src/components/admin/admin-router-options.tsx +14 -10
- package/src/components/admin/admin-router-page.tsx +8 -5
- package/src/components/admin/admin-router.tsx +112 -40
- package/src/components/admin/admin-sessions.tsx +13 -2
- package/src/components/admin/admin-user-detail-audits-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail-identity-aside.tsx +16 -93
- package/src/components/admin/admin-user-detail-overview-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-password-dialog.tsx +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +1 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail.tsx +49 -87
- package/src/components/admin/admin-users-roles-picker.tsx +22 -15
- package/src/components/admin/admin-users.tsx +8 -14
- package/src/components/admin/admin-workflows-execution-sheet.tsx +18 -10
- package/src/components/admin/admin-workflows-executions-panel.tsx +24 -17
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -2
- package/src/components/admin/admin-workflows.tsx +6 -4
- package/src/components/admin/diff-lines.spec.ts +1 -0
- package/src/components/admin/diff-lines.ts +1 -1
- package/src/components/admin/parameter-diff-dialog.tsx +3 -2
- package/src/components/admin/parameter-history-item.tsx +6 -5
- package/src/components/alepha-table/__tests__/alepha-table-static.browser.spec.tsx +190 -0
- package/src/components/alepha-table/__tests__/paginate-local.spec.ts +286 -0
- package/src/components/alepha-table/__tests__/use-table-selection.browser.spec.tsx +1 -0
- package/src/components/alepha-table/alepha-table.tsx +362 -79
- package/src/components/alepha-table/paginate-local.ts +174 -0
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +1 -0
- package/src/components/app-shell/app-shell.tsx +42 -19
- package/src/components/auth/__tests__/auth-router.spec.ts +2 -1
- package/src/components/auth/auth-login.tsx +5 -16
- package/src/components/auth/auth-register.tsx +26 -25
- package/src/components/auth/auth-reset-password.tsx +24 -17
- package/src/components/auth/auth-router.tsx +4 -3
- package/src/components/auth/auth-verify-email.tsx +7 -7
- package/src/components/auth/safe-redirect.ts +14 -0
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -0
- package/src/components/auto-form/auto-form.tsx +60 -39
- package/src/components/brand-icon/brand-icon.tsx +2 -2
- package/src/components/button-dark/button-dark.tsx +2 -2
- package/src/components/button-language/button-language.tsx +2 -2
- package/src/components/button-theme/button-theme.tsx +2 -2
- package/src/components/button-user/button-user.tsx +4 -4
- package/src/components/captcha/turnstile-widget.tsx +6 -5
- package/src/components/control/control.tsx +6 -6
- package/src/components/control-array/control-array.tsx +28 -15
- package/src/components/control-base/__tests__/form-field-a11y.browser.spec.tsx +1 -0
- package/src/components/control-base/field-i18n.ts +5 -3
- package/src/components/control-base/form-field.tsx +13 -13
- package/src/components/control-base/icon-hint.tsx +1 -1
- package/src/components/control-date/control-date.tsx +29 -6
- package/src/components/control-number/control-number.tsx +3 -3
- package/src/components/control-object/control-object.tsx +11 -8
- package/src/components/control-password/control-password.tsx +2 -2
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +1 -0
- package/src/components/control-select/control-select.tsx +32 -18
- package/src/components/control-upload/control-upload.tsx +16 -10
- package/src/components/detail/__tests__/detail-aside.browser.spec.tsx +135 -0
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +151 -0
- package/src/components/detail/detail-aside.tsx +198 -0
- package/src/components/detail/detail-layout.tsx +181 -0
- package/src/components/detail/use-detail-tab.tsx +41 -0
- package/src/components/file-image/file-image.tsx +4 -2
- package/src/components/language-toggle/language-toggle.tsx +2 -2
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +148 -0
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +1 -0
- package/src/components/markdown-view/diagram/DiagramErrorBoundary.tsx +42 -0
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +136 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +59 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +95 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx +58 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +78 -0
- package/src/components/markdown-view/diagram/MermaidFence.tsx +46 -0
- package/src/components/markdown-view/diagram/__tests__/flowchart-diagram.browser.spec.tsx +210 -0
- package/src/components/markdown-view/diagram/flowchartParser.spec.ts +379 -0
- package/src/components/markdown-view/diagram/flowchartParser.ts +475 -0
- package/src/components/markdown-view/diagram/graphModel.ts +72 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.spec.ts +235 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.ts +324 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +128 -0
- package/src/components/markdown-view/diagram/textMetrics.ts +296 -0
- package/src/components/markdown-view/markdown-view.tsx +128 -9
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +1 -0
- package/src/components/nav-shell/nav-shell.tsx +6 -3
- package/src/components/nav-shell/spotlight.tsx +2 -1
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +1 -0
- package/src/components/nav-shell/use-nav-entries.ts +16 -5
- package/src/components/nav-shell/use-nav-tree.ts +1 -0
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +1 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +1 -0
- package/src/components/settings/settings-card-edge.ts +24 -0
- package/src/components/settings/settings-danger-section.tsx +7 -1
- package/src/components/settings/settings-layout.tsx +16 -1
- package/src/components/settings/settings-nav.tsx +12 -3
- package/src/components/settings/settings-row.tsx +2 -2
- package/src/components/settings/settings-section.tsx +2 -1
- package/src/components/ui/accordion.tsx +3 -3
- package/src/components/ui/alert-dialog.tsx +5 -5
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +5 -5
- package/src/components/ui/badge.tsx +48 -2
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/button-group.tsx +2 -2
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/calendar.tsx +8 -8
- package/src/components/ui/card.tsx +3 -3
- package/src/components/ui/carousel.tsx +30 -13
- package/src/components/ui/chart.tsx +18 -6
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -9
- package/src/components/ui/command.tsx +6 -7
- package/src/components/ui/context-menu.tsx +8 -8
- package/src/components/ui/dialog.tsx +4 -4
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +6 -3
- package/src/components/ui/input-otp.tsx +3 -3
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/label.tsx +3 -0
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/navigation-menu.tsx +7 -7
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +3 -3
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scroll-area.tsx +2 -2
- package/src/components/ui/segmented.tsx +8 -3
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/sidebar.tsx +20 -20
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +2 -2
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +10 -5
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +9 -4
- package/src/components/ui/toggle.tsx +2 -2
- package/src/components/ui/tooltip.tsx +13 -3
- package/src/components/use-dialog/use-dialog.tsx +19 -6
- package/src/components/use-toast/__tests__/use-toast.browser.spec.tsx +19 -0
- package/src/components/use-toast/use-toast.tsx +38 -26
- package/src/hooks/use-mobile.ts +27 -14
- package/src/lib/__tests__/i18n-fr.spec.ts +5 -1
- package/src/lib/i18n-fr.ts +18 -10
- package/src/styles.css +5 -5
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
useRef,
|
|
36
36
|
useState,
|
|
37
37
|
} from "react";
|
|
38
|
+
|
|
38
39
|
import {
|
|
39
40
|
type ResizeImageOptions,
|
|
40
41
|
resizeImage,
|
|
@@ -114,7 +115,7 @@ interface UploadedFileMeta {
|
|
|
114
115
|
* Single-file: form value is a uuid string.
|
|
115
116
|
* Multi-file: form value is an array of uuid strings.
|
|
116
117
|
*/
|
|
117
|
-
export
|
|
118
|
+
export const ControlUpload = (props: ControlUploadProps) => {
|
|
118
119
|
const form = useFormState(props.input, ["error"]);
|
|
119
120
|
const [value, setValue] = useFieldValue(props.input);
|
|
120
121
|
const client = useClient<FileController>();
|
|
@@ -143,6 +144,11 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
143
144
|
: value
|
|
144
145
|
? [value as string]
|
|
145
146
|
: [];
|
|
147
|
+
// Reconciles a cache of per-file metadata against the ids the field now
|
|
148
|
+
// holds, and the entries it keeps were filled in by the upload requests this
|
|
149
|
+
// same effect issues. It is the cache for an external system, not derived
|
|
150
|
+
// state; the updater already no-ops when nothing changed.
|
|
151
|
+
// oxlint-disable-next-line react/set-state-in-effect
|
|
146
152
|
setMeta((current) => {
|
|
147
153
|
let changed = false;
|
|
148
154
|
const next = new Map(current);
|
|
@@ -260,14 +266,14 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
260
266
|
};
|
|
261
267
|
|
|
262
268
|
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
263
|
-
if (e.target.files) handleFiles(e.target.files);
|
|
269
|
+
if (e.target.files) void handleFiles(e.target.files);
|
|
264
270
|
};
|
|
265
271
|
|
|
266
272
|
const handleDrop = (e: DragEvent) => {
|
|
267
273
|
e.preventDefault();
|
|
268
274
|
setDragOver(false);
|
|
269
275
|
if (props.disabled) return;
|
|
270
|
-
if (e.dataTransfer.files) handleFiles(e.dataTransfer.files);
|
|
276
|
+
if (e.dataTransfer.files) void handleFiles(e.dataTransfer.files);
|
|
271
277
|
};
|
|
272
278
|
|
|
273
279
|
const removeOne = (id: string) => {
|
|
@@ -296,7 +302,7 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
296
302
|
return (
|
|
297
303
|
<div
|
|
298
304
|
key={id}
|
|
299
|
-
className={`relative flex h-9 cursor-zoom-in items-center rounded-md border
|
|
305
|
+
className={`border-input dark:bg-input/30 relative flex h-9 cursor-zoom-in items-center rounded-md border bg-transparent pl-1 ${canClear ? "pr-9" : "pr-2"}`}
|
|
300
306
|
onClick={() => setPreviewId(id)}
|
|
301
307
|
onKeyDown={(e) => {
|
|
302
308
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -372,12 +378,12 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
372
378
|
>
|
|
373
379
|
{uploading ? (
|
|
374
380
|
<>
|
|
375
|
-
<Loader2 className="size-4
|
|
381
|
+
<Loader2 className="mr-1 size-4 animate-spin" />
|
|
376
382
|
{tr("controlUpload.uploading", { default: "Uploading…" })}
|
|
377
383
|
</>
|
|
378
384
|
) : (
|
|
379
385
|
<>
|
|
380
|
-
<Upload className="size-4
|
|
386
|
+
<Upload className="mr-1 size-4" />
|
|
381
387
|
{props.multi
|
|
382
388
|
? tr("controlUpload.chooseFiles", { default: "Choose files" })
|
|
383
389
|
: tr("controlUpload.chooseFile", { default: "Choose a file" })}
|
|
@@ -452,7 +458,7 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
452
458
|
)}
|
|
453
459
|
</div>
|
|
454
460
|
{(previewHasName || previewItem?.mimeType) && (
|
|
455
|
-
<div className="flex flex-col gap-0 border-t
|
|
461
|
+
<div className="bg-muted/30 flex flex-col gap-0 border-t px-4 py-2">
|
|
456
462
|
{previewHasName && (
|
|
457
463
|
<span className="truncate text-sm font-medium">
|
|
458
464
|
{previewItem?.name}
|
|
@@ -469,9 +475,9 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
469
475
|
</Dialog>
|
|
470
476
|
</FormField>
|
|
471
477
|
);
|
|
472
|
-
}
|
|
478
|
+
};
|
|
473
479
|
|
|
474
|
-
|
|
480
|
+
const ItemThumb = (props: { url: string; alt: string }) => {
|
|
475
481
|
const [broken, setBroken] = useState(false);
|
|
476
482
|
if (broken) {
|
|
477
483
|
return (
|
|
@@ -488,7 +494,7 @@ function ItemThumb(props: { url: string; alt: string }) {
|
|
|
488
494
|
onError={() => setBroken(true)}
|
|
489
495
|
/>
|
|
490
496
|
);
|
|
491
|
-
}
|
|
497
|
+
};
|
|
492
498
|
|
|
493
499
|
const formatBytes = (n: number): string => {
|
|
494
500
|
if (!n) return "0 B";
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import { AlephaContext } from "alepha/react";
|
|
4
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
|
+
import { AlephaReactRouter } from "alepha/react/router";
|
|
6
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { DetailAside } from "../detail-aside.tsx";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The identity panel shared by every detail page. What it pins is the row
|
|
13
|
+
* contract: a `copy` row renders its own value and a working copy button, a
|
|
14
|
+
* plain row renders exactly what it was given, and the copy affordance names
|
|
15
|
+
* the row it belongs to — a page with several copyable rows would otherwise
|
|
16
|
+
* offer a screen reader several buttons all called "Copy".
|
|
17
|
+
*/
|
|
18
|
+
describe("DetailAside", () => {
|
|
19
|
+
let alepha: Alepha | undefined;
|
|
20
|
+
|
|
21
|
+
beforeAll(() => {
|
|
22
|
+
setupJsdomMocks();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
afterEach(async () => {
|
|
26
|
+
await alepha?.stop();
|
|
27
|
+
alepha = undefined;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const mount = async (ui: React.ReactNode) => {
|
|
31
|
+
alepha = Alepha.create().with(AlephaReactRouter).with(AlephaReactI18n);
|
|
32
|
+
await alepha.start();
|
|
33
|
+
return render(
|
|
34
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
it("renders the title and each row's label and value", async () => {
|
|
39
|
+
await mount(
|
|
40
|
+
<DetailAside
|
|
41
|
+
title="Bague Aurore"
|
|
42
|
+
rows={[
|
|
43
|
+
{ label: "Reference", value: <span>bague-aurore</span> },
|
|
44
|
+
{ label: "Price", value: "89,00 €" },
|
|
45
|
+
]}
|
|
46
|
+
/>,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(screen.getByText("Bague Aurore")).toBeTruthy();
|
|
50
|
+
expect(screen.getByText("Reference")).toBeTruthy();
|
|
51
|
+
expect(screen.getByText("bague-aurore")).toBeTruthy();
|
|
52
|
+
expect(screen.getByText("89,00 €")).toBeTruthy();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("renders a copy row's text as its own value", async () => {
|
|
56
|
+
await mount(
|
|
57
|
+
<DetailAside
|
|
58
|
+
title="Bague Aurore"
|
|
59
|
+
rows={[{ label: "ID", copy: "0192aaaa-0000-7000-8000-000000000001" }]}
|
|
60
|
+
/>,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
expect(
|
|
64
|
+
screen.getByText("0192aaaa-0000-7000-8000-000000000001"),
|
|
65
|
+
).toBeTruthy();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("names the copy button after its row", async () => {
|
|
69
|
+
await mount(
|
|
70
|
+
<DetailAside
|
|
71
|
+
title="Bague Aurore"
|
|
72
|
+
rows={[
|
|
73
|
+
{ label: "ID", copy: "id-1" },
|
|
74
|
+
{ label: "Reference", copy: "bague-aurore" },
|
|
75
|
+
]}
|
|
76
|
+
/>,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
expect(screen.getByRole("button", { name: "Copy ID" })).toBeTruthy();
|
|
80
|
+
expect(screen.getByRole("button", { name: "Copy Reference" })).toBeTruthy();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("writes the row's copy text to the clipboard", async () => {
|
|
84
|
+
const writeText = vi.fn().mockResolvedValue(undefined);
|
|
85
|
+
Object.defineProperty(navigator, "clipboard", {
|
|
86
|
+
value: { writeText },
|
|
87
|
+
configurable: true,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
await mount(
|
|
91
|
+
<DetailAside
|
|
92
|
+
title="Bague Aurore"
|
|
93
|
+
rows={[
|
|
94
|
+
{ label: "ID", copy: "id-1" },
|
|
95
|
+
{ label: "Reference", copy: "bague-aurore" },
|
|
96
|
+
]}
|
|
97
|
+
/>,
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
screen.getByRole("button", { name: "Copy Reference" }).click();
|
|
101
|
+
|
|
102
|
+
expect(writeText).toHaveBeenCalledWith("bague-aurore");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("falls back to the title's initial when there is no image", async () => {
|
|
106
|
+
await mount(<DetailAside title="bague aurore" rows={[]} />);
|
|
107
|
+
|
|
108
|
+
expect(screen.getByText("B")).toBeTruthy();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("renders no header at all with neither title nor avatar", async () => {
|
|
112
|
+
await mount(
|
|
113
|
+
<DetailAside
|
|
114
|
+
avatar={false}
|
|
115
|
+
rows={[{ label: "Reference", value: "bague-aurore" }]}
|
|
116
|
+
/>,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
// The row survives; nothing above it does. Guards the case a caller
|
|
120
|
+
// reaches for when a breadcrumb already names the thing.
|
|
121
|
+
expect(screen.getByText("Reference")).toBeTruthy();
|
|
122
|
+
expect(screen.queryAllByText("?")).toHaveLength(0);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("drops the avatar entirely on avatar={false}", async () => {
|
|
126
|
+
await mount(<DetailAside avatar={false} title="bague aurore" rows={[]} />);
|
|
127
|
+
|
|
128
|
+
// The initial and nothing else — asserted as the ABSENCE of the "B",
|
|
129
|
+
// because the title is still rendered and starts with the same letter.
|
|
130
|
+
// `queryAllByText` on the exact string is what separates the avatar's
|
|
131
|
+
// lone initial from the title beside it.
|
|
132
|
+
expect(screen.queryAllByText("B")).toHaveLength(0);
|
|
133
|
+
expect(screen.getByText("bague aurore")).toBeTruthy();
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import { AlephaContext } from "alepha/react";
|
|
4
|
+
import { AlephaReactRouter } from "alepha/react/router";
|
|
5
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
6
|
+
import { User } from "lucide-react";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { DetailLayout } from "../detail-layout.tsx";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The shell every admin detail page composes, so what it pins is the contract
|
|
13
|
+
* those pages rely on: the loading and not-found states replace everything
|
|
14
|
+
* (a page must never render half a shell over missing data), the aside and
|
|
15
|
+
* actions reach the DOM, and only the selected tab's body is mounted.
|
|
16
|
+
*/
|
|
17
|
+
describe("DetailLayout", () => {
|
|
18
|
+
let alepha: Alepha | undefined;
|
|
19
|
+
|
|
20
|
+
beforeAll(() => {
|
|
21
|
+
setupJsdomMocks();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(async () => {
|
|
25
|
+
await alepha?.stop();
|
|
26
|
+
alepha = undefined;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const mount = async (ui: React.ReactNode) => {
|
|
30
|
+
alepha = Alepha.create().with(AlephaReactRouter);
|
|
31
|
+
await alepha.start();
|
|
32
|
+
return render(
|
|
33
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const tabs = [
|
|
38
|
+
{ value: "overview", label: "Overview", icon: User },
|
|
39
|
+
{ value: "stock", label: "Stock" },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
it("renders the aside, the tabs and the actions", async () => {
|
|
43
|
+
await mount(
|
|
44
|
+
<DetailLayout
|
|
45
|
+
aside={<p>identity panel</p>}
|
|
46
|
+
tabs={tabs}
|
|
47
|
+
tab="overview"
|
|
48
|
+
onTabChange={() => {}}
|
|
49
|
+
actions={<button type="button">Publish</button>}
|
|
50
|
+
>
|
|
51
|
+
<p>overview body</p>
|
|
52
|
+
</DetailLayout>,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(screen.getByText("identity panel")).toBeTruthy();
|
|
56
|
+
expect(screen.getByText("overview body")).toBeTruthy();
|
|
57
|
+
expect(screen.getByRole("button", { name: "Publish" })).toBeTruthy();
|
|
58
|
+
expect(screen.getByText("Overview")).toBeTruthy();
|
|
59
|
+
expect(screen.getByText("Stock")).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("reports the picked tab's value to onTabChange", async () => {
|
|
63
|
+
const onTabChange = vi.fn();
|
|
64
|
+
await mount(
|
|
65
|
+
<DetailLayout
|
|
66
|
+
aside={null}
|
|
67
|
+
tabs={tabs}
|
|
68
|
+
tab="overview"
|
|
69
|
+
onTabChange={onTabChange}
|
|
70
|
+
/>,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
screen.getByText("Stock").click();
|
|
74
|
+
|
|
75
|
+
expect(onTabChange).toHaveBeenCalledWith("stock");
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The whole reason `loading` lives on the layout rather than at each call
|
|
80
|
+
* site: a page that rendered its aside from a half-loaded record would read
|
|
81
|
+
* as real data.
|
|
82
|
+
*/
|
|
83
|
+
it("replaces the entire shell while loading", async () => {
|
|
84
|
+
await mount(
|
|
85
|
+
<DetailLayout
|
|
86
|
+
loading
|
|
87
|
+
aside={<p>identity panel</p>}
|
|
88
|
+
tabs={tabs}
|
|
89
|
+
tab="overview"
|
|
90
|
+
onTabChange={() => {}}
|
|
91
|
+
actions={<button type="button">Publish</button>}
|
|
92
|
+
>
|
|
93
|
+
<p>overview body</p>
|
|
94
|
+
</DetailLayout>,
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
expect(screen.queryByText("identity panel")).toBeNull();
|
|
98
|
+
expect(screen.queryByText("overview body")).toBeNull();
|
|
99
|
+
expect(screen.queryByRole("button", { name: "Publish" })).toBeNull();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("replaces the entire shell when not found, and offers the way back", async () => {
|
|
103
|
+
const onBack = vi.fn();
|
|
104
|
+
await mount(
|
|
105
|
+
<DetailLayout
|
|
106
|
+
notFound={{
|
|
107
|
+
message: "Product not found.",
|
|
108
|
+
backLabel: "Back to catalogue",
|
|
109
|
+
onBack,
|
|
110
|
+
}}
|
|
111
|
+
aside={<p>identity panel</p>}
|
|
112
|
+
tabs={tabs}
|
|
113
|
+
tab="overview"
|
|
114
|
+
onTabChange={() => {}}
|
|
115
|
+
>
|
|
116
|
+
<p>overview body</p>
|
|
117
|
+
</DetailLayout>,
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
expect(screen.queryByText("identity panel")).toBeNull();
|
|
121
|
+
expect(screen.queryByText("overview body")).toBeNull();
|
|
122
|
+
expect(screen.getByText("Product not found.")).toBeTruthy();
|
|
123
|
+
|
|
124
|
+
screen.getByRole("button", { name: /Back to catalogue/ }).click();
|
|
125
|
+
expect(onBack).toHaveBeenCalled();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* `loading` wins over `notFound`. A page computes "not found" as "no record",
|
|
130
|
+
* which is also true on the very first render — ordering it the other way
|
|
131
|
+
* flashes "not found" before every successful load.
|
|
132
|
+
*/
|
|
133
|
+
it("prefers the loading state over not-found", async () => {
|
|
134
|
+
await mount(
|
|
135
|
+
<DetailLayout
|
|
136
|
+
loading
|
|
137
|
+
notFound={{
|
|
138
|
+
message: "Product not found.",
|
|
139
|
+
backLabel: "Back",
|
|
140
|
+
onBack: () => {},
|
|
141
|
+
}}
|
|
142
|
+
aside={null}
|
|
143
|
+
tabs={tabs}
|
|
144
|
+
tab="overview"
|
|
145
|
+
onTabChange={() => {}}
|
|
146
|
+
/>,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
expect(screen.queryByText("Product not found.")).toBeNull();
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Avatar,
|
|
7
|
+
AvatarFallback,
|
|
8
|
+
AvatarImage,
|
|
9
|
+
} from "@alepha/ui/components/ui/avatar";
|
|
10
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
11
|
+
import { useI18n } from "alepha/react/i18n";
|
|
12
|
+
import { Check, Copy } from "lucide-react";
|
|
13
|
+
import { useEffect, useRef, useState } from "react";
|
|
14
|
+
|
|
15
|
+
export interface DetailAsideRow {
|
|
16
|
+
/**
|
|
17
|
+
* Doubles as the React key, so two rows in one aside must not share a label.
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
value?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Renders a copy-to-clipboard button beside the value. When `value` is
|
|
23
|
+
* omitted the row renders this text as the value, in mono — the shape an id
|
|
24
|
+
* row wants.
|
|
25
|
+
*/
|
|
26
|
+
copy?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DetailAsideProps {
|
|
30
|
+
/**
|
|
31
|
+
* Omit when something else on screen already names the thing — a
|
|
32
|
+
* breadcrumb leaf, most often. With no title and no avatar the header
|
|
33
|
+
* block is not rendered at all and the list starts at the top edge.
|
|
34
|
+
*/
|
|
35
|
+
title?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Thumbnail or avatar source. Falls back to {@link fallback}.
|
|
38
|
+
*/
|
|
39
|
+
image?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Shown in place of a missing image. Defaults to the title's initial.
|
|
42
|
+
*/
|
|
43
|
+
fallback?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Set `false` for an entity that has no avatar concept at all, and the
|
|
46
|
+
* title stands alone.
|
|
47
|
+
*
|
|
48
|
+
* The letter fallback earns its place when the thing *has* a picture and
|
|
49
|
+
* happens to be missing one — a user without an uploaded photo is still a
|
|
50
|
+
* face-shaped hole. For something that could never have had one, a large
|
|
51
|
+
* square holding the first letter of a title printed beside it is the same
|
|
52
|
+
* character twice at two sizes.
|
|
53
|
+
*/
|
|
54
|
+
avatar?: boolean;
|
|
55
|
+
rows: DetailAsideRow[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The identity panel of a detail page: a thumbnail and title above a dense
|
|
60
|
+
* label/value list.
|
|
61
|
+
*
|
|
62
|
+
* Dense rather than a marketing hero — the list is what a reader scans, so it
|
|
63
|
+
* is a `<dl>` of small caps labels over their values, and a row with nothing
|
|
64
|
+
* to say is left out by the caller rather than rendered empty.
|
|
65
|
+
*
|
|
66
|
+
* Extracted from the admin user detail page and shared by every detail page
|
|
67
|
+
* since, which is why the clipboard behaviour lives here: each of them wants
|
|
68
|
+
* a copyable id, and each of them had reimplemented it. It moved out of
|
|
69
|
+
* `components/admin/` alongside {@link DetailLayout} once a non-admin page
|
|
70
|
+
* (Lore's Epic view) became a consumer.
|
|
71
|
+
*/
|
|
72
|
+
export const DetailAside = (props: DetailAsideProps) => {
|
|
73
|
+
const { tr } = useI18n();
|
|
74
|
+
|
|
75
|
+
// Which row last had its value copied, so only that row shows the tick.
|
|
76
|
+
const [copiedLabel, setCopiedLabel] = useState<string>();
|
|
77
|
+
const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
78
|
+
useEffect(
|
|
79
|
+
() => () => {
|
|
80
|
+
if (timer.current) clearTimeout(timer.current);
|
|
81
|
+
},
|
|
82
|
+
[],
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const copy = async (row: DetailAsideRow) => {
|
|
86
|
+
if (!row.copy) return;
|
|
87
|
+
try {
|
|
88
|
+
await navigator.clipboard.writeText(row.copy);
|
|
89
|
+
setCopiedLabel(row.label);
|
|
90
|
+
if (timer.current) clearTimeout(timer.current);
|
|
91
|
+
timer.current = setTimeout(() => setCopiedLabel(undefined), 1_500);
|
|
92
|
+
} catch {
|
|
93
|
+
// clipboard may be unavailable (insecure context); ignore
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const initial = (props.fallback ?? props.title ?? "?")
|
|
98
|
+
.charAt(0)
|
|
99
|
+
.toUpperCase();
|
|
100
|
+
|
|
101
|
+
const showAvatar = props.avatar !== false;
|
|
102
|
+
const header = showAvatar || props.title;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className="flex flex-col gap-4">
|
|
106
|
+
{header ? (
|
|
107
|
+
<div className="flex items-center gap-3">
|
|
108
|
+
{showAvatar && (
|
|
109
|
+
<Avatar className="size-10 rounded-md after:rounded-md">
|
|
110
|
+
{props.image && (
|
|
111
|
+
<AvatarImage
|
|
112
|
+
src={props.image}
|
|
113
|
+
alt={props.title ?? ""}
|
|
114
|
+
className="rounded-md"
|
|
115
|
+
/>
|
|
116
|
+
)}
|
|
117
|
+
<AvatarFallback className="rounded-md">{initial}</AvatarFallback>
|
|
118
|
+
</Avatar>
|
|
119
|
+
)}
|
|
120
|
+
{props.title ? (
|
|
121
|
+
<span
|
|
122
|
+
className="min-w-0 flex-1 truncate text-sm font-semibold tracking-tight"
|
|
123
|
+
title={props.title}
|
|
124
|
+
>
|
|
125
|
+
{props.title}
|
|
126
|
+
</span>
|
|
127
|
+
) : null}
|
|
128
|
+
</div>
|
|
129
|
+
) : null}
|
|
130
|
+
{/* The list is a bordered card whose rows are divided from each other,
|
|
131
|
+
rather than a run of rows separated by whitespace.
|
|
132
|
+
|
|
133
|
+
It replaced a single `border-t` above the list, which existed only
|
|
134
|
+
to separate it from the header and had to be dropped when there was
|
|
135
|
+
no header to separate it from (a top border with empty space above
|
|
136
|
+
it reads as a clipped element). The card's own border does that job
|
|
137
|
+
on every side, so the conditional is gone: the panel looks the same
|
|
138
|
+
whether or not a title sits above it.
|
|
139
|
+
|
|
140
|
+
`divide-y` instead of a border on each row: a border-bottom on all
|
|
141
|
+
of them doubles up against the card's own bottom edge, and skipping
|
|
142
|
+
the last one by hand is the rule `divide-y` already encodes.
|
|
143
|
+
|
|
144
|
+
`gap-3` had to go with it. Rows that are spaced apart AND ruled show
|
|
145
|
+
the rule floating in the gap rather than meeting the rows it
|
|
146
|
+
divides; `py-2.5` inside each row is what carries the rhythm now.
|
|
147
|
+
|
|
148
|
+
`overflow-hidden` for the corners: with nothing painting a
|
|
149
|
+
background today the radius is only on the border, but the first
|
|
150
|
+
and last rows sit in the rounded corners and anything they gain
|
|
151
|
+
later (a hover tint, a status band) would square them off. */}
|
|
152
|
+
<dl className="flex flex-col divide-y overflow-hidden rounded-lg border text-sm">
|
|
153
|
+
{props.rows.map((row) => (
|
|
154
|
+
<div key={row.label} className="flex flex-col gap-0.5 px-3 py-2.5">
|
|
155
|
+
<dt className="text-muted-foreground text-[11px] font-medium tracking-wide uppercase">
|
|
156
|
+
{row.label}
|
|
157
|
+
</dt>
|
|
158
|
+
<dd className="min-w-0">
|
|
159
|
+
{row.copy ? (
|
|
160
|
+
<div className="flex items-center gap-1">
|
|
161
|
+
{row.value ?? (
|
|
162
|
+
<code
|
|
163
|
+
className="text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs"
|
|
164
|
+
title={row.copy}
|
|
165
|
+
>
|
|
166
|
+
{row.copy}
|
|
167
|
+
</code>
|
|
168
|
+
)}
|
|
169
|
+
<Button
|
|
170
|
+
type="button"
|
|
171
|
+
variant="ghost"
|
|
172
|
+
size="icon-xs"
|
|
173
|
+
onClick={() => copy(row)}
|
|
174
|
+
aria-label={String(
|
|
175
|
+
tr("admin.detail.copyValue", {
|
|
176
|
+
default: `Copy ${row.label}`,
|
|
177
|
+
args: [row.label],
|
|
178
|
+
}),
|
|
179
|
+
)}
|
|
180
|
+
className="text-muted-foreground hover:text-foreground shrink-0"
|
|
181
|
+
>
|
|
182
|
+
{copiedLabel === row.label ? (
|
|
183
|
+
<Check className="size-3.5" />
|
|
184
|
+
) : (
|
|
185
|
+
<Copy className="size-3.5" />
|
|
186
|
+
)}
|
|
187
|
+
</Button>
|
|
188
|
+
</div>
|
|
189
|
+
) : (
|
|
190
|
+
row.value
|
|
191
|
+
)}
|
|
192
|
+
</dd>
|
|
193
|
+
</div>
|
|
194
|
+
))}
|
|
195
|
+
</dl>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
};
|