@softure-ai/theme-notion 0.1.1 → 0.3.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/CHANGELOG.md +178 -0
- package/README.md +239 -12
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/messages/en.d.ts +20 -0
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +11 -0
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/index.d.ts +20 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/Code.d.ts +8 -0
- package/dist/notion/Code.d.ts.map +1 -0
- package/dist/notion/Code.js +12 -0
- package/dist/notion/Code.js.map +1 -0
- package/dist/notion/DetailTable.d.ts +15 -0
- package/dist/notion/DetailTable.d.ts.map +1 -0
- package/dist/notion/DetailTable.js +20 -0
- package/dist/notion/DetailTable.js.map +1 -0
- package/dist/notion/FilterChip.d.ts +24 -0
- package/dist/notion/FilterChip.d.ts.map +1 -0
- package/dist/notion/FilterChip.js +18 -0
- package/dist/notion/FilterChip.js.map +1 -0
- package/dist/notion/FoldRow.d.ts +23 -0
- package/dist/notion/FoldRow.d.ts.map +1 -0
- package/dist/notion/FoldRow.js +14 -0
- package/dist/notion/FoldRow.js.map +1 -0
- package/dist/notion/MarkPopover.d.ts +19 -0
- package/dist/notion/MarkPopover.d.ts.map +1 -0
- package/dist/notion/MarkPopover.js +22 -0
- package/dist/notion/MarkPopover.js.map +1 -0
- package/dist/notion/PageHeader.d.ts +2 -1
- package/dist/notion/PageHeader.d.ts.map +1 -1
- package/dist/notion/PageHeader.js +2 -2
- package/dist/notion/PageHeader.js.map +1 -1
- package/dist/notion/SidePanel.d.ts +13 -0
- package/dist/notion/SidePanel.d.ts.map +1 -0
- package/dist/notion/SidePanel.js +28 -0
- package/dist/notion/SidePanel.js.map +1 -0
- package/dist/notion/Sortable.d.ts +36 -0
- package/dist/notion/Sortable.d.ts.map +1 -0
- package/dist/notion/Sortable.js +83 -0
- package/dist/notion/Sortable.js.map +1 -0
- package/dist/notion/Stats.d.ts +49 -0
- package/dist/notion/Stats.d.ts.map +1 -0
- package/dist/notion/Stats.js +38 -0
- package/dist/notion/Stats.js.map +1 -0
- package/dist/notion/Steps.d.ts +18 -0
- package/dist/notion/Steps.d.ts.map +1 -0
- package/dist/notion/Steps.js +32 -0
- package/dist/notion/Steps.js.map +1 -0
- package/dist/notion/TabBar.d.ts +15 -0
- package/dist/notion/TabBar.d.ts.map +1 -0
- package/dist/notion/TabBar.js +6 -0
- package/dist/notion/TabBar.js.map +1 -0
- package/dist/notion/tones.d.ts +8 -0
- package/dist/notion/tones.d.ts.map +1 -0
- package/dist/notion/tones.js +37 -0
- package/dist/notion/tones.js.map +1 -0
- package/dist/page.css +22 -0
- package/dist/theme.css +55 -46
- package/dist/tokens.d.ts +82 -64
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +22 -19
- package/dist/tokens.js.map +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +33 -13
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button-group.js +1 -1
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +3 -3
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.js +2 -2
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +8 -3
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/progress.d.ts +4 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +9 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +14 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +3 -1
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +2 -2
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.js +2 -2
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sidebar.js +4 -4
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +16 -5
- package/src/index.ts +32 -0
- package/src/messages/en.ts +12 -0
- package/src/notion/Code.tsx +39 -0
- package/src/notion/DetailTable.tsx +46 -0
- package/src/notion/FilterChip.tsx +71 -0
- package/src/notion/FoldRow.tsx +78 -0
- package/src/notion/MarkPopover.tsx +84 -0
- package/src/notion/PageHeader.tsx +4 -2
- package/src/notion/SidePanel.tsx +73 -0
- package/src/notion/Sortable.tsx +235 -0
- package/src/notion/Stats.tsx +165 -0
- package/src/notion/Steps.tsx +102 -0
- package/src/notion/TabBar.tsx +47 -0
- package/src/notion/tones.ts +45 -0
- package/src/page.css +22 -0
- package/src/tokens.ts +22 -19
- package/src/ui/alert.tsx +1 -1
- package/src/ui/badge.tsx +35 -13
- package/src/ui/button-group.tsx +1 -1
- package/src/ui/button.tsx +3 -3
- package/src/ui/checkbox.tsx +1 -1
- package/src/ui/dropdown-menu.tsx +1 -1
- package/src/ui/empty.tsx +1 -1
- package/src/ui/field.tsx +2 -2
- package/src/ui/item.tsx +16 -7
- package/src/ui/progress.tsx +19 -2
- package/src/ui/radio-group.tsx +44 -0
- package/src/ui/scroll-area.tsx +11 -2
- package/src/ui/select.tsx +2 -2
- package/src/ui/sidebar.tsx +4 -4
- package/src/ui/tabs.tsx +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBL,CAAC"}
|
package/dist/messages/en.js
CHANGED
|
@@ -5,9 +5,20 @@
|
|
|
5
5
|
export const en = {
|
|
6
6
|
breadcrumb: { label: "breadcrumb", more: "More" },
|
|
7
7
|
dialog: { close: "Close" },
|
|
8
|
+
filterChip: { add: "Add filter" },
|
|
8
9
|
sheet: { close: "Close" },
|
|
10
|
+
sidePanel: { close: "Close" },
|
|
9
11
|
sidebar: { mobileTitle: "Sidebar", mobileDescription: "Displays the mobile sidebar.", toggle: "Toggle Sidebar" },
|
|
10
12
|
spinner: { label: "Loading" },
|
|
13
|
+
sortable: {
|
|
14
|
+
instructions: "To pick up a row, press Space or Enter. Use the arrow keys to move it, then press Space or Enter to drop it, or Escape to cancel.",
|
|
15
|
+
pickedUp: "Picked up {item}, position {position} of {total}.",
|
|
16
|
+
moved: "{item} moved to position {position} of {total}.",
|
|
17
|
+
dropped: "Dropped {item} at position {position} of {total}.",
|
|
18
|
+
cancelled: "Cancelled. {item} is back in place.",
|
|
19
|
+
handle: "Drag to reorder",
|
|
20
|
+
},
|
|
21
|
+
steps: { done: "Done", current: "Current", todo: "To do", failed: "Failed" },
|
|
11
22
|
command: { title: "Command Palette", description: "Search for a command to run..." },
|
|
12
23
|
};
|
|
13
24
|
//# sourceMappingURL=en.js.map
|
package/dist/messages/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,EAAE,G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OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC5E,OAAO,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,gCAAgC,EAAE;CAC5E,CAAC"}
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -9,9 +9,15 @@ export declare const notionMessages: {
|
|
|
9
9
|
readonly dialog: {
|
|
10
10
|
readonly close: "Close";
|
|
11
11
|
};
|
|
12
|
+
readonly filterChip: {
|
|
13
|
+
readonly add: "Add filter";
|
|
14
|
+
};
|
|
12
15
|
readonly sheet: {
|
|
13
16
|
readonly close: "Close";
|
|
14
17
|
};
|
|
18
|
+
readonly sidePanel: {
|
|
19
|
+
readonly close: "Close";
|
|
20
|
+
};
|
|
15
21
|
readonly sidebar: {
|
|
16
22
|
readonly mobileTitle: "Sidebar";
|
|
17
23
|
readonly mobileDescription: "Displays the mobile sidebar.";
|
|
@@ -20,6 +26,20 @@ export declare const notionMessages: {
|
|
|
20
26
|
readonly spinner: {
|
|
21
27
|
readonly label: "Loading";
|
|
22
28
|
};
|
|
29
|
+
readonly sortable: {
|
|
30
|
+
readonly instructions: "To pick up a row, press Space or Enter. Use the arrow keys to move it, then press Space or Enter to drop it, or Escape to cancel.";
|
|
31
|
+
readonly pickedUp: "Picked up {item}, position {position} of {total}.";
|
|
32
|
+
readonly moved: "{item} moved to position {position} of {total}.";
|
|
33
|
+
readonly dropped: "Dropped {item} at position {position} of {total}.";
|
|
34
|
+
readonly cancelled: "Cancelled. {item} is back in place.";
|
|
35
|
+
readonly handle: "Drag to reorder";
|
|
36
|
+
};
|
|
37
|
+
readonly steps: {
|
|
38
|
+
readonly done: "Done";
|
|
39
|
+
readonly current: "Current";
|
|
40
|
+
readonly todo: "To do";
|
|
41
|
+
readonly failed: "Failed";
|
|
42
|
+
};
|
|
23
43
|
readonly command: {
|
|
24
44
|
readonly title: "Command Palette";
|
|
25
45
|
readonly description: "Search for a command to run...";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAS,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export declare function Code({ className, ...props }: ComponentProps<"code">): import("react").JSX.Element;
|
|
3
|
+
export interface CodeBlockProps extends ComponentProps<"pre"> {
|
|
4
|
+
readonly label?: string;
|
|
5
|
+
readonly wrap?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function CodeBlock({ label, wrap, className, ...props }: CodeBlockProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/notion/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,+BAQnE;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,KAAK,CAAC;IAE3D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,IAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAerF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
// Inline code: the `code` text style in mono, red on the grey `secondary` background, as in Notion.
|
|
4
|
+
export function Code({ className, ...props }) {
|
|
5
|
+
return (_jsx("code", { "data-slot": "code", className: cn("rounded-xs bg-secondary px-1 font-mono text-code text-code-foreground", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
// A mono block for logs and file paths, without syntax highlighting.
|
|
8
|
+
export function CodeBlock({ label, wrap = false, className, ...props }) {
|
|
9
|
+
const region = label === undefined ? {} : { role: "region", "aria-label": label, tabIndex: 0 };
|
|
10
|
+
return (_jsx("pre", { "data-slot": "code-block", "data-wrap": wrap ? "" : undefined, className: cn("overflow-x-auto rounded-lg bg-muted px-4 py-3 font-mono text-code", wrap ? "whitespace-pre-wrap break-words" : "whitespace-pre", className), ...region, ...props }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/notion/Code.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,oGAAoG;AACpG,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA0B;IAClE,OAAO,CACL,4BACY,MAAM,EAChB,SAAS,EAAE,EAAE,CAAC,uEAAuE,EAAE,SAAS,CAAC,KAC7F,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AASD,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IACpF,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC/F,OAAO,CACL,2BACY,YAAY,eACX,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAChC,SAAS,EAAE,EAAE,CACX,mEAAmE,EACnE,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,gBAAgB,EAC3D,SAAS,CACV,KACG,MAAM,KACN,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface DetailRow {
|
|
3
|
+
/** Unique within the table; kept on the row as `data-detail`. */
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** `null`, `undefined` or "": nothing to show, the row is left out. */
|
|
7
|
+
readonly value: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface DetailTableProps {
|
|
10
|
+
/** The table's accessible name. */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly rows: readonly DetailRow[];
|
|
13
|
+
}
|
|
14
|
+
export declare function DetailTable({ label, rows }: DetailTableProps): import("react").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=DetailTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailTable.d.ts","sourceRoot":"","sources":["../../src/notion/DetailTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;CACrC;AAgBD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,gBAAgB,sCAe5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// A row header in a narrow muted column, a quiet line under every row; on a phone the label sits above its value.
|
|
3
|
+
const DETAIL_TABLE_CLASS = [
|
|
4
|
+
"w-full border-collapse text-ui",
|
|
5
|
+
"[&_tr]:border-b [&_tr]:border-border",
|
|
6
|
+
"[&_th]:w-48 [&_th]:py-1.5 [&_th]:pr-3 [&_th]:text-left [&_th]:align-top [&_th]:font-normal [&_th]:text-muted-foreground",
|
|
7
|
+
"[&_td]:py-1.5 [&_td]:align-top [&_td]:wrap-anywhere",
|
|
8
|
+
"max-sm:[&_tr]:block max-sm:[&_tr]:py-1.5 max-sm:[&_th]:block max-sm:[&_th]:w-auto max-sm:[&_th]:py-0 max-sm:[&_td]:block max-sm:[&_td]:py-0",
|
|
9
|
+
].join(" ");
|
|
10
|
+
function hasValue(row) {
|
|
11
|
+
return row.value !== null && row.value !== undefined && row.value !== "";
|
|
12
|
+
}
|
|
13
|
+
// An item's details as a label and value table in the Notion table style; nothing renders when no row has a value.
|
|
14
|
+
export function DetailTable({ label, rows }) {
|
|
15
|
+
const shown = rows.filter(hasValue);
|
|
16
|
+
if (shown.length === 0)
|
|
17
|
+
return null;
|
|
18
|
+
return (_jsx("table", { "data-slot": "detail-table", className: DETAIL_TABLE_CLASS, "aria-label": label, children: _jsx("tbody", { children: shown.map((row) => (_jsxs("tr", { "data-detail": row.key, children: [_jsx("th", { scope: "row", children: row.label }), _jsx("td", { children: row.value })] }, row.key))) }) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=DetailTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailTable.js","sourceRoot":"","sources":["../../src/notion/DetailTable.tsx"],"names":[],"mappings":";AAgBA,kHAAkH;AAClH,MAAM,kBAAkB,GAAG;IACzB,gCAAgC;IAChC,sCAAsC;IACtC,yHAAyH;IACzH,qDAAqD;IACrD,6IAA6I;CAC9I,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,SAAS,QAAQ,CAAC,GAAc;IAC9B,OAAO,GAAG,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC;AAC3E,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAoB;IAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,CACL,6BAAiB,cAAc,EAAC,SAAS,EAAE,kBAAkB,gBAAc,KAAK,YAC9E,0BACG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAClB,6BAA+B,GAAG,CAAC,GAAG,aACpC,aAAI,KAAK,EAAC,KAAK,YAAE,GAAG,CAAC,KAAK,GAAM,EAChC,uBAAK,GAAG,CAAC,KAAK,GAAM,KAFb,GAAG,CAAC,GAAG,CAGX,CACN,CAAC,GACI,GACF,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface FilterChipProps {
|
|
3
|
+
/** The filtered field, as shown before the value: "Status:". */
|
|
4
|
+
readonly label: string;
|
|
5
|
+
/** The chosen option's text; the app's word for "all" when none is chosen. */
|
|
6
|
+
readonly value: string;
|
|
7
|
+
/** Drawn before the label; the caller hides it from assistive technology. */
|
|
8
|
+
readonly icon?: ReactNode;
|
|
9
|
+
/** A non-default value is chosen: the pill turns into the blue tag. */
|
|
10
|
+
readonly isActive?: boolean;
|
|
11
|
+
/** The options, as `DropdownMenu` items (radio items for one choice). */
|
|
12
|
+
readonly children: ReactNode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FilterChipAddProps {
|
|
16
|
+
/** The pill's text; default "Add filter". */
|
|
17
|
+
readonly label?: string;
|
|
18
|
+
/** The fields that can be filtered, as `DropdownMenu` items. */
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
readonly className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function FilterChip({ label, value, icon, isActive, children, className }: FilterChipProps): import("react").JSX.Element;
|
|
23
|
+
export declare function FilterChipAdd({ label, children, className }: FilterChipAddProps): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=FilterChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterChip.d.ts","sourceRoot":"","sources":["../../src/notion/FilterChip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAUD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BAkBxG;AAGD,wBAAgB,aAAa,CAAC,EAAE,KAA+B,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAUzG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, Plus } from "lucide-react";
|
|
3
|
+
import { en as messages } from "../messages/en.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
|
+
const PILL_CLASS = "inline-flex h-6 shrink-0 cursor-pointer items-center gap-1 rounded-full px-2 text-sm whitespace-nowrap text-muted-foreground transition-colors duration-120 outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5";
|
|
8
|
+
const ACTIVE_CLASS = "data-[active]:bg-blue-tag data-[active]:text-blue-tag-foreground data-[active]:hover:bg-blue-tag data-[active]:data-[state=open]:bg-blue-tag";
|
|
9
|
+
// A list filter drawn the way a Notion database view draws it: a small pill `icon · Label: value ▾` above a table
|
|
10
|
+
// that opens a menu of options in the design system's popover.
|
|
11
|
+
export function FilterChip({ label, value, icon, isActive = false, children, className }) {
|
|
12
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-slot": "filter-chip", "data-active": isActive ? "" : undefined, className: cn(PILL_CLASS, ACTIVE_CLASS, className), children: [icon, _jsx("span", { children: label }), _jsx("span", { "data-slot": "filter-chip-value", className: "font-medium", children: value }), _jsx(ChevronDown, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH })] }), _jsx(DropdownMenuContent, { align: "start", children: children })] }));
|
|
13
|
+
}
|
|
14
|
+
// The "+ Add filter" pill next to the filters: the same height, a ghost look, a menu of the fields to filter by.
|
|
15
|
+
export function FilterChipAdd({ label = messages.filterChip.add, children, className }) {
|
|
16
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-slot": "filter-chip-add", className: cn(PILL_CLASS, className), children: [_jsx(Plus, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), _jsx("span", { children: label })] }), _jsx(DropdownMenuContent, { align: "start", children: children })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FilterChip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterChip.js","sourceRoot":"","sources":["../../src/notion/FilterChip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAwBrD,MAAM,UAAU,GACd,uVAAuV,CAAC;AAE1V,MAAM,YAAY,GAChB,8IAA8I,CAAC;AAEjJ,kHAAkH;AAClH,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAmB;IACvG,OAAO,CACL,MAAC,YAAY,eACX,MAAC,mBAAmB,iBACR,aAAa,iBACV,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EACtC,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,SAAS,CAAC,aAEjD,IAAI,EACL,yBAAO,KAAK,GAAQ,EACpB,4BAAgB,mBAAmB,EAAC,SAAS,EAAC,aAAa,YACxD,KAAK,GACD,EACP,KAAC,WAAW,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,IAC9C,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,OAAO,YAAE,QAAQ,GAAuB,IACtD,CAChB,CAAC;AACJ,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAsB;IACxG,OAAO,CACL,MAAC,YAAY,eACX,MAAC,mBAAmB,iBAAW,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,aACnF,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,EAC3D,yBAAO,KAAK,GAAQ,IACA,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAC,OAAO,YAAE,QAAQ,GAAuB,IACtD,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type DetailRow } from "./DetailTable.js";
|
|
3
|
+
import { type Tone } from "./tones.js";
|
|
4
|
+
export interface FoldRowBadge {
|
|
5
|
+
/** Unique within the row; kept on the badge as `data-badge`. */
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly text: string;
|
|
8
|
+
readonly tone?: Tone;
|
|
9
|
+
}
|
|
10
|
+
export interface FoldRowProps {
|
|
11
|
+
readonly title: ReactNode;
|
|
12
|
+
/** Short facts after the title; left out when empty. */
|
|
13
|
+
readonly facts?: readonly ReactNode[];
|
|
14
|
+
/** Badges on the row's right, in order. */
|
|
15
|
+
readonly badges: readonly FoldRowBadge[];
|
|
16
|
+
/** The details table's accessible name. */
|
|
17
|
+
readonly detailsLabel: string;
|
|
18
|
+
readonly details: readonly DetailRow[];
|
|
19
|
+
/** More content under the table when opened. */
|
|
20
|
+
readonly children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function FoldRow({ title, facts, badges, detailsLabel, details, children }: FoldRowProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=FoldRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FoldRow.d.ts","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAGD,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,KAAU,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,YAAY,+BA+CnG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
3
|
+
import { Badge } from "../ui/badge.js";
|
|
4
|
+
import { DetailTable } from "./DetailTable.js";
|
|
5
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
6
|
+
import { TONE_COLORS } from "./tones.js";
|
|
7
|
+
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
8
|
+
export function FoldRow({ title, facts = [], badges, detailsLabel, details, children }) {
|
|
9
|
+
return (_jsxs("details", { "data-slot": "fold-row", className: "group/fold-row border-b border-border", children: [_jsxs("summary", { "data-slot": "fold-row-summary", className: "flex min-h-row-height cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-1 py-1 transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", children: [_jsxs("span", { "data-slot": "fold-row-heading", className: "flex min-w-0 items-center gap-2", children: [_jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90" }), _jsx("span", { className: "min-w-0 text-ui-medium", children: title })] }), facts.map((fact, index) => (_jsx("span", { "data-slot": "fold-row-fact", className: "text-ui text-muted-foreground", children: fact }, index))), badges.length === 0 ? null : (_jsx("span", { "data-slot": "fold-row-badges", className: "ml-auto inline-flex flex-wrap gap-1", children: badges.map((badge) => {
|
|
10
|
+
const tone = badge.tone ?? "default";
|
|
11
|
+
return (_jsx(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-badge": badge.key, "data-tone": tone, children: badge.text }, badge.key));
|
|
12
|
+
}) }))] }), _jsxs("div", { "data-slot": "fold-row-content", className: "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden", children: [_jsx(DetailTable, { label: detailsLabel, rows: details }), children] })] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FoldRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FoldRow.js","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAsBpD,kHAAkH;AAClH,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAgB;IAClG,OAAO,CACL,gCAAmB,UAAU,EAAC,SAAS,EAAC,uCAAuC,aAC7E,gCACY,kBAAkB,EAC5B,SAAS,EAAC,oSAAoS,aAG9S,6BAAgB,kBAAkB,EAAC,SAAS,EAAC,iCAAiC,aAC5E,KAAC,YAAY,mBACC,MAAM,EAClB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAC,uGAAuG,GACjH,EACF,eAAM,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAQ,IAClD,EACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAE1B,4BAA4B,eAAe,EAAC,SAAS,EAAC,+BAA+B,YAClF,IAAI,IADI,KAAK,CAET,CACR,CAAC,EACD,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5B,4BAAgB,iBAAiB,EAAC,SAAS,EAAC,qCAAqC,YAC9E,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;4BACpB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC;4BACrC,OAAO,CACL,KAAC,KAAK,IAEJ,OAAO,EAAC,KAAK,EACb,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,gBACzB,KAAK,CAAC,GAAG,eACV,IAAI,YAEd,KAAK,CAAC,IAAI,IANN,KAAK,CAAC,GAAG,CAOR,CACT,CAAC;wBACJ,CAAC,CAAC,GACG,CACR,IACO,EACV,4BAAe,kBAAkB,EAAC,SAAS,EAAC,iDAAiD,aAC3F,KAAC,WAAW,IAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAI,EAClD,QAAQ,IACL,IACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { PaletteColor } from "./palette.js";
|
|
4
|
+
export interface MarkPopoverProps {
|
|
5
|
+
/** The mark's colour: a palette colour that means the worst of what it lists. */
|
|
6
|
+
readonly color: PaletteColor;
|
|
7
|
+
readonly icon: LucideIcon;
|
|
8
|
+
readonly count: number;
|
|
9
|
+
/** The mark's accessible name: what it counts and that it opens a list. */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly heading: string;
|
|
12
|
+
readonly closeLabel: string;
|
|
13
|
+
/** Extra `data-*` attributes kept on the button. */
|
|
14
|
+
readonly buttonData?: Readonly<Record<`data-${string}`, string | undefined>>;
|
|
15
|
+
/** The entries, as phrasing elements with `role="listitem"`. */
|
|
16
|
+
readonly children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare function MarkPopover({ color, icon: Icon, count, label, heading, closeLabel, buttonData, children }: MarkPopoverProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=MarkPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkPopover.d.ts","sourceRoot":"","sources":["../../src/notion/MarkPopover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC7E,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAMD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BA8C3H"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { badgeVariants } from "../ui/badge.js";
|
|
5
|
+
import { buttonVariants } from "../ui/button.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
8
|
+
// A counted tag (open warnings, tickets to buy) that opens a list of what it counts. The browser's Popover API opens
|
|
9
|
+
// it on click or Enter and closes it on Escape or a click outside, with no client state; the panel sits in the top
|
|
10
|
+
// layer, so a card's overflow never clips it. Centred on a phone, under its mark where CSS anchor positioning works.
|
|
11
|
+
// Phrasing elements only, so the mark fits inside a `<summary>` or a paragraph.
|
|
12
|
+
export function MarkPopover({ color, icon: Icon, count, label, heading, closeLabel, buttonData, children }) {
|
|
13
|
+
const panelId = useId();
|
|
14
|
+
return (_jsxs("span", { "data-slot": "mark", className: "inline-flex [anchor-scope:--mark]", children: [_jsxs("button", { type: "button", className: cn(badgeVariants({ variant: "tag", color }), "cursor-pointer gap-1 font-medium tabular-nums [anchor-name:--mark] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"), ...buttonData, popoverTarget: panelId, "aria-haspopup": "dialog", "aria-label": label, children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), _jsx("span", { "aria-hidden": "true", children: count })] }), _jsxs("span", { id: panelId, popover: "auto", role: "dialog", "aria-labelledby": `${panelId}-heading`, "data-slot": "mark-popover", className: "max-h-[min(24rem,calc(100vh-2rem))] w-[min(22rem,calc(100vw-2rem))] cursor-auto overflow-y-auto rounded-xl bg-popover p-3 text-left text-ui font-normal whitespace-normal text-popover-foreground shadow-menu backdrop:bg-transparent sm:supports-[position-anchor:--mark]:mt-1 sm:supports-[position-anchor:--mark]:mr-0 sm:supports-[position-anchor:--mark]:mb-0 sm:supports-[position-anchor:--mark]:ml-0 sm:supports-[position-anchor:--mark]:[position-anchor:--mark] sm:supports-[position-anchor:--mark]:[position-area:block-end_span-inline-start] sm:supports-[position-anchor:--mark]:[position-try-fallbacks:flip-block,flip-inline]", onClick: keepEnclosingDetailsFolded, children: [_jsxs("span", { className: "mb-2 flex items-center justify-between gap-2", children: [_jsx("span", { id: `${panelId}-heading`, className: "text-ui-medium", children: heading }), _jsx("button", { type: "button", className: buttonVariants({ variant: "ghost", size: "xs" }), popoverTarget: panelId, popoverTargetAction: "hide", children: closeLabel })] }), _jsx("span", { role: "list", className: "flex flex-col gap-2", children: children })] })] }));
|
|
15
|
+
}
|
|
16
|
+
// A click on the panel's text would toggle an enclosing `<details>` (the mark sits in its summary); links and
|
|
17
|
+
// buttons inside keep their default.
|
|
18
|
+
function keepEnclosingDetailsFolded(event) {
|
|
19
|
+
if (event.target instanceof Element && event.target.closest("a, button") === null)
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=MarkPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkPopover.js","sourceRoot":"","sources":["../../src/notion/MarkPopover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,KAAK,EAAmC,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAkBrD,qHAAqH;AACrH,mHAAmH;AACnH,qHAAqH;AACrH,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAoB;IAC1H,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,OAAO,CACL,6BAAgB,MAAM,EAAC,SAAS,EAAC,mCAAmC,aAClE,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,aAAa,CAAC,EAAE,OAA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|
description?: ReactNode;
|
|
11
12
|
actions?: ReactNode;
|
|
12
13
|
children?: ReactNode;
|
|
13
14
|
className?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare function PageHeader({ title, crumbs, icon, description, actions, children, className }: PageHeaderProps): import("react").JSX.Element;
|
|
16
|
+
export declare function PageHeader({ title, crumbs, crumbsLabel, icon, description, actions, children, className }: PageHeaderProps): import("react").JSX.Element;
|
|
16
17
|
//# sourceMappingURL=PageHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/notion/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYjD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IAErB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/notion/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYjD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BA8B1H"}
|
|
@@ -3,7 +3,7 @@ import { Fragment } from "react";
|
|
|
3
3
|
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "../ui/breadcrumb.js";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
// The page's header, once per screen: breadcrumb, page icon, the 40 px title, what follows it, a description and actions.
|
|
6
|
-
export function PageHeader({ title, crumbs, icon, description, actions, children, className }) {
|
|
7
|
-
return (_jsxs("header", { "data-slot": "page-header", className: cn("flex flex-col", className), children: [crumbs && crumbs.length > 0 ? (_jsx(Breadcrumb, { children: _jsx(BreadcrumbList, { children: crumbs.map((crumb, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(BreadcrumbSeparator, {}) : null, _jsx(BreadcrumbItem, { children: crumb.href === undefined ? (_jsx(BreadcrumbPage, { children: crumb.label })) : (_jsx(BreadcrumbLink, { href: crumb.href, children: crumb.label })) })] }, `${index}-${crumb.label}`))) }) })) : null, icon ? (_jsx("div", { className: "mt-6 mb-2 flex size-14 items-center justify-center rounded-xl bg-secondary [&>svg]:size-8", children: icon })) : null, _jsx("h1", { className: "text-page-title text-balance", children: title }), children, description ? _jsx("p", { className: "mt-1 text-body text-muted-foreground", children: description }) : null, actions ? _jsx("div", { className: "mt-3 flex flex-wrap gap-1", children: actions }) : null] }));
|
|
6
|
+
export function PageHeader({ title, crumbs, crumbsLabel, icon, description, actions, children, className }) {
|
|
7
|
+
return (_jsxs("header", { "data-slot": "page-header", className: cn("flex flex-col", className), children: [crumbs && crumbs.length > 0 ? (_jsx(Breadcrumb, { ...(crumbsLabel === undefined ? {} : { "aria-label": crumbsLabel }), children: _jsx(BreadcrumbList, { children: crumbs.map((crumb, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(BreadcrumbSeparator, {}) : null, _jsx(BreadcrumbItem, { children: crumb.href === undefined ? (_jsx(BreadcrumbPage, { children: crumb.label })) : (_jsx(BreadcrumbLink, { href: crumb.href, children: crumb.label })) })] }, `${index}-${crumb.label}`))) }) })) : null, icon ? (_jsx("div", { className: "mt-6 mb-2 flex size-14 items-center justify-center rounded-xl bg-secondary [&>svg]:size-8", children: icon })) : null, _jsx("h1", { className: "text-page-title text-balance", children: title }), children, description ? _jsx("p", { className: "mt-1 text-body text-muted-foreground", children: description }) : null, actions ? _jsx("div", { className: "mt-3 flex flex-wrap gap-1", children: actions }) : null] }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/notion/PageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEjD,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/notion/PageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEjD,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,IAAI,EACR,aAAI,SAAS,EAAC,8BAA8B,YAAE,KAAK,GAAM,EACxD,QAAQ,EACR,WAAW,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,sCAAsC,YAAE,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,EAC1F,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,2BAA2B,YAAE,OAAO,GAAO,CAAC,CAAC,CAAC,IAAI,IACrE,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type SidePanelLayout = "over" | "beside" | "left" | "list";
|
|
3
|
+
export interface SidePanelProps {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly heading: string;
|
|
6
|
+
readonly layout: SidePanelLayout;
|
|
7
|
+
readonly isOpen: boolean;
|
|
8
|
+
readonly onClose: () => void;
|
|
9
|
+
readonly closeLabel?: string;
|
|
10
|
+
readonly children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function SidePanel({ id, heading, layout, isOpen, onClose, closeLabel, children }: SidePanelProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=SidePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS9E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,cAAc;IAE7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAE7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAID,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAqC,EAAE,QAAQ,EAAE,EAAE,cAAc,+BA2ClI"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
import { en as messages } from "../messages/en.js";
|
|
6
|
+
import { Button } from "../ui/button.js";
|
|
7
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
8
|
+
// A non-modal panel at a side of a canvas (a map) that leaves the canvas usable. Its parent is a `relative` flex row
|
|
9
|
+
// holding the canvas and the panel. Hidden while closed, so its content leaves the reading order.
|
|
10
|
+
export function SidePanel({ id, heading, layout, isOpen, onClose, closeLabel = messages.sidePanel.close, children }) {
|
|
11
|
+
const panelRef = useRef(null);
|
|
12
|
+
const wasOpenRef = useRef(isOpen);
|
|
13
|
+
const headingId = `${id}-heading`;
|
|
14
|
+
// Focus moves in when the panel opens, not when it is open on first render.
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (isOpen && !wasOpenRef.current)
|
|
17
|
+
panelRef.current?.focus();
|
|
18
|
+
wasOpenRef.current = isOpen;
|
|
19
|
+
}, [isOpen]);
|
|
20
|
+
function closeOnEscape(event) {
|
|
21
|
+
if (event.key !== "Escape")
|
|
22
|
+
return;
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
onClose();
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs("aside", { ref: panelRef, id: id, tabIndex: -1, "data-slot": "side-panel", className: "absolute inset-y-0 right-0 z-3 flex w-[min(24rem,100%)] flex-col border-l border-border bg-background text-foreground shadow-menu outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[layout=beside]:relative data-[layout=beside]:w-auto data-[layout=beside]:max-w-full data-[layout=beside]:flex-[0_0_max(50%,24rem)] data-[layout=left]:right-auto data-[layout=left]:left-0 data-[layout=left]:border-r data-[layout=left]:border-l-0 max-sm:data-[layout=beside]:absolute max-sm:data-[layout=beside]:inset-0 max-sm:data-[layout=beside]:w-full max-sm:data-[layout=beside]:border-l-0 data-[layout=list]:relative data-[layout=list]:flex-none data-[layout=list]:border-r data-[layout=list]:border-l-0 max-sm:data-[layout=list]:absolute max-sm:data-[layout=list]:inset-0 max-sm:data-[layout=list]:w-full max-sm:data-[layout=list]:border-r-0 [&[hidden]]:hidden", "data-layout": layout, hidden: !isOpen, "aria-labelledby": headingId, "data-testid": id, onKeyDown: closeOnEscape, children: [_jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border py-2 pr-2 pl-4", children: [_jsx("h2", { id: headingId, className: "text-heading-3", children: heading }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": closeLabel, onClick: onClose, children: _jsx(X, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) })] }), _jsx("div", { "data-slot": "side-panel-content", className: "grid flex-1 content-start gap-3 overflow-y-auto p-3", children: children })] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=SidePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAsC,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE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AAE,OAAO,EAAE,OAAO,YACxF,KAAC,CAAC,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GACjD,IACL,EACN,2BAAe,oBAAoB,EAAC,SAAS,EAAC,qDAAqD,YAChG,QAAQ,GACL,IACA,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { Button } from "../ui/button.js";
|
|
3
|
+
export interface SortableAnnouncements {
|
|
4
|
+
readonly pickedUp: string;
|
|
5
|
+
readonly moved: string;
|
|
6
|
+
readonly dropped: string;
|
|
7
|
+
readonly cancelled: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SortableMove {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly from: number;
|
|
12
|
+
readonly to: number;
|
|
13
|
+
}
|
|
14
|
+
export type SortableDragBy = "row" | "handle";
|
|
15
|
+
export interface SortableListProps extends Omit<ComponentProps<"ul">, "children"> {
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly items: readonly string[];
|
|
18
|
+
readonly onReorder: (next: string[], move: SortableMove) => void;
|
|
19
|
+
readonly dragBy?: SortableDragBy;
|
|
20
|
+
readonly holdDelay?: number;
|
|
21
|
+
readonly tolerance?: number;
|
|
22
|
+
readonly instructions?: string;
|
|
23
|
+
readonly announcements?: Partial<SortableAnnouncements>;
|
|
24
|
+
readonly getItemLabel?: (id: string) => string;
|
|
25
|
+
readonly children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function SortableList({ label, items, onReorder, dragBy, holdDelay, tolerance, instructions, announcements, getItemLabel, className, children, ...props }: SortableListProps): import("react").JSX.Element;
|
|
28
|
+
export interface SortableItemProps extends ComponentProps<"li"> {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function SortableItem({ id, className, style, children, ...props }: SortableItemProps): import("react").JSX.Element;
|
|
32
|
+
export interface SortableHandleProps extends Omit<ComponentProps<typeof Button>, "children"> {
|
|
33
|
+
readonly label?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function SortableHandle({ label, className, ...props }: SortableHandleProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=Sortable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sortable.d.ts","sourceRoot":"","sources":["../../src/notion/Sortable.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAA4C,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAItG,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAE/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAElC,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;IAEjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAExD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAwBD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAc,EACd,SAAe,EACf,SAAa,EACb,YAA6C,EAC7C,aAAa,EACb,YAAyB,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAkEnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,IAAI,CAAC;IAE7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAuB3F;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC;IAE1F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,wBAAgB,cAAc,CAAC,EAAE,KAAgC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAqB5G"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { closestCenter, DndContext, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors, } from "@dnd-kit/core";
|
|
4
|
+
import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable";
|
|
5
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
6
|
+
import { GripVertical } from "lucide-react";
|
|
7
|
+
import { createContext, useContext, useId, useRef } from "react";
|
|
8
|
+
import { en as messages } from "../messages/en.js";
|
|
9
|
+
import { cn } from "../lib/utils.js";
|
|
10
|
+
import { Button } from "../ui/button.js";
|
|
11
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
12
|
+
const HANDLE_MOUSE_DISTANCE = 4;
|
|
13
|
+
// The row follows the pointer up and down only.
|
|
14
|
+
const restrictToVerticalAxis = ({ transform }) => ({ ...transform, x: 0 });
|
|
15
|
+
function fillAnnouncement(template, values) {
|
|
16
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => (key in values ? String(values[key]) : match));
|
|
17
|
+
}
|
|
18
|
+
const SortableListContext = createContext({ dragBy: "row" });
|
|
19
|
+
const SortableHandleContext = createContext(null);
|
|
20
|
+
// A list whose rows are reordered by dragging: a long press lifts a row on a touch screen (a swipe before the hold
|
|
21
|
+
// still scrolls, a tap still activates the row), a mouse drags it, the keyboard picks it up with Space or Enter and
|
|
22
|
+
// moves it with the arrows. The order stays with the app: `onReorder` gets the new one.
|
|
23
|
+
export function SortableList({ label, items, onReorder, dragBy = "row", holdDelay = 500, tolerance = 8, instructions = messages.sortable.instructions, announcements, getItemLabel = (id) => id, className, children, ...props }) {
|
|
24
|
+
const contextId = useId();
|
|
25
|
+
const hold = { delay: holdDelay, tolerance };
|
|
26
|
+
const sensors = useSensors(useSensor(MouseSensor, {
|
|
27
|
+
activationConstraint: dragBy === "handle" ? { distance: HANDLE_MOUSE_DISTANCE } : hold,
|
|
28
|
+
}), useSensor(TouchSensor, { activationConstraint: hold }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
29
|
+
const copy = { ...messages.sortable, ...announcements };
|
|
30
|
+
const lastOverId = useRef(null);
|
|
31
|
+
const total = items.length;
|
|
32
|
+
function announce(template, id, overId) {
|
|
33
|
+
const position = items.indexOf(String(overId ?? id)) + 1;
|
|
34
|
+
return fillAnnouncement(template, { item: getItemLabel(String(id)), position, total });
|
|
35
|
+
}
|
|
36
|
+
const liveAnnouncements = {
|
|
37
|
+
onDragStart: ({ active }) => {
|
|
38
|
+
lastOverId.current = active.id;
|
|
39
|
+
return announce(copy.pickedUp, active.id);
|
|
40
|
+
},
|
|
41
|
+
onDragOver: ({ active, over }) => {
|
|
42
|
+
// The first `over` of a drag is the row's own place: keep the "picked up" announcement.
|
|
43
|
+
if (!over || over.id === lastOverId.current)
|
|
44
|
+
return undefined;
|
|
45
|
+
lastOverId.current = over.id;
|
|
46
|
+
return announce(copy.moved, active.id, over.id);
|
|
47
|
+
},
|
|
48
|
+
onDragEnd: ({ active, over }) => announce(over ? copy.dropped : copy.cancelled, active.id, over?.id),
|
|
49
|
+
onDragCancel: ({ active }) => announce(copy.cancelled, active.id),
|
|
50
|
+
};
|
|
51
|
+
function handleDragEnd({ active, over }) {
|
|
52
|
+
if (!over || active.id === over.id)
|
|
53
|
+
return;
|
|
54
|
+
const from = items.indexOf(String(active.id));
|
|
55
|
+
const to = items.indexOf(String(over.id));
|
|
56
|
+
if (from < 0 || to < 0)
|
|
57
|
+
return;
|
|
58
|
+
onReorder(arrayMove([...items], from, to), { id: String(active.id), from, to });
|
|
59
|
+
}
|
|
60
|
+
return (_jsx(DndContext, { id: contextId, sensors: sensors, collisionDetection: closestCenter, modifiers: [restrictToVerticalAxis], accessibility: { announcements: liveAnnouncements, screenReaderInstructions: { draggable: instructions } }, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: [...items], strategy: verticalListSortingStrategy, children: _jsx(SortableListContext.Provider, { value: { dragBy }, children: _jsx("ul", { "aria-label": label, "data-slot": "sortable-list", "data-drag-by": dragBy, className: cn("flex flex-col", className), ...props, children: children }) }) }) }));
|
|
61
|
+
}
|
|
62
|
+
// The lifted row floats on `accent-strong` with `shadow-menu`, above its siblings; `data-dragging` marks it.
|
|
63
|
+
const SORTABLE_ITEM = "rounded-md bg-background outline-none touch-manipulation select-none [-webkit-touch-callout:none] focus-visible:ring-2 focus-visible:ring-ring data-[dragging]:relative data-[dragging]:z-10 data-[dragging]:bg-accent-strong data-[dragging]:shadow-menu";
|
|
64
|
+
// One row of a `SortableList`. In `row` mode the row itself is the drag target and is focusable; in `handle` mode a
|
|
65
|
+
// `SortableHandle` inside it is. The drag's own pointer and key handlers win over the same props on the drag target.
|
|
66
|
+
export function SortableItem({ id, className, style, children, ...props }) {
|
|
67
|
+
const { dragBy } = useContext(SortableListContext);
|
|
68
|
+
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({
|
|
69
|
+
id,
|
|
70
|
+
attributes: { role: "listitem" },
|
|
71
|
+
});
|
|
72
|
+
const rowBinding = dragBy === "row" ? { ...attributes, ...listeners } : {};
|
|
73
|
+
return (_jsx(SortableHandleContext.Provider, { value: { attributes, listeners, setActivatorNodeRef }, children: _jsx("li", { ref: setNodeRef, "data-slot": "sortable-item", "data-id": id, "data-dragging": isDragging ? "" : undefined, className: cn(SORTABLE_ITEM, className), style: { ...style, transform: CSS.Translate.toString(transform), transition }, ...props, ...rowBinding, children: children }) }));
|
|
74
|
+
}
|
|
75
|
+
// A grip button that drags its row, for a list with `dragBy="handle"`.
|
|
76
|
+
export function SortableHandle({ label = messages.sortable.handle, className, ...props }) {
|
|
77
|
+
const binding = useContext(SortableHandleContext);
|
|
78
|
+
if (!binding)
|
|
79
|
+
throw new Error("SortableHandle failed: it must be rendered inside a SortableItem");
|
|
80
|
+
const { attributes, listeners, setActivatorNodeRef } = binding;
|
|
81
|
+
return (_jsx(Button, { ref: setActivatorNodeRef, type: "button", variant: "ghost", size: "icon-sm", "data-slot": "sortable-handle", className: cn("cursor-grab touch-none text-muted-foreground active:cursor-grabbing", className), ...props, ...attributes, ...listeners, role: "button", "aria-label": label, children: _jsx(GripVertical, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
82
|
+
}
|
|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