@echothink-ui/identity 0.1.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.
Files changed (48) hide show
  1. package/README.md +5 -0
  2. package/dist/components/AccessReviewPanel.d.ts +9 -0
  3. package/dist/components/AccountMenu.d.ts +8 -0
  4. package/dist/components/ApprovalPolicyEditor.d.ts +8 -0
  5. package/dist/components/AuditTrail.d.ts +6 -0
  6. package/dist/components/GroupPicker.d.ts +12 -0
  7. package/dist/components/IdentityCard.d.ts +14 -0
  8. package/dist/components/InviteUserPanel.d.ts +14 -0
  9. package/dist/components/OrganizationSwitcher.d.ts +9 -0
  10. package/dist/components/PermissionMatrix.d.ts +10 -0
  11. package/dist/components/PolicyRuleViewer.d.ts +6 -0
  12. package/dist/components/RoleBadge.d.ts +6 -0
  13. package/dist/components/SessionStatus.d.ts +9 -0
  14. package/dist/components/TeamList.d.ts +13 -0
  15. package/dist/components/UserPicker.d.ts +12 -0
  16. package/dist/components/types.d.ts +77 -0
  17. package/dist/index.cjs +1629 -0
  18. package/dist/index.cjs.map +1 -0
  19. package/dist/index.css +2238 -0
  20. package/dist/index.css.map +1 -0
  21. package/dist/index.d.ts +18 -0
  22. package/dist/index.js +1610 -0
  23. package/dist/index.js.map +1 -0
  24. package/package.json +43 -0
  25. package/src/components/AccessReviewPanel.tsx +169 -0
  26. package/src/components/AccountMenu.tsx +144 -0
  27. package/src/components/ApprovalPolicyEditor.tsx +131 -0
  28. package/src/components/AuditTrail.tsx +105 -0
  29. package/src/components/GroupPicker.tsx +175 -0
  30. package/src/components/IdentityCard.tsx +78 -0
  31. package/src/components/InviteUserPanel.tsx +162 -0
  32. package/src/components/OrganizationSwitcher.test.tsx +59 -0
  33. package/src/components/OrganizationSwitcher.tsx +161 -0
  34. package/src/components/PermissionMatrix.test.tsx +96 -0
  35. package/src/components/PermissionMatrix.tsx +271 -0
  36. package/src/components/PolicyRuleViewer.test.tsx +29 -0
  37. package/src/components/PolicyRuleViewer.tsx +78 -0
  38. package/src/components/RoleBadge.test.tsx +35 -0
  39. package/src/components/RoleBadge.tsx +38 -0
  40. package/src/components/SessionStatus.test.tsx +40 -0
  41. package/src/components/SessionStatus.tsx +194 -0
  42. package/src/components/TeamList.test.tsx +48 -0
  43. package/src/components/TeamList.tsx +98 -0
  44. package/src/components/UserPicker.test.tsx +52 -0
  45. package/src/components/UserPicker.tsx +174 -0
  46. package/src/components/types.ts +89 -0
  47. package/src/index.tsx +35 -0
  48. package/src/styles.css +2578 -0
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @echothink-ui/identity
2
+
3
+ Identity package for EchoThink app-domain websites.
4
+
5
+ This package is part of the EchoThink-UI app-domain library. It is designed for normal website app domains rendered inside EchoThink Studio's Chromium shell, not for implementing the studio browser chrome itself.
@@ -0,0 +1,9 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AccessFinding, AccessReviewSubject } from "./types";
3
+ export interface AccessReviewPanelProps extends Omit<SurfaceComponentProps, "children"> {
4
+ subjects: AccessReviewSubject[];
5
+ findings: AccessFinding[];
6
+ onApprove?: (subjectId: string, resourceId: string) => void;
7
+ onRevoke?: (subjectId: string, resourceId: string) => void;
8
+ }
9
+ export declare function AccessReviewPanel({ subjects, findings, onApprove, onRevoke, title, className, ...props }: AccessReviewPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type EthAction, type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { IdentityRef } from "./types";
3
+ export interface AccountMenuProps extends Omit<SurfaceComponentProps, "children" | "actions"> {
4
+ user: IdentityRef;
5
+ actions: EthAction[];
6
+ defaultOpen?: boolean;
7
+ }
8
+ export declare function AccountMenu({ user, actions, defaultOpen, className }: AccountMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { ApprovalPolicy, ApprovalPolicySchema } from "./types";
3
+ export interface ApprovalPolicyEditorProps extends Omit<SurfaceComponentProps, "children" | "onChange"> {
4
+ policy: ApprovalPolicy;
5
+ schema: ApprovalPolicySchema;
6
+ onChange?: (policy: ApprovalPolicy) => void;
7
+ }
8
+ export declare function ApprovalPolicyEditor({ policy, schema, onChange, title, description, actions, className, ...props }: ApprovalPolicyEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { AuditTrailEntry } from "./types";
3
+ export interface AuditTrailProps extends Omit<SurfaceComponentProps, "children"> {
4
+ entries: AuditTrailEntry[];
5
+ }
6
+ export declare function AuditTrail({ entries, title, subtitle, description, density, metadata, className, role, "aria-label": ariaLabel, ...props }: AuditTrailProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { IdentityRef } from "./types";
3
+ export interface GroupPickerProps extends Omit<SurfaceComponentProps, "children" | "onChange" | "value"> {
4
+ value: string[];
5
+ onChange?: (value: string[]) => void;
6
+ onSearch?: (query: string) => void;
7
+ suggestions?: IdentityRef[];
8
+ multiple?: boolean;
9
+ defaultOpen?: boolean;
10
+ disabled?: boolean;
11
+ }
12
+ export declare function GroupPicker({ value, onChange, onSearch, suggestions, multiple, defaultOpen, disabled, loading, className }: GroupPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type EthAction, type EthOperationalStatus, type SurfaceComponentProps } from "@echothink-ui/core";
2
+ export interface IdentityCardProps extends Omit<SurfaceComponentProps, "children" | "actions"> {
3
+ identity: {
4
+ id: string;
5
+ label: string;
6
+ email?: string;
7
+ avatar?: string;
8
+ role?: string;
9
+ kind: "user" | "service-account" | "group";
10
+ status?: EthOperationalStatus;
11
+ };
12
+ actions?: EthAction[];
13
+ }
14
+ export declare function IdentityCard({ identity, actions, className, ...props }: IdentityCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
3
+ export type InviteRole = string | {
4
+ id: string;
5
+ label: string;
6
+ };
7
+ export interface InviteUserPanelProps extends Omit<SurfaceComponentProps, "children"> {
8
+ roles: InviteRole[];
9
+ onInvite?: (email: string, role: string) => void;
10
+ defaultEmail?: string;
11
+ defaultRole?: string;
12
+ inviteLabel?: React.ReactNode;
13
+ }
14
+ export declare function InviteUserPanel({ roles, onInvite, title, description, defaultEmail, defaultRole, inviteLabel, className, ...props }: InviteUserPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { OrganizationRef } from "./types";
3
+ export interface OrganizationSwitcherProps extends Omit<SurfaceComponentProps, "children"> {
4
+ organizations: OrganizationRef[];
5
+ activeId?: string;
6
+ defaultOpen?: boolean;
7
+ onSwitch?: (id: string) => void;
8
+ }
9
+ export declare function OrganizationSwitcher({ organizations, activeId, defaultOpen, onSwitch, className }: OrganizationSwitcherProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { IdentitySubject, PermissionAction, PermissionValue } from "./types";
3
+ export interface PermissionMatrixProps extends Omit<SurfaceComponentProps, "children" | "onChange"> {
4
+ subjects: IdentitySubject[];
5
+ actions: PermissionAction[];
6
+ assignments: Record<string, Record<string, PermissionValue>>;
7
+ onChange?: (subjectId: string, actionId: string, value: PermissionValue) => void;
8
+ mode?: "read" | "edit";
9
+ }
10
+ export declare function PermissionMatrix({ subjects, actions, assignments, onChange, mode, title, description, metadata, className, "aria-label": ariaLabel, ...props }: PermissionMatrixProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { PolicyRule } from "./types";
3
+ export interface PolicyRuleViewerProps extends Omit<SurfaceComponentProps, "children"> {
4
+ rule: PolicyRule;
5
+ }
6
+ export declare function PolicyRuleViewer({ rule, title, className, ...props }: PolicyRuleViewerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { HTMLAttributes } from "react";
2
+ export interface RoleBadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children" | "role"> {
3
+ role: string;
4
+ tier?: "admin" | "editor" | "viewer" | "custom";
5
+ }
6
+ export declare function RoleBadge({ role, tier, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, title, ...props }: RoleBadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ export interface SessionStatusProps extends Omit<SurfaceComponentProps, "children"> {
3
+ session: {
4
+ expiresAt: string;
5
+ mfaEnabled: boolean;
6
+ lastIp?: string;
7
+ };
8
+ }
9
+ export declare function SessionStatus({ session, title, description, className, severity, status, ...props }: SessionStatusProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { IdentityRef } from "./types";
3
+ export interface TeamListTeam {
4
+ id: string;
5
+ label: string;
6
+ memberCount: number;
7
+ lead?: IdentityRef;
8
+ }
9
+ export interface TeamListProps extends Omit<SurfaceComponentProps, "children" | "onSelect"> {
10
+ teams: TeamListTeam[];
11
+ onSelect?: (id: string) => void;
12
+ }
13
+ export declare function TeamList({ teams, onSelect, title, className, ...props }: TeamListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type SurfaceComponentProps } from "@echothink-ui/core";
2
+ import type { IdentityRef } from "./types";
3
+ export interface UserPickerProps extends Omit<SurfaceComponentProps, "children" | "onChange" | "value"> {
4
+ value: string[];
5
+ onChange?: (value: string[]) => void;
6
+ onSearch?: (query: string) => void;
7
+ suggestions?: IdentityRef[];
8
+ multiple?: boolean;
9
+ defaultOpen?: boolean;
10
+ disabled?: boolean;
11
+ }
12
+ export declare function UserPicker({ value, onChange, onSearch, suggestions, multiple, defaultOpen, disabled, loading, className }: UserPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,77 @@
1
+ import type { EthAction, EthOperationalStatus } from "@echothink-ui/core";
2
+ import type { JsonSchema, RuleDefinition } from "@echothink-ui/forms";
3
+ export interface IdentityRef {
4
+ id: string;
5
+ label: string;
6
+ email?: string;
7
+ avatar?: string;
8
+ role?: string;
9
+ kind?: "user" | "service-account" | "group";
10
+ status?: EthOperationalStatus;
11
+ }
12
+ export interface IdentitySubject {
13
+ id: string;
14
+ label: string;
15
+ kind: string;
16
+ role?: string;
17
+ description?: string;
18
+ }
19
+ export interface PermissionAction {
20
+ id: string;
21
+ label: string;
22
+ group?: string;
23
+ resource?: string;
24
+ scope?: string;
25
+ description?: string;
26
+ }
27
+ export type PermissionValue = "allow" | "deny" | "inherit";
28
+ export interface AccessReviewResource {
29
+ resourceId: string;
30
+ resourceLabel: string;
31
+ permissions: string[];
32
+ lastUsedAt?: string;
33
+ }
34
+ export interface AccessReviewSubject extends IdentityRef {
35
+ accessTo: AccessReviewResource[];
36
+ }
37
+ export interface AccessFinding {
38
+ id: string;
39
+ subjectId: string;
40
+ reason: string;
41
+ severity: "info" | "warning" | "error" | "critical";
42
+ }
43
+ export interface OrganizationRef {
44
+ id: string;
45
+ label: string;
46
+ description?: string;
47
+ status?: EthOperationalStatus;
48
+ }
49
+ export interface AuditTrailEntry {
50
+ id: string;
51
+ timestamp: string;
52
+ actor: string;
53
+ action: string;
54
+ resource: string;
55
+ outcome: "success" | "failure";
56
+ }
57
+ export interface PolicyRule {
58
+ id: string;
59
+ effect: "allow" | "deny";
60
+ subjects: string[];
61
+ actions: string[];
62
+ resources: string[];
63
+ conditions?: string;
64
+ }
65
+ export interface ApprovalPolicy {
66
+ id?: string;
67
+ name?: string;
68
+ description?: string;
69
+ requiredApprovals?: number;
70
+ rules?: RuleDefinition[];
71
+ approvers?: IdentityRef[];
72
+ actions?: EthAction[];
73
+ [key: string]: unknown;
74
+ }
75
+ export interface ApprovalPolicySchema extends JsonSchema {
76
+ variables?: string[];
77
+ }