@danxbot/ui 20.0.0 → 20.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
1
  import type { ReactNode } from "react";
2
- import { type ApiKey } from "./ApiKeysTable";
2
+ import { type ApiKey, type KeyRoleEditor } from "./ApiKeysTable";
3
3
  export interface AgentKeysListProps {
4
4
  /** The keys agents hold, already scoped to the person. */
5
5
  keys: ApiKey[];
6
6
  onRevoke: (id: number) => Promise<void>;
7
- /** The id of a key currently mid-revoke. Disables just that row. */
7
+ /** The id of a key currently mid-revoke or mid-role-change. Disables just that row's controls. */
8
8
  busyId?: number | null;
9
+ /** Makes each key's role editable in place. Omit for a read-only role badge. */
10
+ roleEditor?: KeyRoleEditor;
9
11
  emptyState?: ReactNode;
10
12
  className?: string;
11
13
  }
12
- export declare function AgentKeysList({ keys, onRevoke, busyId, emptyState, className }: AgentKeysListProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined>;
14
+ export declare function AgentKeysList({ keys, onRevoke, busyId, roleEditor, emptyState, className }: AgentKeysListProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined>;
@@ -1,9 +1,12 @@
1
+ import type { Permission, Role } from "./types";
1
2
  export interface ApiKey {
2
3
  id: number;
3
4
  name: string;
4
5
  /** The label of the role this key acts with. A label, not an id: a key can carry a role of a team other than the one whose
5
6
  * `roles` the create dialog offers, and only the consumer's server can name that one. */
6
7
  roleLabel: string;
8
+ /** The id of that role, matching a `Role.id` in `roleEditor.roles`. Needed only for a key whose role is editable. */
9
+ roleId?: string;
7
10
  /** ISO instant. */
8
11
  createdAt: string;
9
12
  /** ISO instant, or `null`/omitted if it has never been used. */
@@ -11,11 +14,23 @@ export interface ApiKey {
11
14
  /** ISO instant, or `null`/omitted for a key with no expiry. */
12
15
  expiresAt?: string | null;
13
16
  }
17
+ /** Makes a key's role editable in place. `roles` are the roles the owner may pick from. */
18
+ export interface KeyRoleEditor {
19
+ roles: Role[];
20
+ /** The permission catalog, used to name the permissions that make a role unavailable. */
21
+ permissions: Permission[];
22
+ /** What the owner holds. A role holding anything outside this set is listed but cannot be chosen. */
23
+ ownPermissionKeys: string[];
24
+ /** Fired when a different role is picked. The consumer saves it and refreshes `keys`. */
25
+ onChange: (id: number, roleId: string) => Promise<void>;
26
+ }
14
27
  export interface ApiKeysTableProps {
15
28
  keys: ApiKey[];
16
29
  onRevoke: (id: number) => Promise<void>;
17
- /** The id of a key currently mid-revoke. Disables just that row. */
30
+ /** The id of a key currently mid-revoke or mid-role-change. Disables just that row's controls. */
18
31
  busyId?: number | null;
32
+ /** Makes each key's role editable in place (DX-4427). Omit for a read-only role badge. */
33
+ roleEditor?: KeyRoleEditor;
19
34
  className?: string;
20
35
  }
21
- export declare function ApiKeysTable({ keys, onRevoke, busyId, className }: ApiKeysTableProps): import("react").JSX.Element;
36
+ export declare function ApiKeysTable({ keys, onRevoke, busyId, roleEditor, className }: ApiKeysTableProps): import("react").JSX.Element;
@@ -15,6 +15,8 @@ export interface RoleKeyPickerProps {
15
15
  disabled?: boolean;
16
16
  className?: string;
17
17
  }
18
+ /** Why `role` can't be chosen, naming the missing permissions by label. `null` when it can. */
19
+ export declare function roleUnavailableReason(role: Role, own: ReadonlySet<string>, permissions: Permission[]): string | null;
18
20
  /** Whether `roleId` names a role in `roles` that the issuer may choose. */
19
21
  export declare function isRoleSelectable(roleId: string, roles: Role[], own: ReadonlySet<string>): boolean;
20
22
  /** The id of the selectable role holding the fewest permissions (the first of any tie), or `""` when none is selectable. */
@@ -13,7 +13,7 @@ export * from "./MembersPanel";
13
13
  export * from "./ChangePasswordForm";
14
14
  export * from "./SessionsList";
15
15
  export * from "./RoleKeyPicker";
16
- export type { ApiKey } from "./ApiKeysTable";
16
+ export type { ApiKey, KeyRoleEditor } from "./ApiKeysTable";
17
17
  export * from "./ApiKeysPanel";
18
18
  export * from "./AgentKeysList";
19
19
  export * from "./AccessRequestPanel";
@@ -150,7 +150,7 @@ export { cellLabel, eventLabel, formatDateRange, longDate, monthTitle, timeOfDay
150
150
  export { initialFocusDay, isInMonth, nextDayForKey, useGridNavigation, type GridNavigation, type GridNavigationOptions, } from "./components/calendar/use-grid-navigation";
151
151
  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";
152
152
  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 TimeSegment, type TimedEvent, type VisibleRange, } from "./lib/calendar";
153
- export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, AgentKeysList, AccessRequestPanel, 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 AccessRequestPanelProps, type AccessRequest, type AccessRequestKind, type AccessRequestState, 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";
153
+ export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, AgentKeysList, AccessRequestPanel, 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 KeyRoleEditor, type AccessRequestPanelProps, type AccessRequest, type AccessRequestKind, type AccessRequestState, 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";
154
154
  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";
155
155
  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";
156
156
  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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "20.0.0",
3
+ "version": "20.1.1",
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",