-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added utility mdx components (#60)
* build: configurations for build * style: added icons * feat: added mdx utility components * style: added an dummy image * feat: updated mdx plugin next links * refactor: refactored code base * style: added default styles * style: improved mdx components * feat: added social cards * feat: added mdx card components * style: added icons * feat: added utility link component * feat: declared shared interface for social cards * docs: updated temporary data for showcasing * fix: fixed deployment issue
- Loading branch information
Showing
26 changed files
with
452 additions
and
30 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
type Props = ComponentProps<'svg'>; | ||
|
||
const AlertIcon = (props: Props) => { | ||
return ( | ||
<svg | ||
role="img" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<title>Light Bulb</title> | ||
<path d="M13 17.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.25-8.25a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 1.5 0v-4.5Z" /> | ||
<path | ||
fillRule="evenodd" | ||
d="M9.836 3.244c.963-1.665 3.365-1.665 4.328 0l8.967 15.504c.963 1.667-.24 3.752-2.165 3.752H3.034c-1.926 0-3.128-2.085-2.165-3.752L9.836 3.244Zm3.03.751a1 1 0 0 0-1.732 0L2.168 19.499A1 1 0 0 0 3.034 21h17.932a1 1 0 0 0 .866-1.5L12.866 3.994Z" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default AlertIcon; |
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,20 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
type Props = ComponentProps<'svg'>; | ||
|
||
const BulbIcon = (props: Props) => { | ||
return ( | ||
<svg | ||
role="img" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<title>Light Bulb</title> | ||
<path d="M12 2.5c-3.81 0-6.5 2.743-6.5 6.119 0 1.536.632 2.572 1.425 3.56.172.215.347.422.527.635l.096.112c.21.25.427.508.63.774.404.531.783 1.128.995 1.834a.75.75 0 0 1-1.436.432c-.138-.46-.397-.89-.753-1.357-.188-.243-.382-.48-.582-.714l-.092-.11c-.18-.212-.37-.436-.555-.667C4.87 12.016 4 10.651 4 8.618 4 4.363 7.415 1 12 1s8 3.362 8 7.619c0 2.032-.87 3.397-1.755 4.5-.185.23-.375.454-.555.667l-.092.109c-.21.248-.405.481-.582.714-.356.467-.615.898-.753 1.357a.75.75 0 1 1-1.437-.432c.213-.706.592-1.303.997-1.834.202-.266.419-.524.63-.774l.095-.112c.18-.213.355-.42.527-.634.793-.99 1.425-2.025 1.425-3.561C18.5 5.243 15.81 2.5 12 2.5ZM9.5 21.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 1 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75ZM8.75 18a.75.75 0 1 0 0 1.5h6.5a.75.75 0 1 0 0-1.5h-6.5Z" /> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default BulbIcon; |
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,20 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
type Props = ComponentProps<'svg'>; | ||
|
||
const TwitterIcon = (props: Props) => { | ||
return ( | ||
<svg | ||
role="img" | ||
viewBox="0 0 30 30" | ||
{...props} | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<title>Twitter</title> | ||
<path d="M9,25H4V10h5V25z M6.501,8C5.118,8,4,6.879,4,5.499S5.12,3,6.501,3C7.879,3,9,4.121,9,5.499C9,6.879,7.879,8,6.501,8z M27,25h-4.807v-7.3c0-1.741-0.033-3.98-2.499-3.98c-2.503,0-2.888,1.896-2.888,3.854V25H12V9.989h4.614v2.051h0.065 c0.642-1.18,2.211-2.424,4.551-2.424c4.87,0,5.77,3.109,5.77,7.151C27,16.767,27,25,27,25z"></path> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default TwitterIcon; |
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,25 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
type Props = ComponentProps<'svg'>; | ||
|
||
const QuoteIcon = (props: Props) => { | ||
return ( | ||
<svg | ||
role="img" | ||
viewBox="0 0 24 24" | ||
{...props} | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<title>Quote</title> | ||
<circle cx="18.5" cy="14" r="5.5"></circle> | ||
<path d="M15.797,4.669C14.456,7.232,13,10.762,13,14h5V5.201C18,3.977,16.364,3.585,15.797,4.669z"></path> | ||
<path | ||
d="M5.5,8.5C5.331,8.5,5.165,8.51,5,8.525V5.201c0-1.224-1.636-1.616-2.203-0.532c-1.262,2.412-2.61,5.677-2.766,8.753 C0.011,13.612,0,13.805,0,14c0,3.038,2.462,5.5,5.5,5.5S11,17.038,11,14S8.538,8.5,5.5,8.5z" | ||
opacity=".35" | ||
></path>{' '} | ||
</svg> | ||
); | ||
}; | ||
|
||
export default QuoteIcon; |
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,20 @@ | ||
import { ComponentProps } from 'react'; | ||
|
||
type Props = ComponentProps<'svg'>; | ||
|
||
const TwitterIcon = (props: Props) => { | ||
return ( | ||
<svg | ||
role="img" | ||
viewBox="0 0 30 30" | ||
{...props} | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<title>Twitter</title> | ||
<path d="M28,6.937c-0.957,0.425-1.985,0.711-3.064,0.84c1.102-0.66,1.947-1.705,2.345-2.951c-1.03,0.611-2.172,1.055-3.388,1.295 c-0.973-1.037-2.359-1.685-3.893-1.685c-2.946,0-5.334,2.389-5.334,5.334c0,0.418,0.048,0.826,0.138,1.215 c-4.433-0.222-8.363-2.346-10.995-5.574C3.351,6.199,3.088,7.115,3.088,8.094c0,1.85,0.941,3.483,2.372,4.439 c-0.874-0.028-1.697-0.268-2.416-0.667c0,0.023,0,0.044,0,0.067c0,2.585,1.838,4.741,4.279,5.23 c-0.447,0.122-0.919,0.187-1.406,0.187c-0.343,0-0.678-0.034-1.003-0.095c0.679,2.119,2.649,3.662,4.983,3.705 c-1.825,1.431-4.125,2.284-6.625,2.284c-0.43,0-0.855-0.025-1.273-0.075c2.361,1.513,5.164,2.396,8.177,2.396 c9.812,0,15.176-8.128,15.176-15.177c0-0.231-0.005-0.461-0.015-0.69C26.38,8.945,27.285,8.006,28,6.937z"></path> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default TwitterIcon; |
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,24 @@ | ||
import AlertIcon from '@icons/Alert'; | ||
import type { FC, ReactNode } from 'react'; | ||
|
||
type AlertProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const Alert: FC<AlertProps> = ({ children }) => { | ||
return ( | ||
<div | ||
aria-label="Alert" | ||
className={`mb-4 overflow-hidden rounded-xl border border-amber-500/20 bg-amber-50/50 px-5 dark:border-amber-500/30 dark:bg-amber-500/10`} | ||
> | ||
<div className="flex gap-x-3 prose-p:text-sm prose-p:text-amber-900 prose-a:border-amber-500 prose-a:text-amber-600 dark:prose-p:text-amber-200"> | ||
<span className="my-4"> | ||
<AlertIcon className="h-7 w-7 text-amber-600 dark:text-amber-400/80" /> | ||
</span> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Alert; |
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,62 @@ | ||
import LinkComp from '@utilities/LinkComp'; | ||
import type { ComponentProps, FC, ReactNode } from 'react'; | ||
|
||
type CardProps = { | ||
isActive?: boolean; | ||
children?: ReactNode; | ||
Icon?: FC<ComponentProps<'svg'>>; | ||
subTitle?: string; | ||
title?: string; | ||
href?: string; | ||
}; | ||
|
||
const Card: FC<CardProps> = ({ | ||
children, | ||
isActive = false, | ||
Icon, | ||
title, | ||
subTitle, | ||
href, | ||
}) => { | ||
return ( | ||
<LinkComp href={href}> | ||
<div | ||
className={`not-prose relative h-fit space-y-2 rounded-xl border p-4 text-base font-normal text-skin-base hover:border-accent dark:hover:border-accent ${ | ||
isActive | ||
? `border-purple-600/30 dark:border-purple-600/50 ` | ||
: `border-skin-base` | ||
}`} | ||
> | ||
{/* icon */} | ||
{Icon && ( | ||
<Icon | ||
className={`h-12 w-12 ${ | ||
isActive ? `text-purple-600 dark:text-purple-500` : `text-accent` | ||
}`} | ||
/> | ||
)} | ||
{/* typography */} | ||
<div className="mt-4"> | ||
{/* title */} | ||
<h3 className="flex flex-col -space-y-1 text-xl font-semibold"> | ||
{title} | ||
{subTitle && ( | ||
<span className="flex items-center gap-x-2 text-sm text-skin-muted"> | ||
{subTitle} | ||
{isActive && ( | ||
<span className="rounded-md bg-purple-50 px-2 py-1 text-xs capitalize text-purple-600 dark:bg-purple-600/10 dark:text-purple-200 "> | ||
Mostly Active | ||
</span> | ||
)} | ||
</span> | ||
)} | ||
</h3> | ||
{/* desc */} | ||
<div className="mt-4 text-skin-muted/90">{children}</div> | ||
</div> | ||
</div> | ||
</LinkComp> | ||
); | ||
}; | ||
|
||
export default Card; |
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 @@ | ||
import type { FC, ReactNode } from 'react'; | ||
|
||
type GridProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const Grid: FC<GridProps> = ({ children }) => { | ||
return ( | ||
<div | ||
className={` prose grid grid-cols-1 gap-4 prose-a:border-b-0 md:grid-cols-2 `} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Grid; |
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,24 @@ | ||
import BulbIcon from '@icons/Bulb'; | ||
import type { FC, ReactNode } from 'react'; | ||
|
||
type TipProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const Tip: FC<TipProps> = ({ children }) => { | ||
return ( | ||
<div | ||
aria-label="Tip" | ||
className={`mb-4 overflow-hidden rounded-xl border border-teal-500/20 bg-teal-50/50 px-5 dark:border-teal-500/30 dark:bg-teal-500/10`} | ||
> | ||
<div className="flex gap-x-3 prose-p:text-sm prose-p:text-teal-900 prose-a:border-teal-500 prose-a:text-teal-600 dark:prose-p:text-teal-200"> | ||
<span className="my-4"> | ||
<BulbIcon className="h-7 w-7 text-teal-600 dark:text-teal-400/80" /> | ||
</span> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Tip; |
Oops, something went wrong.
fcb6dad
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.
Successfully deployed to the following URLs:
gitopener-vercel-app – ./
gitopener-vercel-app-git-main-git-opener-team.vercel.app
gitopener-vercel-app-git-opener-team.vercel.app
gitopener.vercel.app