Coder Social home page Coder Social logo

hack4impact-uiuc / bridge Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 4.0 4.44 MB

Hack4Impact UIUC Design System + React Components

Home Page: https://uiuc.hack4impact.org/design

License: MIT License

JavaScript 97.70% CSS 2.30%
components design design-system hack4impact react styling

bridge's People

Contributors

davidenwang avatar dependabot[bot] avatar dl-eric avatar jackieo5023 avatar tko22 avatar zfaizal2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dl-eric enecode

bridge's Issues

Map Markdown to HTML Documentation

Epic: #15
create a utility and file structure to map markdown files to the component/design documentation

So you have a list of components, which will be listed on the Sidebar (#5):

  • Button
  • Alert
  • Text
  • ....

Each Component has details on what it does/how to use it etc... This should be in a markdown file - probably like:

- content
   - design
       - typography
       - colors
       - spacing
       - .... 
   - components
       - Button
       - Alert
       - Link
       - .... 

A sidebar may have different sections, etc - do something like this https://github.com/primer/components/blob/master/docs/src/%40primer/gatsby-theme-doctocat/nav.yml

Either we can use mdx, gatsby or whatever...

Create <Form /> component

there's probably some that i missed and overlooked but here are my initial thoughts. A

component encompasses a group of input elements - this includes everything in #31 . Check out ant.design for inspiration.

There are multiple types of form layouts.. we'll focus on vertical ones. Within vertical forms, you need to account for either

1. 
Label Name [ your choice of input ] 

2. 
Label Name
[ your choise of input ] 

The design system spec only accounts for the 2nd choice. We should add the 1st choice as well.

inline forms (e.g. two text inputs side by side) can be done with Flexbox by dev

Components

  • just include top parent form level styling like typography
  • <Form.Item> an item that includes a label name and the input
  • <Form.Label> the label for the Form Item
  • <Form.Text> helper text (below input)

<Form.Item />

props

  • row: bool - if true, this would choose choice 1, defaults to choice 2
  • disabled? idk how you would put disabled props into children
  • required? idk how you would put disabled props
  • optional? idk how you would put disabled props

<Form.Label/>

  • for - the id of the input (look at reactstrap)
  • required
  • optional

<Form.Text>

props

  • color

Example

<Form>
    <Form.Item row>
       <Form.Label required> Favorite Color </Form.Label>
       <TextArea />
       <Form.Text>some description </Form.Text>
    </Form.Item>
     // inline
   <Flex>
        <Box flex={1}>
           <Form.Label required> Favorite Car </Form.Label>
           <Dropownd asdfasdf />
           <Form.Text>some description </Form.Text>
        </Box>
        <Box flex={1}>
           <Form.Label required> Favorite shoe </Form.Label>
           <TextField />
           <Form.Text>some description </Form.Text>
        </Box>
   <Flex>
   <Form.Item>
       <Button>Submit</Button>
   <Form.Item>
</Form>

Tags fontSize

tags font size should be 12px, line height 16 px, letterspacing 0.3 px

Create <Checkbox /> Components

Design System Link

  • remember about form validation props
  • checkboxes allow for multiple options checked

components

  • <Checkbox> - a radio input. for a radio input, with Blue as the description, do <Checkbox>Blue</Checkbox> (would follow https://ant.design/components/radio/)
  • <Checkbox.Group> - a vertical group?

Props

  • disabled
  • error (this could be in Group and per Checkbox)

Pretty similar to Radios #52

Let me know if you need the icons - im not sure if you need the svg or not

<Alert> Links cannot add space between text

<Alert variant="error" mb="8px">
        <Icon type="errorAlert" />
        Error! Logs will be <Link href="#">here</Link>!
    </Alert>

or

<Alert variant="error" mb="8px">
        Error! Logs will be <Link href="#">{" "}here</Link>!
    </Alert>

doesnt add a space in between text. It doesn't work with a vanilla a tag either.

Table

Design System Link

need to ensure styling matches with <thead>, <tr>, <th>, <td>.. not sure whether they sure inherit whatever the font the table is in?

Props

  • type: primary, borderless, zebra

Potential Components for discussion

An issue to hold a list of potential components. We have a list of initial components from the design system but there are more to be added, especially with grid or just helping with hard to do components. We already have a Flex box container but think of more abstractions like sidebars, row, etc... Look at other component libraries for inspiration too!

Feel free to comment to add more.. I will cross out and link the issue once we decide to go forward with a component on this list.

  • Navbar
  • Timeline
  • Toolkit
  • Flex Row
  • Sidebar
  • Form Grid?

Grid Components
#89

COMMON should have COLOR

  • following primer
  • seems like we need COLOR in everything anyways
  • change up some documentation in the website to reflect this change

Create <Upload /> Component

I'm not sure if we should do this.. it's fairly complicated and idk if it's worth doing for the amount of effort vs how many people will use this

Could use https://react-dropzone.js.org/#dropzone (look at stying with styled-components) but here are some concerns:

  • what are the implications of adding another library?
  • I dont think we can do the progress bars, we could make progress bars into a different component? maybe?

Remove scaling for some theme attributes

some theme attributes like letterSpacings are defined as a scalar array. Then, each value is mapped to a key... but it would make sense not to initially represent it in an array

Fix `get`

get is a HOC over themeGet provided by styled-system... themeGet has the API of

themeGet(objectPath, fallbackValue)(props)

it takes props as a value and gets props.theme...

get just defaults with the default theme...

However, with the way we've been using it outside styled-components (not tagged template literal) and in object literal syntax, it will always fallback the default theme ignoring the passed theme, if it exists...

So, we should

  1. test components changing styles for passed themes via props ( does that automatically if one would use it so we don't have to worry about that)
  2. in any object literal syntax not styled.div or whatever do get(key)(props) where props.theme is the theme... However, we've been converting the theme passed in as props as propTheme since it conflicts with the default theme we import in components... Thus, we should alias default theme we import in as defaultTheme (since we use it once) -
import {default as defaultTheme} from '../theme'

then whenever we deconstruct props for the component, we leave it as theme, instead of aliasing it to propTheme as such:

const Button = ({theme, ...props}){
}

// instead of ({theme: propTheme, ...props})

Form Component Epic

epic for forms, since there's a lot

  • Text Field #32
  • Text Area #33
  • Radio Buttons #52
  • Checkboxes #53
  • Dropdown #44
  • file upload #54 - not sure if we should do
  • Form - #55

Each component will need to have an error prop

Main Page

Banner

Title: Bridge
Hero: A flexible but simple design system
Smaller: Design & Build with Hack4Impact UIUC Design System

Then below โ†’ Lead User to clicking either Design or Components pages

Epic: Documentation Site

Eventually, this would be redirected from uiuc.hack4impact.org/design

I'm imaging something like the Github' Primer or Shopify's polaris. You would have two main sections:

  1. Design System Documentation on Principles, colors, etc (/design)
  2. React Component Documentation (/components)

Both will have a sidebar of elements and clicking them will go to a page with more detail on that subject.

Content

Content will be taken from a markdown file for ease of documentation creation and maintenance.

Design System

Example:
image

Components

There's a ton of examples of react component library documentation.

Github Primer Components
image
Reactstrap
image

Add Sidebar in Docs

Epic: #15

  • use actual npm package @hack4impact-uiuc/design
  • Add sidebar that would list all the different components in the library

<Dropdown /> Components

We'll do a simple dropdown for now (no complex things for like header,
within dropdown - we let user do that on their own if they want... we wont provide the api for that)

props

  • isOpen
  • toggle
  • closeOnOutsideClick
  • direction (direction dropdown will pop out of)

Behavior

  • unless overrided by prop, when user clicks outside dropdown, it should close dropdown

<Dropdown.Item> Render children

image

Navbar

  • use same navbar as website
  • Logo to the left
  • Design, Components, About Tabs
  • Tabs should collapse to a hamburger menu
    • make sure Sidebar gets included with hamburger menu if small

Create <Tags /> Component

Design System Link

I'm not exactly sure how to name these color variants since we have success, error, warning stuff with buttons. Maybe just the name of the color itself? green, blue, red... and then have another prop for "light", "primary", "dark"

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.