@ciderpress/ui 1.0.0-rc.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 +23 -0
- package/dist/0~142.js +2 -0
- package/dist/0~164.js +2 -0
- package/dist/0~2.js +2 -0
- package/dist/0~225.js +2 -0
- package/dist/0~288.js +2 -0
- package/dist/0~299.js +2 -0
- package/dist/0~3.js +2 -0
- package/dist/0~301.js +2 -0
- package/dist/0~311.js +2 -0
- package/dist/0~326.js +2 -0
- package/dist/0~40.js +2 -0
- package/dist/0~43.js +2 -0
- package/dist/0~433.js +2 -0
- package/dist/0~453.js +2 -0
- package/dist/0~457.js +2 -0
- package/dist/0~497.js +2 -0
- package/dist/0~511.js +2 -0
- package/dist/0~603.js +2 -0
- package/dist/0~616.js +2 -0
- package/dist/0~659.js +2 -0
- package/dist/0~670.js +2 -0
- package/dist/0~687.js +2 -0
- package/dist/0~706.js +2 -0
- package/dist/0~729.js +2 -0
- package/dist/0~768.js +2 -0
- package/dist/0~819.js +2 -0
- package/dist/0~830.js +2 -0
- package/dist/0~854.js +2 -0
- package/dist/0~863.js +2 -0
- package/dist/0~879.js +2 -0
- package/dist/0~96.js +2 -0
- package/dist/0~97.js +2 -0
- package/dist/components/FileTree/FileTree.css +90 -0
- package/dist/components/FileTree/FileTree.d.ts +7 -0
- package/dist/components/FileTree/FileTree.js +531 -0
- package/dist/components/FileTree/FileTreeItem.d.ts +8 -0
- package/dist/components/FileTree/RemoteSvgIcon.d.ts +11 -0
- package/dist/components/FileTree/index.d.ts +4 -0
- package/dist/components/folder-icons.d.ts +32 -0
- package/dist/components/languages.d.ts +7 -0
- package/dist/components/tree-parser/tree-parser.d.ts +12 -0
- package/dist/components/tree-parser/types.d.ts +11 -0
- package/dist/head/css/loader-apple.css +1 -0
- package/dist/head/css/loader-backdrop.css +1 -0
- package/dist/head/css/loader-dots.css +1 -0
- package/dist/head/css/themes/amber.css +1 -0
- package/dist/head/css/themes/arcade.css +1 -0
- package/dist/head/css/themes/grannysmith.css +1 -0
- package/dist/head/css/themes/honeycrisp.css +1 -0
- package/dist/head/css/themes/midnight.css +1 -0
- package/dist/head/css/themes/mulled.css +1 -0
- package/dist/head/js/loader-dots.js +1 -0
- package/dist/head/js/vscode-nav.js +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.mjs +40 -0
- package/dist/node.d.ts +81 -0
- package/dist/node.mjs +17762 -0
- package/dist/plugins/mermaid/MermaidRenderer.tsx +480 -0
- package/dist/plugins/mermaid/mermaid.css +199 -0
- package/dist/theme/components/announcement/announcement-bar.css +103 -0
- package/dist/theme/components/announcement/announcement-bar.tsx +173 -0
- package/dist/theme/components/ask-ai/ask-ai-button.css +52 -0
- package/dist/theme/components/ask-ai/ask-ai-button.tsx +56 -0
- package/dist/theme/components/content-footer/content-footer-portal.tsx +70 -0
- package/dist/theme/components/content-footer/feedback.css +47 -0
- package/dist/theme/components/content-footer/feedback.tsx +96 -0
- package/dist/theme/components/content-footer/meta-actions.css +25 -0
- package/dist/theme/components/content-footer/meta-actions.tsx +57 -0
- package/dist/theme/components/content-footer/page-pager.css +61 -0
- package/dist/theme/components/content-footer/page-pager.tsx +110 -0
- package/dist/theme/components/edit-source-button.tsx +97 -0
- package/dist/theme/components/footer/site-footer.css +179 -0
- package/dist/theme/components/footer/site-footer.tsx +115 -0
- package/dist/theme/components/home/cta.css +67 -0
- package/dist/theme/components/home/cta.tsx +77 -0
- package/dist/theme/components/home/feature-card.css +52 -0
- package/dist/theme/components/home/feature-card.tsx +131 -0
- package/dist/theme/components/home/feature.tsx +79 -0
- package/dist/theme/components/home/hero-demo.css +66 -0
- package/dist/theme/components/home/hero-demo.tsx +46 -0
- package/dist/theme/components/home/hero.css +96 -0
- package/dist/theme/components/home/hero.tsx +111 -0
- package/dist/theme/components/home/layout.tsx +183 -0
- package/dist/theme/components/home/page-rail.css +21 -0
- package/dist/theme/components/home/page-rail.tsx +19 -0
- package/dist/theme/components/home/split.css +148 -0
- package/dist/theme/components/home/split.tsx +120 -0
- package/dist/theme/components/home/trust-strip.css +33 -0
- package/dist/theme/components/home/trust-strip.tsx +43 -0
- package/dist/theme/components/home/workspaces.tsx +71 -0
- package/dist/theme/components/nav/branch-tag.css +54 -0
- package/dist/theme/components/nav/branch-tag.tsx +101 -0
- package/dist/theme/components/nav/ciderpress-doc-layout.tsx +247 -0
- package/dist/theme/components/nav/ciderpress-docs-bar.css +505 -0
- package/dist/theme/components/nav/ciderpress-docs-bar.tsx +426 -0
- package/dist/theme/components/nav/ciderpress-header.css +172 -0
- package/dist/theme/components/nav/ciderpress-header.tsx +113 -0
- package/dist/theme/components/nav/ciderpress-layout-context.tsx +49 -0
- package/dist/theme/components/nav/ciderpress-nav-hamburger.css +193 -0
- package/dist/theme/components/nav/ciderpress-nav-hamburger.tsx +112 -0
- package/dist/theme/components/nav/ciderpress-nav-menu.css +130 -0
- package/dist/theme/components/nav/ciderpress-nav-menu.tsx +372 -0
- package/dist/theme/components/nav/ciderpress-nav-search.css +73 -0
- package/dist/theme/components/nav/ciderpress-nav-search.tsx +55 -0
- package/dist/theme/components/nav/ciderpress-nav-social-links.css +35 -0
- package/dist/theme/components/nav/ciderpress-nav-social-links.tsx +87 -0
- package/dist/theme/components/nav/floating-branch-indicator.css +106 -0
- package/dist/theme/components/nav/floating-branch-indicator.tsx +109 -0
- package/dist/theme/components/nav/layout.tsx +268 -0
- package/dist/theme/components/nav/mobile-nav-cta.tsx +79 -0
- package/dist/theme/components/nav/nav-divider.css +15 -0
- package/dist/theme/components/nav/nav-divider.tsx +19 -0
- package/dist/theme/components/nav/nav-logo.css +42 -0
- package/dist/theme/components/nav/nav-logo.tsx +262 -0
- package/dist/theme/components/nav/theme-switcher.css +92 -0
- package/dist/theme/components/nav/theme-switcher.tsx +298 -0
- package/dist/theme/components/nav/topbar-cta.css +45 -0
- package/dist/theme/components/nav/topbar-cta.tsx +39 -0
- package/dist/theme/components/nav/variant-toggle.css +70 -0
- package/dist/theme/components/nav/variant-toggle.tsx +83 -0
- package/dist/theme/components/nav/version-chip.css +31 -0
- package/dist/theme/components/nav/version-chip.tsx +45 -0
- package/dist/theme/components/nav/vscode-tag.css +32 -0
- package/dist/theme/components/nav/vscode-tag.tsx +20 -0
- package/dist/theme/components/openapi/code-sample.tsx +341 -0
- package/dist/theme/components/openapi/copy-markdown-button.tsx +41 -0
- package/dist/theme/components/openapi/icons.tsx +45 -0
- package/dist/theme/components/openapi/index.ts +6 -0
- package/dist/theme/components/openapi/method-badge.tsx +24 -0
- package/dist/theme/components/openapi/openapi.css +665 -0
- package/dist/theme/components/openapi/operation.tsx +200 -0
- package/dist/theme/components/openapi/overview.tsx +207 -0
- package/dist/theme/components/openapi/parameters-table.tsx +149 -0
- package/dist/theme/components/openapi/request-body.tsx +90 -0
- package/dist/theme/components/openapi/response-list.tsx +112 -0
- package/dist/theme/components/openapi/schema-viewer.tsx +277 -0
- package/dist/theme/components/openapi/security-badges.tsx +63 -0
- package/dist/theme/components/openapi/spec-utils.ts +122 -0
- package/dist/theme/components/shared/accordion.css +118 -0
- package/dist/theme/components/shared/accordion.stories.tsx +96 -0
- package/dist/theme/components/shared/accordion.tsx +191 -0
- package/dist/theme/components/shared/brand-logo.stories.tsx +49 -0
- package/dist/theme/components/shared/brand-mark.stories.tsx +53 -0
- package/dist/theme/components/shared/browser-window.css +1 -0
- package/dist/theme/components/shared/browser-window.stories.tsx +100 -0
- package/dist/theme/components/shared/browser-window.tsx +2 -0
- package/dist/theme/components/shared/card.stories.tsx +50 -0
- package/dist/theme/components/shared/card.tsx +35 -0
- package/dist/theme/components/shared/ciderpress-logo.tsx +93 -0
- package/dist/theme/components/shared/ciderpress-mark.tsx +77 -0
- package/dist/theme/components/shared/color.css +56 -0
- package/dist/theme/components/shared/color.stories.tsx +47 -0
- package/dist/theme/components/shared/color.tsx +69 -0
- package/dist/theme/components/shared/columns.css +37 -0
- package/dist/theme/components/shared/columns.stories.tsx +91 -0
- package/dist/theme/components/shared/columns.tsx +50 -0
- package/dist/theme/components/shared/desktop-window.css +339 -0
- package/dist/theme/components/shared/desktop-window.tsx +535 -0
- package/dist/theme/components/shared/field.css +158 -0
- package/dist/theme/components/shared/field.stories.tsx +100 -0
- package/dist/theme/components/shared/field.tsx +186 -0
- package/dist/theme/components/shared/frame.css +39 -0
- package/dist/theme/components/shared/frame.stories.tsx +49 -0
- package/dist/theme/components/shared/frame.tsx +76 -0
- package/dist/theme/components/shared/icon.stories.tsx +90 -0
- package/dist/theme/components/shared/icon.tsx +41 -0
- package/dist/theme/components/shared/prompt.css +178 -0
- package/dist/theme/components/shared/prompt.stories.tsx +57 -0
- package/dist/theme/components/shared/prompt.tsx +369 -0
- package/dist/theme/components/shared/resolve-card-icon.ts +28 -0
- package/dist/theme/components/shared/section-card.stories.tsx +51 -0
- package/dist/theme/components/shared/section-card.tsx +44 -0
- package/dist/theme/components/shared/section-grid.stories.tsx +46 -0
- package/dist/theme/components/shared/section-grid.tsx +15 -0
- package/dist/theme/components/shared/status-badge.css +37 -0
- package/dist/theme/components/shared/status-badge.stories.tsx +61 -0
- package/dist/theme/components/shared/status-badge.tsx +74 -0
- package/dist/theme/components/shared/steps.css +88 -0
- package/dist/theme/components/shared/steps.stories.tsx +68 -0
- package/dist/theme/components/shared/steps.tsx +100 -0
- package/dist/theme/components/shared/tech-icon-table.stories.tsx +29 -0
- package/dist/theme/components/shared/tech-icon-table.tsx +71 -0
- package/dist/theme/components/shared/tech-tag.stories.tsx +40 -0
- package/dist/theme/components/shared/tech-tag.tsx +31 -0
- package/dist/theme/components/shared/theme-color-palette.css +80 -0
- package/dist/theme/components/shared/theme-color-palette.stories.tsx +52 -0
- package/dist/theme/components/shared/theme-color-palette.tsx +275 -0
- package/dist/theme/components/shared/tooltip.css +69 -0
- package/dist/theme/components/shared/tooltip.stories.tsx +72 -0
- package/dist/theme/components/shared/tooltip.tsx +77 -0
- package/dist/theme/components/sidebar/framework-picker.css +77 -0
- package/dist/theme/components/sidebar/framework-picker.tsx +78 -0
- package/dist/theme/components/sidebar/sidebar-filter.test.ts +140 -0
- package/dist/theme/components/sidebar/sidebar-filter.ts +79 -0
- package/dist/theme/components/sidebar/sidebar-links.css +102 -0
- package/dist/theme/components/sidebar/sidebar-links.tsx +122 -0
- package/dist/theme/components/sidebar/sidebar-promo.css +42 -0
- package/dist/theme/components/sidebar/sidebar-promo.tsx +52 -0
- package/dist/theme/components/sidebar/sidebar-scope.tsx +151 -0
- package/dist/theme/components/sidebar/sidebar-toggle.css +181 -0
- package/dist/theme/components/sidebar/sidebar-toggle.tsx +127 -0
- package/dist/theme/components/theme-provider.tsx +637 -0
- package/dist/theme/components/workspaces/card.css +151 -0
- package/dist/theme/components/workspaces/card.tsx +166 -0
- package/dist/theme/components/workspaces/grid.tsx +62 -0
- package/dist/theme/css.d.ts +1 -0
- package/dist/theme/env.d.ts +12 -0
- package/dist/theme/fonts/GeistMono-Variable.woff2 +0 -0
- package/dist/theme/fonts/GeistPixel-Square.woff2 +0 -0
- package/dist/theme/fonts/GeistSans-Variable.woff2 +0 -0
- package/dist/theme/hooks/use-ciderpress.ts +61 -0
- package/dist/theme/hooks/use-nav-items.ts +76 -0
- package/dist/theme/icons/index.ts +2 -0
- package/dist/theme/icons/tech-map.ts +228 -0
- package/dist/theme/index.tsx +180 -0
- package/dist/theme/lib/read-social-links.ts +27 -0
- package/dist/theme/lib/route-link.tsx +126 -0
- package/dist/theme/lib/safe-url.test.ts +0 -0
- package/dist/theme/lib/safe-url.ts +68 -0
- package/dist/theme/lib/theme-favicon.ts +125 -0
- package/dist/theme/lib/user-config-stub.ts +12 -0
- package/dist/theme/styles/layers.css +32 -0
- package/dist/theme/styles/overrides/badge.css +26 -0
- package/dist/theme/styles/overrides/content-footer.css +80 -0
- package/dist/theme/styles/overrides/details.css +61 -0
- package/dist/theme/styles/overrides/fonts.css +32 -0
- package/dist/theme/styles/overrides/home-card.css +133 -0
- package/dist/theme/styles/overrides/home.css +243 -0
- package/dist/theme/styles/overrides/rail.css +337 -0
- package/dist/theme/styles/overrides/rspress.css +62 -0
- package/dist/theme/styles/overrides/scrollbar.css +25 -0
- package/dist/theme/styles/overrides/section-card.css +114 -0
- package/dist/theme/styles/overrides/sidebar.css +144 -0
- package/dist/theme/styles/overrides/tokens.css +288 -0
- package/dist/theme/styles/overrides/vscode.css +88 -0
- package/dist/theme/styles/themes/amber.css +545 -0
- package/dist/theme/styles/themes/arcade-fx.css +366 -0
- package/dist/theme/styles/themes/arcade.css +273 -0
- package/dist/theme/styles/themes/grannysmith.css +545 -0
- package/dist/theme/styles/themes/honeycrisp.css +545 -0
- package/dist/theme/styles/themes/midnight.css +273 -0
- package/dist/theme/styles/themes/mulled.css +817 -0
- package/package.json +103 -0
- package/src/theme/components/announcement/announcement-bar.css +103 -0
- package/src/theme/components/announcement/announcement-bar.tsx +173 -0
- package/src/theme/components/ask-ai/ask-ai-button.css +52 -0
- package/src/theme/components/ask-ai/ask-ai-button.tsx +56 -0
- package/src/theme/components/content-footer/content-footer-portal.tsx +70 -0
- package/src/theme/components/content-footer/feedback.css +47 -0
- package/src/theme/components/content-footer/feedback.tsx +96 -0
- package/src/theme/components/content-footer/meta-actions.css +25 -0
- package/src/theme/components/content-footer/meta-actions.tsx +57 -0
- package/src/theme/components/content-footer/page-pager.css +61 -0
- package/src/theme/components/content-footer/page-pager.tsx +110 -0
- package/src/theme/components/edit-source-button.tsx +97 -0
- package/src/theme/components/footer/site-footer.css +179 -0
- package/src/theme/components/footer/site-footer.tsx +115 -0
- package/src/theme/components/home/cta.css +67 -0
- package/src/theme/components/home/cta.tsx +77 -0
- package/src/theme/components/home/feature-card.css +52 -0
- package/src/theme/components/home/feature-card.tsx +131 -0
- package/src/theme/components/home/feature.tsx +79 -0
- package/src/theme/components/home/hero-demo.css +66 -0
- package/src/theme/components/home/hero-demo.tsx +46 -0
- package/src/theme/components/home/hero.css +96 -0
- package/src/theme/components/home/hero.tsx +111 -0
- package/src/theme/components/home/layout.tsx +183 -0
- package/src/theme/components/home/page-rail.css +21 -0
- package/src/theme/components/home/page-rail.tsx +19 -0
- package/src/theme/components/home/split.css +148 -0
- package/src/theme/components/home/split.tsx +120 -0
- package/src/theme/components/home/trust-strip.css +33 -0
- package/src/theme/components/home/trust-strip.tsx +43 -0
- package/src/theme/components/home/workspaces.tsx +71 -0
- package/src/theme/components/nav/branch-tag.css +54 -0
- package/src/theme/components/nav/branch-tag.tsx +101 -0
- package/src/theme/components/nav/ciderpress-doc-layout.tsx +247 -0
- package/src/theme/components/nav/ciderpress-docs-bar.css +505 -0
- package/src/theme/components/nav/ciderpress-docs-bar.tsx +426 -0
- package/src/theme/components/nav/ciderpress-header.css +172 -0
- package/src/theme/components/nav/ciderpress-header.tsx +113 -0
- package/src/theme/components/nav/ciderpress-layout-context.tsx +49 -0
- package/src/theme/components/nav/ciderpress-nav-hamburger.css +193 -0
- package/src/theme/components/nav/ciderpress-nav-hamburger.tsx +112 -0
- package/src/theme/components/nav/ciderpress-nav-menu.css +130 -0
- package/src/theme/components/nav/ciderpress-nav-menu.tsx +372 -0
- package/src/theme/components/nav/ciderpress-nav-search.css +73 -0
- package/src/theme/components/nav/ciderpress-nav-search.tsx +55 -0
- package/src/theme/components/nav/ciderpress-nav-social-links.css +35 -0
- package/src/theme/components/nav/ciderpress-nav-social-links.tsx +87 -0
- package/src/theme/components/nav/floating-branch-indicator.css +106 -0
- package/src/theme/components/nav/floating-branch-indicator.tsx +109 -0
- package/src/theme/components/nav/layout.tsx +268 -0
- package/src/theme/components/nav/mobile-nav-cta.tsx +79 -0
- package/src/theme/components/nav/nav-divider.css +15 -0
- package/src/theme/components/nav/nav-divider.tsx +19 -0
- package/src/theme/components/nav/nav-logo.css +42 -0
- package/src/theme/components/nav/nav-logo.tsx +262 -0
- package/src/theme/components/nav/theme-switcher.css +92 -0
- package/src/theme/components/nav/theme-switcher.tsx +298 -0
- package/src/theme/components/nav/topbar-cta.css +45 -0
- package/src/theme/components/nav/topbar-cta.tsx +39 -0
- package/src/theme/components/nav/variant-toggle.css +70 -0
- package/src/theme/components/nav/variant-toggle.tsx +83 -0
- package/src/theme/components/nav/version-chip.css +31 -0
- package/src/theme/components/nav/version-chip.tsx +45 -0
- package/src/theme/components/nav/vscode-tag.css +32 -0
- package/src/theme/components/nav/vscode-tag.tsx +20 -0
- package/src/theme/components/openapi/code-sample.tsx +341 -0
- package/src/theme/components/openapi/copy-markdown-button.tsx +41 -0
- package/src/theme/components/openapi/icons.tsx +45 -0
- package/src/theme/components/openapi/index.ts +6 -0
- package/src/theme/components/openapi/method-badge.tsx +24 -0
- package/src/theme/components/openapi/openapi.css +665 -0
- package/src/theme/components/openapi/operation.tsx +200 -0
- package/src/theme/components/openapi/overview.tsx +207 -0
- package/src/theme/components/openapi/parameters-table.tsx +149 -0
- package/src/theme/components/openapi/request-body.tsx +90 -0
- package/src/theme/components/openapi/response-list.tsx +112 -0
- package/src/theme/components/openapi/schema-viewer.tsx +277 -0
- package/src/theme/components/openapi/security-badges.tsx +63 -0
- package/src/theme/components/openapi/spec-utils.ts +122 -0
- package/src/theme/components/shared/accordion.css +118 -0
- package/src/theme/components/shared/accordion.stories.tsx +96 -0
- package/src/theme/components/shared/accordion.tsx +191 -0
- package/src/theme/components/shared/brand-logo.stories.tsx +49 -0
- package/src/theme/components/shared/brand-mark.stories.tsx +53 -0
- package/src/theme/components/shared/browser-window.css +1 -0
- package/src/theme/components/shared/browser-window.stories.tsx +100 -0
- package/src/theme/components/shared/browser-window.tsx +2 -0
- package/src/theme/components/shared/card.stories.tsx +50 -0
- package/src/theme/components/shared/card.tsx +35 -0
- package/src/theme/components/shared/ciderpress-logo.tsx +93 -0
- package/src/theme/components/shared/ciderpress-mark.tsx +77 -0
- package/src/theme/components/shared/color.css +56 -0
- package/src/theme/components/shared/color.stories.tsx +47 -0
- package/src/theme/components/shared/color.tsx +69 -0
- package/src/theme/components/shared/columns.css +37 -0
- package/src/theme/components/shared/columns.stories.tsx +91 -0
- package/src/theme/components/shared/columns.tsx +50 -0
- package/src/theme/components/shared/desktop-window.css +339 -0
- package/src/theme/components/shared/desktop-window.tsx +535 -0
- package/src/theme/components/shared/field.css +158 -0
- package/src/theme/components/shared/field.stories.tsx +100 -0
- package/src/theme/components/shared/field.tsx +186 -0
- package/src/theme/components/shared/frame.css +39 -0
- package/src/theme/components/shared/frame.stories.tsx +49 -0
- package/src/theme/components/shared/frame.tsx +76 -0
- package/src/theme/components/shared/icon.stories.tsx +90 -0
- package/src/theme/components/shared/icon.tsx +41 -0
- package/src/theme/components/shared/prompt.css +178 -0
- package/src/theme/components/shared/prompt.stories.tsx +57 -0
- package/src/theme/components/shared/prompt.tsx +369 -0
- package/src/theme/components/shared/resolve-card-icon.ts +28 -0
- package/src/theme/components/shared/section-card.stories.tsx +51 -0
- package/src/theme/components/shared/section-card.tsx +44 -0
- package/src/theme/components/shared/section-grid.stories.tsx +46 -0
- package/src/theme/components/shared/section-grid.tsx +15 -0
- package/src/theme/components/shared/status-badge.css +37 -0
- package/src/theme/components/shared/status-badge.stories.tsx +61 -0
- package/src/theme/components/shared/status-badge.tsx +74 -0
- package/src/theme/components/shared/steps.css +88 -0
- package/src/theme/components/shared/steps.stories.tsx +68 -0
- package/src/theme/components/shared/steps.tsx +100 -0
- package/src/theme/components/shared/tech-icon-table.stories.tsx +29 -0
- package/src/theme/components/shared/tech-icon-table.tsx +71 -0
- package/src/theme/components/shared/tech-tag.stories.tsx +40 -0
- package/src/theme/components/shared/tech-tag.tsx +31 -0
- package/src/theme/components/shared/theme-color-palette.css +80 -0
- package/src/theme/components/shared/theme-color-palette.stories.tsx +52 -0
- package/src/theme/components/shared/theme-color-palette.tsx +275 -0
- package/src/theme/components/shared/tooltip.css +69 -0
- package/src/theme/components/shared/tooltip.stories.tsx +72 -0
- package/src/theme/components/shared/tooltip.tsx +77 -0
- package/src/theme/components/sidebar/framework-picker.css +77 -0
- package/src/theme/components/sidebar/framework-picker.tsx +78 -0
- package/src/theme/components/sidebar/sidebar-filter.test.ts +140 -0
- package/src/theme/components/sidebar/sidebar-filter.ts +79 -0
- package/src/theme/components/sidebar/sidebar-links.css +102 -0
- package/src/theme/components/sidebar/sidebar-links.tsx +122 -0
- package/src/theme/components/sidebar/sidebar-promo.css +42 -0
- package/src/theme/components/sidebar/sidebar-promo.tsx +52 -0
- package/src/theme/components/sidebar/sidebar-scope.tsx +151 -0
- package/src/theme/components/sidebar/sidebar-toggle.css +181 -0
- package/src/theme/components/sidebar/sidebar-toggle.tsx +127 -0
- package/src/theme/components/theme-provider.tsx +637 -0
- package/src/theme/components/workspaces/card.css +151 -0
- package/src/theme/components/workspaces/card.tsx +166 -0
- package/src/theme/components/workspaces/grid.tsx +62 -0
- package/src/theme/css.d.ts +1 -0
- package/src/theme/env.d.ts +12 -0
- package/src/theme/fonts/GeistMono-Variable.woff2 +0 -0
- package/src/theme/fonts/GeistPixel-Square.woff2 +0 -0
- package/src/theme/fonts/GeistSans-Variable.woff2 +0 -0
- package/src/theme/hooks/use-ciderpress.ts +61 -0
- package/src/theme/hooks/use-nav-items.ts +76 -0
- package/src/theme/icons/index.ts +2 -0
- package/src/theme/icons/tech-map.ts +228 -0
- package/src/theme/index.tsx +180 -0
- package/src/theme/lib/read-social-links.ts +27 -0
- package/src/theme/lib/route-link.tsx +126 -0
- package/src/theme/lib/safe-url.test.ts +0 -0
- package/src/theme/lib/safe-url.ts +68 -0
- package/src/theme/lib/theme-favicon.ts +125 -0
- package/src/theme/lib/user-config-stub.ts +12 -0
- package/src/theme/styles/layers.css +32 -0
- package/src/theme/styles/overrides/badge.css +26 -0
- package/src/theme/styles/overrides/content-footer.css +80 -0
- package/src/theme/styles/overrides/details.css +61 -0
- package/src/theme/styles/overrides/fonts.css +32 -0
- package/src/theme/styles/overrides/home-card.css +133 -0
- package/src/theme/styles/overrides/home.css +243 -0
- package/src/theme/styles/overrides/rail.css +337 -0
- package/src/theme/styles/overrides/rspress.css +62 -0
- package/src/theme/styles/overrides/scrollbar.css +25 -0
- package/src/theme/styles/overrides/section-card.css +114 -0
- package/src/theme/styles/overrides/sidebar.css +144 -0
- package/src/theme/styles/overrides/tokens.css +288 -0
- package/src/theme/styles/overrides/vscode.css +88 -0
- package/src/theme/styles/themes/amber.css +545 -0
- package/src/theme/styles/themes/arcade-fx.css +366 -0
- package/src/theme/styles/themes/arcade.css +273 -0
- package/src/theme/styles/themes/grannysmith.css +545 -0
- package/src/theme/styles/themes/honeycrisp.css +545 -0
- package/src/theme/styles/themes/midnight.css +273 -0
- package/src/theme/styles/themes/mulled.css +817 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { SiteConfig } from '@ciderpress/config'
|
|
2
|
+
import { match, P } from 'massaman/match'
|
|
3
|
+
import type React from 'react'
|
|
4
|
+
|
|
5
|
+
import { useCiderpress } from '../../hooks/use-ciderpress'
|
|
6
|
+
|
|
7
|
+
import './branch-tag.css'
|
|
8
|
+
import { Icon } from '../shared/icon.tsx'
|
|
9
|
+
|
|
10
|
+
declare const __CIDERPRESS_GIT_BRANCH__: string | undefined
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Git branch tag — pill-shaped badge rendered via the `beforeNavMenu`
|
|
14
|
+
* layout slot. Hidden when on default branches (`main` or `master`) or
|
|
15
|
+
* when no `site.edit.repo` is configured. Uses the pixelarticons:git-branch
|
|
16
|
+
* icon.
|
|
17
|
+
*
|
|
18
|
+
* @returns React element, or `null` when on a default branch / unconfigured.
|
|
19
|
+
*/
|
|
20
|
+
export function BranchTag(): React.ReactElement | null {
|
|
21
|
+
const { site } = useCiderpress()
|
|
22
|
+
const branch = resolveBranch()
|
|
23
|
+
|
|
24
|
+
if (!branch || branch === 'main' || branch === 'master') {
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const href = buildBranchHref({ repo: resolveRepo(site), branch })
|
|
29
|
+
if (href === null) {
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<a
|
|
35
|
+
className="cp-branch-tag"
|
|
36
|
+
href={href}
|
|
37
|
+
target="_blank"
|
|
38
|
+
rel="noopener noreferrer"
|
|
39
|
+
title={`Branch: ${branch}`}
|
|
40
|
+
>
|
|
41
|
+
<Icon icon="pixelarticons:git-branch" width={14} height={14} />
|
|
42
|
+
<span className="cp-branch-tag__text">{branch}</span>
|
|
43
|
+
</a>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { BranchTag as default }
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Resolves the current git branch name from the build-time global,
|
|
51
|
+
* returning an empty string when undefined.
|
|
52
|
+
*
|
|
53
|
+
* @private
|
|
54
|
+
* @returns Current git branch name or empty string
|
|
55
|
+
*/
|
|
56
|
+
function resolveBranch(): string {
|
|
57
|
+
if (__CIDERPRESS_GIT_BRANCH__ !== undefined) {
|
|
58
|
+
return __CIDERPRESS_GIT_BRANCH__
|
|
59
|
+
}
|
|
60
|
+
return ''
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Build a GitHub `/tree/<branch>` URL from the configured `site.edit.repo`.
|
|
65
|
+
*
|
|
66
|
+
* Accepts either a full URL (used as-is) or an `org/repo` slug
|
|
67
|
+
* (prefixed with `https://github.com/`). Returns `null` when `repo` is
|
|
68
|
+
* missing so the caller can omit the component entirely.
|
|
69
|
+
*
|
|
70
|
+
* @private
|
|
71
|
+
* @param params - The configured repo and the current branch.
|
|
72
|
+
* @returns Fully-qualified URL string, or `null` when unconfigured.
|
|
73
|
+
*/
|
|
74
|
+
function buildBranchHref(params: {
|
|
75
|
+
readonly repo: string | undefined
|
|
76
|
+
readonly branch: string
|
|
77
|
+
}): string | null {
|
|
78
|
+
return match(params.repo)
|
|
79
|
+
.with(undefined, () => null)
|
|
80
|
+
.with('', () => null)
|
|
81
|
+
.with(P.string.startsWith('http'), (full) => `${full}/tree/${params.branch}`)
|
|
82
|
+
.otherwise((slug) => `https://github.com/${slug}/tree/${params.branch}`)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Pull the configured edit-repo slug off the site config, expressed
|
|
87
|
+
* with explicit null checks rather than optional chaining.
|
|
88
|
+
*
|
|
89
|
+
* @private
|
|
90
|
+
* @param site - The ciderpress site config (may be undefined).
|
|
91
|
+
* @returns The configured `edit.repo` value or `undefined`.
|
|
92
|
+
*/
|
|
93
|
+
function resolveRepo(site: SiteConfig | undefined): string | undefined {
|
|
94
|
+
if (site === undefined) {
|
|
95
|
+
return undefined
|
|
96
|
+
}
|
|
97
|
+
if (site.edit === undefined) {
|
|
98
|
+
return undefined
|
|
99
|
+
}
|
|
100
|
+
return site.edit.repo
|
|
101
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { useFrontmatter, useLocation } from '@rspress/core/runtime'
|
|
2
|
+
import { DocContent, DocFooter, Outline, Overview, Sidebar, useWatchToc } from '@rspress/core/theme'
|
|
3
|
+
import type { DocLayoutProps } from '@rspress/core/theme'
|
|
4
|
+
import { clsx } from 'clsx'
|
|
5
|
+
import { match } from 'massaman/match'
|
|
6
|
+
import { useEffect, useMemo, useState } from 'react'
|
|
7
|
+
import type React from 'react'
|
|
8
|
+
|
|
9
|
+
import { CiderpressLayoutContext } from './ciderpress-layout-context'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Ciderpress replacement for Rspress's `<DocLayout />`. Re-exported
|
|
13
|
+
* from the theme entry so Rspress's `<Layout />` (which imports
|
|
14
|
+
* `DocLayout` via `@rspress/core/theme`) picks this version up
|
|
15
|
+
* automatically.
|
|
16
|
+
*
|
|
17
|
+
* Why a full re-implementation instead of a `beforeDoc` wrapper:
|
|
18
|
+
*
|
|
19
|
+
* 1. Rspress's DocLayout unconditionally renders
|
|
20
|
+
* `<div className="rp-doc-layout__menu">{sidebarMenu}</div>` —
|
|
21
|
+
* and the inner `<SidebarMenu />` is hardcoded inside the
|
|
22
|
+
* private `useSidebarMenu` hook (not swappable). CSS-hiding the
|
|
23
|
+
* wrapper leaves the React subtree (and the focus-trap, body-
|
|
24
|
+
* scroll-lock, click-outside listeners it installs) live, which
|
|
25
|
+
* we don't want when our own `<CiderpressDocsBar />` is the
|
|
26
|
+
* sticky sub-header.
|
|
27
|
+
*
|
|
28
|
+
* 2. The sidebar/outline drawer state lives entirely inside
|
|
29
|
+
* `useSidebarMenu` and isn't exposed publicly. By owning the
|
|
30
|
+
* DocLayout we own the state, which then flows through
|
|
31
|
+
* `<CiderpressLayoutContext />` to `<CiderpressDocsBar />` so
|
|
32
|
+
* the bar's toggle button drives the drawer directly (no
|
|
33
|
+
* `document.querySelector` against Rspress internals).
|
|
34
|
+
*
|
|
35
|
+
* Behavioural parity preserved: SSR markdown short-circuit, all
|
|
36
|
+
* `before*` / `after*` slots, frontmatter-driven sidebar / outline /
|
|
37
|
+
* footer toggles, doc-wide variant, overview-page variant, and the
|
|
38
|
+
* `useWatchToc` ref on the article body.
|
|
39
|
+
*
|
|
40
|
+
* @param props - Standard `DocLayoutProps` (slots + components).
|
|
41
|
+
* @returns Doc-layout React element.
|
|
42
|
+
*/
|
|
43
|
+
export function CiderpressDocLayout(props: DocLayoutProps): React.ReactElement {
|
|
44
|
+
const {
|
|
45
|
+
beforeDocFooter,
|
|
46
|
+
afterDocFooter,
|
|
47
|
+
beforeDoc,
|
|
48
|
+
afterDoc,
|
|
49
|
+
beforeDocContent,
|
|
50
|
+
afterDocContent,
|
|
51
|
+
beforeOutline,
|
|
52
|
+
afterOutline,
|
|
53
|
+
beforeSidebar,
|
|
54
|
+
afterSidebar,
|
|
55
|
+
components,
|
|
56
|
+
} = props
|
|
57
|
+
const { frontmatter } = useFrontmatter()
|
|
58
|
+
const fmRecord = frontmatter as Record<string, unknown>
|
|
59
|
+
const isOverviewPage = fmRecord.overview === true
|
|
60
|
+
const sidebarConfig = match(fmRecord.sidebar)
|
|
61
|
+
.with(false, () => false as const)
|
|
62
|
+
.with('placeholder', () => 'placeholder' as const)
|
|
63
|
+
.otherwise(() => true as const)
|
|
64
|
+
const showSidebar = sidebarConfig === true
|
|
65
|
+
const showSidebarPlaceholder = sidebarConfig === false || sidebarConfig === 'placeholder'
|
|
66
|
+
const isLegacyPlaceholder = sidebarConfig === 'placeholder'
|
|
67
|
+
const showOutline = match(fmRecord.outline)
|
|
68
|
+
.with(false, () => false)
|
|
69
|
+
.otherwise(() => true)
|
|
70
|
+
const showDocFooter = match(fmRecord.footer)
|
|
71
|
+
.with(false, () => false)
|
|
72
|
+
.otherwise(() => true)
|
|
73
|
+
const isDocWide = fmRecord.pageType === 'doc-wide'
|
|
74
|
+
|
|
75
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState(false)
|
|
76
|
+
const [isOutlineOpen, setIsOutlineOpen] = useState(false)
|
|
77
|
+
const { pathname } = useLocation()
|
|
78
|
+
|
|
79
|
+
// Close drawers when navigating to a new page.
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
setIsSidebarOpen(false)
|
|
82
|
+
setIsOutlineOpen(false)
|
|
83
|
+
}, [pathname])
|
|
84
|
+
|
|
85
|
+
// Body scroll lock ONLY while the SIDEBAR drawer is open — the
|
|
86
|
+
// outline is now a dropdown / side popout that lives in the bar
|
|
87
|
+
// and doesn't take over the viewport, so locking page scroll for
|
|
88
|
+
// it makes the page feel "frozen" without good reason.
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (globalThis.document === undefined) {
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
const html = globalThis.document.documentElement
|
|
94
|
+
match(isSidebarOpen)
|
|
95
|
+
.with(true, () => {
|
|
96
|
+
html.dataset.cpDrawerOpen = 'true'
|
|
97
|
+
})
|
|
98
|
+
.otherwise(() => {
|
|
99
|
+
delete html.dataset.cpDrawerOpen
|
|
100
|
+
})
|
|
101
|
+
}, [isSidebarOpen])
|
|
102
|
+
|
|
103
|
+
const { rspressDocRef } = useWatchToc()
|
|
104
|
+
|
|
105
|
+
const contextValue = useMemo(
|
|
106
|
+
() => ({ isSidebarOpen, setIsSidebarOpen, isOutlineOpen, setIsOutlineOpen }),
|
|
107
|
+
[isSidebarOpen, isOutlineOpen]
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
if (process.env.__SSR_MD__) {
|
|
111
|
+
return (
|
|
112
|
+
<>
|
|
113
|
+
{match(isOverviewPage)
|
|
114
|
+
.with(true, () => (
|
|
115
|
+
<Overview content={<DocContent components={components} isOverviewPage />} />
|
|
116
|
+
))
|
|
117
|
+
.otherwise(() => (
|
|
118
|
+
<DocContent components={components} />
|
|
119
|
+
))}
|
|
120
|
+
</>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const sidebarSlot = match({ showSidebar, showSidebarPlaceholder })
|
|
125
|
+
.with({ showSidebar: true }, () => (
|
|
126
|
+
<aside
|
|
127
|
+
className={clsx(
|
|
128
|
+
'rp-doc-layout__sidebar',
|
|
129
|
+
isSidebarOpen && 'rp-doc-layout__sidebar--open',
|
|
130
|
+
'rp-scrollbar'
|
|
131
|
+
)}
|
|
132
|
+
>
|
|
133
|
+
{beforeSidebar}
|
|
134
|
+
<Sidebar />
|
|
135
|
+
{afterSidebar}
|
|
136
|
+
</aside>
|
|
137
|
+
))
|
|
138
|
+
.with({ showSidebarPlaceholder: true }, () => (
|
|
139
|
+
<aside
|
|
140
|
+
className={clsx(
|
|
141
|
+
'rp-doc-layout__sidebar-placeholder',
|
|
142
|
+
isLegacyPlaceholder && 'rp-doc-layout__sidebar-placeholder--legacy'
|
|
143
|
+
)}
|
|
144
|
+
style={docWideStyle(isDocWide)}
|
|
145
|
+
/>
|
|
146
|
+
))
|
|
147
|
+
.otherwise(() => null)
|
|
148
|
+
|
|
149
|
+
const mainSlot = match(isOverviewPage)
|
|
150
|
+
.with(true, () => (
|
|
151
|
+
<main className="rp-doc-layout__overview">
|
|
152
|
+
{beforeDocContent}
|
|
153
|
+
<Overview content={<DocContent components={components} isOverviewPage />} />
|
|
154
|
+
{afterDocContent}
|
|
155
|
+
</main>
|
|
156
|
+
))
|
|
157
|
+
.otherwise(() => (
|
|
158
|
+
<div className={clsx('rp-doc-layout__doc', isDocWide && 'rp-doc-layout__doc--wide')}>
|
|
159
|
+
<main className="rp-doc-layout__doc-container">
|
|
160
|
+
{beforeDocContent}
|
|
161
|
+
<div className="rp-doc rspress-doc" ref={rspressDocRef}>
|
|
162
|
+
<DocContent components={components} />
|
|
163
|
+
</div>
|
|
164
|
+
{afterDocContent}
|
|
165
|
+
{beforeDocFooter}
|
|
166
|
+
{showDocFooter && <DocFooter />}
|
|
167
|
+
{afterDocFooter}
|
|
168
|
+
</main>
|
|
169
|
+
</div>
|
|
170
|
+
))
|
|
171
|
+
|
|
172
|
+
// No `--open` class on the outline rail: at >=1280px it's a sticky
|
|
173
|
+
// desktop rail; at <=1279px Rspress styles it as a fixed overlay
|
|
174
|
+
// drawer that we don't want. <CiderpressDocsBar /> renders its own
|
|
175
|
+
// dropdown using the same `<Toc />` component, so the rail just
|
|
176
|
+
// stays hidden via Rspress's default `visibility: hidden` at narrow
|
|
177
|
+
// widths.
|
|
178
|
+
const outlineSlot = match({ isOverviewPage, showOutline })
|
|
179
|
+
.with({ isOverviewPage: true }, () => null)
|
|
180
|
+
.with({ showOutline: true }, () => (
|
|
181
|
+
<aside className={clsx('rp-doc-layout__outline', 'rp-scrollbar')}>
|
|
182
|
+
{beforeOutline}
|
|
183
|
+
<Outline />
|
|
184
|
+
{afterOutline}
|
|
185
|
+
</aside>
|
|
186
|
+
))
|
|
187
|
+
.otherwise(() => (
|
|
188
|
+
<aside className="rp-doc-layout__outline-placeholder" style={docWideStyle(isDocWide)} />
|
|
189
|
+
))
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<CiderpressLayoutContext.Provider value={contextValue}>
|
|
193
|
+
{beforeDoc}
|
|
194
|
+
<div className="rp-doc-layout__container rp-doc-layout__container--no-menu">
|
|
195
|
+
{/* Mask only renders for the sidebar drawer — the outline
|
|
196
|
+
uses an in-bar dropdown (`<CiderpressDocsBar />`'s
|
|
197
|
+
outline-dropdown) with its own document-mousedown
|
|
198
|
+
click-outside handler, no modal chrome needed. */}
|
|
199
|
+
{isSidebarOpen && (
|
|
200
|
+
<div
|
|
201
|
+
className="cp-drawer-mask"
|
|
202
|
+
onClick={makeCloseDrawers(setIsSidebarOpen, setIsOutlineOpen)}
|
|
203
|
+
aria-hidden="true"
|
|
204
|
+
/>
|
|
205
|
+
)}
|
|
206
|
+
{sidebarSlot}
|
|
207
|
+
{mainSlot}
|
|
208
|
+
{outlineSlot}
|
|
209
|
+
</div>
|
|
210
|
+
{afterDoc}
|
|
211
|
+
</CiderpressLayoutContext.Provider>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Produce the inline style for the placeholder rails when the page is
|
|
217
|
+
* `doc-wide` (zero-width placeholders so the prose can claim the space).
|
|
218
|
+
*
|
|
219
|
+
* @private
|
|
220
|
+
* @param isDocWide - True when the active page is `doc-wide`.
|
|
221
|
+
* @returns Style object or undefined when no override is needed.
|
|
222
|
+
*/
|
|
223
|
+
function docWideStyle(isDocWide: boolean): React.CSSProperties | undefined {
|
|
224
|
+
if (isDocWide) {
|
|
225
|
+
return { width: '0' }
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Build a single onClick handler that closes both drawers. Inlined so
|
|
231
|
+
* `setIsSidebarOpen` / `setIsOutlineOpen` don't need to be wrapped in
|
|
232
|
+
* `useCallback`s that re-create on every state flip.
|
|
233
|
+
*
|
|
234
|
+
* @private
|
|
235
|
+
* @param setSidebar - Setter for the sidebar drawer state.
|
|
236
|
+
* @param setOutline - Setter for the outline drawer state.
|
|
237
|
+
* @returns Click handler.
|
|
238
|
+
*/
|
|
239
|
+
function makeCloseDrawers(
|
|
240
|
+
setSidebar: React.Dispatch<React.SetStateAction<boolean>>,
|
|
241
|
+
setOutline: React.Dispatch<React.SetStateAction<boolean>>
|
|
242
|
+
): () => void {
|
|
243
|
+
return () => {
|
|
244
|
+
setSidebar(false)
|
|
245
|
+
setOutline(false)
|
|
246
|
+
}
|
|
247
|
+
}
|