@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.
- 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/org/index.d.ts +2 -0
- package/dist/org/index.d.ts.map +1 -1
- package/dist/org/index.js +2 -0
- package/dist/org/index.js.map +1 -1
- package/dist/org/organisation-shell.d.ts +41 -0
- package/dist/org/organisation-shell.d.ts.map +1 -0
- package/dist/org/organisation-shell.js +24 -0
- package/dist/org/organisation-shell.js.map +1 -0
- 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,CA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;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE5B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AASD,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,eAAe,EACf,KAAK,EACL,QAAQ,EACR,QAAgB,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,MAA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AC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAC3C,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EACvC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,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,yBA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;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA8D9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
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.ts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|
package/dist/org/index.d.ts
CHANGED
|
@@ -21,4 +21,6 @@ export { BillingAddressSourceControl } from "./billing-address-source.js";
|
|
|
21
21
|
export type { BillingAddressSourceControlProps } from "./billing-address-source.js";
|
|
22
22
|
export { PublicLocationNotice } from "./public-location-notice.js";
|
|
23
23
|
export type { PublicLocationNoticeProps } from "./public-location-notice.js";
|
|
24
|
+
export { OrganisationShell } from "./organisation-shell.js";
|
|
25
|
+
export type { OrganisationShellLabels, OrganisationShellProps, OrganisationShellWidth, } from "./organisation-shell.js";
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/org/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/org/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,GACd,MAAM,SAAS,CAAC;AAIjB,OAAO,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AAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,GACd,MAAM,SAAS,CAAC;AAIjB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,YAAY,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/dist/org/index.js
CHANGED
|
@@ -11,4 +11,6 @@ export { PostalAddressFields } from "./postal-address-fields.js";
|
|
|
11
11
|
export { PostalAddressDisplay } from "./postal-address-display.js";
|
|
12
12
|
export { BillingAddressSourceControl } from "./billing-address-source.js";
|
|
13
13
|
export { PublicLocationNotice } from "./public-location-notice.js";
|
|
14
|
+
// CEL-2126 — shared organisation section layout (title, org name, content column).
|
|
15
|
+
export { OrganisationShell } from "./organisation-shell.js";
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
package/dist/org/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/org/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAW5D,sEAAsE;AACtE,2EAA2E;AAC3E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/org/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAW5D,sEAAsE;AACtE,2EAA2E;AAC3E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,mFAAmF;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type OrganisationShellWidth = "default" | "narrow" | "wide" | "full";
|
|
3
|
+
export interface OrganisationShellLabels {
|
|
4
|
+
/** Subtitle shown under the title when there is no organisation name. */
|
|
5
|
+
noOrgSubtitle?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OrganisationShellProps {
|
|
8
|
+
/** The page title, rendered as the single `h1` (e.g. "Organisation"). */
|
|
9
|
+
title: string;
|
|
10
|
+
/** The organisation name. Plain text, never a heading. Clamps to two lines when long. */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** Optional header actions, right-aligned from `sm` up and stacked below it. */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/** The section content (the router outlet). */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Content width. `default` is `max-w-6xl` (producer's current container),
|
|
18
|
+
* `narrow` is `max-w-4xl`, `wide` is `max-w-7xl`, `full` is unbounded.
|
|
19
|
+
*/
|
|
20
|
+
width?: OrganisationShellWidth;
|
|
21
|
+
/**
|
|
22
|
+
* Shown INSTEAD of `children` when the user has no organisation (join and
|
|
23
|
+
* setup UI, request-status card, loading text). Consumer-owned. Rendered in a
|
|
24
|
+
* centred `max-w-4xl` column, as producer does today.
|
|
25
|
+
*/
|
|
26
|
+
noOrgState?: ReactNode;
|
|
27
|
+
labels?: OrganisationShellLabels;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Shared parent layout for the organisation section (CEL-2126). Header
|
|
32
|
+
* (`font-display` h1 plus muted org-name line plus optional actions) over a
|
|
33
|
+
* centred content column. Class-for-class the same as producer's
|
|
34
|
+
* `_app.organisation` header and `max-w-6xl` Outlet container, so adopting it
|
|
35
|
+
* is not a visual change.
|
|
36
|
+
*
|
|
37
|
+
* Landmarks: it renders no `main` (AppShell owns it) and exactly one `h1`; the
|
|
38
|
+
* header is a plain `div` (a `header` reads as a banner landmark to some tools).
|
|
39
|
+
*/
|
|
40
|
+
export declare function OrganisationShell({ title, subtitle, actions, children, width, noOrgState, labels, className, }: OrganisationShellProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=organisation-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-shell.d.ts","sourceRoot":"","sources":["../../src/org/organisation-shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5E,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAiB,EACjB,UAAU,EACV,MAAM,EACN,SAAS,GACV,EAAE,sBAAsB,2CA8CxB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
const WIDTH_CLASS = {
|
|
4
|
+
default: "max-w-6xl",
|
|
5
|
+
narrow: "max-w-4xl",
|
|
6
|
+
wide: "max-w-7xl",
|
|
7
|
+
full: "max-w-none",
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Shared parent layout for the organisation section (CEL-2126). Header
|
|
11
|
+
* (`font-display` h1 plus muted org-name line plus optional actions) over a
|
|
12
|
+
* centred content column. Class-for-class the same as producer's
|
|
13
|
+
* `_app.organisation` header and `max-w-6xl` Outlet container, so adopting it
|
|
14
|
+
* is not a visual change.
|
|
15
|
+
*
|
|
16
|
+
* Landmarks: it renders no `main` (AppShell owns it) and exactly one `h1`; the
|
|
17
|
+
* header is a plain `div` (a `header` reads as a banner landmark to some tools).
|
|
18
|
+
*/
|
|
19
|
+
export function OrganisationShell({ title, subtitle, actions, children, width = "default", noOrgState, labels, className, }) {
|
|
20
|
+
const hasNoOrgState = noOrgState !== undefined && noOrgState !== null && noOrgState !== false;
|
|
21
|
+
const resolvedSubtitle = subtitle ?? (hasNoOrgState ? (labels?.noOrgSubtitle ?? "Manage your organisation") : undefined);
|
|
22
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-8", className), "data-slot": "organisation-shell", children: [_jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", "data-slot": "organisation-shell-header", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "font-display text-2xl/8 font-bold text-foreground sm:text-3xl/10", children: title }), resolvedSubtitle ? (_jsx("p", { className: "mt-1 line-clamp-2 break-words text-sm/5 text-muted-foreground", title: resolvedSubtitle, "data-slot": "organisation-shell-subtitle", children: resolvedSubtitle })) : null] }), actions ? (_jsx("div", { className: "shrink-0", "data-slot": "organisation-shell-actions", children: actions })) : null] }), hasNoOrgState ? (_jsx("div", { className: "mx-auto w-full max-w-4xl", "data-slot": "organisation-shell-no-org", children: noOrgState })) : (_jsx("div", { className: cn("mx-auto w-full", WIDTH_CLASS[width]), "data-slot": "organisation-shell-content", children: children }))] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=organisation-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-shell.js","sourceRoot":"","sources":["../../src/org/organisation-shell.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAiClC,MAAM,WAAW,GAA2C;IAC1D,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,GAAG,SAAS,EACjB,UAAU,EACV,MAAM,EACN,SAAS,GACc;IACvB,MAAM,aAAa,GAAG,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,KAAK,CAAC;IAC9F,MAAM,gBAAgB,GACpB,QAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,aAAa,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAElG,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,eAAY,oBAAoB,aAClF,eACE,SAAS,EAAC,oEAAoE,eACpE,2BAA2B,aAErC,eAAK,SAAS,EAAC,SAAS,aACtB,aAAI,SAAS,EAAC,kEAAkE,YAC7E,KAAK,GACH,EACJ,gBAAgB,CAAC,CAAC,CAAC,CAClB,YACE,SAAS,EAAC,+DAA+D,EACzE,KAAK,EAAE,gBAAgB,eACb,6BAA6B,YAEtC,gBAAgB,GACf,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,SAAS,EAAC,UAAU,eAAW,4BAA4B,YAC7D,OAAO,GACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EAEL,aAAa,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,0BAA0B,eAAW,2BAA2B,YAC5E,UAAU,GACP,CACP,CAAC,CAAC,CAAC,CACF,cACE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,eACzC,4BAA4B,YAErC,QAAQ,GACL,CACP,IACG,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,EAAE,MAAM,WAAW,CAAC;AA6BxD,MAAM,cAAc,GAAmC;IACrD,KAAK,EAAE,iBA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