cursedbelt 5.15.4 → 5.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/components/Drawer.d.ts.map +1 -1
- package/dist/react/components/Drawer.js +2 -2
- package/dist/react/components/Drawer.js.map +1 -1
- package/dist/react/components/Lightbox.d.ts.map +1 -1
- package/dist/react/components/Lightbox.js +2 -2
- package/dist/react/components/Lightbox.js.map +1 -1
- package/dist/react/components/Modal.d.ts.map +1 -1
- package/dist/react/components/Modal.js +2 -2
- package/dist/react/components/Modal.js.map +1 -1
- package/dist/react/components/Popover.d.ts +2 -0
- package/dist/react/components/Popover.d.ts.map +1 -1
- package/dist/react/components/Popover.js +7 -0
- package/dist/react/components/Popover.js.map +1 -1
- package/dist/react/components/dialog.d.ts +12 -0
- package/dist/react/components/dialog.d.ts.map +1 -1
- package/dist/react/components/dialog.js +15 -0
- package/dist/react/components/dialog.js.map +1 -1
- package/dist/react/index.d.ts +1 -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/dist/react/lib/floatingContainer.d.ts +17 -0
- package/dist/react/lib/floatingContainer.d.ts.map +1 -1
- package/dist/react/lib/floatingContainer.js +19 -2
- package/dist/react/lib/floatingContainer.js.map +1 -1
- package/dist/react/rich-text/RichTextToolbar.d.ts.map +1 -1
- package/dist/react/rich-text/RichTextToolbar.js +15 -5
- package/dist/react/rich-text/RichTextToolbar.js.map +1 -1
- package/dist/scripts/guardrailsEnforce.d.ts +2 -0
- package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
- package/dist/styles-areas/rich-text.css +2 -2
- package/dist/styles-utilities.css +0 -10
- package/package.json +1 -1
- package/scripts/guardrailsEnforce.spec.ts +88 -1
- package/scripts/guardrailsEnforce.ts +133 -2
- package/src/react/components/Drawer.tsx +2 -1
- package/src/react/components/Lightbox.tsx +2 -1
- package/src/react/components/Modal.spec.tsx +50 -0
- package/src/react/components/Modal.tsx +2 -1
- package/src/react/components/Popover.spec.tsx +43 -1
- package/src/react/components/Popover.tsx +8 -0
- package/src/react/components/dialog.tsx +16 -0
- package/src/react/index.ts +1 -0
- package/src/react/lib/floatingContainer.ts +27 -2
- package/src/react/rich-text/RichTextEditor.spec.tsx +48 -1
- package/src/react/rich-text/RichTextToolbar.tsx +34 -14
- package/src/styles-areas/rich-text.css +2 -2
- package/src/styles-utilities.css +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextToolbar.js","sourceRoot":"","sources":["../../../src/react/rich-text/RichTextToolbar.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,aAAa,EACb,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAUlC,SAAS,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAsB;IACnF,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,4EAA4E,EAC5E,MAAM,I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AAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,GAAI,GACzD,IACN,EAGN,eAAK,GAAG,EAAE,cAAc,aACtB,KAAC,aAAa,IACZ,IAAI,EAAE,KAAC,KAAK,IAAC,IAAI,EAAE,EAAE,GAAI,EACzB,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,GAAG,EAAE;oCACZ,WAAW,CAAC,KAAK,CAAC,CAAC;oCACnB,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gCAC1B,CAAC,EACD,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,QAAQ,GAClB,EACF,KAAC,OAAO,IACN,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EACtC,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,YAAY,CAAC,KAAK,CAAC,EACpD,KAAK,EAAC,cAAc,EACpB,KAAK,EAAE,GAAG,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAC,KAAK,YAEf,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,GAAI,GAC3D,IACN,IACF,GACK,GACT,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,8 @@ interface Rule {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function walk(dir: string, out?: string[]): string[];
|
|
18
18
|
export declare function setReimplementedNames(names: readonly string[]): void;
|
|
19
|
+
export declare function setPositionedClasses(compounds: readonly (readonly string[])[]): void;
|
|
20
|
+
export declare function positionedClassesFromCss(css: string): string[][];
|
|
19
21
|
export declare const RULES: Record<string, Rule>;
|
|
20
22
|
/**
|
|
21
23
|
* Rules that are about cursedbelt's OWN source and mean nothing in an app's.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guardrailsEnforce.d.ts","sourceRoot":"","sources":["../../scripts/guardrailsEnforce.ts"],"names":[],"mappings":";AAmNA,UAAU,SAAS;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;sEAGkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,IAAI;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;CACzD;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CA6B9D;AA66BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAEpE;
|
|
1
|
+
{"version":3,"file":"guardrailsEnforce.d.ts","sourceRoot":"","sources":["../../scripts/guardrailsEnforce.ts"],"names":[],"mappings":";AAmNA,UAAU,SAAS;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;sEAGkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,IAAI;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;CACzD;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CA6B9D;AA66BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAEpE;AA4tBD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAEpF;AAID,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAoBhE;AA8CD,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAsBtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAuC,CAAC;AAE5F,0EAA0E;AAC1E,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAAwE,CAAC;AAShH,eAAO,MAAM,uBAAuB,aAAkD,CAAC;AAGvF,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAED;2FAC2F;AAC3F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA0C3F;AAED,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAmGhC,wBAAgB,0BAA0B,CAAC,SAAS,GAAE,MAAwB,GAAG,MAAM,EAAE,CAyBxF"}
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
* after an app's responsive variant (task 2124). An app that imports every area gets exactly
|
|
19
19
|
* what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
|
|
20
20
|
* src/stylesAreas.spec.ts, which is also what fails when this file is stale.
|
|
21
|
-
*
|
|
21
|
+
* 11 candidate(s).
|
|
22
22
|
*
|
|
23
23
|
* Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
|
|
24
24
|
* `bun run build` runs. The map of what is in which area, and why the areas are
|
|
25
25
|
* import closures rather than a hand-written list, is scripts/styleAreas.ts.
|
|
26
26
|
*/
|
|
27
27
|
@source inline("[&_svg]:size-[15px] focus-within:ring-2 focus-within:ring-offset-0 focus-within:ring-ring h-5");
|
|
28
|
-
@source inline("italic
|
|
28
|
+
@source inline("italic min-h-[8rem] self-start text-right text-warning top-full");
|
|
@@ -880,12 +880,6 @@
|
|
|
880
880
|
.w-64 {
|
|
881
881
|
width: calc(var(--spacing) * 64);
|
|
882
882
|
}
|
|
883
|
-
.w-72 {
|
|
884
|
-
width: calc(var(--spacing) * 72);
|
|
885
|
-
}
|
|
886
|
-
.w-80 {
|
|
887
|
-
width: calc(var(--spacing) * 80);
|
|
888
|
-
}
|
|
889
883
|
.w-\[3px\] {
|
|
890
884
|
width: 3px;
|
|
891
885
|
}
|
|
@@ -2912,10 +2906,6 @@
|
|
|
2912
2906
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2913
2907
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2914
2908
|
}
|
|
2915
|
-
.shadow-md {
|
|
2916
|
-
--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
2917
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2918
|
-
}
|
|
2919
2909
|
.shadow-none {
|
|
2920
2910
|
--tw-shadow: 0 0 #0000;
|
|
2921
2911
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The React design system of the cursedbelt split — components, styles, theme. cursedbelt-core below it; server tier in cursedbelt-server.",
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
7
7
|
import { tmpdir } from 'node:os';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
|
-
import { describe, expect, test } from 'bun:test';
|
|
9
|
+
import { afterEach, describe, expect, test } from 'bun:test';
|
|
10
10
|
import {
|
|
11
11
|
APP_RULES,
|
|
12
12
|
BELT_INTERNAL_RULES,
|
|
13
13
|
beltExportedComponentNames,
|
|
14
14
|
parseFileAllows,
|
|
15
|
+
positionedClassesFromCss,
|
|
15
16
|
RULES,
|
|
17
|
+
setPositionedClasses,
|
|
16
18
|
setReimplementedNames,
|
|
17
19
|
walk,
|
|
18
20
|
} from './guardrailsEnforce';
|
|
@@ -1459,3 +1461,88 @@ describe('no-raw-popover', () => {
|
|
|
1459
1461
|
expect(performance.now() - started).toBeLessThan(2000);
|
|
1460
1462
|
});
|
|
1461
1463
|
});
|
|
1464
|
+
|
|
1465
|
+
describe('no-raw-popover — a popup its stylesheet positions (the 2026-09-27 survey)', () => {
|
|
1466
|
+
afterEach(() => setPositionedClasses([]));
|
|
1467
|
+
|
|
1468
|
+
test('reads the class compounds a stylesheet positions, last compound only', () => {
|
|
1469
|
+
expect(
|
|
1470
|
+
positionedClassesFromCss(`
|
|
1471
|
+
/* .commented { position: fixed } */
|
|
1472
|
+
.rail__tree.is-open { z-index: 5; position: fixed; }
|
|
1473
|
+
@media (max-width: 600px) { .roms-speed__pop { position:absolute } }
|
|
1474
|
+
.ft-live-panel, .ft-other { position: absolute; }
|
|
1475
|
+
.ft-space-menu[open] > summary::before { position: fixed; inset: 0; }
|
|
1476
|
+
.card .badge:hover { position: absolute }
|
|
1477
|
+
.in-flow { position: relative; }
|
|
1478
|
+
`),
|
|
1479
|
+
).toEqual([['rail__tree', 'is-open'], ['roms-speed__pop'], ['ft-live-panel'], ['ft-other'], ['badge']]);
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
// music 21bd950 — src/views/VisualizerView.tsx:586, positioned by src/styles.css
|
|
1483
|
+
test('🔴 flags a conditionally rendered element whose class the stylesheet positions', () => {
|
|
1484
|
+
const source = `{panelOpen ? (
|
|
1485
|
+
<div className="viz-panel__host" onPointerDown={(e) => e.stopPropagation()}>x</div>
|
|
1486
|
+
) : null}`;
|
|
1487
|
+
expect(check('no-raw-popover', source)).toHaveLength(0);
|
|
1488
|
+
setPositionedClasses(positionedClassesFromCss('.viz-panel__host { position: absolute; }'));
|
|
1489
|
+
expect(check('no-raw-popover', source)).toHaveLength(1);
|
|
1490
|
+
});
|
|
1491
|
+
|
|
1492
|
+
// roms 414381c — src/components/SpeedControl.tsx:97, a <fieldset> with a comment above it
|
|
1493
|
+
test('🔴 flags a <fieldset> with a comment between the condition and the tag', () => {
|
|
1494
|
+
setPositionedClasses(positionedClassesFromCss('.roms-speed__pop { position: absolute; }'));
|
|
1495
|
+
expect(
|
|
1496
|
+
check(
|
|
1497
|
+
'no-raw-popover',
|
|
1498
|
+
`{open && (
|
|
1499
|
+
// A real <fieldset>, stripped of its chrome.
|
|
1500
|
+
<fieldset className="roms-speed__pop">x</fieldset>
|
|
1501
|
+
)}`,
|
|
1502
|
+
),
|
|
1503
|
+
).toHaveLength(1);
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
// family aff5cba — src/components/LiveLayer.tsx:110, the root of a same-file component
|
|
1507
|
+
test('🔴 flags a conditionally rendered component whose root element is positioned', () => {
|
|
1508
|
+
setPositionedClasses(positionedClassesFromCss('.ft-live-panel { position: absolute; }'));
|
|
1509
|
+
const source = `{open ? (
|
|
1510
|
+
<LivePanel live={live} onClose={() => setOpen(false)} />
|
|
1511
|
+
) : null}
|
|
1512
|
+
function LivePanel({ live, onClose }: Props) {
|
|
1513
|
+
const feed = useActivity(true, 30);
|
|
1514
|
+
return (
|
|
1515
|
+
<div className="ft-live-panel">x</div>
|
|
1516
|
+
);
|
|
1517
|
+
}`;
|
|
1518
|
+
expect(check('no-raw-popover', source)).toHaveLength(1);
|
|
1519
|
+
expect(check('no-raw-popover', source.replace('ft-live-panel', 'ft-live-list'))).toHaveLength(0);
|
|
1520
|
+
});
|
|
1521
|
+
|
|
1522
|
+
// music 21bd950 — src/components/LibraryRail.tsx:940, always rendered, positioned by a toggled class
|
|
1523
|
+
test('🔴 flags an always-rendered element a disclosure-state class positions', () => {
|
|
1524
|
+
setPositionedClasses(positionedClassesFromCss('.rail__tree.is-open { position: fixed; }'));
|
|
1525
|
+
const source = `<FileTree
|
|
1526
|
+
ariaLabel="Folders"
|
|
1527
|
+
className={\`rail__tree\${foldersOpen ? " is-open" : ""}\`}
|
|
1528
|
+
/>`;
|
|
1529
|
+
expect(check('no-raw-popover', source)).toHaveLength(1);
|
|
1530
|
+
// The same class toggled by something that is not disclosure state is not a popup.
|
|
1531
|
+
expect(check('no-raw-popover', source.replace('foldersOpen', 'isDragging'))).toHaveLength(0);
|
|
1532
|
+
// Neither is a class the stylesheet does not position.
|
|
1533
|
+
setPositionedClasses(positionedClassesFromCss('.rail__tree.is-open { color: var(--x); }'));
|
|
1534
|
+
expect(check('no-raw-popover', source)).toHaveLength(0);
|
|
1535
|
+
});
|
|
1536
|
+
|
|
1537
|
+
test('passes an element whose positioned compound is only half there, and honours the opt-out', () => {
|
|
1538
|
+
setPositionedClasses(positionedClassesFromCss('.menu.is-open { position: fixed; }'));
|
|
1539
|
+
expect(check('no-raw-popover', `{open && <div className="menu">x</div>}`)).toHaveLength(0);
|
|
1540
|
+
expect(
|
|
1541
|
+
check(
|
|
1542
|
+
'no-raw-popover',
|
|
1543
|
+
`// guardrails-ignore no-raw-popover: closes through useOutsidePress; a drawer, not a popup
|
|
1544
|
+
<nav className={\`menu\${open ? " is-open" : ""}\`}>x</nav>`,
|
|
1545
|
+
),
|
|
1546
|
+
).toHaveLength(0);
|
|
1547
|
+
});
|
|
1548
|
+
});
|
|
@@ -1836,8 +1836,20 @@ const noRawLazy: Rule = {
|
|
|
1836
1836
|
// genuinely is not a popup (an in-place badge, a drop-target overlay) takes the opt-out
|
|
1837
1837
|
// with its reason in the comment block above. The belt's own `Popover` is exempt.
|
|
1838
1838
|
// Bounded (160 chars, no `{}<>;`): unbounded, a 9,000-line file backtracked for minutes.
|
|
1839
|
+
//
|
|
1840
|
+
// 🔴 And the position need not be in the markup at all. The 2026-09-27 survey found four
|
|
1841
|
+
// popups this could not see because an app's STYLESHEET positioned them — music's folder
|
|
1842
|
+
// tree (`.rail__tree.is-open { position: fixed }`, toggled by a class), music's visualizer
|
|
1843
|
+
// panel, roms' speed picker (a `<fieldset>`), family's live panel (a component whose root
|
|
1844
|
+
// is `.ft-live-panel`). So a scan first reads every `.css` it walks and collects the class
|
|
1845
|
+
// compounds a rule positions (`positionedClassesFromCss`), and then three more shapes are
|
|
1846
|
+
// the same violation: a conditionally rendered element whose classes complete one; a
|
|
1847
|
+
// conditionally rendered same-file component whose root element's do; and an element
|
|
1848
|
+
// that is always there but whose disclosure-state class (`${open ? " is-open" : ""}`)
|
|
1849
|
+
// completes one. A panel that uses `useOutsidePress` is NOT exempt by construction — the
|
|
1850
|
+
// rule is on the shape, and the hook is the reason to write in the opt-out.
|
|
1839
1851
|
const RAW_POPOVER_RE =
|
|
1840
|
-
/\{([^{}<>;]{1,160}?)(?:&&|\?)\s*\(?\s*<(div|ul|ol|section|menu|aside|nav|span|form|dialog)\b/g;
|
|
1852
|
+
/\{([^{}<>;]{1,160}?)(?:&&|\?)\s*\(?\s*<(div|ul|ol|section|menu|aside|nav|span|form|dialog|fieldset|[A-Z][A-Za-z0-9]*)\b/g;
|
|
1841
1853
|
const POPOVER_STATE_RE = /(open|menu|expanded|dropdown|popover|picker|flyout|popup|popout|suggestions)/i;
|
|
1842
1854
|
const FLOATING_POSITION_RE =
|
|
1843
1855
|
/(?:^|[\s"'`{:])(?:[a-z0-9-]+:)*(?:absolute|fixed)(?=[\s"'`}]|$)|position\s*:\s*["'](?:absolute|fixed)["']/;
|
|
@@ -1860,7 +1872,10 @@ const noRawPopover: Rule = {
|
|
|
1860
1872
|
if (!POPOVER_STATE_RE.test(condition)) continue;
|
|
1861
1873
|
const tagStart = (match.index ?? 0) + match[0].lastIndexOf("<");
|
|
1862
1874
|
const tag = readOpeningTag(source, tagStart);
|
|
1863
|
-
if (!FLOATING_POSITION_RE.test(tag.code))
|
|
1875
|
+
if (!FLOATING_POSITION_RE.test(tag.code) && !completesPositioned(classTokens(tag.code))) {
|
|
1876
|
+
const name = match[2] ?? "";
|
|
1877
|
+
if (!/^[A-Z]/.test(name) || !localComponentRootIsPositioned(source, scannable, name)) continue;
|
|
1878
|
+
}
|
|
1864
1879
|
const line = lineOf(source, tagStart);
|
|
1865
1880
|
const matchLine = lineOf(source, match.index ?? 0);
|
|
1866
1881
|
if (
|
|
@@ -1872,10 +1887,121 @@ const noRawPopover: Rule = {
|
|
|
1872
1887
|
continue;
|
|
1873
1888
|
out.push({ file: filePath, line, snippet: lines[line - 1]?.trim().slice(0, 160) ?? "" });
|
|
1874
1889
|
}
|
|
1890
|
+
// The always-rendered shape: a disclosure-state class completes a positioned compound.
|
|
1891
|
+
if (POSITIONED_CLASSES.length > 0) {
|
|
1892
|
+
for (const match of scannable.matchAll(/\bclassName=\{/g)) {
|
|
1893
|
+
const open = (match.index ?? 0) + match[0].length - 1;
|
|
1894
|
+
const value = balancedBraces(source, open);
|
|
1895
|
+
const toggled = new Set<string>();
|
|
1896
|
+
for (const cond of value.matchAll(TOGGLED_CLASS_RE)) {
|
|
1897
|
+
const condition = cond[1] ?? "";
|
|
1898
|
+
if (condition.trim().startsWith("!") || !POPOVER_STATE_RE.test(condition)) continue;
|
|
1899
|
+
for (const token of (cond[3] ?? "").split(/\s+/)) if (token) toggled.add(token);
|
|
1900
|
+
}
|
|
1901
|
+
if (toggled.size === 0) continue;
|
|
1902
|
+
const all = classTokens(`className={${value}}`);
|
|
1903
|
+
const hit = POSITIONED_CLASSES.some(
|
|
1904
|
+
(compound) => compound.some((c) => toggled.has(c)) && compound.every((c) => all.has(c)),
|
|
1905
|
+
);
|
|
1906
|
+
if (!hit) continue;
|
|
1907
|
+
const tagStart = source.lastIndexOf("<", match.index ?? 0);
|
|
1908
|
+
const line = lineOf(source, match.index ?? 0);
|
|
1909
|
+
const tagLine = lineOf(source, Math.max(0, tagStart));
|
|
1910
|
+
if (
|
|
1911
|
+
RAW_POPOVER_IGNORE_RE.test(lines[line - 1] ?? "") ||
|
|
1912
|
+
RAW_POPOVER_IGNORE_RE.test(blockAbove(lines, line)) ||
|
|
1913
|
+
RAW_POPOVER_IGNORE_RE.test(blockAbove(lines, tagLine))
|
|
1914
|
+
)
|
|
1915
|
+
continue;
|
|
1916
|
+
out.push({ file: filePath, line, snippet: lines[line - 1]?.trim().slice(0, 160) ?? "" });
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1875
1919
|
return out;
|
|
1876
1920
|
},
|
|
1877
1921
|
};
|
|
1878
1922
|
|
|
1923
|
+
/** `open ? " is-open" : …` / `open && "is-open"` — the condition, the quote, the class text. */
|
|
1924
|
+
const TOGGLED_CLASS_RE = /([^?:&|(){}`$,]{1,80}?)\s*(?:\?|&&)\s*(["'`])([^"'`$]*)\2/g;
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Class compounds a scanned stylesheet positions `absolute`/`fixed` — each the classes of a
|
|
1928
|
+
* selector's LAST compound (`.rail__tree.is-open` → `["rail__tree", "is-open"]`; the
|
|
1929
|
+
* `summary::before` of `.menu[open] > summary::before` has none and is skipped). Set once per
|
|
1930
|
+
* scan by `main()` from the `.css` files it walked; `setPositionedClasses` for library use.
|
|
1931
|
+
*/
|
|
1932
|
+
let POSITIONED_CLASSES: string[][] = [];
|
|
1933
|
+
export function setPositionedClasses(compounds: readonly (readonly string[])[]): void {
|
|
1934
|
+
POSITIONED_CLASSES = compounds.map((c) => [...c]);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
const CSS_POSITION_RE = /(?:^|[;{\s])position\s*:\s*(?:absolute|fixed)\b/;
|
|
1938
|
+
|
|
1939
|
+
export function positionedClassesFromCss(css: string): string[][] {
|
|
1940
|
+
const out: string[][] = [];
|
|
1941
|
+
const seen = new Set<string>();
|
|
1942
|
+
const plain = css.replace(/\/\*[\s\S]*?\*\//g, " ");
|
|
1943
|
+
for (const block of plain.matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
|
|
1944
|
+
if (!CSS_POSITION_RE.test(block[2] ?? "")) continue;
|
|
1945
|
+
for (const selector of (block[1] ?? "").split(",")) {
|
|
1946
|
+
const parts = selector.trim().split(/\s*[\s>+~]\s*/);
|
|
1947
|
+
const last = (parts[parts.length - 1] ?? "")
|
|
1948
|
+
.replace(/\[[^\]]*\]/g, "")
|
|
1949
|
+
.replace(/::?[\w-]+(?:\([^)]*\))?/g, "");
|
|
1950
|
+
const classes = [...last.matchAll(/\.([A-Za-z_][\w-]*)/g)].map((m) => m[1] as string);
|
|
1951
|
+
if (classes.length === 0) continue;
|
|
1952
|
+
const key = [...classes].sort().join(".");
|
|
1953
|
+
if (seen.has(key)) continue;
|
|
1954
|
+
seen.add(key);
|
|
1955
|
+
out.push(classes);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
return out;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/** Every class-looking token quoted inside a tag's `className` value. */
|
|
1962
|
+
function classTokens(tagCode: string): Set<string> {
|
|
1963
|
+
const tokens = new Set<string>();
|
|
1964
|
+
const at = tagCode.search(/\bclassName=/);
|
|
1965
|
+
if (at === -1) return tokens;
|
|
1966
|
+
let value = tagCode.slice(at + "className=".length);
|
|
1967
|
+
if (value.startsWith("{")) value = balancedBraces(value, 0);
|
|
1968
|
+
else value = value.match(/^(["'])([^"']*)\1/)?.[2] ?? "";
|
|
1969
|
+
const add = (text: string) => {
|
|
1970
|
+
for (const token of text.split(/\s+/)) if (/^[A-Za-z_][\w-]*$/.test(token)) tokens.add(token);
|
|
1971
|
+
};
|
|
1972
|
+
if (!/["'`]/.test(value)) add(value);
|
|
1973
|
+
// Two passes: a template's own text, then every quoted string — including the ones
|
|
1974
|
+
// inside its `${…}`, which is where a toggled class lives.
|
|
1975
|
+
for (const quoted of value.matchAll(/`([^`]*)`/g)) add((quoted[1] ?? "").replace(/\$\{[^}]*\}/g, " "));
|
|
1976
|
+
for (const quoted of value.matchAll(/"([^"]*)"|'([^']*)'/g)) add(quoted[1] ?? quoted[2] ?? "");
|
|
1977
|
+
return tokens;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
function completesPositioned(classes: Set<string>): boolean {
|
|
1981
|
+
return POSITIONED_CLASSES.some((compound) => compound.every((c) => classes.has(c)));
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
/** The text inside the `{…}` that opens at `open`, braces balanced; the rest of the source if unbalanced. */
|
|
1985
|
+
function balancedBraces(source: string, open: number): string {
|
|
1986
|
+
let depth = 0;
|
|
1987
|
+
for (let i = open; i < source.length && i < open + 2000; i++) {
|
|
1988
|
+
if (source[i] === "{") depth++;
|
|
1989
|
+
else if (source[i] === "}" && --depth === 0) return source.slice(open + 1, i);
|
|
1990
|
+
}
|
|
1991
|
+
return source.slice(open + 1, Math.min(source.length, open + 2000));
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
/** A component declared in THIS file whose first returned element is positioned. */
|
|
1995
|
+
function localComponentRootIsPositioned(source: string, scannable: string, name: string): boolean {
|
|
1996
|
+
const declared = new RegExp(`\\bfunction\\s+${name}\\s*[(<]|\\b(?:const|let)\\s+${name}\\s*=`).exec(scannable);
|
|
1997
|
+
if (!declared) return false;
|
|
1998
|
+
const body = scannable.slice(declared.index, declared.index + 8000);
|
|
1999
|
+
const ret = /(?:\breturn\s*\(?|=>\s*\(?)\s*<(?=[a-z])/.exec(body);
|
|
2000
|
+
if (!ret) return false;
|
|
2001
|
+
const tag = readOpeningTag(source, declared.index + ret.index + ret[0].length - 1);
|
|
2002
|
+
return FLOATING_POSITION_RE.test(tag.code) || completesPositioned(classTokens(tag.code));
|
|
2003
|
+
}
|
|
2004
|
+
|
|
1879
2005
|
export const RULES: Record<string, Rule> = {
|
|
1880
2006
|
[noRawActionButton.name]: noRawActionButton,
|
|
1881
2007
|
[noRawOverflow.name]: noRawOverflow,
|
|
@@ -2230,6 +2356,11 @@ function main() {
|
|
|
2230
2356
|
const sourcesByFile = new Map<string, string>();
|
|
2231
2357
|
for (const file of files) sourcesByFile.set(file, readFileSync(file, "utf8"));
|
|
2232
2358
|
|
|
2359
|
+
// `no-raw-popover` sees a popup its app's stylesheet positions — see that rule.
|
|
2360
|
+
setPositionedClasses(
|
|
2361
|
+
[...sourcesByFile].filter(([file]) => extname(file) === ".css").flatMap(([, css]) => positionedClassesFromCss(css)),
|
|
2362
|
+
);
|
|
2363
|
+
|
|
2233
2364
|
// Parse file-scoped allowances once per file; surface malformed directives loudly.
|
|
2234
2365
|
const allowsByFile = new Map<string, FileAllow[]>();
|
|
2235
2366
|
const honoredAllows: { file: string; allow: FileAllow }[] = [];
|
|
@@ -4,7 +4,7 @@ import { useDiscardGuard } from '../hooks/useDiscardGuard.js';
|
|
|
4
4
|
import { type SwipeDismissDirection, useSwipeToDismiss } from '../hooks/useSwipeToDismiss.js';
|
|
5
5
|
import { cn } from '../lib/cn.js';
|
|
6
6
|
import { FooterSlot } from './ActionBar.js';
|
|
7
|
-
import { Dialog, DialogContent, DialogTitle } from './dialog.js';
|
|
7
|
+
import { Dialog, DialogContent, DialogTitle, focusPanelOnOpen } from './dialog.js';
|
|
8
8
|
import { IconButton } from './IconButton.js';
|
|
9
9
|
import { ScrollArea } from './ScrollArea.js';
|
|
10
10
|
|
|
@@ -122,6 +122,7 @@ export function Drawer({
|
|
|
122
122
|
e.preventDefault();
|
|
123
123
|
guardedClose();
|
|
124
124
|
}}
|
|
125
|
+
onOpenAutoFocus={focusPanelOnOpen}
|
|
125
126
|
onEscapeKeyDown={(e) => {
|
|
126
127
|
e.preventDefault();
|
|
127
128
|
if (isConfirming) cancelDiscard();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { X } from 'lucide-react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { cn } from '../lib/cn.js';
|
|
4
|
-
import { Dialog, DialogContent, DialogTitle } from './dialog.js';
|
|
4
|
+
import { Dialog, DialogContent, DialogTitle, focusPanelOnOpen } from './dialog.js';
|
|
5
5
|
import { IconButton } from './IconButton.js';
|
|
6
6
|
|
|
7
7
|
export interface LightboxProps {
|
|
@@ -36,6 +36,7 @@ export function Lightbox({ open, onClose, children, caption }: LightboxProps) {
|
|
|
36
36
|
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
|
|
37
37
|
)}
|
|
38
38
|
onInteractOutside={() => onClose()}
|
|
39
|
+
onOpenAutoFocus={focusPanelOnOpen}
|
|
39
40
|
>
|
|
40
41
|
{/* Names the dialog for assistive tech (Radix requires a title). */}
|
|
41
42
|
<DialogTitle className='sr-only'>{caption ?? 'Media viewer'}</DialogTitle>
|
|
@@ -3,6 +3,7 @@ import { cleanup, fireEvent, render, waitFor } from '@testing-library/react';
|
|
|
3
3
|
import { confirm } from '../confirm.js';
|
|
4
4
|
import { ConfirmDialog } from './ConfirmDialog.js';
|
|
5
5
|
import { Drawer } from './Drawer.js';
|
|
6
|
+
import { Input } from './Input.js';
|
|
6
7
|
import { Lightbox } from './Lightbox.js';
|
|
7
8
|
import { Modal } from './Modal.js';
|
|
8
9
|
|
|
@@ -54,6 +55,31 @@ describe('Modal', () => {
|
|
|
54
55
|
expect(contentPanel()?.className).toContain('max-h-[calc(100dvh-2rem)]');
|
|
55
56
|
});
|
|
56
57
|
|
|
58
|
+
// 🔴 Radix's default auto-focus lands on the first focusable — always the header's X, whose
|
|
59
|
+
// tooltip opens on focus. Radix hands Escape to the TOPMOST layer, so the first Escape only shut
|
|
60
|
+
// the tooltip and the dialog needed two: measured in binary-server's admin, 2026-09-28.
|
|
61
|
+
test('opening focuses the panel, not the X — one Escape closes it', async () => {
|
|
62
|
+
let closed = 0;
|
|
63
|
+
render(
|
|
64
|
+
<Modal open onClose={() => closed++} title='t'>
|
|
65
|
+
<p>x</p>
|
|
66
|
+
</Modal>,
|
|
67
|
+
);
|
|
68
|
+
await waitFor(() => expect(document.activeElement).toBe(contentPanel() ?? null));
|
|
69
|
+
expect(body().querySelector('[role="tooltip"]')).toBeNull();
|
|
70
|
+
fireEvent.keyDown(document.activeElement as HTMLElement, { key: 'Escape' });
|
|
71
|
+
expect(closed).toBe(1);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('a field with autoFocus keeps it — the panel only takes focus nothing inside claimed', async () => {
|
|
75
|
+
render(
|
|
76
|
+
<Modal open onClose={() => {}} isDirty={false} title='t'>
|
|
77
|
+
<Input aria-label='name' autoFocus />
|
|
78
|
+
</Modal>,
|
|
79
|
+
);
|
|
80
|
+
await waitFor(() => expect(document.activeElement).toBe(body().querySelector('[aria-label="name"]')));
|
|
81
|
+
});
|
|
82
|
+
|
|
57
83
|
test('a clean close (the X) calls onClose directly — no discard prompt', () => {
|
|
58
84
|
let closed = 0;
|
|
59
85
|
render(
|
|
@@ -336,6 +362,18 @@ describe('Drawer', () => {
|
|
|
336
362
|
expect(closed).toBe(1);
|
|
337
363
|
});
|
|
338
364
|
|
|
365
|
+
test('opening focuses the panel, not the X — one Escape closes it', async () => {
|
|
366
|
+
let closed = 0;
|
|
367
|
+
render(
|
|
368
|
+
<Drawer open onClose={() => closed++} title='t'>
|
|
369
|
+
<p>x</p>
|
|
370
|
+
</Drawer>,
|
|
371
|
+
);
|
|
372
|
+
await waitFor(() => expect(document.activeElement?.getAttribute('role')).toBe('dialog'));
|
|
373
|
+
fireEvent.keyDown(document.activeElement as HTMLElement, { key: 'Escape' });
|
|
374
|
+
expect(closed).toBe(1);
|
|
375
|
+
});
|
|
376
|
+
|
|
339
377
|
test('a plain click on the header (no drag) still lets the Close button work', () => {
|
|
340
378
|
let closed = 0;
|
|
341
379
|
render(
|
|
@@ -387,6 +425,18 @@ describe('Lightbox', () => {
|
|
|
387
425
|
fireEvent.click(panel?.querySelector('[aria-label="Close"]') as HTMLElement);
|
|
388
426
|
expect(closed).toBe(1);
|
|
389
427
|
});
|
|
428
|
+
|
|
429
|
+
test('opening focuses the panel, not the X — one Escape closes it', async () => {
|
|
430
|
+
let closed = 0;
|
|
431
|
+
render(
|
|
432
|
+
<Lightbox open onClose={() => closed++}>
|
|
433
|
+
<img alt='' src='x.png' />
|
|
434
|
+
</Lightbox>,
|
|
435
|
+
);
|
|
436
|
+
await waitFor(() => expect(document.activeElement).toBe(dialogs()[0] ?? null));
|
|
437
|
+
fireEvent.keyDown(document.activeElement as HTMLElement, { key: 'Escape' });
|
|
438
|
+
expect(closed).toBe(1);
|
|
439
|
+
});
|
|
390
440
|
});
|
|
391
441
|
|
|
392
442
|
describe('Modal — DESIGN.md §6, a widescreen creation flow is TWO columns', () => {
|
|
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import { useDiscardGuard } from '../hooks/useDiscardGuard.js';
|
|
4
4
|
import { cn } from '../lib/cn.js';
|
|
5
5
|
import { FooterSlot } from './ActionBar.js';
|
|
6
|
-
import { Dialog, DialogContent, DialogTitle } from './dialog.js';
|
|
6
|
+
import { Dialog, DialogContent, DialogTitle, focusPanelOnOpen } from './dialog.js';
|
|
7
7
|
import { IconButton } from './IconButton.js';
|
|
8
8
|
import { ScrollArea } from './ScrollArea.js';
|
|
9
9
|
|
|
@@ -179,6 +179,7 @@ export function Modal({
|
|
|
179
179
|
if (backdropClose) guardedClose();
|
|
180
180
|
}}
|
|
181
181
|
onInteractOutside={(e) => e.preventDefault()}
|
|
182
|
+
onOpenAutoFocus={focusPanelOnOpen}
|
|
182
183
|
onEscapeKeyDown={(e) => {
|
|
183
184
|
e.preventDefault();
|
|
184
185
|
if (isConfirming) cancelDiscard();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test } from 'bun:test';
|
|
2
2
|
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react';
|
|
3
3
|
import { type ButtonHTMLAttributes, type Ref, useState } from 'react';
|
|
4
|
-
import { Popover, type PopoverPoint } from './Popover.js';
|
|
4
|
+
import { FloatingContainer, Popover, type PopoverPoint } from './Popover.js';
|
|
5
5
|
|
|
6
6
|
afterEach(cleanup);
|
|
7
7
|
|
|
@@ -239,3 +239,45 @@ describe('full screen', () => {
|
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
});
|
|
242
|
+
|
|
243
|
+
describe('an app-declared container', () => {
|
|
244
|
+
/*
|
|
245
|
+
* desk keeps its tokens on `.cs-root`, so a panel portalled to `body` draws with no
|
|
246
|
+
* colours and no z-index. `FloatingContainer` names where the app's panels mount.
|
|
247
|
+
*/
|
|
248
|
+
test('the panel mounts in the container the app named, not in body', () => {
|
|
249
|
+
const host = document.createElement('div');
|
|
250
|
+
document.body.appendChild(host);
|
|
251
|
+
try {
|
|
252
|
+
render(
|
|
253
|
+
<FloatingContainer container={host}>
|
|
254
|
+
<Harness />
|
|
255
|
+
</FloatingContainer>,
|
|
256
|
+
);
|
|
257
|
+
openIt();
|
|
258
|
+
expect(host.contains(panel())).toBe(true);
|
|
259
|
+
} finally {
|
|
260
|
+
host.remove();
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
test('a full-screen element still wins over it — the only subtree the browser paints', () => {
|
|
265
|
+
const host = document.createElement('div');
|
|
266
|
+
const stage = document.createElement('div');
|
|
267
|
+
document.body.append(host, stage);
|
|
268
|
+
Object.defineProperty(document, 'fullscreenElement', { configurable: true, get: () => stage });
|
|
269
|
+
try {
|
|
270
|
+
render(
|
|
271
|
+
<FloatingContainer container={host}>
|
|
272
|
+
<Harness />
|
|
273
|
+
</FloatingContainer>,
|
|
274
|
+
);
|
|
275
|
+
openIt();
|
|
276
|
+
expect(stage.contains(panel())).toBe(true);
|
|
277
|
+
} finally {
|
|
278
|
+
Object.defineProperty(document, 'fullscreenElement', { configurable: true, get: () => null });
|
|
279
|
+
host.remove();
|
|
280
|
+
stage.remove();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
@@ -9,6 +9,14 @@ import {
|
|
|
9
9
|
FLOATING_CONTENT_BASE,
|
|
10
10
|
} from '../lib/floatingStyles.js';
|
|
11
11
|
|
|
12
|
+
/*
|
|
13
|
+
* Re-exported so an app that imports only this subpath (desk, which has no Tailwind and
|
|
14
|
+
* never loads the barrel) can set where its panels mount, and give a panel that is not a
|
|
15
|
+
* Popover — a mention picker inside an editor — the same tap-away.
|
|
16
|
+
*/
|
|
17
|
+
export { FloatingContainer } from '../lib/floatingContainer.js';
|
|
18
|
+
export { type UseOutsidePressOptions, useOutsidePress } from '../hooks/useOutsidePress.js';
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* A point to open a popover at, for a panel that has no trigger of its own — a context
|
|
14
22
|
* menu at the pointer, or a menu one control opens for another.
|
|
@@ -21,6 +21,22 @@ export const DialogClose = DialogPrimitive.Close;
|
|
|
21
21
|
export const DialogTitle = DialogPrimitive.Title;
|
|
22
22
|
export const DialogDescription = DialogPrimitive.Description;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* `onOpenAutoFocus` for a panel whose first focusable is its header's Close button (Modal,
|
|
26
|
+
* Drawer): focus the PANEL instead — Radix gives it `tabIndex=-1`, so Tab still reaches the X
|
|
27
|
+
* first and the focus trap is unchanged.
|
|
28
|
+
*
|
|
29
|
+
* 🔴 Radix's default lands on that X, and the X's tooltip opens on focus. Radix hands Escape to
|
|
30
|
+
* the TOPMOST dismissable layer, which was the tooltip: the first Escape shut the tooltip and the
|
|
31
|
+
* dialog needed a second one, with a "Close" bubble hanging over the header until then. Measured
|
|
32
|
+
* in binary-server's admin, 2026-09-28. A field with `autoFocus` keeps its focus, because Radix
|
|
33
|
+
* only fires this when nothing inside the panel has claimed focus yet.
|
|
34
|
+
*/
|
|
35
|
+
export const focusPanelOnOpen = (e: Event): void => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
(e.currentTarget as HTMLElement | null)?.focus();
|
|
38
|
+
};
|
|
39
|
+
|
|
24
40
|
/** Shared dimmer behind every overlay: a fixed, blurred scrim that fades with state. */
|
|
25
41
|
export const DialogOverlay = forwardRef<
|
|
26
42
|
HTMLDivElement,
|
package/src/react/index.ts
CHANGED
|
@@ -430,6 +430,7 @@ export { PathText, type PathTextProps } from './components/PathText.js';
|
|
|
430
430
|
export { TruncatedText, type TruncatedTextProps } from './components/TruncatedText.js';
|
|
431
431
|
export { PluginCard, type PluginCardProps } from './components/PluginCard.js';
|
|
432
432
|
export { Popover, PopoverClose, type PopoverPoint, type PopoverProps } from './components/Popover.js';
|
|
433
|
+
export { FloatingContainer } from './lib/floatingContainer.js';
|
|
433
434
|
export {
|
|
434
435
|
Progress,
|
|
435
436
|
type ProgressProps,
|