diff --git a/docs/components/design/buttonStyleText.js b/docs/components/design/buttonStyleText.js new file mode 100644 index 0000000..4bc81f2 --- /dev/null +++ b/docs/components/design/buttonStyleText.js @@ -0,0 +1,9 @@ +import { Text } from '@hack4impact-uiuc/bridge'; + +const ButtonStyleText = ({ children, order, ...props }) => ( + + {children} + +); + +export default ButtonStyleText; diff --git a/docs/components/design/colorPalette.js b/docs/components/design/colorPalette.js index 0755acf..8b2a261 100644 --- a/docs/components/design/colorPalette.js +++ b/docs/components/design/colorPalette.js @@ -18,7 +18,7 @@ const PaletteShade = ({ palette, name }) => ( color = palette.text; } if (label === 'white') { - color = theme.colors.text.grayScale.main; + color = theme.colors.text.greyScale.main; borderStyling = WhiteBorderStyling; } if (label === 'primary') { diff --git a/docs/components/layout.js b/docs/components/layout.js index d9d76b1..f254296 100644 --- a/docs/components/layout.js +++ b/docs/components/layout.js @@ -2,7 +2,7 @@ /* eslint-disable global-require */ import React from 'react'; import { - Flex, Link, Heading, Text, + Flex, Heading, } from '@hack4impact-uiuc/bridge'; import FeedbackContext from './feedback-context'; import Markdown from './markdown'; diff --git a/docs/components/sidebar.js b/docs/components/sidebar.js index 99d15dd..2eef0b2 100644 --- a/docs/components/sidebar.js +++ b/docs/components/sidebar.js @@ -7,7 +7,7 @@ const sidebarSection = (section, title) => ( {section.name} { section.routes.map((elm) => ( - {elm.title} + {elm.title} )) } diff --git a/docs/package.json b/docs/package.json index 7625421..1ae86b0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,7 @@ "start": "next start" }, "dependencies": { - "@hack4impact-uiuc/bridge": "^0.0.7", + "@hack4impact-uiuc/bridge": "^0.0.8", "@mdx-js/loader": "^1.6.1", "@mdx-js/tag": "^0.20.3", "@next/mdx": "^9.3.6", diff --git a/docs/pages/_document.js b/docs/pages/_document.js index a3ee0e0..72ba28c 100644 --- a/docs/pages/_document.js +++ b/docs/pages/_document.js @@ -25,15 +25,10 @@ class DocSite extends Document { sizes="16x16" href="/favicons/favicon-16x16.svg" /> - - - - - diff --git a/docs/pages/design/alerts.mdx b/docs/pages/design/alerts.mdx index 810aceb..8324280 100644 --- a/docs/pages/design/alerts.mdx +++ b/docs/pages/design/alerts.mdx @@ -57,7 +57,7 @@ Links within alerts are set in 18px HK Grotesk SemiBold text (check [typography] - This is a success alert! This is an accompanying link. + This is a success alert! This is an accompanying {" link"}. diff --git a/docs/pages/design/buttons.mdx b/docs/pages/design/buttons.mdx index 4e0ad35..7acd5c0 100644 --- a/docs/pages/design/buttons.mdx +++ b/docs/pages/design/buttons.mdx @@ -1,7 +1,545 @@ export const meta = {type: "design", title: "Buttons"} -import ColorPalette from '../../components/design/colorPalette.js' -import { theme, Flex, Box } from '@hack4impact-uiuc/bridge' +import CodeExampleBox from '../../components/CodeExampleBox' +import { theme, Flex, Box, Heading, Button, Link, Text } from '@hack4impact-uiuc/bridge' +import Row from '../../components/row.js' +import Col from '../../components/col.js' +import ButtonStyleText from '../../components/design/buttonStyleText.js' +import LgButton from '../../public/docs-content/design/buttons/LgButton.svg' +import MedButton from '../../public/docs-content/design/buttons/MedButton.svg' +import SmButton from '../../public/docs-content/design/buttons/SmButton.svg' import Layout from '../../components/layout.js' -export default Layout({...meta}) \ No newline at end of file +export default Layout({...meta}) + +A button is used to trigger an action. + +- **Primary Buttons** are strong visual indicators to guide the user to complete their goal or journey. Example situations are where the user would want to go to the next step, starting a journey, etc. These should be obvious. +- **Secondary Buttons** are used for to provide an alternative action to the primary one. These should be clear but not obvious. +- **Tertiary Buttons** are used for actions that may be used by the user but not necessarily the action they would need to do right then. + +For the primary set of colors (blue), you should use a different shade based on the background its on top of (note the differences in hover as well). + +#### Primary Color + + + + + Primary + + + + + Secondary + + + + + Tertiary + + + + +
+ + + + + + + + + Background: #155DA1 + + + Hover Background: #0E4E8A + + + Text: #FFFFFF + + + + + + + + + + + + Background: #FFFFFF + + + Border/Text: #155DA1 + + + Hover Border/Text: #0E4E8A + + + + + + + + APPLY NOW + + + + Text: #155DA1 + + + Hover Text: #0E4E8A + + + + + + + + + + + + + + Background: #155DA1 + + + Hover Background: #0D3F6E + + + Text: #FFFFFF + + + + + + + + + + + Background: #FFFFFF + + + Border/Text: #155DA1 + + + Hover Border/Text: #0D3F6E + + + + + + + + APPLY NOW + + + Text: #155DA1 + + + Hover Text: #0D3F6E + + + + + + + + + + + + + Background: #FFFFFF + + + Text: #2D4979 + + + Drop Shadow on Hover + + + + + + + + + + Background: #2D4979 + + + Border/Text: #FFFFFF + + + Drop Shadow on Hover + + + + + + + APPLY NOW + + + Text: #FFFFFF + + + + + + + +
+
+ +### Disabled State + + + + + + Primary + + + + + Secondary + + + + + Tertiary + + + + +
+ + + + + + + + + Background: #B4D8FA + + + Text: #FFFFFF + + + + + + + + + + + + Background: #FFFFFF + + + Border/Text: #B4D8FA + + + + + + + + n/a + + + + + + + + + + + Background: #EBEEF2 + + + Border: #8B9199 + + + + + + + + + + + Background: #FFFFFF + + + Border: #EBEEF2 + + + Text: #8B9199 + + + + + + + + n/a + + + + + + + + + + + Background: #415F94 + + + Text: #7D9CD2 + + + + + + + + + + Background: #2D4979 + + + Border: #415F94 + + + Text Color: #7D9CD2 + + + + + + + n/a + + + +
+ + +#### For all other colors + +This includes secondary colors (red, green, yellow) and indigo. You should use the "dark" shade of the color for the hover state and the "light" shade of the color for disabled state. Look at [Colors](/design/colors) from more specifics. + + + + + State + + + + + Primary + + + + + Secondary + + + + +
+ + + + + Active + + + + + + + Use the primary color in the palette. + + + + + + + + Use the primary color in the palette for both border and text. + + + + + + + + + Hovered + + + + + + + Use the “dark” color in the palette. + + + + + + + + Use the “dark” color in the palette for both border and text.. + + + + + + + + + Disabled + + + + + + + Use the “lighter” color in the palette. + + + + + + + + Use the “lighter” color in the palette for both border and text. + + + + + +
+ +#### Button Sizing +There are 3 sizes of buttons. Large buttons are mainly used for call to actions and homepage. Use sparingly. + +Large + + + +Medium + + + +Small + + +
+ +
+ +#### Basic Visual Style + +**Borders** + +Buttons have a border radius of 13 px. +Secondary Buttons have border widths of 2 px. + +
+ +**Drop Shadow** + +Drop shadows have these attributes: `box-shadow: 0 1px 6px 2px rgba(0,0,0,0.15);` + +
+ +**Inline Links** + +Inline links should inherit text style. + +
+ +**Button Typography** + +Large & Medium Button + + + + Font + {theme.typography.button.fontFamily} + + + + + Weight + {theme.typography.button.fontWeight} + + + + + Size + {theme.typography.button.fontSize} + + + + + Letter Spacing + {theme.typography.button.letterSpacing} + + + + + Line Height + {theme.typography.button.lineHeight} + + + + + +Small Button + + + + Font + {theme.typography.buttonSmall.fontFamily} + + + + + Weight + {theme.typography.buttonSmall.fontWeight} + + + + + Size + {theme.typography.buttonSmall.fontSize} + + + + + Letter Spacing + {theme.typography.buttonSmall.letterSpacing} + + + + + Line Height + {theme.typography.buttonSmall.lineHeight} + + + + + diff --git a/docs/pages/design/colors.mdx b/docs/pages/design/colors.mdx index 2ddbc83..3c2ba91 100644 --- a/docs/pages/design/colors.mdx +++ b/docs/pages/design/colors.mdx @@ -23,7 +23,7 @@ Secondary colors are for actions or states. Green is for success. Red is for err Top color indicates a color that can be used for main text. Bottom color is used for supporting text. - + #### Usage diff --git a/docs/pages/design/tags.mdx b/docs/pages/design/tags.mdx index 088e2f0..a1baba3 100644 --- a/docs/pages/design/tags.mdx +++ b/docs/pages/design/tags.mdx @@ -1,4 +1,88 @@ export const meta = {type: "design", title: "Tags"} +import { Tag, Box, Flex } from '@hack4impact-uiuc/bridge' +import CodeExampleBox from '../../components/CodeExampleBox' + import Layout from '../../components/layout.js' -export default Layout({...meta}) \ No newline at end of file +export default Layout({...meta}) + +Tags are used for categorizing and labeling. Tags may be any color in your color palette, along with their light, primary, dark shades with white text. Check out [Bridge's color palette](/design/colors) for more information on colors. + +
+ +#### Light + +Light Red +Light Yellow +Light Green + +Light Blue +Light Indigo +Light Grey + + +
+ +#### Primary + +Red +Yellow +Green + +Blue +Indigo +Grey + + +
+ +#### Dark + +Dark Red +Dark Yellow +Dark Green + +Dark Blue +Dark Indigo +Dark Grey + + +
+
+
+ +### Tags Visual Style + +**Structure and Spacing** + + + +**Dimensions** + +Tags have horizontal padding of 8 px and vertical padding of 8 px. +Tags have a default height of 28 px. + +
+ +**Borders** + +Tags have a border radius of 4 px. + +
+ +**Text** + +Buttons use body text style. + +
+ +### Usage + + + + + + + + + \ No newline at end of file diff --git a/docs/pages/design/typography.mdx b/docs/pages/design/typography.mdx index d40de81..99d455d 100644 --- a/docs/pages/design/typography.mdx +++ b/docs/pages/design/typography.mdx @@ -1,6 +1,6 @@ export const meta = {type: "design", title: "Typography"} -import { Heading, Text, theme} from '@hack4impact-uiuc/bridge' +import { Heading, Text, Box, theme } from '@hack4impact-uiuc/bridge' import Row from '../../components/row.js' import Col from '../../components/col.js' @@ -412,31 +412,31 @@ typography styles. Font - {theme.typography.body.fontFamily} + {theme.typography.tags.fontFamily} Weight - {theme.typography.body.fontWeight} + {theme.typography.tags.fontWeight} Size - {theme.typography.body.fontSize} + {theme.typography.tags.fontSize} Letter Spacing - {theme.typography.body.letterSpacing} + {theme.typography.tags.letterSpacing} Line Height - {theme.typography.body.lineHeight} + {theme.typography.tags.lineHeight} \ No newline at end of file diff --git a/docs/public/docs-content/design/buttons/LgButton.svg b/docs/public/docs-content/design/buttons/LgButton.svg new file mode 100644 index 0000000..b21e940 --- /dev/null +++ b/docs/public/docs-content/design/buttons/LgButton.svg @@ -0,0 +1,56 @@ + + + + LgButton + Created with Sketch. + + + + + + APPLY NOW + + + + LEARN MORE + + + + + + + + 14 px + + + + + + + + + + + + + + 20 px + + + + + + + + + + + 32 px + + + 32 px + + + + + \ No newline at end of file diff --git a/docs/public/docs-content/design/buttons/MedButton.svg b/docs/public/docs-content/design/buttons/MedButton.svg new file mode 100644 index 0000000..b4631bc --- /dev/null +++ b/docs/public/docs-content/design/buttons/MedButton.svg @@ -0,0 +1,55 @@ + + + + MedButton + Created with Sketch. + + + + + + + + 16 px + + + 12 px + + + + + + + + + + + + + + + + + 16 px + + + + + + + + + + + + + + Apply Now + + + Learn More + + + + + \ No newline at end of file diff --git a/docs/public/docs-content/design/buttons/SmButton.svg b/docs/public/docs-content/design/buttons/SmButton.svg new file mode 100644 index 0000000..61c61df --- /dev/null +++ b/docs/public/docs-content/design/buttons/SmButton.svg @@ -0,0 +1,55 @@ + + + + SmButton + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + 12 px + + + 12 px + + + 16 px + + + + + + + + + + + + + Apply Now + + + Learn More + + + + + + + \ No newline at end of file diff --git a/docs/public/docs-content/design/tags/tags-dimensions.svg b/docs/public/docs-content/design/tags/tags-dimensions.svg new file mode 100644 index 0000000..ac82070 --- /dev/null +++ b/docs/public/docs-content/design/tags/tags-dimensions.svg @@ -0,0 +1,77 @@ + + + + Tags + Created with Sketch. + + + + + + + + Light Red + + + Light Blue + + + Light Indigo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 px + + + 4 px + + + 8 px + + + 8 px + + + 8 px + + + + + + + + + + + \ No newline at end of file diff --git a/docs/public/docs-content/design/tags/tags-do.svg b/docs/public/docs-content/design/tags/tags-do.svg new file mode 100644 index 0000000..ef158be --- /dev/null +++ b/docs/public/docs-content/design/tags/tags-do.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/public/docs-content/design/tags/tags-dont.svg b/docs/public/docs-content/design/tags/tags-dont.svg new file mode 100644 index 0000000..f81034f --- /dev/null +++ b/docs/public/docs-content/design/tags/tags-dont.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/yarn.lock b/docs/yarn.lock index d013ec1..ddfd73a 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -986,10 +986,10 @@ resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== -"@hack4impact-uiuc/bridge@^0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@hack4impact-uiuc/bridge/-/bridge-0.0.7.tgz#e87e4eec6c1113d0f4c87cb621945d8b960412a5" - integrity sha512-yDDWXi4/WQUIPy874soNspYJsAiiwoP1zEIEGdKVKD6Y0IMWPKBR/AscPPHIc89SclJv1GQCFeZEW1Bnq3ZS/w== +"@hack4impact-uiuc/bridge@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@hack4impact-uiuc/bridge/-/bridge-0.0.8.tgz#83bc1ac9afcba9b2b3238ba5e775e753d8b56a4f" + integrity sha512-Kjj7Q7+cynq3KeYL1kdoOvWGQ2oV6+56aWPHghu1bk2uqPfjXgRYh2nOzJVetOg1D/xQrOU36UkfxefL0K5OAQ== dependencies: "@styled-system/prop-types" "^5.1.5" "@styled-system/theme-get" "^5.1.2" diff --git a/package.json b/package.json index b8f8d8e..3f67615 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "react-is": "^16.12.0", - "styled-components": "4.4.1" + "styled-components": "^5.1.0" }, "directories": { "doc": "docs" diff --git a/src/__tests__/__snapshots__/Alert.js.snap b/src/__tests__/__snapshots__/Alert.js.snap index b22382b..bf6901f 100644 --- a/src/__tests__/__snapshots__/Alert.js.snap +++ b/src/__tests__/__snapshots__/Alert.js.snap @@ -24,7 +24,6 @@ exports[`Alert Alert Variants renders error 1`] = ` -ms-flex-align: center; align-items: center; padding: 16px 16px; - width: 100%; } .c0 svg { @@ -71,7 +70,6 @@ exports[`Alert Alert Variants renders information 1`] = ` -ms-flex-align: center; align-items: center; padding: 16px 16px; - width: 100%; } .c0 svg { @@ -118,7 +116,6 @@ exports[`Alert Alert Variants renders success 1`] = ` -ms-flex-align: center; align-items: center; padding: 16px 16px; - width: 100%; } .c0 svg { @@ -165,7 +162,6 @@ exports[`Alert Alert Variants renders warning 1`] = ` -ms-flex-align: center; align-items: center; padding: 16px 16px; - width: 100%; } .c0 svg { diff --git a/src/components/Alert/Alert.js b/src/components/Alert/Alert.js index 51e4961..6b80541 100644 --- a/src/components/Alert/Alert.js +++ b/src/components/Alert/Alert.js @@ -24,7 +24,6 @@ const Alert = styled.div` // size padding: 16px 16px; - width: 100%; svg { margin-right: 16px;