@zakmandhro/bunti 0.1.4 → 0.1.5

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 (92) hide show
  1. package/README.md +66 -25
  2. package/dist/colors.d.ts +74 -0
  3. package/dist/colors.d.ts.map +1 -0
  4. package/dist/colors.js +227 -0
  5. package/dist/colors.js.map +1 -0
  6. package/dist/components/Box.d.ts +5 -0
  7. package/dist/components/Box.d.ts.map +1 -0
  8. package/dist/components/Box.js +4 -0
  9. package/dist/components/Box.js.map +1 -0
  10. package/dist/components/Button.d.ts +14 -0
  11. package/dist/components/Button.d.ts.map +1 -0
  12. package/dist/components/Button.js +91 -0
  13. package/dist/components/Button.js.map +1 -0
  14. package/dist/components/Card.d.ts +11 -0
  15. package/dist/components/Card.d.ts.map +1 -0
  16. package/dist/components/Card.js +37 -0
  17. package/dist/components/Card.js.map +1 -0
  18. package/dist/components/Header.d.ts +13 -0
  19. package/dist/components/Header.d.ts.map +1 -0
  20. package/dist/components/Header.js +54 -0
  21. package/dist/components/Header.js.map +1 -0
  22. package/dist/components/Input.d.ts +16 -0
  23. package/dist/components/Input.d.ts.map +1 -0
  24. package/dist/components/Input.js +101 -0
  25. package/dist/components/Input.js.map +1 -0
  26. package/dist/components/Modal.d.ts +13 -0
  27. package/dist/components/Modal.d.ts.map +1 -0
  28. package/dist/components/Modal.js +28 -0
  29. package/dist/components/Modal.js.map +1 -0
  30. package/dist/components/index.d.ts +7 -0
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/{src/components/index.ts → dist/components/index.js} +3 -0
  33. package/dist/components/index.js.map +1 -0
  34. package/dist/data/glyphs.d.ts +5 -0
  35. package/dist/data/glyphs.d.ts.map +1 -0
  36. package/dist/data/glyphs.js +29 -0
  37. package/dist/data/glyphs.js.map +1 -0
  38. package/dist/detect.d.ts +15 -0
  39. package/dist/detect.d.ts.map +1 -0
  40. package/dist/detect.js +49 -0
  41. package/dist/detect.js.map +1 -0
  42. package/dist/dsl.d.ts +159 -0
  43. package/dist/dsl.d.ts.map +1 -0
  44. package/dist/dsl.js +663 -0
  45. package/dist/dsl.js.map +1 -0
  46. package/dist/easing.d.ts +5 -0
  47. package/dist/easing.d.ts.map +1 -0
  48. package/dist/easing.js +18 -0
  49. package/dist/easing.js.map +1 -0
  50. package/dist/geometry.d.ts +38 -0
  51. package/dist/geometry.d.ts.map +1 -0
  52. package/dist/geometry.js +110 -0
  53. package/dist/geometry.js.map +1 -0
  54. package/dist/icons.d.ts +21 -0
  55. package/dist/icons.d.ts.map +1 -0
  56. package/dist/icons.js +185 -0
  57. package/dist/icons.js.map +1 -0
  58. package/dist/index.d.ts +157 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +36 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/layout.d.ts +89 -0
  63. package/dist/layout.d.ts.map +1 -0
  64. package/dist/layout.js +533 -0
  65. package/dist/layout.js.map +1 -0
  66. package/dist/render.d.ts +17 -0
  67. package/dist/render.d.ts.map +1 -0
  68. package/dist/render.js +335 -0
  69. package/dist/render.js.map +1 -0
  70. package/dist/state.d.ts +92 -0
  71. package/dist/state.d.ts.map +1 -0
  72. package/dist/state.js +105 -0
  73. package/dist/state.js.map +1 -0
  74. package/dist/utils.d.ts +27 -0
  75. package/dist/utils.d.ts.map +1 -0
  76. package/dist/utils.js +157 -0
  77. package/dist/utils.js.map +1 -0
  78. package/package.json +33 -8
  79. package/src/colors.ts +0 -255
  80. package/src/components/Button.ts +0 -104
  81. package/src/components/Card.ts +0 -53
  82. package/src/components/Header.ts +0 -65
  83. package/src/components/Input.ts +0 -124
  84. package/src/data/glyphs.ts +0 -30
  85. package/src/detect.ts +0 -60
  86. package/src/dsl.ts +0 -661
  87. package/src/icons.ts +0 -186
  88. package/src/index.ts +0 -72
  89. package/src/layout.ts +0 -640
  90. package/src/render.ts +0 -302
  91. package/src/state.ts +0 -148
  92. package/src/utils.ts +0 -165
package/src/icons.ts DELETED
@@ -1,186 +0,0 @@
1
- /**
2
- * Bunti Icon Engine
3
- * Purely tactical: Nerd Fonts or ASCII fallbacks.
4
- */
5
- import type { TerminalCapabilities } from './detect';
6
-
7
- export interface IconDefinition {
8
- nf: string;
9
- ascii: string;
10
- }
11
-
12
- export const ICON_MAP: Record<string, IconDefinition> = {
13
- add: { nf: '\uf067', ascii: '+' },
14
- 'arrow-left': { nf: '\uf060', ascii: '<' },
15
- 'arrow-right': { nf: '\uf061', ascii: '>' },
16
- bars: { nf: '\uf0c9', ascii: '≡' },
17
- bell: { nf: '\uf0f3', ascii: '!' },
18
- branch: { nf: '\uf418', ascii: '*' },
19
- bullet: { nf: '\uf111', ascii: 'â€ĸ' },
20
- bun: { nf: '\ue76f', ascii: 'B' },
21
- bunti: { nf: '\u{f0065}', ascii: '@' },
22
- check: { nf: '\uf00c', ascii: 'v' },
23
- checkbox: { nf: '\uf0c8', ascii: '[ ]' },
24
- 'checkbox-check': { nf: '\uf14a', ascii: '[x]' },
25
- 'chevron-down': { nf: '\uf078', ascii: 'v' },
26
- 'chevron-left': { nf: '\uf053', ascii: '<' },
27
- 'chevron-right': { nf: '\uf054', ascii: '>' },
28
- close: { nf: '\uf00d', ascii: 'x' },
29
- cloud: { nf: '\uf0c2', ascii: 'C' },
30
- code: { nf: '\uf121', ascii: '{' },
31
- commit: { nf: '\uf172', ascii: '+' },
32
- copy: { nf: '\uf0c5', ascii: '=' },
33
- cpu: { nf: '\uf2db', ascii: 'C' },
34
- database: { nf: '\uf1c0', ascii: 'D' },
35
- desktop: { nf: '\u{f01c4}', ascii: 'D' },
36
- disk: { nf: '\uf0a0', ascii: 'D' },
37
- download: { nf: '\uf019', ascii: 'v' },
38
- 'draft-pr': { nf: '\uebdb', ascii: '!' },
39
- edit: { nf: '\uf044', ascii: 'e' },
40
- error: { nf: '\uf00d', ascii: 'x' },
41
- exit: { nf: '\uf08b', ascii: '<' },
42
- external: { nf: '\uf08e', ascii: '>' },
43
- eye: { nf: '\uf06e', ascii: 'v' },
44
- 'eye-off': { nf: '\uf070', ascii: 'h' },
45
- file: { nf: '\uf15b', ascii: '-' },
46
- folder: { nf: '\uf07b', ascii: '[' },
47
- 'folder-open': { nf: '\uf115', ascii: '{' },
48
- fork: { nf: '\uf41a', ascii: 'Y' },
49
- gear: { nf: '\uf423', ascii: '*' },
50
- git: { nf: '\ue702', ascii: 'g' },
51
- grid: { nf: '\uf009', ascii: '#' },
52
- heart: { nf: '\uf004', ascii: '*' },
53
- 'help-circle': { nf: '\uf059', ascii: '?' },
54
- home: { nf: '\uf015', ascii: 'H' },
55
- image: { nf: '\uf03e', ascii: 'I' },
56
- info: { nf: '\uf05a', ascii: 'i' },
57
- issue: { nf: '\uebd9', ascii: '#' },
58
- json: { nf: '\ue60b', ascii: 'J' },
59
- laptop: { nf: '\uf109', ascii: 'L' },
60
- list: { nf: '\uf03a', ascii: '=' },
61
- loading: { nf: '\uf110', ascii: '~' },
62
- lock: { nf: '\uf023', ascii: 'L' },
63
- mail: { nf: '\uf0e0', ascii: '@' },
64
- markdown: { nf: '\uf48a', ascii: 'M' },
65
- maximize: { nf: '\uf0c8', ascii: '^' },
66
- memory: { nf: '\uf0c7', ascii: 'M' },
67
- menu: { nf: '\uf0c9', ascii: '≡' },
68
- merge: { nf: '\uf419', ascii: '>' },
69
- minimize: { nf: '\u{f10fe}', ascii: 'v' },
70
- network: { nf: '\uf0ac', ascii: 'N' },
71
- node: { nf: '\ue718', ascii: 'N' },
72
- pause: { nf: '\uf04c', ascii: '|' },
73
- pencil: { nf: '\uf044', ascii: 'e' },
74
- planet: { nf: '\ue22e', ascii: '㊀' },
75
- play: { nf: '\uf04b', ascii: '>' },
76
- 'plus-circle': { nf: '\uea60', ascii: '(+)' },
77
- pr: { nf: '\uf41d', ascii: '!' },
78
- refresh: { nf: '\uf021', ascii: 'R' },
79
- remove: { nf: '\uf068', ascii: '-' },
80
- repo: { nf: '\uf401', ascii: 'R' },
81
- robot: { nf: '\u{f06a9}', ascii: 'A' },
82
- rocket: { nf: '\uf135', ascii: 'R' },
83
- satellite: { nf: '\uef5f', ascii: 'S' },
84
- save: { nf: '\uf0c7', ascii: 'S' },
85
- search: { nf: '\uf002', ascii: '/' },
86
- send: { nf: '\uec0f', ascii: '>' },
87
- server: { nf: '\uf233', ascii: 'S' },
88
- settings: { nf: '\uf013', ascii: '*' },
89
- 'staggered-bars': { nf: '\u{ee19}', ascii: '≡' },
90
- star: { nf: '\uf005', ascii: '*' },
91
- stop: { nf: '\uf04d', ascii: 'X' },
92
- success: { nf: '\uf00c', ascii: 'v' },
93
- tag: { nf: '\u{f04fc}', ascii: 't' },
94
- terminal: { nf: '\uf120', ascii: '$' },
95
- trash: { nf: '\uf1f8', ascii: 'x' },
96
- user: { nf: '\uf007', ascii: 'U' },
97
- warning: { nf: '\uf071', ascii: '!' },
98
- wizard: { nf: '\u{f1477}', ascii: 'W' },
99
- yaml: { nf: '\ue6a8', ascii: 'Y' },
100
- zap: { nf: '\uf0e7', ascii: 'z' },
101
- };
102
-
103
- export const EMOJI_MAP: Record<string, string> = {
104
- 'đŸŒŋ': 'branch',
105
- 'đŸ“Ĩ': 'pr',
106
- '📌': 'commit',
107
- '🔀': 'merge',
108
- '🍴': 'fork',
109
- 'đŸˇī¸': 'tag',
110
- '📁': 'folder',
111
- '📂': 'folder-open',
112
- '📄': 'file',
113
- 'đŸ’ģ': 'laptop',
114
- 'đŸ–Ĩī¸': 'desktop',
115
- '📝': 'edit',
116
- 'đŸ“Ļ': 'json',
117
- '📜': 'yaml',
118
- '✅': 'success',
119
- '❌': 'error',
120
- 'âš ī¸': 'warning',
121
- â„šī¸: 'info',
122
- 'âŗ': 'loading',
123
- '🚀': 'rocket',
124
- 'đŸĨŸ': 'satellite',
125
- 'đŸĒ': 'planet',
126
- '🌀': 'bunti',
127
- '🤖': 'robot',
128
- 'đŸ—‘ī¸': 'trash',
129
- 'âš™ī¸': 'gear',
130
- '🔔': 'bell',
131
- 'âœ‰ī¸': 'mail',
132
- 'đŸ–ŧī¸': 'image',
133
- '❓': 'help-circle',
134
- '🙂': 'success',
135
- '😊': 'success',
136
- '😀': 'success',
137
- };
138
-
139
- const _GENERIC_ICON = '\uf0010';
140
-
141
- const cachedCaps: TerminalCapabilities = {
142
- nerdFont: true,
143
- glyphProtocol: false,
144
- unicode: true,
145
- color: true,
146
- };
147
-
148
- export function replaceEmojis(text: string): string {
149
- if (!text) return '';
150
- if (!cachedCaps.nerdFont) return text;
151
-
152
- let out = text;
153
- for (const [emoji, name] of Object.entries(EMOJI_MAP)) {
154
- const glyph = getIcon(name, cachedCaps);
155
- const regex = new RegExp(`${emoji}[\uFE00-\uFE0F]?`, 'g');
156
- out = out.replace(regex, glyph);
157
- }
158
- return out;
159
- }
160
-
161
- export async function init(options?: {
162
- nerdFont?: boolean;
163
- }): Promise<TerminalCapabilities> {
164
- if (options?.nerdFont !== undefined) cachedCaps.nerdFont = options.nerdFont;
165
- return cachedCaps;
166
- }
167
-
168
- export function getIcon(name: string, caps: TerminalCapabilities): string {
169
- const def = ICON_MAP[name];
170
- if (!def) return '';
171
- return caps.nerdFont ? def.nf : def.ascii;
172
- }
173
-
174
- export function icon(name: string): string {
175
- return getIcon(name, cachedCaps);
176
- }
177
-
178
- export function nerd(name: string): string {
179
- return ICON_MAP[name]?.nf || '';
180
- }
181
-
182
- export function register(_name: string, _glyph: string): void {}
183
-
184
- export function nerdIcon(nfChar: string, fallback: string): string {
185
- return cachedCaps.nerdFont ? nfChar : fallback;
186
- }
package/src/index.ts DELETED
@@ -1,72 +0,0 @@
1
- import * as colors from './colors';
2
- import * as detect from './detect';
3
- import * as dsl from './dsl';
4
- import * as icons from './icons';
5
- import * as layout from './layout';
6
- import * as render from './render';
7
- import * as state from './state';
8
- import * as utils from './utils';
9
-
10
- export { bg, createGradient, fg, hexToRGB, PALETTE, rgb } from './colors';
11
- // Type Exports
12
- export type { TerminalCapabilities } from './detect';
13
- // Functional API Individual Exports
14
- export { detectCapabilities } from './detect';
15
- export type { BuntiContext, DSLBoxOptions } from './dsl';
16
- export { KEYS, render } from './dsl';
17
- export type { IconDefinition } from './icons';
18
- export {
19
- EMOJI_MAP,
20
- ICON_MAP,
21
- icon,
22
- init,
23
- nerd,
24
- nerdIcon,
25
- register,
26
- replaceEmojis,
27
- } from './icons';
28
- export type {
29
- BorderStyle,
30
- ListOptions,
31
- StyleOptions,
32
- TableOptions,
33
- } from './layout';
34
- export {
35
- badge,
36
- blit,
37
- box,
38
- createStyle,
39
- getWindow,
40
- gradient,
41
- joinHorizontal,
42
- joinVertical,
43
- list,
44
- rect,
45
- setCell,
46
- table,
47
- viewport,
48
- wallpaper,
49
- } from './layout';
50
- export { flush, loop } from './render';
51
- export type { Cell, RGB, ScreenOptions, ScreenState } from './state';
52
- export {
53
- ANSI,
54
- clearBackBuffer,
55
- createScreenState,
56
- resizeScreen,
57
- } from './state';
58
- export { charWidth, stripAnsi, truncate, visibleWidth } from './utils';
59
-
60
- // Namespaced export for bunti.render style usage
61
- export const bunti = {
62
- ...detect,
63
- ...icons,
64
- ...layout,
65
- ...render,
66
- ...utils,
67
- ...colors,
68
- ...state,
69
- ...dsl,
70
- };
71
-
72
- export default bunti;