@ttt-productions/ui-core 0.11.27 → 0.11.29
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/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/reload-recovery-watch.d.ts +13 -0
- package/dist/browser/reload-recovery-watch.d.ts.map +1 -0
- package/dist/browser/reload-recovery-watch.js +34 -0
- package/dist/browser/reload-recovery-watch.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/reload-recovery.d.ts +15 -0
- package/dist/lib/reload-recovery.d.ts.map +1 -0
- package/dist/lib/reload-recovery.js +38 -0
- package/dist/lib/reload-recovery.js.map +1 -0
- package/dist/react/components/button.d.ts +3 -2
- package/dist/react/components/button.d.ts.map +1 -1
- package/dist/react/components/button.js +1 -1
- package/dist/react/components/button.js.map +1 -1
- package/dist/react/components/dropdown-menu.d.ts +2 -1
- package/dist/react/components/dropdown-menu.d.ts.map +1 -1
- package/dist/react/components/dropdown-menu.js +1 -1
- package/dist/react/components/dropdown-menu.js.map +1 -1
- package/dist/react/components/reload-recovery-notice.d.ts +27 -0
- package/dist/react/components/reload-recovery-notice.d.ts.map +1 -0
- package/dist/react/components/reload-recovery-notice.js +21 -0
- package/dist/react/components/reload-recovery-notice.js.map +1 -0
- package/dist/react/components/select.d.ts +2 -1
- package/dist/react/components/select.d.ts.map +1 -1
- package/dist/react/components/select.js +1 -1
- package/dist/react/components/select.js.map +1 -1
- package/dist/react/components/switch.d.ts +2 -2
- package/dist/react/components/switch.js +1 -1
- package/dist/react/components/switch.js.map +1 -1
- package/dist/react/components/toast.d.ts +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Browser runtime with no React: what a client entry starts before the app mounts.\nexport { createReloadRecoveryWatch } from \"./reload-recovery-watch.js\";\nexport type { ReloadRecoveryTarget, ReloadRecoveryWatch } from \"./reload-recovery-watch.js\";\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReloadRecoveryKind } from "../lib/reload-recovery.js";
|
|
2
|
+
/** What the watch listens on: the page's window. */
|
|
3
|
+
export type ReloadRecoveryTarget = Pick<Window, "addEventListener" | "removeEventListener">;
|
|
4
|
+
export interface ReloadRecoveryWatch {
|
|
5
|
+
/** The first failure only a reload repairs since the watch started, or `null` while there is none. */
|
|
6
|
+
current: () => ReloadRecoveryKind | null;
|
|
7
|
+
/** Calls `listener` once, when the first failure is recorded. Answers the unsubscribe. */
|
|
8
|
+
subscribe: (listener: () => void) => () => void;
|
|
9
|
+
/** Stops listening; a failure already recorded stays. */
|
|
10
|
+
stop: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createReloadRecoveryWatch(target?: ReloadRecoveryTarget): ReloadRecoveryWatch;
|
|
13
|
+
//# sourceMappingURL=reload-recovery-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery-watch.d.ts","sourceRoot":"","sources":["../../src/browser/reload-recovery-watch.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,oDAAoD;AACpD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,CAAC,CAAC;AAE5F,MAAM,WAAW,mBAAmB;IAClC,sGAAsG;IACtG,OAAO,EAAE,MAAM,kBAAkB,GAAG,IAAI,CAAC;IACzC,0FAA0F;IAC1F,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAChD,yDAAyD;IACzD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,GAAE,oBAA6B,GAAG,mBAAmB,CA6BpG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Watches the page for the first failure only a reload repairs. Started once at the app's client
|
|
2
|
+
// entry, before React mounts, so a failure raised during startup is recorded for the notice to show
|
|
3
|
+
// once it mounts. It only listens: it never calls `preventDefault`, so the app's monitoring still
|
|
4
|
+
// captures every event once, and it never reloads the page.
|
|
5
|
+
import { reloadRecoveryKindOf } from "../lib/reload-recovery.js";
|
|
6
|
+
export function createReloadRecoveryWatch(target = window) {
|
|
7
|
+
let recorded = null;
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
const record = (kind) => {
|
|
10
|
+
// The first failure stands: a repeat of it, or the other one after it, changes nothing.
|
|
11
|
+
if (kind === null || recorded !== null)
|
|
12
|
+
return;
|
|
13
|
+
recorded = kind;
|
|
14
|
+
for (const listener of [...listeners])
|
|
15
|
+
listener();
|
|
16
|
+
};
|
|
17
|
+
// An error event's `error` is the thrown value; a cross-origin script's carries only the message.
|
|
18
|
+
const onError = (event) => record(reloadRecoveryKindOf(event.error) ?? reloadRecoveryKindOf({ message: event.message }));
|
|
19
|
+
const onRejection = (event) => record(reloadRecoveryKindOf(event.reason));
|
|
20
|
+
target.addEventListener("error", onError);
|
|
21
|
+
target.addEventListener("unhandledrejection", onRejection);
|
|
22
|
+
return {
|
|
23
|
+
current: () => recorded,
|
|
24
|
+
subscribe: (listener) => {
|
|
25
|
+
listeners.add(listener);
|
|
26
|
+
return () => listeners.delete(listener);
|
|
27
|
+
},
|
|
28
|
+
stop: () => {
|
|
29
|
+
target.removeEventListener("error", onError);
|
|
30
|
+
target.removeEventListener("unhandledrejection", onRejection);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=reload-recovery-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery-watch.js","sourceRoot":"","sources":["../../src/browser/reload-recovery-watch.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,oGAAoG;AACpG,kGAAkG;AAClG,4DAA4D;AAE5D,OAAO,EAAE,oBAAoB,EAA2B,MAAM,2BAA2B,CAAC;AAc1F,MAAM,UAAU,yBAAyB,CAAC,SAA+B,MAAM;IAC7E,IAAI,QAAQ,GAA8B,IAAI,CAAC;IAC/C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAExC,MAAM,MAAM,GAAG,CAAC,IAA+B,EAAE,EAAE;QACjD,wFAAwF;QACxF,IAAI,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO;QAC/C,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC;YAAE,QAAQ,EAAE,CAAC;IACpD,CAAC,CAAC;IACF,kGAAkG;IAClG,MAAM,OAAO,GAAG,CAAC,KAAiB,EAAE,EAAE,CACpC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAChG,MAAM,WAAW,GAAG,CAAC,KAA4B,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjG,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;IAE3D,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ;QACvB,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;YACtB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,EAAE,GAAG,EAAE;YACT,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Watches the page for the first failure only a reload repairs. Started once at the app's client\n// entry, before React mounts, so a failure raised during startup is recorded for the notice to show\n// once it mounts. It only listens: it never calls `preventDefault`, so the app's monitoring still\n// captures every event once, and it never reloads the page.\n\nimport { reloadRecoveryKindOf, type ReloadRecoveryKind } from \"../lib/reload-recovery.js\";\n\n/** What the watch listens on: the page's window. */\nexport type ReloadRecoveryTarget = Pick<Window, \"addEventListener\" | \"removeEventListener\">;\n\nexport interface ReloadRecoveryWatch {\n /** The first failure only a reload repairs since the watch started, or `null` while there is none. */\n current: () => ReloadRecoveryKind | null;\n /** Calls `listener` once, when the first failure is recorded. Answers the unsubscribe. */\n subscribe: (listener: () => void) => () => void;\n /** Stops listening; a failure already recorded stays. */\n stop: () => void;\n}\n\nexport function createReloadRecoveryWatch(target: ReloadRecoveryTarget = window): ReloadRecoveryWatch {\n let recorded: ReloadRecoveryKind | null = null;\n const listeners = new Set<() => void>();\n\n const record = (kind: ReloadRecoveryKind | null) => {\n // The first failure stands: a repeat of it, or the other one after it, changes nothing.\n if (kind === null || recorded !== null) return;\n recorded = kind;\n for (const listener of [...listeners]) listener();\n };\n // An error event's `error` is the thrown value; a cross-origin script's carries only the message.\n const onError = (event: ErrorEvent) =>\n record(reloadRecoveryKindOf(event.error) ?? reloadRecoveryKindOf({ message: event.message }));\n const onRejection = (event: PromiseRejectionEvent) => record(reloadRecoveryKindOf(event.reason));\n\n target.addEventListener(\"error\", onError);\n target.addEventListener(\"unhandledrejection\", onRejection);\n\n return {\n current: () => recorded,\n subscribe: (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n stop: () => {\n target.removeEventListener(\"error\", onError);\n target.removeEventListener(\"unhandledrejection\", onRejection);\n },\n };\n}\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC","sourcesContent":["// Server-safe utilities only. React components and hooks live behind ./react.\nexport * from \"./lib/utils.js\";\nexport * from \"./lib/format-numbers.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC","sourcesContent":["// Server-safe utilities only. React components and hooks live behind ./react.\nexport * from \"./lib/utils.js\";\nexport * from \"./lib/format-numbers.js\";\nexport * from \"./lib/reload-recovery.js\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Each failure only a reload repairs. */
|
|
2
|
+
export declare const RELOAD_RECOVERY_KINDS: readonly ["storageDisconnect", "staleChunk"];
|
|
3
|
+
export type ReloadRecoveryKind = (typeof RELOAD_RECOVERY_KINDS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* WebKit dropping a page's IndexedDB connection when it reclaims a backgrounded tab: an
|
|
6
|
+
* `UnknownError` whose message says the connection to the Indexed Database server was lost. Every
|
|
7
|
+
* storage call after it fails until the page reloads. No other `UnknownError`, and no quota, blocked
|
|
8
|
+
* storage, or network failure, is this one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isStorageDisconnectError(reason: unknown): boolean;
|
|
11
|
+
/** A code chunk the deployed build no longer serves: a `ChunkLoadError`, or "Failed to load chunk". */
|
|
12
|
+
export declare function isStaleChunkError(reason: unknown): boolean;
|
|
13
|
+
/** Which failure only a reload repairs `reason` is, or `null` for any other. */
|
|
14
|
+
export declare function reloadRecoveryKindOf(reason: unknown): ReloadRecoveryKind | null;
|
|
15
|
+
//# sourceMappingURL=reload-recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery.d.ts","sourceRoot":"","sources":["../../src/lib/reload-recovery.ts"],"names":[],"mappings":"AAGA,0CAA0C;AAC1C,eAAO,MAAM,qBAAqB,8CAA+C,CAAC;AAClF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAaxE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAKjE;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAK1D;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAI/E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// The failures that leave a page only a reload repairs, recognised narrowly. Server-safe: pure
|
|
2
|
+
// predicates over whatever an `error` or `unhandledrejection` event carries.
|
|
3
|
+
/** Each failure only a reload repairs. */
|
|
4
|
+
export const RELOAD_RECOVERY_KINDS = ["storageDisconnect", "staleChunk"];
|
|
5
|
+
const STORAGE_DISCONNECT_NAME = "UnknownError";
|
|
6
|
+
const STORAGE_DISCONNECT_MESSAGE = "Connection to Indexed Database server lost";
|
|
7
|
+
const STALE_CHUNK_NAME = "ChunkLoadError";
|
|
8
|
+
const STALE_CHUNK_MESSAGE = "Failed to load chunk";
|
|
9
|
+
function fieldOf(reason, field) {
|
|
10
|
+
if (typeof reason !== "object" || reason === null)
|
|
11
|
+
return null;
|
|
12
|
+
const value = reason[field];
|
|
13
|
+
return typeof value === "string" ? value : null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* WebKit dropping a page's IndexedDB connection when it reclaims a backgrounded tab: an
|
|
17
|
+
* `UnknownError` whose message says the connection to the Indexed Database server was lost. Every
|
|
18
|
+
* storage call after it fails until the page reloads. No other `UnknownError`, and no quota, blocked
|
|
19
|
+
* storage, or network failure, is this one.
|
|
20
|
+
*/
|
|
21
|
+
export function isStorageDisconnectError(reason) {
|
|
22
|
+
return (fieldOf(reason, "name") === STORAGE_DISCONNECT_NAME &&
|
|
23
|
+
(fieldOf(reason, "message")?.includes(STORAGE_DISCONNECT_MESSAGE) ?? false));
|
|
24
|
+
}
|
|
25
|
+
/** A code chunk the deployed build no longer serves: a `ChunkLoadError`, or "Failed to load chunk". */
|
|
26
|
+
export function isStaleChunkError(reason) {
|
|
27
|
+
return (fieldOf(reason, "name") === STALE_CHUNK_NAME ||
|
|
28
|
+
(fieldOf(reason, "message")?.includes(STALE_CHUNK_MESSAGE) ?? false));
|
|
29
|
+
}
|
|
30
|
+
/** Which failure only a reload repairs `reason` is, or `null` for any other. */
|
|
31
|
+
export function reloadRecoveryKindOf(reason) {
|
|
32
|
+
if (isStorageDisconnectError(reason))
|
|
33
|
+
return "storageDisconnect";
|
|
34
|
+
if (isStaleChunkError(reason))
|
|
35
|
+
return "staleChunk";
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=reload-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery.js","sourceRoot":"","sources":["../../src/lib/reload-recovery.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,6EAA6E;AAE7E,0CAA0C;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAU,CAAC;AAGlF,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAC/C,MAAM,0BAA0B,GAAG,4CAA4C,CAAC;AAChF,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAC1C,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAEnD,SAAS,OAAO,CAAC,MAAe,EAAE,KAAyB;IACzD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/D,MAAM,KAAK,GAAI,MAAkC,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAe;IACtD,OAAO,CACL,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,uBAAuB;QACnD,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,0BAA0B,CAAC,IAAI,KAAK,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,OAAO,CACL,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,gBAAgB;QAC5C,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC,IAAI,KAAK,CAAC,CACrE,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAClD,IAAI,wBAAwB,CAAC,MAAM,CAAC;QAAE,OAAO,mBAAmB,CAAC;IACjE,IAAI,iBAAiB,CAAC,MAAM,CAAC;QAAE,OAAO,YAAY,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// The failures that leave a page only a reload repairs, recognised narrowly. Server-safe: pure\n// predicates over whatever an `error` or `unhandledrejection` event carries.\n\n/** Each failure only a reload repairs. */\nexport const RELOAD_RECOVERY_KINDS = [\"storageDisconnect\", \"staleChunk\"] as const;\nexport type ReloadRecoveryKind = (typeof RELOAD_RECOVERY_KINDS)[number];\n\nconst STORAGE_DISCONNECT_NAME = \"UnknownError\";\nconst STORAGE_DISCONNECT_MESSAGE = \"Connection to Indexed Database server lost\";\nconst STALE_CHUNK_NAME = \"ChunkLoadError\";\nconst STALE_CHUNK_MESSAGE = \"Failed to load chunk\";\n\nfunction fieldOf(reason: unknown, field: \"name\" | \"message\"): string | null {\n if (typeof reason !== \"object\" || reason === null) return null;\n const value = (reason as Record<string, unknown>)[field];\n return typeof value === \"string\" ? value : null;\n}\n\n/**\n * WebKit dropping a page's IndexedDB connection when it reclaims a backgrounded tab: an\n * `UnknownError` whose message says the connection to the Indexed Database server was lost. Every\n * storage call after it fails until the page reloads. No other `UnknownError`, and no quota, blocked\n * storage, or network failure, is this one.\n */\nexport function isStorageDisconnectError(reason: unknown): boolean {\n return (\n fieldOf(reason, \"name\") === STORAGE_DISCONNECT_NAME &&\n (fieldOf(reason, \"message\")?.includes(STORAGE_DISCONNECT_MESSAGE) ?? false)\n );\n}\n\n/** A code chunk the deployed build no longer serves: a `ChunkLoadError`, or \"Failed to load chunk\". */\nexport function isStaleChunkError(reason: unknown): boolean {\n return (\n fieldOf(reason, \"name\") === STALE_CHUNK_NAME ||\n (fieldOf(reason, \"message\")?.includes(STALE_CHUNK_MESSAGE) ?? false)\n );\n}\n\n/** Which failure only a reload repairs `reason` is, or `null` for any other. */\nexport function reloadRecoveryKindOf(reason: unknown): ReloadRecoveryKind | null {\n if (isStorageDisconnectError(reason)) return \"storageDisconnect\";\n if (isStaleChunkError(reason)) return \"staleChunk\";\n return null;\n}\n"]}
|
|
@@ -11,8 +11,9 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
11
11
|
* click, a key press, a form's implicit submit — sets `aria-disabled` and
|
|
12
12
|
* `aria-busy`, and shows the canonical spinner: an icon button (`size="icon"`)
|
|
13
13
|
* swaps its icon for it; any other button shows it in place of its `icon`. It is
|
|
14
|
-
* never natively disabled
|
|
15
|
-
* keeps focus
|
|
14
|
+
* never natively disabled while pending — a `disabled` passed alongside `pending`
|
|
15
|
+
* applies once pending ends — so the button the user just pressed keeps focus
|
|
16
|
+
* (FRONTEND-203).
|
|
16
17
|
*/
|
|
17
18
|
pending?: boolean;
|
|
18
19
|
/** Leading icon, rendered before the label. While `pending`, the spinner takes its place. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/react/components/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQjE,QAAA,MAAM,cAAc;;;8EAgCnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/react/components/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQjE,QAAA,MAAM,cAAc;;;8EAgCnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,QAAA,MAAM,MAAM,uFAmDX,CAAA;AAID,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -48,7 +48,7 @@ const Button = React.forwardRef(({ className, variant, size, asChild = false, pe
|
|
|
48
48
|
onKeyDownCapture: blockActivationKey,
|
|
49
49
|
}
|
|
50
50
|
: {}),
|
|
51
|
-
disabled: disabled || undefined,
|
|
51
|
+
disabled: (disabled && !pending) || undefined,
|
|
52
52
|
className: cn(buttonVariants({ variant, size, className })),
|
|
53
53
|
};
|
|
54
54
|
const spinner = _jsx(Spinner, { size: size === "lg" ? "sm" : "xs" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/react/components/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEnE,kGAAkG;AAClG,6EAA6E;AAC7E,MAAM,cAAc,GAAG,GAAG,CACxB,mWAAmW,EACnW;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,wHAAwH;YAC1H,WAAW,EACT,qHAAqH;YACvH,OAAO,EACL,sKAAsK;YACxK,OAAO,EACL,mGAAmG;YACrG,SAAS,EACP,qFAAqF;YACvF,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,iDAAiD;YACvD,QAAQ,EACN,yKAAyK;SAC5K;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,gBAAgB;YACzB,EAAE,EAAE,qBAAqB;YACzB,EAAE,EAAE,sBAAsB;YAC1B,IAAI,EAAE,SAAS;SAChB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/react/components/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEnE,kGAAkG;AAClG,6EAA6E;AAC7E,MAAM,cAAc,GAAG,GAAG,CACxB,mWAAmW,EACnW;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,wHAA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I,CAAC,CAAC,CAAC,IAAI,GAAI,CAAA;IAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;IAExC,IAAI,OAAO,EAAE,CAAC;QACZ,kFAAkF;QAClF,iEAAiE;QACjE,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,MAAC,IAAI,IAAC,GAAG,EAAE,GAAG,KAAM,MAAM,aACvB,OAAO,EACR,KAAC,SAAS,cAAE,QAAQ,GAAa,IAC5B,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,GAAG,EAAE,GAAG,KAAM,MAAM,YACvB,QAAQ,GACJ,CACR,CAAA;IACH,CAAC;IAED,OAAO,CACL,iBAAQ,GAAG,EAAE,GAAG,KAAM,MAAM,YACzB,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CACjB,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAC7B,CAAC,CAAC,CAAC,CACF,8BACG,OAAO,EACP,QAAQ,IACR,CACJ,GACM,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Slot, Slottable } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\nimport { blockActivationKey, blockEvent } from \"./pending-guard.js\"\n\n// `ui-button` is the stable hook an app's own stylesheet keys a rule for every button on (a press\n// effect), so it never has to match this component's private utility string.\nconst buttonVariants = cva(\n \"ui-button inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-bold ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"button-default bg-primary text-primary-foreground hover:bg-primary/90 border-2 border-[hsl(var(--brand-primary-deep))]\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 border-2 border-[hsl(var(--destructive-border))]\",\n success:\n \"bg-[color:var(--button-success)] text-[hsl(var(--success-foreground))] hover:bg-[color:var(--button-success)]/90 border-2 border-[hsl(var(--status-success-border))]\",\n outline:\n \"border-2 border-border bg-background hover:bg-accent hover:text-accent-foreground text-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-2 border-border\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n inverted:\n \"bg-[hsl(var(--inverted-background))] text-[hsl(var(--inverted-foreground))] hover:bg-[hsl(var(--inverted-background))]/90 border-2 border-[hsl(var(--inverted-border))]\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n /**\n * Async work this button started is in flight. The button ignores activation — a\n * click, a key press, a form's implicit submit — sets `aria-disabled` and\n * `aria-busy`, and shows the canonical spinner: an icon button (`size=\"icon\"`)\n * swaps its icon for it; any other button shows it in place of its `icon`. It is\n * never natively disabled while pending — a `disabled` passed alongside `pending`\n * applies once pending ends — so the button the user just pressed keeps focus\n * (FRONTEND-203).\n */\n pending?: boolean\n /** Leading icon, rendered before the label. While `pending`, the spinner takes its place. */\n icon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, pending = false, icon, disabled, children, ...props }, ref) => {\n const shared = {\n ...props,\n ...(pending\n ? {\n \"aria-busy\": true,\n \"aria-disabled\": true,\n \"data-pending\": \"\",\n // Stopped before any handler runs — the caller's, an `asChild` child's own, or a Radix\n // trigger's — so a click submits nothing, a link goes nowhere, and neither a pointer\n // press nor an activation key opens what the button triggers.\n onClickCapture: blockEvent,\n onPointerDownCapture: blockEvent,\n onKeyDownCapture: blockActivationKey,\n }\n : {}),\n disabled: (disabled && !pending) || undefined,\n className: cn(buttonVariants({ variant, size, className })),\n }\n const spinner = <Spinner size={size === \"lg\" ? \"sm\" : \"xs\"} />\n const leading = pending ? spinner : icon\n\n if (asChild) {\n // Slot finds the Slottable among its DIRECT children, so the leading slot and the\n // Slottable must be siblings here — never wrapped in a fragment.\n return leading ? (\n <Slot ref={ref} {...shared}>\n {leading}\n <Slottable>{children}</Slottable>\n </Slot>\n ) : (\n <Slot ref={ref} {...shared}>\n {children}\n </Slot>\n )\n }\n\n return (\n <button ref={ref} {...shared}>\n {size === \"icon\" ? (\n pending ? spinner : children\n ) : (\n <>\n {leading}\n {children}\n </>\n )}\n </button>\n )\n }\n)\n\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"]}
|
|
@@ -16,7 +16,8 @@ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMen
|
|
|
16
16
|
/**
|
|
17
17
|
* The action this item started is in flight: the item ignores selection, sets
|
|
18
18
|
* `aria-disabled` and `aria-busy`, and shows the spinner in place of its `icon`. It is
|
|
19
|
-
* never disabled
|
|
19
|
+
* never natively disabled while pending (a `disabled` passed alongside applies once pending
|
|
20
|
+
* ends), so it keeps focus (FRONTEND-203). Keeping the menu
|
|
20
21
|
* open meanwhile is the caller's `onSelect` (`event.preventDefault()`, close on settle).
|
|
21
22
|
*/
|
|
22
23
|
pending?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names":[],"mappings":"AAE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A;AAGF,QAAA,MAAM,qBAAqB,4KAmBzB,CAAA;AAGF,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAQjB,CAAA;AAGF,QAAA,MAAM,qBAAqB,4KASzB,CAAA;AAGF,QAAA,MAAM,oBAAoB;8BAGvB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAEvC,CAAA;AAGD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
|
|
@@ -26,7 +26,7 @@ function blockActivation(event) {
|
|
|
26
26
|
}
|
|
27
27
|
const DropdownMenuItem = React.forwardRef(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item", inset && "pl-8", className), ...props, ...(pending
|
|
28
28
|
? { "aria-busy": true, "aria-disabled": true, "data-pending": "", onClickCapture: blockActivation }
|
|
29
|
-
: {}), disabled: disabled || undefined, children: [pending ? _jsx(Spinner, { size: "xs" }) : icon, _jsx(Slottable, { children: children })] })));
|
|
29
|
+
: {}), disabled: (disabled && !pending) || undefined, children: [pending ? _jsx(Spinner, { size: "xs" }) : icon, _jsx(Slottable, { children: children })] })));
|
|
30
30
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
31
31
|
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
32
32
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAA;AAC/C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,CAAA;AACzD,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CAAA;AACrD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,MAAM,CAAA;AACvD,MAAM,eAAe,GAAG,qBAAqB,CAAC,GAAG,CAAA;AACjD,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,UAAU,CAAA;AAE/D,MAAM,sBAAsB,GAAG,KAAK,CAAC,UAAU,CAK7C,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EA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AAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAA;AAE/E,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE,CAAC,CAC3C,eAAM,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5F,CAAA;AACD,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Slottable } from \"@radix-ui/react-slot\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Every selection — a pointer, Enter, or Space — reaches the item as a click; stopping it in the\n// capture phase keeps the item's select (and an `asChild` link's navigation) from running.\nfunction blockActivation(event: React.MouseEvent<HTMLElement>) {\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n /**\n * The action this item started is in flight: the item ignores selection, sets\n * `aria-disabled` and `aria-busy`, and shows the spinner in place of its `icon`. It is\n * never disabled for being pending, so it keeps focus (FRONTEND-203). Keeping the menu\n * open meanwhile is the caller's `onSelect` (`event.preventDefault()`, close on settle).\n */\n pending?: boolean\n /** Leading icon. While `pending`, the spinner takes its place. */\n icon?: React.ReactNode\n }\n>(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n {...(pending\n ? { \"aria-busy\": true, \"aria-disabled\": true, \"data-pending\": \"\", onClickCapture: blockActivation }\n : {})}\n disabled={disabled || undefined}\n >\n {/* Direct siblings, never a fragment: under `asChild` Radix Slot finds the Slottable\n among its direct children and renders the icon/spinner inside the child element. */}\n {pending ? <Spinner size=\"xs\" /> : icon}\n <Slottable>{children}</Slottable>\n </DropdownMenuPrimitive.Item>\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />\n)\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/react/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,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,KAAK,IAC1B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,MAAM,EAAE,SAAS,CAAC,KAC1E,KAAK,GACT,CACH,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAA;AAEvE,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAG5C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,qBAAqB,CAAC,SAAS,IAC9B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAA;AACF,qBAAqB,CAAC,WAAW,GAAG,qBAAqB,CAAC,SAAS,CAAC,WAAW,CAAA;AAE/E,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE,CAAC,CAC3C,eAAM,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5F,CAAA;AACD,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { Slottable } from \"@radix-ui/react-slot\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-raised data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border !bg-card p-1 text-popover-foreground elevation-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Every selection — a pointer, Enter, or Space — reaches the item as a click; stopping it in the\n// capture phase keeps the item's select (and an `asChild` link's navigation) from running.\nfunction blockActivation(event: React.MouseEvent<HTMLElement>) {\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n /**\n * The action this item started is in flight: the item ignores selection, sets\n * `aria-disabled` and `aria-busy`, and shows the spinner in place of its `icon`. It is\n * never natively disabled while pending (a `disabled` passed alongside applies once pending\n * ends), so it keeps focus (FRONTEND-203). Keeping the menu\n * open meanwhile is the caller's `onSelect` (`event.preventDefault()`, close on settle).\n */\n pending?: boolean\n /** Leading icon. While `pending`, the spinner takes its place. */\n icon?: React.ReactNode\n }\n>(({ className, inset, pending = false, icon, disabled, children, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 app-dropdown-item\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n {...(pending\n ? { \"aria-busy\": true, \"aria-disabled\": true, \"data-pending\": \"\", onClickCapture: blockActivation }\n : {})}\n disabled={(disabled && !pending) || undefined}\n >\n {/* Direct siblings, never a fragment: under `asChild` Radix Slot finds the Slottable\n among its direct children and renders the icon/spinner inside the child element. */}\n {pending ? <Spinner size=\"xs\" /> : icon}\n <Slottable>{children}</Slottable>\n </DropdownMenuPrimitive.Item>\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />\n)\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ReloadRecoveryWatch } from "../../browser/reload-recovery-watch.js";
|
|
3
|
+
import type { ReloadRecoveryKind } from "../../lib/reload-recovery.js";
|
|
4
|
+
export interface ReloadRecoveryNoticeProps {
|
|
5
|
+
/** The watch the app's client entry started. */
|
|
6
|
+
watch: ReloadRecoveryWatch;
|
|
7
|
+
/** The app's sentence for each failure. */
|
|
8
|
+
messages: Readonly<Record<ReloadRecoveryKind, React.ReactNode>>;
|
|
9
|
+
/** The app's label for the refresh control. */
|
|
10
|
+
refreshLabel: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The app's own reload, which runs its unsaved-work guard first. Refresh is pending until it
|
|
13
|
+
* settles: a reload that proceeds keeps it pending until the page unloads, and a cancelled guard
|
|
14
|
+
* settles it with the page, its input, and the notice as they were.
|
|
15
|
+
*/
|
|
16
|
+
onRefresh: () => Promise<unknown>;
|
|
17
|
+
/** Receives anything `onRefresh` throws. */
|
|
18
|
+
onRefreshError: (error: unknown) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One notice pinned to the top of the screen once the page hits a failure only a reload repairs.
|
|
23
|
+
* It cannot be dismissed and never reloads by itself: the page and every editor beneath it stay
|
|
24
|
+
* mounted and usable until the person presses Refresh. A repeat of the failure changes nothing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ReloadRecoveryNotice({ watch, messages, refreshLabel, onRefresh, onRefreshError, className, }: ReloadRecoveryNoticeProps): React.JSX.Element | null;
|
|
27
|
+
//# sourceMappingURL=reload-recovery-notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery-notice.d.ts","sourceRoot":"","sources":["../../../src/react/components/reload-recovery-notice.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,MAAM,WAAW,yBAAyB;IACxC,gDAAgD;IAChD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAChE,+CAA+C;IAC/C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,4CAA4C;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACd,SAAS,GACV,EAAE,yBAAyB,4BAiB3B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { useAsyncAction } from "../hooks/use-async-action.js";
|
|
6
|
+
import { Alert, AlertDescription } from "./alert.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
const noFailureOnServer = () => null;
|
|
9
|
+
/**
|
|
10
|
+
* One notice pinned to the top of the screen once the page hits a failure only a reload repairs.
|
|
11
|
+
* It cannot be dismissed and never reloads by itself: the page and every editor beneath it stay
|
|
12
|
+
* mounted and usable until the person presses Refresh. A repeat of the failure changes nothing.
|
|
13
|
+
*/
|
|
14
|
+
export function ReloadRecoveryNotice({ watch, messages, refreshLabel, onRefresh, onRefreshError, className, }) {
|
|
15
|
+
const kind = React.useSyncExternalStore(watch.subscribe, watch.current, noFailureOnServer);
|
|
16
|
+
const refresh = useAsyncAction(onRefresh, { onError: onRefreshError });
|
|
17
|
+
if (kind === null)
|
|
18
|
+
return null;
|
|
19
|
+
return (_jsxs(Alert, { className: cn("ui-reload-recovery-notice fixed inset-x-0 top-0 z-50 flex items-center justify-between gap-4 rounded-none border-x-0 border-t-0", className), children: [_jsx(AlertDescription, { children: messages[kind] }), _jsx(Button, { type: "button", size: "sm", pending: refresh.pending, onClick: () => void refresh.run(), children: refreshLabel })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=reload-recovery-notice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-recovery-notice.js","sourceRoot":"","sources":["../../../src/react/components/reload-recovery-notice.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoBrC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACd,SAAS,GACiB;IAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC3F,MAAM,OAAO,GAAG,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACvE,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,CACL,MAAC,KAAK,IACJ,SAAS,EAAE,EAAE,CACX,iIAAiI,EACjI,SAAS,CACV,aAED,KAAC,gBAAgB,cAAE,QAAQ,CAAC,IAAI,CAAC,GAAoB,EACrD,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,EAAE,YACxF,YAAY,GACN,IACH,CACT,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { ReloadRecoveryWatch } from \"../../browser/reload-recovery-watch.js\";\nimport type { ReloadRecoveryKind } from \"../../lib/reload-recovery.js\";\nimport { cn } from \"../../lib/utils.js\";\nimport { useAsyncAction } from \"../hooks/use-async-action.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { Button } from \"./button.js\";\n\nexport interface ReloadRecoveryNoticeProps {\n /** The watch the app's client entry started. */\n watch: ReloadRecoveryWatch;\n /** The app's sentence for each failure. */\n messages: Readonly<Record<ReloadRecoveryKind, React.ReactNode>>;\n /** The app's label for the refresh control. */\n refreshLabel: React.ReactNode;\n /**\n * The app's own reload, which runs its unsaved-work guard first. Refresh is pending until it\n * settles: a reload that proceeds keeps it pending until the page unloads, and a cancelled guard\n * settles it with the page, its input, and the notice as they were.\n */\n onRefresh: () => Promise<unknown>;\n /** Receives anything `onRefresh` throws. */\n onRefreshError: (error: unknown) => void;\n className?: string;\n}\n\nconst noFailureOnServer = () => null;\n\n/**\n * One notice pinned to the top of the screen once the page hits a failure only a reload repairs.\n * It cannot be dismissed and never reloads by itself: the page and every editor beneath it stay\n * mounted and usable until the person presses Refresh. A repeat of the failure changes nothing.\n */\nexport function ReloadRecoveryNotice({\n watch,\n messages,\n refreshLabel,\n onRefresh,\n onRefreshError,\n className,\n}: ReloadRecoveryNoticeProps) {\n const kind = React.useSyncExternalStore(watch.subscribe, watch.current, noFailureOnServer);\n const refresh = useAsyncAction(onRefresh, { onError: onRefreshError });\n if (kind === null) return null;\n return (\n <Alert\n className={cn(\n \"ui-reload-recovery-notice fixed inset-x-0 top-0 z-50 flex items-center justify-between gap-4 rounded-none border-x-0 border-t-0\",\n className,\n )}\n >\n <AlertDescription>{messages[kind]}</AlertDescription>\n <Button type=\"button\" size=\"sm\" pending={refresh.pending} onClick={() => void refresh.run()}>\n {refreshLabel}\n </Button>\n </Alert>\n );\n}\n"]}
|
|
@@ -7,7 +7,8 @@ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitiv
|
|
|
7
7
|
/**
|
|
8
8
|
* The change this select started is in flight: the trigger ignores opening and typeahead,
|
|
9
9
|
* sets `aria-disabled` and `aria-busy`, and shows the spinner in place of its chevron. It
|
|
10
|
-
* is never disabled
|
|
10
|
+
* is never natively disabled while pending (a `disabled` passed alongside applies once
|
|
11
|
+
* pending ends), so it keeps focus (FRONTEND-203). It keeps showing
|
|
11
12
|
* the COMMITTED value — the caller changes `value` only once the write lands.
|
|
12
13
|
*/
|
|
13
14
|
pending?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAOzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AACzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAIzC,QAAA,MAAM,aAAa;IAGf
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAOzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AACzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAIzC,QAAA,MAAM,aAAa;IAGf;;;;;;OAMG;cACO,OAAO;2CA+BnB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAWxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAW1B,CAAA;AAGF,QAAA,MAAM,aAAa,8JA6BjB,CAAA;AAGF,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JAoBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
|
|
@@ -20,7 +20,7 @@ const SelectTrigger = React.forwardRef(({ className, children, pending = false,
|
|
|
20
20
|
onClickCapture: blockEvent,
|
|
21
21
|
onKeyDownCapture: blockActivationKey,
|
|
22
22
|
}
|
|
23
|
-
: {}), disabled: disabled || undefined, children: [children, pending ? (_jsx(Spinner, { size: "xs" })) : (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) }))] })));
|
|
23
|
+
: {}), disabled: (disabled && !pending) || undefined, children: [children, pending ? (_jsx(Spinner, { size: "xs" })) : (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) }))] })));
|
|
24
24
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
25
25
|
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
26
26
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEnE,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAA;AACnC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AACzC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AAEzC,yFAAyF;AACzF,gGAAgG;AAChG,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAWpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvE,MAAC,eAAe,CAAC,OAAO,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,+WAA+W,EAC/W,SAAS,CACV,KACG,KAAK,KACL,CAAC,OAAO;QACV,CAAC,CAAC;YACE,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,EAAE;YAClB,oBAAoB,EAAE,UAAU;YAChC,cAAc,EAAE,UAA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AA8D,YAC5E,KAAC,eAAe,CAAC,aAAa,cAC5B,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,GACC,GAC3B,EAEP,KAAC,eAAe,CAAC,QAAQ,cAAE,QAAQ,GAA4B,IAC1C,CACxB,CAAC,CAAA;AACF,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAA;AAEzD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAGtC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAEnE,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\nimport { blockActivationKey, blockEvent } from \"./pending-guard.js\"\n\nconst Select = SelectPrimitive.Root\nconst SelectGroup = SelectPrimitive.Group\nconst SelectValue = SelectPrimitive.Value\n\n// A pending trigger opens on nothing: it opens on a pointer press or a key, and a closed\n// trigger's typeahead changes the value, so both are stopped before the trigger's own handlers.\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {\n /**\n * The change this select started is in flight: the trigger ignores opening and typeahead,\n * sets `aria-disabled` and `aria-busy`, and shows the spinner in place of its chevron. It\n * is never disabled for being pending, so it keeps focus (FRONTEND-203). It keeps showing\n * the COMMITTED value — the caller changes `value` only once the write lands.\n */\n pending?: boolean\n }\n>(({ className, children, pending = false, disabled, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n {...(pending\n ? {\n \"aria-busy\": true,\n \"aria-disabled\": true,\n \"data-pending\": \"\",\n onPointerDownCapture: blockEvent,\n onClickCapture: blockEvent,\n onKeyDownCapture: blockActivationKey,\n }\n : {})}\n disabled={disabled || undefined}\n >\n {children}\n {pending ? (\n <Spinner size=\"xs\" />\n ) : (\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground elevation-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,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,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAEnE,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\nimport { blockActivationKey, blockEvent } from \"./pending-guard.js\"\n\nconst Select = SelectPrimitive.Root\nconst SelectGroup = SelectPrimitive.Group\nconst SelectValue = SelectPrimitive.Value\n\n// A pending trigger opens on nothing: it opens on a pointer press or a key, and a closed\n// trigger's typeahead changes the value, so both are stopped before the trigger's own handlers.\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {\n /**\n * The change this select started is in flight: the trigger ignores opening and typeahead,\n * sets `aria-disabled` and `aria-busy`, and shows the spinner in place of its chevron. It\n * is never natively disabled while pending (a `disabled` passed alongside applies once\n * pending ends), so it keeps focus (FRONTEND-203). It keeps showing\n * the COMMITTED value — the caller changes `value` only once the write lands.\n */\n pending?: boolean\n }\n>(({ className, children, pending = false, disabled, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n {...(pending\n ? {\n \"aria-busy\": true,\n \"aria-disabled\": true,\n \"data-pending\": \"\",\n onPointerDownCapture: blockEvent,\n onClickCapture: blockEvent,\n onKeyDownCapture: blockActivationKey,\n }\n : {})}\n disabled={(disabled && !pending) || undefined}\n >\n {children}\n {pending ? (\n <Spinner size=\"xs\" />\n ) : (\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground elevation-popover data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"]}
|
|
@@ -5,8 +5,8 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.Swit
|
|
|
5
5
|
* The change this switch started is in flight: the switch ignores toggling, sets
|
|
6
6
|
* `aria-disabled` and `aria-busy`, and spins inside its thumb. It keeps showing the
|
|
7
7
|
* COMMITTED state — the caller flips `checked` only once the write lands. It is never
|
|
8
|
-
* natively disabled
|
|
9
|
-
* (FRONTEND-203).
|
|
8
|
+
* natively disabled while pending (a `disabled` passed alongside applies once pending
|
|
9
|
+
* ends), so the switch the user just pressed keeps focus (FRONTEND-203).
|
|
10
10
|
*/
|
|
11
11
|
pending?: boolean;
|
|
12
12
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -12,7 +12,7 @@ function blockToggle(event) {
|
|
|
12
12
|
}
|
|
13
13
|
const Switch = React.forwardRef(({ className, pending = false, disabled, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ...(pending
|
|
14
14
|
? { "aria-busy": true, "aria-disabled": true, "data-pending": "", onClickCapture: blockToggle }
|
|
15
|
-
: {}), disabled: disabled || undefined, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-background elevation-raised transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"), children: pending ? _jsx(Spinner, { size: "xs" }) : null }) })));
|
|
15
|
+
: {}), disabled: (disabled && !pending) || undefined, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-background elevation-raised transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"), children: pending ? _jsx(Spinner, { size: "xs" }) : null }) })));
|
|
16
16
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
17
17
|
export { Switch };
|
|
18
18
|
//# sourceMappingURL=switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/react/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,0FAA0F;AAC1F,2CAA2C;AAC3C,SAAS,WAAW,CAAC,KAA0C;IAC7D,KAAK,CAAC,cAAc,EAAE,CAAA;IACtB,KAAK,CAAC,eAAe,EAAE,CAAA;AACzB,CAAC;AAED,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAY7B,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7D,KAAC,g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,EAAE,GAAG,YAER,KAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CACX,uMAAuM,CACxM,YAEA,OAAO,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAChB,GACH,CACzB,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\n// Stopped in the capture phase so neither the caller's click handler nor the switch's own\n// toggle runs while a change is in flight.\nfunction blockToggle(event: React.MouseEvent<HTMLButtonElement>) {\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {\n /**\n * The change this switch started is in flight: the switch ignores toggling, sets\n * `aria-disabled` and `aria-busy`, and spins inside its thumb. It keeps showing the\n * COMMITTED state — the caller flips `checked` only once the write lands. It is never\n * natively disabled while pending (a `disabled` passed alongside applies once pending\n * ends), so the switch the user just pressed keeps focus (FRONTEND-203).\n */\n pending?: boolean\n }\n>(({ className, pending = false, disabled, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className\n )}\n {...props}\n {...(pending\n ? { \"aria-busy\": true, \"aria-disabled\": true, \"data-pending\": \"\", onClickCapture: blockToggle }\n : {})}\n disabled={(disabled && !pending) || undefined}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-background elevation-raised transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n >\n {pending ? <Spinner size=\"xs\" /> : null}\n </SwitchPrimitives.Thumb>\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"]}
|
|
@@ -4,7 +4,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
4
4
|
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
5
|
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
6
|
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "error" | "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
9
9
|
/** ms; ignored when `persistent` is true */
|
|
10
10
|
duration?: number;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export { ShowMoreToggle } from "./components/show-more-toggle.js";
|
|
|
62
62
|
export type { ShowMoreToggleProps } from "./components/show-more-toggle.js";
|
|
63
63
|
export { ChunkErrorRecovery } from "./components/chunk-error-recovery.js";
|
|
64
64
|
export type { ChunkErrorRecoveryProps } from "./components/chunk-error-recovery.js";
|
|
65
|
+
export { ReloadRecoveryNotice } from "./components/reload-recovery-notice.js";
|
|
66
|
+
export type { ReloadRecoveryNoticeProps } from "./components/reload-recovery-notice.js";
|
|
65
67
|
export { ListPagination } from "./components/list-pagination.js";
|
|
66
68
|
export type { ListPaginationProps } from "./components/list-pagination.js";
|
|
67
69
|
export { usePagedList } from "./hooks/use-paged-list.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrI,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACpL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,E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AAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,YAAY,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAIxF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKhG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtH,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/react/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export { EndOfListIndicator } from "./components/end-of-list-indicator.js";
|
|
|
45
45
|
export { ScrollToTopButton } from "./components/scroll-to-top-button.js";
|
|
46
46
|
export { ShowMoreToggle } from "./components/show-more-toggle.js";
|
|
47
47
|
export { ChunkErrorRecovery } from "./components/chunk-error-recovery.js";
|
|
48
|
+
export { ReloadRecoveryNotice } from "./components/reload-recovery-notice.js";
|
|
48
49
|
// List pagination — the one Previous / counter / Next control plus the page-state
|
|
49
50
|
// hooks for its two flavors (known total, and cursor/`hasMore`).
|
|
50
51
|
export { ListPagination } from "./components/list-pagination.js";
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACpL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAA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AElG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,yBAAyB;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,kFAAkF;AAClF,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,uFAAuF;AACvF,wFAAwF;AACxF,gCAAgC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["\"use client\";\n\nexport type { ButtonProps } from \"./components/button.js\";\nexport { Button, buttonVariants } from \"./components/button.js\";\nexport type { SpinnerProps, SpinnerSize } from \"./components/spinner.js\";\nexport { Spinner } from \"./components/spinner.js\";\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Label } from \"./components/label.js\";\nexport type { TextareaProps, FreeTextTextareaProps, NonFreeTextTextareaProps, NonFreeTextareaEntry } from \"./components/textarea.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription } from \"./components/dialog.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup } from \"./components/dropdown-menu.js\";\nexport { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut } from \"./components/menubar.js\";\nexport { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from \"./components/alert-dialog.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport type { ToastProps, ToastActionElement } from \"./components/toast.js\";\nexport { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction } from \"./components/toast.js\";\nexport { Toaster } from \"./components/toaster.js\";\nexport type { ToastVariant, ToasterToast } from \"./hooks/use-toast.js\";\nexport { toast, useToast } from \"./hooks/use-toast.js\";\nexport type { InputProps, FreeTextInputProps, NonFreeTextInputProps, NonFreeTextEntry, BuiltInFormatInputProps, BuiltInFormatInputType } from \"./components/input.js\";\nexport { Input } from \"./components/input.js\";\nexport { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton } from \"./components/select.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from \"./components/tooltip.js\";\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from \"./components/form.js\";\nexport { Checkbox } from \"./components/checkbox.js\";\nexport { Switch } from \"./components/switch.js\";\nexport type { BadgeProps } from \"./components/badge.js\";\nexport { Badge, badgeVariants } from \"./components/badge.js\";\nexport { Avatar, AvatarImage, AvatarFallback } from \"./components/avatar.js\";\nexport { Separator } from \"./components/separator.js\";\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"./components/accordion.js\";\nexport { RadioGroup, RadioGroupItem } from \"./components/radio-group.js\";\nexport { Progress } from \"./components/progress.js\";\nexport { Slider } from \"./components/slider.js\";\nexport type { DatePickerProps } from \"./components/date-picker.js\";\nexport { DatePicker } from \"./components/date-picker.js\";\nexport type { DateTimePickerProps, DateTimePickerTime } from \"./components/date-time-picker.js\";\nexport { DateTimePicker } from \"./components/date-time-picker.js\";\nexport { ScrollArea, ScrollBar } from \"./components/scroll-area.js\";\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, SortableTableHead, TableRow, TableCell, TableCaption } from \"./components/table.js\";\nexport type { SortableTableHeadProps, SortDirection } from \"./components/table.js\";\nexport { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } from \"./components/sheet.js\";\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from \"./components/collapsible.js\";\nexport type { SearchDropdownProps } from \"./components/search-dropdown.js\";\nexport { SearchDropdown } from \"./components/search-dropdown.js\";\n\nexport type { ConsequenceDialogProps, ConsequenceDialogReason, ConsequenceDialogTypedConfirmation } from \"./components/consequence-dialog.js\";\nexport { ConsequenceDialog } from \"./components/consequence-dialog.js\";\n\nexport type { MaxWidthOption, ScreenAdaptiveViewProps } from \"./components/layout/screen-adaptive-view.js\";\nexport { ScreenAdaptiveView } from \"./components/layout/screen-adaptive-view.js\";\n\nexport { useMediaQuery } from \"./hooks/use-media-query.js\";\n\nexport { useAsyncAction } from \"./hooks/use-async-action.js\";\nexport type { AsyncAction, UseAsyncActionOptions } from \"./hooks/use-async-action.js\";\n\n// Shared building blocks\nexport { RelativeTime } from \"./components/relative-time.js\";\nexport type { RelativeTimeProps } from \"./components/relative-time.js\";\n\nexport { EndOfListIndicator } from \"./components/end-of-list-indicator.js\";\nexport type { EndOfListIndicatorProps } from \"./components/end-of-list-indicator.js\";\n\nexport { ScrollToTopButton } from \"./components/scroll-to-top-button.js\";\nexport type { ScrollToTopButtonProps } from \"./components/scroll-to-top-button.js\";\n\nexport { ShowMoreToggle } from \"./components/show-more-toggle.js\";\nexport type { ShowMoreToggleProps } from \"./components/show-more-toggle.js\";\n\nexport { ChunkErrorRecovery } from \"./components/chunk-error-recovery.js\";\nexport type { ChunkErrorRecoveryProps } from \"./components/chunk-error-recovery.js\";\n\n// List pagination — the one Previous / counter / Next control plus the page-state\n// hooks for its two flavors (known total, and cursor/`hasMore`).\nexport { ListPagination } from \"./components/list-pagination.js\";\nexport type { ListPaginationProps } from \"./components/list-pagination.js\";\n\nexport { usePagedList } from \"./hooks/use-paged-list.js\";\nexport type { ListPaginationState, PagedList, UsePagedListOptions } from \"./hooks/use-paged-list.js\";\n\nexport { useCursorPage } from \"./hooks/use-cursor-page.js\";\nexport type { CursorPage, CursorPager, UseCursorPageOptions } from \"./hooks/use-cursor-page.js\";\n\n// Return-scroll: restore a list's window offset when the user comes back to it after a\n// route change (save on leave, restore once on an eligible + ready return, keyed by the\n// caller's canonical list URL).\nexport { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll } from \"./hooks/use-return-scroll.js\";\nexport type { ReturnScrollEntry, UseReturnScrollOptions, UseReturnScrollResult } from \"./hooks/use-return-scroll.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],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,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAG9E,kFAAkF;AAClF,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,uFAAuF;AACvF,wFAAwF;AACxF,gCAAgC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["\"use client\";\n\nexport type { ButtonProps } from \"./components/button.js\";\nexport { Button, buttonVariants } from \"./components/button.js\";\nexport type { SpinnerProps, SpinnerSize } from \"./components/spinner.js\";\nexport { Spinner } from \"./components/spinner.js\";\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Label } from \"./components/label.js\";\nexport type { TextareaProps, FreeTextTextareaProps, NonFreeTextTextareaProps, NonFreeTextareaEntry } from \"./components/textarea.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription } from \"./components/dialog.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup } from \"./components/dropdown-menu.js\";\nexport { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut } from \"./components/menubar.js\";\nexport { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from \"./components/alert-dialog.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport type { ToastProps, ToastActionElement } from \"./components/toast.js\";\nexport { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction } from \"./components/toast.js\";\nexport { Toaster } from \"./components/toaster.js\";\nexport type { ToastVariant, ToasterToast } from \"./hooks/use-toast.js\";\nexport { toast, useToast } from \"./hooks/use-toast.js\";\nexport type { InputProps, FreeTextInputProps, NonFreeTextInputProps, NonFreeTextEntry, BuiltInFormatInputProps, BuiltInFormatInputType } from \"./components/input.js\";\nexport { Input } from \"./components/input.js\";\nexport { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton } from \"./components/select.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from \"./components/tooltip.js\";\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } from \"./components/form.js\";\nexport { Checkbox } from \"./components/checkbox.js\";\nexport { Switch } from \"./components/switch.js\";\nexport type { BadgeProps } from \"./components/badge.js\";\nexport { Badge, badgeVariants } from \"./components/badge.js\";\nexport { Avatar, AvatarImage, AvatarFallback } from \"./components/avatar.js\";\nexport { Separator } from \"./components/separator.js\";\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"./components/accordion.js\";\nexport { RadioGroup, RadioGroupItem } from \"./components/radio-group.js\";\nexport { Progress } from \"./components/progress.js\";\nexport { Slider } from \"./components/slider.js\";\nexport type { DatePickerProps } from \"./components/date-picker.js\";\nexport { DatePicker } from \"./components/date-picker.js\";\nexport type { DateTimePickerProps, DateTimePickerTime } from \"./components/date-time-picker.js\";\nexport { DateTimePicker } from \"./components/date-time-picker.js\";\nexport { ScrollArea, ScrollBar } from \"./components/scroll-area.js\";\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, SortableTableHead, TableRow, TableCell, TableCaption } from \"./components/table.js\";\nexport type { SortableTableHeadProps, SortDirection } from \"./components/table.js\";\nexport { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } from \"./components/sheet.js\";\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from \"./components/collapsible.js\";\nexport type { SearchDropdownProps } from \"./components/search-dropdown.js\";\nexport { SearchDropdown } from \"./components/search-dropdown.js\";\n\nexport type { ConsequenceDialogProps, ConsequenceDialogReason, ConsequenceDialogTypedConfirmation } from \"./components/consequence-dialog.js\";\nexport { ConsequenceDialog } from \"./components/consequence-dialog.js\";\n\nexport type { MaxWidthOption, ScreenAdaptiveViewProps } from \"./components/layout/screen-adaptive-view.js\";\nexport { ScreenAdaptiveView } from \"./components/layout/screen-adaptive-view.js\";\n\nexport { useMediaQuery } from \"./hooks/use-media-query.js\";\n\nexport { useAsyncAction } from \"./hooks/use-async-action.js\";\nexport type { AsyncAction, UseAsyncActionOptions } from \"./hooks/use-async-action.js\";\n\n// Shared building blocks\nexport { RelativeTime } from \"./components/relative-time.js\";\nexport type { RelativeTimeProps } from \"./components/relative-time.js\";\n\nexport { EndOfListIndicator } from \"./components/end-of-list-indicator.js\";\nexport type { EndOfListIndicatorProps } from \"./components/end-of-list-indicator.js\";\n\nexport { ScrollToTopButton } from \"./components/scroll-to-top-button.js\";\nexport type { ScrollToTopButtonProps } from \"./components/scroll-to-top-button.js\";\n\nexport { ShowMoreToggle } from \"./components/show-more-toggle.js\";\nexport type { ShowMoreToggleProps } from \"./components/show-more-toggle.js\";\n\nexport { ChunkErrorRecovery } from \"./components/chunk-error-recovery.js\";\nexport type { ChunkErrorRecoveryProps } from \"./components/chunk-error-recovery.js\";\n\nexport { ReloadRecoveryNotice } from \"./components/reload-recovery-notice.js\";\nexport type { ReloadRecoveryNoticeProps } from \"./components/reload-recovery-notice.js\";\n\n// List pagination — the one Previous / counter / Next control plus the page-state\n// hooks for its two flavors (known total, and cursor/`hasMore`).\nexport { ListPagination } from \"./components/list-pagination.js\";\nexport type { ListPaginationProps } from \"./components/list-pagination.js\";\n\nexport { usePagedList } from \"./hooks/use-paged-list.js\";\nexport type { ListPaginationState, PagedList, UsePagedListOptions } from \"./hooks/use-paged-list.js\";\n\nexport { useCursorPage } from \"./hooks/use-cursor-page.js\";\nexport type { CursorPage, CursorPager, UseCursorPageOptions } from \"./hooks/use-cursor-page.js\";\n\n// Return-scroll: restore a list's window offset when the user comes back to it after a\n// route change (save on leave, restore once on an eligible + ready return, keyed by the\n// caller's canonical list URL).\nexport { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll } from \"./hooks/use-return-scroll.js\";\nexport type { ReturnScrollEntry, UseReturnScrollOptions, UseReturnScrollResult } from \"./hooks/use-return-scroll.js\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/ui-core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.29",
|
|
4
4
|
"description": "Shared UI components for TTT Productions projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"types": "./dist/react/index.d.ts",
|
|
29
29
|
"import": "./dist/react/index.js",
|
|
30
30
|
"default": "./dist/react/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./browser": {
|
|
33
|
+
"types": "./dist/browser/index.d.ts",
|
|
34
|
+
"import": "./dist/browser/index.js",
|
|
35
|
+
"default": "./dist/browser/index.js"
|
|
31
36
|
}
|
|
32
37
|
},
|
|
33
38
|
"scripts": {
|