paperyo / paper-components

✨📦✨ A simple yet beautiful set of React components built on top of styled-components. 💅
MIT License
3 stars 0 forks source link

Adding button #1

Closed gabrielreisn closed 5 years ago

gabrielreisn commented 5 years ago

This PR attempts to add the button component and basic configuration for CI / CD

gabrielreisn commented 5 years ago

@savioserra it's on WIP, so don't worry about reviewing it :) Besides the PascalCase it needs to have more themes than just "tomato" and "disabled"

savioserra commented 5 years ago

We should establish a color palette in our guideline.

Also, emotionjs has a component named ThemeProvider, which injects themes as props on child components. When I was developing the InputField component (also wip), I created a default folder inside the themes folder. There, we can define those colors and others variables, which should fallback to when the user doesn't provide his own theme.

image

What do you think? I think this is a nice approach for both library and users. We could split the code inside the themes/default as: themes/default/colors, themes/default/sizes? and so on, and export it all together in the themes/default/index.tsx.

savioserra commented 5 years ago

About the prop type. Do you think we should keep it as a separate file or define it in the same file of the component?

gabrielreisn commented 5 years ago

@savioserra ok, i'll try to use and improve the emotion theme provider. We can discuss color pallet at the guidelines. WDYT about using a movie / anime for choosing it? (like this: https://digitalsynopsis.com/wp-content/uploads/2016/05/cinema-palettes-famous-movie-colors-moonrise-kingdom.jpg)

I also think that we should keep consistency and add a types file for each component, just like you did :)

savioserra commented 5 years ago

@gabrielreisn What if we wrap our top level components always on a ThemeProvider, like this:

<ThemeProvider theme={props.theme || defaultTheme} >
    {...children}
<ThemeProvider/>

Or even better, we could merge them:

<ThemeProvider theme={{...defaultTheme, ...props.theme}} >
    {...children}
<ThemeProvider/>

So we don't need to check every time if a value is present in the props.theme, since it always falls back to the defaultTheme.

savioserra commented 5 years ago

@savioserra ok, i'll try to use and improve the emotion theme provider. We can discuss color pallet at the guidelines. WDYT about using a movie / anime for choosing it? (like this: https://digitalsynopsis.com/wp-content/uploads/2016/05/cinema-palettes-famous-movie-colors-moonrise-kingdom.jpg)

I also think that we should keep consistency and add a types file for each component, just like you did :)

Choosing the color palette based on a anime sounds funny 😃 Let's do it.