@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.
- package/README.md +3 -0
- package/coder.ts +1 -0
- package/content.ts +3 -0
- package/dist/CTABanner-CWX9isVG.js +1 -0
- package/dist/CodeSample-C5YaEpAi.js +1 -0
- package/dist/HomeView-CnAj-VYl.js +1 -0
- package/dist/UnderlineNav-C8onw9Na.js +1 -0
- package/dist/_rollupPluginBabelHelpers-DfQAiTCw.js +1 -0
- package/dist/abap-kIO_7z1o.js +1 -0
- package/dist/actionscript-3-DiaraCXE.js +1 -0
- package/dist/ada-aNFKX2pl.js +1 -0
- package/dist/angular-html-y0qIEhS2.js +1 -0
- package/dist/angular-ts-Bn_6f37o.js +1 -0
- package/dist/apache-Cx7e0H64.js +1 -0
- package/dist/apex-CdSCJjuL.js +1 -0
- package/dist/apl-BDzWBUim.js +1 -0
- package/dist/applescript-CJFkzk5i.js +1 -0
- package/dist/ara-BC9R9M5c.js +1 -0
- package/dist/asciidoc-lqQQs4M0.js +1 -0
- package/dist/asm-QQeI-gwp.js +1 -0
- package/dist/astro-BPstp8LF.js +1 -0
- package/dist/awk-Cxb7Sqvk.js +1 -0
- package/dist/ballerina-G8TyVc6O.js +1 -0
- package/dist/bat-UDEmXz-g.js +1 -0
- package/dist/beancount-BWg86rhE.js +1 -0
- package/dist/berry-5E5uGOYg.js +1 -0
- package/dist/bibtex-CZn_FFnb.js +1 -0
- package/dist/bicep-D_G0XT5J.js +1 -0
- package/dist/blade-7dxmctkK.js +1 -0
- package/dist/brand.d.ts +30 -0
- package/dist/brand.js +1 -0
- package/dist/c-CrEz-oYf.js +1 -0
- package/dist/cadence-BulSIR1A.js +1 -0
- package/dist/clarity-m2OigCMT.js +1 -0
- package/dist/clojure-Bpes2rhL.js +1 -0
- package/dist/cmake-C4Tr1SQC.js +1 -0
- package/dist/cobol-Dp8xGW1S.js +1 -0
- package/dist/codeowners-Bs3mpoau.js +1 -0
- package/dist/codeql-CvQzaisq.js +1 -0
- package/dist/coder.d.ts +19 -0
- package/dist/coder.js +1 -0
- package/dist/coffee-DOjtyJj_.js +1 -0
- package/dist/common-lisp-DGVR8DFi.js +1 -0
- package/dist/content.d.ts +225 -0
- package/dist/content.js +1 -0
- package/dist/cpp-BUT7C4Bo.js +1 -0
- package/dist/crystal-BJh9OJ1_.js +1 -0
- package/dist/csharp-BhZuAD8H.js +1 -0
- package/dist/css-8_G4_UCW.js +1 -0
- package/dist/csv-DLRyYdMG.js +1 -0
- package/dist/cue-DAgMCCsT.js +1 -0
- package/dist/cypher-CtSiSKRh.js +1 -0
- package/dist/d-feZJOTtr.js +1 -0
- package/dist/dark-plus-Dcn2h2HL.js +1 -0
- package/dist/dart-CNOu4aud.js +1 -0
- package/dist/dax-Dkp1Uj6t.js +1 -0
- package/dist/desktop-CAGQzotA.js +1 -0
- package/dist/diff-D6yk3_ZG.js +1 -0
- package/dist/docker-BdTrQq0b.js +1 -0
- package/dist/dotenv-BeHGAMs7.js +1 -0
- package/dist/dracula-BUaMrXr0.js +1 -0
- package/dist/dracula-soft-CBx6n76m.js +1 -0
- package/dist/dream-maker-BU0sZZmb.js +1 -0
- package/dist/edge-D2Tk5tmg.js +1 -0
- package/dist/elixir-B-l3Nz-G.js +1 -0
- package/dist/elm-Bqm7aRpV.js +1 -0
- package/dist/emacs-lisp-BSvpfolf.js +1 -0
- package/dist/erb-CwBHxfFV.js +1 -0
- package/dist/erlang-B0PtHWg2.js +1 -0
- package/dist/fennel-CdN4E9Xo.js +1 -0
- package/dist/fish-XrbYjeRx.js +1 -0
- package/dist/fluent-zYsEgElv.js +1 -0
- package/dist/fortran-fixed-form-CPwX6okW.js +1 -0
- package/dist/fortran-free-form-B6Kk9658.js +1 -0
- package/dist/fsharp-CbMfVCMr.js +1 -0
- package/dist/gdresource-CdRUpBQO.js +1 -0
- package/dist/gdscript-CYXv_Ac9.js +1 -0
- package/dist/gdshader-CtiaGYI5.js +1 -0
- package/dist/genie-C-gOIth7.js +1 -0
- package/dist/gherkin-uGsOfG-k.js +1 -0
- package/dist/git-commit-CWQvkRNX.js +1 -0
- package/dist/git-rebase-BZ0YVJ-O.js +1 -0
- package/dist/github-dark-DCm4kydX.js +1 -0
- package/dist/github-dark-dimmed-CsRUrOJA.js +1 -0
- package/dist/github-from-css-CTRi6tFC.js +1 -0
- package/dist/github-light-B2ofRYMU.js +1 -0
- package/dist/gleam-C9ZZ3Vp2.js +1 -0
- package/dist/glimmer-js-Cuwfndkm.js +1 -0
- package/dist/glimmer-ts-D8nR8_k2.js +1 -0
- package/dist/glsl-qc_rLvzz.js +1 -0
- package/dist/gnuplot-BgHAcd--.js +1 -0
- package/dist/go-Dm8VBUM2.js +1 -0
- package/dist/graphql-CRmnB6D5.js +1 -0
- package/dist/groovy-DJcw8dX4.js +1 -0
- package/dist/hack-DYOVz52F.js +1 -0
- package/dist/haml-j8Vx_P4q.js +1 -0
- package/dist/handlebars-Qz3hgrPG.js +1 -0
- package/dist/haskell-DE3vVmXn.js +1 -0
- package/dist/haxe-DpuNPTTj.js +1 -0
- package/dist/hcl-BvV3VZ9s.js +1 -0
- package/dist/hjson-CsTZvU0B.js +1 -0
- package/dist/hlsl-BLZumTGu.js +1 -0
- package/dist/html-BJsWDmIe.js +1 -0
- package/dist/html-derivative-zDWJvwg5.js +1 -0
- package/dist/http-BiMppEBd.js +1 -0
- package/dist/hxml-DG2jWwyK.js +1 -0
- package/dist/hy-C9zVJlJf.js +1 -0
- package/dist/imba-DGD1mm8E.js +1 -0
- package/dist/index-TKJ66_wI.js +1 -0
- package/dist/index.css +135 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/ini-CU7wgrgh.js +1 -0
- package/dist/java-DyOZhX5L.js +1 -0
- package/dist/javascript-C0AWZ4eK.js +1 -0
- package/dist/jinja-Lc82IfGI.js +1 -0
- package/dist/jison-DT7Oqeqm.js +1 -0
- package/dist/json-Zoq3rK60.js +1 -0
- package/dist/json5-BOFh3mt2.js +1 -0
- package/dist/jsonc-CPutX9W5.js +1 -0
- package/dist/jsonl-xWfKSBhV.js +1 -0
- package/dist/jsonnet-UcnvaLwK.js +1 -0
- package/dist/jssm-BRT8_Uqd.js +1 -0
- package/dist/jsx-B4WNxrCK.js +1 -0
- package/dist/julia-i7_3XSV_.js +1 -0
- package/dist/kotlin-B_s0KNy5.js +1 -0
- package/dist/kusto-CDr4m-xT.js +1 -0
- package/dist/latex-BNB6MZrj.js +1 -0
- package/dist/layouts.d.ts +19 -0
- package/dist/layouts.js +1 -0
- package/dist/lean-2dBp1asm.js +1 -0
- package/dist/less-CfPPFFsV.js +1 -0
- package/dist/light-plus-glPHycm5.js +1 -0
- package/dist/liquid-Bj1DN66U.js +1 -0
- package/dist/log-CKSz9t_o.js +1 -0
- package/dist/logo-D3UPVeLP.js +1 -0
- package/dist/lua-C1EFGxtA.js +1 -0
- package/dist/luau-Dvb2LLsw.js +1 -0
- package/dist/make-TqphZF-7.js +1 -0
- package/dist/markdown-yX62Igf3.js +1 -0
- package/dist/marko-LH6NoP97.js +1 -0
- package/dist/material-darker-D6whucX3.js +1 -0
- package/dist/material-default-DYqS7fqa.js +1 -0
- package/dist/material-from-css-DlWo_ZDV.js +1 -0
- package/dist/material-lighter-CYQaMsGh.js +1 -0
- package/dist/material-ocean-Dl_zLA-F.js +1 -0
- package/dist/material-palenight-Cd4X9kqy.js +1 -0
- package/dist/matlab-Dy9K5GW8.js +1 -0
- package/dist/mdc-DhAfBnnn.js +1 -0
- package/dist/mdx-tnT2uTqR.js +1 -0
- package/dist/mermaid-aEaCok9S.js +1 -0
- package/dist/min-dark-CpapYCVz.js +1 -0
- package/dist/min-light-plRN0zW-.js +1 -0
- package/dist/mojo-BanaVmFY.js +1 -0
- package/dist/monokai-Cs2_BG4b.js +1 -0
- package/dist/move-B_kaWhAV.js +1 -0
- package/dist/narrat-6tChrAmV.js +1 -0
- package/dist/nextflow-BYB6CU6V.js +1 -0
- package/dist/nginx-Clr7XfzW.js +1 -0
- package/dist/nim-gLesixmv.js +1 -0
- package/dist/nix-DCgUXh-o.js +1 -0
- package/dist/nord-BHSE8FbR.js +1 -0
- package/dist/nushell-DDKGkuZY.js +1 -0
- package/dist/objective-c-BsQdhSk0.js +1 -0
- package/dist/objective-cpp-B-VZlBXW.js +1 -0
- package/dist/ocaml-B19L2xxl.js +1 -0
- package/dist/one-dark-pro-AWPQgJbJ.js +1 -0
- package/dist/pages.d.ts +30 -0
- package/dist/pages.js +1 -0
- package/dist/pascal-B0kVBVTU.js +1 -0
- package/dist/perl-Bs2cXIO6.js +1 -0
- package/dist/php-BgaH_AHK.js +1 -0
- package/dist/plsql-CPY7hT9n.js +1 -0
- package/dist/po-BszTsnLZ.js +1 -0
- package/dist/poimandres-CZF4JUv5.js +1 -0
- package/dist/postcss-DQ0frX96.js +1 -0
- package/dist/powerquery-BitONm6p.js +1 -0
- package/dist/powershell-B_lVHVgu.js +1 -0
- package/dist/prisma-CqkE3olT.js +1 -0
- package/dist/prolog-Bpuon3aK.js +1 -0
- package/dist/proto-C349dup0.js +1 -0
- package/dist/pug-Bbf3g_hT.js +1 -0
- package/dist/puppet-qDtDc0so.js +1 -0
- package/dist/purescript-C03CHyrT.js +1 -0
- package/dist/python-D5e4BtVB.js +1 -0
- package/dist/qml-LVCeHqxw.js +1 -0
- package/dist/qmldir-BEg8Q-XX.js +1 -0
- package/dist/qss-vq-U9k0N.js +1 -0
- package/dist/r-DnCIdoUu.js +1 -0
- package/dist/racket-BQt8mf2o.js +1 -0
- package/dist/raku-ChTHpuBS.js +1 -0
- package/dist/razor-CjFZSXD2.js +1 -0
- package/dist/reg-12gGsscy.js +1 -0
- package/dist/regexp-zLCCZKTi.js +1 -0
- package/dist/rel-aZ4oe34Q.js +1 -0
- package/dist/riscv-BA9R8KI2.js +1 -0
- package/dist/rose-pine-8QECO0Ox.js +1 -0
- package/dist/rose-pine-dawn-DT77ObZh.js +1 -0
- package/dist/rose-pine-moon-D3-I8ETF.js +1 -0
- package/dist/rst-DFKlxnrd.js +1 -0
- package/dist/ruby-BypI_hk5.js +1 -0
- package/dist/rust-tE6tRkqD.js +1 -0
- package/dist/sas-D1sMUJql.js +1 -0
- package/dist/sass-DBEOLVv3.js +1 -0
- package/dist/scala-DUzir4os.js +1 -0
- package/dist/scheme-dsSqVZz3.js +1 -0
- package/dist/scss-B0kJw1gM.js +1 -0
- package/dist/shaderlab-Cd8Cbryn.js +1 -0
- package/dist/shellscript-BL-Ihj2z.js +1 -0
- package/dist/shellsession-C5KJPcFG.js +1 -0
- package/dist/slack-dark-JbsLGggd.js +1 -0
- package/dist/slack-ochin-hTeCADjA.js +1 -0
- package/dist/smalltalk-DQ23HuGh.js +1 -0
- package/dist/solarized-dark-D2bQRcX7.js +1 -0
- package/dist/solarized-light-6xrOKoxI.js +1 -0
- package/dist/solidity-DUCwohjn.js +1 -0
- package/dist/soy-Cy4pRjbu.js +1 -0
- package/dist/sparql-D7gNTkUq.js +1 -0
- package/dist/splunk-Dvl5Xm98.js +1 -0
- package/dist/sql-BfoT44Al.js +1 -0
- package/dist/ssh-config-C-ZFySPN.js +1 -0
- package/dist/stata-Dpw9jvge.js +1 -0
- package/dist/stylus-mJ9_5M6n.js +1 -0
- package/dist/svelte-DD5dtnEi.js +1 -0
- package/dist/swift-DDernUpH.js +1 -0
- package/dist/system-verilog-DeXSd9Py.js +1 -0
- package/dist/systemd-NetTuLPL.js +1 -0
- package/dist/tasl-BCm9L3tI.js +1 -0
- package/dist/tcl-DmWVgxCm.js +1 -0
- package/dist/templ-B7wt_K-d.js +1 -0
- package/dist/terraform-DYIIsq8p.js +1 -0
- package/dist/tex-DFj0qpOD.js +1 -0
- package/dist/toml-CFu3vY0Q.js +1 -0
- package/dist/ts-tags-BvMEeGTJ.js +1 -0
- package/dist/tslib.es6-C3PNVQlC.js +1 -0
- package/dist/tsv-DnenRF8k.js +1 -0
- package/dist/tsx-DooqfEr1.js +1 -0
- package/dist/turtle-DKlxyehf.js +1 -0
- package/dist/twig-DpQc8FUF.js +1 -0
- package/dist/txt-C4tHEtDr.js +1 -0
- package/dist/typescript-DtE5sB_4.js +1 -0
- package/dist/typespec-B69vp3jc.js +1 -0
- package/dist/typst-BzEngGMo.js +1 -0
- package/dist/v-Dy6tTX8K.js +1 -0
- package/dist/vala-DQnmDtkE.js +1 -0
- package/dist/vb-CqTjXY4K.js +1 -0
- package/dist/verilog-D6Zfe00a.js +1 -0
- package/dist/vhdl-Dxu0BOr9.js +1 -0
- package/dist/views.d.ts +17 -0
- package/dist/views.js +1 -0
- package/dist/viml-eXtfIM-m.js +1 -0
- package/dist/vue-D3vey6Cu.js +1 -0
- package/dist/vue-html-DyaqvCGV.js +1 -0
- package/dist/vyper-C6AULW8C.js +1 -0
- package/dist/wasm-Cl39COlm.js +1 -0
- package/dist/wenyan-DJGdsiXE.js +1 -0
- package/dist/wgsl-CDhIPMwJ.js +1 -0
- package/dist/wikitext-D05PpJ8X.js +1 -0
- package/dist/wolfram-JgWnd2g7.js +1 -0
- package/dist/writer.d.ts +157 -0
- package/dist/writer.js +1 -0
- package/dist/xml-Cc1Sy-d4.js +1 -0
- package/dist/xsl-CEYTrbD0.js +1 -0
- package/dist/yaml-NvTdC05o.js +1 -0
- package/dist/zenscript-De0mU_BW.js +1 -0
- package/dist/zig-D9TJVGyp.js +1 -0
- package/index.ts +1 -0
- package/layouts.ts +1 -0
- package/package.json +58 -0
- package/postcss.config.cjs +5 -0
- package/rollup.config.js +149 -0
- package/src/brand/Button/Button.tsx +48 -0
- package/src/brand/Button/index.ts +7 -0
- package/src/brand/CTABanner/CTABanner.tsx +127 -0
- package/src/brand/CTABanner/index.ts +8 -0
- package/src/brand/Footer/Footer.tsx +36 -0
- package/src/brand/Footer/index.ts +3 -0
- package/src/brand/index.ts +5 -0
- package/src/coder/CodeCopy/CodeCopy.style.tsx +21 -0
- package/src/coder/CodeCopy/CodeCopy.tsx +32 -0
- package/src/coder/CodeCopy/index.ts +7 -0
- package/src/coder/CodeSample/CodeSample.styles.tsx +137 -0
- package/src/coder/CodeSample/CodeSample.tsx +150 -0
- package/src/coder/CodeSample/default-theme.ts +266 -0
- package/src/coder/CodeSample/index.ts +12 -0
- package/src/coder/CodeSample/withLocalStored.tsx +50 -0
- package/src/coder/README.md +1 -0
- package/src/coder/index.ts +3 -0
- package/src/content/Anchor/Anchor.tsx +63 -0
- package/src/content/Anchor/index.tsx +3 -0
- package/src/content/Content/Content.tsx +20 -0
- package/src/content/Content/index.tsx +3 -0
- package/src/content/Content.tsx +137 -0
- package/src/content/Subtitle/Subtitle.tsx +21 -0
- package/src/content/Subtitle/index.tsx +3 -0
- package/src/content/index.ts +3 -0
- package/src/layouts/Layout.styles.tsx +151 -0
- package/src/layouts/Layout.tsx +121 -0
- package/src/layouts/index.ts +7 -0
- package/src/pages/HomePage/HomePage.tsx +93 -0
- package/src/pages/HomePage/index.ts +5 -0
- package/src/pages/HomePage/types.ts +41 -0
- package/src/pages/index.ts +1 -0
- package/src/views/HomeView/HomeView.tsx +74 -0
- package/src/views/HomeView/index.ts +3 -0
- package/src/views/index.ts +1 -0
- package/src/writer/Badge/Badge.styles.tsx +29 -0
- package/src/writer/Badge/Badge.tsx +28 -0
- package/src/writer/Badge/index.ts +7 -0
- package/src/writer/Blockquote/Blockquote.styles.tsx +10 -0
- package/src/writer/Blockquote/Blockquote.tsx +13 -0
- package/src/writer/Blockquote/index.ts +7 -0
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +28 -0
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +46 -0
- package/src/writer/Breadcrumbs/index.ts +7 -0
- package/src/writer/Callout/Callout.styles.tsx +50 -0
- package/src/writer/Callout/Callout.tsx +37 -0
- package/src/writer/Callout/index.tsx +3 -0
- package/src/writer/Code/Code.styles.tsx +17 -0
- package/src/writer/Code/Code.tsx +13 -0
- package/src/writer/Code/index.ts +3 -0
- package/src/writer/Details/Details.styles.tsx +76 -0
- package/src/writer/Details/Details.tsx +122 -0
- package/src/writer/Details/index.ts +3 -0
- package/src/writer/GuideCard/GuideCard.styles.tsx +115 -0
- package/src/writer/GuideCard/GuideCard.tsx +81 -0
- package/src/writer/GuideCard/index.ts +1 -0
- package/src/writer/Heading/Heading.styles.tsx +73 -0
- package/src/writer/Heading/Heading.tsx +53 -0
- package/src/writer/Heading/index.ts +7 -0
- package/src/writer/Hr/Hr.styles.tsx +7 -0
- package/src/writer/Hr/Hr.tsx +13 -0
- package/src/writer/Hr/index.ts +3 -0
- package/src/writer/Icon/index.tsx +112 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +32 -0
- package/src/writer/NavLinks/NavLinks.tsx +48 -0
- package/src/writer/NavLinks/index.ts +7 -0
- package/src/writer/Pre/Pre.styles.tsx +13 -0
- package/src/writer/Pre/Pre.tsx +13 -0
- package/src/writer/Pre/index.ts +3 -0
- package/src/writer/README.md +1 -0
- package/src/writer/Steps/Steps.styles.tsx +36 -0
- package/src/writer/Steps/Steps.tsx +24 -0
- package/src/writer/Steps/index.ts +5 -0
- package/src/writer/Table/Table.styles.tsx +39 -0
- package/src/writer/Table/Table.tsx +45 -0
- package/src/writer/Table/index.ts +10 -0
- package/src/writer/Tabs/Tabs.styles.tsx +77 -0
- package/src/writer/Tabs/Tabs.tsx +104 -0
- package/src/writer/Tabs/index.ts +7 -0
- package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +45 -0
- package/src/writer/UnderlineNav/UnderlineNav.tsx +38 -0
- package/src/writer/UnderlineNav/index.ts +1 -0
- package/src/writer/index.ts +32 -0
- package/tsconfig.json +41 -0
- 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,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,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"
|