@outfitter/cli 0.2.0 → 0.4.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 (261) hide show
  1. package/README.md +47 -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 +1 -1
  10. package/dist/command.js +1 -2
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +4 -5
  13. package/dist/input.d.ts +3 -26
  14. package/dist/input.js +1 -31
  15. package/dist/output.d.ts +3 -3
  16. package/dist/output.js +4 -3
  17. package/dist/pagination.d.ts +1 -1
  18. package/dist/pagination.js +0 -2
  19. package/dist/shared/@outfitter/{cli-ttt7r0j7.d.ts → cli-02kyvj7h.d.ts} +2 -13
  20. package/dist/shared/@outfitter/{cli-8gg0hck1.js → cli-7wp5nj0s.js} +16 -12
  21. package/dist/shared/@outfitter/{cli-72kg550t.d.ts → cli-f79bwzsp.d.ts} +30 -2
  22. package/dist/shared/@outfitter/{cli-d9ad0rqj.js → cli-jbj78ac5.js} +1 -6
  23. package/dist/shared/@outfitter/{cli-5g6rkv3d.js → cli-rk9zagkm.js} +24 -32
  24. package/dist/shared/@outfitter/{cli-efy6jfcj.js → cli-zahqsaby.js} +33 -10
  25. package/dist/terminal/detection.js +1 -5
  26. package/dist/terminal/index.js +1 -6
  27. package/dist/{shared/@outfitter/cli-4cb5g831.d.ts → text.d.ts} +1 -1
  28. package/dist/{shared/@outfitter/cli-mwxsh3sr.js → text.js} +15 -14
  29. package/dist/types.d.ts +2 -2
  30. package/dist/types.js +0 -2
  31. package/package.json +35 -213
  32. package/dist/borders/index.d.ts +0 -3
  33. package/dist/borders/index.js +0 -13
  34. package/dist/box/index.d.ts +0 -4
  35. package/dist/box/index.js +0 -13
  36. package/dist/demo/index.d.ts +0 -78
  37. package/dist/demo/index.js +0 -148
  38. package/dist/demo/registry.d.ts +0 -7
  39. package/dist/demo/registry.js +0 -28
  40. package/dist/demo/renderers/borders.d.ts +0 -7
  41. package/dist/demo/renderers/borders.js +0 -17
  42. package/dist/demo/renderers/box.d.ts +0 -7
  43. package/dist/demo/renderers/box.js +0 -18
  44. package/dist/demo/renderers/colors.d.ts +0 -7
  45. package/dist/demo/renderers/colors.js +0 -18
  46. package/dist/demo/renderers/indicators.d.ts +0 -7
  47. package/dist/demo/renderers/indicators.js +0 -17
  48. package/dist/demo/renderers/list.d.ts +0 -7
  49. package/dist/demo/renderers/list.js +0 -19
  50. package/dist/demo/renderers/markdown.d.ts +0 -7
  51. package/dist/demo/renderers/markdown.js +0 -18
  52. package/dist/demo/renderers/progress.d.ts +0 -7
  53. package/dist/demo/renderers/progress.js +0 -17
  54. package/dist/demo/renderers/spinner.d.ts +0 -7
  55. package/dist/demo/renderers/spinner.js +0 -19
  56. package/dist/demo/renderers/table.d.ts +0 -7
  57. package/dist/demo/renderers/table.js +0 -19
  58. package/dist/demo/renderers/text.d.ts +0 -7
  59. package/dist/demo/renderers/text.js +0 -16
  60. package/dist/demo/renderers/tree.d.ts +0 -7
  61. package/dist/demo/renderers/tree.js +0 -18
  62. package/dist/demo/section.d.ts +0 -5
  63. package/dist/demo/section.js +0 -23
  64. package/dist/demo/templates.d.ts +0 -4
  65. package/dist/demo/templates.js +0 -10
  66. package/dist/demo/types.d.ts +0 -3
  67. package/dist/demo/types.js +0 -8
  68. package/dist/list/index.d.ts +0 -3
  69. package/dist/list/index.js +0 -9
  70. package/dist/preset/full.d.ts +0 -14
  71. package/dist/preset/full.js +0 -41
  72. package/dist/preset/standard.d.ts +0 -11
  73. package/dist/preset/standard.js +0 -30
  74. package/dist/prompt/confirm.d.ts +0 -4
  75. package/dist/prompt/confirm.js +0 -9
  76. package/dist/prompt/group.d.ts +0 -4
  77. package/dist/prompt/group.js +0 -9
  78. package/dist/prompt/index.d.ts +0 -7
  79. package/dist/prompt/index.js +0 -32
  80. package/dist/prompt/select.d.ts +0 -4
  81. package/dist/prompt/select.js +0 -11
  82. package/dist/prompt/text.d.ts +0 -4
  83. package/dist/prompt/text.js +0 -11
  84. package/dist/prompt/types.d.ts +0 -3
  85. package/dist/prompt/types.js +0 -8
  86. package/dist/prompt/validators.d.ts +0 -2
  87. package/dist/prompt/validators.js +0 -8
  88. package/dist/render/borders.d.ts +0 -2
  89. package/dist/render/borders.js +0 -15
  90. package/dist/render/box.d.ts +0 -3
  91. package/dist/render/box.js +0 -23
  92. package/dist/render/date.d.ts +0 -2
  93. package/dist/render/date.js +0 -12
  94. package/dist/render/format-relative.d.ts +0 -2
  95. package/dist/render/format-relative.js +0 -8
  96. package/dist/render/format.d.ts +0 -2
  97. package/dist/render/format.js +0 -10
  98. package/dist/render/heading.d.ts +0 -3
  99. package/dist/render/heading.js +0 -14
  100. package/dist/render/index.d.ts +0 -32
  101. package/dist/render/index.js +0 -235
  102. package/dist/render/indicators.d.ts +0 -2
  103. package/dist/render/indicators.js +0 -16
  104. package/dist/render/json.d.ts +0 -2
  105. package/dist/render/json.js +0 -10
  106. package/dist/render/layout.d.ts +0 -5
  107. package/dist/render/layout.js +0 -25
  108. package/dist/render/list.d.ts +0 -2
  109. package/dist/render/list.js +0 -8
  110. package/dist/render/markdown.d.ts +0 -2
  111. package/dist/render/markdown.js +0 -10
  112. package/dist/render/progress.d.ts +0 -2
  113. package/dist/render/progress.js +0 -8
  114. package/dist/render/separator.d.ts +0 -3
  115. package/dist/render/separator.js +0 -14
  116. package/dist/render/shapes.d.ts +0 -2
  117. package/dist/render/shapes.js +0 -35
  118. package/dist/render/spinner.d.ts +0 -2
  119. package/dist/render/spinner.js +0 -12
  120. package/dist/render/stack.d.ts +0 -3
  121. package/dist/render/stack.js +0 -38
  122. package/dist/render/table.d.ts +0 -3
  123. package/dist/render/table.js +0 -12
  124. package/dist/render/text.d.ts +0 -2
  125. package/dist/render/text.js +0 -27
  126. package/dist/render/tree.d.ts +0 -2
  127. package/dist/render/tree.js +0 -10
  128. package/dist/render/types.d.ts +0 -2
  129. package/dist/shared/@outfitter/cli-0djg8q91.js +0 -7
  130. package/dist/shared/@outfitter/cli-0w242qtv.d.ts +0 -48
  131. package/dist/shared/@outfitter/cli-1g8tt31a.d.ts +0 -119
  132. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +0 -45
  133. package/dist/shared/@outfitter/cli-1sb3xvnw.js +0 -95
  134. package/dist/shared/@outfitter/cli-1vy0vtga.js +0 -135
  135. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +0 -50
  136. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +0 -42
  137. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +0 -97
  138. package/dist/shared/@outfitter/cli-3hk2xf3c.js +0 -82
  139. package/dist/shared/@outfitter/cli-3hp8qwx3.js +0 -11
  140. package/dist/shared/@outfitter/cli-47yw5h6a.js +0 -7
  141. package/dist/shared/@outfitter/cli-4b6tbp68.d.ts +0 -36
  142. package/dist/shared/@outfitter/cli-4fcz51qa.js +0 -70
  143. package/dist/shared/@outfitter/cli-4x6pqnez.js +0 -20
  144. package/dist/shared/@outfitter/cli-4zk2y4a2.d.ts +0 -61
  145. package/dist/shared/@outfitter/cli-60b5xh1r.js +0 -20
  146. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +0 -51
  147. package/dist/shared/@outfitter/cli-6fxffp8k.js +0 -1
  148. package/dist/shared/@outfitter/cli-6hg0sg2d.d.ts +0 -93
  149. package/dist/shared/@outfitter/cli-6r3m2knf.js +0 -62
  150. package/dist/shared/@outfitter/cli-6ty1nvws.js +0 -179
  151. package/dist/shared/@outfitter/cli-7n610r63.js +0 -20
  152. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +0 -59
  153. package/dist/shared/@outfitter/cli-83jwvj1t.d.ts +0 -17
  154. package/dist/shared/@outfitter/cli-85fg2vr5.js +0 -123
  155. package/dist/shared/@outfitter/cli-8bwaw3pz.js +0 -7
  156. package/dist/shared/@outfitter/cli-8hngbjyr.d.ts +0 -164
  157. package/dist/shared/@outfitter/cli-8j5k6mr3.js +0 -71
  158. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +0 -223
  159. package/dist/shared/@outfitter/cli-914d47mt.js +0 -20
  160. package/dist/shared/@outfitter/cli-9bcm4zhf.d.ts +0 -87
  161. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +0 -190
  162. package/dist/shared/@outfitter/cli-a4q87517.d.ts +0 -64
  163. package/dist/shared/@outfitter/cli-aem6v4c8.js +0 -146
  164. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +0 -132
  165. package/dist/shared/@outfitter/cli-b5c2k0d7.js +0 -39
  166. package/dist/shared/@outfitter/cli-b5epywry.js +0 -1
  167. package/dist/shared/@outfitter/cli-bc17qeh2.js +0 -19
  168. package/dist/shared/@outfitter/cli-bcmcaz1b.js +0 -23
  169. package/dist/shared/@outfitter/cli-bv09nme3.d.ts +0 -56
  170. package/dist/shared/@outfitter/cli-c6pbxpw0.d.ts +0 -112
  171. package/dist/shared/@outfitter/cli-c8fqdaes.js +0 -117
  172. package/dist/shared/@outfitter/cli-c8q4f71g.js +0 -144
  173. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +0 -30
  174. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +0 -53
  175. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +0 -42
  176. package/dist/shared/@outfitter/cli-cwgj6mcs.js +0 -214
  177. package/dist/shared/@outfitter/cli-d8ahdd9d.js +0 -272
  178. package/dist/shared/@outfitter/cli-dbyteh27.d.ts +0 -24
  179. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +0 -91
  180. package/dist/shared/@outfitter/cli-en6zn6sj.js +0 -1
  181. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +0 -300
  182. package/dist/shared/@outfitter/cli-f6fsaayd.js +0 -94
  183. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +0 -106
  184. package/dist/shared/@outfitter/cli-ffa0jwb7.js +0 -122
  185. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +0 -66
  186. package/dist/shared/@outfitter/cli-h3jz0bxz.js +0 -48
  187. package/dist/shared/@outfitter/cli-h4wpzb3f.js +0 -67
  188. package/dist/shared/@outfitter/cli-hda6mc28.js +0 -126
  189. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +0 -328
  190. package/dist/shared/@outfitter/cli-j19a91ck.js +0 -30
  191. package/dist/shared/@outfitter/cli-jejfypgf.js +0 -85
  192. package/dist/shared/@outfitter/cli-jp0k3qd9.js +0 -279
  193. package/dist/shared/@outfitter/cli-k76e7173.js +0 -128
  194. package/dist/shared/@outfitter/cli-kc3ffp1v.d.ts +0 -23
  195. package/dist/shared/@outfitter/cli-kk5hnndk.d.ts +0 -128
  196. package/dist/shared/@outfitter/cli-ktqme80d.js +0 -7
  197. package/dist/shared/@outfitter/cli-mq0jp15z.js +0 -1
  198. package/dist/shared/@outfitter/cli-n0c33vba.js +0 -25
  199. package/dist/shared/@outfitter/cli-n17gt1dz.js +0 -19
  200. package/dist/shared/@outfitter/cli-n9dbh0hp.js +0 -51
  201. package/dist/shared/@outfitter/cli-ndem6tz8.js +0 -63
  202. package/dist/shared/@outfitter/cli-nj4nqy1h.d.ts +0 -24
  203. package/dist/shared/@outfitter/cli-nkns8p4r.js +0 -61
  204. package/dist/shared/@outfitter/cli-p3dqm1vd.js +0 -22
  205. package/dist/shared/@outfitter/cli-pndwprz8.js +0 -118
  206. package/dist/shared/@outfitter/cli-pvrwv6rb.js +0 -352
  207. package/dist/shared/@outfitter/cli-py02m79x.d.ts +0 -20
  208. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +0 -71
  209. package/dist/shared/@outfitter/cli-regjbef6.d.ts +0 -26
  210. package/dist/shared/@outfitter/cli-s1tx5kha.d.ts +0 -59
  211. package/dist/shared/@outfitter/cli-sam2sq50.js +0 -37
  212. package/dist/shared/@outfitter/cli-snxj55n6.js +0 -43
  213. package/dist/shared/@outfitter/cli-symyxb0z.js +0 -20
  214. package/dist/shared/@outfitter/cli-tvw1xrdj.js +0 -20
  215. package/dist/shared/@outfitter/cli-v1tzwxkt.js +0 -32
  216. package/dist/shared/@outfitter/cli-vd60dj65.js +0 -1
  217. package/dist/shared/@outfitter/cli-vfcrskfj.d.ts +0 -41
  218. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +0 -74
  219. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +0 -54
  220. package/dist/shared/@outfitter/cli-x4cavvc0.js +0 -1
  221. package/dist/shared/@outfitter/cli-xep6v2c0.js +0 -52
  222. package/dist/shared/@outfitter/cli-xg5y5fhk.js +0 -86
  223. package/dist/shared/@outfitter/cli-y7k1t81k.js +0 -30
  224. package/dist/shared/@outfitter/cli-yfyzy95c.js +0 -67
  225. package/dist/shared/@outfitter/cli-z78mkrc7.js +0 -59
  226. package/dist/shared/@outfitter/cli-znc47004.js +0 -134
  227. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +0 -26
  228. package/dist/streaming/ansi.d.ts +0 -2
  229. package/dist/streaming/ansi.js +0 -8
  230. package/dist/streaming/index.d.ts +0 -4
  231. package/dist/streaming/index.js +0 -17
  232. package/dist/streaming/spinner.d.ts +0 -3
  233. package/dist/streaming/spinner.js +0 -10
  234. package/dist/streaming/writer.d.ts +0 -2
  235. package/dist/streaming/writer.js +0 -9
  236. package/dist/table/index.d.ts +0 -4
  237. package/dist/table/index.js +0 -13
  238. package/dist/theme/context.d.ts +0 -9
  239. package/dist/theme/context.js +0 -14
  240. package/dist/theme/create.d.ts +0 -8
  241. package/dist/theme/create.js +0 -12
  242. package/dist/theme/index.d.ts +0 -17
  243. package/dist/theme/index.js +0 -42
  244. package/dist/theme/presets/bold.d.ts +0 -8
  245. package/dist/theme/presets/bold.js +0 -12
  246. package/dist/theme/presets/default.d.ts +0 -8
  247. package/dist/theme/presets/default.js +0 -11
  248. package/dist/theme/presets/index.d.ts +0 -12
  249. package/dist/theme/presets/index.js +0 -24
  250. package/dist/theme/presets/minimal.d.ts +0 -8
  251. package/dist/theme/presets/minimal.js +0 -12
  252. package/dist/theme/presets/rounded.d.ts +0 -8
  253. package/dist/theme/presets/rounded.js +0 -12
  254. package/dist/theme/resolve.d.ts +0 -8
  255. package/dist/theme/resolve.js +0 -11
  256. package/dist/theme/types.d.ts +0 -7
  257. package/dist/theme/types.js +0 -1
  258. package/dist/tree/index.d.ts +0 -3
  259. package/dist/tree/index.js +0 -11
  260. /package/dist/shared/@outfitter/{cli-ykxn7rb2.d.ts → cli-xppg982q.d.ts} +0 -0
  261. /package/dist/{render/types.js → shared/@outfitter/cli-zw75pdk8.js} +0 -0
@@ -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
@@ -1,300 +0,0 @@
1
- /**
2
- * A tree node for hierarchical data structures.
3
- *
4
- * @example
5
- * ```typescript
6
- * const tree: TreeNode = {
7
- * name: "src",
8
- * children: [
9
- * { name: "index.ts", children: [] },
10
- * { name: "utils", children: [{ name: "helpers.ts", children: [] }] },
11
- * ],
12
- * };
13
- * ```
14
- */
15
- interface TreeNode {
16
- /** The name/label of this node */
17
- name: string;
18
- /** Child nodes (empty array for leaf nodes) */
19
- children: TreeNode[];
20
- }
21
- /**
22
- * A collection of items, rendered as table (objects) or list (primitives).
23
- *
24
- * @example
25
- * ```typescript
26
- * // Table rendering (array of objects)
27
- * const users: Collection = {
28
- * type: "collection",
29
- * items: [{ name: "Alice", age: 30 }, { name: "Bob", age: 25 }],
30
- * headers: { name: "Name", age: "Age" },
31
- * };
32
- *
33
- * // List rendering (array of primitives)
34
- * const tasks: Collection = {
35
- * type: "collection",
36
- * items: ["Task 1", "Task 2", "Task 3"],
37
- * };
38
- * ```
39
- */
40
- interface Collection {
41
- /** Discriminant for Collection type */
42
- type: "collection";
43
- /** Array of items to render */
44
- items: unknown[];
45
- /** Optional custom headers for table rendering */
46
- headers?: Record<string, string>;
47
- }
48
- /**
49
- * A hierarchical tree structure.
50
- *
51
- * @example
52
- * ```typescript
53
- * const fileTree: Hierarchy = {
54
- * type: "hierarchy",
55
- * root: {
56
- * name: "project",
57
- * children: [
58
- * { name: "src", children: [{ name: "index.ts", children: [] }] },
59
- * { name: "package.json", children: [] },
60
- * ],
61
- * },
62
- * };
63
- * ```
64
- */
65
- interface Hierarchy {
66
- /** Discriminant for Hierarchy type */
67
- type: "hierarchy";
68
- /** Root node of the tree */
69
- root: TreeNode;
70
- }
71
- /**
72
- * Key-value pairs for displaying configuration or metadata.
73
- *
74
- * @example
75
- * ```typescript
76
- * const config: KeyValue = {
77
- * type: "keyvalue",
78
- * entries: {
79
- * name: "my-app",
80
- * version: "1.0.0",
81
- * debug: true,
82
- * },
83
- * };
84
- * ```
85
- */
86
- interface KeyValue {
87
- /** Discriminant for KeyValue type */
88
- type: "keyvalue";
89
- /** Key-value entries to display */
90
- entries: Record<string, unknown>;
91
- }
92
- /**
93
- * A resource with content in a specific format.
94
- *
95
- * @example
96
- * ```typescript
97
- * const jsonResource: Resource = {
98
- * type: "resource",
99
- * data: { name: "test", value: 42 },
100
- * format: "json",
101
- * };
102
- *
103
- * const markdownResource: Resource = {
104
- * type: "resource",
105
- * data: "# Heading\n\nSome **bold** text",
106
- * format: "markdown",
107
- * };
108
- * ```
109
- */
110
- interface Resource {
111
- /** Discriminant for Resource type */
112
- type: "resource";
113
- /** The content to render */
114
- data: unknown;
115
- /** Output format (defaults to "json") */
116
- format?: "json" | "markdown" | "text";
117
- }
118
- /**
119
- * Discriminated union of all output shape types.
120
- *
121
- * Use the type guards {@link isCollection}, {@link isHierarchy},
122
- * {@link isKeyValue}, and {@link isResource} for type narrowing.
123
- *
124
- * @example
125
- * ```typescript
126
- * function processShape(shape: Shape) {
127
- * if (isCollection(shape)) {
128
- * console.log(`Collection with ${shape.items.length} items`);
129
- * } else if (isHierarchy(shape)) {
130
- * console.log(`Tree rooted at ${shape.root.name}`);
131
- * }
132
- * }
133
- * ```
134
- */
135
- type Shape = Collection | Hierarchy | KeyValue | Resource;
136
- /**
137
- * Options for the unified {@link render} function.
138
- *
139
- * @example
140
- * ```typescript
141
- * const options: RenderOptions = {
142
- * width: 80,
143
- * color: true,
144
- * format: "json",
145
- * };
146
- * ```
147
- */
148
- interface RenderOptions {
149
- /** Maximum width for output (used by some renderers) */
150
- width?: number;
151
- /** Whether to use ANSI colors in output */
152
- color?: boolean;
153
- /** Force a specific output format, overriding auto-selection */
154
- format?: "table" | "list" | "tree" | "json" | "text";
155
- }
156
- /**
157
- * Type guard for {@link Collection} shapes.
158
- *
159
- * @param shape - Shape to check
160
- * @returns `true` if the shape is a Collection
161
- *
162
- * @example
163
- * ```typescript
164
- * if (isCollection(shape)) {
165
- * console.log(`Has ${shape.items.length} items`);
166
- * }
167
- * ```
168
- */
169
- declare function isCollection(shape: Shape): shape is Collection;
170
- /**
171
- * Type guard for {@link Hierarchy} shapes.
172
- *
173
- * @param shape - Shape to check
174
- * @returns `true` if the shape is a Hierarchy
175
- *
176
- * @example
177
- * ```typescript
178
- * if (isHierarchy(shape)) {
179
- * console.log(`Root: ${shape.root.name}`);
180
- * }
181
- * ```
182
- */
183
- declare function isHierarchy(shape: Shape): shape is Hierarchy;
184
- /**
185
- * Type guard for {@link KeyValue} shapes.
186
- *
187
- * @param shape - Shape to check
188
- * @returns `true` if the shape is a KeyValue
189
- *
190
- * @example
191
- * ```typescript
192
- * if (isKeyValue(shape)) {
193
- * console.log(`Keys: ${Object.keys(shape.entries).join(", ")}`);
194
- * }
195
- * ```
196
- */
197
- declare function isKeyValue(shape: Shape): shape is KeyValue;
198
- /**
199
- * Type guard for {@link Resource} shapes.
200
- *
201
- * @param shape - Shape to check
202
- * @returns `true` if the shape is a Resource
203
- *
204
- * @example
205
- * ```typescript
206
- * if (isResource(shape)) {
207
- * console.log(`Format: ${shape.format ?? "json"}`);
208
- * }
209
- * ```
210
- */
211
- declare function isResource(shape: Shape): shape is Resource;
212
- /**
213
- * Converts a TreeNode to the Record format expected by renderTree.
214
- */
215
- declare function treeNodeToRecord(node: TreeNode): Record<string, unknown>;
216
- /**
217
- * Checks if an item is a plain object (not null, not array, not primitive).
218
- */
219
- declare function isPlainObject(item: unknown): item is Record<string, unknown>;
220
- /**
221
- * A function that renders a shape to a string.
222
- *
223
- * @typeParam S - The specific shape type this renderer handles
224
- */
225
- type ShapeRenderer<S extends Shape = Shape> = (shape: S, options?: RenderOptions) => string;
226
- /**
227
- * Registers a custom renderer for a shape type.
228
- * Custom renderers take precedence over built-in renderers.
229
- *
230
- * @param shapeType - The shape type to register (e.g., "collection", "hierarchy")
231
- * @param renderer - The renderer function to use for this shape type
232
- *
233
- * @example
234
- * ```typescript
235
- * registerRenderer("collection", (shape, opts) => {
236
- * return shape.items.map(item => `- ${item}`).join("\n");
237
- * });
238
- * ```
239
- */
240
- declare function registerRenderer<S extends Shape>(shapeType: S["type"], renderer: ShapeRenderer<S>): void;
241
- /**
242
- * Removes a custom renderer, reverting to built-in behavior.
243
- *
244
- * @param shapeType - The shape type to unregister
245
- * @returns `true` if a renderer was removed, `false` if none existed
246
- *
247
- * @example
248
- * ```typescript
249
- * unregisterRenderer("collection"); // Reverts to built-in table/list rendering
250
- * ```
251
- */
252
- declare function unregisterRenderer(shapeType: string): boolean;
253
- /**
254
- * Clears all custom renderers, reverting to built-in behavior.
255
- * Useful for testing to ensure clean state between tests.
256
- *
257
- * @example
258
- * ```typescript
259
- * afterEach(() => {
260
- * clearRenderers();
261
- * });
262
- * ```
263
- */
264
- declare function clearRenderers(): void;
265
- /**
266
- * Unified render function that auto-selects the appropriate renderer based on shape type.
267
- *
268
- * Auto-selection logic:
269
- * - **Collection**: Uses {@link renderTable} for object items, {@link renderList} for primitives
270
- * - **Hierarchy**: Uses {@link renderTree}
271
- * - **KeyValue**: Renders as formatted key-value pairs (JSON-like)
272
- * - **Resource**: Uses {@link renderJson}, {@link renderMarkdown}, or {@link renderText} based on format
273
- *
274
- * The `options.format` parameter can override auto-selection.
275
- *
276
- * @param shape - The shape to render
277
- * @param options - Rendering options
278
- * @returns Rendered string output
279
- *
280
- * @example
281
- * ```typescript
282
- * // Collection auto-selects table or list
283
- * render({ type: "collection", items: [{ name: "Alice" }] });
284
- * render({ type: "collection", items: ["item1", "item2"] });
285
- *
286
- * // Hierarchy uses tree rendering
287
- * render({ type: "hierarchy", root: { name: "src", children: [] } });
288
- *
289
- * // KeyValue renders formatted pairs
290
- * render({ type: "keyvalue", entries: { key: "value" } });
291
- *
292
- * // Resource respects format option
293
- * render({ type: "resource", data: obj, format: "json" });
294
- *
295
- * // Override with options.format
296
- * render({ type: "collection", items: [{ a: 1 }] }, { format: "json" });
297
- * ```
298
- */
299
- declare function render(shape: Shape, options?: RenderOptions): string;
300
- export { TreeNode, Collection, Hierarchy, KeyValue, Resource, Shape, RenderOptions, isCollection, isHierarchy, isKeyValue, isResource, treeNodeToRecord, isPlainObject, ShapeRenderer, registerRenderer, unregisterRenderer, clearRenderers, render };