@alepha/ui 0.30.0 → 0.32.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 +1 -1
- package/dist/account/$pageAccount.d.ts +15 -7
- package/dist/account/$pageAccount.d.ts.map +1 -1
- package/dist/account/$pageAccount.js +15 -7
- package/dist/account/$pageAccount.js.map +1 -1
- package/dist/account/AccountBackToSiteMenuItem.d.ts +21 -0
- package/dist/account/AccountBackToSiteMenuItem.d.ts.map +1 -0
- package/dist/account/AccountBackToSiteMenuItem.js +32 -0
- package/dist/account/AccountBackToSiteMenuItem.js.map +1 -0
- package/dist/account/AccountBrand.d.ts +23 -0
- package/dist/account/AccountBrand.d.ts.map +1 -0
- package/dist/account/AccountBrand.js +47 -0
- package/dist/account/AccountBrand.js.map +1 -0
- package/dist/account/AccountConnections.d.ts +11 -6
- package/dist/account/AccountConnections.d.ts.map +1 -1
- package/dist/account/AccountConnections.js +103 -63
- package/dist/account/AccountConnections.js.map +1 -1
- package/dist/account/AccountDeleteDialog.js +4 -4
- package/dist/account/AccountDeleteDialog.js.map +1 -1
- package/dist/account/AccountKeys.d.ts +12 -8
- package/dist/account/AccountKeys.d.ts.map +1 -1
- package/dist/account/AccountKeys.js +236 -123
- package/dist/account/AccountKeys.js.map +1 -1
- package/dist/account/AccountLayout.d.ts +23 -24
- package/dist/account/AccountLayout.d.ts.map +1 -1
- package/dist/account/AccountLayout.js +79 -46
- package/dist/account/AccountLayout.js.map +1 -1
- package/dist/account/AccountMfaDialog.d.ts.map +1 -1
- package/dist/account/AccountMfaDialog.js +64 -75
- package/dist/account/AccountMfaDialog.js.map +1 -1
- package/dist/account/AccountPage.d.ts +28 -0
- package/dist/account/AccountPage.d.ts.map +1 -0
- package/dist/account/AccountPage.js +33 -0
- package/dist/account/AccountPage.js.map +1 -0
- package/dist/account/AccountPasswordDialog.js +3 -3
- package/dist/account/AccountPasswordDialog.js.map +1 -1
- package/dist/account/AccountProfile.d.ts.map +1 -1
- package/dist/account/AccountProfile.js +119 -115
- package/dist/account/AccountProfile.js.map +1 -1
- package/dist/account/AccountRecoveryCodes.d.ts +16 -0
- package/dist/account/AccountRecoveryCodes.d.ts.map +1 -0
- package/dist/account/AccountRecoveryCodes.js +46 -0
- package/dist/account/AccountRecoveryCodes.js.map +1 -0
- package/dist/account/AccountRecoveryCodesDialog.d.ts +16 -0
- package/dist/account/AccountRecoveryCodesDialog.d.ts.map +1 -0
- package/dist/account/AccountRecoveryCodesDialog.js +30 -0
- package/dist/account/AccountRecoveryCodesDialog.js.map +1 -0
- package/dist/account/AccountRouter.d.ts +61 -40
- package/dist/account/AccountRouter.d.ts.map +1 -1
- package/dist/account/AccountRouter.js +74 -48
- package/dist/account/AccountRouter.js.map +1 -1
- package/dist/account/AccountRouterOptions.d.ts +55 -26
- package/dist/account/AccountRouterOptions.d.ts.map +1 -1
- package/dist/account/AccountRouterOptions.js +1 -1
- package/dist/account/AccountRouterOptions.js.map +1 -1
- package/dist/account/AccountSecurity.d.ts.map +1 -1
- package/dist/account/AccountSecurity.js +129 -89
- package/dist/account/AccountSecurity.js.map +1 -1
- package/dist/account/AccountSessions.d.ts +16 -7
- package/dist/account/AccountSessions.d.ts.map +1 -1
- package/dist/account/AccountSessions.js +144 -98
- package/dist/account/AccountSessions.js.map +1 -1
- package/dist/account/ApiKeyCreateDialog.js +3 -3
- package/dist/account/ApiKeyCreateDialog.js.map +1 -1
- package/dist/account/ApiKeyScopeMatrix.js +1 -1
- package/dist/account/index.d.ts +4 -1
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +4 -1
- package/dist/admin/AdminAnalytics.js +2 -2
- package/dist/admin/AdminAudits.js +3 -3
- package/dist/admin/AdminDashboardCountCard.js +1 -1
- package/dist/admin/AdminFiles.d.ts.map +1 -1
- package/dist/admin/AdminFiles.js +7 -4
- package/dist/admin/AdminFiles.js.map +1 -1
- package/dist/admin/AdminFilesUsage.d.ts +4 -0
- package/dist/admin/AdminFilesUsage.d.ts.map +1 -1
- package/dist/admin/AdminFilesUsage.js +5 -2
- package/dist/admin/AdminFilesUsage.js.map +1 -1
- package/dist/admin/AdminFilesUsageCard.d.ts +12 -0
- package/dist/admin/AdminFilesUsageCard.d.ts.map +1 -1
- package/dist/admin/AdminFilesUsageCard.js +31 -3
- package/dist/admin/AdminFilesUsageCard.js.map +1 -1
- package/dist/admin/AdminJobDetail.js +3 -3
- package/dist/admin/AdminJobDetail.js.map +1 -1
- package/dist/admin/AdminJobDetailAside.js +1 -1
- package/dist/admin/AdminJobDetailExecutions.js +4 -4
- package/dist/admin/AdminJobDetailExecutions.js.map +1 -1
- package/dist/admin/AdminJobExecutionLogs.js +1 -1
- package/dist/admin/AdminJobExecutionLogs.js.map +1 -1
- package/dist/admin/AdminJobExecutionSheet.js +4 -4
- package/dist/admin/AdminJobExecutionSheet.js.map +1 -1
- package/dist/admin/AdminJobs.js +4 -4
- package/dist/admin/AdminJobs.js.map +1 -1
- package/dist/admin/AdminJobsPayloadDialog.js +1 -1
- package/dist/admin/AdminJobsTypeIcon.js +1 -1
- package/dist/admin/AdminKeys.js +6 -6
- package/dist/admin/AdminKeysTokenDialog.js +2 -2
- package/dist/admin/AdminKeysTokenDialog.js.map +1 -1
- package/dist/admin/AdminLayout.js +3 -3
- package/dist/admin/AdminNotifications.js +3 -3
- package/dist/admin/AdminNotificationsDetail.js +1 -1
- package/dist/admin/AdminNotificationsDetailTabs.js +1 -1
- package/dist/admin/AdminNotificationsPreviewTab.js +1 -1
- package/dist/admin/AdminParameters.d.ts.map +1 -1
- package/dist/admin/AdminParameters.js +2 -2
- package/dist/admin/AdminParameters.js.map +1 -1
- package/dist/admin/AdminParametersEditorForm.js +3 -3
- package/dist/admin/AdminParametersEditorForm.js.map +1 -1
- package/dist/admin/AdminParametersEditorPane.js +2 -2
- package/dist/admin/AdminParametersHistoryPane.js +2 -2
- package/dist/admin/AdminParametersTreeFooterActions.js +3 -3
- package/dist/admin/AdminParametersTreeFooterActions.js.map +1 -1
- package/dist/admin/AdminParametersTreeNodeView.js +4 -4
- package/dist/admin/AdminParametersTreeNodeView.js.map +1 -1
- package/dist/admin/AdminParametersTreePane.js +2 -2
- package/dist/admin/AdminParametersTreePane.js.map +1 -1
- package/dist/admin/AdminPayments.js +2 -2
- package/dist/admin/AdminRouter.js +1 -1
- package/dist/admin/AdminSessions.js +3 -3
- package/dist/admin/AdminUserAvatarControl.js +4 -4
- package/dist/admin/AdminUserAvatarControl.js.map +1 -1
- package/dist/admin/AdminUserDetail.d.ts.map +1 -1
- package/dist/admin/AdminUserDetail.js +5 -4
- package/dist/admin/AdminUserDetail.js.map +1 -1
- package/dist/admin/AdminUserDetailAuditsTab.js +1 -1
- package/dist/admin/AdminUserDetailIdentityAside.js +1 -1
- package/dist/admin/AdminUserDetailOverviewTab.js +1 -1
- package/dist/admin/AdminUserDetailPasswordDialog.js +2 -2
- package/dist/admin/AdminUserDetailPasswordDialog.js.map +1 -1
- package/dist/admin/AdminUserDetailSecurityTab.d.ts.map +1 -1
- package/dist/admin/AdminUserDetailSecurityTab.js +6 -4
- package/dist/admin/AdminUserDetailSecurityTab.js.map +1 -1
- package/dist/admin/AdminUserDetailSessionsTab.js +1 -1
- package/dist/admin/AdminUsers.js +4 -4
- package/dist/admin/AdminUsersRolesPicker.js +1 -1
- package/dist/admin/AdminUsersStatusBadge.js +1 -1
- package/dist/admin/ParameterDiffDialog.js +3 -3
- package/dist/admin/ParameterDiffDialog.js.map +1 -1
- package/dist/admin/ParameterHistoryItem.js +3 -3
- package/dist/admin/ParameterHistoryItem.js.map +1 -1
- package/dist/admin/ParameterJsonDialog.js +2 -2
- package/dist/admin/ParameterJsonDialog.js.map +1 -1
- package/dist/admin/ParameterSaveDialog.js +3 -3
- package/dist/admin/ParameterSaveDialog.js.map +1 -1
- package/dist/admin/analytics/AdvancedSection.js +1 -1
- package/dist/admin/analytics/AnalyticsEmpty.js +1 -1
- package/dist/admin/analytics/DatasetSelect.js +1 -1
- package/dist/admin/analytics/FilterEditor.js +4 -4
- package/dist/admin/analytics/FilterEditor.js.map +1 -1
- package/dist/admin/analytics/FilterValuePicker.js +3 -3
- package/dist/admin/analytics/FilterValuePicker.js.map +1 -1
- package/dist/admin/analytics/RequestDialog.js +2 -2
- package/dist/admin/analytics/RequestDialog.js.map +1 -1
- package/dist/admin/analytics/ResultsPane.js +2 -2
- package/dist/admin/analytics/ResultsPane.js.map +1 -1
- package/dist/admin/analytics/ResultsTable.d.ts.map +1 -1
- package/dist/admin/analytics/ResultsTable.js +2 -2
- package/dist/admin/analytics/ResultsTable.js.map +1 -1
- package/dist/admin/analytics/RunFooter.js +1 -1
- package/dist/admin/analytics/SamplingBadge.js +1 -1
- package/dist/admin/analytics/ToggleChip.js +1 -1
- package/dist/admin/analytics/ToggleChip.js.map +1 -1
- package/dist/admin/analytics/TruncationBanner.js +2 -2
- package/dist/admin/analytics/TruncationBanner.js.map +1 -1
- package/dist/admin/analytics/useAnalyticsQuery.js +1 -1
- package/dist/admin/analytics/useShapeLabels.js +1 -1
- package/dist/auth/AuthLogin.js +5 -5
- package/dist/auth/AuthLogin.js.map +1 -1
- package/dist/auth/AuthMfaStep.js +3 -3
- package/dist/auth/AuthMfaStep.js.map +1 -1
- package/dist/auth/AuthRegister.js +5 -5
- package/dist/auth/AuthRegister.js.map +1 -1
- package/dist/auth/AuthRegisterFormPhase.js +3 -3
- package/dist/auth/AuthRegisterFormPhase.js.map +1 -1
- package/dist/auth/AuthRegisterPasswordRules.js +1 -1
- package/dist/auth/AuthResetPassword.js +5 -5
- package/dist/auth/AuthResetPassword.js.map +1 -1
- package/dist/auth/AuthRouter.d.ts +2 -2
- package/dist/auth/AuthRouter.js +2 -2
- package/dist/auth/AuthRouter.js.map +1 -1
- package/dist/auth/AuthVerifyEmailStateful.js +2 -2
- package/dist/auth/AuthVerifyEmailView.js +3 -3
- package/dist/auth/AuthVerifyEmailView.js.map +1 -1
- package/dist/auth/safeRedirect.d.ts +3 -0
- package/dist/auth/safeRedirect.d.ts.map +1 -1
- package/dist/auth/safeRedirect.js +11 -0
- package/dist/auth/safeRedirect.js.map +1 -1
- package/dist/calendar/Calendar.js +3 -3
- package/dist/calendar/Calendar.js.map +1 -1
- package/dist/core/Alert.js +2 -2
- package/dist/core/Alert.js.map +1 -1
- package/dist/core/AlertDialog.js +1 -1
- package/dist/core/AlertDialog.js.map +1 -1
- package/dist/core/Badge.js +3 -3
- package/dist/core/Badge.js.map +1 -1
- package/dist/core/Button.d.ts +45 -3
- package/dist/core/Button.d.ts.map +1 -1
- package/dist/core/Button.js +155 -11
- package/dist/core/Button.js.map +1 -1
- package/dist/core/ButtonGroup.js +1 -1
- package/dist/core/Checkbox.js +1 -1
- package/dist/core/Checkbox.js.map +1 -1
- package/dist/core/Combobox.js +4 -4
- package/dist/core/Combobox.js.map +1 -1
- package/dist/core/ContextMenu.js +1 -1
- package/dist/core/ContextMenu.js.map +1 -1
- package/dist/core/Dialog.js +2 -2
- package/dist/core/Dialog.js.map +1 -1
- package/dist/core/DropdownMenu.js +2 -2
- package/dist/core/DropdownMenu.js.map +1 -1
- package/dist/core/Empty.js +1 -1
- package/dist/core/Input.js +1 -1
- package/dist/core/Input.js.map +1 -1
- package/dist/core/InputGroup.js +3 -3
- package/dist/core/InputGroup.js.map +1 -1
- package/dist/core/Menubar.js +2 -2
- package/dist/core/Menubar.js.map +1 -1
- package/dist/core/Pagination.js +1 -1
- package/dist/core/Pagination.js.map +1 -1
- package/dist/core/Segmented.d.ts.map +1 -1
- package/dist/core/Segmented.js +1 -1
- package/dist/core/Segmented.js.map +1 -1
- package/dist/core/Sheet.js +1 -1
- package/dist/core/Sheet.js.map +1 -1
- package/dist/core/Sidebar.js +4 -4
- package/dist/core/Sidebar.js.map +1 -1
- package/dist/core/Switch.js +1 -1
- package/dist/core/Switch.js.map +1 -1
- package/dist/core/Tabs.js +1 -1
- package/dist/core/Textarea.js +1 -1
- package/dist/core/Textarea.js.map +1 -1
- package/dist/core/TimeAgo.js +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +20 -20
- package/dist/core/useDialog.d.ts.map +1 -1
- package/dist/core/useDialog.js +3 -3
- package/dist/core/useDialog.js.map +1 -1
- package/dist/form/AutoForm.d.ts +3 -1
- package/dist/form/AutoForm.d.ts.map +1 -1
- package/dist/form/AutoForm.js +3 -3
- package/dist/form/AutoForm.js.map +1 -1
- package/dist/form/AutoFormBottomBar.d.ts.map +1 -1
- package/dist/form/AutoFormBottomBar.js +5 -4
- package/dist/form/AutoFormBottomBar.js.map +1 -1
- package/dist/form/AutoFormErrorPopover.js +4 -4
- package/dist/form/AutoFormErrorPopover.js.map +1 -1
- package/dist/form/AutoFormGroupBlock.js +2 -2
- package/dist/form/AutoFormGroupGridField.js +1 -1
- package/dist/form/Control.d.ts +16 -0
- package/dist/form/Control.d.ts.map +1 -1
- package/dist/form/Control.js +30 -10
- package/dist/form/Control.js.map +1 -1
- package/dist/form/ControlArray.d.ts.map +1 -1
- package/dist/form/ControlArray.js +15 -14
- package/dist/form/ControlArray.js.map +1 -1
- package/dist/form/ControlDate.d.ts.map +1 -1
- package/dist/form/ControlDate.js +5 -2
- package/dist/form/ControlDate.js.map +1 -1
- package/dist/form/ControlDatePopover.js +1 -1
- package/dist/form/ControlDateRange.js +2 -2
- package/dist/form/ControlObject.js +7 -7
- package/dist/form/ControlObject.js.map +1 -1
- package/dist/form/ControlPassword.js +1 -1
- package/dist/form/ControlPassword.js.map +1 -1
- package/dist/form/ControlSelect.d.ts +3 -2
- package/dist/form/ControlSelect.d.ts.map +1 -1
- package/dist/form/ControlSelect.js +2 -2
- package/dist/form/ControlSelect.js.map +1 -1
- package/dist/form/ControlSelectCombobox.js +1 -1
- package/dist/form/ControlUpload.js +3 -3
- package/dist/form/ControlUpload.js.map +1 -1
- package/dist/form/FormField.js +5 -5
- package/dist/form/FormField.js.map +1 -1
- package/dist/form/fieldTrigger.js +1 -1
- package/dist/form/grid.d.ts +11 -0
- package/dist/form/grid.d.ts.map +1 -1
- package/dist/form/grid.js +17 -6
- package/dist/form/grid.js.map +1 -1
- package/dist/form/index.js +2 -2
- package/dist/i18n/fr/uiFr.d.ts.map +1 -1
- package/dist/i18n/fr/uiFr.js +41 -30
- package/dist/i18n/fr/uiFr.js.map +1 -1
- package/dist/markdown/MarkdownView.d.ts.map +1 -1
- package/dist/markdown/MarkdownView.js +5 -4
- package/dist/markdown/MarkdownView.js.map +1 -1
- package/dist/markdown/rehypeHighlight.d.ts +1 -1
- package/dist/markdown/rehypeHighlight.js +1 -1
- package/dist/markdown/rehypeHighlight.js.map +1 -1
- package/dist/organizations/MyOrganizationInvitations.d.ts +36 -0
- package/dist/organizations/MyOrganizationInvitations.d.ts.map +1 -1
- package/dist/organizations/MyOrganizationInvitations.js +116 -58
- package/dist/organizations/MyOrganizationInvitations.js.map +1 -1
- package/dist/organizations/MyOrganizations.js +4 -4
- package/dist/organizations/MyOrganizations.js.map +1 -1
- package/dist/organizations/OrganizationInviteDialog.js +2 -2
- package/dist/organizations/OrganizationInviteDialog.js.map +1 -1
- package/dist/organizations/OrganizationMemberIdentity.d.ts.map +1 -1
- package/dist/organizations/OrganizationMemberIdentity.js +1 -1
- package/dist/organizations/OrganizationMemberIdentity.js.map +1 -1
- package/dist/organizations/OrganizationMemberRankPicker.js +3 -3
- package/dist/organizations/OrganizationMembers.js +7 -7
- package/dist/organizations/OrganizationMembers.js.map +1 -1
- package/dist/organizations/OrganizationPendingInvitations.js +5 -5
- package/dist/organizations/OrganizationPendingInvitations.js.map +1 -1
- package/dist/organizations/OrganizationRankColumnHeader.d.ts +0 -1
- package/dist/organizations/OrganizationRankColumnHeader.d.ts.map +1 -1
- package/dist/organizations/OrganizationRankColumnHeader.js +26 -35
- package/dist/organizations/OrganizationRankColumnHeader.js.map +1 -1
- package/dist/organizations/OrganizationRanks.d.ts.map +1 -1
- package/dist/organizations/OrganizationRanks.js +7 -8
- package/dist/organizations/OrganizationRanks.js.map +1 -1
- package/dist/organizations/OrganizationTransferOwnershipDialog.js +3 -3
- package/dist/organizations/OrganizationTransferOwnershipDialog.js.map +1 -1
- package/dist/organizations/useInviteOrganizationMember.js +1 -1
- package/dist/organizations/useRevokeOrganizationInvitation.js +1 -1
- package/dist/otp/InputOTP.js +2 -2
- package/dist/otp/InputOTP.js.map +1 -1
- package/dist/settings/SettingsDangerSection.js +2 -2
- package/dist/settings/SettingsDangerSection.js.map +1 -1
- package/dist/settings/SettingsHeading.d.ts +1 -1
- package/dist/settings/SettingsHeading.js +1 -1
- package/dist/settings/SettingsHeading.js.map +1 -1
- package/dist/settings/SettingsSection.d.ts +1 -1
- package/dist/settings/SettingsSection.js +2 -2
- package/dist/settings/SettingsSection.js.map +1 -1
- package/dist/settings/index.js +2 -2
- package/dist/shell/AppActions.d.ts +2 -2
- package/dist/shell/AppActions.js +6 -6
- package/dist/shell/AppActions.js.map +1 -1
- package/dist/shell/AppShellSidebarNavItem.d.ts.map +1 -1
- package/dist/shell/AppShellSidebarNavItem.js +8 -2
- package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
- package/dist/shell/AppShellStatefulSidebarTrigger.js +1 -1
- package/dist/shell/AppShellStatefulSidebarTrigger.js.map +1 -1
- package/dist/shell/ButtonDark.d.ts +2 -2
- package/dist/shell/ButtonDark.d.ts.map +1 -1
- package/dist/shell/ButtonDark.js +1 -1
- package/dist/shell/ButtonDark.js.map +1 -1
- package/dist/shell/ButtonInbox.d.ts +1 -1
- package/dist/shell/ButtonInbox.d.ts.map +1 -1
- package/dist/shell/ButtonInbox.js +7 -7
- package/dist/shell/ButtonInbox.js.map +1 -1
- package/dist/shell/ButtonLanguage.d.ts +2 -2
- package/dist/shell/ButtonLanguage.d.ts.map +1 -1
- package/dist/shell/ButtonLanguage.js +3 -3
- package/dist/shell/ButtonLanguage.js.map +1 -1
- package/dist/shell/ButtonSettings.d.ts +2 -2
- package/dist/shell/ButtonSettings.d.ts.map +1 -1
- package/dist/shell/ButtonSettings.js +2 -2
- package/dist/shell/ButtonSettings.js.map +1 -1
- package/dist/shell/ButtonSettingsLanguageMenu.js +1 -1
- package/dist/shell/ButtonSettingsThemeMenu.js +1 -1
- package/dist/shell/ButtonTheme.d.ts +2 -2
- package/dist/shell/ButtonTheme.d.ts.map +1 -1
- package/dist/shell/ButtonTheme.js +3 -3
- package/dist/shell/ButtonTheme.js.map +1 -1
- package/dist/shell/ButtonUser.d.ts +2 -2
- package/dist/shell/ButtonUser.d.ts.map +1 -1
- package/dist/shell/ButtonUser.js +4 -4
- package/dist/shell/ButtonUser.js.map +1 -1
- package/dist/shell/DetailAside.js +3 -3
- package/dist/shell/DetailAside.js.map +1 -1
- package/dist/shell/DetailLayout.js +2 -2
- package/dist/shell/DetailLayout.js.map +1 -1
- package/dist/shell/NavShell.js +1 -1
- package/dist/shell/NavigationProgress.js +1 -1
- package/dist/shell/PlateTabBar.d.ts.map +1 -1
- package/dist/shell/PlateTabBar.js +2 -2
- package/dist/shell/PlateTabBar.js.map +1 -1
- package/dist/shell/Spotlight.js +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/shell/useNavBreadcrumbs.js +1 -1
- package/dist/shell/useNavEntries.js +1 -1
- package/dist/styles.css +152 -12
- package/dist/table/DataTable.js +3 -3
- package/dist/table/DataTableBody.js +1 -1
- package/dist/table/DataTableBulkBar.d.ts.map +1 -1
- package/dist/table/DataTableBulkBar.js +6 -3
- package/dist/table/DataTableBulkBar.js.map +1 -1
- package/dist/table/DataTableBulkMenu.d.ts.map +1 -1
- package/dist/table/DataTableBulkMenu.js +4 -3
- package/dist/table/DataTableBulkMenu.js.map +1 -1
- package/dist/table/DataTableColumnPicker.js +3 -3
- package/dist/table/DataTableColumnPicker.js.map +1 -1
- package/dist/table/DataTableFilterAdd.d.ts +7 -0
- package/dist/table/DataTableFilterAdd.d.ts.map +1 -1
- package/dist/table/DataTableFilterAdd.js +15 -6
- package/dist/table/DataTableFilterAdd.js.map +1 -1
- package/dist/table/DataTableFilterBar.d.ts.map +1 -1
- package/dist/table/DataTableFilterBar.js +12 -3
- package/dist/table/DataTableFilterBar.js.map +1 -1
- package/dist/table/DataTableFilterControl.d.ts +1 -1
- package/dist/table/DataTableFilterControl.js +2 -2
- package/dist/table/DataTableFilterControl.js.map +1 -1
- package/dist/table/DataTableFilterDialog.js +5 -5
- package/dist/table/DataTableFilterDialog.js.map +1 -1
- package/dist/table/DataTableFilterMenu.js +3 -3
- package/dist/table/DataTableFilterMenu.js.map +1 -1
- package/dist/table/DataTableFooter.d.ts.map +1 -1
- package/dist/table/DataTableFooter.js +1 -1
- package/dist/table/DataTableFooter.js.map +1 -1
- package/dist/table/DataTableHeaderRow.js +1 -1
- package/dist/table/DataTableHelpButton.js +2 -2
- package/dist/table/DataTableHelpButton.js.map +1 -1
- package/dist/table/DataTableRowActionsMenu.js +3 -3
- package/dist/table/DataTableRowActionsMenu.js.map +1 -1
- package/dist/table/DataTableToolbar.d.ts.map +1 -1
- package/dist/table/DataTableToolbar.js +4 -4
- package/dist/table/DataTableToolbar.js.map +1 -1
- package/dist/table/PermissionMatrixRowLabel.d.ts +1 -1
- package/dist/table/PermissionMatrixRowLabel.js +1 -1
- package/dist/table/PermissionMatrixRowLabel.js.map +1 -1
- package/dist/table/dataTableTypes.d.ts +12 -1
- package/dist/table/dataTableTypes.d.ts.map +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table/useDataTableData.d.ts.map +1 -1
- package/dist/table/useDataTableData.js +13 -2
- package/dist/table/useDataTableData.js.map +1 -1
- package/dist/tree/TreeViewRenameInput.js +1 -1
- package/dist/tree/TreeViewResizer.js +1 -1
- package/package.json +17 -14
- package/src/account/$pageAccount.tsx +15 -7
- package/src/account/AccountBackToSiteMenuItem.tsx +46 -0
- package/src/account/AccountBrand.tsx +51 -0
- package/src/account/AccountConnections.tsx +154 -126
- package/src/account/AccountDeleteDialog.tsx +2 -2
- package/src/account/AccountKeys.tsx +277 -162
- package/src/account/AccountLayout.tsx +75 -84
- package/src/account/AccountMfaDialog.tsx +19 -38
- package/src/account/AccountPage.tsx +63 -0
- package/src/account/AccountPasswordDialog.tsx +1 -1
- package/src/account/AccountProfile.tsx +6 -4
- package/src/account/AccountRecoveryCodes.tsx +69 -0
- package/src/account/AccountRecoveryCodesDialog.tsx +47 -0
- package/src/account/AccountRouter.tsx +82 -50
- package/src/account/AccountRouterOptions.tsx +59 -27
- package/src/account/AccountSecurity.tsx +84 -12
- package/src/account/AccountSessions.tsx +214 -159
- package/src/account/ApiKeyCreateDialog.tsx +1 -1
- package/src/account/__tests__/AccountConnections.browser.spec.tsx +130 -0
- package/src/account/__tests__/AccountKeys.browser.spec.tsx +156 -0
- package/src/account/__tests__/AccountLayout.browser.spec.tsx +120 -30
- package/src/account/__tests__/AccountRecoveryCodes.browser.spec.tsx +118 -0
- package/src/account/__tests__/AccountRouter.spec.ts +34 -0
- package/src/account/__tests__/AccountSessions.browser.spec.tsx +199 -0
- package/src/account/index.ts +7 -1
- package/src/admin/AdminFiles.tsx +4 -1
- package/src/admin/AdminFilesUsage.tsx +10 -1
- package/src/admin/AdminFilesUsageCard.tsx +69 -2
- package/src/admin/AdminJobDetail.tsx +1 -1
- package/src/admin/AdminJobDetailExecutions.tsx +1 -1
- package/src/admin/AdminJobExecutionLogs.tsx +1 -1
- package/src/admin/AdminJobExecutionSheet.tsx +1 -1
- package/src/admin/AdminJobs.tsx +1 -1
- package/src/admin/AdminKeysTokenDialog.tsx +1 -1
- package/src/admin/AdminParameters.tsx +13 -14
- package/src/admin/AdminParametersEditorForm.tsx +2 -2
- package/src/admin/AdminParametersTreeFooterActions.tsx +2 -2
- package/src/admin/AdminParametersTreeNodeView.tsx +2 -2
- package/src/admin/AdminParametersTreePane.tsx +1 -1
- package/src/admin/AdminUserAvatarControl.tsx +2 -2
- package/src/admin/AdminUserDetail.tsx +3 -2
- package/src/admin/AdminUserDetailPasswordDialog.tsx +1 -1
- package/src/admin/AdminUserDetailSecurityTab.tsx +5 -3
- package/src/admin/ParameterDiffDialog.tsx +2 -2
- package/src/admin/ParameterHistoryItem.tsx +1 -1
- package/src/admin/ParameterJsonDialog.tsx +1 -1
- package/src/admin/ParameterSaveDialog.tsx +1 -1
- package/src/admin/__tests__/AdminFilesUsageCard.browser.spec.tsx +52 -2
- package/src/admin/analytics/FilterEditor.tsx +3 -3
- package/src/admin/analytics/FilterValuePicker.tsx +2 -2
- package/src/admin/analytics/RequestDialog.tsx +1 -1
- package/src/admin/analytics/ResultsPane.tsx +1 -1
- package/src/admin/analytics/ResultsTable.tsx +6 -1
- package/src/admin/analytics/ToggleChip.tsx +1 -1
- package/src/admin/analytics/TruncationBanner.tsx +1 -1
- package/src/auth/AuthLogin.tsx +2 -2
- package/src/auth/AuthMfaStep.tsx +2 -2
- package/src/auth/AuthRegister.tsx +2 -2
- package/src/auth/AuthRegisterFormPhase.tsx +1 -1
- package/src/auth/AuthResetPassword.tsx +2 -2
- package/src/auth/AuthRouter.tsx +2 -2
- package/src/auth/AuthVerifyEmailView.tsx +1 -1
- package/src/auth/__tests__/AuthRouter.spec.ts +2 -1
- package/src/auth/__tests__/safeRedirect.spec.ts +38 -0
- package/src/auth/safeRedirect.ts +13 -0
- package/src/calendar/Calendar.tsx +2 -2
- package/src/core/Alert.tsx +1 -1
- package/src/core/AlertDialog.tsx +1 -1
- package/src/core/Badge.tsx +2 -2
- package/src/core/Button.tsx +232 -18
- package/src/core/Checkbox.tsx +1 -1
- package/src/core/Combobox.tsx +4 -4
- package/src/core/ContextMenu.tsx +1 -1
- package/src/core/Dialog.tsx +2 -2
- package/src/core/DropdownMenu.tsx +1 -1
- package/src/core/Input.tsx +1 -1
- package/src/core/InputGroup.tsx +2 -2
- package/src/core/Menubar.tsx +1 -1
- package/src/core/Pagination.tsx +1 -1
- package/src/core/Segmented.tsx +6 -4
- package/src/core/Sheet.tsx +1 -1
- package/src/core/Sidebar.tsx +1 -1
- package/src/core/Switch.tsx +1 -1
- package/src/core/Textarea.tsx +1 -1
- package/src/core/index.ts +7 -1
- package/src/core/useDialog.tsx +3 -5
- package/src/form/AutoForm.tsx +3 -1
- package/src/form/AutoFormBottomBar.tsx +4 -3
- package/src/form/AutoFormErrorPopover.tsx +3 -3
- package/src/form/Control.tsx +66 -9
- package/src/form/ControlArray.tsx +13 -12
- package/src/form/ControlDate.tsx +4 -1
- package/src/form/ControlObject.tsx +6 -6
- package/src/form/ControlPassword.tsx +1 -1
- package/src/form/ControlSelect.tsx +3 -2
- package/src/form/ControlUpload.tsx +1 -1
- package/src/form/FormField.tsx +5 -5
- package/src/form/__tests__/ControlVerbatim.browser.spec.tsx +71 -0
- package/src/form/grid.tsx +17 -6
- package/src/i18n/fr/uiFr.ts +46 -33
- package/src/markdown/MarkdownView.tsx +5 -4
- package/src/markdown/rehypeHighlight.ts +1 -1
- package/src/organizations/MyOrganizationInvitations.tsx +177 -71
- package/src/organizations/MyOrganizations.tsx +1 -1
- package/src/organizations/OrganizationInviteDialog.tsx +1 -1
- package/src/organizations/OrganizationMemberIdentity.tsx +4 -1
- package/src/organizations/OrganizationMembers.tsx +3 -3
- package/src/organizations/OrganizationPendingInvitations.tsx +1 -1
- package/src/organizations/OrganizationRankColumnHeader.tsx +1 -8
- package/src/organizations/OrganizationRanks.tsx +2 -3
- package/src/organizations/OrganizationTransferOwnershipDialog.tsx +2 -2
- package/src/organizations/__tests__/MyOrganizationInvitations.browser.spec.tsx +61 -7
- package/src/organizations/__tests__/OrganizationRanks.browser.spec.tsx +34 -0
- package/src/otp/InputOTP.tsx +2 -2
- package/src/settings/SettingsDangerSection.tsx +2 -2
- package/src/settings/SettingsHeading.tsx +1 -1
- package/src/settings/SettingsSection.tsx +1 -1
- package/src/settings/__tests__/SettingsSection.browser.spec.tsx +3 -3
- package/src/shell/AppActions.tsx +6 -6
- package/src/shell/AppShellSidebarNavItem.tsx +17 -2
- package/src/shell/AppShellStatefulSidebarTrigger.tsx +1 -1
- package/src/shell/ButtonDark.tsx +3 -3
- package/src/shell/ButtonInbox.tsx +15 -5
- package/src/shell/ButtonLanguage.tsx +3 -3
- package/src/shell/ButtonSettings.tsx +3 -3
- package/src/shell/ButtonTheme.tsx +3 -3
- package/src/shell/ButtonUser.tsx +4 -4
- package/src/shell/DetailAside.tsx +1 -1
- package/src/shell/DetailLayout.tsx +1 -1
- package/src/shell/PlateTabBar.tsx +4 -2
- package/src/shell/__tests__/ActionErrorToaster.browser.spec.tsx +2 -2
- package/src/shell/__tests__/AppActions.browser.spec.tsx +1 -1
- package/src/shell/__tests__/ButtonInbox.browser.spec.tsx +12 -0
- package/src/shell/__tests__/NavigationProgress.browser.spec.tsx +2 -2
- package/src/styles.css +152 -12
- package/src/table/DataTableBulkBar.tsx +10 -3
- package/src/table/DataTableBulkMenu.tsx +2 -1
- package/src/table/DataTableColumnPicker.tsx +1 -1
- package/src/table/DataTableFilterAdd.tsx +55 -25
- package/src/table/DataTableFilterBar.tsx +16 -3
- package/src/table/DataTableFilterControl.tsx +1 -1
- package/src/table/DataTableFilterDialog.tsx +3 -3
- package/src/table/DataTableFilterMenu.tsx +1 -1
- package/src/table/DataTableFooter.tsx +31 -32
- package/src/table/DataTableHelpButton.tsx +1 -1
- package/src/table/DataTableRowActionsMenu.tsx +1 -1
- package/src/table/DataTableToolbar.tsx +11 -3
- package/src/table/PermissionMatrixRowLabel.tsx +1 -1
- package/src/table/__tests__/DataTableBulkBarChrome.browser.spec.tsx +87 -0
- package/src/table/__tests__/DataTableFilterDefaultBar.browser.spec.tsx +24 -0
- package/src/table/__tests__/DataTableNewestRequest.browser.spec.tsx +91 -0
- package/src/table/dataTableTypes.ts +14 -1
- package/src/table/useDataTableData.ts +24 -1
- package/dist/account/AccountHeader.d.ts +0 -33
- package/dist/account/AccountHeader.d.ts.map +0 -1
- package/dist/account/AccountHeader.js +0 -45
- package/dist/account/AccountHeader.js.map +0 -1
- package/dist/account/AccountKeysRow.d.ts +0 -22
- package/dist/account/AccountKeysRow.d.ts.map +0 -1
- package/dist/account/AccountKeysRow.js +0 -68
- package/dist/account/AccountKeysRow.js.map +0 -1
- package/src/account/AccountHeader.tsx +0 -66
- package/src/account/AccountKeysRow.tsx +0 -100
|
@@ -0,0 +1,87 @@
|
|
|
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/testing/react";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { DataTable } from "../DataTable.tsx";
|
|
10
|
+
import type { BulkAction } from "../dataTableTypes.ts";
|
|
11
|
+
|
|
12
|
+
interface Row {
|
|
13
|
+
id: number;
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const rows: Row[] = [{ id: 1, title: "Alpha" }];
|
|
18
|
+
|
|
19
|
+
const columns = {
|
|
20
|
+
title: { label: "Title", cell: (r: Row) => r.title },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* #Q2499: the pill's buttons took the default solid primary variant and
|
|
25
|
+
* overrode only its background, so its darker border and top highlight
|
|
26
|
+
* stayed and drew a blue ring on the dark pill. The classes that carry
|
|
27
|
+
* them must not reach any button of the pill.
|
|
28
|
+
*/
|
|
29
|
+
describe("DataTable (bulk bar chrome)", () => {
|
|
30
|
+
let alepha: Alepha | undefined;
|
|
31
|
+
|
|
32
|
+
beforeAll(() => {
|
|
33
|
+
setupJsdomMocks();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterEach(async () => {
|
|
37
|
+
await alepha?.stop();
|
|
38
|
+
alepha = undefined;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const mount = async (actions: BulkAction<Row>[]) => {
|
|
42
|
+
alepha = Alepha.create().with(AlephaReactRouter).with(AlephaReactI18n);
|
|
43
|
+
await alepha.start();
|
|
44
|
+
render(
|
|
45
|
+
<AlephaContext.Provider value={alepha}>
|
|
46
|
+
<DataTable<Row> data={rows} columns={columns} bulkActions={actions} />
|
|
47
|
+
</AlephaContext.Provider>,
|
|
48
|
+
);
|
|
49
|
+
await waitFor(() => expect(screen.getByText("Alpha")).toBeTruthy());
|
|
50
|
+
fireEvent.click(screen.getAllByRole("checkbox")[1]);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* What the solid primary variant adds: the gradient, the top highlight
|
|
55
|
+
* and the border darker than the primary fill.
|
|
56
|
+
*/
|
|
57
|
+
const solidChrome = (button: HTMLElement) =>
|
|
58
|
+
button.className
|
|
59
|
+
.split(/\s+/)
|
|
60
|
+
.filter(
|
|
61
|
+
(name) =>
|
|
62
|
+
name.startsWith("bg-linear-to-b") ||
|
|
63
|
+
name.startsWith("shadow-[inset") ||
|
|
64
|
+
name.startsWith("border-[color-mix(in_oklch,var(--primary)"),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
it("draws no primary border or highlight on the actions and the close button", async () => {
|
|
68
|
+
await mount([
|
|
69
|
+
{ label: "Export", onClick: () => undefined },
|
|
70
|
+
{ label: "Delete", destructive: true, onClick: () => undefined },
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
for (const name of ["Export", "Delete", "Clear selection"]) {
|
|
74
|
+
expect(solidChrome(screen.getByRole("button", { name }))).toEqual([]);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("gives the close button no fill at rest", async () => {
|
|
79
|
+
await mount([{ label: "Export", onClick: () => undefined }]);
|
|
80
|
+
|
|
81
|
+
const close = screen.getByRole("button", { name: "Clear selection" });
|
|
82
|
+
const fills = close.className
|
|
83
|
+
.split(/\s+/)
|
|
84
|
+
.filter((name) => name.startsWith("bg-") && name !== "bg-clip-padding");
|
|
85
|
+
expect(fills).toEqual([]);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -468,6 +468,30 @@ describe("DataTable (the filter bar drawn from fields)", () => {
|
|
|
468
468
|
});
|
|
469
469
|
});
|
|
470
470
|
|
|
471
|
+
describe("the add button", () => {
|
|
472
|
+
it("carries a visible label while no filter is on screen, then turns back into a bare +", async () => {
|
|
473
|
+
await mount({
|
|
474
|
+
fields: {
|
|
475
|
+
team: filterFields.team,
|
|
476
|
+
owner: filterFields.owner,
|
|
477
|
+
},
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
// Nothing locked and nothing default: the bar holds the button alone,
|
|
481
|
+
// so it says what it adds, and needs no tooltip to say it.
|
|
482
|
+
const labeled = screen.getByRole("button", { name: "Add filter" });
|
|
483
|
+
expect(labeled.textContent).toContain("Add filter");
|
|
484
|
+
|
|
485
|
+
fireEvent.keyDown(labeled, { key: "ArrowDown" });
|
|
486
|
+
fireEvent.click(await screen.findByRole("menuitem", { name: /Owner/ }));
|
|
487
|
+
await waitFor(() => expect(slot("owner")).toBeTruthy());
|
|
488
|
+
|
|
489
|
+
// A filter now sits beside it: back to the small "+".
|
|
490
|
+
const bare = screen.getByRole("button", { name: "Add filters" });
|
|
491
|
+
expect(bare.textContent).not.toContain("Add filter");
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
|
|
471
495
|
describe("render", () => {
|
|
472
496
|
it("draws no bar when the caller renders the filters", async () => {
|
|
473
497
|
const app = await start();
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { act, 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/testing/react";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { DataTable } from "../DataTable.tsx";
|
|
10
|
+
|
|
11
|
+
interface Row {
|
|
12
|
+
id: number;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const columns = {
|
|
17
|
+
title: { label: "Title", cell: (r: Row) => r.title },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const page = (title: string) => ({
|
|
21
|
+
content: [{ id: 1, title }],
|
|
22
|
+
page: {
|
|
23
|
+
number: 0,
|
|
24
|
+
size: 20,
|
|
25
|
+
totalElements: 1,
|
|
26
|
+
totalPages: 1,
|
|
27
|
+
isEmpty: false,
|
|
28
|
+
isFirst: true,
|
|
29
|
+
isLast: true,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* #Q2517: every load's result was written whenever it arrived, so a slow
|
|
35
|
+
* older request (a project switch, a filter keystroke, a refresh) put the
|
|
36
|
+
* previous rows back over the newer ones.
|
|
37
|
+
*/
|
|
38
|
+
describe("DataTable (the newest request wins)", () => {
|
|
39
|
+
let alepha: Alepha | undefined;
|
|
40
|
+
|
|
41
|
+
beforeAll(() => {
|
|
42
|
+
setupJsdomMocks();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
afterEach(async () => {
|
|
46
|
+
await alepha?.stop();
|
|
47
|
+
alepha = undefined;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("keeps the newer rows when an older request answers last, and aborts it", async () => {
|
|
51
|
+
alepha = Alepha.create().with(AlephaReactRouter).with(AlephaReactI18n);
|
|
52
|
+
await alepha.start();
|
|
53
|
+
const calls: Array<{
|
|
54
|
+
resolve: (value: ReturnType<typeof page>) => void;
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}> = [];
|
|
57
|
+
const fetch = (params: { signal?: AbortSignal }) =>
|
|
58
|
+
new Promise<ReturnType<typeof page>>((resolve) => {
|
|
59
|
+
calls.push({ resolve, signal: params.signal });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const tree = (signal: number) => (
|
|
63
|
+
<AlephaContext.Provider value={alepha!}>
|
|
64
|
+
<DataTable<Row>
|
|
65
|
+
fetch={fetch as never}
|
|
66
|
+
refreshSignal={signal}
|
|
67
|
+
columns={columns}
|
|
68
|
+
/>
|
|
69
|
+
</AlephaContext.Provider>
|
|
70
|
+
);
|
|
71
|
+
const view = render(tree(0));
|
|
72
|
+
await waitFor(() => expect(calls).toHaveLength(1));
|
|
73
|
+
|
|
74
|
+
// A second load starts while the first is still out.
|
|
75
|
+
view.rerender(tree(1));
|
|
76
|
+
await waitFor(() => expect(calls).toHaveLength(2));
|
|
77
|
+
expect(calls[0]!.signal?.aborted).toBe(true);
|
|
78
|
+
|
|
79
|
+
await act(async () => {
|
|
80
|
+
calls[1]!.resolve(page("newer project"));
|
|
81
|
+
});
|
|
82
|
+
await waitFor(() => expect(screen.getByText("newer project")).toBeTruthy());
|
|
83
|
+
|
|
84
|
+
// The older request answers last. It used to win.
|
|
85
|
+
await act(async () => {
|
|
86
|
+
calls[0]!.resolve(page("older project"));
|
|
87
|
+
});
|
|
88
|
+
expect(screen.queryByText("older project")).toBeNull();
|
|
89
|
+
expect(screen.getByText("newer project")).toBeTruthy();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -386,8 +386,14 @@ export interface DataTableFilterFieldOptions {
|
|
|
386
386
|
/**
|
|
387
387
|
* The options of a list filter, for live data (an atom, a fetch). Without
|
|
388
388
|
* it, an enum schema gives the options. Read every render.
|
|
389
|
+
*
|
|
390
|
+
* A function receives the bar's current values, so one filter's options can
|
|
391
|
+
* follow another's choice: an "action" list narrowed to the actions the
|
|
392
|
+
* picked resource types actually have.
|
|
389
393
|
*/
|
|
390
|
-
items?:
|
|
394
|
+
items?:
|
|
395
|
+
| SelectOption[]
|
|
396
|
+
| ((values: Record<string, unknown>) => SelectOption[]);
|
|
391
397
|
/**
|
|
392
398
|
* The label of one option an enum schema gives. Its argument is `any` in
|
|
393
399
|
* the hoisted form; annotate it where a label map needs the literal type.
|
|
@@ -681,6 +687,13 @@ export type TableFetcher<
|
|
|
681
687
|
size: number;
|
|
682
688
|
sort?: string;
|
|
683
689
|
filters?: DataTableFilterValues<F>;
|
|
690
|
+
/**
|
|
691
|
+
* Aborted when a newer load supersedes this one (a filter keystroke, a
|
|
692
|
+
* project switch, a refresh). Pass it to the request to stop paying for an
|
|
693
|
+
* answer the table will discard anyway; ignoring it is safe, since a
|
|
694
|
+
* superseded answer is never written.
|
|
695
|
+
*/
|
|
696
|
+
signal?: AbortSignal;
|
|
684
697
|
}) => Promise<Page<T>>;
|
|
685
698
|
|
|
686
699
|
/**
|
|
@@ -122,11 +122,25 @@ export const useDataTableData = <T>(options: UseDataTableDataOptions<T>) => {
|
|
|
122
122
|
const fetchRef = useRef(props.fetch);
|
|
123
123
|
fetchRef.current = props.fetch;
|
|
124
124
|
|
|
125
|
+
// The newest request, so an older one that answers late cannot put its
|
|
126
|
+
// rows back (#Q2517). A project switch, a filter keystroke or a refresh
|
|
127
|
+
// each start one; only the last may write, and it aborts the one before.
|
|
128
|
+
const latestRequest = useRef<
|
|
129
|
+
{ id: number; abort: AbortController } | undefined
|
|
130
|
+
>(undefined);
|
|
131
|
+
|
|
125
132
|
const load = useCallback(async () => {
|
|
126
133
|
// Static mode owns no request. Bail before touching `loading` too, so a
|
|
127
134
|
// table fed an array never flashes the skeleton over rows it already has.
|
|
128
135
|
const fetcher = fetchRef.current;
|
|
129
136
|
if (!fetcher) return;
|
|
137
|
+
latestRequest.current?.abort.abort();
|
|
138
|
+
const request = {
|
|
139
|
+
id: (latestRequest.current?.id ?? 0) + 1,
|
|
140
|
+
abort: new AbortController(),
|
|
141
|
+
};
|
|
142
|
+
latestRequest.current = request;
|
|
143
|
+
const isLatest = () => latestRequest.current === request;
|
|
130
144
|
setLoading(true);
|
|
131
145
|
const sent = form ? { ...form.currentValues } : undefined;
|
|
132
146
|
try {
|
|
@@ -135,11 +149,16 @@ export const useDataTableData = <T>(options: UseDataTableDataOptions<T>) => {
|
|
|
135
149
|
size,
|
|
136
150
|
sort: sortParam,
|
|
137
151
|
filters: form?.currentValues,
|
|
152
|
+
signal: request.abort.signal,
|
|
138
153
|
});
|
|
154
|
+
if (!isLatest()) return;
|
|
139
155
|
setData(res.content);
|
|
140
156
|
setMeta(res.page);
|
|
141
157
|
setFetchedFilters(sent);
|
|
142
158
|
} catch (error) {
|
|
159
|
+
// A superseded request's failure (its own abort included) is nobody's
|
|
160
|
+
// news: a newer one is already answering.
|
|
161
|
+
if (!isLatest()) return;
|
|
143
162
|
// Surface read failures through the same `react:action:error` channel
|
|
144
163
|
// that useAction/useQuery use, so a mounted <ActionErrorToaster /> toasts
|
|
145
164
|
// them. Keep the previous rows on screen rather than blanking the table.
|
|
@@ -149,7 +168,11 @@ export const useDataTableData = <T>(options: UseDataTableDataOptions<T>) => {
|
|
|
149
168
|
error: error as Error,
|
|
150
169
|
});
|
|
151
170
|
} finally {
|
|
152
|
-
|
|
171
|
+
// Only the newest request clears `loading`: an older one finishing
|
|
172
|
+
// first used to hide the spinner while the table still waited.
|
|
173
|
+
if (isLatest()) {
|
|
174
|
+
setLoading(false);
|
|
175
|
+
}
|
|
153
176
|
}
|
|
154
177
|
}, [page, size, sortParam, refreshKey, form, alepha]);
|
|
155
178
|
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface AccountHeaderProps {
|
|
2
|
-
/**
|
|
3
|
-
* Route name the back link points at.
|
|
4
|
-
*
|
|
5
|
-
* @default "home"
|
|
6
|
-
*/
|
|
7
|
-
homeRouteName?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Label for the back link.
|
|
10
|
-
*
|
|
11
|
-
* @default "Back to site"
|
|
12
|
-
*/
|
|
13
|
-
backLabel?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The account area's top bar: a way out on the left, the ambient controls on
|
|
17
|
-
* the right.
|
|
18
|
-
*
|
|
19
|
-
* The way out is the point. `/account` is a destination you arrive at from
|
|
20
|
-
* somewhere else and leave again, and unlike `/admin` it has no sidebar to
|
|
21
|
-
* carry a brand or a home affordance — without this the only exit is the
|
|
22
|
-
* browser's back button.
|
|
23
|
-
*
|
|
24
|
-
* It is a real `<Link href>`, not a button that calls `router.push`, so the
|
|
25
|
-
* middle-click / open-in-new-tab / copy-link behaviours all work and the
|
|
26
|
-
* destination is visible in the status bar on hover.
|
|
27
|
-
*
|
|
28
|
-
* Replaceable wholesale: `AccountRouterOptions.header` overrides this, for an
|
|
29
|
-
* application whose account area sits inside its own chrome and needs no
|
|
30
|
-
* second header.
|
|
31
|
-
*/
|
|
32
|
-
export declare const AccountHeader: (props: AccountHeaderProps) => import("react").JSX.Element;
|
|
33
|
-
//# sourceMappingURL=AccountHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountHeader.d.ts","sourceRoot":"","sources":["../../src/account/AccountHeader.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,UAAW,kBAAkB,gCAyBtD,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Button } from "../core/Button.js";
|
|
2
|
-
import { ButtonSettings } from "../shell/ButtonSettings.js";
|
|
3
|
-
import { Link, useRouter } from "alepha/react/router";
|
|
4
|
-
import { ArrowLeft } from "lucide-react";
|
|
5
|
-
import { useI18n } from "alepha/react/i18n";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
//#region src/account/AccountHeader.tsx
|
|
8
|
-
/**
|
|
9
|
-
* The account area's top bar: a way out on the left, the ambient controls on
|
|
10
|
-
* the right.
|
|
11
|
-
*
|
|
12
|
-
* The way out is the point. `/account` is a destination you arrive at from
|
|
13
|
-
* somewhere else and leave again, and unlike `/admin` it has no sidebar to
|
|
14
|
-
* carry a brand or a home affordance — without this the only exit is the
|
|
15
|
-
* browser's back button.
|
|
16
|
-
*
|
|
17
|
-
* It is a real `<Link href>`, not a button that calls `router.push`, so the
|
|
18
|
-
* middle-click / open-in-new-tab / copy-link behaviours all work and the
|
|
19
|
-
* destination is visible in the status bar on hover.
|
|
20
|
-
*
|
|
21
|
-
* Replaceable wholesale: `AccountRouterOptions.header` overrides this, for an
|
|
22
|
-
* application whose account area sits inside its own chrome and needs no
|
|
23
|
-
* second header.
|
|
24
|
-
*/
|
|
25
|
-
const AccountHeader = (props) => {
|
|
26
|
-
const router = useRouter();
|
|
27
|
-
const { tr } = useI18n();
|
|
28
|
-
const home = props.homeRouteName ?? "home";
|
|
29
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
-
className: "flex items-center justify-between gap-4 border-b pb-3",
|
|
31
|
-
children: [/* @__PURE__ */ jsxs(Button, {
|
|
32
|
-
variant: "ghost",
|
|
33
|
-
size: "sm",
|
|
34
|
-
className: "text-muted-foreground hover:text-foreground -ml-2",
|
|
35
|
-
render: /* @__PURE__ */ jsx(Link, { href: router.path(home) }),
|
|
36
|
-
nativeButton: false,
|
|
37
|
-
role: "link",
|
|
38
|
-
children: [/* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" }), props.backLabel ?? tr("account.header.back", { default: "Back to site" })]
|
|
39
|
-
}), /* @__PURE__ */ jsx(ButtonSettings, {})]
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
//#endregion
|
|
43
|
-
export { AccountHeader };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=AccountHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountHeader.js","names":[],"sources":["../../src/account/AccountHeader.tsx"],"sourcesContent":["import { useI18n } from \"alepha/react/i18n\";\nimport { Link, useRouter } from \"alepha/react/router\";\nimport { ArrowLeft } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport { ButtonSettings } from \"../shell/ButtonSettings.tsx\";\n\nexport interface AccountHeaderProps {\n /**\n * Route name the back link points at.\n *\n * @default \"home\"\n */\n homeRouteName?: string;\n\n /**\n * Label for the back link.\n *\n * @default \"Back to site\"\n */\n backLabel?: string;\n}\n\n/**\n * The account area's top bar: a way out on the left, the ambient controls on\n * the right.\n *\n * The way out is the point. `/account` is a destination you arrive at from\n * somewhere else and leave again, and unlike `/admin` it has no sidebar to\n * carry a brand or a home affordance — without this the only exit is the\n * browser's back button.\n *\n * It is a real `<Link href>`, not a button that calls `router.push`, so the\n * middle-click / open-in-new-tab / copy-link behaviours all work and the\n * destination is visible in the status bar on hover.\n *\n * Replaceable wholesale: `AccountRouterOptions.header` overrides this, for an\n * application whose account area sits inside its own chrome and needs no\n * second header.\n */\nexport const AccountHeader = (props: AccountHeaderProps) => {\n const router = useRouter<any>();\n const { tr } = useI18n();\n const home = props.homeRouteName ?? \"home\";\n\n return (\n <div className=\"flex items-center justify-between gap-4 border-b pb-3\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"text-muted-foreground hover:text-foreground -ml-2\"\n render={<Link href={router.path(home)} />}\n // A link wearing a button's clothes: `nativeButton={false}` stops Base UI\n // assuming a native <button> (it warns otherwise), and `role` puts back the\n // link semantics its non-native branch would overwrite with `role=\"button\"`.\n nativeButton={false}\n role=\"link\"\n >\n <ArrowLeft className=\"size-4\" />\n {props.backLabel ??\n tr(\"account.header.back\", { default: \"Back to site\" })}\n </Button>\n <ButtonSettings />\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,iBAAiB,UAA8B;CAC1D,MAAM,SAAS,UAAe;CAC9B,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,OAAO,MAAM,iBAAiB;CAEpC,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,qBAAC,QAAD;GACE,SAAQ;GACR,MAAK;GACL,WAAU;GACV,QAAQ,oBAAC,MAAD,EAAM,MAAM,OAAO,KAAK,IAAI,EAAI,CAAA;GAIxC,cAAc;GACd,MAAK;GATP,UAAA,CAWE,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA,GAC9B,MAAM,aACL,GAAG,uBAAuB,EAAE,SAAS,eAAe,CAAC,CACjD;EACR,CAAA,GAAA,oBAAC,gBAAD,CAAiB,CAAA,CACd;;AAET"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ListApiKeyItem } from "alepha/api/keys";
|
|
2
|
-
export interface AccountKeysRowProps {
|
|
3
|
-
apiKey: ListApiKeyItem;
|
|
4
|
-
/**
|
|
5
|
-
* Offered on a live or an expired key: rotating an expired key is how it
|
|
6
|
-
* is renewed. Never on a revoked one.
|
|
7
|
-
*/
|
|
8
|
-
onRotate: (apiKey: ListApiKeyItem) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Offered on a live key only.
|
|
11
|
-
*/
|
|
12
|
-
onRevoke: (apiKey: ListApiKeyItem) => void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* One of your API keys: which one, how it has been used, where it is in its
|
|
16
|
-
* life, and what may still be done with it.
|
|
17
|
-
*
|
|
18
|
-
* A revoked key keeps its row, dimmed, with its usage and no action left;
|
|
19
|
-
* an expired key is dimmed too but keeps Rotate.
|
|
20
|
-
*/
|
|
21
|
-
export declare const AccountKeysRow: (props: AccountKeysRowProps) => import("react").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=AccountKeysRow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountKeysRow.d.ts","sourceRoot":"","sources":["../../src/account/AccountKeysRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWtD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,CAAC;IAEvB;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,UAAW,mBAAmB,gCAkExD,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Button } from "../core/Button.js";
|
|
2
|
-
import { SettingsRow } from "../settings/SettingsRow.js";
|
|
3
|
-
import { ApiKeyScopeSummary } from "./ApiKeyScopeSummary.js";
|
|
4
|
-
import { ApiKeyStatusBadge } from "./ApiKeyStatusBadge.js";
|
|
5
|
-
import { RefreshCw, Trash2 } from "lucide-react";
|
|
6
|
-
import { DateTimeProvider } from "alepha/datetime";
|
|
7
|
-
import { useInject } from "alepha/react";
|
|
8
|
-
import { useI18n } from "alepha/react/i18n";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
//#region src/account/AccountKeysRow.tsx
|
|
11
|
-
/**
|
|
12
|
-
* One of your API keys: which one, how it has been used, where it is in its
|
|
13
|
-
* life, and what may still be done with it.
|
|
14
|
-
*
|
|
15
|
-
* A revoked key keeps its row, dimmed, with its usage and no action left;
|
|
16
|
-
* an expired key is dimmed too but keeps Rotate.
|
|
17
|
-
*/
|
|
18
|
-
const AccountKeysRow = (props) => {
|
|
19
|
-
const dt = useInject(DateTimeProvider);
|
|
20
|
-
const { tr } = useI18n();
|
|
21
|
-
const key = props.apiKey;
|
|
22
|
-
const dead = key.status === "revoked" || key.status === "expired";
|
|
23
|
-
return /* @__PURE__ */ jsx(SettingsRow, {
|
|
24
|
-
label: key.name,
|
|
25
|
-
className: dead ? "opacity-70" : void 0,
|
|
26
|
-
description: (key.description ? `${key.description} · ` : "") + tr("account.keys.createdAt", {
|
|
27
|
-
default: "…$1 · created $2",
|
|
28
|
-
args: [key.tokenSuffix, dt.of(key.createdAt).fromNow()]
|
|
29
|
-
}) + (key.lastUsedAt ? tr("account.keys.lastUsedAt", {
|
|
30
|
-
default: " · last used $1",
|
|
31
|
-
args: [dt.of(key.lastUsedAt).fromNow()]
|
|
32
|
-
}) : tr("account.keys.neverUsed", { default: " · never used" })) + (key.ipAllowlist.length ? tr("account.keys.ipAllowlist", {
|
|
33
|
-
default: " · only from $1",
|
|
34
|
-
args: [key.ipAllowlist.join(", ")]
|
|
35
|
-
}) : ""),
|
|
36
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
37
|
-
className: "flex items-center gap-2",
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsx(ApiKeyScopeSummary, { permissions: key.permissions }),
|
|
40
|
-
/* @__PURE__ */ jsx(ApiKeyStatusBadge, { apiKey: key }),
|
|
41
|
-
key.status === "revoked" ? null : /* @__PURE__ */ jsx(Button, {
|
|
42
|
-
variant: "ghost",
|
|
43
|
-
size: "sm",
|
|
44
|
-
onClick: () => props.onRotate(key),
|
|
45
|
-
"aria-label": tr("account.keys.rotateAria", {
|
|
46
|
-
default: "Rotate $1",
|
|
47
|
-
args: [key.name]
|
|
48
|
-
}),
|
|
49
|
-
children: /* @__PURE__ */ jsx(RefreshCw, { className: "size-4" })
|
|
50
|
-
}),
|
|
51
|
-
dead ? null : /* @__PURE__ */ jsx(Button, {
|
|
52
|
-
variant: "ghost",
|
|
53
|
-
size: "sm",
|
|
54
|
-
onClick: () => props.onRevoke(key),
|
|
55
|
-
"aria-label": tr("account.keys.revokeAria", {
|
|
56
|
-
default: "Revoke $1",
|
|
57
|
-
args: [key.name]
|
|
58
|
-
}),
|
|
59
|
-
children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
//#endregion
|
|
66
|
-
export { AccountKeysRow };
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=AccountKeysRow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountKeysRow.js","names":[],"sources":["../../src/account/AccountKeysRow.tsx"],"sourcesContent":["import type { ListApiKeyItem } from \"alepha/api/keys\";\nimport { DateTimeProvider } from \"alepha/datetime\";\nimport { useInject } from \"alepha/react\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { RefreshCw, Trash2 } from \"lucide-react\";\n\nimport { Button } from \"../core/Button.tsx\";\nimport { SettingsRow } from \"../settings/SettingsRow.tsx\";\nimport { ApiKeyScopeSummary } from \"./ApiKeyScopeSummary.tsx\";\nimport { ApiKeyStatusBadge } from \"./ApiKeyStatusBadge.tsx\";\n\nexport interface AccountKeysRowProps {\n apiKey: ListApiKeyItem;\n\n /**\n * Offered on a live or an expired key: rotating an expired key is how it\n * is renewed. Never on a revoked one.\n */\n onRotate: (apiKey: ListApiKeyItem) => void;\n\n /**\n * Offered on a live key only.\n */\n onRevoke: (apiKey: ListApiKeyItem) => void;\n}\n\n/**\n * One of your API keys: which one, how it has been used, where it is in its\n * life, and what may still be done with it.\n *\n * A revoked key keeps its row, dimmed, with its usage and no action left;\n * an expired key is dimmed too but keeps Rotate.\n */\nexport const AccountKeysRow = (props: AccountKeysRowProps) => {\n const dt = useInject(DateTimeProvider);\n const { tr } = useI18n();\n const key = props.apiKey;\n const dead = key.status === \"revoked\" || key.status === \"expired\";\n\n return (\n <SettingsRow\n label={key.name}\n className={dead ? \"opacity-70\" : undefined}\n description={\n (key.description ? `${key.description} · ` : \"\") +\n tr(\"account.keys.createdAt\", {\n default: \"…$1 · created $2\",\n args: [key.tokenSuffix, dt.of(key.createdAt).fromNow()],\n }) +\n (key.lastUsedAt\n ? tr(\"account.keys.lastUsedAt\", {\n default: \" · last used $1\",\n args: [dt.of(key.lastUsedAt).fromNow()],\n })\n : tr(\"account.keys.neverUsed\", { default: \" · never used\" })) +\n // Read-only, set when the key was created through the API: shown so a\n // key refusing requests from a new address can be diagnosed here.\n (key.ipAllowlist.length\n ? tr(\"account.keys.ipAllowlist\", {\n default: \" · only from $1\",\n args: [key.ipAllowlist.join(\", \")],\n })\n : \"\")\n }\n >\n <div className=\"flex items-center gap-2\">\n <ApiKeyScopeSummary permissions={key.permissions} />\n <ApiKeyStatusBadge apiKey={key} />\n\n {key.status === \"revoked\" ? null : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => props.onRotate(key)}\n aria-label={tr(\"account.keys.rotateAria\", {\n default: \"Rotate $1\",\n args: [key.name],\n })}\n >\n <RefreshCw className=\"size-4\" />\n </Button>\n )}\n\n {dead ? null : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => props.onRevoke(key)}\n aria-label={tr(\"account.keys.revokeAria\", {\n default: \"Revoke $1\",\n args: [key.name],\n })}\n >\n <Trash2 className=\"size-4\" />\n </Button>\n )}\n </div>\n </SettingsRow>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAa,kBAAkB,UAA+B;CAC5D,MAAM,KAAK,UAAU,gBAAgB;CACrC,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,MAAM,MAAM;CAClB,MAAM,OAAO,IAAI,WAAW,aAAa,IAAI,WAAW;CAExD,OACE,oBAAC,aAAD;EACE,OAAO,IAAI;EACX,WAAW,OAAO,eAAe,KAAA;EACjC,cACG,IAAI,cAAc,GAAG,IAAI,YAAY,OAAO,MAC7C,GAAG,0BAA0B;GAC3B,SAAS;GACT,MAAM,CAAC,IAAI,aAAa,GAAG,GAAG,IAAI,SAAS,CAAC,CAAC,QAAQ,CAAC;EACxD,CAAC,KACA,IAAI,aACD,GAAG,2BAA2B;GAC5B,SAAS;GACT,MAAM,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,QAAQ,CAAC;EACxC,CAAC,IACD,GAAG,0BAA0B,EAAE,SAAS,gBAAgB,CAAC,MAG5D,IAAI,YAAY,SACb,GAAG,4BAA4B;GAC7B,SAAS;GACT,MAAM,CAAC,IAAI,YAAY,KAAK,IAAI,CAAC;EACnC,CAAC,IACD;EAGN,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,oBAAC,oBAAD,EAAoB,aAAa,IAAI,YAAc,CAAA;IACnD,oBAAC,mBAAD,EAAmB,QAAQ,IAAM,CAAA;IAEhC,IAAI,WAAW,YAAY,OAC1B,oBAAC,QAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,MAAM,SAAS,GAAG;KACjC,cAAY,GAAG,2BAA2B;MACxC,SAAS;MACT,MAAM,CAAC,IAAI,IAAI;KACjB,CAAC;KAED,UAAA,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;IACzB,CAAA;IAGT,OAAO,OACN,oBAAC,QAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,MAAM,SAAS,GAAG;KACjC,cAAY,GAAG,2BAA2B;MACxC,SAAS;MACT,MAAM,CAAC,IAAI,IAAI;KACjB,CAAC;KAED,UAAA,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA;IACtB,CAAA;GAEP;;CACM,CAAA;AAEjB"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { useI18n } from "alepha/react/i18n";
|
|
2
|
-
import { Link, useRouter } from "alepha/react/router";
|
|
3
|
-
import { ArrowLeft } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
import { Button } from "../core/Button.tsx";
|
|
6
|
-
import { ButtonSettings } from "../shell/ButtonSettings.tsx";
|
|
7
|
-
|
|
8
|
-
export interface AccountHeaderProps {
|
|
9
|
-
/**
|
|
10
|
-
* Route name the back link points at.
|
|
11
|
-
*
|
|
12
|
-
* @default "home"
|
|
13
|
-
*/
|
|
14
|
-
homeRouteName?: string;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Label for the back link.
|
|
18
|
-
*
|
|
19
|
-
* @default "Back to site"
|
|
20
|
-
*/
|
|
21
|
-
backLabel?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The account area's top bar: a way out on the left, the ambient controls on
|
|
26
|
-
* the right.
|
|
27
|
-
*
|
|
28
|
-
* The way out is the point. `/account` is a destination you arrive at from
|
|
29
|
-
* somewhere else and leave again, and unlike `/admin` it has no sidebar to
|
|
30
|
-
* carry a brand or a home affordance — without this the only exit is the
|
|
31
|
-
* browser's back button.
|
|
32
|
-
*
|
|
33
|
-
* It is a real `<Link href>`, not a button that calls `router.push`, so the
|
|
34
|
-
* middle-click / open-in-new-tab / copy-link behaviours all work and the
|
|
35
|
-
* destination is visible in the status bar on hover.
|
|
36
|
-
*
|
|
37
|
-
* Replaceable wholesale: `AccountRouterOptions.header` overrides this, for an
|
|
38
|
-
* application whose account area sits inside its own chrome and needs no
|
|
39
|
-
* second header.
|
|
40
|
-
*/
|
|
41
|
-
export const AccountHeader = (props: AccountHeaderProps) => {
|
|
42
|
-
const router = useRouter<any>();
|
|
43
|
-
const { tr } = useI18n();
|
|
44
|
-
const home = props.homeRouteName ?? "home";
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div className="flex items-center justify-between gap-4 border-b pb-3">
|
|
48
|
-
<Button
|
|
49
|
-
variant="ghost"
|
|
50
|
-
size="sm"
|
|
51
|
-
className="text-muted-foreground hover:text-foreground -ml-2"
|
|
52
|
-
render={<Link href={router.path(home)} />}
|
|
53
|
-
// A link wearing a button's clothes: `nativeButton={false}` stops Base UI
|
|
54
|
-
// assuming a native <button> (it warns otherwise), and `role` puts back the
|
|
55
|
-
// link semantics its non-native branch would overwrite with `role="button"`.
|
|
56
|
-
nativeButton={false}
|
|
57
|
-
role="link"
|
|
58
|
-
>
|
|
59
|
-
<ArrowLeft className="size-4" />
|
|
60
|
-
{props.backLabel ??
|
|
61
|
-
tr("account.header.back", { default: "Back to site" })}
|
|
62
|
-
</Button>
|
|
63
|
-
<ButtonSettings />
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { ListApiKeyItem } from "alepha/api/keys";
|
|
2
|
-
import { DateTimeProvider } from "alepha/datetime";
|
|
3
|
-
import { useInject } from "alepha/react";
|
|
4
|
-
import { useI18n } from "alepha/react/i18n";
|
|
5
|
-
import { RefreshCw, Trash2 } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
import { Button } from "../core/Button.tsx";
|
|
8
|
-
import { SettingsRow } from "../settings/SettingsRow.tsx";
|
|
9
|
-
import { ApiKeyScopeSummary } from "./ApiKeyScopeSummary.tsx";
|
|
10
|
-
import { ApiKeyStatusBadge } from "./ApiKeyStatusBadge.tsx";
|
|
11
|
-
|
|
12
|
-
export interface AccountKeysRowProps {
|
|
13
|
-
apiKey: ListApiKeyItem;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Offered on a live or an expired key: rotating an expired key is how it
|
|
17
|
-
* is renewed. Never on a revoked one.
|
|
18
|
-
*/
|
|
19
|
-
onRotate: (apiKey: ListApiKeyItem) => void;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Offered on a live key only.
|
|
23
|
-
*/
|
|
24
|
-
onRevoke: (apiKey: ListApiKeyItem) => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* One of your API keys: which one, how it has been used, where it is in its
|
|
29
|
-
* life, and what may still be done with it.
|
|
30
|
-
*
|
|
31
|
-
* A revoked key keeps its row, dimmed, with its usage and no action left;
|
|
32
|
-
* an expired key is dimmed too but keeps Rotate.
|
|
33
|
-
*/
|
|
34
|
-
export const AccountKeysRow = (props: AccountKeysRowProps) => {
|
|
35
|
-
const dt = useInject(DateTimeProvider);
|
|
36
|
-
const { tr } = useI18n();
|
|
37
|
-
const key = props.apiKey;
|
|
38
|
-
const dead = key.status === "revoked" || key.status === "expired";
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<SettingsRow
|
|
42
|
-
label={key.name}
|
|
43
|
-
className={dead ? "opacity-70" : undefined}
|
|
44
|
-
description={
|
|
45
|
-
(key.description ? `${key.description} · ` : "") +
|
|
46
|
-
tr("account.keys.createdAt", {
|
|
47
|
-
default: "…$1 · created $2",
|
|
48
|
-
args: [key.tokenSuffix, dt.of(key.createdAt).fromNow()],
|
|
49
|
-
}) +
|
|
50
|
-
(key.lastUsedAt
|
|
51
|
-
? tr("account.keys.lastUsedAt", {
|
|
52
|
-
default: " · last used $1",
|
|
53
|
-
args: [dt.of(key.lastUsedAt).fromNow()],
|
|
54
|
-
})
|
|
55
|
-
: tr("account.keys.neverUsed", { default: " · never used" })) +
|
|
56
|
-
// Read-only, set when the key was created through the API: shown so a
|
|
57
|
-
// key refusing requests from a new address can be diagnosed here.
|
|
58
|
-
(key.ipAllowlist.length
|
|
59
|
-
? tr("account.keys.ipAllowlist", {
|
|
60
|
-
default: " · only from $1",
|
|
61
|
-
args: [key.ipAllowlist.join(", ")],
|
|
62
|
-
})
|
|
63
|
-
: "")
|
|
64
|
-
}
|
|
65
|
-
>
|
|
66
|
-
<div className="flex items-center gap-2">
|
|
67
|
-
<ApiKeyScopeSummary permissions={key.permissions} />
|
|
68
|
-
<ApiKeyStatusBadge apiKey={key} />
|
|
69
|
-
|
|
70
|
-
{key.status === "revoked" ? null : (
|
|
71
|
-
<Button
|
|
72
|
-
variant="ghost"
|
|
73
|
-
size="sm"
|
|
74
|
-
onClick={() => props.onRotate(key)}
|
|
75
|
-
aria-label={tr("account.keys.rotateAria", {
|
|
76
|
-
default: "Rotate $1",
|
|
77
|
-
args: [key.name],
|
|
78
|
-
})}
|
|
79
|
-
>
|
|
80
|
-
<RefreshCw className="size-4" />
|
|
81
|
-
</Button>
|
|
82
|
-
)}
|
|
83
|
-
|
|
84
|
-
{dead ? null : (
|
|
85
|
-
<Button
|
|
86
|
-
variant="ghost"
|
|
87
|
-
size="sm"
|
|
88
|
-
onClick={() => props.onRevoke(key)}
|
|
89
|
-
aria-label={tr("account.keys.revokeAria", {
|
|
90
|
-
default: "Revoke $1",
|
|
91
|
-
args: [key.name],
|
|
92
|
-
})}
|
|
93
|
-
>
|
|
94
|
-
<Trash2 className="size-4" />
|
|
95
|
-
</Button>
|
|
96
|
-
)}
|
|
97
|
-
</div>
|
|
98
|
-
</SettingsRow>
|
|
99
|
-
);
|
|
100
|
-
};
|