tosijs-ui 1.0.10 → 1.0.13

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 (332) hide show
  1. package/README.md +4 -4
  2. package/bin/docs.ts +233 -0
  3. package/dist/doc-browser.d.ts +27 -0
  4. package/dist/icon-data.d.ts +4 -315
  5. package/dist/icons/data/activity.d.ts +1 -0
  6. package/dist/icons/data/airplay.d.ts +1 -0
  7. package/dist/icons/data/alertCircle.d.ts +1 -0
  8. package/dist/icons/data/alertOctagon.d.ts +1 -0
  9. package/dist/icons/data/alertTriangle.d.ts +1 -0
  10. package/dist/icons/data/alignCenter.d.ts +1 -0
  11. package/dist/icons/data/alignJustify.d.ts +1 -0
  12. package/dist/icons/data/alignLeft.d.ts +1 -0
  13. package/dist/icons/data/alignRight.d.ts +1 -0
  14. package/dist/icons/data/anchor.d.ts +1 -0
  15. package/dist/icons/data/aperture.d.ts +1 -0
  16. package/dist/icons/data/archive.d.ts +1 -0
  17. package/dist/icons/data/arrowDown.d.ts +1 -0
  18. package/dist/icons/data/arrowDownCircle.d.ts +1 -0
  19. package/dist/icons/data/arrowDownLeft.d.ts +1 -0
  20. package/dist/icons/data/arrowDownRight.d.ts +1 -0
  21. package/dist/icons/data/arrowLeft.d.ts +1 -0
  22. package/dist/icons/data/arrowLeftCircle.d.ts +1 -0
  23. package/dist/icons/data/arrowRight.d.ts +1 -0
  24. package/dist/icons/data/arrowRightCircle.d.ts +1 -0
  25. package/dist/icons/data/arrowUp.d.ts +1 -0
  26. package/dist/icons/data/arrowUpCircle.d.ts +1 -0
  27. package/dist/icons/data/arrowUpLeft.d.ts +1 -0
  28. package/dist/icons/data/arrowUpRight.d.ts +1 -0
  29. package/dist/icons/data/atSign.d.ts +1 -0
  30. package/dist/icons/data/award.d.ts +1 -0
  31. package/dist/icons/data/barChart.d.ts +1 -0
  32. package/dist/icons/data/barChart2.d.ts +1 -0
  33. package/dist/icons/data/battery.d.ts +1 -0
  34. package/dist/icons/data/batteryCharging.d.ts +1 -0
  35. package/dist/icons/data/bell.d.ts +1 -0
  36. package/dist/icons/data/bellOff.d.ts +1 -0
  37. package/dist/icons/data/blog.d.ts +1 -0
  38. package/dist/icons/data/blueprint.d.ts +1 -0
  39. package/dist/icons/data/bluetooth.d.ts +1 -0
  40. package/dist/icons/data/bold.d.ts +1 -0
  41. package/dist/icons/data/book.d.ts +1 -0
  42. package/dist/icons/data/bookOpen.d.ts +1 -0
  43. package/dist/icons/data/bookmark.d.ts +1 -0
  44. package/dist/icons/data/box.d.ts +1 -0
  45. package/dist/icons/data/briefcase.d.ts +1 -0
  46. package/dist/icons/data/bug.d.ts +1 -0
  47. package/dist/icons/data/calendar.d.ts +1 -0
  48. package/dist/icons/data/camera.d.ts +1 -0
  49. package/dist/icons/data/cameraOff.d.ts +1 -0
  50. package/dist/icons/data/cast.d.ts +1 -0
  51. package/dist/icons/data/check.d.ts +1 -0
  52. package/dist/icons/data/checkCircle.d.ts +1 -0
  53. package/dist/icons/data/checkSquare.d.ts +1 -0
  54. package/dist/icons/data/chevronDown.d.ts +1 -0
  55. package/dist/icons/data/chevronLeft.d.ts +1 -0
  56. package/dist/icons/data/chevronRight.d.ts +1 -0
  57. package/dist/icons/data/chevronUp.d.ts +1 -0
  58. package/dist/icons/data/chevronsDown.d.ts +1 -0
  59. package/dist/icons/data/chevronsLeft.d.ts +1 -0
  60. package/dist/icons/data/chevronsRight.d.ts +1 -0
  61. package/dist/icons/data/chevronsUp.d.ts +1 -0
  62. package/dist/icons/data/chrome.d.ts +1 -0
  63. package/dist/icons/data/circle.d.ts +1 -0
  64. package/dist/icons/data/clipboard.d.ts +1 -0
  65. package/dist/icons/data/clock.d.ts +1 -0
  66. package/dist/icons/data/cloud.d.ts +1 -0
  67. package/dist/icons/data/cloudDrizzle.d.ts +1 -0
  68. package/dist/icons/data/cloudLightning.d.ts +1 -0
  69. package/dist/icons/data/cloudOff.d.ts +1 -0
  70. package/dist/icons/data/cloudRain.d.ts +1 -0
  71. package/dist/icons/data/cloudSnow.d.ts +1 -0
  72. package/dist/icons/data/cmy.d.ts +1 -0
  73. package/dist/icons/data/code.d.ts +1 -0
  74. package/dist/icons/data/codepen.d.ts +1 -0
  75. package/dist/icons/data/codesandbox.d.ts +1 -0
  76. package/dist/icons/data/coffee.d.ts +1 -0
  77. package/dist/icons/data/columns.d.ts +1 -0
  78. package/dist/icons/data/command.d.ts +1 -0
  79. package/dist/icons/data/compass.d.ts +1 -0
  80. package/dist/icons/data/copy.d.ts +1 -0
  81. package/dist/icons/data/cornerDownLeft.d.ts +1 -0
  82. package/dist/icons/data/cornerDownRight.d.ts +1 -0
  83. package/dist/icons/data/cornerLeftDown.d.ts +1 -0
  84. package/dist/icons/data/cornerLeftUp.d.ts +1 -0
  85. package/dist/icons/data/cornerRightDown.d.ts +1 -0
  86. package/dist/icons/data/cornerRightUp.d.ts +1 -0
  87. package/dist/icons/data/cornerUpLeft.d.ts +1 -0
  88. package/dist/icons/data/cornerUpRight.d.ts +1 -0
  89. package/dist/icons/data/cpu.d.ts +1 -0
  90. package/dist/icons/data/creditCard.d.ts +1 -0
  91. package/dist/icons/data/crop.d.ts +1 -0
  92. package/dist/icons/data/crosshair.d.ts +1 -0
  93. package/dist/icons/data/database.d.ts +1 -0
  94. package/dist/icons/data/delete.d.ts +1 -0
  95. package/dist/icons/data/disc.d.ts +1 -0
  96. package/dist/icons/data/discord.d.ts +1 -0
  97. package/dist/icons/data/divide.d.ts +1 -0
  98. package/dist/icons/data/divideCircle.d.ts +1 -0
  99. package/dist/icons/data/divideSquare.d.ts +1 -0
  100. package/dist/icons/data/dollarSign.d.ts +1 -0
  101. package/dist/icons/data/download.d.ts +1 -0
  102. package/dist/icons/data/downloadCloud.d.ts +1 -0
  103. package/dist/icons/data/dribbble.d.ts +1 -0
  104. package/dist/icons/data/droplet.d.ts +1 -0
  105. package/dist/icons/data/earth.d.ts +1 -0
  106. package/dist/icons/data/edit.d.ts +1 -0
  107. package/dist/icons/data/edit2.d.ts +1 -0
  108. package/dist/icons/data/edit3.d.ts +1 -0
  109. package/dist/icons/data/externalLink.d.ts +1 -0
  110. package/dist/icons/data/eye.d.ts +1 -0
  111. package/dist/icons/data/eyeOff.d.ts +1 -0
  112. package/dist/icons/data/facebook.d.ts +1 -0
  113. package/dist/icons/data/fastForward.d.ts +1 -0
  114. package/dist/icons/data/feather.d.ts +1 -0
  115. package/dist/icons/data/figma.d.ts +1 -0
  116. package/dist/icons/data/file.d.ts +1 -0
  117. package/dist/icons/data/fileMinus.d.ts +1 -0
  118. package/dist/icons/data/filePlus.d.ts +1 -0
  119. package/dist/icons/data/fileText.d.ts +1 -0
  120. package/dist/icons/data/film.d.ts +1 -0
  121. package/dist/icons/data/filter.d.ts +1 -0
  122. package/dist/icons/data/flag.d.ts +1 -0
  123. package/dist/icons/data/folder.d.ts +1 -0
  124. package/dist/icons/data/folderMinus.d.ts +1 -0
  125. package/dist/icons/data/folderPlus.d.ts +1 -0
  126. package/dist/icons/data/fontBold.d.ts +1 -0
  127. package/dist/icons/data/fontItalic.d.ts +1 -0
  128. package/dist/icons/data/fontUnderline.d.ts +1 -0
  129. package/dist/icons/data/framer.d.ts +1 -0
  130. package/dist/icons/data/frown.d.ts +1 -0
  131. package/dist/icons/data/game.d.ts +1 -0
  132. package/dist/icons/data/gift.d.ts +1 -0
  133. package/dist/icons/data/gitBranch.d.ts +1 -0
  134. package/dist/icons/data/gitCommit.d.ts +1 -0
  135. package/dist/icons/data/gitMerge.d.ts +1 -0
  136. package/dist/icons/data/gitPullRequest.d.ts +1 -0
  137. package/dist/icons/data/github.d.ts +1 -0
  138. package/dist/icons/data/gitlab.d.ts +1 -0
  139. package/dist/icons/data/globe.d.ts +1 -0
  140. package/dist/icons/data/google.d.ts +1 -0
  141. package/dist/icons/data/grid.d.ts +1 -0
  142. package/dist/icons/data/hardDrive.d.ts +1 -0
  143. package/dist/icons/data/hash.d.ts +1 -0
  144. package/dist/icons/data/headphones.d.ts +1 -0
  145. package/dist/icons/data/heart.d.ts +1 -0
  146. package/dist/icons/data/helpCircle.d.ts +1 -0
  147. package/dist/icons/data/hexagon.d.ts +1 -0
  148. package/dist/icons/data/home.d.ts +1 -0
  149. package/dist/icons/data/image.d.ts +1 -0
  150. package/dist/icons/data/inbox.d.ts +1 -0
  151. package/dist/icons/data/indent.d.ts +1 -0
  152. package/dist/icons/data/index.d.ts +313 -0
  153. package/dist/icons/data/info.d.ts +1 -0
  154. package/dist/icons/data/instagram.d.ts +1 -0
  155. package/dist/icons/data/italic.d.ts +1 -0
  156. package/dist/icons/data/key.d.ts +1 -0
  157. package/dist/icons/data/layers.d.ts +1 -0
  158. package/dist/icons/data/layout.d.ts +1 -0
  159. package/dist/icons/data/lifeBuoy.d.ts +1 -0
  160. package/dist/icons/data/link.d.ts +1 -0
  161. package/dist/icons/data/link2.d.ts +1 -0
  162. package/dist/icons/data/linkedin.d.ts +1 -0
  163. package/dist/icons/data/list.d.ts +1 -0
  164. package/dist/icons/data/listBullet.d.ts +1 -0
  165. package/dist/icons/data/listNumber.d.ts +1 -0
  166. package/dist/icons/data/loader.d.ts +1 -0
  167. package/dist/icons/data/lock.d.ts +1 -0
  168. package/dist/icons/data/logIn.d.ts +1 -0
  169. package/dist/icons/data/logOut.d.ts +1 -0
  170. package/dist/icons/data/mail.d.ts +1 -0
  171. package/dist/icons/data/map.d.ts +1 -0
  172. package/dist/icons/data/mapPin.d.ts +1 -0
  173. package/dist/icons/data/maximize.d.ts +1 -0
  174. package/dist/icons/data/maximize2.d.ts +1 -0
  175. package/dist/icons/data/meh.d.ts +1 -0
  176. package/dist/icons/data/menu.d.ts +1 -0
  177. package/dist/icons/data/messageCircle.d.ts +1 -0
  178. package/dist/icons/data/messageSquare.d.ts +1 -0
  179. package/dist/icons/data/mic.d.ts +1 -0
  180. package/dist/icons/data/micOff.d.ts +1 -0
  181. package/dist/icons/data/minimize.d.ts +1 -0
  182. package/dist/icons/data/minimize2.d.ts +1 -0
  183. package/dist/icons/data/minus.d.ts +1 -0
  184. package/dist/icons/data/minusCircle.d.ts +1 -0
  185. package/dist/icons/data/minusSquare.d.ts +1 -0
  186. package/dist/icons/data/monitor.d.ts +1 -0
  187. package/dist/icons/data/moon.d.ts +1 -0
  188. package/dist/icons/data/moreHorizontal.d.ts +1 -0
  189. package/dist/icons/data/moreVertical.d.ts +1 -0
  190. package/dist/icons/data/mousePointer.d.ts +1 -0
  191. package/dist/icons/data/move.d.ts +1 -0
  192. package/dist/icons/data/music.d.ts +1 -0
  193. package/dist/icons/data/navigation.d.ts +1 -0
  194. package/dist/icons/data/navigation2.d.ts +1 -0
  195. package/dist/icons/data/npm.d.ts +1 -0
  196. package/dist/icons/data/octagon.d.ts +1 -0
  197. package/dist/icons/data/outdent.d.ts +1 -0
  198. package/dist/icons/data/package.d.ts +1 -0
  199. package/dist/icons/data/paperclip.d.ts +1 -0
  200. package/dist/icons/data/pause.d.ts +1 -0
  201. package/dist/icons/data/pauseCircle.d.ts +1 -0
  202. package/dist/icons/data/penTool.d.ts +1 -0
  203. package/dist/icons/data/percent.d.ts +1 -0
  204. package/dist/icons/data/phone.d.ts +1 -0
  205. package/dist/icons/data/phoneCall.d.ts +1 -0
  206. package/dist/icons/data/phoneForwarded.d.ts +1 -0
  207. package/dist/icons/data/phoneIncoming.d.ts +1 -0
  208. package/dist/icons/data/phoneMissed.d.ts +1 -0
  209. package/dist/icons/data/phoneOff.d.ts +1 -0
  210. package/dist/icons/data/phoneOutgoing.d.ts +1 -0
  211. package/dist/icons/data/pieChart.d.ts +1 -0
  212. package/dist/icons/data/play.d.ts +1 -0
  213. package/dist/icons/data/playCircle.d.ts +1 -0
  214. package/dist/icons/data/plus.d.ts +1 -0
  215. package/dist/icons/data/plusCircle.d.ts +1 -0
  216. package/dist/icons/data/plusSquare.d.ts +1 -0
  217. package/dist/icons/data/pocket.d.ts +1 -0
  218. package/dist/icons/data/power.d.ts +1 -0
  219. package/dist/icons/data/printer.d.ts +1 -0
  220. package/dist/icons/data/radio.d.ts +1 -0
  221. package/dist/icons/data/refreshCcw.d.ts +1 -0
  222. package/dist/icons/data/refreshCw.d.ts +1 -0
  223. package/dist/icons/data/repeat.d.ts +1 -0
  224. package/dist/icons/data/resize.d.ts +1 -0
  225. package/dist/icons/data/rewind.d.ts +1 -0
  226. package/dist/icons/data/rgb.d.ts +1 -0
  227. package/dist/icons/data/rotateCcw.d.ts +1 -0
  228. package/dist/icons/data/rotateCw.d.ts +1 -0
  229. package/dist/icons/data/rss.d.ts +1 -0
  230. package/dist/icons/data/save.d.ts +1 -0
  231. package/dist/icons/data/scissors.d.ts +1 -0
  232. package/dist/icons/data/search.d.ts +1 -0
  233. package/dist/icons/data/send.d.ts +1 -0
  234. package/dist/icons/data/server.d.ts +1 -0
  235. package/dist/icons/data/settings.d.ts +1 -0
  236. package/dist/icons/data/share.d.ts +1 -0
  237. package/dist/icons/data/share2.d.ts +1 -0
  238. package/dist/icons/data/shield.d.ts +1 -0
  239. package/dist/icons/data/shieldOff.d.ts +1 -0
  240. package/dist/icons/data/shoppingBag.d.ts +1 -0
  241. package/dist/icons/data/shoppingCart.d.ts +1 -0
  242. package/dist/icons/data/shuffle.d.ts +1 -0
  243. package/dist/icons/data/sidebar.d.ts +1 -0
  244. package/dist/icons/data/skipBack.d.ts +1 -0
  245. package/dist/icons/data/skipForward.d.ts +1 -0
  246. package/dist/icons/data/slack.d.ts +1 -0
  247. package/dist/icons/data/slash.d.ts +1 -0
  248. package/dist/icons/data/sliders.d.ts +1 -0
  249. package/dist/icons/data/smartphone.d.ts +1 -0
  250. package/dist/icons/data/smile.d.ts +1 -0
  251. package/dist/icons/data/sortAscending.d.ts +1 -0
  252. package/dist/icons/data/sortDescending.d.ts +1 -0
  253. package/dist/icons/data/speaker.d.ts +1 -0
  254. package/dist/icons/data/square.d.ts +1 -0
  255. package/dist/icons/data/star.d.ts +1 -0
  256. package/dist/icons/data/stopCircle.d.ts +1 -0
  257. package/dist/icons/data/sun.d.ts +1 -0
  258. package/dist/icons/data/sunrise.d.ts +1 -0
  259. package/dist/icons/data/sunset.d.ts +1 -0
  260. package/dist/icons/data/table.d.ts +1 -0
  261. package/dist/icons/data/tablet.d.ts +1 -0
  262. package/dist/icons/data/tag.d.ts +1 -0
  263. package/dist/icons/data/target.d.ts +1 -0
  264. package/dist/icons/data/terminal.d.ts +1 -0
  265. package/dist/icons/data/thermometer.d.ts +1 -0
  266. package/dist/icons/data/thumbsDown.d.ts +1 -0
  267. package/dist/icons/data/thumbsUp.d.ts +1 -0
  268. package/dist/icons/data/toggleLeft.d.ts +1 -0
  269. package/dist/icons/data/toggleRight.d.ts +1 -0
  270. package/dist/icons/data/tool.d.ts +1 -0
  271. package/dist/icons/data/tosi.d.ts +1 -0
  272. package/dist/icons/data/tosiFavicon.d.ts +1 -0
  273. package/dist/icons/data/tosiPlatform.d.ts +1 -0
  274. package/dist/icons/data/tosiUi.d.ts +1 -0
  275. package/dist/icons/data/tosiXr.d.ts +1 -0
  276. package/dist/icons/data/trash.d.ts +1 -0
  277. package/dist/icons/data/trash2.d.ts +1 -0
  278. package/dist/icons/data/trello.d.ts +1 -0
  279. package/dist/icons/data/trendingDown.d.ts +1 -0
  280. package/dist/icons/data/trendingUp.d.ts +1 -0
  281. package/dist/icons/data/triangle.d.ts +1 -0
  282. package/dist/icons/data/truck.d.ts +1 -0
  283. package/dist/icons/data/tv.d.ts +1 -0
  284. package/dist/icons/data/twitch.d.ts +1 -0
  285. package/dist/icons/data/twitter.d.ts +1 -0
  286. package/dist/icons/data/type.d.ts +1 -0
  287. package/dist/icons/data/umbrella.d.ts +1 -0
  288. package/dist/icons/data/underline.d.ts +1 -0
  289. package/dist/icons/data/unlock.d.ts +1 -0
  290. package/dist/icons/data/upload.d.ts +1 -0
  291. package/dist/icons/data/uploadCloud.d.ts +1 -0
  292. package/dist/icons/data/user.d.ts +1 -0
  293. package/dist/icons/data/userCheck.d.ts +1 -0
  294. package/dist/icons/data/userMinus.d.ts +1 -0
  295. package/dist/icons/data/userPlus.d.ts +1 -0
  296. package/dist/icons/data/userX.d.ts +1 -0
  297. package/dist/icons/data/users.d.ts +1 -0
  298. package/dist/icons/data/video.d.ts +1 -0
  299. package/dist/icons/data/videoOff.d.ts +1 -0
  300. package/dist/icons/data/voicemail.d.ts +1 -0
  301. package/dist/icons/data/volume.d.ts +1 -0
  302. package/dist/icons/data/volume1.d.ts +1 -0
  303. package/dist/icons/data/volume2.d.ts +1 -0
  304. package/dist/icons/data/volumeX.d.ts +1 -0
  305. package/dist/icons/data/watch.d.ts +1 -0
  306. package/dist/icons/data/wifi.d.ts +1 -0
  307. package/dist/icons/data/wifiOff.d.ts +1 -0
  308. package/dist/icons/data/wind.d.ts +1 -0
  309. package/dist/icons/data/x.d.ts +1 -0
  310. package/dist/icons/data/xCircle.d.ts +1 -0
  311. package/dist/icons/data/xOctagon.d.ts +1 -0
  312. package/dist/icons/data/xSquare.d.ts +1 -0
  313. package/dist/icons/data/xrColor.d.ts +1 -0
  314. package/dist/icons/data/youtube.d.ts +1 -0
  315. package/dist/icons/data/zap.d.ts +1 -0
  316. package/dist/icons/data/zapOff.d.ts +1 -0
  317. package/dist/icons/data/zoomIn.d.ts +1 -0
  318. package/dist/icons/data/zoomOut.d.ts +1 -0
  319. package/dist/iife.js +52 -40
  320. package/dist/iife.js.map +27 -25
  321. package/dist/index.d.ts +2 -0
  322. package/dist/index.js +21 -9
  323. package/dist/index.js.map +26 -24
  324. package/dist/live-example.d.ts +4 -0
  325. package/dist/menu.d.ts +3 -0
  326. package/dist/month.d.ts +1 -1
  327. package/dist/select.d.ts +2 -0
  328. package/dist/tab-selector.d.ts +6 -0
  329. package/dist/theme.d.ts +52 -0
  330. package/dist/tsconfig.tsbuildinfo +1 -0
  331. package/dist/version.d.ts +1 -1
  332. package/package.json +5 -3
package/README.md CHANGED
@@ -32,10 +32,10 @@ It works beautifully with other web-component libraries, such as [shoelace.style
32
32
 
33
33
  ### Using npm and a bundler
34
34
 
35
- Add xinjs-ui to your project, e.g.
35
+ Add tosijs-ui to your project, e.g.
36
36
 
37
37
  ```bash
38
- npm add xinjs-ui
38
+ npm add tosijs-ui
39
39
  ```
40
40
 
41
41
  Then you can import the component `elementCreator` and create the element any way you
@@ -43,7 +43,7 @@ like, the easiest way being to use the `elementCreator` itself. A `tosijs` `elem
43
43
  is syntax sugar around `document.createElement()`.
44
44
 
45
45
  ```ts
46
- import { dataTable } from 'xinjs-ui'
46
+ import { dataTable } from 'tosijs-ui'
47
47
 
48
48
  document.body.append(dataTable())
49
49
  ```
@@ -111,7 +111,7 @@ use HTML or the `ElementCreator` function exported.
111
111
  E.g. to use the markdown viewer:
112
112
 
113
113
  ```
114
- import { markdownViewer } from 'xinjs-ui'
114
+ import { markdownViewer } from 'tosijs-ui'
115
115
  document.body.append(markdownViewer('# hello world\nthis is a test'))
116
116
  ```
117
117
 
package/bin/docs.ts ADDED
@@ -0,0 +1,233 @@
1
+ /*#
2
+ # docs
3
+
4
+ Utility for extracting documentation from markdown files and inline comments in source code.
5
+
6
+ > `docs.ts` is intended to be run directly using `bun`. You can transpile it to javascript if you
7
+ want to run it using node.
8
+
9
+ This is used by the `doc-browser` component to build searchable, navigable documentation
10
+ from your project's source files.
11
+
12
+ ## Usage
13
+
14
+ import { extractDocs } from 'docs'
15
+
16
+ extractDocs({
17
+ paths: ['src', 'README.md'],
18
+ ignore: ['node_modules', 'dist', 'build']
19
+ path: 'public/docs.json'
20
+ })
21
+
22
+ ## API
23
+
24
+ ### `extractDocs(options)`
25
+
26
+ Scans directories for markdown files and source code comments.
27
+
28
+ **Options:**
29
+ - `paths`: Array of directory paths or file paths to scan
30
+ - `ignore`: Array of directory names to ignore (default: ['node_modules', 'dist'])
31
+ - `output`: if provided, path to write json result.
32
+
33
+ **Returns:** Array of `Doc` objects
34
+
35
+ ### `Doc` object structure
36
+
37
+ {
38
+ text: string, // Markdown content
39
+ title: string, // First heading or filename
40
+ filename: string, // Just the filename
41
+ path: string, // Full file path
42
+ pin?: 'top' | 'bottom' // Optional pinning for sort order
43
+ }
44
+
45
+ ## Documentation Format
46
+
47
+ ### Markdown files
48
+
49
+ Any `.md` file will be included in its entirety.
50
+
51
+ ### Source code comments
52
+
53
+ Multi-line comments that start with `/*#` will be extracted as markdown:
54
+
55
+ /*#
56
+ # My Component
57
+
58
+ This is documentation for my component.
59
+
60
+ ```html
61
+ <my-component></my-component>
62
+ ```
63
+ ```js
64
+ console.log('hello world')
65
+ ```
66
+ ```css
67
+ my-componet {
68
+ color: blue
69
+ }
70
+ ```
71
+ *‎/
72
+
73
+ export class MyComponent extends Component {
74
+ // implementation
75
+ }
76
+ ...
77
+
78
+ The [doc-browser](/?doc-browser.ts) will render the output as a test-bed project with documentation and live examples.
79
+
80
+ ### Metadata
81
+
82
+ You can include JSON metadata in comments to control sorting:
83
+
84
+ html:
85
+ <!--{ "pin": "bottom" }-->
86
+
87
+ ts, js, css:
88
+ /*{ "pin": "bottom" }*‎/
89
+
90
+ This will pin the document to the top or bottom of the navigation list.
91
+ */
92
+ /*{ "pin": "bottom" }*/
93
+
94
+ // TODO CLI options
95
+
96
+ import * as fs from 'fs'
97
+ import * as path from 'path'
98
+
99
+ export interface Doc {
100
+ text: string
101
+ title: string
102
+ filename: string
103
+ path: string
104
+ pin?: 'top' | 'bottom'
105
+ hidden?: boolean
106
+ }
107
+
108
+ export interface ExtractDocsOptions {
109
+ paths: string[]
110
+ ignore?: string[]
111
+ output?: string
112
+ }
113
+
114
+ const TRIM_REGEX = /^#+ |`/g
115
+
116
+ function metadata(content: string, filePath: string): Partial<Doc> {
117
+ const source = content.match(/<\!\-\-(\{.*\})\-\->|\/\*(\{.*\})\*\//)
118
+ let data: Partial<Doc> = {}
119
+ if (source) {
120
+ try {
121
+ data = JSON.parse(source[1] || source[2])
122
+ } catch (e) {
123
+ console.error('bad metadata in doc', filePath)
124
+ }
125
+ }
126
+ return data
127
+ }
128
+
129
+ function pinnedSort(a: Doc, b: Doc): number {
130
+ const aKey =
131
+ (a.pin === 'top' ? 'A' : a.pin === 'bottom' ? 'Z' : 'M') +
132
+ a.title.toLocaleLowerCase()
133
+ const bKey =
134
+ (b.pin === 'top' ? 'A' : b.pin === 'bottom' ? 'Z' : 'M') +
135
+ b.title.toLocaleLowerCase()
136
+ return aKey > bKey ? 1 : bKey > aKey ? -1 : 0
137
+ }
138
+
139
+ function findMarkdownFiles(paths: string[], ignore: string[]): Doc[] {
140
+ const markdownFiles: Doc[] = []
141
+
142
+ function traverseDirectory(dir: string, ignore: string[]) {
143
+ console.log(dir)
144
+ const files = fs.readdirSync(dir)
145
+ const baseName = path.basename(dir)
146
+
147
+ if (ignore.includes(baseName)) {
148
+ return
149
+ }
150
+
151
+ files.forEach((file) => {
152
+ const filePath = path.join(dir, file)
153
+ let stats
154
+
155
+ try {
156
+ stats = fs.statSync(filePath)
157
+ } catch (err) {
158
+ return
159
+ }
160
+
161
+ if (stats.isDirectory()) {
162
+ traverseDirectory(filePath, ignore)
163
+ } else if (path.extname(file) === '.md') {
164
+ const content = fs.readFileSync(filePath, 'utf8')
165
+ markdownFiles.push({
166
+ text: content,
167
+ title: content.split('\n')[0].replace(TRIM_REGEX, ''),
168
+ filename: file,
169
+ path: filePath,
170
+ ...metadata(content, filePath),
171
+ })
172
+ } else if (['.ts', '.js', '.css'].includes(path.extname(file))) {
173
+ const content = fs.readFileSync(filePath, 'utf8')
174
+ const docs = content.match(/\/\*#[\s\S]+?\*\//g) || []
175
+ if (docs.length) {
176
+ const markdown = docs.map((s) => s.substring(3, s.length - 2).trim())
177
+ const text = markdown.join('\n\n')
178
+ markdownFiles.push({
179
+ text,
180
+ title: text.split('\n')[0].replace(TRIM_REGEX, ''),
181
+ filename: file,
182
+ path: filePath,
183
+ ...metadata(content, filePath),
184
+ })
185
+ }
186
+ }
187
+ })
188
+ }
189
+
190
+ paths.forEach((dir) => {
191
+ try {
192
+ const stats = fs.statSync(dir)
193
+ if (stats.isDirectory()) {
194
+ traverseDirectory(dir, ignore)
195
+ } else if (stats.isFile()) {
196
+ const file = path.basename(dir)
197
+ if (path.extname(file) === '.md') {
198
+ const content = fs.readFileSync(dir, 'utf8')
199
+ markdownFiles.push({
200
+ text: content,
201
+ title: content.split('\n')[0].replace(TRIM_REGEX, ''),
202
+ filename: file,
203
+ path: dir,
204
+ ...metadata(content, dir),
205
+ })
206
+ }
207
+ }
208
+ } catch (err) {
209
+ console.error(`Could not read ${dir}:`, err)
210
+ }
211
+ })
212
+
213
+ return markdownFiles.sort(pinnedSort)
214
+ }
215
+
216
+ export function extractDocs(options: ExtractDocsOptions): Doc[] {
217
+ const {
218
+ paths,
219
+ ignore = ['node_modules', 'dist', 'build', 'docs'],
220
+ output,
221
+ } = options
222
+ const docs = findMarkdownFiles(paths, ignore)
223
+ if (output) {
224
+ saveDocsJSON(docs, output)
225
+ }
226
+ return docs
227
+ }
228
+
229
+ export function saveDocsJSON(docs: Doc[], outputPath: string): void {
230
+ const jsonData = JSON.stringify(docs, null, 2)
231
+ fs.writeFileSync(outputPath, jsonData, 'utf8')
232
+ console.log(`Documentation saved to ${outputPath}`)
233
+ }
@@ -0,0 +1,27 @@
1
+ export interface Doc {
2
+ text: string;
3
+ title: string;
4
+ filename: string;
5
+ path: string;
6
+ pin?: string;
7
+ hidden?: boolean;
8
+ }
9
+ export interface ProjectLinks {
10
+ github?: string;
11
+ npm?: string;
12
+ discord?: string;
13
+ blog?: string;
14
+ tosijs?: string;
15
+ bundle?: string;
16
+ cdn?: string;
17
+ [key: string]: string | undefined;
18
+ }
19
+ export interface DocBrowserOptions {
20
+ docs: Doc[];
21
+ context?: Record<string, any>;
22
+ projectName?: string;
23
+ projectLinks?: ProjectLinks;
24
+ navSize?: number;
25
+ minSize?: number;
26
+ }
27
+ export declare function createDocBrowser(options: DocBrowserOptions): HTMLElement;
@@ -1,316 +1,5 @@
1
- declare const _default: {
2
- earth: string;
3
- blueprint: string;
4
- tosiXr: string;
5
- cmy: string;
6
- rgb: string;
7
- xrColor: string;
8
- tosiUi: string;
9
- tosiFavicon: string;
10
- tosiPlatform: string;
11
- tosi: string;
12
- sortDescending: string;
13
- columns: string;
14
- underline: string;
15
- grid: string;
16
- triangle: string;
17
- search: string;
18
- volume2: string;
19
- arrowUpCircle: string;
20
- pauseCircle: string;
21
- checkSquare: string;
22
- arrowDown: string;
23
- figma: string;
24
- cornerRightUp: string;
25
- chevronsRight: string;
26
- list: string;
27
- chevronsDown: string;
28
- wind: string;
29
- cornerUpRight: string;
30
- target: string;
31
- scissors: string;
32
- minimize2: string;
33
- playCircle: string;
34
- crosshair: string;
35
- airplay: string;
36
- xOctagon: string;
37
- repeat: string;
38
- edit3: string;
39
- volume1: string;
40
- sunrise: string;
41
- toggleRight: string;
42
- umbrella: string;
43
- user: string;
44
- fileMinus: string;
45
- xCircle: string;
46
- circle: string;
47
- phoneMissed: string;
48
- edit2: string;
49
- cornerLeftUp: string;
50
- home: string;
51
- gitlab: string;
52
- music: string;
53
- smartphone: string;
54
- moreHorizontal: string;
55
- sliders: string;
56
- arrowUpLeft: string;
57
- chevronDown: string;
58
- hexagon: string;
59
- github: string;
60
- crop: string;
61
- tag: string;
62
- briefcase: string;
63
- rotateCw: string;
64
- map: string;
65
- inbox: string;
66
- alignJustify: string;
67
- plusSquare: string;
68
- power: string;
69
- database: string;
70
- cameraOff: string;
71
- toggleLeft: string;
72
- file: string;
73
- messageCircle: string;
74
- voicemail: string;
75
- terminal: string;
76
- move: string;
77
- maximize: string;
78
- chevronUp: string;
79
- arrowDownLeft: string;
80
- fileText: string;
81
- droplet: string;
82
- zapOff: string;
83
- x: string;
84
- barChart: string;
85
- lock: string;
86
- logIn: string;
87
- shoppingBag: string;
88
- divide: string;
89
- cloudDrizzle: string;
90
- refreshCw: string;
91
- chevronRight: string;
92
- clipboard: string;
93
- package: string;
94
- instagram: string;
95
- link: string;
96
- videoOff: string;
97
- key: string;
98
- meh: string;
99
- cornerDownRight: string;
100
- arrowRight: string;
101
- aperture: string;
102
- stopCircle: string;
103
- logOut: string;
104
- arrowLeftCircle: string;
105
- barChart2: string;
106
- gitPullRequest: string;
107
- minimize: string;
108
- minusSquare: string;
109
- settings: string;
110
- cloudSnow: string;
111
- thumbsDown: string;
112
- type: string;
113
- archive: string;
114
- phoneOutgoing: string;
115
- pocket: string;
116
- mail: string;
117
- shield: string;
118
- download: string;
119
- phoneForwarded: string;
120
- cornerRightDown: string;
121
- bookOpen: string;
122
- divideSquare: string;
123
- server: string;
124
- tv: string;
125
- skipForward: string;
126
- volume: string;
127
- userPlus: string;
128
- batteryCharging: string;
129
- layers: string;
130
- slash: string;
131
- radio: string;
132
- book: string;
133
- userMinus: string;
134
- bell: string;
135
- gitBranch: string;
136
- coffee: string;
137
- code: string;
138
- thermometer: string;
139
- cast: string;
140
- flag: string;
141
- eyeOff: string;
142
- battery: string;
143
- disc: string;
144
- frown: string;
145
- tool: string;
146
- cpu: string;
147
- bold: string;
148
- hash: string;
149
- share2: string;
150
- plus: string;
151
- check: string;
152
- rotateCcw: string;
153
- hardDrive: string;
154
- bluetooth: string;
155
- pieChart: string;
156
- headphones: string;
157
- rss: string;
158
- wifi: string;
159
- cornerUpLeft: string;
160
- watch: string;
161
- info: string;
162
- userX: string;
163
- loader: string;
164
- refreshCcw: string;
165
- folderPlus: string;
166
- gitMerge: string;
167
- mic: string;
168
- copy: string;
169
- zoomIn: string;
170
- arrowRightCircle: string;
171
- alignRight: string;
172
- image: string;
173
- maximize2: string;
174
- checkCircle: string;
175
- sunset: string;
176
- save: string;
177
- smile: string;
178
- navigation: string;
179
- cloudLightning: string;
180
- paperclip: string;
181
- fastForward: string;
182
- xSquare: string;
183
- award: string;
184
- zoomOut: string;
185
- box: string;
186
- thumbsUp: string;
187
- percent: string;
188
- sidebar: string;
189
- square: string;
190
- play: string;
191
- gitCommit: string;
192
- table: string;
193
- send: string;
194
- phoneCall: string;
195
- speaker: string;
196
- facebook: string;
197
- codesandbox: string;
198
- camera: string;
199
- link2: string;
200
- printer: string;
201
- folderMinus: string;
202
- arrowUpRight: string;
203
- truck: string;
204
- lifeBuoy: string;
205
- penTool: string;
206
- atSign: string;
207
- feather: string;
208
- trash: string;
209
- wifiOff: string;
210
- cornerLeftDown: string;
211
- dollarSign: string;
212
- star: string;
213
- cloudOff: string;
214
- sun: string;
215
- messageSquare: string;
216
- edit: string;
217
- anchor: string;
218
- alertCircle: string;
219
- chevronsUp: string;
220
- uploadCloud: string;
221
- twitch: string;
222
- youtube: string;
223
- unlock: string;
224
- compass: string;
225
- plusCircle: string;
226
- creditCard: string;
227
- cloudRain: string;
228
- trash2: string;
229
- skipBack: string;
230
- filePlus: string;
231
- delete: string;
232
- command: string;
233
- clock: string;
234
- octagon: string;
235
- phone: string;
236
- eye: string;
237
- phoneOff: string;
238
- codepen: string;
239
- dribbble: string;
240
- gift: string;
241
- externalLink: string;
242
- zap: string;
243
- trello: string;
244
- moreVertical: string;
245
- micOff: string;
246
- share: string;
247
- arrowUp: string;
248
- bellOff: string;
249
- linkedin: string;
250
- video: string;
251
- divideCircle: string;
252
- activity: string;
253
- twitter: string;
254
- mapPin: string;
255
- filter: string;
256
- phoneIncoming: string;
257
- italic: string;
258
- chevronsLeft: string;
259
- calendar: string;
260
- globe: string;
261
- arrowLeft: string;
262
- alignCenter: string;
263
- minusCircle: string;
264
- arrowDownRight: string;
265
- framer: string;
266
- volumeX: string;
267
- slack: string;
268
- cloud: string;
269
- downloadCloud: string;
270
- shuffle: string;
271
- rewind: string;
272
- upload: string;
273
- trendingDown: string;
274
- pause: string;
275
- arrowDownCircle: string;
276
- bookmark: string;
277
- alertTriangle: string;
278
- userCheck: string;
279
- tablet: string;
280
- alertOctagon: string;
281
- menu: string;
282
- chrome: string;
283
- shoppingCart: string;
284
- folder: string;
285
- users: string;
286
- cornerDownLeft: string;
287
- monitor: string;
288
- minus: string;
289
- helpCircle: string;
290
- navigation2: string;
291
- chevronLeft: string;
292
- film: string;
293
- moon: string;
294
- shieldOff: string;
295
- layout: string;
296
- mousePointer: string;
297
- alignLeft: string;
298
- heart: string;
299
- trendingUp: string;
300
- listBullet: string;
301
- indent: string;
302
- fontBold: string;
303
- fontItalic: string;
304
- fontUnderline: string;
305
- outdent: string;
306
- listNumber: string;
307
- resize: string;
308
- bug: string;
309
- blog: string;
310
- sortAscending: string;
311
- npm: string;
312
- game: string;
313
- google: string;
314
- discord: string;
315
- };
1
+ export interface IconData {
2
+ [key: string]: string;
3
+ }
4
+ declare const _default: IconData;
316
5
  export default _default;
@@ -0,0 +1 @@
1
+ export declare const activity = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><polyline points=\"22 12 18 12 15 21 9 3 6 12 2 12\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const airplay = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><path d=\"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1\"></path><polygon points=\"12 15 17 21 7 21 12 15\"></polygon></svg>";
@@ -0,0 +1 @@
1
+ export declare const alertCircle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alertOctagon = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><polygon points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"></polygon><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alertTriangle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alignCenter = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"18\" y1=\"10\" x2=\"6\" y2=\"10\"></line><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\"></line><line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\"></line><line x1=\"18\" y1=\"18\" x2=\"6\" y2=\"18\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alignJustify = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"21\" y1=\"10\" x2=\"3\" y2=\"10\"></line><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\"></line><line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\"></line><line x1=\"21\" y1=\"18\" x2=\"3\" y2=\"18\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alignLeft = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"17\" y1=\"10\" x2=\"3\" y2=\"10\"></line><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\"></line><line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\"></line><line x1=\"17\" y1=\"18\" x2=\"3\" y2=\"18\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const alignRight = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"21\" y1=\"10\" x2=\"7\" y2=\"10\"></line><line x1=\"21\" y1=\"6\" x2=\"3\" y2=\"6\"></line><line x1=\"21\" y1=\"14\" x2=\"3\" y2=\"14\"></line><line x1=\"21\" y1=\"18\" x2=\"7\" y2=\"18\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const anchor = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"5\" r=\"3\"></circle><line x1=\"12\" y1=\"22\" x2=\"12\" y2=\"8\"></line><path d=\"M5 12H2a10 10 0 0 0 20 0h-3\"></path></svg>";
@@ -0,0 +1 @@
1
+ export declare const aperture = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"14.31\" y1=\"8\" x2=\"20.05\" y2=\"17.94\"></line><line x1=\"9.69\" y1=\"8\" x2=\"21.17\" y2=\"8\"></line><line x1=\"7.38\" y1=\"12\" x2=\"13.12\" y2=\"2.06\"></line><line x1=\"9.69\" y1=\"16\" x2=\"3.95\" y2=\"6.06\"></line><line x1=\"14.31\" y1=\"16\" x2=\"2.83\" y2=\"16\"></line><line x1=\"16.62\" y1=\"12\" x2=\"10.88\" y2=\"21.94\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const archive = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><polyline points=\"21 8 21 21 3 21 3 8\"></polyline><rect x=\"1\" y=\"3\" width=\"22\" height=\"5\"></rect><line x1=\"10\" y1=\"12\" x2=\"14\" y2=\"12\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowDown = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"></line><polyline points=\"19 12 12 19 5 12\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowDownCircle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><polyline points=\"8 12 12 16 16 12\"></polyline><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"16\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowDownLeft = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"17\" y1=\"7\" x2=\"7\" y2=\"17\"></line><polyline points=\"17 17 7 17 7 7\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowDownRight = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"7\" y1=\"7\" x2=\"17\" y2=\"17\"></line><polyline points=\"17 7 17 17 7 17\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowLeft = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"19\" y1=\"12\" x2=\"5\" y2=\"12\"></line><polyline points=\"12 19 5 12 12 5\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowLeftCircle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><polyline points=\"12 8 8 12 12 16\"></polyline><line x1=\"16\" y1=\"12\" x2=\"8\" y2=\"12\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowRight = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"></line><polyline points=\"12 5 19 12 12 19\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowRightCircle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><polyline points=\"12 16 16 12 12 8\"></polyline><line x1=\"8\" y1=\"12\" x2=\"16\" y2=\"12\"></line></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowUp = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"5\"></line><polyline points=\"5 12 12 5 19 12\"></polyline></svg>";
@@ -0,0 +1 @@
1
+ export declare const arrowUpCircle = "<svg class=\"stroked\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><polyline points=\"16 12 12 8 8 12\"></polyline><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"8\"></line></svg>";