@alepha/ui 0.27.0 → 0.27.1
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 +56 -15
- package/dist/components/account/account-connections.d.ts.map +1 -1
- package/dist/components/account/account-connections.js +24 -13
- 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 -8
- package/dist/components/account/account-delete-dialog.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/components/account/account-keys.js +35 -21
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-mfa-dialog.d.ts +20 -0
- package/dist/components/account/account-mfa-dialog.d.ts.map +1 -0
- package/dist/components/account/account-mfa-dialog.js +149 -0
- package/dist/components/account/account-mfa-dialog.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -1
- package/dist/components/account/account-password-dialog.js +15 -10
- package/dist/components/account/account-password-dialog.js.map +1 -1
- package/dist/components/account/account-profile.d.ts.map +1 -1
- package/dist/components/account/account-profile.js +25 -25
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router.d.ts +76 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +44 -4
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts +11 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +119 -32
- 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 +46 -24
- package/dist/components/account/account-sessions.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 +4 -9
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +3 -3
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-labels.d.ts +26 -0
- package/dist/components/admin/admin-jobs-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-labels.js +46 -0
- package/dist/components/admin/admin-jobs-status-labels.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +5 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts +21 -0
- package/dist/components/admin/admin-notifications-detail-tabs.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js +122 -0
- package/dist/components/admin/admin-notifications-detail-tabs.js.map +1 -0
- package/dist/components/admin/admin-notifications-detail.d.ts +23 -0
- package/dist/components/admin/admin-notifications-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-detail.js +48 -0
- package/dist/components/admin/admin-notifications-detail.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts +13 -0
- package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-body.js +64 -0
- package/dist/components/admin/admin-notifications-preview-body.js.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts +24 -0
- package/dist/components/admin/admin-notifications-preview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-preview-tab.js +35 -0
- package/dist/components/admin/admin-notifications-preview-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts +18 -0
- package/dist/components/admin/admin-notifications-raw-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-raw-tab.js +53 -0
- package/dist/components/admin/admin-notifications-raw-tab.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-badge.js +32 -0
- package/dist/components/admin/admin-notifications-status-badge.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts +17 -0
- package/dist/components/admin/admin-notifications-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-labels.js +33 -0
- package/dist/components/admin/admin-notifications-status-labels.js.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts +44 -0
- package/dist/components/admin/admin-notifications-status-tones.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-status-tones.js +64 -0
- package/dist/components/admin/admin-notifications-status-tones.js.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts +16 -0
- package/dist/components/admin/admin-notifications-template-label.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications-template-label.js +24 -0
- package/dist/components/admin/admin-notifications-template-label.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +13 -2
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +264 -29
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +29 -2
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +68 -8
- 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 +1 -1
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +12 -2
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +63 -44
- package/dist/components/admin/admin-user-detail-security-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 +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 +20 -15
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users.js +1 -1
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +4 -12
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +3 -3
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-labels.d.ts +19 -0
- package/dist/components/admin/admin-workflows-status-labels.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-labels.js +48 -0
- package/dist/components/admin/admin-workflows-status-labels.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +6 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +33 -5
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +27 -17
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-mfa-step.d.ts +25 -0
- package/dist/components/auth/auth-mfa-step.d.ts.map +1 -0
- package/dist/components/auth/auth-mfa-step.js +122 -0
- package/dist/components/auth/auth-mfa-step.js.map +1 -0
- package/dist/components/auth/auth-register.js +2 -2
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.js +2 -2
- package/dist/components/auth/auth-router.d.ts +20 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.d.ts.map +1 -1
- package/dist/components/auth/provider-labels.js +1 -0
- package/dist/components/auth/provider-labels.js.map +1 -1
- package/dist/components/control/control.d.ts +11 -2
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +7 -2
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +55 -10
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +5 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +1 -0
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +12 -1
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- 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-password/control-password.d.ts.map +1 -1
- package/dist/components/control-password/control-password.js +1 -0
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/detail/detail-layout.d.ts +6 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -1
- package/dist/components/detail/detail-layout.js +2 -1
- package/dist/components/detail/detail-layout.js.map +1 -1
- package/dist/components/email-body-frame/email-body-frame.d.ts +37 -0
- package/dist/components/email-body-frame/email-body-frame.d.ts.map +1 -0
- package/dist/components/email-body-frame/email-body-frame.js +44 -0
- package/dist/components/email-body-frame/email-body-frame.js.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts +33 -0
- package/dist/components/markdown-view/diagram/DiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/{FlowchartDiagramLabel.js → DiagramLabel.js} +15 -6
- package/dist/components/markdown-view/diagram/DiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +0 -5
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +2 -6
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +2 -3
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +20 -11
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
- package/dist/components/markdown-view/diagram/MermaidFence.js +48 -13
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts +50 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js +141 -0
- package/dist/components/markdown-view/diagram/SequenceDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js +101 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts +23 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js +77 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts +16 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js +39 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramNote.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts +20 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js +61 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts +27 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js +65 -0
- package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts +155 -0
- package/dist/components/markdown-view/diagram/layoutSequence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js +478 -0
- package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts +132 -0
- package/dist/components/markdown-view/diagram/sequenceModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceModel.js +0 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts +32 -0
- package/dist/components/markdown-view/diagram/sequenceParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js +312 -0
- package/dist/components/markdown-view/diagram/sequenceParser.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +65 -0
- package/dist/components/markdown-view/markdown-view.d.ts +18 -11
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +30 -16
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-page.d.ts +7 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-page.js.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.d.ts +64 -2
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-tree-util.js +29 -6
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts +3 -2
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js +9 -6
- 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 +9 -2
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +6 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +8 -3
- 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 +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +2 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +2 -2
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/card.d.ts +2 -2
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/card.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 +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts +2 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +2 -2
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +1 -0
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +2 -2
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +1 -0
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +1 -0
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/segmented.d.ts +11 -0
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +6 -2
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +2 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +1 -11
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +0 -10
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +252 -2
- package/dist/lib/i18n-fr.js.map +1 -1
- package/package.json +5 -5
- package/src/components/account/__tests__/account-router.spec.ts +25 -0
- package/src/components/account/__tests__/account-security-mfa-gate.browser.spec.tsx +76 -0
- package/src/components/account/account-connections.tsx +50 -18
- package/src/components/account/account-delete-dialog.tsx +24 -9
- package/src/components/account/account-header.tsx +4 -1
- package/src/components/account/account-keys.tsx +73 -29
- package/src/components/account/account-mfa-dialog.tsx +233 -0
- package/src/components/account/account-password-dialog.tsx +42 -12
- package/src/components/account/account-profile.tsx +66 -25
- package/src/components/account/account-router.tsx +47 -6
- package/src/components/account/account-security.tsx +209 -22
- package/src/components/account/account-sessions.tsx +87 -22
- package/src/components/action-error-toaster/__tests__/action-error-toaster.browser.spec.tsx +114 -0
- package/src/components/admin/__tests__/admin-nav-i18n.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +128 -0
- package/src/components/admin/__tests__/admin-notifications-raw-tab.browser.spec.tsx +76 -0
- package/src/components/admin/__tests__/admin-notifications-status-badge.browser.spec.tsx +121 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +27 -0
- package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +152 -0
- package/src/components/admin/__tests__/admin-user-detail-security-tab.browser.spec.tsx +92 -0
- package/src/components/admin/admin-jobs-executions-panel.tsx +8 -11
- package/src/components/admin/admin-jobs-status-badge.tsx +4 -5
- package/src/components/admin/admin-jobs-status-labels.ts +46 -0
- package/src/components/admin/admin-layout.tsx +9 -3
- package/src/components/admin/admin-notifications-detail-tabs.tsx +167 -0
- package/src/components/admin/admin-notifications-detail.tsx +100 -0
- package/src/components/admin/admin-notifications-preview-body.tsx +104 -0
- package/src/components/admin/admin-notifications-preview-tab.tsx +55 -0
- package/src/components/admin/admin-notifications-raw-tab.tsx +76 -0
- package/src/components/admin/admin-notifications-status-badge.tsx +44 -0
- package/src/components/admin/admin-notifications-status-labels.ts +42 -0
- package/src/components/admin/admin-notifications-status-tones.ts +85 -0
- package/src/components/admin/admin-notifications-template-label.ts +22 -0
- package/src/components/admin/admin-notifications.tsx +398 -31
- package/src/components/admin/admin-router.tsx +65 -8
- package/src/components/admin/admin-sessions.tsx +10 -3
- package/src/components/admin/admin-user-detail-security-tab.tsx +70 -5
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +10 -3
- package/src/components/admin/admin-user-detail.tsx +92 -23
- package/src/components/admin/admin-users.tsx +1 -1
- package/src/components/admin/admin-workflows-executions-panel.tsx +8 -16
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -5
- package/src/components/admin/admin-workflows-status-labels.ts +51 -0
- package/src/components/alepha-table/__tests__/alepha-table-row-key.browser.spec.tsx +106 -0
- package/src/components/alepha-table/alepha-table.tsx +50 -10
- package/src/components/auth/auth-login.tsx +37 -18
- package/src/components/auth/auth-mfa-step.tsx +177 -0
- package/src/components/auth/auth-register.tsx +1 -1
- package/src/components/auth/provider-labels.ts +4 -0
- package/src/components/control/__tests__/control-autofocus.browser.spec.tsx +107 -0
- package/src/components/control/control.tsx +20 -5
- package/src/components/control-array/__tests__/control-array-child-change.browser.spec.tsx +90 -0
- package/src/components/control-array/control-array.tsx +85 -13
- package/src/components/control-number/control-number.tsx +7 -0
- package/src/components/control-object/__tests__/control-object-clear.browser.spec.tsx +100 -0
- package/src/components/control-object/control-object.tsx +21 -2
- package/src/components/control-password/control-password.tsx +2 -1
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +36 -0
- package/src/components/detail/detail-layout.tsx +20 -1
- package/src/components/email-body-frame/__tests__/email-body-frame.browser.spec.tsx +52 -0
- package/src/components/email-body-frame/email-body-frame.tsx +81 -0
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +65 -2
- package/src/components/markdown-view/diagram/{FlowchartDiagramLabel.tsx → DiagramLabel.tsx} +14 -4
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +1 -6
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +1 -1
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +2 -3
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +2 -3
- package/src/components/markdown-view/diagram/MermaidFence.tsx +65 -15
- package/src/components/markdown-view/diagram/SequenceDiagram.tsx +203 -0
- package/src/components/markdown-view/diagram/SequenceDiagramFragment.tsx +120 -0
- package/src/components/markdown-view/diagram/SequenceDiagramMessage.tsx +100 -0
- package/src/components/markdown-view/diagram/SequenceDiagramNote.tsx +46 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipant.tsx +80 -0
- package/src/components/markdown-view/diagram/SequenceDiagramParticipantActor.tsx +74 -0
- package/src/components/markdown-view/diagram/__tests__/sequence-diagram.browser.spec.tsx +267 -0
- package/src/components/markdown-view/diagram/layoutSequence.spec.ts +535 -0
- package/src/components/markdown-view/diagram/layoutSequence.ts +764 -0
- package/src/components/markdown-view/diagram/sequenceModel.ts +141 -0
- package/src/components/markdown-view/diagram/sequenceParser.spec.ts +495 -0
- package/src/components/markdown-view/diagram/sequenceParser.ts +443 -0
- package/src/components/markdown-view/markdown-view.css +65 -0
- package/src/components/markdown-view/markdown-view.tsx +34 -16
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +107 -1
- package/src/components/nav-shell/nav-page.tsx +8 -0
- package/src/components/nav-shell/nav-tree-util.ts +95 -2
- package/src/components/nav-shell/spotlight.tsx +22 -8
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +9 -2
- package/src/components/nav-shell/use-nav-entries.ts +18 -2
- package/src/components/nav-shell/use-nav-tree.ts +4 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +3 -3
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -8
- package/src/components/ui/command.tsx +4 -4
- package/src/components/ui/context-menu.tsx +7 -7
- package/src/components/ui/dialog.tsx +1 -1
- package/src/components/ui/drawer.tsx +6 -6
- package/src/components/ui/dropdown-menu.tsx +8 -14
- package/src/components/ui/empty.tsx +3 -3
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +2 -2
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/pagination.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/segmented.tsx +28 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/sheet.tsx +4 -4
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +6 -9
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -11
- package/src/components/use-dialog/__tests__/use-dialog-providers.browser.spec.tsx +61 -0
- package/src/hooks/use-mobile.ts +1 -1
- package/src/lib/__tests__/i18n-fr.spec.ts +27 -5
- package/src/lib/i18n-fr.ts +308 -1
- package/dist/components/language-toggle/language-toggle.d.ts +0 -8
- package/dist/components/language-toggle/language-toggle.d.ts.map +0 -1
- package/dist/components/language-toggle/language-toggle.js +0 -49
- package/dist/components/language-toggle/language-toggle.js.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +0 -23
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +0 -1
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +0 -1
- package/dist/components/ui/accordion.d.ts +0 -7
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -55
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/aspect-ratio.d.ts +0 -5
- package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/components/ui/aspect-ratio.js +0 -15
- package/dist/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/carousel.d.ts +0 -29
- package/dist/components/ui/carousel.d.ts.map +0 -1
- package/dist/components/ui/carousel.js +0 -144
- package/dist/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts +0 -6
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js +0 -26
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/direction.d.ts +0 -2
- package/dist/components/ui/direction.d.ts.map +0 -1
- package/dist/components/ui/direction.js +0 -3
- package/dist/components/ui/item.d.ts +0 -23
- package/dist/components/ui/item.d.ts.map +0 -1
- package/dist/components/ui/item.js +0 -122
- package/dist/components/ui/item.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts +0 -12
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js +0 -84
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/radio-group.d.ts +0 -6
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/radio-group.js +0 -29
- package/dist/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts +0 -5
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -38
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/toggle-group.d.ts +0 -12
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -60
- package/dist/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/toggle.d.ts +0 -9
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -38
- package/dist/components/ui/toggle.js.map +0 -1
- package/src/components/language-toggle/language-toggle.tsx +0 -66
- package/src/components/ui/accordion.tsx +0 -77
- package/src/components/ui/aspect-ratio.tsx +0 -22
- package/src/components/ui/carousel.tsx +0 -258
- package/src/components/ui/collapsible.tsx +0 -21
- package/src/components/ui/direction.tsx +0 -6
- package/src/components/ui/item.tsx +0 -200
- package/src/components/ui/navigation-menu.tsx +0 -170
- package/src/components/ui/radio-group.tsx +0 -37
- package/src/components/ui/scroll-area.tsx +0 -53
- package/src/components/ui/toggle-group.tsx +0 -93
- package/src/components/ui/toggle.tsx +0 -44
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useI18n } from "alepha/react/i18n";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The workflow-execution vocabulary, in the order the filter offers it.
|
|
5
|
+
*
|
|
6
|
+
* `skipped` is deliberately absent: it is a STEP status only, so offering it
|
|
7
|
+
* as an execution filter would be a value the query can never match. The
|
|
8
|
+
* labels below still carry it, because the badge renders step rows too.
|
|
9
|
+
*/
|
|
10
|
+
export const WORKFLOW_EXECUTION_STATUSES = [
|
|
11
|
+
"pending",
|
|
12
|
+
"running",
|
|
13
|
+
"completed",
|
|
14
|
+
"failed",
|
|
15
|
+
"timed_out",
|
|
16
|
+
"compensating",
|
|
17
|
+
"compensated",
|
|
18
|
+
"compensation_failed",
|
|
19
|
+
"cancelled",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Localised workflow status labels, keyed by status.
|
|
24
|
+
*
|
|
25
|
+
* Covers both vocabularies - `workflowExecutions` and `workflowStepExecutions`
|
|
26
|
+
* differ only on `timed_out` / `skipped` - because the badge takes either.
|
|
27
|
+
*
|
|
28
|
+
* One literal `tr()` per status: see {@link useJobStatusLabels} for why a
|
|
29
|
+
* computed key could never have been translated.
|
|
30
|
+
*/
|
|
31
|
+
export const useWorkflowStatusLabels = (): Record<string, string> => {
|
|
32
|
+
const { tr } = useI18n();
|
|
33
|
+
return {
|
|
34
|
+
pending: tr("admin.workflows.status.pending", { default: "Pending" }),
|
|
35
|
+
running: tr("admin.workflows.status.running", { default: "Running" }),
|
|
36
|
+
completed: tr("admin.workflows.status.completed", { default: "Completed" }),
|
|
37
|
+
failed: tr("admin.workflows.status.failed", { default: "Failed" }),
|
|
38
|
+
timed_out: tr("admin.workflows.status.timedOut", { default: "Timed out" }),
|
|
39
|
+
skipped: tr("admin.workflows.status.skipped", { default: "Skipped" }),
|
|
40
|
+
compensating: tr("admin.workflows.status.compensating", {
|
|
41
|
+
default: "Compensating",
|
|
42
|
+
}),
|
|
43
|
+
compensated: tr("admin.workflows.status.compensated", {
|
|
44
|
+
default: "Compensated",
|
|
45
|
+
}),
|
|
46
|
+
compensation_failed: tr("admin.workflows.status.compensationFailed", {
|
|
47
|
+
default: "Compensation failed",
|
|
48
|
+
}),
|
|
49
|
+
cancelled: tr("admin.workflows.status.cancelled", { default: "Cancelled" }),
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { fireEvent, render, screen, waitFor } 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 { useState } from "react";
|
|
8
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
9
|
+
|
|
10
|
+
import { AlephaTable } from "../alepha-table.tsx";
|
|
11
|
+
|
|
12
|
+
/** No `id`, on purpose: this is the case that fell back to `Math.random()`. */
|
|
13
|
+
interface Row {
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Rows without an `id` used to be keyed with `Math.random()`, so every render
|
|
19
|
+
* produced a new key and React remounted the row. Anything living in that row
|
|
20
|
+
* - focus, an uncommitted input value, a selection - was destroyed by a
|
|
21
|
+
* re-render caused somewhere else entirely.
|
|
22
|
+
*/
|
|
23
|
+
describe("AlephaTable row keys without an id", () => {
|
|
24
|
+
let alepha: Alepha | undefined;
|
|
25
|
+
|
|
26
|
+
beforeAll(() => {
|
|
27
|
+
setupJsdomMocks();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterEach(async () => {
|
|
31
|
+
await alepha?.stop();
|
|
32
|
+
alepha = undefined;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const mount = async (ui: React.ReactNode) => {
|
|
36
|
+
alepha = Alepha.create().with(AlephaReactRouter).with(AlephaReactI18n);
|
|
37
|
+
await alepha.start();
|
|
38
|
+
return render(
|
|
39
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A table with an inline input, plus a counter outside it whose only job is
|
|
45
|
+
* to force a re-render of the whole tree without touching `data`.
|
|
46
|
+
*/
|
|
47
|
+
const Harness = () => {
|
|
48
|
+
const [tick, setTick] = useState(0);
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<button type="button" onClick={() => setTick((n) => n + 1)}>
|
|
52
|
+
rerender
|
|
53
|
+
</button>
|
|
54
|
+
<span data-testid="tick">{tick}</span>
|
|
55
|
+
<AlephaTable<Row>
|
|
56
|
+
data={[{ title: "Alpha" }, { title: "Beta" }]}
|
|
57
|
+
columns={{
|
|
58
|
+
title: {
|
|
59
|
+
label: "Title",
|
|
60
|
+
cell: (r: Row) => (
|
|
61
|
+
<input aria-label={`edit ${r.title}`} defaultValue={r.title} />
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
it("keeps focus in an inline input across an unrelated re-render", async () => {
|
|
71
|
+
await mount(<Harness />);
|
|
72
|
+
|
|
73
|
+
const input = await screen.findByLabelText("edit Alpha");
|
|
74
|
+
(input as HTMLInputElement).focus();
|
|
75
|
+
expect(document.activeElement).toBe(input);
|
|
76
|
+
|
|
77
|
+
fireEvent.click(screen.getByRole("button", { name: "rerender" }));
|
|
78
|
+
await waitFor(() =>
|
|
79
|
+
expect(screen.getByTestId("tick").textContent).toBe("1"),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// Same element, still focused. A remount would have replaced the node,
|
|
83
|
+
// dropping focus to <body>.
|
|
84
|
+
expect(screen.getByLabelText("edit Alpha")).toBe(input);
|
|
85
|
+
expect(document.activeElement).toBe(input);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("keeps an uncommitted edit across an unrelated re-render", async () => {
|
|
89
|
+
await mount(<Harness />);
|
|
90
|
+
|
|
91
|
+
const input = (await screen.findByLabelText(
|
|
92
|
+
"edit Beta",
|
|
93
|
+
)) as HTMLInputElement;
|
|
94
|
+
fireEvent.change(input, { target: { value: "Beta (editing)" } });
|
|
95
|
+
|
|
96
|
+
fireEvent.click(screen.getByRole("button", { name: "rerender" }));
|
|
97
|
+
await waitFor(() =>
|
|
98
|
+
expect(screen.getByTestId("tick").textContent).toBe("1"),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// `defaultValue` means a remount would reset this to "Beta".
|
|
102
|
+
expect((screen.getByLabelText("edit Beta") as HTMLInputElement).value).toBe(
|
|
103
|
+
"Beta (editing)",
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -279,6 +279,12 @@ export interface AlephaTableBaseProps<T> {
|
|
|
279
279
|
pageSizes?: number[];
|
|
280
280
|
/**
|
|
281
281
|
* Stable row identifier. Defaults to `item.id`.
|
|
282
|
+
*
|
|
283
|
+
* Rows with neither fall back to their position in the current page, which
|
|
284
|
+
* is stable across renders but NOT across sorting or paging - the same row
|
|
285
|
+
* sorted into a different slot becomes a different row as far as React and
|
|
286
|
+
* the selection are concerned. Pass this whenever rows can be selected or
|
|
287
|
+
* hold an inline input and the data has no `id`.
|
|
282
288
|
*/
|
|
283
289
|
rowKey?: (item: T) => string;
|
|
284
290
|
/**
|
|
@@ -388,12 +394,6 @@ export interface AlephaTableBaseProps<T> {
|
|
|
388
394
|
autoApplyFilters?: boolean;
|
|
389
395
|
}
|
|
390
396
|
|
|
391
|
-
const defaultRowKey = (item: unknown): string =>
|
|
392
|
-
// Coercion at a boundary: the value is a form/route/chart primitive whose
|
|
393
|
-
// declared type is wider than what can reach here.
|
|
394
|
-
// oxlint-disable-next-line typescript/no-base-to-string
|
|
395
|
-
String((item as { id?: unknown })?.id ?? Math.random());
|
|
396
|
-
|
|
397
397
|
const EMPTY_FILTERS_SCHEMA = z.object({}) as ZObject;
|
|
398
398
|
|
|
399
399
|
/**
|
|
@@ -448,8 +448,6 @@ const writePersisted = (key: string, suffix: string, value: unknown): void => {
|
|
|
448
448
|
export const PAGE_SIZES = [10, 20, 50, 100];
|
|
449
449
|
|
|
450
450
|
export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
451
|
-
const rowKey = props.rowKey ?? defaultRowKey;
|
|
452
|
-
|
|
453
451
|
// State, not a constant. It was `props.defaultSize ?? 20` read once, so a
|
|
454
452
|
// reader had no way to see more rows than the call site had decided for
|
|
455
453
|
// them. Already in `load`'s dependency array, so changing it refetches.
|
|
@@ -759,6 +757,48 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
759
757
|
return () => clearInterval(id);
|
|
760
758
|
}, [props.pollMs]);
|
|
761
759
|
|
|
760
|
+
// -- Row identity ----------------------------------------------------------
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* A row's key, in order of preference: the caller's `rowKey`, the row's own
|
|
764
|
+
* `id`, then where the row sits.
|
|
765
|
+
*
|
|
766
|
+
* The last one used to be `Math.random()`, which is not an identity at all.
|
|
767
|
+
* Every render produced a new key, so React saw every id-less row as a new
|
|
768
|
+
* row and remounted it: focus in an inline input was lost the moment
|
|
769
|
+
* anything else re-rendered, and the list re-animated on every keystroke.
|
|
770
|
+
* Selection was broken by the same thing - `selection.has(rowKey(item))`
|
|
771
|
+
* compared against a key generated one render earlier, so it never matched.
|
|
772
|
+
*/
|
|
773
|
+
const rowKeys = useMemo(
|
|
774
|
+
() =>
|
|
775
|
+
data.map((item, index) => {
|
|
776
|
+
if (props.rowKey) return props.rowKey(item);
|
|
777
|
+
const id = (item as { id?: unknown })?.id;
|
|
778
|
+
// Coercion at a boundary: the value is a form/route/chart primitive
|
|
779
|
+
// whose declared type is wider than what can reach here.
|
|
780
|
+
// oxlint-disable-next-line typescript/no-base-to-string
|
|
781
|
+
return id != null ? String(id) : `page-${page}-row-${index}`;
|
|
782
|
+
}),
|
|
783
|
+
[data, page, props.rowKey],
|
|
784
|
+
);
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Selection asks for a key by item, not by index. Every item it can ask
|
|
788
|
+
* about is one of `data`'s, so a lookup keyed on identity covers it without
|
|
789
|
+
* an O(n) scan per call.
|
|
790
|
+
*/
|
|
791
|
+
const rowKeyByItem = useMemo(() => {
|
|
792
|
+
const map = new Map<T, string>();
|
|
793
|
+
data.forEach((item, index) => map.set(item, rowKeys[index]));
|
|
794
|
+
return map;
|
|
795
|
+
}, [data, rowKeys]);
|
|
796
|
+
|
|
797
|
+
const rowKey = useCallback(
|
|
798
|
+
(item: T): string => rowKeyByItem.get(item) ?? "",
|
|
799
|
+
[rowKeyByItem],
|
|
800
|
+
);
|
|
801
|
+
|
|
762
802
|
// -- Selection -------------------------------------------------------------
|
|
763
803
|
|
|
764
804
|
const {
|
|
@@ -1202,8 +1242,8 @@ export function AlephaTable<T>(props: AlephaTableProps<T>) {
|
|
|
1202
1242
|
</TableCell>
|
|
1203
1243
|
</TableRow>
|
|
1204
1244
|
) : (
|
|
1205
|
-
data.map((item) => {
|
|
1206
|
-
const key =
|
|
1245
|
+
data.map((item, rowIndex) => {
|
|
1246
|
+
const key = rowKeys[rowIndex];
|
|
1207
1247
|
const isSelected = selection.has(key);
|
|
1208
1248
|
return (
|
|
1209
1249
|
<TableRow
|
|
@@ -10,14 +10,15 @@ import { Card, CardContent } from "@alepha/ui/components/ui/card";
|
|
|
10
10
|
import { Separator } from "@alepha/ui/components/ui/separator";
|
|
11
11
|
import { AlephaError, SchemaValidationError, z } from "alepha";
|
|
12
12
|
import type { RealmConfig } from "alepha/api/users";
|
|
13
|
-
import { useAuth } from "alepha/react/auth";
|
|
13
|
+
import { isMfaRequired, type MfaChallenge, useAuth } from "alepha/react/auth";
|
|
14
14
|
import { FormValidationError, useForm, useFormState } from "alepha/react/form";
|
|
15
15
|
import { useI18n } from "alepha/react/i18n";
|
|
16
16
|
import { useRouter } from "alepha/react/router";
|
|
17
17
|
import { HttpError } from "alepha/server";
|
|
18
18
|
import { AlertCircle, Mail, User } from "lucide-react";
|
|
19
|
-
import { type ReactNode,
|
|
19
|
+
import { type ReactNode, useMemo, useState } from "react";
|
|
20
20
|
|
|
21
|
+
import { AuthMfaStep } from "./auth-mfa-step.tsx";
|
|
21
22
|
import { safeRedirect } from "./safe-redirect.ts";
|
|
22
23
|
|
|
23
24
|
export interface AuthLoginProps {
|
|
@@ -63,6 +64,12 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
63
64
|
const redirect = safeRedirect(router.query.redirect);
|
|
64
65
|
const error = router.query.error;
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Set once the password has been accepted and a second factor is owed.
|
|
69
|
+
* While it is set, the code step replaces the credentials form.
|
|
70
|
+
*/
|
|
71
|
+
const [challenge, setChallenge] = useState<MfaChallenge>();
|
|
72
|
+
|
|
66
73
|
const credentialsProvider = props.realmConfig.authenticationMethods.find(
|
|
67
74
|
(it) => it.type === "CREDENTIALS",
|
|
68
75
|
);
|
|
@@ -135,6 +142,12 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
135
142
|
force: true,
|
|
136
143
|
});
|
|
137
144
|
} catch (err) {
|
|
145
|
+
// The password was right and the realm wants a second factor. Not a
|
|
146
|
+
// failure: swap the form for the code step and carry on.
|
|
147
|
+
if (isMfaRequired(err)) {
|
|
148
|
+
setChallenge(err.data);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
138
151
|
if (
|
|
139
152
|
err instanceof HttpError &&
|
|
140
153
|
err.error === "InvalidCredentialsError"
|
|
@@ -167,27 +180,19 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
167
180
|
(m) => m.type !== "CREDENTIALS",
|
|
168
181
|
);
|
|
169
182
|
|
|
170
|
-
// Autofocus the identifier field on mount
|
|
183
|
+
// Autofocus the identifier field on mount - but only when credentials is the
|
|
171
184
|
// *sole* login method. With OAuth/external buttons present we don't steal
|
|
172
185
|
// focus (and trigger the browser's autofill popup) from a user who came to
|
|
173
|
-
// click "Continue with
|
|
174
|
-
|
|
175
|
-
const identifierId = form.input.identifier.props.id;
|
|
176
|
-
useEffect(() => {
|
|
177
|
-
if (!credentialsProvider || externalMethods.length > 0 || !identifierId) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
(
|
|
181
|
-
document.getElementById(String(identifierId)) as HTMLInputElement | null
|
|
182
|
-
)?.focus();
|
|
183
|
-
}, [credentialsProvider, externalMethods.length, identifierId]);
|
|
186
|
+
// click "Continue with ...".
|
|
187
|
+
const autoFocusIdentifier = !!credentialsProvider && !externalMethods.length;
|
|
184
188
|
|
|
185
189
|
const formState = useFormState(form, ["error", "loading"]);
|
|
186
190
|
const formError =
|
|
187
191
|
formState.error && !(formState.error instanceof SchemaValidationError)
|
|
188
192
|
? formState.error.message
|
|
189
193
|
: undefined;
|
|
190
|
-
const showDivider =
|
|
194
|
+
const showDivider =
|
|
195
|
+
!challenge && credentialsProvider && externalMethods.length > 0;
|
|
191
196
|
// Propagate BOTH realm and the post-auth redirect to the register / reset
|
|
192
197
|
// links — dropping `redirect` here strands a user who signs up mid-flow
|
|
193
198
|
// (e.g. an OIDC authorize continuation) on the home page. Mirrors the
|
|
@@ -238,13 +243,27 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
238
243
|
</Alert>
|
|
239
244
|
)}
|
|
240
245
|
|
|
241
|
-
{
|
|
246
|
+
{challenge && (
|
|
247
|
+
<AuthMfaStep
|
|
248
|
+
challenge={challenge}
|
|
249
|
+
onVerified={async () => {
|
|
250
|
+
await router.push(safeRedirect(router.query.redirect), {
|
|
251
|
+
force: true,
|
|
252
|
+
});
|
|
253
|
+
}}
|
|
254
|
+
onCancel={() => setChallenge(undefined)}
|
|
255
|
+
/>
|
|
256
|
+
)}
|
|
257
|
+
|
|
258
|
+
{!challenge && credentialsProvider && (
|
|
242
259
|
<form {...form.props} className="flex flex-col gap-4">
|
|
243
260
|
<Control
|
|
244
261
|
label={identifierLabel}
|
|
245
262
|
input={form.input.identifier}
|
|
246
263
|
icon={identifierIcon}
|
|
247
264
|
autoComplete={identifierAutoComplete}
|
|
265
|
+
// oxlint-disable-next-line jsx-a11y/no-autofocus
|
|
266
|
+
autoFocus={autoFocusIdentifier}
|
|
248
267
|
/>
|
|
249
268
|
<Control
|
|
250
269
|
label={tr("auth.login.password", {
|
|
@@ -279,7 +298,7 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
279
298
|
</div>
|
|
280
299
|
)}
|
|
281
300
|
|
|
282
|
-
{externalMethods.length > 0 && (
|
|
301
|
+
{!challenge && externalMethods.length > 0 && (
|
|
283
302
|
<div className="flex flex-col gap-2">
|
|
284
303
|
{externalMethods.map((method) => {
|
|
285
304
|
const provider =
|
|
@@ -306,7 +325,7 @@ export const AuthLogin = (props: AuthLoginProps) => {
|
|
|
306
325
|
</div>
|
|
307
326
|
)}
|
|
308
327
|
|
|
309
|
-
{settings.registrationAllowed && (
|
|
328
|
+
{!challenge && settings.registrationAllowed && (
|
|
310
329
|
<p className="text-muted-foreground text-center text-sm">
|
|
311
330
|
{tr("auth.login.noAccount", {
|
|
312
331
|
default: "Don't have an account?",
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
void React;
|
|
4
|
+
|
|
5
|
+
import { Alert, AlertDescription } from "@alepha/ui/components/ui/alert";
|
|
6
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
7
|
+
import {
|
|
8
|
+
InputOTP,
|
|
9
|
+
InputOTPGroup,
|
|
10
|
+
InputOTPSlot,
|
|
11
|
+
} from "@alepha/ui/components/ui/input-otp";
|
|
12
|
+
import { type MfaChallenge, useAuth } from "alepha/react/auth";
|
|
13
|
+
import { useI18n } from "alepha/react/i18n";
|
|
14
|
+
import { HttpError } from "alepha/server";
|
|
15
|
+
import { AlertCircle } from "lucide-react";
|
|
16
|
+
import { useState } from "react";
|
|
17
|
+
|
|
18
|
+
export interface AuthMfaStepProps {
|
|
19
|
+
/**
|
|
20
|
+
* The challenge the sign-in was refused with.
|
|
21
|
+
*/
|
|
22
|
+
challenge: MfaChallenge;
|
|
23
|
+
/**
|
|
24
|
+
* Called once the code has been accepted and the session exists.
|
|
25
|
+
*/
|
|
26
|
+
onVerified: () => void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Back to the password form.
|
|
29
|
+
*/
|
|
30
|
+
onCancel: () => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Second step of a sign-in: the six-digit code.
|
|
35
|
+
*
|
|
36
|
+
* The same component serves both factors. Only the wording and the resend
|
|
37
|
+
* affordance differ, because to the user the act is identical: read a code,
|
|
38
|
+
* type it in.
|
|
39
|
+
*/
|
|
40
|
+
export const AuthMfaStep = (props: AuthMfaStepProps) => {
|
|
41
|
+
const auth = useAuth();
|
|
42
|
+
const { tr } = useI18n();
|
|
43
|
+
|
|
44
|
+
const [code, setCode] = useState("");
|
|
45
|
+
const [error, setError] = useState<string>();
|
|
46
|
+
const [loading, setLoading] = useState(false);
|
|
47
|
+
const [resending, setResending] = useState(false);
|
|
48
|
+
const [sentTo, setSentTo] = useState(props.challenge.sentTo);
|
|
49
|
+
|
|
50
|
+
const isEmail = props.challenge.methods.includes("emailCode");
|
|
51
|
+
|
|
52
|
+
const submit = async (value: string) => {
|
|
53
|
+
setLoading(true);
|
|
54
|
+
setError(undefined);
|
|
55
|
+
try {
|
|
56
|
+
await auth.loginMfa(props.challenge.challenge, value);
|
|
57
|
+
await props.onVerified();
|
|
58
|
+
} catch (err) {
|
|
59
|
+
setCode("");
|
|
60
|
+
// A 401 here is a wrong or stale code, which is the only failure the
|
|
61
|
+
// user can do anything about. Anything else is ours, not theirs.
|
|
62
|
+
if (err instanceof HttpError && err.status === 401) {
|
|
63
|
+
setError(
|
|
64
|
+
tr("auth.mfa.invalid", {
|
|
65
|
+
default: "That code is not valid. Try again.",
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
|
+
} else {
|
|
69
|
+
console.error("Second factor failed:", err);
|
|
70
|
+
setError(
|
|
71
|
+
tr("auth.mfa.error", {
|
|
72
|
+
default: "Something went wrong. Please try again.",
|
|
73
|
+
}),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
setLoading(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const resend = async () => {
|
|
82
|
+
setResending(true);
|
|
83
|
+
setError(undefined);
|
|
84
|
+
try {
|
|
85
|
+
const result = await auth.resendMfaCode(props.challenge.challenge);
|
|
86
|
+
setSentTo(result.sentTo ?? sentTo);
|
|
87
|
+
} catch {
|
|
88
|
+
setError(
|
|
89
|
+
tr("auth.mfa.resendFailed", {
|
|
90
|
+
default: "Could not send a new code. Try again in a moment.",
|
|
91
|
+
}),
|
|
92
|
+
);
|
|
93
|
+
} finally {
|
|
94
|
+
setResending(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className="flex flex-col gap-4">
|
|
100
|
+
<div className="flex flex-col gap-1">
|
|
101
|
+
<h2 className="text-center text-lg font-semibold">
|
|
102
|
+
{tr("auth.mfa.title", { default: "Two-step verification" })}
|
|
103
|
+
</h2>
|
|
104
|
+
<p className="text-muted-foreground text-center text-sm">
|
|
105
|
+
{isEmail
|
|
106
|
+
? // Two keys rather than one interpolated with a possibly-empty
|
|
107
|
+
// address: a translation reading "sent to ." is worse than a
|
|
108
|
+
// sentence written for the case where we have nothing to show.
|
|
109
|
+
sentTo
|
|
110
|
+
? tr("auth.mfa.emailHint", {
|
|
111
|
+
default: `Enter the code we sent to ${sentTo}.`,
|
|
112
|
+
args: [sentTo],
|
|
113
|
+
})
|
|
114
|
+
: tr("auth.mfa.emailHintGeneric", {
|
|
115
|
+
default: "Enter the code we sent to your email address.",
|
|
116
|
+
})
|
|
117
|
+
: tr("auth.mfa.totpHint", {
|
|
118
|
+
default: "Enter the code from your authenticator app.",
|
|
119
|
+
})}
|
|
120
|
+
</p>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
{error && (
|
|
124
|
+
<Alert variant="destructive">
|
|
125
|
+
<AlertCircle className="size-4" />
|
|
126
|
+
<AlertDescription>{error}</AlertDescription>
|
|
127
|
+
</Alert>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
<div className="flex justify-center">
|
|
131
|
+
<InputOTP
|
|
132
|
+
maxLength={6}
|
|
133
|
+
value={code}
|
|
134
|
+
disabled={loading}
|
|
135
|
+
onChange={(value: string) => {
|
|
136
|
+
setCode(value);
|
|
137
|
+
// Submitting on the sixth digit spares the user a button press
|
|
138
|
+
// they would otherwise always have to make.
|
|
139
|
+
if (value.length === 6) {
|
|
140
|
+
void submit(value);
|
|
141
|
+
}
|
|
142
|
+
}}
|
|
143
|
+
>
|
|
144
|
+
<InputOTPGroup>
|
|
145
|
+
{[0, 1, 2, 3, 4, 5].map((index) => (
|
|
146
|
+
<InputOTPSlot key={index} index={index} />
|
|
147
|
+
))}
|
|
148
|
+
</InputOTPGroup>
|
|
149
|
+
</InputOTP>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<Button
|
|
153
|
+
type="button"
|
|
154
|
+
loading={loading}
|
|
155
|
+
disabled={code.length !== 6}
|
|
156
|
+
onClick={() => submit(code)}
|
|
157
|
+
>
|
|
158
|
+
{tr("auth.mfa.submit", { default: "Verify" })}
|
|
159
|
+
</Button>
|
|
160
|
+
|
|
161
|
+
{isEmail && (
|
|
162
|
+
<Button
|
|
163
|
+
type="button"
|
|
164
|
+
variant="ghost"
|
|
165
|
+
loading={resending}
|
|
166
|
+
onClick={resend}
|
|
167
|
+
>
|
|
168
|
+
{tr("auth.mfa.resend", { default: "Send a new code" })}
|
|
169
|
+
</Button>
|
|
170
|
+
)}
|
|
171
|
+
|
|
172
|
+
<Button type="button" variant="ghost" onClick={props.onCancel}>
|
|
173
|
+
{tr("auth.mfa.back", { default: "Back to sign in" })}
|
|
174
|
+
</Button>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
@@ -120,7 +120,7 @@ export const AuthRegister = (props: AuthRegisterProps) => {
|
|
|
120
120
|
// Optionality is decided as each field is built, because that is the only
|
|
121
121
|
// thing the form reads: `FormModel` derives both the required marker and
|
|
122
122
|
// the pre-submit check from `z.schema.requiredKeys(schema)`, which asks
|
|
123
|
-
// whether the field is
|
|
123
|
+
// whether the field is optional or defaulted.
|
|
124
124
|
//
|
|
125
125
|
// This used to declare every field optional and then push the configured
|
|
126
126
|
// names onto the array returned by `z.schema.requiredKeys(s)` — a TypeBox
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const PROVIDER_LABELS: Record<string, string> = {
|
|
9
9
|
credentials: "Password",
|
|
10
|
+
// Not a way to sign in, but it is stored as an identity row, so it shows
|
|
11
|
+
// up in the same lists. Naming it here is what lets an administrator
|
|
12
|
+
// recognise (and clear) the second factor of a locked-out user.
|
|
13
|
+
totp: "Authenticator app",
|
|
10
14
|
google: "Google",
|
|
11
15
|
apple: "Apple",
|
|
12
16
|
github: "GitHub",
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// oxlint-disable jsx-a11y/no-autofocus -- the prop under test is the point
|
|
2
|
+
import { render, waitFor } from "@testing-library/react";
|
|
3
|
+
import { Alepha, z } from "alepha";
|
|
4
|
+
import { AlephaLogger } from "alepha/logger";
|
|
5
|
+
import { AlephaContext } from "alepha/react";
|
|
6
|
+
import { useForm } from "alepha/react/form";
|
|
7
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
import { describe, expect, it } from "vitest";
|
|
10
|
+
|
|
11
|
+
import { Control } from "../control.tsx";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `autoFocus` is documented on `Control` and was being dropped: a lint pass
|
|
15
|
+
* removed the forwarding and left the prop declared, so login and dialog forms
|
|
16
|
+
* silently stopped focusing their first field. Two components had already
|
|
17
|
+
* worked around it with `getElementById(...).focus()`.
|
|
18
|
+
*/
|
|
19
|
+
describe("Control autoFocus", () => {
|
|
20
|
+
const mount = (alepha: Alepha, ui: ReactNode) =>
|
|
21
|
+
render(
|
|
22
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const start = async () => {
|
|
26
|
+
const alepha = Alepha.create().with(AlephaLogger).with(AlephaReactI18n);
|
|
27
|
+
await alepha.start();
|
|
28
|
+
return alepha;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const Probe = (props: {
|
|
32
|
+
variant: "text" | "password" | "number" | "area";
|
|
33
|
+
}) => {
|
|
34
|
+
const form = useForm({
|
|
35
|
+
schema: z.object({
|
|
36
|
+
text: z.text(),
|
|
37
|
+
password: z.text(),
|
|
38
|
+
count: z.number(),
|
|
39
|
+
bio: z.text(),
|
|
40
|
+
}),
|
|
41
|
+
handler: () => {},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (props.variant === "password") {
|
|
45
|
+
return <Control input={form.input.password} password autoFocus />;
|
|
46
|
+
}
|
|
47
|
+
if (props.variant === "number") {
|
|
48
|
+
return <Control input={form.input.count} autoFocus />;
|
|
49
|
+
}
|
|
50
|
+
if (props.variant === "area") {
|
|
51
|
+
return <Control input={form.input.bio} area autoFocus />;
|
|
52
|
+
}
|
|
53
|
+
return <Control input={form.input.text} autoFocus />;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const focusedTag = () => document.activeElement?.tagName.toLowerCase();
|
|
57
|
+
|
|
58
|
+
it("should focus a text control", async () => {
|
|
59
|
+
const { container } = mount(await start(), <Probe variant="text" />);
|
|
60
|
+
|
|
61
|
+
await waitFor(() => {
|
|
62
|
+
expect(document.activeElement).toBe(container.querySelector("input"));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("should focus a password control", async () => {
|
|
67
|
+
const { container } = mount(await start(), <Probe variant="password" />);
|
|
68
|
+
|
|
69
|
+
await waitFor(() => {
|
|
70
|
+
expect(document.activeElement).toBe(
|
|
71
|
+
container.querySelector('input[type="password"]'),
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("should focus a number control", async () => {
|
|
77
|
+
const { container } = mount(await start(), <Probe variant="number" />);
|
|
78
|
+
|
|
79
|
+
await waitFor(() => {
|
|
80
|
+
expect(document.activeElement).toBe(
|
|
81
|
+
container.querySelector('input[type="number"]'),
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("should focus a textarea control", async () => {
|
|
87
|
+
mount(await start(), <Probe variant="area" />);
|
|
88
|
+
|
|
89
|
+
await waitFor(() => {
|
|
90
|
+
expect(focusedTag()).toBe("textarea");
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("should leave focus alone without the prop", async () => {
|
|
95
|
+
const NoFocus = () => {
|
|
96
|
+
const form = useForm({
|
|
97
|
+
schema: z.object({ text: z.text() }),
|
|
98
|
+
handler: () => {},
|
|
99
|
+
});
|
|
100
|
+
return <Control input={form.input.text} />;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
mount(await start(), <NoFocus />);
|
|
104
|
+
|
|
105
|
+
expect(focusedTag()).toBe("body");
|
|
106
|
+
});
|
|
107
|
+
});
|