@xyd-js/components 0.1.0-xyd.10 → 0.1.0-xyd.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 (352) hide show
  1. package/.idea/git_toolbox_blame.xml +6 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/.idea/xyd-components.iml +12 -0
  5. package/CHANGELOG.md +22 -0
  6. package/TODO.md +1 -0
  7. package/content.ts +0 -2
  8. package/dist/CTABanner-BD4wweO5.js +2 -0
  9. package/dist/CTABanner-BD4wweO5.js.map +1 -0
  10. package/dist/CTABanner-DLG0_gv8.js +2 -0
  11. package/dist/CTABanner-DLG0_gv8.js.map +1 -0
  12. package/dist/CTABanner-DpPtA-FL.js +2 -0
  13. package/dist/CTABanner-DpPtA-FL.js.map +1 -0
  14. package/dist/CodeSample--qfqZ1hL.js +2 -0
  15. package/dist/CodeSample--qfqZ1hL.js.map +1 -0
  16. package/dist/CodeSample-CqFaFwwz.js +2 -0
  17. package/dist/CodeSample-CqFaFwwz.js.map +1 -0
  18. package/dist/CodeSample-GbqwRbcO.js +2 -0
  19. package/dist/CodeSample-GbqwRbcO.js.map +1 -0
  20. package/dist/HomeView-BZdY0g_7.js +2 -0
  21. package/dist/{HomeView-ACBdUgyz.js.map → HomeView-BZdY0g_7.js.map} +1 -1
  22. package/dist/HomeView-C_mEMzjV.js +2 -0
  23. package/dist/{HomeView-B0ATNUF1.js.map → HomeView-C_mEMzjV.js.map} +1 -1
  24. package/dist/HomeView-RATm-3zT.js +2 -0
  25. package/dist/{HomeView-CHSb4HL6.js.map → HomeView-RATm-3zT.js.map} +1 -1
  26. package/dist/Icon-BkXdTctK.js +2 -0
  27. package/dist/Icon-BkXdTctK.js.map +1 -0
  28. package/dist/Icon-BoKcRZAF.js +2 -0
  29. package/dist/Icon-BoKcRZAF.js.map +1 -0
  30. package/dist/Icon-CouPZRkJ.js +2 -0
  31. package/dist/Icon-CouPZRkJ.js.map +1 -0
  32. package/dist/Text-B-E3eaWW.js +2 -0
  33. package/dist/Text-B-E3eaWW.js.map +1 -0
  34. package/dist/Text-B5Ba_pci.js +2 -0
  35. package/dist/Text-B5Ba_pci.js.map +1 -0
  36. package/dist/Text-QH4jjPUM.js +2 -0
  37. package/dist/Text-QH4jjPUM.js.map +1 -0
  38. package/dist/Update-BlhP2VFR.js +2 -0
  39. package/dist/Update-BlhP2VFR.js.map +1 -0
  40. package/dist/Update-CMM38Snc.js +2 -0
  41. package/dist/Update-CMM38Snc.js.map +1 -0
  42. package/dist/Update-D5e_yqty.js +2 -0
  43. package/dist/Update-D5e_yqty.js.map +1 -0
  44. package/dist/VideoGuide-C5aW4OXW.js +2 -0
  45. package/dist/VideoGuide-C5aW4OXW.js.map +1 -0
  46. package/dist/VideoGuide-CoQXlHjQ.js +2 -0
  47. package/dist/VideoGuide-CoQXlHjQ.js.map +1 -0
  48. package/dist/VideoGuide-CwkedH8b.js +2 -0
  49. package/dist/VideoGuide-CwkedH8b.js.map +1 -0
  50. package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js +4 -0
  51. package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js.map +1 -0
  52. package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js +4 -0
  53. package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js.map +1 -0
  54. package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js +4 -0
  55. package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js.map +1 -0
  56. package/dist/brand.js +1 -1
  57. package/dist/brand.js.map +1 -1
  58. package/dist/coder/themes/cosmo-light.js.map +1 -1
  59. package/dist/coder.d.ts +29 -9
  60. package/dist/coder.js +1 -1
  61. package/dist/coder.js.map +1 -1
  62. package/dist/content.d.ts +264 -201
  63. package/dist/content.js +1 -1
  64. package/dist/content.js.map +1 -1
  65. package/dist/index.css +260 -210
  66. package/dist/layouts.d.ts +20 -21
  67. package/dist/layouts.js +1 -1
  68. package/dist/layouts.js.map +1 -1
  69. package/dist/pages.js +1 -1
  70. package/dist/pages.js.map +1 -1
  71. package/dist/system.d.ts +10 -0
  72. package/dist/system.js +2 -0
  73. package/dist/system.js.map +1 -0
  74. package/dist/tslib.es6-Bb9zBh0L.js +2 -0
  75. package/dist/{tslib.es6-BBkx4Se1.js.map → tslib.es6-Bb9zBh0L.js.map} +1 -1
  76. package/dist/tslib.es6-Bd9lzVn6.js +2 -0
  77. package/dist/{tslib.es6-BF6ZLEXa.js.map → tslib.es6-Bd9lzVn6.js.map} +1 -1
  78. package/dist/tslib.es6-DwnOrHRg.js +2 -0
  79. package/dist/{tslib.es6-BOZCDgb8.js.map → tslib.es6-DwnOrHRg.js.map} +1 -1
  80. package/dist/views.js +1 -1
  81. package/dist/writer.d.ts +409 -77
  82. package/dist/writer.js +1 -1
  83. package/dist/writer.js.map +1 -1
  84. package/docs/.nojekyll +1 -0
  85. package/docs/assets/hierarchy.js +1 -0
  86. package/docs/assets/highlight.css +22 -0
  87. package/docs/assets/icons.js +18 -0
  88. package/docs/assets/icons.svg +1 -0
  89. package/docs/assets/main.js +60 -0
  90. package/docs/assets/navigation.js +1 -0
  91. package/docs/assets/search.js +1 -0
  92. package/docs/assets/style.css +1640 -0
  93. package/docs/functions/GuideCard.html +6 -0
  94. package/docs/hierarchy.html +1 -0
  95. package/docs/index.html +2 -0
  96. package/docs/interfaces/GuideCardProps.html +18 -0
  97. package/docs/modules.html +1 -0
  98. package/index.ts +0 -1
  99. package/package.json +10 -6
  100. package/project.json +677 -0
  101. package/rollup.config.js +30 -20
  102. package/src/brand/Button/Button.styles.tsx +0 -3
  103. package/src/brand/CTABanner/CTABanner.styles.tsx +2 -4
  104. package/src/brand/Footer/Footer.styles.tsx +0 -3
  105. package/src/coder/Code/Code.styles.tsx +132 -33
  106. package/src/coder/Code/Code.tsx +129 -38
  107. package/src/coder/Code/CodeLoader.tsx +3 -3
  108. package/src/coder/Code/annotations.tsx +28 -8
  109. package/src/coder/Code/highlight.ts +38 -0
  110. package/src/coder/Code/index.ts +2 -1
  111. package/src/coder/CodeCopy/CodeCopy.styles.tsx +13 -11
  112. package/src/coder/CodeCopy/CodeCopy.tsx +5 -3
  113. package/src/coder/CodeSample/CodeSample.tsx +83 -27
  114. package/src/coder/CodeTabs/CodeTabs.styles.tsx +111 -94
  115. package/src/coder/CodeTabs/CodeTabs.tsx +69 -51
  116. package/src/coder/CodeTheme/CodeTheme.tsx +89 -49
  117. package/src/coder/CodeTheme/index.ts +0 -1
  118. package/src/coder/CoderProvider.tsx +26 -0
  119. package/src/coder/index.ts +8 -4
  120. package/src/content/ContentDecoator.styles.tsx +113 -0
  121. package/src/content/ContentDecorator.tsx +17 -0
  122. package/src/content/GridDecorator.styles.tsx +67 -0
  123. package/src/content/GridDecorator.tsx +21 -0
  124. package/src/content/ReactContent.tsx +575 -0
  125. package/src/content/index.ts +10 -2
  126. package/src/icons/index.ts +0 -0
  127. package/src/kit/Loader/Loader.styles.tsx +53 -0
  128. package/src/kit/Loader/Loader.tsx +22 -0
  129. package/src/kit/index.ts +1 -0
  130. package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +270 -306
  131. package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +171 -91
  132. package/src/layouts/LayoutPrimary/index.ts +0 -2
  133. package/src/layouts/index.ts +0 -7
  134. package/src/system/SearchButton/SearchButton.styles.tsx +86 -0
  135. package/src/system/SearchButton/SearchButton.tsx +116 -0
  136. package/src/system/SearchButton/index.ts +1 -0
  137. package/src/system/index.ts +1 -0
  138. package/src/writer/Anchor/Anchor.styles.tsx +11 -0
  139. package/src/{content → writer}/Anchor/Anchor.tsx +20 -22
  140. package/src/writer/Anchor/index.tsx +1 -0
  141. package/src/writer/Badge/Badge.styles.tsx +37 -27
  142. package/src/writer/Badge/Badge.tsx +34 -48
  143. package/src/writer/Banner/Banner.styles.tsx +91 -0
  144. package/src/writer/Banner/Banner.tsx +70 -0
  145. package/src/writer/Banner/index.ts +1 -0
  146. package/src/writer/Blockquote/Blockquote.styles.tsx +6 -4
  147. package/src/writer/Blockquote/Blockquote.tsx +5 -2
  148. package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +25 -25
  149. package/src/writer/Breadcrumbs/Breadcrumbs.tsx +18 -12
  150. package/src/writer/Button/Button.styles.tsx +137 -0
  151. package/src/writer/Button/Button.tsx +75 -0
  152. package/src/writer/Button/index.ts +2 -0
  153. package/src/writer/Callout/Callout.styles.tsx +35 -42
  154. package/src/writer/Callout/Callout.tsx +30 -15
  155. package/src/writer/Card/Card.styles.tsx +47 -0
  156. package/src/writer/Card/Card.tsx +69 -0
  157. package/src/writer/Card/index.ts +1 -0
  158. package/src/writer/Code/Code.styles.tsx +12 -11
  159. package/src/writer/Code/Code.tsx +6 -3
  160. package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +172 -0
  161. package/src/writer/ColorSchemeButton/index.ts +1 -0
  162. package/src/writer/Details/Details.styles.tsx +87 -98
  163. package/src/writer/Details/Details.tsx +65 -44
  164. package/src/writer/Example/index.tsx +5 -0
  165. package/src/writer/GuideCard/GuideCard.styles.tsx +100 -103
  166. package/src/writer/GuideCard/GuideCard.tsx +72 -37
  167. package/src/writer/Heading/Heading.styles.tsx +76 -60
  168. package/src/writer/Heading/Heading.tsx +92 -22
  169. package/src/writer/Hr/Hr.styles.tsx +3 -1
  170. package/src/writer/Hr/Hr.tsx +2 -5
  171. package/src/writer/Icon/Icon.tsx +48 -0
  172. package/src/writer/Icon/index.ts +1 -0
  173. package/src/writer/Image/Image.styles.tsx +9 -0
  174. package/src/writer/Image/Image.tsx +19 -0
  175. package/src/writer/Image/index.ts +1 -0
  176. package/src/writer/List/List.styles.tsx +47 -0
  177. package/src/writer/List/List.tsx +29 -0
  178. package/src/writer/List/index.ts +4 -0
  179. package/src/writer/NavLinks/NavLinks.styles.ts +26 -26
  180. package/src/writer/NavLinks/NavLinks.tsx +65 -18
  181. package/src/writer/Pre/Pre.styles.tsx +8 -6
  182. package/src/writer/Pre/Pre.tsx +3 -2
  183. package/src/writer/Steps/Steps.styles.tsx +27 -24
  184. package/src/writer/Steps/Steps.tsx +38 -8
  185. package/src/writer/Table/Table.styles.tsx +65 -34
  186. package/src/writer/Table/Table.tsx +121 -11
  187. package/src/writer/Table/index.ts +0 -11
  188. package/src/writer/Tabs/Tabs.styles.tsx +51 -55
  189. package/src/writer/Tabs/Tabs.tsx +30 -23
  190. package/src/writer/Text/Text.styles.tsx +66 -0
  191. package/src/writer/Text/Text.tsx +79 -0
  192. package/src/writer/Text/index.ts +3 -0
  193. package/src/writer/TocCard/TocCard.module.css +44 -0
  194. package/src/writer/TocCard/TocCard.tsx +42 -0
  195. package/src/writer/TocCard/index.ts +3 -0
  196. package/src/writer/UnderlineNav/Tabs.tsx +51 -0
  197. package/src/writer/UnderlineNav/TabsPrimary.styles.tsx +184 -0
  198. package/src/writer/UnderlineNav/TabsPrimary.tsx +209 -0
  199. package/src/writer/UnderlineNav/TabsSecondary.styles.tsx +77 -0
  200. package/src/writer/UnderlineNav/TabsSecondary.tsx +171 -0
  201. package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +165 -31
  202. package/src/writer/UnderlineNav/UnderlineNav.tsx +257 -22
  203. package/src/writer/UnderlineNav/index.ts +2 -1
  204. package/src/writer/UnderlineNav/useValueChange.ts +60 -0
  205. package/src/writer/Update/Update.styles.tsx +33 -0
  206. package/src/writer/Update/Update.tsx +37 -0
  207. package/src/writer/Update/index.ts +1 -0
  208. package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
  209. package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
  210. package/src/writer/VideoGuide/index.ts +1 -0
  211. package/src/writer/index.ts +23 -1
  212. package/tsconfig.json +9 -3
  213. package/types.d.ts +50 -0
  214. package/writer.ts +1 -1
  215. package/dist/CTABanner-4FVIoaTR.js +0 -2
  216. package/dist/CTABanner-4FVIoaTR.js.map +0 -1
  217. package/dist/CTABanner-BQx2SLf8.js +0 -2
  218. package/dist/CTABanner-BQx2SLf8.js.map +0 -1
  219. package/dist/CTABanner-C6afsXoE.js +0 -2
  220. package/dist/CTABanner-C6afsXoE.js.map +0 -1
  221. package/dist/CTABanner-CEKs-Hb-.js +0 -2
  222. package/dist/CTABanner-CEKs-Hb-.js.map +0 -1
  223. package/dist/CTABanner-CUNcTr6s.js +0 -2
  224. package/dist/CTABanner-CUNcTr6s.js.map +0 -1
  225. package/dist/CTABanner-D02aIAsD.js +0 -2
  226. package/dist/CTABanner-D02aIAsD.js.map +0 -1
  227. package/dist/CTABanner-Dm3tUG3I.js +0 -2
  228. package/dist/CTABanner-Dm3tUG3I.js.map +0 -1
  229. package/dist/CTABanner-MCOcVowa.js +0 -2
  230. package/dist/CTABanner-MCOcVowa.js.map +0 -1
  231. package/dist/CTABanner-X6K49gSr.js +0 -2
  232. package/dist/CTABanner-X6K49gSr.js.map +0 -1
  233. package/dist/CodeSample-B9VUhTKF.js +0 -2
  234. package/dist/CodeSample-B9VUhTKF.js.map +0 -1
  235. package/dist/CodeSample-BSXeFy0x.js +0 -2
  236. package/dist/CodeSample-BSXeFy0x.js.map +0 -1
  237. package/dist/CodeSample-BwP208sQ.js +0 -2
  238. package/dist/CodeSample-BwP208sQ.js.map +0 -1
  239. package/dist/CodeSample-CK-CQYrV.js +0 -2
  240. package/dist/CodeSample-CK-CQYrV.js.map +0 -1
  241. package/dist/CodeSample-CUemtj_W.js +0 -2
  242. package/dist/CodeSample-CUemtj_W.js.map +0 -1
  243. package/dist/CodeSample-D0iKih-A.js +0 -2
  244. package/dist/CodeSample-D0iKih-A.js.map +0 -1
  245. package/dist/CodeSample-D33vTa6M.js +0 -2
  246. package/dist/CodeSample-D33vTa6M.js.map +0 -1
  247. package/dist/CodeSample-DUSx2KBt.js +0 -2
  248. package/dist/CodeSample-DUSx2KBt.js.map +0 -1
  249. package/dist/CodeSample-P4yxkHPW.js +0 -2
  250. package/dist/CodeSample-P4yxkHPW.js.map +0 -1
  251. package/dist/HomeView-ACBdUgyz.js +0 -2
  252. package/dist/HomeView-B0ATNUF1.js +0 -2
  253. package/dist/HomeView-CHSb4HL6.js +0 -2
  254. package/dist/HomeView-COJrg8Ju.js +0 -2
  255. package/dist/HomeView-COJrg8Ju.js.map +0 -1
  256. package/dist/HomeView-Cun4apuy.js +0 -2
  257. package/dist/HomeView-Cun4apuy.js.map +0 -1
  258. package/dist/HomeView-D4DXEOOn.js +0 -2
  259. package/dist/HomeView-D4DXEOOn.js.map +0 -1
  260. package/dist/HomeView-DaH1PSBB.js +0 -2
  261. package/dist/HomeView-DaH1PSBB.js.map +0 -1
  262. package/dist/HomeView-O_lj2c2t.js +0 -2
  263. package/dist/HomeView-O_lj2c2t.js.map +0 -1
  264. package/dist/HomeView-_Nu2RcOM.js +0 -2
  265. package/dist/HomeView-_Nu2RcOM.js.map +0 -1
  266. package/dist/UnderlineNav-3-KptDYD.js +0 -2
  267. package/dist/UnderlineNav-3-KptDYD.js.map +0 -1
  268. package/dist/UnderlineNav-BCyB0G5d.js +0 -2
  269. package/dist/UnderlineNav-BCyB0G5d.js.map +0 -1
  270. package/dist/UnderlineNav-BEhDJk0H.js +0 -2
  271. package/dist/UnderlineNav-BEhDJk0H.js.map +0 -1
  272. package/dist/UnderlineNav-BqZ2xAp7.js +0 -2
  273. package/dist/UnderlineNav-BqZ2xAp7.js.map +0 -1
  274. package/dist/UnderlineNav-C2-4Vyj8.js +0 -2
  275. package/dist/UnderlineNav-C2-4Vyj8.js.map +0 -1
  276. package/dist/UnderlineNav-Co08Gykm.js +0 -2
  277. package/dist/UnderlineNav-Co08Gykm.js.map +0 -1
  278. package/dist/UnderlineNav-DC3UVmnZ.js +0 -2
  279. package/dist/UnderlineNav-DC3UVmnZ.js.map +0 -1
  280. package/dist/UnderlineNav-DsRYwuGB.js +0 -2
  281. package/dist/UnderlineNav-DsRYwuGB.js.map +0 -1
  282. package/dist/UnderlineNav-FbclXKUW.js +0 -2
  283. package/dist/UnderlineNav-FbclXKUW.js.map +0 -1
  284. package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js +0 -2
  285. package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js.map +0 -1
  286. package/dist/_rollupPluginBabelHelpers-BHehKRBq.js +0 -2
  287. package/dist/_rollupPluginBabelHelpers-BHehKRBq.js.map +0 -1
  288. package/dist/_rollupPluginBabelHelpers-Bunpz22T.js +0 -2
  289. package/dist/_rollupPluginBabelHelpers-Bunpz22T.js.map +0 -1
  290. package/dist/_rollupPluginBabelHelpers-CVblpRvU.js +0 -2
  291. package/dist/_rollupPluginBabelHelpers-CVblpRvU.js.map +0 -1
  292. package/dist/_rollupPluginBabelHelpers-CxmswfqM.js +0 -2
  293. package/dist/_rollupPluginBabelHelpers-CxmswfqM.js.map +0 -1
  294. package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js +0 -2
  295. package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js.map +0 -1
  296. package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js +0 -2
  297. package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js.map +0 -1
  298. package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js +0 -2
  299. package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js.map +0 -1
  300. package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js +0 -2
  301. package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js.map +0 -1
  302. package/dist/index-B0FncPxO.js +0 -2
  303. package/dist/index-B0FncPxO.js.map +0 -1
  304. package/dist/index-BEm-xkm-.js +0 -2
  305. package/dist/index-BEm-xkm-.js.map +0 -1
  306. package/dist/index-BHwtxG27.js +0 -2
  307. package/dist/index-BHwtxG27.js.map +0 -1
  308. package/dist/index-BTcmIG47.js +0 -2
  309. package/dist/index-BTcmIG47.js.map +0 -1
  310. package/dist/index-BbIMmTvo.js +0 -2
  311. package/dist/index-BbIMmTvo.js.map +0 -1
  312. package/dist/index-CNkHt1r7.js +0 -2
  313. package/dist/index-CNkHt1r7.js.map +0 -1
  314. package/dist/index-D0XuyFm7.js +0 -2
  315. package/dist/index-D0XuyFm7.js.map +0 -1
  316. package/dist/index-DBspcqWq.js +0 -2
  317. package/dist/index-DBspcqWq.js.map +0 -1
  318. package/dist/index-DVBO4gYE.js +0 -2
  319. package/dist/index-DVBO4gYE.js.map +0 -1
  320. package/dist/tslib.es6-BBkx4Se1.js +0 -2
  321. package/dist/tslib.es6-BF6ZLEXa.js +0 -2
  322. package/dist/tslib.es6-BOZCDgb8.js +0 -2
  323. package/dist/tslib.es6-CNVK7Xcu.js +0 -2
  324. package/dist/tslib.es6-CNVK7Xcu.js.map +0 -1
  325. package/dist/tslib.es6-Cjl5tesf.js +0 -2
  326. package/dist/tslib.es6-Cjl5tesf.js.map +0 -1
  327. package/dist/tslib.es6-DEH7Dkgy.js +0 -2
  328. package/dist/tslib.es6-DEH7Dkgy.js.map +0 -1
  329. package/dist/tslib.es6-DTeJ7dWi.js +0 -2
  330. package/dist/tslib.es6-DTeJ7dWi.js.map +0 -1
  331. package/dist/tslib.es6-U9-f6pA7.js +0 -2
  332. package/dist/tslib.es6-U9-f6pA7.js.map +0 -1
  333. package/dist/tslib.es6-cb69JjeS.js +0 -2
  334. package/dist/tslib.es6-cb69JjeS.js.map +0 -1
  335. package/src/content/Anchor/Anchor.styles.tsx +0 -5
  336. package/src/content/Anchor/index.tsx +0 -3
  337. package/src/content/Content/Content.styles.tsx +0 -9
  338. package/src/content/Content/Content.tsx +0 -13
  339. package/src/content/Content/index.tsx +0 -3
  340. package/src/content/Content.tsx +0 -179
  341. package/src/content/Subtitle/Subtitle.styles.ts +0 -8
  342. package/src/content/Subtitle/Subtitle.tsx +0 -12
  343. package/src/content/Subtitle/index.tsx +0 -3
  344. package/src/layouts/Layout.styles.tsx +0 -155
  345. package/src/layouts/Layout.tsx +0 -119
  346. package/src/ui/Loader/Loader.styles.tsx +0 -54
  347. package/src/ui/Loader/Loader.tsx +0 -26
  348. package/src/ui/index.ts +0 -1
  349. package/src/writer/Icon/index.tsx +0 -355
  350. package/src/writer/Table/TableV2.styles.tsx +0 -117
  351. package/src/writer/Table/TableV2.tsx +0 -83
  352. /package/src/{ui → kit}/TODO.md +0 -0
@@ -0,0 +1,575 @@
1
+ import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react'
2
+ import { HighlightedCode } from 'codehike/code';
3
+
4
+ import {
5
+ Settings
6
+ } from "@xyd-js/core"
7
+
8
+ import {
9
+ Anchor,
10
+ Badge,
11
+ Blockquote,
12
+ Callout,
13
+ Code,
14
+ Details,
15
+ GuideCard,
16
+ Heading,
17
+ Hr,
18
+ Table,
19
+ Tabs,
20
+ Steps,
21
+ List,
22
+ ListOl,
23
+ UnderlineNav,
24
+ Text,
25
+ Button,
26
+ Icon,
27
+ Image,
28
+ Update,
29
+ Card,
30
+ ColorSchemeButton
31
+ } from '../writer'
32
+ import { CodeSample } from "../coder";
33
+ import { GridDecorator } from './GridDecorator';
34
+
35
+ interface ReactContentOptions {
36
+ Link?: React.ElementType
37
+ components?: { [component: string]: (props: any) => React.JSX.Element | null }
38
+ useLocation?: () => {
39
+ search: string
40
+ } // TODO: !!!! BETTER API !!!!!
41
+ useNavigate?: (to: any) => void // TODO: !!!! BETTER API !!!!!
42
+ useNavigation?: () => any, // TODO: !!!! BETTER API !!!!!
43
+
44
+ }
45
+
46
+ export class ReactContent {
47
+ constructor(
48
+ protected settings?: Settings,
49
+ protected options?: ReactContentOptions
50
+ ) {
51
+ }
52
+
53
+ public components(): { [component: string]: (props: any) => React.JSX.Element | null } {
54
+ const builtInComponents = [
55
+ stdContent,
56
+ writerContent,
57
+ iconContent,
58
+ coderContent,
59
+ directiveContent,
60
+ contentDecorators
61
+ ]
62
+ .map(fn => fn.bind(this))
63
+ .reduce((acc, fn) => ({ ...acc, ...fn() }), {});
64
+
65
+ return {
66
+ ...builtInComponents,
67
+ ...this.options?.components || {}
68
+ }
69
+ }
70
+
71
+ public noop() {
72
+ const components = this.components()
73
+
74
+ const noopBuiltInFlatComponents = [
75
+ ...Object.keys(components),
76
+ ...Object.keys(this.options?.components || {})
77
+ ].reduce((acc, key) => {
78
+ acc[key] = () => null
79
+ return acc
80
+ }, {})
81
+
82
+ const noopNestedComponents = {
83
+ Steps: NoopComponent,
84
+ UnderlineNav: NoopComponent,
85
+ Tabs: NoopComponent,
86
+ GuideCard: NoopComponent,
87
+ Table: NoopComponent,
88
+ }
89
+
90
+ return {
91
+ ...noopBuiltInFlatComponents,
92
+ ...noopNestedComponents,
93
+ React: NoopReactComponent,
94
+ }
95
+ }
96
+ }
97
+
98
+ function NoopComponent() {
99
+ return null
100
+ }
101
+ NoopComponent.Item = () => null
102
+ NoopComponent.Content = () => null
103
+ NoopComponent.List = () => null
104
+ NoopComponent.Head = () => null
105
+ NoopComponent.Td = () => null
106
+ NoopComponent.Tr = () => null
107
+ NoopComponent.Th = () => null
108
+ NoopComponent.Cell = () => null
109
+
110
+
111
+ function NoopReactComponent() { // TODO: !!!! in the future refactor but `html-to-jsx-transform` creates <React.Fragment> !!!
112
+ return null
113
+ }
114
+ NoopReactComponent.Fragment = React.Fragment
115
+
116
+ export function stdContent(
117
+ this: ReactContent,
118
+ ) {
119
+ const $$Pre = $Pre.bind(this)
120
+ const $$Heading = $Heading.bind(this)
121
+
122
+ return {
123
+ h1: (props) => {
124
+ return <$$Heading depth={1} {...props} noanchor />
125
+ },
126
+ h2: props => {
127
+ return <$$Heading depth={2} {...props} />
128
+ },
129
+ h3: props => {
130
+ return <$$Heading depth={3} {...props} />
131
+ },
132
+ h4: props => {
133
+ return <$$Heading depth={4} {...props} />
134
+ },
135
+ h5: props => {
136
+ return <$$Heading depth={5} {...props} />
137
+ },
138
+ p: props => {
139
+ return <Text {...props} />
140
+ },
141
+ ul: props => {
142
+ return <List {...props}>
143
+ {props.children}
144
+ </List>
145
+ },
146
+ ol: props => {
147
+ return <ListOl {...props}>
148
+ {props.children}
149
+ </ListOl>
150
+ },
151
+ li: props => {
152
+ return <List.Item {...props} >
153
+ {props.children}
154
+ </List.Item>
155
+ },
156
+
157
+ table: (props) => {
158
+ return <Table {...props} />
159
+ },
160
+ tr: (props) => {
161
+ return <Table.Tr {...props} />
162
+ },
163
+ th: (props) => {
164
+ return <Table.Th {...props} />
165
+ },
166
+ td: (props) => {
167
+ return <Table.Td {...props}>
168
+ <Table.Cell>
169
+ {props.children}
170
+ </Table.Cell>
171
+ </Table.Td>
172
+ },
173
+
174
+ code: (props) => {
175
+ return <Code {...props} />
176
+ },
177
+ pre: $$Pre,
178
+ details: (props) => {
179
+ return <Details {...props} />
180
+ },
181
+ blockquote: (props) => {
182
+ return <Blockquote {...props} />
183
+ },
184
+ hr: (props) => {
185
+ return <Hr {...props} />
186
+ },
187
+ a: (props) => {
188
+ return <$Link {...props} as={this?.options?.Link} />
189
+ },
190
+ br: (props) => {
191
+ return <br />
192
+ },
193
+ img: (props) => {
194
+ return <Image {...props} />
195
+ },
196
+
197
+ React: NoopReactComponent,
198
+ }
199
+ }
200
+
201
+ interface HeadingContentProps {
202
+ id: string
203
+ depth: 1 | 2 | 3 | 4 | 5 | 6
204
+ children: React.ReactNode
205
+ label?: string
206
+ subtitle?: string
207
+ noanchor?: boolean
208
+ style?: any
209
+ }
210
+
211
+ function $Heading({ id, depth, children, label, subtitle, noanchor, style }: HeadingContentProps) {
212
+ // const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!
213
+ // const navigate = this?.options?.useNavigate() // TODO: !!!! BETTER API !!!!!
214
+ const navigation = this?.options?.useNavigation() // TODO: !!!! BETTER API !!!!!
215
+
216
+ const ref = useRef<HTMLHeadingElement>(null!)
217
+ const [active, setActive] = useState(false)
218
+
219
+ function onReplaceState(e: any) {
220
+ const active = window.location.hash === `#${id}`
221
+ setActive(active)
222
+ }
223
+
224
+ useEffect(() => {
225
+ window.addEventListener('replaceState', onReplaceState)
226
+
227
+ const active = window.location.hash === `#${id}`
228
+ setActive(active)
229
+
230
+ if (active && ref.current && navigation?.state !== "loading") {
231
+ ref.current.scrollIntoView()
232
+ }
233
+
234
+ return () => {
235
+ window.removeEventListener('replaceState', onReplaceState)
236
+ }
237
+ }, [])
238
+
239
+ return <Heading
240
+ ref={ref}
241
+ id={id}
242
+ size={depth}
243
+ active={active}
244
+ onClick={() => {
245
+ // navigate({
246
+ // hash: id
247
+ // })
248
+
249
+ // TODO: !!! in the future we should use react-router but some issues with the hash !!!
250
+ const url = new URL(window.location.href)
251
+ url.hash = id
252
+ history.replaceState(null, '', url)
253
+
254
+ document.querySelector(`#${id}`)?.scrollIntoView()
255
+ }}
256
+ label={label}
257
+ subtitle={subtitle}
258
+ noanchor={noanchor}
259
+ style={style}
260
+ >
261
+ {children}
262
+ </Heading>
263
+ }
264
+
265
+ export function writerContent() {
266
+ const GuideCardContent = $GuideCardContentComponent.bind(this)
267
+ GuideCardContent.List = GuideCard.List
268
+
269
+ const UnderlineNavContent = $UnderlineNavContentComponent.bind(this)
270
+ UnderlineNavContent.Content = $UnderlineNavContentContentComponent.bind(this)
271
+ UnderlineNavContent.Item = $UnderlineNavItemContentComponent.bind(this)
272
+ UnderlineNavContent.Item.displayName = "UnderlineNav.Item"
273
+
274
+ return {
275
+ Callout,
276
+ Details,
277
+ GuideCard: GuideCardContent,
278
+ Steps,
279
+ Tabs: UnderlineNavContent,
280
+ Table,
281
+ Badge,
282
+ Button,
283
+ UnderlineNav: UnderlineNavContent,
284
+ Subtitle(props) {
285
+ const paragraph = props?.children?.props?.children
286
+
287
+ return <Heading size={4} kind="muted" {...props}>
288
+ {paragraph}
289
+ </Heading>
290
+ },
291
+ Update,
292
+ Card: $Card.bind(this),
293
+ ColorSchemeButton: ColorSchemeButton
294
+ }
295
+ }
296
+
297
+ function $GuideCardContentComponent(props) {
298
+ return <GuideCard
299
+ {...props}
300
+ as={this?.options?.Link}
301
+ />
302
+ }
303
+
304
+ function $Card(props) {
305
+ return <Card
306
+ {...props}
307
+ link={this?.options?.Link}
308
+ />
309
+ }
310
+
311
+ const UnderlineNavContentContext = createContext({
312
+ value: "",
313
+ onChange: (v: string) => {
314
+ }
315
+ })
316
+
317
+ function $UnderlineNavContentComponent(props) {
318
+ const [value, setValue] = useState(props.value)
319
+
320
+ return <UnderlineNavContentContext value={{ value, onChange: setValue }}>
321
+ <Tabs
322
+ {...props}
323
+ value={value}
324
+ onChange={val => {
325
+ setValue(val)
326
+ }}
327
+ />
328
+ </UnderlineNavContentContext>
329
+ }
330
+
331
+ function $UnderlineNavContentContentComponent(this: ReactContent, props) {
332
+ const { onChange } = useContext(UnderlineNavContentContext)
333
+ const location = this?.options?.useLocation?.() // TODO: !!!! BETTER API !!!!!
334
+
335
+ const search = location?.search
336
+ const params = new URLSearchParams(search)
337
+ const propsParams = new URLSearchParams(props.value)
338
+
339
+ let tabsMatch: boolean | undefined = true
340
+ let keyMatchExists = true
341
+ propsParams.forEach((value, key) => {
342
+ const paramKey = params.get(key)
343
+ if (paramKey !== value) {
344
+ tabsMatch = false
345
+ }
346
+ if (!paramKey) {
347
+ keyMatchExists = false
348
+ }
349
+ })
350
+
351
+ useEffect(() => {
352
+ if (tabsMatch) {
353
+ onChange(props.value)
354
+ }
355
+ }, [tabsMatch])
356
+
357
+ if (!keyMatchExists) {
358
+ tabsMatch = undefined
359
+ }
360
+
361
+ return <Tabs.Content {...props} defaultActive={tabsMatch} />
362
+ }
363
+
364
+ function $UnderlineNavItemContentComponent(props) {
365
+ const { onChange } = useContext(UnderlineNavContentContext)
366
+ const location = this?.options?.useLocation?.()
367
+
368
+ const search = location?.search
369
+ const params = new URLSearchParams(search)
370
+ const propsParams = new URLSearchParams(props.value)
371
+
372
+ let tabsMatch = true
373
+ propsParams.forEach((value, key) => {
374
+ if (params.get(key) !== value) {
375
+ tabsMatch = false
376
+ }
377
+ })
378
+
379
+ useEffect(() => {
380
+ if (tabsMatch) {
381
+ onChange(props.value)
382
+ }
383
+ }, [tabsMatch])
384
+
385
+ return <Tabs.Item
386
+ {...props}
387
+ as={this?.options?.Link}
388
+ defaultActive={tabsMatch}
389
+ />
390
+ }
391
+
392
+ // TODO: better system for icons + should work with .md like icon="session-replay" etc.
393
+ export function iconContent() {
394
+ return {
395
+ Icon,
396
+ }
397
+ }
398
+
399
+ export function coderContent() {
400
+ return {
401
+ CodeSample, // TODO: server side highlight?
402
+ }
403
+ }
404
+
405
+ export function directiveContent(
406
+ this: ReactContent,
407
+ ) {
408
+ return {
409
+ // TODO: deprecate? - but currently needed for directive cuz we do JSON.parse here
410
+ DirectiveCodeGroup: (props) => {
411
+ return <CodeSample
412
+ {...props}
413
+ theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}
414
+ codeblocks={JSON.parse(props.codeblocks)}
415
+ />
416
+ }
417
+ }
418
+ }
419
+
420
+ export function contentDecorators() {
421
+ return {
422
+ GridDecorator
423
+ }
424
+ }
425
+
426
+ function $Pre(
427
+ this: ReactContent,
428
+ props: any
429
+ ) {
430
+ let highlighted: HighlightedCode | undefined = undefined
431
+
432
+ if (props.highlighted) {
433
+ // if ssr highlighted code
434
+ try {
435
+ const serverHighlight: HighlightedCode = JSON.parse(props.highlighted)
436
+
437
+ if (serverHighlight) {
438
+ highlighted = serverHighlight
439
+ }
440
+ } catch (e) {
441
+ console.error("Error parsing highlighted code", e)
442
+ }
443
+ }
444
+ const lang = (props?.children?.props?.className || "").replace("language-", "")
445
+
446
+ let descriptionContent: React.ReactNode | undefined = undefined
447
+ if (props?.descriptionContent) {
448
+ const code = mdxContent(props?.descriptionContent)
449
+ if (code?.component) {
450
+ const Component = MemoMDXComponent(code?.component)
451
+
452
+ descriptionContent = <Component components={this.components()} />
453
+ }
454
+ }
455
+
456
+ return <CodeSample
457
+ theme={this.settings?.theme?.coder?.syntaxHighlight || undefined}
458
+ name={lang}
459
+ description={props?.children?.props?.meta}
460
+ codeblocks={[
461
+ {
462
+ value: props?.children?.props?.children,
463
+ lang: lang,
464
+ meta: lang,
465
+ highlighted,
466
+ }
467
+ ]}
468
+ lineNumbers={props?.lineNumbers}
469
+ size={props?.size}
470
+ descriptionHead={props?.descriptionHead}
471
+ descriptionContent={descriptionContent}
472
+ descriptionIcon={props?.descriptionIcon}
473
+ />
474
+ }
475
+
476
+ const EXTERNAL_HREF_REGEX = /https?:\/\//
477
+
478
+ interface LinkProps {
479
+ href?: string
480
+ as?: React.ElementType
481
+ newWindow?: boolean
482
+ children?: React.ReactNode
483
+ }
484
+
485
+ function $Link({
486
+ href = '',
487
+ as,
488
+ newWindow,
489
+ children,
490
+ ...props
491
+ }: LinkProps) {
492
+ const Link = as || Anchor
493
+
494
+ return <Link
495
+ href={href}
496
+ newWindow={newWindow || EXTERNAL_HREF_REGEX.test(href)}
497
+ {...props}
498
+ >
499
+ {children}
500
+ </Link>
501
+ }
502
+
503
+ // TODO: move to content?
504
+ function mdxExport(code: string) {
505
+ // Create a wrapper around React.createElement that adds keys to elements in lists
506
+ const scope = {
507
+ Fragment: React.Fragment,
508
+ jsxs: createElementWithKeys,
509
+ jsx: createElementWithKeys,
510
+ jsxDEV: createElementWithKeys,
511
+ }
512
+ const fn = new Function(...Object.keys(scope), code)
513
+
514
+ return fn(scope)
515
+ }
516
+
517
+ function MemoMDXComponent(codeComponent: any) {
518
+ return useMemo(
519
+ () => codeComponent ? codeComponent : null,
520
+ [codeComponent]
521
+ )
522
+ }
523
+
524
+
525
+ // // TODO: move to content?
526
+ function mdxContent(code: string) {
527
+ const content = mdxExport(code) // TODO: fix any
528
+ if (!mdxExport) {
529
+ return {}
530
+ }
531
+
532
+ return {
533
+ component: content?.default,
534
+ }
535
+ }
536
+
537
+ const createElementWithKeys = (type: any, props: any) => {
538
+ // Process children to add keys to all elements
539
+ const processChildren = (childrenArray: any[]): any[] => {
540
+ return childrenArray.map((child, index) => {
541
+ // If the child is a React element and doesn't have a key, add one
542
+ if (React.isValidElement(child) && !child.key) {
543
+ return React.cloneElement(child, { key: `mdx-${index}` });
544
+ }
545
+ // If the child is an array, process it recursively
546
+ if (Array.isArray(child)) {
547
+ return processChildren(child);
548
+ }
549
+ return child;
550
+ });
551
+ };
552
+
553
+ // Handle both cases: children as separate args or as props.children
554
+ let processedChildren;
555
+
556
+ if (props && props.children) {
557
+ if (Array.isArray(props.children)) {
558
+ processedChildren = processChildren(props.children);
559
+ } else if (React.isValidElement(props.children) && !props.children.key) {
560
+ // Single child without key
561
+ processedChildren = React.cloneElement(props.children, { key: 'mdx-child' });
562
+ } else {
563
+ // Single child with key or non-React element
564
+ processedChildren = props.children;
565
+ }
566
+ } else {
567
+ processedChildren = [];
568
+ }
569
+
570
+ // Create the element with processed children
571
+ return React.createElement(type, {
572
+ ...props,
573
+ children: processedChildren
574
+ });
575
+ };
@@ -1,3 +1,11 @@
1
- export * from "./Content"
1
+ export {
2
+ ReactContent,
2
3
 
3
- export {default as MDX} from "./Content"
4
+ stdContent,
5
+ writerContent,
6
+ iconContent,
7
+ coderContent,
8
+ directiveContent,
9
+ } from "./ReactContent"
10
+
11
+ export { ContentDecorator } from "./ContentDecorator"
File without changes
@@ -0,0 +1,53 @@
1
+ import { css } from "@linaria/core";
2
+
3
+ export const LoaderHost = css`
4
+ @layer defaults {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+
9
+ &[data-size="small"] {
10
+ width: 6px;
11
+ height: 6px;
12
+ }
13
+ &[data-size="large"] {
14
+ width: 12px;
15
+ height: 12px;
16
+ }
17
+
18
+ [part="dots"] {
19
+ display: flex;
20
+ gap: 4px;
21
+ }
22
+
23
+ [part="dot"] {
24
+ width: 8px;
25
+ height: 8px;
26
+ background-color: currentColor;
27
+ border-radius: 50%;
28
+ animation: pulse 1.4s infinite ease-in-out;
29
+ opacity: 0.6;
30
+
31
+ &:nth-of-type(2) {
32
+ animation-delay: 0.2s;
33
+ }
34
+
35
+ &:nth-of-type(3) {
36
+ animation-delay: 0.4s;
37
+ }
38
+
39
+ @keyframes pulse {
40
+ 0%, 80%, 100% {
41
+ transform: scale(0.6);
42
+ opacity: 0.4;
43
+ }
44
+ 40% {
45
+ transform: scale(1);
46
+ opacity: 1;
47
+ }
48
+ }
49
+ }
50
+ }
51
+ `;
52
+
53
+
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import * as cn from "./Loader.styles";
3
+
4
+ export interface LoaderProps {
5
+ size?: "small" | "medium" | "large";
6
+ className?: string;
7
+ }
8
+
9
+ export function Loader({size = "medium", className}: LoaderProps) {
10
+ return (
11
+ <xyd-loader
12
+ data-size={size}
13
+ className={` ${cn.LoaderHost} ${className || ""} `}
14
+ >
15
+ <div part="dots">
16
+ <div part="dot"/>
17
+ <div part="dot"/>
18
+ <div part="dot"/>
19
+ </div>
20
+ </xyd-loader>
21
+ );
22
+ }
@@ -0,0 +1 @@
1
+ export * from "./Loader/Loader";