@netoyed/ux4g-design-system-v3-cdn 1.0.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/dist/ux4g.cdn.es.js +287 -0
- package/dist/ux4g.cdn.es.js.map +1 -0
- package/dist/ux4g.cdn.min.js +2 -0
- package/dist/ux4g.cdn.min.js.map +1 -0
- package/dist/ux4g.cdn.umd.js +2 -0
- package/dist/ux4g.cdn.umd.js.map +1 -0
- package/package.json +16 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
const v = {
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------------------------
|
|
4
|
+
* CORE
|
|
5
|
+
* --------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
prefix: "ux4g-",
|
|
8
|
+
/**
|
|
9
|
+
* dev | build | cdn
|
|
10
|
+
* NOTE: CLI command will override this
|
|
11
|
+
*/
|
|
12
|
+
mode: "build",
|
|
13
|
+
/**
|
|
14
|
+
* --------------------------------------------------
|
|
15
|
+
* CONTENT (used for purge / JIT)
|
|
16
|
+
* --------------------------------------------------
|
|
17
|
+
*/
|
|
18
|
+
content: [
|
|
19
|
+
"./index.html",
|
|
20
|
+
"./src/**/*.{js,ts,jsx,tsx,vue,html}",
|
|
21
|
+
"./pages/**/*.{js,ts,jsx,tsx}",
|
|
22
|
+
"./components/**/*.{js,ts,jsx,tsx}",
|
|
23
|
+
"./**/*.php"
|
|
24
|
+
],
|
|
25
|
+
/**
|
|
26
|
+
* --------------------------------------------------
|
|
27
|
+
* THEME (tokens)
|
|
28
|
+
* --------------------------------------------------
|
|
29
|
+
*/
|
|
30
|
+
theme: {
|
|
31
|
+
colors: {
|
|
32
|
+
primary: {
|
|
33
|
+
50: "#EFF6FF",
|
|
34
|
+
500: "#3B82F6",
|
|
35
|
+
700: "#1D4ED8"
|
|
36
|
+
},
|
|
37
|
+
secondary: {
|
|
38
|
+
500: "#9333EA"
|
|
39
|
+
},
|
|
40
|
+
danger: {
|
|
41
|
+
500: "#EF4444"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
spacing: {
|
|
45
|
+
0: "0px",
|
|
46
|
+
1: "4px",
|
|
47
|
+
2: "8px",
|
|
48
|
+
4: "16px",
|
|
49
|
+
6: "24px",
|
|
50
|
+
8: "32px"
|
|
51
|
+
},
|
|
52
|
+
fontSize: {
|
|
53
|
+
xs: "12px",
|
|
54
|
+
sm: "14px",
|
|
55
|
+
md: "16px",
|
|
56
|
+
lg: "18px",
|
|
57
|
+
xl: "20px"
|
|
58
|
+
},
|
|
59
|
+
fontWeight: {
|
|
60
|
+
regular: 400,
|
|
61
|
+
medium: 500,
|
|
62
|
+
bold: 700
|
|
63
|
+
},
|
|
64
|
+
radius: {
|
|
65
|
+
sm: "4px",
|
|
66
|
+
md: "8px",
|
|
67
|
+
lg: "12px",
|
|
68
|
+
xl: "16px"
|
|
69
|
+
},
|
|
70
|
+
shadow: {
|
|
71
|
+
sm: "0 1px 2px rgba(0,0,0,0.05)",
|
|
72
|
+
md: "0 4px 6px rgba(0,0,0,0.1)"
|
|
73
|
+
},
|
|
74
|
+
zIndex: {
|
|
75
|
+
dropdown: 1e3,
|
|
76
|
+
modal: 1100,
|
|
77
|
+
toast: 1200
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* --------------------------------------------------
|
|
82
|
+
* RESPONSIVE
|
|
83
|
+
* --------------------------------------------------
|
|
84
|
+
*/
|
|
85
|
+
breakpoints: {
|
|
86
|
+
sm: "640px",
|
|
87
|
+
md: "768px",
|
|
88
|
+
lg: "1024px",
|
|
89
|
+
xl: "1280px"
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* --------------------------------------------------
|
|
93
|
+
* DARK MODE / THEMES
|
|
94
|
+
* --------------------------------------------------
|
|
95
|
+
*/
|
|
96
|
+
darkMode: {
|
|
97
|
+
enabled: !0,
|
|
98
|
+
strategy: "data-attribute",
|
|
99
|
+
// class | data-attribute
|
|
100
|
+
attribute: "data-theme",
|
|
101
|
+
themes: {
|
|
102
|
+
light: "light",
|
|
103
|
+
dark: "dark"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* --------------------------------------------------
|
|
108
|
+
* SAFELIST (dynamic classes)
|
|
109
|
+
* --------------------------------------------------
|
|
110
|
+
*/
|
|
111
|
+
safelist: [],
|
|
112
|
+
/**
|
|
113
|
+
* --------------------------------------------------
|
|
114
|
+
* COMPONENTS
|
|
115
|
+
* --------------------------------------------------
|
|
116
|
+
*/
|
|
117
|
+
components: {
|
|
118
|
+
button: !0,
|
|
119
|
+
card: !0,
|
|
120
|
+
input: !0,
|
|
121
|
+
modal: !1
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* --------------------------------------------------
|
|
125
|
+
* PLUGINS
|
|
126
|
+
* --------------------------------------------------
|
|
127
|
+
*/
|
|
128
|
+
plugins: [],
|
|
129
|
+
/**
|
|
130
|
+
* --------------------------------------------------
|
|
131
|
+
* OUTPUT
|
|
132
|
+
* --------------------------------------------------
|
|
133
|
+
*/
|
|
134
|
+
output: {
|
|
135
|
+
dir: "dist",
|
|
136
|
+
file: "ux4g.css",
|
|
137
|
+
minify: !0,
|
|
138
|
+
sourceMap: !1
|
|
139
|
+
}
|
|
140
|
+
}, w = {
|
|
141
|
+
// --- Spacing ---
|
|
142
|
+
p: { type: "space", property: "padding" },
|
|
143
|
+
pt: { type: "space", property: "padding-top" },
|
|
144
|
+
pr: { type: "space", property: "padding-right" },
|
|
145
|
+
pb: { type: "space", property: "padding-bottom" },
|
|
146
|
+
pl: { type: "space", property: "padding-left" },
|
|
147
|
+
px: { type: "space", property: ["padding-left", "padding-right"] },
|
|
148
|
+
py: { type: "space", property: ["padding-top", "padding-bottom"] },
|
|
149
|
+
m: { type: "space", property: "margin" },
|
|
150
|
+
mt: { type: "space", property: "margin-top" },
|
|
151
|
+
mr: { type: "space", property: "margin-right" },
|
|
152
|
+
mb: { type: "space", property: "margin-bottom" },
|
|
153
|
+
ml: { type: "space", property: "margin-left" },
|
|
154
|
+
mx: { type: "space", property: ["margin-left", "margin-right"] },
|
|
155
|
+
my: { type: "space", property: ["margin-top", "margin-bottom"] },
|
|
156
|
+
// --- Colors ---
|
|
157
|
+
text: { type: "color", property: "color" },
|
|
158
|
+
bg: { type: "color", property: "background-color" },
|
|
159
|
+
border: { type: "color", property: "border-color" },
|
|
160
|
+
// --- Typography ---
|
|
161
|
+
font: { type: "fontDetail", property: "font-weight" },
|
|
162
|
+
"text-size": { type: "text", property: "font-size" },
|
|
163
|
+
leading: { type: "value", property: "line-height" },
|
|
164
|
+
tracking: { type: "value", property: "letter-spacing" },
|
|
165
|
+
align: { type: "static", property: "text-align" },
|
|
166
|
+
// text-center
|
|
167
|
+
// --- Layout ---
|
|
168
|
+
flex: { type: "static", property: "display", value: "flex" },
|
|
169
|
+
"inline-flex": { type: "static", property: "display", value: "inline-flex" },
|
|
170
|
+
grid: { type: "static", property: "display", value: "grid" },
|
|
171
|
+
hidden: { type: "static", property: "display", value: "none" },
|
|
172
|
+
block: { type: "static", property: "display", value: "block" },
|
|
173
|
+
"inline-block": { type: "static", property: "display", value: "inline-block" },
|
|
174
|
+
items: { type: "static", property: "align-items" },
|
|
175
|
+
// start, end, center, baseline, stretch
|
|
176
|
+
justify: { type: "static", property: "justify-content" },
|
|
177
|
+
// start, end, center, between, around, evenly
|
|
178
|
+
self: { type: "static", property: "align-self" },
|
|
179
|
+
"flex-col": { type: "static", property: "flex-direction", value: "column" },
|
|
180
|
+
"flex-row": { type: "static", property: "flex-direction", value: "row" },
|
|
181
|
+
"flex-wrap": { type: "static", property: "flex-wrap", value: "wrap" },
|
|
182
|
+
"flex-nowrap": { type: "static", property: "flex-wrap", value: "nowrap" },
|
|
183
|
+
gap: { type: "space", property: "gap" },
|
|
184
|
+
"gap-x": { type: "space", property: "column-gap" },
|
|
185
|
+
"gap-y": { type: "space", property: "row-gap" },
|
|
186
|
+
// --- Sizing ---
|
|
187
|
+
w: { type: "size", property: "width" },
|
|
188
|
+
h: { type: "size", property: "height" },
|
|
189
|
+
"min-w": { type: "size", property: "min-width" },
|
|
190
|
+
"min-h": { type: "size", property: "min-height" },
|
|
191
|
+
"max-w": { type: "size", property: "max-width" },
|
|
192
|
+
"max-h": { type: "size", property: "max-height" },
|
|
193
|
+
// --- Borders & Effects ---
|
|
194
|
+
rounded: { type: "radius", property: "border-radius" },
|
|
195
|
+
shadow: { type: "shadow", property: "box-shadow" },
|
|
196
|
+
opacity: { type: "value", property: "opacity" },
|
|
197
|
+
z: { type: "zIndex", property: "z-index" },
|
|
198
|
+
// --- Position ---
|
|
199
|
+
absolute: { type: "static", property: "position", value: "absolute" },
|
|
200
|
+
relative: { type: "static", property: "position", value: "relative" },
|
|
201
|
+
fixed: { type: "static", property: "position", value: "fixed" },
|
|
202
|
+
top: { type: "space", property: "top" },
|
|
203
|
+
right: { type: "space", property: "right" },
|
|
204
|
+
bottom: { type: "space", property: "bottom" },
|
|
205
|
+
left: { type: "space", property: "left" }
|
|
206
|
+
};
|
|
207
|
+
function $(t, e) {
|
|
208
|
+
let a = null, n = t;
|
|
209
|
+
t.includes(":") && ([a, n] = t.split(":"));
|
|
210
|
+
let o = "";
|
|
211
|
+
if (!n.startsWith(e.prefix)) return null;
|
|
212
|
+
const f = n.replace(e.prefix, "");
|
|
213
|
+
for (const [x, p] of Object.entries(w)) {
|
|
214
|
+
const g = `${x}-`;
|
|
215
|
+
if (f.startsWith(g)) {
|
|
216
|
+
const r = f.slice(g.length);
|
|
217
|
+
let i = "";
|
|
218
|
+
if (p.type === "space") i = `var(--${e.prefix}space-${r})`;
|
|
219
|
+
else if (p.type === "color") i = `var(--${e.prefix}color-${r})`;
|
|
220
|
+
else if (p.type === "radius") i = `var(--${e.prefix}radius-${r || "DEFAULT"})`;
|
|
221
|
+
else if (p.type === "shadow") i = `var(--${e.prefix}shadow-${r || "DEFAULT"})`;
|
|
222
|
+
else if (p.type === "zIndex") i = `var(--${e.prefix}zIndex-${r})`;
|
|
223
|
+
else if (p.type === "fontDetail") i = `var(--${e.prefix}fontWeight-${r})`;
|
|
224
|
+
else if (p.type === "static")
|
|
225
|
+
if (p.value) {
|
|
226
|
+
if (r !== "" && !p.allowValue) continue;
|
|
227
|
+
i = p.value;
|
|
228
|
+
} else
|
|
229
|
+
i = r;
|
|
230
|
+
else if (p.type === "size")
|
|
231
|
+
if (e.theme.spacing[r])
|
|
232
|
+
i = `var(--${e.prefix}space-${r})`;
|
|
233
|
+
else if (r.includes("/")) {
|
|
234
|
+
const [y, b] = r.split("/");
|
|
235
|
+
i = `${parseInt(y) / parseInt(b) * 100}%`;
|
|
236
|
+
} else
|
|
237
|
+
continue;
|
|
238
|
+
else continue;
|
|
239
|
+
const m = Array.isArray(p.property) ? p.property : [p.property], h = p.type === "static" && p.value ? i : m.map((y) => `${y}:${i}`).join(";");
|
|
240
|
+
o = `.${z(t)}{${h};}`;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return o ? a ? `@media (min-width:${e.breakpoints[a]}){${o}}` : o : null;
|
|
245
|
+
}
|
|
246
|
+
function z(t) {
|
|
247
|
+
return t.replace(/:/g, "\\:");
|
|
248
|
+
}
|
|
249
|
+
function C() {
|
|
250
|
+
return {
|
|
251
|
+
usedClasses: /* @__PURE__ */ new Set(),
|
|
252
|
+
generatedCSS: /* @__PURE__ */ new Map()
|
|
253
|
+
// class → css
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
const c = { ...v };
|
|
257
|
+
window.ux4gConfig && Object.assign(c, window.ux4gConfig);
|
|
258
|
+
c.prefix = "ux4g-";
|
|
259
|
+
const l = C(), u = document.createElement("style");
|
|
260
|
+
u.id = "ux4g-cdn-styles";
|
|
261
|
+
document.head.appendChild(u);
|
|
262
|
+
let d = !1;
|
|
263
|
+
function k() {
|
|
264
|
+
let t = "";
|
|
265
|
+
for (const e of l.generatedCSS.values())
|
|
266
|
+
t += e;
|
|
267
|
+
u.textContent = t, d = !1;
|
|
268
|
+
}
|
|
269
|
+
function E() {
|
|
270
|
+
d || (d = !0, requestAnimationFrame(k));
|
|
271
|
+
}
|
|
272
|
+
function s(t) {
|
|
273
|
+
t.nodeType === 1 && (t.classList && t.classList.length > 0 && t.classList.forEach((e) => {
|
|
274
|
+
if (l.usedClasses.has(e)) return;
|
|
275
|
+
const a = $(e, c);
|
|
276
|
+
a && (l.usedClasses.add(e), l.generatedCSS.set(e, a), E());
|
|
277
|
+
}), t.children && Array.from(t.children).forEach(s));
|
|
278
|
+
}
|
|
279
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => s(document.body)) : s(document.body);
|
|
280
|
+
const S = new MutationObserver((t) => {
|
|
281
|
+
t.forEach((e) => {
|
|
282
|
+
e.type === "childList" ? e.addedNodes.forEach(s) : e.type === "attributes" && e.attributeName === "class" && s(e.target);
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
document.body && S.observe(document.body, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["class"] });
|
|
286
|
+
console.log("🌍 UX4G CDN Engine Active");
|
|
287
|
+
//# sourceMappingURL=ux4g.cdn.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ux4g.cdn.es.js","sources":["../../core/config/defaultConfig.js","../../core/jit/registry.js","../../core/jit/generator.js","../../core/jit/state.js","../index.js"],"sourcesContent":["/**\r\n * UX4G Design System – Default Config\r\n * DO NOT EDIT (user overrides via ux4g.config.js)\r\n */\r\n\r\nexport const defaultConfig = {\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CORE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tprefix: 'ux4g-',\r\n\r\n\t/**\r\n\t * dev | build | cdn\r\n\t * NOTE: CLI command will override this\r\n\t */\r\n\tmode: 'build',\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CONTENT (used for purge / JIT)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcontent: [\r\n\t\t'./index.html',\r\n\t\t'./src/**/*.{js,ts,jsx,tsx,vue,html}',\r\n\t\t'./pages/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./components/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./**/*.php'\r\n\t],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * THEME (tokens)\r\n\t * --------------------------------------------------\r\n\t */\r\n\ttheme: {\r\n\t\tcolors: {\r\n\t\t\tprimary: {\r\n\t\t\t\t50: '#EFF6FF',\r\n\t\t\t\t500: '#3B82F6',\r\n\t\t\t\t700: '#1D4ED8'\r\n\t\t\t},\r\n\t\t\tsecondary: {\r\n\t\t\t\t500: '#9333EA'\r\n\t\t\t},\r\n\t\t\tdanger: {\r\n\t\t\t\t500: '#EF4444'\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tspacing: {\r\n\t\t\t0: '0px',\r\n\t\t\t1: '4px',\r\n\t\t\t2: '8px',\r\n\t\t\t4: '16px',\r\n\t\t\t6: '24px',\r\n\t\t\t8: '32px'\r\n\t\t},\r\n\r\n\t\tfontSize: {\r\n\t\t\txs: '12px',\r\n\t\t\tsm: '14px',\r\n\t\t\tmd: '16px',\r\n\t\t\tlg: '18px',\r\n\t\t\txl: '20px'\r\n\t\t},\r\n\r\n\t\tfontWeight: {\r\n\t\t\tregular: 400,\r\n\t\t\tmedium: 500,\r\n\t\t\tbold: 700\r\n\t\t},\r\n\r\n\t\tradius: {\r\n\t\t\tsm: '4px',\r\n\t\t\tmd: '8px',\r\n\t\t\tlg: '12px',\r\n\t\t\txl: '16px'\r\n\t\t},\r\n\r\n\t\tshadow: {\r\n\t\t\tsm: '0 1px 2px rgba(0,0,0,0.05)',\r\n\t\t\tmd: '0 4px 6px rgba(0,0,0,0.1)'\r\n\t\t},\r\n\r\n\t\tzIndex: {\r\n\t\t\tdropdown: 1000,\r\n\t\t\tmodal: 1100,\r\n\t\t\ttoast: 1200\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * RESPONSIVE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tbreakpoints: {\r\n\t\tsm: '640px',\r\n\t\tmd: '768px',\r\n\t\tlg: '1024px',\r\n\t\txl: '1280px'\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * DARK MODE / THEMES\r\n\t * --------------------------------------------------\r\n\t */\r\n\tdarkMode: {\r\n\t\tenabled: true,\r\n\t\tstrategy: 'data-attribute', // class | data-attribute\r\n\t\tattribute: 'data-theme',\r\n\t\tthemes: {\r\n\t\t\tlight: 'light',\r\n\t\t\tdark: 'dark'\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * SAFELIST (dynamic classes)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tsafelist: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * COMPONENTS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcomponents: {\r\n\t\tbutton: true,\r\n\t\tcard: true,\r\n\t\tinput: true,\r\n\t\tmodal: false\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * PLUGINS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tplugins: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * OUTPUT\r\n\t * --------------------------------------------------\r\n\t */\r\n\toutput: {\r\n\t\tdir: 'dist',\r\n\t\tfile: 'ux4g.css',\r\n\t\tminify: true,\r\n\t\tsourceMap: false\r\n\t}\r\n};\r\n","export const registry = {\r\n\t// --- Spacing ---\r\n\t'p': { type: 'space', property: 'padding' },\r\n\t'pt': { type: 'space', property: 'padding-top' },\r\n\t'pr': { type: 'space', property: 'padding-right' },\r\n\t'pb': { type: 'space', property: 'padding-bottom' },\r\n\t'pl': { type: 'space', property: 'padding-left' },\r\n\t'px': { type: 'space', property: ['padding-left', 'padding-right'] },\r\n\t'py': { type: 'space', property: ['padding-top', 'padding-bottom'] },\r\n\r\n\t'm': { type: 'space', property: 'margin' },\r\n\t'mt': { type: 'space', property: 'margin-top' },\r\n\t'mr': { type: 'space', property: 'margin-right' },\r\n\t'mb': { type: 'space', property: 'margin-bottom' },\r\n\t'ml': { type: 'space', property: 'margin-left' },\r\n\t'mx': { type: 'space', property: ['margin-left', 'margin-right'] },\r\n\t'my': { type: 'space', property: ['margin-top', 'margin-bottom'] },\r\n\r\n\t// --- Colors ---\r\n\t'text': { type: 'color', property: 'color' },\r\n\t'bg': { type: 'color', property: 'background-color' },\r\n\t'border': { type: 'color', property: 'border-color' },\r\n\r\n\t// --- Typography ---\r\n\t'font': { type: 'fontDetail', property: 'font-weight' },\r\n\t'text-size': { type: 'text', property: 'font-size' },\r\n\t'leading': { type: 'value', property: 'line-height' },\r\n\t'tracking': { type: 'value', property: 'letter-spacing' },\r\n\t'align': { type: 'static', property: 'text-align' }, // text-center\r\n\r\n\t// --- Layout ---\r\n\t'flex': { type: 'static', property: 'display', value: 'flex' },\r\n\t'inline-flex': { type: 'static', property: 'display', value: 'inline-flex' },\r\n\t'grid': { type: 'static', property: 'display', value: 'grid' },\r\n\t'hidden': { type: 'static', property: 'display', value: 'none' },\r\n\t'block': { type: 'static', property: 'display', value: 'block' },\r\n\t'inline-block': { type: 'static', property: 'display', value: 'inline-block' },\r\n\r\n\t'items': { type: 'static', property: 'align-items' }, // start, end, center, baseline, stretch\r\n\t'justify': { type: 'static', property: 'justify-content' }, // start, end, center, between, around, evenly\r\n\t'self': { type: 'static', property: 'align-self' },\r\n\r\n\t'flex-col': { type: 'static', property: 'flex-direction', value: 'column' },\r\n\t'flex-row': { type: 'static', property: 'flex-direction', value: 'row' },\r\n\t'flex-wrap': { type: 'static', property: 'flex-wrap', value: 'wrap' },\r\n\t'flex-nowrap': { type: 'static', property: 'flex-wrap', value: 'nowrap' },\r\n\r\n\t'gap': { type: 'space', property: 'gap' },\r\n\t'gap-x': { type: 'space', property: 'column-gap' },\r\n\t'gap-y': { type: 'space', property: 'row-gap' },\r\n\r\n\t// --- Sizing ---\r\n\t'w': { type: 'size', property: 'width' },\r\n\t'h': { type: 'size', property: 'height' },\r\n\t'min-w': { type: 'size', property: 'min-width' },\r\n\t'min-h': { type: 'size', property: 'min-height' },\r\n\t'max-w': { type: 'size', property: 'max-width' },\r\n\t'max-h': { type: 'size', property: 'max-height' },\r\n\r\n\t// --- Borders & Effects ---\r\n\t'rounded': { type: 'radius', property: 'border-radius' },\r\n\t'shadow': { type: 'shadow', property: 'box-shadow' },\r\n\t'opacity': { type: 'value', property: 'opacity' },\r\n\t'z': { type: 'zIndex', property: 'z-index' },\r\n\r\n\t// --- Position ---\r\n\t'absolute': { type: 'static', property: 'position', value: 'absolute' },\r\n\t'relative': { type: 'static', property: 'position', value: 'relative' },\r\n\t'fixed': { type: 'static', property: 'position', value: 'fixed' },\r\n\t'top': { type: 'space', property: 'top' },\r\n\t'right': { type: 'space', property: 'right' },\r\n\t'bottom': { type: 'space', property: 'bottom' },\r\n\t'left': { type: 'space', property: 'left' },\r\n};\r\n","import { registry } from './registry.js';\r\nexport function generateUtility(className, config) {\r\n\tlet bp = null;\r\n\tlet util = className;\r\n\r\n\tif (className.includes(':')) {\r\n\t\t[bp, util] = className.split(':');\r\n\t}\r\n\r\n\tlet css = '';\r\n\r\n\tif (!util.startsWith(config.prefix)) return null;\r\n\tconst coreUtil = util.replace(config.prefix, '');\r\n\r\n\tfor (const [key, def] of Object.entries(registry)) {\r\n\t\tconst prefix = `${key}-`;\r\n\t\tif (coreUtil.startsWith(prefix)) {\r\n\t\t\tconst value = coreUtil.slice(prefix.length);\r\n\r\n\t\t\tlet varName = '';\r\n\r\n\t\t\tif (def.type === 'space') varName = `var(--${config.prefix}space-${value})`;\r\n\t\t\telse if (def.type === 'color') varName = `var(--${config.prefix}color-${value})`;\r\n\t\t\telse if (def.type === 'radius') varName = `var(--${config.prefix}radius-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'shadow') varName = `var(--${config.prefix}shadow-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'zIndex') varName = `var(--${config.prefix}zIndex-${value})`;\r\n\t\t\telse if (def.type === 'fontDetail') varName = `var(--${config.prefix}fontWeight-${value})`;\r\n\r\n\t\t\telse if (def.type === 'static') {\r\n\t\t\t\tif (def.value) {\r\n\t\t\t\t\tif (value !== '' && !def.allowValue) continue;\r\n\t\t\t\t\tvarName = def.value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvarName = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse if (def.type === 'size') {\r\n\t\t\t\tif (config.theme.spacing[value]) {\r\n\t\t\t\t\tvarName = `var(--${config.prefix}space-${value})`;\r\n\t\t\t\t} else if (value.includes('/')) {\r\n\t\t\t\t\tconst [num, den] = value.split('/');\r\n\t\t\t\t\tvarName = `${(parseInt(num) / parseInt(den)) * 100}%`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse continue;\r\n\r\n\t\t\t// Generate CSS properties\r\n\t\t\tconst props = Array.isArray(def.property) ? def.property : [def.property];\r\n\t\t\tconst decls = (def.type === 'static' && def.value) ? varName : props.map(p => `${p}:${varName}`).join(';');\r\n\r\n\t\t\tcss = `.${escape(className)}{${decls};}`;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!css) return null;\r\n\r\n\tif (bp) {\r\n\t\tconst size = config.breakpoints[bp];\r\n\t\treturn `@media (min-width:${size}){${css}}`;\r\n\t}\r\n\r\n\treturn css;\r\n}\r\n\r\nfunction escape(cls) {\r\n\treturn cls.replace(/:/g, '\\\\:');\r\n}\r\n","export function createJITState() {\r\n\treturn {\r\n\t\tusedClasses: new Set(),\r\n\t\tgeneratedCSS: new Map(), // class → css\r\n\t};\r\n}\r\n","import { defaultConfig } from '../core/config/defaultConfig.js';\r\nimport { generateUtility } from '../core/jit/generator.js';\r\nimport { createJITState } from '../core/jit/state.js';\r\n\r\nconst config = { ...defaultConfig };\r\nif (window.ux4gConfig) {\r\n\tObject.assign(config, window.ux4gConfig);\r\n}\r\n\r\nconfig.prefix = 'ux4g-';\r\n\r\nconst state = createJITState();\r\nconst styleTag = document.createElement('style');\r\nstyleTag.id = 'ux4g-cdn-styles';\r\ndocument.head.appendChild(styleTag);\r\n\r\nlet updateScheduled = false;\r\n\r\nfunction updateCSS() {\r\n\tlet css = '';\r\n\tfor (const rule of state.generatedCSS.values()) {\r\n\t\tcss += rule;\r\n\t}\r\n\tstyleTag.textContent = css;\r\n\tupdateScheduled = false;\r\n}\r\n\r\nfunction scheduleUpdate() {\r\n\tif (!updateScheduled) {\r\n\t\tupdateScheduled = true;\r\n\t\trequestAnimationFrame(updateCSS);\r\n\t}\r\n}\r\n\r\nfunction processNode(node) {\r\n\tif (node.nodeType !== 1) return;\r\n\r\n\tif (node.classList && node.classList.length > 0) {\r\n\t\tnode.classList.forEach(cls => {\r\n\t\t\tif (state.usedClasses.has(cls)) return;\r\n\r\n\t\t\tconst rule = generateUtility(cls, config);\r\n\t\t\tif (rule) {\r\n\t\t\t\tstate.usedClasses.add(cls);\r\n\t\t\t\tstate.generatedCSS.set(cls, rule);\r\n\t\t\t\tscheduleUpdate();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tif (node.children) {\r\n\t\tArray.from(node.children).forEach(processNode);\r\n\t}\r\n}\r\n\r\nif (document.readyState === 'loading') {\r\n\tdocument.addEventListener('DOMContentLoaded', () => processNode(document.body));\r\n} else {\r\n\tprocessNode(document.body);\r\n}\r\n\r\nconst observer = new MutationObserver(mutations => {\r\n\tmutations.forEach(mutation => {\r\n\t\tif (mutation.type === 'childList') {\r\n\t\t\tmutation.addedNodes.forEach(processNode);\r\n\t\t} else if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\r\n\t\t\tprocessNode(mutation.target);\r\n\t\t}\r\n\t});\r\n});\r\n\r\nif (document.body) {\r\n\tobserver.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\r\n}\r\nconsole.log('🌍 UX4G CDN Engine Active');\r\n"],"names":["defaultConfig","registry","generateUtility","className","config","bp","util","css","coreUtil","key","def","prefix","value","varName","num","den","props","decls","p","escape","cls","createJITState","state","styleTag","updateScheduled","updateCSS","rule","scheduleUpdate","processNode","node","observer","mutations","mutation"],"mappings":"AAKO,MAAMA,IAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM5B,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAON,SAAS;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOC,OAAO;AAAA,IACN,QAAQ;AAAA,MACP,SAAS;AAAA,QACR,IAAI;AAAA,QACJ,KAAK;AAAA,QACL,KAAK;AAAA,MACT;AAAA,MACG,WAAW;AAAA,QACV,KAAK;AAAA,MACT;AAAA,MACG,QAAQ;AAAA,QACP,KAAK;AAAA,MACT;AAAA,IACA;AAAA,IAEE,SAAS;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,IACN;AAAA,IAEE,UAAU;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACP;AAAA,IAEE,YAAY;AAAA,MACX,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,MAAM;AAAA,IACT;AAAA,IAEE,QAAQ;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACP;AAAA,IAEE,QAAQ;AAAA,MACP,IAAI;AAAA,MACJ,IAAI;AAAA,IACP;AAAA,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chB,GACvBiB,IAAkB;AACnB;AAEA,SAASG,IAAiB;AACzB,EAAKH,MACJA,IAAkB,IAClB,sBAAsBC,CAAS;AAEjC;AAEA,SAASG,EAAYC,GAAM;AAC1B,EAAIA,EAAK,aAAa,MAElBA,EAAK,aAAaA,EAAK,UAAU,SAAS,KAC7CA,EAAK,UAAU,QAAQ,CAAAT,MAAO;AAC7B,QAAIE,EAAM,YAAY,IAAIF,CAAG,EAAG;AAEhC,UAAMM,IAAOxB,EAAgBkB,GAAKhB,CAAM;AACxC,IAAIsB,MACHJ,EAAM,YAAY,IAAIF,CAAG,GACzBE,EAAM,aAAa,IAAIF,GAAKM,CAAI,GAChCC;EAEF,CAAC,GAGEE,EAAK,YACR,MAAM,KAAKA,EAAK,QAAQ,EAAE,QAAQD,CAAW;AAE/C;AAEI,SAAS,eAAe,YAC3B,SAAS,iBAAiB,oBAAoB,MAAMA,EAAY,SAAS,IAAI,CAAC,IAE9EA,EAAY,SAAS,IAAI;AAG1B,MAAME,IAAW,IAAI,iBAAiB,CAAAC,MAAa;AAClD,EAAAA,EAAU,QAAQ,CAAAC,MAAY;AAC7B,IAAIA,EAAS,SAAS,cACrBA,EAAS,WAAW,QAAQJ,CAAW,IAC7BI,EAAS,SAAS,gBAAgBA,EAAS,kBAAkB,WACvEJ,EAAYI,EAAS,MAAM;AAAA,EAE7B,CAAC;AACF,CAAC;AAEG,SAAS,QACZF,EAAS,QAAQ,SAAS,MAAM,EAAE,WAAW,IAAM,SAAS,IAAM,YAAY,IAAM,iBAAiB,CAAC,OAAO,EAAC,CAAE;AAEjH,QAAQ,IAAI,2BAA2B;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";const m={prefix:"ux4g-",mode:"build",content:["./index.html","./src/**/*.{js,ts,jsx,tsx,vue,html}","./pages/**/*.{js,ts,jsx,tsx}","./components/**/*.{js,ts,jsx,tsx}","./**/*.php"],theme:{colors:{primary:{50:"#EFF6FF",500:"#3B82F6",700:"#1D4ED8"},secondary:{500:"#9333EA"},danger:{500:"#EF4444"}},spacing:{0:"0px",1:"4px",2:"8px",4:"16px",6:"24px",8:"32px"},fontSize:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},fontWeight:{regular:400,medium:500,bold:700},radius:{sm:"4px",md:"8px",lg:"12px",xl:"16px"},shadow:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px rgba(0,0,0,0.1)"},zIndex:{dropdown:1e3,modal:1100,toast:1200}},breakpoints:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},darkMode:{enabled:!0,strategy:"data-attribute",attribute:"data-theme",themes:{light:"light",dark:"dark"}},safelist:[],components:{button:!0,card:!0,input:!0,modal:!1},plugins:[],output:{dir:"dist",file:"ux4g.css",minify:!0,sourceMap:!1}},h={p:{type:"space",property:"padding"},pt:{type:"space",property:"padding-top"},pr:{type:"space",property:"padding-right"},pb:{type:"space",property:"padding-bottom"},pl:{type:"space",property:"padding-left"},px:{type:"space",property:["padding-left","padding-right"]},py:{type:"space",property:["padding-top","padding-bottom"]},m:{type:"space",property:"margin"},mt:{type:"space",property:"margin-top"},mr:{type:"space",property:"margin-right"},mb:{type:"space",property:"margin-bottom"},ml:{type:"space",property:"margin-left"},mx:{type:"space",property:["margin-left","margin-right"]},my:{type:"space",property:["margin-top","margin-bottom"]},text:{type:"color",property:"color"},bg:{type:"color",property:"background-color"},border:{type:"color",property:"border-color"},font:{type:"fontDetail",property:"font-weight"},"text-size":{type:"text",property:"font-size"},leading:{type:"value",property:"line-height"},tracking:{type:"value",property:"letter-spacing"},align:{type:"static",property:"text-align"},flex:{type:"static",property:"display",value:"flex"},"inline-flex":{type:"static",property:"display",value:"inline-flex"},grid:{type:"static",property:"display",value:"grid"},hidden:{type:"static",property:"display",value:"none"},block:{type:"static",property:"display",value:"block"},"inline-block":{type:"static",property:"display",value:"inline-block"},items:{type:"static",property:"align-items"},justify:{type:"static",property:"justify-content"},self:{type:"static",property:"align-self"},"flex-col":{type:"static",property:"flex-direction",value:"column"},"flex-row":{type:"static",property:"flex-direction",value:"row"},"flex-wrap":{type:"static",property:"flex-wrap",value:"wrap"},"flex-nowrap":{type:"static",property:"flex-wrap",value:"nowrap"},gap:{type:"space",property:"gap"},"gap-x":{type:"space",property:"column-gap"},"gap-y":{type:"space",property:"row-gap"},w:{type:"size",property:"width"},h:{type:"size",property:"height"},"min-w":{type:"size",property:"min-width"},"min-h":{type:"size",property:"min-height"},"max-w":{type:"size",property:"max-width"},"max-h":{type:"size",property:"max-height"},rounded:{type:"radius",property:"border-radius"},shadow:{type:"shadow",property:"box-shadow"},opacity:{type:"value",property:"opacity"},z:{type:"zIndex",property:"z-index"},absolute:{type:"static",property:"position",value:"absolute"},relative:{type:"static",property:"position",value:"relative"},fixed:{type:"static",property:"position",value:"fixed"},top:{type:"space",property:"top"},right:{type:"space",property:"right"},bottom:{type:"space",property:"bottom"},left:{type:"space",property:"left"}};function b(t,e){let a=null,c=t;t.includes(":")&&([a,c]=t.split(":"));let l="";if(!c.startsWith(e.prefix))return null;const f=c.replace(e.prefix,"");for(const[x,p]of Object.entries(h)){const g=`${x}-`;if(f.startsWith(g)){const r=f.slice(g.length);let i="";if(p.type==="space")i=`var(--${e.prefix}space-${r})`;else if(p.type==="color")i=`var(--${e.prefix}color-${r})`;else if(p.type==="radius")i=`var(--${e.prefix}radius-${r||"DEFAULT"})`;else if(p.type==="shadow")i=`var(--${e.prefix}shadow-${r||"DEFAULT"})`;else if(p.type==="zIndex")i=`var(--${e.prefix}zIndex-${r})`;else if(p.type==="fontDetail")i=`var(--${e.prefix}fontWeight-${r})`;else if(p.type==="static")if(p.value){if(r!==""&&!p.allowValue)continue;i=p.value}else i=r;else if(p.type==="size")if(e.theme.spacing[r])i=`var(--${e.prefix}space-${r})`;else if(r.includes("/")){const[u,S]=r.split("/");i=`${parseInt(u)/parseInt(S)*100}%`}else continue;else continue;const k=Array.isArray(p.property)?p.property:[p.property],E=p.type==="static"&&p.value?i:k.map(u=>`${u}:${i}`).join(";");l=`.${v(t)}{${E};}`;break}}return l?a?`@media (min-width:${e.breakpoints[a]}){${l}}`:l:null}function v(t){return t.replace(/:/g,"\\:")}function w(){return{usedClasses:new Set,generatedCSS:new Map}}const n={...m};window.ux4gConfig&&Object.assign(n,window.ux4gConfig),n.prefix="ux4g-";const o=w(),y=document.createElement("style");y.id="ux4g-cdn-styles",document.head.appendChild(y);let d=!1;function $(){let t="";for(const e of o.generatedCSS.values())t+=e;y.textContent=t,d=!1}function z(){d||(d=!0,requestAnimationFrame($))}function s(t){t.nodeType===1&&(t.classList&&t.classList.length>0&&t.classList.forEach(e=>{if(o.usedClasses.has(e))return;const a=b(e,n);a&&(o.usedClasses.add(e),o.generatedCSS.set(e,a),z())}),t.children&&Array.from(t.children).forEach(s))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>s(document.body)):s(document.body);const C=new MutationObserver(t=>{t.forEach(e=>{e.type==="childList"?e.addedNodes.forEach(s):e.type==="attributes"&&e.attributeName==="class"&&s(e.target)})});document.body&&C.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),console.log("🌍 UX4G CDN Engine Active")})();
|
|
2
|
+
//# sourceMappingURL=ux4g.cdn.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ux4g.cdn.min.js","sources":["../../core/config/defaultConfig.js","../../core/jit/registry.js","../../core/jit/generator.js","../../core/jit/state.js","../index.js"],"sourcesContent":["/**\r\n * UX4G Design System – Default Config\r\n * DO NOT EDIT (user overrides via ux4g.config.js)\r\n */\r\n\r\nexport const defaultConfig = {\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CORE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tprefix: 'ux4g-',\r\n\r\n\t/**\r\n\t * dev | build | cdn\r\n\t * NOTE: CLI command will override this\r\n\t */\r\n\tmode: 'build',\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CONTENT (used for purge / JIT)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcontent: [\r\n\t\t'./index.html',\r\n\t\t'./src/**/*.{js,ts,jsx,tsx,vue,html}',\r\n\t\t'./pages/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./components/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./**/*.php'\r\n\t],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * THEME (tokens)\r\n\t * --------------------------------------------------\r\n\t */\r\n\ttheme: {\r\n\t\tcolors: {\r\n\t\t\tprimary: {\r\n\t\t\t\t50: '#EFF6FF',\r\n\t\t\t\t500: '#3B82F6',\r\n\t\t\t\t700: '#1D4ED8'\r\n\t\t\t},\r\n\t\t\tsecondary: {\r\n\t\t\t\t500: '#9333EA'\r\n\t\t\t},\r\n\t\t\tdanger: {\r\n\t\t\t\t500: '#EF4444'\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tspacing: {\r\n\t\t\t0: '0px',\r\n\t\t\t1: '4px',\r\n\t\t\t2: '8px',\r\n\t\t\t4: '16px',\r\n\t\t\t6: '24px',\r\n\t\t\t8: '32px'\r\n\t\t},\r\n\r\n\t\tfontSize: {\r\n\t\t\txs: '12px',\r\n\t\t\tsm: '14px',\r\n\t\t\tmd: '16px',\r\n\t\t\tlg: '18px',\r\n\t\t\txl: '20px'\r\n\t\t},\r\n\r\n\t\tfontWeight: {\r\n\t\t\tregular: 400,\r\n\t\t\tmedium: 500,\r\n\t\t\tbold: 700\r\n\t\t},\r\n\r\n\t\tradius: {\r\n\t\t\tsm: '4px',\r\n\t\t\tmd: '8px',\r\n\t\t\tlg: '12px',\r\n\t\t\txl: '16px'\r\n\t\t},\r\n\r\n\t\tshadow: {\r\n\t\t\tsm: '0 1px 2px rgba(0,0,0,0.05)',\r\n\t\t\tmd: '0 4px 6px rgba(0,0,0,0.1)'\r\n\t\t},\r\n\r\n\t\tzIndex: {\r\n\t\t\tdropdown: 1000,\r\n\t\t\tmodal: 1100,\r\n\t\t\ttoast: 1200\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * RESPONSIVE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tbreakpoints: {\r\n\t\tsm: '640px',\r\n\t\tmd: '768px',\r\n\t\tlg: '1024px',\r\n\t\txl: '1280px'\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * DARK MODE / THEMES\r\n\t * --------------------------------------------------\r\n\t */\r\n\tdarkMode: {\r\n\t\tenabled: true,\r\n\t\tstrategy: 'data-attribute', // class | data-attribute\r\n\t\tattribute: 'data-theme',\r\n\t\tthemes: {\r\n\t\t\tlight: 'light',\r\n\t\t\tdark: 'dark'\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * SAFELIST (dynamic classes)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tsafelist: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * COMPONENTS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcomponents: {\r\n\t\tbutton: true,\r\n\t\tcard: true,\r\n\t\tinput: true,\r\n\t\tmodal: false\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * PLUGINS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tplugins: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * OUTPUT\r\n\t * --------------------------------------------------\r\n\t */\r\n\toutput: {\r\n\t\tdir: 'dist',\r\n\t\tfile: 'ux4g.css',\r\n\t\tminify: true,\r\n\t\tsourceMap: false\r\n\t}\r\n};\r\n","export const registry = {\r\n\t// --- Spacing ---\r\n\t'p': { type: 'space', property: 'padding' },\r\n\t'pt': { type: 'space', property: 'padding-top' },\r\n\t'pr': { type: 'space', property: 'padding-right' },\r\n\t'pb': { type: 'space', property: 'padding-bottom' },\r\n\t'pl': { type: 'space', property: 'padding-left' },\r\n\t'px': { type: 'space', property: ['padding-left', 'padding-right'] },\r\n\t'py': { type: 'space', property: ['padding-top', 'padding-bottom'] },\r\n\r\n\t'm': { type: 'space', property: 'margin' },\r\n\t'mt': { type: 'space', property: 'margin-top' },\r\n\t'mr': { type: 'space', property: 'margin-right' },\r\n\t'mb': { type: 'space', property: 'margin-bottom' },\r\n\t'ml': { type: 'space', property: 'margin-left' },\r\n\t'mx': { type: 'space', property: ['margin-left', 'margin-right'] },\r\n\t'my': { type: 'space', property: ['margin-top', 'margin-bottom'] },\r\n\r\n\t// --- Colors ---\r\n\t'text': { type: 'color', property: 'color' },\r\n\t'bg': { type: 'color', property: 'background-color' },\r\n\t'border': { type: 'color', property: 'border-color' },\r\n\r\n\t// --- Typography ---\r\n\t'font': { type: 'fontDetail', property: 'font-weight' },\r\n\t'text-size': { type: 'text', property: 'font-size' },\r\n\t'leading': { type: 'value', property: 'line-height' },\r\n\t'tracking': { type: 'value', property: 'letter-spacing' },\r\n\t'align': { type: 'static', property: 'text-align' }, // text-center\r\n\r\n\t// --- Layout ---\r\n\t'flex': { type: 'static', property: 'display', value: 'flex' },\r\n\t'inline-flex': { type: 'static', property: 'display', value: 'inline-flex' },\r\n\t'grid': { type: 'static', property: 'display', value: 'grid' },\r\n\t'hidden': { type: 'static', property: 'display', value: 'none' },\r\n\t'block': { type: 'static', property: 'display', value: 'block' },\r\n\t'inline-block': { type: 'static', property: 'display', value: 'inline-block' },\r\n\r\n\t'items': { type: 'static', property: 'align-items' }, // start, end, center, baseline, stretch\r\n\t'justify': { type: 'static', property: 'justify-content' }, // start, end, center, between, around, evenly\r\n\t'self': { type: 'static', property: 'align-self' },\r\n\r\n\t'flex-col': { type: 'static', property: 'flex-direction', value: 'column' },\r\n\t'flex-row': { type: 'static', property: 'flex-direction', value: 'row' },\r\n\t'flex-wrap': { type: 'static', property: 'flex-wrap', value: 'wrap' },\r\n\t'flex-nowrap': { type: 'static', property: 'flex-wrap', value: 'nowrap' },\r\n\r\n\t'gap': { type: 'space', property: 'gap' },\r\n\t'gap-x': { type: 'space', property: 'column-gap' },\r\n\t'gap-y': { type: 'space', property: 'row-gap' },\r\n\r\n\t// --- Sizing ---\r\n\t'w': { type: 'size', property: 'width' },\r\n\t'h': { type: 'size', property: 'height' },\r\n\t'min-w': { type: 'size', property: 'min-width' },\r\n\t'min-h': { type: 'size', property: 'min-height' },\r\n\t'max-w': { type: 'size', property: 'max-width' },\r\n\t'max-h': { type: 'size', property: 'max-height' },\r\n\r\n\t// --- Borders & Effects ---\r\n\t'rounded': { type: 'radius', property: 'border-radius' },\r\n\t'shadow': { type: 'shadow', property: 'box-shadow' },\r\n\t'opacity': { type: 'value', property: 'opacity' },\r\n\t'z': { type: 'zIndex', property: 'z-index' },\r\n\r\n\t// --- Position ---\r\n\t'absolute': { type: 'static', property: 'position', value: 'absolute' },\r\n\t'relative': { type: 'static', property: 'position', value: 'relative' },\r\n\t'fixed': { type: 'static', property: 'position', value: 'fixed' },\r\n\t'top': { type: 'space', property: 'top' },\r\n\t'right': { type: 'space', property: 'right' },\r\n\t'bottom': { type: 'space', property: 'bottom' },\r\n\t'left': { type: 'space', property: 'left' },\r\n};\r\n","import { registry } from './registry.js';\r\nexport function generateUtility(className, config) {\r\n\tlet bp = null;\r\n\tlet util = className;\r\n\r\n\tif (className.includes(':')) {\r\n\t\t[bp, util] = className.split(':');\r\n\t}\r\n\r\n\tlet css = '';\r\n\r\n\tif (!util.startsWith(config.prefix)) return null;\r\n\tconst coreUtil = util.replace(config.prefix, '');\r\n\r\n\tfor (const [key, def] of Object.entries(registry)) {\r\n\t\tconst prefix = `${key}-`;\r\n\t\tif (coreUtil.startsWith(prefix)) {\r\n\t\t\tconst value = coreUtil.slice(prefix.length);\r\n\r\n\t\t\tlet varName = '';\r\n\r\n\t\t\tif (def.type === 'space') varName = `var(--${config.prefix}space-${value})`;\r\n\t\t\telse if (def.type === 'color') varName = `var(--${config.prefix}color-${value})`;\r\n\t\t\telse if (def.type === 'radius') varName = `var(--${config.prefix}radius-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'shadow') varName = `var(--${config.prefix}shadow-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'zIndex') varName = `var(--${config.prefix}zIndex-${value})`;\r\n\t\t\telse if (def.type === 'fontDetail') varName = `var(--${config.prefix}fontWeight-${value})`;\r\n\r\n\t\t\telse if (def.type === 'static') {\r\n\t\t\t\tif (def.value) {\r\n\t\t\t\t\tif (value !== '' && !def.allowValue) continue;\r\n\t\t\t\t\tvarName = def.value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvarName = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse if (def.type === 'size') {\r\n\t\t\t\tif (config.theme.spacing[value]) {\r\n\t\t\t\t\tvarName = `var(--${config.prefix}space-${value})`;\r\n\t\t\t\t} else if (value.includes('/')) {\r\n\t\t\t\t\tconst [num, den] = value.split('/');\r\n\t\t\t\t\tvarName = `${(parseInt(num) / parseInt(den)) * 100}%`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse continue;\r\n\r\n\t\t\t// Generate CSS properties\r\n\t\t\tconst props = Array.isArray(def.property) ? def.property : [def.property];\r\n\t\t\tconst decls = (def.type === 'static' && def.value) ? varName : props.map(p => `${p}:${varName}`).join(';');\r\n\r\n\t\t\tcss = `.${escape(className)}{${decls};}`;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!css) return null;\r\n\r\n\tif (bp) {\r\n\t\tconst size = config.breakpoints[bp];\r\n\t\treturn `@media (min-width:${size}){${css}}`;\r\n\t}\r\n\r\n\treturn css;\r\n}\r\n\r\nfunction escape(cls) {\r\n\treturn cls.replace(/:/g, '\\\\:');\r\n}\r\n","export function createJITState() {\r\n\treturn {\r\n\t\tusedClasses: new Set(),\r\n\t\tgeneratedCSS: new Map(), // class → css\r\n\t};\r\n}\r\n","import { defaultConfig } from '../core/config/defaultConfig.js';\r\nimport { generateUtility } from '../core/jit/generator.js';\r\nimport { createJITState } from '../core/jit/state.js';\r\n\r\nconst config = { ...defaultConfig };\r\nif (window.ux4gConfig) {\r\n\tObject.assign(config, window.ux4gConfig);\r\n}\r\n\r\nconfig.prefix = 'ux4g-';\r\n\r\nconst state = createJITState();\r\nconst styleTag = document.createElement('style');\r\nstyleTag.id = 'ux4g-cdn-styles';\r\ndocument.head.appendChild(styleTag);\r\n\r\nlet updateScheduled = false;\r\n\r\nfunction updateCSS() {\r\n\tlet css = '';\r\n\tfor (const rule of state.generatedCSS.values()) {\r\n\t\tcss += rule;\r\n\t}\r\n\tstyleTag.textContent = css;\r\n\tupdateScheduled = false;\r\n}\r\n\r\nfunction scheduleUpdate() {\r\n\tif (!updateScheduled) {\r\n\t\tupdateScheduled = true;\r\n\t\trequestAnimationFrame(updateCSS);\r\n\t}\r\n}\r\n\r\nfunction processNode(node) {\r\n\tif (node.nodeType !== 1) return;\r\n\r\n\tif (node.classList && node.classList.length > 0) {\r\n\t\tnode.classList.forEach(cls => {\r\n\t\t\tif (state.usedClasses.has(cls)) return;\r\n\r\n\t\t\tconst rule = generateUtility(cls, config);\r\n\t\t\tif (rule) {\r\n\t\t\t\tstate.usedClasses.add(cls);\r\n\t\t\t\tstate.generatedCSS.set(cls, rule);\r\n\t\t\t\tscheduleUpdate();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tif (node.children) {\r\n\t\tArray.from(node.children).forEach(processNode);\r\n\t}\r\n}\r\n\r\nif (document.readyState === 'loading') {\r\n\tdocument.addEventListener('DOMContentLoaded', () => processNode(document.body));\r\n} else {\r\n\tprocessNode(document.body);\r\n}\r\n\r\nconst observer = new MutationObserver(mutations => {\r\n\tmutations.forEach(mutation => {\r\n\t\tif (mutation.type === 'childList') {\r\n\t\t\tmutation.addedNodes.forEach(processNode);\r\n\t\t} else if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\r\n\t\t\tprocessNode(mutation.target);\r\n\t\t}\r\n\t});\r\n});\r\n\r\nif (document.body) {\r\n\tobserver.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\r\n}\r\nconsole.log('🌍 UX4G CDN Engine Active');\r\n"],"names":["defaultConfig","registry","generateUtility","className","config","bp","util","css","coreUtil","key","def","prefix","value","varName","num","den","props","decls","p","escape","cls","createJITState","state","styleTag","updateScheduled","updateCSS","rule","scheduleUpdate","processNode","node","observer","mutations","mutation"],"mappings":"yBAKO,MAAMA,EAAgB,CAM5B,OAAQ,QAMR,KAAM,QAON,QAAS,CACR,eACA,sCACA,+BACA,oCACA,YACF,EAOC,MAAO,CACN,OAAQ,CACP,QAAS,CACR,GAAI,UACJ,IAAK,UACL,IAAK,SACT,EACG,UAAW,CACV,IAAK,SACT,EACG,OAAQ,CACP,IAAK,SACT,CACA,EAEE,QAAS,CACR,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,OACH,EAAG,OACH,EAAG,MACN,EAEE,SAAU,CACT,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,MACP,EAEE,WAAY,CACX,QAAS,IACT,OAAQ,IACR,KAAM,GACT,EAEE,OAAQ,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,OACJ,GAAI,MACP,EAEE,OAAQ,CACP,GAAI,6BACJ,GAAI,2BACP,EAEE,OAAQ,CACP,SAAU,IACV,MAAO,KACP,MAAO,IACV,CACA,EAOC,YAAa,CACZ,GAAI,QACJ,GAAI,QACJ,GAAI,SACJ,GAAI,QACN,EAOC,SAAU,CACT,QAAS,GACT,SAAU,iBACV,UAAW,aACX,OAAQ,CACP,MAAO,QACP,KAAM,MACT,CACA,EAOC,SAAU,CAAA,EAOV,WAAY,CACX,OAAQ,GACR,KAAM,GACN,MAAO,GACP,MAAO,EACT,EAOC,QAAS,CAAA,EAOT,OAAQ,CACP,IAAK,OACL,KAAM,WACN,OAAQ,GACR,UAAW,EACb,CACA,EC9JaC,EAAW,CAEvB,EAAK,CAA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,OAAS,GAC7CA,EAAK,UAAU,QAAQT,GAAO,CAC7B,GAAIE,EAAM,YAAY,IAAIF,CAAG,EAAG,OAEhC,MAAMM,EAAOxB,EAAgBkB,EAAKhB,CAAM,EACpCsB,IACHJ,EAAM,YAAY,IAAIF,CAAG,EACzBE,EAAM,aAAa,IAAIF,EAAKM,CAAI,EAChCC,IAEF,CAAC,EAGEE,EAAK,UACR,MAAM,KAAKA,EAAK,QAAQ,EAAE,QAAQD,CAAW,EAE/C,CAEI,SAAS,aAAe,UAC3B,SAAS,iBAAiB,mBAAoB,IAAMA,EAAY,SAAS,IAAI,CAAC,EAE9EA,EAAY,SAAS,IAAI,EAG1B,MAAME,EAAW,IAAI,iBAAiBC,GAAa,CAClDA,EAAU,QAAQC,GAAY,CACzBA,EAAS,OAAS,YACrBA,EAAS,WAAW,QAAQJ,CAAW,EAC7BI,EAAS,OAAS,cAAgBA,EAAS,gBAAkB,SACvEJ,EAAYI,EAAS,MAAM,CAE7B,CAAC,CACF,CAAC,EAEG,SAAS,MACZF,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,GAAM,WAAY,GAAM,gBAAiB,CAAC,OAAO,CAAC,CAAE,EAEjH,QAAQ,IAAI,2BAA2B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(o){typeof define=="function"&&define.amd?define(o):o()})(function(){"use strict";const o={prefix:"ux4g-",mode:"build",content:["./index.html","./src/**/*.{js,ts,jsx,tsx,vue,html}","./pages/**/*.{js,ts,jsx,tsx}","./components/**/*.{js,ts,jsx,tsx}","./**/*.php"],theme:{colors:{primary:{50:"#EFF6FF",500:"#3B82F6",700:"#1D4ED8"},secondary:{500:"#9333EA"},danger:{500:"#EF4444"}},spacing:{0:"0px",1:"4px",2:"8px",4:"16px",6:"24px",8:"32px"},fontSize:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px"},fontWeight:{regular:400,medium:500,bold:700},radius:{sm:"4px",md:"8px",lg:"12px",xl:"16px"},shadow:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px rgba(0,0,0,0.1)"},zIndex:{dropdown:1e3,modal:1100,toast:1200}},breakpoints:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},darkMode:{enabled:!0,strategy:"data-attribute",attribute:"data-theme",themes:{light:"light",dark:"dark"}},safelist:[],components:{button:!0,card:!0,input:!0,modal:!1},plugins:[],output:{dir:"dist",file:"ux4g.css",minify:!0,sourceMap:!1}},h={p:{type:"space",property:"padding"},pt:{type:"space",property:"padding-top"},pr:{type:"space",property:"padding-right"},pb:{type:"space",property:"padding-bottom"},pl:{type:"space",property:"padding-left"},px:{type:"space",property:["padding-left","padding-right"]},py:{type:"space",property:["padding-top","padding-bottom"]},m:{type:"space",property:"margin"},mt:{type:"space",property:"margin-top"},mr:{type:"space",property:"margin-right"},mb:{type:"space",property:"margin-bottom"},ml:{type:"space",property:"margin-left"},mx:{type:"space",property:["margin-left","margin-right"]},my:{type:"space",property:["margin-top","margin-bottom"]},text:{type:"color",property:"color"},bg:{type:"color",property:"background-color"},border:{type:"color",property:"border-color"},font:{type:"fontDetail",property:"font-weight"},"text-size":{type:"text",property:"font-size"},leading:{type:"value",property:"line-height"},tracking:{type:"value",property:"letter-spacing"},align:{type:"static",property:"text-align"},flex:{type:"static",property:"display",value:"flex"},"inline-flex":{type:"static",property:"display",value:"inline-flex"},grid:{type:"static",property:"display",value:"grid"},hidden:{type:"static",property:"display",value:"none"},block:{type:"static",property:"display",value:"block"},"inline-block":{type:"static",property:"display",value:"inline-block"},items:{type:"static",property:"align-items"},justify:{type:"static",property:"justify-content"},self:{type:"static",property:"align-self"},"flex-col":{type:"static",property:"flex-direction",value:"column"},"flex-row":{type:"static",property:"flex-direction",value:"row"},"flex-wrap":{type:"static",property:"flex-wrap",value:"wrap"},"flex-nowrap":{type:"static",property:"flex-wrap",value:"nowrap"},gap:{type:"space",property:"gap"},"gap-x":{type:"space",property:"column-gap"},"gap-y":{type:"space",property:"row-gap"},w:{type:"size",property:"width"},h:{type:"size",property:"height"},"min-w":{type:"size",property:"min-width"},"min-h":{type:"size",property:"min-height"},"max-w":{type:"size",property:"max-width"},"max-h":{type:"size",property:"max-height"},rounded:{type:"radius",property:"border-radius"},shadow:{type:"shadow",property:"box-shadow"},opacity:{type:"value",property:"opacity"},z:{type:"zIndex",property:"z-index"},absolute:{type:"static",property:"position",value:"absolute"},relative:{type:"static",property:"position",value:"relative"},fixed:{type:"static",property:"position",value:"fixed"},top:{type:"space",property:"top"},right:{type:"space",property:"right"},bottom:{type:"space",property:"bottom"},left:{type:"space",property:"left"}};function b(t,e){let a=null,u=t;t.includes(":")&&([a,u]=t.split(":"));let l="";if(!u.startsWith(e.prefix))return null;const x=u.replace(e.prefix,"");for(const[g,p]of Object.entries(h)){const m=`${g}-`;if(x.startsWith(m)){const r=x.slice(m.length);let i="";if(p.type==="space")i=`var(--${e.prefix}space-${r})`;else if(p.type==="color")i=`var(--${e.prefix}color-${r})`;else if(p.type==="radius")i=`var(--${e.prefix}radius-${r||"DEFAULT"})`;else if(p.type==="shadow")i=`var(--${e.prefix}shadow-${r||"DEFAULT"})`;else if(p.type==="zIndex")i=`var(--${e.prefix}zIndex-${r})`;else if(p.type==="fontDetail")i=`var(--${e.prefix}fontWeight-${r})`;else if(p.type==="static")if(p.value){if(r!==""&&!p.allowValue)continue;i=p.value}else i=r;else if(p.type==="size")if(e.theme.spacing[r])i=`var(--${e.prefix}space-${r})`;else if(r.includes("/")){const[f,S]=r.split("/");i=`${parseInt(f)/parseInt(S)*100}%`}else continue;else continue;const k=Array.isArray(p.property)?p.property:[p.property],E=p.type==="static"&&p.value?i:k.map(f=>`${f}:${i}`).join(";");l=`.${v(t)}{${E};}`;break}}return l?a?`@media (min-width:${e.breakpoints[a]}){${l}}`:l:null}function v(t){return t.replace(/:/g,"\\:")}function w(){return{usedClasses:new Set,generatedCSS:new Map}}const y={...o};window.ux4gConfig&&Object.assign(y,window.ux4gConfig),y.prefix="ux4g-";const n=w(),d=document.createElement("style");d.id="ux4g-cdn-styles",document.head.appendChild(d);let c=!1;function $(){let t="";for(const e of n.generatedCSS.values())t+=e;d.textContent=t,c=!1}function z(){c||(c=!0,requestAnimationFrame($))}function s(t){t.nodeType===1&&(t.classList&&t.classList.length>0&&t.classList.forEach(e=>{if(n.usedClasses.has(e))return;const a=b(e,y);a&&(n.usedClasses.add(e),n.generatedCSS.set(e,a),z())}),t.children&&Array.from(t.children).forEach(s))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>s(document.body)):s(document.body);const C=new MutationObserver(t=>{t.forEach(e=>{e.type==="childList"?e.addedNodes.forEach(s):e.type==="attributes"&&e.attributeName==="class"&&s(e.target)})});document.body&&C.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),console.log("🌍 UX4G CDN Engine Active")});
|
|
2
|
+
//# sourceMappingURL=ux4g.cdn.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ux4g.cdn.umd.js","sources":["../../core/config/defaultConfig.js","../../core/jit/registry.js","../../core/jit/generator.js","../../core/jit/state.js","../index.js"],"sourcesContent":["/**\r\n * UX4G Design System – Default Config\r\n * DO NOT EDIT (user overrides via ux4g.config.js)\r\n */\r\n\r\nexport const defaultConfig = {\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CORE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tprefix: 'ux4g-',\r\n\r\n\t/**\r\n\t * dev | build | cdn\r\n\t * NOTE: CLI command will override this\r\n\t */\r\n\tmode: 'build',\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * CONTENT (used for purge / JIT)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcontent: [\r\n\t\t'./index.html',\r\n\t\t'./src/**/*.{js,ts,jsx,tsx,vue,html}',\r\n\t\t'./pages/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./components/**/*.{js,ts,jsx,tsx}',\r\n\t\t'./**/*.php'\r\n\t],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * THEME (tokens)\r\n\t * --------------------------------------------------\r\n\t */\r\n\ttheme: {\r\n\t\tcolors: {\r\n\t\t\tprimary: {\r\n\t\t\t\t50: '#EFF6FF',\r\n\t\t\t\t500: '#3B82F6',\r\n\t\t\t\t700: '#1D4ED8'\r\n\t\t\t},\r\n\t\t\tsecondary: {\r\n\t\t\t\t500: '#9333EA'\r\n\t\t\t},\r\n\t\t\tdanger: {\r\n\t\t\t\t500: '#EF4444'\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tspacing: {\r\n\t\t\t0: '0px',\r\n\t\t\t1: '4px',\r\n\t\t\t2: '8px',\r\n\t\t\t4: '16px',\r\n\t\t\t6: '24px',\r\n\t\t\t8: '32px'\r\n\t\t},\r\n\r\n\t\tfontSize: {\r\n\t\t\txs: '12px',\r\n\t\t\tsm: '14px',\r\n\t\t\tmd: '16px',\r\n\t\t\tlg: '18px',\r\n\t\t\txl: '20px'\r\n\t\t},\r\n\r\n\t\tfontWeight: {\r\n\t\t\tregular: 400,\r\n\t\t\tmedium: 500,\r\n\t\t\tbold: 700\r\n\t\t},\r\n\r\n\t\tradius: {\r\n\t\t\tsm: '4px',\r\n\t\t\tmd: '8px',\r\n\t\t\tlg: '12px',\r\n\t\t\txl: '16px'\r\n\t\t},\r\n\r\n\t\tshadow: {\r\n\t\t\tsm: '0 1px 2px rgba(0,0,0,0.05)',\r\n\t\t\tmd: '0 4px 6px rgba(0,0,0,0.1)'\r\n\t\t},\r\n\r\n\t\tzIndex: {\r\n\t\t\tdropdown: 1000,\r\n\t\t\tmodal: 1100,\r\n\t\t\ttoast: 1200\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * RESPONSIVE\r\n\t * --------------------------------------------------\r\n\t */\r\n\tbreakpoints: {\r\n\t\tsm: '640px',\r\n\t\tmd: '768px',\r\n\t\tlg: '1024px',\r\n\t\txl: '1280px'\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * DARK MODE / THEMES\r\n\t * --------------------------------------------------\r\n\t */\r\n\tdarkMode: {\r\n\t\tenabled: true,\r\n\t\tstrategy: 'data-attribute', // class | data-attribute\r\n\t\tattribute: 'data-theme',\r\n\t\tthemes: {\r\n\t\t\tlight: 'light',\r\n\t\t\tdark: 'dark'\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * SAFELIST (dynamic classes)\r\n\t * --------------------------------------------------\r\n\t */\r\n\tsafelist: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * COMPONENTS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tcomponents: {\r\n\t\tbutton: true,\r\n\t\tcard: true,\r\n\t\tinput: true,\r\n\t\tmodal: false\r\n\t},\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * PLUGINS\r\n\t * --------------------------------------------------\r\n\t */\r\n\tplugins: [],\r\n\r\n\t/**\r\n\t * --------------------------------------------------\r\n\t * OUTPUT\r\n\t * --------------------------------------------------\r\n\t */\r\n\toutput: {\r\n\t\tdir: 'dist',\r\n\t\tfile: 'ux4g.css',\r\n\t\tminify: true,\r\n\t\tsourceMap: false\r\n\t}\r\n};\r\n","export const registry = {\r\n\t// --- Spacing ---\r\n\t'p': { type: 'space', property: 'padding' },\r\n\t'pt': { type: 'space', property: 'padding-top' },\r\n\t'pr': { type: 'space', property: 'padding-right' },\r\n\t'pb': { type: 'space', property: 'padding-bottom' },\r\n\t'pl': { type: 'space', property: 'padding-left' },\r\n\t'px': { type: 'space', property: ['padding-left', 'padding-right'] },\r\n\t'py': { type: 'space', property: ['padding-top', 'padding-bottom'] },\r\n\r\n\t'm': { type: 'space', property: 'margin' },\r\n\t'mt': { type: 'space', property: 'margin-top' },\r\n\t'mr': { type: 'space', property: 'margin-right' },\r\n\t'mb': { type: 'space', property: 'margin-bottom' },\r\n\t'ml': { type: 'space', property: 'margin-left' },\r\n\t'mx': { type: 'space', property: ['margin-left', 'margin-right'] },\r\n\t'my': { type: 'space', property: ['margin-top', 'margin-bottom'] },\r\n\r\n\t// --- Colors ---\r\n\t'text': { type: 'color', property: 'color' },\r\n\t'bg': { type: 'color', property: 'background-color' },\r\n\t'border': { type: 'color', property: 'border-color' },\r\n\r\n\t// --- Typography ---\r\n\t'font': { type: 'fontDetail', property: 'font-weight' },\r\n\t'text-size': { type: 'text', property: 'font-size' },\r\n\t'leading': { type: 'value', property: 'line-height' },\r\n\t'tracking': { type: 'value', property: 'letter-spacing' },\r\n\t'align': { type: 'static', property: 'text-align' }, // text-center\r\n\r\n\t// --- Layout ---\r\n\t'flex': { type: 'static', property: 'display', value: 'flex' },\r\n\t'inline-flex': { type: 'static', property: 'display', value: 'inline-flex' },\r\n\t'grid': { type: 'static', property: 'display', value: 'grid' },\r\n\t'hidden': { type: 'static', property: 'display', value: 'none' },\r\n\t'block': { type: 'static', property: 'display', value: 'block' },\r\n\t'inline-block': { type: 'static', property: 'display', value: 'inline-block' },\r\n\r\n\t'items': { type: 'static', property: 'align-items' }, // start, end, center, baseline, stretch\r\n\t'justify': { type: 'static', property: 'justify-content' }, // start, end, center, between, around, evenly\r\n\t'self': { type: 'static', property: 'align-self' },\r\n\r\n\t'flex-col': { type: 'static', property: 'flex-direction', value: 'column' },\r\n\t'flex-row': { type: 'static', property: 'flex-direction', value: 'row' },\r\n\t'flex-wrap': { type: 'static', property: 'flex-wrap', value: 'wrap' },\r\n\t'flex-nowrap': { type: 'static', property: 'flex-wrap', value: 'nowrap' },\r\n\r\n\t'gap': { type: 'space', property: 'gap' },\r\n\t'gap-x': { type: 'space', property: 'column-gap' },\r\n\t'gap-y': { type: 'space', property: 'row-gap' },\r\n\r\n\t// --- Sizing ---\r\n\t'w': { type: 'size', property: 'width' },\r\n\t'h': { type: 'size', property: 'height' },\r\n\t'min-w': { type: 'size', property: 'min-width' },\r\n\t'min-h': { type: 'size', property: 'min-height' },\r\n\t'max-w': { type: 'size', property: 'max-width' },\r\n\t'max-h': { type: 'size', property: 'max-height' },\r\n\r\n\t// --- Borders & Effects ---\r\n\t'rounded': { type: 'radius', property: 'border-radius' },\r\n\t'shadow': { type: 'shadow', property: 'box-shadow' },\r\n\t'opacity': { type: 'value', property: 'opacity' },\r\n\t'z': { type: 'zIndex', property: 'z-index' },\r\n\r\n\t// --- Position ---\r\n\t'absolute': { type: 'static', property: 'position', value: 'absolute' },\r\n\t'relative': { type: 'static', property: 'position', value: 'relative' },\r\n\t'fixed': { type: 'static', property: 'position', value: 'fixed' },\r\n\t'top': { type: 'space', property: 'top' },\r\n\t'right': { type: 'space', property: 'right' },\r\n\t'bottom': { type: 'space', property: 'bottom' },\r\n\t'left': { type: 'space', property: 'left' },\r\n};\r\n","import { registry } from './registry.js';\r\nexport function generateUtility(className, config) {\r\n\tlet bp = null;\r\n\tlet util = className;\r\n\r\n\tif (className.includes(':')) {\r\n\t\t[bp, util] = className.split(':');\r\n\t}\r\n\r\n\tlet css = '';\r\n\r\n\tif (!util.startsWith(config.prefix)) return null;\r\n\tconst coreUtil = util.replace(config.prefix, '');\r\n\r\n\tfor (const [key, def] of Object.entries(registry)) {\r\n\t\tconst prefix = `${key}-`;\r\n\t\tif (coreUtil.startsWith(prefix)) {\r\n\t\t\tconst value = coreUtil.slice(prefix.length);\r\n\r\n\t\t\tlet varName = '';\r\n\r\n\t\t\tif (def.type === 'space') varName = `var(--${config.prefix}space-${value})`;\r\n\t\t\telse if (def.type === 'color') varName = `var(--${config.prefix}color-${value})`;\r\n\t\t\telse if (def.type === 'radius') varName = `var(--${config.prefix}radius-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'shadow') varName = `var(--${config.prefix}shadow-${value || 'DEFAULT'})`;\r\n\t\t\telse if (def.type === 'zIndex') varName = `var(--${config.prefix}zIndex-${value})`;\r\n\t\t\telse if (def.type === 'fontDetail') varName = `var(--${config.prefix}fontWeight-${value})`;\r\n\r\n\t\t\telse if (def.type === 'static') {\r\n\t\t\t\tif (def.value) {\r\n\t\t\t\t\tif (value !== '' && !def.allowValue) continue;\r\n\t\t\t\t\tvarName = def.value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvarName = value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse if (def.type === 'size') {\r\n\t\t\t\tif (config.theme.spacing[value]) {\r\n\t\t\t\t\tvarName = `var(--${config.prefix}space-${value})`;\r\n\t\t\t\t} else if (value.includes('/')) {\r\n\t\t\t\t\tconst [num, den] = value.split('/');\r\n\t\t\t\t\tvarName = `${(parseInt(num) / parseInt(den)) * 100}%`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse continue;\r\n\r\n\t\t\t// Generate CSS properties\r\n\t\t\tconst props = Array.isArray(def.property) ? def.property : [def.property];\r\n\t\t\tconst decls = (def.type === 'static' && def.value) ? varName : props.map(p => `${p}:${varName}`).join(';');\r\n\r\n\t\t\tcss = `.${escape(className)}{${decls};}`;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!css) return null;\r\n\r\n\tif (bp) {\r\n\t\tconst size = config.breakpoints[bp];\r\n\t\treturn `@media (min-width:${size}){${css}}`;\r\n\t}\r\n\r\n\treturn css;\r\n}\r\n\r\nfunction escape(cls) {\r\n\treturn cls.replace(/:/g, '\\\\:');\r\n}\r\n","export function createJITState() {\r\n\treturn {\r\n\t\tusedClasses: new Set(),\r\n\t\tgeneratedCSS: new Map(), // class → css\r\n\t};\r\n}\r\n","import { defaultConfig } from '../core/config/defaultConfig.js';\r\nimport { generateUtility } from '../core/jit/generator.js';\r\nimport { createJITState } from '../core/jit/state.js';\r\n\r\nconst config = { ...defaultConfig };\r\nif (window.ux4gConfig) {\r\n\tObject.assign(config, window.ux4gConfig);\r\n}\r\n\r\nconfig.prefix = 'ux4g-';\r\n\r\nconst state = createJITState();\r\nconst styleTag = document.createElement('style');\r\nstyleTag.id = 'ux4g-cdn-styles';\r\ndocument.head.appendChild(styleTag);\r\n\r\nlet updateScheduled = false;\r\n\r\nfunction updateCSS() {\r\n\tlet css = '';\r\n\tfor (const rule of state.generatedCSS.values()) {\r\n\t\tcss += rule;\r\n\t}\r\n\tstyleTag.textContent = css;\r\n\tupdateScheduled = false;\r\n}\r\n\r\nfunction scheduleUpdate() {\r\n\tif (!updateScheduled) {\r\n\t\tupdateScheduled = true;\r\n\t\trequestAnimationFrame(updateCSS);\r\n\t}\r\n}\r\n\r\nfunction processNode(node) {\r\n\tif (node.nodeType !== 1) return;\r\n\r\n\tif (node.classList && node.classList.length > 0) {\r\n\t\tnode.classList.forEach(cls => {\r\n\t\t\tif (state.usedClasses.has(cls)) return;\r\n\r\n\t\t\tconst rule = generateUtility(cls, config);\r\n\t\t\tif (rule) {\r\n\t\t\t\tstate.usedClasses.add(cls);\r\n\t\t\t\tstate.generatedCSS.set(cls, rule);\r\n\t\t\t\tscheduleUpdate();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tif (node.children) {\r\n\t\tArray.from(node.children).forEach(processNode);\r\n\t}\r\n}\r\n\r\nif (document.readyState === 'loading') {\r\n\tdocument.addEventListener('DOMContentLoaded', () => processNode(document.body));\r\n} else {\r\n\tprocessNode(document.body);\r\n}\r\n\r\nconst observer = new MutationObserver(mutations => {\r\n\tmutations.forEach(mutation => {\r\n\t\tif (mutation.type === 'childList') {\r\n\t\t\tmutation.addedNodes.forEach(processNode);\r\n\t\t} else if (mutation.type === 'attributes' && mutation.attributeName === 'class') {\r\n\t\t\tprocessNode(mutation.target);\r\n\t\t}\r\n\t});\r\n});\r\n\r\nif (document.body) {\r\n\tobserver.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\r\n}\r\nconsole.log('🌍 UX4G CDN Engine Active');\r\n"],"names":["defaultConfig","registry","generateUtility","className","config","bp","util","css","coreUtil","key","def","prefix","value","varName","num","den","props","decls","p","escape","cls","createJITState","state","styleTag","updateScheduled","updateCSS","rule","scheduleUpdate","processNode","node","observer","mutations","mutation"],"mappings":"2FAKO,MAAMA,EAAgB,CAM5B,OAAQ,QAMR,KAAM,QAON,QAAS,CACR,eACA,sCACA,+BACA,oCACA,YACF,EAOC,MAAO,CACN,OAAQ,CACP,QAAS,CACR,GAAI,UACJ,IAAK,UACL,IAAK,SACT,EACG,UAAW,CACV,IAAK,SACT,EACG,OAAQ,CACP,IAAK,SACT,CACA,EAEE,QAAS,CACR,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,OACH,EAAG,OACH,EAAG,MACN,EAEE,SAAU,CACT,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,MACP,EAEE,WAAY,CACX,QAAS,IACT,OAAQ,IACR,KAAM,GACT,EAEE,OAAQ,CACP,GAAI,MACJ,GAAI,MACJ,GAAI,OACJ,GAAI,MACP,EAEE,OAAQ,CACP,GAAI,6BACJ,GAAI,2BACP,EAEE,OAAQ,CACP,SAAU,IACV,MAAO,KACP,MAAO,IACV,CACA,EAOC,YAAa,CACZ,GAAI,QACJ,GAAI,QACJ,GAAI,SACJ,GAAI,QACN,EAOC,SAAU,CACT,QAAS,GACT,SAAU,iBACV,UAAW,aACX,OAAQ,CACP,MAAO,QACP,KAAM,MACT,CACA,EAOC,SAAU,CAAA,EAOV,WAAY,CACX,OAAQ,GACR,KAAM,GACN,MAAO,GACP,MAAO,EACT,EAOC,QAAS,CAAA,EAOT,OAAQ,CACP,IAAK,OACL,KAAM,WACN,OAAQ,GACR,UAAW,EACb,CACA,EC9JaC,EAAW,CAEvB,EAAK,CAAE,KAAM,QAAS,SAAU,SAAS,EACzC,GAAM,CAAE,KAAM,QAAS,SAAU,aAAa,EAC9C,GAAM,CAAE,KAAM,QAAS,SAAU,eAAe,EAChD,GAAM,CAAE,KAAM,QAAS,SAAU,gBAAgB,EACjD,GAAM,CAAE,KAAM,QAAS,SAAU,cAAc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IF,EAAKM,CAAI,EAChCC,IAEF,CAAC,EAGEE,EAAK,UACR,MAAM,KAAKA,EAAK,QAAQ,EAAE,QAAQD,CAAW,EAE/C,CAEI,SAAS,aAAe,UAC3B,SAAS,iBAAiB,mBAAoB,IAAMA,EAAY,SAAS,IAAI,CAAC,EAE9EA,EAAY,SAAS,IAAI,EAG1B,MAAME,EAAW,IAAI,iBAAiBC,GAAa,CAClDA,EAAU,QAAQC,GAAY,CACzBA,EAAS,OAAS,YACrBA,EAAS,WAAW,QAAQJ,CAAW,EAC7BI,EAAS,OAAS,cAAgBA,EAAS,gBAAkB,SACvEJ,EAAYI,EAAS,MAAM,CAE7B,CAAC,CACF,CAAC,EAEG,SAAS,MACZF,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,GAAM,WAAY,GAAM,gBAAiB,CAAC,OAAO,CAAC,CAAE,EAEjH,QAAQ,IAAI,2BAA2B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@netoyed/ux4g-design-system-v3-cdn",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CDN runtime for UX4G Design System",
|
|
5
|
+
"main": "dist/ux4g.cdn.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "vite build"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"vite": "^5.0.0"
|
|
15
|
+
}
|
|
16
|
+
}
|