@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
@@ -0,0 +1,282 @@
1
+ var p = Object.defineProperty;
2
+ var b = (r, i, e) => i in r ? p(r, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[i] = e;
3
+ var n = (r, i, e) => b(r, typeof i != "symbol" ? i + "" : i, e);
4
+ import { B as a } from "./base-CkGf4b9G.js";
5
+ class c extends a {
6
+ constructor() {
7
+ super(...arguments);
8
+ n(this, "type", "background");
9
+ n(this, "priority", 95);
10
+ }
11
+ apply(e, t) {
12
+ if (!t.element) return;
13
+ const o = t.element, d = this.resolveBackground(this.properties.background);
14
+ d && (o.style.background = d);
15
+ }
16
+ resolveBackground(e) {
17
+ return typeof e == "string" ? e : typeof e == "object" && e !== null && "resolve" in e ? e.resolve() : typeof e == "object" && e !== null && "value" in e ? e.value : String(e);
18
+ }
19
+ }
20
+ class y extends a {
21
+ constructor() {
22
+ super(...arguments);
23
+ n(this, "type", "backgroundClip");
24
+ n(this, "priority", 40);
25
+ }
26
+ apply(e, t) {
27
+ if (!t.element) return;
28
+ const o = this.computeBackgroundClipStyles(this.properties);
29
+ this.applyStyles(t.element, o);
30
+ }
31
+ computeBackgroundClipStyles(e) {
32
+ const t = {};
33
+ return e.backgroundImage && (t.backgroundImage = e.backgroundImage), e.backgroundClip && (t.backgroundClip = e.backgroundClip, t.webkitBackgroundClip = e.backgroundClip), e.color && (t.color = e.color, e.backgroundClip === "text" && (t.webkitTextFillColor = e.color)), t;
34
+ }
35
+ }
36
+ function w(r) {
37
+ return new c({ background: r });
38
+ }
39
+ function B(r) {
40
+ return new c({ background: r });
41
+ }
42
+ function R(r, i = "text", e = "transparent") {
43
+ return new y({
44
+ backgroundImage: r,
45
+ backgroundClip: i,
46
+ color: e
47
+ });
48
+ }
49
+ function s(r) {
50
+ return new y({
51
+ backgroundImage: r,
52
+ backgroundClip: "text",
53
+ color: "transparent"
54
+ });
55
+ }
56
+ function k() {
57
+ return s("linear-gradient(45deg, #007AFF, #5856D6)");
58
+ }
59
+ function T() {
60
+ return s(
61
+ "linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #80ff00, #00ff80, #0080ff, #8000ff)"
62
+ );
63
+ }
64
+ function x() {
65
+ return s("linear-gradient(45deg, #ff6b6b, #feca57, #ff9ff3)");
66
+ }
67
+ function L() {
68
+ return s("linear-gradient(45deg, #667eea, #764ba2)");
69
+ }
70
+ function $() {
71
+ return s("linear-gradient(45deg, #f7971e, #ffd200)");
72
+ }
73
+ class l extends a {
74
+ constructor() {
75
+ super(...arguments);
76
+ n(this, "type", "border");
77
+ n(this, "priority", 40);
78
+ }
79
+ apply(e, t) {
80
+ if (!t.element) return;
81
+ const o = this.computeBorderStyles(this.properties);
82
+ this.applyStyles(t.element, o);
83
+ }
84
+ computeBorderStyles(e) {
85
+ const t = {}, o = this.resolveBorderSides(e);
86
+ return !(o.top || o.right || o.bottom || o.left || e.all) && (e.width !== void 0 || e.color !== void 0 || e.style !== void 0) && (e.width !== void 0 && (t.borderWidth = this.formatBorderWidth(e.width)), e.color !== void 0 && (t.borderColor = e.color), e.style !== void 0 && (t.borderStyle = e.style)), e.all !== void 0 && (e.all.width !== void 0 && (t.borderWidth = this.formatBorderWidth(e.all.width)), e.all.color !== void 0 && (t.borderColor = e.all.color), e.all.style !== void 0 && (t.borderStyle = e.all.style)), o.top !== void 0 && this.applySideBorder(t, o.top, "Top"), o.right !== void 0 && this.applySideBorder(t, o.right, "Right"), o.bottom !== void 0 && this.applySideBorder(t, o.bottom, "Bottom"), o.left !== void 0 && this.applySideBorder(t, o.left, "Left"), t;
87
+ }
88
+ resolveBorderSides(e) {
89
+ return {
90
+ top: e.top || e.vertical,
91
+ right: e.right || e.trailing || e.horizontal,
92
+ bottom: e.bottom || e.vertical,
93
+ left: e.left || e.leading || e.horizontal
94
+ };
95
+ }
96
+ applySideBorder(e, t, o) {
97
+ t.width !== void 0 && (e[`border${o}Width`] = this.formatBorderWidth(t.width)), t.color !== void 0 && (e[`border${o}Color`] = t.color), t.style !== void 0 && (e[`border${o}Style`] = t.style);
98
+ }
99
+ formatBorderWidth(e) {
100
+ return typeof e == "number" ? `${e}px` : e;
101
+ }
102
+ }
103
+ class g extends a {
104
+ constructor() {
105
+ super(...arguments);
106
+ n(this, "type", "cornerRadius");
107
+ n(this, "priority", 35);
108
+ }
109
+ apply(e, t) {
110
+ if (!t.element) return;
111
+ const o = this.computeCornerRadiusStyles(this.properties.radius);
112
+ this.applyStyles(t.element, o);
113
+ }
114
+ computeCornerRadiusStyles(e) {
115
+ return typeof e == "number" || typeof e == "string" ? { borderRadius: this.formatRadius(e) } : this.generateCornerRadiusCSS(e);
116
+ }
117
+ generateCornerRadiusCSS(e) {
118
+ const t = this.resolveCornerValues(e), o = {};
119
+ return Object.entries(t).forEach(([d, u]) => {
120
+ if (u !== void 0) {
121
+ const f = this.cornerToCSSProperty(
122
+ d
123
+ );
124
+ o[f] = this.formatRadius(u);
125
+ }
126
+ }), o;
127
+ }
128
+ cornerToCSSProperty(e) {
129
+ return {
130
+ topLeft: "borderTopLeftRadius",
131
+ topRight: "borderTopRightRadius",
132
+ bottomLeft: "borderBottomLeftRadius",
133
+ bottomRight: "borderBottomRightRadius"
134
+ }[e];
135
+ }
136
+ resolveCornerValues(e) {
137
+ return {
138
+ topLeft: e.topLeft ?? e.topLeading ?? e.top ?? e.left,
139
+ topRight: e.topRight ?? e.topTrailing ?? e.top ?? e.right,
140
+ bottomLeft: e.bottomLeft ?? e.bottomLeading ?? e.bottom ?? e.left,
141
+ bottomRight: e.bottomRight ?? e.bottomTrailing ?? e.bottom ?? e.right
142
+ };
143
+ }
144
+ formatRadius(e) {
145
+ return typeof e == "number" ? `${e}px` : e;
146
+ }
147
+ }
148
+ function M(r, i, e) {
149
+ return typeof r == "number" || typeof r == "string" ? new l({
150
+ width: r,
151
+ color: i || "currentColor",
152
+ style: e || "solid"
153
+ }) : new l(r);
154
+ }
155
+ function P(r, i, e) {
156
+ return new l({ top: { width: r, color: i, style: e } });
157
+ }
158
+ function _(r, i, e) {
159
+ return new l({ right: { width: r, color: i, style: e } });
160
+ }
161
+ function z(r, i, e) {
162
+ return new l({ bottom: { width: r, color: i, style: e } });
163
+ }
164
+ function F(r, i, e) {
165
+ return new l({ left: { width: r, color: i, style: e } });
166
+ }
167
+ function G(r, i, e) {
168
+ return new l({ leading: { width: r, color: i, style: e } });
169
+ }
170
+ function j(r, i, e) {
171
+ return new l({ trailing: { width: r, color: i, style: e } });
172
+ }
173
+ function I(r, i, e) {
174
+ return new l({ horizontal: { width: r, color: i, style: e } });
175
+ }
176
+ function V(r, i, e) {
177
+ return new l({ vertical: { width: r, color: i, style: e } });
178
+ }
179
+ function W(r) {
180
+ return new g({ radius: r });
181
+ }
182
+ class h extends a {
183
+ constructor() {
184
+ super(...arguments);
185
+ n(this, "type", "foreground");
186
+ n(this, "priority", 90);
187
+ }
188
+ apply(e, t) {
189
+ if (!t.element) return;
190
+ const o = t.element;
191
+ o.style.color = this.properties.color;
192
+ }
193
+ }
194
+ function A(r) {
195
+ return new h({ color: r });
196
+ }
197
+ function X(r) {
198
+ return new h({ color: r });
199
+ }
200
+ class m extends a {
201
+ constructor() {
202
+ super(...arguments);
203
+ n(this, "type", "clip-shape");
204
+ n(this, "priority", 90);
205
+ }
206
+ apply(e, t) {
207
+ if (!t.element) return;
208
+ const o = t.element;
209
+ if (!o.style) return;
210
+ const { shape: d, parameters: u = {} } = this.properties, f = this.generateClipPath(d, u);
211
+ f && (o.style.clipPath = f);
212
+ }
213
+ generateClipPath(e, t) {
214
+ switch (e) {
215
+ case "circle":
216
+ return "circle(50%)";
217
+ case "ellipse": {
218
+ const o = t && t.radiusX || "50%", d = t && t.radiusY || "50%";
219
+ return `ellipse(${o} ${d} at center)`;
220
+ }
221
+ case "rect":
222
+ return `inset(${t && t.inset || 0}px)`;
223
+ case "polygon": {
224
+ const o = t && t.points;
225
+ return o ? `polygon(${o})` : "";
226
+ }
227
+ default:
228
+ return "";
229
+ }
230
+ }
231
+ }
232
+ function Y(r, i) {
233
+ return new m({ shape: r, parameters: i || {} });
234
+ }
235
+ class v extends a {
236
+ constructor() {
237
+ super(...arguments);
238
+ n(this, "type", "clipped");
239
+ n(this, "priority", 89);
240
+ }
241
+ apply(e, t) {
242
+ if (!t.element) return;
243
+ const o = t.element;
244
+ o.style && (this.properties.clipped ? o.style.overflow = "hidden" : o.style.overflow = "");
245
+ }
246
+ }
247
+ function q(r = !0) {
248
+ return new v({ clipped: r });
249
+ }
250
+ export {
251
+ q as A,
252
+ c as B,
253
+ g as C,
254
+ h as F,
255
+ y as a,
256
+ w as b,
257
+ B as c,
258
+ R as d,
259
+ k as e,
260
+ $ as f,
261
+ s as g,
262
+ l as h,
263
+ M as i,
264
+ P as j,
265
+ _ as k,
266
+ z as l,
267
+ F as m,
268
+ G as n,
269
+ L as o,
270
+ j as p,
271
+ I as q,
272
+ T as r,
273
+ x as s,
274
+ V as t,
275
+ W as u,
276
+ A as v,
277
+ X as w,
278
+ m as x,
279
+ Y as y,
280
+ v as z
281
+ };
282
+ //# sourceMappingURL=clipped-CCW8gJqJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipped-CCW8gJqJ.js","sources":["../src/appearance/background.ts","../src/appearance/border.ts","../src/appearance/foreground.ts","../src/appearance/clip-shape.ts","../src/appearance/clipped.ts"],"sourcesContent":["/**\n * Background Modifiers\n *\n * Background styling modifiers with asset and gradient support\n */\n\nimport { BaseModifier } from '../basic/base'\nimport type { ModifierContext } from '@tachui/core/modifiers/types'\nimport type { DOMNode } from '@tachui/core/runtime/types'\n\nexport interface BackgroundOptions {\n background: string | any\n}\n\nexport class BackgroundModifier extends BaseModifier<BackgroundOptions> {\n readonly type = 'background'\n readonly priority = 95\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const element = context.element as HTMLElement\n const cssValue = this.resolveBackground(this.properties.background)\n\n if (cssValue) {\n element.style.background = cssValue\n }\n\n return undefined\n }\n\n private resolveBackground(background: any): string {\n if (typeof background === 'string') {\n return background\n }\n\n if (\n typeof background === 'object' &&\n background !== null &&\n 'resolve' in background\n ) {\n return background.resolve()\n }\n\n if (\n typeof background === 'object' &&\n background !== null &&\n 'value' in background\n ) {\n return background.value\n }\n\n return String(background)\n }\n}\n\nexport interface BackgroundClipOptions {\n backgroundImage?: string\n backgroundClip?: 'text' | 'border-box' | 'padding-box' | 'content-box'\n color?: string\n}\n\nexport class BackgroundClipModifier extends BaseModifier<BackgroundClipOptions> {\n readonly type = 'backgroundClip'\n readonly priority = 40\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const styles = this.computeBackgroundClipStyles(this.properties)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private computeBackgroundClipStyles(props: BackgroundClipOptions) {\n const styles: Record<string, string> = {}\n\n if (props.backgroundImage) {\n styles.backgroundImage = props.backgroundImage\n }\n\n if (props.backgroundClip) {\n styles.backgroundClip = props.backgroundClip\n styles.webkitBackgroundClip = props.backgroundClip\n }\n\n if (props.color) {\n styles.color = props.color\n if (props.backgroundClip === 'text') {\n styles.webkitTextFillColor = props.color\n }\n }\n\n return styles\n }\n}\n\nexport function backgroundColor(color: string): BackgroundModifier {\n return new BackgroundModifier({ background: color })\n}\n\nexport function background(value: string): BackgroundModifier {\n return new BackgroundModifier({ background: value })\n}\n\nexport function backgroundClip(\n backgroundImage: string,\n clip: 'text' | 'border-box' | 'padding-box' | 'content-box' = 'text',\n color: string = 'transparent'\n): BackgroundClipModifier {\n return new BackgroundClipModifier({\n backgroundImage,\n backgroundClip: clip,\n color,\n })\n}\n\nexport function gradientText(gradient: string): BackgroundClipModifier {\n return new BackgroundClipModifier({\n backgroundImage: gradient,\n backgroundClip: 'text',\n color: 'transparent',\n })\n}\n\nexport function blueGradientText(): BackgroundClipModifier {\n return gradientText('linear-gradient(45deg, #007AFF, #5856D6)')\n}\n\nexport function rainbowGradientText(): BackgroundClipModifier {\n return gradientText(\n 'linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #80ff00, #00ff80, #0080ff, #8000ff)'\n )\n}\n\nexport function sunsetGradientText(): BackgroundClipModifier {\n return gradientText('linear-gradient(45deg, #ff6b6b, #feca57, #ff9ff3)')\n}\n\nexport function oceanGradientText(): BackgroundClipModifier {\n return gradientText('linear-gradient(45deg, #667eea, #764ba2)')\n}\n\nexport function goldGradientText(): BackgroundClipModifier {\n return gradientText('linear-gradient(45deg, #f7971e, #ffd200)')\n}\n","/**\n * Border Modifiers\n *\n * Comprehensive border styling with radius support\n */\n\nimport { BaseModifier } from '../basic/base'\nimport type { ModifierContext } from '@tachui/core/modifiers/types'\nimport type { DOMNode } from '@tachui/core/runtime/types'\n\nexport type BorderStyle =\n | 'none'\n | 'solid'\n | 'dashed'\n | 'dotted'\n | 'double'\n | 'groove'\n | 'ridge'\n | 'inset'\n | 'outset'\n\nexport interface BorderSide {\n width?: number | string\n color?: string\n style?: BorderStyle\n}\n\nexport interface BorderOptions {\n top?: BorderSide\n right?: BorderSide\n bottom?: BorderSide\n left?: BorderSide\n all?: BorderSide\n\n leading?: BorderSide\n trailing?: BorderSide\n horizontal?: BorderSide\n vertical?: BorderSide\n\n width?: number | string\n color?: string\n style?: BorderStyle\n}\n\nexport class BorderModifier extends BaseModifier<BorderOptions> {\n readonly type = 'border'\n readonly priority = 40\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const styles = this.computeBorderStyles(this.properties)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private computeBorderStyles(props: BorderOptions) {\n const styles: Record<string, any> = {}\n\n const resolvedSides = this.resolveBorderSides(props)\n\n const hasSpecificSides =\n resolvedSides.top ||\n resolvedSides.right ||\n resolvedSides.bottom ||\n resolvedSides.left ||\n props.all\n if (\n !hasSpecificSides &&\n (props.width !== undefined ||\n props.color !== undefined ||\n props.style !== undefined)\n ) {\n if (props.width !== undefined)\n styles.borderWidth = this.formatBorderWidth(props.width)\n if (props.color !== undefined) styles.borderColor = props.color\n if (props.style !== undefined) styles.borderStyle = props.style\n }\n\n if (props.all !== undefined) {\n if (props.all.width !== undefined)\n styles.borderWidth = this.formatBorderWidth(props.all.width)\n if (props.all.color !== undefined) styles.borderColor = props.all.color\n if (props.all.style !== undefined) styles.borderStyle = props.all.style\n }\n\n if (resolvedSides.top !== undefined) {\n this.applySideBorder(styles, resolvedSides.top, 'Top')\n }\n if (resolvedSides.right !== undefined) {\n this.applySideBorder(styles, resolvedSides.right, 'Right')\n }\n if (resolvedSides.bottom !== undefined) {\n this.applySideBorder(styles, resolvedSides.bottom, 'Bottom')\n }\n if (resolvedSides.left !== undefined) {\n this.applySideBorder(styles, resolvedSides.left, 'Left')\n }\n\n return styles\n }\n\n private resolveBorderSides(props: BorderOptions) {\n return {\n top: props.top || props.vertical,\n right: props.right || props.trailing || props.horizontal,\n bottom: props.bottom || props.vertical,\n left: props.left || props.leading || props.horizontal,\n }\n }\n\n private applySideBorder(\n styles: Record<string, any>,\n side: BorderSide,\n sideName: string\n ) {\n if (side.width !== undefined) {\n styles[`border${sideName}Width`] = this.formatBorderWidth(side.width)\n }\n if (side.color !== undefined) {\n styles[`border${sideName}Color`] = side.color\n }\n if (side.style !== undefined) {\n styles[`border${sideName}Style`] = side.style\n }\n }\n\n private formatBorderWidth(width: number | string): string {\n return typeof width === 'number' ? `${width}px` : width\n }\n}\n\nexport type CornerRadiusValue = number | string\n\nexport interface CornerRadiusConfig {\n topLeft?: CornerRadiusValue\n topRight?: CornerRadiusValue\n bottomLeft?: CornerRadiusValue\n bottomRight?: CornerRadiusValue\n\n topLeading?: CornerRadiusValue\n topTrailing?: CornerRadiusValue\n bottomLeading?: CornerRadiusValue\n bottomTrailing?: CornerRadiusValue\n\n top?: CornerRadiusValue\n bottom?: CornerRadiusValue\n left?: CornerRadiusValue\n right?: CornerRadiusValue\n}\n\nexport interface CornerRadiusOptions {\n radius: number | string | CornerRadiusConfig\n}\n\nexport class CornerRadiusModifier extends BaseModifier<CornerRadiusOptions> {\n readonly type = 'cornerRadius'\n readonly priority = 35\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const styles = this.computeCornerRadiusStyles(this.properties.radius)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private computeCornerRadiusStyles(\n radius: number | string | CornerRadiusConfig\n ) {\n if (typeof radius === 'number' || typeof radius === 'string') {\n return { borderRadius: this.formatRadius(radius) }\n }\n\n return this.generateCornerRadiusCSS(radius)\n }\n\n private generateCornerRadiusCSS(\n config: CornerRadiusConfig\n ): Record<string, string> {\n const corners = this.resolveCornerValues(config)\n const styles: Record<string, string> = {}\n\n Object.entries(corners).forEach(([corner, value]) => {\n if (value !== undefined) {\n const cssProperty = this.cornerToCSSProperty(\n corner as keyof typeof corners\n )\n styles[cssProperty] = this.formatRadius(value)\n }\n })\n\n return styles\n }\n\n private cornerToCSSProperty(\n corner: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'\n ): string {\n const map = {\n topLeft: 'borderTopLeftRadius',\n topRight: 'borderTopRightRadius',\n bottomLeft: 'borderBottomLeftRadius',\n bottomRight: 'borderBottomRightRadius',\n }\n return map[corner]\n }\n\n private resolveCornerValues(config: CornerRadiusConfig) {\n return {\n topLeft: config.topLeft ?? config.topLeading ?? config.top ?? config.left,\n topRight:\n config.topRight ?? config.topTrailing ?? config.top ?? config.right,\n bottomLeft:\n config.bottomLeft ??\n config.bottomLeading ??\n config.bottom ??\n config.left,\n bottomRight:\n config.bottomRight ??\n config.bottomTrailing ??\n config.bottom ??\n config.right,\n }\n }\n\n private formatRadius(value: CornerRadiusValue): string {\n return typeof value === 'number' ? `${value}px` : value\n }\n}\n\nexport function border(options: BorderOptions): BorderModifier\nexport function border(\n width: number | string,\n color?: string,\n style?: BorderStyle\n): BorderModifier\nexport function border(\n optionsOrWidth: BorderOptions | number | string,\n color?: string,\n style?: BorderStyle\n): BorderModifier {\n if (\n typeof optionsOrWidth === 'number' ||\n typeof optionsOrWidth === 'string'\n ) {\n return new BorderModifier({\n width: optionsOrWidth,\n color: color || 'currentColor',\n style: style || 'solid',\n })\n }\n return new BorderModifier(optionsOrWidth)\n}\n\nexport function borderTop(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ top: { width, color, style } })\n}\n\nexport function borderRight(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ right: { width, color, style } })\n}\n\nexport function borderBottom(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ bottom: { width, color, style } })\n}\n\nexport function borderLeft(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ left: { width, color, style } })\n}\n\nexport function borderLeading(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ leading: { width, color, style } })\n}\n\nexport function borderTrailing(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ trailing: { width, color, style } })\n}\n\nexport function borderHorizontal(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ horizontal: { width, color, style } })\n}\n\nexport function borderVertical(\n width: number | string,\n color: string,\n style?: BorderStyle\n): BorderModifier {\n return new BorderModifier({ vertical: { width, color, style } })\n}\n\nexport function cornerRadius(value: number | string): CornerRadiusModifier\nexport function cornerRadius(config: CornerRadiusConfig): CornerRadiusModifier\nexport function cornerRadius(\n value: number | string | CornerRadiusConfig\n): CornerRadiusModifier {\n return new CornerRadiusModifier({ radius: value })\n}\n","/**\n * Foreground Modifiers\n *\n * Text color and foreground styling modifiers\n */\n\nimport { BaseModifier } from '../basic/base'\nimport type { ModifierContext } from '@tachui/core/modifiers/types'\nimport type { DOMNode } from '@tachui/core/runtime/types'\n\nexport interface ForegroundOptions {\n color: string\n}\n\nexport class ForegroundModifier extends BaseModifier<ForegroundOptions> {\n readonly type = 'foreground'\n readonly priority = 90\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const element = context.element as HTMLElement\n element.style.color = this.properties.color\n\n return undefined\n }\n}\n\nexport function foregroundColor(color: string): ForegroundModifier {\n return new ForegroundModifier({ color })\n}\n\nexport function foreground(color: string): ForegroundModifier {\n return new ForegroundModifier({ color })\n}\n","/**\n * Clip Shape Modifier\n *\n * SwiftUI-inspired modifier for clipping content to various shapes\n */\n\nimport { BaseModifier } from '../basic/base'\nimport type { ModifierContext } from '@tachui/core/modifiers/types'\nimport type { DOMNode } from '@tachui/core/runtime/types'\n\nexport interface ClipShapeOptions {\n shape: 'circle' | 'ellipse' | 'rect' | 'polygon'\n parameters?: Record<string, any>\n}\n\nexport class ClipShapeModifier extends BaseModifier<ClipShapeOptions> {\n readonly type = 'clip-shape'\n readonly priority = 90\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const element = context.element as HTMLElement\n if (!element.style) return\n const { shape, parameters = {} } = this.properties\n\n const clipPath = this.generateClipPath(shape, parameters)\n if (clipPath) {\n element.style.clipPath = clipPath\n }\n\n return undefined\n }\n\n private generateClipPath(\n shape: ClipShapeOptions['shape'],\n parameters: Record<string, any>\n ): string {\n switch (shape) {\n case 'circle':\n return 'circle(50%)'\n\n case 'ellipse': {\n const radiusX = (parameters && parameters.radiusX) || '50%'\n const radiusY = (parameters && parameters.radiusY) || '50%'\n return `ellipse(${radiusX} ${radiusY} at center)`\n }\n\n case 'rect': {\n const inset = (parameters && parameters.inset) || 0\n return `inset(${inset}px)`\n }\n\n case 'polygon': {\n const points = parameters && parameters.points\n if (!points) return ''\n return `polygon(${points})`\n }\n\n default:\n return ''\n }\n }\n}\n\n/**\n * Creates a clip shape modifier that clips content to the specified shape\n */\nexport function clipShape(\n shape: 'circle' | 'ellipse' | 'rect' | 'polygon',\n parameters?: Record<string, any>\n): ClipShapeModifier {\n return new ClipShapeModifier({ shape, parameters: parameters || {} })\n}\n","/**\n * Clipped Modifier\n *\n * SwiftUI-inspired modifier for clipping content to its bounds\n */\n\nimport { BaseModifier } from '../basic/base'\nimport type { ModifierContext } from '@tachui/core/modifiers/types'\nimport type { DOMNode } from '@tachui/core/runtime/types'\n\nexport interface ClippedOptions {\n clipped: boolean\n}\n\nexport class ClippedModifier extends BaseModifier<ClippedOptions> {\n readonly type = 'clipped'\n readonly priority = 89\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const element = context.element as HTMLElement\n if (!element.style) return\n\n if (this.properties.clipped) {\n element.style.overflow = 'hidden'\n } else {\n // Reset to default if explicitly set to false\n element.style.overflow = ''\n }\n\n return undefined\n }\n}\n\n/**\n * Creates a clipped modifier that clips content to its bounds\n */\nexport function clipped(enabled = true): ClippedModifier {\n return new ClippedModifier({ clipped: enabled })\n}\n"],"names":["BackgroundModifier","BaseModifier","__publicField","_node","context","element","cssValue","background","BackgroundClipModifier","styles","props","backgroundColor","color","value","backgroundClip","backgroundImage","clip","gradientText","gradient","blueGradientText","rainbowGradientText","sunsetGradientText","oceanGradientText","goldGradientText","BorderModifier","resolvedSides","side","sideName","width","CornerRadiusModifier","radius","config","corners","corner","cssProperty","border","optionsOrWidth","style","borderTop","borderRight","borderBottom","borderLeft","borderLeading","borderTrailing","borderHorizontal","borderVertical","cornerRadius","ForegroundModifier","foregroundColor","foreground","ClipShapeModifier","shape","parameters","clipPath","radiusX","radiusY","points","cl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AAcA,EAAW,WAAY;AACtD,eAAO,WAAWE,CAAO,IAAIC,CAAO;AAAA,MACtC;AAAA,MAEA,KAAK;AAEH,eAAO,SADQH,KAAcA,EAAW,SAAU,CAC7B;AAAA,MAGvB,KAAK,WAAW;AACd,cAAMI,IAASJ,KAAcA,EAAW;AACxC,eAAKI,IACE,WAAWA,CAAM,MADJ;AAAA,MAEtB;AAAA,MAEA;AACE,eAAO;AAAA,IAAA;AAAA,EAEb;AACF;AAKO,SAASC,EACdN,GACAC,GACmB;AACnB,SAAO,IAAIF,EAAkB,EAAE,OAAAC,GAAO,YAAYC,KAAc,CAAA,GAAI;AACtE;AC3DO,MAAMM,UAAwBzD,EAA6B;AAAA,EAA3D;AAAA;AACI,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA,kBAAW;AAAA;AAAA,EAEpB,MAAMC,GAAgBC,GAA+C;AACnE,QAAI,CAACA,EAAQ,QAAS;AAEtB,UAAMC,IAAUD,EAAQ;AACxB,IAAKC,EAAQ,UAET,KAAK,WAAW,UAClBA,EAAQ,MAAM,WAAW,WAGzBA,EAAQ,MAAM,WAAW;AAAA,EAI7B;AACF;AAKO,SAASsD,EAAQC,IAAU,IAAuB;AACvD,SAAO,IAAIF,EAAgB,EAAE,SAASE,GAAS;AACjD;"}
@@ -0,0 +1,124 @@
1
+ var a = Object.defineProperty;
2
+ var d = (i, o, e) => o in i ? a(i, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[o] = e;
3
+ var r = (i, o, e) => d(i, typeof o != "symbol" ? o + "" : o, e);
4
+ import { B as f } from "./base-CkGf4b9G.js";
5
+ class l extends f {
6
+ // Lower priority for utility properties
7
+ constructor(e) {
8
+ const t = {};
9
+ for (const [s, n] of Object.entries(e))
10
+ typeof n == "function" && "peek" in n ? t[s] = n.peek() : t[s] = n;
11
+ super(t);
12
+ r(this, "type", "utility");
13
+ r(this, "priority", 10);
14
+ }
15
+ apply(e, t) {
16
+ if (!t.element) return;
17
+ const s = this.computeUtilityStyles(this.properties);
18
+ this.applyStyles(t.element, s);
19
+ }
20
+ computeUtilityStyles(e) {
21
+ const t = {};
22
+ return e.cursor !== void 0 && (process.env.NODE_ENV === "development" && this.validateCursorValue(e.cursor), t.cursor = e.cursor), e.overflow !== void 0 && (t.overflow = e.overflow), e.overflowX !== void 0 && (t.overflowX = e.overflowX), e.overflowY !== void 0 && (t.overflowY = e.overflowY), e.position !== void 0 && (t.position = e.position), e.top !== void 0 && (t.top = this.toCSSValue(e.top)), e.right !== void 0 && (t.right = this.toCSSValue(e.right)), e.bottom !== void 0 && (t.bottom = this.toCSSValue(e.bottom)), e.left !== void 0 && (t.left = this.toCSSValue(e.left)), e.zIndex !== void 0 && (t.zIndex = e.zIndex.toString()), e.display !== void 0 && (t.display = e.display), e.visibility !== void 0 && (t.visibility = e.visibility), e.pointerEvents !== void 0 && (t.pointerEvents = e.pointerEvents), e.userSelect !== void 0 && (t.userSelect = e.userSelect), e.boxSizing !== void 0 && (t.boxSizing = e.boxSizing), e.objectFit !== void 0 && (t.objectFit = e.objectFit), e.objectPosition !== void 0 && (t.objectPosition = e.objectPosition), e.resize !== void 0 && (t.resize = e.resize), e.outline !== void 0 && (t.outline = e.outline), e.outlineOffset !== void 0 && (t.outlineOffset = this.toCSSValue(e.outlineOffset)), t;
23
+ }
24
+ validateCursorValue(e) {
25
+ ![
26
+ "auto",
27
+ "default",
28
+ "pointer",
29
+ "text",
30
+ "wait",
31
+ "help",
32
+ "not-allowed",
33
+ "none",
34
+ "grab",
35
+ "grabbing",
36
+ "zoom-in",
37
+ "zoom-out",
38
+ "alias",
39
+ "cell",
40
+ "copy"
41
+ ].includes(e) && !e.includes("url(") && console.warn(
42
+ `Unknown cursor value: "${e}". See documentation for valid cursor values.`
43
+ );
44
+ }
45
+ }
46
+ function S(i) {
47
+ return new l(i);
48
+ }
49
+ function w(i) {
50
+ return new l({ cursor: i });
51
+ }
52
+ function b(i) {
53
+ return new l({ overflowY: i });
54
+ }
55
+ function h(i) {
56
+ return new l({ overflowX: i });
57
+ }
58
+ function C(i) {
59
+ return new l({ display: i });
60
+ }
61
+ function m(i) {
62
+ return new l({ outline: i });
63
+ }
64
+ function z(i) {
65
+ return new l({ outlineOffset: i });
66
+ }
67
+ class u extends f {
68
+ // Very low priority so raw CSS doesn't override specific modifiers
69
+ constructor(e) {
70
+ const t = {};
71
+ for (const [s, n] of Object.entries(e))
72
+ typeof n == "function" && "peek" in n ? t[s] = n.peek() : t[s] = n;
73
+ super(t);
74
+ r(this, "type", "css");
75
+ r(this, "priority", 5);
76
+ }
77
+ apply(e, t) {
78
+ if (!t.element) return;
79
+ const s = this.computeCSSStyles(this.properties);
80
+ this.applyStyles(t.element, s);
81
+ }
82
+ computeCSSStyles(e) {
83
+ const t = {};
84
+ for (const [s, n] of Object.entries(e))
85
+ if (n !== void 0) {
86
+ const c = this.toCSSProperty(s);
87
+ t[c] = this.toCSSValue(n);
88
+ }
89
+ return t;
90
+ }
91
+ }
92
+ function g(i) {
93
+ return new u(i);
94
+ }
95
+ function O(i, o) {
96
+ return new u({ [i]: o });
97
+ }
98
+ function V(i, o) {
99
+ const e = i.startsWith("--") ? i : `--${i}`;
100
+ return new u({ [e]: o });
101
+ }
102
+ function j(i, o, e) {
103
+ const t = i.charAt(0).toUpperCase() + i.slice(1), s = `-${i.toLowerCase()}-${o}`, n = t + o.charAt(0).toUpperCase() + o.slice(1);
104
+ return new u({
105
+ [s]: e,
106
+ [n]: e
107
+ });
108
+ }
109
+ export {
110
+ u as C,
111
+ l as U,
112
+ h as a,
113
+ m as b,
114
+ w as c,
115
+ C as d,
116
+ z as e,
117
+ g as f,
118
+ O as g,
119
+ V as h,
120
+ j as i,
121
+ b as o,
122
+ S as u
123
+ };
124
+ //# sourceMappingURL=css-CJEXRr6H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-CJEXRr6H.js","sources":["../src/utility/utility.ts","../src/utility/css.ts"],"sourcesContent":["/**\n * Utility Modifier - miscellaneous CSS properties\n *\n * Provides access to various CSS properties that don't fit\n * into other specific modifier categories.\n */\n\nimport type { DOMNode } from '@tachui/core/runtime/types'\nimport { BaseModifier } from '../basic/base'\nimport type {\n ModifierContext,\n ReactiveModifierProps,\n} from '@tachui/core/modifiers/types'\n\nexport interface UtilityOptions {\n cursor?:\n | 'auto'\n | 'default'\n | 'pointer'\n | 'text'\n | 'wait'\n | 'help'\n | 'not-allowed'\n | 'none'\n | 'grab'\n | 'grabbing'\n | 'zoom-in'\n | 'zoom-out'\n | 'alias'\n | 'cell'\n | 'copy'\n | string // CSS cursor syntax: 'url(...), fallback'\n overflow?: 'visible' | 'hidden' | 'scroll' | 'auto'\n overflowX?: 'visible' | 'hidden' | 'scroll' | 'auto'\n overflowY?: 'visible' | 'hidden' | 'scroll' | 'auto'\n position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'\n top?: number | string\n right?: number | string\n bottom?: number | string\n left?: number | string\n zIndex?: number\n display?:\n | 'block'\n | 'inline'\n | 'inline-block'\n | 'flex'\n | 'inline-flex'\n | 'grid'\n | 'none'\n visibility?: 'visible' | 'hidden' | 'collapse'\n pointerEvents?: 'auto' | 'none'\n userSelect?: 'auto' | 'none' | 'text' | 'all'\n boxSizing?: 'content-box' | 'border-box'\n objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'\n objectPosition?: string\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n outline?: string\n outlineOffset?: number | string\n}\n\nexport type ReactiveUtilityOptions = ReactiveModifierProps<UtilityOptions>\n\nexport class UtilityModifier extends BaseModifier<UtilityOptions> {\n readonly type = 'utility'\n readonly priority = 10 // Lower priority for utility properties\n\n constructor(options: ReactiveUtilityOptions) {\n // Convert reactive options to regular options for immediate use\n const resolvedOptions: UtilityOptions = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' && 'peek' in value) {\n ;(resolvedOptions as any)[key] = (value as any).peek()\n } else {\n ;(resolvedOptions as any)[key] = value\n }\n }\n super(resolvedOptions)\n }\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const styles = this.computeUtilityStyles(this.properties)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private computeUtilityStyles(props: UtilityOptions) {\n const styles: Record<string, string> = {}\n\n if (props.cursor !== undefined) {\n // Validate cursor value in development mode\n if (process.env.NODE_ENV === 'development') {\n this.validateCursorValue(props.cursor)\n }\n styles.cursor = props.cursor\n }\n if (props.overflow !== undefined) {\n styles.overflow = props.overflow\n }\n if (props.overflowX !== undefined) {\n styles.overflowX = props.overflowX\n }\n if (props.overflowY !== undefined) {\n styles.overflowY = props.overflowY\n }\n if (props.position !== undefined) {\n styles.position = props.position\n }\n if (props.top !== undefined) {\n styles.top = this.toCSSValue(props.top)\n }\n if (props.right !== undefined) {\n styles.right = this.toCSSValue(props.right)\n }\n if (props.bottom !== undefined) {\n styles.bottom = this.toCSSValue(props.bottom)\n }\n if (props.left !== undefined) {\n styles.left = this.toCSSValue(props.left)\n }\n if (props.zIndex !== undefined) {\n styles.zIndex = props.zIndex.toString()\n }\n if (props.display !== undefined) {\n styles.display = props.display\n }\n if (props.visibility !== undefined) {\n styles.visibility = props.visibility\n }\n if (props.pointerEvents !== undefined) {\n styles.pointerEvents = props.pointerEvents\n }\n if (props.userSelect !== undefined) {\n styles.userSelect = props.userSelect\n }\n if (props.boxSizing !== undefined) {\n styles.boxSizing = props.boxSizing\n }\n if (props.objectFit !== undefined) {\n styles.objectFit = props.objectFit\n }\n if (props.objectPosition !== undefined) {\n styles.objectPosition = props.objectPosition\n }\n if (props.resize !== undefined) {\n styles.resize = props.resize\n }\n if (props.outline !== undefined) {\n styles.outline = props.outline\n }\n if (props.outlineOffset !== undefined) {\n styles.outlineOffset = this.toCSSValue(props.outlineOffset)\n }\n\n return styles\n }\n\n private validateCursorValue(value: string): void {\n const validCursors = [\n 'auto',\n 'default',\n 'pointer',\n 'text',\n 'wait',\n 'help',\n 'not-allowed',\n 'none',\n 'grab',\n 'grabbing',\n 'zoom-in',\n 'zoom-out',\n 'alias',\n 'cell',\n 'copy',\n ]\n\n if (!validCursors.includes(value) && !value.includes('url(')) {\n console.warn(\n `Unknown cursor value: \"${value}\". See documentation for valid cursor values.`\n )\n }\n }\n}\n\n/**\n * Create a utility modifier with miscellaneous CSS properties\n */\nexport function utility(options: ReactiveUtilityOptions): UtilityModifier {\n return new UtilityModifier(options)\n}\n\n/**\n * Convenience function for cursor\n */\nexport function cursor(value: UtilityOptions['cursor']): UtilityModifier {\n return new UtilityModifier({ cursor: value })\n}\n\n/**\n * Convenience function for overflow-y\n */\nexport function overflowY(value: UtilityOptions['overflowY']): UtilityModifier {\n return new UtilityModifier({ overflowY: value })\n}\n\n/**\n * Convenience function for overflow-x\n */\nexport function overflowX(value: UtilityOptions['overflowX']): UtilityModifier {\n return new UtilityModifier({ overflowX: value })\n}\n\n// NOTE: position and zIndex functions are now provided by @tachui/modifiers/layout\n// with enhanced functionality. Use those instead of the utility versions.\n\n/**\n * Convenience function for display\n */\nexport function display(value: UtilityOptions['display']): UtilityModifier {\n return new UtilityModifier({ display: value })\n}\n\n/**\n * Convenience function for outline\n */\nexport function outline(value: string): UtilityModifier {\n return new UtilityModifier({ outline: value })\n}\n\n/**\n * Convenience function for outline-offset\n */\nexport function outlineOffset(value: number | string): UtilityModifier {\n return new UtilityModifier({ outlineOffset: value })\n}\n","/**\n * CSS Modifier - raw CSS properties\n *\n * Provides an escape hatch for applying raw CSS properties\n * that may not have dedicated modifiers yet, or for experimental\n * CSS features.\n */\n\nimport type { DOMNode } from '@tachui/core/runtime/types'\nimport { BaseModifier } from '../basic/base'\nimport type {\n ModifierContext,\n ReactiveModifierProps,\n} from '@tachui/core/modifiers/types'\n\nexport interface CSSOptions {\n [property: string]: string | number | undefined\n}\n\nexport type ReactiveCSSOptions = ReactiveModifierProps<CSSOptions>\n\nexport class CSSModifier extends BaseModifier<CSSOptions> {\n readonly type = 'css'\n readonly priority = 5 // Very low priority so raw CSS doesn't override specific modifiers\n\n constructor(options: ReactiveCSSOptions) {\n // Convert reactive options to regular options for immediate use\n const resolvedOptions: CSSOptions = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' && 'peek' in value) {\n ;(resolvedOptions as any)[key] = (value as any).peek()\n } else {\n ;(resolvedOptions as any)[key] = value\n }\n }\n super(resolvedOptions)\n }\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const styles = this.computeCSSStyles(this.properties)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private computeCSSStyles(props: CSSOptions) {\n const styles: Record<string, string> = {}\n\n for (const [property, value] of Object.entries(props)) {\n if (value !== undefined) {\n // Convert camelCase to kebab-case for CSS properties\n const cssProperty = this.toCSSProperty(property)\n styles[cssProperty] = this.toCSSValue(value)\n }\n }\n\n return styles\n }\n}\n\n/**\n * Create a CSS modifier with raw CSS properties\n *\n * @example\n * ```typescript\n * // Apply raw CSS properties\n * .css({\n * backdropFilter: 'blur(10px)',\n * maskImage: 'linear-gradient(to bottom, black, transparent)',\n * scrollBehavior: 'smooth',\n * containerType: 'inline-size'\n * })\n *\n * // Mix camelCase and kebab-case (both work)\n * .css({\n * backgroundColor: 'red', // camelCase (recommended)\n * 'background-color': 'red', // kebab-case (also works)\n * WebkitTransform: 'scale(1.1)', // vendor prefixes\n * '--custom-property': '42px' // CSS custom properties\n * })\n *\n * // Experimental CSS features\n * .css({\n * aspectRatio: '16/9',\n * scrollSnapType: 'y mandatory',\n * containIntrinsicSize: '300px',\n * accentColor: '#007AFF'\n * })\n * ```\n */\nexport function css(properties: ReactiveCSSOptions): CSSModifier {\n return new CSSModifier(properties)\n}\n\n/**\n * Convenience function for setting a single CSS property\n *\n * @example\n * ```typescript\n * .cssProperty('backdrop-filter', 'blur(10px)')\n * .cssProperty('scrollBehavior', 'smooth')\n * .cssProperty('aspectRatio', '16/9')\n * ```\n */\nexport function cssProperty(\n property: string,\n value: string | number\n): CSSModifier {\n return new CSSModifier({ [property]: value })\n}\n\n/**\n * Convenience function for CSS custom properties (CSS variables)\n *\n * @example\n * ```typescript\n * .cssVariable('primary-color', '#007AFF')\n * .cssVariable('spacing-unit', '8px')\n * .cssVariable('border-radius', '12px')\n * ```\n */\nexport function cssVariable(name: string, value: string | number): CSSModifier {\n // Ensure the property starts with --\n const propertyName = name.startsWith('--') ? name : `--${name}`\n return new CSSModifier({ [propertyName]: value })\n}\n\n/**\n * Convenience function for vendor-prefixed properties\n *\n * @example\n * ```typescript\n * .cssVendor('webkit', 'transform', 'scale(1.1)')\n * .cssVendor('moz', 'user-select', 'none')\n * .cssVendor('ms', 'filter', 'blur(5px)')\n * ```\n */\nexport function cssVendor(\n prefix: 'webkit' | 'moz' | 'ms' | 'o',\n property: string,\n value: string | number\n): CSSModifier {\n // Convert to proper vendor prefix format\n const capitalizedPrefix = prefix.charAt(0).toUpperCase() + prefix.slice(1)\n const vendorProperty = `-${prefix.toLowerCase()}-${property}`\n const camelCaseProperty =\n capitalizedPrefix + property.charAt(0).toUpperCase() + property.slice(1)\n\n return new CSSModifier({\n [vendorProperty]: value,\n [camelCaseProperty]: value,\n })\n}\n"],"names":["UtilityModifier","BaseModifier","options","resolvedOptions","key","value","__publicField","_node","context","styles","props","utility","cursor","overflowY","overflowX","display","outline","outlineOffset","CSSModifier","property","cssProperty","css","properties","cssVariable","name","propertyName","cssVendor","prefix","capitalizedPrefix","vendorProperty","camelCaseProperty"],"mappings":";;;;AA8DO,MAAMA,UAAwBC,EAA6B;AAAA;AAAA,EAIhE,YAAYC,GAAiC;AAE3C,UAAMC,IAAkC,CAAA;AACxC,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQH,CAAO;AAC/C,MAAI,OAAOG,KAAU,cAAc,UAAUA,IACzCF,EAAwBC,CAAG,IAAKC,EAAc,KAAA,IAE9CF,EAAwBC,CAAG,IAAIC;AAGrC,UAAMF,CAAe;AAbd,IAAAG,EAAA,cAAO;AACP,IAAAA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CAACyB,CAAiB,GAAGzB;AAAA,EAAA,CACtB;AACH;"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Decorative Pseudo-element Modifiers
3
+ *
4
+ * Common decorative patterns using pseudo-elements for icons, lines, badges,
5
+ * tooltips, ribbons, and loading indicators.
6
+ */
7
+ import { type PseudoElementStyles, PseudoElementModifier } from './pseudo-elements';
8
+ /**
9
+ * Icon before content using a Unicode character
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * .iconBefore('★', { color: '#ffd700', marginRight: 8 })
14
+ * .iconBefore('→', { color: '#007AFF' })
15
+ * ```
16
+ */
17
+ export declare function iconBefore(icon: string, styles?: Omit<PseudoElementStyles, 'content'>): PseudoElementModifier;
18
+ /**
19
+ * Icon after content using a Unicode character
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * .iconAfter('→', { color: '#007AFF', marginLeft: 8 })
24
+ * .iconAfter('✓', { color: '#34c759' })
25
+ * ```
26
+ */
27
+ export declare function iconAfter(icon: string, styles?: Omit<PseudoElementStyles, 'content'>): PseudoElementModifier;
28
+ /**
29
+ * Decorative line before content
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * .lineBefore() // Default line
34
+ * .lineBefore('#007AFF', 2, 20) // Blue line, 2px thick, 20px long
35
+ * ```
36
+ */
37
+ export declare function lineBefore(color?: string, thickness?: number, length?: number): PseudoElementModifier;
38
+ /**
39
+ * Decorative line after content
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * .lineAfter() // Default line
44
+ * .lineAfter('#007AFF', 2, 20) // Blue line, 2px thick, 20px long
45
+ * ```
46
+ */
47
+ export declare function lineAfter(color?: string, thickness?: number, length?: number): PseudoElementModifier;
48
+ /**
49
+ * Quote marks around content
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * .quotes() // Default quotes (" ")
54
+ * .quotes('«', '»') // Custom quote characters
55
+ * ```
56
+ */
57
+ export declare function quotes(openQuote?: string, closeQuote?: string): PseudoElementModifier;
58
+ /**
59
+ * Underline decoration using ::after
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * .underline() // Default underline
64
+ * .underline('#007AFF', 2, 0.2) // Blue underline, 2px thick, 20% opacity
65
+ * ```
66
+ */
67
+ export declare function underline(color?: string, thickness?: number, opacity?: number): PseudoElementModifier;
68
+ /**
69
+ * Badge or notification dot using ::after
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * .badge() // Default red dot
74
+ * .badge('#007AFF', 8, '2') // Blue badge with "2" text
75
+ * ```
76
+ */
77
+ export declare function badge(color?: string, size?: number, text?: string): PseudoElementModifier;
78
+ /**
79
+ * Tooltip using ::before with positioning
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * .tooltip('This is a tooltip')
84
+ * .tooltip('Custom tooltip', 'bottom', '#333')
85
+ * ```
86
+ */
87
+ export declare function tooltip(text: string, position?: 'top' | 'bottom' | 'left' | 'right', backgroundColor?: string, textColor?: string): PseudoElementModifier;
88
+ /**
89
+ * Corner ribbon using ::before
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * .cornerRibbon('New!') // Default red ribbon
94
+ * .cornerRibbon('Sale', '#ff9500') // Orange sale ribbon
95
+ * ```
96
+ */
97
+ export declare function cornerRibbon(text: string, color?: string, textColor?: string): PseudoElementModifier;
98
+ /**
99
+ * Loading spinner using ::before with animation
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * .spinner() // Default spinner
104
+ * .spinner(16, '#007AFF', 2) // Custom size, color, border width
105
+ * ```
106
+ */
107
+ export declare function spinner(size?: number, color?: string, borderWidth?: number): PseudoElementModifier;
108
+ export { PseudoElementModifier };
109
+ //# sourceMappingURL=decorative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorative.d.ts","sourceRoot":"","sources":["../../src/elements/decorative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAGL,KAAK,mBAAmB,EACxB,qBAAqB,EACtB,MAAM,mBAAmB,CAAA;AAM1B;;;;;;;;GAQG;AACH,wB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BvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACrB,IAAI,GAAE,MAAW,EACjB,KAAK,GAAE,MAAkB,EACzB,WAAW,GAAE,MAAU,GACtB,qBAAqB,CAwBvB;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Pseudo-element Modifiers - ::before and ::after styling
3
+ */
4
+ export * from './pseudo-elements';
5
+ export * from './decorative';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/elements/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA"}