@tachui/responsive 0.8.1-alpha → 0.8.5-alpha
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -2469
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2876 -0
- package/dist/modifiers/responsive/advanced-utilities.d.ts +1 -1
- package/dist/modifiers/responsive/advanced-utilities.d.ts.map +1 -1
- package/dist/modifiers/responsive/breakpoints.d.ts +1 -1
- package/dist/modifiers/responsive/breakpoints.d.ts.map +1 -1
- package/dist/modifiers/responsive/dev-tools.d.ts +1 -1
- package/dist/modifiers/responsive/dev-tools.d.ts.map +1 -1
- package/dist/modifiers/responsive/index.d.ts +7 -0
- package/dist/modifiers/responsive/index.d.ts.map +1 -1
- package/dist/modifiers/responsive/responsive-builder.d.ts +29 -29
- package/dist/modifiers/responsive/responsive-builder.d.ts.map +1 -1
- package/dist/modifiers/responsive/utilities.d.ts +1 -1
- package/dist/modifiers/responsive/utilities.d.ts.map +1 -1
- package/dist/version.d.ts +8 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +13 -9
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2876 @@
|
|
|
1
|
+
import { globalModifierRegistry as W } from "@tachui/registry";
|
|
2
|
+
import { BaseModifier as se } from "@tachui/modifiers";
|
|
3
|
+
import { createSignal as E, createEffect as V, isSignal as T, isComputed as j, getThemeSignal as me, createComputed as m, createMemo as ge } from "@tachui/core";
|
|
4
|
+
const b = {
|
|
5
|
+
Clean: 0,
|
|
6
|
+
Check: 1,
|
|
7
|
+
Dirty: 2,
|
|
8
|
+
Disposed: 3
|
|
9
|
+
};
|
|
10
|
+
let be = 0;
|
|
11
|
+
const ve = Math.random().toString(36).substr(2, 6);
|
|
12
|
+
let K = null, Z = null;
|
|
13
|
+
const ye = /* @__PURE__ */ new Set();
|
|
14
|
+
ye.add(ve);
|
|
15
|
+
const D = {
|
|
16
|
+
get currentComputation() {
|
|
17
|
+
return K;
|
|
18
|
+
},
|
|
19
|
+
set currentComputation(s) {
|
|
20
|
+
K = s;
|
|
21
|
+
},
|
|
22
|
+
get currentOwner() {
|
|
23
|
+
return Z;
|
|
24
|
+
},
|
|
25
|
+
set currentOwner(s) {
|
|
26
|
+
Z = s;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function ne() {
|
|
30
|
+
return D.currentComputation;
|
|
31
|
+
}
|
|
32
|
+
function xe() {
|
|
33
|
+
return D.currentOwner;
|
|
34
|
+
}
|
|
35
|
+
class we {
|
|
36
|
+
id;
|
|
37
|
+
owner;
|
|
38
|
+
fn;
|
|
39
|
+
sources = /* @__PURE__ */ new Set();
|
|
40
|
+
// Signals this computation depends on
|
|
41
|
+
observers = /* @__PURE__ */ new Set();
|
|
42
|
+
// Computations that depend on this
|
|
43
|
+
state = b.Dirty;
|
|
44
|
+
value = void 0;
|
|
45
|
+
constructor(e, t = null) {
|
|
46
|
+
this.id = ++be, this.fn = e, this.owner = t, t && !t.disposed && t.sources.add(this);
|
|
47
|
+
}
|
|
48
|
+
execute() {
|
|
49
|
+
if (this.state === b.Disposed)
|
|
50
|
+
return this.value;
|
|
51
|
+
for (const t of this.sources)
|
|
52
|
+
t && typeof t == "object" && "removeObserver" in t && t.removeObserver(this);
|
|
53
|
+
this.sources.clear();
|
|
54
|
+
const e = D.currentComputation;
|
|
55
|
+
D.currentComputation = this;
|
|
56
|
+
try {
|
|
57
|
+
return this.state = b.Clean, this.value = this.fn(), this.value;
|
|
58
|
+
} catch (t) {
|
|
59
|
+
throw this.state = b.Disposed, (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error in computation:", t), t;
|
|
60
|
+
} finally {
|
|
61
|
+
D.currentComputation = e;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
dispose() {
|
|
65
|
+
if (this.state !== b.Disposed) {
|
|
66
|
+
this.state = b.Disposed;
|
|
67
|
+
for (const e of this.sources)
|
|
68
|
+
e && typeof e == "object" && "removeObserver" in e && e.removeObserver(this);
|
|
69
|
+
this.sources.clear();
|
|
70
|
+
for (const e of this.observers)
|
|
71
|
+
e.sources.delete(this);
|
|
72
|
+
this.observers.clear(), this.owner && !this.owner.disposed && this.owner.sources.delete(this);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = process.env.NODE_ENV !== "production");
|
|
77
|
+
const Se = (s, e) => s === e;
|
|
78
|
+
var F = /* @__PURE__ */ ((s) => (s[s.Immediate = 0] = "Immediate", s[s.High = 1] = "High", s[s.Normal = 2] = "Normal", s[s.Low = 3] = "Low", s[s.Idle = 4] = "Idle", s))(F || {});
|
|
79
|
+
class Ce extends we {
|
|
80
|
+
type = "computed";
|
|
81
|
+
priority;
|
|
82
|
+
_hasValue = !1;
|
|
83
|
+
_error = null;
|
|
84
|
+
equalsFn;
|
|
85
|
+
options;
|
|
86
|
+
constructor(e, t = {}, i = xe()) {
|
|
87
|
+
super(e, i), this.priority = t.priority ?? F.Normal, this.equalsFn = t.equals ?? Se, this.options = t;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the computed value, tracking dependency and lazily computing
|
|
91
|
+
*/
|
|
92
|
+
getValue() {
|
|
93
|
+
const e = ne();
|
|
94
|
+
return e && e.state !== b.Disposed && (this.observers.add(e), e.sources.add(this)), (this.state === b.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get the current value without tracking dependency
|
|
98
|
+
*/
|
|
99
|
+
peek() {
|
|
100
|
+
return (this.state === b.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Remove an observer (cleanup)
|
|
104
|
+
*/
|
|
105
|
+
removeObserver(e) {
|
|
106
|
+
this.observers.delete(e);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Execute the computation and notify observers
|
|
110
|
+
*/
|
|
111
|
+
execute() {
|
|
112
|
+
const e = this._hasValue ? this.value : void 0, t = super.execute();
|
|
113
|
+
if (!this._hasValue || !this.equalsFn(e, t))
|
|
114
|
+
for (const i of this.observers)
|
|
115
|
+
i.state !== b.Disposed && (i.state = b.Dirty, "execute" in i && typeof i.execute == "function" && queueMicrotask(() => {
|
|
116
|
+
i.state === b.Dirty && i.execute();
|
|
117
|
+
}));
|
|
118
|
+
return t;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Notify method for ReactiveNode compatibility
|
|
122
|
+
*/
|
|
123
|
+
notify() {
|
|
124
|
+
this.execute();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Complete cleanup for memory management
|
|
128
|
+
*/
|
|
129
|
+
cleanup() {
|
|
130
|
+
for (const e of this.sources)
|
|
131
|
+
"removeObserver" in e && e.removeObserver(this);
|
|
132
|
+
this.sources.clear();
|
|
133
|
+
for (const e of this.observers)
|
|
134
|
+
e.sources.delete(this);
|
|
135
|
+
this.observers.clear(), this._hasValue = !1, this._error = null, this.state = b.Disposed;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Dispose the computed value
|
|
139
|
+
*/
|
|
140
|
+
dispose() {
|
|
141
|
+
this.cleanup(), super.dispose();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Debug information
|
|
145
|
+
*/
|
|
146
|
+
[Symbol.for("tachui.debug")]() {
|
|
147
|
+
return {
|
|
148
|
+
id: this.id,
|
|
149
|
+
type: this.type,
|
|
150
|
+
value: this._hasValue ? this.value : void 0,
|
|
151
|
+
hasValue: this._hasValue,
|
|
152
|
+
error: this._error?.message,
|
|
153
|
+
state: this.state,
|
|
154
|
+
sourceCount: this.sources.size,
|
|
155
|
+
observerCount: this.observers.size,
|
|
156
|
+
priority: F[this.priority],
|
|
157
|
+
debugName: this.options.debugName,
|
|
158
|
+
equalsFn: this.equalsFn.name || "anonymous"
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
toString() {
|
|
162
|
+
return `Computed(${this.options.debugName || this.id}): ${this._hasValue ? this.value : "no value"}`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function $e(s, e) {
|
|
166
|
+
const t = new Ce(s, e), i = t.getValue.bind(t);
|
|
167
|
+
return i.peek = t.peek.bind(t), Object.defineProperty(i, Symbol.for("tachui.computed"), {
|
|
168
|
+
value: t,
|
|
169
|
+
enumerable: !1
|
|
170
|
+
}), i;
|
|
171
|
+
}
|
|
172
|
+
let Be = 0;
|
|
173
|
+
class ke {
|
|
174
|
+
id;
|
|
175
|
+
observers = /* @__PURE__ */ new Set();
|
|
176
|
+
_value;
|
|
177
|
+
constructor(e) {
|
|
178
|
+
this.id = ++Be, this._value = e;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get the current value and track dependency
|
|
182
|
+
*/
|
|
183
|
+
getValue() {
|
|
184
|
+
const e = ne();
|
|
185
|
+
return e && e.state !== b.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get the current value without tracking dependency
|
|
189
|
+
*/
|
|
190
|
+
peek() {
|
|
191
|
+
return this._value;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Set a new value and notify observers
|
|
195
|
+
*/
|
|
196
|
+
set(e) {
|
|
197
|
+
const t = typeof e == "function" ? e(this._value) : e;
|
|
198
|
+
return t !== this._value && (this._value = t, this.notify()), t;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Notify all observers that this signal has changed
|
|
202
|
+
*/
|
|
203
|
+
notify() {
|
|
204
|
+
for (const e of this.observers)
|
|
205
|
+
e.state !== b.Disposed && (e.state = b.Dirty, Re(e));
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Remove an observer (cleanup)
|
|
209
|
+
*/
|
|
210
|
+
removeObserver(e) {
|
|
211
|
+
this.observers.delete(e);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get debug information about this signal
|
|
215
|
+
*/
|
|
216
|
+
[Symbol.for("tachui.debug")]() {
|
|
217
|
+
return {
|
|
218
|
+
id: this.id,
|
|
219
|
+
value: this._value,
|
|
220
|
+
observerCount: this.observers.size,
|
|
221
|
+
type: "Signal"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const L = /* @__PURE__ */ new Set();
|
|
226
|
+
let N = !1;
|
|
227
|
+
function Re(s) {
|
|
228
|
+
L.add(s), N || queueMicrotask(Me);
|
|
229
|
+
}
|
|
230
|
+
function Me() {
|
|
231
|
+
if (!N) {
|
|
232
|
+
N = !0;
|
|
233
|
+
try {
|
|
234
|
+
for (; L.size > 0; ) {
|
|
235
|
+
const s = Array.from(L).sort((e, t) => e.id - t.id);
|
|
236
|
+
L.clear();
|
|
237
|
+
for (const e of s)
|
|
238
|
+
e.state === b.Dirty && e.execute();
|
|
239
|
+
}
|
|
240
|
+
} finally {
|
|
241
|
+
N = !1;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function Oe(s) {
|
|
246
|
+
const e = new ke(s), t = e.getValue.bind(e);
|
|
247
|
+
t.peek = e.peek.bind(e);
|
|
248
|
+
const i = e.set.bind(e);
|
|
249
|
+
return Object.defineProperty(t, Symbol.for("tachui.signal"), {
|
|
250
|
+
value: e,
|
|
251
|
+
enumerable: !1
|
|
252
|
+
}), [t, i];
|
|
253
|
+
}
|
|
254
|
+
const [Ve, st] = Oe("light");
|
|
255
|
+
$e(() => {
|
|
256
|
+
const s = Ve();
|
|
257
|
+
return s === "system" ? Ee() : s;
|
|
258
|
+
});
|
|
259
|
+
function Ee() {
|
|
260
|
+
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
261
|
+
}
|
|
262
|
+
process.env.NODE_ENV, process.env.NODE_ENV;
|
|
263
|
+
process.env.NODE_ENV === "development" && console.log("📤 Created RegistryAdapter for globalModifierRegistry", {
|
|
264
|
+
registryId: W.instanceId,
|
|
265
|
+
currentSize: W.list().length
|
|
266
|
+
});
|
|
267
|
+
const Ie = "0.8.1-alpha", Te = Ie, Y = /* @__PURE__ */ new WeakSet(), X = /* @__PURE__ */ new WeakMap(), je = {
|
|
268
|
+
name: "@tachui/core",
|
|
269
|
+
version: Te,
|
|
270
|
+
author: "TachUI Team",
|
|
271
|
+
verified: !0
|
|
272
|
+
};
|
|
273
|
+
function De(s) {
|
|
274
|
+
Y.has(s) || (s.setFeatureFlags({
|
|
275
|
+
metadataRegistration: !0
|
|
276
|
+
}), Y.add(s));
|
|
277
|
+
}
|
|
278
|
+
function Pe(s, e) {
|
|
279
|
+
let t = X.get(s);
|
|
280
|
+
t || (t = /* @__PURE__ */ new Set(), X.set(s, t)), !t.has(e.name) && (s.registerPlugin(e), t.add(e.name));
|
|
281
|
+
}
|
|
282
|
+
function _e(s, e, t, i = W, r = je) {
|
|
283
|
+
De(i), Pe(i, r), i.has(s) || i.register(s, e), i.getMetadata(s) || i.registerMetadata({
|
|
284
|
+
...t,
|
|
285
|
+
name: s,
|
|
286
|
+
plugin: r.name
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
const ze = "0.8.0-alpha", qe = ze, oe = {
|
|
290
|
+
base: "0px",
|
|
291
|
+
// Mobile-first base
|
|
292
|
+
sm: "640px",
|
|
293
|
+
// Small tablets and large phones
|
|
294
|
+
md: "768px",
|
|
295
|
+
// Tablets
|
|
296
|
+
lg: "1024px",
|
|
297
|
+
// Laptops and small desktops
|
|
298
|
+
xl: "1280px",
|
|
299
|
+
// Large desktops
|
|
300
|
+
"2xl": "1536px"
|
|
301
|
+
// Extra large screens
|
|
302
|
+
};
|
|
303
|
+
function w(s) {
|
|
304
|
+
return typeof s == "object" && s !== null && !Array.isArray(s) && Object.keys(s).some(
|
|
305
|
+
(e) => ["base", "sm", "md", "lg", "xl", "2xl"].includes(e)
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
function J(s) {
|
|
309
|
+
return ["base", "sm", "md", "lg", "xl", "2xl"].includes(s);
|
|
310
|
+
}
|
|
311
|
+
let z = {
|
|
312
|
+
...oe
|
|
313
|
+
};
|
|
314
|
+
const [ae, ee] = E("base"), [ce, Le] = E({
|
|
315
|
+
width: 0,
|
|
316
|
+
height: 0
|
|
317
|
+
});
|
|
318
|
+
function nt(s) {
|
|
319
|
+
Ae(s), z = {
|
|
320
|
+
...oe,
|
|
321
|
+
...s
|
|
322
|
+
}, _(), typeof window < "u" && window.addEventListener("resize", _);
|
|
323
|
+
}
|
|
324
|
+
function P() {
|
|
325
|
+
return { ...z };
|
|
326
|
+
}
|
|
327
|
+
function x() {
|
|
328
|
+
return ae;
|
|
329
|
+
}
|
|
330
|
+
function ot() {
|
|
331
|
+
return ce;
|
|
332
|
+
}
|
|
333
|
+
function at() {
|
|
334
|
+
typeof window > "u" || (H(), _(), window.addEventListener("resize", () => {
|
|
335
|
+
H(), _();
|
|
336
|
+
}), window.addEventListener("orientationchange", () => {
|
|
337
|
+
setTimeout(() => {
|
|
338
|
+
H(), _();
|
|
339
|
+
}, 100);
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
function S() {
|
|
343
|
+
const s = ae(), e = ce();
|
|
344
|
+
return {
|
|
345
|
+
current: s,
|
|
346
|
+
width: e.width,
|
|
347
|
+
height: e.height,
|
|
348
|
+
isAbove: (t) => te(s, t),
|
|
349
|
+
isBelow: (t) => ie(s, t),
|
|
350
|
+
isBetween: (t, i) => te(s, t) && ie(s, i),
|
|
351
|
+
matches: (t) => window.matchMedia(t).matches
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
function G(s) {
|
|
355
|
+
const e = z[s];
|
|
356
|
+
return e.endsWith("px") ? parseInt(e, 10) : e.endsWith("em") || e.endsWith("rem") ? parseInt(e, 10) * 16 : parseInt(e, 10) || 0;
|
|
357
|
+
}
|
|
358
|
+
function y(s) {
|
|
359
|
+
return ["base", "sm", "md", "lg", "xl", "2xl"].indexOf(s);
|
|
360
|
+
}
|
|
361
|
+
function te(s, e) {
|
|
362
|
+
return y(s) > y(e);
|
|
363
|
+
}
|
|
364
|
+
function ie(s, e) {
|
|
365
|
+
return y(s) < y(e);
|
|
366
|
+
}
|
|
367
|
+
function Ne(s) {
|
|
368
|
+
return s === "base" ? "" : `(min-width: ${z[s]})`;
|
|
369
|
+
}
|
|
370
|
+
function ct(s, e) {
|
|
371
|
+
const t = [];
|
|
372
|
+
if (s !== "base" && t.push(`(min-width: ${z[s]})`), e && e !== "2xl") {
|
|
373
|
+
const i = ["sm", "md", "lg", "xl", "2xl"], r = i.indexOf(e);
|
|
374
|
+
if (r >= 0 && r < i.length - 1) {
|
|
375
|
+
const o = i[r + 1], n = `${G(o) - 1}px`;
|
|
376
|
+
t.push(`(max-width: ${n})`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return t.length > 0 ? t.join(" and ") : "";
|
|
380
|
+
}
|
|
381
|
+
function Q() {
|
|
382
|
+
return ["base", "sm", "md", "lg", "xl", "2xl"];
|
|
383
|
+
}
|
|
384
|
+
function dt(s) {
|
|
385
|
+
const e = Q(), t = e.indexOf(s);
|
|
386
|
+
return t >= 0 ? e.slice(t + 1) : [];
|
|
387
|
+
}
|
|
388
|
+
function ut(s) {
|
|
389
|
+
const e = Q(), t = e.indexOf(s);
|
|
390
|
+
return t > 0 ? e.slice(0, t) : [];
|
|
391
|
+
}
|
|
392
|
+
function _() {
|
|
393
|
+
if (typeof window > "u")
|
|
394
|
+
return;
|
|
395
|
+
const s = window.innerWidth, e = Q().reverse();
|
|
396
|
+
for (const t of e)
|
|
397
|
+
if (t === "base" || s >= G(t)) {
|
|
398
|
+
ee(t);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
ee("base");
|
|
402
|
+
}
|
|
403
|
+
function H() {
|
|
404
|
+
typeof window < "u" && Le({
|
|
405
|
+
width: window.innerWidth,
|
|
406
|
+
height: window.innerHeight
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
function Ae(s) {
|
|
410
|
+
for (const [t, i] of Object.entries(s)) {
|
|
411
|
+
if (!J(t))
|
|
412
|
+
throw new Error(
|
|
413
|
+
`Invalid breakpoint key: "${t}". Valid keys are: base, sm, md, lg, xl, 2xl`
|
|
414
|
+
);
|
|
415
|
+
if (typeof i != "string")
|
|
416
|
+
throw new Error(
|
|
417
|
+
`Breakpoint value for "${t}" must be a string (e.g., "768px")`
|
|
418
|
+
);
|
|
419
|
+
if (!i.match(/^\d+(\.\d+)?(px|em|rem|%)$/))
|
|
420
|
+
throw new Error(
|
|
421
|
+
`Invalid breakpoint value for "${t}": "${i}". Must be a valid CSS length (e.g., "768px", "48em")`
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
const e = Object.keys(s).filter(J).sort((t, i) => y(t) - y(i));
|
|
425
|
+
for (let t = 1; t < e.length; t++) {
|
|
426
|
+
const i = e[t - 1], r = e[t], o = s[i], n = s[r];
|
|
427
|
+
if (G(i) >= parseInt(n, 10))
|
|
428
|
+
throw new Error(
|
|
429
|
+
`Breakpoint "${r}" (${n}) must be larger than "${i}" (${o})`
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
const lt = {
|
|
434
|
+
// Tailwind CSS (default)
|
|
435
|
+
tailwind: {
|
|
436
|
+
sm: "640px",
|
|
437
|
+
md: "768px",
|
|
438
|
+
lg: "1024px",
|
|
439
|
+
xl: "1280px",
|
|
440
|
+
"2xl": "1536px"
|
|
441
|
+
},
|
|
442
|
+
// Bootstrap
|
|
443
|
+
bootstrap: {
|
|
444
|
+
sm: "576px",
|
|
445
|
+
md: "768px",
|
|
446
|
+
lg: "992px",
|
|
447
|
+
xl: "1200px",
|
|
448
|
+
"2xl": "1400px"
|
|
449
|
+
},
|
|
450
|
+
// Material Design
|
|
451
|
+
material: {
|
|
452
|
+
sm: "600px",
|
|
453
|
+
md: "960px",
|
|
454
|
+
lg: "1280px",
|
|
455
|
+
xl: "1920px",
|
|
456
|
+
"2xl": "2560px"
|
|
457
|
+
},
|
|
458
|
+
// Custom mobile-first
|
|
459
|
+
mobileFocus: {
|
|
460
|
+
sm: "480px",
|
|
461
|
+
md: "768px",
|
|
462
|
+
lg: "1024px",
|
|
463
|
+
xl: "1200px",
|
|
464
|
+
"2xl": "1440px"
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
class de {
|
|
468
|
+
options;
|
|
469
|
+
constructor(e) {
|
|
470
|
+
this.options = {
|
|
471
|
+
generateMinified: !1,
|
|
472
|
+
includeComments: !0,
|
|
473
|
+
optimizeOutput: !0,
|
|
474
|
+
mobileFirst: !0,
|
|
475
|
+
...e
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Generate complete responsive CSS from a style configuration
|
|
480
|
+
*/
|
|
481
|
+
generateResponsiveCSS(e) {
|
|
482
|
+
const t = [], i = [], r = {};
|
|
483
|
+
let o = !1;
|
|
484
|
+
for (const [n, a] of Object.entries(e))
|
|
485
|
+
if (w(a)) {
|
|
486
|
+
o = !0;
|
|
487
|
+
const c = this.generatePropertyMediaQueries(n, a);
|
|
488
|
+
t.push(...c.mediaQueries), c.baseStyles && Object.assign(r, c.baseStyles);
|
|
489
|
+
} else
|
|
490
|
+
r[this.toCSSPropertyName(n)] = this.formatCSSValue(
|
|
491
|
+
n,
|
|
492
|
+
a
|
|
493
|
+
);
|
|
494
|
+
return i.push(...this.generateCSSRules(t, r)), {
|
|
495
|
+
cssRules: i,
|
|
496
|
+
mediaQueries: t,
|
|
497
|
+
fallbackStyles: r,
|
|
498
|
+
hasResponsiveStyles: o
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Generate media queries for a single property
|
|
503
|
+
*/
|
|
504
|
+
generatePropertyMediaQueries(e, t) {
|
|
505
|
+
const i = [], r = {}, o = Q();
|
|
506
|
+
for (const n of o) {
|
|
507
|
+
const a = t[n];
|
|
508
|
+
if (a === void 0) continue;
|
|
509
|
+
const c = this.toCSSPropertyName(e), d = this.formatCSSValue(e, a);
|
|
510
|
+
if (n === "base")
|
|
511
|
+
r[c] = d;
|
|
512
|
+
else {
|
|
513
|
+
const l = Ne(n), p = { [c]: d };
|
|
514
|
+
i.push({
|
|
515
|
+
breakpoint: n,
|
|
516
|
+
query: l,
|
|
517
|
+
styles: p,
|
|
518
|
+
selector: this.options.selector
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return {
|
|
523
|
+
mediaQueries: i,
|
|
524
|
+
baseStyles: Object.keys(r).length > 0 ? r : void 0
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Generate CSS rules from media queries and base styles
|
|
529
|
+
*/
|
|
530
|
+
generateCSSRules(e, t) {
|
|
531
|
+
const i = [];
|
|
532
|
+
if (Object.keys(t).length > 0) {
|
|
533
|
+
const o = this.generateCSSRule(this.options.selector, t);
|
|
534
|
+
i.push(o);
|
|
535
|
+
}
|
|
536
|
+
const r = this.groupQueriesByMediaQuery(e);
|
|
537
|
+
for (const [o, n] of Object.entries(r)) {
|
|
538
|
+
if (o === "") continue;
|
|
539
|
+
const a = {};
|
|
540
|
+
for (const d of n)
|
|
541
|
+
Object.assign(a, d.styles);
|
|
542
|
+
const c = this.generateMediaQueryRule(
|
|
543
|
+
o,
|
|
544
|
+
this.options.selector,
|
|
545
|
+
a
|
|
546
|
+
);
|
|
547
|
+
i.push(c);
|
|
548
|
+
}
|
|
549
|
+
return i;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Group media queries by their query string for optimization
|
|
553
|
+
*/
|
|
554
|
+
groupQueriesByMediaQuery(e) {
|
|
555
|
+
const t = {};
|
|
556
|
+
for (const i of e)
|
|
557
|
+
t[i.query] || (t[i.query] = []), t[i.query].push(i);
|
|
558
|
+
return t;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Generate a single CSS rule
|
|
562
|
+
*/
|
|
563
|
+
generateCSSRule(e, t) {
|
|
564
|
+
const { generateMinified: i, includeComments: r } = this.options, o = i ? "" : " ", n = i ? "" : `
|
|
565
|
+
`, a = i ? "" : " ";
|
|
566
|
+
let c = `${e}${a}{${n}`;
|
|
567
|
+
for (const [d, l] of Object.entries(t))
|
|
568
|
+
c += `${o}${d}:${a}${l};${n}`;
|
|
569
|
+
return c += `}${n}`, r && !i && (c = `/* Base styles (mobile-first) */${n}${c}`), c;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Generate a CSS media query rule
|
|
573
|
+
*/
|
|
574
|
+
generateMediaQueryRule(e, t, i) {
|
|
575
|
+
const { generateMinified: r, includeComments: o } = this.options, n = r ? "" : " ", a = r ? "" : " ", c = r ? "" : `
|
|
576
|
+
`, d = r ? "" : " ";
|
|
577
|
+
let l = `@media ${e}${d}{${c}`;
|
|
578
|
+
l += `${n}${t}${d}{${c}`;
|
|
579
|
+
for (const [p, f] of Object.entries(i))
|
|
580
|
+
l += `${a}${p}:${d}${f};${c}`;
|
|
581
|
+
return l += `${n}}${c}`, l += `}${c}`, o && !r && (l = `/* ${this.getBreakpointFromQuery(e)} styles */${c}${l}`), l;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Convert camelCase property to CSS kebab-case
|
|
585
|
+
*/
|
|
586
|
+
toCSSProperty(e) {
|
|
587
|
+
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Format CSS value with appropriate units and validation
|
|
591
|
+
*/
|
|
592
|
+
formatCSSValue(e, t) {
|
|
593
|
+
if (t == null)
|
|
594
|
+
return "inherit";
|
|
595
|
+
if (typeof t == "number") {
|
|
596
|
+
const i = [
|
|
597
|
+
"opacity",
|
|
598
|
+
"z-index",
|
|
599
|
+
"font-weight",
|
|
600
|
+
"line-height",
|
|
601
|
+
"flex-grow",
|
|
602
|
+
"flex-shrink",
|
|
603
|
+
"order",
|
|
604
|
+
"grid-column-start",
|
|
605
|
+
"grid-column-end",
|
|
606
|
+
"grid-row-start",
|
|
607
|
+
"grid-row-end"
|
|
608
|
+
], r = this.toCSSProperty(e);
|
|
609
|
+
if (i.includes(r))
|
|
610
|
+
return this.addImportantIfNeeded(e, t.toString());
|
|
611
|
+
if ([
|
|
612
|
+
"width",
|
|
613
|
+
"height",
|
|
614
|
+
"min-width",
|
|
615
|
+
"max-width",
|
|
616
|
+
"min-height",
|
|
617
|
+
"max-height",
|
|
618
|
+
"padding",
|
|
619
|
+
"margin",
|
|
620
|
+
"border-width",
|
|
621
|
+
"border-radius",
|
|
622
|
+
"top",
|
|
623
|
+
"right",
|
|
624
|
+
"bottom",
|
|
625
|
+
"left",
|
|
626
|
+
"font-size",
|
|
627
|
+
"letter-spacing",
|
|
628
|
+
"text-indent"
|
|
629
|
+
].some((n) => r.includes(n)))
|
|
630
|
+
return this.addImportantIfNeeded(e, `${t}px`);
|
|
631
|
+
}
|
|
632
|
+
return this.addImportantIfNeeded(e, t.toString());
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Add !important for properties that need to override base component styles
|
|
636
|
+
*/
|
|
637
|
+
addImportantIfNeeded(e, t) {
|
|
638
|
+
const i = [
|
|
639
|
+
"flexDirection",
|
|
640
|
+
"flex-direction",
|
|
641
|
+
"justifyContent",
|
|
642
|
+
"justify-content",
|
|
643
|
+
"alignItems",
|
|
644
|
+
"align-items",
|
|
645
|
+
"display"
|
|
646
|
+
], r = this.toCSSProperty(e);
|
|
647
|
+
return i.includes(e) || i.includes(r) ? `${t} !important` : t;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Convert property name to appropriate CSS property (including custom properties)
|
|
651
|
+
*/
|
|
652
|
+
toCSSPropertyName(e) {
|
|
653
|
+
return this.toCSSProperty(e);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Extract breakpoint name from media query for comments
|
|
657
|
+
*/
|
|
658
|
+
getBreakpointFromQuery(e) {
|
|
659
|
+
const t = P();
|
|
660
|
+
for (const [i, r] of Object.entries(t))
|
|
661
|
+
if (e.includes(r))
|
|
662
|
+
return i;
|
|
663
|
+
return "custom";
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function pt(s, e, t, i) {
|
|
667
|
+
if (!w(t)) {
|
|
668
|
+
const a = e.replace(
|
|
669
|
+
/[A-Z]/g,
|
|
670
|
+
(d) => `-${d.toLowerCase()}`
|
|
671
|
+
), c = typeof t == "number" ? `${t}px` : t.toString();
|
|
672
|
+
return [`${s} { ${a}: ${c}; }`];
|
|
673
|
+
}
|
|
674
|
+
const r = new de({ selector: s, ...i }), o = { [e]: t };
|
|
675
|
+
return r.generateResponsiveCSS(o).cssRules;
|
|
676
|
+
}
|
|
677
|
+
function ht(s, e, t) {
|
|
678
|
+
const { generateMinified: i = !1 } = t || {}, r = i ? "" : " ", o = i ? "" : `
|
|
679
|
+
`, n = i ? "" : " ";
|
|
680
|
+
let a = `@media ${e.query}${n}{${o}`;
|
|
681
|
+
a += `${r}${s}${n}{${o}`;
|
|
682
|
+
for (const [c, d] of Object.entries(e.styles)) {
|
|
683
|
+
const l = c.replace(
|
|
684
|
+
/[A-Z]/g,
|
|
685
|
+
(f) => `-${f.toLowerCase()}`
|
|
686
|
+
), p = typeof d == "number" ? `${d}px` : d.toString();
|
|
687
|
+
a += `${r}${r}${l}:${n}${p};${o}`;
|
|
688
|
+
}
|
|
689
|
+
return a += `${r}}${o}`, a += `}${o}`, a;
|
|
690
|
+
}
|
|
691
|
+
class ue {
|
|
692
|
+
static styleSheet = null;
|
|
693
|
+
static injectedRules = /* @__PURE__ */ new Set();
|
|
694
|
+
/**
|
|
695
|
+
* Get or create the tachUI responsive stylesheet
|
|
696
|
+
*/
|
|
697
|
+
static getStyleSheet() {
|
|
698
|
+
if (this.styleSheet)
|
|
699
|
+
return this.styleSheet;
|
|
700
|
+
const e = document.createElement("style");
|
|
701
|
+
return e.setAttribute("data-tachui-responsive", "true"), document.head.appendChild(e), this.styleSheet = e.sheet, this.styleSheet;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Inject CSS rules into the document
|
|
705
|
+
*/
|
|
706
|
+
static injectCSS(e) {
|
|
707
|
+
if (typeof document > "u")
|
|
708
|
+
return;
|
|
709
|
+
const t = this.getStyleSheet();
|
|
710
|
+
for (const i of e)
|
|
711
|
+
if (!this.injectedRules.has(i))
|
|
712
|
+
try {
|
|
713
|
+
t.insertRule(i, t.cssRules.length), this.injectedRules.add(i);
|
|
714
|
+
} catch (r) {
|
|
715
|
+
console.warn("Failed to inject CSS rule:", i, r);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Clear all injected responsive CSS
|
|
720
|
+
*/
|
|
721
|
+
static clearCSS() {
|
|
722
|
+
if (this.styleSheet) {
|
|
723
|
+
for (; this.styleSheet.cssRules.length > 0; )
|
|
724
|
+
this.styleSheet.deleteRule(0);
|
|
725
|
+
this.injectedRules.clear();
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Check if a rule has been injected
|
|
730
|
+
*/
|
|
731
|
+
static hasRule(e) {
|
|
732
|
+
return this.injectedRules.has(e);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
class Qe {
|
|
736
|
+
cache = /* @__PURE__ */ new Map();
|
|
737
|
+
hitCount = 0;
|
|
738
|
+
missCount = 0;
|
|
739
|
+
get(e) {
|
|
740
|
+
const t = this.cache.get(e);
|
|
741
|
+
return t ? this.hitCount++ : this.missCount++, t;
|
|
742
|
+
}
|
|
743
|
+
set(e, t) {
|
|
744
|
+
this.cache.set(e, t);
|
|
745
|
+
}
|
|
746
|
+
clear() {
|
|
747
|
+
this.cache.clear(), this.hitCount = 0, this.missCount = 0;
|
|
748
|
+
}
|
|
749
|
+
getStats() {
|
|
750
|
+
return {
|
|
751
|
+
size: this.cache.size,
|
|
752
|
+
hitRate: this.hitCount / (this.hitCount + this.missCount) || 0,
|
|
753
|
+
hits: this.hitCount,
|
|
754
|
+
misses: this.missCount
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
const R = new Qe();
|
|
759
|
+
class ft {
|
|
760
|
+
static BATCH_SIZE = 50;
|
|
761
|
+
static ruleQueue = [];
|
|
762
|
+
static flushTimer = null;
|
|
763
|
+
/**
|
|
764
|
+
* Generate CSS with caching and batching
|
|
765
|
+
*/
|
|
766
|
+
static generateOptimizedCSS(e, t, i = {}) {
|
|
767
|
+
const {
|
|
768
|
+
minify: r = process.env.NODE_ENV === "production",
|
|
769
|
+
batch: o = !0,
|
|
770
|
+
deduplicate: n = !0
|
|
771
|
+
} = i, a = this.createCacheKey(e, t, { minify: r });
|
|
772
|
+
if (n) {
|
|
773
|
+
const d = R.get(a);
|
|
774
|
+
if (d)
|
|
775
|
+
return d;
|
|
776
|
+
}
|
|
777
|
+
const c = this.generateCSS(e, t, { minify: r });
|
|
778
|
+
return n && R.set(a, c), o && c.trim() ? (this.addToBatch(c), "") : c;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Create cache key for CSS rule
|
|
782
|
+
*/
|
|
783
|
+
static createCacheKey(e, t, i) {
|
|
784
|
+
return JSON.stringify({ selector: e, config: t, options: i });
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Generate CSS without optimizations (for comparison)
|
|
788
|
+
*/
|
|
789
|
+
static generateCSS(e, t, i) {
|
|
790
|
+
const { minify: r = !1 } = i, o = r ? "" : " ", n = r ? "" : `
|
|
791
|
+
`, a = r ? "" : " ";
|
|
792
|
+
let c = "";
|
|
793
|
+
const d = /* @__PURE__ */ new Set(), l = this.extractBaseStyles(t);
|
|
794
|
+
Object.keys(l).length > 0 && (c += `${e}${a}{${n}`, c += this.generateProperties(l, o, n, a), c += `}${n}`);
|
|
795
|
+
for (const [p, f] of Object.entries(t))
|
|
796
|
+
if (typeof f == "object" && f !== null)
|
|
797
|
+
for (const [v, C] of Object.entries(f)) {
|
|
798
|
+
if (v === "base") continue;
|
|
799
|
+
const k = this.getMediaQuery(v), I = `${k}:${p}`;
|
|
800
|
+
d.has(I) || (c += `@media ${k}${a}{${n}`, c += `${o}${e}${a}{${n}`, c += `${o}${o}${this.propertyToCSS(p)}:${a}${this.valueToCSS(C)};${n}`, c += `${o}}${n}`, c += `}${n}`, d.add(I));
|
|
801
|
+
}
|
|
802
|
+
return c;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Add CSS to batch queue
|
|
806
|
+
*/
|
|
807
|
+
static addToBatch(e) {
|
|
808
|
+
this.ruleQueue.push(e), this.ruleQueue.length >= this.BATCH_SIZE ? this.flushBatch() : this.flushTimer || (this.flushTimer = window.setTimeout(() => this.flushBatch(), 16));
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Flush batched CSS rules
|
|
812
|
+
*/
|
|
813
|
+
static flushBatch() {
|
|
814
|
+
if (this.ruleQueue.length === 0) return;
|
|
815
|
+
const e = this.ruleQueue.join("");
|
|
816
|
+
this.ruleQueue = [], this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.injectCSS(e);
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Inject CSS into document
|
|
820
|
+
*/
|
|
821
|
+
static injectCSS(e) {
|
|
822
|
+
if (typeof document > "u") return;
|
|
823
|
+
let t = document.getElementById(
|
|
824
|
+
"tachui-responsive-styles"
|
|
825
|
+
);
|
|
826
|
+
t || (t = document.createElement("style"), t.id = "tachui-responsive-styles", t.type = "text/css", document.head.appendChild(t)), t.appendChild(document.createTextNode(e));
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Extract base (non-responsive) styles
|
|
830
|
+
*/
|
|
831
|
+
static extractBaseStyles(e) {
|
|
832
|
+
const t = {};
|
|
833
|
+
for (const [i, r] of Object.entries(e))
|
|
834
|
+
typeof r != "object" || r === null ? t[i] = r : "base" in r && (t[i] = r.base);
|
|
835
|
+
return t;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Generate CSS properties
|
|
839
|
+
*/
|
|
840
|
+
static generateProperties(e, t, i, r) {
|
|
841
|
+
let o = "";
|
|
842
|
+
for (const [n, a] of Object.entries(e))
|
|
843
|
+
a !== void 0 && (o += `${t}${this.propertyToCSS(n)}:${r}${this.valueToCSS(a)};${i}`);
|
|
844
|
+
return o;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Convert property name to CSS
|
|
848
|
+
*/
|
|
849
|
+
static propertyToCSS(e) {
|
|
850
|
+
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Convert value to CSS
|
|
854
|
+
*/
|
|
855
|
+
static valueToCSS(e) {
|
|
856
|
+
return typeof e == "number" ? `${e}px` : e.toString();
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Get media query for breakpoint
|
|
860
|
+
*/
|
|
861
|
+
static getMediaQuery(e) {
|
|
862
|
+
return {
|
|
863
|
+
base: "",
|
|
864
|
+
sm: "(min-width: 640px)",
|
|
865
|
+
md: "(min-width: 768px)",
|
|
866
|
+
lg: "(min-width: 1024px)",
|
|
867
|
+
xl: "(min-width: 1280px)",
|
|
868
|
+
"2xl": "(min-width: 1536px)"
|
|
869
|
+
}[e] || e;
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Force flush any pending batched CSS
|
|
873
|
+
*/
|
|
874
|
+
static flush() {
|
|
875
|
+
this.flushBatch();
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Get performance statistics
|
|
879
|
+
*/
|
|
880
|
+
static getStats() {
|
|
881
|
+
return {
|
|
882
|
+
cache: R.getStats(),
|
|
883
|
+
batch: {
|
|
884
|
+
queueSize: this.ruleQueue.length,
|
|
885
|
+
batchSize: this.BATCH_SIZE
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Clear all caches and reset performance counters
|
|
891
|
+
*/
|
|
892
|
+
static reset() {
|
|
893
|
+
R.clear(), this.ruleQueue = [], this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
class A {
|
|
897
|
+
static measurements = /* @__PURE__ */ new Map();
|
|
898
|
+
/**
|
|
899
|
+
* Start performance measurement
|
|
900
|
+
*/
|
|
901
|
+
static startMeasurement(e) {
|
|
902
|
+
const t = performance.now();
|
|
903
|
+
return () => {
|
|
904
|
+
const i = performance.now() - t;
|
|
905
|
+
return this.recordMeasurement(e, i), i;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Record measurement
|
|
910
|
+
*/
|
|
911
|
+
static recordMeasurement(e, t) {
|
|
912
|
+
this.measurements.has(e) || this.measurements.set(e, []);
|
|
913
|
+
const i = this.measurements.get(e);
|
|
914
|
+
i.push(t), i.length > 100 && i.shift();
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Get performance statistics
|
|
918
|
+
*/
|
|
919
|
+
static getStats() {
|
|
920
|
+
const e = {};
|
|
921
|
+
for (const [t, i] of this.measurements) {
|
|
922
|
+
const r = [...i].sort((n, a) => n - a), o = i.reduce((n, a) => n + a, 0) / i.length;
|
|
923
|
+
e[t] = {
|
|
924
|
+
count: i.length,
|
|
925
|
+
average: o,
|
|
926
|
+
min: r[0],
|
|
927
|
+
max: r[r.length - 1],
|
|
928
|
+
p50: r[Math.floor(r.length * 0.5)],
|
|
929
|
+
p95: r[Math.floor(r.length * 0.95)],
|
|
930
|
+
p99: r[Math.floor(r.length * 0.99)]
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
return e;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Clear all performance data
|
|
937
|
+
*/
|
|
938
|
+
static reset() {
|
|
939
|
+
this.measurements.clear();
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
const le = 250;
|
|
943
|
+
class U extends se {
|
|
944
|
+
type = "responsive";
|
|
945
|
+
priority = le;
|
|
946
|
+
generatedCSS = null;
|
|
947
|
+
elementSelector = "";
|
|
948
|
+
_config;
|
|
949
|
+
constructor(e) {
|
|
950
|
+
super(e), this._config = e;
|
|
951
|
+
}
|
|
952
|
+
get config() {
|
|
953
|
+
return this._config;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Apply responsive styles to the element
|
|
957
|
+
*/
|
|
958
|
+
apply(e, t) {
|
|
959
|
+
const i = e.element;
|
|
960
|
+
!i || !(i instanceof HTMLElement) || (this.elementSelector = this.generateUniqueSelector(i), i.classList.add(this.getClassFromSelector(this.elementSelector)), this.generateAndInjectCSS(), this.setupReactiveUpdates());
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Generate and inject responsive CSS
|
|
964
|
+
*/
|
|
965
|
+
generateAndInjectCSS() {
|
|
966
|
+
const e = A.startMeasurement("css-generation");
|
|
967
|
+
try {
|
|
968
|
+
const t = new de({
|
|
969
|
+
selector: this.elementSelector,
|
|
970
|
+
generateMinified: process.env.NODE_ENV === "production",
|
|
971
|
+
includeComments: process.env.NODE_ENV !== "production",
|
|
972
|
+
optimizeOutput: !0
|
|
973
|
+
});
|
|
974
|
+
this.generatedCSS = t.generateResponsiveCSS(this.config), this.generatedCSS.cssRules.length > 0 && ue.injectCSS(this.generatedCSS.cssRules);
|
|
975
|
+
} finally {
|
|
976
|
+
e();
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Set up reactive updates for dynamic responsive values
|
|
981
|
+
*/
|
|
982
|
+
setupReactiveUpdates() {
|
|
983
|
+
this.hasReactiveValues(this.config) && V(() => {
|
|
984
|
+
this.trackReactiveDependencies(this.config);
|
|
985
|
+
const t = this.resolveReactiveConfig(this.config);
|
|
986
|
+
this.updateConfig(t);
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Track reactive dependencies by accessing all reactive values
|
|
991
|
+
*/
|
|
992
|
+
trackReactiveDependencies(e) {
|
|
993
|
+
let t = !1;
|
|
994
|
+
for (const [i, r] of Object.entries(e))
|
|
995
|
+
if (this.isReactiveValue(r))
|
|
996
|
+
T(r) || j(r) ? r() : this.isAsset(r) && (t = !0, r.resolve());
|
|
997
|
+
else if (w(r))
|
|
998
|
+
for (const [o, n] of Object.entries(r))
|
|
999
|
+
this.isReactiveValue(n) && (T(n) || j(n) ? n() : this.isAsset(n) && (t = !0, n.resolve()));
|
|
1000
|
+
t && me()();
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Update configuration and regenerate CSS
|
|
1004
|
+
*/
|
|
1005
|
+
updateConfig(e) {
|
|
1006
|
+
this._config = e, this.generateAndInjectCSS();
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Generate unique CSS selector for this element
|
|
1010
|
+
*/
|
|
1011
|
+
generateUniqueSelector(e) {
|
|
1012
|
+
return `.${`tachui-responsive-${this.generateUniqueId()}`}`;
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Extract class name from CSS selector
|
|
1016
|
+
*/
|
|
1017
|
+
getClassFromSelector(e) {
|
|
1018
|
+
return e.replace(/^\./, "");
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Generate unique ID for CSS class names
|
|
1022
|
+
*/
|
|
1023
|
+
generateUniqueId() {
|
|
1024
|
+
return Math.random().toString(36).substr(2, 9);
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Check if configuration contains reactive values (signals)
|
|
1028
|
+
*/
|
|
1029
|
+
hasReactiveValues(e) {
|
|
1030
|
+
for (const t of Object.values(e)) {
|
|
1031
|
+
if (this.isReactiveValue(t))
|
|
1032
|
+
return !0;
|
|
1033
|
+
if (w(t)) {
|
|
1034
|
+
for (const i of Object.values(t))
|
|
1035
|
+
if (this.isReactiveValue(i))
|
|
1036
|
+
return !0;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return !1;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Check if a value is a reactive signal, computed, or Asset
|
|
1043
|
+
*/
|
|
1044
|
+
isReactiveValue(e) {
|
|
1045
|
+
return !!(T(e) || j(e) || this.isAsset(e));
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Check if a value is an Asset object
|
|
1049
|
+
*/
|
|
1050
|
+
isAsset(e) {
|
|
1051
|
+
return e != null && typeof e == "object" && "resolve" in e && typeof e.resolve == "function";
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Resolve configuration with current signal values
|
|
1055
|
+
*/
|
|
1056
|
+
resolveReactiveConfig(e) {
|
|
1057
|
+
const t = {};
|
|
1058
|
+
for (const [i, r] of Object.entries(e))
|
|
1059
|
+
if (this.isReactiveValue(r))
|
|
1060
|
+
T(r) || j(r) ? t[i] = r() : this.isAsset(r) && (t[i] = r.resolve());
|
|
1061
|
+
else if (w(r)) {
|
|
1062
|
+
const o = {};
|
|
1063
|
+
for (const [n, a] of Object.entries(r))
|
|
1064
|
+
this.isReactiveValue(a) ? T(a) || j(a) ? o[n] = a() : this.isAsset(a) && (o[n] = a.resolve()) : o[n] = a;
|
|
1065
|
+
t[i] = o;
|
|
1066
|
+
} else
|
|
1067
|
+
t[i] = r;
|
|
1068
|
+
return t;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Get generated CSS information (for debugging)
|
|
1072
|
+
*/
|
|
1073
|
+
getGeneratedCSS() {
|
|
1074
|
+
return this.generatedCSS;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Get configuration (for debugging)
|
|
1078
|
+
*/
|
|
1079
|
+
getConfig() {
|
|
1080
|
+
return this.config;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function h(s) {
|
|
1084
|
+
return new U(s);
|
|
1085
|
+
}
|
|
1086
|
+
class He extends se {
|
|
1087
|
+
type = "media-query";
|
|
1088
|
+
priority = le + 1;
|
|
1089
|
+
// Slightly higher than responsive
|
|
1090
|
+
elementSelector = "";
|
|
1091
|
+
constructor(e, t) {
|
|
1092
|
+
super({ query: e, styles: t });
|
|
1093
|
+
}
|
|
1094
|
+
get query() {
|
|
1095
|
+
return this.properties.query;
|
|
1096
|
+
}
|
|
1097
|
+
get styles() {
|
|
1098
|
+
return this.properties.styles;
|
|
1099
|
+
}
|
|
1100
|
+
apply(e, t) {
|
|
1101
|
+
const i = e.element;
|
|
1102
|
+
!i || !(i instanceof HTMLElement) || (this.elementSelector = this.generateUniqueSelector(i), i.classList.add(this.getClassFromSelector(this.elementSelector)), this.generateMediaQueryCSS());
|
|
1103
|
+
}
|
|
1104
|
+
generateMediaQueryCSS() {
|
|
1105
|
+
const { generateMinified: e = process.env.NODE_ENV === "production" } = {}, t = e ? "" : " ", i = e ? "" : " ", r = e ? "" : `
|
|
1106
|
+
`, o = e ? "" : " ";
|
|
1107
|
+
let n = `@media ${this.query}${o}{${r}`;
|
|
1108
|
+
n += `${t}${this.elementSelector}${o}{${r}`;
|
|
1109
|
+
for (const [a, c] of Object.entries(this.styles)) {
|
|
1110
|
+
const d = a.replace(
|
|
1111
|
+
/[A-Z]/g,
|
|
1112
|
+
(p) => `-${p.toLowerCase()}`
|
|
1113
|
+
), l = typeof c == "number" ? `${c}px` : c.toString();
|
|
1114
|
+
n += `${i}${d}:${o}${l};${r}`;
|
|
1115
|
+
}
|
|
1116
|
+
n += `${t}}${r}`, n += `}${r}`, ue.injectCSS([n]);
|
|
1117
|
+
}
|
|
1118
|
+
generateUniqueSelector(e) {
|
|
1119
|
+
return `.${`tachui-mq-${Math.random().toString(36).substr(2, 9)}`}`;
|
|
1120
|
+
}
|
|
1121
|
+
getClassFromSelector(e) {
|
|
1122
|
+
return e.replace(/^\./, "");
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
function $(s, e) {
|
|
1126
|
+
return new He(s, e);
|
|
1127
|
+
}
|
|
1128
|
+
function u(s, e) {
|
|
1129
|
+
const t = { [s]: e };
|
|
1130
|
+
return new U(t);
|
|
1131
|
+
}
|
|
1132
|
+
function pe(s) {
|
|
1133
|
+
const e = {};
|
|
1134
|
+
return s.direction && (e.flexDirection = s.direction), s.wrap && (e.flexWrap = s.wrap), s.justify && (e.justifyContent = s.justify), s.align && (e.alignItems = s.align), s.gap && (e.gap = s.gap), new U(e);
|
|
1135
|
+
}
|
|
1136
|
+
class he {
|
|
1137
|
+
constructor(e) {
|
|
1138
|
+
return this.baseBuilder = e, new Proxy(this, {
|
|
1139
|
+
get(t, i) {
|
|
1140
|
+
if (i === "base" || i === "sm" || i === "md" || i === "lg" || i === "xl" || i === "2xl" || i in t)
|
|
1141
|
+
return t[i];
|
|
1142
|
+
const r = t.baseBuilder[i];
|
|
1143
|
+
return typeof r == "function" ? (...o) => {
|
|
1144
|
+
const n = r.apply(t.baseBuilder, o);
|
|
1145
|
+
return n === t.baseBuilder ? t : n;
|
|
1146
|
+
} : r;
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
// Delegate essential builder methods
|
|
1151
|
+
addModifier(e) {
|
|
1152
|
+
this.baseBuilder.addModifier(e);
|
|
1153
|
+
}
|
|
1154
|
+
build() {
|
|
1155
|
+
return this.baseBuilder.build();
|
|
1156
|
+
}
|
|
1157
|
+
// Core responsive methods
|
|
1158
|
+
responsive(e) {
|
|
1159
|
+
const t = h(e);
|
|
1160
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1161
|
+
}
|
|
1162
|
+
mediaQuery(e, t) {
|
|
1163
|
+
const i = $(e, t);
|
|
1164
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1165
|
+
}
|
|
1166
|
+
// Advanced media query methods
|
|
1167
|
+
orientation(e, t) {
|
|
1168
|
+
const i = `(orientation: ${e})`, r = $(i, t);
|
|
1169
|
+
return this.baseBuilder.addModifier(r), this;
|
|
1170
|
+
}
|
|
1171
|
+
colorScheme(e, t) {
|
|
1172
|
+
const i = `(prefers-color-scheme: ${e})`, r = $(i, t);
|
|
1173
|
+
return this.baseBuilder.addModifier(r), this;
|
|
1174
|
+
}
|
|
1175
|
+
reducedMotion(e) {
|
|
1176
|
+
const i = $("(prefers-reduced-motion: reduce)", e);
|
|
1177
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1178
|
+
}
|
|
1179
|
+
highContrast(e) {
|
|
1180
|
+
const i = $("(prefers-contrast: high)", e);
|
|
1181
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1182
|
+
}
|
|
1183
|
+
touchDevice(e) {
|
|
1184
|
+
const i = $("(pointer: coarse)", e);
|
|
1185
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1186
|
+
}
|
|
1187
|
+
mouseDevice(e) {
|
|
1188
|
+
const i = $("(pointer: fine)", e);
|
|
1189
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1190
|
+
}
|
|
1191
|
+
retina(e) {
|
|
1192
|
+
const i = $("(min-resolution: 2dppx)", e);
|
|
1193
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1194
|
+
}
|
|
1195
|
+
print(e) {
|
|
1196
|
+
const i = $("print", e);
|
|
1197
|
+
return this.baseBuilder.addModifier(i), this;
|
|
1198
|
+
}
|
|
1199
|
+
// Responsive layout methods
|
|
1200
|
+
responsiveLayout(e) {
|
|
1201
|
+
const t = pe(e);
|
|
1202
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1203
|
+
}
|
|
1204
|
+
// Responsive dimension methods
|
|
1205
|
+
responsiveWidth(e) {
|
|
1206
|
+
const t = u("width", e);
|
|
1207
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1208
|
+
}
|
|
1209
|
+
responsiveHeight(e) {
|
|
1210
|
+
const t = u("height", e);
|
|
1211
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1212
|
+
}
|
|
1213
|
+
responsiveSize(e) {
|
|
1214
|
+
const t = h(e);
|
|
1215
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1216
|
+
}
|
|
1217
|
+
// Responsive spacing methods
|
|
1218
|
+
responsivePadding(e) {
|
|
1219
|
+
if (w(e) || typeof e == "string" || typeof e == "number") {
|
|
1220
|
+
const t = u(
|
|
1221
|
+
"padding",
|
|
1222
|
+
e
|
|
1223
|
+
);
|
|
1224
|
+
this.baseBuilder.addModifier(t);
|
|
1225
|
+
} else {
|
|
1226
|
+
const t = {}, i = e;
|
|
1227
|
+
i.all && (t.padding = i.all), i.horizontal && (t.paddingLeft = i.horizontal, t.paddingRight = i.horizontal), i.vertical && (t.paddingTop = i.vertical, t.paddingBottom = i.vertical), i.top && (t.paddingTop = i.top), i.right && (t.paddingRight = i.right), i.bottom && (t.paddingBottom = i.bottom), i.left && (t.paddingLeft = i.left);
|
|
1228
|
+
const r = h(t);
|
|
1229
|
+
this.baseBuilder.addModifier(r);
|
|
1230
|
+
}
|
|
1231
|
+
return this;
|
|
1232
|
+
}
|
|
1233
|
+
responsiveMargin(e) {
|
|
1234
|
+
if (w(e) || typeof e == "string" || typeof e == "number") {
|
|
1235
|
+
const t = u(
|
|
1236
|
+
"margin",
|
|
1237
|
+
e
|
|
1238
|
+
);
|
|
1239
|
+
this.baseBuilder.addModifier(t);
|
|
1240
|
+
} else {
|
|
1241
|
+
const t = {}, i = e;
|
|
1242
|
+
i.all && (t.margin = i.all), i.horizontal && (t.marginLeft = i.horizontal, t.marginRight = i.horizontal), i.vertical && (t.marginTop = i.vertical, t.marginBottom = i.vertical), i.top && (t.marginTop = i.top), i.right && (t.marginRight = i.right), i.bottom && (t.marginBottom = i.bottom), i.left && (t.marginLeft = i.left);
|
|
1243
|
+
const r = h(t);
|
|
1244
|
+
this.baseBuilder.addModifier(r);
|
|
1245
|
+
}
|
|
1246
|
+
return this;
|
|
1247
|
+
}
|
|
1248
|
+
// Responsive typography methods
|
|
1249
|
+
responsiveFont(e) {
|
|
1250
|
+
const t = h(e);
|
|
1251
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1252
|
+
}
|
|
1253
|
+
responsiveFontSize(e) {
|
|
1254
|
+
const t = u("fontSize", e);
|
|
1255
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1256
|
+
}
|
|
1257
|
+
responsiveTextAlign(e) {
|
|
1258
|
+
const t = u("textAlign", e);
|
|
1259
|
+
return this.baseBuilder.addModifier(t), this;
|
|
1260
|
+
}
|
|
1261
|
+
// Breakpoint shorthand methods
|
|
1262
|
+
get base() {
|
|
1263
|
+
return new O("base", this, this.baseBuilder);
|
|
1264
|
+
}
|
|
1265
|
+
get sm() {
|
|
1266
|
+
return new O("sm", this, this.baseBuilder);
|
|
1267
|
+
}
|
|
1268
|
+
get md() {
|
|
1269
|
+
return new O("md", this, this.baseBuilder);
|
|
1270
|
+
}
|
|
1271
|
+
get lg() {
|
|
1272
|
+
return new O("lg", this, this.baseBuilder);
|
|
1273
|
+
}
|
|
1274
|
+
get xl() {
|
|
1275
|
+
return new O("xl", this, this.baseBuilder);
|
|
1276
|
+
}
|
|
1277
|
+
get "2xl"() {
|
|
1278
|
+
return new O("2xl", this, this.baseBuilder);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
class O {
|
|
1282
|
+
constructor(e, t, i) {
|
|
1283
|
+
this.breakpoint = e, this.parentBuilder = t, this.baseBuilder = i;
|
|
1284
|
+
}
|
|
1285
|
+
// Layout properties
|
|
1286
|
+
width(e) {
|
|
1287
|
+
const t = { [this.breakpoint]: e }, i = u("width", t);
|
|
1288
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1289
|
+
}
|
|
1290
|
+
height(e) {
|
|
1291
|
+
const t = { [this.breakpoint]: e }, i = u("height", t);
|
|
1292
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1293
|
+
}
|
|
1294
|
+
minWidth(e) {
|
|
1295
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1296
|
+
"minWidth",
|
|
1297
|
+
t
|
|
1298
|
+
);
|
|
1299
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1300
|
+
}
|
|
1301
|
+
maxWidth(e) {
|
|
1302
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1303
|
+
"maxWidth",
|
|
1304
|
+
t
|
|
1305
|
+
);
|
|
1306
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1307
|
+
}
|
|
1308
|
+
minHeight(e) {
|
|
1309
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1310
|
+
"minHeight",
|
|
1311
|
+
t
|
|
1312
|
+
);
|
|
1313
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1314
|
+
}
|
|
1315
|
+
maxHeight(e) {
|
|
1316
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1317
|
+
"maxHeight",
|
|
1318
|
+
t
|
|
1319
|
+
);
|
|
1320
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1321
|
+
}
|
|
1322
|
+
padding(e) {
|
|
1323
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1324
|
+
"padding",
|
|
1325
|
+
t
|
|
1326
|
+
);
|
|
1327
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1328
|
+
}
|
|
1329
|
+
paddingHorizontal(e) {
|
|
1330
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1331
|
+
"paddingLeft",
|
|
1332
|
+
t
|
|
1333
|
+
), r = u(
|
|
1334
|
+
"paddingRight",
|
|
1335
|
+
t
|
|
1336
|
+
);
|
|
1337
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
|
|
1338
|
+
}
|
|
1339
|
+
paddingVertical(e) {
|
|
1340
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1341
|
+
"paddingTop",
|
|
1342
|
+
t
|
|
1343
|
+
), r = u(
|
|
1344
|
+
"paddingBottom",
|
|
1345
|
+
t
|
|
1346
|
+
);
|
|
1347
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
|
|
1348
|
+
}
|
|
1349
|
+
paddingTop(e) {
|
|
1350
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1351
|
+
"paddingTop",
|
|
1352
|
+
t
|
|
1353
|
+
);
|
|
1354
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1355
|
+
}
|
|
1356
|
+
paddingBottom(e) {
|
|
1357
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1358
|
+
"paddingBottom",
|
|
1359
|
+
t
|
|
1360
|
+
);
|
|
1361
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1362
|
+
}
|
|
1363
|
+
paddingLeft(e) {
|
|
1364
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1365
|
+
"paddingLeft",
|
|
1366
|
+
t
|
|
1367
|
+
);
|
|
1368
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1369
|
+
}
|
|
1370
|
+
paddingRight(e) {
|
|
1371
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1372
|
+
"paddingRight",
|
|
1373
|
+
t
|
|
1374
|
+
);
|
|
1375
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1376
|
+
}
|
|
1377
|
+
margin(e) {
|
|
1378
|
+
const t = { [this.breakpoint]: e }, i = u("margin", t);
|
|
1379
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1380
|
+
}
|
|
1381
|
+
marginHorizontal(e) {
|
|
1382
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1383
|
+
"marginLeft",
|
|
1384
|
+
t
|
|
1385
|
+
), r = u(
|
|
1386
|
+
"marginRight",
|
|
1387
|
+
t
|
|
1388
|
+
);
|
|
1389
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
|
|
1390
|
+
}
|
|
1391
|
+
marginVertical(e) {
|
|
1392
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1393
|
+
"marginTop",
|
|
1394
|
+
t
|
|
1395
|
+
), r = u(
|
|
1396
|
+
"marginBottom",
|
|
1397
|
+
t
|
|
1398
|
+
);
|
|
1399
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
|
|
1400
|
+
}
|
|
1401
|
+
marginTop(e) {
|
|
1402
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1403
|
+
"marginTop",
|
|
1404
|
+
t
|
|
1405
|
+
);
|
|
1406
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1407
|
+
}
|
|
1408
|
+
marginBottom(e) {
|
|
1409
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1410
|
+
"marginBottom",
|
|
1411
|
+
t
|
|
1412
|
+
);
|
|
1413
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1414
|
+
}
|
|
1415
|
+
marginLeft(e) {
|
|
1416
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1417
|
+
"marginLeft",
|
|
1418
|
+
t
|
|
1419
|
+
);
|
|
1420
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1421
|
+
}
|
|
1422
|
+
marginRight(e) {
|
|
1423
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1424
|
+
"marginRight",
|
|
1425
|
+
t
|
|
1426
|
+
);
|
|
1427
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1428
|
+
}
|
|
1429
|
+
// Typography properties
|
|
1430
|
+
fontSize(e) {
|
|
1431
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1432
|
+
"fontSize",
|
|
1433
|
+
t
|
|
1434
|
+
);
|
|
1435
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1436
|
+
}
|
|
1437
|
+
textAlign(e) {
|
|
1438
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1439
|
+
"textAlign",
|
|
1440
|
+
t
|
|
1441
|
+
);
|
|
1442
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1443
|
+
}
|
|
1444
|
+
// Display properties
|
|
1445
|
+
display(e) {
|
|
1446
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1447
|
+
"display",
|
|
1448
|
+
t
|
|
1449
|
+
);
|
|
1450
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1451
|
+
}
|
|
1452
|
+
// Flexbox properties
|
|
1453
|
+
flexDirection(e) {
|
|
1454
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1455
|
+
"flexDirection",
|
|
1456
|
+
t
|
|
1457
|
+
);
|
|
1458
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1459
|
+
}
|
|
1460
|
+
justifyContent(e) {
|
|
1461
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1462
|
+
"justifyContent",
|
|
1463
|
+
t
|
|
1464
|
+
);
|
|
1465
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1466
|
+
}
|
|
1467
|
+
alignItems(e) {
|
|
1468
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1469
|
+
"alignItems",
|
|
1470
|
+
t
|
|
1471
|
+
);
|
|
1472
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1473
|
+
}
|
|
1474
|
+
// Visual properties
|
|
1475
|
+
backgroundColor(e) {
|
|
1476
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1477
|
+
"backgroundColor",
|
|
1478
|
+
t
|
|
1479
|
+
);
|
|
1480
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1481
|
+
}
|
|
1482
|
+
color(e) {
|
|
1483
|
+
const t = { [this.breakpoint]: e }, i = u("color", t);
|
|
1484
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1485
|
+
}
|
|
1486
|
+
opacity(e) {
|
|
1487
|
+
const t = { [this.breakpoint]: e }, i = u(
|
|
1488
|
+
"opacity",
|
|
1489
|
+
t
|
|
1490
|
+
);
|
|
1491
|
+
return this.parentBuilder.addModifier(i), this.parentBuilder;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function mt(s) {
|
|
1495
|
+
return new he(s);
|
|
1496
|
+
}
|
|
1497
|
+
function gt(s) {
|
|
1498
|
+
return new he(s);
|
|
1499
|
+
}
|
|
1500
|
+
function bt() {
|
|
1501
|
+
const s = x(), e = m(() => S());
|
|
1502
|
+
return {
|
|
1503
|
+
current: s,
|
|
1504
|
+
context: e,
|
|
1505
|
+
isAbove: (n) => m(
|
|
1506
|
+
() => y(s()) > y(n)
|
|
1507
|
+
),
|
|
1508
|
+
isBelow: (n) => m(
|
|
1509
|
+
() => y(s()) < y(n)
|
|
1510
|
+
),
|
|
1511
|
+
isBetween: (n, a) => m(() => {
|
|
1512
|
+
const c = y(s()), d = y(n), l = y(a);
|
|
1513
|
+
return c >= d && c <= l;
|
|
1514
|
+
}),
|
|
1515
|
+
matches: (n) => {
|
|
1516
|
+
const [a, c] = E(!1);
|
|
1517
|
+
if (typeof window < "u") {
|
|
1518
|
+
const d = window.matchMedia(n);
|
|
1519
|
+
c(d.matches);
|
|
1520
|
+
const l = (p) => c(p.matches);
|
|
1521
|
+
d.addEventListener("change", l);
|
|
1522
|
+
}
|
|
1523
|
+
return a;
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
function vt(s) {
|
|
1528
|
+
const [e, t] = E(!1);
|
|
1529
|
+
if (typeof window < "u") {
|
|
1530
|
+
const i = window.matchMedia(s);
|
|
1531
|
+
t(i.matches);
|
|
1532
|
+
const r = (o) => t(o.matches);
|
|
1533
|
+
i.addEventListener("change", r);
|
|
1534
|
+
}
|
|
1535
|
+
return e;
|
|
1536
|
+
}
|
|
1537
|
+
function yt(s) {
|
|
1538
|
+
const e = x();
|
|
1539
|
+
return m(() => {
|
|
1540
|
+
if (!w(s))
|
|
1541
|
+
return s;
|
|
1542
|
+
const t = e(), i = s, r = [
|
|
1543
|
+
"base",
|
|
1544
|
+
"sm",
|
|
1545
|
+
"md",
|
|
1546
|
+
"lg",
|
|
1547
|
+
"xl",
|
|
1548
|
+
"2xl"
|
|
1549
|
+
], o = r.indexOf(t);
|
|
1550
|
+
for (let n = o; n >= 0; n--) {
|
|
1551
|
+
const a = r[n];
|
|
1552
|
+
if (i[a] !== void 0)
|
|
1553
|
+
return i[a];
|
|
1554
|
+
}
|
|
1555
|
+
for (const n of r)
|
|
1556
|
+
if (i[n] !== void 0)
|
|
1557
|
+
return i[n];
|
|
1558
|
+
throw new Error("No responsive value found for any breakpoint");
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
function xt(s, e) {
|
|
1562
|
+
if (!w(s))
|
|
1563
|
+
return s;
|
|
1564
|
+
const t = s, i = e || x()(), r = [
|
|
1565
|
+
"base",
|
|
1566
|
+
"sm",
|
|
1567
|
+
"md",
|
|
1568
|
+
"lg",
|
|
1569
|
+
"xl",
|
|
1570
|
+
"2xl"
|
|
1571
|
+
], o = r.indexOf(i);
|
|
1572
|
+
for (let n = o; n >= 0; n--) {
|
|
1573
|
+
const a = r[n];
|
|
1574
|
+
if (t[a] !== void 0)
|
|
1575
|
+
return t[a];
|
|
1576
|
+
}
|
|
1577
|
+
for (const n of r)
|
|
1578
|
+
if (t[n] !== void 0)
|
|
1579
|
+
return t[n];
|
|
1580
|
+
throw new Error("No responsive value found for any breakpoint");
|
|
1581
|
+
}
|
|
1582
|
+
function wt(s, e) {
|
|
1583
|
+
const t = {};
|
|
1584
|
+
for (const [i, r] of Object.entries(e))
|
|
1585
|
+
if (w(r)) {
|
|
1586
|
+
const o = r;
|
|
1587
|
+
for (const [n, a] of Object.entries(o))
|
|
1588
|
+
if (a !== void 0) {
|
|
1589
|
+
const c = n === "base" ? `--${s}-${i}` : `--${s}-${i}-${n}`;
|
|
1590
|
+
t[c] = a.toString();
|
|
1591
|
+
}
|
|
1592
|
+
} else
|
|
1593
|
+
t[`--${s}-${i}`] = r.toString();
|
|
1594
|
+
return t;
|
|
1595
|
+
}
|
|
1596
|
+
const g = {
|
|
1597
|
+
// Viewport size queries
|
|
1598
|
+
mobile: "(max-width: 767px)",
|
|
1599
|
+
tablet: "(min-width: 768px) and (max-width: 1023px)",
|
|
1600
|
+
desktop: "(min-width: 1024px)",
|
|
1601
|
+
// Device orientation
|
|
1602
|
+
landscape: "(orientation: landscape)",
|
|
1603
|
+
portrait: "(orientation: portrait)",
|
|
1604
|
+
// Device pixel density
|
|
1605
|
+
highDPI: "(min-resolution: 2dppx)",
|
|
1606
|
+
lowDPI: "(max-resolution: 1dppx)",
|
|
1607
|
+
retinaDisplay: "(min-resolution: 2dppx)",
|
|
1608
|
+
standardDisplay: "(max-resolution: 1.9dppx)",
|
|
1609
|
+
// Color scheme preference
|
|
1610
|
+
darkMode: "(prefers-color-scheme: dark)",
|
|
1611
|
+
lightMode: "(prefers-color-scheme: light)",
|
|
1612
|
+
noColorSchemePreference: "(prefers-color-scheme: no-preference)",
|
|
1613
|
+
// Reduced motion preference
|
|
1614
|
+
reducedMotion: "(prefers-reduced-motion: reduce)",
|
|
1615
|
+
allowMotion: "(prefers-reduced-motion: no-preference)",
|
|
1616
|
+
// Contrast preference (accessibility)
|
|
1617
|
+
highContrast: "(prefers-contrast: high)",
|
|
1618
|
+
lowContrast: "(prefers-contrast: low)",
|
|
1619
|
+
normalContrast: "(prefers-contrast: no-preference)",
|
|
1620
|
+
// Data usage preference
|
|
1621
|
+
reduceData: "(prefers-reduced-data: reduce)",
|
|
1622
|
+
allowData: "(prefers-reduced-data: no-preference)",
|
|
1623
|
+
// Transparency preference
|
|
1624
|
+
reduceTransparency: "(prefers-reduced-transparency: reduce)",
|
|
1625
|
+
allowTransparency: "(prefers-reduced-transparency: no-preference)",
|
|
1626
|
+
// Hover capability
|
|
1627
|
+
canHover: "(hover: hover)",
|
|
1628
|
+
noHover: "(hover: none)",
|
|
1629
|
+
// Pointer capability
|
|
1630
|
+
finePointer: "(pointer: fine)",
|
|
1631
|
+
// Mouse, trackpad
|
|
1632
|
+
coarsePointer: "(pointer: coarse)",
|
|
1633
|
+
// Touch
|
|
1634
|
+
// Any-hover (any input can hover)
|
|
1635
|
+
anyCanHover: "(any-hover: hover)",
|
|
1636
|
+
anyNoHover: "(any-hover: none)",
|
|
1637
|
+
// Any-pointer (any input type)
|
|
1638
|
+
anyFinePointer: "(any-pointer: fine)",
|
|
1639
|
+
anyCoarsePointer: "(any-pointer: coarse)",
|
|
1640
|
+
// Update preference
|
|
1641
|
+
slowUpdate: "(update: slow)",
|
|
1642
|
+
// E-ink displays
|
|
1643
|
+
fastUpdate: "(update: fast)",
|
|
1644
|
+
// Standard displays
|
|
1645
|
+
// Overflow-block capability
|
|
1646
|
+
blockScrolling: "(overflow-block: scroll)",
|
|
1647
|
+
blockPaged: "(overflow-block: paged)",
|
|
1648
|
+
// Overflow-inline capability
|
|
1649
|
+
inlineScrolling: "(overflow-inline: scroll)",
|
|
1650
|
+
// Forced colors (high contrast mode)
|
|
1651
|
+
forcedColors: "(forced-colors: active)",
|
|
1652
|
+
normalColors: "(forced-colors: none)",
|
|
1653
|
+
// Inverted colors
|
|
1654
|
+
invertedColors: "(inverted-colors: inverted)",
|
|
1655
|
+
normalInvertedColors: "(inverted-colors: none)",
|
|
1656
|
+
// Scripting capability
|
|
1657
|
+
scriptingEnabled: "(scripting: enabled)",
|
|
1658
|
+
scriptingDisabled: "(scripting: none)",
|
|
1659
|
+
scriptingInitialOnly: "(scripting: initial-only)",
|
|
1660
|
+
// Container queries (future)
|
|
1661
|
+
containerSmall: "(max-width: 400px)",
|
|
1662
|
+
containerMedium: "(min-width: 401px) and (max-width: 800px)",
|
|
1663
|
+
containerLarge: "(min-width: 801px)",
|
|
1664
|
+
// Custom breakpoint builders
|
|
1665
|
+
minWidth: (s) => `(min-width: ${s}${typeof s == "number" ? "px" : ""})`,
|
|
1666
|
+
maxWidth: (s) => `(max-width: ${s}${typeof s == "number" ? "px" : ""})`,
|
|
1667
|
+
between: (s, e) => `(min-width: ${s}${typeof s == "number" ? "px" : ""}) and (max-width: ${e}${typeof e == "number" ? "px" : ""})`,
|
|
1668
|
+
// Height-based queries
|
|
1669
|
+
minHeight: (s) => `(min-height: ${s}${typeof s == "number" ? "px" : ""})`,
|
|
1670
|
+
maxHeight: (s) => `(max-height: ${s}${typeof s == "number" ? "px" : ""})`,
|
|
1671
|
+
heightBetween: (s, e) => `(min-height: ${s}${typeof s == "number" ? "px" : ""}) and (max-height: ${e}${typeof e == "number" ? "px" : ""})`,
|
|
1672
|
+
// Aspect ratio queries
|
|
1673
|
+
square: "(aspect-ratio: 1/1)",
|
|
1674
|
+
landscape16_9: "(aspect-ratio: 16/9)",
|
|
1675
|
+
portrait9_16: "(aspect-ratio: 9/16)",
|
|
1676
|
+
widescreen: "(min-aspect-ratio: 16/9)",
|
|
1677
|
+
tallscreen: "(max-aspect-ratio: 9/16)",
|
|
1678
|
+
customAspectRatio: (s) => `(aspect-ratio: ${s})`,
|
|
1679
|
+
minAspectRatio: (s) => `(min-aspect-ratio: ${s})`,
|
|
1680
|
+
maxAspectRatio: (s) => `(max-aspect-ratio: ${s})`,
|
|
1681
|
+
// Resolution queries
|
|
1682
|
+
lowRes: "(max-resolution: 120dpi)",
|
|
1683
|
+
standardRes: "(min-resolution: 120dpi) and (max-resolution: 192dpi)",
|
|
1684
|
+
highRes: "(min-resolution: 192dpi)",
|
|
1685
|
+
customResolution: (s) => `(min-resolution: ${s}dpi)`,
|
|
1686
|
+
// Print media
|
|
1687
|
+
print: "print",
|
|
1688
|
+
screen: "screen",
|
|
1689
|
+
speech: "speech",
|
|
1690
|
+
// Device-specific queries (common patterns)
|
|
1691
|
+
iPhone: "(max-width: 428px)",
|
|
1692
|
+
iPad: "(min-width: 768px) and (max-width: 1024px)",
|
|
1693
|
+
desktopSmall: "(min-width: 1024px) and (max-width: 1440px)",
|
|
1694
|
+
desktopLarge: "(min-width: 1440px)",
|
|
1695
|
+
// Special conditions
|
|
1696
|
+
touchDevice: "(pointer: coarse)",
|
|
1697
|
+
mouseDevice: "(pointer: fine)",
|
|
1698
|
+
keyboardNavigation: "(hover: none) and (pointer: coarse)",
|
|
1699
|
+
// Modern display features
|
|
1700
|
+
wideColorGamut: "(color-gamut: p3)",
|
|
1701
|
+
standardColorGamut: "(color-gamut: srgb)",
|
|
1702
|
+
hdr: "(dynamic-range: high)",
|
|
1703
|
+
sdr: "(dynamic-range: standard)"
|
|
1704
|
+
};
|
|
1705
|
+
function St(...s) {
|
|
1706
|
+
return s.filter((e) => e).join(" and ");
|
|
1707
|
+
}
|
|
1708
|
+
function Ct(...s) {
|
|
1709
|
+
return s.filter((e) => e).join(", ");
|
|
1710
|
+
}
|
|
1711
|
+
function $t(s) {
|
|
1712
|
+
const e = x();
|
|
1713
|
+
return m(() => {
|
|
1714
|
+
const t = e();
|
|
1715
|
+
return !(s.hideOn && s.hideOn.includes(t) || s.showOn && !s.showOn.includes(t));
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
function We() {
|
|
1719
|
+
if (typeof window > "u") return;
|
|
1720
|
+
const s = S();
|
|
1721
|
+
console.group("🔍 tachUI Responsive State"), console.log("Current breakpoint:", s.current), console.log("Viewport dimensions:", `${s.width}x${s.height}`), console.log("Available breakpoints:", ["base", "sm", "md", "lg", "xl", "2xl"]);
|
|
1722
|
+
const e = {
|
|
1723
|
+
Mobile: g.mobile,
|
|
1724
|
+
Tablet: g.tablet,
|
|
1725
|
+
Desktop: g.desktop,
|
|
1726
|
+
"Dark mode": g.darkMode,
|
|
1727
|
+
"Reduced motion": g.reducedMotion,
|
|
1728
|
+
"Can hover": g.canHover
|
|
1729
|
+
};
|
|
1730
|
+
console.log("Media query matches:");
|
|
1731
|
+
for (const [t, i] of Object.entries(e))
|
|
1732
|
+
console.log(` ${t}: ${window.matchMedia(i).matches}`);
|
|
1733
|
+
console.groupEnd();
|
|
1734
|
+
}
|
|
1735
|
+
function Bt(s = {}) {
|
|
1736
|
+
if (typeof window > "u" || process.env.NODE_ENV === "production")
|
|
1737
|
+
return;
|
|
1738
|
+
const {
|
|
1739
|
+
position: e = "top-right",
|
|
1740
|
+
showDimensions: t = !0,
|
|
1741
|
+
showBreakpoint: i = !0
|
|
1742
|
+
} = s, r = document.createElement("div");
|
|
1743
|
+
r.id = "tachui-responsive-debug", r.style.cssText = `
|
|
1744
|
+
position: fixed;
|
|
1745
|
+
${e.includes("top") ? "top: 10px" : "bottom: 10px"};
|
|
1746
|
+
${e.includes("right") ? "right: 10px" : "left: 10px"};
|
|
1747
|
+
background: rgba(0, 0, 0, 0.8);
|
|
1748
|
+
color: white;
|
|
1749
|
+
padding: 8px 12px;
|
|
1750
|
+
border-radius: 4px;
|
|
1751
|
+
font-family: monospace;
|
|
1752
|
+
font-size: 12px;
|
|
1753
|
+
z-index: 9999;
|
|
1754
|
+
pointer-events: none;
|
|
1755
|
+
white-space: pre-line;
|
|
1756
|
+
`, document.body.appendChild(r);
|
|
1757
|
+
function o() {
|
|
1758
|
+
const n = S();
|
|
1759
|
+
let a = "";
|
|
1760
|
+
i && (a += `Breakpoint: ${n.current}`), t && (a && (a += `
|
|
1761
|
+
`), a += `Size: ${n.width}×${n.height}`), r.textContent = a;
|
|
1762
|
+
}
|
|
1763
|
+
o(), window.addEventListener("resize", o), We();
|
|
1764
|
+
}
|
|
1765
|
+
class Fe {
|
|
1766
|
+
/**
|
|
1767
|
+
* Create a responsive grid with automatic column sizing
|
|
1768
|
+
*/
|
|
1769
|
+
static autoFit(e) {
|
|
1770
|
+
const t = {};
|
|
1771
|
+
if (typeof e.minColumnWidth == "object") {
|
|
1772
|
+
t.gridTemplateColumns = {};
|
|
1773
|
+
for (const [i, r] of Object.entries(e.minColumnWidth)) {
|
|
1774
|
+
const o = typeof r == "number" ? `${r}px` : r, n = e.maxColumns && typeof e.maxColumns == "object" ? e.maxColumns[i] || "auto" : e.maxColumns || "auto";
|
|
1775
|
+
t.gridTemplateColumns[i] = n === "auto" ? `repeat(auto-fit, minmax(${o}, 1fr))` : `repeat(${n}, minmax(${o}, 1fr))`;
|
|
1776
|
+
}
|
|
1777
|
+
} else {
|
|
1778
|
+
const i = typeof e.minColumnWidth == "number" ? `${e.minColumnWidth}px` : e.minColumnWidth, r = e.maxColumns || "auto";
|
|
1779
|
+
t.gridTemplateColumns = r === "auto" ? `repeat(auto-fit, minmax(${i}, 1fr))` : `repeat(${r}, minmax(${i}, 1fr))`;
|
|
1780
|
+
}
|
|
1781
|
+
return e.gap && (t.gap = e.gap), t.display = "grid", h(t);
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Create a responsive grid with explicit column counts
|
|
1785
|
+
*/
|
|
1786
|
+
static columns(e, t) {
|
|
1787
|
+
const i = {
|
|
1788
|
+
display: "grid",
|
|
1789
|
+
gridTemplateColumns: typeof e == "object" ? Object.fromEntries(
|
|
1790
|
+
Object.entries(e).map(([r, o]) => [
|
|
1791
|
+
r,
|
|
1792
|
+
`repeat(${o}, 1fr)`
|
|
1793
|
+
])
|
|
1794
|
+
) : `repeat(${e}, 1fr)`
|
|
1795
|
+
};
|
|
1796
|
+
return t?.gap && (i.gap = t.gap), t?.rowGap && (i.rowGap = t.rowGap), t?.autoRows && (i.gridAutoRows = t.autoRows), h(i);
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Create responsive masonry-style grid
|
|
1800
|
+
*/
|
|
1801
|
+
static masonry(e) {
|
|
1802
|
+
const t = {
|
|
1803
|
+
display: "grid",
|
|
1804
|
+
gridTemplateColumns: typeof e.columns == "object" ? Object.fromEntries(
|
|
1805
|
+
Object.entries(e.columns).map(([i, r]) => [
|
|
1806
|
+
i,
|
|
1807
|
+
`repeat(${r}, 1fr)`
|
|
1808
|
+
])
|
|
1809
|
+
) : `repeat(${e.columns}, 1fr)`,
|
|
1810
|
+
gridAutoRows: "max-content"
|
|
1811
|
+
};
|
|
1812
|
+
return e.gap && (t.gap = e.gap), h(t);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
class kt {
|
|
1816
|
+
/**
|
|
1817
|
+
* Create a responsive flex container that stacks on mobile, flows horizontally on desktop
|
|
1818
|
+
*/
|
|
1819
|
+
static stackToRow(e) {
|
|
1820
|
+
const i = {
|
|
1821
|
+
display: "flex",
|
|
1822
|
+
flexDirection: {
|
|
1823
|
+
base: "column",
|
|
1824
|
+
[e?.stackBreakpoint || "md"]: "row"
|
|
1825
|
+
}
|
|
1826
|
+
};
|
|
1827
|
+
return e?.gap && (i.gap = e.gap), e?.align && (i.alignItems = e.align), e?.justify && (i.justifyContent = e.justify), h(i);
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Create a responsive flex container with wrapping behavior
|
|
1831
|
+
*/
|
|
1832
|
+
static wrap(e) {
|
|
1833
|
+
const t = {
|
|
1834
|
+
display: "flex",
|
|
1835
|
+
flexWrap: "wrap",
|
|
1836
|
+
...e
|
|
1837
|
+
};
|
|
1838
|
+
return h(t);
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Create centered flex layout
|
|
1842
|
+
*/
|
|
1843
|
+
static center(e = "row") {
|
|
1844
|
+
return h({
|
|
1845
|
+
display: "flex",
|
|
1846
|
+
flexDirection: e,
|
|
1847
|
+
justifyContent: "center",
|
|
1848
|
+
alignItems: "center"
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Create space-between flex layout
|
|
1853
|
+
*/
|
|
1854
|
+
static spaceBetween(e = "row") {
|
|
1855
|
+
return h({
|
|
1856
|
+
display: "flex",
|
|
1857
|
+
flexDirection: e,
|
|
1858
|
+
justifyContent: "space-between",
|
|
1859
|
+
alignItems: "center"
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
class Rt {
|
|
1864
|
+
/**
|
|
1865
|
+
* Create a responsive container with max-width constraints
|
|
1866
|
+
*/
|
|
1867
|
+
static container(e) {
|
|
1868
|
+
const t = {
|
|
1869
|
+
width: "100%",
|
|
1870
|
+
marginLeft: "auto",
|
|
1871
|
+
marginRight: "auto"
|
|
1872
|
+
};
|
|
1873
|
+
return e?.maxWidth ? t.maxWidth = e.maxWidth : t.maxWidth = {
|
|
1874
|
+
sm: "640px",
|
|
1875
|
+
md: "768px",
|
|
1876
|
+
lg: "1024px",
|
|
1877
|
+
xl: "1280px",
|
|
1878
|
+
"2xl": "1536px"
|
|
1879
|
+
}, e?.padding && (t.paddingLeft = e.padding, t.paddingRight = e.padding), e?.margin && (t.marginTop = e.margin, t.marginBottom = e.margin), h(t);
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Create a full-width container that breaks out of constraints
|
|
1883
|
+
*/
|
|
1884
|
+
static fullWidth() {
|
|
1885
|
+
return h({
|
|
1886
|
+
width: "100vw",
|
|
1887
|
+
marginLeft: "calc(-50vw + 50%)",
|
|
1888
|
+
marginRight: "calc(-50vw + 50%)"
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Create a section container with responsive padding
|
|
1893
|
+
*/
|
|
1894
|
+
static section(e) {
|
|
1895
|
+
const t = {};
|
|
1896
|
+
return e?.paddingY && (t.paddingTop = e.paddingY, t.paddingBottom = e.paddingY), e?.paddingX && (t.paddingLeft = e.paddingX, t.paddingRight = e.paddingX), e?.maxWidth && (t.maxWidth = e.maxWidth, t.marginLeft = "auto", t.marginRight = "auto"), h(t);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
class Mt {
|
|
1900
|
+
/**
|
|
1901
|
+
* Show element only on specific breakpoints
|
|
1902
|
+
*/
|
|
1903
|
+
static showOn(e) {
|
|
1904
|
+
const t = {
|
|
1905
|
+
display: {}
|
|
1906
|
+
// Start with empty object
|
|
1907
|
+
};
|
|
1908
|
+
for (const i of e)
|
|
1909
|
+
t.display[i] = "block";
|
|
1910
|
+
return h(t);
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Hide element only on specific breakpoints
|
|
1914
|
+
*/
|
|
1915
|
+
static hideOn(e) {
|
|
1916
|
+
const t = {
|
|
1917
|
+
display: {}
|
|
1918
|
+
// Start with empty object
|
|
1919
|
+
};
|
|
1920
|
+
for (const i of e)
|
|
1921
|
+
t.display[i] = "none";
|
|
1922
|
+
return h(t);
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* Show on mobile, hide on desktop
|
|
1926
|
+
*/
|
|
1927
|
+
static mobileOnly() {
|
|
1928
|
+
return h({
|
|
1929
|
+
display: {
|
|
1930
|
+
base: "block",
|
|
1931
|
+
md: "none"
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Hide on mobile, show on desktop
|
|
1937
|
+
*/
|
|
1938
|
+
static desktopOnly() {
|
|
1939
|
+
return h({
|
|
1940
|
+
display: {
|
|
1941
|
+
base: "none",
|
|
1942
|
+
md: "block"
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Show only on tablet breakpoint
|
|
1948
|
+
*/
|
|
1949
|
+
static tabletOnly() {
|
|
1950
|
+
return h({
|
|
1951
|
+
display: {
|
|
1952
|
+
base: "none",
|
|
1953
|
+
md: "block",
|
|
1954
|
+
lg: "none"
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
class Ot {
|
|
1960
|
+
/**
|
|
1961
|
+
* Create responsive padding
|
|
1962
|
+
*/
|
|
1963
|
+
static padding(e) {
|
|
1964
|
+
const t = {};
|
|
1965
|
+
return e.all && (t.padding = e.all), e.horizontal && (t.paddingLeft = e.horizontal, t.paddingRight = e.horizontal), e.vertical && (t.paddingTop = e.vertical, t.paddingBottom = e.vertical), e.top && (t.paddingTop = e.top), e.right && (t.paddingRight = e.right), e.bottom && (t.paddingBottom = e.bottom), e.left && (t.paddingLeft = e.left), h(t);
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Create responsive margin
|
|
1969
|
+
*/
|
|
1970
|
+
static margin(e) {
|
|
1971
|
+
const t = {};
|
|
1972
|
+
return e.all && (t.margin = e.all), e.horizontal && (t.marginLeft = e.horizontal, t.marginRight = e.horizontal), e.vertical && (t.marginTop = e.vertical, t.marginBottom = e.vertical), e.top && (t.marginTop = e.top), e.right && (t.marginRight = e.right), e.bottom && (t.marginBottom = e.bottom), e.left && (t.marginLeft = e.left), h(t);
|
|
1973
|
+
}
|
|
1974
|
+
/**
|
|
1975
|
+
* Create responsive gap (for flexbox and grid)
|
|
1976
|
+
*/
|
|
1977
|
+
static gap(e) {
|
|
1978
|
+
const t = {};
|
|
1979
|
+
return e.all && (t.gap = e.all), e.column && (t.columnGap = e.column), e.row && (t.rowGap = e.row), h(t);
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
class Vt {
|
|
1983
|
+
/**
|
|
1984
|
+
* Create responsive font scale
|
|
1985
|
+
*/
|
|
1986
|
+
static scale(e) {
|
|
1987
|
+
const t = {
|
|
1988
|
+
fontSize: e.base
|
|
1989
|
+
};
|
|
1990
|
+
if (e.scale && typeof e.scale == "object") {
|
|
1991
|
+
t.fontSize = {};
|
|
1992
|
+
for (const [i, r] of Object.entries(e.scale)) {
|
|
1993
|
+
const o = typeof e.base == "number" ? e.base : parseFloat(e.base);
|
|
1994
|
+
t.fontSize[i] = `${o * r}px`;
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
return e.lineHeight && (t.lineHeight = e.lineHeight), h(t);
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Create fluid typography that scales smoothly
|
|
2001
|
+
*/
|
|
2002
|
+
static fluid(e) {
|
|
2003
|
+
const t = e.minBreakpoint || "320px", i = e.maxBreakpoint || "1200px", r = typeof e.minSize == "number" ? `${e.minSize}px` : e.minSize, o = typeof e.maxSize == "number" ? `${e.maxSize}px` : e.maxSize;
|
|
2004
|
+
return h({
|
|
2005
|
+
fontSize: `clamp(${r}, calc(${r} + (${o} - ${r}) * ((100vw - ${t}) / (${i} - ${t}))), ${o})`
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
const Et = {
|
|
2010
|
+
/**
|
|
2011
|
+
* Sidebar layout that collapses on mobile
|
|
2012
|
+
*/
|
|
2013
|
+
sidebar: (s) => {
|
|
2014
|
+
const e = s?.collapseBreakpoint || "md", t = s?.sidebarWidth || "250px";
|
|
2015
|
+
return h({
|
|
2016
|
+
display: "grid",
|
|
2017
|
+
gridTemplateColumns: {
|
|
2018
|
+
base: "1fr",
|
|
2019
|
+
[e]: `${t} 1fr`
|
|
2020
|
+
},
|
|
2021
|
+
gap: s?.gap || "1rem"
|
|
2022
|
+
});
|
|
2023
|
+
},
|
|
2024
|
+
/**
|
|
2025
|
+
* Holy grail layout (header, footer, sidebar, main content)
|
|
2026
|
+
*/
|
|
2027
|
+
holyGrail: (s) => {
|
|
2028
|
+
const e = s?.collapseBreakpoint || "lg";
|
|
2029
|
+
return h({
|
|
2030
|
+
display: "grid",
|
|
2031
|
+
gridTemplateAreas: {
|
|
2032
|
+
base: '"header" "main" "footer"',
|
|
2033
|
+
[e]: '"header header" "sidebar main" "footer footer"'
|
|
2034
|
+
},
|
|
2035
|
+
gridTemplateRows: {
|
|
2036
|
+
base: `${s?.headerHeight || "auto"} 1fr ${s?.footerHeight || "auto"}`,
|
|
2037
|
+
[e]: `${s?.headerHeight || "auto"} 1fr ${s?.footerHeight || "auto"}`
|
|
2038
|
+
},
|
|
2039
|
+
gridTemplateColumns: {
|
|
2040
|
+
base: "1fr",
|
|
2041
|
+
[e]: `${s?.sidebarWidth || "250px"} 1fr`
|
|
2042
|
+
},
|
|
2043
|
+
minHeight: "100vh"
|
|
2044
|
+
});
|
|
2045
|
+
},
|
|
2046
|
+
/**
|
|
2047
|
+
* Card grid layout
|
|
2048
|
+
*/
|
|
2049
|
+
cardGrid: (s) => Fe.autoFit({
|
|
2050
|
+
minColumnWidth: s?.minCardWidth || "300px",
|
|
2051
|
+
gap: s?.gap || "1rem",
|
|
2052
|
+
maxColumns: s?.maxColumns
|
|
2053
|
+
}),
|
|
2054
|
+
/**
|
|
2055
|
+
* Hero section layout
|
|
2056
|
+
*/
|
|
2057
|
+
hero: (s) => h({
|
|
2058
|
+
display: "flex",
|
|
2059
|
+
flexDirection: "column",
|
|
2060
|
+
justifyContent: "center",
|
|
2061
|
+
alignItems: "center",
|
|
2062
|
+
textAlign: s?.textAlign || "center",
|
|
2063
|
+
minHeight: s?.minHeight || "50vh",
|
|
2064
|
+
padding: s?.padding || "2rem"
|
|
2065
|
+
})
|
|
2066
|
+
};
|
|
2067
|
+
class B {
|
|
2068
|
+
/**
|
|
2069
|
+
* Create a responsive value resolver with custom logic
|
|
2070
|
+
*/
|
|
2071
|
+
static createResponsiveResolver(e, t = []) {
|
|
2072
|
+
const i = x();
|
|
2073
|
+
return m(() => {
|
|
2074
|
+
t.forEach((n) => n());
|
|
2075
|
+
const r = i(), o = S();
|
|
2076
|
+
return e(r, o);
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Create responsive value that interpolates between breakpoints
|
|
2081
|
+
*/
|
|
2082
|
+
static createInterpolatedValue(e, t = {}) {
|
|
2083
|
+
const { smoothing: i = "linear", clamp: r = !0 } = t;
|
|
2084
|
+
return m(() => {
|
|
2085
|
+
const n = S().width, a = P(), c = [];
|
|
2086
|
+
for (const [v, C] of Object.entries(e))
|
|
2087
|
+
if (C !== void 0) {
|
|
2088
|
+
const k = v === "base" ? 0 : parseInt(a[v] || "0");
|
|
2089
|
+
c.push({ width: k, value: C });
|
|
2090
|
+
}
|
|
2091
|
+
if (c.sort((v, C) => v.width - C.width), c.length === 0) return 0;
|
|
2092
|
+
if (c.length === 1) return c[0].value;
|
|
2093
|
+
let d = c[0], l = c[c.length - 1];
|
|
2094
|
+
for (let v = 0; v < c.length - 1; v++)
|
|
2095
|
+
if (n >= c[v].width && n <= c[v + 1].width) {
|
|
2096
|
+
d = c[v], l = c[v + 1];
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
if (r) {
|
|
2100
|
+
if (n <= d.width) return d.value;
|
|
2101
|
+
if (n >= l.width) return l.value;
|
|
2102
|
+
}
|
|
2103
|
+
const p = (n - d.width) / (l.width - d.width);
|
|
2104
|
+
let f = p;
|
|
2105
|
+
switch (i) {
|
|
2106
|
+
case "ease":
|
|
2107
|
+
f = 0.5 - 0.5 * Math.cos(p * Math.PI);
|
|
2108
|
+
break;
|
|
2109
|
+
case "ease-in":
|
|
2110
|
+
f = p * p;
|
|
2111
|
+
break;
|
|
2112
|
+
case "ease-out":
|
|
2113
|
+
f = 1 - (1 - p) * (1 - p);
|
|
2114
|
+
break;
|
|
2115
|
+
case "linear":
|
|
2116
|
+
default:
|
|
2117
|
+
f = p;
|
|
2118
|
+
break;
|
|
2119
|
+
}
|
|
2120
|
+
return d.value + (l.value - d.value) * f;
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* Create conditional responsive behavior
|
|
2125
|
+
*/
|
|
2126
|
+
static createConditionalResponsive(e, t, i) {
|
|
2127
|
+
const r = x();
|
|
2128
|
+
return m(() => {
|
|
2129
|
+
const o = S(), a = e(o) ? t : i;
|
|
2130
|
+
return this.resolveResponsiveValue(a, r());
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Resolve responsive value at specific breakpoint
|
|
2135
|
+
*/
|
|
2136
|
+
static resolveResponsiveValue(e, t) {
|
|
2137
|
+
if (!w(e))
|
|
2138
|
+
return e;
|
|
2139
|
+
const i = e, r = [
|
|
2140
|
+
"base",
|
|
2141
|
+
"sm",
|
|
2142
|
+
"md",
|
|
2143
|
+
"lg",
|
|
2144
|
+
"xl",
|
|
2145
|
+
"2xl"
|
|
2146
|
+
], o = r.indexOf(t);
|
|
2147
|
+
for (let n = o; n >= 0; n--) {
|
|
2148
|
+
const a = r[n];
|
|
2149
|
+
if (i[a] !== void 0)
|
|
2150
|
+
return i[a];
|
|
2151
|
+
}
|
|
2152
|
+
for (const n of r)
|
|
2153
|
+
if (i[n] !== void 0)
|
|
2154
|
+
return i[n];
|
|
2155
|
+
throw new Error("No responsive value found");
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
class Ge {
|
|
2159
|
+
/**
|
|
2160
|
+
* Hook for responsive arrays (e.g., responsive grid columns data)
|
|
2161
|
+
*/
|
|
2162
|
+
static useResponsiveArray(e) {
|
|
2163
|
+
const t = x();
|
|
2164
|
+
return m(() => {
|
|
2165
|
+
const i = t();
|
|
2166
|
+
return B.resolveResponsiveValue(e, i) || [];
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
/**
|
|
2170
|
+
* Hook for responsive object selection
|
|
2171
|
+
*/
|
|
2172
|
+
static useResponsiveObject(e) {
|
|
2173
|
+
const t = x();
|
|
2174
|
+
return m(() => {
|
|
2175
|
+
const i = t();
|
|
2176
|
+
try {
|
|
2177
|
+
return B.resolveResponsiveValue(
|
|
2178
|
+
e,
|
|
2179
|
+
i
|
|
2180
|
+
);
|
|
2181
|
+
} catch {
|
|
2182
|
+
return null;
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Hook for responsive function selection and execution
|
|
2188
|
+
*/
|
|
2189
|
+
static useResponsiveFunction(e) {
|
|
2190
|
+
const t = x();
|
|
2191
|
+
return m(() => {
|
|
2192
|
+
const i = t();
|
|
2193
|
+
try {
|
|
2194
|
+
return B.resolveResponsiveValue(
|
|
2195
|
+
e,
|
|
2196
|
+
i
|
|
2197
|
+
);
|
|
2198
|
+
} catch {
|
|
2199
|
+
return null;
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Hook for responsive state management
|
|
2205
|
+
*/
|
|
2206
|
+
static useResponsiveState(e) {
|
|
2207
|
+
const [t, i] = E(e), r = x();
|
|
2208
|
+
return [m(() => {
|
|
2209
|
+
const a = t(), c = r();
|
|
2210
|
+
try {
|
|
2211
|
+
return B.resolveResponsiveValue(
|
|
2212
|
+
a,
|
|
2213
|
+
c
|
|
2214
|
+
);
|
|
2215
|
+
} catch {
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
}), (a) => {
|
|
2219
|
+
w(a) ? i(a) : i({ [r()]: a });
|
|
2220
|
+
}];
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Hook for responsive computations with memoization
|
|
2224
|
+
*/
|
|
2225
|
+
static useResponsiveComputation(e, t = []) {
|
|
2226
|
+
return ge(() => {
|
|
2227
|
+
t.forEach((r) => r());
|
|
2228
|
+
const i = S();
|
|
2229
|
+
return e(i);
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* Hook for responsive side effects
|
|
2234
|
+
*/
|
|
2235
|
+
static useResponsiveEffect(e, t = []) {
|
|
2236
|
+
let i, r;
|
|
2237
|
+
V(() => {
|
|
2238
|
+
t.forEach((a) => a());
|
|
2239
|
+
const o = S();
|
|
2240
|
+
i && (i(), i = void 0);
|
|
2241
|
+
const n = e(o, r);
|
|
2242
|
+
typeof n == "function" && (i = n), r = o;
|
|
2243
|
+
});
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
class Ue {
|
|
2247
|
+
/**
|
|
2248
|
+
* Execute callback only on specific breakpoints
|
|
2249
|
+
*/
|
|
2250
|
+
static onBreakpoints(e, t) {
|
|
2251
|
+
let i;
|
|
2252
|
+
return V(() => {
|
|
2253
|
+
const r = S();
|
|
2254
|
+
if (e.includes(r.current)) {
|
|
2255
|
+
i && (i(), i = void 0);
|
|
2256
|
+
const o = t(r);
|
|
2257
|
+
typeof o == "function" && (i = o);
|
|
2258
|
+
}
|
|
2259
|
+
}), () => {
|
|
2260
|
+
i && i();
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* Execute callback when breakpoint changes
|
|
2265
|
+
*/
|
|
2266
|
+
static onBreakpointChange(e) {
|
|
2267
|
+
let t;
|
|
2268
|
+
return V(() => {
|
|
2269
|
+
const i = S(), r = i.current;
|
|
2270
|
+
t && t !== r && e(r, t, i), t = r;
|
|
2271
|
+
}), () => {
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Execute callback when entering/leaving specific breakpoint ranges
|
|
2276
|
+
*/
|
|
2277
|
+
static onBreakpointRange(e, t, i) {
|
|
2278
|
+
let r = !1, o, n;
|
|
2279
|
+
return V(() => {
|
|
2280
|
+
const a = S(), c = y(a.current), d = y(e), l = y(t), p = c >= d && c <= l;
|
|
2281
|
+
if (p && !r) {
|
|
2282
|
+
if (i.onEnter) {
|
|
2283
|
+
const f = i.onEnter(a);
|
|
2284
|
+
typeof f == "function" && (n = f);
|
|
2285
|
+
}
|
|
2286
|
+
r = !0;
|
|
2287
|
+
} else !p && r && (n && (n(), n = void 0), o && (o(), o = void 0), i.onLeave && i.onLeave(a), r = !1);
|
|
2288
|
+
if (p && i.onWithin) {
|
|
2289
|
+
o && (o(), o = void 0);
|
|
2290
|
+
const f = i.onWithin(a);
|
|
2291
|
+
typeof f == "function" && (o = f);
|
|
2292
|
+
}
|
|
2293
|
+
}), () => {
|
|
2294
|
+
n && n(), o && o();
|
|
2295
|
+
};
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
class Ke {
|
|
2299
|
+
/**
|
|
2300
|
+
* Create responsive pagination
|
|
2301
|
+
*/
|
|
2302
|
+
static createResponsivePagination(e, t) {
|
|
2303
|
+
const [i, r] = E(1), o = x(), n = m(() => {
|
|
2304
|
+
const C = o();
|
|
2305
|
+
return B.resolveResponsiveValue(
|
|
2306
|
+
t,
|
|
2307
|
+
C
|
|
2308
|
+
);
|
|
2309
|
+
}), a = m(() => Math.ceil(e.length / n())), c = m(() => {
|
|
2310
|
+
const C = n(), I = (i() - 1) * C, fe = I + C;
|
|
2311
|
+
return e.slice(I, fe);
|
|
2312
|
+
}), d = m(
|
|
2313
|
+
() => i() < a()
|
|
2314
|
+
), l = m(() => i() > 1), p = (C) => {
|
|
2315
|
+
const k = a();
|
|
2316
|
+
r(Math.max(1, Math.min(C, k)));
|
|
2317
|
+
}, f = () => {
|
|
2318
|
+
d() && r(i() + 1);
|
|
2319
|
+
}, v = () => {
|
|
2320
|
+
l() && r(i() - 1);
|
|
2321
|
+
};
|
|
2322
|
+
return V(() => {
|
|
2323
|
+
n(), r(1);
|
|
2324
|
+
}), {
|
|
2325
|
+
currentPage: i,
|
|
2326
|
+
totalPages: a,
|
|
2327
|
+
currentItems: c,
|
|
2328
|
+
setPage: p,
|
|
2329
|
+
nextPage: f,
|
|
2330
|
+
prevPage: v,
|
|
2331
|
+
hasNext: d,
|
|
2332
|
+
hasPrev: l
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Create responsive filtering
|
|
2337
|
+
*/
|
|
2338
|
+
static createResponsiveFilter(e, t) {
|
|
2339
|
+
const i = x();
|
|
2340
|
+
return m(() => {
|
|
2341
|
+
const r = i(), o = B.resolveResponsiveValue(
|
|
2342
|
+
t,
|
|
2343
|
+
r
|
|
2344
|
+
);
|
|
2345
|
+
return o ? e.filter(o) : e;
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
/**
|
|
2349
|
+
* Create responsive sorting
|
|
2350
|
+
*/
|
|
2351
|
+
static createResponsiveSort(e, t) {
|
|
2352
|
+
const i = x();
|
|
2353
|
+
return m(() => {
|
|
2354
|
+
const r = i(), o = B.resolveResponsiveValue(
|
|
2355
|
+
t,
|
|
2356
|
+
r
|
|
2357
|
+
);
|
|
2358
|
+
return o ? [...e].sort(o) : e;
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
const It = {
|
|
2363
|
+
Breakpoints: B,
|
|
2364
|
+
Hooks: Ge,
|
|
2365
|
+
Targeting: Ue,
|
|
2366
|
+
Data: Ke
|
|
2367
|
+
};
|
|
2368
|
+
class M {
|
|
2369
|
+
static isEnabled = !1;
|
|
2370
|
+
static debugOverlay = null;
|
|
2371
|
+
static logLevel = "info";
|
|
2372
|
+
/**
|
|
2373
|
+
* Enable responsive development tools
|
|
2374
|
+
*/
|
|
2375
|
+
static enable(e = {}) {
|
|
2376
|
+
if (process.env.NODE_ENV === "production") {
|
|
2377
|
+
console.warn("ResponsiveDevTools: Not enabling in production mode");
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2380
|
+
this.isEnabled = !0, this.logLevel = e.logLevel || "info", this.log("info", "ResponsiveDevTools: Enabled"), e.showOverlay && this.createDebugOverlay(e), e.highlightResponsiveElements && this.enableElementHighlighting(), e.showPerformance && this.enablePerformanceMonitoring(), this.logResponsiveState();
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Disable responsive development tools
|
|
2384
|
+
*/
|
|
2385
|
+
static disable() {
|
|
2386
|
+
this.isEnabled = !1, this.debugOverlay && (this.debugOverlay.remove(), this.debugOverlay = null), this.disableElementHighlighting(), this.log("info", "ResponsiveDevTools: Disabled");
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Check if development tools are enabled
|
|
2390
|
+
*/
|
|
2391
|
+
static get enabled() {
|
|
2392
|
+
return this.isEnabled && process.env.NODE_ENV !== "production";
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Log responsive information
|
|
2396
|
+
*/
|
|
2397
|
+
static log(e, ...t) {
|
|
2398
|
+
if (!this.enabled) return;
|
|
2399
|
+
const i = ["error", "warn", "info", "debug"], r = i.indexOf(this.logLevel);
|
|
2400
|
+
i.indexOf(e) <= r && console[e]("[ResponsiveDevTools]", ...t);
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Create visual debug overlay
|
|
2404
|
+
*/
|
|
2405
|
+
static createDebugOverlay(e) {
|
|
2406
|
+
if (typeof document > "u") return;
|
|
2407
|
+
const t = e.position || "top-right";
|
|
2408
|
+
this.debugOverlay = document.createElement("div"), this.debugOverlay.id = "tachui-responsive-debug", this.debugOverlay.style.cssText = `
|
|
2409
|
+
position: fixed;
|
|
2410
|
+
${t.includes("top") ? "top: 10px" : "bottom: 10px"};
|
|
2411
|
+
${t.includes("right") ? "right: 10px" : "left: 10px"};
|
|
2412
|
+
background: rgba(0, 0, 0, 0.9);
|
|
2413
|
+
color: white;
|
|
2414
|
+
padding: 12px;
|
|
2415
|
+
border-radius: 8px;
|
|
2416
|
+
font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
|
|
2417
|
+
font-size: 12px;
|
|
2418
|
+
z-index: 10000;
|
|
2419
|
+
pointer-events: auto;
|
|
2420
|
+
cursor: pointer;
|
|
2421
|
+
max-width: 300px;
|
|
2422
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
2423
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
2424
|
+
`;
|
|
2425
|
+
const i = document.createElement("div");
|
|
2426
|
+
i.textContent = "×", i.style.cssText = `
|
|
2427
|
+
position: absolute;
|
|
2428
|
+
top: 4px;
|
|
2429
|
+
right: 8px;
|
|
2430
|
+
cursor: pointer;
|
|
2431
|
+
font-size: 16px;
|
|
2432
|
+
color: #ff6b6b;
|
|
2433
|
+
`, i.onclick = () => this.disable(), this.debugOverlay.appendChild(i), document.body.appendChild(this.debugOverlay), this.updateDebugOverlay(e);
|
|
2434
|
+
let r;
|
|
2435
|
+
window.addEventListener("resize", () => {
|
|
2436
|
+
clearTimeout(r), r = window.setTimeout(() => {
|
|
2437
|
+
this.updateDebugOverlay(e);
|
|
2438
|
+
}, 100);
|
|
2439
|
+
});
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Update debug overlay content
|
|
2443
|
+
*/
|
|
2444
|
+
static updateDebugOverlay(e) {
|
|
2445
|
+
if (!this.debugOverlay) return;
|
|
2446
|
+
const t = S(), i = P();
|
|
2447
|
+
let r = `
|
|
2448
|
+
<div style="margin-bottom: 8px; font-weight: bold; color: #4fc3f7;">
|
|
2449
|
+
📱 Responsive Debug
|
|
2450
|
+
</div>
|
|
2451
|
+
`;
|
|
2452
|
+
if (r += `
|
|
2453
|
+
<div style="margin-bottom: 6px;">
|
|
2454
|
+
<strong>Current:</strong> <span style="color: #66bb6a;">${t.current}</span>
|
|
2455
|
+
</div>
|
|
2456
|
+
<div style="margin-bottom: 6px;">
|
|
2457
|
+
<strong>Size:</strong> ${t.width}×${t.height}
|
|
2458
|
+
</div>
|
|
2459
|
+
`, e.showBreakpoints) {
|
|
2460
|
+
r += '<div style="margin: 8px 0; font-weight: bold; color: #ffb74d;">Breakpoints:</div>';
|
|
2461
|
+
for (const [n, a] of Object.entries(i)) {
|
|
2462
|
+
const c = n === t.current;
|
|
2463
|
+
r += `
|
|
2464
|
+
<div style="color: ${c ? "#66bb6a" : "#999"}; margin-bottom: 2px;">
|
|
2465
|
+
${c ? "▶" : "▷"} ${n}: ${a}
|
|
2466
|
+
</div>
|
|
2467
|
+
`;
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
if (e.showPerformance) {
|
|
2471
|
+
const n = A.getStats(), a = R.getStats();
|
|
2472
|
+
if (r += '<div style="margin: 8px 0; font-weight: bold; color: #f06292;">Performance:</div>', r += `
|
|
2473
|
+
<div style="margin-bottom: 2px;">
|
|
2474
|
+
Cache: ${a.size} rules (${(a.hitRate * 100).toFixed(1)}% hit rate)
|
|
2475
|
+
</div>
|
|
2476
|
+
`, Object.keys(n).length > 0)
|
|
2477
|
+
for (const [c, d] of Object.entries(n))
|
|
2478
|
+
r += `
|
|
2479
|
+
<div style="margin-bottom: 2px;">
|
|
2480
|
+
${c}: ${d.average.toFixed(2)}ms avg
|
|
2481
|
+
</div>
|
|
2482
|
+
`;
|
|
2483
|
+
}
|
|
2484
|
+
r += '<div style="margin: 8px 0; font-weight: bold; color: #ba68c8;">Media Queries:</div>';
|
|
2485
|
+
const o = {
|
|
2486
|
+
Touch: g.touchDevice,
|
|
2487
|
+
Dark: g.darkMode,
|
|
2488
|
+
"Reduced Motion": g.reducedMotion,
|
|
2489
|
+
"High Contrast": g.highContrast
|
|
2490
|
+
};
|
|
2491
|
+
for (const [n, a] of Object.entries(o)) {
|
|
2492
|
+
const c = window.matchMedia(a).matches;
|
|
2493
|
+
r += `
|
|
2494
|
+
<div style="color: ${c ? "#66bb6a" : "#666"}; margin-bottom: 2px;">
|
|
2495
|
+
${c ? "✓" : "✗"} ${n}
|
|
2496
|
+
</div>
|
|
2497
|
+
`;
|
|
2498
|
+
}
|
|
2499
|
+
this.debugOverlay.innerHTML = r + this.debugOverlay.querySelector("div:last-child")?.outerHTML || "";
|
|
2500
|
+
}
|
|
2501
|
+
/**
|
|
2502
|
+
* Enable element highlighting for responsive elements
|
|
2503
|
+
*/
|
|
2504
|
+
static enableElementHighlighting() {
|
|
2505
|
+
if (typeof document > "u") return;
|
|
2506
|
+
const e = document.createElement("style");
|
|
2507
|
+
e.id = "tachui-responsive-highlight", e.textContent = `
|
|
2508
|
+
.tachui-responsive-element {
|
|
2509
|
+
outline: 2px dashed #4fc3f7 !important;
|
|
2510
|
+
outline-offset: 2px !important;
|
|
2511
|
+
position: relative !important;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
.tachui-responsive-element::before {
|
|
2515
|
+
content: 'R';
|
|
2516
|
+
position: absolute !important;
|
|
2517
|
+
top: -8px !important;
|
|
2518
|
+
right: -8px !important;
|
|
2519
|
+
background: #4fc3f7 !important;
|
|
2520
|
+
color: white !important;
|
|
2521
|
+
width: 16px !important;
|
|
2522
|
+
height: 16px !important;
|
|
2523
|
+
border-radius: 50% !important;
|
|
2524
|
+
font-size: 10px !important;
|
|
2525
|
+
font-weight: bold !important;
|
|
2526
|
+
display: flex !important;
|
|
2527
|
+
align-items: center !important;
|
|
2528
|
+
justify-content: center !important;
|
|
2529
|
+
z-index: 10001 !important;
|
|
2530
|
+
font-family: monospace !important;
|
|
2531
|
+
}
|
|
2532
|
+
`, document.head.appendChild(e), new MutationObserver(() => {
|
|
2533
|
+
this.highlightResponsiveElements();
|
|
2534
|
+
}).observe(document.body, {
|
|
2535
|
+
childList: !0,
|
|
2536
|
+
subtree: !0,
|
|
2537
|
+
attributes: !0,
|
|
2538
|
+
attributeFilter: ["class"]
|
|
2539
|
+
}), this.highlightResponsiveElements();
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* Disable element highlighting
|
|
2543
|
+
*/
|
|
2544
|
+
static disableElementHighlighting() {
|
|
2545
|
+
if (typeof document > "u") return;
|
|
2546
|
+
const e = document.getElementById("tachui-responsive-highlight");
|
|
2547
|
+
e && e.remove(), document.querySelectorAll(".tachui-responsive-element").forEach((t) => {
|
|
2548
|
+
t.classList.remove("tachui-responsive-element");
|
|
2549
|
+
});
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Highlight elements with responsive classes
|
|
2553
|
+
*/
|
|
2554
|
+
static highlightResponsiveElements() {
|
|
2555
|
+
if (typeof document > "u") return;
|
|
2556
|
+
[
|
|
2557
|
+
'[class*="tachui-responsive-"]',
|
|
2558
|
+
'[class*="tachui-mq-"]'
|
|
2559
|
+
].forEach((t) => {
|
|
2560
|
+
document.querySelectorAll(t).forEach((i) => {
|
|
2561
|
+
i.classList.contains("tachui-responsive-element") || i.classList.add("tachui-responsive-element");
|
|
2562
|
+
});
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* Enable performance monitoring display
|
|
2567
|
+
*/
|
|
2568
|
+
static enablePerformanceMonitoring() {
|
|
2569
|
+
setInterval(() => {
|
|
2570
|
+
if (!this.enabled) return;
|
|
2571
|
+
const e = A.getStats(), t = R.getStats();
|
|
2572
|
+
this.log("debug", "Performance Stats:", {
|
|
2573
|
+
cache: t,
|
|
2574
|
+
performance: e
|
|
2575
|
+
});
|
|
2576
|
+
}, 5e3);
|
|
2577
|
+
}
|
|
2578
|
+
/**
|
|
2579
|
+
* Log current responsive state
|
|
2580
|
+
*/
|
|
2581
|
+
static logResponsiveState() {
|
|
2582
|
+
if (!this.enabled) return;
|
|
2583
|
+
const e = S(), t = P();
|
|
2584
|
+
if (console.group("🔍 TachUI Responsive State"), console.log("Current breakpoint:", e.current), console.log("Viewport:", `${e.width}×${e.height}`), console.log("Configuration:", t), typeof window < "u" && window.matchMedia) {
|
|
2585
|
+
const i = {
|
|
2586
|
+
Mobile: g.mobile,
|
|
2587
|
+
Tablet: g.tablet,
|
|
2588
|
+
Desktop: g.desktop,
|
|
2589
|
+
"Touch Device": g.touchDevice,
|
|
2590
|
+
"Dark Mode": g.darkMode,
|
|
2591
|
+
"Reduced Motion": g.reducedMotion
|
|
2592
|
+
};
|
|
2593
|
+
console.log("Media Query Results:");
|
|
2594
|
+
for (const [r, o] of Object.entries(i))
|
|
2595
|
+
try {
|
|
2596
|
+
console.log(` ${r}: ${window.matchMedia(o).matches}`);
|
|
2597
|
+
} catch {
|
|
2598
|
+
console.log(` ${r}: Error testing query`);
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
console.groupEnd();
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Inspect a responsive value
|
|
2605
|
+
*/
|
|
2606
|
+
static inspectResponsiveValue(e, t) {
|
|
2607
|
+
if (!this.enabled) return;
|
|
2608
|
+
const i = x();
|
|
2609
|
+
if (console.group(`🔍 Responsive Value${t ? ` - ${t}` : ""}`), w(e)) {
|
|
2610
|
+
const r = e;
|
|
2611
|
+
console.log("Responsive object:", r);
|
|
2612
|
+
const o = [
|
|
2613
|
+
"base",
|
|
2614
|
+
"sm",
|
|
2615
|
+
"md",
|
|
2616
|
+
"lg",
|
|
2617
|
+
"xl",
|
|
2618
|
+
"2xl"
|
|
2619
|
+
], n = o.indexOf(i());
|
|
2620
|
+
let a;
|
|
2621
|
+
for (let c = n; c >= 0; c--) {
|
|
2622
|
+
const d = o[c];
|
|
2623
|
+
if (r[d] !== void 0) {
|
|
2624
|
+
a = r[d], console.log(`Resolved value (${d}):`, a);
|
|
2625
|
+
break;
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
console.log("Defined breakpoints:");
|
|
2629
|
+
for (const [c, d] of Object.entries(r))
|
|
2630
|
+
if (d !== void 0) {
|
|
2631
|
+
const l = c === i();
|
|
2632
|
+
console.log(` ${l ? "→" : " "} ${c}:`, d);
|
|
2633
|
+
}
|
|
2634
|
+
} else
|
|
2635
|
+
console.log("Static value:", e);
|
|
2636
|
+
console.groupEnd();
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* Test responsive behavior
|
|
2640
|
+
*/
|
|
2641
|
+
static testResponsiveBehavior(e, t = ["base", "sm", "md", "lg", "xl", "2xl"]) {
|
|
2642
|
+
if (!this.enabled) return {};
|
|
2643
|
+
const i = {};
|
|
2644
|
+
return t.forEach((r) => {
|
|
2645
|
+
this.log("debug", `Testing breakpoint ${r}:`, e);
|
|
2646
|
+
}), i;
|
|
2647
|
+
}
|
|
2648
|
+
/**
|
|
2649
|
+
* Export responsive configuration for debugging
|
|
2650
|
+
*/
|
|
2651
|
+
static exportConfiguration() {
|
|
2652
|
+
const e = S(), t = P(), i = A.getStats(), r = R.getStats(), o = {};
|
|
2653
|
+
if (typeof window < "u" && window.matchMedia) {
|
|
2654
|
+
for (const [n, a] of Object.entries(g))
|
|
2655
|
+
if (typeof a == "string")
|
|
2656
|
+
try {
|
|
2657
|
+
o[n] = window.matchMedia(a).matches;
|
|
2658
|
+
} catch {
|
|
2659
|
+
o[n] = !1;
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
return {
|
|
2663
|
+
breakpoints: t,
|
|
2664
|
+
currentContext: e,
|
|
2665
|
+
performance: {
|
|
2666
|
+
cache: r,
|
|
2667
|
+
timings: i
|
|
2668
|
+
},
|
|
2669
|
+
mediaQueries: o
|
|
2670
|
+
};
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
function Ze(s, e) {
|
|
2674
|
+
const t = x();
|
|
2675
|
+
return m(() => {
|
|
2676
|
+
const i = t(), r = w(s);
|
|
2677
|
+
let o, n = {};
|
|
2678
|
+
if (r) {
|
|
2679
|
+
const a = s;
|
|
2680
|
+
n = a;
|
|
2681
|
+
const c = [
|
|
2682
|
+
"base",
|
|
2683
|
+
"sm",
|
|
2684
|
+
"md",
|
|
2685
|
+
"lg",
|
|
2686
|
+
"xl",
|
|
2687
|
+
"2xl"
|
|
2688
|
+
], d = c.indexOf(i);
|
|
2689
|
+
for (let l = d; l >= 0; l--) {
|
|
2690
|
+
const p = c[l];
|
|
2691
|
+
if (a[p] !== void 0) {
|
|
2692
|
+
o = a[p];
|
|
2693
|
+
break;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
} else
|
|
2697
|
+
o = s, n = { [i]: o };
|
|
2698
|
+
return M.enabled && e && M.inspectResponsiveValue(s, e), {
|
|
2699
|
+
resolvedValue: o,
|
|
2700
|
+
activeBreakpoint: i,
|
|
2701
|
+
allValues: n,
|
|
2702
|
+
isResponsive: r
|
|
2703
|
+
};
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
class Ye {
|
|
2707
|
+
/**
|
|
2708
|
+
* Test CSS features support
|
|
2709
|
+
*/
|
|
2710
|
+
static testCSSFeatures() {
|
|
2711
|
+
if (typeof window > "u" || typeof CSS > "u" || !CSS.supports)
|
|
2712
|
+
return {};
|
|
2713
|
+
const e = {};
|
|
2714
|
+
try {
|
|
2715
|
+
e.cssGrid = CSS.supports("display", "grid"), e.flexbox = CSS.supports("display", "flex"), e.customProperties = CSS.supports("--test", "value"), e.viewportUnits = CSS.supports("width", "100vw"), e.mediaQueries = typeof window.matchMedia == "function", e.containerQueries = CSS.supports("container-type", "inline-size"), e.logicalProperties = CSS.supports("margin-inline-start", "1rem");
|
|
2716
|
+
} catch {
|
|
2717
|
+
}
|
|
2718
|
+
return e;
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* Test responsive behavior across different viewport sizes
|
|
2722
|
+
*/
|
|
2723
|
+
static testViewportSizes(e) {
|
|
2724
|
+
if (typeof window > "u") return;
|
|
2725
|
+
const t = [
|
|
2726
|
+
{ width: 320, height: 568, name: "iPhone SE" },
|
|
2727
|
+
{ width: 375, height: 667, name: "iPhone 8" },
|
|
2728
|
+
{ width: 768, height: 1024, name: "iPad Portrait" },
|
|
2729
|
+
{ width: 1024, height: 768, name: "iPad Landscape" },
|
|
2730
|
+
{ width: 1280, height: 720, name: "Desktop Small" },
|
|
2731
|
+
{ width: 1920, height: 1080, name: "Desktop Large" }
|
|
2732
|
+
];
|
|
2733
|
+
M.enabled && M.log("info", "Testing viewport sizes:", t), t.forEach((i) => {
|
|
2734
|
+
e(i.width, i.height);
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
typeof window < "u" && process.env.NODE_ENV !== "production" && (window.tachUIResponsive = {
|
|
2739
|
+
devTools: M,
|
|
2740
|
+
inspector: Ze,
|
|
2741
|
+
compatibility: Ye,
|
|
2742
|
+
logState: () => M.logResponsiveState(),
|
|
2743
|
+
export: () => M.exportConfiguration()
|
|
2744
|
+
});
|
|
2745
|
+
const Xe = {
|
|
2746
|
+
name: "@tachui/responsive",
|
|
2747
|
+
version: qe,
|
|
2748
|
+
author: "TachUI Team",
|
|
2749
|
+
verified: !0
|
|
2750
|
+
}, q = 80, Je = [
|
|
2751
|
+
[
|
|
2752
|
+
"responsive",
|
|
2753
|
+
h,
|
|
2754
|
+
{
|
|
2755
|
+
category: "layout",
|
|
2756
|
+
priority: q,
|
|
2757
|
+
signature: "(config: ResponsiveStyleConfig) => Modifier",
|
|
2758
|
+
description: "Applies responsive style mappings across configured breakpoints."
|
|
2759
|
+
}
|
|
2760
|
+
],
|
|
2761
|
+
[
|
|
2762
|
+
"mediaQuery",
|
|
2763
|
+
$,
|
|
2764
|
+
{
|
|
2765
|
+
category: "layout",
|
|
2766
|
+
priority: q,
|
|
2767
|
+
signature: "(query: string, styles: Record<string, any>) => Modifier",
|
|
2768
|
+
description: "Attaches custom CSS rules for a media query to a component."
|
|
2769
|
+
}
|
|
2770
|
+
],
|
|
2771
|
+
[
|
|
2772
|
+
"responsiveProperty",
|
|
2773
|
+
u,
|
|
2774
|
+
{
|
|
2775
|
+
category: "layout",
|
|
2776
|
+
priority: q,
|
|
2777
|
+
signature: "(property: string, value: ResponsiveValue<any>) => Modifier",
|
|
2778
|
+
description: "Creates a responsive modifier from a single style property/value map."
|
|
2779
|
+
}
|
|
2780
|
+
],
|
|
2781
|
+
[
|
|
2782
|
+
"responsiveLayout",
|
|
2783
|
+
pe,
|
|
2784
|
+
{
|
|
2785
|
+
category: "layout",
|
|
2786
|
+
priority: q,
|
|
2787
|
+
signature: "(config: ResponsiveLayoutConfig) => Modifier",
|
|
2788
|
+
description: "Configures responsive flexbox layout properties such as direction, wrap, and gap."
|
|
2789
|
+
}
|
|
2790
|
+
]
|
|
2791
|
+
];
|
|
2792
|
+
let re = !1;
|
|
2793
|
+
function et(s) {
|
|
2794
|
+
const e = s?.registry, t = s?.plugin ?? Xe, i = s?.force === !0, r = !!(e || s?.plugin);
|
|
2795
|
+
!r && re && !i || (Je.forEach(([o, n, a]) => {
|
|
2796
|
+
_e(
|
|
2797
|
+
o,
|
|
2798
|
+
n,
|
|
2799
|
+
a,
|
|
2800
|
+
e,
|
|
2801
|
+
t
|
|
2802
|
+
);
|
|
2803
|
+
}), r || (re = !0));
|
|
2804
|
+
}
|
|
2805
|
+
et();
|
|
2806
|
+
export {
|
|
2807
|
+
B as AdvancedBreakpointUtils,
|
|
2808
|
+
lt as BreakpointPresets,
|
|
2809
|
+
Ye as BrowserCompatibility,
|
|
2810
|
+
ue as CSSInjector,
|
|
2811
|
+
Rt as Container,
|
|
2812
|
+
oe as DEFAULT_BREAKPOINTS,
|
|
2813
|
+
kt as Flex,
|
|
2814
|
+
Et as LayoutPatterns,
|
|
2815
|
+
g as MediaQueries,
|
|
2816
|
+
He as MediaQueryModifier,
|
|
2817
|
+
ft as OptimizedCSSGenerator,
|
|
2818
|
+
le as RESPONSIVE_MODIFIER_PRIORITY,
|
|
2819
|
+
It as ResponsiveAdvanced,
|
|
2820
|
+
de as ResponsiveCSSGenerator,
|
|
2821
|
+
Rt as ResponsiveContainerPatterns,
|
|
2822
|
+
Ke as ResponsiveDataUtils,
|
|
2823
|
+
M as ResponsiveDevTools,
|
|
2824
|
+
kt as ResponsiveFlexPatterns,
|
|
2825
|
+
Fe as ResponsiveGrid,
|
|
2826
|
+
Fe as ResponsiveGridPatterns,
|
|
2827
|
+
Ge as ResponsiveHooks,
|
|
2828
|
+
U as ResponsiveModifier,
|
|
2829
|
+
he as ResponsiveModifierBuilderImpl,
|
|
2830
|
+
A as ResponsivePerformanceMonitor,
|
|
2831
|
+
Ot as ResponsiveSpacingPatterns,
|
|
2832
|
+
Ue as ResponsiveTargeting,
|
|
2833
|
+
Vt as ResponsiveTypography,
|
|
2834
|
+
Vt as ResponsiveTypographyPatterns,
|
|
2835
|
+
Mt as ResponsiveVisibilityPatterns,
|
|
2836
|
+
Ot as Spacing,
|
|
2837
|
+
Mt as Visibility,
|
|
2838
|
+
G as breakpointToPixels,
|
|
2839
|
+
St as combineMediaQueries,
|
|
2840
|
+
nt as configureBreakpoints,
|
|
2841
|
+
S as createBreakpointContext,
|
|
2842
|
+
$ as createMediaQueryModifier,
|
|
2843
|
+
gt as createResponsiveBuilder,
|
|
2844
|
+
wt as createResponsiveCSSVariables,
|
|
2845
|
+
pe as createResponsiveLayoutModifier,
|
|
2846
|
+
h as createResponsiveModifier,
|
|
2847
|
+
u as createResponsivePropertyModifier,
|
|
2848
|
+
$t as createResponsiveVisibility,
|
|
2849
|
+
R as cssRuleCache,
|
|
2850
|
+
Bt as enableResponsiveDebugOverlay,
|
|
2851
|
+
ht as generateCustomMediaQuery,
|
|
2852
|
+
Ne as generateMediaQuery,
|
|
2853
|
+
ct as generateRangeMediaQuery,
|
|
2854
|
+
pt as generateResponsiveProperty,
|
|
2855
|
+
y as getBreakpointIndex,
|
|
2856
|
+
dt as getBreakpointsAbove,
|
|
2857
|
+
ut as getBreakpointsBelow,
|
|
2858
|
+
x as getCurrentBreakpoint,
|
|
2859
|
+
P as getCurrentBreakpointConfig,
|
|
2860
|
+
Q as getSortedBreakpoints,
|
|
2861
|
+
ot as getViewportDimensions,
|
|
2862
|
+
at as initializeResponsiveSystem,
|
|
2863
|
+
te as isBreakpointAbove,
|
|
2864
|
+
ie as isBreakpointBelow,
|
|
2865
|
+
w as isResponsiveValue,
|
|
2866
|
+
J as isValidBreakpointKey,
|
|
2867
|
+
We as logResponsiveState,
|
|
2868
|
+
Ct as orMediaQueries,
|
|
2869
|
+
et as registerResponsiveModifiers,
|
|
2870
|
+
xt as resolveResponsiveValue,
|
|
2871
|
+
bt as useBreakpoint,
|
|
2872
|
+
vt as useMediaQuery,
|
|
2873
|
+
Ze as useResponsiveInspector,
|
|
2874
|
+
yt as useResponsiveValue,
|
|
2875
|
+
mt as withResponsive
|
|
2876
|
+
};
|