@limetech/kompendium 1.1.1
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/LICENSE +21 -0
- package/README.md +313 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +13 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js +69 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js.map +1 -0
- package/dist/cjs/index-DYiJ6dQL.js +1866 -0
- package/dist/cjs/index-DYiJ6dQL.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-app_7.cjs.entry.js +2924 -0
- package/dist/cjs/kompendium-code.cjs.entry.js +2724 -0
- package/dist/cjs/kompendium-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-component.cjs.entry.js +207 -0
- package/dist/cjs/kompendium-component.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-debug.cjs.entry.js +47 -0
- package/dist/cjs/kompendium-debug.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-code.cjs.entry.js +20 -0
- package/dist/cjs/kompendium-example-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-markdown.cjs.entry.js +165 -0
- package/dist/cjs/kompendium-example-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-guide.cjs.entry.js +33 -0
- package/dist/cjs/kompendium-guide.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-markdown.cjs.entry.js +48923 -0
- package/dist/cjs/kompendium-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-playground.cjs.entry.js +89 -0
- package/dist/cjs/kompendium-playground.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist.kompendium-taglist.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist_2.cjs.entry.js +49 -0
- package/dist/cjs/kompendium-type.cjs.entry.js +83 -0
- package/dist/cjs/kompendium-type.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium.cjs.js +25 -0
- package/dist/cjs/kompendium.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/markdown-types-B884tLd-.js +15 -0
- package/dist/cjs/markdown-types-B884tLd-.js.map +1 -0
- package/dist/cjs/methods-DoA78dOH.js +97 -0
- package/dist/cjs/methods-DoA78dOH.js.map +1 -0
- package/dist/cjs/types-SjA7Kcy_.js +8 -0
- package/dist/cjs/types-SjA7Kcy_.js.map +1 -0
- package/dist/collection/assets/favicon.svg +65 -0
- package/dist/collection/assets/icons/bookmark-fill.svg +1 -0
- package/dist/collection/assets/icons/danger.svg +1 -0
- package/dist/collection/assets/icons/debug.svg +1 -0
- package/dist/collection/assets/icons/important.svg +1 -0
- package/dist/collection/assets/icons/info.svg +1 -0
- package/dist/collection/assets/icons/logo.svg +1 -0
- package/dist/collection/assets/icons/note.svg +1 -0
- package/dist/collection/assets/icons/search.svg +1 -0
- package/dist/collection/assets/icons/tip.svg +1 -0
- package/dist/collection/assets/icons/warning.svg +1 -0
- package/dist/collection/assets/logotype.svg +64 -0
- package/dist/collection/collection-manifest.json +35 -0
- package/dist/collection/components/anchor-scroll.js +61 -0
- package/dist/collection/components/anchor-scroll.js.map +1 -0
- package/dist/collection/components/app/app.css +125 -0
- package/dist/collection/components/app/app.js +149 -0
- package/dist/collection/components/app/app.js.map +1 -0
- package/dist/collection/components/code/code.css +250 -0
- package/dist/collection/components/code/code.js +82 -0
- package/dist/collection/components/code/code.js.map +1 -0
- package/dist/collection/components/code/examples/code.js +14 -0
- package/dist/collection/components/code/examples/code.js.map +1 -0
- package/dist/collection/components/component/component.css +383 -0
- package/dist/collection/components/component/component.js +191 -0
- package/dist/collection/components/component/component.js.map +1 -0
- package/dist/collection/components/component/templates/events.js +32 -0
- package/dist/collection/components/component/templates/events.js.map +1 -0
- package/dist/collection/components/component/templates/examples.js +17 -0
- package/dist/collection/components/component/templates/examples.js.map +1 -0
- package/dist/collection/components/component/templates/methods.js +54 -0
- package/dist/collection/components/component/templates/methods.js.map +1 -0
- package/dist/collection/components/component/templates/props.js +36 -0
- package/dist/collection/components/component/templates/props.js.map +1 -0
- package/dist/collection/components/component/templates/slots.js +14 -0
- package/dist/collection/components/component/templates/slots.js.map +1 -0
- package/dist/collection/components/component/templates/style.js +14 -0
- package/dist/collection/components/component/templates/style.js.map +1 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.css +141 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js +90 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js.map +1 -0
- package/dist/collection/components/darkmode-switch/types.js +2 -0
- package/dist/collection/components/darkmode-switch/types.js.map +1 -0
- package/dist/collection/components/debug/debug.js +146 -0
- package/dist/collection/components/debug/debug.js.map +1 -0
- package/dist/collection/components/guide/guide.js +61 -0
- package/dist/collection/components/guide/guide.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown-example.js +150 -0
- package/dist/collection/components/markdown/examples/markdown-example.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown.js +14 -0
- package/dist/collection/components/markdown/examples/markdown.js.map +1 -0
- package/dist/collection/components/markdown/markdown-types.js +8 -0
- package/dist/collection/components/markdown/markdown-types.js.map +1 -0
- package/dist/collection/components/markdown/markdown.css +660 -0
- package/dist/collection/components/markdown/markdown.js +83 -0
- package/dist/collection/components/markdown/markdown.js.map +1 -0
- package/dist/collection/components/navigation/navigation.css +403 -0
- package/dist/collection/components/navigation/navigation.js +184 -0
- package/dist/collection/components/navigation/navigation.js.map +1 -0
- package/dist/collection/components/playground/playground.css +198 -0
- package/dist/collection/components/playground/playground.js +174 -0
- package/dist/collection/components/playground/playground.js.map +1 -0
- package/dist/collection/components/playground/playground.types.js +2 -0
- package/dist/collection/components/playground/playground.types.js.map +1 -0
- package/dist/collection/components/proplist/proplist.css +334 -0
- package/dist/collection/components/proplist/proplist.js +53 -0
- package/dist/collection/components/proplist/proplist.js.map +1 -0
- package/dist/collection/components/search/search.css +183 -0
- package/dist/collection/components/search/search.js +76 -0
- package/dist/collection/components/search/search.js.map +1 -0
- package/dist/collection/components/taglist/taglist.css +58 -0
- package/dist/collection/components/taglist/taglist.js +82 -0
- package/dist/collection/components/taglist/taglist.js.map +1 -0
- package/dist/collection/components/type/templates/alias.js +11 -0
- package/dist/collection/components/type/templates/alias.js.map +1 -0
- package/dist/collection/components/type/templates/enum.js +25 -0
- package/dist/collection/components/type/templates/enum.js.map +1 -0
- package/dist/collection/components/type/templates/interface.js +13 -0
- package/dist/collection/components/type/templates/interface.js.map +1 -0
- package/dist/collection/components/type/type.js +97 -0
- package/dist/collection/components/type/type.js.map +1 -0
- package/dist/collection/index.js +4 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/kompendium/config.js +7 -0
- package/dist/collection/kompendium/config.js.map +1 -0
- package/dist/collection/kompendium/filesystem.js +9 -0
- package/dist/collection/kompendium/filesystem.js.map +1 -0
- package/dist/collection/kompendium/generator.js +217 -0
- package/dist/collection/kompendium/generator.js.map +1 -0
- package/dist/collection/kompendium/guides.js +30 -0
- package/dist/collection/kompendium/guides.js.map +1 -0
- package/dist/collection/kompendium/index.js +2 -0
- package/dist/collection/kompendium/index.js.map +1 -0
- package/dist/collection/kompendium/markdown-admonitions.js +82 -0
- package/dist/collection/kompendium/markdown-admonitions.js.map +1 -0
- package/dist/collection/kompendium/markdown-code.js +40 -0
- package/dist/collection/kompendium/markdown-code.js.map +1 -0
- package/dist/collection/kompendium/markdown-frontmatter.js +12 -0
- package/dist/collection/kompendium/markdown-frontmatter.js.map +1 -0
- package/dist/collection/kompendium/markdown-nodes.js +10 -0
- package/dist/collection/kompendium/markdown-nodes.js.map +1 -0
- package/dist/collection/kompendium/markdown-typelinks.js +115 -0
- package/dist/collection/kompendium/markdown-typelinks.js.map +1 -0
- package/dist/collection/kompendium/markdown.js +35 -0
- package/dist/collection/kompendium/markdown.js.map +1 -0
- package/dist/collection/kompendium/menu.js +149 -0
- package/dist/collection/kompendium/menu.js.map +1 -0
- package/dist/collection/kompendium/schema.js +167 -0
- package/dist/collection/kompendium/schema.js.map +1 -0
- package/dist/collection/kompendium/search.js +144 -0
- package/dist/collection/kompendium/search.js.map +1 -0
- package/dist/collection/kompendium/source.js +81 -0
- package/dist/collection/kompendium/source.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/basic.js +48 -0
- package/dist/collection/kompendium/test/fixtures/basic.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js +29 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js.map +1 -0
- package/dist/collection/kompendium/typedoc.js +481 -0
- package/dist/collection/kompendium/typedoc.js.map +1 -0
- package/dist/collection/kompendium/watch.js +9 -0
- package/dist/collection/kompendium/watch.js.map +1 -0
- package/dist/collection/types.js +2 -0
- package/dist/collection/types.js.map +1 -0
- package/dist/config.ts +8 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +10 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js +65 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js.map +1 -0
- package/dist/esm/index-9UrzenzW.js +1857 -0
- package/dist/esm/index-9UrzenzW.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map +1 -0
- package/dist/esm/kompendium-app_7.entry.js +2916 -0
- package/dist/esm/kompendium-code.entry.js +2722 -0
- package/dist/esm/kompendium-code.entry.js.map +1 -0
- package/dist/esm/kompendium-component.entry.js +205 -0
- package/dist/esm/kompendium-component.entry.js.map +1 -0
- package/dist/esm/kompendium-debug.entry.js +45 -0
- package/dist/esm/kompendium-debug.entry.js.map +1 -0
- package/dist/esm/kompendium-example-code.entry.js +18 -0
- package/dist/esm/kompendium-example-code.entry.js.map +1 -0
- package/dist/esm/kompendium-example-markdown.entry.js +163 -0
- package/dist/esm/kompendium-example-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-guide.entry.js +31 -0
- package/dist/esm/kompendium-guide.entry.js.map +1 -0
- package/dist/esm/kompendium-markdown.entry.js +48921 -0
- package/dist/esm/kompendium-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-playground.entry.js +87 -0
- package/dist/esm/kompendium-playground.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist.kompendium-taglist.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist_2.entry.js +46 -0
- package/dist/esm/kompendium-type.entry.js +81 -0
- package/dist/esm/kompendium-type.entry.js.map +1 -0
- package/dist/esm/kompendium.js +21 -0
- package/dist/esm/kompendium.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/markdown-types-Ajsawr_9.js +12 -0
- package/dist/esm/markdown-types-Ajsawr_9.js.map +1 -0
- package/dist/esm/methods-BAjd6f7g.js +94 -0
- package/dist/esm/methods-BAjd6f7g.js.map +1 -0
- package/dist/esm/types-BIPLEi1G.js +6 -0
- package/dist/esm/types-BIPLEi1G.js.map +1 -0
- package/dist/filesystem.ts +9 -0
- package/dist/generator.ts +302 -0
- package/dist/guides.ts +49 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.ts +1 -0
- package/dist/kompendium/index.esm.js +2 -0
- package/dist/kompendium/index.esm.js.map +1 -0
- package/dist/kompendium/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-component.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-debug.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-guide.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-playground.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-proplist.kompendium-taglist.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-type.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium.css +47 -0
- package/dist/kompendium/kompendium.esm.js +2 -0
- package/dist/kompendium/kompendium.esm.js.map +1 -0
- package/dist/kompendium/loader.esm.js.map +1 -0
- package/dist/kompendium/p-15e4b2c0.entry.js +2 -0
- package/dist/kompendium/p-15e4b2c0.entry.js.map +1 -0
- package/dist/kompendium/p-1cf0168f.entry.js +2 -0
- package/dist/kompendium/p-1cf0168f.entry.js.map +1 -0
- package/dist/kompendium/p-29c23c89.entry.js +2 -0
- package/dist/kompendium/p-29c23c89.entry.js.map +1 -0
- package/dist/kompendium/p-3981d11f.entry.js +2 -0
- package/dist/kompendium/p-3981d11f.entry.js.map +1 -0
- package/dist/kompendium/p-93f0548d.entry.js +2 -0
- package/dist/kompendium/p-93f0548d.entry.js.map +1 -0
- package/dist/kompendium/p-97b02575.entry.js +2 -0
- package/dist/kompendium/p-97b02575.entry.js.map +1 -0
- package/dist/kompendium/p-9UrzenzW.js +3 -0
- package/dist/kompendium/p-9UrzenzW.js.map +1 -0
- package/dist/kompendium/p-Ajsawr_9.js +2 -0
- package/dist/kompendium/p-Ajsawr_9.js.map +1 -0
- package/dist/kompendium/p-BAGXN2n6.js +2 -0
- package/dist/kompendium/p-BAGXN2n6.js.map +1 -0
- package/dist/kompendium/p-BFTU3MAI.js +2 -0
- package/dist/kompendium/p-BFTU3MAI.js.map +1 -0
- package/dist/kompendium/p-BIPLEi1G.js +2 -0
- package/dist/kompendium/p-BIPLEi1G.js.map +1 -0
- package/dist/kompendium/p-CnQEA7KO.js +2 -0
- package/dist/kompendium/p-CnQEA7KO.js.map +1 -0
- package/dist/kompendium/p-b0f95bd6.entry.js +2 -0
- package/dist/kompendium/p-b0f95bd6.entry.js.map +1 -0
- package/dist/kompendium/p-d9bcc473.entry.js +10 -0
- package/dist/kompendium/p-d9bcc473.entry.js.map +1 -0
- package/dist/kompendium/p-e36f3f1e.entry.js +2 -0
- package/dist/kompendium/p-e36f3f1e.entry.js.map +1 -0
- package/dist/kompendium/p-e52a2f57.entry.js +2 -0
- package/dist/kompendium/p-e52a2f57.entry.js.map +1 -0
- package/dist/kompendium/p-ec5861de.entry.js +2 -0
- package/dist/kompendium/p-ec5861de.entry.js.map +1 -0
- package/dist/markdown-admonitions.ts +112 -0
- package/dist/markdown-code.ts +51 -0
- package/dist/markdown-frontmatter.ts +19 -0
- package/dist/markdown-nodes.ts +23 -0
- package/dist/markdown-typelinks.ts +166 -0
- package/dist/markdown.ts +49 -0
- package/dist/menu.ts +189 -0
- package/dist/schema.ts +233 -0
- package/dist/search.ts +197 -0
- package/dist/source.ts +129 -0
- package/dist/typedoc.ts +665 -0
- package/dist/types/components/anchor-scroll.d.ts +36 -0
- package/dist/types/components/app/app.d.ts +22 -0
- package/dist/types/components/code/code.d.ts +26 -0
- package/dist/types/components/code/examples/code.d.ts +3 -0
- package/dist/types/components/component/component.d.ts +32 -0
- package/dist/types/components/component/templates/events.d.ts +5 -0
- package/dist/types/components/component/templates/examples.d.ts +9 -0
- package/dist/types/components/component/templates/methods.d.ts +5 -0
- package/dist/types/components/component/templates/props.d.ts +5 -0
- package/dist/types/components/component/templates/slots.d.ts +5 -0
- package/dist/types/components/component/templates/style.d.ts +5 -0
- package/dist/types/components/darkmode-switch/darkmode-switch.d.ts +18 -0
- package/dist/types/components/darkmode-switch/types.d.ts +2 -0
- package/dist/types/components/debug/debug.d.ts +24 -0
- package/dist/types/components/guide/guide.d.ts +14 -0
- package/dist/types/components/markdown/examples/markdown-example.d.ts +1 -0
- package/dist/types/components/markdown/examples/markdown.d.ts +7 -0
- package/dist/types/components/markdown/markdown-types.d.ts +2 -0
- package/dist/types/components/markdown/markdown.d.ts +20 -0
- package/dist/types/components/navigation/navigation.d.ts +35 -0
- package/dist/types/components/playground/playground.d.ts +32 -0
- package/dist/types/components/playground/playground.types.d.ts +1 -0
- package/dist/types/components/proplist/proplist.d.ts +12 -0
- package/dist/types/components/search/search.d.ts +15 -0
- package/dist/types/components/taglist/taglist.d.ts +16 -0
- package/dist/types/components/type/templates/alias.d.ts +4 -0
- package/dist/types/components/type/templates/enum.d.ts +4 -0
- package/dist/types/components/type/templates/interface.d.ts +4 -0
- package/dist/types/components/type/type.d.ts +15 -0
- package/dist/types/components.d.ts +517 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/kompendium/config.d.ts +2 -0
- package/dist/types/kompendium/filesystem.d.ts +1 -0
- package/dist/types/kompendium/generator.d.ts +4 -0
- package/dist/types/kompendium/guides.d.ts +9 -0
- package/dist/types/kompendium/index.d.ts +1 -0
- package/dist/types/kompendium/markdown-admonitions.d.ts +3 -0
- package/dist/types/kompendium/markdown-code.d.ts +2 -0
- package/dist/types/kompendium/markdown-frontmatter.d.ts +6 -0
- package/dist/types/kompendium/markdown-nodes.d.ts +12 -0
- package/dist/types/kompendium/markdown-typelinks.d.ts +21 -0
- package/dist/types/kompendium/markdown.d.ts +8 -0
- package/dist/types/kompendium/menu.d.ts +12 -0
- package/dist/types/kompendium/schema.d.ts +9 -0
- package/dist/types/kompendium/search.d.ts +3 -0
- package/dist/types/kompendium/source.d.ts +10 -0
- package/dist/types/kompendium/test/fixtures/basic.d.ts +65 -0
- package/dist/types/kompendium/test/fixtures/filtering/example-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/node-modules-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/private-types.d.ts +23 -0
- package/dist/types/kompendium/test/fixtures/filtering/stencil-component-types.d.ts +19 -0
- package/dist/types/kompendium/test/fixtures/filtering/test-helper-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/valid-types.d.ts +42 -0
- package/dist/types/kompendium/typedoc.d.ts +2 -0
- package/dist/types/kompendium/watch.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1746 -0
- package/dist/types/types.d.ts +119 -0
- package/dist/watch.ts +14 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +116 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--width-nav-panel: 16rem;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tab-panel {
|
|
10
|
+
height: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.tab-bar {
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: 0.1875rem 1rem 0 1rem;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
}
|
|
20
|
+
.tab-bar .tab span {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: 0.125rem 0;
|
|
27
|
+
}
|
|
28
|
+
.tab-bar .tab {
|
|
29
|
+
transition: background-color 0.2s ease;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-block;
|
|
33
|
+
padding: 0.5rem 1rem;
|
|
34
|
+
text-align: center;
|
|
35
|
+
line-height: 0.9375rem;
|
|
36
|
+
color: rgb(var(--kompendium-contrast-1000));
|
|
37
|
+
font-size: 1rem;
|
|
38
|
+
border-radius: 0.5rem 0.5rem 0 0;
|
|
39
|
+
margin: 0 0.125rem;
|
|
40
|
+
min-width: 3.75rem;
|
|
41
|
+
}
|
|
42
|
+
.tab-bar .tab:before, .tab-bar .tab:after {
|
|
43
|
+
transition: background-color 0.2s ease;
|
|
44
|
+
content: "";
|
|
45
|
+
display: block;
|
|
46
|
+
width: 0.625rem;
|
|
47
|
+
height: 0.625rem;
|
|
48
|
+
position: absolute;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
-webkit-mask-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' clip-rule='evenodd' viewBox='0 0 50 50'><defs/><path d='M0 0c0 27.594 22.406 50 50 50H0V0z'/></svg>");
|
|
51
|
+
mask-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' clip-rule='evenodd' viewBox='0 0 50 50'><defs/><path d='M0 0c0 27.594 22.406 50 50 50H0V0z'/></svg>");
|
|
52
|
+
background: transparent;
|
|
53
|
+
}
|
|
54
|
+
.tab-bar .tab:before {
|
|
55
|
+
left: -0.625rem;
|
|
56
|
+
transform: rotateY(180deg);
|
|
57
|
+
}
|
|
58
|
+
.tab-bar .tab:after {
|
|
59
|
+
right: -0.625rem;
|
|
60
|
+
}
|
|
61
|
+
.tab-bar .tab:hover {
|
|
62
|
+
background-color: rgb(var(--kompendium-contrast-100));
|
|
63
|
+
}
|
|
64
|
+
.tab-bar .tab:hover:before, .tab-bar .tab:hover:after {
|
|
65
|
+
background-color: rgb(var(--kompendium-contrast-100));
|
|
66
|
+
}
|
|
67
|
+
.tab-bar .tab.active {
|
|
68
|
+
z-index: 1;
|
|
69
|
+
color: rgb(var(--kompendium-contrast-1100));
|
|
70
|
+
background: rgb(var(--kompendium-color-code-background));
|
|
71
|
+
}
|
|
72
|
+
.tab-bar .tab.active:before, .tab-bar .tab.active:after {
|
|
73
|
+
background: rgb(var(--kompendium-color-code-background));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.tab-items {
|
|
77
|
+
display: flex;
|
|
78
|
+
max-height: 31.25rem;
|
|
79
|
+
}
|
|
80
|
+
.tab-items .tab-item {
|
|
81
|
+
width: 100%;
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
.tab-items .tab-item.active {
|
|
85
|
+
display: flex;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
kompendium-code {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
kompendium-code:before, kompendium-code:after {
|
|
92
|
+
content: "";
|
|
93
|
+
z-index: 1;
|
|
94
|
+
display: block;
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: 0;
|
|
97
|
+
right: 0;
|
|
98
|
+
border-radius: 0.5625rem;
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
}
|
|
101
|
+
kompendium-code:before {
|
|
102
|
+
top: 2.4375rem;
|
|
103
|
+
height: 1.5rem;
|
|
104
|
+
background-image: linear-gradient(rgb(var(--kompendium-color-code-background)), rgba(var(--kompendium-color-code-background), 0));
|
|
105
|
+
}
|
|
106
|
+
kompendium-code:after {
|
|
107
|
+
bottom: 0;
|
|
108
|
+
height: 2rem;
|
|
109
|
+
background-image: linear-gradient(rgba(var(--kompendium-color-code-background), 0), rgb(var(--kompendium-color-code-background)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
section.example {
|
|
113
|
+
transition: border-color 0.3s ease 0.05s;
|
|
114
|
+
padding-bottom: 2.5rem;
|
|
115
|
+
margin-bottom: 2.5rem;
|
|
116
|
+
border-bottom: 1px solid rgb(var(--kompendium-contrast-500));
|
|
117
|
+
}
|
|
118
|
+
section.example .result,
|
|
119
|
+
section.example .code {
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
display: inline-block;
|
|
122
|
+
vertical-align: top;
|
|
123
|
+
width: 50%;
|
|
124
|
+
}
|
|
125
|
+
section.example .result {
|
|
126
|
+
padding-right: 2.5rem;
|
|
127
|
+
}
|
|
128
|
+
section.example .result kompendium-markdown {
|
|
129
|
+
margin-bottom: 2rem;
|
|
130
|
+
}
|
|
131
|
+
section.example .code {
|
|
132
|
+
position: sticky;
|
|
133
|
+
top: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media (max-width: 1000px) {
|
|
137
|
+
section.example .result,
|
|
138
|
+
section.example .code {
|
|
139
|
+
width: 100%;
|
|
140
|
+
padding-right: 0;
|
|
141
|
+
margin-bottom: 5rem;
|
|
142
|
+
}
|
|
143
|
+
section.example .code {
|
|
144
|
+
position: relative;
|
|
145
|
+
margin-bottom: 2.5rem;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.show-case_description {
|
|
149
|
+
padding: 0.75rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.show-case_component {
|
|
153
|
+
font-family: var(--kompendium-example-font-family, inherit);
|
|
154
|
+
font-size: var(--kompendium-example-font-size, inherit);
|
|
155
|
+
line-height: var(--kompendium-example-line-height, inherit);
|
|
156
|
+
color: var(--kompendium-example-color, inherit);
|
|
157
|
+
padding: 1.25rem;
|
|
158
|
+
border-radius: 0.875rem;
|
|
159
|
+
background-color: rgb(var(--kompendium-contrast-100));
|
|
160
|
+
border: 1px solid rgb(var(--kompendium-contrast-300));
|
|
161
|
+
box-shadow: var(--shadow-showcase);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.debug {
|
|
165
|
+
display: flex;
|
|
166
|
+
justify-content: flex-end;
|
|
167
|
+
}
|
|
168
|
+
.debug a.debug-link {
|
|
169
|
+
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
170
|
+
}
|
|
171
|
+
.debug a.debug-link:hover {
|
|
172
|
+
box-shadow: var(--kompendium-button-shadow-hovered);
|
|
173
|
+
}
|
|
174
|
+
.debug a.debug-link:active {
|
|
175
|
+
box-shadow: var(--kompendium-button-shadow-pressed);
|
|
176
|
+
transform: translate3d(0, 0.08rem, 0);
|
|
177
|
+
}
|
|
178
|
+
.debug a.debug-link:focus {
|
|
179
|
+
outline: none;
|
|
180
|
+
}
|
|
181
|
+
.debug a.debug-link:focus-visible {
|
|
182
|
+
outline: none;
|
|
183
|
+
box-shadow: var(--kompendium-shadow-depth-8-focused);
|
|
184
|
+
}
|
|
185
|
+
.debug a.debug-link {
|
|
186
|
+
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out, opacity 0.2s ease;
|
|
187
|
+
width: 1.75rem;
|
|
188
|
+
height: 1.75rem;
|
|
189
|
+
font-size: 0;
|
|
190
|
+
margin: -3.25rem -1rem 0 0;
|
|
191
|
+
border-radius: 50%;
|
|
192
|
+
color: rgb(var(--kompendium-contrast-1200));
|
|
193
|
+
opacity: 0.6;
|
|
194
|
+
}
|
|
195
|
+
.debug a.debug-link:hover {
|
|
196
|
+
opacity: 1;
|
|
197
|
+
background-color: rgb(var(--kompendium-contrast-100));
|
|
198
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { THEME_EVENT_NAME } from "../darkmode-switch/types";
|
|
3
|
+
export class Playground {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Factory for creating props for example components
|
|
7
|
+
* @returns {Record<string, unknown>} props
|
|
8
|
+
*/
|
|
9
|
+
this.propsFactory = () => ({});
|
|
10
|
+
this.activateTab = (id) => () => {
|
|
11
|
+
this.activeTab = id;
|
|
12
|
+
};
|
|
13
|
+
this.themeListener = (event) => {
|
|
14
|
+
this.theme = event.detail;
|
|
15
|
+
};
|
|
16
|
+
this.renderTab = this.renderTab.bind(this);
|
|
17
|
+
this.renderItem = this.renderItem.bind(this);
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
this.theme = document.querySelector('html').dataset.theme;
|
|
21
|
+
document.addEventListener(THEME_EVENT_NAME, this.themeListener);
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
document.removeEventListener(THEME_EVENT_NAME, this.themeListener);
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (!this.component) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const sources = this.component.sources || [];
|
|
31
|
+
return (h(Host, { "data-theme": this.theme }, h("section", { class: "example" }, h("div", { class: "result" }, this.renderResult()), h("aside", { class: "code" }, h("nav", { class: "tab-bar" }, this.renderTabs(sources)), h("div", { class: "tab-items" }, this.renderItems(sources))))));
|
|
32
|
+
}
|
|
33
|
+
renderTabs(sources) {
|
|
34
|
+
return sources.map(this.renderTab);
|
|
35
|
+
}
|
|
36
|
+
renderTab(source, index) {
|
|
37
|
+
const classList = {
|
|
38
|
+
tab: true,
|
|
39
|
+
active: this.isTabActive(source, index),
|
|
40
|
+
};
|
|
41
|
+
return (h("a", { class: classList, onClick: this.activateTab(source.filename) }, h("span", null, source.filename)));
|
|
42
|
+
}
|
|
43
|
+
renderItems(sources) {
|
|
44
|
+
return sources.map(this.renderItem);
|
|
45
|
+
}
|
|
46
|
+
renderResult() {
|
|
47
|
+
const ExampleComponent = this.component.tag;
|
|
48
|
+
const text = '##### ' + this.component.docs;
|
|
49
|
+
const factory = this.propsFactory;
|
|
50
|
+
const props = {
|
|
51
|
+
schema: this.schema,
|
|
52
|
+
...factory(ExampleComponent),
|
|
53
|
+
};
|
|
54
|
+
return (h("div", { class: "show-case" }, h("div", { class: "show-case_description" }, h("kompendium-markdown", { text: text })), h("div", { class: "show-case_component" }, this.renderDebugButton(this.component.tag), h(ExampleComponent, { ...props }))));
|
|
55
|
+
}
|
|
56
|
+
renderItem(source, index) {
|
|
57
|
+
const classList = {
|
|
58
|
+
'tab-item': true,
|
|
59
|
+
active: this.isTabActive(source, index),
|
|
60
|
+
};
|
|
61
|
+
const code = source.source.replace(/\/\*\*.+?\*\//gms, '');
|
|
62
|
+
const key = [this.component.tag, source.filename].join('/');
|
|
63
|
+
return (h("kompendium-code", { class: classList, language: source.type, key: key }, code));
|
|
64
|
+
}
|
|
65
|
+
renderDebugButton(tag) {
|
|
66
|
+
if (!['localhost', '127.0.0.1'].includes(location.hostname)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const href = `#/debug/${tag}`;
|
|
70
|
+
return (h("div", { class: "debug" }, h("a", { class: "debug-link", href: href, title: "Debug" }, h("svg", { viewBox: "0 0 400 400", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-miterlimit": "1.5" }, h("path", { fill: "none", d: "M0 0h400v400H0z" }), h("path", { d: "M194.97 254.84h77.555", fill: "none", stroke: "currentColor", "stroke-opacity": ".6", "stroke-width": "20" }), h("path", { d: "M127.474 145.16l54.84 54.84M182.315 200l-54.84 54.84", fill: "none", stroke: "currentColor", "stroke-width": "20" })))));
|
|
71
|
+
}
|
|
72
|
+
isTabActive(source, index) {
|
|
73
|
+
let isActive = this.activeTab === source.filename;
|
|
74
|
+
if (!isActive) {
|
|
75
|
+
isActive = index === 0 && !this.activeTab;
|
|
76
|
+
}
|
|
77
|
+
return isActive;
|
|
78
|
+
}
|
|
79
|
+
static get is() { return "kompendium-playground"; }
|
|
80
|
+
static get encapsulation() { return "shadow"; }
|
|
81
|
+
static get originalStyleUrls() {
|
|
82
|
+
return {
|
|
83
|
+
"$": ["playground.scss"]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static get styleUrls() {
|
|
87
|
+
return {
|
|
88
|
+
"$": ["playground.css"]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get properties() {
|
|
92
|
+
return {
|
|
93
|
+
"component": {
|
|
94
|
+
"type": "unknown",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "JsonDocsComponent",
|
|
98
|
+
"resolved": "JsonDocsComponent",
|
|
99
|
+
"references": {
|
|
100
|
+
"JsonDocsComponent": {
|
|
101
|
+
"location": "import",
|
|
102
|
+
"path": "@stencil/core/internal",
|
|
103
|
+
"id": "node_modules::JsonDocsComponent"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "The component to display"
|
|
112
|
+
},
|
|
113
|
+
"getter": false,
|
|
114
|
+
"setter": false
|
|
115
|
+
},
|
|
116
|
+
"schema": {
|
|
117
|
+
"type": "unknown",
|
|
118
|
+
"mutable": false,
|
|
119
|
+
"complexType": {
|
|
120
|
+
"original": "Record<string, any>",
|
|
121
|
+
"resolved": "{ [x: string]: any; }",
|
|
122
|
+
"references": {
|
|
123
|
+
"Record": {
|
|
124
|
+
"location": "global",
|
|
125
|
+
"id": "global::Record"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Schema for the component"
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false
|
|
137
|
+
},
|
|
138
|
+
"propsFactory": {
|
|
139
|
+
"type": "unknown",
|
|
140
|
+
"mutable": false,
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "PropsFactory",
|
|
143
|
+
"resolved": "(name: string) => Record<string, unknown>",
|
|
144
|
+
"references": {
|
|
145
|
+
"PropsFactory": {
|
|
146
|
+
"location": "import",
|
|
147
|
+
"path": "./playground.types",
|
|
148
|
+
"id": "src/components/playground/playground.types.ts::PropsFactory"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": true,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [{
|
|
156
|
+
"name": "returns",
|
|
157
|
+
"text": "props"
|
|
158
|
+
}],
|
|
159
|
+
"text": "Factory for creating props for example components"
|
|
160
|
+
},
|
|
161
|
+
"getter": false,
|
|
162
|
+
"setter": false,
|
|
163
|
+
"defaultValue": "() => ({})"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
static get states() {
|
|
168
|
+
return {
|
|
169
|
+
"activeTab": {},
|
|
170
|
+
"theme": {}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=playground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.js","sourceRoot":"","sources":["../../../src/components/playground/playground.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,EAAS,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,MAAM,OAAO,UAAU;IA0BnB;QAbA;;;WAGG;QAEI,iBAAY,GAAkB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QA4IxC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W,CAAC,MAAsB,EAAE,KAAa;QACrD,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,CAAC;QAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,QAAQ,GAAG,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9C,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKJ","sourcesContent":["import { Component, h, Host, Prop, State } from '@stencil/core';\nimport { JsonDocsComponent } from '@stencil/core/internal';\nimport { JsonDocsSource } from '../../kompendium/source';\nimport { Theme, THEME_EVENT_NAME } from '../darkmode-switch/types';\nimport { PropsFactory } from './playground.types';\n\n@Component({\n tag: 'kompendium-playground',\n styleUrl: 'playground.scss',\n shadow: true,\n})\nexport class Playground {\n /**\n * The component to display\n */\n @Prop()\n public component: JsonDocsComponent;\n\n /**\n * Schema for the component\n */\n @Prop()\n public schema: Record<string, any>;\n\n /**\n * Factory for creating props for example components\n * @returns {Record<string, unknown>} props\n */\n @Prop()\n public propsFactory?: PropsFactory = () => ({});\n\n @State()\n private activeTab: string;\n\n @State()\n private theme: Theme;\n\n constructor() {\n this.renderTab = this.renderTab.bind(this);\n this.renderItem = this.renderItem.bind(this);\n }\n\n public connectedCallback() {\n this.theme = document.querySelector('html').dataset.theme as Theme;\n document.addEventListener(THEME_EVENT_NAME, this.themeListener);\n }\n\n public disconnectedCallback() {\n document.removeEventListener(THEME_EVENT_NAME, this.themeListener);\n }\n\n public render(): HTMLElement {\n if (!this.component) {\n return;\n }\n\n const sources: JsonDocsSource[] = (this.component as any).sources || [];\n\n return (\n <Host data-theme={this.theme}>\n <section class=\"example\">\n <div class=\"result\">{this.renderResult()}</div>\n\n <aside class=\"code\">\n <nav class=\"tab-bar\">{this.renderTabs(sources)}</nav>\n <div class=\"tab-items\">{this.renderItems(sources)}</div>\n </aside>\n </section>\n </Host>\n );\n }\n\n private renderTabs(sources: JsonDocsSource[]) {\n return sources.map(this.renderTab);\n }\n\n private renderTab(source: JsonDocsSource, index: number) {\n const classList = {\n tab: true,\n active: this.isTabActive(source, index),\n };\n\n return (\n <a class={classList} onClick={this.activateTab(source.filename)}>\n <span>{source.filename}</span>\n </a>\n );\n }\n\n private renderItems(sources: JsonDocsSource[]) {\n return sources.map(this.renderItem);\n }\n\n private renderResult() {\n const ExampleComponent = this.component.tag;\n const text = '##### ' + this.component.docs;\n const factory = this.propsFactory;\n const props = {\n schema: this.schema,\n ...factory(ExampleComponent),\n };\n\n return (\n <div class=\"show-case\">\n <div class=\"show-case_description\">\n <kompendium-markdown text={text} />\n </div>\n <div class=\"show-case_component\">\n {this.renderDebugButton(this.component.tag)}\n <ExampleComponent {...props} />\n </div>\n </div>\n );\n }\n\n private renderItem(source: JsonDocsSource, index: number) {\n const classList = {\n 'tab-item': true,\n active: this.isTabActive(source, index),\n };\n const code = source.source.replace(/\\/\\*\\*.+?\\*\\//gms, '');\n const key = [this.component.tag, source.filename].join('/');\n\n return (\n <kompendium-code class={classList} language={source.type} key={key}>\n {code}\n </kompendium-code>\n );\n }\n\n private renderDebugButton(tag: string) {\n if (!['localhost', '127.0.0.1'].includes(location.hostname)) {\n return;\n }\n\n const href = `#/debug/${tag}`;\n\n return (\n <div class=\"debug\">\n <a class=\"debug-link\" href={href} title=\"Debug\">\n <svg\n viewBox=\"0 0 400 400\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-miterlimit=\"1.5\"\n >\n <path fill=\"none\" d=\"M0 0h400v400H0z\" />\n <path\n d=\"M194.97 254.84h77.555\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-opacity=\".6\"\n stroke-width=\"20\"\n />\n <path\n d=\"M127.474 145.16l54.84 54.84M182.315 200l-54.84 54.84\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"20\"\n />\n </svg>\n </a>\n </div>\n );\n }\n\n private activateTab = (id: string) => () => {\n this.activeTab = id;\n };\n\n private isTabActive(source: JsonDocsSource, index: number): boolean {\n let isActive = this.activeTab === source.filename;\n if (!isActive) {\n isActive = index === 0 && !this.activeTab;\n }\n\n return isActive;\n }\n\n private themeListener = (event: CustomEvent<Theme>) => {\n this.theme = event.detail;\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.types.js","sourceRoot":"","sources":["../../../src/components/playground/playground.types.ts"],"names":[],"mappings":"","sourcesContent":["export type PropsFactory = (name: string) => Record<string, unknown>;\n"]}
|