@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,77 @@
|
|
|
1
|
+
import { match } from 'massaman/match'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
const MARK_FALLBACK_COLOR = '#dc2626'
|
|
5
|
+
const MARK_FALLBACK_SHADOW = '#7f1d1d'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props accepted by the ciderpress brand mark.
|
|
9
|
+
*/
|
|
10
|
+
export interface CiderpressMarkProps {
|
|
11
|
+
/** Optional className applied to the root `<svg>` element. */
|
|
12
|
+
readonly className?: string
|
|
13
|
+
/** Explicit `width`/`height` — defaults to letting CSS size the SVG. */
|
|
14
|
+
readonly size?: number | string
|
|
15
|
+
/**
|
|
16
|
+
* Accessible label. Defaults to `"ciderpress"`. Pass an empty string to
|
|
17
|
+
* mark the SVG as decorative (`aria-hidden`).
|
|
18
|
+
*/
|
|
19
|
+
readonly title?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Compact ciderpress brand mark — a rounded-square chip with the
|
|
24
|
+
* pixel-apple glyph centred inside. The apple body uses
|
|
25
|
+
* `fill="currentColor"` so it inherits the active theme's brand colour
|
|
26
|
+
* via `--rp-c-brand`; the body shadow tracks `--cp-c-brand-3` (the
|
|
27
|
+
* deepest brand shade). Leaf greens and stem browns stay constant.
|
|
28
|
+
*
|
|
29
|
+
* Visually mirrors the favicon swapped in by `syncThemeFavicon`, so the
|
|
30
|
+
* tab mark and the in-page mark stay in lockstep across every theme.
|
|
31
|
+
*
|
|
32
|
+
* @param props - Optional className, size, and accessible label.
|
|
33
|
+
* @returns Inline SVG element.
|
|
34
|
+
*/
|
|
35
|
+
export function CiderpressMark(props: CiderpressMarkProps): React.ReactElement {
|
|
36
|
+
const decorative = props.title === ''
|
|
37
|
+
const label = props.title ?? 'ciderpress'
|
|
38
|
+
const a11yProps = match(decorative)
|
|
39
|
+
.with(true, () => ({ role: 'presentation' as const, 'aria-hidden': true as const }))
|
|
40
|
+
.otherwise(() => ({ role: 'img' as const, 'aria-label': label }))
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<svg
|
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
viewBox="0 0 64 64"
|
|
46
|
+
shapeRendering="crispEdges"
|
|
47
|
+
className={props.className}
|
|
48
|
+
width={props.size}
|
|
49
|
+
height={props.size}
|
|
50
|
+
style={{ color: `var(--rp-c-brand, ${MARK_FALLBACK_COLOR})` }}
|
|
51
|
+
{...a11yProps}
|
|
52
|
+
>
|
|
53
|
+
{!decorative && <title>{label}</title>}
|
|
54
|
+
<rect width="64" height="64" rx="12" fill="var(--cp-c-bg, #0a0a0a)" />
|
|
55
|
+
{/* Apple source content lives in (60..250, 40..260). scale(0.25)
|
|
56
|
+
places a 47.5x55 apple centred in the 64x64 chip. */}
|
|
57
|
+
<g transform="translate(8.25 4.5) scale(0.25) translate(-60 -40)">
|
|
58
|
+
<path d="M80,40h10v10h-10v-10zM90,50h30v10h10v10h-30v-10h-10v-10z" fill="#99e550" />
|
|
59
|
+
<path
|
|
60
|
+
d="M90,40h30v10h-30v-10zM120,50h10v10h-10v-10zM130,60h10v10h-10v-10z"
|
|
61
|
+
fill="#6abe30"
|
|
62
|
+
/>
|
|
63
|
+
<path d="M120,40h20v10h10v20h-10v-10h-10v-10h-10v-10z" fill="#4b692f" />
|
|
64
|
+
<path d="M160,40h20v10h-10v10h-10v10h-10v-20h10v-10z" fill="#d9a066" />
|
|
65
|
+
<path d="M150,70h10v20h-10v-20z" fill="#8f563b" />
|
|
66
|
+
<path
|
|
67
|
+
d="M90,80h20v10h30v10h30v-10h30v-10h20v10h10v10h10v10h10v90h-10v20h-10v20h-10v10h-10v10h-30v-10h-10v-10h-10v-10h-10v10h-10v10h-10v10h-30v-10h-10v-10h-10v-20h-10v-20h-10v-90h10v-10h10v-10h10v-10zM220,200h10v-30h-10v-10h-10v40h-10v20h-10v20h10v-10h10v-10h10v-20z"
|
|
68
|
+
fill="currentColor"
|
|
69
|
+
/>
|
|
70
|
+
<path
|
|
71
|
+
d="M110,80h30v10h-30v-10zM170,80h30v10h-30v-10zM140,90h30v10h-30v-10zM210,160h10v10h10v30h-10v20h-10v10h-10v10h-10v-20h10v-20h10v-40zM150,230h10v10h10v10h10v10h-50v-10h10v-10h10v-10z"
|
|
72
|
+
fill={`var(--cp-c-brand-3, ${MARK_FALLBACK_SHADOW})`}
|
|
73
|
+
/>
|
|
74
|
+
</g>
|
|
75
|
+
</svg>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color — color swatch with click-to-copy.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.cp-color {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: var(--cp-s-8);
|
|
9
|
+
padding: var(--cp-s-4) var(--cp-s-10) var(--cp-s-4) var(--cp-s-4);
|
|
10
|
+
border: 1px solid var(--cp-c-border);
|
|
11
|
+
border-radius: var(--rp-radius-large);
|
|
12
|
+
background: var(--cp-c-bg);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
font-family: var(--cp-font-family-base);
|
|
15
|
+
transition: border-color var(--cp-duration-base);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.cp-color:hover {
|
|
19
|
+
border-color: var(--cp-c-brand-1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cp-color:focus-visible {
|
|
23
|
+
border-color: var(--cp-c-brand-1);
|
|
24
|
+
outline: var(--cp-size-focus-ring) solid var(--cp-c-brand-1);
|
|
25
|
+
outline-offset: var(--cp-size-focus-ring-offset);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cp-color__swatch {
|
|
29
|
+
display: block;
|
|
30
|
+
width: var(--cp-size-swatch);
|
|
31
|
+
height: var(--cp-size-swatch);
|
|
32
|
+
border-radius: var(--rp-radius);
|
|
33
|
+
border: 1px solid var(--cp-c-overlay-faint);
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cp-color__info {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 0;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.cp-color__name {
|
|
45
|
+
font-size: var(--cp-fs-color-name);
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
color: var(--cp-c-text-1);
|
|
48
|
+
line-height: var(--cp-lh-tighter);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.cp-color__value {
|
|
52
|
+
font-size: var(--cp-fs-color-value);
|
|
53
|
+
font-family: var(--cp-font-family-mono);
|
|
54
|
+
color: var(--cp-c-text-2);
|
|
55
|
+
line-height: var(--cp-lh-tighter);
|
|
56
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Story } from '@ladle/react'
|
|
2
|
+
|
|
3
|
+
import { Color } from './color.tsx'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Data Display / Color Swatch',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Single swatch — click the button to copy the value to clipboard.
|
|
13
|
+
*
|
|
14
|
+
* @returns Color swatch
|
|
15
|
+
*/
|
|
16
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
17
|
+
export const Default: Story = () => <Color value="#dc2626" name="brand-1" />
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Anonymous swatch — no name, just the colour value as label.
|
|
21
|
+
*
|
|
22
|
+
* @returns Color swatch without a name
|
|
23
|
+
*/
|
|
24
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
25
|
+
export const Anonymous: Story = () => <Color value="hsl(0 84% 60%)" />
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Full Mulled palette laid out as a grid.
|
|
29
|
+
*
|
|
30
|
+
* @returns Grid of palette swatches
|
|
31
|
+
*/
|
|
32
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
33
|
+
export const Palette: Story = () => (
|
|
34
|
+
<div
|
|
35
|
+
style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 8 }}
|
|
36
|
+
>
|
|
37
|
+
<Color value="#991b1b" name="brand-1" />
|
|
38
|
+
<Color value="#7f1d1d" name="brand-2" />
|
|
39
|
+
<Color value="#450a0a" name="brand-3" />
|
|
40
|
+
<Color value="#dc2626" name="brand-light" />
|
|
41
|
+
<Color value="#0a0a0a" name="bg" />
|
|
42
|
+
<Color value="#0f0f0f" name="bg-alt" />
|
|
43
|
+
<Color value="#161616" name="bg-elv" />
|
|
44
|
+
<Color value="#f5f5f5" name="text-1" />
|
|
45
|
+
<Color value="#2a2a2a" name="border" />
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { match, P } from 'massaman/match'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
export interface ColorProps {
|
|
6
|
+
/**
|
|
7
|
+
* Color value in any CSS-valid format (hex, rgb, hsl).
|
|
8
|
+
*/
|
|
9
|
+
readonly value: string
|
|
10
|
+
/**
|
|
11
|
+
* Optional display name for the color.
|
|
12
|
+
*/
|
|
13
|
+
readonly name?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Color swatch that displays a color value with an optional name.
|
|
18
|
+
* Click to copy the color value to clipboard.
|
|
19
|
+
*
|
|
20
|
+
* @param props - Color value and optional display name
|
|
21
|
+
* @returns React element with clickable color swatch
|
|
22
|
+
*/
|
|
23
|
+
export function Color({ value, name }: ColorProps): React.ReactElement {
|
|
24
|
+
const [copied, setCopied] = useState(false)
|
|
25
|
+
const resetTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
26
|
+
|
|
27
|
+
useEffect(
|
|
28
|
+
() => () => {
|
|
29
|
+
if (resetTimerRef.current !== null) {
|
|
30
|
+
clearTimeout(resetTimerRef.current)
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[]
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
const handleClick = useCallback(() => {
|
|
37
|
+
navigator.clipboard
|
|
38
|
+
.writeText(value)
|
|
39
|
+
.then(() => {
|
|
40
|
+
if (resetTimerRef.current !== null) {
|
|
41
|
+
clearTimeout(resetTimerRef.current)
|
|
42
|
+
}
|
|
43
|
+
setCopied(true)
|
|
44
|
+
resetTimerRef.current = setTimeout(() => setCopied(false), 2000)
|
|
45
|
+
return null
|
|
46
|
+
})
|
|
47
|
+
.catch(() => {
|
|
48
|
+
setCopied(false)
|
|
49
|
+
})
|
|
50
|
+
}, [value])
|
|
51
|
+
|
|
52
|
+
const nameEl = match(name)
|
|
53
|
+
.with(P.nonNullable, (n) => <span className="cp-color__name">{n}</span>)
|
|
54
|
+
.otherwise(() => null)
|
|
55
|
+
|
|
56
|
+
const label = match(copied)
|
|
57
|
+
.with(true, () => 'Copied!')
|
|
58
|
+
.otherwise(() => value)
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<button type="button" className="cp-color" onClick={handleClick} title={`Copy ${value}`}>
|
|
62
|
+
<span className="cp-color__swatch" style={{ backgroundColor: value }} />
|
|
63
|
+
<span className="cp-color__info">
|
|
64
|
+
{nameEl}
|
|
65
|
+
<span className="cp-color__value">{label}</span>
|
|
66
|
+
</span>
|
|
67
|
+
</button>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Columns — responsive grid layout (1–4 columns).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.cp-columns {
|
|
6
|
+
display: grid;
|
|
7
|
+
gap: 16px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cp-columns--1 {
|
|
12
|
+
grid-template-columns: 1fr;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cp-columns--2 {
|
|
16
|
+
grid-template-columns: repeat(2, 1fr);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.cp-columns--3 {
|
|
20
|
+
grid-template-columns: repeat(3, 1fr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.cp-columns--4 {
|
|
24
|
+
grid-template-columns: repeat(4, 1fr);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (max-width: 640px) {
|
|
28
|
+
.cp-columns--2,
|
|
29
|
+
.cp-columns--3,
|
|
30
|
+
.cp-columns--4 {
|
|
31
|
+
grid-template-columns: 1fr;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.cp-column {
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Story } from '@ladle/react'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
import { Column, Columns } from './columns.tsx'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Layout / Columns',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default meta
|
|
11
|
+
|
|
12
|
+
function Cell({ n }: { readonly n: number }): React.ReactElement {
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
style={{
|
|
16
|
+
padding: '20px 16px',
|
|
17
|
+
background: 'var(--cp-c-bg-soft)',
|
|
18
|
+
border: '1px solid var(--cp-c-border)',
|
|
19
|
+
borderRadius: 'var(--rp-radius)',
|
|
20
|
+
textAlign: 'center',
|
|
21
|
+
fontFamily: 'ui-monospace, monospace',
|
|
22
|
+
color: 'var(--cp-c-text-2)',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
cell {n}
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Two-column grid — the default. Collapses to a single column below
|
|
32
|
+
* 640px.
|
|
33
|
+
*
|
|
34
|
+
* @returns Two-column grid
|
|
35
|
+
*/
|
|
36
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
37
|
+
export const TwoColumns: Story = () => (
|
|
38
|
+
<Columns>
|
|
39
|
+
<Cell n={1} />
|
|
40
|
+
<Cell n={2} />
|
|
41
|
+
</Columns>
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Three-column grid.
|
|
46
|
+
*
|
|
47
|
+
* @returns Three-column grid
|
|
48
|
+
*/
|
|
49
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
50
|
+
export const ThreeColumns: Story = () => (
|
|
51
|
+
<Columns cols={3}>
|
|
52
|
+
<Cell n={1} />
|
|
53
|
+
<Cell n={2} />
|
|
54
|
+
<Cell n={3} />
|
|
55
|
+
</Columns>
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Four-column grid — densest variant.
|
|
60
|
+
*
|
|
61
|
+
* @returns Four-column grid
|
|
62
|
+
*/
|
|
63
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
64
|
+
export const FourColumns: Story = () => (
|
|
65
|
+
<Columns cols={4}>
|
|
66
|
+
{[1, 2, 3, 4].map((n) => (
|
|
67
|
+
<Cell key={n} n={n} />
|
|
68
|
+
))}
|
|
69
|
+
</Columns>
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Explicit `<Column>` wrappers — use these when a cell needs to group
|
|
74
|
+
* multiple elements into a single grid slot.
|
|
75
|
+
*
|
|
76
|
+
* @returns Two-column grid with grouped content per column
|
|
77
|
+
*/
|
|
78
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
79
|
+
export const ExplicitColumns: Story = () => (
|
|
80
|
+
<Columns>
|
|
81
|
+
<Column>
|
|
82
|
+
<h3 style={{ marginTop: 0 }}>Left</h3>
|
|
83
|
+
<p>Multiple elements in one grid slot.</p>
|
|
84
|
+
<p>Second paragraph stays grouped.</p>
|
|
85
|
+
</Column>
|
|
86
|
+
<Column>
|
|
87
|
+
<h3 style={{ marginTop: 0 }}>Right</h3>
|
|
88
|
+
<p>Mirrored layout on the other side.</p>
|
|
89
|
+
</Column>
|
|
90
|
+
</Columns>
|
|
91
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { match } from 'massaman/match'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
|
|
4
|
+
export interface ColumnsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Number of grid columns (1–4). Defaults to 2.
|
|
7
|
+
* Collapses to a single column on viewports below 640px.
|
|
8
|
+
*/
|
|
9
|
+
readonly cols?: 1 | 2 | 3 | 4
|
|
10
|
+
/**
|
|
11
|
+
* Grid children — either raw content or explicit Column wrappers.
|
|
12
|
+
*/
|
|
13
|
+
readonly children: React.ReactNode
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Generic responsive grid layout for arbitrary content.
|
|
18
|
+
* Supports 1–4 columns with automatic responsive collapse.
|
|
19
|
+
*
|
|
20
|
+
* @param props - Grid configuration with column count
|
|
21
|
+
* @returns React element with CSS Grid layout
|
|
22
|
+
*/
|
|
23
|
+
export function Columns({ cols = 2, children }: ColumnsProps): React.ReactElement {
|
|
24
|
+
const className = match(cols)
|
|
25
|
+
.with(1, () => 'cp-columns cp-columns--1')
|
|
26
|
+
.with(2, () => 'cp-columns cp-columns--2')
|
|
27
|
+
.with(3, () => 'cp-columns cp-columns--3')
|
|
28
|
+
.with(4, () => 'cp-columns cp-columns--4')
|
|
29
|
+
.exhaustive()
|
|
30
|
+
|
|
31
|
+
return <div className={className}>{children}</div>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ColumnProps {
|
|
35
|
+
/**
|
|
36
|
+
* Content rendered inside the column.
|
|
37
|
+
*/
|
|
38
|
+
readonly children: React.ReactNode
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Explicit wrapper for content placed inside a Columns grid.
|
|
43
|
+
* Use when you need to group multiple elements into a single grid cell.
|
|
44
|
+
*
|
|
45
|
+
* @param props - Column content
|
|
46
|
+
* @returns React element for a grid cell
|
|
47
|
+
*/
|
|
48
|
+
export function Column({ children }: ColumnProps): React.ReactElement {
|
|
49
|
+
return <div className="cp-column">{children}</div>
|
|
50
|
+
}
|