@alepha/ui 0.34.0 → 0.35.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/dist/account/$pageAccount.js +1 -2
- package/dist/account/AccountBackToSiteMenuItem.js +1 -2
- package/dist/account/AccountBrand.js +1 -2
- package/dist/account/AccountConnections.js +1 -2
- package/dist/account/AccountDeleteDialog.js +2 -3
- package/dist/account/AccountKeys.js +3 -4
- package/dist/account/AccountLayout.js +4 -5
- package/dist/account/AccountMfaDialog.js +2 -3
- package/dist/account/AccountPage.js +1 -2
- package/dist/account/AccountPasswordDialog.js +2 -3
- package/dist/account/AccountProfile.js +3 -4
- package/dist/account/AccountRecoveryCodes.js +2 -3
- package/dist/account/AccountRecoveryCodesDialog.js +1 -2
- package/dist/account/AccountRouter.js +1 -2
- package/dist/account/AccountRouterOptions.js +1 -2
- package/dist/account/AccountSecurity.js +6 -7
- package/dist/account/AccountSessions.js +1 -2
- package/dist/account/ApiKeyCreateDialog.js +2 -3
- package/dist/account/ApiKeyScopeMatrix.js +1 -2
- package/dist/account/ApiKeyScopeSummary.js +1 -2
- package/dist/account/ApiKeyStatusBadge.js +1 -2
- package/dist/account/index.js +5 -5
- package/dist/admin/$pageAdmin.js +1 -2
- package/dist/admin/AdminAnalytics.js +1 -2
- package/dist/admin/AdminAudits.js +2 -3
- package/dist/admin/AdminAudits.js.map +1 -1
- package/dist/admin/AdminDashboard.js +2 -3
- package/dist/admin/AdminDashboardCountCard.js +1 -2
- package/dist/admin/AdminFiles.js +5 -6
- package/dist/admin/AdminFiles.js.map +1 -1
- package/dist/admin/AdminFilesUsage.d.ts.map +1 -1
- package/dist/admin/AdminFilesUsage.js +1 -2
- package/dist/admin/AdminFilesUsage.js.map +1 -1
- package/dist/admin/AdminFilesUsageCard.js +2 -3
- package/dist/admin/AdminJobDetail.js +1 -2
- package/dist/admin/AdminJobDetailAside.js +1 -2
- package/dist/admin/AdminJobDetailExecutions.js +2 -3
- package/dist/admin/AdminJobExecutionLogs.js +1 -2
- package/dist/admin/AdminJobExecutionSheet.js +3 -4
- package/dist/admin/AdminJobs.js +2 -3
- package/dist/admin/AdminJobsPayloadBody.js +1 -2
- package/dist/admin/AdminJobsPayloadDialog.js +1 -2
- package/dist/admin/AdminJobsStatusBadge.js +1 -2
- package/dist/admin/AdminJobsTypeIcon.js +1 -2
- package/dist/admin/AdminKeys.js +6 -7
- package/dist/admin/AdminKeysTokenDialog.js +2 -3
- package/dist/admin/AdminLayout.js +1 -2
- package/dist/admin/AdminNotifications.d.ts.map +1 -1
- package/dist/admin/AdminNotifications.js +6 -7
- package/dist/admin/AdminNotifications.js.map +1 -1
- package/dist/admin/AdminNotificationsDetail.js +1 -2
- package/dist/admin/AdminNotificationsDetailTabs.js +1 -2
- package/dist/admin/AdminNotificationsPreviewBody.js +1 -2
- package/dist/admin/AdminNotificationsPreviewTab.js +1 -2
- package/dist/admin/AdminNotificationsPreviewTab.js.map +1 -1
- package/dist/admin/AdminNotificationsRawTab.js +1 -2
- package/dist/admin/AdminNotificationsStatusBadge.js +1 -2
- package/dist/admin/AdminPage.js +1 -2
- package/dist/admin/AdminParameters.d.ts.map +1 -1
- package/dist/admin/AdminParameters.js +5 -6
- package/dist/admin/AdminParameters.js.map +1 -1
- package/dist/admin/AdminParametersEditorForm.js +1 -2
- package/dist/admin/AdminParametersEditorForm.js.map +1 -1
- package/dist/admin/AdminParametersEditorPane.js +3 -4
- package/dist/admin/AdminParametersEditorPane.js.map +1 -1
- package/dist/admin/AdminParametersHistoryPane.js +2 -3
- package/dist/admin/AdminParametersTreeFooterActions.js +1 -2
- package/dist/admin/AdminParametersTreeNodeView.js +2 -3
- package/dist/admin/AdminParametersTreePane.js +1 -2
- package/dist/admin/AdminPayments.js +2 -3
- package/dist/admin/AdminPaymentsStatusBadge.js +1 -2
- package/dist/admin/AdminRouter.d.ts +3 -2
- package/dist/admin/AdminRouter.d.ts.map +1 -1
- package/dist/admin/AdminRouter.js +1 -2
- package/dist/admin/AdminRouterOptions.js +1 -2
- package/dist/admin/AdminSessions.js +1 -2
- package/dist/admin/AdminUserAvatarControl.js +1 -2
- package/dist/admin/AdminUserCell.js +1 -2
- package/dist/admin/AdminUserDetail.js +2 -3
- package/dist/admin/AdminUserDetailAuditsTab.js +2 -3
- package/dist/admin/AdminUserDetailIdentityAside.js +1 -2
- package/dist/admin/AdminUserDetailOverviewTab.js +1 -2
- package/dist/admin/AdminUserDetailPasswordDialog.js +1 -2
- package/dist/admin/AdminUserDetailSecurityTab.js +3 -4
- package/dist/admin/AdminUserDetailSessionsTab.js +1 -2
- package/dist/admin/AdminUsers.js +3 -4
- package/dist/admin/AdminUsersRolesPicker.js +1 -2
- package/dist/admin/AdminUsersStatusBadge.js +1 -2
- package/dist/admin/EmailBodyFrame.js +1 -2
- package/dist/admin/ParameterDiffDialog.js +2 -3
- package/dist/admin/ParameterHistoryItem.d.ts.map +1 -1
- package/dist/admin/ParameterHistoryItem.js +4 -5
- package/dist/admin/ParameterHistoryItem.js.map +1 -1
- package/dist/admin/ParameterJsonDialog.js +2 -3
- package/dist/admin/ParameterSaveDialog.js +1 -2
- package/dist/admin/adminJobsStatusTones.js +1 -2
- package/dist/admin/adminNotificationsChannelLabel.js +1 -2
- package/dist/admin/adminNotificationsStatusTones.js +1 -2
- package/dist/admin/adminNotificationsTemplateLabel.js +1 -2
- package/dist/admin/adminParametersTree.js +1 -2
- package/dist/admin/adminPaymentsStatusTones.js +1 -2
- package/dist/admin/adminUserDetailPasswordSchema.d.ts +2 -1
- package/dist/admin/adminUserDetailPasswordSchema.d.ts.map +1 -1
- package/dist/admin/adminUserDetailPasswordSchema.js +1 -2
- package/dist/admin/adminUserDetailProfilePolicy.js +1 -2
- package/dist/admin/adminUserDetailProfileSchema.d.ts +7 -7
- package/dist/admin/adminUserDetailProfileSchema.d.ts.map +1 -1
- package/dist/admin/adminUserDetailProfileSchema.js +1 -2
- package/dist/admin/analytics/AdvancedSection.js +2 -3
- package/dist/admin/analytics/AnalyticsChart.js +1 -2
- package/dist/admin/analytics/AnalyticsChartBars.js +1 -2
- package/dist/admin/analytics/AnalyticsChartDonut.js +1 -2
- package/dist/admin/analytics/AnalyticsChartHeader.js +1 -2
- package/dist/admin/analytics/AnalyticsChartHeat.js +1 -2
- package/dist/admin/analytics/AnalyticsChartLegend.js +1 -2
- package/dist/admin/analytics/AnalyticsChartLine.js +1 -2
- package/dist/admin/analytics/AnalyticsChartRank.js +1 -2
- package/dist/admin/analytics/AnalyticsChartTicks.js +1 -2
- package/dist/admin/analytics/AnalyticsEmpty.js +1 -2
- package/dist/admin/analytics/ClauseLabel.js +1 -2
- package/dist/admin/analytics/CoarsenedBadge.js +1 -2
- package/dist/admin/analytics/CompareNote.js +1 -2
- package/dist/admin/analytics/DatasetSelect.js +1 -2
- package/dist/admin/analytics/FilterEditor.js +1 -2
- package/dist/admin/analytics/FilterValuePicker.js +2 -3
- package/dist/admin/analytics/GroupByChips.js +1 -2
- package/dist/admin/analytics/MeasureChips.js +1 -2
- package/dist/admin/analytics/QueryPanel.js +2 -3
- package/dist/admin/analytics/RangeControl.js +2 -3
- package/dist/admin/analytics/RequestDialog.js +1 -2
- package/dist/admin/analytics/ResultsPane.js +6 -7
- package/dist/admin/analytics/ResultsTable.js +3 -4
- package/dist/admin/analytics/RunFooter.js +1 -2
- package/dist/admin/analytics/SamplingBadge.js +1 -2
- package/dist/admin/analytics/ToggleChip.js +2 -3
- package/dist/admin/analytics/TotalsCards.js +1 -2
- package/dist/admin/analytics/TruncationBanner.js +1 -2
- package/dist/admin/analytics/analyticsModel.js +1 -2
- package/dist/admin/analytics/chartModel.js +1 -2
- package/dist/admin/analytics/instantRangeSchema.d.ts +3 -2
- package/dist/admin/analytics/instantRangeSchema.d.ts.map +1 -1
- package/dist/admin/analytics/instantRangeSchema.js +1 -2
- package/dist/admin/analytics/useAnalyticsQuery.js +1 -2
- package/dist/admin/analytics/useDismissable.js +1 -2
- package/dist/admin/analytics/useFilterValues.js +1 -2
- package/dist/admin/analytics/usePanelWidth.js +1 -2
- package/dist/admin/analytics/useShapeLabels.js +1 -2
- package/dist/admin/diffLines.js +1 -2
- package/dist/admin/downloadJson.js +1 -2
- package/dist/admin/index.js +5 -5
- package/dist/admin/useConfirmedAction.js +1 -2
- package/dist/admin/useJobRetentionLabels.js +1 -2
- package/dist/admin/useJobStatusLabels.js +1 -2
- package/dist/admin/useNotificationStatusLabels.js +1 -2
- package/dist/admin/useParameterHistoryCollapsed.js +1 -2
- package/dist/ai/AiChat.js +3 -4
- package/dist/ai/AiChatConfirmCard.js +1 -2
- package/dist/ai/AiChatHistory.js +2 -3
- package/dist/ai/AiChatMessage.js +1 -2
- package/dist/ai/AiFormRegistry.js +1 -2
- package/dist/ai/aiChatMessageFormSchema.d.ts +2 -1
- package/dist/ai/aiChatMessageFormSchema.d.ts.map +1 -1
- package/dist/ai/aiChatMessageFormSchema.js +1 -2
- package/dist/ai/aiContextAtom.d.ts +6 -5
- package/dist/ai/aiContextAtom.d.ts.map +1 -1
- package/dist/ai/aiContextAtom.js +1 -2
- package/dist/ai/index.js +1 -1
- package/dist/ai/useAiChat.js +1 -2
- package/dist/ai/useAiContext.js +1 -2
- package/dist/auth/AuthLogin.js +5 -6
- package/dist/auth/AuthMfaStep.js +2 -3
- package/dist/auth/AuthRegister.d.ts.map +1 -1
- package/dist/auth/AuthRegister.js +4 -5
- package/dist/auth/AuthRegister.js.map +1 -1
- package/dist/auth/AuthRegisterCentered.js +1 -2
- package/dist/auth/AuthRegisterFormPhase.js +5 -6
- package/dist/auth/AuthRegisterPasswordRules.js +1 -2
- package/dist/auth/AuthRegisterRealmHeader.js +1 -2
- package/dist/auth/AuthRegisterRealmLogo.js +1 -2
- package/dist/auth/AuthResetPassword.js +4 -5
- package/dist/auth/AuthRouter.js +1 -2
- package/dist/auth/AuthVerifyEmail.js +2 -3
- package/dist/auth/AuthVerifyEmailStateful.js +1 -2
- package/dist/auth/AuthVerifyEmailView.js +2 -3
- package/dist/auth/TurnstileWidget.js +1 -2
- package/dist/auth/index.js +3 -3
- package/dist/auth/providerLabels.js +1 -2
- package/dist/auth/safeRedirect.js +1 -2
- package/dist/calendar/Calendar.js +2 -3
- package/dist/calendar/LazyCalendar.js +1 -2
- package/dist/calendar/index.js +1 -2
- package/dist/chart/Chart.js +1 -2
- package/dist/chart/index.js +1 -2
- package/dist/command/Command.js +2 -3
- package/dist/command/commandScore.js +1 -2
- package/dist/command/index.js +1 -1
- package/dist/command/rankCommandItems.js +1 -2
- package/dist/core/Alert.js +1 -2
- package/dist/core/AlertDialog.js +2 -3
- package/dist/core/Avatar.js +1 -2
- package/dist/core/Badge.js +1 -2
- package/dist/core/BrandIcon.js +1 -2
- package/dist/core/Breadcrumb.js +1 -2
- package/dist/core/Button.js +1 -2
- package/dist/core/ButtonGroup.js +2 -3
- package/dist/core/Card.js +1 -2
- package/dist/core/Checkbox.js +1 -2
- package/dist/core/Combobox.js +2 -3
- package/dist/core/ContextMenu.js +1 -2
- package/dist/core/Dialog.js +2 -3
- package/dist/core/Drawer.js +1 -2
- package/dist/core/DropdownMenu.js +1 -2
- package/dist/core/Empty.js +1 -2
- package/dist/core/FileImage.js +1 -2
- package/dist/core/FilterSlot.js +1 -2
- package/dist/core/Highlight.js +2 -3
- package/dist/core/HoverCard.js +1 -2
- package/dist/core/Input.js +1 -2
- package/dist/core/InputGroup.js +2 -3
- package/dist/core/Kbd.js +1 -2
- package/dist/core/Label.js +1 -2
- package/dist/core/Menubar.js +2 -3
- package/dist/core/Pagination.js +2 -3
- package/dist/core/PaneRail.js +1 -2
- package/dist/core/Popover.js +1 -2
- package/dist/core/Progress.js +1 -2
- package/dist/core/Segmented.js +1 -2
- package/dist/core/Separator.js +1 -2
- package/dist/core/Sheet.js +2 -3
- package/dist/core/Sidebar.js +5 -6
- package/dist/core/Skeleton.js +1 -2
- package/dist/core/Slider.js +1 -2
- package/dist/core/Spinner.js +1 -2
- package/dist/core/Switch.js +1 -2
- package/dist/core/Table.js +1 -2
- package/dist/core/Tabs.js +1 -2
- package/dist/core/Textarea.js +1 -2
- package/dist/core/TimeAgo.js +1 -2
- package/dist/core/Toaster.js +1 -2
- package/dist/core/Tooltip.js +1 -2
- package/dist/core/UserAvatar.js +2 -3
- package/dist/core/highlightRanges.js +1 -2
- package/dist/core/index.js +37 -37
- package/dist/core/useDialog.js +1 -2
- package/dist/core/useIsMobile.js +1 -2
- package/dist/core/useToast.js +1 -2
- package/dist/core/utils.js +1 -2
- package/dist/form/AutoForm.js +6 -7
- package/dist/form/AutoFormBottomBar.js +2 -3
- package/dist/form/AutoFormErrorPopover.js +1 -2
- package/dist/form/AutoFormGroupBlock.js +3 -4
- package/dist/form/AutoFormGroupGridField.js +2 -3
- package/dist/form/Control.js +5 -6
- package/dist/form/ControlArray.js +2 -3
- package/dist/form/ControlArray.js.map +1 -1
- package/dist/form/ControlDate.js +1 -2
- package/dist/form/ControlDatePopover.js +3 -4
- package/dist/form/ControlDateRange.js +2 -3
- package/dist/form/ControlMonthPopover.js +2 -3
- package/dist/form/ControlNumber.js +2 -3
- package/dist/form/ControlObject.js +2 -3
- package/dist/form/ControlObject.js.map +1 -1
- package/dist/form/ControlPassword.js +1 -2
- package/dist/form/ControlSelect.js +3 -4
- package/dist/form/ControlSelectCombobox.js +3 -4
- package/dist/form/ControlUpload.js +4 -5
- package/dist/form/ControlUpload.js.map +1 -1
- package/dist/form/ControlUploadItemThumb.js +1 -2
- package/dist/form/FormField.js +2 -3
- package/dist/form/FormFieldAutoSaveProvider.js +1 -2
- package/dist/form/FormFieldLayoutProvider.js +1 -2
- package/dist/form/FormFieldRequiredMarkerProvider.js +1 -2
- package/dist/form/autoFormGroups.js +1 -2
- package/dist/form/controlSelectOptions.js +1 -2
- package/dist/form/dateOnly.js +1 -2
- package/dist/form/fieldI18n.js +1 -2
- package/dist/form/fieldTrigger.js +1 -2
- package/dist/form/grid.js +1 -2
- package/dist/form/iconHint.js +1 -2
- package/dist/form/index.js +7 -7
- package/dist/form/resizeImage.js +1 -2
- package/dist/i18n/fr/index.js +1 -2
- package/dist/i18n/fr/uiFr.js +1 -2
- package/dist/markdown/MarkdownView.js +1 -2
- package/dist/markdown/SpoilerSpan.js +1 -2
- package/dist/markdown/diagram/DiagramErrorBoundary.js +1 -2
- package/dist/markdown/diagram/DiagramLabel.js +1 -2
- package/dist/markdown/diagram/FlowchartDiagram.js +2 -3
- package/dist/markdown/diagram/FlowchartDiagramCluster.js +2 -3
- package/dist/markdown/diagram/FlowchartDiagramEdge.js +1 -2
- package/dist/markdown/diagram/FlowchartDiagramNode.js +1 -2
- package/dist/markdown/diagram/MermaidFence.js +3 -4
- package/dist/markdown/diagram/SequenceDiagram.js +2 -3
- package/dist/markdown/diagram/SequenceDiagramFragment.js +1 -2
- package/dist/markdown/diagram/SequenceDiagramMessage.js +1 -2
- package/dist/markdown/diagram/SequenceDiagramNote.js +1 -2
- package/dist/markdown/diagram/SequenceDiagramParticipant.js +1 -2
- package/dist/markdown/diagram/SequenceDiagramParticipantActor.js +2 -3
- package/dist/markdown/diagram/diagramKind.js +1 -2
- package/dist/markdown/diagram/flowchartParser.js +1 -2
- package/dist/markdown/diagram/layoutFlowchart.js +1 -2
- package/dist/markdown/diagram/layoutFlowchart.js.map +1 -1
- package/dist/markdown/diagram/layoutSequence.js +1 -2
- package/dist/markdown/diagram/sequenceParser.js +1 -2
- package/dist/markdown/diagram/textMetrics.js +1 -2
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/rehypeHighlight.js +1 -2
- package/dist/markdown/remarkSpoiler.js +1 -2
- package/dist/organizations/MyOrganizationInvitations.js +2 -3
- package/dist/organizations/MyOrganizations.js +2 -3
- package/dist/organizations/OrganizationInviteDialog.js +2 -3
- package/dist/organizations/OrganizationMemberIdentity.js +2 -3
- package/dist/organizations/OrganizationMemberRankPicker.js +1 -2
- package/dist/organizations/OrganizationMembers.js +3 -4
- package/dist/organizations/OrganizationPendingInvitations.js +3 -4
- package/dist/organizations/OrganizationRankColumnHeader.js +2 -3
- package/dist/organizations/OrganizationRanks.js +5 -6
- package/dist/organizations/OrganizationTransferOwnershipDialog.js +2 -3
- package/dist/organizations/index.js +6 -6
- package/dist/organizations/useInviteOrganizationMember.js +1 -2
- package/dist/organizations/useRevokeOrganizationInvitation.js +1 -2
- package/dist/otp/InputOTP.js +1 -2
- package/dist/otp/index.js +1 -2
- package/dist/resizable/Resizable.js +1 -2
- package/dist/resizable/index.js +1 -2
- package/dist/settings/SettingsDangerSection.js +2 -3
- package/dist/settings/SettingsHeading.js +1 -2
- package/dist/settings/SettingsLayout.js +1 -2
- package/dist/settings/SettingsNav.js +1 -2
- package/dist/settings/SettingsRow.js +2 -3
- package/dist/settings/SettingsSection.js +3 -4
- package/dist/settings/index.js +3 -3
- package/dist/settings/settingsCardEdge.js +1 -2
- package/dist/shell/$pageNav.js +1 -2
- package/dist/shell/ActionErrorToaster.js +1 -2
- package/dist/shell/AppActions.js +2 -3
- package/dist/shell/AppShell.js +3 -4
- package/dist/shell/AppShellNavCollapse.js +1 -2
- package/dist/shell/AppShellNavDropdownItems.js +1 -2
- package/dist/shell/AppShellSidebarNavItem.d.ts.map +1 -1
- package/dist/shell/AppShellSidebarNavItem.js +4 -3
- package/dist/shell/AppShellSidebarNavItem.js.map +1 -1
- package/dist/shell/AppShellStatefulSidebarTrigger.js +1 -2
- package/dist/shell/ButtonDark.js +1 -2
- package/dist/shell/ButtonInbox.js +3 -4
- package/dist/shell/ButtonLanguage.js +2 -3
- package/dist/shell/ButtonLanguage.js.map +1 -1
- package/dist/shell/ButtonSettings.js +2 -3
- package/dist/shell/ButtonSettingsColorModeMenu.js +1 -2
- package/dist/shell/ButtonSettingsLanguageMenu.js +1 -2
- package/dist/shell/ButtonSettingsLanguageMenu.js.map +1 -1
- package/dist/shell/ButtonSettingsThemeMenu.js +1 -2
- package/dist/shell/ButtonTheme.js +3 -4
- package/dist/shell/ButtonThemeSwatch.js +1 -2
- package/dist/shell/ButtonUser.js +2 -3
- package/dist/shell/ButtonUserAccountMenuItem.js +1 -2
- package/dist/shell/ButtonUserAdminMenuItem.js +1 -2
- package/dist/shell/ButtonUserContent.js +3 -4
- package/dist/shell/ButtonUserDefaultMenu.js +1 -2
- package/dist/shell/ButtonUserEmail.js +1 -2
- package/dist/shell/ButtonUserLogoutMenuItem.js +1 -2
- package/dist/shell/ButtonUserPlaceholder.js +1 -2
- package/dist/shell/DetailAside.js +3 -4
- package/dist/shell/DetailLayout.js +2 -3
- package/dist/shell/NavShell.js +1 -2
- package/dist/shell/NavigationProgress.js +1 -2
- package/dist/shell/PlateLayout.js +1 -2
- package/dist/shell/PlateTabBar.d.ts +5 -0
- 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/SidebarNavAutoClose.js +1 -2
- package/dist/shell/Spotlight.js +2 -3
- package/dist/shell/appShellNav.d.ts +6 -0
- package/dist/shell/appShellNav.d.ts.map +1 -1
- package/dist/shell/appShellNav.js +1 -2
- package/dist/shell/appShellNav.js.map +1 -1
- package/dist/shell/inboxUnreadAtom.js +1 -2
- package/dist/shell/index.js +10 -10
- package/dist/shell/navTreeUtil.js +1 -2
- package/dist/shell/spotlightSearchText.js +1 -2
- package/dist/shell/useDetailTab.js +1 -2
- package/dist/shell/useNavBreadcrumbs.js +1 -2
- package/dist/shell/useNavEntries.js +1 -2
- package/dist/shell/useNavTree.js +1 -2
- package/dist/table/DataTable.js +2 -3
- package/dist/table/DataTableBody.js +3 -4
- package/dist/table/DataTableBulkBar.js +1 -2
- package/dist/table/DataTableBulkMenu.js +2 -3
- package/dist/table/DataTableColumnPicker.js +3 -4
- package/dist/table/DataTableFilterAdd.js +2 -3
- package/dist/table/DataTableFilterBar.js +2 -3
- package/dist/table/DataTableFilterBar.js.map +1 -1
- package/dist/table/DataTableFilterControl.js +2 -3
- package/dist/table/DataTableFilterDialog.js +1 -2
- package/dist/table/DataTableFilterMenu.js +2 -3
- package/dist/table/DataTableFilterOperator.js +1 -2
- package/dist/table/DataTableFooter.js +2 -3
- package/dist/table/DataTableHeaderRow.js +3 -4
- package/dist/table/DataTableHelpButton.js +1 -2
- package/dist/table/DataTableRowActionItem.js +1 -2
- package/dist/table/DataTableRowActionsMenu.js +2 -3
- package/dist/table/DataTableSkeletonRows.js +2 -3
- package/dist/table/DataTableSummaryCard.js +1 -2
- package/dist/table/DataTableSummaryPanel.js +2 -3
- package/dist/table/DataTableToolbar.js +2 -3
- package/dist/table/PermissionMatrix.js +2 -3
- package/dist/table/PermissionMatrixGroupRows.js +3 -4
- package/dist/table/PermissionMatrixRowLabel.js +1 -2
- package/dist/table/dataTableCellPadding.js +1 -2
- package/dist/table/dataTableFilterFields.js +1 -2
- package/dist/table/dataTablePersistence.js +1 -2
- package/dist/table/dataTableSquareRight.js +1 -2
- package/dist/table/index.js +4 -4
- package/dist/table/paginateLocal.js +1 -2
- package/dist/table/queryFilters.js +1 -2
- package/dist/table/queryFilters.js.map +1 -1
- package/dist/table/useDataTableColumns.js +1 -2
- package/dist/table/useDataTableData.d.ts +2 -2
- package/dist/table/useDataTableData.d.ts.map +1 -1
- package/dist/table/useDataTableData.js +1 -2
- package/dist/table/useDataTableFilterForm.js +2 -3
- package/dist/table/useDataTableFilterVisibility.js +1 -2
- package/dist/table/useDataTableRefresh.js +1 -2
- package/dist/table/useDataTableSummary.js +1 -2
- package/dist/table/useTableSelection.js +1 -2
- package/dist/tree/TreeView.js +1 -2
- package/dist/tree/TreeViewRenameInput.js +1 -2
- package/dist/tree/TreeViewResizer.js +1 -2
- package/dist/tree/TreeViewRow.js +2 -3
- package/dist/tree/index.js +1 -1
- package/dist/tree/treeModel.js +1 -2
- package/dist/tree/useTreeState.js +1 -2
- package/package.json +16 -16
- package/src/account/__tests__/AccountLayout.browser.spec.tsx +2 -2
- package/src/account/__tests__/AccountRouter.spec.ts +1 -1
- package/src/admin/AdminAudits.tsx +1 -1
- package/src/admin/AdminFiles.tsx +1 -1
- package/src/admin/AdminFilesUsage.tsx +1 -2
- package/src/admin/AdminNotifications.tsx +2 -5
- package/src/admin/AdminNotificationsPreviewTab.tsx +2 -2
- package/src/admin/AdminParameters.tsx +1 -3
- package/src/admin/AdminParametersEditorForm.tsx +1 -1
- package/src/admin/AdminParametersEditorPane.tsx +1 -1
- package/src/admin/ParameterHistoryItem.tsx +1 -3
- package/src/admin/__tests__/AdminNavI18n.browser.spec.tsx +1 -1
- package/src/admin/__tests__/AdminStatusLabels.browser.spec.tsx +1 -1
- package/src/admin/analytics/analyticsModel.spec.ts +6 -6
- package/src/auth/AuthRegister.tsx +1 -3
- package/src/form/ControlArray.tsx +1 -1
- package/src/form/ControlObject.tsx +1 -1
- package/src/form/ControlUpload.tsx +1 -1
- package/src/form/__tests__/ControlDateLanguage.browser.spec.tsx +1 -1
- package/src/form/__tests__/ControlDateRange.browser.spec.tsx +1 -1
- package/src/form/__tests__/ControlObjectClear.browser.spec.tsx +2 -2
- package/src/form/__tests__/ControlSelectClearLabel.browser.spec.tsx +1 -1
- package/src/form/__tests__/ControlSelectDeselect.browser.spec.tsx +1 -3
- package/src/form/__tests__/ControlSelectMulti.browser.spec.tsx +2 -2
- package/src/form/__tests__/ControlSelectSearchable.browser.spec.tsx +1 -1
- package/src/form/__tests__/ControlSelectSizeMinimal.browser.spec.tsx +2 -2
- package/src/form/__tests__/ControlSelectTriggerProps.browser.spec.tsx +1 -3
- package/src/markdown/diagram/layoutFlowchart.ts +1 -1
- package/src/organizations/__tests__/OrganizationRanks.browser.spec.tsx +1 -1
- package/src/organizations/__tests__/OrganizationTransferOwnershipDialog.browser.spec.tsx +1 -1
- package/src/shell/AppShellSidebarNavItem.tsx +8 -0
- package/src/shell/ButtonLanguage.tsx +1 -1
- package/src/shell/ButtonSettingsLanguageMenu.tsx +1 -1
- package/src/shell/PlateTabBar.tsx +6 -0
- package/src/shell/__tests__/AppActions.browser.spec.tsx +1 -1
- package/src/shell/__tests__/ButtonInbox.browser.spec.tsx +1 -1
- package/src/shell/__tests__/ButtonSettings.browser.spec.tsx +1 -1
- package/src/shell/__tests__/ButtonUserAvatar.browser.spec.tsx +1 -1
- package/src/shell/__tests__/SidebarNavAutoClose.browser.spec.tsx +1 -1
- package/src/shell/appShellNav.tsx +6 -0
- package/src/table/DataTableFilterBar.tsx +1 -1
- package/src/table/queryFilters.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthRegister.js","names":[],"sources":["../../src/auth/AuthRegister.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { SchemaValidationError, z } from \"alepha\";\nimport type {\n RealmConfig,\n RegistrationIntentResponse,\n UserController,\n} from \"alepha/api/users\";\nimport { useClient } from \"alepha/react\";\nimport { useAuth } from \"alepha/react/auth\";\nimport { useForm, useFormState } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useRouter } from \"alepha/react/router\";\nimport { AlertCircle } from \"lucide-react\";\nimport {\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Alert, AlertDescription } from \"../core/Alert.tsx\";\nimport { Button } from \"../core/Button.tsx\";\nimport { Card, CardContent } from \"../core/Card.tsx\";\nimport { Label } from \"../core/Label.tsx\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n} from \"../otp/InputOTP.tsx\";\nimport { AuthRegisterCentered } from \"./AuthRegisterCentered.tsx\";\nimport { AuthRegisterFormPhase } from \"./AuthRegisterFormPhase.tsx\";\nimport { AuthRegisterRealmLogo } from \"./AuthRegisterRealmLogo.tsx\";\nimport { safeRedirect } from \"./safeRedirect.ts\";\nimport type { TurnstileWidgetHandle } from \"./TurnstileWidget.tsx\";\n\nexport interface AuthRegisterProps {\n /**\n * Realm configuration (drives required fields, verification step, OAuth buttons).\n */\n realmConfig: RealmConfig;\n /**\n * Custom logo node, rendered above the form. When provided, it replaces\n * the default `settings.logoUrl` <img>. Use this to inject a branded\n * component (e.g. with light/dark variants or an animation).\n */\n logo?: ReactNode;\n /**\n * Route to the login page. When set, a \"Sign in\" link is shown.\n */\n loginPath?: string;\n /**\n * Optional banner rendered above the registration form (form phase only).\n * Used to contextualize the flow when the user arrives via a CTA, e.g.\n * \"Before creating a campaign, create an account.\"\n */\n message?: ReactNode;\n /**\n * Where the \"Cancel\" button abandons to. Defaults to \"/\". This is\n * intentionally decoupled from the post-auth `?redirect=` target: cancelling\n * an unauthenticated registration must land somewhere public (home), not the\n * protected destination the user was *heading* to — which would only bounce\n * them back to this page.\n */\n cancelPath?: string;\n /**\n * Render the form even though `settings.registrationAllowed` is `false`.\n *\n * For a visitor the application has already vouched for out of band - an\n * invitation link, a signup code - who would otherwise meet the closed\n * alert and stop. Presentation only: the server decides, through the\n * realm's `isPreAuthorized` seam, and refuses this submit like any other if\n * {@link preAuthToken} does not hold up.\n */\n preAuthorized?: boolean;\n /**\n * Pre-fill the email field and stop it being edited.\n *\n * Set it alongside {@link preAuthToken}, which is bound to one address:\n * letting the field be typed over only produces a server-side refusal the\n * visitor cannot act on.\n */\n lockedEmail?: string;\n /**\n * The application's opaque proof that this address may register into a\n * closed realm. Passed through to the register request untouched.\n */\n preAuthToken?: string;\n /**\n * Where a successful registration lands, overriding `?redirect=`.\n *\n * A prop rather than a URL param because the submit handler is built ONCE,\n * at mount, and closes over whatever `redirect` was then: a page that\n * decides the destination and seeds the query afterwards has already\n * missed it, and the user lands on the default with nothing to explain\n * why. A prop is read on the render that builds the handler.\n *\n * Sanitised like the query value, since the two are the same kind of thing.\n */\n redirect?: string;\n}\n\nexport const AuthRegister = (props: AuthRegisterProps) => {\n const auth = useAuth();\n const userCtrl = useClient<UserController>();\n const router = useRouter();\n const { tr } = useI18n();\n const redirect = safeRedirect(props.redirect ?? router.query.redirect);\n // Surface upstream auth errors (e.g. failed OAuth callback redirects with\n // `?error=...`) — same pattern as AuthLogin. Without this the user lands on\n // a fresh-looking registration page with no clue why.\n const queryError =\n typeof router.query.error === \"string\" ? router.query.error : undefined;\n\n const [state, setState] = useState<State>({ phase: \"form\" });\n const [emailCode, setEmailCode] = useState(\"\");\n const [phoneCode, setPhoneCode] = useState(\"\");\n const [verifyError, setVerifyError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const captchaSiteKey = props.realmConfig.captchaSiteKey;\n const [captchaToken, setCaptchaToken] = useState<string | undefined>();\n const captchaRef = useRef<TurnstileWidgetHandle | null>(null);\n // The handler reads the token the widget issued last through a ref, so a\n // submit never posts a token captured by an earlier render.\n const captchaTokenRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n captchaTokenRef.current = captchaToken;\n }, [captchaToken]);\n\n const credentialsProvider = props.realmConfig.authenticationMethods.find(\n (it) => it.type === \"CREDENTIALS\",\n );\n const settings = props.realmConfig.settings;\n // The realm decides, unless the application has already vouched for this\n // particular visitor. Both halves are presentation: the gate is\n // `RegistrationService`, which refuses a submit that the seam does not\n // recognise however the form got rendered.\n const allowed =\n props.preAuthorized === true || settings.registrationAllowed !== false;\n\n const schema = useMemo(() => {\n // Optionality is decided as each field is built, because that is the only\n // thing the form reads: `FormModel` derives both the required marker and\n // the pre-submit check from `z.schema.requiredInputKeys(schema)`, which asks\n // whether the field is optional or defaulted.\n //\n // This used to declare every field optional and then push the configured\n // names onto the array returned by `z.schema.requiredInputKeys(s)` , a TypeBox\n // habit, where a JSON Schema's `required` was a live array hanging off the\n // schema. The zod implementation computes a fresh array from the shape, so\n // the pushes mutated a detached value and vanished: a realm with\n // `email: \"required\"` still rendered Email with no asterisk and let an\n // empty one through to the server.\n const names = settings.firstNameLastName === \"required\";\n const shape = {\n firstName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n username:\n settings.username === \"required\"\n ? z.text({ trim: true, pattern: settings.usernameRegExp })\n : z.text({ trim: true, pattern: settings.usernameRegExp }).optional(),\n email: settings.email === \"required\" ? z.email() : z.email().optional(),\n phoneNumber:\n settings.phoneNumber === \"required\" ? z.e164() : z.e164().optional(),\n password: z.string().min(settings.passwordPolicy?.minLength ?? 8),\n };\n\n // The runtime shape varies with the realm, but the *type* must not: every\n // consumer below reads `data.email`, `data.username` and the rest as\n // possibly-absent. Widening to the all-optional shape keeps one stable\n // type instead of a union of eight.\n return z.object(shape) as unknown as ReturnType<typeof registerFormSchema>;\n }, [settings]);\n\n const form = useForm({\n schema,\n // A locked address is the form's starting value, not a field the visitor\n // fills. It arrives before mount (the page resolves the token in its\n // loader), which is what lets `useForm` anchor it here.\n initialValues: props.lockedEmail\n ? ({ email: props.lockedEmail } as never)\n : undefined,\n // Handled here: every error this form throws is rendered by the page itself,\n // under its field or in the alert above the form. Without an `onError`,\n // a mounted `ActionErrorToaster` toasted the same sentence a second time.\n onError: () => {},\n handler: async (data) => {\n try {\n const intent = await userCtrl.createRegistrationIntent({\n query: { userRealmName: props.realmConfig.realmName },\n body: {\n firstName: data.firstName,\n lastName: data.lastName,\n username: data.username,\n // The locked address wins over whatever the field holds: it is\n // the one the token is bound to, and a disabled input is a\n // presentation fact rather than a guarantee.\n email: props.lockedEmail ?? data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n preAuthToken: props.preAuthToken,\n },\n });\n const identifier =\n data.username ?? props.lockedEmail ?? data.email ?? data.phoneNumber;\n if (\n intent.expectEmailVerification ||\n intent.expectPhoneVerification ||\n intent.expectCaptcha\n ) {\n setState({\n phase: \"verification\",\n intent,\n credentials: identifier\n ? { identifier, password: data.password }\n : undefined,\n });\n return;\n }\n await userCtrl.createUserFromIntent({\n body: { intentId: intent.intentId },\n });\n if (identifier && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: identifier,\n password: data.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in AuthLogin.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n // Turnstile tokens are single-use — force a fresh challenge so the\n // user can retry after a server-side failure.\n captchaRef.current?.reset();\n throw err;\n }\n },\n });\n\n const formState = useFormState(form, [\"error\", \"values\", \"loading\"]);\n const formError =\n formState.error && !(formState.error instanceof SchemaValidationError)\n ? formState.error.message\n : undefined;\n const passwordValue = String(formState.values?.password ?? \"\");\n\n const firstFieldId =\n (settings.firstNameLastName !== \"none\" && form.input.firstName?.props.id) ||\n (settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username?.props.id) ||\n (settings.email !== \"none\" && form.input.email?.props.id) ||\n (settings.phoneNumber !== \"none\" && form.input.phoneNumber?.props.id) ||\n form.input.password.props.id;\n\n useEffect(() => {\n if (state.phase !== \"form\" || !firstFieldId) return;\n const el = document.getElementById(\n String(firstFieldId),\n ) as HTMLInputElement | null;\n el?.focus();\n }, [state.phase, firstFieldId]);\n\n const handleVerify = async () => {\n if (!state.intent) return;\n setSubmitting(true);\n setVerifyError(null);\n try {\n await userCtrl.createUserFromIntent({\n body: {\n intentId: state.intent.intentId,\n emailCode: state.intent.expectEmailVerification\n ? emailCode\n : undefined,\n phoneCode: state.intent.expectPhoneVerification\n ? phoneCode\n : undefined,\n },\n });\n if (state.credentials && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: state.credentials.identifier,\n password: state.credentials.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in AuthLogin.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n setVerifyError(\n err instanceof Error\n ? err.message\n : tr(\"auth.register.verifyFailed\", {\n default: \"Verification failed\",\n }),\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n // Query appended to the \"already have an account? sign in\" link: the realm,\n // plus the post-auth redirect (`?redirect=`) so signing in returns the user\n // to wherever registering would have sent them (it's dropped otherwise).\n const realmBit = props.realmConfig.realmName\n ? `realm=${encodeURIComponent(props.realmConfig.realmName)}`\n : \"\";\n const redirectBit =\n typeof router.query.redirect === \"string\" && router.query.redirect\n ? `redirect=${encodeURIComponent(router.query.redirect)}`\n : \"\";\n const loginQ = [realmBit, redirectBit].filter(Boolean).join(\"&\");\n const realmQuery = loginQ ? `?${loginQ}` : \"\";\n\n const externalMethods = props.realmConfig.authenticationMethods.filter(\n (m) => m.type !== \"CREDENTIALS\",\n );\n const showDivider = credentialsProvider && externalMethods.length > 0;\n const isVerifying = state.phase === \"verification\" && state.intent;\n const canSubmitVerify =\n !isVerifying ||\n ((!state.intent!.expectEmailVerification || emailCode.length === 6) &&\n (!state.intent!.expectPhoneVerification || phoneCode.length === 6));\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number | undefined>(\n undefined,\n );\n useLayoutEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n setContentHeight(el.scrollHeight);\n const ro = new ResizeObserver(() => {\n setContentHeight(el.scrollHeight);\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n return (\n <AuthRegisterCentered>\n {props.logo ?? (\n <AuthRegisterRealmLogo\n settings={settings}\n realmName={props.realmConfig.realmName}\n />\n )}\n <Card className=\"w-full\">\n <CardContent\n className=\"overflow-hidden p-0 transition-[height] duration-300 ease-out\"\n style={\n contentHeight !== undefined ? { height: contentHeight } : undefined\n }\n >\n <div ref={contentRef}>\n <div\n key={state.phase}\n className=\"animate-in fade-in flex flex-col gap-4 px-6 duration-300\"\n >\n {isVerifying ? (\n <>\n <h2 className=\"text-center text-lg font-semibold\">\n {tr(\"auth.register.verifyTitle\", {\n default: \"Verify your account\",\n })}\n </h2>\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.verifyHint\", {\n default:\n \"Please enter the verification code(s) sent to you.\",\n })}\n </p>\n {verifyError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{verifyError}</AlertDescription>\n </Alert>\n )}\n {state.intent!.expectEmailVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"emailCode\">\n {tr(\"auth.register.emailCode\", {\n default: \"Email verification code\",\n })}\n </Label>\n <InputOTP\n id=\"emailCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={emailCode}\n onChange={setEmailCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n {state.intent!.expectPhoneVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"phoneCode\">\n {tr(\"auth.register.phoneCode\", {\n default: \"Phone verification code\",\n })}\n </Label>\n <InputOTP\n id=\"phoneCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={phoneCode}\n onChange={setPhoneCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n <Button\n onClick={handleVerify}\n loading={submitting}\n disabled={!canSubmitVerify}\n >\n {tr(\"auth.register.verifySubmit\", {\n default: \"Complete registration\",\n })}\n </Button>\n <Button\n variant=\"minimal\"\n onClick={() => setState({ phase: \"form\" })}\n >\n {tr(\"auth.register.verifyBack\", {\n default: \"Back to registration\",\n })}\n </Button>\n </>\n ) : (\n <AuthRegisterFormPhase\n allowed={allowed}\n form={form}\n formError={formError ?? queryError}\n loading={formState.loading}\n passwordValue={passwordValue}\n settings={settings}\n realmName={props.realmConfig.realmName}\n credentialsProvider={credentialsProvider}\n externalMethods={externalMethods}\n showDivider={showDivider}\n redirect={redirect}\n loginPath={props.loginPath}\n realmQuery={realmQuery}\n auth={auth}\n captchaSiteKey={captchaSiteKey}\n captchaToken={captchaToken}\n captchaRef={captchaRef}\n onCaptchaToken={setCaptchaToken}\n message={props.message}\n lockedEmail={props.lockedEmail}\n />\n )}\n </div>\n </div>\n </CardContent>\n </Card>\n {!isVerifying && (\n <Button\n variant=\"minimal\"\n nativeButton={false}\n render={<a href={props.cancelPath ?? \"/\"} />}\n >\n {tr(\"auth.register.cancel\", { default: \"Cancel\" })}\n </Button>\n )}\n </AuthRegisterCentered>\n );\n};\n\ntype Phase = \"form\" | \"verification\";\n\ninterface State {\n phase: Phase;\n intent?: RegistrationIntentResponse;\n credentials?: { identifier: string; password: string };\n}\n\n/**\n * The reference shape of the registration form, with every configurable field\n * optional.\n *\n * `AuthRegister` builds its real schema from the realm settings, so which\n * fields are optional changes per realm. This exists purely to give that\n * schema one stable TypeScript type: the handler reads `data.email`,\n * `data.username` and `data.phoneNumber` as possibly-absent regardless of what\n * a given realm requires, which is the correct type for code that has to\n * compile against all of them.\n */\nconst registerFormSchema = () =>\n z.object({\n firstName: z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: z.text({ trim: true, maxLength: 100 }).optional(),\n username: z.text({ trim: true }).optional(),\n email: z.email().optional(),\n phoneNumber: z.e164().optional(),\n password: z.string(),\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2GA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,MAAM,YAAY,OAAO,MAAM,QAAQ;CAIrE,MAAM,aACJ,OAAO,OAAO,MAAM,UAAU,WAAW,OAAO,MAAM,QAAQ,KAAA;CAEhE,MAAM,CAAC,OAAO,YAAY,SAAgB,EAAE,OAAO,OA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CAAA;UACf,oBAAC,mBAAD,CAAoB,CAAA;UACpB,qBAAC,eAAD,EAAA,UAAA;WACE,oBAAC,cAAD,EAAc,OAAO,EAAI,CAAA;WACzB,oBAAC,cAAD,EAAc,OAAO,EAAI,CAAA;WACzB,oBAAC,cAAD,EAAc,OAAO,EAAI,CAAA;UACZ,EAAA,CAAA;SACP;QACP,CAAA,CAAA;;OAEP,oBAAC,QAAD;QACE,SAAS;QACT,SAAS;QACT,UAAU,CAAC;QAEV,UAAA,GAAG,8BAA8B,EAChC,SAAS,wBACX,CAAC;OACK,CAAA;OACR,oBAAC,QAAD;QACE,SAAQ;QACR,eAAe,SAAS,EAAE,OAAO,OAAO,CAAC;QAExC,UAAA,GAAG,4BAA4B,EAC9B,SAAS,uBACX,CAAC;OACK,CAAA;MACR,EAAA,CAAA,IAEF,oBAAC,uBAAD;OACW;OACH;OACN,WAAW,aAAa;OACxB,SAAS,UAAU;OACJ;OACL;OACV,WAAW,MAAM,YAAY;OACR;OACJ;OACJ;OACH;OACV,WAAW,MAAM;OACL;OACN;OACU;OACF;OACF;OACZ,gBAAgB;OAChB,SAAS,MAAM;OACf,aAAa,MAAM;MACpB,CAAA;KAEA,GA1HE,MAAM,KA0HR;IACF,CAAA;GACM,CAAA;EACT,CAAA;EACL,CAAC,eACA,oBAAC,QAAD;GACE,SAAQ;GACR,cAAc;GACd,QAAQ,oBAAC,KAAD,EAAG,MAAM,MAAM,cAAc,IAAM,CAAA;GAE1C,UAAA,GAAG,wBAAwB,EAAE,SAAS,SAAS,CAAC;EAC3C,CAAA;CAEU,EAAA,CAAA;AAE1B"}
|
|
1
|
+
{"version":3,"file":"AuthRegister.js","names":[],"sources":["../../src/auth/AuthRegister.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { SchemaValidationError, z } from \"alepha\";\nimport type {\n RealmConfig,\n RegistrationIntentResponse,\n UserController,\n} from \"alepha/api/users\";\nimport { useClient } from \"alepha/react\";\nimport { useAuth } from \"alepha/react/auth\";\nimport { useForm, useFormState } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useRouter } from \"alepha/react/router\";\nimport { AlertCircle } from \"lucide-react\";\nimport {\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Alert, AlertDescription } from \"../core/Alert.tsx\";\nimport { Button } from \"../core/Button.tsx\";\nimport { Card, CardContent } from \"../core/Card.tsx\";\nimport { Label } from \"../core/Label.tsx\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n} from \"../otp/InputOTP.tsx\";\nimport { AuthRegisterCentered } from \"./AuthRegisterCentered.tsx\";\nimport { AuthRegisterFormPhase } from \"./AuthRegisterFormPhase.tsx\";\nimport { AuthRegisterRealmLogo } from \"./AuthRegisterRealmLogo.tsx\";\nimport { safeRedirect } from \"./safeRedirect.ts\";\nimport type { TurnstileWidgetHandle } from \"./TurnstileWidget.tsx\";\n\nexport interface AuthRegisterProps {\n /**\n * Realm configuration (drives required fields, verification step, OAuth buttons).\n */\n realmConfig: RealmConfig;\n /**\n * Custom logo node, rendered above the form. When provided, it replaces\n * the default `settings.logoUrl` <img>. Use this to inject a branded\n * component (e.g. with light/dark variants or an animation).\n */\n logo?: ReactNode;\n /**\n * Route to the login page. When set, a \"Sign in\" link is shown.\n */\n loginPath?: string;\n /**\n * Optional banner rendered above the registration form (form phase only).\n * Used to contextualize the flow when the user arrives via a CTA, e.g.\n * \"Before creating a campaign, create an account.\"\n */\n message?: ReactNode;\n /**\n * Where the \"Cancel\" button abandons to. Defaults to \"/\". This is\n * intentionally decoupled from the post-auth `?redirect=` target: cancelling\n * an unauthenticated registration must land somewhere public (home), not the\n * protected destination the user was *heading* to — which would only bounce\n * them back to this page.\n */\n cancelPath?: string;\n /**\n * Render the form even though `settings.registrationAllowed` is `false`.\n *\n * For a visitor the application has already vouched for out of band - an\n * invitation link, a signup code - who would otherwise meet the closed\n * alert and stop. Presentation only: the server decides, through the\n * realm's `isPreAuthorized` seam, and refuses this submit like any other if\n * {@link preAuthToken} does not hold up.\n */\n preAuthorized?: boolean;\n /**\n * Pre-fill the email field and stop it being edited.\n *\n * Set it alongside {@link preAuthToken}, which is bound to one address:\n * letting the field be typed over only produces a server-side refusal the\n * visitor cannot act on.\n */\n lockedEmail?: string;\n /**\n * The application's opaque proof that this address may register into a\n * closed realm. Passed through to the register request untouched.\n */\n preAuthToken?: string;\n /**\n * Where a successful registration lands, overriding `?redirect=`.\n *\n * A prop rather than a URL param because the submit handler is built ONCE,\n * at mount, and closes over whatever `redirect` was then: a page that\n * decides the destination and seeds the query afterwards has already\n * missed it, and the user lands on the default with nothing to explain\n * why. A prop is read on the render that builds the handler.\n *\n * Sanitised like the query value, since the two are the same kind of thing.\n */\n redirect?: string;\n}\n\nexport const AuthRegister = (props: AuthRegisterProps) => {\n const auth = useAuth();\n const userCtrl = useClient<UserController>();\n const router = useRouter();\n const { tr } = useI18n();\n const redirect = safeRedirect(props.redirect ?? router.query.redirect);\n // Surface upstream auth errors (e.g. failed OAuth callback redirects with\n // `?error=...`) — same pattern as AuthLogin. Without this the user lands on\n // a fresh-looking registration page with no clue why.\n const queryError =\n typeof router.query.error === \"string\" ? router.query.error : undefined;\n\n const [state, setState] = useState<State>({ phase: \"form\" });\n const [emailCode, setEmailCode] = useState(\"\");\n const [phoneCode, setPhoneCode] = useState(\"\");\n const [verifyError, setVerifyError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const captchaSiteKey = props.realmConfig.captchaSiteKey;\n const [captchaToken, setCaptchaToken] = useState<string | undefined>();\n const captchaRef = useRef<TurnstileWidgetHandle | null>(null);\n // The handler reads the token the widget issued last through a ref, so a\n // submit never posts a token captured by an earlier render.\n const captchaTokenRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n captchaTokenRef.current = captchaToken;\n }, [captchaToken]);\n\n const credentialsProvider = props.realmConfig.authenticationMethods.find(\n (it) => it.type === \"CREDENTIALS\",\n );\n const settings = props.realmConfig.settings;\n // The realm decides, unless the application has already vouched for this\n // particular visitor. Both halves are presentation: the gate is\n // `RegistrationService`, which refuses a submit that the seam does not\n // recognise however the form got rendered.\n const allowed =\n props.preAuthorized === true || settings.registrationAllowed !== false;\n\n const schema = useMemo(() => {\n // Optionality is decided as each field is built, because that is the only\n // thing the form reads: `FormModel` derives both the required marker and\n // the pre-submit check from `z.schema.requiredInputKeys(schema)`, which asks\n // whether the field is optional or defaulted.\n //\n // This used to declare every field optional and then push the configured\n // names onto the array returned by `z.schema.requiredInputKeys(s)` , a TypeBox\n // habit, where a JSON Schema's `required` was a live array hanging off the\n // schema. The zod implementation computes a fresh array from the shape, so\n // the pushes mutated a detached value and vanished: a realm with\n // `email: \"required\"` still rendered Email with no asterisk and let an\n // empty one through to the server.\n const names = settings.firstNameLastName === \"required\";\n const shape = {\n firstName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n username:\n settings.username === \"required\"\n ? z.text({ trim: true, pattern: settings.usernameRegExp })\n : z.text({ trim: true, pattern: settings.usernameRegExp }).optional(),\n email: settings.email === \"required\" ? z.email() : z.email().optional(),\n phoneNumber:\n settings.phoneNumber === \"required\" ? z.e164() : z.e164().optional(),\n password: z.string().min(settings.passwordPolicy?.minLength ?? 8),\n };\n\n // The runtime shape varies with the realm, but the *type* must not: every\n // consumer below reads `data.email`, `data.username` and the rest as\n // possibly-absent. Widening to the all-optional shape keeps one stable\n // type instead of a union of eight.\n return z.object(shape) as unknown as ReturnType<typeof registerFormSchema>;\n }, [settings]);\n\n const form = useForm({\n schema,\n // A locked address is the form's starting value, not a field the visitor\n // fills. It arrives before mount (the page resolves the token in its\n // loader), which is what lets `useForm` anchor it here.\n initialValues: props.lockedEmail ? { email: props.lockedEmail } : undefined,\n // Handled here: every error this form throws is rendered by the page itself,\n // under its field or in the alert above the form. Without an `onError`,\n // a mounted `ActionErrorToaster` toasted the same sentence a second time.\n onError: () => {},\n handler: async (data) => {\n try {\n const intent = await userCtrl.createRegistrationIntent({\n query: { userRealmName: props.realmConfig.realmName },\n body: {\n firstName: data.firstName,\n lastName: data.lastName,\n username: data.username,\n // The locked address wins over whatever the field holds: it is\n // the one the token is bound to, and a disabled input is a\n // presentation fact rather than a guarantee.\n email: props.lockedEmail ?? data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n preAuthToken: props.preAuthToken,\n },\n });\n const identifier =\n data.username ?? props.lockedEmail ?? data.email ?? data.phoneNumber;\n if (\n intent.expectEmailVerification ||\n intent.expectPhoneVerification ||\n intent.expectCaptcha\n ) {\n setState({\n phase: \"verification\",\n intent,\n credentials: identifier\n ? { identifier, password: data.password }\n : undefined,\n });\n return;\n }\n await userCtrl.createUserFromIntent({\n body: { intentId: intent.intentId },\n });\n if (identifier && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: identifier,\n password: data.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in AuthLogin.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n // Turnstile tokens are single-use — force a fresh challenge so the\n // user can retry after a server-side failure.\n captchaRef.current?.reset();\n throw err;\n }\n },\n });\n\n const formState = useFormState(form, [\"error\", \"values\", \"loading\"]);\n const formError =\n formState.error && !(formState.error instanceof SchemaValidationError)\n ? formState.error.message\n : undefined;\n const passwordValue = String(formState.values?.password ?? \"\");\n\n const firstFieldId =\n (settings.firstNameLastName !== \"none\" && form.input.firstName?.props.id) ||\n (settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username?.props.id) ||\n (settings.email !== \"none\" && form.input.email?.props.id) ||\n (settings.phoneNumber !== \"none\" && form.input.phoneNumber?.props.id) ||\n form.input.password.props.id;\n\n useEffect(() => {\n if (state.phase !== \"form\" || !firstFieldId) return;\n const el = document.getElementById(\n String(firstFieldId),\n ) as HTMLInputElement | null;\n el?.focus();\n }, [state.phase, firstFieldId]);\n\n const handleVerify = async () => {\n if (!state.intent) return;\n setSubmitting(true);\n setVerifyError(null);\n try {\n await userCtrl.createUserFromIntent({\n body: {\n intentId: state.intent.intentId,\n emailCode: state.intent.expectEmailVerification\n ? emailCode\n : undefined,\n phoneCode: state.intent.expectPhoneVerification\n ? phoneCode\n : undefined,\n },\n });\n if (state.credentials && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: state.credentials.identifier,\n password: state.credentials.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in AuthLogin.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n setVerifyError(\n err instanceof Error\n ? err.message\n : tr(\"auth.register.verifyFailed\", {\n default: \"Verification failed\",\n }),\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n // Query appended to the \"already have an account? sign in\" link: the realm,\n // plus the post-auth redirect (`?redirect=`) so signing in returns the user\n // to wherever registering would have sent them (it's dropped otherwise).\n const realmBit = props.realmConfig.realmName\n ? `realm=${encodeURIComponent(props.realmConfig.realmName)}`\n : \"\";\n const redirectBit =\n typeof router.query.redirect === \"string\" && router.query.redirect\n ? `redirect=${encodeURIComponent(router.query.redirect)}`\n : \"\";\n const loginQ = [realmBit, redirectBit].filter(Boolean).join(\"&\");\n const realmQuery = loginQ ? `?${loginQ}` : \"\";\n\n const externalMethods = props.realmConfig.authenticationMethods.filter(\n (m) => m.type !== \"CREDENTIALS\",\n );\n const showDivider = credentialsProvider && externalMethods.length > 0;\n const isVerifying = state.phase === \"verification\" && state.intent;\n const canSubmitVerify =\n !isVerifying ||\n ((!state.intent!.expectEmailVerification || emailCode.length === 6) &&\n (!state.intent!.expectPhoneVerification || phoneCode.length === 6));\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number | undefined>(\n undefined,\n );\n useLayoutEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n setContentHeight(el.scrollHeight);\n const ro = new ResizeObserver(() => {\n setContentHeight(el.scrollHeight);\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n return (\n <AuthRegisterCentered>\n {props.logo ?? (\n <AuthRegisterRealmLogo\n settings={settings}\n realmName={props.realmConfig.realmName}\n />\n )}\n <Card className=\"w-full\">\n <CardContent\n className=\"overflow-hidden p-0 transition-[height] duration-300 ease-out\"\n style={\n contentHeight !== undefined ? { height: contentHeight } : undefined\n }\n >\n <div ref={contentRef}>\n <div\n key={state.phase}\n className=\"animate-in fade-in flex flex-col gap-4 px-6 duration-300\"\n >\n {isVerifying ? (\n <>\n <h2 className=\"text-center text-lg font-semibold\">\n {tr(\"auth.register.verifyTitle\", {\n default: \"Verify your account\",\n })}\n </h2>\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.verifyHint\", {\n default:\n \"Please enter the verification code(s) sent to you.\",\n })}\n </p>\n {verifyError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{verifyError}</AlertDescription>\n </Alert>\n )}\n {state.intent!.expectEmailVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"emailCode\">\n {tr(\"auth.register.emailCode\", {\n default: \"Email verification code\",\n })}\n </Label>\n <InputOTP\n id=\"emailCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={emailCode}\n onChange={setEmailCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n {state.intent!.expectPhoneVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"phoneCode\">\n {tr(\"auth.register.phoneCode\", {\n default: \"Phone verification code\",\n })}\n </Label>\n <InputOTP\n id=\"phoneCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={phoneCode}\n onChange={setPhoneCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n <Button\n onClick={handleVerify}\n loading={submitting}\n disabled={!canSubmitVerify}\n >\n {tr(\"auth.register.verifySubmit\", {\n default: \"Complete registration\",\n })}\n </Button>\n <Button\n variant=\"minimal\"\n onClick={() => setState({ phase: \"form\" })}\n >\n {tr(\"auth.register.verifyBack\", {\n default: \"Back to registration\",\n })}\n </Button>\n </>\n ) : (\n <AuthRegisterFormPhase\n allowed={allowed}\n form={form}\n formError={formError ?? queryError}\n loading={formState.loading}\n passwordValue={passwordValue}\n settings={settings}\n realmName={props.realmConfig.realmName}\n credentialsProvider={credentialsProvider}\n externalMethods={externalMethods}\n showDivider={showDivider}\n redirect={redirect}\n loginPath={props.loginPath}\n realmQuery={realmQuery}\n auth={auth}\n captchaSiteKey={captchaSiteKey}\n captchaToken={captchaToken}\n captchaRef={captchaRef}\n onCaptchaToken={setCaptchaToken}\n message={props.message}\n lockedEmail={props.lockedEmail}\n />\n )}\n </div>\n </div>\n </CardContent>\n </Card>\n {!isVerifying && (\n <Button\n variant=\"minimal\"\n nativeButton={false}\n render={<a href={props.cancelPath ?? \"/\"} />}\n >\n {tr(\"auth.register.cancel\", { default: \"Cancel\" })}\n </Button>\n )}\n </AuthRegisterCentered>\n );\n};\n\ntype Phase = \"form\" | \"verification\";\n\ninterface State {\n phase: Phase;\n intent?: RegistrationIntentResponse;\n credentials?: { identifier: string; password: string };\n}\n\n/**\n * The reference shape of the registration form, with every configurable field\n * optional.\n *\n * `AuthRegister` builds its real schema from the realm settings, so which\n * fields are optional changes per realm. This exists purely to give that\n * schema one stable TypeScript type: the handler reads `data.email`,\n * `data.username` and `data.phoneNumber` as possibly-absent regardless of what\n * a given realm requires, which is the correct type for code that has to\n * compile against all of them.\n */\nconst registerFormSchema = () =>\n z.object({\n firstName: z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: z.text({ trim: true, maxLength: 100 }).optional(),\n username: z.text({ trim: true }).optional(),\n email: z.email().optional(),\n phoneNumber: z.e164().optional(),\n password: z.string(),\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2GA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,MAAM,YAAY,OAAO,MAAM,QAAQ;CAIrE,MAAM,aACJ,OAAO,OAAO,MAAM,UAAU,WAAW,OAAO,MAAM,QAAQ,KAAA;CAEhE,MAAM,CAAC,OAAO,YAAY,SAAgB,EAAE,OAAO,OAAO,CAAC;CAC3D,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAClE,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAElD,MAAM,iBAAiB,MAAM,YAAY;CACzC,MAAM,CAAC,cAAc,mBAAmB,SAA6B;CACrE,MAAM,aAAa,OAAqC,IAAI;CAG5D,MAAM,kBAAkB,OAA2B,KAAA,CAAS;CAC5D,gBAAgB;EACd,gBAAgB,UAAU;CAC5B,GAAG,CAAC,YAAY,CAAC;CAEjB,MAAM,sBAAsB,MAAM,YAAY,sBAAsB,MACjE,OAAO,GAAG,SAAS,aACtB;CACA,MAAM,WAAW,MAAM,YAAY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AAA,IAEF,oBAAC,uBAAD;OACW;OACH;OACN,WAAW,aAAa;OACxB,SAAS,UAAU;OACJ;OACL;OACV,WAAW,MAAM,YAAY;OACR;OACJ;OACJ;OACH;OACV,WAAW,MAAM;OACL;OACN;OACU;OACF;OACF;OACZ,gBAAgB;OAChB,SAAS,MAAM;OACf,aAAa,MAAM;MACpB,CAAA;KAEA,GA1HE,MAAM,KA0HR;IACF,CAAA;GACM,CAAA;EACT,CAAA;EACL,CAAC,eACA,oBAAC,QAAD;GACE,SAAQ;GACR,cAAc;GACd,QAAQ,oBAAC,KAAD,EAAG,MAAM,MAAM,cAAc,IAAM,CAAA;GAE1C,UAAA,GAAG,wBAAwB,EAAE,SAAS,SAAS,CAAC;EAC3C,CAAA;CAEU,EAAA,CAAA;AAE1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/auth/AuthRegisterCentered.tsx
|
|
4
4
|
const AuthRegisterCentered = (props) => {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
6
|
className: "flex min-h-svh flex-1 items-center justify-center p-6",
|
|
@@ -10,7 +10,6 @@ const AuthRegisterCentered = (props) => {
|
|
|
10
10
|
})
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { AuthRegisterCentered };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=AuthRegisterCentered.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Button } from "../core/Button.js";
|
|
2
|
-
import { iconFor } from "../form/iconHint.js";
|
|
3
|
-
import { Control } from "../form/Control.js";
|
|
4
|
-
import { Separator } from "../core/Separator.js";
|
|
5
1
|
import { Alert, AlertDescription } from "../core/Alert.js";
|
|
6
2
|
import { BrandIcon } from "../core/BrandIcon.js";
|
|
3
|
+
import { Button } from "../core/Button.js";
|
|
4
|
+
import { Separator } from "../core/Separator.js";
|
|
5
|
+
import { Control } from "../form/Control.js";
|
|
6
|
+
import { iconFor } from "../form/iconHint.js";
|
|
7
7
|
import { AuthRegisterPasswordRules } from "./AuthRegisterPasswordRules.js";
|
|
8
8
|
import { AuthRegisterRealmHeader } from "./AuthRegisterRealmHeader.js";
|
|
9
9
|
import { TurnstileWidget } from "./TurnstileWidget.js";
|
|
@@ -11,7 +11,7 @@ import { useI18n } from "alepha/react/i18n";
|
|
|
11
11
|
import { AlertCircle, Info } from "lucide-react";
|
|
12
12
|
import { useState } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
14
|
+
// src/auth/AuthRegisterFormPhase.tsx
|
|
15
15
|
const AuthRegisterFormPhase = (props) => {
|
|
16
16
|
const { tr } = useI18n();
|
|
17
17
|
const [passwordFieldFocused, setPasswordFieldFocused] = useState(false);
|
|
@@ -130,7 +130,6 @@ const AuthRegisterFormPhase = (props) => {
|
|
|
130
130
|
})
|
|
131
131
|
] })] });
|
|
132
132
|
};
|
|
133
|
-
//#endregion
|
|
134
133
|
export { AuthRegisterFormPhase };
|
|
135
134
|
|
|
136
135
|
//# sourceMappingURL=AuthRegisterFormPhase.js.map
|
|
@@ -2,7 +2,7 @@ import { useI18n } from "alepha/react/i18n";
|
|
|
2
2
|
import { Check, X } from "lucide-react";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/auth/AuthRegisterPasswordRules.tsx
|
|
6
6
|
const AuthRegisterPasswordRules = (props) => {
|
|
7
7
|
const { tr } = useI18n();
|
|
8
8
|
const policy = props.policy;
|
|
@@ -40,7 +40,6 @@ const AuthRegisterPasswordRules = (props) => {
|
|
|
40
40
|
}, idx))
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { AuthRegisterPasswordRules };
|
|
45
44
|
|
|
46
45
|
//# sourceMappingURL=AuthRegisterPasswordRules.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/auth/AuthRegisterRealmHeader.tsx
|
|
4
4
|
const AuthRegisterRealmHeader = (props) => {
|
|
5
5
|
const s = props.settings;
|
|
6
6
|
if (!s.displayName && !s.description) return null;
|
|
@@ -15,7 +15,6 @@ const AuthRegisterRealmHeader = (props) => {
|
|
|
15
15
|
})]
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { AuthRegisterRealmHeader };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=AuthRegisterRealmHeader.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/auth/AuthRegisterRealmLogo.tsx
|
|
4
4
|
const AuthRegisterRealmLogo = (props) => {
|
|
5
5
|
if (!props.settings.logoUrl) return null;
|
|
6
6
|
return /* @__PURE__ */ jsx("img", {
|
|
@@ -9,7 +9,6 @@ const AuthRegisterRealmLogo = (props) => {
|
|
|
9
9
|
className: "bg-muted size-16 rounded-xl border object-cover shadow-sm"
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { AuthRegisterRealmLogo };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=AuthRegisterRealmLogo.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { Alert, AlertDescription } from "../core/Alert.js";
|
|
1
2
|
import { Button } from "../core/Button.js";
|
|
3
|
+
import { Card, CardContent } from "../core/Card.js";
|
|
2
4
|
import { Label } from "../core/Label.js";
|
|
3
|
-
import { iconFor } from "../form/iconHint.js";
|
|
4
5
|
import { Control } from "../form/Control.js";
|
|
5
|
-
import {
|
|
6
|
+
import { iconFor } from "../form/iconHint.js";
|
|
6
7
|
import { InputOTP, InputOTPGroup, InputOTPSlot } from "../otp/InputOTP.js";
|
|
7
|
-
import { Card, CardContent } from "../core/Card.js";
|
|
8
8
|
import { safeRedirect } from "./safeRedirect.js";
|
|
9
9
|
import { TurnstileWidget } from "./TurnstileWidget.js";
|
|
10
10
|
import { AlephaError, SchemaValidationError, z } from "alepha";
|
|
@@ -16,7 +16,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
import { useClient } from "alepha/react";
|
|
17
17
|
import { useForm, useFormState } from "alepha/react/form";
|
|
18
18
|
import { resetPasswordRequestSchema } from "alepha/api/users";
|
|
19
|
-
|
|
19
|
+
// src/auth/AuthResetPassword.tsx
|
|
20
20
|
const AuthResetPassword = (props) => {
|
|
21
21
|
const router = useRouter();
|
|
22
22
|
const { tr } = useI18n();
|
|
@@ -282,7 +282,6 @@ const AuthResetPassword = (props) => {
|
|
|
282
282
|
})
|
|
283
283
|
});
|
|
284
284
|
};
|
|
285
|
-
//#endregion
|
|
286
285
|
export { AuthResetPassword };
|
|
287
286
|
|
|
288
287
|
//# sourceMappingURL=AuthResetPassword.js.map
|
package/dist/auth/AuthRouter.js
CHANGED
|
@@ -5,7 +5,7 @@ import { AuthVerifyEmail } from "./AuthVerifyEmail.js";
|
|
|
5
5
|
import { $page } from "alepha/react/router";
|
|
6
6
|
import { $client } from "alepha/server/links";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/auth/AuthRouter.tsx
|
|
9
9
|
/**
|
|
10
10
|
* The four authentication screens, mounted and wired — a router you can use
|
|
11
11
|
* as-is.
|
|
@@ -111,7 +111,6 @@ var AuthRouter = class {
|
|
|
111
111
|
component: () => /* @__PURE__ */ jsx(AuthVerifyEmail, { loginPath: "/auth/login" })
|
|
112
112
|
});
|
|
113
113
|
};
|
|
114
|
-
//#endregion
|
|
115
114
|
export { AuthRouter };
|
|
116
115
|
|
|
117
116
|
//# sourceMappingURL=AuthRouter.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AuthVerifyEmailView } from "./AuthVerifyEmailView.js";
|
|
2
1
|
import { AuthVerifyEmailStateful } from "./AuthVerifyEmailStateful.js";
|
|
2
|
+
import { AuthVerifyEmailView } from "./AuthVerifyEmailView.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/auth/AuthVerifyEmail.tsx
|
|
6
6
|
const AuthVerifyEmail = (props) => {
|
|
7
7
|
if (props.step) return /* @__PURE__ */ jsx(AuthVerifyEmailView, {
|
|
8
8
|
step: props.step,
|
|
@@ -14,7 +14,6 @@ const AuthVerifyEmail = (props) => {
|
|
|
14
14
|
logo: props.logo
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { AuthVerifyEmail };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=AuthVerifyEmail.js.map
|
|
@@ -4,7 +4,7 @@ import { useI18n } from "alepha/react/i18n";
|
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useClient } from "alepha/react";
|
|
7
|
-
|
|
7
|
+
// src/auth/AuthVerifyEmailStateful.tsx
|
|
8
8
|
const AuthVerifyEmailStateful = (props) => {
|
|
9
9
|
const state = useRouterState();
|
|
10
10
|
const { tr } = useI18n();
|
|
@@ -45,7 +45,6 @@ const AuthVerifyEmailStateful = (props) => {
|
|
|
45
45
|
logo: props.logo
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
//#endregion
|
|
49
48
|
export { AuthVerifyEmailStateful };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=AuthVerifyEmailStateful.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Button } from "../core/Button.js";
|
|
2
1
|
import { Alert, AlertDescription } from "../core/Alert.js";
|
|
2
|
+
import { Button } from "../core/Button.js";
|
|
3
3
|
import { Card, CardContent } from "../core/Card.js";
|
|
4
4
|
import { useI18n } from "alepha/react/i18n";
|
|
5
5
|
import { AlertCircle, CheckCircle2, Loader2, MailCheck } from "lucide-react";
|
|
6
6
|
import "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/auth/AuthVerifyEmailView.tsx
|
|
9
9
|
const AuthVerifyEmailView = (props) => {
|
|
10
10
|
const { tr } = useI18n();
|
|
11
11
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -65,7 +65,6 @@ const AuthVerifyEmailView = (props) => {
|
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
//#endregion
|
|
69
68
|
export { AuthVerifyEmailView };
|
|
70
69
|
|
|
71
70
|
//# sourceMappingURL=AuthVerifyEmailView.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlephaError } from "alepha";
|
|
2
2
|
import { useEffect, useImperativeHandle, useRef } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/auth/TurnstileWidget.tsx
|
|
5
5
|
/**
|
|
6
6
|
* Cloudflare Turnstile loader — idempotent across remounts.
|
|
7
7
|
* Resolves once the global `window.turnstile` is ready.
|
|
@@ -92,7 +92,6 @@ const TurnstileWidget = (props) => {
|
|
|
92
92
|
className: props.className
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
-
//#endregion
|
|
96
95
|
export { TurnstileWidget };
|
|
97
96
|
|
|
98
97
|
//# sourceMappingURL=TurnstileWidget.js.map
|
package/dist/auth/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AuthMfaStep } from "./AuthMfaStep.js";
|
|
2
1
|
import { AuthLogin } from "./AuthLogin.js";
|
|
3
|
-
import {
|
|
2
|
+
import { AuthMfaStep } from "./AuthMfaStep.js";
|
|
4
3
|
import { AuthRegister } from "./AuthRegister.js";
|
|
5
4
|
import { AuthResetPassword } from "./AuthResetPassword.js";
|
|
6
|
-
import { AuthVerifyEmail } from "./AuthVerifyEmail.js";
|
|
7
5
|
import { AuthRouter } from "./AuthRouter.js";
|
|
6
|
+
import { AuthVerifyEmail } from "./AuthVerifyEmail.js";
|
|
7
|
+
import { TurnstileWidget } from "./TurnstileWidget.js";
|
|
8
8
|
export { AuthLogin, AuthMfaStep, AuthRegister, AuthResetPassword, AuthRouter, AuthVerifyEmail, TurnstileWidget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/auth/providerLabels.ts
|
|
2
2
|
/**
|
|
3
3
|
* Display names for identity providers.
|
|
4
4
|
*
|
|
@@ -15,7 +15,6 @@ const PROVIDER_LABELS = {
|
|
|
15
15
|
microsoft: "Microsoft",
|
|
16
16
|
facebook: "Facebook"
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { PROVIDER_LABELS };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=providerLabels.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/auth/safeRedirect.ts
|
|
2
2
|
/**
|
|
3
3
|
* Filter a `?redirect=` query value to a safe in-app destination:
|
|
4
4
|
* - only a same-origin absolute path (a single leading `/`);
|
|
@@ -24,7 +24,6 @@ const safeRedirect = (raw) => {
|
|
|
24
24
|
if (raw.startsWith("/auth/")) return "/";
|
|
25
25
|
return raw;
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { safeRedirect };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=safeRedirect.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cn } from "../core/utils.js";
|
|
2
1
|
import { Button, buttonVariants } from "../core/Button.js";
|
|
2
|
+
import { cn } from "../core/utils.js";
|
|
3
3
|
import { useI18n } from "alepha/react/i18n";
|
|
4
4
|
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { enUS, es, fr } from "date-fns/locale";
|
|
8
8
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
9
|
-
|
|
9
|
+
// src/calendar/Calendar.tsx
|
|
10
10
|
const LOCALE_BY_LANG = {
|
|
11
11
|
fr,
|
|
12
12
|
es,
|
|
@@ -115,7 +115,6 @@ const CalendarDayButton = (props) => {
|
|
|
115
115
|
...rest
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
//#endregion
|
|
119
118
|
export { Calendar, CalendarDayButton };
|
|
120
119
|
|
|
121
120
|
//# sourceMappingURL=Calendar.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Suspense, lazy } from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/calendar/LazyCalendar.tsx
|
|
4
4
|
/**
|
|
5
5
|
* The one `import()` of the calendar chunk, shared by the preload and the
|
|
6
6
|
* lazy component so the chunk is requested once whichever asks first.
|
|
@@ -68,7 +68,6 @@ const LazyCalendar = (props) => {
|
|
|
68
68
|
children: /* @__PURE__ */ jsx(CalendarChunk, { ...props })
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
//#endregion
|
|
72
71
|
export { LazyCalendar, preloadCalendar };
|
|
73
72
|
|
|
74
73
|
//# sourceMappingURL=LazyCalendar.js.map
|
package/dist/calendar/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Calendar, CalendarDayButton };
|
|
1
|
+
export { Calendar, CalendarDayButton } from "./Calendar.js";
|
package/dist/chart/Chart.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "../core/utils.js";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import * as RechartsPrimitive from "recharts";
|
|
5
|
-
|
|
5
|
+
// src/chart/Chart.tsx
|
|
6
6
|
const THEMES = {
|
|
7
7
|
light: "",
|
|
8
8
|
dark: ".dark"
|
|
@@ -153,7 +153,6 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
153
153
|
else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
|
|
154
154
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
155
155
|
}
|
|
156
|
-
//#endregion
|
|
157
156
|
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
158
157
|
|
|
159
158
|
//# sourceMappingURL=Chart.js.map
|
package/dist/chart/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
1
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./Chart.js";
|
package/dist/command/Command.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cn } from "../core/utils.js";
|
|
2
1
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../core/Dialog.js";
|
|
3
2
|
import { InputGroup, InputGroupAddon } from "../core/InputGroup.js";
|
|
3
|
+
import { cn } from "../core/utils.js";
|
|
4
4
|
import { defaultCommandFilter, defaultCommandItemToString, rankCommandItems } from "./rankCommandItems.js";
|
|
5
5
|
import { CheckIcon, SearchIcon } from "lucide-react";
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
9
|
-
|
|
9
|
+
// src/command/Command.tsx
|
|
10
10
|
/**
|
|
11
11
|
* The palette itself: a search input over a list that stays on screen, on
|
|
12
12
|
* Base UI's `Autocomplete` rendered `inline`.
|
|
@@ -144,7 +144,6 @@ const CommandShortcut = (props) => {
|
|
|
144
144
|
...spanProps
|
|
145
145
|
});
|
|
146
146
|
};
|
|
147
|
-
//#endregion
|
|
148
147
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
149
148
|
|
|
150
149
|
//# sourceMappingURL=Command.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/command/commandScore.ts
|
|
2
2
|
const SCORE_CONTINUE_MATCH = 1;
|
|
3
3
|
const SCORE_SPACE_WORD_JUMP = .9;
|
|
4
4
|
const SCORE_NON_SPACE_WORD_JUMP = .8;
|
|
@@ -71,7 +71,6 @@ const commandScore = (string, abbreviation, aliases) => {
|
|
|
71
71
|
const text = aliases && aliases.length > 0 ? `${string} ${aliases.join(" ")}` : string;
|
|
72
72
|
return commandScoreInner(text, abbreviation, formatInput(text), formatInput(abbreviation), 0, 0, {});
|
|
73
73
|
};
|
|
74
|
-
//#endregion
|
|
75
74
|
export { commandScore };
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=commandScore.js.map
|
package/dist/command/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { commandScore } from "./commandScore.js";
|
|
2
1
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./Command.js";
|
|
2
|
+
import { commandScore } from "./commandScore.js";
|
|
3
3
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, commandScore };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { commandScore } from "./commandScore.js";
|
|
2
|
-
|
|
2
|
+
// src/command/rankCommandItems.ts
|
|
3
3
|
/**
|
|
4
4
|
* The text an item is searched by when the root is given no `itemToStringValue`:
|
|
5
5
|
* a string or number item itself, or an object's `label` when it is a string.
|
|
@@ -50,7 +50,6 @@ const rankCommandItems = (items, query, filter, itemToString) => {
|
|
|
50
50
|
};
|
|
51
51
|
}).filter((entry) => entry.group.items.length > 0).sort((a, b) => b.best - a.best || a.index - b.index).map((entry) => entry.group);
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
export { defaultCommandFilter, defaultCommandItemToString, isCommandItemGroups, rankCommandItems };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=rankCommandItems.js.map
|
package/dist/core/Alert.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "./utils.js";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
|
|
5
|
+
// src/core/Alert.tsx
|
|
6
6
|
const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
7
7
|
variants: { variant: {
|
|
8
8
|
default: "bg-card text-card-foreground",
|
|
@@ -43,7 +43,6 @@ const AlertAction = (props) => {
|
|
|
43
43
|
...rest
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=Alert.js.map
|
package/dist/core/AlertDialog.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cn } from "./utils.js";
|
|
2
1
|
import { Button } from "./Button.js";
|
|
2
|
+
import { cn } from "./utils.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
6
|
-
|
|
6
|
+
// src/core/AlertDialog.tsx
|
|
7
7
|
const AlertDialog = (props) => {
|
|
8
8
|
return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
|
|
9
9
|
"data-slot": "alert-dialog",
|
|
@@ -99,7 +99,6 @@ const AlertDialogCancel = (props) => {
|
|
|
99
99
|
...rest
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
//#endregion
|
|
103
102
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
104
103
|
|
|
105
104
|
//# sourceMappingURL=AlertDialog.js.map
|
package/dist/core/Avatar.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "./utils.js";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
|
-
|
|
5
|
+
// src/core/Avatar.tsx
|
|
6
6
|
const Avatar = (props) => {
|
|
7
7
|
const { className, size = "default", ...rest } = props;
|
|
8
8
|
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
@@ -52,7 +52,6 @@ const AvatarGroupCount = (props) => {
|
|
|
52
52
|
...rest
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
55
|
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=Avatar.js.map
|
package/dist/core/Badge.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cn } from "./utils.js";
|
|
|
2
2
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
|
|
5
|
+
// src/core/Badge.tsx
|
|
6
6
|
const badgeVariants = cva("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
@@ -95,7 +95,6 @@ const Badge = (props) => {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
//#endregion
|
|
99
98
|
export { Badge, badgeVariants };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=Badge.js.map
|
package/dist/core/BrandIcon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "./utils.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/core/BrandIcon.tsx
|
|
5
5
|
/**
|
|
6
6
|
* Theme-friendly auth-provider logo. GitHub and Apple are monochrome marks
|
|
7
7
|
* drawn with `fill="currentColor"`, so they inherit the surrounding text
|
|
@@ -78,7 +78,6 @@ const BrandIcon = (props) => {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { BrandIcon };
|
|
83
82
|
|
|
84
83
|
//# sourceMappingURL=BrandIcon.js.map
|