@drjoshcsimmons/scl 0.1.0 → 0.1.2

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 (195) hide show
  1. package/dist/components/ui/alert/alert.d.ts +1 -1
  2. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  3. package/dist/components/ui/badge/badge.d.ts +1 -1
  4. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  5. package/dist/components/ui/button/button.d.ts +1 -1
  6. package/dist/components/ui/button/button.d.ts.map +1 -1
  7. package/dist/components/ui/combobox/combobox.d.ts +31 -0
  8. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  9. package/dist/components/ui/combobox/index.d.ts +3 -0
  10. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  11. package/dist/components/ui/command/command.d.ts +85 -0
  12. package/dist/components/ui/command/command.d.ts.map +1 -0
  13. package/dist/components/ui/command/index.d.ts +2 -0
  14. package/dist/components/ui/command/index.d.ts.map +1 -0
  15. package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
  16. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  17. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  18. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  19. package/dist/components/ui/form/form.d.ts +24 -0
  20. package/dist/components/ui/form/form.d.ts.map +1 -0
  21. package/dist/components/ui/form/index.d.ts +2 -0
  22. package/dist/components/ui/form/index.d.ts.map +1 -0
  23. package/dist/components/ui/progress/progress.d.ts +0 -6
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  26. package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
  27. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  29. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
  30. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +166 -143
  34. package/dist/index10.js +30 -30
  35. package/dist/index100.js +218 -29
  36. package/dist/index101.js +646 -11
  37. package/dist/index102.js +173 -127
  38. package/dist/index103.js +4 -50
  39. package/dist/index104.js +30 -9
  40. package/dist/index105.js +6 -4
  41. package/dist/index106.js +11 -180
  42. package/dist/index107.js +19 -648
  43. package/dist/index108.js +9 -107
  44. package/dist/index109.js +38 -91
  45. package/dist/index11.js +13 -13
  46. package/dist/index110.js +18 -67
  47. package/dist/index111.js +201 -154
  48. package/dist/index112.js +20 -395
  49. package/dist/index113.js +395 -1675
  50. package/dist/index114.js +2 -278
  51. package/dist/index115.js +49 -128
  52. package/dist/index116.js +65 -32
  53. package/dist/index117.js +19 -1605
  54. package/dist/index118.js +28 -297
  55. package/dist/index119.js +5 -635
  56. package/dist/index12.js +1 -1
  57. package/dist/index120.js +2 -144
  58. package/dist/index121.js +2 -21
  59. package/dist/index122.js +5 -9
  60. package/dist/index123.js +3 -38
  61. package/dist/index124.js +24 -18
  62. package/dist/index125.js +113 -6
  63. package/dist/index126.js +15 -11
  64. package/dist/index127.js +513 -194
  65. package/dist/index128.js +128 -22
  66. package/dist/index129.js +114 -380
  67. package/dist/index13.js +132 -93
  68. package/dist/index130.js +59 -1300
  69. package/dist/index131.js +63 -612
  70. package/dist/index132.js +9 -2
  71. package/dist/index133.js +13 -52
  72. package/dist/index134.js +64 -63
  73. package/dist/index135.js +3 -24
  74. package/dist/index136.js +23 -29
  75. package/dist/index137.js +23 -5
  76. package/dist/index138.js +13 -2
  77. package/dist/index139.js +28 -2
  78. package/dist/index14.js +106 -220
  79. package/dist/index140.js +5 -5
  80. package/dist/index15.js +79 -125
  81. package/dist/index16.js +280 -17
  82. package/dist/index17.js +139 -12
  83. package/dist/index18.js +92 -22
  84. package/dist/index19.js +18 -55
  85. package/dist/index2.js +2 -2
  86. package/dist/index20.js +14 -26
  87. package/dist/index21.js +19 -33
  88. package/dist/index22.js +38 -121
  89. package/dist/index23.js +29 -22
  90. package/dist/index24.js +31 -64
  91. package/dist/index25.js +121 -15
  92. package/dist/index26.js +19 -29
  93. package/dist/index27.js +68 -77
  94. package/dist/index28.js +20 -25
  95. package/dist/index29.js +32 -88
  96. package/dist/index3.js +11 -9
  97. package/dist/index30.js +138 -38
  98. package/dist/index31.js +20 -227
  99. package/dist/index32.js +88 -18
  100. package/dist/index33.js +37 -28
  101. package/dist/index34.js +86 -22
  102. package/dist/index35.js +17 -102
  103. package/dist/index36.js +34 -65
  104. package/dist/index37.js +23 -49
  105. package/dist/index38.js +38 -99
  106. package/dist/index39.js +65 -10
  107. package/dist/index4.js +6 -6
  108. package/dist/index40.js +49 -15
  109. package/dist/index41.js +93 -2256
  110. package/dist/index42.js +10 -32
  111. package/dist/index43.js +15 -18
  112. package/dist/index44.js +2251 -225
  113. package/dist/index45.js +237 -11
  114. package/dist/index46.js +11 -73
  115. package/dist/index47.js +33 -249
  116. package/dist/index48.js +118 -9
  117. package/dist/index49.js +63 -326
  118. package/dist/index5.js +23 -23
  119. package/dist/index50.js +307 -57
  120. package/dist/index51.js +12 -241
  121. package/dist/index52.js +222 -822
  122. package/dist/index53.js +6 -3
  123. package/dist/index54.js +56 -114
  124. package/dist/index55.js +248 -219
  125. package/dist/index56.js +249 -11
  126. package/dist/index57.js +3 -5
  127. package/dist/index58.js +110 -221
  128. package/dist/index59.js +12 -260
  129. package/dist/index6.js +12 -12
  130. package/dist/index60.js +18 -12
  131. package/dist/index61.js +221 -18
  132. package/dist/index62.js +11 -530
  133. package/dist/index63.js +11 -6155
  134. package/dist/index64.js +234 -2626
  135. package/dist/index65.js +230 -292
  136. package/dist/index66.js +504 -646
  137. package/dist/index67.js +155 -824
  138. package/dist/index68.js +128 -23
  139. package/dist/index69.js +319 -311
  140. package/dist/index7.js +22 -22
  141. package/dist/index70.js +72 -4889
  142. package/dist/index71.js +408 -802
  143. package/dist/index72.js +18 -1254
  144. package/dist/index73.js +844 -518
  145. package/dist/index74.js +9 -125
  146. package/dist/index75.js +31 -161
  147. package/dist/index76.js +7 -31
  148. package/dist/index77.js +62 -429
  149. package/dist/index78.js +50 -128
  150. package/dist/index79.js +4 -81
  151. package/dist/index8.js +17 -18
  152. package/dist/index80.js +23 -64
  153. package/dist/index81.js +33 -45
  154. package/dist/index82.js +63 -21
  155. package/dist/index83.js +10 -6
  156. package/dist/index84.js +52 -49
  157. package/dist/index85.js +10 -33
  158. package/dist/index86.js +30 -11
  159. package/dist/index87.js +12 -7
  160. package/dist/index88.js +46 -30
  161. package/dist/index89.js +7 -54
  162. package/dist/index9.js +23 -31
  163. package/dist/index90.js +14 -10
  164. package/dist/index91.js +125 -4
  165. package/dist/index92.js +131 -9
  166. package/dist/index93.js +14 -6
  167. package/dist/index94.js +14 -24
  168. package/dist/index95.js +9 -69
  169. package/dist/index96.js +47 -122
  170. package/dist/index97.js +51 -216
  171. package/dist/index98.js +6 -14
  172. package/dist/index99.js +24 -53
  173. package/dist/tokens/colors.d.ts +26 -86
  174. package/dist/tokens/colors.d.ts.map +1 -1
  175. package/dist/tokens/index.d.ts +12 -84
  176. package/dist/tokens/index.d.ts.map +1 -1
  177. package/package.json +28 -23
  178. package/dist/index141.js +0 -5
  179. package/dist/index142.js +0 -26
  180. package/dist/index143.js +0 -115
  181. package/dist/index144.js +0 -18
  182. package/dist/index145.js +0 -527
  183. package/dist/index146.js +0 -130
  184. package/dist/index147.js +0 -136
  185. package/dist/index148.js +0 -67
  186. package/dist/index149.js +0 -71
  187. package/dist/index150.js +0 -11
  188. package/dist/index151.js +0 -16
  189. package/dist/index152.js +0 -68
  190. package/dist/index153.js +0 -6
  191. package/dist/index154.js +0 -25
  192. package/dist/index155.js +0 -25
  193. package/dist/index156.js +0 -15
  194. package/dist/index157.js +0 -30
  195. package/dist/index158.js +0 -7
package/dist/index16.js CHANGED
@@ -1,21 +1,284 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { cn as t } from "./index2.js";
4
- const s = o.forwardRef(
5
- ({ className: e, type: f, ...i }, l) => /* @__PURE__ */ r(
6
- "input",
7
- {
8
- type: f,
9
- className: t(
10
- "flex h-10 w-full border border-[#00ff00] bg-black px-3 py-1 text-base text-[#00ff00] transition-colors file:-ml-3 file:-my-1 file:mr-4 file:h-10 file:px-3 file:border-0 file:border-r file:border-[#00ff00] file:bg-[#00ff00] file:text-black file:text-sm file:font-medium file:cursor-pointer hover:file:bg-black hover:file:text-[#00ff00] placeholder:text-[#00ff00]/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#00ff00] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
11
- e
12
- ),
13
- ref: l,
14
- ...i
1
+ import { jsx as X } from "react/jsx-runtime";
2
+ import * as R from "react";
3
+ import { cn as L } from "./index2.js";
4
+ const M = `
5
+ attribute vec2 a_position;
6
+ attribute vec2 a_texCoord;
7
+ varying vec2 v_texCoord;
8
+
9
+ void main() {
10
+ gl_Position = vec4(a_position, 0.0, 1.0);
11
+ v_texCoord = a_texCoord;
12
+ }
13
+ `, F = `
14
+ precision mediump float;
15
+
16
+ varying vec2 v_texCoord;
17
+
18
+ uniform sampler2D u_image;
19
+ uniform vec3 u_color;
20
+
21
+ void main() {
22
+ vec4 texColor = texture2D(u_image, v_texCoord);
23
+ // Dithered image is already black/white, just colorize the white pixels
24
+ vec3 finalColor = texColor.r * u_color;
25
+ gl_FragColor = vec4(finalColor, texColor.a);
26
+ }
27
+ `, B = `
28
+ precision mediump float;
29
+
30
+ varying vec2 v_texCoord;
31
+
32
+ uniform sampler2D u_image;
33
+ uniform sampler2D u_bayerTex;
34
+ uniform vec2 u_resolution;
35
+ uniform float u_ditherSize;
36
+ uniform vec3 u_color;
37
+
38
+ void main() {
39
+ vec2 pixelPos = mod(floor(gl_FragCoord.xy / u_ditherSize), 8.0);
40
+ vec4 texColor = texture2D(u_image, v_texCoord);
41
+
42
+ // Convert to grayscale using luminance
43
+ float gray = dot(texColor.rgb, vec3(0.299, 0.587, 0.114));
44
+
45
+ // Look up threshold from Bayer texture
46
+ float threshold = texture2D(u_bayerTex, (pixelPos + 0.5) / 8.0).r;
47
+ float dithered = step(threshold, gray);
48
+
49
+ // Output color or black
50
+ vec3 finalColor = dithered * u_color;
51
+ gl_FragColor = vec4(finalColor, texColor.a);
52
+ }
53
+ `, N = [
54
+ 0,
55
+ 32,
56
+ 8,
57
+ 40,
58
+ 2,
59
+ 34,
60
+ 10,
61
+ 42,
62
+ 48,
63
+ 16,
64
+ 56,
65
+ 24,
66
+ 50,
67
+ 18,
68
+ 58,
69
+ 26,
70
+ 12,
71
+ 44,
72
+ 4,
73
+ 36,
74
+ 14,
75
+ 46,
76
+ 6,
77
+ 38,
78
+ 60,
79
+ 28,
80
+ 52,
81
+ 20,
82
+ 62,
83
+ 30,
84
+ 54,
85
+ 22,
86
+ 3,
87
+ 35,
88
+ 11,
89
+ 43,
90
+ 1,
91
+ 33,
92
+ 9,
93
+ 41,
94
+ 51,
95
+ 19,
96
+ 59,
97
+ 27,
98
+ 49,
99
+ 17,
100
+ 57,
101
+ 25,
102
+ 15,
103
+ 47,
104
+ 7,
105
+ 39,
106
+ 13,
107
+ 45,
108
+ 5,
109
+ 37,
110
+ 63,
111
+ 31,
112
+ 55,
113
+ 23,
114
+ 61,
115
+ 29,
116
+ 53,
117
+ 21
118
+ ];
119
+ function w(n, m = 128) {
120
+ const t = new Uint8ClampedArray(n.data), o = n.width, d = n.height, _ = (r, a) => (a * o + r) * 4, f = (r, a, i) => {
121
+ if (r < 0 || r >= o || a < 0 || a >= d) return;
122
+ const E = _(r, a);
123
+ t[E] = Math.max(0, Math.min(255, t[E] + i)), t[E + 1] = Math.max(0, Math.min(255, t[E + 1] + i)), t[E + 2] = Math.max(0, Math.min(255, t[E + 2] + i));
124
+ };
125
+ for (let r = 0; r < d; r++)
126
+ for (let a = 0; a < o; a++) {
127
+ const i = _(a, r), E = t[i] * 0.299 + t[i + 1] * 0.587 + t[i + 2] * 0.114, c = E < m ? 0 : 255, u = Math.floor((E - c) / 8);
128
+ t[i] = c, t[i + 1] = c, t[i + 2] = c, f(a + 1, r, u), f(a + 2, r, u), f(a - 1, r + 1, u), f(a, r + 1, u), f(a + 1, r + 1, u), f(a, r + 2, u);
15
129
  }
16
- )
130
+ return new ImageData(t, o, d);
131
+ }
132
+ function G(n, m = 128) {
133
+ const t = new Uint8ClampedArray(n.data), o = n.width, d = n.height, _ = (r, a) => (a * o + r) * 4, f = (r, a, i, E) => {
134
+ if (r < 0 || r >= o || a < 0 || a >= d) return;
135
+ const c = _(r, a), u = i * E;
136
+ t[c] = Math.max(0, Math.min(255, t[c] + u)), t[c + 1] = Math.max(0, Math.min(255, t[c + 1] + u)), t[c + 2] = Math.max(0, Math.min(255, t[c + 2] + u));
137
+ };
138
+ for (let r = 0; r < d; r++)
139
+ for (let a = 0; a < o; a++) {
140
+ const i = _(a, r), E = t[i] * 0.299 + t[i + 1] * 0.587 + t[i + 2] * 0.114, c = E < m ? 0 : 255, u = E - c;
141
+ t[i] = c, t[i + 1] = c, t[i + 2] = c, f(a + 1, r, u, 7 / 16), f(a - 1, r + 1, u, 3 / 16), f(a, r + 1, u, 5 / 16), f(a + 1, r + 1, u, 1 / 16);
142
+ }
143
+ return new ImageData(t, o, d);
144
+ }
145
+ function I(n, m, t) {
146
+ const o = n.createShader(m);
147
+ return o ? (n.shaderSource(o, t), n.compileShader(o), n.getShaderParameter(o, n.COMPILE_STATUS) ? o : (console.error("Shader compile error:", n.getShaderInfoLog(o)), n.deleteShader(o), null)) : null;
148
+ }
149
+ function k(n, m, t) {
150
+ const o = n.createProgram();
151
+ return o ? (n.attachShader(o, m), n.attachShader(o, t), n.linkProgram(o), n.getProgramParameter(o, n.LINK_STATUS) ? o : (console.error("Program link error:", n.getProgramInfoLog(o)), n.deleteProgram(o), null)) : null;
152
+ }
153
+ const O = R.forwardRef(
154
+ ({
155
+ className: n,
156
+ src: m,
157
+ alt: t,
158
+ width: o,
159
+ height: d,
160
+ ditherSize: _ = 1,
161
+ color: f = [0, 255, 0],
162
+ algorithm: r = "atkinson",
163
+ threshold: a = 128,
164
+ ...i
165
+ }, E) => {
166
+ const c = R.useRef(null), u = R.useRef(null), b = R.useRef(null), p = R.useRef(null);
167
+ return R.useImperativeHandle(E, () => c.current), R.useEffect(() => {
168
+ const A = c.current;
169
+ if (!A) return;
170
+ const e = A.getContext("webgl", { preserveDrawingBuffer: !0 });
171
+ if (!e) {
172
+ console.error("WebGL not supported");
173
+ return;
174
+ }
175
+ u.current = e;
176
+ const x = r === "bayer" ? B : F, l = I(e, e.VERTEX_SHADER, M), g = I(
177
+ e,
178
+ e.FRAGMENT_SHADER,
179
+ x
180
+ );
181
+ if (!l || !g) {
182
+ console.error("Failed to create shaders");
183
+ return;
184
+ }
185
+ const s = k(e, l, g);
186
+ if (!s) {
187
+ console.error("Failed to create program");
188
+ return;
189
+ }
190
+ if (e.useProgram(s), b.current = s, r === "bayer") {
191
+ const S = e.createTexture();
192
+ e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, S);
193
+ const P = new Uint8Array(N.map((y) => y / 64 * 255));
194
+ e.texImage2D(
195
+ e.TEXTURE_2D,
196
+ 0,
197
+ e.LUMINANCE,
198
+ 8,
199
+ 8,
200
+ 0,
201
+ e.LUMINANCE,
202
+ e.UNSIGNED_BYTE,
203
+ P
204
+ ), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.REPEAT), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), p.current = S;
205
+ }
206
+ const T = new Float32Array([
207
+ -1,
208
+ -1,
209
+ 1,
210
+ -1,
211
+ -1,
212
+ 1,
213
+ -1,
214
+ 1,
215
+ 1,
216
+ -1,
217
+ 1,
218
+ 1
219
+ ]), h = new Float32Array([0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0]), C = e.createBuffer();
220
+ e.bindBuffer(e.ARRAY_BUFFER, C), e.bufferData(e.ARRAY_BUFFER, T, e.STATIC_DRAW);
221
+ const D = e.getAttribLocation(s, "a_position");
222
+ e.enableVertexAttribArray(D), e.vertexAttribPointer(D, 2, e.FLOAT, !1, 0, 0);
223
+ const v = e.createBuffer();
224
+ e.bindBuffer(e.ARRAY_BUFFER, v), e.bufferData(e.ARRAY_BUFFER, h, e.STATIC_DRAW);
225
+ const U = e.getAttribLocation(s, "a_texCoord");
226
+ return e.enableVertexAttribArray(U), e.vertexAttribPointer(U, 2, e.FLOAT, !1, 0, 0), e.uniform1i(e.getUniformLocation(s, "u_image"), 0), r === "bayer" && e.uniform1i(e.getUniformLocation(s, "u_bayerTex"), 1), () => {
227
+ e.deleteProgram(s), e.deleteShader(l), e.deleteShader(g), p.current && e.deleteTexture(p.current);
228
+ };
229
+ }, [r]), R.useEffect(() => {
230
+ const A = c.current, e = u.current, x = b.current;
231
+ if (!A || !e || !x) return;
232
+ const l = new Image();
233
+ l.crossOrigin = "anonymous", l.onload = () => {
234
+ const g = l.naturalWidth / l.naturalHeight;
235
+ let s, T;
236
+ o && d ? (s = o, T = d) : o ? (s = o, T = Math.round(o / g)) : d ? (T = d, s = Math.round(d * g)) : (s = l.naturalWidth, T = l.naturalHeight), A.width = s, A.height = T, e.viewport(0, 0, s, T), e.useProgram(x);
237
+ let h = l;
238
+ if (r === "atkinson" || r === "floyd-steinberg") {
239
+ const D = document.createElement("canvas");
240
+ D.width = s, D.height = T;
241
+ const v = D.getContext("2d");
242
+ if (v) {
243
+ v.drawImage(l, 0, 0, s, T);
244
+ const U = v.getImageData(0, 0, s, T);
245
+ h = r === "atkinson" ? w(U, a) : G(U, a);
246
+ }
247
+ }
248
+ r === "bayer" && (e.activeTexture(e.TEXTURE1), e.bindTexture(e.TEXTURE_2D, p.current)), e.activeTexture(e.TEXTURE0);
249
+ const C = e.createTexture();
250
+ e.bindTexture(e.TEXTURE_2D, C), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST), h instanceof ImageData, e.texImage2D(
251
+ e.TEXTURE_2D,
252
+ 0,
253
+ e.RGBA,
254
+ e.RGBA,
255
+ e.UNSIGNED_BYTE,
256
+ h
257
+ ), r === "bayer" && (e.uniform2f(e.getUniformLocation(x, "u_resolution"), s, T), e.uniform1f(
258
+ e.getUniformLocation(x, "u_ditherSize"),
259
+ _
260
+ )), e.uniform3f(
261
+ e.getUniformLocation(x, "u_color"),
262
+ f[0] / 255,
263
+ f[1] / 255,
264
+ f[2] / 255
265
+ ), e.drawArrays(e.TRIANGLES, 0, 6), e.deleteTexture(C);
266
+ }, l.onerror = () => {
267
+ console.error("Failed to load image:", m);
268
+ }, l.src = m;
269
+ }, [m, o, d, _, f, r, a]), /* @__PURE__ */ X(
270
+ "canvas",
271
+ {
272
+ ref: c,
273
+ className: L("", n),
274
+ "aria-label": t,
275
+ role: "img",
276
+ ...i
277
+ }
278
+ );
279
+ }
17
280
  );
18
- s.displayName = "Input";
281
+ O.displayName = "DitheredImage";
19
282
  export {
20
- s as Input
283
+ O as DitheredImage
21
284
  };
package/dist/index17.js CHANGED
@@ -1,19 +1,146 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import * as t from "react";
3
- import { Root as o } from "./index43.js";
4
- import { cva as i } from "./index42.js";
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { Root as w, Trigger as x, Group as N, Portal as m, Sub as v, RadioGroup as R, Content as l, Item as p, CheckboxItem as c, ItemIndicator as u, RadioItem as f, Label as b, Separator as y, SubContent as g, SubTrigger as h } from "./index61.js";
5
4
  import { cn as s } from "./index2.js";
6
- const l = i(
7
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
8
- ), p = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ m(
9
- o,
5
+ import D from "./index57.js";
6
+ import M from "./index62.js";
7
+ import S from "./index63.js";
8
+ const H = w, J = x, K = N, O = m, Q = v, U = R, I = n.forwardRef(({ className: e, inset: a, children: t, ...r }, i) => /* @__PURE__ */ d(
9
+ h,
10
+ {
11
+ ref: i,
12
+ className: s(
13
+ "flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none hover:bg-primary/20 focus:bg-primary/20 data-[state=open]:bg-primary/20 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
14
+ a && "pl-8",
15
+ e
16
+ ),
17
+ ...r,
18
+ children: [
19
+ t,
20
+ /* @__PURE__ */ o(S, { className: "ml-auto" })
21
+ ]
22
+ }
23
+ ));
24
+ I.displayName = h.displayName;
25
+ const C = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
26
+ g,
27
+ {
28
+ ref: t,
29
+ className: s(
30
+ "z-[60] min-w-[8rem] overflow-hidden border-2 border-primary bg-black p-1 text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
31
+ e
32
+ ),
33
+ ...a
34
+ }
35
+ ));
36
+ C.displayName = g.displayName;
37
+ const k = n.forwardRef(({ className: e, sideOffset: a = 4, ...t }, r) => /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(
38
+ l,
10
39
  {
11
40
  ref: r,
12
- className: s(l(), a),
13
- ...e
41
+ sideOffset: a,
42
+ className: s(
43
+ "z-[60] min-w-[8rem] overflow-hidden border-2 border-primary bg-black p-1 text-primary",
44
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
45
+ e
46
+ ),
47
+ ...t
48
+ }
49
+ ) }));
50
+ k.displayName = l.displayName;
51
+ const z = n.forwardRef(({ className: e, inset: a, ...t }, r) => /* @__PURE__ */ o(
52
+ p,
53
+ {
54
+ ref: r,
55
+ className: s(
56
+ "relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors hover:bg-primary/20 focus:bg-primary/20 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
57
+ a && "pl-8",
58
+ e
59
+ ),
60
+ ...t
61
+ }
62
+ ));
63
+ z.displayName = p.displayName;
64
+ const G = n.forwardRef(({ className: e, children: a, checked: t, ...r }, i) => /* @__PURE__ */ d(
65
+ c,
66
+ {
67
+ ref: i,
68
+ className: s(
69
+ "relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-primary/20 focus:bg-primary/20 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
70
+ e
71
+ ),
72
+ checked: t,
73
+ ...r,
74
+ children: [
75
+ /* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(D, { className: "h-4 w-4" }) }) }),
76
+ a
77
+ ]
14
78
  }
15
79
  ));
16
- p.displayName = o.displayName;
80
+ G.displayName = c.displayName;
81
+ const T = n.forwardRef(({ className: e, children: a, ...t }, r) => /* @__PURE__ */ d(
82
+ f,
83
+ {
84
+ ref: r,
85
+ className: s(
86
+ "relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:bg-primary/20 focus:bg-primary/20 focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
87
+ e
88
+ ),
89
+ ...t,
90
+ children: [
91
+ /* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(M, { className: "h-4 w-4 fill-current" }) }) }),
92
+ a
93
+ ]
94
+ }
95
+ ));
96
+ T.displayName = f.displayName;
97
+ const j = n.forwardRef(({ className: e, inset: a, ...t }, r) => /* @__PURE__ */ o(
98
+ b,
99
+ {
100
+ ref: r,
101
+ className: s(
102
+ "px-2 py-1.5 text-sm font-semibold",
103
+ a && "pl-8",
104
+ e
105
+ ),
106
+ ...t
107
+ }
108
+ ));
109
+ j.displayName = b.displayName;
110
+ const L = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(
111
+ y,
112
+ {
113
+ ref: t,
114
+ className: s("-mx-1 my-1 h-px bg-muted", e),
115
+ ...a
116
+ }
117
+ ));
118
+ L.displayName = y.displayName;
119
+ const P = ({
120
+ className: e,
121
+ ...a
122
+ }) => /* @__PURE__ */ o(
123
+ "span",
124
+ {
125
+ className: s("ml-auto text-xs tracking-widest text-primary border border-primary px-1", e),
126
+ ...a
127
+ }
128
+ );
129
+ P.displayName = "DropdownMenuShortcut";
17
130
  export {
18
- p as Label
131
+ H as DropdownMenu,
132
+ G as DropdownMenuCheckboxItem,
133
+ k as DropdownMenuContent,
134
+ K as DropdownMenuGroup,
135
+ z as DropdownMenuItem,
136
+ j as DropdownMenuLabel,
137
+ O as DropdownMenuPortal,
138
+ U as DropdownMenuRadioGroup,
139
+ T as DropdownMenuRadioItem,
140
+ L as DropdownMenuSeparator,
141
+ P as DropdownMenuShortcut,
142
+ Q as DropdownMenuSub,
143
+ C as DropdownMenuSubContent,
144
+ I as DropdownMenuSubTrigger,
145
+ J as DropdownMenuTrigger
19
146
  };
package/dist/index18.js CHANGED
@@ -1,24 +1,94 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { Root as s, Trigger as m, Anchor as l, Portal as p, Content as t } from "./index51.js";
4
- import { cn as c } from "./index2.js";
5
- const u = s, P = m, v = l, f = i.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...n }, d) => /* @__PURE__ */ o(p, { children: /* @__PURE__ */ o(
6
- t,
7
- {
8
- ref: d,
9
- align: a,
10
- sideOffset: r,
11
- className: c(
12
- "z-50 w-72 rounded-md border border-terminal-green bg-black p-4 text-terminal-green shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
13
- e
14
- ),
15
- ...n
16
- }
17
- ) }));
18
- f.displayName = t.displayName;
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { Root as F } from "./index54.js";
4
+ import { FormProvider as u, useFormContext as p, Controller as x } from "./index55.js";
5
+ import { cn as a } from "./index2.js";
6
+ import { Label as I } from "./index20.js";
7
+ const D = u, f = s.createContext(
8
+ {}
9
+ ), M = ({
10
+ ...e
11
+ }) => /* @__PURE__ */ i(f.Provider, { value: { name: e.name }, children: /* @__PURE__ */ i(x, { ...e }) }), d = () => {
12
+ const e = s.useContext(f), o = s.useContext(l), { getFieldState: r, formState: t } = p(), m = r(e.name, t);
13
+ if (!e)
14
+ throw new Error("useFormField should be used within <FormField>");
15
+ const { id: n } = o;
16
+ return {
17
+ id: n,
18
+ name: e.name,
19
+ formItemId: `${n}-form-item`,
20
+ formDescriptionId: `${n}-form-item-description`,
21
+ formMessageId: `${n}-form-item-message`,
22
+ ...m
23
+ };
24
+ }, l = s.createContext(
25
+ {}
26
+ ), C = s.forwardRef(({ className: e, ...o }, r) => {
27
+ const t = s.useId();
28
+ return /* @__PURE__ */ i(l.Provider, { value: { id: t }, children: /* @__PURE__ */ i("div", { ref: r, className: a("space-y-2", e), ...o }) });
29
+ });
30
+ C.displayName = "FormItem";
31
+ const g = s.forwardRef(({ className: e, ...o }, r) => {
32
+ const { error: t, formItemId: m } = d();
33
+ return /* @__PURE__ */ i(
34
+ I,
35
+ {
36
+ ref: r,
37
+ className: a(t && "text-destructive", e),
38
+ htmlFor: m,
39
+ ...o
40
+ }
41
+ );
42
+ });
43
+ g.displayName = "FormLabel";
44
+ const v = s.forwardRef(({ ...e }, o) => {
45
+ const { error: r, formItemId: t, formDescriptionId: m, formMessageId: n } = d();
46
+ return /* @__PURE__ */ i(
47
+ F,
48
+ {
49
+ ref: o,
50
+ id: t,
51
+ "aria-describedby": r ? `${m} ${n}` : `${m}`,
52
+ "aria-invalid": !!r,
53
+ ...e
54
+ }
55
+ );
56
+ });
57
+ v.displayName = "FormControl";
58
+ const N = s.forwardRef(({ className: e, ...o }, r) => {
59
+ const { formDescriptionId: t } = d();
60
+ return /* @__PURE__ */ i(
61
+ "p",
62
+ {
63
+ ref: r,
64
+ id: t,
65
+ className: a("text-[0.8rem] text-muted-foreground", e),
66
+ ...o
67
+ }
68
+ );
69
+ });
70
+ N.displayName = "FormDescription";
71
+ const w = s.forwardRef(({ className: e, children: o, ...r }, t) => {
72
+ const { error: m, formMessageId: n } = d(), c = m ? String(m == null ? void 0 : m.message) : o;
73
+ return c ? /* @__PURE__ */ i(
74
+ "p",
75
+ {
76
+ ref: t,
77
+ id: n,
78
+ className: a("text-[0.8rem] font-medium text-destructive", e),
79
+ ...r,
80
+ children: c
81
+ }
82
+ ) : null;
83
+ });
84
+ w.displayName = "FormMessage";
19
85
  export {
20
- u as Popover,
21
- v as PopoverAnchor,
22
- f as PopoverContent,
23
- P as PopoverTrigger
86
+ D as Form,
87
+ v as FormControl,
88
+ N as FormDescription,
89
+ M as FormField,
90
+ C as FormItem,
91
+ g as FormLabel,
92
+ w as FormMessage,
93
+ d as useFormField
24
94
  };
package/dist/index19.js CHANGED
@@ -1,58 +1,21 @@
1
- import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { Root as h } from "./index79.js";
4
- import { cn as d } from "./index2.js";
5
- const u = {
6
- red: "bg-terminal-red",
7
- yellow: "bg-terminal-yellow",
8
- green: "bg-terminal-green",
9
- magenta: "bg-terminal-magenta",
10
- blue: "bg-terminal-blue"
11
- }, w = m.forwardRef(
12
- ({
13
- className: f,
14
- value: e = 0,
15
- segments: l = 20,
16
- colorRange: a = !1,
17
- color: i = "yellow",
18
- showPercentage: o = !1,
19
- label: n,
20
- ...g
21
- }, c) => {
22
- const p = m.useMemo(() => a ? e < 34 ? "red" : e < 67 ? "yellow" : "green" : i, [e, a, i]), b = Math.floor(e / 100 * l);
23
- return /* @__PURE__ */ t("div", { className: "w-full", children: [
24
- (n || o) && /* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-2 font-mono text-xs text-terminal-green", children: [
25
- n && /* @__PURE__ */ r("span", { children: n }),
26
- o && /* @__PURE__ */ t("span", { children: [
27
- Math.round(e),
28
- "%"
29
- ] })
30
- ] }),
31
- /* @__PURE__ */ r(
32
- h,
33
- {
34
- ref: c,
35
- className: d("relative h-6 w-full overflow-hidden bg-black border-2 border-terminal-green", f),
36
- ...g,
37
- children: /* @__PURE__ */ r("div", { className: "flex h-full gap-[2px] p-[2px]", children: Array.from({ length: l }).map((y, s) => {
38
- const x = s < b;
39
- return /* @__PURE__ */ r(
40
- "div",
41
- {
42
- className: d(
43
- "flex-1 transition-colors duration-200",
44
- x ? u[p] : "bg-[repeating-linear-gradient(45deg,transparent,transparent_2px,rgba(0,255,0,0.1)_2px,rgba(0,255,0,0.1)_4px)]"
45
- )
46
- },
47
- s
48
- );
49
- }) })
50
- }
51
- )
52
- ] });
53
- }
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { cn as f } from "./index2.js";
4
+ const a = t.forwardRef(
5
+ ({ className: r, type: e, ...i }, l) => /* @__PURE__ */ o(
6
+ "input",
7
+ {
8
+ type: e,
9
+ className: f(
10
+ "flex h-10 w-full border-2 border-primary bg-black px-3 py-1 text-base text-primary transition-colors file:-ml-3 file:-my-1 file:mr-4 file:h-10 file:px-3 file:border-0 file:border-r file:border-primary file:bg-primary file:text-primary-foreground file:text-sm file:font-medium file:cursor-pointer hover:file:bg-black hover:file:text-primary placeholder:text-primary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
11
+ r
12
+ ),
13
+ ref: l,
14
+ ...i
15
+ }
16
+ )
54
17
  );
55
- w.displayName = "Progress";
18
+ a.displayName = "Input";
56
19
  export {
57
- w as Progress
20
+ a as Input
58
21
  };
package/dist/index2.js CHANGED
@@ -1,5 +1,5 @@
1
- import { clsx as o } from "./index40.js";
2
- import { twMerge as t } from "./index41.js";
1
+ import { clsx as o } from "./index43.js";
2
+ import { twMerge as t } from "./index44.js";
3
3
  function n(...r) {
4
4
  return t(o(r));
5
5
  }