Coder Social home page Coder Social logo

ui-components's People

Contributors

rutger avatar spacek33z avatar taym95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ui-components's Issues

ActionBar: don't use full width

When not using <Row> and <Col>, the ActionBar component shows two buttons like this:

screen shot 2018-01-29 at 17 57 47

I would expect them to be next to eachother. I have pushed this example to the repository.

Refactor to use TypeScript

I wanna try how this module would work with TypeScript.

My main reason for doing this would be the better integration with IDE's, since with TypeScript they can know the exact props etc. ahead of time.

  • Use special styled-components wrapper everywhere
  • Fix @withTheme TS error
  • Fix all TS errors
  • Fix build script to compile with TS
  • Inventarize use of any and make ticket to resolve later
  • Compare new build size with old build size

Fix `any` typescript hacks

When converting to TypeScript I made a couple of shortcuts by typecasting to any, which resolves type issues by bypassing the types...

Add groupings of items to dropdown-selects

It would be nice if dropdowns like FancySelect, MultiPick and MultiSelect would have groupings/heading.

The dropdown of a MultiSelect could look a bit like this:

Mammals

  • Doggo
  • Cat
  • Human

Reptiles

  • Snake
  • Mark Zuckerberg
  • Turtle
    etc.

Model: use `zIndexModal` configuration

With the latest refactoring of the Modal component, it doesn't use the zIndexModal anymore. This is important since as a result of this, the modal falls before the notification stack component thus hides notifications behind the modal.

Table: use fixed-layout

The Table component should use fixed-layout, so it is easier to force tables to have a specific width.

Auto-imports in vscode is broken

Need to look into why adding types to the package.json lead vscode into stopping providing auto-import. It does seem that there is something wrong with some of the exports;

  • PropTypes.ts file doesn't seem to be generated
  • @types packages are not provided to the user
  • styled-components.d.ts is giving an error (which the original styled-components file doesn't)

Maybe fixing that will automatically fix the auto-imports. Or maybe vscode's IntelliSense just works differently when there are types, but how???

Look into switching to `emotion`

emotion instead of styled-components is quite interesting; to start with it is smaller, but the main advantage for me is that it supports things like this:

const active = css`background: red`;
...
<Dropzone activeClassname={active} />

I really miss this feature in styled-components. Switching would be relatively easy, since emotion's API is largely the same as styled-components.

TypeScript support also seems very good in emotion.

But it all might not be worth it...

Modal: add quick alert/confirm modals

At the moment we often use the native window.confirm() popup to warn the user before deleting e.g. a user. This is really ugly.

I was inspired by the nice confirm() replacement SweetAlert.

We could just imitate ant.design here, I like their design and the API:

Modal.confirm({
    title: 'Do you want to delete these items?',
    onOk() {},
    onCancel() {},
});

#8 needs to be fixed before this.

FancySelect: fix selected item display

In FancySelect, there is CSS and code that implies that the selected item should always be bold in the dropdown list.

However, it is styled normally:
screen shot 2018-01-31 at 14 22 48

Please take a look at:

selected: selectedItem === item.value,

Improve overall UI

The UI really needs some refinements. At the moment it is not visually pleasing. I realize this is very subjective but I'm just going to give some examples.

To start with, the usage of colors and subtle shadows could be improved for the overall layout:

screen shot 2018-01-01 at 23 43 05

For the top menu, I'm missing hover effects to make it a little less boring. Perhaps also a bit more shadows here or whatever;

screen shot 2018-01-01 at 23 45 55

Automate versioning via CI

Now that we use Travis, I should find a way to automate releases. Perhaps use semantic-release to auto-generate changelog.

Add correct typings for Icon components

At the moment all Icon components have this typing: let IconChat: (props: any) => JSX.Element. Since the icon is directly passed to SVG, we can use the SVG props interface.

Drop Moment as dependency

Moment is a pretty huge dependency and I don't even like the API. In the past few months a lot of alternatives have popped up. Needs research.

Fork grid package

I would like to implement the code of react-styled-flexboxgrid in this repository. It needs some changes so it works better with ui-components. Mainly:

  • Add a last prop on <Col />
  • Allow true on props, which would be the same as "xs". Example: <Row middle="xs"> to: <Row middle>.
  • Add typescript types

Tooltip: should work in divs with `overflow: hidden`

Right now the tooltip component uses a :before and :after CSS hack to get placed directly underneath the child component it wraps. However, this doesn't work when a parent component has CSS like overflow: hidden.

This is fixable if JS is used to determine the x and y location of the child component, and then the tooltip is inserted in the <body> instead.

Errors in stories should fail the build

When there is a TypeScript error in a stories file, for example due to a prop no longer existing, it should fail the build completely. This would have prevented so much errors in the past...

Responsiveness

Some issues regarding responsiveness:

  • Layout of nav bar and toolbar stretches over the whole width, while the content is limited to a max width. I suggest to limit the width of the nav bar and tool bar content to the same content max width. Background color / container should stretch over the whole width of the view.
  • The content max width is too limited for large monitors. With wide tables and a lot of data it is handy to use all space available.
  • There is also content where you do not want to use the whole width (like forms, or text). Maybe we can set a flag for the type of container?
  • I am thinking about mobile, since there will be instances where that is a requirement. Thoughts?

Modal: automatically append the modal to `<body>`

At the moment the <Modal /> component is simply rendered on the place where you decide to render it (which can be in a

with e.g. overflow: hidden;). Because that wouldn't work properly in many cases, our projects have some kind of viewStore.setModal() method, and in the top <App /> component the modal is rendered.

I don't like that at all, because it means more configuration in each project while we also could fix this in ui-components. We could imitate ant.design here (again haha)

Topmenu: make colors more configurable

Currently the MenuRow component of the topmenu will switch colors based on where it's used (first MenuRow will be white bg, second MenuRow will be dark bg).

This should be changed to allow for more flexibility; something like <MenuRow tone={Tone.Dark} />.

Improve build time

The build time is insanely high, because the rollup typescript plugin is doing very weird slow stuff.

Two ways to fix; first one to actually try to find the bottlenecks and see if we can improve it. Second one to just not bundle the whole ui-components to a single file. Maybe this is better anyway, but needs some research since it might increase build time for projects that use ui-components.

Fix Dropdown hitbox

This small gif explains the bug:
Dropdown hitbox bug

What happens is that the wrapper of the button and dropdown has the click handler, instead of it being on only the button. This can also be very annoying when you're trying to close the modal, as you have to click outside of the hitbox.

Button: add loading state

Buttons should have a loading state with a fancy loading indicator.

Perhaps just <Button loading />. When this prop is true, the button should also have the disabled attribute.

screen shot 2018-01-13 at 17 03 06

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.