@danxbot/ui 26.1.1 → 26.2.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.
@@ -1,5 +1,6 @@
1
+ import { type ProviderContinuation, type VerifiedIdentity } from "./SignInProviders";
1
2
  import { type TermsAcceptanceProps } from "./TermsAcceptance";
2
- export interface AcceptInvitationCardProps {
3
+ export type AcceptInvitationCardProps = {
3
4
  teamName: string;
4
5
  teamLogoUrl?: string;
5
6
  inviterName: string;
@@ -20,15 +21,20 @@ export interface AcceptInvitationCardProps {
20
21
  termsHref: string;
21
22
  /** Runs on that link's click; see `TermsAcceptance`. */
22
23
  onOpenTerms?: TermsAcceptanceProps["onOpenTerms"];
24
+ /** `password` is `null` exactly when `verifiedIdentity` is set. */
23
25
  onCreateAccount: (input: {
24
26
  name: string;
25
27
  username: string;
26
- password: string;
28
+ password: string | null;
27
29
  acceptedTerms: true;
28
30
  }) => void;
31
+ /** Set once a provider has verified the person; replaces the password field. */
32
+ verifiedIdentity?: VerifiedIdentity | null;
29
33
  onJoinAsSignedInUser?: () => void;
30
34
  /** Offered when `accountExists` is true but the viewer isn't signed in as that email. */
31
35
  onSignInInstead?: () => void;
32
36
  className?: string;
33
- }
34
- export declare function AcceptInvitationCard({ teamName, teamLogoUrl, inviterName, roleLabel, email, accountExists, signedInAsMatchingUser, loading, error, termsHref, onOpenTerms, onCreateAccount, onJoinAsSignedInUser, onSignInInstead, className, }: AcceptInvitationCardProps): import("react").JSX.Element;
37
+ } & ProviderContinuation<{
38
+ acceptedTerms: true;
39
+ }>;
40
+ export declare function AcceptInvitationCard({ teamName, teamLogoUrl, inviterName, roleLabel, email, accountExists, signedInAsMatchingUser, loading, error, termsHref, onOpenTerms, onCreateAccount, onJoinAsSignedInUser, onSignInInstead, verifiedIdentity, providers, onContinueWithProvider, pendingProvider, className, }: AcceptInvitationCardProps): import("react").JSX.Element;
@@ -4,6 +4,8 @@ export interface LoginFormProps {
4
4
  /** Rendered beside the password field's label — typically a "Forgot password?" link. */
5
5
  forgotPasswordLink?: ReactNode;
6
6
  submitLabel?: string;
7
+ /** DX-5095 — other ways in (typically `SignInProviders`), rendered below the form under an "or" divider. */
8
+ alternatives?: ReactNode;
7
9
  className?: string;
8
10
  }
9
- export declare function LoginForm({ onSubmit, forgotPasswordLink, submitLabel, className, }: LoginFormProps): import("react").JSX.Element;
11
+ export declare function LoginForm({ onSubmit, forgotPasswordLink, submitLabel, alternatives, className, }: LoginFormProps): import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ export type SignInProviderId = "google" | "github";
2
+ export interface SignInProvider {
3
+ id: SignInProviderId;
4
+ /** The provider's name as the button shows it ("Google"). */
5
+ label: string;
6
+ }
7
+ export interface SignInProvidersProps {
8
+ providers: readonly SignInProvider[];
9
+ onSelect: (id: SignInProviderId) => void;
10
+ /** The provider whose sign-in has started; disables the whole row. */
11
+ pending?: SignInProviderId | null;
12
+ /** Blocks the row without a pending provider. */
13
+ disabled?: boolean;
14
+ className?: string;
15
+ }
16
+ export declare function SignInProviders({ providers, onSelect, pending, disabled, className }: SignInProvidersProps): import("react").JSX.Element | null;
17
+ /** A verified identity from a provider: the account is created from it, so no password exists to ask for. */
18
+ export interface VerifiedIdentity {
19
+ provider: SignInProviderId;
20
+ handle: string;
21
+ email: string;
22
+ }
23
+ /**
24
+ * The provider buttons of a card that creates an account: all three props or none. `Ctx` is what the card has
25
+ * collected that the provider round trip must carry.
26
+ */
27
+ export type ProviderContinuation<Ctx> = {
28
+ providers?: undefined;
29
+ onContinueWithProvider?: undefined;
30
+ pendingProvider?: undefined;
31
+ } | {
32
+ providers: readonly SignInProvider[];
33
+ onContinueWithProvider: (id: SignInProviderId, context: Ctx) => void;
34
+ /** The provider whose round trip has started; disables the row. */
35
+ pendingProvider?: SignInProviderId | null;
36
+ };
37
+ /** The "or" rule between a form and its provider buttons. */
38
+ export declare function OrDivider({ className }: {
39
+ className?: string;
40
+ }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type PasswordRequirementRule } from "../PasswordRequirements";
2
+ import { type ProviderContinuation, type VerifiedIdentity } from "./SignInProviders";
2
3
  import { type TermsAcceptanceProps } from "./TermsAcceptance";
3
- export interface SignupCardProps {
4
+ export type SignupCardProps = {
4
5
  /** A code already known (the sign-up link's). Checked on mount, then shown read-only while it is good. */
5
6
  initialCode?: string;
6
7
  /**
@@ -22,14 +23,21 @@ export interface SignupCardProps {
22
23
  username: string;
23
24
  email: string;
24
25
  teamName: string;
25
- password: string;
26
+ /** `null` exactly when `verifiedIdentity` is set. */
27
+ password: string | null;
26
28
  acceptedTerms: true;
27
29
  }) => void;
30
+ /** Set once a provider has verified the person; replaces the password field and fills the email. */
31
+ verifiedIdentity?: VerifiedIdentity | null;
28
32
  loading?: boolean;
29
33
  /** A server-side error surfaced after a failed submit (username taken, rate limited, ...). */
30
34
  error?: string;
31
35
  /** Offered beneath the card for a visitor who already has an account. */
32
36
  onSignInInstead?: () => void;
33
37
  className?: string;
34
- }
35
- export declare function SignupCard({ initialCode, onValidateCode, passwordRules, termsHref, onOpenTerms, onSignup, loading, error, onSignInInstead, className, }: SignupCardProps): import("react").JSX.Element;
38
+ } & ProviderContinuation<{
39
+ code: string;
40
+ teamName: string;
41
+ acceptedTerms: true;
42
+ }>;
43
+ export declare function SignupCard({ initialCode, onValidateCode, passwordRules, termsHref, onOpenTerms, onSignup, loading, error, onSignInInstead, verifiedIdentity, providers, onContinueWithProvider, pendingProvider, className, }: SignupCardProps): import("react").JSX.Element;
@@ -2,6 +2,7 @@ export * from "./AuthLayout";
2
2
  export * from "./AcceptInvitationCard";
3
3
  export * from "./SignupCard";
4
4
  export * from "./LoginForm";
5
+ export * from "./SignInProviders";
5
6
  export * from "./ForgotPasswordForm";
6
7
  export * from "./ResetPasswordForm";
7
8
  export * from "./TermsAcceptance";
@@ -1,11 +1,18 @@
1
1
  import { type PasswordRequirementRule } from "../PasswordRequirements";
2
- export interface ChangePasswordFormProps {
2
+ interface ChangePasswordFormBaseProps {
3
3
  /** Pure — recomputed against the current draft of the new password on every
4
4
  * render. See the module header for why this is a function rather than a
5
5
  * precomputed `rules[]`. */
6
6
  passwordRules: (nextPassword: string) => PasswordRequirementRule[];
7
- onSubmit: (current: string, next: string) => Promise<void>;
8
7
  submitLabel?: string;
9
8
  className?: string;
10
9
  }
11
- export declare function ChangePasswordForm({ passwordRules, onSubmit, submitLabel, className, }: ChangePasswordFormProps): import("react").JSX.Element;
10
+ export type ChangePasswordFormProps = ChangePasswordFormBaseProps & ({
11
+ hasCurrentPassword?: true;
12
+ onSubmit: (current: string, next: string) => Promise<void>;
13
+ } | {
14
+ hasCurrentPassword: false;
15
+ onSubmit: (next: string) => Promise<void>;
16
+ });
17
+ export declare function ChangePasswordForm(props: ChangePasswordFormProps): import("react").JSX.Element;
18
+ export {};
@@ -1682,6 +1682,28 @@ export declare const coreIcons: {
1682
1682
  }], readonly ["path", {
1683
1683
  readonly d: "m16 19 2 2 4-4";
1684
1684
  }]];
1685
+ readonly github: readonly [readonly ["path", {
1686
+ readonly d: "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4";
1687
+ }], readonly ["path", {
1688
+ readonly d: "M9 18c-4.51 2-5-2-7-2";
1689
+ }]];
1690
+ readonly google: readonly [readonly ["path", {
1691
+ readonly d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z";
1692
+ readonly fill: "#4285F4";
1693
+ readonly stroke: "none";
1694
+ }], readonly ["path", {
1695
+ readonly d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z";
1696
+ readonly fill: "#34A853";
1697
+ readonly stroke: "none";
1698
+ }], readonly ["path", {
1699
+ readonly d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z";
1700
+ readonly fill: "#FBBC05";
1701
+ readonly stroke: "none";
1702
+ }], readonly ["path", {
1703
+ readonly d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z";
1704
+ readonly fill: "#EA4335";
1705
+ readonly stroke: "none";
1706
+ }]];
1685
1707
  readonly "align-center": readonly [readonly ["path", {
1686
1708
  readonly d: "M21 5H3";
1687
1709
  }], readonly ["path", {
@@ -160,7 +160,7 @@ export { initialFocusDay, isInMonth, nextDayForKey, useGridNavigation, type Grid
160
160
  export { AmbiguousTimeError, addDays, addDuration, addMonths, atMidnight, atTime, comparePlainDate, dayFraction, dayLengthMs, dayOfWeek, daysBetween, daysInMonth, endOfMonth, hoursInDay, instantAtFraction, instantToPlainDate, instantToPlainDateTime, isSameDate, isoDateString, isoDateTimeString, monthGridDays, nextDay, offsetAt, parsePlainDate, plainDateTimeToInstant, relativeAge, startOfDay, startOfMonth, startOfWeek, weekDays, type CalendarDuration, type Disambiguation, type Instant, type PlainDate, type PlainDateTime, type TimeZone, } from "./lib/time";
161
161
  export { allDayBandSegment, dayKey, daySlots, isAllDay, packBand, packLanes, snapFractionToInstant, timeSegments, timedBandSegment, type AllDayEvent, type BandInput, type BandOptions, type BandPlacement, type BandResult, type BandSegment, type CalendarEvent, type CalendarEventId, type CalendarView, type DaySlot, type DragKind, type EventDraft, type EventPalette, type LaneInput, type LaneOptions, type LanePlacement, type PaletteEntry, type PaletteKey, type TimeSegment, type TimedEvent, type VisibleRange, } from "./lib/calendar";
162
162
  export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, AgentKeysList, AccessRequestPanel, PermissionRequestPanel, RoleKeyPicker, isRoleSelectable, leastPrivilegeRoleId, InvitationsList, InviteMembersDialog, Brand, TeamSettingsForm, DangerZone, type RBACProviderProps, type RBACHookResult, type CanProps, type AccountMenuProps, type TeamSwitcherProps, type DevToolsPopoverProps, type RolePermissionMatrixProps, type RoleEditorDialogProps, type RoleEditorDialogSubmitInput, type ProfileFormProps, type ProfileFormAccount, type ProfileFormSaveInput, type ProfilePageProps, type RolesPermissionsPageProps, type MembersPanelProps, type MembersPanelMember, type ChangePasswordFormProps, type SessionsListProps, type Session, type ApiKeysPanelProps, type AgentKeysListProps, type ApiKey, type KeyGrant, type KeyRoleEditor, type AccessRequestPanelProps, type AccessRequest, type AccessRequestKind, type IssuedKey, type AccessRequestState, type ExpiredNote, type PermissionRequestPanelProps, type PermissionRequest, type RoleKeyPickerProps, type InvitationsListProps, type InvitationsListItem, type InvitationStatus, type InviteMembersDialogProps, type Permission, type Role, type User, type Team, type TeamMembership, type BrandProps, type TeamSettingsFormProps, type TeamSettingsFormTeam, type TeamSettingsFormSaveInput, type DangerZoneProps, } from "./components/rbac";
163
- export { AuthLayout, AcceptInvitationCard, SignupCard, TermsAcceptance, LoginForm, ForgotPasswordForm, ResetPasswordForm, type AuthLayoutProps, type AcceptInvitationCardProps, type SignupCardProps, type TermsAcceptanceProps, type LoginFormProps, type ForgotPasswordFormProps, type ResetPasswordFormProps, } from "./components/auth";
163
+ export { AuthLayout, AcceptInvitationCard, SignupCard, SignInProviders, TermsAcceptance, LoginForm, ForgotPasswordForm, ResetPasswordForm, type AuthLayoutProps, type AcceptInvitationCardProps, type SignupCardProps, type SignInProvidersProps, type SignInProvider, type SignInProviderId, type VerifiedIdentity, type ProviderContinuation, type TermsAcceptanceProps, type LoginFormProps, type ForgotPasswordFormProps, type ResetPasswordFormProps, } from "./components/auth";
164
164
  export { UseCaseCard, RoadmapItemCard, RoadmapSwimlaneBoard, UseCaseLedgerPage, RoadmapPage, PhaseManager, TrackManager, deriveRoadmapItemStatus, isFullyBuilt, isUnbuilt, trackIds, trackProgress, toneForIndex, CATEGORY_TONES, type Domain, type Phase, type Track, type RoadmapItem, type RoadmapItemStatus, type UseCase, type UseCaseStatus, type UseCaseDecision, type UseCaseCardProps, type RoadmapItemCardProps, type RoadmapSwimlaneBoardProps, type UseCaseLedgerPageProps, type RoadmapPageProps, type PhaseManagerProps, type TrackManagerProps, } from "./components/roadmap";
165
165
  export { ProvenanceDisclosure, ProvenanceDetail, ProvenanceBadge, ConfidenceReadout, ConfidenceMeter, ConfidenceBar, provenanceStateLabel, confidenceBand, confidenceScore, scoredConfidence, ratedConfidence, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ConfidenceScore, type ProvenanceConfidence, type ConfidenceReadoutProps, type ConfidenceBarProps, type ConfidenceBarSize, type ProvenanceDisclosureProps, type ProvenanceDetailProps, type ProvenanceDetailTitleAs, type ProvenanceTriggerBadge, type ProvenanceBadgeProps, type ProvenanceBadgeAppearance, type ConfidenceMeterProps, } from "./components/provenance";
166
166
  export { confidenceLevel, CONFIDENCE_LEVEL_LABELS, type ConfidenceLevel } from "./lib/confidence";
@@ -13,6 +13,8 @@ export interface AuthProvenanceFlowsStrings {
13
13
  accountExists: (email: string) => string;
14
14
  /** Button pointing an existing-account viewer at sign-in. */
15
15
  signInToAccept: string;
16
+ /** Label of the read-only email field shown once a provider has verified the person. */
17
+ email: string;
16
18
  /** Label of the new-account name field. */
17
19
  name: string;
18
20
  /** Label of the new-account username field. */
@@ -94,6 +96,21 @@ export interface AuthProvenanceFlowsStrings {
94
96
  /** The sign-in link beneath the card. */
95
97
  signIn: string;
96
98
  };
99
+ signInProviders: {
100
+ /** Accessible name of the provider button group. */
101
+ groupLabel: string;
102
+ /** One provider button: `provider` is that provider's name from `names`. */
103
+ continueWith: (provider: string) => string;
104
+ /** The word between a form and its provider buttons ("or"). */
105
+ or: string;
106
+ /** Display name of each provider, by id. */
107
+ names: {
108
+ google: string;
109
+ github: string;
110
+ };
111
+ /** Line shown in place of the password fields once a provider has verified the person: who they are there. */
112
+ verifiedAs: (provider: string, handle: string, emphasis: Emphasis) => ReactNode;
113
+ };
97
114
  termsAcceptance: {
98
115
  /** The agreement row is `before` + the link text + `after`, so a translation controls the order around the link. */
99
116
  agreement: {
@@ -462,6 +462,12 @@ export interface RbacStrings {
462
462
  mismatch: string;
463
463
  /** Default submit button text. */
464
464
  submit: string;
465
+ /** Set-password mode (no current password yet): title of the error callout when it fails. */
466
+ setFailedTitle: string;
467
+ /** Set-password mode: fallback error text when it rejects without a message. */
468
+ setFailedMessage: string;
469
+ /** Set-password mode: default submit button text. */
470
+ setSubmit: string;
465
471
  };
466
472
  /** `DangerZone`. */
467
473
  dangerZone: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "26.1.1",
3
+ "version": "26.2.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",