@cellarnode/ui 0.184.0 → 0.185.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.
- package/dist/components/journey-card.d.ts.map +1 -1
- package/dist/components/journey-card.js +2 -1
- package/dist/components/journey-card.js.map +1 -1
- package/dist/components/sortable-card-grip.d.ts +23 -0
- package/dist/components/sortable-card-grip.d.ts.map +1 -0
- package/dist/components/sortable-card-grip.js +13 -0
- package/dist/components/sortable-card-grip.js.map +1 -0
- package/dist/components/sortable-card-shell.d.ts +29 -19
- package/dist/components/sortable-card-shell.d.ts.map +1 -1
- package/dist/components/sortable-card-shell.js +49 -27
- package/dist/components/sortable-card-shell.js.map +1 -1
- package/dist/profile/account-actions-card.d.ts +28 -0
- package/dist/profile/account-actions-card.d.ts.map +1 -0
- package/dist/profile/account-actions-card.js +37 -0
- package/dist/profile/account-actions-card.js.map +1 -0
- package/dist/profile/account-edit-form.d.ts +84 -0
- package/dist/profile/account-edit-form.d.ts.map +1 -0
- package/dist/profile/account-edit-form.js +168 -0
- package/dist/profile/account-edit-form.js.map +1 -0
- package/dist/profile/account-preferences-card.d.ts +27 -0
- package/dist/profile/account-preferences-card.d.ts.map +1 -0
- package/dist/profile/account-preferences-card.js +53 -0
- package/dist/profile/account-preferences-card.js.map +1 -0
- package/dist/profile/index.d.ts +10 -0
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +6 -0
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/subscription-card.d.ts +49 -0
- package/dist/profile/subscription-card.d.ts.map +1 -0
- package/dist/profile/subscription-card.js +53 -0
- package/dist/profile/subscription-card.js.map +1 -0
- package/dist/profile/user-information-card.d.ts +55 -0
- package/dist/profile/user-information-card.d.ts.map +1 -0
- package/dist/profile/user-information-card.js +63 -0
- package/dist/profile/user-information-card.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-card.d.ts","sourceRoot":"","sources":["../../src/components/journey-card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"journey-card.d.ts","sourceRoot":"","sources":["../../src/components/journey-card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI9D,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAErE,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpG;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,8HAA8H;IAC9H,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qCAAqC;IACrC,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,MAAM,WAAW,gBAAgB;IAC/B,iGAAiG;IACjG,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxD,2FAA2F;IAC3F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8FAA8F;I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AgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,aAAyB,EACzB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,OAAmB,EACnB,OAAe,EACf,YAAoB,EACpB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,aAAa,GACd,EAAE,gBAAgB,2CAwTlB"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { motion } from "motion/react";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { GripVertical } from "lucide-react";
|
|
5
|
+
import { SortableCardGrip } from "./sortable-card-grip.js";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { AvatarStack } from "./avatar-stack.js";
|
|
7
8
|
import { SortableCardContext } from "./sortable-card-context.js";
|
|
@@ -40,7 +41,7 @@ export function JourneyCard({ productImage, productInitials, title, subtitle, mo
|
|
|
40
41
|
// When the grip is shown, widen the left padding into a dedicated
|
|
41
42
|
// gutter that holds it; twMerge overrides the left side of p-3.5.
|
|
42
43
|
renderGrip && "pl-7", onClick && "cursor-pointer", className), children: [onClick && (_jsx("button", { type: "button", "data-card-main": true, onClick: onClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : `${openLabelId} ${titleId}`, className: "absolute inset-0 z-[1] cursor-pointer rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70" })), (onClick && !ariaLabel) || (renderGrip && handleRef) ? (_jsxs("span", { hidden: true, children: [onClick && !ariaLabel && _jsx("span", { id: openLabelId, children: openLabel }), renderGrip && handleRef && _jsx("span", { id: reorderLabelId, children: reorderLabel })] })) : null, renderGrip &&
|
|
43
|
-
(handleRef ? (_jsx(
|
|
44
|
+
(handleRef ? (_jsx(SortableCardGrip, { handleRef: handleRef, "aria-labelledby": `${reorderLabelId} ${titleId}` })) : (_jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-y-0 left-0 z-10 flex w-7 items-center justify-center text-[var(--muted-foreground)] opacity-0 transition-opacity duration-[var(--duration-standard)] ease-[var(--ease-emphasized)] group-hover:opacity-100 pointer-coarse:opacity-30", children: _jsx(GripVertical, { className: "size-4" }) }))), _jsxs("div", { className: "flex items-start gap-[10px]", children: [productImage ? (_jsx("img", { src: productImage.url, alt: productImage.altText ?? "", width: 48, height: 48, loading: "lazy", "data-thumb": "true", className: cn("size-12 shrink-0 rounded-lg object-cover shadow-[0_2px_8px_-2px_oklch(0_0_0/0.15),inset_0_1px_0_oklch(1_0_0/0.2)]", source === "match" &&
|
|
44
45
|
"ring-4 ring-[color-mix(in_oklab,var(--primary)_18%,transparent)]") })) : showInitials ? (_jsx("div", { "data-thumb": "true", className: cn("flex size-12 shrink-0 items-center justify-center rounded-lg text-sm font-bold tracking-tight text-white shadow-[0_2px_8px_-2px_oklch(0_0_0/0.15),inset_0_1px_0_oklch(1_0_0/0.2)]", source === "match" &&
|
|
45
46
|
"ring-4 ring-[color-mix(in_oklab,var(--primary)_18%,transparent)]"), style: {
|
|
46
47
|
background: "linear-gradient(135deg, color-mix(in oklab, var(--primary) 60%, white) 0%, color-mix(in oklab, var(--accent-secondary) 60%, white) 100%)",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-card.js","sourceRoot":"","sources":["../../src/components/journey-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAmB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAA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AAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,YAEtD,KAAK,GACK,CACd,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SortableCardGrip — the real grip `<button>` that is the dnd-kit keyboard
|
|
3
|
+
* handle of a sortable card (CEL-2173, CEL-2179).
|
|
4
|
+
*
|
|
5
|
+
* Shared by `JourneyCard` (which mounts it itself, in its own left gutter) and
|
|
6
|
+
* `SortableCardShell` (which mounts it as a fallback when its child mounts no
|
|
7
|
+
* handle), so both look and focus identically. Leaf module: imports no dnd-kit.
|
|
8
|
+
*/
|
|
9
|
+
declare const HOVER: {
|
|
10
|
+
readonly card: "group-hover:opacity-100";
|
|
11
|
+
readonly shell: "group-hover/sortable-card:opacity-100";
|
|
12
|
+
};
|
|
13
|
+
export interface SortableCardGripProps {
|
|
14
|
+
/** dnd-kit activator ref (`SortableCardContext.handleRef`). */
|
|
15
|
+
handleRef: (element: Element | null) => void;
|
|
16
|
+
/** Which `group` reveals the grip on hover. */
|
|
17
|
+
scope?: keyof typeof HOVER;
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
"aria-labelledby"?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function SortableCardGrip({ handleRef, scope, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, }: SortableCardGripProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=sortable-card-grip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-card-grip.d.ts","sourceRoot":"","sources":["../../src/components/sortable-card-grip.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,QAAA,MAAM,KAAK;;;CAGD,CAAC;AAEX,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAc,EACd,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GAClC,EAAE,qBAAqB,2CAavB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GripVertical } from "lucide-react";
|
|
3
|
+
const BASE = "absolute inset-y-0 left-0 z-10 flex w-7 cursor-grab items-center justify-center rounded-l-xl text-[var(--muted-foreground)] opacity-0 transition-opacity duration-[var(--duration-standard)] ease-[var(--ease-emphasized)] focus-visible:opacity-100 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring/70 pointer-coarse:w-9 pointer-coarse:opacity-30 pointer-coarse:focus-visible:opacity-100";
|
|
4
|
+
// Static strings so Tailwind can see them. "card" = the card's own unnamed
|
|
5
|
+
// `group`; "shell" = the `group/sortable-card` on the SortableCardShell wrapper.
|
|
6
|
+
const HOVER = {
|
|
7
|
+
card: "group-hover:opacity-100",
|
|
8
|
+
shell: "group-hover/sortable-card:opacity-100",
|
|
9
|
+
};
|
|
10
|
+
export function SortableCardGrip({ handleRef, scope = "card", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, }) {
|
|
11
|
+
return (_jsx("button", { type: "button", ref: handleRef, "data-drag-handle": true, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className: `${BASE} ${HOVER[scope]}`, children: _jsx(GripVertical, { "aria-hidden": "true", className: "size-4" }) }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=sortable-card-grip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortable-card-grip.js","sourceRoot":"","sources":["../../src/components/sortable-card-grip.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,IAAI,GACR,kaAAka,CAAC;AAEra,2EAA2E;AAC3E,iFAAiF;AACjF,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,uCAAuC;CACtC,CAAC;AAWX,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,GAAG,MAAM,EACd,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,GACX;IACtB,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,SAAmC,0CAE5B,SAAS,qBACJ,cAAc,EAC/B,SAAS,EAAE,GAAG,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,YAEpC,KAAC,YAAY,mBAAa,MAAM,EAAC,SAAS,EAAC,QAAQ,GAAG,GAC/C,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -22,15 +22,17 @@
|
|
|
22
22
|
* mounts it on a real grip `<button>` (JourneyCard does, CEL-2173) makes that
|
|
23
23
|
* button the only keyboard drag handle, and the wrapper stays a plain,
|
|
24
24
|
* non-focusable container (no nested interactives). Pointer drag still starts
|
|
25
|
-
* from anywhere on the card. A card that mounts no handle
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* from anywhere on the card. A card that mounts no handle (custom children, or
|
|
26
|
+
* `JourneyCard showGrip={false}`) gets a real grip `<button>` rendered by the
|
|
27
|
+
* shell itself (CEL-2179), so the wrapper is NEVER the activator and never a
|
|
28
|
+
* button. Announcement copy is overridable at the board level (see `KanbanDndBoard`).
|
|
28
29
|
* See CEL-921.
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Cards that want their own grip position (e.g. JourneyCard) read the
|
|
32
|
+
* exported `SortableCardContext` and mount `handleRef` on their own grip; the
|
|
33
|
+
* shell then renders none. Otherwise the shell renders the grip at the
|
|
34
|
+
* wrapper's left edge and reserves a 28px (`pl-7`) gutter for it, so it never
|
|
35
|
+
* overlaps content; when the child mounts its own grip, no gutter is added.
|
|
34
36
|
*
|
|
35
37
|
* Requires the optional peer dependencies `@dnd-kit/react` and `@dnd-kit/dom`.
|
|
36
38
|
* Not exported from the main barrel — import directly from
|
|
@@ -46,11 +48,12 @@ export type { SortableCardContextValue };
|
|
|
46
48
|
* adding the `data-no-drag` attribute.
|
|
47
49
|
*
|
|
48
50
|
* Notable exclusion: `[role='button']` and `[role='link']` are NOT in
|
|
49
|
-
* this list.
|
|
50
|
-
* matched those, `closest()` would resolve to
|
|
51
|
-
* `@dnd-kit/dom`'s own activation
|
|
52
|
-
* already prevent tap-clicks from
|
|
53
|
-
* these roles is safe.
|
|
51
|
+
* this list. A card root may itself carry `role='button'` (custom children).
|
|
52
|
+
* If we matched those, `closest()` would resolve to that card root and drag
|
|
53
|
+
* would never activate from the card body. `@dnd-kit/dom`'s own activation
|
|
54
|
+
* constraints (5px distance, 200ms delay) already prevent tap-clicks from
|
|
55
|
+
* starting accidental drags, so dropping these roles is safe. (The shell
|
|
56
|
+
* wrapper itself is never a button: it renders a real grip button, CEL-2179.)
|
|
54
57
|
*
|
|
55
58
|
* Exported so consumers can extend or reuse it in custom sensor configs.
|
|
56
59
|
*/
|
|
@@ -73,21 +76,28 @@ interface SortableCardShellCommonProps {
|
|
|
73
76
|
/** Extra classes for the wrapper element. */
|
|
74
77
|
className?: string;
|
|
75
78
|
/**
|
|
76
|
-
* @deprecated The shell
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
+
* @deprecated No-op. The shell's fallback grip (rendered only when the child
|
|
80
|
+
* mounts none, CEL-2179) is not customisable; cards such as `JourneyCard`
|
|
81
|
+
* render their own grip. Retained for backwards compatibility.
|
|
79
82
|
*/
|
|
80
83
|
gripClassName?: string;
|
|
81
84
|
/**
|
|
82
|
-
* @deprecated The shell
|
|
83
|
-
*
|
|
85
|
+
* @deprecated No-op. The shell always provides a real grip button (its own,
|
|
86
|
+
* or the child's); it cannot be hidden. Use `disabled` to remove dragging.
|
|
84
87
|
*/
|
|
85
88
|
hideGrip?: boolean;
|
|
86
89
|
/**
|
|
87
|
-
* @deprecated
|
|
88
|
-
*
|
|
90
|
+
* @deprecated No-op. Name the shell's fallback grip with `dragHandleLabel`
|
|
91
|
+
* and `dragHandlePrefix`.
|
|
89
92
|
*/
|
|
90
93
|
gripTitle?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Names the shell's own grip: "Reorder {dragHandleLabel}". Only used when the
|
|
96
|
+
* child mounts no grip. Pass the card's title. Defaults to "card".
|
|
97
|
+
*/
|
|
98
|
+
dragHandleLabel?: string;
|
|
99
|
+
/** Prefix of the shell grip's name (translatable). Default "Reorder". */
|
|
100
|
+
dragHandlePrefix?: string;
|
|
91
101
|
children: ReactNode;
|
|
92
102
|
}
|
|
93
103
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable-card-shell.d.ts","sourceRoot":"","sources":["../../src/components/sortable-card-shell.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sortable-card-shell.d.ts","sourceRoot":"","sources":["../../src/components/sortable-card-shell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAA0C,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAKzF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAM7F,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,wBAAwB,EAAE,CAAC;AAIzC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,8BAA8B,QAqBhC,CAAC;AA2BZ,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,WAAW,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
3
3
|
* SortableCardShell — whole-card drag wrapper.
|
|
4
4
|
*
|
|
@@ -23,24 +23,27 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
23
23
|
* mounts it on a real grip `<button>` (JourneyCard does, CEL-2173) makes that
|
|
24
24
|
* button the only keyboard drag handle, and the wrapper stays a plain,
|
|
25
25
|
* non-focusable container (no nested interactives). Pointer drag still starts
|
|
26
|
-
* from anywhere on the card. A card that mounts no handle
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* from anywhere on the card. A card that mounts no handle (custom children, or
|
|
27
|
+
* `JourneyCard showGrip={false}`) gets a real grip `<button>` rendered by the
|
|
28
|
+
* shell itself (CEL-2179), so the wrapper is NEVER the activator and never a
|
|
29
|
+
* button. Announcement copy is overridable at the board level (see `KanbanDndBoard`).
|
|
29
30
|
* See CEL-921.
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* Cards that want their own grip position (e.g. JourneyCard) read the
|
|
33
|
+
* exported `SortableCardContext` and mount `handleRef` on their own grip; the
|
|
34
|
+
* shell then renders none. Otherwise the shell renders the grip at the
|
|
35
|
+
* wrapper's left edge and reserves a 28px (`pl-7`) gutter for it, so it never
|
|
36
|
+
* overlaps content; when the child mounts its own grip, no gutter is added.
|
|
35
37
|
*
|
|
36
38
|
* Requires the optional peer dependencies `@dnd-kit/react` and `@dnd-kit/dom`.
|
|
37
39
|
* Not exported from the main barrel — import directly from
|
|
38
40
|
* `@cellarnode/ui/sortable-card-shell`.
|
|
39
41
|
*/
|
|
40
|
-
import { useMemo } from "react";
|
|
42
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
41
43
|
import { KeyboardSensor, PointerSensor } from "@dnd-kit/dom";
|
|
42
44
|
import { cn } from "../lib/utils.js";
|
|
43
45
|
import { useDraggableCard, useSortableCard } from "../hooks/use-kanban-dnd.js";
|
|
46
|
+
import { SortableCardGrip } from "./sortable-card-grip.js";
|
|
44
47
|
import { SortableCardContext } from "./sortable-card-context.js";
|
|
45
48
|
// Re-export for backwards compatibility: consumers that imported the
|
|
46
49
|
// context + type from `./sortable-card-shell` should keep working without
|
|
@@ -54,11 +57,12 @@ export { SortableCardContext };
|
|
|
54
57
|
* adding the `data-no-drag` attribute.
|
|
55
58
|
*
|
|
56
59
|
* Notable exclusion: `[role='button']` and `[role='link']` are NOT in
|
|
57
|
-
* this list.
|
|
58
|
-
* matched those, `closest()` would resolve to
|
|
59
|
-
* `@dnd-kit/dom`'s own activation
|
|
60
|
-
* already prevent tap-clicks from
|
|
61
|
-
* these roles is safe.
|
|
60
|
+
* this list. A card root may itself carry `role='button'` (custom children).
|
|
61
|
+
* If we matched those, `closest()` would resolve to that card root and drag
|
|
62
|
+
* would never activate from the card body. `@dnd-kit/dom`'s own activation
|
|
63
|
+
* constraints (5px distance, 200ms delay) already prevent tap-clicks from
|
|
64
|
+
* starting accidental drags, so dropping these roles is safe. (The shell
|
|
65
|
+
* wrapper itself is never a button: it renders a real grip button, CEL-2179.)
|
|
62
66
|
*
|
|
63
67
|
* Exported so consumers can extend or reuse it in custom sensor configs.
|
|
64
68
|
*/
|
|
@@ -122,7 +126,7 @@ function shouldPreventDragActivation(event, allowCardMain = false) {
|
|
|
122
126
|
* own drag affordance (e.g. a grip icon in `JourneyCard`).
|
|
123
127
|
*/
|
|
124
128
|
export function SortableCardShell(props) {
|
|
125
|
-
const { id, data, disabled, isShaking, className, children } = props;
|
|
129
|
+
const { id, data, disabled, isShaking, className, dragHandleLabel, dragHandlePrefix, children } = props;
|
|
126
130
|
// Per-draggable sensors: pointer (mouse/touch/pen) + keyboard, both sharing
|
|
127
131
|
// the interactive-element guard. Stable across renders — neither constructor
|
|
128
132
|
// depends on props.
|
|
@@ -143,13 +147,13 @@ export function SortableCardShell(props) {
|
|
|
143
147
|
}),
|
|
144
148
|
], []);
|
|
145
149
|
if (props.mode === "draggable") {
|
|
146
|
-
return (_jsx(DraggableShell, { id: id, data: data, disabled: disabled, isShaking: isShaking, className: className, sensors: sensors, children: children }));
|
|
150
|
+
return (_jsx(DraggableShell, { id: id, data: data, disabled: disabled, isShaking: isShaking, className: className, sensors: sensors, dragHandleLabel: dragHandleLabel, dragHandlePrefix: dragHandlePrefix, children: children }));
|
|
147
151
|
}
|
|
148
152
|
// Sortable mode (default). TS narrows `props` so `index` and `group`
|
|
149
153
|
// are guaranteed to be `number` + `string` — no casts needed.
|
|
150
|
-
return (_jsx(SortableShell, { id: id, index: props.index, group: props.group, data: data, disabled: disabled, isShaking: isShaking, className: className, sensors: sensors, children: children }));
|
|
154
|
+
return (_jsx(SortableShell, { id: id, index: props.index, group: props.group, data: data, disabled: disabled, isShaking: isShaking, className: className, sensors: sensors, dragHandleLabel: dragHandleLabel, dragHandlePrefix: dragHandlePrefix, children: children }));
|
|
151
155
|
}
|
|
152
|
-
function SortableShell({ id, index, group, data, disabled, isShaking, className, sensors, children, }) {
|
|
156
|
+
function SortableShell({ id, index, group, data, disabled, isShaking, className, sensors, dragHandleLabel, dragHandlePrefix, children, }) {
|
|
153
157
|
const { ref, handleRef, isDragSource, isDropTarget } = useSortableCard({
|
|
154
158
|
id,
|
|
155
159
|
index,
|
|
@@ -158,28 +162,46 @@ function SortableShell({ id, index, group, data, disabled, isShaking, className,
|
|
|
158
162
|
disabled,
|
|
159
163
|
sensors,
|
|
160
164
|
});
|
|
161
|
-
return (_jsx(
|
|
165
|
+
return (_jsx(ShellFrame, { disabled: disabled, handleRef: handleRef, label: dragHandleLabel, prefix: dragHandlePrefix, innerRef: ref, isDragSource: isDragSource, isDropTarget: isDropTarget, showDropTargetLine: true, isShaking: isShaking, className: className, children: children }));
|
|
162
166
|
}
|
|
163
|
-
function DraggableShell({ id, data, disabled, isShaking, className, sensors, children, }) {
|
|
167
|
+
function DraggableShell({ id, data, disabled, isShaking, className, sensors, dragHandleLabel, dragHandlePrefix, children, }) {
|
|
164
168
|
const { ref, handleRef, isDragging } = useDraggableCard({
|
|
165
169
|
id,
|
|
166
170
|
data,
|
|
167
171
|
disabled,
|
|
168
172
|
sensors,
|
|
169
173
|
});
|
|
170
|
-
return (_jsx(
|
|
174
|
+
return (_jsx(ShellFrame, { disabled: disabled, handleRef: handleRef, label: dragHandleLabel, prefix: dragHandlePrefix, innerRef: ref, isDragSource: isDragging, isDropTarget: false, showDropTargetLine: false, isShaking: isShaking, className: className, children: children }));
|
|
171
175
|
}
|
|
172
|
-
function
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
function ShellFrame({ disabled, handleRef, label = "card", prefix = "Reorder", children, ...wrapperProps }) {
|
|
177
|
+
// Does the child mount its own grip? It reports through the context handleRef.
|
|
178
|
+
const childHandle = useRef(null);
|
|
179
|
+
const [childHasHandle, setChildHasHandle] = useState(false);
|
|
180
|
+
const childRef = useCallback((element) => {
|
|
181
|
+
childHandle.current = element;
|
|
182
|
+
setChildHasHandle(element !== null);
|
|
183
|
+
handleRef(element);
|
|
184
|
+
}, [handleRef]);
|
|
185
|
+
// The shell grip must never clobber the child's activator: only the child's
|
|
186
|
+
// handle wins, and unmounting the shell grip must not clear it.
|
|
187
|
+
const shellRef = useCallback((element) => {
|
|
188
|
+
if (childHandle.current === null)
|
|
189
|
+
handleRef(element);
|
|
190
|
+
}, [handleRef]);
|
|
191
|
+
const showShellGrip = !disabled && !childHasHandle;
|
|
192
|
+
const value = useMemo(() => ({
|
|
193
|
+
isDraggable: !disabled,
|
|
194
|
+
handleRef: disabled ? undefined : childRef,
|
|
195
|
+
}), [disabled, childRef]);
|
|
196
|
+
return (_jsx(SortableCardContext, { value: value, children: _jsxs(Wrapper, { ...wrapperProps, reserveGrip: showShellGrip, children: [children, showShellGrip && (_jsx(SortableCardGrip, { handleRef: shellRef, scope: "shell", "aria-label": `${prefix} ${label}` }))] }) }));
|
|
175
197
|
}
|
|
176
|
-
function Wrapper({ innerRef, isDragSource, isDropTarget, showDropTargetLine, isShaking, className, children, }) {
|
|
177
|
-
return (_jsx("div", { ref: innerRef, className: cn("relative cursor-grab select-none transition-[transform,box-shadow,opacity] hover:z-10 has-[[data-open]]:z-50 active:cursor-grabbing",
|
|
198
|
+
function Wrapper({ innerRef, isDragSource, isDropTarget, showDropTargetLine, reserveGrip, isShaking, className, children, }) {
|
|
199
|
+
return (_jsx("div", { ref: innerRef, className: cn("group/sortable-card relative cursor-grab select-none transition-[transform,box-shadow,opacity] hover:z-10 has-[[data-open]]:z-50 active:cursor-grabbing",
|
|
178
200
|
// Unified drag-source dim (producer used 30, importer 50, standardizing on 40)
|
|
179
201
|
isDragSource && "opacity-40",
|
|
180
202
|
// Drop-target insertion line (sortable only)
|
|
181
203
|
showDropTargetLine &&
|
|
182
204
|
isDropTarget &&
|
|
183
|
-
"before:absolute before:-top-1 before:left-0 before:right-0 before:h-0.5 before:rounded-full before:bg-primary", isShaking && "card-shake", className), "data-drag-source": isDragSource ? "true" : undefined, "data-drop-target": isDropTarget ? "true" : undefined, children: children }));
|
|
205
|
+
"before:absolute before:-top-1 before:left-0 before:right-0 before:h-0.5 before:rounded-full before:bg-primary", reserveGrip && "pl-7 pointer-coarse:pl-9", isShaking && "card-shake", className), "data-drag-source": isDragSource ? "true" : undefined, "data-drop-target": isDropTarget ? "true" : undefined, children: children }));
|
|
184
206
|
}
|
|
185
207
|
//# sourceMappingURL=sortable-card-shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable-card-shell.js","sourceRoot":"","sources":["../../src/components/sortable-card-shell.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"sortable-card-shell.js","sourceRoot":"","sources":["../../src/components/sortable-card-shell.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,c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GAAG,EAAE,CAAC,CAAC;QACL,WAAW,EAAE,CAAC,QAAQ;QACtB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;KAC3C,CAAC,EACF,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACrB,CAAC;IACF,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,YAC/B,MAAC,OAAO,OAAK,YAAY,EAAE,WAAW,EAAE,aAAa,aAClD,QAAQ,EACR,aAAa,IAAI,CAChB,KAAC,gBAAgB,IAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAC,OAAO,gBAAa,GAAG,MAAM,IAAI,KAAK,EAAE,GAAI,CAC1F,IACO,GACU,CACvB,CAAC;AACJ,CAAC;AAgBD,SAAS,OAAO,CAAC,EACf,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,SAAS,EACT,QAAQ,GACK;IACb,OAAO,CACL,cACE,GAAG,EAAE,QAA+B,EACpC,SAAS,EAAE,EAAE,CACX,yJAAyJ;QACzJ,+EAA+E;QAC/E,YAAY,IAAI,YAAY;QAC5B,6CAA6C;QAC7C,kBAAkB;YAChB,YAAY;YACZ,+GAA+G,EACjH,WAAW,IAAI,0BAA0B,EACzC,SAAS,IAAI,YAAY,EACzB,SAAS,CACV,sBACiB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,sBACjC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAElD,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface AccountActionsLabels {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
signOut?: string;
|
|
5
|
+
signOutEverywhere?: string;
|
|
6
|
+
confirmTitle?: string;
|
|
7
|
+
confirmDescription?: string;
|
|
8
|
+
confirmWarning?: string;
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
cancel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AccountActionsCardProps {
|
|
13
|
+
/** Signs out this device. The button is disabled while a returned promise is pending. */
|
|
14
|
+
onSignOut: () => void | Promise<void>;
|
|
15
|
+
/** Called with the error when `onSignOut` rejects or throws. Without it the error is swallowed. */
|
|
16
|
+
onSignOutError?: (error: unknown) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Revokes every session. When provided, a "Sign Out Everywhere" button opens
|
|
19
|
+
* a confirmation. Reject to keep the dialog open for a retry (the consumer
|
|
20
|
+
* shows its own error toast); resolve to close it.
|
|
21
|
+
*/
|
|
22
|
+
onSignOutEverywhere?: () => Promise<void>;
|
|
23
|
+
labels?: AccountActionsLabels;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** The "Account Actions" card (CEL-2126): Sign Out, optional Sign Out Everywhere with confirm. */
|
|
27
|
+
export declare function AccountActionsCard({ onSignOut, onSignOutError, onSignOutEverywhere, labels, className, }: AccountActionsCardProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=account-actions-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-actions-card.d.ts","sourceRoot":"","sources":["../../src/profile/account-actions-card.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mGAAmG;IACnG,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,SAAS,GACV,EAAE,uBAAuB,2CA6CzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { LogOutIcon, ShieldAlertIcon } from "lucide-react";
|
|
4
|
+
import { Button } from "../components/button.js";
|
|
5
|
+
import { ConfirmationDialog } from "../components/confirmation-dialog.js";
|
|
6
|
+
import { ProfileActions, ProfileCard } from "./profile.js";
|
|
7
|
+
const DEFAULT_LABELS = {
|
|
8
|
+
title: "Account Actions",
|
|
9
|
+
description: "Quick actions related to your user account.",
|
|
10
|
+
signOut: "Sign Out",
|
|
11
|
+
signOutEverywhere: "Sign Out Everywhere",
|
|
12
|
+
confirmTitle: "Sign out everywhere?",
|
|
13
|
+
confirmDescription: "You'll be signed out of CellarNode on every device, including this browser.",
|
|
14
|
+
confirmWarning: "This ends all your sessions, including the e-label app.",
|
|
15
|
+
confirmLabel: "Sign out everywhere",
|
|
16
|
+
cancel: "Cancel",
|
|
17
|
+
};
|
|
18
|
+
/** The "Account Actions" card (CEL-2126): Sign Out, optional Sign Out Everywhere with confirm. */
|
|
19
|
+
export function AccountActionsCard({ onSignOut, onSignOutError, onSignOutEverywhere, labels, className, }) {
|
|
20
|
+
const l = { ...DEFAULT_LABELS, ...labels };
|
|
21
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
22
|
+
const [signingOut, setSigningOut] = useState(false);
|
|
23
|
+
const handleSignOut = async () => {
|
|
24
|
+
setSigningOut(true);
|
|
25
|
+
try {
|
|
26
|
+
await onSignOut();
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
onSignOutError?.(error);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
setSigningOut(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs(ProfileCard, { title: l.title, description: l.description, className: className, children: [_jsxs(ProfileActions, { children: [_jsxs(Button, { color: "red", onClick: handleSignOut, disabled: signingOut, children: [_jsx(LogOutIcon, { className: "size-4", "aria-hidden": "true" }), l.signOut] }), onSignOutEverywhere ? (_jsxs(Button, { plain: true, onClick: () => setConfirmOpen(true), children: [_jsx(ShieldAlertIcon, { className: "size-4", "aria-hidden": "true" }), l.signOutEverywhere] })) : null] }), onSignOutEverywhere ? (_jsx(ConfirmationDialog, { open: confirmOpen, onClose: () => setConfirmOpen(false), onConfirm: onSignOutEverywhere, tone: "danger", title: l.confirmTitle, description: l.confirmDescription, warning: l.confirmWarning, confirmLabel: l.confirmLabel, cancelLabel: l.cancel })) : null] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=account-actions-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-actions-card.js","sourceRoot":"","sources":["../../src/profile/account-actions-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,WAAW,EA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MAAM,GAAG,EACnD,CAAC,CAAC,OAAO,IACH,EACR,mBAAmB,CAAC,CAAC,CAAC,CACrB,MAAC,MAAM,IAAC,KAAK,QAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,aAC/C,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,EACxD,CAAC,CAAC,iBAAiB,IACb,CACV,CAAC,CAAC,CAAC,IAAI,IACO,EAChB,mBAAmB,CAAC,CAAC,CAAC,CACrB,KAAC,kBAAkB,IACjB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EACpC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,CAAC,CAAC,YAAY,EACrB,WAAW,EAAE,CAAC,CAAC,kBAAkB,EACjC,OAAO,EAAE,CAAC,CAAC,cAAc,EACzB,YAAY,EAAE,CAAC,CAAC,YAAY,EAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,GACrB,CACH,CAAC,CAAC,CAAC,IAAI,IACI,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -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; just `firstName` when `lastName` is empty. */
|
|
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,WAAW,iBAAiB;IAChC,6GAA6G;IAC7G,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,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;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,2CAgRtB"}
|
|
@@ -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() !== "";
|
|
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].filter(Boolean).join(" "),
|
|
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" })] })] }), 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":"","sources":["../../src/profile/account-edit-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM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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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,EAC7C,SAAS,EAAE,EAAE,CACX,6GAA6G,EAC7G,qEAAqE,EACrE,QAAQ;wCACN,CAAC,CAAC,8CAA8C;wCAChD,CAAC,CAAC,2GAA2G,CAChH,aAED,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,EAC7C,CAAC,CAAC,GAAG,CAAC,KAnBF,KAAK,CAoBH,CACV,CAAC;4BACJ,CAAC,CAAC,GACE,IACF,EAEL,YAAY,CAAC,CAAC,CAAC,CACd,0BACE,YAAG,SAAS,EAAC,0EAA0E,YACpF,CAAC,CAAC,QAAQ,GACT,EACH,YAAY,IACT,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,GACM,CACf,CAAC;AACJ,CAAC"}
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -12,4 +12,14 @@ export * from "./business-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"}
|
package/dist/profile/index.js
CHANGED
|
@@ -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/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ACpB;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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CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GACzF,IACC,CACN,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,WAAW,IAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,YAC1E,IAAI,GACO,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface UserInformationCardLabels {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
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,CAA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BAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAiB,EACjB,MAAM,EACN,SAAS,GACV,EAAE,wBAAwB,2CA+D1B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Building2Icon, SquarePenIcon } from "lucide-react";
|
|
3
|
+
import { Avatar } from "../components/avatar.js";
|
|
4
|
+
import { Badge } from "../components/badge.js";
|
|
5
|
+
import { Button } from "../components/button.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { ProfileActions, ProfileCard, ProfileInfoGrid, ProfileInfoItem } from "./profile.js";
|
|
8
|
+
const DEFAULT_LABELS = {
|
|
9
|
+
title: "User Information",
|
|
10
|
+
description: "Your account identity and access details.",
|
|
11
|
+
role: "Role",
|
|
12
|
+
organisation: "Organisation",
|
|
13
|
+
accountId: "Account ID",
|
|
14
|
+
phone: "Phone",
|
|
15
|
+
editAccount: "Edit Account",
|
|
16
|
+
notSet: "Not set",
|
|
17
|
+
noEmail: "No email available",
|
|
18
|
+
unnamedUser: "User",
|
|
19
|
+
loading: "Loading...",
|
|
20
|
+
unknownRole: "Unknown",
|
|
21
|
+
};
|
|
22
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
23
|
+
/** Initials from a display name: first letters of the first two words. */
|
|
24
|
+
export function deriveInitials(name) {
|
|
25
|
+
const parts = (name ?? "").trim().split(/\s+/).filter(Boolean).slice(0, 2);
|
|
26
|
+
return (parts
|
|
27
|
+
.map((part) => part[0])
|
|
28
|
+
.join("")
|
|
29
|
+
.toUpperCase() || "?");
|
|
30
|
+
}
|
|
31
|
+
/** @internal Trimmed text or null. */
|
|
32
|
+
export function present(value) {
|
|
33
|
+
const trimmed = value?.trim();
|
|
34
|
+
return trimmed ? trimmed : null;
|
|
35
|
+
}
|
|
36
|
+
/** @internal The trimmed organisation name or null. Warns in development when it looks like an id. */
|
|
37
|
+
export function safeOrganisationName(value) {
|
|
38
|
+
const org = present(value);
|
|
39
|
+
if (org && process.env.NODE_ENV !== "production" && UUID_RE.test(org)) {
|
|
40
|
+
console.warn("[@cellarnode/ui/profile] `organisationName` looks like an id. Pass the organisation NAME.");
|
|
41
|
+
}
|
|
42
|
+
return org;
|
|
43
|
+
}
|
|
44
|
+
/** @internal Producer's formatRole: first letter capitalised. */
|
|
45
|
+
export function formatRoleLabel(role, unknown) {
|
|
46
|
+
const value = present(role);
|
|
47
|
+
return value ? value.charAt(0).toUpperCase() + value.slice(1) : unknown;
|
|
48
|
+
}
|
|
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 function UserInformationCard({ name, email, avatarUrl, initials, role, organisationName, accountId, phone, onEdit, isLoading = false, labels, className, }) {
|
|
55
|
+
const l = { ...DEFAULT_LABELS, ...labels };
|
|
56
|
+
const displayName = present(name) ?? l.unnamedUser;
|
|
57
|
+
const org = safeOrganisationName(organisationName);
|
|
58
|
+
const phoneText = present(phone);
|
|
59
|
+
const hasPhoneRow = phone !== undefined;
|
|
60
|
+
const footer = onEdit ? (_jsx(ProfileActions, { children: _jsxs(Button, { color: "brand", onClick: onEdit, children: [_jsx(SquarePenIcon, { className: "size-4", "aria-hidden": "true" }), l.editAccount] }) })) : undefined;
|
|
61
|
+
return (_jsxs(ProfileCard, { title: l.title, description: l.description, footer: footer, className: cn(className), children: [_jsxs("div", { className: "mb-5 flex min-w-0 items-center gap-4", children: [_jsx(Avatar, { src: avatarUrl, square: true, initials: initials ?? deriveInitials(displayName), alt: displayName, className: "size-14 rounded-full bg-primary/15 text-primary" }), _jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsx("p", { className: "break-words text-base font-semibold text-foreground", children: isLoading ? l.loading : displayName }), _jsx("p", { className: "break-words text-sm text-muted-foreground", children: present(email) ?? l.noEmail })] })] }), _jsxs(ProfileInfoGrid, { children: [_jsx(ProfileInfoItem, { label: l.role, children: _jsx(Badge, { color: "zinc", className: "bg-primary/10 text-primary", children: formatRoleLabel(role, l.unknownRole) }) }), _jsx(ProfileInfoItem, { label: l.organisation, children: _jsxs("div", { className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [_jsx(Building2Icon, { className: "size-4 shrink-0 text-primary", "aria-hidden": "true" }), _jsx("span", { className: "min-w-0 break-words", children: org ?? l.notSet })] }) }), hasPhoneRow ? (_jsx(ProfileInfoItem, { label: l.phone, colSpan: "full", children: _jsx("span", { className: "break-words", children: phoneText ?? l.notSet }) })) : null, _jsx(ProfileInfoItem, { label: l.accountId, colSpan: "full", children: _jsx("span", { className: "break-all font-mono text-sm text-foreground", children: present(accountId) ?? "-" }) })] })] }));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=user-information-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-information-card.js","sourceRoot":"","sources":["../../src/profile/user-information-card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;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C,MAAM,GAAQ,GAC5C,CACnB,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,eAAe,IAAC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,YACjD,eAAM,SAAS,EAAC,6CAA6C,YAC1D,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,GACrB,GACS,IACF,IACN,CACf,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cellarnode/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.185.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
|