rei-kit 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/BaseSkeleton-B-oo7JKE.js +43 -0
- package/dist/BaseSkeleton-B-oo7JKE.js.map +1 -0
- package/dist/{GoogleButton-nIRz9G8s.js → GoogleButton-DVro7xZH.js} +3 -33
- package/dist/GoogleButton-DVro7xZH.js.map +1 -0
- package/dist/app.js +2 -2
- package/dist/components/AvatarStack.vue.d.ts +24 -0
- package/dist/components/BaseChip.vue.d.ts +32 -0
- package/dist/components/BaseKbd.vue.d.ts +21 -0
- package/dist/components/BaseLink.vue.d.ts +33 -0
- package/dist/components/BaseListbox.vue.d.ts +38 -0
- package/dist/components/BaseRating.vue.d.ts +35 -0
- package/dist/components/BaseSeparator.vue.d.ts +20 -0
- package/dist/components/BaseSkeleton.vue.d.ts +25 -0
- package/dist/components/CopyButton.vue.d.ts +33 -0
- package/dist/components/FileDrop.vue.d.ts +45 -0
- package/dist/components/TagsInput.vue.d.ts +38 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +926 -167
- package/dist/index.js.map +1 -1
- package/dist/{inert-B441LoCD.js → inert-TJG_g0d6.js} +32 -2
- package/dist/inert-TJG_g0d6.js.map +1 -0
- package/dist/styles.css +697 -0
- package/dist/web/CommandMenu.vue.d.ts +50 -0
- package/dist/web/DataTable.vue.d.ts +61 -0
- package/dist/web/index.d.ts +13 -0
- package/dist/web.js +438 -51
- package/dist/web.js.map +1 -1
- package/package.json +2 -2
- package/dist/GoogleButton-nIRz9G8s.js.map +0 -1
- package/dist/inert-B441LoCD.js.map +0 -1
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
//#region src/utils/sheet-root.ts
|
|
2
|
+
/** The node every sheet teleports into. */
|
|
3
|
+
var SHEET_ROOT_ID = "sheet-root";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the sheet root, creating it if the page has none.
|
|
6
|
+
*
|
|
7
|
+
* `BaseSheet` teleports out of the app's tree so the app behind it can be
|
|
8
|
+
* marked `inert` — a sheet inside the element it is disabling would disable
|
|
9
|
+
* itself. That means it needs a mount point outside `#app`.
|
|
10
|
+
*
|
|
11
|
+
* It used to need the consuming app to put `<div id="sheet-root">` in its
|
|
12
|
+
* `index.html`, and nothing said so. A page without it got a sheet that opened,
|
|
13
|
+
* blocked the page, and rendered nothing: Vue warns to the console about a
|
|
14
|
+
* missing teleport target and carries on, so the build is green, the types are
|
|
15
|
+
* fine, and the screen is wrong. The kit's own showcase had exactly that bug,
|
|
16
|
+
* which is how it was found.
|
|
17
|
+
*
|
|
18
|
+
* So the node is made on demand. An app that already declares one keeps it —
|
|
19
|
+
* this only fills a gap, it never replaces.
|
|
20
|
+
*/
|
|
21
|
+
function ensureSheetRoot() {
|
|
22
|
+
const selector = `#${SHEET_ROOT_ID}`;
|
|
23
|
+
if (typeof document === "undefined") return selector;
|
|
24
|
+
if (document.getElementById("sheet-root")) return selector;
|
|
25
|
+
const root = document.createElement("div");
|
|
26
|
+
root.id = SHEET_ROOT_ID;
|
|
27
|
+
document.body.appendChild(root);
|
|
28
|
+
return selector;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
1
31
|
//#region src/utils/inert.ts
|
|
2
32
|
/**
|
|
3
33
|
* How many open layers hold each element inert. An element set inert by the
|
|
@@ -48,6 +78,6 @@ function inertOutside(keep) {
|
|
|
48
78
|
};
|
|
49
79
|
}
|
|
50
80
|
//#endregion
|
|
51
|
-
export { inertOutside as t };
|
|
81
|
+
export { SHEET_ROOT_ID as n, ensureSheetRoot as r, inertOutside as t };
|
|
52
82
|
|
|
53
|
-
//# sourceMappingURL=inert-
|
|
83
|
+
//# sourceMappingURL=inert-TJG_g0d6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inert-TJG_g0d6.js","names":[],"sources":["../src/utils/sheet-root.ts","../src/utils/inert.ts"],"sourcesContent":["/** The node every sheet teleports into. */\nexport const SHEET_ROOT_ID = 'sheet-root'\n\n/**\n * Returns the sheet root, creating it if the page has none.\n *\n * `BaseSheet` teleports out of the app's tree so the app behind it can be\n * marked `inert` — a sheet inside the element it is disabling would disable\n * itself. That means it needs a mount point outside `#app`.\n *\n * It used to need the consuming app to put `<div id=\"sheet-root\">` in its\n * `index.html`, and nothing said so. A page without it got a sheet that opened,\n * blocked the page, and rendered nothing: Vue warns to the console about a\n * missing teleport target and carries on, so the build is green, the types are\n * fine, and the screen is wrong. The kit's own showcase had exactly that bug,\n * which is how it was found.\n *\n * So the node is made on demand. An app that already declares one keeps it —\n * this only fills a gap, it never replaces.\n */\nexport function ensureSheetRoot(): string {\n const selector = `#${SHEET_ROOT_ID}`\n\n // Server-rendered: there is no document, and Teleport is skipped anyway.\n if (typeof document === 'undefined') return selector\n if (document.getElementById(SHEET_ROOT_ID)) return selector\n\n const root = document.createElement('div')\n root.id = SHEET_ROOT_ID\n document.body.appendChild(root)\n\n return selector\n}\n","/**\n * How many open layers hold each element inert. An element set inert by the\n * app itself is never in here, so releasing never undoes the app's own choice.\n */\nconst holds = new Map<Element, number>()\n\n/**\n * Takes everything on the page except the branch holding `keep` out of tab\n * order and pointer events, and returns the function that gives it back.\n *\n * `inert` is a real focus trap without keydown bookkeeping, and the only one\n * that also stops a screen reader's virtual cursor. It used to be applied to\n * `document.getElementById('app')` — the id Vite's template happens to use —\n * so an app mounted on `#root` got a dialog whose background was still\n * reachable with Tab, and nothing said so. Working from `<body>`'s children\n * instead holds whatever the app is mounted on, and anything else teleported\n * there too.\n *\n * Counted per element, so a sheet opened over a sheet, or a tour over either,\n * does not hand the page back when the inner one closes.\n */\nexport function inertOutside(keep: Element): () => void {\n if (typeof document === 'undefined') return () => {}\n\n const taken: Element[] = []\n\n for (const element of Array.from(document.body.children)) {\n if (element.contains(keep)) continue\n\n const count = holds.get(element)\n if (count === undefined) {\n if (element.hasAttribute('inert')) continue\n element.setAttribute('inert', '')\n }\n holds.set(element, (count ?? 0) + 1)\n taken.push(element)\n }\n\n let released = false\n\n return () => {\n if (released) return\n released = true\n\n for (const element of taken) {\n const count = (holds.get(element) ?? 1) - 1\n if (count > 0) {\n holds.set(element, count)\n continue\n }\n holds.delete(element)\n element.removeAttribute('inert')\n }\n }\n}\n"],"mappings":";;AACA,IAAa,gBAAgB;;;;;;;;;;;;;;;;;;AAmB7B,SAAgB,kBAA0B;CACxC,MAAM,WAAW,IAAI;CAGrB,IAAI,OAAO,aAAa,aAAa,OAAO;CAC5C,IAAI,SAAS,eAAA,YAA4B,GAAG,OAAO;CAEnD,MAAM,OAAO,SAAS,cAAc,KAAK;CACzC,KAAK,KAAK;CACV,SAAS,KAAK,YAAY,IAAI;CAE9B,OAAO;AACT;;;;;;;AC5BA,IAAM,wBAAQ,IAAI,IAAqB;;;;;;;;;;;;;;;;AAiBvC,SAAgB,aAAa,MAA2B;CACtD,IAAI,OAAO,aAAa,aAAa,aAAa,CAAC;CAEnD,MAAM,QAAmB,CAAC;CAE1B,KAAK,MAAM,WAAW,MAAM,KAAK,SAAS,KAAK,QAAQ,GAAG;EACxD,IAAI,QAAQ,SAAS,IAAI,GAAG;EAE5B,MAAM,QAAQ,MAAM,IAAI,OAAO;EAC/B,IAAI,UAAU,KAAA,GAAW;GACvB,IAAI,QAAQ,aAAa,OAAO,GAAG;GACnC,QAAQ,aAAa,SAAS,EAAE;EAClC;EACA,MAAM,IAAI,UAAU,SAAS,KAAK,CAAC;EACnC,MAAM,KAAK,OAAO;CACpB;CAEA,IAAI,WAAW;CAEf,aAAa;EACX,IAAI,UAAU;EACd,WAAW;EAEX,KAAK,MAAM,WAAW,OAAO;GAC3B,MAAM,SAAS,MAAM,IAAI,OAAO,KAAK,KAAK;GAC1C,IAAI,QAAQ,GAAG;IACb,MAAM,IAAI,SAAS,KAAK;IACxB;GACF;GACA,MAAM,OAAO,OAAO;GACpB,QAAQ,gBAAgB,OAAO;EACjC;CACF;AACF"}
|