@strands.gg/lumen 3.0.17 → 3.0.18
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/nuxt/module.cjs.js +2 -2
- package/dist/nuxt/module.es.js +43 -23
- package/package.json +1 -1
package/dist/nuxt/module.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("@nuxt/kit");var r=typeof document<"u"?document.currentScript:null;const d={accentColor:"#EA00A8",styles:!0,theme:"system"},f=s.defineNuxtModule({meta:{name:"@strands.gg/lumen/nuxt",configKey:"lumen",compatibility:{nuxt:"^3.0.0 || ^4.0.0"}},defaults:d,async setup(t,e){const a=s.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:r&&r.tagName.toUpperCase()==="SCRIPT"&&r.src||new URL("nuxt/module.cjs.js",document.baseURI).href);e.options.runtimeConfig.public=e.options.runtimeConfig.public||{};const m={...t,styles:t.styles!==!1};if(e.options.runtimeConfig.public.lumen=m,e.options.appConfig&&(e.options.appConfig.lumen=m),t.styles!==!1){e.options.css.push(a.resolve("../lumen.css"));const o=a.resolve("../fonts");e.hook("nitro:config",n=>{n.publicAssets=n.publicAssets||[],n.publicAssets.push({dir:o,baseURL:"/_lumen/fonts",maxAge:3600*24*365})}),e.options.app.head=e.options.app.head||{},e.options.app.head.style=e.options.app.head.style||[],e.options.app.head.style.push({innerHTML:["@font-face{font-family:'Satoshi';font-weight:300 900;font-display:swap;font-style:normal;src:url('/_lumen/fonts/Satoshi-Variable.woff2') format('woff2')}","@font-face{font-family:'Satoshi';font-weight:300 900;font-display:swap;font-style:italic;src:url('/_lumen/fonts/Satoshi-VariableItalic.woff2') format('woff2')}","@font-face{font-family:'Courier New';font-weight:400;font-display:swap;font-style:normal;src:url('/_lumen/fonts/CourierNew-Regular.ttf') format('truetype')}","@font-face{font-family:'Courier New';font-weight:700;font-display:swap;font-style:normal;src:url('/_lumen/fonts/CourierNew-Bold.ttf') format('truetype')}"].join(""),key:"lumen-fonts"})}if(t.accentColor&&t.accentColor!=="#EA00A8"){const o=t.accentColor,n=`
|
|
2
2
|
:root {
|
|
3
3
|
--lumen-custom-accent: ${o};
|
|
4
4
|
--lumen-custom-50: color-mix(in srgb, ${o} 10%, white);
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
--lumen-custom-900: color-mix(in srgb, ${o} 40%, black);
|
|
14
14
|
--lumen-custom-950: color-mix(in srgb, ${o} 25%, black);
|
|
15
15
|
}
|
|
16
|
-
`;e.options.app.head=e.options.app.head||{},e.options.app.head.style=e.options.app.head.style||[],e.options.app.head.style.unshift({innerHTML:
|
|
16
|
+
`;e.options.app.head=e.options.app.head||{},e.options.app.head.style=e.options.app.head.style||[],e.options.app.head.style.unshift({innerHTML:n,key:"lumen-accent-override"})}const l=t.theme||"system";if(e.options.app.head=e.options.app.head||{},l==="dark"||l==="light"){if(e.options.app.head.htmlAttrs=e.options.app.head.htmlAttrs||{},e.options.app.head.htmlAttrs["data-theme"]=l,l==="dark"){const o=e.options.app.head.htmlAttrs.class||"";e.options.app.head.htmlAttrs.class=[o,"dark"].filter(Boolean).join(" ")}}else e.options.app.head.script=e.options.app.head.script||[],e.options.app.head.script.unshift({key:"lumen-theme-init",innerHTML:["(function(){","var d=document.documentElement,","t=localStorage.getItem('lumen-theme')||'system';","if(t==='system'){t=matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light'}","d.setAttribute('data-theme',t);","if(t==='dark')d.classList.add('dark')","})()"].join(""),tagPosition:"head"});const i="es.js",u=a.resolve(`./runtime/plugin.client.${i}`),c=a.resolve(`./runtime/plugin.server.${i}`);s.addPlugin({src:u,mode:"client"}),s.addPlugin({src:c,mode:"server"}),s.addImports([{name:"useTheme",as:"useTheme",from:"@strands.gg/lumen"},{name:"useDarkMode",as:"useDarkMode",from:"@strands.gg/lumen"},{name:"useGlobalDarkMode",as:"useGlobalDarkMode",from:"@strands.gg/lumen"},{name:"useFloatingPosition",as:"useFloatingPosition",from:"@strands.gg/lumen"},{name:"useModalStack",as:"useModalStack",from:"@strands.gg/lumen"},{name:"useModalTeleport",as:"useModalTeleport",from:"@strands.gg/lumen"},{name:"useGlobalModalStack",as:"useGlobalModalStack",from:"@strands.gg/lumen"}]);const p=["LumenAlert","LumenApp","LumenAvatarEditor","LumenBunnyFontPicker","LumenButton","LumenButtonGroup","LumenCard","LumenCheckboxGroup","LumenCodeBlock","LumenColorPicker","LumenDateTimePicker","LumenDivider","LumenHero","LumenInput","LumenLevelProgress","LumenLink","LumenLoader","LumenMegaMenu","LumenMegaMenuItem","LumenMegaMenuPanel","LumenMegaMenuGroup","LumenModal","LumenPill","LumenRadioGroup","LumenSlider","LumenTable","LumenTabs","LumenThemeToggle","LumenToggle","LumenTooltip","LumenScrollSpy","VirtualList","SvgIcon"];for(const o of p)s.addComponent({name:o,export:o,filePath:"@strands.gg/lumen"})}});module.exports=f;
|
package/dist/nuxt/module.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineNuxtModule as p, createResolver as d, addPlugin as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtModule as p, createResolver as d, addPlugin as i, addImports as f, addComponent as h } from "@nuxt/kit";
|
|
2
|
+
const g = {
|
|
3
3
|
accentColor: "#EA00A8",
|
|
4
4
|
styles: !0,
|
|
5
5
|
theme: "system"
|
|
6
|
-
},
|
|
6
|
+
}, y = p({
|
|
7
7
|
meta: {
|
|
8
8
|
name: "@strands.gg/lumen/nuxt",
|
|
9
9
|
configKey: "lumen",
|
|
@@ -11,16 +11,36 @@ const L = {
|
|
|
11
11
|
nuxt: "^3.0.0 || ^4.0.0"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
defaults:
|
|
15
|
-
async setup(
|
|
16
|
-
const
|
|
14
|
+
defaults: g,
|
|
15
|
+
async setup(t, e) {
|
|
16
|
+
const n = d(import.meta.url);
|
|
17
17
|
e.options.runtimeConfig.public = e.options.runtimeConfig.public || {};
|
|
18
|
-
const
|
|
19
|
-
...
|
|
20
|
-
styles:
|
|
18
|
+
const l = {
|
|
19
|
+
...t,
|
|
20
|
+
styles: t.styles !== !1
|
|
21
21
|
};
|
|
22
|
-
if (e.options.runtimeConfig.public.lumen =
|
|
23
|
-
|
|
22
|
+
if (e.options.runtimeConfig.public.lumen = l, e.options.appConfig && (e.options.appConfig.lumen = l), t.styles !== !1) {
|
|
23
|
+
e.options.css.push(n.resolve("../lumen.css"));
|
|
24
|
+
const o = n.resolve("../fonts");
|
|
25
|
+
e.hook("nitro:config", (s) => {
|
|
26
|
+
s.publicAssets = s.publicAssets || [], s.publicAssets.push({
|
|
27
|
+
dir: o,
|
|
28
|
+
baseURL: "/_lumen/fonts",
|
|
29
|
+
maxAge: 3600 * 24 * 365
|
|
30
|
+
// 1 year cache
|
|
31
|
+
});
|
|
32
|
+
}), e.options.app.head = e.options.app.head || {}, e.options.app.head.style = e.options.app.head.style || [], e.options.app.head.style.push({
|
|
33
|
+
innerHTML: [
|
|
34
|
+
"@font-face{font-family:'Satoshi';font-weight:300 900;font-display:swap;font-style:normal;src:url('/_lumen/fonts/Satoshi-Variable.woff2') format('woff2')}",
|
|
35
|
+
"@font-face{font-family:'Satoshi';font-weight:300 900;font-display:swap;font-style:italic;src:url('/_lumen/fonts/Satoshi-VariableItalic.woff2') format('woff2')}",
|
|
36
|
+
"@font-face{font-family:'Courier New';font-weight:400;font-display:swap;font-style:normal;src:url('/_lumen/fonts/CourierNew-Regular.ttf') format('truetype')}",
|
|
37
|
+
"@font-face{font-family:'Courier New';font-weight:700;font-display:swap;font-style:normal;src:url('/_lumen/fonts/CourierNew-Bold.ttf') format('truetype')}"
|
|
38
|
+
].join(""),
|
|
39
|
+
key: "lumen-fonts"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (t.accentColor && t.accentColor !== "#EA00A8") {
|
|
43
|
+
const o = t.accentColor, s = `
|
|
24
44
|
:root {
|
|
25
45
|
--lumen-custom-accent: ${o};
|
|
26
46
|
--lumen-custom-50: color-mix(in srgb, ${o} 10%, white);
|
|
@@ -37,13 +57,13 @@ const L = {
|
|
|
37
57
|
}
|
|
38
58
|
`;
|
|
39
59
|
e.options.app.head = e.options.app.head || {}, e.options.app.head.style = e.options.app.head.style || [], e.options.app.head.style.unshift({
|
|
40
|
-
innerHTML:
|
|
60
|
+
innerHTML: s,
|
|
41
61
|
key: "lumen-accent-override"
|
|
42
62
|
});
|
|
43
63
|
}
|
|
44
|
-
const
|
|
45
|
-
if (e.options.app.head = e.options.app.head || {},
|
|
46
|
-
if (e.options.app.head.htmlAttrs = e.options.app.head.htmlAttrs || {}, e.options.app.head.htmlAttrs["data-theme"] =
|
|
64
|
+
const a = t.theme || "system";
|
|
65
|
+
if (e.options.app.head = e.options.app.head || {}, a === "dark" || a === "light") {
|
|
66
|
+
if (e.options.app.head.htmlAttrs = e.options.app.head.htmlAttrs || {}, e.options.app.head.htmlAttrs["data-theme"] = a, a === "dark") {
|
|
47
67
|
const o = e.options.app.head.htmlAttrs.class || "";
|
|
48
68
|
e.options.app.head.htmlAttrs.class = [o, "dark"].filter(Boolean).join(" ");
|
|
49
69
|
}
|
|
@@ -61,14 +81,14 @@ const L = {
|
|
|
61
81
|
].join(""),
|
|
62
82
|
tagPosition: "head"
|
|
63
83
|
});
|
|
64
|
-
const m = "es.js", r =
|
|
65
|
-
|
|
84
|
+
const m = "es.js", r = n.resolve(`./runtime/plugin.client.${m}`), u = n.resolve(`./runtime/plugin.server.${m}`);
|
|
85
|
+
i({
|
|
66
86
|
src: r,
|
|
67
87
|
mode: "client"
|
|
68
|
-
}),
|
|
69
|
-
src:
|
|
88
|
+
}), i({
|
|
89
|
+
src: u,
|
|
70
90
|
mode: "server"
|
|
71
|
-
}),
|
|
91
|
+
}), f([
|
|
72
92
|
{
|
|
73
93
|
name: "useTheme",
|
|
74
94
|
as: "useTheme",
|
|
@@ -105,7 +125,7 @@ const L = {
|
|
|
105
125
|
from: "@strands.gg/lumen"
|
|
106
126
|
}
|
|
107
127
|
]);
|
|
108
|
-
const
|
|
128
|
+
const c = [
|
|
109
129
|
"LumenAlert",
|
|
110
130
|
"LumenApp",
|
|
111
131
|
"LumenAvatarEditor",
|
|
@@ -141,7 +161,7 @@ const L = {
|
|
|
141
161
|
"VirtualList",
|
|
142
162
|
"SvgIcon"
|
|
143
163
|
];
|
|
144
|
-
for (const o of
|
|
164
|
+
for (const o of c)
|
|
145
165
|
h({
|
|
146
166
|
name: o,
|
|
147
167
|
export: o,
|
|
@@ -150,5 +170,5 @@ const L = {
|
|
|
150
170
|
}
|
|
151
171
|
});
|
|
152
172
|
export {
|
|
153
|
-
|
|
173
|
+
y as default
|
|
154
174
|
};
|