This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies. Add a Badge component and update documentation. * Add Checkbox component. Add error state to the Select component. Update docs for all form elements. * Add borderRadius prop to Button. Add disabled state example and additional styles for checkbox. * Add error state to Checkbox. Improved error styles on other form elements. * Working on Radio components. * Add Radio tests and error state styles. Complete Radio documentation. * Docs and styles. * PropsTable now display all exported components for a file. Add CopyButton to code previews. Working on Card components. * Display import statements above each component props table. * Wrap up the Card components. Add emphasis prop to Alert. * Dependency upgrades. Add NPM badges to docs home page. * Changelog date.
- Loading branch information
1 parent
8a4ddaa
commit 703cb12
Showing
76 changed files
with
2,076 additions
and
713 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
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> | ||
<url><loc>https://strum.design</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/overview/design-concepts</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/overview/development</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Alert</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Avatar</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Badge</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Box</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Button</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Card</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Checkbox</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Container</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Dialog</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Heading</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Input</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Nav</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Radio</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Select</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Skeleton</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Spinner</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Stack</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/StrumProvider</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Switch</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Text</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Textarea</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Toast</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Tooltip</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/VisuallyHidden</loc><lastmod>2022-09-13T14:27:20.746Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/overview/design-concepts</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/overview/development</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Alert</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Avatar</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Badge</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Box</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Button</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Card</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Checkbox</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Container</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Dialog</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Heading</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Input</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Nav</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Radio</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Select</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Skeleton</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Spinner</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Stack</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/StrumProvider</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Switch</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Text</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Textarea</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Toast</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/Tooltip</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://strum.design/components/VisuallyHidden</loc><lastmod>2022-09-19T22:47:57.912Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
</urlset> |
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
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,7 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const copyButtonStyle = style({ | ||
right: '1rem', | ||
top: '1rem', | ||
zIndex: 1, | ||
}); |
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 @@ | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faCheck, faCopy } from '@fortawesome/sharp-solid-svg-icons'; | ||
import { Box, Button, Tooltip } from '@strum/react'; | ||
import { default as copy } from 'copy-to-clipboard'; | ||
import React from 'react'; | ||
import { copyButtonStyle } from './CopyButton.css'; | ||
|
||
type CopyButtonProps = { | ||
content: string; | ||
}; | ||
|
||
type State = { | ||
copied: boolean; | ||
}; | ||
|
||
const initialState = { | ||
copied: false, | ||
}; | ||
|
||
const CopyButton: React.FC<CopyButtonProps> = ({ content }) => { | ||
const timeoutRef = React.useRef<NodeJS.Timeout>(); | ||
const [state, setState] = React.useState<State>(initialState); | ||
|
||
const onClick = React.useCallback(() => { | ||
if (timeoutRef.current) { | ||
clearTimeout(timeoutRef.current); | ||
setState((x) => ({ ...x, copied: false })); | ||
} | ||
|
||
copy(content, { | ||
format: 'text/plain', | ||
}); | ||
|
||
setState((x) => ({ ...x, copied: true })); | ||
timeoutRef.current = setTimeout( | ||
() => setState((x) => ({ ...x, copied: false })), | ||
2000, | ||
); | ||
}, [content]); | ||
|
||
return ( | ||
<Box className={copyButtonStyle} position="absolute"> | ||
<Tooltip color="neutral" content="Copy to clipboard"> | ||
<Button | ||
color={state.copied ? 'success' : 'neutral'} | ||
onClick={onClick} | ||
size="small" | ||
> | ||
{state.copied ? ( | ||
<> | ||
<FontAwesomeIcon fixedWidth icon={faCheck} /> | ||
</> | ||
) : ( | ||
<> | ||
<FontAwesomeIcon fixedWidth icon={faCopy} /> | ||
</> | ||
)} | ||
</Button> | ||
</Tooltip> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default CopyButton; |
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
Oops, something went wrong.
703cb12
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:
strum-design – ./
strum.design
strum-design-git-main-colin-hemphill.vercel.app
www.strum.design
strum-design.vercel.app
strum-design-colin-hemphill.vercel.app