@harryisfish/gitt 1.5.0 → 1.6.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.
package/dist/theme.js DELETED
@@ -1,59 +0,0 @@
1
- import chalk from 'chalk';
2
- // 自定义颜色
3
- const colors = {
4
- primary: chalk.cyan,
5
- success: chalk.green,
6
- warning: chalk.yellow,
7
- error: chalk.red,
8
- muted: chalk.gray,
9
- highlight: chalk.blue,
10
- info: chalk.white,
11
- };
12
- // 自定义图标
13
- const icons = {
14
- pointer: '❯',
15
- done: '✔',
16
- error: '✖',
17
- waiting: '○',
18
- };
19
- // 定义主题
20
- export const theme = {
21
- prefix: {
22
- idle: colors.primary('?'),
23
- done: colors.success(icons.done),
24
- },
25
- spinner: {
26
- interval: 100,
27
- frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'],
28
- },
29
- icon: {
30
- cursor: colors.primary(icons.pointer),
31
- },
32
- style: {
33
- // 答案样式
34
- answer: (text) => colors.success(text),
35
- // 问题样式
36
- message: (text, status) => {
37
- switch (status) {
38
- case 'loading':
39
- return colors.muted(text);
40
- case 'done':
41
- return colors.success(text);
42
- default:
43
- return colors.primary(text);
44
- }
45
- },
46
- // 错误信息样式
47
- error: (text) => colors.error(icons.error + ' ' + text),
48
- // 帮助信息样式
49
- help: (text) => colors.muted(text),
50
- // 高亮样式
51
- highlight: (text) => colors.highlight(text),
52
- // 选项描述样式
53
- description: (text) => colors.muted(`\n ${text}`),
54
- // 禁用选项样式
55
- disabled: (text) => colors.muted(`${icons.waiting} ${text}`),
56
- },
57
- // 帮助提示显示模式:'always' | 'never' | 'auto'
58
- helpMode: 'auto',
59
- };