@cellarnode/ui 0.183.0 → 0.185.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 (44) hide show
  1. package/dist/components/journey-card.d.ts.map +1 -1
  2. package/dist/components/journey-card.js +2 -1
  3. package/dist/components/journey-card.js.map +1 -1
  4. package/dist/components/sortable-card-grip.d.ts +23 -0
  5. package/dist/components/sortable-card-grip.d.ts.map +1 -0
  6. package/dist/components/sortable-card-grip.js +13 -0
  7. package/dist/components/sortable-card-grip.js.map +1 -0
  8. package/dist/components/sortable-card-shell.d.ts +29 -19
  9. package/dist/components/sortable-card-shell.d.ts.map +1 -1
  10. package/dist/components/sortable-card-shell.js +49 -27
  11. package/dist/components/sortable-card-shell.js.map +1 -1
  12. package/dist/org/index.d.ts +2 -0
  13. package/dist/org/index.d.ts.map +1 -1
  14. package/dist/org/index.js +2 -0
  15. package/dist/org/index.js.map +1 -1
  16. package/dist/org/organisation-shell.d.ts +41 -0
  17. package/dist/org/organisation-shell.d.ts.map +1 -0
  18. package/dist/org/organisation-shell.js +24 -0
  19. package/dist/org/organisation-shell.js.map +1 -0
  20. package/dist/profile/account-actions-card.d.ts +28 -0
  21. package/dist/profile/account-actions-card.d.ts.map +1 -0
  22. package/dist/profile/account-actions-card.js +37 -0
  23. package/dist/profile/account-actions-card.js.map +1 -0
  24. package/dist/profile/account-edit-form.d.ts +84 -0
  25. package/dist/profile/account-edit-form.d.ts.map +1 -0
  26. package/dist/profile/account-edit-form.js +168 -0
  27. package/dist/profile/account-edit-form.js.map +1 -0
  28. package/dist/profile/account-preferences-card.d.ts +27 -0
  29. package/dist/profile/account-preferences-card.d.ts.map +1 -0
  30. package/dist/profile/account-preferences-card.js +53 -0
  31. package/dist/profile/account-preferences-card.js.map +1 -0
  32. package/dist/profile/index.d.ts +10 -0
  33. package/dist/profile/index.d.ts.map +1 -1
  34. package/dist/profile/index.js +6 -0
  35. package/dist/profile/index.js.map +1 -1
  36. package/dist/profile/subscription-card.d.ts +49 -0
  37. package/dist/profile/subscription-card.d.ts.map +1 -0
  38. package/dist/profile/subscription-card.js +53 -0
  39. package/dist/profile/subscription-card.js.map +1 -0
  40. package/dist/profile/user-information-card.d.ts +55 -0
  41. package/dist/profile/user-information-card.d.ts.map +1 -0
  42. package/dist/profile/user-information-card.js +63 -0
  43. package/dist/profile/user-information-card.js.map +1 -0
  44. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ export interface AccountEditValues {
2
+ firstName: string;
3
+ lastName: string;
4
+ /** Only read when `showPhone` is set. */
5
+ phone?: string;
6
+ }
7
+ export interface AccountEditSubmit {
8
+ /** `firstName` and `lastName` trimmed and joined by one space. */
9
+ name: string;
10
+ /** Trimmed phone (possibly empty). Present only when `showPhone` is set. */
11
+ phone?: string;
12
+ }
13
+ export interface AccountEditFormLabels {
14
+ title?: string;
15
+ subtitle?: string;
16
+ /** Accessible name of the icon-only back button. */
17
+ back?: string;
18
+ personalInformation?: string;
19
+ personalInformationDescription?: string;
20
+ accountContext?: string;
21
+ accountContextDescription?: string;
22
+ firstName?: string;
23
+ lastName?: string;
24
+ phone?: string;
25
+ email?: string;
26
+ emailReadonly?: string;
27
+ role?: string;
28
+ /** Includes the trailing colon, as producer's row does. */
29
+ organisation?: string;
30
+ /** Includes the trailing colon, as producer's row does. */
31
+ accountId?: string;
32
+ notSet?: string;
33
+ unknownRole?: string;
34
+ save?: string;
35
+ cancel?: string;
36
+ changedElsewhere?: string;
37
+ reloadLatest?: string;
38
+ }
39
+ export interface AccountEditFormProps {
40
+ /** The account values on the server. Editing starts from, and "Reload latest" resets to, these. */
41
+ serverValues: AccountEditValues;
42
+ /** Account id. A change of id resets the form to the new account without a banner. */
43
+ accountId: string;
44
+ /**
45
+ * Opaque string for server-side context that is not editable here (role,
46
+ * organisation id). When it changes while the form is dirty, the "changed
47
+ * elsewhere" banner appears.
48
+ */
49
+ contextRevision?: string;
50
+ email?: string | null;
51
+ role?: string | null;
52
+ /** The organisation NAME, never an id. */
53
+ organisationName?: string | null;
54
+ /** Show and submit the optional phone field. */
55
+ showPhone?: boolean;
56
+ /**
57
+ * Return a promise. Resolve to mark the form clean (the submitted values become
58
+ * the baseline until `serverValues` change); reject to keep the edits. The form
59
+ * never reports the failure itself: the consumer owns it (producer shows a toast).
60
+ */
61
+ onSubmit: (values: AccountEditSubmit) => Promise<void>;
62
+ /** Called by Cancel and by the back button. */
63
+ onCancel: () => void;
64
+ /** Consumer-owned in-flight flag (e.g. a mutation). The form also tracks its own pending submit. */
65
+ isSaving?: boolean;
66
+ /** Disables Save while the account is still loading. */
67
+ isLoading?: boolean;
68
+ /** Opt-in inline alert. Producer shows none (it uses a toast), so omit it to match producer. */
69
+ error?: string | null;
70
+ /** Called when the dirty state flips, so the consumer can guard navigation. */
71
+ onDirtyChange?: (dirty: boolean) => void;
72
+ labels?: AccountEditFormLabels;
73
+ className?: string;
74
+ }
75
+ /**
76
+ * Edit form for the personal account (CEL-2126), a port of producer's
77
+ * `_app.profile.edit`, same layout: header (back, title, Cancel and Save),
78
+ * "Personal Information" card, "Account Context" card with icon rows. Dirty
79
+ * tracking and the "changed elsewhere" banner with "Reload latest".
80
+ * First and last name are required (Save stays disabled while either is blank).
81
+ * The consumer owns the data call, the copy and failure reporting.
82
+ */
83
+ export declare function AccountEditForm({ serverValues, accountId, contextRevision, email, role, organisationName, showPhone, onSubmit, onCancel, isSaving, isLoading, error, onDirtyChange, labels, className, }: AccountEditFormProps): import("react/jsx-runtime").JSX.Element;
84
+ //# sourceMappingURL=account-edit-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-edit-form.d.ts","sourceRoot":"","sources":["../../src/profile/account-edit-form.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,W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C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,oGAAoG;IACpG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2CD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,SAAS,EACT,eAAe,EACf,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,SAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,SAAiB,EACjB,KAAK,EACL,aAAa,EACb,MAAM,EACN,SAAS,GACV,EAAE,oBAAoB,2CAiRtB"}
@@ -0,0 +1,168 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useRef, useState } from "react";
3
+ import { ArrowLeftIcon, Building2Icon, DownloadIcon, MailIcon, TriangleAlertIcon, UserIcon, } from "lucide-react";
4
+ import { Badge } from "../components/badge.js";
5
+ import { Button } from "../components/button.js";
6
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../components/card.js";
7
+ import { Input } from "../components/input.js";
8
+ import { formatRoleLabel, present, safeOrganisationName } from "./user-information-card.js";
9
+ const DEFAULT_LABELS = {
10
+ title: "Edit Account",
11
+ subtitle: "Update your personal account details.",
12
+ back: "Back",
13
+ personalInformation: "Personal Information",
14
+ personalInformationDescription: "Name and email used by your account.",
15
+ accountContext: "Account Context",
16
+ accountContextDescription: "Read-only account metadata.",
17
+ firstName: "First Name",
18
+ lastName: "Last Name",
19
+ phone: "Phone",
20
+ email: "Email",
21
+ emailReadonly: "Email is your sign-in identity and can't be changed here.",
22
+ role: "Role",
23
+ organisation: "Organisation:",
24
+ accountId: "Account ID:",
25
+ notSet: "Not set",
26
+ unknownRole: "Unknown",
27
+ save: "Save",
28
+ cancel: "Cancel",
29
+ changedElsewhere: "Account context changed elsewhere. Your edits are still here.",
30
+ reloadLatest: "Reload latest",
31
+ };
32
+ function toState(values, showPhone) {
33
+ return {
34
+ firstName: values.firstName ?? "",
35
+ lastName: values.lastName ?? "",
36
+ phone: showPhone ? (values.phone ?? "") : "",
37
+ };
38
+ }
39
+ const sameState = (a, b) => a.firstName === b.firstName && a.lastName === b.lastName && a.phone === b.phone;
40
+ /**
41
+ * Edit form for the personal account (CEL-2126), a port of producer's
42
+ * `_app.profile.edit`, same layout: header (back, title, Cancel and Save),
43
+ * "Personal Information" card, "Account Context" card with icon rows. Dirty
44
+ * tracking and the "changed elsewhere" banner with "Reload latest".
45
+ * First and last name are required (Save stays disabled while either is blank).
46
+ * The consumer owns the data call, the copy and failure reporting.
47
+ */
48
+ export function AccountEditForm({ serverValues, accountId, contextRevision, email, role, organisationName, showPhone = false, onSubmit, onCancel, isSaving = false, isLoading = false, error, onDirtyChange, labels, className, }) {
49
+ const l = { ...DEFAULT_LABELS, ...labels };
50
+ const uid = useId();
51
+ const ids = {
52
+ first: `${uid}-first`,
53
+ last: `${uid}-last`,
54
+ phone: `${uid}-phone`,
55
+ email: `${uid}-email`,
56
+ emailHelp: `${uid}-email-help`,
57
+ };
58
+ const serverForm = useMemo(() => toState(serverValues, showPhone), [serverValues.firstName, serverValues.lastName, serverValues.phone, showPhone]);
59
+ const serverRevision = JSON.stringify({ id: accountId, context: contextRevision ?? null });
60
+ const [form, setForm] = useState(serverForm);
61
+ const [baseline, setBaseline] = useState(serverForm);
62
+ const [serverChanged, setServerChanged] = useState(false);
63
+ const [pending, setPending] = useState(false);
64
+ const observedRef = useRef(null);
65
+ // The values of the last successful save. A server refetch that returns exactly
66
+ // these is our own save arriving, not a change made elsewhere.
67
+ const lastSavedRef = useRef(null);
68
+ const isDirty = !sameState(form, baseline);
69
+ const dirtyCallbackRef = useRef(onDirtyChange);
70
+ dirtyCallbackRef.current = onDirtyChange;
71
+ const lastDirtyRef = useRef(false);
72
+ useEffect(() => {
73
+ if (lastDirtyRef.current === isDirty)
74
+ return;
75
+ lastDirtyRef.current = isDirty;
76
+ dirtyCallbackRef.current?.(isDirty);
77
+ }, [isDirty]);
78
+ // Reconcile with the server. Adopt on first sight, on an account change, and when a
79
+ // CLEAN form sees the server move. Never overwrite edits: a dirty form keeps them and
80
+ // warns. When the server is unchanged nothing happens, so stale `serverValues` after a
81
+ // save never overwrite the saved baseline (the baseline is the submitted values until
82
+ // the server actually changes).
83
+ useEffect(() => {
84
+ const observed = observedRef.current;
85
+ const context = serverRevision;
86
+ const identityChanged = observed !== null && observed.id !== accountId;
87
+ const serverMoved = observed !== null && (observed.context !== context || !sameState(observed.form, serverForm));
88
+ observedRef.current = { id: accountId, context, form: serverForm };
89
+ if (observed === null || identityChanged) {
90
+ lastSavedRef.current = null;
91
+ setForm(serverForm);
92
+ setBaseline(serverForm);
93
+ setServerChanged(false);
94
+ return;
95
+ }
96
+ if (!serverMoved) {
97
+ // Back to clean after a "changed elsewhere" warning: adopt the latest, as producer does.
98
+ if (serverChanged && !isDirty) {
99
+ setForm(serverForm);
100
+ setBaseline(serverForm);
101
+ setServerChanged(false);
102
+ }
103
+ return;
104
+ }
105
+ const ownSave = lastSavedRef.current !== null && sameState(lastSavedRef.current, serverForm);
106
+ if (ownSave) {
107
+ lastSavedRef.current = null;
108
+ setBaseline(serverForm);
109
+ return;
110
+ }
111
+ if (isDirty) {
112
+ setServerChanged(true);
113
+ }
114
+ else {
115
+ setForm(serverForm);
116
+ setBaseline(serverForm);
117
+ setServerChanged(false);
118
+ }
119
+ }, [accountId, isDirty, serverChanged, serverForm, serverRevision]);
120
+ const reloadLatest = () => {
121
+ lastSavedRef.current = null;
122
+ setForm(serverForm);
123
+ setBaseline(serverForm);
124
+ setServerChanged(false);
125
+ };
126
+ const busy = pending || isSaving;
127
+ const namesPresent = form.firstName.trim() !== "" && form.lastName.trim() !== "";
128
+ const canSave = isDirty && namesPresent && !isLoading && !busy;
129
+ const handleSubmit = async (event) => {
130
+ event.preventDefault();
131
+ if (!canSave)
132
+ return;
133
+ const snapshot = form;
134
+ const saved = {
135
+ firstName: snapshot.firstName.trim(),
136
+ lastName: snapshot.lastName.trim(),
137
+ phone: showPhone ? snapshot.phone.trim() : "",
138
+ };
139
+ const payload = {
140
+ name: `${saved.firstName} ${saved.lastName}`,
141
+ ...(showPhone ? { phone: saved.phone } : {}),
142
+ };
143
+ setPending(true);
144
+ try {
145
+ await onSubmit(payload);
146
+ }
147
+ catch {
148
+ // The consumer reports the failure; the edits stay in place.
149
+ return;
150
+ }
151
+ finally {
152
+ setPending(false);
153
+ }
154
+ // The submitted values are the new baseline. A field edited while the save was in
155
+ // flight keeps what the user typed; an untouched one is normalised to what was sent.
156
+ lastSavedRef.current = saved;
157
+ setBaseline(saved);
158
+ setForm((current) => ({
159
+ firstName: current.firstName === snapshot.firstName ? saved.firstName : current.firstName,
160
+ lastName: current.lastName === snapshot.lastName ? saved.lastName : current.lastName,
161
+ phone: current.phone === snapshot.phone ? saved.phone : current.phone,
162
+ }));
163
+ };
164
+ const labelClass = "text-sm font-medium text-foreground";
165
+ const safeOrg = safeOrganisationName(organisationName);
166
+ return (_jsxs("form", { noValidate: true, onSubmit: handleSubmit, className: ["mx-auto flex max-w-3xl flex-col gap-6", className].filter(Boolean).join(" "), children: [_jsxs("header", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { plain: true, onClick: onCancel, className: "p-2", "aria-label": l.back, children: _jsx(ArrowLeftIcon, { className: "size-5", "aria-hidden": "true" }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold text-foreground", children: l.title }), _jsx("p", { className: "mt-1 text-muted-foreground", children: l.subtitle })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { outline: true, onClick: onCancel, children: l.cancel }), _jsxs(Button, { type: "submit", color: "brand", disabled: !canSave, children: [_jsx(DownloadIcon, { className: "size-4", "aria-hidden": "true" }), l.save] })] })] }), _jsxs(Card, { className: "border-border/60", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { role: "heading", "aria-level": 2, className: "text-xl text-foreground", children: l.personalInformation }), _jsx(CardDescription, { children: l.personalInformationDescription })] }), _jsxs(CardContent, { className: "flex flex-col gap-4", children: [serverChanged ? (_jsxs("div", { role: "status", className: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-[var(--tone-warning-border)] bg-[var(--tone-warning-soft)] px-3 py-2 text-sm/6 text-[var(--tone-warning-fg)]", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx(TriangleAlertIcon, { "aria-hidden": "true", className: "size-5 shrink-0" }), l.changedElsewhere] }), _jsx(Button, { outline: true, onClick: reloadLatest, disabled: busy, children: l.reloadLatest })] })) : null, error ? (_jsx("div", { role: "alert", className: "rounded-lg border border-[var(--tone-danger-border)] bg-[var(--tone-danger-soft)] px-3 py-2 text-sm/6 text-[var(--tone-danger-fg)]", children: error })) : null, _jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: ids.first, className: labelClass, children: l.firstName }), _jsx(Input, { id: ids.first, value: form.firstName, onChange: (e) => setForm((c) => ({ ...c, firstName: e.target.value })), autoComplete: "given-name", required: true })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: ids.last, className: labelClass, children: l.lastName }), _jsx(Input, { id: ids.last, value: form.lastName, onChange: (e) => setForm((c) => ({ ...c, lastName: e.target.value })), autoComplete: "family-name", required: true })] })] }), showPhone ? (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: ids.phone, className: labelClass, children: l.phone }), _jsx(Input, { id: ids.phone, type: "tel", value: form.phone, onChange: (e) => setForm((c) => ({ ...c, phone: e.target.value })), autoComplete: "tel" })] })) : null, _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: ids.email, className: labelClass, children: l.email }), _jsx(Input, { id: ids.email, type: "email", value: email ?? "", disabled: true, readOnly: true, "aria-describedby": ids.emailHelp }), _jsx("p", { id: ids.emailHelp, className: "text-xs text-muted-foreground", children: l.emailReadonly })] })] })] }), _jsxs(Card, { className: "border-border/60", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { role: "heading", "aria-level": 2, className: "text-xl text-foreground", children: l.accountContext }), _jsx(CardDescription, { children: l.accountContextDescription })] }), _jsxs(CardContent, { className: "flex flex-col gap-3 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(UserIcon, { className: "size-4 text-primary", "aria-hidden": "true" }), l.role, _jsx(Badge, { color: "zinc", className: "ml-1 bg-primary/10 text-primary", children: formatRoleLabel(role, l.unknownRole) })] }), _jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(Building2Icon, { className: "size-4 text-primary", "aria-hidden": "true" }), l.organisation, " ", _jsx("span", { className: "font-medium text-foreground", children: safeOrg ?? l.notSet })] }), _jsxs("div", { className: "flex items-center gap-2 text-muted-foreground", children: [_jsx(MailIcon, { className: "size-4 text-primary", "aria-hidden": "true" }), l.accountId, " ", _jsx("span", { className: "font-mono text-foreground", children: present(accountId) ?? "-" })] })] })] })] }));
167
+ }
168
+ //# sourceMappingURL=account-edit-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-edit-form.js","sourceRoot":"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C,iCAAiC,YAC5D,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,GAC/B,IACJ,EACN,eAAK,SAAS,EAAC,+CAA+C,aAC5D,KAAC,aAAa,IAAC,SAAS,EAAC,qBAAqB,iBAAa,MAAM,GAAG,EACnE,CAAC,CAAC,YAAY,EAAE,GAAG,EACpB,eAAM,SAAS,EAAC,6BAA6B,YAAE,OAAO,IAAI,CAAC,CAAC,MAAM,GAAQ,IACtE,EACN,eAAK,SAAS,EAAC,+CAA+C,aAC5D,KAAC,QAAQ,IAAC,SAAS,EAAC,qBAAqB,iBAAa,MAAM,GAAG,EAC9D,CAAC,CAAC,SAAS,EAAE,GAAG,EACjB,eAAM,SAAS,EAAC,2BAA2B,YAAE,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,GAAQ,IAC1E,IACM,IACT,IACF,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ export type AccountTheme = "light" | "dark" | "system";
3
+ export interface AccountPreferencesLabels {
4
+ title?: string;
5
+ description?: string;
6
+ theme?: string;
7
+ language?: string;
8
+ light?: string;
9
+ dark?: string;
10
+ system?: string;
11
+ }
12
+ export interface AccountPreferencesCardProps {
13
+ /** The current theme, or `undefined` before the consumer's theme provider has mounted. */
14
+ theme?: string | null;
15
+ onThemeChange: (theme: AccountTheme) => void;
16
+ /** The consumer's LanguageSwitcher. The "Language" group is omitted when absent. */
17
+ languageSlot?: ReactNode;
18
+ labels?: AccountPreferencesLabels;
19
+ className?: string;
20
+ }
21
+ /**
22
+ * The "Preferences" card (CEL-2126): producer's theme buttons as a radio group
23
+ * (arrow keys move and select, roving tabindex) plus a slot for the consumer's
24
+ * language switcher. The consumer owns theme state.
25
+ */
26
+ export declare function AccountPreferencesCard({ theme, onThemeChange, languageSlot, labels, className, }: AccountPreferencesCardProps): import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=account-preferences-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-preferences-card.d.ts","sourceRoot":"","sources":["../../src/profile/account-preferences-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,oFAAoF;IACpF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,aAAa,EACb,YAAY,EACZ,MAAM,EACN,SAAS,GACV,EAAE,2BAA2B,2CAyE7B"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useRef } from "react";
3
+ import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";
4
+ import { cn } from "../lib/utils.js";
5
+ import { ProfileCard } from "./profile.js";
6
+ const DEFAULT_LABELS = {
7
+ title: "Preferences",
8
+ description: "Language and display settings.",
9
+ theme: "Theme",
10
+ language: "Language",
11
+ light: "Light",
12
+ dark: "Dark",
13
+ system: "System",
14
+ };
15
+ const THEMES = [
16
+ { value: "light", key: "light", Icon: SunIcon },
17
+ { value: "dark", key: "dark", Icon: MoonIcon },
18
+ { value: "system", key: "system", Icon: MonitorIcon },
19
+ ];
20
+ /**
21
+ * The "Preferences" card (CEL-2126): producer's theme buttons as a radio group
22
+ * (arrow keys move and select, roving tabindex) plus a slot for the consumer's
23
+ * language switcher. The consumer owns theme state.
24
+ */
25
+ export function AccountPreferencesCard({ theme, onThemeChange, languageSlot, labels, className, }) {
26
+ const l = { ...DEFAULT_LABELS, ...labels };
27
+ const labelId = useId();
28
+ const refs = useRef([]);
29
+ const selectedIndex = THEMES.findIndex((t) => t.value === theme);
30
+ const tabStop = selectedIndex === -1 ? 0 : selectedIndex;
31
+ const onKeyDown = (event, index) => {
32
+ const delta = event.key === "ArrowRight" || event.key === "ArrowDown"
33
+ ? 1
34
+ : event.key === "ArrowLeft" || event.key === "ArrowUp"
35
+ ? -1
36
+ : 0;
37
+ if (delta === 0)
38
+ return;
39
+ event.preventDefault();
40
+ const next = (index + delta + THEMES.length) % THEMES.length;
41
+ onThemeChange(THEMES[next].value);
42
+ refs.current[next]?.focus();
43
+ };
44
+ return (_jsx(ProfileCard, { title: l.title, description: l.description, className: className, children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { children: [_jsx("p", { id: labelId, className: "mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: l.theme }), _jsx("div", { role: "radiogroup", "aria-labelledby": labelId, className: "grid grid-cols-3 gap-2", children: THEMES.map(({ value, key, Icon }, index) => {
45
+ const selected = theme === value;
46
+ return (_jsxs("button", { ref: (node) => {
47
+ refs.current[index] = node;
48
+ }, type: "button", role: "radio", "aria-checked": selected, tabIndex: index === tabStop ? 0 : -1, onClick: () => onThemeChange(value), onKeyDown: (event) => onKeyDown(event, index), className: cn("flex min-w-0 flex-col items-center gap-2 rounded-2xl border px-3 py-4 text-sm font-medium transition-colors", "outline-offset-2 focus-visible:outline-2 focus-visible:outline-ring", selected
49
+ ? "border-primary/40 bg-primary/10 text-primary"
50
+ : "border-border bg-card text-muted-foreground hover:border-primary/20 hover:bg-accent hover:text-foreground"), children: [_jsx(Icon, { className: "size-5", "aria-hidden": "true" }), l[key]] }, value));
51
+ }) })] }), languageSlot ? (_jsxs("div", { children: [_jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: l.language }), languageSlot] })) : null] }) }));
52
+ }
53
+ //# sourceMappingURL=account-preferences-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-preferences-card.js","sourceRoot":"","sources":["../../src/profile/account-preferences-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAsC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAwBxC,MAAM,cAAc,GAAuC;IACzD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IAC/C,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9C,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE;CAC7C,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACrC,KAAK,EACL,aAAa,EACb,YAAY,EACZ,MAAM,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-details.js";
12
12
  export * from "./certifications-card.js";
13
13
  export * from "./profile-cta.js";
14
14
  export { PortfolioCoverPlaceholder, type PortfolioCoverPlaceholderProps, } from "../components/portfolio-cover-placeholder.js";
15
+ export { UserInformationCard, deriveInitials } from "./user-information-card.js";
16
+ export type { UserInformationCardLabels, UserInformationCardProps } from "./user-information-card.js";
17
+ export { AccountEditForm } from "./account-edit-form.js";
18
+ export type { AccountEditFormLabels, AccountEditFormProps, AccountEditSubmit, AccountEditValues, } from "./account-edit-form.js";
19
+ export { AccountPreferencesCard } from "./account-preferences-card.js";
20
+ export type { AccountPreferencesCardProps, AccountPreferencesLabels, AccountTheme, } from "./account-preferences-card.js";
21
+ export { AccountActionsCard } from "./account-actions-card.js";
22
+ export type { AccountActionsCardProps, AccountActionsLabels } from "./account-actions-card.js";
23
+ export { SubscriptionCard } from "./subscription-card.js";
24
+ export type { AccountSubscription, SubscriptionCardLabels, SubscriptionCardProps, } from "./subscription-card.js";
15
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
@@ -12,4 +12,10 @@ export * from "./business-details.js";
12
12
  export * from "./certifications-card.js";
13
13
  export * from "./profile-cta.js";
14
14
  export { PortfolioCoverPlaceholder, } from "../components/portfolio-cover-placeholder.js";
15
+ // CEL-2126 phase 2b: shared personal-account profile components.
16
+ export { UserInformationCard, deriveInitials } from "./user-information-card.js";
17
+ export { AccountEditForm } from "./account-edit-form.js";
18
+ export { AccountPreferencesCard } from "./account-preferences-card.js";
19
+ export { AccountActionsCard } from "./account-actions-card.js";
20
+ export { SubscriptionCard } from "./subscription-card.js";
15
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AAEnD,iEAAiE;AACjE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The account's plan. Distinct from `SubscriptionInfo` in `ui/org`, which is
3
+ * the seat-count shape for team management.
4
+ */
5
+ export interface AccountSubscription {
6
+ /** Tier key, e.g. "free" or "standard". Shown capitalised. */
7
+ tier?: string | null;
8
+ /** Plan display name. */
9
+ planName?: string | null;
10
+ /** Status text, already translated by the consumer (e.g. "Active"). */
11
+ status?: string | null;
12
+ /** Entitlement names, already translated by the consumer. */
13
+ entitlements?: readonly string[];
14
+ /** ISO timestamp of the last plan change. */
15
+ updatedAt?: string | null;
16
+ }
17
+ export interface SubscriptionCardLabels {
18
+ title?: string;
19
+ description?: string;
20
+ tier?: string;
21
+ plan?: string;
22
+ status?: string;
23
+ entitlements?: string;
24
+ lastUpdated?: string;
25
+ noEntitlements?: string;
26
+ notUpdated?: string;
27
+ loadFailed?: string;
28
+ retry?: string;
29
+ empty?: string;
30
+ /** Announced (visually hidden) while loading. */
31
+ loading?: string;
32
+ }
33
+ export interface SubscriptionCardProps {
34
+ subscription?: AccountSubscription | null;
35
+ isLoading?: boolean;
36
+ isError?: boolean;
37
+ /** Renders the "Try again" button in the error state. */
38
+ onRetry?: () => void;
39
+ /** BCP 47 locale for the "last updated" date. Defaults to the runtime locale. */
40
+ locale?: string;
41
+ labels?: SubscriptionCardLabels;
42
+ className?: string;
43
+ }
44
+ /**
45
+ * Plan, status and entitlements card (CEL-2126). Ported from the importer's
46
+ * profile page. States: loading, error with retry, empty, and populated.
47
+ */
48
+ export declare function SubscriptionCard({ subscription, isLoading, isError, onRetry, locale, labels, className, }: SubscriptionCardProps): import("react/jsx-runtime").JSX.Element;
49
+ //# sourceMappingURL=subscription-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-card.d.ts","sourceRoot":"","sources":["../../src/profile/subscription-card.tsx"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,SAAiB,EACjB,OAAe,EACf,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,GACV,EAAE,qBAAqB,2CAkGvB"}
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ActivityIcon, BadgeCheckIcon, KeyRoundIcon, RefreshCwIcon, ShieldCheckIcon, UserRoundIcon, } from "lucide-react";
3
+ import { Badge } from "../components/badge.js";
4
+ import { Button } from "../components/button.js";
5
+ import { EmptyState } from "../components/empty-state.js";
6
+ import { Skeleton } from "../components/skeleton.js";
7
+ import { ProfileCard, ProfileDetailRow } from "./profile.js";
8
+ const DEFAULT_LABELS = {
9
+ title: "Subscription and entitlements",
10
+ description: "Your current plan.",
11
+ tier: "Tier",
12
+ plan: "Plan",
13
+ status: "Status",
14
+ entitlements: "Entitlements",
15
+ lastUpdated: "Last updated",
16
+ noEntitlements: "No entitlements",
17
+ notUpdated: "Not yet updated",
18
+ loadFailed: "Subscription details could not be loaded.",
19
+ retry: "Try again",
20
+ empty: "No active subscription.",
21
+ loading: "Loading subscription details",
22
+ };
23
+ /** The importer card's detail-row layout: stacked on mobile, 1fr/2fr from `sm`. */
24
+ const DETAIL_ROW_CLASS = "grid-cols-1 gap-1.5 sm:grid-cols-[1fr_2fr] sm:gap-3";
25
+ function formatDate(value, locale) {
26
+ const date = new Date(value);
27
+ if (Number.isNaN(date.valueOf()))
28
+ return value;
29
+ return new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short" }).format(date);
30
+ }
31
+ /**
32
+ * Plan, status and entitlements card (CEL-2126). Ported from the importer's
33
+ * profile page. States: loading, error with retry, empty, and populated.
34
+ */
35
+ export function SubscriptionCard({ subscription, isLoading = false, isError = false, onRetry, locale, labels, className, }) {
36
+ const l = { ...DEFAULT_LABELS, ...labels };
37
+ let body;
38
+ if (isLoading) {
39
+ body = (_jsxs("div", { role: "status", "aria-busy": "true", className: "divide-y divide-border/50 border-y border-border/50", children: [_jsx("span", { className: "sr-only", children: l.loading }), _jsx(Skeleton, { className: "my-3 h-10 w-full" }), _jsx(Skeleton, { className: "my-3 h-10 w-full" })] }));
40
+ }
41
+ else if (isError) {
42
+ body = (_jsxs("div", { role: "alert", className: "flex flex-wrap items-center justify-between gap-3 border-y border-border/50 py-5", children: [_jsx("p", { className: "text-sm/6 text-foreground", children: l.loadFailed }), onRetry ? (_jsxs(Button, { outline: true, className: "min-h-11", onClick: onRetry, children: [_jsx(RefreshCwIcon, { className: "size-4", "aria-hidden": "true" }), l.retry] })) : null] }));
43
+ }
44
+ else if (!subscription) {
45
+ body = (_jsx(EmptyState, { className: "border-y border-border/50 py-10", icon: _jsx(ShieldCheckIcon, { className: "size-5" }), headline: l.empty }));
46
+ }
47
+ else {
48
+ const entitlements = subscription.entitlements ?? [];
49
+ body = (_jsxs("dl", { className: "divide-y divide-border/50 border-y border-border/50", children: [subscription.tier ? (_jsx(ProfileDetailRow, { className: DETAIL_ROW_CLASS, icon: _jsx(UserRoundIcon, { className: "size-4", "aria-hidden": "true" }), label: l.tier, value: _jsx("span", { className: "capitalize", children: subscription.tier }) })) : null, _jsx(ProfileDetailRow, { className: DETAIL_ROW_CLASS, icon: _jsx(ShieldCheckIcon, { className: "size-4", "aria-hidden": "true" }), label: l.plan, value: subscription.planName?.trim() || "-" }), subscription.status ? (_jsx(ProfileDetailRow, { className: DETAIL_ROW_CLASS, icon: _jsx(ActivityIcon, { className: "size-4", "aria-hidden": "true" }), label: l.status, value: _jsx(Badge, { color: "brand", children: subscription.status }) })) : null, _jsx(ProfileDetailRow, { className: DETAIL_ROW_CLASS, icon: _jsx(BadgeCheckIcon, { className: "size-4", "aria-hidden": "true" }), label: l.entitlements, value: entitlements.length > 0 ? (_jsx("ul", { className: "flex flex-wrap gap-1.5", children: entitlements.map((name, index) => (_jsx("li", { children: _jsx(Badge, { children: name }) }, `${index}-${name}`))) })) : (_jsx("span", { className: "text-muted-foreground", children: l.noEntitlements })) }), _jsx(ProfileDetailRow, { className: DETAIL_ROW_CLASS, icon: _jsx(KeyRoundIcon, { className: "size-4", "aria-hidden": "true" }), label: l.lastUpdated, value: subscription.updatedAt ? formatDate(subscription.updatedAt, locale) : l.notUpdated })] }));
50
+ }
51
+ return (_jsx(ProfileCard, { title: l.title, description: l.description, className: className, children: body }));
52
+ }
53
+ //# sourceMappingURL=subscription-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-card.js","sourceRoot":"","sources":["../../src/profile/subscription-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAgD1D,MAAM,cAAc,GAAqC;IACvD,KAAK,EAAE,+BAA+B;IACtC,WAAW,EAAE,oBAAoB;IACjC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,cAAc;IAC3B,cAAc,EAAE,iBAAiB;IACjC,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,2CAA2C;IACvD,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,yBAAyB;IAChC,OAAO,EAAE,8BAA8B;CACxC,CAAC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role?: string;
5
+ organisation?: string;
6
+ accountId?: string;
7
+ phone?: string;
8
+ editAccount?: string;
9
+ /** Shown for an empty organisation, phone or role. */
10
+ notSet?: string;
11
+ /** Shown under the name when there is no email. */
12
+ noEmail?: string;
13
+ /** Fallback display name when `name` is empty. */
14
+ unnamedUser?: string;
15
+ /** Shown in place of the name while `isLoading`. */
16
+ loading?: string;
17
+ /** Role badge text when there is no role. */
18
+ unknownRole?: string;
19
+ }
20
+ export interface UserInformationCardProps {
21
+ /** Display name. Falls back to `labels.unnamedUser`. */
22
+ name?: string | null;
23
+ email?: string | null;
24
+ avatarUrl?: string | null;
25
+ /** Avatar fallback initials. Derived from `name` when omitted. */
26
+ initials?: string;
27
+ /** Role text for the badge. The first letter is capitalised, as producer does. An empty role shows "Unknown". */
28
+ role?: string | null;
29
+ /** The organisation NAME, never an id. A UUID-looking value logs a dev-only warning. */
30
+ organisationName?: string | null;
31
+ accountId?: string | null;
32
+ /** Shown only when provided (importer shows it, producer does not have it). */
33
+ phone?: string | null;
34
+ /** Renders the "Edit Account" button in the card footer when provided. */
35
+ onEdit?: () => void;
36
+ /** Shows skeletons for the name and email while the user loads. */
37
+ isLoading?: boolean;
38
+ labels?: UserInformationCardLabels;
39
+ className?: string;
40
+ }
41
+ /** Initials from a display name: first letters of the first two words. */
42
+ export declare function deriveInitials(name: string | null | undefined): string;
43
+ /** @internal Trimmed text or null. */
44
+ export declare function present(value: string | null | undefined): string | null;
45
+ /** @internal The trimmed organisation name or null. Warns in development when it looks like an id. */
46
+ export declare function safeOrganisationName(value: string | null | undefined): string | null;
47
+ /** @internal Producer's formatRole: first letter capitalised. */
48
+ export declare function formatRoleLabel(role: string | null | undefined, unknown: string): string;
49
+ /**
50
+ * The "User Information" card of the personal profile page (CEL-2126).
51
+ * Producer's card: avatar, name, email, role badge, organisation name,
52
+ * account id, an optional phone and an optional Edit Account action.
53
+ */
54
+ export declare function UserInformationCard({ name, email, avatarUrl, initials, role, organisationName, accountId, phone, onEdit, isLoading, labels, className, }: UserInformationCardProps): import("react/jsx-runtime").JSX.Element;
55
+ //# sourceMappingURL=user-information-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-information-card.d.ts","sourceRoot":"","sources":["../../src/profile/user-information-card.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,0EAA0E;IAC1E,MAAM,CAAC,EAAE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