@zakmandhro/bunti 0.1.4 → 0.2.0

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 (203) hide show
  1. package/AGENTS.md +65 -0
  2. package/README.md +145 -34
  3. package/dist/cli.d.ts +44 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +147 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/colors.d.ts +144 -0
  8. package/dist/colors.d.ts.map +1 -0
  9. package/dist/colors.js +426 -0
  10. package/dist/colors.js.map +1 -0
  11. package/dist/components/Box.d.ts +11 -0
  12. package/dist/components/Box.d.ts.map +1 -0
  13. package/dist/components/Box.js +9 -0
  14. package/dist/components/Box.js.map +1 -0
  15. package/dist/components/Button.d.ts +24 -0
  16. package/dist/components/Button.d.ts.map +1 -0
  17. package/dist/components/Button.js +102 -0
  18. package/dist/components/Button.js.map +1 -0
  19. package/dist/components/Card.d.ts +33 -0
  20. package/dist/components/Card.d.ts.map +1 -0
  21. package/dist/components/Card.js +79 -0
  22. package/dist/components/Card.js.map +1 -0
  23. package/dist/components/Header.d.ts +23 -0
  24. package/dist/components/Header.d.ts.map +1 -0
  25. package/dist/components/Header.js +58 -0
  26. package/dist/components/Header.js.map +1 -0
  27. package/dist/components/Input.d.ts +25 -0
  28. package/dist/components/Input.d.ts.map +1 -0
  29. package/dist/components/Input.js +232 -0
  30. package/dist/components/Input.js.map +1 -0
  31. package/dist/components/Link.d.ts +21 -0
  32. package/dist/components/Link.d.ts.map +1 -0
  33. package/dist/components/Link.js +29 -0
  34. package/dist/components/Link.js.map +1 -0
  35. package/dist/components/Modal.d.ts +38 -0
  36. package/dist/components/Modal.d.ts.map +1 -0
  37. package/dist/components/Modal.js +87 -0
  38. package/dist/components/Modal.js.map +1 -0
  39. package/dist/components/Progress.d.ts +27 -0
  40. package/dist/components/Progress.d.ts.map +1 -0
  41. package/dist/components/Progress.js +39 -0
  42. package/dist/components/Progress.js.map +1 -0
  43. package/dist/components/Spinner.d.ts +19 -0
  44. package/dist/components/Spinner.d.ts.map +1 -0
  45. package/dist/components/Spinner.js +27 -0
  46. package/dist/components/Spinner.js.map +1 -0
  47. package/dist/components/index.d.ts +10 -0
  48. package/dist/components/index.d.ts.map +1 -0
  49. package/dist/components/index.js +10 -0
  50. package/dist/components/index.js.map +1 -0
  51. package/dist/data/nf-glyphs.d.ts +11 -0
  52. package/dist/data/nf-glyphs.d.ts.map +1 -0
  53. package/dist/data/nf-glyphs.js +535 -0
  54. package/dist/data/nf-glyphs.js.map +1 -0
  55. package/dist/data/nf-names.d.ts +8 -0
  56. package/dist/data/nf-names.d.ts.map +1 -0
  57. package/dist/data/nf-names.js +2 -0
  58. package/dist/data/nf-names.js.map +1 -0
  59. package/dist/demo-registry.d.ts +27 -0
  60. package/dist/demo-registry.d.ts.map +1 -0
  61. package/dist/demo-registry.js +57 -0
  62. package/dist/demo-registry.js.map +1 -0
  63. package/dist/demos/2048.ts +743 -0
  64. package/dist/demos/animation.ts +246 -0
  65. package/dist/demos/demo-layout.ts +124 -0
  66. package/dist/demos/engine.ts +374 -0
  67. package/dist/demos/interaction.ts +91 -0
  68. package/dist/demos/login.ts +203 -0
  69. package/dist/demos/mission-control.ts +558 -0
  70. package/dist/demos/showcase.ts +224 -0
  71. package/dist/detect.d.ts +104 -0
  72. package/dist/detect.d.ts.map +1 -0
  73. package/dist/detect.js +227 -0
  74. package/dist/detect.js.map +1 -0
  75. package/dist/diagnostics.d.ts +73 -0
  76. package/dist/diagnostics.d.ts.map +1 -0
  77. package/dist/diagnostics.js +225 -0
  78. package/dist/diagnostics.js.map +1 -0
  79. package/dist/dsl/context.d.ts +11 -0
  80. package/dist/dsl/context.d.ts.map +1 -0
  81. package/dist/dsl/context.js +563 -0
  82. package/dist/dsl/context.js.map +1 -0
  83. package/dist/dsl/hooks.d.ts +12 -0
  84. package/dist/dsl/hooks.d.ts.map +1 -0
  85. package/dist/dsl/hooks.js +148 -0
  86. package/dist/dsl/hooks.js.map +1 -0
  87. package/dist/dsl/interaction.d.ts +16 -0
  88. package/dist/dsl/interaction.d.ts.map +1 -0
  89. package/dist/dsl/interaction.js +101 -0
  90. package/dist/dsl/interaction.js.map +1 -0
  91. package/dist/dsl/layers.d.ts +14 -0
  92. package/dist/dsl/layers.d.ts.map +1 -0
  93. package/dist/dsl/layers.js +87 -0
  94. package/dist/dsl/layers.js.map +1 -0
  95. package/dist/dsl/motion.d.ts +10 -0
  96. package/dist/dsl/motion.d.ts.map +1 -0
  97. package/dist/dsl/motion.js +150 -0
  98. package/dist/dsl/motion.js.map +1 -0
  99. package/dist/dsl/render.d.ts +22 -0
  100. package/dist/dsl/render.d.ts.map +1 -0
  101. package/dist/dsl/render.js +69 -0
  102. package/dist/dsl/render.js.map +1 -0
  103. package/dist/dsl/types.d.ts +510 -0
  104. package/dist/dsl/types.d.ts.map +1 -0
  105. package/dist/dsl/types.js +33 -0
  106. package/dist/dsl/types.js.map +1 -0
  107. package/dist/dsl.d.ts +18 -0
  108. package/dist/dsl.d.ts.map +1 -0
  109. package/dist/dsl.js +17 -0
  110. package/dist/dsl.js.map +1 -0
  111. package/dist/easing.d.ts +45 -0
  112. package/dist/easing.d.ts.map +1 -0
  113. package/dist/easing.js +121 -0
  114. package/dist/easing.js.map +1 -0
  115. package/dist/geometry.d.ts +77 -0
  116. package/dist/geometry.d.ts.map +1 -0
  117. package/dist/geometry.js +130 -0
  118. package/dist/geometry.js.map +1 -0
  119. package/dist/icons-full.d.ts +5 -0
  120. package/dist/icons-full.d.ts.map +1 -0
  121. package/dist/icons-full.js +31 -0
  122. package/dist/icons-full.js.map +1 -0
  123. package/dist/icons.d.ts +442 -0
  124. package/dist/icons.d.ts.map +1 -0
  125. package/dist/icons.js +314 -0
  126. package/dist/icons.js.map +1 -0
  127. package/dist/index.d.ts +228 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +46 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/input.d.ts +177 -0
  132. package/dist/input.d.ts.map +1 -0
  133. package/dist/input.js +533 -0
  134. package/dist/input.js.map +1 -0
  135. package/dist/layout.d.ts +194 -0
  136. package/dist/layout.d.ts.map +1 -0
  137. package/dist/layout.js +673 -0
  138. package/dist/layout.js.map +1 -0
  139. package/dist/render.d.ts +49 -0
  140. package/dist/render.d.ts.map +1 -0
  141. package/dist/render.js +650 -0
  142. package/dist/render.js.map +1 -0
  143. package/dist/state.d.ts +226 -0
  144. package/dist/state.d.ts.map +1 -0
  145. package/dist/state.js +130 -0
  146. package/dist/state.js.map +1 -0
  147. package/dist/theme.d.ts +129 -0
  148. package/dist/theme.d.ts.map +1 -0
  149. package/dist/theme.js +167 -0
  150. package/dist/theme.js.map +1 -0
  151. package/dist/themes/catppuccin-mocha.d.ts +19 -0
  152. package/dist/themes/catppuccin-mocha.d.ts.map +1 -0
  153. package/dist/themes/catppuccin-mocha.js +36 -0
  154. package/dist/themes/catppuccin-mocha.js.map +1 -0
  155. package/dist/themes/dracula.d.ts +21 -0
  156. package/dist/themes/dracula.d.ts.map +1 -0
  157. package/dist/themes/dracula.js +37 -0
  158. package/dist/themes/dracula.js.map +1 -0
  159. package/dist/themes/github-light.d.ts +21 -0
  160. package/dist/themes/github-light.d.ts.map +1 -0
  161. package/dist/themes/github-light.js +36 -0
  162. package/dist/themes/github-light.js.map +1 -0
  163. package/dist/themes/index.d.ts +19 -0
  164. package/dist/themes/index.d.ts.map +1 -0
  165. package/dist/themes/index.js +17 -0
  166. package/dist/themes/index.js.map +1 -0
  167. package/dist/themes/nord.d.ts +23 -0
  168. package/dist/themes/nord.d.ts.map +1 -0
  169. package/dist/themes/nord.js +38 -0
  170. package/dist/themes/nord.js.map +1 -0
  171. package/dist/themes/one-dark-pro.d.ts +21 -0
  172. package/dist/themes/one-dark-pro.d.ts.map +1 -0
  173. package/dist/themes/one-dark-pro.js +36 -0
  174. package/dist/themes/one-dark-pro.js.map +1 -0
  175. package/dist/themes/tokyo-night.d.ts +20 -0
  176. package/dist/themes/tokyo-night.d.ts.map +1 -0
  177. package/dist/themes/tokyo-night.js +37 -0
  178. package/dist/themes/tokyo-night.js.map +1 -0
  179. package/dist/utils.d.ts +28 -0
  180. package/dist/utils.d.ts.map +1 -0
  181. package/dist/utils.js +158 -0
  182. package/dist/utils.js.map +1 -0
  183. package/dist/vendor/colors.d.ts +45 -0
  184. package/dist/vendor/colors.d.ts.map +1 -0
  185. package/dist/vendor/colors.js +72 -0
  186. package/dist/vendor/colors.js.map +1 -0
  187. package/llms.txt +79 -0
  188. package/package.json +52 -11
  189. package/src/colors.ts +0 -255
  190. package/src/components/Button.ts +0 -104
  191. package/src/components/Card.ts +0 -53
  192. package/src/components/Header.ts +0 -65
  193. package/src/components/Input.ts +0 -124
  194. package/src/components/index.ts +0 -4
  195. package/src/data/glyphs.ts +0 -30
  196. package/src/detect.ts +0 -60
  197. package/src/dsl.ts +0 -661
  198. package/src/icons.ts +0 -186
  199. package/src/index.ts +0 -72
  200. package/src/layout.ts +0 -640
  201. package/src/render.ts +0 -302
  202. package/src/state.ts +0 -148
  203. package/src/utils.ts +0 -165
package/dist/utils.js ADDED
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Bunti Utility Suite - Bun-Native High Performance Edition
3
+ */
4
+ /**
5
+ * Strips ANSI escape sequences from a string to allow accurate width measurement.
6
+ */
7
+ export function stripAnsi(str) {
8
+ if (!str)
9
+ return '';
10
+ return str.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
11
+ }
12
+ /**
13
+ * Calculates the visible width of a string using Bun's SIMD-optimized API.
14
+ */
15
+ export function visibleWidth(str) {
16
+ if (!str)
17
+ return 0;
18
+ const lines = str.split('\n');
19
+ if (lines.length > 1) {
20
+ return Math.max(...lines.map(visibleWidth));
21
+ }
22
+ return Bun.stringWidth(stripAnsi(str));
23
+ }
24
+ /**
25
+ * Returns the width of a single character or grapheme.
26
+ */
27
+ export function charWidth(char) {
28
+ const clean = stripAnsi(char);
29
+ if (clean.length === 0)
30
+ return 0;
31
+ return Bun.stringWidth(clean);
32
+ }
33
+ /**
34
+ * Truncates a string to a visible width while preserving ANSI codes.
35
+ * GUARANTEE: Never slices an ANSI escape sequence in half.
36
+ */
37
+ export function truncate(str, width, tail = '…') {
38
+ const visible = visibleWidth(str);
39
+ if (visible <= width)
40
+ return str;
41
+ const targetWidth = width - visibleWidth(tail);
42
+ if (targetWidth <= 0)
43
+ return '';
44
+ let currentWidth = 0;
45
+ let out = '';
46
+ // Custom parsing loop to isolate ANSI sequences from text
47
+ const regex = /\x1B\[[0-9;]*[a-zA-Z]/g;
48
+ let lastIndex = 0;
49
+ let match = null;
50
+ while ((match = regex.exec(str)) !== null) {
51
+ // 1. Process text before the ANSI code
52
+ const textSegment = str.substring(lastIndex, match.index);
53
+ if (textSegment.length > 0) {
54
+ const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
55
+ for (const { segment } of segmenter.segment(textSegment)) {
56
+ const w = charWidth(segment);
57
+ if (currentWidth + w > targetWidth) {
58
+ return `${out}\x1b[0m${tail}`; // Return immediately upon hitting limit
59
+ }
60
+ out += segment;
61
+ currentWidth += w;
62
+ }
63
+ }
64
+ // 2. Append the ANSI code itself (zero width)
65
+ out += match[0];
66
+ lastIndex = regex.lastIndex;
67
+ }
68
+ // 3. Process remaining text after the last ANSI code
69
+ const remainingText = str.substring(lastIndex);
70
+ if (remainingText.length > 0) {
71
+ const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
72
+ for (const { segment } of segmenter.segment(remainingText)) {
73
+ const w = charWidth(segment);
74
+ if (currentWidth + w > targetWidth) {
75
+ return `${out}\x1b[0m${tail}`;
76
+ }
77
+ out += segment;
78
+ currentWidth += w;
79
+ }
80
+ }
81
+ return `${out}\x1b[0m`;
82
+ }
83
+ /**
84
+ * Wraps text to a specific visible width, preserving ANSI codes.
85
+ * Implements word-based wrapping with fallback to char-breaking for long tokens.
86
+ */
87
+ export function wrapText(str, width) {
88
+ if (width <= 0)
89
+ return [str];
90
+ const result = [];
91
+ const rawLines = str.split('\n');
92
+ for (const rawLine of rawLines) {
93
+ if (visibleWidth(rawLine) <= width) {
94
+ result.push(rawLine);
95
+ continue;
96
+ }
97
+ // Split into tokens: words and whitespaces
98
+ const tokens = rawLine.split(/(\s+)/).filter((t) => t.length > 0);
99
+ let currentLine = '';
100
+ let currentWidth = 0;
101
+ for (const token of tokens) {
102
+ const tokenWidth = visibleWidth(token);
103
+ const isWhitespace = /^\s+$/.test(stripAnsi(token));
104
+ // If token itself is too wide, we MUST break it by character
105
+ if (tokenWidth > width) {
106
+ // Flush current line if it exists
107
+ if (currentLine) {
108
+ result.push(`${currentLine}\x1b[0m`);
109
+ currentLine = '';
110
+ currentWidth = 0;
111
+ }
112
+ // Segmented break of the long token
113
+ const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
114
+ for (const { segment } of segmenter.segment(token)) {
115
+ const sw = charWidth(segment);
116
+ if (currentWidth + sw > width) {
117
+ result.push(`${currentLine}\x1b[0m`);
118
+ currentLine = segment;
119
+ currentWidth = sw;
120
+ }
121
+ else {
122
+ currentLine += segment;
123
+ currentWidth += sw;
124
+ }
125
+ }
126
+ continue;
127
+ }
128
+ // Normal word wrap
129
+ if (currentWidth + tokenWidth > width) {
130
+ if (isWhitespace) {
131
+ // Swallow leading whitespace on new lines
132
+ continue;
133
+ }
134
+ result.push(`${currentLine.trimEnd()}\x1b[0m`);
135
+ currentLine = token;
136
+ currentWidth = tokenWidth;
137
+ }
138
+ else {
139
+ currentLine += token;
140
+ currentWidth += tokenWidth;
141
+ }
142
+ }
143
+ if (currentLine)
144
+ result.push(currentLine.trimEnd());
145
+ }
146
+ return result;
147
+ }
148
+ /** Prefixes every line of a block with `columns` spaces. */
149
+ export function indentBlock(content, columns) {
150
+ if (columns <= 0)
151
+ return content;
152
+ const prefix = ' '.repeat(columns);
153
+ return content
154
+ .split('\n')
155
+ .map((line) => prefix + line)
156
+ .join('\n');
157
+ }
158
+ //# sourceM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,CAAC;gBACrB,YAAY,IAAI,UAAU,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,IAAI,WAAW;YAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,OAAe;IAC1D,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC;IACjC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,OAAO;SACX,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC;SAC5B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Bunti Vendored ANSI Colors
3
+ *
4
+ * Adapted from picocolors (https://github.com/alexeyraspopov/picocolors)
5
+ * Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
6
+ * MIT License.
7
+ *
8
+ * Vendored (and typed) so Bunti ships with zero runtime dependencies. It
9
+ * keeps picocolors' wrap semantics: each formatter wraps text in open/close
10
+ * ANSI codes and re-opens the style after any nested close code, so nested
11
+ * styles compose correctly.
12
+ */
13
+ /** Wraps input in ANSI codes. Non-strings are coerced via string conversion. */
14
+ export type ColorFormatter = (input: string | number | null | undefined) => string;
15
+ /**
16
+ * The color surface Bunti exposes on `ctx.color` (minus Bunti's own RGB
17
+ * helpers, which are layered on top in the DSL context).
18
+ */
19
+ export interface BuntiColor {
20
+ isColorSupported: boolean;
21
+ reset: ColorFormatter;
22
+ bold: ColorFormatter;
23
+ dim: ColorFormatter;
24
+ italic: ColorFormatter;
25
+ underline: ColorFormatter;
26
+ black: ColorFormatter;
27
+ red: ColorFormatter;
28
+ green: ColorFormatter;
29
+ yellow: ColorFormatter;
30
+ blue: ColorFormatter;
31
+ magenta: ColorFormatter;
32
+ cyan: ColorFormatter;
33
+ white: ColorFormatter;
34
+ gray: ColorFormatter;
35
+ bgBlack: ColorFormatter;
36
+ bgRed: ColorFormatter;
37
+ bgGreen: ColorFormatter;
38
+ bgYellow: ColorFormatter;
39
+ bgBlue: ColorFormatter;
40
+ bgMagenta: ColorFormatter;
41
+ bgCyan: ColorFormatter;
42
+ bgWhite: ColorFormatter;
43
+ }
44
+ export declare const colors: BuntiColor;
45
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/vendor/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,gFAAgF;AAChF,MAAM,MAAM,cAAc,GAAG,CAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,KACtC,MAAM,CAAC;AAEZ;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,cAAc,CAAC;CACzB;AAoDD,eAAO,MAAM,MAAM,EAAE,UAwBpB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Bunti Vendored ANSI Colors
3
+ *
4
+ * Adapted from picocolors (https://github.com/alexeyraspopov/picocolors)
5
+ * Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
6
+ * MIT License.
7
+ *
8
+ * Vendored (and typed) so Bunti ships with zero runtime dependencies. It
9
+ * keeps picocolors' wrap semantics: each formatter wraps text in open/close
10
+ * ANSI codes and re-opens the style after any nested close code, so nested
11
+ * styles compose correctly.
12
+ */
13
+ const env = process.env ?? {};
14
+ const argv = process.argv ?? [];
15
+ const isColorSupported = !(env.NO_COLOR || argv.includes('--no-color')) &&
16
+ Boolean(env.FORCE_COLOR ||
17
+ argv.includes('--color') ||
18
+ process.platform === 'win32' ||
19
+ (process.stdout?.isTTY && env.TERM !== 'dumb') ||
20
+ env.CI);
21
+ /**
22
+ * Replaces every occurrence of `close` inside `text` with `replace`, so an
23
+ * inner style's reset re-opens the outer style instead of ending it.
24
+ */
25
+ function replaceClose(text, close, replace, index) {
26
+ let result = '';
27
+ let cursor = 0;
28
+ do {
29
+ result += text.substring(cursor, index) + replace;
30
+ cursor = index + close.length;
31
+ index = text.indexOf(close, cursor);
32
+ } while (index !== -1);
33
+ return result + text.substring(cursor);
34
+ }
35
+ function formatter(open, close, replace = open) {
36
+ if (!isColorSupported) {
37
+ return (input) => `${input}`;
38
+ }
39
+ return (input) => {
40
+ const text = `${input}`;
41
+ const index = text.indexOf(close, open.length);
42
+ return index !== -1
43
+ ? open + replaceClose(text, close, replace, index) + close
44
+ : open + text + close;
45
+ };
46
+ }
47
+ export const colors = {
48
+ isColorSupported,
49
+ reset: formatter('\x1b[0m', '\x1b[0m'),
50
+ bold: formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m'),
51
+ dim: formatter('\x1b[2m', '\x1b[22m', '\x1b[22m\x1b[2m'),
52
+ italic: formatter('\x1b[3m', '\x1b[23m'),
53
+ underline: formatter('\x1b[4m', '\x1b[24m'),
54
+ black: formatter('\x1b[30m', '\x1b[39m'),
55
+ red: formatter('\x1b[31m', '\x1b[39m'),
56
+ green: formatter('\x1b[32m', '\x1b[39m'),
57
+ yellow: formatter('\x1b[33m', '\x1b[39m'),
58
+ blue: formatter('\x1b[34m', '\x1b[39m'),
59
+ magenta: formatter('\x1b[35m', '\x1b[39m'),
60
+ cyan: formatter('\x1b[36m', '\x1b[39m'),
61
+ white: formatter('\x1b[37m', '\x1b[39m'),
62
+ gray: formatter('\x1b[90m', '\x1b[39m'),
63
+ bgBlack: formatter('\x1b[40m', '\x1b[49m'),
64
+ bgRed: formatter('\x1b[41m', '\x1b[49m'),
65
+ bgGreen: formatter('\x1b[42m', '\x1b[49m'),
66
+ bgYellow: formatter('\x1b[43m', '\x1b[49m'),
67
+ bgBlue: formatter('\x1b[44m', '\x1b[49m'),
68
+ bgMagenta: formatter('\x1b[45m', '\x1b[49m'),
69
+ bgCyan: formatter('\x1b[46m', '\x1b[49m'),
70
+ bgWhite: formatter('\x1b[47m', '\x1b[49m'),
71
+ };
72
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/vendor/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqCH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;AAEhC,MAAM,gBAAgB,GACpB,CAAC,CAAC,GAAG,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC9C,OAAO,CACL,GAAG,CAAC,WAAW;QACb,IAAI,CAAC,QAA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,UAAU,EAAE,UAAU,CAAC;IACzC,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;CAC3C,CAAC"}
package/llms.txt ADDED
@@ -0,0 +1,79 @@
1
+ # Bunti
2
+
3
+ > A Bun-native terminal UI engine with zero dependencies: 60fps
4
+ > double-buffered diff rendering, an immediate-mode contextual DSL,
5
+ > semantic themes (6 VS Code presets), mouse + keyboard input, motion
6
+ > helpers, and a 10.7k-name Nerd Font icon registry. Built to be the
7
+ > easiest TUI library for coding agents.
8
+
9
+ Requires the Bun runtime (>= 1.0); Node.js is not supported.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ bun add @zakmandhro/bunti
15
+ ```
16
+
17
+ ## Mental model
18
+
19
+ - render — Starts a Bunti app: runs `callback` every frame (immediate mode — redraw the whole screen from state each call) and flushes only the changed cells to the terminal.
20
+ - One frame = one callback: read input, derive state with
21
+ ctx.useState(key, initial), draw everything. Never mutate the
22
+ terminal yourself.
23
+ - Coordinates are terminal cells, local to the current context (the
24
+ whole screen at the root; the padded interior inside a box).
25
+ padding is [vertical, horizontal]. ctx.elapsedTime is milliseconds.
26
+ - Root-level boxes paint directly to the screen and CENTER themselves
27
+ unless given x/y. Anything that must overlap other content goes in
28
+ ctx.layer(zIndex, cb) — draw order alone does not stack.
29
+ - Keyboard input ({ keyboard: true }) needs a real TTY on stdin; piped
30
+ input is ignored. Printable keys arrive as the literal character,
31
+ specials as lowercase names ('up', 'enter'), mouse as
32
+ 'click'/'wheel_up'/'wheel_down'.
33
+
34
+ ## Core API (ctx is the object your render callback receives)
35
+
36
+ - ctx.box — Draws a styled box and renders the callback inside its padded interior (a fresh sub-context).
37
+ - ctx.text — Appends text to the current flow at the cursor.
38
+ - ctx.icon — Resolves an icon name to its glyph (Nerd Font, or ASCII fallback on plain terminals).
39
+ - ctx.blit — Paints a (possibly multi-line, ANSI-styled) string directly into the screen buffer at absolute cell coordinates — exact-position text, sprites, labels, and ASCII art.
40
+ - ctx.rect — Fills a w×h cell rectangle at absolute coordinates with a style — bars, panels, charts, and backgrounds.
41
+ - ctx.layer — Renders the callback into a transparent buffer composited above the base content by z-index — THE primitive for modals, HUDs, popovers, and anything that must overlap other content.
42
+ - ctx.wallpaper — Fills the whole screen background with a color or gradient.
43
+ - ctx.gradient — Builds a multi-stop Gradient value for `wallpaper`/`bgColor`.
44
+ - ctx.split — Splits the current area into tracks from fixed sizes, percentages, and 'fr' fill units — the layout workhorse for dashboards.
45
+ - ctx.useState — Frame-persistent state.
46
+ - ctx.useAsync — Fetches async data without blocking the render loop: kicks off the fetcher (re-running every `interval` ms when set) and returns the latest { data, loading, error } snapshot each frame.
47
+ - ctx.lastKey — First unmodified key name of this frame, or undefined when no key arrived.
48
+ - ctx.keyPressed — True if `name` was pressed (or auto-repeated) this frame.
49
+ - ctx.isKeyHeld — True from a key's first press until its repeat stream expires (~150ms hold window) — smooth held-key movement on legacy terminals.
50
+ - ctx.hitbox — Registers a clickable region and returns its interaction snapshot for this frame.
51
+ - ctx.isClicked — True exactly one frame per click (SGR release at the press origin) — fire actions here, not on isPressed.
52
+ - ctx.isHovered — True while the mouse is inside the hitbox registered for `id`.
53
+ - ctx.list — Renders a selectable list with built-in up/down keyboard navigation, mouse hover/click selection, and theme-token highlighting.
54
+ - ctx.table — Renders rows of cells as an aligned table with shared borders.
55
+ - ctx.theme — The active semantic theme for this subtree.
56
+ - ctx.setTheme — Swaps the active theme live and requests a rerender.
57
+ - ctx.animate — 0→1 progress over `duration` ms.
58
+ - ctx.transition — Enter/exit progress keyed on a visibility flag.
59
+ - ctx.stagger — Cascading entrance progress: item `index` starts index*delay ms into the timeline and animates for `duration` ms.
60
+ - ctx.elapsedTime — Milliseconds elapsed since render() started.
61
+ - ctx.requestStop — Stops the render loop and restores the terminal (the promise returned by render() then resolves).
62
+
63
+ ## Components ('@zakmandhro/bunti/components')
64
+
65
+ Box, Card, Button, Input, Modal, Spinner, Progress, Link, Header —
66
+ call as functions: Button(ctx, { id, label, onClick }).
67
+
68
+ ## Themes ('@zakmandhro/bunti/themes')
69
+
70
+ dracula, tokyoNight, catppuccinMocha, nord, oneDarkPro, githubLight;
71
+ ctx.setTheme(dracula) swaps live. createTheme({...}) derives full
72
+ themes from sparse color specs.
73
+
74
+ ## More
75
+
76
+ - Full typed API with examples ships in the package's dist/*.d.ts.
77
+ - Agent playbook: AGENTS.md (in this package).
78
+ - Starter template: https://github.com/zakmandhro/bunti/blob/main/examples/starter.ts
79
+ - Docs: https://zakmandhro.github.io/bunti/
package/package.json CHANGED
@@ -1,21 +1,57 @@
1
1
  {
2
2
  "name": "@zakmandhro/bunti",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "A Bun-native terminal layout engine with zero dependencies, 60fps rendering, and an agent-optimized functional API.",
5
- "module": "src/index.ts",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
6
8
  "exports": {
7
- ".": "./src/index.ts",
8
- "./components": "./src/components/index.ts",
9
- "./icons": "./src/icons.ts",
10
- "./layout": "./src/layout.ts",
11
- "./render": "./src/render.ts"
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./components": {
14
+ "types": "./dist/components/index.d.ts",
15
+ "import": "./dist/components/index.js"
16
+ },
17
+ "./geometry": {
18
+ "types": "./dist/geometry.d.ts",
19
+ "import": "./dist/geometry.js"
20
+ },
21
+ "./icons": {
22
+ "types": "./dist/icons.d.ts",
23
+ "import": "./dist/icons.js"
24
+ },
25
+ "./icons-full": {
26
+ "types": "./dist/icons-full.d.ts",
27
+ "import": "./dist/icons-full.js"
28
+ },
29
+ "./layout": {
30
+ "types": "./dist/layout.d.ts",
31
+ "import": "./dist/layout.js"
32
+ },
33
+ "./render": {
34
+ "types": "./dist/render.d.ts",
35
+ "import": "./dist/render.js"
36
+ },
37
+ "./themes": {
38
+ "types": "./dist/themes/index.d.ts",
39
+ "import": "./dist/themes/index.js"
40
+ }
12
41
  },
13
42
  "type": "module",
43
+ "bin": {
44
+ "bunti": "dist/cli.js"
45
+ },
14
46
  "engines": {
15
47
  "bun": ">=1.0.0"
16
48
  },
17
49
  "scripts": {
50
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && bun scripts/build-demos.ts",
51
+ "gen:llms": "bun scripts/gen-llms.ts",
52
+ "prepublishOnly": "bun run typecheck && bun run lint && bun run test && bun run gen:llms && bun run build",
18
53
  "test": "bun test",
54
+ "smoke": "bun scripts/smoke-demos.ts",
19
55
  "bench": "bun scripts/bench.ts",
20
56
  "typecheck": "tsc --noEmit",
21
57
  "type-check": "tsc --noEmit",
@@ -24,6 +60,10 @@
24
60
  "format": "biome format --write .",
25
61
  "demo": "bun demo/runner.ts",
26
62
  "example": "bun demo/runner.ts",
63
+ "record": "vhs tapes/2048.tape",
64
+ "record:animation": "vhs tapes/animation.tape",
65
+ "record:mission-control": "vhs tapes/mission-control.tape",
66
+ "record:all": "vhs tapes/2048.tape && vhs tapes/animation.tape && vhs tapes/mission-control.tape",
27
67
  "docs:dev": "vitepress dev docs",
28
68
  "docs:build": "vitepress build docs",
29
69
  "docs:preview": "vitepress preview docs"
@@ -39,11 +79,12 @@
39
79
  "author": "Zak Mandhro <zakmandhro@gmail.com>",
40
80
  "license": "MIT",
41
81
  "files": [
42
- "src"
82
+ "dist",
83
+ "README.md",
84
+ "LICENSE",
85
+ "AGENTS.md",
86
+ "llms.txt"
43
87
  ],
44
- "peerDependencies": {
45
- "picocolors": "^1.0.0"
46
- },
47
88
  "devDependencies": {
48
89
  "@biomejs/biome": "^2.4.15",
49
90
  "@types/bun": "^1.3.13",