@tachui/modifiers 0.8.0-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.
Files changed (131) hide show
  1. package/LICENSE +363 -0
  2. package/README.md +322 -0
  3. package/dist/allows-hit-testing-DscPrcOw.js +464 -0
  4. package/dist/allows-hit-testing-DscPrcOw.js.map +1 -0
  5. package/dist/appearance/background.d.ts +38 -0
  6. package/dist/appearance/background.d.ts.map +1 -0
  7. package/dist/appearance/border.d.ts +78 -0
  8. package/dist/appearance/border.d.ts.map +1 -0
  9. package/dist/appearance/clip-shape.d.ts +23 -0
  10. package/dist/appearance/clip-shape.d.ts.map +1 -0
  11. package/dist/appearance/clipped.d.ts +21 -0
  12. package/dist/appearance/clipped.d.ts.map +1 -0
  13. package/dist/appearance/foreground.d.ts +19 -0
  14. package/dist/appearance/foreground.d.ts.map +1 -0
  15. package/dist/appearance/index.d.ts +11 -0
  16. package/dist/appearance/index.d.ts.map +1 -0
  17. package/dist/appearance/index.js +34 -0
  18. package/dist/appearance/index.js.map +1 -0
  19. package/dist/attributes/aria.d.ts +101 -0
  20. package/dist/attributes/aria.d.ts.map +1 -0
  21. package/dist/attributes/css-properties.d.ts +229 -0
  22. package/dist/attributes/css-properties.d.ts.map +1 -0
  23. package/dist/attributes/html.d.ts +108 -0
  24. package/dist/attributes/html.d.ts.map +1 -0
  25. package/dist/attributes/index.d.ts +12 -0
  26. package/dist/attributes/index.d.ts.map +1 -0
  27. package/dist/base-CkGf4b9G.js +786 -0
  28. package/dist/base-CkGf4b9G.js.map +1 -0
  29. package/dist/base.d.ts +154 -0
  30. package/dist/base.d.ts.map +1 -0
  31. package/dist/base.js +842 -0
  32. package/dist/base.js.map +1 -0
  33. package/dist/basic/base.d.ts +147 -0
  34. package/dist/basic/base.d.ts.map +1 -0
  35. package/dist/basic/index.d.ts +9 -0
  36. package/dist/basic/index.d.ts.map +1 -0
  37. package/dist/basic/margin.d.ts +266 -0
  38. package/dist/basic/margin.d.ts.map +1 -0
  39. package/dist/basic/margin.js +160 -0
  40. package/dist/basic/margin.js.map +1 -0
  41. package/dist/basic/padding.d.ts +258 -0
  42. package/dist/basic/padding.d.ts.map +1 -0
  43. package/dist/basic/padding.js +155 -0
  44. package/dist/basic/padding.js.map +1 -0
  45. package/dist/basic/size.d.ts +113 -0
  46. package/dist/basic/size.d.ts.map +1 -0
  47. package/dist/basic/size.js +78 -0
  48. package/dist/basic/size.js.map +1 -0
  49. package/dist/clipped-CCW8gJqJ.js +282 -0
  50. package/dist/clipped-CCW8gJqJ.js.map +1 -0
  51. package/dist/css-CJEXRr6H.js +124 -0
  52. package/dist/css-CJEXRr6H.js.map +1 -0
  53. package/dist/elements/decorative.d.ts +109 -0
  54. package/dist/elements/decorative.d.ts.map +1 -0
  55. package/dist/elements/index.d.ts +6 -0
  56. package/dist/elements/index.d.ts.map +1 -0
  57. package/dist/elements/pseudo-elements.d.ts +145 -0
  58. package/dist/elements/pseudo-elements.d.ts.map +1 -0
  59. package/dist/font-3qM2Z97N.js +135 -0
  60. package/dist/font-3qM2Z97N.js.map +1 -0
  61. package/dist/index.d.ts +20 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +885 -0
  64. package/dist/index.js.map +1 -0
  65. package/dist/interaction/allows-hit-testing.d.ts +31 -0
  66. package/dist/interaction/allows-hit-testing.d.ts.map +1 -0
  67. package/dist/interaction/focusable.d.ts +33 -0
  68. package/dist/interaction/focusable.d.ts.map +1 -0
  69. package/dist/interaction/focused.d.ts +28 -0
  70. package/dist/interaction/focused.d.ts.map +1 -0
  71. package/dist/interaction/index.d.ts +11 -0
  72. package/dist/interaction/index.d.ts.map +1 -0
  73. package/dist/interaction/index.js +32 -0
  74. package/dist/interaction/index.js.map +1 -0
  75. package/dist/interaction/keyboard-shortcut.d.ts +30 -0
  76. package/dist/interaction/keyboard-shortcut.d.ts.map +1 -0
  77. package/dist/interaction/on-continuous-hover.d.ts +41 -0
  78. package/dist/interaction/on-continuous-hover.d.ts.map +1 -0
  79. package/dist/interaction/on-long-press-gesture.d.ts +26 -0
  80. package/dist/interaction/on-long-press-gesture.d.ts.map +1 -0
  81. package/dist/interaction/scroll.d.ts +143 -0
  82. package/dist/interaction/scroll.d.ts.map +1 -0
  83. package/dist/layout/aspect-ratio.d.ts +65 -0
  84. package/dist/layout/aspect-ratio.d.ts.map +1 -0
  85. package/dist/layout/fixed-size.d.ts +49 -0
  86. package/dist/layout/fixed-size.d.ts.map +1 -0
  87. package/dist/layout/flexbox.d.ts +253 -0
  88. package/dist/layout/flexbox.d.ts.map +1 -0
  89. package/dist/layout/index.d.ts +19 -0
  90. package/dist/layout/index.d.ts.map +1 -0
  91. package/dist/layout/index.js +30 -0
  92. package/dist/layout/index.js.map +1 -0
  93. package/dist/layout/offset.d.ts +44 -0
  94. package/dist/layout/offset.d.ts.map +1 -0
  95. package/dist/layout/overlay.d.ts +26 -0
  96. package/dist/layout/overlay.d.ts.map +1 -0
  97. package/dist/layout/position.d.ts +55 -0
  98. package/dist/layout/position.d.ts.map +1 -0
  99. package/dist/layout/scale-effect.d.ts +51 -0
  100. package/dist/layout/scale-effect.d.ts.map +1 -0
  101. package/dist/layout/z-index.d.ts +65 -0
  102. package/dist/layout/z-index.d.ts.map +1 -0
  103. package/dist/overlay-DDiSLprp.js +774 -0
  104. package/dist/overlay-DDiSLprp.js.map +1 -0
  105. package/dist/responsive/index.d.ts +10 -0
  106. package/dist/responsive/index.d.ts.map +1 -0
  107. package/dist/types.d.ts +598 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +5 -0
  110. package/dist/types.js.map +1 -0
  111. package/dist/typography/font.d.ts +24 -0
  112. package/dist/typography/font.d.ts.map +1 -0
  113. package/dist/typography/index.d.ts +9 -0
  114. package/dist/typography/index.d.ts.map +1 -0
  115. package/dist/typography/index.js +30 -0
  116. package/dist/typography/index.js.map +1 -0
  117. package/dist/typography/text.d.ts +70 -0
  118. package/dist/typography/text.d.ts.map +1 -0
  119. package/dist/typography/text.js +129 -0
  120. package/dist/typography/text.js.map +1 -0
  121. package/dist/typography/typography.d.ts +52 -0
  122. package/dist/typography/typography.d.ts.map +1 -0
  123. package/dist/utility/css.d.ts +86 -0
  124. package/dist/utility/css.d.ts.map +1 -0
  125. package/dist/utility/index.d.ts +6 -0
  126. package/dist/utility/index.d.ts.map +1 -0
  127. package/dist/utility/index.js +17 -0
  128. package/dist/utility/index.js.map +1 -0
  129. package/dist/utility/utility.d.ts +69 -0
  130. package/dist/utility/utility.d.ts.map +1 -0
  131. package/package.json +117 -0
package/dist/index.js ADDED
@@ -0,0 +1,885 @@
1
+ var x = Object.defineProperty;
2
+ var v = (r, o, e) => o in r ? x(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
3
+ var s = (r, o, e) => v(r, typeof o != "symbol" ? o + "" : o, e);
4
+ import { globalModifierRegistry as A } from "@tachui/core/modifiers/registry";
5
+ import { B as u } from "./base-CkGf4b9G.js";
6
+ import { a as yt, A as It, I as xt, L as vt, b as At } from "./base-CkGf4b9G.js";
7
+ import { ModifierPriority as St } from "@tachui/core/modifiers/types";
8
+ import { l as w, n as S, o as M, r as T, p as C, s as $, z as P } from "./overlay-DDiSLprp.js";
9
+ import { A as Tt, m as Ct, F as $t, O as Pt, q as Rt, P as Et, S as Bt, Z as Vt, d as kt, e as zt, c as Dt, h as Ot, a as Lt, b as Nt, i as Ut, f as Ht, k as jt, g as Wt, j as Ft } from "./overlay-DDiSLprp.js";
10
+ import { f as R, g as E, h as B, u as V } from "./css-CJEXRr6H.js";
11
+ import { C as qt, U as Gt, i as Zt, c as _t, d as Xt, b as Yt, e as Jt, a as Qt, o as er } from "./css-CJEXRr6H.js";
12
+ import { b as k, i as z, y as D, A as O, v as L } from "./clipped-CCW8gJqJ.js";
13
+ import { a as rr, B as ir, h as or, x as ar, z as nr, C as sr, F as dr, c as lr, d as cr, e as fr, l as pr, q as ur, n as mr, m as gr, k as br, j as hr, p as yr, t as Ir, u as xr, w as vr, f as Ar, g as wr, o as Sr, r as Mr, s as Tr } from "./clipped-CCW8gJqJ.js";
14
+ import { t as N, a as U, j as H } from "./font-3qM2Z97N.js";
15
+ import { T as $r, k as Pr, i as Rr, f as Er, d as Br, e as Vr, l as kr, o as zr, s as Dr, h as Or, c as Lr, g as Nr, b as Ur, w as Hr } from "./font-3qM2Z97N.js";
16
+ import { lineClamp as j, wordBreak as W } from "./typography/text.js";
17
+ import { HyphensModifier as Wr, LineClampModifier as Fr, OverflowWrapModifier as Kr, WordBreakModifier as qr, hyphens as Gr, overflowWrap as Zr } from "./typography/text.js";
18
+ import { u as F, l as K, m as q, n as G, i as Z, k as _, q as X, g as Y, s as J, a as Q, o as ee, b as te, c as re, d as ie, e as oe, f as ae } from "./allows-hit-testing-DscPrcOw.js";
19
+ import { A as Xr, j as Yr, F as Jr, K as Qr, p as ei, O as ti, S as ri, w as ii, v as oi, h as ai, t as ni, r as si } from "./allows-hit-testing-DscPrcOw.js";
20
+ import { padding as ne, paddingTop as se, paddingBottom as de, paddingLeft as le, paddingRight as ce, paddingLeading as fe, paddingTrailing as pe, paddingHorizontal as ue, paddingVertical as me } from "./basic/padding.js";
21
+ import { PaddingModifier as li, paddingPresets as ci } from "./basic/padding.js";
22
+ import { margin as ge, marginTop as be, marginBottom as he, marginLeft as ye, marginRight as Ie, marginLeading as xe, marginTrailing as ve, marginHorizontal as Ae, marginVertical as we } from "./basic/margin.js";
23
+ import { MarginModifier as pi, marginPresets as ui } from "./basic/margin.js";
24
+ import { size as Se, width as Me, height as Te, maxWidth as Ce, maxHeight as $e, minWidth as Pe, minHeight as Re } from "./basic/size.js";
25
+ import { SizeModifier as gi } from "./basic/size.js";
26
+ import { BaseModifier as Ee } from "./base.js";
27
+ const c = class c extends Ee {
28
+ constructor() {
29
+ super(...arguments);
30
+ s(this, "type", "pseudoElement");
31
+ s(this, "priority", 50);
32
+ }
33
+ apply(e, t) {
34
+ if (!t.element) return;
35
+ const i = `tachui-pseudo-${++c.elementCount}`;
36
+ t.element.classList.add(i), this.properties.before && this.addPseudoElementRule(i, "before", this.properties.before), this.properties.after && this.addPseudoElementRule(i, "after", this.properties.after);
37
+ }
38
+ addPseudoElementRule(e, t, i) {
39
+ const a = this.getOrCreateStyleSheet(), n = this.generatePseudoElementCSS(e, t, i);
40
+ try {
41
+ a.insertRule(n);
42
+ } catch (d) {
43
+ (typeof process > "u" || process.env.NODE_ENV !== "test") && console.warn("Failed to add pseudo-element rule:", d);
44
+ }
45
+ }
46
+ generatePseudoElementCSS(e, t, i) {
47
+ const a = `.${e}::${t}`, n = [];
48
+ return i.content || (i.content = '""'), Object.entries(i).forEach(([d, l]) => {
49
+ if (l !== void 0) {
50
+ const y = this.toCSSProperty(d), I = this.formatCSSValue(d, l);
51
+ n.push(`${y}: ${I}`);
52
+ }
53
+ }), `${a} { ${n.join("; ")} }`;
54
+ }
55
+ formatCSSValue(e, t) {
56
+ return e === "content" ? typeof t == "string" ? !t.startsWith('"') && !t.startsWith("'") ? `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : t : '""' : typeof t == "number" ? [
57
+ "opacity",
58
+ "z-index",
59
+ "line-height",
60
+ "flex-grow",
61
+ "flex-shrink",
62
+ "order",
63
+ "column-count",
64
+ "font-weight"
65
+ ].includes(this.toCSSProperty(e)) ? String(t) : `${t}px` : String(t);
66
+ }
67
+ getOrCreateStyleSheet() {
68
+ const e = document.getElementById(
69
+ c.styleSheetId
70
+ );
71
+ if (e && e instanceof HTMLStyleElement)
72
+ return e.sheet;
73
+ const t = document.createElement("style");
74
+ t.id = c.styleSheetId;
75
+ try {
76
+ document.head.appendChild(t);
77
+ } catch (i) {
78
+ (typeof process > "u" || process.env.NODE_ENV !== "test") && console.warn("Failed to append stylesheet to document.head:", i);
79
+ }
80
+ return t.sheet;
81
+ }
82
+ toCSSProperty(e) {
83
+ return e.replace(/([A-Z])/g, "-$1").toLowerCase();
84
+ }
85
+ };
86
+ // High priority to ensure pseudo-elements are applied last
87
+ s(c, "styleSheetId", "tachui-pseudo-elements"), s(c, "elementCount", 0);
88
+ let f = c;
89
+ function p(r) {
90
+ return new f({ before: r });
91
+ }
92
+ function m(r) {
93
+ return new f({ after: r });
94
+ }
95
+ function Be(r) {
96
+ return new f(r);
97
+ }
98
+ function Ve(r, o = {}) {
99
+ return p({
100
+ content: r,
101
+ display: "inline-block",
102
+ ...o
103
+ });
104
+ }
105
+ function ke(r, o = {}) {
106
+ return m({
107
+ content: r,
108
+ display: "inline-block",
109
+ ...o
110
+ });
111
+ }
112
+ function ze(r = "#ddd", o = 1, e = 16) {
113
+ return p({
114
+ content: "",
115
+ display: "inline-block",
116
+ width: e,
117
+ height: o,
118
+ backgroundColor: r,
119
+ marginRight: 8,
120
+ verticalAlign: "middle"
121
+ });
122
+ }
123
+ function De(r = "#ddd", o = 1, e = 16) {
124
+ return m({
125
+ content: "",
126
+ display: "inline-block",
127
+ width: e,
128
+ height: o,
129
+ backgroundColor: r,
130
+ marginLeft: 8,
131
+ verticalAlign: "middle"
132
+ });
133
+ }
134
+ function Oe(r = '"', o = '"') {
135
+ return new f({
136
+ before: {
137
+ content: r,
138
+ fontSize: "1.2em",
139
+ color: "#666",
140
+ marginRight: 4
141
+ },
142
+ after: {
143
+ content: o,
144
+ fontSize: "1.2em",
145
+ color: "#666",
146
+ marginLeft: 4
147
+ }
148
+ });
149
+ }
150
+ function Le(r = "currentColor", o = 1, e = 1) {
151
+ return m({
152
+ content: "",
153
+ position: "absolute",
154
+ bottom: 0,
155
+ left: 0,
156
+ right: 0,
157
+ height: o,
158
+ backgroundColor: r,
159
+ opacity: e
160
+ });
161
+ }
162
+ function Ne(r = "#ff3b30", o = 6, e = "") {
163
+ return m({
164
+ content: e,
165
+ position: "absolute",
166
+ top: -2,
167
+ right: -2,
168
+ width: e ? "auto" : o,
169
+ height: o,
170
+ minWidth: o,
171
+ backgroundColor: r,
172
+ borderRadius: "50%",
173
+ fontSize: 10,
174
+ color: "white",
175
+ textAlign: "center",
176
+ lineHeight: e ? o / 10 : 1,
177
+ padding: e ? "2px 4px" : 0,
178
+ display: "flex",
179
+ alignItems: "center",
180
+ justifyContent: "center"
181
+ });
182
+ }
183
+ function Ue(r, o = "top", e = "#333", t = "white") {
184
+ return p({
185
+ content: r,
186
+ position: "absolute",
187
+ backgroundColor: e,
188
+ color: t,
189
+ padding: "4px 8px",
190
+ borderRadius: 4,
191
+ fontSize: 12,
192
+ whiteSpace: "nowrap",
193
+ zIndex: 1e3,
194
+ opacity: 0,
195
+ pointerEvents: "none",
196
+ transition: "opacity 0.2s ease",
197
+ ...{
198
+ top: {
199
+ bottom: "100%",
200
+ left: "50%",
201
+ transform: "translateX(-50%)",
202
+ marginBottom: 5
203
+ },
204
+ bottom: {
205
+ top: "100%",
206
+ left: "50%",
207
+ transform: "translateX(-50%)",
208
+ marginTop: 5
209
+ },
210
+ left: {
211
+ right: "100%",
212
+ top: "50%",
213
+ transform: "translateY(-50%)",
214
+ marginRight: 5
215
+ },
216
+ right: {
217
+ left: "100%",
218
+ top: "50%",
219
+ transform: "translateY(-50%)",
220
+ marginLeft: 5
221
+ }
222
+ }[o]
223
+ });
224
+ }
225
+ function He(r, o = "#ff3b30", e = "white") {
226
+ return p({
227
+ content: r,
228
+ position: "absolute",
229
+ top: 8,
230
+ right: -8,
231
+ backgroundColor: o,
232
+ color: e,
233
+ padding: "2px 12px",
234
+ fontSize: 11,
235
+ fontWeight: "bold",
236
+ textTransform: "uppercase",
237
+ transform: "rotate(45deg)",
238
+ transformOrigin: "center",
239
+ zIndex: 10
240
+ });
241
+ }
242
+ function je(r = 20, o = "#007AFF", e = 2) {
243
+ if (!document.getElementById("tachui-spinner-animation")) {
244
+ const t = document.createElement("style");
245
+ t.id = "tachui-spinner-animation", t.textContent = `
246
+ @keyframes spin {
247
+ 0% { transform: rotate(0deg); }
248
+ 100% { transform: rotate(360deg); }
249
+ }
250
+ `, document.head.appendChild(t);
251
+ }
252
+ return p({
253
+ content: "",
254
+ display: "inline-block",
255
+ width: r,
256
+ height: r,
257
+ border: `${e}px solid transparent`,
258
+ borderTop: `${e}px solid ${o}`,
259
+ borderRadius: "50%",
260
+ animation: "spin 1s linear infinite"
261
+ });
262
+ }
263
+ class We extends u {
264
+ // High priority for HTML attributes
265
+ constructor(e) {
266
+ super(e);
267
+ s(this, "type", "id");
268
+ s(this, "priority", 85);
269
+ }
270
+ apply(e, t) {
271
+ if (!t.element) return;
272
+ const { id: i } = this.properties;
273
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.validateId(i), t.element.setAttribute("id", i);
274
+ }
275
+ validateId(e) {
276
+ if (!e || typeof e != "string") {
277
+ console.warn("TachUI ID Modifier: ID must be a non-empty string");
278
+ return;
279
+ }
280
+ /^[a-zA-Z][a-zA-Z0-9_:-]*$/.test(e) || console.warn(
281
+ `TachUI ID Modifier: Invalid ID format "${e}". IDs must start with a letter and contain only letters, digits, hyphens, underscores, colons, and periods.`
282
+ ), typeof document < "u" && document.getElementById && document.getElementById(e) && console.warn(
283
+ `TachUI ID Modifier: Duplicate ID "${e}" detected. IDs should be unique within the document.`
284
+ );
285
+ }
286
+ }
287
+ function Fe(r) {
288
+ return new We({ id: r });
289
+ }
290
+ class Ke extends u {
291
+ // High priority for HTML attributes
292
+ constructor(e) {
293
+ super(e);
294
+ s(this, "type", "data");
295
+ s(this, "priority", 80);
296
+ }
297
+ apply(e, t) {
298
+ if (!t.element) return;
299
+ const { data: i } = this.properties;
300
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.validateDataAttributes(i), Object.entries(i).forEach(([a, n]) => {
301
+ const d = this.formatDataAttributeName(a), l = this.formatDataAttributeValue(n);
302
+ t.element.setAttribute(d, l);
303
+ });
304
+ }
305
+ formatDataAttributeName(e) {
306
+ const t = e.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
307
+ return t.startsWith("data-") ? t : `data-${t}`;
308
+ }
309
+ formatDataAttributeValue(e) {
310
+ return typeof e == "boolean" ? e ? "true" : "false" : String(e);
311
+ }
312
+ validateDataAttributes(e) {
313
+ Object.entries(e).forEach(([t, i]) => {
314
+ if (!t || typeof t != "string") {
315
+ console.warn(
316
+ "TachUI Data Modifier: Data attribute keys must be non-empty strings"
317
+ );
318
+ return;
319
+ }
320
+ const a = t.replace(/^data-/, "");
321
+ /^[a-zA-Z][a-zA-Z0-9-_]*$/.test(a) || console.warn(
322
+ `TachUI Data Modifier: Invalid data attribute key "${t}". Keys should start with a letter and contain only letters, numbers, hyphens, and underscores.`
323
+ ), i != null && typeof i != "string" && typeof i != "number" && typeof i != "boolean" && console.warn(
324
+ `TachUI Data Modifier: Data attribute "${t}" has invalid value type "${typeof i}". Only strings, numbers, and booleans are supported.`
325
+ );
326
+ });
327
+ }
328
+ }
329
+ function qe(r) {
330
+ return new Ke({ data: r });
331
+ }
332
+ class Ge extends u {
333
+ // High priority for accessibility
334
+ constructor(e) {
335
+ super(e);
336
+ s(this, "type", "tabIndex");
337
+ s(this, "priority", 75);
338
+ }
339
+ apply(e, t) {
340
+ if (!t.element) return;
341
+ const { tabIndex: i } = this.properties;
342
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.validateTabIndex(i), t.element.setAttribute("tabindex", String(i));
343
+ }
344
+ validateTabIndex(e) {
345
+ if (typeof e != "number" || !Number.isInteger(e)) {
346
+ console.warn("TachUI TabIndex Modifier: tabIndex must be an integer");
347
+ return;
348
+ }
349
+ e > 0 && console.info(
350
+ 'TachUI TabIndex Modifier: Positive tabIndex values can disrupt natural tab order. Consider using tabIndex="0" for focusable elements and tabIndex="-1" for programmatically focusable elements.'
351
+ ), e < -1 && console.warn(
352
+ "TachUI TabIndex Modifier: tabIndex values less than -1 are not recommended. Use -1 to remove from tab order or 0+ for tab order."
353
+ );
354
+ }
355
+ }
356
+ function Ze(r) {
357
+ return new Ge({ tabIndex: r });
358
+ }
359
+ const b = class b extends u {
360
+ constructor(e) {
361
+ super(e);
362
+ s(this, "type", "aria");
363
+ s(this, "priority", 90);
364
+ }
365
+ apply(e, t) {
366
+ if (!t.element) return;
367
+ const { aria: i } = this.properties;
368
+ typeof process < "u" && process.env.NODE_ENV === "development" && this.validateAriaAttributes(i), Object.entries(i).forEach(([a, n]) => {
369
+ if (n != null) {
370
+ const d = this.formatAriaAttributeName(a), l = this.formatAriaAttributeValue(n);
371
+ t.element.setAttribute(d, l);
372
+ }
373
+ });
374
+ }
375
+ formatAriaAttributeName(e) {
376
+ if (e === "role")
377
+ return "role";
378
+ e === "labeledby" && (e = "labelledby");
379
+ const t = e.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
380
+ return t.startsWith("aria-") ? t : `aria-${t}`;
381
+ }
382
+ formatAriaAttributeValue(e) {
383
+ return typeof e == "boolean" ? e ? "true" : "false" : String(e);
384
+ }
385
+ validateAriaAttributes(e) {
386
+ Object.entries(e).forEach(([t, i]) => {
387
+ if (!t || typeof t != "string") {
388
+ console.warn(
389
+ "TachUI ARIA Modifier: ARIA attribute keys must be non-empty strings"
390
+ );
391
+ return;
392
+ }
393
+ const a = t.replace(/^aria-/, "");
394
+ !b.KNOWN_ATTRIBUTES.has(a) && !t.startsWith("aria-") && console.warn(
395
+ `TachUI ARIA Modifier: Unknown ARIA attribute "${t}". This may not be a valid ARIA attribute. Did you mean "${this.suggestCorrection(a)}"?`
396
+ ), this.validateSpecificAriaAttribute(t, i);
397
+ });
398
+ }
399
+ validateSpecificAriaAttribute(e, t) {
400
+ const i = e.replace(/^aria-/, "");
401
+ switch (i) {
402
+ case "live":
403
+ ["off", "polite", "assertive"].includes(t) || console.warn(
404
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-live. Valid values are: "off", "polite", "assertive"`
405
+ );
406
+ break;
407
+ case "haspopup":
408
+ const a = [
409
+ "false",
410
+ "true",
411
+ "menu",
412
+ "listbox",
413
+ "tree",
414
+ "grid",
415
+ "dialog"
416
+ ];
417
+ typeof t == "string" && !a.includes(t) && console.warn(
418
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-haspopup. Valid values are: ${a.join(", ")}`
419
+ );
420
+ break;
421
+ case "current":
422
+ const n = ["page", "step", "location", "date", "time"];
423
+ typeof t == "string" && !n.includes(t) && console.warn(
424
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-current. Valid values are: false, true, ${n.join(", ")}`
425
+ );
426
+ break;
427
+ case "invalid":
428
+ const d = ["false", "true", "grammar", "spelling"];
429
+ typeof t == "string" && !d.includes(t) && console.warn(
430
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-invalid. Valid values are: ${d.join(", ")}`
431
+ );
432
+ break;
433
+ case "orientation":
434
+ ["horizontal", "vertical"].includes(t) || console.warn(
435
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-orientation. Valid values are: "horizontal", "vertical"`
436
+ );
437
+ break;
438
+ case "sort":
439
+ ["none", "ascending", "descending", "other"].includes(
440
+ t
441
+ ) || console.warn(
442
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-sort. Valid values are: "none", "ascending", "descending", "other"`
443
+ );
444
+ break;
445
+ case "pressed":
446
+ const l = ["true", "false", "mixed"];
447
+ typeof t == "string" && !l.includes(t) && console.warn(
448
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-pressed. Valid values are: ${l.join(", ")}`
449
+ );
450
+ break;
451
+ // Numeric attributes validation
452
+ case "level":
453
+ case "posinset":
454
+ case "setsize":
455
+ case "valuemax":
456
+ case "valuemin":
457
+ case "valuenow":
458
+ typeof t == "number" && (t < 0 || !Number.isInteger(t)) && console.warn(
459
+ `TachUI ARIA Modifier: Invalid value "${t}" for aria-${i}. Must be a non-negative integer.`
460
+ );
461
+ break;
462
+ }
463
+ }
464
+ suggestCorrection(e) {
465
+ return {
466
+ lable: "label",
467
+ labeledby: "labelledby",
468
+ descripedby: "describedby",
469
+ described: "describedby",
470
+ controled: "controls",
471
+ controles: "controls",
472
+ expaned: "expanded",
473
+ expandd: "expanded",
474
+ hiden: "hidden",
475
+ hidde: "hidden",
476
+ disbled: "disabled",
477
+ disable: "disabled",
478
+ requird: "required",
479
+ require: "required",
480
+ selectd: "selected",
481
+ select: "selected",
482
+ orientaton: "orientation"
483
+ }[e] || e;
484
+ }
485
+ };
486
+ // Highest priority for accessibility
487
+ s(b, "KNOWN_ATTRIBUTES", /* @__PURE__ */ new Set([
488
+ "label",
489
+ "labelledby",
490
+ "describedby",
491
+ "expanded",
492
+ "hidden",
493
+ "live",
494
+ "atomic",
495
+ "busy",
496
+ "controls",
497
+ "current",
498
+ "disabled",
499
+ "grabbed",
500
+ "haspopup",
501
+ "invalid",
502
+ "level",
503
+ "multiline",
504
+ "multiselectable",
505
+ "orientation",
506
+ "owns",
507
+ "placeholder",
508
+ "posinset",
509
+ "pressed",
510
+ "readonly",
511
+ "relevant",
512
+ "required",
513
+ "selected",
514
+ "setsize",
515
+ "sort",
516
+ "valuemax",
517
+ "valuemin",
518
+ "valuenow",
519
+ "valuetext",
520
+ "role"
521
+ ]));
522
+ let h = b;
523
+ function _e(r) {
524
+ return new h({ aria: r });
525
+ }
526
+ class g extends u {
527
+ // Early application for CSS variables
528
+ constructor(e) {
529
+ super(e);
530
+ s(this, "type", "customProperties");
531
+ s(this, "priority", 5);
532
+ }
533
+ apply(e, t) {
534
+ if (!t.element) return;
535
+ const i = this.computeCustomPropertyStyles(this.properties);
536
+ this.applyStyles(t.element, i);
537
+ }
538
+ computeCustomPropertyStyles(e) {
539
+ const t = {};
540
+ return Object.entries(e.properties).forEach(([i, a]) => {
541
+ const n = i.startsWith("--") ? i : `--${i}`;
542
+ t[n] = this.formatPropertyValue(a);
543
+ }), t;
544
+ }
545
+ formatPropertyValue(e) {
546
+ return typeof e == "number" ? e.toString() : String(e);
547
+ }
548
+ }
549
+ function Xe(r) {
550
+ return new g({
551
+ properties: r.properties,
552
+ scope: r.scope || "local"
553
+ });
554
+ }
555
+ function Ye(r, o, e) {
556
+ return new g({
557
+ properties: { [r]: o },
558
+ scope: e || "local"
559
+ });
560
+ }
561
+ function Je(r) {
562
+ return new g({
563
+ properties: r,
564
+ scope: "local"
565
+ });
566
+ }
567
+ function mt(r) {
568
+ const o = {};
569
+ return Object.entries(r).forEach(([e, t]) => {
570
+ if (t !== void 0) {
571
+ const i = e.replace(
572
+ /[A-Z]/g,
573
+ (a) => `-${a.toLowerCase()}`
574
+ );
575
+ o[`--theme-color-${i}`] = t;
576
+ }
577
+ }), new g({
578
+ properties: o,
579
+ scope: "local"
580
+ });
581
+ }
582
+ function gt(r) {
583
+ const o = {};
584
+ return Object.entries(r).forEach(([e, t]) => {
585
+ t !== void 0 && (o[`--token-${e}`] = t);
586
+ }), new g({
587
+ properties: o,
588
+ scope: "local"
589
+ });
590
+ }
591
+ const Qe = [
592
+ // Basic layout modifiers
593
+ ["padding", ne],
594
+ ["paddingTop", se],
595
+ ["paddingBottom", de],
596
+ ["paddingLeft", le],
597
+ ["paddingRight", ce],
598
+ ["paddingLeading", fe],
599
+ ["paddingTrailing", pe],
600
+ ["paddingHorizontal", ue],
601
+ ["paddingVertical", me],
602
+ ["margin", ge],
603
+ ["marginTop", be],
604
+ ["marginBottom", he],
605
+ ["marginLeft", ye],
606
+ ["marginRight", Ie],
607
+ ["marginLeading", xe],
608
+ ["marginTrailing", ve],
609
+ ["marginHorizontal", Ae],
610
+ ["marginVertical", we],
611
+ ["size", Se],
612
+ ["width", Me],
613
+ ["height", Te],
614
+ ["maxWidth", Ce],
615
+ ["maxHeight", $e],
616
+ ["minWidth", Pe],
617
+ ["minHeight", Re],
618
+ // Advanced layout modifiers - only core functions that exist
619
+ ["aspectRatio", w],
620
+ ["fixedSize", S],
621
+ ["offset", M],
622
+ ["overlay", T],
623
+ ["position", C],
624
+ ["scaleEffect", $],
625
+ ["zIndex", P],
626
+ // Appearance modifiers - core functions only
627
+ ["backgroundColor", k],
628
+ ["border", z],
629
+ ["clipShape", D],
630
+ ["clipped", O],
631
+ ["foregroundColor", L],
632
+ // Typography modifiers - core functions only
633
+ ["typography", N],
634
+ ["textAlign", U],
635
+ ["font", H],
636
+ ["lineClamp", j],
637
+ ["wordBreak", W],
638
+ // Interaction modifiers
639
+ ["allowsHitTesting", F],
640
+ ["focusable", K],
641
+ ["activatable", q],
642
+ ["editable", G],
643
+ ["focused", Z],
644
+ ["keyboardShortcut", _],
645
+ ["onContinuousHover", X],
646
+ ["onLongPressGesture", Y],
647
+ ["scroll", J],
648
+ ["scrollBehavior", Q],
649
+ ["overscrollBehavior", ee],
650
+ ["overscrollBehaviorX", te],
651
+ ["overscrollBehaviorY", re],
652
+ ["scrollMargin", ie],
653
+ ["scrollPadding", oe],
654
+ ["scrollSnap", ae],
655
+ // Utility modifiers
656
+ ["css", R],
657
+ ["cssProperty", E],
658
+ ["cssVariable", B],
659
+ ["utility", V],
660
+ // Attribute modifiers
661
+ ["aria", _e],
662
+ ["customProperties", Xe],
663
+ ["customProperty", Ye],
664
+ ["cssVariables", Je],
665
+ ["id", Fe],
666
+ ["data", qe],
667
+ ["tabIndex", Ze],
668
+ // Element modifiers
669
+ ["before", p],
670
+ ["after", m],
671
+ ["pseudoElements", Be],
672
+ ["iconBefore", Ve],
673
+ ["iconAfter", ke],
674
+ ["lineBefore", ze],
675
+ ["lineAfter", De],
676
+ ["quotes", Oe],
677
+ ["underline", Le],
678
+ ["badge", Ne],
679
+ ["tooltip", Ue],
680
+ ["cornerRibbon", He],
681
+ ["spinner", je]
682
+ ];
683
+ function et() {
684
+ let r = 0, o = 0;
685
+ Qe.forEach(([e, t]) => {
686
+ try {
687
+ A.register(e, t), r++;
688
+ } catch (i) {
689
+ console.warn(`Failed to register modifier '${e}':`, i), o++;
690
+ }
691
+ }), console.log(
692
+ `@tachui/modifiers: Registered ${r} modifiers${o > 0 ? `, ${o} failed` : ""}`
693
+ );
694
+ }
695
+ et();
696
+ export {
697
+ Xr as AllowsHitTestingModifier,
698
+ yt as AnimationModifier,
699
+ It as AppearanceModifier,
700
+ h as AriaModifier,
701
+ Tt as AspectRatioModifier,
702
+ rr as BackgroundClipModifier,
703
+ ir as BackgroundModifier,
704
+ u as BaseModifier,
705
+ or as BorderModifier,
706
+ qt as CSSModifier,
707
+ ar as ClipShapeModifier,
708
+ nr as ClippedModifier,
709
+ sr as CornerRadiusModifier,
710
+ g as CustomPropertiesModifier,
711
+ Ke as DataModifier,
712
+ Ct as FixedSizeModifier,
713
+ $t as FlexboxModifier,
714
+ Yr as FocusableModifier,
715
+ Jr as FocusedModifier,
716
+ dr as ForegroundModifier,
717
+ Wr as HyphensModifier,
718
+ We as IdModifier,
719
+ xt as InteractionModifier,
720
+ Qr as KeyboardShortcutModifier,
721
+ vt as LayoutModifier,
722
+ At as LifecycleModifier,
723
+ Fr as LineClampModifier,
724
+ pi as MarginModifier,
725
+ St as ModifierPriority,
726
+ Pt as OffsetModifier,
727
+ ei as OnContinuousHoverModifier,
728
+ ti as OnLongPressGestureModifier,
729
+ Kr as OverflowWrapModifier,
730
+ Rt as OverlayModifier,
731
+ li as PaddingModifier,
732
+ Et as PositionModifier,
733
+ f as PseudoElementModifier,
734
+ Bt as ScaleEffectModifier,
735
+ ri as ScrollModifier,
736
+ gi as SizeModifier,
737
+ Ge as TabIndexModifier,
738
+ $r as TypographyModifier,
739
+ Gt as UtilityModifier,
740
+ qr as WordBreakModifier,
741
+ Vt as ZIndexModifier,
742
+ q as activatable,
743
+ m as after,
744
+ kt as alignItems,
745
+ zt as alignSelf,
746
+ F as allowsHitTesting,
747
+ _e as aria,
748
+ w as aspectRatio,
749
+ lr as background,
750
+ cr as backgroundClip,
751
+ k as backgroundColor,
752
+ Ne as badge,
753
+ p as before,
754
+ fr as blueGradientText,
755
+ z as border,
756
+ pr as borderBottom,
757
+ ur as borderHorizontal,
758
+ mr as borderLeading,
759
+ gr as borderLeft,
760
+ br as borderRight,
761
+ hr as borderTop,
762
+ yr as borderTrailing,
763
+ Ir as borderVertical,
764
+ D as clipShape,
765
+ O as clipped,
766
+ xr as cornerRadius,
767
+ He as cornerRibbon,
768
+ R as css,
769
+ E as cssProperty,
770
+ B as cssVariable,
771
+ Je as cssVariables,
772
+ Zt as cssVendor,
773
+ _t as cursor,
774
+ Pr as custom,
775
+ Xe as customProperties,
776
+ Ye as customProperty,
777
+ qe as data,
778
+ gt as designTokens,
779
+ ii as disableHitTesting,
780
+ Xt as display,
781
+ G as editable,
782
+ oi as enableHitTesting,
783
+ S as fixedSize,
784
+ Dt as flexBasis,
785
+ Ot as flexDirection,
786
+ Lt as flexGrow,
787
+ Nt as flexShrink,
788
+ Ut as flexWrap,
789
+ Ht as flexbox,
790
+ jt as flexboxPresets,
791
+ K as focusable,
792
+ Z as focused,
793
+ H as font,
794
+ Rr as fontFamily,
795
+ Er as fontSize,
796
+ Br as fontWeight,
797
+ vr as foreground,
798
+ L as foregroundColor,
799
+ Wt as gap,
800
+ Ar as goldGradientText,
801
+ wr as gradientText,
802
+ Te as height,
803
+ Gr as hyphens,
804
+ ke as iconAfter,
805
+ Ve as iconBefore,
806
+ Fe as id,
807
+ Ft as justifyContent,
808
+ _ as keyboardShortcut,
809
+ ai as keyboardShortcutBuilder,
810
+ Vr as letterSpacing,
811
+ De as lineAfter,
812
+ ze as lineBefore,
813
+ j as lineClamp,
814
+ kr as lineHeight,
815
+ ge as margin,
816
+ he as marginBottom,
817
+ Ae as marginHorizontal,
818
+ xe as marginLeading,
819
+ ye as marginLeft,
820
+ ui as marginPresets,
821
+ Ie as marginRight,
822
+ be as marginTop,
823
+ ve as marginTrailing,
824
+ we as marginVertical,
825
+ $e as maxHeight,
826
+ Ce as maxWidth,
827
+ Re as minHeight,
828
+ Pe as minWidth,
829
+ Sr as oceanGradientText,
830
+ M as offset,
831
+ X as onContinuousHover,
832
+ ni as onContinuousHoverGlobal,
833
+ si as onContinuousHoverLocal,
834
+ Y as onLongPressGesture,
835
+ Yt as outline,
836
+ Jt as outlineOffset,
837
+ zr as overflow,
838
+ Zr as overflowWrap,
839
+ Qt as overflowX,
840
+ er as overflowY,
841
+ T as overlay,
842
+ ee as overscrollBehavior,
843
+ te as overscrollBehaviorX,
844
+ re as overscrollBehaviorY,
845
+ ne as padding,
846
+ de as paddingBottom,
847
+ ue as paddingHorizontal,
848
+ fe as paddingLeading,
849
+ le as paddingLeft,
850
+ ci as paddingPresets,
851
+ ce as paddingRight,
852
+ se as paddingTop,
853
+ pe as paddingTrailing,
854
+ me as paddingVertical,
855
+ C as position,
856
+ Be as pseudoElements,
857
+ Oe as quotes,
858
+ Mr as rainbowGradientText,
859
+ $ as scaleEffect,
860
+ J as scroll,
861
+ Q as scrollBehavior,
862
+ ie as scrollMargin,
863
+ oe as scrollPadding,
864
+ ae as scrollSnap,
865
+ Se as size,
866
+ je as spinner,
867
+ Tr as sunsetGradientText,
868
+ Dr as system,
869
+ Ze as tabIndex,
870
+ U as textAlign,
871
+ Or as textCase,
872
+ Lr as textDecoration,
873
+ Nr as textOverflow,
874
+ Ur as textTransform,
875
+ mt as themeColors,
876
+ Ue as tooltip,
877
+ N as typography,
878
+ Le as underline,
879
+ V as utility,
880
+ Hr as whiteSpace,
881
+ Me as width,
882
+ W as wordBreak,
883
+ P as zIndex
884
+ };
885
+ //# sourceMappingURL=index.js.map