@danxbot/ui 26.1.2 → 26.3.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,18 @@
1
+ import { type ProviderContinuation, type VerifiedIdentity } from "./SignInProviders";
1
2
  import { type TermsAcceptanceProps } from "./TermsAcceptance";
2
- export interface AcceptInvitationCardProps {
3
+ /** What the new-account form hands over; the password mode adds `password`, the verified mode does not. */
4
+ type AcceptInvitationAccount = {
5
+ name: string;
6
+ username: string;
7
+ acceptedTerms: true;
8
+ };
9
+ /** What the person typed before a provider round trip, handed back on return. */
10
+ export interface AcceptInvitationInitialValues {
11
+ name?: string;
12
+ username?: string;
13
+ acceptedTerms?: boolean;
14
+ }
15
+ type AcceptInvitationCardBase = {
3
16
  teamName: string;
4
17
  teamLogoUrl?: string;
5
18
  inviterName: string;
@@ -20,15 +33,22 @@ export interface AcceptInvitationCardProps {
20
33
  termsHref: string;
21
34
  /** Runs on that link's click; see `TermsAcceptance`. */
22
35
  onOpenTerms?: TermsAcceptanceProps["onOpenTerms"];
23
- onCreateAccount: (input: {
24
- name: string;
25
- username: string;
26
- password: string;
27
- acceptedTerms: true;
28
- }) => void;
36
+ /** Seeds the new-account form (read once, on mount): what `onContinueWithProvider` reported before the redirect. */
37
+ initialValues?: AcceptInvitationInitialValues;
29
38
  onJoinAsSignedInUser?: () => void;
30
39
  /** Offered when `accountExists` is true but the viewer isn't signed in as that email. */
31
40
  onSignInInstead?: () => void;
32
41
  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;
42
+ };
43
+ export type AcceptInvitationCardProps = AcceptInvitationCardBase & ProviderContinuation<AcceptInvitationAccount> & ({
44
+ verifiedIdentity?: undefined;
45
+ onCreateAccount: (input: AcceptInvitationAccount & {
46
+ password: string;
47
+ }) => void;
48
+ } | {
49
+ /** Set once a provider has verified the person; replaces the password field. */
50
+ verifiedIdentity: VerifiedIdentity;
51
+ onCreateAccount: (input: AcceptInvitationAccount) => void;
52
+ });
53
+ export declare function AcceptInvitationCard(props: AcceptInvitationCardProps): import("react").JSX.Element;
54
+ export {};
@@ -1,9 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
- export interface LoginFormProps {
2
+ import { type ProviderSelection } from "./SignInProviders";
3
+ export type LoginFormProps = {
3
4
  onSubmit: (identifier: string, password: string) => Promise<void>;
4
5
  /** Rendered beside the password field's label — typically a "Forgot password?" link. */
5
6
  forgotPasswordLink?: ReactNode;
6
7
  submitLabel?: string;
7
8
  className?: string;
8
- }
9
- export declare function LoginForm({ onSubmit, forgotPasswordLink, submitLabel, className, }: LoginFormProps): import("react").JSX.Element;
9
+ } & ProviderSelection;
10
+ export declare function LoginForm({ onSubmit, forgotPasswordLink, submitLabel, providers, onSelectProvider, pendingProvider, className, }: LoginFormProps): import("react").JSX.Element;
@@ -0,0 +1,56 @@
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
+ /**
15
+ * Draws the "or" rule above the row. The rule belongs to the row, not to the form around it, so an empty `providers`
16
+ * list renders neither: there is no way to get an orphan divider (DX-5095).
17
+ */
18
+ divided?: boolean;
19
+ className?: string;
20
+ }
21
+ export declare function SignInProviders({ providers, onSelect, pending, disabled, divided, className, }: SignInProvidersProps): import("react").JSX.Element | null;
22
+ /** A verified identity from a provider: the account is created from it, so no password exists to ask for. */
23
+ export interface VerifiedIdentity {
24
+ provider: SignInProviderId;
25
+ handle: string;
26
+ email: string;
27
+ }
28
+ /**
29
+ * The provider buttons of a card that creates an account: all three props or none. `Ctx` is what the card has
30
+ * collected that the provider round trip must carry.
31
+ */
32
+ export type ProviderContinuation<Ctx> = {
33
+ providers?: undefined;
34
+ onContinueWithProvider?: undefined;
35
+ pendingProvider?: undefined;
36
+ } | {
37
+ providers: readonly SignInProvider[];
38
+ onContinueWithProvider: (id: SignInProviderId, context: Ctx) => void;
39
+ /** The provider whose round trip has started; disables the row. */
40
+ pendingProvider?: SignInProviderId | null;
41
+ };
42
+ /** The provider buttons of a form that signs an existing account in: all three props or none. */
43
+ export type ProviderSelection = {
44
+ providers?: undefined;
45
+ onSelectProvider?: undefined;
46
+ pendingProvider?: undefined;
47
+ } | {
48
+ providers: readonly SignInProvider[];
49
+ onSelectProvider: (id: SignInProviderId) => void;
50
+ /** The provider whose round trip has started; disables the row. */
51
+ pendingProvider?: SignInProviderId | null;
52
+ };
53
+ /** The "or" rule between a form and its provider buttons. */
54
+ export declare function OrDivider({ className }: {
55
+ className?: string;
56
+ }): import("react").JSX.Element;
@@ -1,6 +1,23 @@
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
+ /** What the account form hands over; the password mode adds `password`, the verified mode does not. */
5
+ type SignupAccount = {
6
+ code: string;
7
+ name: string;
8
+ username: string;
9
+ email: string;
10
+ teamName: string;
11
+ acceptedTerms: true;
12
+ };
13
+ /** What the person typed before a provider round trip, handed back on return (the code comes back as `initialCode`). */
14
+ export interface SignupInitialValues {
15
+ name?: string;
16
+ username?: string;
17
+ teamName?: string;
18
+ acceptedTerms?: boolean;
19
+ }
20
+ type SignupCardBase = {
4
21
  /** A code already known (the sign-up link's). Checked on mount, then shown read-only while it is good. */
5
22
  initialCode?: string;
6
23
  /**
@@ -16,20 +33,30 @@ export interface SignupCardProps {
16
33
  termsHref: string;
17
34
  /** Runs on that link's click; see `TermsAcceptance`. */
18
35
  onOpenTerms?: TermsAcceptanceProps["onOpenTerms"];
19
- onSignup: (input: {
20
- code: string;
21
- name: string;
22
- username: string;
23
- email: string;
24
- teamName: string;
25
- password: string;
26
- acceptedTerms: true;
27
- }) => void;
36
+ /** Seeds the account form (read once, on mount): what `onContinueWithProvider` reported before the redirect. */
37
+ initialValues?: SignupInitialValues;
28
38
  loading?: boolean;
29
39
  /** A server-side error surfaced after a failed submit (username taken, rate limited, ...). */
30
40
  error?: string;
31
41
  /** Offered beneath the card for a visitor who already has an account. */
32
42
  onSignInInstead?: () => void;
33
43
  className?: string;
34
- }
35
- export declare function SignupCard({ initialCode, onValidateCode, passwordRules, termsHref, onOpenTerms, onSignup, loading, error, onSignInInstead, className, }: SignupCardProps): import("react").JSX.Element;
44
+ };
45
+ export type SignupCardProps = SignupCardBase & ProviderContinuation<{
46
+ code: string;
47
+ name: string;
48
+ username: string;
49
+ teamName: string;
50
+ acceptedTerms: true;
51
+ }> & ({
52
+ verifiedIdentity?: undefined;
53
+ onSignup: (input: SignupAccount & {
54
+ password: string;
55
+ }) => void;
56
+ } | {
57
+ /** Set once a provider has verified the person; replaces the password field and fills the email. */
58
+ verifiedIdentity: VerifiedIdentity;
59
+ onSignup: (input: SignupAccount) => void;
60
+ });
61
+ export declare function SignupCard(props: SignupCardProps): import("react").JSX.Element;
62
+ export {};
@@ -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 SignupInitialValues, type AcceptInvitationInitialValues, type SignInProvidersProps, type ProviderSelection, 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. */
@@ -81,6 +83,8 @@ export interface AuthProvenanceFlowsStrings {
81
83
  email: string;
82
84
  /** Helper text when the code reserves the email address. */
83
85
  emailReserved: string;
86
+ /** Error under the email field when a provider verified a different address than the one the code is reserved for. */
87
+ emailLockMismatch: (reservedEmail: string) => string;
84
88
  /** Label of the team-name field. */
85
89
  teamName: string;
86
90
  /** Helper text under the team-name field. */
@@ -94,6 +98,21 @@ export interface AuthProvenanceFlowsStrings {
94
98
  /** The sign-in link beneath the card. */
95
99
  signIn: string;
96
100
  };
101
+ signInProviders: {
102
+ /** Accessible name of the provider button group. */
103
+ groupLabel: string;
104
+ /** One provider button: `provider` is that provider's name from `names`. */
105
+ continueWith: (provider: string) => string;
106
+ /** The word between a form and its provider buttons ("or"). */
107
+ or: string;
108
+ /** Display name of each provider, by id. */
109
+ names: {
110
+ google: string;
111
+ github: string;
112
+ };
113
+ /** Line shown in place of the password fields once a provider has verified the person: who they are there. */
114
+ verifiedAs: (provider: string, handle: string, emphasis: Emphasis) => ReactNode;
115
+ };
97
116
  termsAcceptance: {
98
117
  /** The agreement row is `before` + the link text + `after`, so a translation controls the order around the link. */
99
118
  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.2",
3
+ "version": "26.3.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",