@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,50 @@
|
|
|
1
|
+
import React, {useState, useEffect} from "react"
|
|
2
|
+
|
|
3
|
+
export interface CodeTabsProps {
|
|
4
|
+
$localStorageKey: string
|
|
5
|
+
$defaultValue: string
|
|
6
|
+
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// TODO: interface
|
|
11
|
+
export function withLocalStored(Component: any) {
|
|
12
|
+
return function LocalStored(props: CodeTabsProps) {
|
|
13
|
+
const [value, setValue] = useState(
|
|
14
|
+
typeof localStorage !== "undefined"
|
|
15
|
+
? localStorage?.getItem(props.$localStorageKey) || props.$defaultValue
|
|
16
|
+
: props.$defaultValue,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const handler = (e: StorageEvent) => {
|
|
21
|
+
if (e.key === props.$localStorageKey) {
|
|
22
|
+
setValue(e.newValue || props.$defaultValue)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
window.addEventListener("storage", handler)
|
|
26
|
+
return () => {
|
|
27
|
+
window.removeEventListener("storage", handler)
|
|
28
|
+
}
|
|
29
|
+
}, [props.$localStorageKey])
|
|
30
|
+
|
|
31
|
+
function onValueChange(value: string) {
|
|
32
|
+
localStorage.setItem(props.$localStorageKey, value)
|
|
33
|
+
window.dispatchEvent(
|
|
34
|
+
new StorageEvent("storage", {
|
|
35
|
+
key: props.$localStorageKey,
|
|
36
|
+
newValue: value,
|
|
37
|
+
}),
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Component
|
|
43
|
+
onValueChange={onValueChange}
|
|
44
|
+
value={value}
|
|
45
|
+
>
|
|
46
|
+
{props.children}
|
|
47
|
+
</Component>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @xyd-js/components/coder
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, {forwardRef} from 'react'
|
|
2
|
+
import type {ComponentProps, ReactElement} from 'react'
|
|
3
|
+
|
|
4
|
+
import {css} from "@linaria/core";
|
|
5
|
+
|
|
6
|
+
const $anchor = {
|
|
7
|
+
host: css`
|
|
8
|
+
color: #7051d4;
|
|
9
|
+
`,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type AnchorProps = Omit<ComponentProps<'a'>, 'ref'> & {
|
|
13
|
+
newWindow?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// TODO: where react-router?
|
|
17
|
+
|
|
18
|
+
export const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(function (
|
|
19
|
+
{href = '', children, newWindow},
|
|
20
|
+
// ref is used in <NavbarMenu />
|
|
21
|
+
forwardedRef
|
|
22
|
+
): ReactElement {
|
|
23
|
+
if (newWindow) {
|
|
24
|
+
return (
|
|
25
|
+
<a
|
|
26
|
+
ref={forwardedRef}
|
|
27
|
+
to={href}
|
|
28
|
+
href={href}
|
|
29
|
+
target="_blank"
|
|
30
|
+
rel="noreferrer"
|
|
31
|
+
className={$anchor.host}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</a>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!href) {
|
|
39
|
+
return (
|
|
40
|
+
<a
|
|
41
|
+
ref={forwardedRef}
|
|
42
|
+
to={href}
|
|
43
|
+
href={href}
|
|
44
|
+
className={$anchor.host}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</a>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<a
|
|
53
|
+
ref={forwardedRef}
|
|
54
|
+
to={href}
|
|
55
|
+
href={href}
|
|
56
|
+
className={$anchor.host}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</a>
|
|
60
|
+
)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
Anchor.displayName = 'Anchor'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
|
|
4
|
+
const $content = {
|
|
5
|
+
host: css`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 24px;
|
|
9
|
+
`
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ContentProps {
|
|
13
|
+
children: React.ReactNode
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Content({children}: ContentProps) {
|
|
17
|
+
return <div className={$content.host}>
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
20
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Badge,
|
|
5
|
+
Blockquote,
|
|
6
|
+
Callout,
|
|
7
|
+
Code,
|
|
8
|
+
Details,
|
|
9
|
+
GuideCard,
|
|
10
|
+
Heading,
|
|
11
|
+
Hr,
|
|
12
|
+
Table,
|
|
13
|
+
Tabs,
|
|
14
|
+
Steps,
|
|
15
|
+
|
|
16
|
+
IconCode,
|
|
17
|
+
IconCustomEvent,
|
|
18
|
+
IconFunnels,
|
|
19
|
+
IconMetrics,
|
|
20
|
+
IconSessionReplay,
|
|
21
|
+
} from '../writer'
|
|
22
|
+
import {CodeSample} from "../coder";
|
|
23
|
+
|
|
24
|
+
import {Content as ContentComponent} from "./Content/index";
|
|
25
|
+
import {Subtitle} from "./Subtitle";
|
|
26
|
+
import {Anchor} from "./Anchor";
|
|
27
|
+
|
|
28
|
+
const EXTERNAL_HREF_REGEX = /https?:\/\//
|
|
29
|
+
|
|
30
|
+
const Link = ({href = '', className, ...props}) => (
|
|
31
|
+
<Anchor
|
|
32
|
+
href={href}
|
|
33
|
+
newWindow={EXTERNAL_HREF_REGEX.test(href)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
// TODO: options?
|
|
39
|
+
export default function content() {
|
|
40
|
+
return {
|
|
41
|
+
...stdContent(),
|
|
42
|
+
...writerContent(),
|
|
43
|
+
...helperContent(),
|
|
44
|
+
...iconContent(),
|
|
45
|
+
...coderContent(),
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function stdContent() {
|
|
50
|
+
return {
|
|
51
|
+
h1: (props) => <div><Heading id={props.children} {...props}/></div>,
|
|
52
|
+
h2: props => <div><Heading id={props.children} size={2} {...props} /></div>,
|
|
53
|
+
h3: props => <div><Heading id={props.children} size={3} {...props} /></div>,
|
|
54
|
+
h4: props => <div><Heading id={props.children} size={4} {...props} /></div>,
|
|
55
|
+
h5: props => <div><Heading id={props.children} size={5} {...props} /></div>,
|
|
56
|
+
h6: props => <div><Heading id={props.children} size={6} {...props} /></div>,
|
|
57
|
+
p: props => <p {...props} />,
|
|
58
|
+
|
|
59
|
+
ul: props => (
|
|
60
|
+
<ul{...props}>
|
|
61
|
+
{props.children}
|
|
62
|
+
</ul>
|
|
63
|
+
),
|
|
64
|
+
ol: props => (
|
|
65
|
+
<ol{...props}
|
|
66
|
+
>
|
|
67
|
+
{props.children}
|
|
68
|
+
</ol>
|
|
69
|
+
),
|
|
70
|
+
li: props => <li {...props} >
|
|
71
|
+
{props.children}
|
|
72
|
+
</li>,
|
|
73
|
+
|
|
74
|
+
table: Table,
|
|
75
|
+
tr: Table.Tr,
|
|
76
|
+
th: Table.Th,
|
|
77
|
+
td: Table.Td,
|
|
78
|
+
|
|
79
|
+
code: Code,
|
|
80
|
+
pre: props => {
|
|
81
|
+
const lang = (props?.children?.props?.className || "").replace("language-", "") // TODO: better solution
|
|
82
|
+
|
|
83
|
+
return <CodeSample
|
|
84
|
+
name={lang}
|
|
85
|
+
description={props?.children?.props?.meta}
|
|
86
|
+
codeblocks={[
|
|
87
|
+
{
|
|
88
|
+
value: props?.children?.props?.children,
|
|
89
|
+
lang: lang,
|
|
90
|
+
meta: lang,
|
|
91
|
+
}
|
|
92
|
+
]}
|
|
93
|
+
size="full" // TODO: in the future configurable
|
|
94
|
+
/>
|
|
95
|
+
},
|
|
96
|
+
details: Details,
|
|
97
|
+
blockquote: Blockquote,
|
|
98
|
+
|
|
99
|
+
hr: Hr,
|
|
100
|
+
a: Link,
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function writerContent() {
|
|
105
|
+
return {
|
|
106
|
+
Callout,
|
|
107
|
+
Details,
|
|
108
|
+
GuideCard,
|
|
109
|
+
Steps,
|
|
110
|
+
Tabs,
|
|
111
|
+
Table,
|
|
112
|
+
Badge,
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function helperContent() {
|
|
117
|
+
return {
|
|
118
|
+
Content: ContentComponent,
|
|
119
|
+
Subtitle
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function iconContent() {
|
|
124
|
+
return {
|
|
125
|
+
IconSessionReplay,
|
|
126
|
+
IconMetrics,
|
|
127
|
+
IconFunnels,
|
|
128
|
+
IconCode,
|
|
129
|
+
IconCustomEvent,
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function coderContent() {
|
|
134
|
+
return {
|
|
135
|
+
CodeSample,
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
|
|
4
|
+
const $subitlte = {
|
|
5
|
+
host: css`
|
|
6
|
+
margin-top: -18px;
|
|
7
|
+
font-size: 18px;
|
|
8
|
+
color: #7051d4;
|
|
9
|
+
font-weight: 300;
|
|
10
|
+
`
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SubtitleProps {
|
|
14
|
+
children: React.ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Subtitle({children}: SubtitleProps) {
|
|
18
|
+
return <div className={$subitlte.host}>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
const globalPageGutter = '8px';
|
|
4
|
+
export const globalHeaderHeight = '46px';
|
|
5
|
+
const globalHeaderWarningHeight = "0px";
|
|
6
|
+
const contentTopSpace = "12px";
|
|
7
|
+
|
|
8
|
+
const globalHeaderHeightWithSub = '90px';
|
|
9
|
+
|
|
10
|
+
const cubicMove = "cubic-bezier(.65, 0, .35, 1)";
|
|
11
|
+
const sidebarWidth = "210px";
|
|
12
|
+
|
|
13
|
+
// TODO: better solution - design tokens
|
|
14
|
+
export const globals = css`
|
|
15
|
+
:global() {
|
|
16
|
+
:root {
|
|
17
|
+
--xyd-navbar-height: ${globalHeaderHeight};
|
|
18
|
+
--xyd-global-page-gutter: ${globalPageGutter};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const $layout = {
|
|
24
|
+
host: css`
|
|
25
|
+
width: 100%;
|
|
26
|
+
`,
|
|
27
|
+
header: css`
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
|
|
32
|
+
position: fixed;
|
|
33
|
+
top: ${globalHeaderWarningHeight};
|
|
34
|
+
right: ${globalPageGutter};
|
|
35
|
+
left: ${globalPageGutter};
|
|
36
|
+
|
|
37
|
+
height: ${globalHeaderHeight};
|
|
38
|
+
`,
|
|
39
|
+
header$$sub: css`
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
height: ${globalHeaderHeightWithSub};
|
|
42
|
+
transition: transform 200ms;
|
|
43
|
+
`,
|
|
44
|
+
header$$hideMain: css`
|
|
45
|
+
transform: translateY(calc(-${globalHeaderHeight} + 3px));
|
|
46
|
+
`,
|
|
47
|
+
main: css`
|
|
48
|
+
position: fixed;
|
|
49
|
+
top: calc(${globalHeaderHeight} + ${globalHeaderWarningHeight});
|
|
50
|
+
bottom: ${globalPageGutter};
|
|
51
|
+
left: ${globalPageGutter};
|
|
52
|
+
right: ${globalPageGutter};
|
|
53
|
+
}`,
|
|
54
|
+
main$$sub: css`
|
|
55
|
+
top: calc(${globalHeaderHeightWithSub} + ${globalHeaderWarningHeight});
|
|
56
|
+
transition: top 200ms;
|
|
57
|
+
`,
|
|
58
|
+
sidebar: css`
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
bottom: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
z-index: 101;
|
|
66
|
+
width: ${sidebarWidth};
|
|
67
|
+
border: 0;
|
|
68
|
+
padding: ${contentTopSpace} 0 0;
|
|
69
|
+
overflow: visible;
|
|
70
|
+
background: none;
|
|
71
|
+
border-radius: 0;
|
|
72
|
+
opacity: 1;
|
|
73
|
+
visibility: visible;
|
|
74
|
+
transition: opacity .3s ${cubicMove};
|
|
75
|
+
`,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const $page = {
|
|
79
|
+
host: css`
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: ${contentTopSpace};
|
|
82
|
+
right: 0;
|
|
83
|
+
bottom: 0;
|
|
84
|
+
z-index: 201;
|
|
85
|
+
background: #fff;
|
|
86
|
+
|
|
87
|
+
//border-radius: 8px;
|
|
88
|
+
//border: 1px solid #ececf1;
|
|
89
|
+
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
transition: opacity .3s ${cubicMove};
|
|
92
|
+
|
|
93
|
+
left: ${sidebarWidth};
|
|
94
|
+
`,
|
|
95
|
+
scroll: css`
|
|
96
|
+
//position: absolute;
|
|
97
|
+
//top: 0;
|
|
98
|
+
//right: 0;
|
|
99
|
+
//bottom: 0;
|
|
100
|
+
//left: 0;
|
|
101
|
+
//overflow: auto;
|
|
102
|
+
|
|
103
|
+
overflow: scroll;
|
|
104
|
+
height: 100%;
|
|
105
|
+
|
|
106
|
+
`,
|
|
107
|
+
container: css`
|
|
108
|
+
padding: 0;
|
|
109
|
+
width: 100%;
|
|
110
|
+
//position: relative; TODO: unset if during client render?
|
|
111
|
+
min-height: 100%;
|
|
112
|
+
|
|
113
|
+
max-width: 100%;
|
|
114
|
+
margin: 0 auto;
|
|
115
|
+
font-size: 15px;
|
|
116
|
+
line-height: 24px;
|
|
117
|
+
`,
|
|
118
|
+
articleContainer: css`
|
|
119
|
+
width: 980px;
|
|
120
|
+
padding: 40px 56px;
|
|
121
|
+
padding-top: 20px;
|
|
122
|
+
max-width: 100%;
|
|
123
|
+
margin: 0 auto;
|
|
124
|
+
`,
|
|
125
|
+
articleContainer$$fullWidth: css`
|
|
126
|
+
width: 1200px;
|
|
127
|
+
`,
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const $article = {
|
|
132
|
+
host: css`
|
|
133
|
+
display: flex;
|
|
134
|
+
gap: 30px;
|
|
135
|
+
width: 100%;
|
|
136
|
+
align-items: flex-start;;
|
|
137
|
+
`,
|
|
138
|
+
content: css`
|
|
139
|
+
flex: 1 1 0;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
`,
|
|
142
|
+
nav: css`
|
|
143
|
+
position: sticky;
|
|
144
|
+
top: 30px;
|
|
145
|
+
width: 180px;
|
|
146
|
+
margin-top: 0;
|
|
147
|
+
margin-left: 50px;
|
|
148
|
+
padding-left: 16px;
|
|
149
|
+
flex: none;
|
|
150
|
+
`
|
|
151
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React, {useEffect, useState} from "react"
|
|
2
|
+
|
|
3
|
+
import {$layout, $page, $article, globalHeaderHeight} from "./Layout.styles"
|
|
4
|
+
|
|
5
|
+
export interface LayoutProps {
|
|
6
|
+
header: React.ReactNode;
|
|
7
|
+
aside: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
contentNav: React.ReactNode;
|
|
10
|
+
subheader?: boolean;
|
|
11
|
+
kind?: "fullwidth"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function Layout(props: LayoutProps) {
|
|
15
|
+
const [hideMainHeader, setHideMainHeader] = useState(false)
|
|
16
|
+
const [scrollTop, setScrollTop] = useState(0)
|
|
17
|
+
const [controlScrollPos, setControlScrollPos] = useState(0)
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (scrollTop === controlScrollPos) {
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const checkpoint = parseInt(globalHeaderHeight, 10) / 2
|
|
25
|
+
const diff = scrollTop - controlScrollPos
|
|
26
|
+
const reversePosDiff = Math.abs(scrollTop - controlScrollPos)
|
|
27
|
+
|
|
28
|
+
if (diff > checkpoint) {
|
|
29
|
+
setHideMainHeader(true)
|
|
30
|
+
} else if (reversePosDiff > checkpoint) {
|
|
31
|
+
setHideMainHeader(false)
|
|
32
|
+
}
|
|
33
|
+
}, [
|
|
34
|
+
scrollTop,
|
|
35
|
+
controlScrollPos,
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
function onScroll(e: Event) {
|
|
39
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const scroll = e.target?.scrollTop
|
|
44
|
+
setScrollTop(scroll)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function onScrollFinish(e: Event) {
|
|
48
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setControlScrollPos(e.target?.scrollTop)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// TODO: by ref?
|
|
56
|
+
// TODO: MOVE SOMEWHERE ELSE BECAUSE IT DECREASE PERFORMANCE (RERENDER)
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
// return // TODO: UNCOMMENT
|
|
59
|
+
|
|
60
|
+
if (!props.subheader) {
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
document.querySelector(`.${$page.scroll}`)?.addEventListener("scroll", onScroll)
|
|
65
|
+
document.querySelector(`.${$page.scroll}`)?.addEventListener("scrollend", onScrollFinish)
|
|
66
|
+
|
|
67
|
+
return () => {
|
|
68
|
+
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scroll", onScroll)
|
|
69
|
+
document.querySelector(`.${$page.scroll}`)?.removeEventListener("scrollend", onScrollFinish)
|
|
70
|
+
}
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
return <div className={$layout.host}>
|
|
74
|
+
<Layout.Header className={`
|
|
75
|
+
${props.subheader && $layout.header$$sub}
|
|
76
|
+
${hideMainHeader && $layout.header$$hideMain}
|
|
77
|
+
`}>
|
|
78
|
+
{props.header}
|
|
79
|
+
</Layout.Header>
|
|
80
|
+
<main className={`
|
|
81
|
+
${$layout.main}
|
|
82
|
+
${!hideMainHeader && props.subheader && $layout.main$$sub}
|
|
83
|
+
`}>
|
|
84
|
+
<aside className={$layout.sidebar}>
|
|
85
|
+
{props.aside}
|
|
86
|
+
</aside>
|
|
87
|
+
<div className={$page.host}>
|
|
88
|
+
<div className={$page.scroll}>
|
|
89
|
+
<div className={$page.container}>
|
|
90
|
+
<div className={`
|
|
91
|
+
${$page.articleContainer}
|
|
92
|
+
${props.kind == "fullwidth" && $page.articleContainer$$fullWidth}
|
|
93
|
+
`}>
|
|
94
|
+
<article className={$article.host}>
|
|
95
|
+
<section className={$article.content}>
|
|
96
|
+
{props.content}
|
|
97
|
+
</section>
|
|
98
|
+
{
|
|
99
|
+
props.contentNav && <nav className={`
|
|
100
|
+
${$article.nav}
|
|
101
|
+
`}>
|
|
102
|
+
{props.contentNav}
|
|
103
|
+
</nav>
|
|
104
|
+
}
|
|
105
|
+
</article>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</main>
|
|
111
|
+
</div>
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
Layout.Header = function LayoutHeader({className, children}: { className?: string, children: React.ReactNode }) {
|
|
115
|
+
return <header className={`
|
|
116
|
+
${$layout.header}
|
|
117
|
+
${className}
|
|
118
|
+
`}>
|
|
119
|
+
{children}
|
|
120
|
+
</header>
|
|
121
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {css} from "@linaria/core";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
GuideCard,
|
|
6
|
+
} from "../../writer"
|
|
7
|
+
import {Button, CTABanner} from "../../brand"
|
|
8
|
+
import {HomeView} from "../../views"
|
|
9
|
+
|
|
10
|
+
import {IHomePageHero, IHomePageFeature} from "./types";
|
|
11
|
+
|
|
12
|
+
const $cards = {
|
|
13
|
+
host: css`
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: repeat(2, 500px);
|
|
16
|
+
justify-content: center;
|
|
17
|
+
gap: 30px;
|
|
18
|
+
|
|
19
|
+
@media (max-width: 1200px) {
|
|
20
|
+
grid-template-columns: repeat(2, 1fr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 768px) {
|
|
24
|
+
grid-template-columns: 1fr;
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface HomePageProps {
|
|
30
|
+
header: React.ReactNode
|
|
31
|
+
|
|
32
|
+
children?: React.ReactNode
|
|
33
|
+
hero?: IHomePageHero
|
|
34
|
+
footer?: React.ReactNode
|
|
35
|
+
features?: IHomePageFeature[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function HomePage(props: HomePageProps) {
|
|
39
|
+
return <HomeView
|
|
40
|
+
header={props.header}
|
|
41
|
+
body={<HomeView.Body>
|
|
42
|
+
<$Hero {...props}/>
|
|
43
|
+
|
|
44
|
+
{props.hero?.actions && <$Cards {...props}/>}
|
|
45
|
+
|
|
46
|
+
{props.children}
|
|
47
|
+
</HomeView.Body>}
|
|
48
|
+
footer={props.footer}
|
|
49
|
+
/>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function $Hero(props: HomePageProps) {
|
|
53
|
+
return <CTABanner>
|
|
54
|
+
<CTABanner.Heading
|
|
55
|
+
title={props.hero?.text || ""}
|
|
56
|
+
headingEffect={props.hero?.textEffect}
|
|
57
|
+
subtitle={props.hero?.subtitle}
|
|
58
|
+
/>
|
|
59
|
+
{props?.hero?.actions && <CTABanner.ButtonGroup>
|
|
60
|
+
{props?.hero?.actions.map((action, index) => (
|
|
61
|
+
<a href={action.href}>
|
|
62
|
+
<Button key={action.text + index} kind={action.kind}>
|
|
63
|
+
{action.text}
|
|
64
|
+
</Button>
|
|
65
|
+
</a>
|
|
66
|
+
))}
|
|
67
|
+
</CTABanner.ButtonGroup>}
|
|
68
|
+
</CTABanner>
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function $Cards(props: HomePageProps) {
|
|
72
|
+
// TODO: cards gridTemplateColumns based on elements
|
|
73
|
+
return <div
|
|
74
|
+
className={`
|
|
75
|
+
${$cards.host}
|
|
76
|
+
xyd_page-comp-homepage-cards
|
|
77
|
+
`}>
|
|
78
|
+
{props.features?.map((feat, index) => (
|
|
79
|
+
<GuideCard
|
|
80
|
+
key={feat.title + index}
|
|
81
|
+
href={feat.href || ""}
|
|
82
|
+
title={feat.title}
|
|
83
|
+
icon={feat.icon}
|
|
84
|
+
kind="secondary"
|
|
85
|
+
size="md"
|
|
86
|
+
>
|
|
87
|
+
{feat.description}
|
|
88
|
+
</GuideCard>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|