Browse Source
Refresh sandbox iconography (#4746)
* Refresh sandbox iconography
* Remove extra margins
main
Dan Lebo
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
53 additions and
21 deletions
-
beta/src/components/Icon/IconDownload.tsx
-
beta/src/components/Icon/IconNewPage.tsx
-
beta/src/components/Icon/IconRestart.tsx
-
beta/src/components/MDX/Sandpack/DownloadButton.tsx
-
beta/src/components/MDX/Sandpack/OpenInCodeSandboxButton.tsx
-
beta/src/components/MDX/Sandpack/ResetButton.tsx
|
|
@ -0,0 +1,30 @@ |
|
|
|
/* |
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates. |
|
|
|
*/ |
|
|
|
|
|
|
|
import * as React from 'react'; |
|
|
|
|
|
|
|
export const IconDownload = React.memo<JSX.IntrinsicElements['svg']>( |
|
|
|
function IconArrowSmall({className}) { |
|
|
|
return ( |
|
|
|
<svg |
|
|
|
width="1em" |
|
|
|
height="1em" |
|
|
|
viewBox="0 0 24 24" |
|
|
|
fill="none" |
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
className={className}> |
|
|
|
<path |
|
|
|
d="M20.5 22H3.5C3.10218 22 2.72064 21.842 2.43934 21.5607C2.15804 21.2794 2 20.8978 2 20.5V15.5C2 15.3674 2.05268 15.2402 2.14645 15.1464C2.24021 15.0527 2.36739 15 2.5 15H3.5C3.63261 15 3.75979 15.0527 3.85355 15.1464C3.94732 15.2402 4 15.3674 4 15.5V20H20V15.5C20 15.3674 20.0527 15.2402 20.1464 15.1464C20.2402 15.0527 20.3674 15 20.5 15H21.5C21.6326 15 21.7598 15.0527 21.8536 15.1464C21.9473 15.2402 22 15.3674 22 15.5V20.5C22 20.8978 21.842 21.2794 21.5607 21.5607C21.2794 21.842 20.8978 22 20.5 22Z" |
|
|
|
fill="currentColor" |
|
|
|
/> |
|
|
|
<path |
|
|
|
d="M10.9999 2.5V13.79L8.81994 11.61C8.72479 11.5178 8.59747 11.4662 8.46494 11.4662C8.33241 11.4662 8.20509 11.5178 8.10994 11.61L7.39994 12.32C7.30769 12.4151 7.2561 12.5425 7.2561 12.675C7.2561 12.8075 7.30769 12.9348 7.39994 13.03L10.9399 16.56C11.0785 16.7003 11.2436 16.8117 11.4255 16.8877C11.6075 16.9637 11.8027 17.0029 11.9999 17.0029C12.1971 17.0029 12.3924 16.9637 12.5743 16.8877C12.7563 16.8117 12.9214 16.7003 13.0599 16.56L16.5999 13C16.6922 12.9048 16.7438 12.7775 16.7438 12.645C16.7438 12.5125 16.6922 12.3851 16.5999 12.29L15.8899 11.58C15.7948 11.4878 15.6675 11.4362 15.5349 11.4362C15.4024 11.4362 15.2751 11.4878 15.1799 11.58L12.9999 13.79V2.5C12.9999 2.36739 12.9473 2.24021 12.8535 2.14645C12.7597 2.05268 12.6325 2 12.4999 2H11.4999C11.3673 2 11.2402 2.05268 11.1464 2.14645C11.0526 2.24021 10.9999 2.36739 10.9999 2.5Z" |
|
|
|
fill="currentColor" |
|
|
|
/> |
|
|
|
</svg> |
|
|
|
); |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
IconDownload.displayName = 'IconDownload'; |
|
|
@ -8,13 +8,18 @@ export const IconNewPage = React.memo<JSX.IntrinsicElements['svg']>( |
|
|
|
function IconNewPage(props) { |
|
|
|
return ( |
|
|
|
<svg |
|
|
|
width="0.72em" |
|
|
|
height="0.72em" |
|
|
|
viewBox="0 0 13 13" |
|
|
|
width="1em" |
|
|
|
height="1em" |
|
|
|
viewBox="0 0 24 24" |
|
|
|
fill="none" |
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
{...props}> |
|
|
|
<path |
|
|
|
d="M4.72038 2.94824V4.28158H1.38704V11.6149H8.72038V8.28158H10.0537V12.2816C10.0537 12.4584 9.98347 12.628 9.85845 12.753C9.73343 12.878 9.56386 12.9482 9.38704 12.9482H0.720378C0.543567 12.9482 0.373997 12.878 0.248973 12.753C0.123949 12.628 0.0537109 12.4584 0.0537109 12.2816V3.61491C0.0537109 3.4381 0.123949 3.26853 0.248973 3.1435C0.373997 3.01848 0.543567 2.94824 0.720378 2.94824H4.72038ZM12.0537 0.948242V6.28158H10.7204V3.22358L5.52504 8.41958L4.58238 7.47691L9.77704 2.28158H6.72038V0.948242H12.0537Z" |
|
|
|
d="M20.5001 2H15.5001C15.3675 2 15.2403 2.05268 15.1465 2.14645C15.0528 2.24021 15.0001 2.36739 15.0001 2.5V3.5C15.0001 3.63261 15.0528 3.75979 15.1465 3.85355C15.2403 3.94732 15.3675 4 15.5001 4H18.5901L7.6501 14.94C7.60323 14.9865 7.56604 15.0418 7.54065 15.1027C7.51527 15.1636 7.5022 15.229 7.5022 15.295C7.5022 15.361 7.51527 15.4264 7.54065 15.4873C7.56604 15.5482 7.60323 15.6035 7.6501 15.65L8.3501 16.35C8.39658 16.3969 8.45188 16.4341 8.51281 16.4594C8.57374 16.4848 8.63909 16.4979 8.7051 16.4979C8.7711 16.4979 8.83646 16.4848 8.89738 16.4594C8.95831 16.4341 9.01362 16.3969 9.0601 16.35L20.0001 5.41V8.5C20.0001 8.63261 20.0528 8.75979 20.1465 8.85355C20.2403 8.94732 20.3675 9 20.5001 9H21.5001C21.6327 9 21.7599 8.94732 21.8537 8.85355C21.9474 8.75979 22.0001 8.63261 22.0001 8.5V3.5C22.0001 3.10218 21.8421 2.72064 21.5608 2.43934C21.2795 2.15804 20.8979 2 20.5001 2V2Z" |
|
|
|
fill="currentColor" |
|
|
|
/> |
|
|
|
<path |
|
|
|
d="M21.5 13H20.5C20.3674 13 20.2402 13.0527 20.1464 13.1464C20.0527 13.2402 20 13.3674 20 13.5V20H4V4H10.5C10.6326 4 10.7598 3.94732 10.8536 3.85355C10.9473 3.75979 11 3.63261 11 3.5V2.5C11 2.36739 10.9473 2.24021 10.8536 2.14645C10.7598 2.05268 10.6326 2 10.5 2H3.5C3.10218 2 2.72064 2.15804 2.43934 2.43934C2.15804 2.72064 2 3.10218 2 3.5V20.5C2 20.8978 2.15804 21.2794 2.43934 21.5607C2.72064 21.842 3.10218 22 3.5 22H20.5C20.8978 22 21.2794 21.842 21.5607 21.5607C21.842 21.2794 22 20.8978 22 20.5V13.5C22 13.3674 21.9473 13.2402 21.8536 13.1464C21.7598 13.0527 21.6326 13 21.5 13Z" |
|
|
|
fill="currentColor" |
|
|
|
/> |
|
|
|
</svg> |
|
|
|
|
|
@ -8,13 +8,14 @@ export const IconRestart = React.memo<JSX.IntrinsicElements['svg']>( |
|
|
|
function IconRestart({className}) { |
|
|
|
return ( |
|
|
|
<svg |
|
|
|
className={className} |
|
|
|
width="0.78em" |
|
|
|
height="0.78em" |
|
|
|
viewBox="0 0 14 14" |
|
|
|
xmlns="http://www.w3.org/2000/svg"> |
|
|
|
width="1em" |
|
|
|
height="1em" |
|
|
|
viewBox="0 0 24 24" |
|
|
|
fill="none" |
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
className={className}> |
|
|
|
<path |
|
|
|
d="M11.3567 11.9929C10.147 13.0412 8.59937 13.6172 6.9987 13.615C3.3167 13.615 0.332031 10.6303 0.332031 6.94828C0.332031 3.26628 3.3167 0.281616 6.9987 0.281616C10.6807 0.281616 13.6654 3.26628 13.6654 6.94828C13.6654 8.37228 13.2187 9.69228 12.4587 10.775L10.332 6.94828H12.332C12.3319 5.71909 11.9072 4.52766 11.1298 3.57554C10.3524 2.62343 9.26994 1.96908 8.06559 1.72319C6.86124 1.4773 5.60892 1.65496 4.52048 2.22613C3.43205 2.79729 2.57431 3.72689 2.09238 4.85767C1.61045 5.98845 1.5339 7.25099 1.87569 8.43171C2.21748 9.61243 2.95663 10.6388 3.96809 11.3373C4.97955 12.0358 6.20123 12.3635 7.42646 12.2649C8.6517 12.1663 9.80527 11.6475 10.692 10.7963L11.3567 11.9929Z" |
|
|
|
d="M13.8982 5.20844C12.4626 4.88688 10.9686 4.93769 9.55821 5.35604L11.8524 3.06184C11.8989 3.0154 11.9357 2.96028 11.9608 2.89961C11.986 2.83894 11.9989 2.77391 11.9989 2.70824C11.9989 2.64256 11.986 2.57754 11.9608 2.51686C11.9357 2.45619 11.8989 2.40107 11.8524 2.35464L11.1456 1.64784C11.0992 1.60139 11.0441 1.56455 10.9834 1.53942C10.9227 1.51428 10.8577 1.50134 10.792 1.50134C10.7263 1.50134 10.6613 1.51428 10.6006 1.53942C10.54 1.56455 10.4848 1.60139 10.4384 1.64784L6.14571 5.94054C6.00654 6.07969 5.89615 6.2449 5.82083 6.42673C5.74551 6.60855 5.70675 6.80343 5.70675 7.00024C5.70675 7.19704 5.74551 7.39192 5.82083 7.57374C5.89615 7.75557 6.00654 7.92078 6.14571 8.05994L10.4387 12.3529C10.5325 12.4465 10.6595 12.4991 10.792 12.4991C10.9245 12.4991 11.0516 12.4465 11.1453 12.3529L11.8527 11.6455C11.9463 11.5518 11.9989 11.4247 11.9989 11.2922C11.9989 11.1598 11.9463 11.0327 11.8527 10.9389L8.77481 7.86104C9.99795 7.16236 11.415 6.8801 12.8125 7.05678C14.21 7.23347 15.5122 7.85953 16.523 8.84064C17.5338 9.82176 18.1983 11.1048 18.4165 12.4964C18.6347 13.888 18.3947 15.3129 17.7328 16.5562C17.0708 17.7996 16.0227 18.7942 14.7463 19.3902C13.47 19.9861 12.0345 20.1511 10.6563 19.8603C9.27798 19.5695 8.03152 18.8387 7.10469 17.778C6.17786 16.7172 5.62086 15.384 5.51761 13.9791C5.51156 13.8512 5.45689 13.7303 5.36477 13.6413C5.27265 13.5522 5.15001 13.5017 5.02191 13.5H4.02081C3.95297 13.4996 3.88574 13.5129 3.8232 13.5392C3.76065 13.5655 3.70408 13.6042 3.6569 13.6529C3.60972 13.7017 3.57291 13.7595 3.54869 13.8228C3.52448 13.8862 3.51336 13.9538 3.51601 14.0216C3.61349 15.5965 4.1473 17.1132 5.0577 18.4019C5.9681 19.6906 7.21917 20.7006 8.6709 21.3188C10.1226 21.937 11.7178 22.139 13.2778 21.9022C14.8378 21.6654 16.3011 20.9992 17.504 19.978C18.7069 18.9569 19.6019 17.6212 20.0889 16.1203C20.5759 14.6195 20.6356 13.0128 20.2614 11.4799C19.8872 9.94705 19.0938 8.54858 17.97 7.44098C16.8462 6.33339 15.4363 5.56037 13.8982 5.20844V5.20844Z" |
|
|
|
fill="currentColor" |
|
|
|
/> |
|
|
|
</svg> |
|
|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
import * as React from 'react'; |
|
|
|
import {useSandpack} from '@codesandbox/sandpack-react'; |
|
|
|
import {IconArrowSmall} from '../../Icon/IconArrowSmall'; |
|
|
|
import {IconDownload} from '../../Icon/IconDownload'; |
|
|
|
export interface DownloadButtonProps {} |
|
|
|
|
|
|
|
let supportsImportMap: boolean | void; |
|
|
@ -92,11 +92,7 @@ ${css} |
|
|
|
onClick={downloadHTML} |
|
|
|
title="Download Sandbox" |
|
|
|
type="button"> |
|
|
|
<IconArrowSmall |
|
|
|
displayDirection="down" |
|
|
|
className="inline mb-0.5 mr-1 mt-1" |
|
|
|
/>{' '} |
|
|
|
Download |
|
|
|
<IconDownload className="inline mr-1" /> Download |
|
|
|
</button> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
@ -9,12 +9,12 @@ import {IconNewPage} from '../../Icon/IconNewPage'; |
|
|
|
export const OpenInCodeSandboxButton = () => { |
|
|
|
return ( |
|
|
|
<UnstyledOpenInCodeSandboxButton |
|
|
|
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1 ml-3 md:ml-1" |
|
|
|
className="text-sm text-primary dark:text-primary-dark inline-flex items-center hover:text-link duration-100 ease-in transition mx-1 ml-2 md:ml-1" |
|
|
|
title="Open in CodeSandbox"> |
|
|
|
<IconNewPage |
|
|
|
className="inline mb-0.5 ml-1 mr-1 relative top-px" |
|
|
|
width=".8em" |
|
|
|
height=".8em" |
|
|
|
className="inline ml-1 mr-1 relative" |
|
|
|
width="1em" |
|
|
|
height="1em" |
|
|
|
/> |
|
|
|
<span className="hidden md:block">Fork</span> |
|
|
|
</UnstyledOpenInCodeSandboxButton> |
|
|
|
|
|
@ -15,7 +15,7 @@ export const ResetButton: React.FC<ResetButtonProps> = ({onReset}) => { |
|
|
|
onClick={onReset} |
|
|
|
title="Reset Sandbox" |
|
|
|
type="button"> |
|
|
|
<IconRestart className="inline mb-0.5 ml-1 mr-1 relative top-0.5" /> Reset |
|
|
|
<IconRestart className="inline ml-1 mr-1 relative" /> Reset |
|
|
|
</button> |
|
|
|
); |
|
|
|
}; |
|
|
|