@tachui/core 0.8.23 → 0.8.25

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.
Files changed (56) hide show
  1. package/dist/assets/index.js +41 -40
  2. package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
  3. package/dist/build-tools/typegen-runner.d.ts +4 -0
  4. package/dist/build-tools/typegen-runner.d.ts.map +1 -1
  5. package/dist/cleanup-BR8UpYPX.js +61 -0
  6. package/dist/common.js +272 -277
  7. package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
  8. package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
  9. package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/computed-CA4Cgtoe.js +407 -0
  12. package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
  13. package/dist/css-classes/index.js +2 -2
  14. package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
  15. package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
  16. package/dist/essential.js +276 -281
  17. package/dist/factories-Bz6LZlk6.js +653 -0
  18. package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
  19. package/dist/full.d.ts +12 -0
  20. package/dist/full.d.ts.map +1 -0
  21. package/dist/full.js +436 -0
  22. package/dist/gradients/index.js +53 -53
  23. package/dist/hooks-w_FYPLjI.js +158 -0
  24. package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +295 -300
  28. package/dist/minimal-prod.js +106 -108
  29. package/dist/minimal.js +97 -98
  30. package/dist/modifiers/base.d.ts.map +1 -1
  31. package/dist/modifiers/base.js +188 -181
  32. package/dist/modifiers/builder.js +1 -1
  33. package/dist/modifiers/factories.d.ts.map +1 -1
  34. package/dist/modifiers/index.js +22 -23
  35. package/dist/modifiers/registry.js +1 -1
  36. package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
  37. package/dist/optimization-D9t53vNJ.js +308 -0
  38. package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
  39. package/dist/reactive/index.js +87 -85
  40. package/dist/runtime/dom-bridge.js +15 -17
  41. package/dist/runtime/index.js +71 -71
  42. package/dist/runtime/renderer.js +10 -11
  43. package/dist/signal-BRoiFOO7.js +262 -0
  44. package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
  45. package/dist/state/index.js +43 -44
  46. package/dist/theme-D5-09a8N.js +26 -0
  47. package/dist/validation/index.js +24 -26
  48. package/dist/version.js +1 -1
  49. package/package.json +16 -3
  50. package/dist/factories-B3-rmvkB.js +0 -268
  51. package/dist/hooks-WGmpzYgD.js +0 -446
  52. package/dist/optimization-CbKNA9w4.js +0 -21
  53. package/dist/presets-B9x94uRn.js +0 -381
  54. package/dist/scheduler-DppMK9mR.js +0 -169
  55. package/dist/theme-CRLPHryV.js +0 -687
  56. package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
@@ -0,0 +1,653 @@
1
+ import { LayoutModifier as S, AppearanceModifier as F, AnimationModifier as y, LifecycleModifier as C, InteractionModifier as g, BaseModifier as z } from "./modifiers/base.js";
2
+ import { ModifierPriority as v } from "@tachui/types/modifiers";
3
+ import { globalModifierRegistry as j } from "@tachui/registry";
4
+ import { c as w } from "./effect-DgNm6jk9.js";
5
+ import { i as b } from "./signal-BRoiFOO7.js";
6
+ v.LAYOUT;
7
+ const O = (e) => new S({ alignment: e });
8
+ function T(e) {
9
+ return O(e);
10
+ }
11
+ v.LAYOUT;
12
+ const D = (e) => new S({ layoutPriority: e });
13
+ function $(e) {
14
+ return D(e);
15
+ }
16
+ v.APPEARANCE;
17
+ const H = (e) => new F({ opacity: e });
18
+ function V(e) {
19
+ return H(e);
20
+ }
21
+ v.APPEARANCE;
22
+ const W = (e) => new F({ cornerRadius: e });
23
+ function Y(e) {
24
+ return W(e);
25
+ }
26
+ function u(e, ...r) {
27
+ const t = j.get(e);
28
+ if (!t)
29
+ throw new Error(
30
+ `Modifier '${e}' not found in registry. Import '@tachui/modifiers' or the relevant segmented bundle before using preset helpers.`
31
+ );
32
+ return t(...r);
33
+ }
34
+ const h = {
35
+ /**
36
+ * Set foreground (text) color
37
+ */
38
+ foregroundColor(e) {
39
+ return u("foregroundColor", e);
40
+ },
41
+ /**
42
+ * Set frame dimensions with support for infinity
43
+ */
44
+ frame(e, r, t) {
45
+ let i = t || {};
46
+ return (e !== void 0 || r !== void 0) && (i = {
47
+ ...i,
48
+ ...e !== void 0 ? { width: e } : {},
49
+ ...r !== void 0 ? { height: r } : {}
50
+ }), new S({ frame: i });
51
+ },
52
+ /**
53
+ * Set padding on all sides
54
+ */
55
+ padding(e) {
56
+ return u("padding", e);
57
+ },
58
+ /**
59
+ * Set margin on all sides
60
+ */
61
+ margin(e) {
62
+ return u("margin", e);
63
+ },
64
+ /**
65
+ * Set content alignment
66
+ */
67
+ alignment(e) {
68
+ return T(e);
69
+ },
70
+ /**
71
+ * Set layout priority for ZStack container sizing and flexible layout
72
+ * Higher priority views determine container size in ZStack
73
+ */
74
+ layoutPriority(e) {
75
+ return $(e);
76
+ }
77
+ }, p = {
78
+ /**
79
+ * Set foreground (text) color
80
+ */
81
+ foregroundColor(e) {
82
+ return u("foregroundColor", e);
83
+ },
84
+ /**
85
+ * Set background color
86
+ */
87
+ backgroundColor(e) {
88
+ return u("backgroundColor", e);
89
+ },
90
+ /**
91
+ * Set background (supports gradients)
92
+ */
93
+ background(e) {
94
+ return u("background", e);
95
+ },
96
+ /**
97
+ * Set font properties
98
+ */
99
+ font(e) {
100
+ return u("font", e);
101
+ },
102
+ /**
103
+ * Set font size
104
+ */
105
+ fontSize(e) {
106
+ return u("fontSize", e);
107
+ },
108
+ /**
109
+ * Set font weight
110
+ */
111
+ fontWeight(e) {
112
+ return u("fontWeight", e);
113
+ },
114
+ /**
115
+ * Set font family
116
+ */
117
+ fontFamily(e) {
118
+ return u("fontFamily", e);
119
+ },
120
+ /**
121
+ * Set opacity
122
+ */
123
+ opacity(e) {
124
+ return V(e);
125
+ },
126
+ /**
127
+ * Set corner radius (enhanced)
128
+ */
129
+ cornerRadius(e) {
130
+ return Y(e);
131
+ },
132
+ /**
133
+ * Set border
134
+ */
135
+ border(e, r = "#000000", t = "solid") {
136
+ return u("border", e, r, t);
137
+ },
138
+ /**
139
+ * Set detailed border properties
140
+ */
141
+ borderDetailed(e) {
142
+ return u("border", e);
143
+ }
144
+ // Shadow functionality moved to @tachui/modifiers/effects entry point
145
+ }, A = {
146
+ /**
147
+ * Add tap handler
148
+ */
149
+ onTap(e) {
150
+ return new g({ onTap: e });
151
+ },
152
+ /**
153
+ * Add hover handler
154
+ */
155
+ onHover(e) {
156
+ return new g({ onHover: e });
157
+ },
158
+ /**
159
+ * Add focus handler
160
+ */
161
+ onFocus(e) {
162
+ return new g({ onFocus: e });
163
+ },
164
+ /**
165
+ * Set disabled state
166
+ */
167
+ disabled(e = !0) {
168
+ return new g({ disabled: e });
169
+ },
170
+ /**
171
+ * Set accessibility label
172
+ */
173
+ accessibilityLabel(e) {
174
+ return new g({ accessibilityLabel: e });
175
+ },
176
+ /**
177
+ * Set accessibility hint
178
+ */
179
+ accessibilityHint(e) {
180
+ return new g({ accessibilityHint: e });
181
+ }
182
+ }, L = {
183
+ /**
184
+ * Add transition
185
+ */
186
+ transition(e = "all", r = 300, t = "ease", i = 0) {
187
+ return new y({
188
+ transition: { property: e, duration: r, easing: t, delay: i }
189
+ });
190
+ },
191
+ /**
192
+ * Add detailed transition
193
+ */
194
+ transitionDetailed(e) {
195
+ return new y({ transition: e });
196
+ },
197
+ /**
198
+ * Add animation
199
+ */
200
+ animation(e) {
201
+ return new y({ animation: e });
202
+ },
203
+ /**
204
+ * Add fade in animation
205
+ */
206
+ fadeIn(e = 300) {
207
+ return new y({
208
+ animation: {
209
+ keyframes: {
210
+ "0%": { opacity: "0" },
211
+ "100%": { opacity: "1" }
212
+ },
213
+ duration: e,
214
+ easing: "ease-out"
215
+ }
216
+ });
217
+ },
218
+ /**
219
+ * Add fade out animation
220
+ */
221
+ fadeOut(e = 300) {
222
+ return new y({
223
+ animation: {
224
+ keyframes: {
225
+ "0%": { opacity: "1" },
226
+ "100%": { opacity: "0" }
227
+ },
228
+ duration: e,
229
+ easing: "ease-in"
230
+ }
231
+ });
232
+ },
233
+ /**
234
+ * Add slide in animation
235
+ */
236
+ slideIn(e = "up", r = 300, t = 20) {
237
+ const i = {
238
+ up: [`translateY(${t}px)`, "translateY(0)"],
239
+ down: [`translateY(-${t}px)`, "translateY(0)"],
240
+ left: [`translateX(${t}px)`, "translateX(0)"],
241
+ right: [`translateX(-${t}px)`, "translateX(0)"]
242
+ }, [s, o] = i[e];
243
+ return new y({
244
+ animation: {
245
+ keyframes: {
246
+ "0%": { transform: s, opacity: "0" },
247
+ "100%": { transform: o, opacity: "1" }
248
+ },
249
+ duration: r,
250
+ easing: "ease-out"
251
+ }
252
+ });
253
+ },
254
+ /**
255
+ * Add scale animation
256
+ */
257
+ scaleAnimation(e = 0.8, r = 1, t = 300) {
258
+ return new y({
259
+ animation: {
260
+ keyframes: {
261
+ "0%": { transform: `scale(${e})`, opacity: "0" },
262
+ "100%": { transform: `scale(${r})`, opacity: "1" }
263
+ },
264
+ duration: t,
265
+ easing: "ease-out"
266
+ }
267
+ });
268
+ }
269
+ }, I = {
270
+ /**
271
+ * Execute handler when component appears in viewport
272
+ */
273
+ onAppear(e) {
274
+ return new C({ onAppear: e });
275
+ },
276
+ /**
277
+ * Execute handler when component disappears from viewport
278
+ */
279
+ onDisappear(e) {
280
+ return new C({ onDisappear: e });
281
+ },
282
+ /**
283
+ * Execute async task with automatic cancellation on component unmount
284
+ */
285
+ task(e, r) {
286
+ return new C({
287
+ task: {
288
+ operation: e,
289
+ id: r?.id,
290
+ priority: r?.priority || "default"
291
+ }
292
+ });
293
+ },
294
+ /**
295
+ * Add pull-to-refresh functionality
296
+ */
297
+ refreshable(e, r) {
298
+ return new C({
299
+ refreshable: {
300
+ onRefresh: e,
301
+ isRefreshing: r
302
+ }
303
+ });
304
+ }
305
+ }, B = {
306
+ /**
307
+ * Card-like appearance
308
+ */
309
+ card(e = 16) {
310
+ return [
311
+ p.backgroundColor("#ffffff"),
312
+ p.cornerRadius(8),
313
+ // shadow moved to @tachui/modifiers/effects entry point
314
+ h.padding(e)
315
+ ];
316
+ },
317
+ /**
318
+ * Button-like appearance
319
+ */
320
+ button(e = "#007AFF", r = "#ffffff") {
321
+ return [
322
+ p.backgroundColor(e),
323
+ p.foregroundColor(r),
324
+ p.cornerRadius(6),
325
+ h.padding(12),
326
+ // Simplified to single value for now
327
+ A.onHover((t) => {
328
+ }),
329
+ L.transition("all", 150)
330
+ ];
331
+ },
332
+ /**
333
+ * Input field appearance
334
+ */
335
+ input() {
336
+ return [
337
+ p.border(1, "#d1d5db"),
338
+ p.cornerRadius(4),
339
+ h.padding(8),
340
+ L.transition("border-color", 150),
341
+ A.onFocus((e) => {
342
+ })
343
+ ];
344
+ },
345
+ /**
346
+ * Typography presets
347
+ */
348
+ typography: {
349
+ title: () => [
350
+ p.fontSize(24),
351
+ p.fontWeight("bold")
352
+ ],
353
+ heading: () => [
354
+ p.fontSize(20),
355
+ p.fontWeight("600")
356
+ ],
357
+ body: () => [
358
+ p.fontSize(16),
359
+ p.fontWeight("normal")
360
+ ],
361
+ caption: () => [
362
+ p.fontSize(12),
363
+ p.fontWeight("normal"),
364
+ p.opacity(0.7)
365
+ ]
366
+ }
367
+ }, J = {
368
+ ...h,
369
+ ...p,
370
+ ...A,
371
+ ...L,
372
+ ...I,
373
+ presets: B
374
+ };
375
+ var N = Object.defineProperty, X = (e, r, t) => r in e ? N(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, E = (e, r, t) => X(e, typeof r != "symbol" ? r + "" : r, t);
376
+ function R(e) {
377
+ return typeof HTMLElement < "u" && e instanceof HTMLElement;
378
+ }
379
+ function _(e) {
380
+ return typeof e == "object" && e !== null && "style" in e && !!e.style;
381
+ }
382
+ function U(e) {
383
+ return _(e) && typeof e.style.setProperty == "function";
384
+ }
385
+ const P = {
386
+ /**
387
+ * Check if a value is a reactive signal
388
+ */
389
+ isReactive(e) {
390
+ return b(e);
391
+ },
392
+ /**
393
+ * Resolve a potentially reactive value
394
+ */
395
+ resolveValue(e) {
396
+ return b(e) ? e() : e;
397
+ },
398
+ /**
399
+ * Create a reactive effect for a value
400
+ */
401
+ createReactiveEffect(e, r) {
402
+ if (b(e)) {
403
+ const t = w(() => {
404
+ const i = e();
405
+ r(i);
406
+ });
407
+ return () => t.dispose();
408
+ }
409
+ return null;
410
+ },
411
+ /**
412
+ * Merge modifier properties
413
+ */
414
+ mergeProperties(e, r) {
415
+ const t = { ...e };
416
+ for (const [i, s] of Object.entries(r))
417
+ s !== void 0 && (t[i] = s);
418
+ return t;
419
+ },
420
+ /**
421
+ * Convert a CSS property name to camelCase
422
+ */
423
+ toCamelCase(e) {
424
+ return e.replace(
425
+ /-([a-z])/g,
426
+ (r, t) => t.toUpperCase()
427
+ );
428
+ },
429
+ /**
430
+ * Convert a camelCase property to CSS kebab-case
431
+ */
432
+ toKebabCase(e) {
433
+ return e.replace(/([A-Z])/g, "-$1").toLowerCase();
434
+ },
435
+ /**
436
+ * Normalize a CSS value
437
+ */
438
+ normalizeCSSValue(e) {
439
+ return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : String(e);
440
+ }
441
+ };
442
+ function c(e, r, t) {
443
+ class i extends z {
444
+ constructor() {
445
+ super(...arguments), E(this, "type", e), E(this, "priority", r);
446
+ }
447
+ apply(o, n) {
448
+ return t(o, n, this.properties);
449
+ }
450
+ }
451
+ return (s) => new i(s);
452
+ }
453
+ function Q(e, r, t = 100) {
454
+ return c(e, t, (i, s, o) => {
455
+ if (_(s.element)) {
456
+ const n = r(o);
457
+ Object.assign(s.element.style, n);
458
+ }
459
+ return i;
460
+ });
461
+ }
462
+ function ee(e, r, t = 100) {
463
+ return () => c(e, t, (i, s) => (_(s.element) && Object.assign(s.element.style, r), i))({});
464
+ }
465
+ function re(e, ...r) {
466
+ return console.warn("createComponentVariant is not yet implemented"), e;
467
+ }
468
+ function te(e, r = "combined", t = 999) {
469
+ return c(r, t, (i, s, o) => {
470
+ let n = i;
471
+ for (const a of e) {
472
+ const f = a.apply(n, s);
473
+ f && typeof f == "object" && "type" in f && (n = f);
474
+ }
475
+ return n;
476
+ })({});
477
+ }
478
+ function ne(e, r) {
479
+ return c(
480
+ `conditional-${r.type}`,
481
+ r.priority,
482
+ (t, i, s) => {
483
+ if (P.resolveValue(e))
484
+ return r.apply(t, i);
485
+ if (b(e)) {
486
+ const n = w(() => {
487
+ const a = e();
488
+ i.element && a && r.apply(t, i);
489
+ });
490
+ if (!t.dispose)
491
+ t.dispose = () => n.dispose();
492
+ else {
493
+ const a = t.dispose;
494
+ t.dispose = () => {
495
+ n.dispose(), a();
496
+ };
497
+ }
498
+ }
499
+ return t;
500
+ }
501
+ )({});
502
+ }
503
+ function ie(e, r) {
504
+ return c("state", 500, (t, i, s) => {
505
+ let o = t;
506
+ const n = (f) => {
507
+ const d = r[f] || [];
508
+ for (const M of d) {
509
+ const l = M.apply(o, i);
510
+ l && typeof l == "object" && "type" in l && (o = l);
511
+ }
512
+ };
513
+ n(e());
514
+ const a = w(() => {
515
+ const f = e();
516
+ n(f);
517
+ });
518
+ if (!t.dispose)
519
+ t.dispose = () => a.dispose();
520
+ else {
521
+ const f = t.dispose;
522
+ t.dispose = () => {
523
+ a.dispose(), f();
524
+ };
525
+ }
526
+ return o;
527
+ })({});
528
+ }
529
+ function oe(e, r = []) {
530
+ return c("responsive", 100, (t, i, s) => {
531
+ let o = t;
532
+ const n = () => {
533
+ const d = window.innerWidth;
534
+ let M = r;
535
+ for (const [l, m] of Object.entries(e)) {
536
+ const k = parseInt(l);
537
+ d >= k && (M = m);
538
+ }
539
+ for (const l of M) {
540
+ const m = l.apply(o, i);
541
+ m && typeof m == "object" && "type" in m && (o = m);
542
+ }
543
+ };
544
+ n();
545
+ const a = () => n();
546
+ window.addEventListener("resize", a);
547
+ const f = () => window.removeEventListener("resize", a);
548
+ if (!t.dispose)
549
+ t.dispose = f;
550
+ else {
551
+ const d = t.dispose;
552
+ t.dispose = () => {
553
+ f(), d();
554
+ };
555
+ }
556
+ return o;
557
+ })({});
558
+ }
559
+ function se(e) {
560
+ return c("class", 50, (r, t, i) => {
561
+ if (!t.element) return r;
562
+ const s = (o) => {
563
+ const n = Array.isArray(o) ? o : o.split(" ").filter(Boolean);
564
+ R(t.element) && t.element.classList.add(...n);
565
+ };
566
+ if (b(e)) {
567
+ let o = [];
568
+ const n = w(() => {
569
+ const a = e(), f = Array.isArray(a) ? a : a.split(" ").filter(Boolean);
570
+ R(t.element) && (t.element.classList.remove(...o), t.element.classList.add(...f), o = f);
571
+ });
572
+ if (!r.dispose)
573
+ r.dispose = () => n.dispose();
574
+ else {
575
+ const a = r.dispose;
576
+ r.dispose = () => {
577
+ n.dispose(), a();
578
+ };
579
+ }
580
+ } else
581
+ s(e);
582
+ return r;
583
+ })({});
584
+ }
585
+ function ae(e) {
586
+ return c("style", 200, (r, t, i) => {
587
+ if (!t.element) return r;
588
+ const s = (o) => {
589
+ if (U(t.element))
590
+ for (const [n, a] of Object.entries(o)) {
591
+ const f = P.toKebabCase(n), d = P.normalizeCSSValue(a);
592
+ t.element.style.setProperty(f, d);
593
+ }
594
+ };
595
+ if (b(e)) {
596
+ const o = w(() => {
597
+ const n = e();
598
+ s(n);
599
+ });
600
+ if (!r.dispose)
601
+ r.dispose = () => o.dispose();
602
+ else {
603
+ const n = r.dispose;
604
+ r.dispose = () => {
605
+ o.dispose(), n();
606
+ };
607
+ }
608
+ } else
609
+ s(e);
610
+ return r;
611
+ })({});
612
+ }
613
+ function fe(e) {
614
+ return c("event", 300, (r, t, i) => {
615
+ if (!t.element) return r;
616
+ const s = [];
617
+ for (const [n, a] of Object.entries(e))
618
+ t.element.addEventListener(n, a), s.push(() => {
619
+ t.element?.removeEventListener(n, a);
620
+ });
621
+ const o = () => s.forEach((n) => n());
622
+ if (!r.dispose)
623
+ r.dispose = o;
624
+ else {
625
+ const n = r.dispose;
626
+ r.dispose = () => {
627
+ o(), n();
628
+ };
629
+ }
630
+ return r;
631
+ })({});
632
+ }
633
+ export {
634
+ L as a,
635
+ p as b,
636
+ J as c,
637
+ se as d,
638
+ te as e,
639
+ ne as f,
640
+ c as g,
641
+ Q as h,
642
+ A as i,
643
+ fe as j,
644
+ ae as k,
645
+ h as l,
646
+ P as m,
647
+ I as n,
648
+ ee as o,
649
+ B as p,
650
+ re as q,
651
+ oe as r,
652
+ ie as s
653
+ };