-
Notifications
You must be signed in to change notification settings - Fork 0
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
update: icons and styles #1
Merged
Merged
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
47dcb15
feat: added symbolAliases to all icons data
Argeare5 125ac9e
fix: format symbol func
Argeare5 c6752b0
fix: update configs
Argeare5 a9d62d4
feat: added asset icon list (WIP)
Argeare5 2bdbf1d
fix: styles
Argeare5 c4702a1
fix: icons generator scripts to optimize svg id's & asset icon component
Argeare5 ff8bc85
fix: asset icon fallback
Argeare5 5615609
fix: small style fix and added missing icons
Argeare5 3eedae8
feat: added copy to clickboard logic
Argeare5 dce4128
feat: added download button; fix: docs app build
Argeare5 f459686
fix: added all variants of assets icons on one screen
Argeare5 e2e0b0d
fix: small code optimize
Argeare5 1091704
fix: rename package
Argeare5 f9b743f
feat: added tsup for build package and fix package json
Argeare5 4371eaa
fix: added basic favicon for docs
Argeare5 9558e9b
fix: readme and small style fixes
Argeare5 816e6c8
feat: added github workflows to automatic release a package
Argeare5 ec6bf1e
fix: workflows
Argeare5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.idea | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
This file contains 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 |
---|---|---|
|
@@ -28,4 +28,3 @@ To run docs website locally: | |
```bash | ||
pnpm --filter docs dev | ||
``` | ||
|
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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,17 @@ | ||
{ | ||
"short_name": "Boilerplate", | ||
"name": "App boilerplate", | ||
"description": "App boilerplate description", | ||
"iconPath": "vercel.svg", | ||
"icons": [ | ||
{ | ||
"src": "vercel.svg", | ||
"sizes": "32x32", | ||
"type": "image/svg" | ||
} | ||
], | ||
"start_url": "./index.html", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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,46 @@ | ||
import { cn } from "@/utils/cn"; | ||
|
||
export const CopyIcon = ({ isCopied }: { isCopied: boolean }) => { | ||
const size = 6; | ||
|
||
return ( | ||
<> | ||
<span className={`flex h-${size} w-${size} overflow-hidden`}> | ||
<svg | ||
className={cn( | ||
`h-${size} w-${size} shrink-0 transition-all duration-150 ease-linear`, | ||
{ | ||
["-translate-x-full text-green-500"]: isCopied, | ||
}, | ||
)} | ||
viewBox="0 0 50 50" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M15 30.7361H11V11H31.5714V14.3833M39 18.8944V38.0667H19V18.8944H39Z" | ||
stroke="currentColor" | ||
strokeWidth="3" | ||
/> | ||
</svg> | ||
<svg | ||
viewBox="0 0 50 50" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={cn( | ||
`h-${size} w-${size} shrink-0 translate-x-full transition-all duration-150 ease-linear`, | ||
{ | ||
["-translate-x-full text-green-500"]: isCopied, | ||
}, | ||
)} | ||
> | ||
<path | ||
d="M14 24.8571L21.1719 33L41 12" | ||
stroke="currentColor" | ||
strokeWidth="4" | ||
/> | ||
</svg> | ||
</span> | ||
</> | ||
); | ||
}; |
This file contains 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,39 @@ | ||
"use client"; | ||
|
||
import { type ReactNode, useState } from "react"; | ||
import * as React from "react"; | ||
|
||
import { CopyIcon } from "@/components/CopyIcon"; | ||
import { cn } from "@/utils/cn"; | ||
|
||
type Props = { | ||
copyText: string | number | null | ReactNode; | ||
children?: ReactNode; | ||
className?: React.ComponentProps<"div">["className"]; | ||
}; | ||
|
||
export const CopyToClipboard = ({ copyText, className, children }: Props) => { | ||
const [copied, setCopied] = useState(false); | ||
|
||
const handleCopyClick = async (event: React.MouseEvent) => { | ||
event.preventDefault(); | ||
await navigator.clipboard.writeText(String(copyText)); | ||
setCopied(true); | ||
setTimeout(() => { | ||
setCopied(false); | ||
}, 1500); | ||
}; | ||
|
||
return ( | ||
<div className={cn("flex flex-wrap items-center", className)}> | ||
{children} | ||
<button | ||
className="p-1 text-gray-400 hover:text-gray-800" | ||
type="button" | ||
onClick={handleCopyClick} | ||
> | ||
<CopyIcon isCopied={copied} /> | ||
</button> | ||
</div> | ||
); | ||
}; |
This file contains 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,64 @@ | ||
"use client"; | ||
|
||
import { type ReactNode, useCallback } from "react"; | ||
import { renderToString } from "react-dom/server"; | ||
|
||
function downloadBlob(blob: Blob, filename: string) { | ||
const objectUrl = URL.createObjectURL(blob); | ||
const link = document.createElement("a"); | ||
link.href = objectUrl; | ||
link.download = filename; | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
setTimeout(() => URL.revokeObjectURL(objectUrl), 5000); | ||
} | ||
|
||
interface DownloadButtonProps { | ||
svgComponent: ReactNode; | ||
fileName: string; | ||
} | ||
|
||
export const DownloadButton = ({ | ||
svgComponent, | ||
fileName, | ||
}: DownloadButtonProps) => { | ||
const downloadSVG = useCallback(() => { | ||
const blob = new Blob([renderToString(svgComponent)], { | ||
type: "image/svg+xml", | ||
}); | ||
downloadBlob(blob, `${fileName}.svg`); | ||
}, [fileName, svgComponent]); | ||
|
||
return ( | ||
<button | ||
className="ml-auto p-1 text-gray-400 hover:text-gray-800" | ||
type="button" | ||
onClick={downloadSVG} | ||
> | ||
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24"> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
d="M4.75 14.75V16.25C4.75 17.9069 6.09315 19.25 7.75 19.25H16.25C17.9069 19.25 19.25 17.9069 19.25 16.25V14.75" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
d="M12 14.25L12 4.75" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="1.5" | ||
d="M8.75 10.75L12 14.25L15.25 10.75" | ||
></path> | ||
</svg> | ||
</button> | ||
); | ||
}; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to name this package, just makes it hard to run scripts with
pnpm --filter @bgd-labs/react-web3-icons-docs dev