@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.
- package/README.md +66 -25
- package/dist/colors.d.ts +74 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +227 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/Box.d.ts +5 -0
- package/dist/components/Box.d.ts.map +1 -0
- package/dist/components/Box.js +4 -0
- package/dist/components/Box.js.map +1 -0
- package/dist/components/Button.d.ts +14 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +91 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +11 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +37 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Header.d.ts +13 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +54 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/Input.d.ts +16 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +101 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/Modal.d.ts +13 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +28 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/{src/components/index.ts â dist/components/index.js} +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/data/glyphs.d.ts +5 -0
- package/dist/data/glyphs.d.ts.map +1 -0
- package/dist/data/glyphs.js +29 -0
- package/dist/data/glyphs.js.map +1 -0
- package/dist/detect.d.ts +15 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +49 -0
- package/dist/detect.js.map +1 -0
- package/dist/dsl.d.ts +159 -0
- package/dist/dsl.d.ts.map +1 -0
- package/dist/dsl.js +663 -0
- package/dist/dsl.js.map +1 -0
- package/dist/easing.d.ts +5 -0
- package/dist/easing.d.ts.map +1 -0
- package/dist/easing.js +18 -0
- package/dist/easing.js.map +1 -0
- package/dist/geometry.d.ts +38 -0
- package/dist/geometry.d.ts.map +1 -0
- package/dist/geometry.js +110 -0
- package/dist/geometry.js.map +1 -0
- package/dist/icons.d.ts +21 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +185 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +89 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +533 -0
- package/dist/layout.js.map +1 -0
- package/dist/render.d.ts +17 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +335 -0
- package/dist/render.js.map +1 -0
- package/dist/state.d.ts +92 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +105 -0
- package/dist/state.js.map +1 -0
- package/dist/utils.d.ts +27 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +157 -0
- package/dist/utils.js.map +1 -0
- package/package.json +33 -8
- package/src/colors.ts +0 -255
- package/src/components/Button.ts +0 -104
- package/src/components/Card.ts +0 -53
- package/src/components/Header.ts +0 -65
- package/src/components/Input.ts +0 -124
- package/src/data/glyphs.ts +0 -30
- package/src/detect.ts +0 -60
- package/src/dsl.ts +0 -661
- package/src/icons.ts +0 -186
- package/src/index.ts +0 -72
- package/src/layout.ts +0 -640
- package/src/render.ts +0 -302
- package/src/state.ts +0 -148
- 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;
|