-
Notifications
You must be signed in to change notification settings - Fork 114
feat(kumo): add CloudflareLogo and PoweredByCloudflare components #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9317edc
feat(kumo): add CloudflareLogo component
mattrothenberg 47e4b39
fix(cloudflare-logo): polish PoweredByCloudflare and demo variants
stritt e11ceb0
docs: add CloudflareLogo to sidebar navigation
mattrothenberg 226deeb
fix(demos): use bg-white/bg-black for consistent dark mode display
mattrothenberg 1560abc
fix(PoweredByCloudflare): use light background for black variant
mattrothenberg 8a227d3
feat(CloudflareLogo): add generateCloudflareLogoSvg helper, fix lint
mattrothenberg 8d66b09
fix(PoweredByCloudflare): increase vertical padding to py-2
stritt 344f14c
Merge branch 'main' into feat/cloudflare-logo
stritt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@cloudflare/kumo": minor | ||
| --- | ||
|
|
||
| Add CloudflareLogo component with glyph and full logo variants, color schemes (brand/black/white), and exported SVG path data for custom implementations | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
169 changes: 169 additions & 0 deletions
169
packages/kumo-docs-astro/src/components/demos/CloudflareLogoDemo.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| import { useState } from "react"; | ||
| import { | ||
| CloudflareLogo, | ||
| PoweredByCloudflare, | ||
| DropdownMenu, | ||
| generateCloudflareLogoSvg, | ||
| } from "@cloudflare/kumo"; | ||
| import { | ||
| CloudIcon, | ||
| CodeIcon, | ||
| DownloadSimpleIcon, | ||
| ArrowSquareOutIcon, | ||
| } from "@phosphor-icons/react"; | ||
|
|
||
| export function CloudflareLogoBasicDemo() { | ||
| return <CloudflareLogo className="w-72" />; | ||
| } | ||
|
|
||
| export function CloudflareLogoGlyphDemo() { | ||
| return <CloudflareLogo variant="glyph" className="w-24" />; | ||
| } | ||
|
|
||
| export function CloudflareLogoColorVariantsDemo() { | ||
| return ( | ||
| <div className="flex flex-wrap items-center gap-8"> | ||
| <CloudflareLogo className="w-28" color="color" /> | ||
| <div className="rounded-lg bg-white p-4"> | ||
| <CloudflareLogo className="w-28" color="black" /> | ||
| </div> | ||
| <div className="rounded-lg bg-black p-4"> | ||
| <CloudflareLogo className="w-28" color="white" /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function CloudflareLogoGlyphVariantsDemo() { | ||
| return ( | ||
| <div className="flex flex-wrap items-center gap-8"> | ||
| <CloudflareLogo variant="glyph" className="w-12" color="color" /> | ||
| <div className="rounded-lg bg-white p-4"> | ||
| <CloudflareLogo variant="glyph" className="w-12" color="black" /> | ||
| </div> | ||
| <div className="rounded-lg bg-black p-4"> | ||
| <CloudflareLogo variant="glyph" className="w-12" color="white" /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function CloudflareLogoSizesDemo() { | ||
| return ( | ||
| <div className="flex flex-wrap items-end gap-6"> | ||
| <CloudflareLogo className="w-20" /> | ||
| <CloudflareLogo className="w-28" /> | ||
| <CloudflareLogo className="w-44" /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function CloudflareLogoCopyDemo() { | ||
| const [copied, setCopied] = useState<string | null>(null); | ||
|
|
||
| const copyToClipboard = async (text: string, label: string) => { | ||
| await navigator.clipboard.writeText(text); | ||
| setCopied(label); | ||
| setTimeout(() => setCopied(null), 2000); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="flex items-center gap-4"> | ||
| <DropdownMenu> | ||
| <DropdownMenu.Trigger> | ||
| <button | ||
| type="button" | ||
| className="flex items-center gap-2 rounded-lg bg-black px-4 py-3 text-white transition-opacity hover:opacity-80" | ||
| > | ||
| <CloudflareLogo variant="glyph" color="white" className="w-8" /> | ||
| <span className="font-medium">Logo</span> | ||
| </button> | ||
| </DropdownMenu.Trigger> | ||
| <DropdownMenu.Content> | ||
| <DropdownMenu.Item | ||
| icon={CloudIcon} | ||
| onSelect={() => | ||
| copyToClipboard( | ||
| generateCloudflareLogoSvg({ variant: "glyph" }), | ||
| "glyph", | ||
| ) | ||
| } | ||
| > | ||
| {copied === "glyph" ? "Copied!" : "Copy logo as SVG"} | ||
| </DropdownMenu.Item> | ||
| <DropdownMenu.Item | ||
| icon={CodeIcon} | ||
| onSelect={() => | ||
| copyToClipboard( | ||
| generateCloudflareLogoSvg({ variant: "full" }), | ||
| "full", | ||
| ) | ||
| } | ||
| > | ||
| {copied === "full" ? "Copied!" : "Copy full logo as SVG"} | ||
| </DropdownMenu.Item> | ||
| <DropdownMenu.Item | ||
| icon={DownloadSimpleIcon} | ||
| onSelect={() => | ||
| window.open( | ||
| "https://www.cloudflare.com/press-kit/", | ||
| "_blank", | ||
| "noopener", | ||
| ) | ||
| } | ||
| > | ||
| Download brand assets | ||
| </DropdownMenu.Item> | ||
| <DropdownMenu.Separator /> | ||
| <DropdownMenu.Item | ||
| icon={ArrowSquareOutIcon} | ||
| onSelect={() => | ||
| window.open( | ||
| "https://www.cloudflare.com/brand-assets/", | ||
| "_blank", | ||
| "noopener", | ||
| ) | ||
| } | ||
| > | ||
| Visit brand guidelines | ||
| </DropdownMenu.Item> | ||
| </DropdownMenu.Content> | ||
| </DropdownMenu> | ||
|
|
||
| <span className="text-sm text-kumo-subtle"> | ||
| Click to open the brand assets menu | ||
| </span> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| // ============================================================================= | ||
| // PoweredByCloudflare Demos | ||
| // ============================================================================= | ||
|
|
||
| export function PoweredByCloudflareBasicDemo() { | ||
| return <PoweredByCloudflare />; | ||
| } | ||
|
|
||
| export function PoweredByCloudflareVariantsDemo() { | ||
| return ( | ||
| <div className="flex flex-wrap items-center gap-4"> | ||
| <PoweredByCloudflare /> | ||
| <PoweredByCloudflare color="black" /> | ||
| <div className="rounded-lg bg-black p-3"> | ||
| <PoweredByCloudflare color="white" /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function PoweredByCloudflareFooterDemo() { | ||
| return ( | ||
| <footer className="flex w-full items-center justify-between rounded-lg border border-kumo-line bg-kumo-elevated px-6 py-4"> | ||
| <span className="text-sm text-kumo-subtle"> | ||
| © 2026 Your Company. All rights reserved. | ||
| </span> | ||
| <PoweredByCloudflare /> | ||
| </footer> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.