@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,100 @@
|
|
|
1
|
+
import type { Story } from '@ladle/react'
|
|
2
|
+
|
|
3
|
+
import { Field, FieldGroup } from './field.tsx'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Forms / Field',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Required field with a type pill.
|
|
13
|
+
*
|
|
14
|
+
* @returns Required field
|
|
15
|
+
*/
|
|
16
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
17
|
+
export const Required: Story = () => (
|
|
18
|
+
<Field name="title" type="string" required>
|
|
19
|
+
The site title displayed in the navbar and document `<title>`.
|
|
20
|
+
</Field>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optional field — default badge state.
|
|
25
|
+
*
|
|
26
|
+
* @returns Optional field
|
|
27
|
+
*/
|
|
28
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
29
|
+
export const Optional: Story = () => (
|
|
30
|
+
<Field name="base" type="string">
|
|
31
|
+
Base path for the deployed site, e.g. `'/docs/'`.
|
|
32
|
+
</Field>
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Deprecated field — name is struck through, badge swaps for
|
|
37
|
+
* `deprecated`.
|
|
38
|
+
*
|
|
39
|
+
* @returns Deprecated field
|
|
40
|
+
*/
|
|
41
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
42
|
+
export const Deprecated: Story = () => (
|
|
43
|
+
<Field name="legacyTheme" type="string" deprecated>
|
|
44
|
+
Use `theme` instead. Will be removed in 2.0.
|
|
45
|
+
</Field>
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Field with a default value rendered below the header row.
|
|
50
|
+
*
|
|
51
|
+
* @returns Field with default value
|
|
52
|
+
*/
|
|
53
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
54
|
+
export const WithDefault: Story = () => (
|
|
55
|
+
<Field
|
|
56
|
+
name="theme"
|
|
57
|
+
type="'mulled' | 'honeycrisp' | 'grannysmith' | 'amber' | 'midnight' | 'arcade'"
|
|
58
|
+
defaultValue="'mulled'"
|
|
59
|
+
>
|
|
60
|
+
Built-in theme palette applied to the site.
|
|
61
|
+
</Field>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Multiple fields wrapped in a static group (titled section with
|
|
66
|
+
* bottom border).
|
|
67
|
+
*
|
|
68
|
+
* @returns Field group with three fields
|
|
69
|
+
*/
|
|
70
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
71
|
+
export const Grouped: Story = () => (
|
|
72
|
+
<FieldGroup title="Site config">
|
|
73
|
+
<Field name="title" type="string" required>
|
|
74
|
+
The site title.
|
|
75
|
+
</Field>
|
|
76
|
+
<Field name="description" type="string">
|
|
77
|
+
Meta description used for SEO and link previews.
|
|
78
|
+
</Field>
|
|
79
|
+
<Field name="base" type="string" defaultValue="'/'">
|
|
80
|
+
Base path for the deployed site.
|
|
81
|
+
</Field>
|
|
82
|
+
</FieldGroup>
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Expandable group — collapsible panel with chevron trigger.
|
|
87
|
+
*
|
|
88
|
+
* @returns Expandable field group
|
|
89
|
+
*/
|
|
90
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
91
|
+
export const Expandable: Story = () => (
|
|
92
|
+
<FieldGroup title="Advanced options" expandable>
|
|
93
|
+
<Field name="markdown.toc.level" type="number[]" defaultValue="[2, 3]">
|
|
94
|
+
Heading levels included in the table of contents.
|
|
95
|
+
</Field>
|
|
96
|
+
<Field name="search" type="'local' | false" defaultValue="'local'">
|
|
97
|
+
Search provider. Set to `false` to disable the in-page search panel.
|
|
98
|
+
</Field>
|
|
99
|
+
</FieldGroup>
|
|
100
|
+
)
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { match, P } from 'massaman/match'
|
|
2
|
+
import type React from 'react'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Icon } from './icon'
|
|
6
|
+
|
|
7
|
+
export interface FieldProps {
|
|
8
|
+
/**
|
|
9
|
+
* Field name, rendered in monospace bold.
|
|
10
|
+
*/
|
|
11
|
+
readonly name: string
|
|
12
|
+
/**
|
|
13
|
+
* Type annotation shown as a pill badge (e.g. "string", "User[]").
|
|
14
|
+
*/
|
|
15
|
+
readonly type?: string
|
|
16
|
+
/**
|
|
17
|
+
* When true, shows a "required" badge. When false or omitted, shows "optional".
|
|
18
|
+
* Ignored when `deprecated` is true.
|
|
19
|
+
*/
|
|
20
|
+
readonly required?: boolean
|
|
21
|
+
/**
|
|
22
|
+
* When true, shows a "deprecated" badge and strikes through the name.
|
|
23
|
+
* Overrides the required/optional badge.
|
|
24
|
+
*/
|
|
25
|
+
readonly deprecated?: boolean
|
|
26
|
+
/**
|
|
27
|
+
* Default value displayed below the header row.
|
|
28
|
+
*/
|
|
29
|
+
readonly defaultValue?: string
|
|
30
|
+
/**
|
|
31
|
+
* Description text and optional nested FieldGroup.
|
|
32
|
+
*/
|
|
33
|
+
readonly children: React.ReactNode
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Individual field documentation block displaying a parameter name,
|
|
38
|
+
* type badge, required/optional/deprecated badges, default value,
|
|
39
|
+
* and description body.
|
|
40
|
+
*
|
|
41
|
+
* @param props - Field configuration and description children
|
|
42
|
+
* @returns React element for a single documented field
|
|
43
|
+
*/
|
|
44
|
+
export function Field({
|
|
45
|
+
name,
|
|
46
|
+
type,
|
|
47
|
+
required,
|
|
48
|
+
deprecated,
|
|
49
|
+
defaultValue,
|
|
50
|
+
children,
|
|
51
|
+
}: FieldProps): React.ReactElement {
|
|
52
|
+
const nameClass = match(deprecated)
|
|
53
|
+
.with(true, () => 'cp-field__name cp-field__name--deprecated')
|
|
54
|
+
.otherwise(() => 'cp-field__name')
|
|
55
|
+
|
|
56
|
+
const typeEl = match(type)
|
|
57
|
+
.with(P.nonNullable, (t) => <span className="cp-field__type">{t}</span>)
|
|
58
|
+
.otherwise(() => null)
|
|
59
|
+
|
|
60
|
+
const badgeEl = match(deprecated)
|
|
61
|
+
.with(true, () => (
|
|
62
|
+
<span className="cp-field__badge cp-field__badge--deprecated">deprecated</span>
|
|
63
|
+
))
|
|
64
|
+
.otherwise(() =>
|
|
65
|
+
match(required)
|
|
66
|
+
.with(true, () => (
|
|
67
|
+
<span className="cp-field__badge cp-field__badge--required">required</span>
|
|
68
|
+
))
|
|
69
|
+
.otherwise(() => (
|
|
70
|
+
<span className="cp-field__badge cp-field__badge--optional">optional</span>
|
|
71
|
+
))
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const defaultEl = match(defaultValue)
|
|
75
|
+
.with(P.nonNullable, (v) => (
|
|
76
|
+
<div className="cp-field__default">
|
|
77
|
+
Default: <code>{v}</code>
|
|
78
|
+
</div>
|
|
79
|
+
))
|
|
80
|
+
.otherwise(() => null)
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div className="cp-field">
|
|
84
|
+
<div className="cp-field__header">
|
|
85
|
+
<span className={nameClass}>{name}</span>
|
|
86
|
+
{typeEl}
|
|
87
|
+
{badgeEl}
|
|
88
|
+
</div>
|
|
89
|
+
{defaultEl}
|
|
90
|
+
<div className="cp-field__body">{children}</div>
|
|
91
|
+
</div>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface FieldGroupProps {
|
|
96
|
+
/**
|
|
97
|
+
* Group label displayed as a header or trigger text.
|
|
98
|
+
*/
|
|
99
|
+
readonly title: string
|
|
100
|
+
/**
|
|
101
|
+
* When true, renders as a collapsible section with a toggle trigger.
|
|
102
|
+
*/
|
|
103
|
+
readonly expandable?: boolean
|
|
104
|
+
/**
|
|
105
|
+
* Initial expanded state when `expandable` is true.
|
|
106
|
+
*/
|
|
107
|
+
readonly defaultOpen?: boolean
|
|
108
|
+
/**
|
|
109
|
+
* Field children to display within the group.
|
|
110
|
+
*/
|
|
111
|
+
readonly children: React.ReactNode
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Dual-purpose grouping wrapper for Field components.
|
|
116
|
+
*
|
|
117
|
+
* In top-level mode (default), renders a titled section with a bottom border.
|
|
118
|
+
* In expandable mode, renders a collapsible panel with a click-to-toggle
|
|
119
|
+
* trigger and chevron icon.
|
|
120
|
+
*
|
|
121
|
+
* @param props - Group configuration with title and optional expand behavior
|
|
122
|
+
* @returns React element wrapping grouped fields
|
|
123
|
+
*/
|
|
124
|
+
export function FieldGroup({
|
|
125
|
+
title,
|
|
126
|
+
expandable = false,
|
|
127
|
+
defaultOpen = false,
|
|
128
|
+
children,
|
|
129
|
+
}: FieldGroupProps): React.ReactElement {
|
|
130
|
+
return match(expandable)
|
|
131
|
+
.with(true, () => (
|
|
132
|
+
<ExpandableFieldGroup title={title} defaultOpen={defaultOpen}>
|
|
133
|
+
{children}
|
|
134
|
+
</ExpandableFieldGroup>
|
|
135
|
+
))
|
|
136
|
+
.otherwise(() => (
|
|
137
|
+
<div className="cp-field-group">
|
|
138
|
+
<div className="cp-field-group__title">{title}</div>
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
141
|
+
))
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const DATA_OPEN = { 'data-open': '' } as const
|
|
145
|
+
const DATA_CLOSED = {} as const
|
|
146
|
+
|
|
147
|
+
interface ExpandableFieldGroupInternalProps {
|
|
148
|
+
readonly title: string
|
|
149
|
+
readonly defaultOpen: boolean
|
|
150
|
+
readonly children: React.ReactNode
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Internal expandable variant of FieldGroup with toggle state.
|
|
155
|
+
*
|
|
156
|
+
* @private
|
|
157
|
+
* @param props - Title, default open state, and children
|
|
158
|
+
* @returns React element with collapsible panel
|
|
159
|
+
*/
|
|
160
|
+
function ExpandableFieldGroup({
|
|
161
|
+
title,
|
|
162
|
+
defaultOpen,
|
|
163
|
+
children,
|
|
164
|
+
}: ExpandableFieldGroupInternalProps): React.ReactElement {
|
|
165
|
+
const [open, setOpen] = useState(defaultOpen)
|
|
166
|
+
|
|
167
|
+
const dataAttrs = match(open)
|
|
168
|
+
.with(true, () => DATA_OPEN)
|
|
169
|
+
.otherwise(() => DATA_CLOSED)
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div className="cp-field-group--expandable" {...dataAttrs}>
|
|
173
|
+
<button
|
|
174
|
+
type="button"
|
|
175
|
+
className="cp-field-group__trigger"
|
|
176
|
+
onClick={() => setOpen((prev) => !prev)}
|
|
177
|
+
>
|
|
178
|
+
<span className="cp-field-group__chevron">
|
|
179
|
+
<Icon icon="pixelarticons:chevron-right" />
|
|
180
|
+
</span>
|
|
181
|
+
{title}
|
|
182
|
+
</button>
|
|
183
|
+
<div className="cp-field-group__panel">{children}</div>
|
|
184
|
+
</div>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame — media wrapper with caption and hint.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.cp-frame {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
margin: 16px 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.cp-frame__hint {
|
|
14
|
+
display: block;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: var(--cp-c-text-3);
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cp-frame__content {
|
|
21
|
+
border: 1px solid var(--cp-c-border);
|
|
22
|
+
border-radius: var(--rp-radius-large);
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
background: var(--cp-c-bg-soft);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cp-frame__content img,
|
|
28
|
+
.cp-frame__content video {
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cp-frame__caption {
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
color: var(--cp-c-text-2);
|
|
37
|
+
text-align: center;
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Story } from '@ladle/react'
|
|
2
|
+
|
|
3
|
+
import { Frame } from './frame.tsx'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Layout / Frame',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
|
|
11
|
+
const IMAGE_URL = 'https://picsum.photos/seed/ciderpress-frame/1200/600'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Bare frame — image wrapped in a `<figure>` with the standard border
|
|
15
|
+
* treatment.
|
|
16
|
+
*
|
|
17
|
+
* @returns Frame around an image
|
|
18
|
+
*/
|
|
19
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
20
|
+
export const Default: Story = () => (
|
|
21
|
+
<Frame>
|
|
22
|
+
<img src={IMAGE_URL} alt="Sample" />
|
|
23
|
+
</Frame>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Frame with a caption rendered below the content.
|
|
28
|
+
*
|
|
29
|
+
* @returns Frame with caption
|
|
30
|
+
*/
|
|
31
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
32
|
+
export const WithCaption: Story = () => (
|
|
33
|
+
<Frame caption="Figure 1. Default Ciderpress landing page.">
|
|
34
|
+
<img src={IMAGE_URL} alt="Sample" />
|
|
35
|
+
</Frame>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Frame with a hint rendered above the content — useful for callouts
|
|
40
|
+
* like "Source: …" or "Live preview".
|
|
41
|
+
*
|
|
42
|
+
* @returns Frame with hint and caption
|
|
43
|
+
*/
|
|
44
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
45
|
+
export const WithHint: Story = () => (
|
|
46
|
+
<Frame hint="Live preview" caption="Theme: mulled · variant: dark">
|
|
47
|
+
<img src={IMAGE_URL} alt="Sample" />
|
|
48
|
+
</Frame>
|
|
49
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { match, P } from 'massaman/match'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export interface FrameProps {
|
|
5
|
+
/**
|
|
6
|
+
* Caption text displayed below the content.
|
|
7
|
+
* Rendered as-is (MDX children handle markdown processing).
|
|
8
|
+
*/
|
|
9
|
+
readonly caption?: string
|
|
10
|
+
/**
|
|
11
|
+
* Hint text displayed above the content.
|
|
12
|
+
*/
|
|
13
|
+
readonly hint?: string
|
|
14
|
+
/**
|
|
15
|
+
* Image, video, or other visual content to frame.
|
|
16
|
+
*/
|
|
17
|
+
readonly children: React.ReactNode
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Media wrapper that adds consistent border styling, optional caption,
|
|
22
|
+
* and hint text to images and videos.
|
|
23
|
+
*
|
|
24
|
+
* When a video child has `autoPlay`, the Frame automatically injects
|
|
25
|
+
* `playsInline`, `loop`, and `muted` attributes.
|
|
26
|
+
*
|
|
27
|
+
* @param props - Frame configuration with optional caption and hint
|
|
28
|
+
* @returns React element with semantic figure/figcaption markup
|
|
29
|
+
*/
|
|
30
|
+
export function Frame({ caption, hint, children }: FrameProps): React.ReactElement {
|
|
31
|
+
const hintEl = match(hint)
|
|
32
|
+
.with(P.nonNullable, (h) => <span className="cp-frame__hint">{h}</span>)
|
|
33
|
+
.otherwise(() => null)
|
|
34
|
+
|
|
35
|
+
const captionEl = match(caption)
|
|
36
|
+
.with(P.nonNullable, (c) => <figcaption className="cp-frame__caption">{c}</figcaption>)
|
|
37
|
+
.otherwise(() => null)
|
|
38
|
+
|
|
39
|
+
const enhancedChildren = React.Children.map(children, enhanceVideoChild)
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<figure className="cp-frame">
|
|
43
|
+
{hintEl}
|
|
44
|
+
<div className="cp-frame__content">{enhancedChildren}</div>
|
|
45
|
+
{captionEl}
|
|
46
|
+
</figure>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Clone video elements with autoPlay to inject playsInline, loop, and muted.
|
|
52
|
+
*
|
|
53
|
+
* @private
|
|
54
|
+
* @param child - React child element
|
|
55
|
+
* @returns Original child or enhanced video clone
|
|
56
|
+
*/
|
|
57
|
+
function enhanceVideoChild(child: React.ReactNode): React.ReactNode {
|
|
58
|
+
if (!React.isValidElement(child)) {
|
|
59
|
+
return child
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const props = child.props as Record<string, unknown>
|
|
63
|
+
|
|
64
|
+
if (child.type === 'video' && props['autoPlay'] === true) {
|
|
65
|
+
return React.cloneElement(
|
|
66
|
+
child as React.ReactElement<React.VideoHTMLAttributes<HTMLVideoElement>>,
|
|
67
|
+
{
|
|
68
|
+
playsInline: true,
|
|
69
|
+
loop: true,
|
|
70
|
+
muted: true,
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return child
|
|
76
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Story } from '@ladle/react'
|
|
2
|
+
|
|
3
|
+
import { Icon } from './icon'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Icons / Icon',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Default — Iconify icon at default size (inherits text color via
|
|
13
|
+
* `currentColor`).
|
|
14
|
+
*
|
|
15
|
+
* @returns Single icon
|
|
16
|
+
*/
|
|
17
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
18
|
+
export const Default: Story = () => (
|
|
19
|
+
<div style={{ fontSize: 32 }}>
|
|
20
|
+
<Icon icon="pixelarticons:sparkles" />
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* One icon per registered Iconify library so reviewers can verify each
|
|
26
|
+
* collection loaded.
|
|
27
|
+
*
|
|
28
|
+
* @returns Grid of icons across libraries
|
|
29
|
+
*/
|
|
30
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
31
|
+
export const Libraries: Story = () => {
|
|
32
|
+
const samples = [
|
|
33
|
+
{ id: 'pixelarticons:flag', label: 'pixelarticons' },
|
|
34
|
+
{ id: 'devicon:typescript', label: 'devicon' },
|
|
35
|
+
{ id: 'mdi:database', label: 'mdi' },
|
|
36
|
+
{ id: 'simple-icons:vercel', label: 'simple-icons' },
|
|
37
|
+
{ id: 'skill-icons:rust', label: 'skill-icons' },
|
|
38
|
+
{ id: 'catppuccin:typescript', label: 'catppuccin' },
|
|
39
|
+
{ id: 'logos:github-icon', label: 'logos' },
|
|
40
|
+
{ id: 'vscode-icons:file-type-typescript', label: 'vscode-icons' },
|
|
41
|
+
{ id: 'material-icon-theme:typescript', label: 'material-icon-theme' },
|
|
42
|
+
]
|
|
43
|
+
return (
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
display: 'grid',
|
|
47
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(160px, 1fr))',
|
|
48
|
+
gap: 12,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{samples.map((s) => (
|
|
52
|
+
<div
|
|
53
|
+
key={s.id}
|
|
54
|
+
style={{
|
|
55
|
+
display: 'flex',
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
gap: 6,
|
|
59
|
+
padding: 12,
|
|
60
|
+
border: '1px solid var(--cp-c-border)',
|
|
61
|
+
borderRadius: 8,
|
|
62
|
+
background: 'var(--cp-c-bg-soft)',
|
|
63
|
+
fontFamily: 'ui-monospace, monospace',
|
|
64
|
+
fontSize: 11,
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<div style={{ fontSize: 28 }}>
|
|
68
|
+
<Icon icon={s.id} />
|
|
69
|
+
</div>
|
|
70
|
+
<code style={{ color: 'var(--cp-c-text-3)' }}>{s.label}</code>
|
|
71
|
+
<code style={{ color: 'var(--cp-c-text-2)' }}>{s.id}</code>
|
|
72
|
+
</div>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Explicit size — width/height props bypass the inherited font-size.
|
|
80
|
+
*
|
|
81
|
+
* @returns Three icons at 16/32/64px
|
|
82
|
+
*/
|
|
83
|
+
// oxlint-disable-next-line func-style -- Ladle stories use `export const`
|
|
84
|
+
export const Sizes: Story = () => (
|
|
85
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 24 }}>
|
|
86
|
+
<Icon icon="pixelarticons:sparkles" width={16} height={16} />
|
|
87
|
+
<Icon icon="pixelarticons:sparkles" width={32} height={32} />
|
|
88
|
+
<Icon icon="pixelarticons:sparkles" width={64} height={64} />
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import catppuccin from '@iconify-json/catppuccin/icons.json' with { type: 'json' }
|
|
2
|
+
import devicon from '@iconify-json/devicon/icons.json' with { type: 'json' }
|
|
3
|
+
import logos from '@iconify-json/logos/icons.json' with { type: 'json' }
|
|
4
|
+
import materialIconTheme from '@iconify-json/material-icon-theme/icons.json' with { type: 'json' }
|
|
5
|
+
import mdi from '@iconify-json/mdi/icons.json' with { type: 'json' }
|
|
6
|
+
import pixelarticons from '@iconify-json/pixelarticons/icons.json' with { type: 'json' }
|
|
7
|
+
import simpleIcons from '@iconify-json/simple-icons/icons.json' with { type: 'json' }
|
|
8
|
+
import skillIcons from '@iconify-json/skill-icons/icons.json' with { type: 'json' }
|
|
9
|
+
import vscodeIcons from '@iconify-json/vscode-icons/icons.json' with { type: 'json' }
|
|
10
|
+
import { addCollection, Icon } from '@iconify/react'
|
|
11
|
+
|
|
12
|
+
// Register all icon collections for offline Iconify resolution.
|
|
13
|
+
// `addCollection` is called purely for its side effect of mutating
|
|
14
|
+
// Iconify's internal registry. Holding the return values in a
|
|
15
|
+
// throwaway `const` keeps the call list a single expression statement
|
|
16
|
+
// rather than nine misleading named exports.
|
|
17
|
+
// oxlint-disable-next-line no-unused-vars
|
|
18
|
+
const _iconCollectionsLoaded = [
|
|
19
|
+
addCollection(cast(pixelarticons)),
|
|
20
|
+
addCollection(cast(devicon)),
|
|
21
|
+
addCollection(cast(mdi)),
|
|
22
|
+
addCollection(cast(simpleIcons)),
|
|
23
|
+
addCollection(cast(skillIcons)),
|
|
24
|
+
addCollection(cast(catppuccin)),
|
|
25
|
+
addCollection(cast(logos)),
|
|
26
|
+
addCollection(cast(vscodeIcons)),
|
|
27
|
+
addCollection(cast(materialIconTheme)),
|
|
28
|
+
] as const
|
|
29
|
+
|
|
30
|
+
export { Icon }
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Cast an icon JSON import to the type expected by `addCollection`.
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
* @param v - Raw icon JSON import
|
|
37
|
+
* @returns Value cast to the addCollection parameter type
|
|
38
|
+
*/
|
|
39
|
+
function cast(v: unknown): Parameters<typeof addCollection>[0] {
|
|
40
|
+
return v as Parameters<typeof addCollection>[0]
|
|
41
|
+
}
|