@xyd-js/components 0.1.0-xyd.0 → 0.1.0-xyd.10
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/CHANGELOG.md +55 -0
- package/LICENSE +21 -0
- package/dist/CTABanner-4FVIoaTR.js +2 -0
- package/dist/CTABanner-4FVIoaTR.js.map +1 -0
- package/dist/CTABanner-BQx2SLf8.js +2 -0
- package/dist/CTABanner-BQx2SLf8.js.map +1 -0
- package/dist/CTABanner-C6afsXoE.js +2 -0
- package/dist/CTABanner-C6afsXoE.js.map +1 -0
- package/dist/CTABanner-CEKs-Hb-.js +2 -0
- package/dist/CTABanner-CEKs-Hb-.js.map +1 -0
- package/dist/CTABanner-CUNcTr6s.js +2 -0
- package/dist/CTABanner-CUNcTr6s.js.map +1 -0
- package/dist/CTABanner-D02aIAsD.js +2 -0
- package/dist/CTABanner-D02aIAsD.js.map +1 -0
- package/dist/CTABanner-Dm3tUG3I.js +2 -0
- package/dist/CTABanner-Dm3tUG3I.js.map +1 -0
- package/dist/CTABanner-MCOcVowa.js +2 -0
- package/dist/CTABanner-MCOcVowa.js.map +1 -0
- package/dist/CTABanner-X6K49gSr.js +2 -0
- package/dist/CTABanner-X6K49gSr.js.map +1 -0
- package/dist/CodeSample-B9VUhTKF.js +2 -0
- package/dist/CodeSample-B9VUhTKF.js.map +1 -0
- package/dist/CodeSample-BSXeFy0x.js +2 -0
- package/dist/CodeSample-BSXeFy0x.js.map +1 -0
- package/dist/CodeSample-BwP208sQ.js +2 -0
- package/dist/CodeSample-BwP208sQ.js.map +1 -0
- package/dist/CodeSample-CK-CQYrV.js +2 -0
- package/dist/CodeSample-CK-CQYrV.js.map +1 -0
- package/dist/CodeSample-CUemtj_W.js +2 -0
- package/dist/CodeSample-CUemtj_W.js.map +1 -0
- package/dist/CodeSample-D0iKih-A.js +2 -0
- package/dist/CodeSample-D0iKih-A.js.map +1 -0
- package/dist/CodeSample-D33vTa6M.js +2 -0
- package/dist/CodeSample-D33vTa6M.js.map +1 -0
- package/dist/CodeSample-DUSx2KBt.js +2 -0
- package/dist/CodeSample-DUSx2KBt.js.map +1 -0
- package/dist/CodeSample-P4yxkHPW.js +2 -0
- package/dist/CodeSample-P4yxkHPW.js.map +1 -0
- package/dist/HomeView-ACBdUgyz.js +2 -0
- package/dist/HomeView-ACBdUgyz.js.map +1 -0
- package/dist/HomeView-B0ATNUF1.js +2 -0
- package/dist/HomeView-B0ATNUF1.js.map +1 -0
- package/dist/HomeView-CHSb4HL6.js +2 -0
- package/dist/HomeView-CHSb4HL6.js.map +1 -0
- package/dist/HomeView-COJrg8Ju.js +2 -0
- package/dist/HomeView-COJrg8Ju.js.map +1 -0
- package/dist/HomeView-Cun4apuy.js +2 -0
- package/dist/HomeView-Cun4apuy.js.map +1 -0
- package/dist/HomeView-D4DXEOOn.js +2 -0
- package/dist/HomeView-D4DXEOOn.js.map +1 -0
- package/dist/HomeView-DaH1PSBB.js +2 -0
- package/dist/HomeView-DaH1PSBB.js.map +1 -0
- package/dist/HomeView-O_lj2c2t.js +2 -0
- package/dist/HomeView-O_lj2c2t.js.map +1 -0
- package/dist/HomeView-_Nu2RcOM.js +2 -0
- package/dist/HomeView-_Nu2RcOM.js.map +1 -0
- package/dist/UnderlineNav-3-KptDYD.js +2 -0
- package/dist/UnderlineNav-3-KptDYD.js.map +1 -0
- package/dist/UnderlineNav-BCyB0G5d.js +2 -0
- package/dist/UnderlineNav-BCyB0G5d.js.map +1 -0
- package/dist/UnderlineNav-BEhDJk0H.js +2 -0
- package/dist/UnderlineNav-BEhDJk0H.js.map +1 -0
- package/dist/UnderlineNav-BqZ2xAp7.js +2 -0
- package/dist/UnderlineNav-BqZ2xAp7.js.map +1 -0
- package/dist/UnderlineNav-C2-4Vyj8.js +2 -0
- package/dist/UnderlineNav-C2-4Vyj8.js.map +1 -0
- package/dist/UnderlineNav-Co08Gykm.js +2 -0
- package/dist/UnderlineNav-Co08Gykm.js.map +1 -0
- package/dist/UnderlineNav-DC3UVmnZ.js +2 -0
- package/dist/UnderlineNav-DC3UVmnZ.js.map +1 -0
- package/dist/UnderlineNav-DsRYwuGB.js +2 -0
- package/dist/UnderlineNav-DsRYwuGB.js.map +1 -0
- package/dist/UnderlineNav-FbclXKUW.js +2 -0
- package/dist/UnderlineNav-FbclXKUW.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js +2 -0
- package/dist/_rollupPluginBabelHelpers-BEouSrrZ.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-BHehKRBq.js +2 -0
- package/dist/_rollupPluginBabelHelpers-BHehKRBq.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js +2 -0
- package/dist/_rollupPluginBabelHelpers-Bunpz22T.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js +2 -0
- package/dist/_rollupPluginBabelHelpers-CVblpRvU.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js +2 -0
- package/dist/_rollupPluginBabelHelpers-CxmswfqM.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js +2 -0
- package/dist/_rollupPluginBabelHelpers-D0XU6lDu.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js +2 -0
- package/dist/_rollupPluginBabelHelpers-DQJTK9EO.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js +2 -0
- package/dist/_rollupPluginBabelHelpers-DuRQdJ01.js.map +1 -0
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js +2 -0
- package/dist/_rollupPluginBabelHelpers-tRAa4O0f.js.map +1 -0
- package/dist/brand.d.ts +11 -10
- package/dist/brand.js +2 -1
- package/dist/brand.js.map +1 -0
- package/dist/coder/themes/cosmo-light.d.ts +5 -0
- package/dist/coder/themes/cosmo-light.js +2 -0
- package/dist/coder/themes/cosmo-light.js.map +1 -0
- package/dist/coder.d.ts +54 -3
- package/dist/coder.js +2 -1
- package/dist/coder.js.map +1 -0
- package/dist/content.d.ts +103 -37
- package/dist/content.js +2 -1
- package/dist/content.js.map +1 -0
- package/dist/index-B0FncPxO.js +2 -0
- package/dist/index-B0FncPxO.js.map +1 -0
- package/dist/index-BEm-xkm-.js +2 -0
- package/dist/index-BEm-xkm-.js.map +1 -0
- package/dist/index-BHwtxG27.js +2 -0
- package/dist/index-BHwtxG27.js.map +1 -0
- package/dist/index-BTcmIG47.js +2 -0
- package/dist/index-BTcmIG47.js.map +1 -0
- package/dist/index-BbIMmTvo.js +2 -0
- package/dist/index-BbIMmTvo.js.map +1 -0
- package/dist/index-CNkHt1r7.js +2 -0
- package/dist/index-CNkHt1r7.js.map +1 -0
- package/dist/index-D0XuyFm7.js +2 -0
- package/dist/index-D0XuyFm7.js.map +1 -0
- package/dist/index-DBspcqWq.js +2 -0
- package/dist/index-DBspcqWq.js.map +1 -0
- package/dist/index-DVBO4gYE.js +2 -0
- package/dist/index-DVBO4gYE.js.map +1 -0
- package/dist/index.css +217 -135
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts.d.ts +12 -1
- package/dist/layouts.js +2 -1
- package/dist/layouts.js.map +1 -0
- package/dist/pages.d.ts +2 -1
- package/dist/pages.js +2 -1
- package/dist/pages.js.map +1 -0
- package/dist/{tslib.es6-C3PNVQlC.js → tslib.es6-BBkx4Se1.js} +1 -0
- package/dist/tslib.es6-BBkx4Se1.js.map +1 -0
- package/dist/tslib.es6-BF6ZLEXa.js +2 -0
- package/dist/tslib.es6-BF6ZLEXa.js.map +1 -0
- package/dist/tslib.es6-BOZCDgb8.js +2 -0
- package/dist/tslib.es6-BOZCDgb8.js.map +1 -0
- package/dist/tslib.es6-CNVK7Xcu.js +2 -0
- package/dist/tslib.es6-CNVK7Xcu.js.map +1 -0
- package/dist/tslib.es6-Cjl5tesf.js +2 -0
- package/dist/tslib.es6-Cjl5tesf.js.map +1 -0
- package/dist/tslib.es6-DEH7Dkgy.js +2 -0
- package/dist/tslib.es6-DEH7Dkgy.js.map +1 -0
- package/dist/tslib.es6-DTeJ7dWi.js +2 -0
- package/dist/tslib.es6-DTeJ7dWi.js.map +1 -0
- package/dist/tslib.es6-U9-f6pA7.js +2 -0
- package/dist/tslib.es6-U9-f6pA7.js.map +1 -0
- package/dist/tslib.es6-cb69JjeS.js +2 -0
- package/dist/tslib.es6-cb69JjeS.js.map +1 -0
- package/dist/views.d.ts +2 -1
- package/dist/views.js +2 -1
- package/dist/views.js.map +1 -0
- package/dist/writer.d.ts +62 -8
- package/dist/writer.js +2 -1
- package/dist/writer.js.map +1 -0
- package/package.json +35 -12
- package/rollup.config.js +53 -8
- package/src/brand/Button/Button.styles.tsx +31 -0
- package/src/brand/Button/Button.tsx +3 -35
- package/src/brand/CTABanner/CTABanner.styles.tsx +82 -0
- package/src/brand/CTABanner/CTABanner.tsx +34 -112
- package/src/brand/Footer/Footer.styles.tsx +21 -0
- package/src/brand/Footer/Footer.tsx +4 -24
- package/src/brand/TODO.md +1 -0
- package/src/coder/Code/Code.styles.tsx +47 -0
- package/src/coder/Code/Code.tsx +76 -0
- package/src/coder/Code/CodeLoader.tsx +10 -0
- package/src/coder/Code/annotations.tsx +31 -0
- package/src/coder/Code/highlight.ts +170 -0
- package/src/coder/Code/index.ts +15 -0
- package/src/coder/CodeCopy/CodeCopy.styles.tsx +19 -0
- package/src/coder/CodeCopy/CodeCopy.tsx +2 -4
- package/src/coder/CodeSample/CodeSample.tsx +42 -133
- package/src/coder/CodeSample/index.ts +0 -1
- package/src/coder/CodeSample/withLocalStored.tsx +1 -1
- package/src/coder/CodeTabs/CodeTabs.styles.tsx +104 -0
- package/src/coder/CodeTabs/CodeTabs.tsx +95 -0
- package/src/coder/CodeTabs/index.ts +6 -0
- package/src/coder/CodeTheme/CodeTheme.tsx +79 -0
- package/src/coder/CodeTheme/index.ts +8 -0
- package/src/coder/hooks/highlight.ts +182 -0
- package/src/coder/index.ts +31 -1
- package/src/coder/{CodeSample/default-theme.ts → themes/cosmo-light.ts} +3 -2
- package/src/content/Anchor/Anchor.styles.tsx +5 -0
- package/src/content/Anchor/Anchor.tsx +4 -14
- package/src/content/Content/Content.styles.tsx +9 -0
- package/src/content/Content/Content.tsx +4 -11
- package/src/content/Content.tsx +48 -6
- package/src/content/Subtitle/Subtitle.styles.ts +8 -0
- package/src/content/Subtitle/Subtitle.tsx +2 -11
- package/src/layouts/Layout.styles.tsx +135 -131
- package/src/layouts/Layout.tsx +21 -23
- package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +341 -0
- package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +157 -0
- package/src/layouts/LayoutPrimary/index.ts +5 -0
- package/src/layouts/index.ts +7 -1
- package/src/pages/HomePage/HomePage.styles.tsx +16 -0
- package/src/pages/HomePage/HomePage.tsx +7 -21
- package/src/pages/TODO.md +1 -0
- package/src/pages/index.ts +1 -0
- package/src/ui/Loader/Loader.styles.tsx +54 -0
- package/src/ui/Loader/Loader.tsx +26 -0
- package/src/ui/TODO.md +2 -0
- package/src/ui/index.ts +1 -0
- package/src/utils/useStyle.ts +19 -0
- package/src/views/HomeView/HomeView.styles.tsx +37 -0
- package/src/views/HomeView/HomeView.tsx +5 -45
- package/src/views/TODO.md +1 -0
- package/src/views/index.ts +1 -0
- package/src/writer/Badge/Badge.styles.tsx +31 -26
- package/src/writer/Badge/Badge.tsx +42 -9
- package/src/writer/Blockquote/Blockquote.styles.tsx +6 -8
- package/src/writer/Blockquote/Blockquote.tsx +2 -2
- package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +27 -26
- package/src/writer/Breadcrumbs/Breadcrumbs.tsx +5 -5
- package/src/writer/Callout/Callout.styles.tsx +44 -48
- package/src/writer/Callout/Callout.tsx +5 -5
- package/src/writer/Code/Code.styles.tsx +11 -13
- package/src/writer/Code/Code.tsx +2 -2
- package/src/writer/Details/Details.styles.tsx +102 -74
- package/src/writer/Details/Details.tsx +46 -30
- package/src/writer/GuideCard/GuideCard.styles.tsx +116 -112
- package/src/writer/GuideCard/GuideCard.tsx +19 -19
- package/src/writer/Heading/Heading.styles.tsx +65 -61
- package/src/writer/Heading/Heading.tsx +11 -11
- package/src/writer/Hr/Hr.styles.tsx +3 -5
- package/src/writer/Hr/Hr.tsx +2 -2
- package/src/writer/Icon/index.tsx +243 -0
- package/src/writer/NavLinks/NavLinks.styles.ts +30 -30
- package/src/writer/NavLinks/NavLinks.tsx +6 -6
- package/src/writer/Pre/Pre.styles.tsx +8 -10
- package/src/writer/Pre/Pre.tsx +2 -2
- package/src/writer/Steps/Steps.styles.tsx +30 -31
- package/src/writer/Steps/Steps.tsx +3 -4
- package/src/writer/Table/Table.styles.tsx +32 -31
- package/src/writer/Table/Table.tsx +5 -5
- package/src/writer/Table/TableV2.styles.tsx +117 -0
- package/src/writer/Table/TableV2.tsx +83 -0
- package/src/writer/Table/index.ts +4 -0
- package/src/writer/Tabs/Tabs.styles.tsx +60 -63
- package/src/writer/Tabs/Tabs.tsx +11 -16
- package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +44 -42
- package/src/writer/UnderlineNav/UnderlineNav.tsx +5 -5
- package/tsconfig.json +2 -3
- package/dist/CTABanner-CWX9isVG.js +0 -1
- package/dist/CodeSample-C5YaEpAi.js +0 -1
- package/dist/HomeView-CnAj-VYl.js +0 -1
- package/dist/UnderlineNav-C8onw9Na.js +0 -1
- package/dist/_rollupPluginBabelHelpers-DfQAiTCw.js +0 -1
- package/dist/abap-kIO_7z1o.js +0 -1
- package/dist/actionscript-3-DiaraCXE.js +0 -1
- package/dist/ada-aNFKX2pl.js +0 -1
- package/dist/angular-html-y0qIEhS2.js +0 -1
- package/dist/angular-ts-Bn_6f37o.js +0 -1
- package/dist/apache-Cx7e0H64.js +0 -1
- package/dist/apex-CdSCJjuL.js +0 -1
- package/dist/apl-BDzWBUim.js +0 -1
- package/dist/applescript-CJFkzk5i.js +0 -1
- package/dist/ara-BC9R9M5c.js +0 -1
- package/dist/asciidoc-lqQQs4M0.js +0 -1
- package/dist/asm-QQeI-gwp.js +0 -1
- package/dist/astro-BPstp8LF.js +0 -1
- package/dist/awk-Cxb7Sqvk.js +0 -1
- package/dist/ballerina-G8TyVc6O.js +0 -1
- package/dist/bat-UDEmXz-g.js +0 -1
- package/dist/beancount-BWg86rhE.js +0 -1
- package/dist/berry-5E5uGOYg.js +0 -1
- package/dist/bibtex-CZn_FFnb.js +0 -1
- package/dist/bicep-D_G0XT5J.js +0 -1
- package/dist/blade-7dxmctkK.js +0 -1
- package/dist/c-CrEz-oYf.js +0 -1
- package/dist/cadence-BulSIR1A.js +0 -1
- package/dist/clarity-m2OigCMT.js +0 -1
- package/dist/clojure-Bpes2rhL.js +0 -1
- package/dist/cmake-C4Tr1SQC.js +0 -1
- package/dist/cobol-Dp8xGW1S.js +0 -1
- package/dist/codeowners-Bs3mpoau.js +0 -1
- package/dist/codeql-CvQzaisq.js +0 -1
- package/dist/coffee-DOjtyJj_.js +0 -1
- package/dist/common-lisp-DGVR8DFi.js +0 -1
- package/dist/cpp-BUT7C4Bo.js +0 -1
- package/dist/crystal-BJh9OJ1_.js +0 -1
- package/dist/csharp-BhZuAD8H.js +0 -1
- package/dist/css-8_G4_UCW.js +0 -1
- package/dist/csv-DLRyYdMG.js +0 -1
- package/dist/cue-DAgMCCsT.js +0 -1
- package/dist/cypher-CtSiSKRh.js +0 -1
- package/dist/d-feZJOTtr.js +0 -1
- package/dist/dark-plus-Dcn2h2HL.js +0 -1
- package/dist/dart-CNOu4aud.js +0 -1
- package/dist/dax-Dkp1Uj6t.js +0 -1
- package/dist/desktop-CAGQzotA.js +0 -1
- package/dist/diff-D6yk3_ZG.js +0 -1
- package/dist/docker-BdTrQq0b.js +0 -1
- package/dist/dotenv-BeHGAMs7.js +0 -1
- package/dist/dracula-BUaMrXr0.js +0 -1
- package/dist/dracula-soft-CBx6n76m.js +0 -1
- package/dist/dream-maker-BU0sZZmb.js +0 -1
- package/dist/edge-D2Tk5tmg.js +0 -1
- package/dist/elixir-B-l3Nz-G.js +0 -1
- package/dist/elm-Bqm7aRpV.js +0 -1
- package/dist/emacs-lisp-BSvpfolf.js +0 -1
- package/dist/erb-CwBHxfFV.js +0 -1
- package/dist/erlang-B0PtHWg2.js +0 -1
- package/dist/fennel-CdN4E9Xo.js +0 -1
- package/dist/fish-XrbYjeRx.js +0 -1
- package/dist/fluent-zYsEgElv.js +0 -1
- package/dist/fortran-fixed-form-CPwX6okW.js +0 -1
- package/dist/fortran-free-form-B6Kk9658.js +0 -1
- package/dist/fsharp-CbMfVCMr.js +0 -1
- package/dist/gdresource-CdRUpBQO.js +0 -1
- package/dist/gdscript-CYXv_Ac9.js +0 -1
- package/dist/gdshader-CtiaGYI5.js +0 -1
- package/dist/genie-C-gOIth7.js +0 -1
- package/dist/gherkin-uGsOfG-k.js +0 -1
- package/dist/git-commit-CWQvkRNX.js +0 -1
- package/dist/git-rebase-BZ0YVJ-O.js +0 -1
- package/dist/github-dark-DCm4kydX.js +0 -1
- package/dist/github-dark-dimmed-CsRUrOJA.js +0 -1
- package/dist/github-from-css-CTRi6tFC.js +0 -1
- package/dist/github-light-B2ofRYMU.js +0 -1
- package/dist/gleam-C9ZZ3Vp2.js +0 -1
- package/dist/glimmer-js-Cuwfndkm.js +0 -1
- package/dist/glimmer-ts-D8nR8_k2.js +0 -1
- package/dist/glsl-qc_rLvzz.js +0 -1
- package/dist/gnuplot-BgHAcd--.js +0 -1
- package/dist/go-Dm8VBUM2.js +0 -1
- package/dist/graphql-CRmnB6D5.js +0 -1
- package/dist/groovy-DJcw8dX4.js +0 -1
- package/dist/hack-DYOVz52F.js +0 -1
- package/dist/haml-j8Vx_P4q.js +0 -1
- package/dist/handlebars-Qz3hgrPG.js +0 -1
- package/dist/haskell-DE3vVmXn.js +0 -1
- package/dist/haxe-DpuNPTTj.js +0 -1
- package/dist/hcl-BvV3VZ9s.js +0 -1
- package/dist/hjson-CsTZvU0B.js +0 -1
- package/dist/hlsl-BLZumTGu.js +0 -1
- package/dist/html-BJsWDmIe.js +0 -1
- package/dist/html-derivative-zDWJvwg5.js +0 -1
- package/dist/http-BiMppEBd.js +0 -1
- package/dist/hxml-DG2jWwyK.js +0 -1
- package/dist/hy-C9zVJlJf.js +0 -1
- package/dist/imba-DGD1mm8E.js +0 -1
- package/dist/index-TKJ66_wI.js +0 -1
- package/dist/ini-CU7wgrgh.js +0 -1
- package/dist/java-DyOZhX5L.js +0 -1
- package/dist/javascript-C0AWZ4eK.js +0 -1
- package/dist/jinja-Lc82IfGI.js +0 -1
- package/dist/jison-DT7Oqeqm.js +0 -1
- package/dist/json-Zoq3rK60.js +0 -1
- package/dist/json5-BOFh3mt2.js +0 -1
- package/dist/jsonc-CPutX9W5.js +0 -1
- package/dist/jsonl-xWfKSBhV.js +0 -1
- package/dist/jsonnet-UcnvaLwK.js +0 -1
- package/dist/jssm-BRT8_Uqd.js +0 -1
- package/dist/jsx-B4WNxrCK.js +0 -1
- package/dist/julia-i7_3XSV_.js +0 -1
- package/dist/kotlin-B_s0KNy5.js +0 -1
- package/dist/kusto-CDr4m-xT.js +0 -1
- package/dist/latex-BNB6MZrj.js +0 -1
- package/dist/lean-2dBp1asm.js +0 -1
- package/dist/less-CfPPFFsV.js +0 -1
- package/dist/light-plus-glPHycm5.js +0 -1
- package/dist/liquid-Bj1DN66U.js +0 -1
- package/dist/log-CKSz9t_o.js +0 -1
- package/dist/logo-D3UPVeLP.js +0 -1
- package/dist/lua-C1EFGxtA.js +0 -1
- package/dist/luau-Dvb2LLsw.js +0 -1
- package/dist/make-TqphZF-7.js +0 -1
- package/dist/markdown-yX62Igf3.js +0 -1
- package/dist/marko-LH6NoP97.js +0 -1
- package/dist/material-darker-D6whucX3.js +0 -1
- package/dist/material-default-DYqS7fqa.js +0 -1
- package/dist/material-from-css-DlWo_ZDV.js +0 -1
- package/dist/material-lighter-CYQaMsGh.js +0 -1
- package/dist/material-ocean-Dl_zLA-F.js +0 -1
- package/dist/material-palenight-Cd4X9kqy.js +0 -1
- package/dist/matlab-Dy9K5GW8.js +0 -1
- package/dist/mdc-DhAfBnnn.js +0 -1
- package/dist/mdx-tnT2uTqR.js +0 -1
- package/dist/mermaid-aEaCok9S.js +0 -1
- package/dist/min-dark-CpapYCVz.js +0 -1
- package/dist/min-light-plRN0zW-.js +0 -1
- package/dist/mojo-BanaVmFY.js +0 -1
- package/dist/monokai-Cs2_BG4b.js +0 -1
- package/dist/move-B_kaWhAV.js +0 -1
- package/dist/narrat-6tChrAmV.js +0 -1
- package/dist/nextflow-BYB6CU6V.js +0 -1
- package/dist/nginx-Clr7XfzW.js +0 -1
- package/dist/nim-gLesixmv.js +0 -1
- package/dist/nix-DCgUXh-o.js +0 -1
- package/dist/nord-BHSE8FbR.js +0 -1
- package/dist/nushell-DDKGkuZY.js +0 -1
- package/dist/objective-c-BsQdhSk0.js +0 -1
- package/dist/objective-cpp-B-VZlBXW.js +0 -1
- package/dist/ocaml-B19L2xxl.js +0 -1
- package/dist/one-dark-pro-AWPQgJbJ.js +0 -1
- package/dist/pascal-B0kVBVTU.js +0 -1
- package/dist/perl-Bs2cXIO6.js +0 -1
- package/dist/php-BgaH_AHK.js +0 -1
- package/dist/plsql-CPY7hT9n.js +0 -1
- package/dist/po-BszTsnLZ.js +0 -1
- package/dist/poimandres-CZF4JUv5.js +0 -1
- package/dist/postcss-DQ0frX96.js +0 -1
- package/dist/powerquery-BitONm6p.js +0 -1
- package/dist/powershell-B_lVHVgu.js +0 -1
- package/dist/prisma-CqkE3olT.js +0 -1
- package/dist/prolog-Bpuon3aK.js +0 -1
- package/dist/proto-C349dup0.js +0 -1
- package/dist/pug-Bbf3g_hT.js +0 -1
- package/dist/puppet-qDtDc0so.js +0 -1
- package/dist/purescript-C03CHyrT.js +0 -1
- package/dist/python-D5e4BtVB.js +0 -1
- package/dist/qml-LVCeHqxw.js +0 -1
- package/dist/qmldir-BEg8Q-XX.js +0 -1
- package/dist/qss-vq-U9k0N.js +0 -1
- package/dist/r-DnCIdoUu.js +0 -1
- package/dist/racket-BQt8mf2o.js +0 -1
- package/dist/raku-ChTHpuBS.js +0 -1
- package/dist/razor-CjFZSXD2.js +0 -1
- package/dist/reg-12gGsscy.js +0 -1
- package/dist/regexp-zLCCZKTi.js +0 -1
- package/dist/rel-aZ4oe34Q.js +0 -1
- package/dist/riscv-BA9R8KI2.js +0 -1
- package/dist/rose-pine-8QECO0Ox.js +0 -1
- package/dist/rose-pine-dawn-DT77ObZh.js +0 -1
- package/dist/rose-pine-moon-D3-I8ETF.js +0 -1
- package/dist/rst-DFKlxnrd.js +0 -1
- package/dist/ruby-BypI_hk5.js +0 -1
- package/dist/rust-tE6tRkqD.js +0 -1
- package/dist/sas-D1sMUJql.js +0 -1
- package/dist/sass-DBEOLVv3.js +0 -1
- package/dist/scala-DUzir4os.js +0 -1
- package/dist/scheme-dsSqVZz3.js +0 -1
- package/dist/scss-B0kJw1gM.js +0 -1
- package/dist/shaderlab-Cd8Cbryn.js +0 -1
- package/dist/shellscript-BL-Ihj2z.js +0 -1
- package/dist/shellsession-C5KJPcFG.js +0 -1
- package/dist/slack-dark-JbsLGggd.js +0 -1
- package/dist/slack-ochin-hTeCADjA.js +0 -1
- package/dist/smalltalk-DQ23HuGh.js +0 -1
- package/dist/solarized-dark-D2bQRcX7.js +0 -1
- package/dist/solarized-light-6xrOKoxI.js +0 -1
- package/dist/solidity-DUCwohjn.js +0 -1
- package/dist/soy-Cy4pRjbu.js +0 -1
- package/dist/sparql-D7gNTkUq.js +0 -1
- package/dist/splunk-Dvl5Xm98.js +0 -1
- package/dist/sql-BfoT44Al.js +0 -1
- package/dist/ssh-config-C-ZFySPN.js +0 -1
- package/dist/stata-Dpw9jvge.js +0 -1
- package/dist/stylus-mJ9_5M6n.js +0 -1
- package/dist/svelte-DD5dtnEi.js +0 -1
- package/dist/swift-DDernUpH.js +0 -1
- package/dist/system-verilog-DeXSd9Py.js +0 -1
- package/dist/systemd-NetTuLPL.js +0 -1
- package/dist/tasl-BCm9L3tI.js +0 -1
- package/dist/tcl-DmWVgxCm.js +0 -1
- package/dist/templ-B7wt_K-d.js +0 -1
- package/dist/terraform-DYIIsq8p.js +0 -1
- package/dist/tex-DFj0qpOD.js +0 -1
- package/dist/toml-CFu3vY0Q.js +0 -1
- package/dist/ts-tags-BvMEeGTJ.js +0 -1
- package/dist/tsv-DnenRF8k.js +0 -1
- package/dist/tsx-DooqfEr1.js +0 -1
- package/dist/turtle-DKlxyehf.js +0 -1
- package/dist/twig-DpQc8FUF.js +0 -1
- package/dist/txt-C4tHEtDr.js +0 -1
- package/dist/typescript-DtE5sB_4.js +0 -1
- package/dist/typespec-B69vp3jc.js +0 -1
- package/dist/typst-BzEngGMo.js +0 -1
- package/dist/v-Dy6tTX8K.js +0 -1
- package/dist/vala-DQnmDtkE.js +0 -1
- package/dist/vb-CqTjXY4K.js +0 -1
- package/dist/verilog-D6Zfe00a.js +0 -1
- package/dist/vhdl-Dxu0BOr9.js +0 -1
- package/dist/viml-eXtfIM-m.js +0 -1
- package/dist/vue-D3vey6Cu.js +0 -1
- package/dist/vue-html-DyaqvCGV.js +0 -1
- package/dist/vyper-C6AULW8C.js +0 -1
- package/dist/wasm-Cl39COlm.js +0 -1
- package/dist/wenyan-DJGdsiXE.js +0 -1
- package/dist/wgsl-CDhIPMwJ.js +0 -1
- package/dist/wikitext-D05PpJ8X.js +0 -1
- package/dist/wolfram-JgWnd2g7.js +0 -1
- package/dist/xml-Cc1Sy-d4.js +0 -1
- package/dist/xsl-CEYTrbD0.js +0 -1
- package/dist/yaml-NvTdC05o.js +0 -1
- package/dist/zenscript-De0mU_BW.js +0 -1
- package/dist/zig-D9TJVGyp.js +0 -1
- package/src/coder/CodeCopy/CodeCopy.style.tsx +0 -21
- package/src/coder/CodeSample/CodeSample.styles.tsx +0 -137
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
const globalPageGutter = '8px';
|
|
4
|
+
export const globalHeaderHeight = '50px';
|
|
5
|
+
const globalHeaderWarningHeight = "0px";
|
|
6
|
+
const contentTopSpace = "12px";
|
|
7
|
+
|
|
8
|
+
const globalHeaderHeightWithSub = '94px';
|
|
9
|
+
|
|
10
|
+
const cubicMove = "cubic-bezier(.65, 0, .35, 1)";
|
|
11
|
+
const sidebarWidth = "250px";
|
|
12
|
+
|
|
13
|
+
const tabletBreakpoint = '1024px';
|
|
14
|
+
const mobileBreakpoint = '768px';
|
|
15
|
+
|
|
16
|
+
// TODO: better solution - design tokens
|
|
17
|
+
export const globals = css`
|
|
18
|
+
:global() {
|
|
19
|
+
:root {
|
|
20
|
+
--xyd-navbar-height: ${globalHeaderHeight};
|
|
21
|
+
--xyd-global-page-gutter: ${globalPageGutter};
|
|
22
|
+
--xyd-sidebar-width: ${sidebarWidth};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const LayoutPrimaryHost = css`
|
|
28
|
+
width: 100%;
|
|
29
|
+
overflow-x: hidden;
|
|
30
|
+
background: #fff;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const LayoutPrimaryHeader = css`
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
align-items: center;
|
|
37
|
+
position: fixed;
|
|
38
|
+
top: ${globalHeaderWarningHeight};
|
|
39
|
+
right: ${globalPageGutter};
|
|
40
|
+
left: ${globalPageGutter};
|
|
41
|
+
height: ${globalHeaderHeight};
|
|
42
|
+
z-index: 20;
|
|
43
|
+
background: #fff;
|
|
44
|
+
|
|
45
|
+
@media (max-width: 768px) {
|
|
46
|
+
padding: 0;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export const LayoutPrimaryHeaderContent = css`
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
width: 100%;
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const LayoutPrimaryHeaderSub = css`
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
height: ${globalHeaderHeightWithSub};
|
|
59
|
+
transition: transform 200ms;
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
export const LayoutPrimaryHeaderHideMain = css`
|
|
63
|
+
transform: translateY(calc(-${globalHeaderHeight} + 3px));
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const LayoutPrimaryHamburgerButton = css`
|
|
67
|
+
display: none;
|
|
68
|
+
|
|
69
|
+
@media (max-width: 768px) {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
width: 40px;
|
|
74
|
+
height: 40px;
|
|
75
|
+
border: none;
|
|
76
|
+
background: none;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
export const LayoutPrimaryHamburgerIcon = css`
|
|
83
|
+
width: 24px;
|
|
84
|
+
height: 24px;
|
|
85
|
+
position: relative;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
export const LayoutPrimaryHamburgerLine = css`
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 2px;
|
|
94
|
+
background: #000;
|
|
95
|
+
transition: transform 0.3s ${cubicMove};
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
export const LayoutPrimaryHamburgerLineOpen = css`
|
|
99
|
+
&:first-child {
|
|
100
|
+
transform: translateY(11px) rotate(45deg);
|
|
101
|
+
}
|
|
102
|
+
&:nth-child(2) {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
}
|
|
105
|
+
&:last-child {
|
|
106
|
+
transform: translateY(-11px) rotate(-45deg);
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
export const LayoutPrimaryMain = css`
|
|
111
|
+
position: fixed;
|
|
112
|
+
display: flex;
|
|
113
|
+
top: calc(${globalHeaderHeight} + ${globalHeaderWarningHeight});
|
|
114
|
+
bottom: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
right: 0;
|
|
117
|
+
padding: ${globalPageGutter};
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
|
|
120
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
121
|
+
padding-top: calc(${globalHeaderHeight} + ${globalHeaderWarningHeight} + ${globalPageGutter});
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
export const LayoutPrimaryMainSub = css`
|
|
126
|
+
top: calc(${globalHeaderHeightWithSub} + ${globalHeaderWarningHeight});
|
|
127
|
+
|
|
128
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
129
|
+
padding-top: calc(${globalHeaderHeightWithSub} + ${globalHeaderWarningHeight} + ${globalPageGutter});
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
export const LayoutPrimaryStaticSidebar = css`
|
|
134
|
+
flex: none;
|
|
135
|
+
width: ${sidebarWidth};
|
|
136
|
+
background: #fff;
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
position: relative;
|
|
140
|
+
height: 100%;
|
|
141
|
+
|
|
142
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
|
|
147
|
+
export const LayoutPrimaryMobileSidebar = css`
|
|
148
|
+
display: none;
|
|
149
|
+
|
|
150
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
151
|
+
display: flex;
|
|
152
|
+
position: fixed;
|
|
153
|
+
top: 0;
|
|
154
|
+
bottom: 0;
|
|
155
|
+
left: 0;
|
|
156
|
+
width: ${sidebarWidth};
|
|
157
|
+
background: #fff;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
z-index: 50;
|
|
160
|
+
transform: translateX(-100%);
|
|
161
|
+
transition: transform .3s ${cubicMove};
|
|
162
|
+
box-shadow: 4px 0 8px rgba(0, 0, 0, 0.1);
|
|
163
|
+
}
|
|
164
|
+
`;
|
|
165
|
+
|
|
166
|
+
export const LayoutPrimaryMobileSidebarOpen = css`
|
|
167
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
168
|
+
transform: translateX(0);
|
|
169
|
+
}
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
export const LayoutPrimarySidebarContent = css`
|
|
173
|
+
flex: 1;
|
|
174
|
+
overflow-y: auto;
|
|
175
|
+
-webkit-overflow-scrolling: touch;
|
|
176
|
+
height: 100%;
|
|
177
|
+
`;
|
|
178
|
+
|
|
179
|
+
export const LayoutPrimaryCloseButton = css`
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: 12px;
|
|
182
|
+
right: 12px;
|
|
183
|
+
width: 32px;
|
|
184
|
+
height: 32px;
|
|
185
|
+
border: none;
|
|
186
|
+
background: none;
|
|
187
|
+
padding: 0;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
`;
|
|
193
|
+
|
|
194
|
+
export const LayoutPrimarySearchInput = css`
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 40px;
|
|
197
|
+
padding: 0 12px;
|
|
198
|
+
border: 1px solid #eaeaea;
|
|
199
|
+
border-radius: 6px;
|
|
200
|
+
font-size: 14px;
|
|
201
|
+
outline: none;
|
|
202
|
+
transition: border-color 0.2s;
|
|
203
|
+
|
|
204
|
+
&:focus {
|
|
205
|
+
border-color: #666;
|
|
206
|
+
}
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
export const LayoutPrimaryCloseIcon = css`
|
|
210
|
+
width: 20px;
|
|
211
|
+
height: 20px;
|
|
212
|
+
position: relative;
|
|
213
|
+
|
|
214
|
+
&::before,
|
|
215
|
+
&::after {
|
|
216
|
+
content: '';
|
|
217
|
+
position: absolute;
|
|
218
|
+
top: 50%;
|
|
219
|
+
left: 0;
|
|
220
|
+
width: 100%;
|
|
221
|
+
height: 2px;
|
|
222
|
+
background: #666;
|
|
223
|
+
transform-origin: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&::before {
|
|
227
|
+
transform: rotate(45deg);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&::after {
|
|
231
|
+
transform: rotate(-45deg);
|
|
232
|
+
}
|
|
233
|
+
`;
|
|
234
|
+
|
|
235
|
+
export const LayoutPrimaryOverlay = css`
|
|
236
|
+
display: none;
|
|
237
|
+
|
|
238
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
239
|
+
display: block;
|
|
240
|
+
position: fixed;
|
|
241
|
+
top: 0;
|
|
242
|
+
right: 0;
|
|
243
|
+
bottom: 0;
|
|
244
|
+
left: 0;
|
|
245
|
+
background: rgba(0, 0, 0, 0.6);
|
|
246
|
+
transition: opacity .3s;
|
|
247
|
+
opacity: 0;
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
z-index: 40;
|
|
250
|
+
height: 100vh;
|
|
251
|
+
}
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
export const LayoutPrimaryOverlayVisible = css`
|
|
255
|
+
opacity: 1;
|
|
256
|
+
pointer-events: auto;
|
|
257
|
+
`;
|
|
258
|
+
|
|
259
|
+
export const LayoutPrimaryPageHost = css`
|
|
260
|
+
position: relative;
|
|
261
|
+
flex: 1;
|
|
262
|
+
background: #fff;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
height: 100%;
|
|
266
|
+
`;
|
|
267
|
+
|
|
268
|
+
export const LayoutPrimaryPageScroll = css`
|
|
269
|
+
overflow-y: auto;
|
|
270
|
+
height: 100%;
|
|
271
|
+
-webkit-overflow-scrolling: touch;
|
|
272
|
+
padding: 0 48px;
|
|
273
|
+
|
|
274
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
275
|
+
padding: 0 32px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@media (max-width: ${mobileBreakpoint}) {
|
|
279
|
+
padding: 0 24px;
|
|
280
|
+
}
|
|
281
|
+
`;
|
|
282
|
+
|
|
283
|
+
export const LayoutPrimaryPageContainer = css`
|
|
284
|
+
max-width: 1000px;
|
|
285
|
+
margin: 0 auto;
|
|
286
|
+
padding: 0 ${globalPageGutter};
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
export const LayoutPrimaryPageContainerLarge = css`
|
|
290
|
+
max-width: 1200px;
|
|
291
|
+
`;
|
|
292
|
+
|
|
293
|
+
export const LayoutPrimaryPageArticleContainer = css`
|
|
294
|
+
display: flex;
|
|
295
|
+
gap: 48px;
|
|
296
|
+
padding: 48px 0;
|
|
297
|
+
min-height: 100%;
|
|
298
|
+
|
|
299
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
300
|
+
gap: 32px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@media (max-width: ${mobileBreakpoint}) {
|
|
304
|
+
flex-direction: column;
|
|
305
|
+
padding: 24px 0;
|
|
306
|
+
gap: 24px;
|
|
307
|
+
}
|
|
308
|
+
`;
|
|
309
|
+
|
|
310
|
+
export const LayoutPrimaryArticleHost = css`
|
|
311
|
+
flex: 1;
|
|
312
|
+
min-width: 0;
|
|
313
|
+
`;
|
|
314
|
+
|
|
315
|
+
export const LayoutPrimaryArticleContent = css`
|
|
316
|
+
width: 100%;
|
|
317
|
+
`;
|
|
318
|
+
|
|
319
|
+
export const LayoutPrimaryArticleNav = css`
|
|
320
|
+
flex: none;
|
|
321
|
+
width: 256px;
|
|
322
|
+
position: sticky;
|
|
323
|
+
top: 0;
|
|
324
|
+
height: fit-content;
|
|
325
|
+
max-height: 100vh;
|
|
326
|
+
overflow-y: auto;
|
|
327
|
+
padding-right: 24px;
|
|
328
|
+
padding-top: ${contentTopSpace};
|
|
329
|
+
|
|
330
|
+
@media (max-width: ${tabletBreakpoint}) {
|
|
331
|
+
width: 200px;
|
|
332
|
+
padding-right: 16px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@media (max-width: ${mobileBreakpoint}) {
|
|
336
|
+
width: 100%;
|
|
337
|
+
position: static;
|
|
338
|
+
max-height: none;
|
|
339
|
+
padding-right: 0;
|
|
340
|
+
}
|
|
341
|
+
`;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React, {useEffect, useState} from "react"
|
|
2
|
+
|
|
3
|
+
import * as cn from "./LayoutPrimary.styles"
|
|
4
|
+
|
|
5
|
+
export interface LayoutPrimaryProps {
|
|
6
|
+
header: React.ReactNode;
|
|
7
|
+
aside: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
contentNav?: React.ReactNode;
|
|
10
|
+
|
|
11
|
+
subheader?: React.ReactNode;
|
|
12
|
+
layoutSize?: "large"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// TODO: move scroller to xyd-foo
|
|
16
|
+
export function LayoutPrimary(props: LayoutPrimaryProps) {
|
|
17
|
+
const [isMobileNavOpen, setIsMobileNavOpen] = useState(false)
|
|
18
|
+
|
|
19
|
+
const {hideMainHeader} = props.subheader ? useSubHeader() : {hideMainHeader: false}
|
|
20
|
+
|
|
21
|
+
return <div className={cn.LayoutPrimaryHost}>
|
|
22
|
+
<header className={`
|
|
23
|
+
${cn.LayoutPrimaryHeader}
|
|
24
|
+
${props.subheader && cn.LayoutPrimaryHeaderSub}
|
|
25
|
+
${hideMainHeader && cn.LayoutPrimaryHeaderHideMain}
|
|
26
|
+
`}>
|
|
27
|
+
<div className={cn.LayoutPrimaryHeaderContent}>
|
|
28
|
+
{props.header}
|
|
29
|
+
<button
|
|
30
|
+
className={cn.LayoutPrimaryHamburgerButton}
|
|
31
|
+
onClick={() => setIsMobileNavOpen(!isMobileNavOpen)}
|
|
32
|
+
aria-label="Toggle navigation menu"
|
|
33
|
+
>
|
|
34
|
+
<div className={cn.LayoutPrimaryHamburgerIcon}>
|
|
35
|
+
<span
|
|
36
|
+
className={`${cn.LayoutPrimaryHamburgerLine} ${isMobileNavOpen ? cn.LayoutPrimaryHamburgerLineOpen : ''}`}/>
|
|
37
|
+
<span
|
|
38
|
+
className={`${cn.LayoutPrimaryHamburgerLine} ${isMobileNavOpen ? cn.LayoutPrimaryHamburgerLineOpen : ''}`}/>
|
|
39
|
+
<span
|
|
40
|
+
className={`${cn.LayoutPrimaryHamburgerLine} ${isMobileNavOpen ? cn.LayoutPrimaryHamburgerLineOpen : ''}`}/>
|
|
41
|
+
</div>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
{props.subheader}
|
|
45
|
+
</header>
|
|
46
|
+
|
|
47
|
+
{/* Mobile Drawer Sidebar */}
|
|
48
|
+
<div
|
|
49
|
+
className={`${cn.LayoutPrimaryOverlay} ${isMobileNavOpen ? cn.LayoutPrimaryOverlayVisible : ''}`}
|
|
50
|
+
onClick={() => setIsMobileNavOpen(false)}
|
|
51
|
+
/>
|
|
52
|
+
<aside className={`
|
|
53
|
+
${cn.LayoutPrimaryMobileSidebar}
|
|
54
|
+
${isMobileNavOpen ? cn.LayoutPrimaryMobileSidebarOpen : ''}
|
|
55
|
+
`}>
|
|
56
|
+
<div className={cn.LayoutPrimarySidebarContent}>
|
|
57
|
+
{props.aside}
|
|
58
|
+
</div>
|
|
59
|
+
<button
|
|
60
|
+
className={cn.LayoutPrimaryCloseButton}
|
|
61
|
+
onClick={() => setIsMobileNavOpen(false)}
|
|
62
|
+
aria-label="Close navigation menu"
|
|
63
|
+
>
|
|
64
|
+
<div className={cn.LayoutPrimaryCloseIcon}/>
|
|
65
|
+
</button>
|
|
66
|
+
</aside>
|
|
67
|
+
|
|
68
|
+
<main className={`
|
|
69
|
+
${cn.LayoutPrimaryMain}
|
|
70
|
+
${!hideMainHeader && props.subheader && cn.LayoutPrimaryMainSub}
|
|
71
|
+
`}>
|
|
72
|
+
{/* Desktop Static Sidebar */}
|
|
73
|
+
<aside className={cn.LayoutPrimaryStaticSidebar}>
|
|
74
|
+
{props.aside}
|
|
75
|
+
</aside>
|
|
76
|
+
|
|
77
|
+
<div className={cn.LayoutPrimaryPageHost}>
|
|
78
|
+
<div className={cn.LayoutPrimaryPageScroll}>
|
|
79
|
+
<div className={`
|
|
80
|
+
${cn.LayoutPrimaryPageContainer}
|
|
81
|
+
${props.layoutSize == "large" && cn.LayoutPrimaryPageContainerLarge}
|
|
82
|
+
`}>
|
|
83
|
+
<div className={cn.LayoutPrimaryPageArticleContainer}>
|
|
84
|
+
<article className={cn.LayoutPrimaryArticleHost}>
|
|
85
|
+
<section className={cn.LayoutPrimaryArticleContent}>
|
|
86
|
+
{props.content}
|
|
87
|
+
</section>
|
|
88
|
+
</article>
|
|
89
|
+
{props.contentNav && <nav className={cn.LayoutPrimaryArticleNav}>
|
|
90
|
+
{props.contentNav}
|
|
91
|
+
</nav>}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</main>
|
|
97
|
+
</div>
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// TODO: move to `xyd-foo` or somewhere else
|
|
101
|
+
function useSubHeader() {
|
|
102
|
+
const [hideMainHeader, setHideMainHeader] = useState(false)
|
|
103
|
+
const [scrollTop, setScrollTop] = useState(0)
|
|
104
|
+
const [controlScrollPos, setControlScrollPos] = useState(0)
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (scrollTop === controlScrollPos) {
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const checkpoint = parseInt(cn.globalHeaderHeight, 10) / 2
|
|
112
|
+
const diff = scrollTop - controlScrollPos
|
|
113
|
+
const reversePosDiff = Math.abs(scrollTop - controlScrollPos)
|
|
114
|
+
|
|
115
|
+
if (diff > checkpoint) {
|
|
116
|
+
setHideMainHeader(true)
|
|
117
|
+
} else if (reversePosDiff > checkpoint) {
|
|
118
|
+
setHideMainHeader(false)
|
|
119
|
+
}
|
|
120
|
+
}, [
|
|
121
|
+
scrollTop,
|
|
122
|
+
controlScrollPos,
|
|
123
|
+
]);
|
|
124
|
+
|
|
125
|
+
function onScroll(e: Event) {
|
|
126
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const scroll = e.target?.scrollTop
|
|
131
|
+
setScrollTop(scroll)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function onScrollFinish(e: Event) {
|
|
135
|
+
if (!(e.target instanceof HTMLElement)) {
|
|
136
|
+
return
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
setControlScrollPos(e.target?.scrollTop)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// TODO: by ref?
|
|
143
|
+
// TODO: MOVE SOMEWHERE ELSE BECAUSE IT DECREASE PERFORMANCE (RERENDER)
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
document.querySelector(`.${cn.LayoutPrimaryPageScroll}`)?.addEventListener("scroll", onScroll)
|
|
146
|
+
document.querySelector(`.${cn.LayoutPrimaryPageScroll}`)?.addEventListener("scrollend", onScrollFinish)
|
|
147
|
+
|
|
148
|
+
return () => {
|
|
149
|
+
document.querySelector(`.${cn.LayoutPrimaryPageScroll}`)?.removeEventListener("scroll", onScroll)
|
|
150
|
+
document.querySelector(`.${cn.LayoutPrimaryPageScroll}`)?.removeEventListener("scrollend", onScrollFinish)
|
|
151
|
+
}
|
|
152
|
+
}, []);
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
hideMainHeader,
|
|
156
|
+
}
|
|
157
|
+
}
|
package/src/layouts/index.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// TODO: move this pkg @xyd-js/layouts ?
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
LayoutPrimary,
|
|
5
|
+
type LayoutPrimaryProps
|
|
6
|
+
} from "./LayoutPrimary";
|
|
7
|
+
|
|
3
8
|
export {
|
|
4
9
|
Layout
|
|
5
10
|
} from "./Layout";
|
|
6
11
|
|
|
7
|
-
export type {LayoutProps} from "./Layout";
|
|
12
|
+
export type {LayoutProps} from "./Layout";
|
|
13
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const HomePageCardsHost = css`
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-template-columns: repeat(2, 500px);
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: 30px;
|
|
8
|
+
|
|
9
|
+
@media (max-width: 1200px) {
|
|
10
|
+
grid-template-columns: repeat(2, 1fr);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (max-width: 768px) {
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import
|
|
2
|
+
import * as cn from "./HomePage.styles";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
GuideCard,
|
|
@@ -9,23 +9,6 @@ import {HomeView} from "../../views"
|
|
|
9
9
|
|
|
10
10
|
import {IHomePageHero, IHomePageFeature} from "./types";
|
|
11
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
12
|
export interface HomePageProps {
|
|
30
13
|
header: React.ReactNode
|
|
31
14
|
|
|
@@ -50,11 +33,14 @@ export function HomePage(props: HomePageProps) {
|
|
|
50
33
|
}
|
|
51
34
|
|
|
52
35
|
function $Hero(props: HomePageProps) {
|
|
36
|
+
const subtitle = typeof props.hero?.subtitle === 'string'
|
|
37
|
+
? props.hero.subtitle
|
|
38
|
+
: props.hero?.subtitle?.toString() || "";
|
|
39
|
+
|
|
53
40
|
return <CTABanner>
|
|
54
41
|
<CTABanner.Heading
|
|
55
42
|
title={props.hero?.text || ""}
|
|
56
|
-
|
|
57
|
-
subtitle={props.hero?.subtitle}
|
|
43
|
+
subtitle={subtitle}
|
|
58
44
|
/>
|
|
59
45
|
{props?.hero?.actions && <CTABanner.ButtonGroup>
|
|
60
46
|
{props?.hero?.actions.map((action, index) => (
|
|
@@ -72,7 +58,7 @@ function $Cards(props: HomePageProps) {
|
|
|
72
58
|
// TODO: cards gridTemplateColumns based on elements
|
|
73
59
|
return <div
|
|
74
60
|
className={`
|
|
75
|
-
${
|
|
61
|
+
${cn.HomePageCardsHost}
|
|
76
62
|
xyd_page-comp-homepage-cards
|
|
77
63
|
`}>
|
|
78
64
|
{props.features?.map((feat, index) => (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
move to `@xyd-js/pages` ?
|
package/src/pages/index.ts
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {css} from "@linaria/core";
|
|
2
|
+
|
|
3
|
+
export const LoaderHost = css`
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
export const LoaderDots = css`
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const LoaderDot = css`
|
|
15
|
+
width: 8px;
|
|
16
|
+
height: 8px;
|
|
17
|
+
background-color: currentColor;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
animation: pulse 1.4s infinite ease-in-out;
|
|
20
|
+
opacity: 0.6;
|
|
21
|
+
|
|
22
|
+
&:nth-of-type(2) {
|
|
23
|
+
animation-delay: 0.2s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:nth-of-type(3) {
|
|
27
|
+
animation-delay: 0.4s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes pulse {
|
|
31
|
+
0%, 80%, 100% {
|
|
32
|
+
transform: scale(0.6);
|
|
33
|
+
opacity: 0.4;
|
|
34
|
+
}
|
|
35
|
+
40% {
|
|
36
|
+
transform: scale(1);
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const LoaderSmall = css`
|
|
43
|
+
.${LoaderDot} {
|
|
44
|
+
width: 6px;
|
|
45
|
+
height: 6px;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const LoaderLarge = css`
|
|
50
|
+
.${LoaderDot} {
|
|
51
|
+
width: 12px;
|
|
52
|
+
height: 12px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
<div
|
|
12
|
+
className={`
|
|
13
|
+
${cn.LoaderHost}
|
|
14
|
+
${size === "small" && cn.LoaderSmall}
|
|
15
|
+
${size === "large" && cn.LoaderLarge}
|
|
16
|
+
${className}
|
|
17
|
+
`}
|
|
18
|
+
>
|
|
19
|
+
<div className={cn.LoaderDots}>
|
|
20
|
+
<div className={cn.LoaderDot} />
|
|
21
|
+
<div className={cn.LoaderDot} />
|
|
22
|
+
<div className={cn.LoaderDot} />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
package/src/ui/TODO.md
ADDED
package/src/ui/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Loader/Loader";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {css} from '@linaria/core';
|
|
2
|
+
|
|
3
|
+
type StyleObject = Record<string, string>;
|
|
4
|
+
type StyleFunction = (strings: TemplateStringsArray, ...values: any[]) => string;
|
|
5
|
+
|
|
6
|
+
export function useStyle<T extends StyleObject>(component: { styles: T }) {
|
|
7
|
+
const styled = {} as Record<keyof T, StyleFunction>;
|
|
8
|
+
|
|
9
|
+
for (const key of Object.keys(component.styles)) {
|
|
10
|
+
styled[key as keyof T] = (strings: TemplateStringsArray, ...values: any[]) => {
|
|
11
|
+
const customStyles = css`
|
|
12
|
+
${strings.reduce((result, str, i) => result + str + (values[i] || ''), '')}
|
|
13
|
+
`;
|
|
14
|
+
return `${component.styles[key]} ${customStyles}`;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return styled;
|
|
19
|
+
}
|