@xyd-js/components 0.1.0-xyd.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 (356) hide show
  1. package/README.md +3 -0
  2. package/coder.ts +1 -0
  3. package/content.ts +3 -0
  4. package/dist/CTABanner-CWX9isVG.js +1 -0
  5. package/dist/CodeSample-C5YaEpAi.js +1 -0
  6. package/dist/HomeView-CnAj-VYl.js +1 -0
  7. package/dist/UnderlineNav-C8onw9Na.js +1 -0
  8. package/dist/_rollupPluginBabelHelpers-DfQAiTCw.js +1 -0
  9. package/dist/abap-kIO_7z1o.js +1 -0
  10. package/dist/actionscript-3-DiaraCXE.js +1 -0
  11. package/dist/ada-aNFKX2pl.js +1 -0
  12. package/dist/angular-html-y0qIEhS2.js +1 -0
  13. package/dist/angular-ts-Bn_6f37o.js +1 -0
  14. package/dist/apache-Cx7e0H64.js +1 -0
  15. package/dist/apex-CdSCJjuL.js +1 -0
  16. package/dist/apl-BDzWBUim.js +1 -0
  17. package/dist/applescript-CJFkzk5i.js +1 -0
  18. package/dist/ara-BC9R9M5c.js +1 -0
  19. package/dist/asciidoc-lqQQs4M0.js +1 -0
  20. package/dist/asm-QQeI-gwp.js +1 -0
  21. package/dist/astro-BPstp8LF.js +1 -0
  22. package/dist/awk-Cxb7Sqvk.js +1 -0
  23. package/dist/ballerina-G8TyVc6O.js +1 -0
  24. package/dist/bat-UDEmXz-g.js +1 -0
  25. package/dist/beancount-BWg86rhE.js +1 -0
  26. package/dist/berry-5E5uGOYg.js +1 -0
  27. package/dist/bibtex-CZn_FFnb.js +1 -0
  28. package/dist/bicep-D_G0XT5J.js +1 -0
  29. package/dist/blade-7dxmctkK.js +1 -0
  30. package/dist/brand.d.ts +30 -0
  31. package/dist/brand.js +1 -0
  32. package/dist/c-CrEz-oYf.js +1 -0
  33. package/dist/cadence-BulSIR1A.js +1 -0
  34. package/dist/clarity-m2OigCMT.js +1 -0
  35. package/dist/clojure-Bpes2rhL.js +1 -0
  36. package/dist/cmake-C4Tr1SQC.js +1 -0
  37. package/dist/cobol-Dp8xGW1S.js +1 -0
  38. package/dist/codeowners-Bs3mpoau.js +1 -0
  39. package/dist/codeql-CvQzaisq.js +1 -0
  40. package/dist/coder.d.ts +19 -0
  41. package/dist/coder.js +1 -0
  42. package/dist/coffee-DOjtyJj_.js +1 -0
  43. package/dist/common-lisp-DGVR8DFi.js +1 -0
  44. package/dist/content.d.ts +225 -0
  45. package/dist/content.js +1 -0
  46. package/dist/cpp-BUT7C4Bo.js +1 -0
  47. package/dist/crystal-BJh9OJ1_.js +1 -0
  48. package/dist/csharp-BhZuAD8H.js +1 -0
  49. package/dist/css-8_G4_UCW.js +1 -0
  50. package/dist/csv-DLRyYdMG.js +1 -0
  51. package/dist/cue-DAgMCCsT.js +1 -0
  52. package/dist/cypher-CtSiSKRh.js +1 -0
  53. package/dist/d-feZJOTtr.js +1 -0
  54. package/dist/dark-plus-Dcn2h2HL.js +1 -0
  55. package/dist/dart-CNOu4aud.js +1 -0
  56. package/dist/dax-Dkp1Uj6t.js +1 -0
  57. package/dist/desktop-CAGQzotA.js +1 -0
  58. package/dist/diff-D6yk3_ZG.js +1 -0
  59. package/dist/docker-BdTrQq0b.js +1 -0
  60. package/dist/dotenv-BeHGAMs7.js +1 -0
  61. package/dist/dracula-BUaMrXr0.js +1 -0
  62. package/dist/dracula-soft-CBx6n76m.js +1 -0
  63. package/dist/dream-maker-BU0sZZmb.js +1 -0
  64. package/dist/edge-D2Tk5tmg.js +1 -0
  65. package/dist/elixir-B-l3Nz-G.js +1 -0
  66. package/dist/elm-Bqm7aRpV.js +1 -0
  67. package/dist/emacs-lisp-BSvpfolf.js +1 -0
  68. package/dist/erb-CwBHxfFV.js +1 -0
  69. package/dist/erlang-B0PtHWg2.js +1 -0
  70. package/dist/fennel-CdN4E9Xo.js +1 -0
  71. package/dist/fish-XrbYjeRx.js +1 -0
  72. package/dist/fluent-zYsEgElv.js +1 -0
  73. package/dist/fortran-fixed-form-CPwX6okW.js +1 -0
  74. package/dist/fortran-free-form-B6Kk9658.js +1 -0
  75. package/dist/fsharp-CbMfVCMr.js +1 -0
  76. package/dist/gdresource-CdRUpBQO.js +1 -0
  77. package/dist/gdscript-CYXv_Ac9.js +1 -0
  78. package/dist/gdshader-CtiaGYI5.js +1 -0
  79. package/dist/genie-C-gOIth7.js +1 -0
  80. package/dist/gherkin-uGsOfG-k.js +1 -0
  81. package/dist/git-commit-CWQvkRNX.js +1 -0
  82. package/dist/git-rebase-BZ0YVJ-O.js +1 -0
  83. package/dist/github-dark-DCm4kydX.js +1 -0
  84. package/dist/github-dark-dimmed-CsRUrOJA.js +1 -0
  85. package/dist/github-from-css-CTRi6tFC.js +1 -0
  86. package/dist/github-light-B2ofRYMU.js +1 -0
  87. package/dist/gleam-C9ZZ3Vp2.js +1 -0
  88. package/dist/glimmer-js-Cuwfndkm.js +1 -0
  89. package/dist/glimmer-ts-D8nR8_k2.js +1 -0
  90. package/dist/glsl-qc_rLvzz.js +1 -0
  91. package/dist/gnuplot-BgHAcd--.js +1 -0
  92. package/dist/go-Dm8VBUM2.js +1 -0
  93. package/dist/graphql-CRmnB6D5.js +1 -0
  94. package/dist/groovy-DJcw8dX4.js +1 -0
  95. package/dist/hack-DYOVz52F.js +1 -0
  96. package/dist/haml-j8Vx_P4q.js +1 -0
  97. package/dist/handlebars-Qz3hgrPG.js +1 -0
  98. package/dist/haskell-DE3vVmXn.js +1 -0
  99. package/dist/haxe-DpuNPTTj.js +1 -0
  100. package/dist/hcl-BvV3VZ9s.js +1 -0
  101. package/dist/hjson-CsTZvU0B.js +1 -0
  102. package/dist/hlsl-BLZumTGu.js +1 -0
  103. package/dist/html-BJsWDmIe.js +1 -0
  104. package/dist/html-derivative-zDWJvwg5.js +1 -0
  105. package/dist/http-BiMppEBd.js +1 -0
  106. package/dist/hxml-DG2jWwyK.js +1 -0
  107. package/dist/hy-C9zVJlJf.js +1 -0
  108. package/dist/imba-DGD1mm8E.js +1 -0
  109. package/dist/index-TKJ66_wI.js +1 -0
  110. package/dist/index.css +135 -0
  111. package/dist/index.d.ts +2 -0
  112. package/dist/index.js +1 -0
  113. package/dist/ini-CU7wgrgh.js +1 -0
  114. package/dist/java-DyOZhX5L.js +1 -0
  115. package/dist/javascript-C0AWZ4eK.js +1 -0
  116. package/dist/jinja-Lc82IfGI.js +1 -0
  117. package/dist/jison-DT7Oqeqm.js +1 -0
  118. package/dist/json-Zoq3rK60.js +1 -0
  119. package/dist/json5-BOFh3mt2.js +1 -0
  120. package/dist/jsonc-CPutX9W5.js +1 -0
  121. package/dist/jsonl-xWfKSBhV.js +1 -0
  122. package/dist/jsonnet-UcnvaLwK.js +1 -0
  123. package/dist/jssm-BRT8_Uqd.js +1 -0
  124. package/dist/jsx-B4WNxrCK.js +1 -0
  125. package/dist/julia-i7_3XSV_.js +1 -0
  126. package/dist/kotlin-B_s0KNy5.js +1 -0
  127. package/dist/kusto-CDr4m-xT.js +1 -0
  128. package/dist/latex-BNB6MZrj.js +1 -0
  129. package/dist/layouts.d.ts +19 -0
  130. package/dist/layouts.js +1 -0
  131. package/dist/lean-2dBp1asm.js +1 -0
  132. package/dist/less-CfPPFFsV.js +1 -0
  133. package/dist/light-plus-glPHycm5.js +1 -0
  134. package/dist/liquid-Bj1DN66U.js +1 -0
  135. package/dist/log-CKSz9t_o.js +1 -0
  136. package/dist/logo-D3UPVeLP.js +1 -0
  137. package/dist/lua-C1EFGxtA.js +1 -0
  138. package/dist/luau-Dvb2LLsw.js +1 -0
  139. package/dist/make-TqphZF-7.js +1 -0
  140. package/dist/markdown-yX62Igf3.js +1 -0
  141. package/dist/marko-LH6NoP97.js +1 -0
  142. package/dist/material-darker-D6whucX3.js +1 -0
  143. package/dist/material-default-DYqS7fqa.js +1 -0
  144. package/dist/material-from-css-DlWo_ZDV.js +1 -0
  145. package/dist/material-lighter-CYQaMsGh.js +1 -0
  146. package/dist/material-ocean-Dl_zLA-F.js +1 -0
  147. package/dist/material-palenight-Cd4X9kqy.js +1 -0
  148. package/dist/matlab-Dy9K5GW8.js +1 -0
  149. package/dist/mdc-DhAfBnnn.js +1 -0
  150. package/dist/mdx-tnT2uTqR.js +1 -0
  151. package/dist/mermaid-aEaCok9S.js +1 -0
  152. package/dist/min-dark-CpapYCVz.js +1 -0
  153. package/dist/min-light-plRN0zW-.js +1 -0
  154. package/dist/mojo-BanaVmFY.js +1 -0
  155. package/dist/monokai-Cs2_BG4b.js +1 -0
  156. package/dist/move-B_kaWhAV.js +1 -0
  157. package/dist/narrat-6tChrAmV.js +1 -0
  158. package/dist/nextflow-BYB6CU6V.js +1 -0
  159. package/dist/nginx-Clr7XfzW.js +1 -0
  160. package/dist/nim-gLesixmv.js +1 -0
  161. package/dist/nix-DCgUXh-o.js +1 -0
  162. package/dist/nord-BHSE8FbR.js +1 -0
  163. package/dist/nushell-DDKGkuZY.js +1 -0
  164. package/dist/objective-c-BsQdhSk0.js +1 -0
  165. package/dist/objective-cpp-B-VZlBXW.js +1 -0
  166. package/dist/ocaml-B19L2xxl.js +1 -0
  167. package/dist/one-dark-pro-AWPQgJbJ.js +1 -0
  168. package/dist/pages.d.ts +30 -0
  169. package/dist/pages.js +1 -0
  170. package/dist/pascal-B0kVBVTU.js +1 -0
  171. package/dist/perl-Bs2cXIO6.js +1 -0
  172. package/dist/php-BgaH_AHK.js +1 -0
  173. package/dist/plsql-CPY7hT9n.js +1 -0
  174. package/dist/po-BszTsnLZ.js +1 -0
  175. package/dist/poimandres-CZF4JUv5.js +1 -0
  176. package/dist/postcss-DQ0frX96.js +1 -0
  177. package/dist/powerquery-BitONm6p.js +1 -0
  178. package/dist/powershell-B_lVHVgu.js +1 -0
  179. package/dist/prisma-CqkE3olT.js +1 -0
  180. package/dist/prolog-Bpuon3aK.js +1 -0
  181. package/dist/proto-C349dup0.js +1 -0
  182. package/dist/pug-Bbf3g_hT.js +1 -0
  183. package/dist/puppet-qDtDc0so.js +1 -0
  184. package/dist/purescript-C03CHyrT.js +1 -0
  185. package/dist/python-D5e4BtVB.js +1 -0
  186. package/dist/qml-LVCeHqxw.js +1 -0
  187. package/dist/qmldir-BEg8Q-XX.js +1 -0
  188. package/dist/qss-vq-U9k0N.js +1 -0
  189. package/dist/r-DnCIdoUu.js +1 -0
  190. package/dist/racket-BQt8mf2o.js +1 -0
  191. package/dist/raku-ChTHpuBS.js +1 -0
  192. package/dist/razor-CjFZSXD2.js +1 -0
  193. package/dist/reg-12gGsscy.js +1 -0
  194. package/dist/regexp-zLCCZKTi.js +1 -0
  195. package/dist/rel-aZ4oe34Q.js +1 -0
  196. package/dist/riscv-BA9R8KI2.js +1 -0
  197. package/dist/rose-pine-8QECO0Ox.js +1 -0
  198. package/dist/rose-pine-dawn-DT77ObZh.js +1 -0
  199. package/dist/rose-pine-moon-D3-I8ETF.js +1 -0
  200. package/dist/rst-DFKlxnrd.js +1 -0
  201. package/dist/ruby-BypI_hk5.js +1 -0
  202. package/dist/rust-tE6tRkqD.js +1 -0
  203. package/dist/sas-D1sMUJql.js +1 -0
  204. package/dist/sass-DBEOLVv3.js +1 -0
  205. package/dist/scala-DUzir4os.js +1 -0
  206. package/dist/scheme-dsSqVZz3.js +1 -0
  207. package/dist/scss-B0kJw1gM.js +1 -0
  208. package/dist/shaderlab-Cd8Cbryn.js +1 -0
  209. package/dist/shellscript-BL-Ihj2z.js +1 -0
  210. package/dist/shellsession-C5KJPcFG.js +1 -0
  211. package/dist/slack-dark-JbsLGggd.js +1 -0
  212. package/dist/slack-ochin-hTeCADjA.js +1 -0
  213. package/dist/smalltalk-DQ23HuGh.js +1 -0
  214. package/dist/solarized-dark-D2bQRcX7.js +1 -0
  215. package/dist/solarized-light-6xrOKoxI.js +1 -0
  216. package/dist/solidity-DUCwohjn.js +1 -0
  217. package/dist/soy-Cy4pRjbu.js +1 -0
  218. package/dist/sparql-D7gNTkUq.js +1 -0
  219. package/dist/splunk-Dvl5Xm98.js +1 -0
  220. package/dist/sql-BfoT44Al.js +1 -0
  221. package/dist/ssh-config-C-ZFySPN.js +1 -0
  222. package/dist/stata-Dpw9jvge.js +1 -0
  223. package/dist/stylus-mJ9_5M6n.js +1 -0
  224. package/dist/svelte-DD5dtnEi.js +1 -0
  225. package/dist/swift-DDernUpH.js +1 -0
  226. package/dist/system-verilog-DeXSd9Py.js +1 -0
  227. package/dist/systemd-NetTuLPL.js +1 -0
  228. package/dist/tasl-BCm9L3tI.js +1 -0
  229. package/dist/tcl-DmWVgxCm.js +1 -0
  230. package/dist/templ-B7wt_K-d.js +1 -0
  231. package/dist/terraform-DYIIsq8p.js +1 -0
  232. package/dist/tex-DFj0qpOD.js +1 -0
  233. package/dist/toml-CFu3vY0Q.js +1 -0
  234. package/dist/ts-tags-BvMEeGTJ.js +1 -0
  235. package/dist/tslib.es6-C3PNVQlC.js +1 -0
  236. package/dist/tsv-DnenRF8k.js +1 -0
  237. package/dist/tsx-DooqfEr1.js +1 -0
  238. package/dist/turtle-DKlxyehf.js +1 -0
  239. package/dist/twig-DpQc8FUF.js +1 -0
  240. package/dist/txt-C4tHEtDr.js +1 -0
  241. package/dist/typescript-DtE5sB_4.js +1 -0
  242. package/dist/typespec-B69vp3jc.js +1 -0
  243. package/dist/typst-BzEngGMo.js +1 -0
  244. package/dist/v-Dy6tTX8K.js +1 -0
  245. package/dist/vala-DQnmDtkE.js +1 -0
  246. package/dist/vb-CqTjXY4K.js +1 -0
  247. package/dist/verilog-D6Zfe00a.js +1 -0
  248. package/dist/vhdl-Dxu0BOr9.js +1 -0
  249. package/dist/views.d.ts +17 -0
  250. package/dist/views.js +1 -0
  251. package/dist/viml-eXtfIM-m.js +1 -0
  252. package/dist/vue-D3vey6Cu.js +1 -0
  253. package/dist/vue-html-DyaqvCGV.js +1 -0
  254. package/dist/vyper-C6AULW8C.js +1 -0
  255. package/dist/wasm-Cl39COlm.js +1 -0
  256. package/dist/wenyan-DJGdsiXE.js +1 -0
  257. package/dist/wgsl-CDhIPMwJ.js +1 -0
  258. package/dist/wikitext-D05PpJ8X.js +1 -0
  259. package/dist/wolfram-JgWnd2g7.js +1 -0
  260. package/dist/writer.d.ts +157 -0
  261. package/dist/writer.js +1 -0
  262. package/dist/xml-Cc1Sy-d4.js +1 -0
  263. package/dist/xsl-CEYTrbD0.js +1 -0
  264. package/dist/yaml-NvTdC05o.js +1 -0
  265. package/dist/zenscript-De0mU_BW.js +1 -0
  266. package/dist/zig-D9TJVGyp.js +1 -0
  267. package/index.ts +1 -0
  268. package/layouts.ts +1 -0
  269. package/package.json +58 -0
  270. package/postcss.config.cjs +5 -0
  271. package/rollup.config.js +149 -0
  272. package/src/brand/Button/Button.tsx +48 -0
  273. package/src/brand/Button/index.ts +7 -0
  274. package/src/brand/CTABanner/CTABanner.tsx +127 -0
  275. package/src/brand/CTABanner/index.ts +8 -0
  276. package/src/brand/Footer/Footer.tsx +36 -0
  277. package/src/brand/Footer/index.ts +3 -0
  278. package/src/brand/index.ts +5 -0
  279. package/src/coder/CodeCopy/CodeCopy.style.tsx +21 -0
  280. package/src/coder/CodeCopy/CodeCopy.tsx +32 -0
  281. package/src/coder/CodeCopy/index.ts +7 -0
  282. package/src/coder/CodeSample/CodeSample.styles.tsx +137 -0
  283. package/src/coder/CodeSample/CodeSample.tsx +150 -0
  284. package/src/coder/CodeSample/default-theme.ts +266 -0
  285. package/src/coder/CodeSample/index.ts +12 -0
  286. package/src/coder/CodeSample/withLocalStored.tsx +50 -0
  287. package/src/coder/README.md +1 -0
  288. package/src/coder/index.ts +3 -0
  289. package/src/content/Anchor/Anchor.tsx +63 -0
  290. package/src/content/Anchor/index.tsx +3 -0
  291. package/src/content/Content/Content.tsx +20 -0
  292. package/src/content/Content/index.tsx +3 -0
  293. package/src/content/Content.tsx +137 -0
  294. package/src/content/Subtitle/Subtitle.tsx +21 -0
  295. package/src/content/Subtitle/index.tsx +3 -0
  296. package/src/content/index.ts +3 -0
  297. package/src/layouts/Layout.styles.tsx +151 -0
  298. package/src/layouts/Layout.tsx +121 -0
  299. package/src/layouts/index.ts +7 -0
  300. package/src/pages/HomePage/HomePage.tsx +93 -0
  301. package/src/pages/HomePage/index.ts +5 -0
  302. package/src/pages/HomePage/types.ts +41 -0
  303. package/src/pages/index.ts +1 -0
  304. package/src/views/HomeView/HomeView.tsx +74 -0
  305. package/src/views/HomeView/index.ts +3 -0
  306. package/src/views/index.ts +1 -0
  307. package/src/writer/Badge/Badge.styles.tsx +29 -0
  308. package/src/writer/Badge/Badge.tsx +28 -0
  309. package/src/writer/Badge/index.ts +7 -0
  310. package/src/writer/Blockquote/Blockquote.styles.tsx +10 -0
  311. package/src/writer/Blockquote/Blockquote.tsx +13 -0
  312. package/src/writer/Blockquote/index.ts +7 -0
  313. package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +28 -0
  314. package/src/writer/Breadcrumbs/Breadcrumbs.tsx +46 -0
  315. package/src/writer/Breadcrumbs/index.ts +7 -0
  316. package/src/writer/Callout/Callout.styles.tsx +50 -0
  317. package/src/writer/Callout/Callout.tsx +37 -0
  318. package/src/writer/Callout/index.tsx +3 -0
  319. package/src/writer/Code/Code.styles.tsx +17 -0
  320. package/src/writer/Code/Code.tsx +13 -0
  321. package/src/writer/Code/index.ts +3 -0
  322. package/src/writer/Details/Details.styles.tsx +76 -0
  323. package/src/writer/Details/Details.tsx +122 -0
  324. package/src/writer/Details/index.ts +3 -0
  325. package/src/writer/GuideCard/GuideCard.styles.tsx +115 -0
  326. package/src/writer/GuideCard/GuideCard.tsx +81 -0
  327. package/src/writer/GuideCard/index.ts +1 -0
  328. package/src/writer/Heading/Heading.styles.tsx +73 -0
  329. package/src/writer/Heading/Heading.tsx +53 -0
  330. package/src/writer/Heading/index.ts +7 -0
  331. package/src/writer/Hr/Hr.styles.tsx +7 -0
  332. package/src/writer/Hr/Hr.tsx +13 -0
  333. package/src/writer/Hr/index.ts +3 -0
  334. package/src/writer/Icon/index.tsx +112 -0
  335. package/src/writer/NavLinks/NavLinks.styles.ts +32 -0
  336. package/src/writer/NavLinks/NavLinks.tsx +48 -0
  337. package/src/writer/NavLinks/index.ts +7 -0
  338. package/src/writer/Pre/Pre.styles.tsx +13 -0
  339. package/src/writer/Pre/Pre.tsx +13 -0
  340. package/src/writer/Pre/index.ts +3 -0
  341. package/src/writer/README.md +1 -0
  342. package/src/writer/Steps/Steps.styles.tsx +36 -0
  343. package/src/writer/Steps/Steps.tsx +24 -0
  344. package/src/writer/Steps/index.ts +5 -0
  345. package/src/writer/Table/Table.styles.tsx +39 -0
  346. package/src/writer/Table/Table.tsx +45 -0
  347. package/src/writer/Table/index.ts +10 -0
  348. package/src/writer/Tabs/Tabs.styles.tsx +77 -0
  349. package/src/writer/Tabs/Tabs.tsx +104 -0
  350. package/src/writer/Tabs/index.ts +7 -0
  351. package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +45 -0
  352. package/src/writer/UnderlineNav/UnderlineNav.tsx +38 -0
  353. package/src/writer/UnderlineNav/index.ts +1 -0
  354. package/src/writer/index.ts +32 -0
  355. package/tsconfig.json +41 -0
  356. package/writer.ts +1 -0
@@ -0,0 +1,39 @@
1
+ import {css} from "@linaria/core";
2
+
3
+ const colors = {
4
+ primary: "#D1D5DB"
5
+ }
6
+
7
+ export const $table = {
8
+ host: css`
9
+ display: block;
10
+ overflow-x: scroll;
11
+
12
+ border-collapse: collapse;
13
+ border-radius: 3px;
14
+ `,
15
+ th: css`
16
+ padding: 0.5rem 1rem;
17
+ margin: 0;
18
+
19
+ font-weight: 600;
20
+ border-width: 1px;
21
+ border-color: ${colors.primary};
22
+ background: rgba(234, 238, 242, 0.5);
23
+ `,
24
+ tr: css`
25
+ padding: 0;
26
+ margin: 0;
27
+ border-top-width: 1px;
28
+ border-color: ${colors.primary};
29
+ `,
30
+ td: css`
31
+ padding: 0.5rem 1rem;
32
+ margin: 0;
33
+
34
+ border-width: 1px;
35
+ border-color: ${colors.primary};
36
+ `
37
+ }
38
+
39
+
@@ -0,0 +1,45 @@
1
+ import React from "react"
2
+
3
+ import {$table} from "./Table.styles";
4
+
5
+ export interface TableProps {
6
+ children: React.ReactNode;
7
+ }
8
+
9
+ export function Table({children}: TableProps) {
10
+ return <table className={$table.host}>
11
+ {children}
12
+ </table>
13
+ }
14
+
15
+ export interface TableThProps {
16
+ children: React.ReactNode;
17
+ }
18
+
19
+ Table.Th = function TableTh({children}: TableThProps) {
20
+ return <th className={$table.th}>
21
+ {children}
22
+ </th>
23
+ }
24
+
25
+ export interface TableTrProps {
26
+ children: React.ReactNode;
27
+ }
28
+
29
+ Table.Tr = function TableTr({children}: TableTrProps) {
30
+ return <tr className={$table.tr}>
31
+ {children}
32
+ </tr>
33
+
34
+ }
35
+
36
+ export interface TableTdProps {
37
+ children: React.ReactNode;
38
+ }
39
+
40
+ Table.Td = function TableTd({children}: TableTdProps) {
41
+ return <td className={$table.td}>
42
+ {children}
43
+ </td>
44
+
45
+ }
@@ -0,0 +1,10 @@
1
+ export {
2
+ Table
3
+ } from "./Table"
4
+
5
+ export type {
6
+ TableProps,
7
+ TableThProps,
8
+ TableTrProps,
9
+ TableTdProps
10
+ } from "./Table"
@@ -0,0 +1,77 @@
1
+ import {css} from "@linaria/core";
2
+
3
+ export const $sample = {
4
+ host: css`
5
+ position: relative;
6
+ max-width: 100%;
7
+ `,
8
+ buttons: css`
9
+ display: flex;
10
+ align-items: center;
11
+ `,
12
+ content: css`
13
+ margin-top: 16px;
14
+ `
15
+ }
16
+
17
+ export const $arrow = {
18
+ host: css`
19
+ padding: 8px;
20
+ background-color: #ffffff;
21
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
22
+ `,
23
+ icon: css`
24
+ width: 16px;
25
+ height: 16px;
26
+ `
27
+ }
28
+
29
+ export const $scroller = {
30
+ host: css`
31
+ overflow-x: auto;
32
+ flex-grow: 1;
33
+ `,
34
+ container: css`
35
+ display: inline-flex;
36
+ gap: 4px;
37
+
38
+ border-radius: 8px;
39
+ background-color: #F3F4F6;
40
+
41
+ padding: 4px;
42
+ margin-left: 4px;
43
+ `
44
+ }
45
+
46
+ export const $button = {
47
+ host: css`
48
+ padding: 0.5rem 1rem;
49
+
50
+ border-radius: 0.375rem;
51
+ font-size: 0.875rem;
52
+ line-height: 1.25rem;
53
+ font-weight: 500;
54
+ white-space: nowrap;
55
+
56
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
57
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
58
+ transition-duration: 300ms;
59
+
60
+ color: #6B7280;
61
+
62
+ &:hover {
63
+ color: #111827;
64
+ }
65
+
66
+ &[data-state="active"] {
67
+ color: #111827;
68
+ background-color: #ffffff;
69
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
70
+ }
71
+ `,
72
+ $$active: css`
73
+ color: #111827;
74
+ background-color: #ffffff;
75
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
76
+ `
77
+ }
@@ -0,0 +1,104 @@
1
+ import React, {useState, useRef, useEffect} from 'react'
2
+ import * as RadixTabs from "@radix-ui/react-tabs"
3
+ import {ChevronLeft, ChevronRight} from "lucide-react"
4
+
5
+ import {
6
+ $sample,
7
+ $arrow,
8
+ $scroller,
9
+ $button
10
+ } from "./Tabs.styles";
11
+
12
+ export interface TabsProps {
13
+ children: React.ReactNode;
14
+ items: string[];
15
+ tabIndex?: number;
16
+ }
17
+
18
+ export function Tabs({children, items, tabIndex}: TabsProps) {
19
+ const [showLeftArrow, setShowLeftArrow] = useState(false)
20
+ const [showRightArrow, setShowRightArrow] = useState(false)
21
+ const scrollContainerRef = useRef<HTMLDivElement>(null)
22
+
23
+ const [value, setActiveTab] = useState(items[tabIndex || 0] || "")
24
+
25
+ const handleScroll = () => {
26
+ if (scrollContainerRef.current) {
27
+ const {scrollLeft, scrollWidth, clientWidth} = scrollContainerRef.current
28
+ setShowLeftArrow(scrollLeft > 0)
29
+ setShowRightArrow(scrollLeft < scrollWidth - clientWidth)
30
+ }
31
+ }
32
+
33
+ useEffect(() => {
34
+ handleScroll()
35
+ window.addEventListener('resize', handleScroll)
36
+ return () => window.removeEventListener('resize', handleScroll)
37
+ }, [])
38
+
39
+ const scroll = (direction: 'left' | 'right') => {
40
+ if (scrollContainerRef.current) {
41
+ const scrollAmount = direction === 'left' ? -200 : 200
42
+ scrollContainerRef.current.scrollBy({left: scrollAmount, behavior: 'smooth'})
43
+ }
44
+ }
45
+
46
+ return (
47
+ <RadixTabs.Root asChild value={value} onValueChange={setActiveTab}>
48
+ <div className={$sample.host}>
49
+ <div className={$sample.buttons}>
50
+ {showLeftArrow && (
51
+ <button
52
+ onClick={() => scroll('left')}
53
+ className={$arrow.host}
54
+ >
55
+ <ChevronLeft className={$arrow.icon}/>
56
+ </button>
57
+ )}
58
+
59
+ <div
60
+ ref={scrollContainerRef}
61
+ onScroll={handleScroll}
62
+ className={$scroller.host}
63
+ >
64
+ <div className={$scroller.container}>
65
+ <RadixTabs.List>
66
+ {items.map((item, index) => <TabsItem key={index} value={item}>
67
+ {item}
68
+ </TabsItem>
69
+ )}
70
+ </RadixTabs.List>
71
+ </div>
72
+ </div>
73
+
74
+ {showRightArrow && (
75
+ <button
76
+ onClick={() => scroll('right')}
77
+ className={$arrow.host}
78
+ >
79
+ <ChevronRight className={$arrow.icon}/>
80
+ </button>
81
+ )}
82
+ </div>
83
+
84
+ <div className={$sample.content}>
85
+ {children}
86
+ </div>
87
+ </div>
88
+ </RadixTabs.Root>
89
+ )
90
+ }
91
+
92
+ function TabsItem({children, value}) {
93
+ return <RadixTabs.Trigger asChild value={value}>
94
+ <button className={`${$button.host}`}>
95
+ {children}
96
+ </button>
97
+ </RadixTabs.Trigger>
98
+ }
99
+
100
+ Tabs.Content = function TabsContent({children, value}) {
101
+ return <RadixTabs.Content asChild value={value}>
102
+ {children}
103
+ </RadixTabs.Content>
104
+ }
@@ -0,0 +1,7 @@
1
+ export {
2
+ Tabs,
3
+ } from "./Tabs"
4
+
5
+ export type {
6
+ TabsProps
7
+ } from "./Tabs"
@@ -0,0 +1,45 @@
1
+ import {css} from "@linaria/core"
2
+
3
+ export const $nav = {
4
+ host: css`
5
+ align-items: center;
6
+ display: flex;
7
+
8
+ height: 42px;
9
+
10
+ background-color: #fff;
11
+ border-bottom: 1px solid hsl(212, 15%, calc(96% - 12% * 1));
12
+
13
+ z-index: 99;
14
+ `,
15
+ ul: css`
16
+ display: flex;
17
+ gap: 10px;
18
+
19
+ height: 100%;
20
+ color: hsl(212, 15%, calc(96% - 12% * 4));
21
+
22
+ list-style: none;
23
+ padding: 0;
24
+ white-space: nowrap;
25
+ `,
26
+ item: css`
27
+ height: 100%;
28
+
29
+ &[data-state="active"] { // TODO: in the future it should not be possible
30
+ a {
31
+ border-bottom-color: rgb(112, 81, 212);
32
+ }
33
+ }
34
+ `,
35
+ itemLink: css`
36
+ display: inline-flex;
37
+ border-bottom: 3px solid transparent;
38
+ text-decoration: none;
39
+
40
+ height: 100%;
41
+ padding: 10px;
42
+ `,
43
+ itemLink$$active: css`
44
+ `
45
+ }
@@ -0,0 +1,38 @@
1
+ import React from "react"
2
+ import * as RadixTabs from "@radix-ui/react-tabs";
3
+
4
+ import {$nav} from "./UnderlineNav.styles"
5
+
6
+ export interface TabsProps {
7
+ children: React.ReactNode
8
+ value: string
9
+ onChange: (value: string) => void
10
+ }
11
+
12
+ export function UnderlineNav({children, value, onChange}: TabsProps) {
13
+ return <RadixTabs.Root asChild value={value} onValueChange={onChange}>
14
+ <nav className={$nav.host}>
15
+ <RadixTabs.List asChild>
16
+ <ul className={$nav.ul}>
17
+ {children}
18
+ </ul>
19
+ </RadixTabs.List>
20
+ </nav>
21
+ </RadixTabs.Root>
22
+ }
23
+
24
+ export interface UnderlineNavItemProps {
25
+ children: React.ReactNode
26
+ value: string
27
+ href?: string
28
+ }
29
+
30
+ UnderlineNav.Item = function UnderlineNavItem({children, value, href}: UnderlineNavItemProps) {
31
+ return <RadixTabs.Trigger asChild value={value}>
32
+ <li className={$nav.item}>
33
+ <a href={href} className={`${$nav.itemLink}`}>
34
+ {children}
35
+ </a>
36
+ </li>
37
+ </RadixTabs.Trigger>
38
+ }
@@ -0,0 +1 @@
1
+ export {UnderlineNav} from "./UnderlineNav"
@@ -0,0 +1,32 @@
1
+ export * from "./Badge"
2
+
3
+ export * from "./Blockquote"
4
+
5
+ export * from "./Breadcrumbs"
6
+
7
+ export * from "./Callout"
8
+
9
+ export * from "./Code"
10
+
11
+ export * from "./Details"
12
+
13
+ export * from "./GuideCard"
14
+
15
+ export * from "./Heading"
16
+
17
+ export * from "./Hr"
18
+
19
+ export * from "./Icon"
20
+
21
+ export * from "./NavLinks"
22
+
23
+ export * from "./Pre"
24
+
25
+ export * from "./Steps"
26
+
27
+ export * from "./Table"
28
+
29
+ export * from "./Tabs"
30
+
31
+ export * from "./UnderlineNav"
32
+
package/tsconfig.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "esModuleInterop": true,
5
+ "moduleResolution": "bundler", // Update this line
6
+ "target": "ES6",
7
+ "lib": [
8
+ "dom",
9
+ "dom.iterable",
10
+ "esnext"
11
+ ],
12
+ "allowJs": true,
13
+ "skipLibCheck": true,
14
+ "strict": false,
15
+ "noEmit": true,
16
+ "incremental": false,
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "jsx": "react",
20
+ "plugins": [
21
+ {
22
+ "name": "next"
23
+ }
24
+ ],
25
+ "strictNullChecks": true,
26
+ "allowImportingTsExtensions": true,
27
+ "baseUrl": ".",
28
+ "paths": {
29
+ "*": ["*", "*.ts"]
30
+ }
31
+ },
32
+ "include": [
33
+ "next-env.d.ts",
34
+ "**/*.ts",
35
+ "**/*.tsx",
36
+ ".next/types/**/*.ts"
37
+ ],
38
+ "exclude": [
39
+ "node_modules"
40
+ ]
41
+ }
package/writer.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/writer"