@outfitter/cli 0.3.0 → 0.4.1

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 (269) hide show
  1. package/README.md +48 -4
  2. package/dist/actions.js +0 -2
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.js +1 -2
  5. package/dist/{render → colors}/colors.d.ts +1 -1
  6. package/dist/{render → colors}/colors.js +2 -6
  7. package/dist/colors/index.d.ts +1 -1
  8. package/dist/colors/index.js +3 -4
  9. package/dist/command.d.ts +2 -2
  10. package/dist/command.js +11 -2
  11. package/dist/completion.d.ts +36 -0
  12. package/dist/completion.js +91 -0
  13. package/dist/flags.d.ts +167 -0
  14. package/dist/flags.js +31 -0
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +5 -4
  17. package/dist/input.d.ts +3 -26
  18. package/dist/input.js +1 -31
  19. package/dist/output.d.ts +2 -2
  20. package/dist/output.js +0 -1
  21. package/dist/pagination.d.ts +1 -1
  22. package/dist/pagination.js +0 -2
  23. package/dist/query.d.ts +50 -0
  24. package/dist/query.js +51 -0
  25. package/dist/shared/@outfitter/cli-b2zk8fb3.js +357 -0
  26. package/dist/shared/@outfitter/{cli-d9ad0rqj.js → cli-jbj78ac5.js} +1 -6
  27. package/dist/shared/@outfitter/{cli-e6yv2764.d.ts → cli-k0yvzn6d.d.ts} +1 -1
  28. package/dist/shared/@outfitter/{cli-ttt7r0j7.d.ts → cli-md9347gn.d.ts} +155 -13
  29. package/dist/shared/@outfitter/{cli-5g6rkv3d.js → cli-rk9zagkm.js} +24 -32
  30. package/dist/shared/@outfitter/{cli-4h4rpdra.js → cli-zahqsaby.js} +32 -10
  31. package/dist/terminal/detection.js +1 -5
  32. package/dist/terminal/index.js +1 -6
  33. package/dist/{shared/@outfitter/cli-4cb5g831.d.ts → text.d.ts} +1 -1
  34. package/dist/{shared/@outfitter/cli-mwxsh3sr.js → text.js} +15 -14
  35. package/dist/types.d.ts +2 -2
  36. package/dist/types.js +0 -2
  37. package/dist/verbs.d.ts +50 -0
  38. package/dist/verbs.js +61 -0
  39. package/package.json +50 -204
  40. package/dist/borders/index.d.ts +0 -3
  41. package/dist/borders/index.js +0 -13
  42. package/dist/box/index.d.ts +0 -4
  43. package/dist/box/index.js +0 -13
  44. package/dist/demo/index.d.ts +0 -78
  45. package/dist/demo/index.js +0 -148
  46. package/dist/demo/registry.d.ts +0 -7
  47. package/dist/demo/registry.js +0 -28
  48. package/dist/demo/renderers/borders.d.ts +0 -7
  49. package/dist/demo/renderers/borders.js +0 -17
  50. package/dist/demo/renderers/box.d.ts +0 -7
  51. package/dist/demo/renderers/box.js +0 -18
  52. package/dist/demo/renderers/colors.d.ts +0 -7
  53. package/dist/demo/renderers/colors.js +0 -18
  54. package/dist/demo/renderers/indicators.d.ts +0 -7
  55. package/dist/demo/renderers/indicators.js +0 -17
  56. package/dist/demo/renderers/list.d.ts +0 -7
  57. package/dist/demo/renderers/list.js +0 -19
  58. package/dist/demo/renderers/markdown.d.ts +0 -7
  59. package/dist/demo/renderers/markdown.js +0 -18
  60. package/dist/demo/renderers/progress.d.ts +0 -7
  61. package/dist/demo/renderers/progress.js +0 -17
  62. package/dist/demo/renderers/spinner.d.ts +0 -7
  63. package/dist/demo/renderers/spinner.js +0 -19
  64. package/dist/demo/renderers/table.d.ts +0 -7
  65. package/dist/demo/renderers/table.js +0 -19
  66. package/dist/demo/renderers/text.d.ts +0 -7
  67. package/dist/demo/renderers/text.js +0 -16
  68. package/dist/demo/renderers/tree.d.ts +0 -7
  69. package/dist/demo/renderers/tree.js +0 -18
  70. package/dist/demo/section.d.ts +0 -5
  71. package/dist/demo/section.js +0 -23
  72. package/dist/demo/templates.d.ts +0 -4
  73. package/dist/demo/templates.js +0 -10
  74. package/dist/demo/types.d.ts +0 -3
  75. package/dist/demo/types.js +0 -8
  76. package/dist/list/index.d.ts +0 -3
  77. package/dist/list/index.js +0 -9
  78. package/dist/preset/full.d.ts +0 -14
  79. package/dist/preset/full.js +0 -41
  80. package/dist/preset/standard.d.ts +0 -11
  81. package/dist/preset/standard.js +0 -30
  82. package/dist/prompt/confirm.d.ts +0 -4
  83. package/dist/prompt/confirm.js +0 -9
  84. package/dist/prompt/group.d.ts +0 -4
  85. package/dist/prompt/group.js +0 -9
  86. package/dist/prompt/index.d.ts +0 -7
  87. package/dist/prompt/index.js +0 -32
  88. package/dist/prompt/select.d.ts +0 -4
  89. package/dist/prompt/select.js +0 -11
  90. package/dist/prompt/text.d.ts +0 -4
  91. package/dist/prompt/text.js +0 -11
  92. package/dist/prompt/types.d.ts +0 -3
  93. package/dist/prompt/types.js +0 -8
  94. package/dist/prompt/validators.d.ts +0 -2
  95. package/dist/prompt/validators.js +0 -8
  96. package/dist/render/borders.d.ts +0 -2
  97. package/dist/render/borders.js +0 -15
  98. package/dist/render/box.d.ts +0 -3
  99. package/dist/render/box.js +0 -23
  100. package/dist/render/date.d.ts +0 -2
  101. package/dist/render/date.js +0 -12
  102. package/dist/render/format-relative.d.ts +0 -2
  103. package/dist/render/format-relative.js +0 -8
  104. package/dist/render/format.d.ts +0 -2
  105. package/dist/render/format.js +0 -10
  106. package/dist/render/heading.d.ts +0 -3
  107. package/dist/render/heading.js +0 -14
  108. package/dist/render/index.d.ts +0 -32
  109. package/dist/render/index.js +0 -235
  110. package/dist/render/indicators.d.ts +0 -2
  111. package/dist/render/indicators.js +0 -16
  112. package/dist/render/json.d.ts +0 -2
  113. package/dist/render/json.js +0 -10
  114. package/dist/render/layout.d.ts +0 -5
  115. package/dist/render/layout.js +0 -25
  116. package/dist/render/list.d.ts +0 -2
  117. package/dist/render/list.js +0 -8
  118. package/dist/render/markdown.d.ts +0 -2
  119. package/dist/render/markdown.js +0 -10
  120. package/dist/render/progress.d.ts +0 -2
  121. package/dist/render/progress.js +0 -8
  122. package/dist/render/separator.d.ts +0 -3
  123. package/dist/render/separator.js +0 -14
  124. package/dist/render/shapes.d.ts +0 -2
  125. package/dist/render/shapes.js +0 -35
  126. package/dist/render/spinner.d.ts +0 -2
  127. package/dist/render/spinner.js +0 -12
  128. package/dist/render/stack.d.ts +0 -3
  129. package/dist/render/stack.js +0 -38
  130. package/dist/render/table.d.ts +0 -3
  131. package/dist/render/table.js +0 -12
  132. package/dist/render/text.d.ts +0 -2
  133. package/dist/render/text.js +0 -27
  134. package/dist/render/tree.d.ts +0 -2
  135. package/dist/render/tree.js +0 -10
  136. package/dist/render/types.d.ts +0 -2
  137. package/dist/shared/@outfitter/cli-0djg8q91.js +0 -7
  138. package/dist/shared/@outfitter/cli-0w242qtv.d.ts +0 -48
  139. package/dist/shared/@outfitter/cli-1g8tt31a.d.ts +0 -119
  140. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +0 -45
  141. package/dist/shared/@outfitter/cli-1sb3xvnw.js +0 -95
  142. package/dist/shared/@outfitter/cli-1vy0vtga.js +0 -135
  143. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +0 -50
  144. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +0 -42
  145. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +0 -97
  146. package/dist/shared/@outfitter/cli-3hk2xf3c.js +0 -82
  147. package/dist/shared/@outfitter/cli-3hp8qwx3.js +0 -11
  148. package/dist/shared/@outfitter/cli-47yw5h6a.js +0 -7
  149. package/dist/shared/@outfitter/cli-4b6tbp68.d.ts +0 -36
  150. package/dist/shared/@outfitter/cli-4fcz51qa.js +0 -70
  151. package/dist/shared/@outfitter/cli-4x6pqnez.js +0 -20
  152. package/dist/shared/@outfitter/cli-4zk2y4a2.d.ts +0 -61
  153. package/dist/shared/@outfitter/cli-60b5xh1r.js +0 -20
  154. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +0 -51
  155. package/dist/shared/@outfitter/cli-6fxffp8k.js +0 -1
  156. package/dist/shared/@outfitter/cli-6hg0sg2d.d.ts +0 -93
  157. package/dist/shared/@outfitter/cli-6r3m2knf.js +0 -62
  158. package/dist/shared/@outfitter/cli-6ty1nvws.js +0 -179
  159. package/dist/shared/@outfitter/cli-7n610r63.js +0 -20
  160. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +0 -59
  161. package/dist/shared/@outfitter/cli-83jwvj1t.d.ts +0 -17
  162. package/dist/shared/@outfitter/cli-85fg2vr5.js +0 -123
  163. package/dist/shared/@outfitter/cli-8bwaw3pz.js +0 -7
  164. package/dist/shared/@outfitter/cli-8hngbjyr.d.ts +0 -164
  165. package/dist/shared/@outfitter/cli-8j5k6mr3.js +0 -71
  166. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +0 -223
  167. package/dist/shared/@outfitter/cli-914d47mt.js +0 -20
  168. package/dist/shared/@outfitter/cli-9bcm4zhf.d.ts +0 -87
  169. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +0 -190
  170. package/dist/shared/@outfitter/cli-a4q87517.d.ts +0 -64
  171. package/dist/shared/@outfitter/cli-aem6v4c8.js +0 -146
  172. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +0 -132
  173. package/dist/shared/@outfitter/cli-b5c2k0d7.js +0 -39
  174. package/dist/shared/@outfitter/cli-b5epywry.js +0 -1
  175. package/dist/shared/@outfitter/cli-bc17qeh2.js +0 -19
  176. package/dist/shared/@outfitter/cli-bcmcaz1b.js +0 -23
  177. package/dist/shared/@outfitter/cli-bv09nme3.d.ts +0 -56
  178. package/dist/shared/@outfitter/cli-c6pbxpw0.d.ts +0 -112
  179. package/dist/shared/@outfitter/cli-c8fqdaes.js +0 -117
  180. package/dist/shared/@outfitter/cli-c8q4f71g.js +0 -144
  181. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +0 -30
  182. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +0 -53
  183. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +0 -42
  184. package/dist/shared/@outfitter/cli-cwgj6mcs.js +0 -214
  185. package/dist/shared/@outfitter/cli-d8ahdd9d.js +0 -272
  186. package/dist/shared/@outfitter/cli-dbyteh27.d.ts +0 -24
  187. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +0 -91
  188. package/dist/shared/@outfitter/cli-en6zn6sj.js +0 -1
  189. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +0 -300
  190. package/dist/shared/@outfitter/cli-f6fsaayd.js +0 -94
  191. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +0 -106
  192. package/dist/shared/@outfitter/cli-ffa0jwb7.js +0 -122
  193. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +0 -66
  194. package/dist/shared/@outfitter/cli-h3jz0bxz.js +0 -48
  195. package/dist/shared/@outfitter/cli-h4wpzb3f.js +0 -67
  196. package/dist/shared/@outfitter/cli-hda6mc28.js +0 -126
  197. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +0 -328
  198. package/dist/shared/@outfitter/cli-j19a91ck.js +0 -30
  199. package/dist/shared/@outfitter/cli-jejfypgf.js +0 -85
  200. package/dist/shared/@outfitter/cli-jp0k3qd9.js +0 -279
  201. package/dist/shared/@outfitter/cli-k76e7173.js +0 -128
  202. package/dist/shared/@outfitter/cli-kc3ffp1v.d.ts +0 -23
  203. package/dist/shared/@outfitter/cli-kk5hnndk.d.ts +0 -128
  204. package/dist/shared/@outfitter/cli-ktqme80d.js +0 -7
  205. package/dist/shared/@outfitter/cli-mq0jp15z.js +0 -1
  206. package/dist/shared/@outfitter/cli-n0c33vba.js +0 -25
  207. package/dist/shared/@outfitter/cli-n17gt1dz.js +0 -19
  208. package/dist/shared/@outfitter/cli-n9dbh0hp.js +0 -51
  209. package/dist/shared/@outfitter/cli-ndem6tz8.js +0 -63
  210. package/dist/shared/@outfitter/cli-nj4nqy1h.d.ts +0 -24
  211. package/dist/shared/@outfitter/cli-nkns8p4r.js +0 -61
  212. package/dist/shared/@outfitter/cli-p3dqm1vd.js +0 -22
  213. package/dist/shared/@outfitter/cli-pndwprz8.js +0 -118
  214. package/dist/shared/@outfitter/cli-pvrwv6rb.js +0 -352
  215. package/dist/shared/@outfitter/cli-py02m79x.d.ts +0 -20
  216. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +0 -71
  217. package/dist/shared/@outfitter/cli-regjbef6.d.ts +0 -26
  218. package/dist/shared/@outfitter/cli-s1tx5kha.d.ts +0 -59
  219. package/dist/shared/@outfitter/cli-sam2sq50.js +0 -37
  220. package/dist/shared/@outfitter/cli-snxj55n6.js +0 -43
  221. package/dist/shared/@outfitter/cli-symyxb0z.js +0 -20
  222. package/dist/shared/@outfitter/cli-tvw1xrdj.js +0 -20
  223. package/dist/shared/@outfitter/cli-v1tzwxkt.js +0 -32
  224. package/dist/shared/@outfitter/cli-vd60dj65.js +0 -1
  225. package/dist/shared/@outfitter/cli-vfcrskfj.d.ts +0 -41
  226. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +0 -74
  227. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +0 -54
  228. package/dist/shared/@outfitter/cli-x4cavvc0.js +0 -1
  229. package/dist/shared/@outfitter/cli-xep6v2c0.js +0 -52
  230. package/dist/shared/@outfitter/cli-xg5y5fhk.js +0 -86
  231. package/dist/shared/@outfitter/cli-y7k1t81k.js +0 -30
  232. package/dist/shared/@outfitter/cli-yfyzy95c.js +0 -67
  233. package/dist/shared/@outfitter/cli-z78mkrc7.js +0 -59
  234. package/dist/shared/@outfitter/cli-znc47004.js +0 -134
  235. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +0 -26
  236. package/dist/streaming/ansi.d.ts +0 -2
  237. package/dist/streaming/ansi.js +0 -8
  238. package/dist/streaming/index.d.ts +0 -4
  239. package/dist/streaming/index.js +0 -17
  240. package/dist/streaming/spinner.d.ts +0 -3
  241. package/dist/streaming/spinner.js +0 -10
  242. package/dist/streaming/writer.d.ts +0 -2
  243. package/dist/streaming/writer.js +0 -9
  244. package/dist/table/index.d.ts +0 -4
  245. package/dist/table/index.js +0 -13
  246. package/dist/theme/context.d.ts +0 -9
  247. package/dist/theme/context.js +0 -14
  248. package/dist/theme/create.d.ts +0 -8
  249. package/dist/theme/create.js +0 -12
  250. package/dist/theme/index.d.ts +0 -17
  251. package/dist/theme/index.js +0 -42
  252. package/dist/theme/presets/bold.d.ts +0 -8
  253. package/dist/theme/presets/bold.js +0 -12
  254. package/dist/theme/presets/default.d.ts +0 -8
  255. package/dist/theme/presets/default.js +0 -11
  256. package/dist/theme/presets/index.d.ts +0 -12
  257. package/dist/theme/presets/index.js +0 -24
  258. package/dist/theme/presets/minimal.d.ts +0 -8
  259. package/dist/theme/presets/minimal.js +0 -12
  260. package/dist/theme/presets/rounded.d.ts +0 -8
  261. package/dist/theme/presets/rounded.js +0 -12
  262. package/dist/theme/resolve.d.ts +0 -8
  263. package/dist/theme/resolve.js +0 -11
  264. package/dist/theme/types.d.ts +0 -7
  265. package/dist/theme/types.js +0 -1
  266. package/dist/tree/index.d.ts +0 -3
  267. package/dist/tree/index.js +0 -11
  268. /package/dist/shared/@outfitter/{cli-ykxn7rb2.d.ts → cli-xppg982q.d.ts} +0 -0
  269. /package/dist/{render/types.js → shared/@outfitter/cli-zw75pdk8.js} +0 -0
@@ -1,214 +0,0 @@
1
- // @bun
2
- import {
3
- BORDER_STYLE_META,
4
- getBorderStyles
5
- } from "./cli-d8ahdd9d.js";
6
- import {
7
- getExample
8
- } from "./cli-xep6v2c0.js";
9
- import {
10
- demoSection
11
- } from "./cli-sam2sq50.js";
12
- import {
13
- createBox,
14
- init_box,
15
- renderBox
16
- } from "./cli-jp0k3qd9.js";
17
-
18
- // packages/cli/src/demo/renderers/box.ts
19
- init_box();
20
- function renderBoxDemo(config, theme) {
21
- const showCode = config.showCode ?? true;
22
- const showDescriptions = config.showDescriptions ?? true;
23
- const lines = [];
24
- lines.push(demoSection("Basic Box"));
25
- lines.push("");
26
- if (showCode) {
27
- lines.push('import { renderBox } from "@outfitter/cli/render";');
28
- lines.push("");
29
- }
30
- const content = getExample("boxContent", config.examples);
31
- if (showCode) {
32
- lines.push(`renderBox("${content}")`);
33
- lines.push("");
34
- }
35
- lines.push(renderBox(content));
36
- lines.push("");
37
- lines.push(demoSection("Box with Title"));
38
- lines.push("");
39
- const title = getExample("boxTitle", config.examples);
40
- if (showCode) {
41
- lines.push(`renderBox("${content}", { title: "${title}" })`);
42
- lines.push("");
43
- }
44
- lines.push(renderBox(content, { title }));
45
- lines.push("");
46
- lines.push(demoSection("Border Styles"));
47
- lines.push("");
48
- const styles = getBorderStyles().filter((s) => s !== "none");
49
- for (const style of styles) {
50
- const meta = BORDER_STYLE_META[style];
51
- lines.push(`${meta.label.toUpperCase()}`);
52
- if (showDescriptions) {
53
- lines.push(theme.muted(meta.description));
54
- }
55
- lines.push("");
56
- lines.push(renderBox("Content", { border: style }));
57
- lines.push("");
58
- }
59
- lines.push(demoSection("Alignment"));
60
- lines.push("");
61
- const alignments = [
62
- "left",
63
- "center",
64
- "right"
65
- ];
66
- for (const align of alignments) {
67
- if (showCode) {
68
- lines.push(`renderBox("${align}", { width: 30, align: "${align}" })`);
69
- }
70
- lines.push(renderBox(align, { width: 30, align }));
71
- lines.push("");
72
- }
73
- lines.push(demoSection("Multi-Line Content"));
74
- lines.push("");
75
- const multiLine = ["Line one", "Line two", "Line three"];
76
- if (showCode) {
77
- lines.push('renderBox(["Line one", "Line two", "Line three"])');
78
- lines.push("");
79
- }
80
- lines.push(renderBox(multiLine));
81
- lines.push("");
82
- lines.push(demoSection("Sections with Dividers"));
83
- lines.push("");
84
- if (showDescriptions) {
85
- lines.push(theme.muted("Use sections to separate content with internal dividers."));
86
- lines.push("");
87
- }
88
- if (showCode) {
89
- lines.push('renderBox("", {');
90
- lines.push(' sections: ["Header", ["Line 1", "Line 2"], "Footer"],');
91
- lines.push(' border: "rounded",');
92
- lines.push("})");
93
- lines.push("");
94
- }
95
- lines.push(renderBox("", {
96
- sections: ["Header", ["Line 1", "Line 2"], "Footer"],
97
- border: "rounded"
98
- }));
99
- lines.push("");
100
- if (showDescriptions) {
101
- lines.push(theme.muted("Example: Status panel with sections"));
102
- lines.push("");
103
- }
104
- if (showCode) {
105
- lines.push('renderBox("", {');
106
- lines.push(" sections: [");
107
- lines.push(' "System Status",');
108
- lines.push(' ["CPU: 45%", "Memory: 2.1 GB", "Disk: 120 GB free"],');
109
- lines.push(' "Updated: 2 min ago"');
110
- lines.push(" ],");
111
- lines.push(' border: "single",');
112
- lines.push(" width: 30,");
113
- lines.push("})");
114
- lines.push("");
115
- }
116
- lines.push(renderBox("", {
117
- sections: [
118
- "System Status",
119
- ["CPU: 45%", "Memory: 2.1 GB", "Disk: 120 GB free"],
120
- "Updated: 2 min ago"
121
- ],
122
- border: "single",
123
- width: 30
124
- }));
125
- lines.push("");
126
- lines.push(demoSection("Partial Borders"));
127
- lines.push("");
128
- if (showDescriptions) {
129
- lines.push(theme.muted("Control which borders to render with the borders option."));
130
- lines.push("");
131
- }
132
- if (showCode) {
133
- lines.push('renderBox("Top and bottom only", {');
134
- lines.push(" borders: { top: true, bottom: true, left: false, right: false }");
135
- lines.push("})");
136
- lines.push("");
137
- }
138
- lines.push(renderBox("Top and bottom only", {
139
- borders: { top: true, bottom: true, left: false, right: false }
140
- }));
141
- lines.push("");
142
- if (showCode) {
143
- lines.push('renderBox("Left and right only", {');
144
- lines.push(" borders: { top: false, bottom: false, left: true, right: true }");
145
- lines.push("})");
146
- lines.push("");
147
- }
148
- lines.push(renderBox("Left and right only", {
149
- borders: { top: false, bottom: false, left: true, right: true }
150
- }));
151
- lines.push("");
152
- lines.push(demoSection("Margin"));
153
- lines.push("");
154
- if (showDescriptions) {
155
- lines.push(theme.muted("Add spacing outside the box with margin."));
156
- lines.push("");
157
- }
158
- if (showCode) {
159
- lines.push('renderBox("With margin", { margin: { left: 4 } })');
160
- lines.push("");
161
- }
162
- lines.push(renderBox("With margin", { margin: { left: 4 } }));
163
- lines.push("");
164
- lines.push(demoSection("Individual Padding"));
165
- lines.push("");
166
- if (showDescriptions) {
167
- lines.push(theme.muted("Control padding per side with an object."));
168
- lines.push("");
169
- }
170
- if (showCode) {
171
- lines.push('renderBox("Custom padding", {');
172
- lines.push(" padding: { top: 1, bottom: 1, left: 3, right: 1 }");
173
- lines.push("})");
174
- lines.push("");
175
- }
176
- lines.push(renderBox("Custom padding", {
177
- padding: { top: 1, bottom: 1, left: 3, right: 1 }
178
- }));
179
- lines.push("");
180
- lines.push(demoSection("Nested Boxes"));
181
- lines.push("");
182
- if (showDescriptions) {
183
- lines.push(theme.muted("Use createBox() to create composable boxes with metadata."));
184
- lines.push("");
185
- }
186
- if (showCode) {
187
- lines.push('const inner = createBox("Inner content", { border: "rounded" });');
188
- lines.push('const outer = createBox(inner, { border: "double", title: "Container" });');
189
- lines.push("console.log(outer.output);");
190
- lines.push("");
191
- }
192
- const inner = createBox("Inner content", { border: "rounded" });
193
- const outer = createBox(inner, { border: "double", title: "Container" });
194
- lines.push(outer.output);
195
- lines.push("");
196
- if (showDescriptions) {
197
- lines.push(theme.muted("Boxes can be nested to any depth."));
198
- lines.push("");
199
- }
200
- if (showCode) {
201
- lines.push('const level1 = createBox("Core", { border: "single" });');
202
- lines.push('const level2 = createBox(level1, { border: "rounded", title: "Middle" });');
203
- lines.push('const level3 = createBox(level2, { border: "double", title: "Outer" });');
204
- lines.push("");
205
- }
206
- const level1 = createBox("Core", { border: "single" });
207
- const level2 = createBox(level1, { border: "rounded", title: "Middle" });
208
- const level3 = createBox(level2, { border: "double", title: "Outer" });
209
- lines.push(level3.output);
210
- return lines.join(`
211
- `);
212
- }
213
-
214
- export { renderBoxDemo };
@@ -1,272 +0,0 @@
1
- // @bun
2
- // packages/cli/src/demo/registry.ts
3
- var THEME_METHOD_META = {
4
- success: {
5
- category: "semantic",
6
- description: "Green for success messages",
7
- defaultExample: "Operation completed"
8
- },
9
- warning: {
10
- category: "semantic",
11
- description: "Yellow for warnings",
12
- defaultExample: "Proceed with caution"
13
- },
14
- error: {
15
- category: "semantic",
16
- description: "Red for errors",
17
- defaultExample: "Something went wrong"
18
- },
19
- info: {
20
- category: "semantic",
21
- description: "Blue for information",
22
- defaultExample: "For your information"
23
- },
24
- primary: {
25
- category: "semantic",
26
- description: "Default text (no color)",
27
- defaultExample: "Main content"
28
- },
29
- secondary: {
30
- category: "semantic",
31
- description: "Gray for secondary text",
32
- defaultExample: "Supporting text"
33
- },
34
- muted: {
35
- category: "semantic",
36
- description: "Dim for de-emphasized text",
37
- defaultExample: "(optional)"
38
- },
39
- accent: {
40
- category: "semantic",
41
- description: "Cyan for highlights",
42
- defaultExample: "Highlighted item"
43
- },
44
- highlight: {
45
- category: "semantic",
46
- description: "Bold for emphasis",
47
- defaultExample: "Important"
48
- },
49
- link: {
50
- category: "semantic",
51
- description: "Cyan + underline for URLs",
52
- defaultExample: "https://example.com"
53
- },
54
- destructive: {
55
- category: "semantic",
56
- description: "Bright red for dangerous actions",
57
- defaultExample: "Delete forever"
58
- },
59
- subtle: {
60
- category: "semantic",
61
- description: "Dim gray for fine print",
62
- defaultExample: "Fine print"
63
- },
64
- bold: {
65
- category: "utility",
66
- description: "Bold styling",
67
- defaultExample: "Strong emphasis"
68
- },
69
- italic: {
70
- category: "utility",
71
- description: "Italic styling",
72
- defaultExample: "Subtle emphasis"
73
- },
74
- underline: {
75
- category: "utility",
76
- description: "Underline styling",
77
- defaultExample: "Underlined text"
78
- },
79
- dim: {
80
- category: "utility",
81
- description: "Dim styling",
82
- defaultExample: "De-emphasized"
83
- },
84
- inverse: {
85
- category: "utility",
86
- description: "Inverse styling (swap fg/bg)",
87
- defaultExample: "Inverted text"
88
- }
89
- };
90
- function getThemeMethodsByCategory() {
91
- const semantic = [];
92
- const utility = [];
93
- for (const [key, meta] of Object.entries(THEME_METHOD_META)) {
94
- if (meta.category === "semantic") {
95
- semantic.push(key);
96
- } else {
97
- utility.push(key);
98
- }
99
- }
100
- return { semantic, utility };
101
- }
102
- var BORDER_STYLE_META = {
103
- single: {
104
- value: "single",
105
- label: "Single",
106
- description: "Standard Unicode single-line borders (\u250C\u2500\u2510)"
107
- },
108
- double: {
109
- value: "double",
110
- label: "Double",
111
- description: "Double-line borders (\u2554\u2550\u2557)"
112
- },
113
- rounded: {
114
- value: "rounded",
115
- label: "Rounded",
116
- description: "Rounded corners with single lines (\u256D\u2500\u256E)"
117
- },
118
- heavy: {
119
- value: "heavy",
120
- label: "Heavy",
121
- description: "Thick/heavy borders (\u250F\u2501\u2513)"
122
- },
123
- ascii: {
124
- value: "ascii",
125
- label: "ASCII",
126
- description: "ASCII-only fallback (+, -, |)"
127
- },
128
- none: {
129
- value: "none",
130
- label: "None",
131
- description: "No borders (empty strings)"
132
- }
133
- };
134
- function getBorderStyles() {
135
- return Object.keys(BORDER_STYLE_META);
136
- }
137
- var SPINNER_STYLE_META = {
138
- dots: {
139
- value: "dots",
140
- label: "Dots",
141
- description: "Braille dots animation (default, smooth)"
142
- },
143
- line: {
144
- value: "line",
145
- label: "Line",
146
- description: "Classic ASCII spinner (-\\|/)"
147
- },
148
- arc: {
149
- value: "arc",
150
- label: "Arc",
151
- description: "Corner arc rotation"
152
- },
153
- circle: {
154
- value: "circle",
155
- label: "Circle",
156
- description: "Half-filled circle rotation"
157
- },
158
- bounce: {
159
- value: "bounce",
160
- label: "Bounce",
161
- description: "Bouncing dot (vertical)"
162
- },
163
- ping: {
164
- value: "ping",
165
- label: "Ping",
166
- description: "Bouncing dot in brackets (horizontal)"
167
- }
168
- };
169
- function getSpinnerStyles() {
170
- return Object.keys(SPINNER_STYLE_META);
171
- }
172
- var LIST_STYLE_META = {
173
- dash: {
174
- value: "dash",
175
- label: "Dash",
176
- description: "Uses - character (default)"
177
- },
178
- bullet: {
179
- value: "bullet",
180
- label: "Bullet",
181
- description: "Uses \u2022 character"
182
- },
183
- number: {
184
- value: "number",
185
- label: "Number",
186
- description: "Uses 1. for top-level, a. for nested, i. for deeply nested"
187
- },
188
- checkbox: {
189
- value: "checkbox",
190
- label: "Checkbox",
191
- description: "Uses \u2610 for unchecked, \u2611 for checked"
192
- }
193
- };
194
- function getListStyles() {
195
- return Object.keys(LIST_STYLE_META);
196
- }
197
- var PRIMITIVE_META = {
198
- colors: {
199
- id: "colors",
200
- name: "Colors",
201
- description: "Semantic color theme with ANSI support",
202
- importExample: 'import { createTheme } from "@outfitter/cli/render";'
203
- },
204
- borders: {
205
- id: "borders",
206
- name: "Borders",
207
- description: "Box-drawing character sets",
208
- importExample: 'import { BORDERS, getBorderCharacters } from "@outfitter/cli/render";'
209
- },
210
- spinner: {
211
- id: "spinner",
212
- name: "Spinner",
213
- description: "Animated spinners for async operations",
214
- importExample: 'import { renderSpinner, SPINNERS } from "@outfitter/cli/render";'
215
- },
216
- list: {
217
- id: "list",
218
- name: "List",
219
- description: "Bullet, numbered, and checkbox lists",
220
- importExample: 'import { renderList } from "@outfitter/cli/render";'
221
- },
222
- box: {
223
- id: "box",
224
- name: "Box",
225
- description: "Bordered panels with optional titles",
226
- importExample: 'import { renderBox } from "@outfitter/cli/render";'
227
- },
228
- table: {
229
- id: "table",
230
- name: "Table",
231
- description: "Unicode tables with multiple border styles",
232
- importExample: 'import { renderTable } from "@outfitter/cli/render";'
233
- },
234
- progress: {
235
- id: "progress",
236
- name: "Progress",
237
- description: "Progress bars with filled/empty segments",
238
- importExample: 'import { renderProgress } from "@outfitter/cli/render";'
239
- },
240
- tree: {
241
- id: "tree",
242
- name: "Tree",
243
- description: "Hierarchical tree rendering",
244
- importExample: 'import { renderTree } from "@outfitter/cli/render";'
245
- },
246
- text: {
247
- id: "text",
248
- name: "Text",
249
- description: "Text utilities (width, wrap, truncate, pad)",
250
- importExample: 'import { getStringWidth, wrapText, truncateText, padText } from "@outfitter/cli/render";'
251
- },
252
- markdown: {
253
- id: "markdown",
254
- name: "Markdown",
255
- description: "Markdown to terminal ANSI rendering",
256
- importExample: 'import { renderMarkdown } from "@outfitter/cli/render";'
257
- },
258
- indicators: {
259
- id: "indicators",
260
- name: "Indicators",
261
- description: "Status symbols, selection markers, and progress indicators",
262
- importExample: 'import { getIndicator, INDICATORS } from "@outfitter/cli/render";'
263
- }
264
- };
265
- function getPrimitiveIds() {
266
- return Object.keys(PRIMITIVE_META);
267
- }
268
- function getPrimitiveMeta(id) {
269
- return PRIMITIVE_META[id];
270
- }
271
-
272
- export { THEME_METHOD_META, getThemeMethodsByCategory, BORDER_STYLE_META, getBorderStyles, SPINNER_STYLE_META, getSpinnerStyles, LIST_STYLE_META, getListStyles, PRIMITIVE_META, getPrimitiveIds, getPrimitiveMeta };
@@ -1,24 +0,0 @@
1
- import { VisualTheme } from "./cli-8hngbjyr";
2
- /**
3
- * Rounded visual theme.
4
- *
5
- * Features:
6
- * - Rounded box-drawing corners (╭─╮)
7
- * - Rounded tree guide style
8
- * - Softer visual aesthetic
9
- *
10
- * Inherits all other properties from {@link defaultTheme}.
11
- *
12
- * @example
13
- * ```typescript
14
- * import { roundedTheme } from "@outfitter/cli/theme/presets";
15
- *
16
- * // Use rounded styling
17
- * const box = renderBox("Hello", { border: roundedTheme.border });
18
- * // ╭───────╮
19
- * // │ Hello │
20
- * // ╰───────╯
21
- * ```
22
- */
23
- declare const roundedTheme: VisualTheme;
24
- export { roundedTheme };
@@ -1,91 +0,0 @@
1
- /**
2
- * Spinner rendering utilities.
3
- *
4
- * Provides animated spinner frames for async operations with
5
- * multiple styles and graceful degradation for non-TTY contexts.
6
- *
7
- * @packageDocumentation
8
- */
9
- /**
10
- * Available spinner animation styles.
11
- *
12
- * - `dots`: Braille dots animation (default, smooth)
13
- * - `line`: Classic ASCII spinner (-\|/)
14
- * - `arc`: Corner arc rotation
15
- * - `circle`: Half-filled circle rotation
16
- * - `bounce`: Bouncing dot (vertical)
17
- * - `ping`: Bouncing dot in brackets (horizontal)
18
- */
19
- type SpinnerStyle = "dots" | "line" | "arc" | "circle" | "bounce" | "ping";
20
- /**
21
- * Spinner animation frame definition.
22
- */
23
- interface SpinnerFrames {
24
- /** Array of characters to cycle through */
25
- frames: string[];
26
- /** Milliseconds between frame changes */
27
- interval: number;
28
- }
29
- /**
30
- * Predefined spinner animations.
31
- *
32
- * @example
33
- * ```typescript
34
- * const dotsSpinner = SPINNERS.dots;
35
- * console.log(dotsSpinner.frames[0]); // "⠋"
36
- * console.log(dotsSpinner.interval); // 80
37
- * ```
38
- */
39
- declare const SPINNERS: Record<SpinnerStyle, SpinnerFrames>;
40
- /**
41
- * Gets the spinner frame for a given elapsed time.
42
- *
43
- * Calculates which frame to display based on elapsed milliseconds
44
- * and the spinner's interval setting. Automatically wraps around
45
- * when the elapsed time exceeds a full cycle.
46
- *
47
- * @param style - The spinner style to use
48
- * @param elapsed - Elapsed time in milliseconds since spinner started
49
- * @returns The frame character to display
50
- *
51
- * @example
52
- * ```typescript
53
- * // Get frame at start
54
- * getSpinnerFrame("dots", 0); // "⠋"
55
- *
56
- * // Get frame after 160ms
57
- * getSpinnerFrame("dots", 160); // "⠹" (third frame)
58
- *
59
- * // Frames wrap around automatically
60
- * const fullCycle = SPINNERS.dots.interval * SPINNERS.dots.frames.length;
61
- * getSpinnerFrame("dots", fullCycle); // "⠋" (back to first)
62
- * ```
63
- */
64
- declare function getSpinnerFrame(style: SpinnerStyle, elapsed: number): string;
65
- /**
66
- * Renders a static spinner frame with optional message.
67
- *
68
- * This is the non-interactive version for logging and non-TTY contexts.
69
- * For animated spinners, use the elapsed parameter with `getSpinnerFrame()`.
70
- *
71
- * @param style - The spinner style to use
72
- * @param message - Optional message to display after the spinner
73
- * @returns Formatted spinner string
74
- *
75
- * @example
76
- * ```typescript
77
- * // Simple spinner
78
- * console.log(renderSpinner("dots"));
79
- * // "⠋"
80
- *
81
- * // Spinner with message
82
- * console.log(renderSpinner("dots", "Loading..."));
83
- * // "⠋ Loading..."
84
- *
85
- * // For logs (non-TTY)
86
- * logger.info(renderSpinner("line", "Fetching data"));
87
- * // "- Fetching data"
88
- * ```
89
- */
90
- declare function renderSpinner(style: SpinnerStyle, message?: string): string;
91
- export { SpinnerStyle, SpinnerFrames, SPINNERS, getSpinnerFrame, renderSpinner };
@@ -1 +0,0 @@
1
- // @bun