@studious-creative/yumekit 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/y-appbar.js +316 -7
- package/dist/components/y-icon.d.ts +3 -0
- package/dist/components/y-icon.js +29 -4
- package/dist/components/y-tag.d.ts +1 -1
- package/dist/components/y-tag.js +30 -5
- package/dist/components/y-theme.js +1 -1
- package/dist/components/y-toast.d.ts +1 -1
- package/dist/components/y-toast.js +5 -3
- package/dist/icons/all.js +67 -28
- package/dist/index.js +611 -398
- package/dist/react.d.ts +211 -130
- package/dist/styles/variables.css +3 -0
- package/dist/yumekit.min.js +1 -1
- package/package.json +1 -1
- package/dist/modules/load-defaults.d.ts +0 -1
- package/dist/modules/load-defaults.js +0 -45
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function loadDefaultVariables(): void;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-inject styles/variables.css into the document <head> so that
|
|
3
|
-
* all YumeKit CSS custom-properties are available globally — even when
|
|
4
|
-
* components are used without a <y-theme> wrapper.
|
|
5
|
-
*
|
|
6
|
-
* The `:root` variables defined in variables.css inherit through shadow-DOM
|
|
7
|
-
* boundaries, so every web-component can resolve its `var(--*)` references.
|
|
8
|
-
*
|
|
9
|
-
* This module is idempotent: the stylesheet is only injected once regardless
|
|
10
|
-
* of how many components import it.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const LINK_ID = "yumekit-default-variables";
|
|
14
|
-
|
|
15
|
-
let injected = false;
|
|
16
|
-
|
|
17
|
-
export function loadDefaultVariables() {
|
|
18
|
-
if (injected || typeof document === "undefined") return;
|
|
19
|
-
|
|
20
|
-
// Guard against duplicate injection (e.g. both ESM + IIFE bundles loaded)
|
|
21
|
-
if (document.getElementById(LINK_ID)) {
|
|
22
|
-
injected = true;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Resolve the URL relative to the importing script's location.
|
|
27
|
-
// import.meta.url points to this module file (e.g. src/modules/ or dist/modules/).
|
|
28
|
-
// Walk up to the package root, then into styles/.
|
|
29
|
-
let baseUrl = document.currentScript?.src || import.meta.url;
|
|
30
|
-
|
|
31
|
-
// Go up two levels: modules/ → src|dist/ → package root
|
|
32
|
-
const base = new URL("../../", baseUrl).href;
|
|
33
|
-
const stylesUrl = new URL("styles/variables.css", base).href;
|
|
34
|
-
|
|
35
|
-
const link = document.createElement("link");
|
|
36
|
-
link.id = LINK_ID;
|
|
37
|
-
link.rel = "stylesheet";
|
|
38
|
-
link.href = stylesUrl;
|
|
39
|
-
document.head.appendChild(link);
|
|
40
|
-
|
|
41
|
-
injected = true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Self-execute on import so components get defaults automatically
|
|
45
|
-
loadDefaultVariables();
|