Giter Site home page Giter Site logo

react-ui-org / react-ui Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 7.0 9.91 MB

React UI is a themeable and performant UI library for React apps.

Home Page: https://react-ui.io

License: MIT License

JavaScript 55.45% SCSS 42.76% CSS 1.69% Dockerfile 0.04% HTML 0.06%
components design-system react react-component-library react-components reactjs ui ui-components

react-ui's People

Contributors

adamkudrna avatar bedrich-schindler avatar crishpeen avatar dacerondrej avatar dlouhak avatar fousjiri avatar hubacekj avatar joeyyy09 avatar mbohal avatar xdacer00 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

react-ui's Issues

Consider passing custom attributes to components

Currently, most components cannot have custom attributes like className, aria-label or similar. It might be useful if they could — for example, adding CSS utility classes for offsets would be easier. Optional attributes could be of any type, they would not be defined in component's props.

Passing CSS class

Current state:

<div className="mb-3">
  <Button label="Button with classname" />
</div>

Proposal:
⚠️ This is not a desired solution, it could encourage people to hack the component's inner styles.

<Button className="mb-3" label="Button with classname" />

👉 Proposal: special utility props, see #18.

Passing eg. ARIA attribute for accessibility

Proposal (currently supported only in ButtonGroup and CardList):

<ButtonGoup aria-label="group"></ButtonGroup>

Create AutoScroll component

This issue is blocked by issue #53 (#58)

We need to create AutoScroll component that will be able to automatically scroll in selected direction when its content its updated. This functionality will be applied only if user will be scrolled at the edge of viewport. Component should detect change of content, it must not be detected by x or y coordinate because it will not work in case we will remove and add data at the same time.

We can create new AutoScroll component or implement it into ScrollView.

Lint commit messages

Check that commit messages are in the following format:

<Commit message text> (#<GitHub issue number>)

Improve breakpoint scale

Largest breakpoints are currently too close: 84 em and 90 em.

image

Breakpoint values would be better off with a graded scale like this:

image

This will provide better control on largest screens.

Improve Table sorting buttons

Currently, the Button component is used for sorting arrows. It would be nice to have them aligned with text in the table, in the same color and without the button-style hover effect.

image

Maybe also reveal them on hover like in MUI?

image

(Created from #19, relates to #13).

Layout API for all UI components

As of now, adding an outer spacing to a component is done with utility classes like this:

<div className="mb-3">
  <Component />
</div>

This makes source code and DOM needlessly complex. It would be nice if we could do something like this:

<Component mb={3} />

This kind of “layout API” would be present in all UI components.


ℹ️ We don't want to make it possible to modify inner component styles so only outer CSS properties would be part in such API: margin (all directions), maybe flex child properties (align-self, justify-self).

Remove automatic spacing from form fields

Related to #41.

Providing form fields with no automatic margins should lead to a better expected behaviour. By far, automatic margins don't work as good as Toolbar or FormLayout.

Resets of auto margins have to be removed from the afore-mentioned layout components.

Unify `error` vs. `helperText` props

In all form fields (CheckboxField, MultipleSelectField, RadioField, SelectField, TextArea, TextField, Toggle):

  • rename helperText to helpText
  • use validationText for invalid/valid/warning validation message (ie. don't share the purpose with helperText)
  • get rid of the error prop
  • validate both *Text props as string or node to enable passing custom HTML such as links or icons

The new validationText would be styled according to the validationState prop.


As discussed in #20:

Mainly, we have to unify differences between usage of error vs helperText+validationState across all components, not only Radio, CheckBox and Toogle. It is weird to have different approaches of passing these values into components. So this is the first part of issue we probably agree on.

Then I am in to have two different props for setting these values, errorText and helpText, so we can set both independently. With this change, we will have to remove validationState prop and remove old error prop. And I also tend to use helpText instead of helperText.

The only thing I am not sure about is if we will need some help icon or not. If yes, then we will have to have prop for help icon, something like helpIcon. But it is only weak point I see now. Maybe icon is not necessary. It is totally up to @adamkudrna.

I am still thinking about icons because it is not so handy to pass all these icons like sortingAscIcon, sortingDescIcon, helpIcon (if it is needed) to components all the time. And in case we will need to have helpIcon then I would like to open discussion aboutIconContext component. We already have TranslationContext that can pass translations to components globally and it can be same for icons.

Originally posted by @bedrich-schindler in #20 (comment)

have two different props for setting these values, errorText and helpText
I like these names

The only thing I am not sure about is if we will need some help icon or not.

Could we make helpText and errorText accept nodes and/or text and then we could pass in the icons inline? That would open other possibilities such as passing into helperText a button that opens documentation modal and such things.

Something like (I didnt test this code):

<MyComponent
  helpText={<><Icon type="help"> I'm the help text.</>}
/>

Originally posted by @mbohal in #20 (comment)

Toolbar layout enhancements

  • enable vertical alignment for all items
  • enable grouping of items
  • ⚠️ BC: introduce justification options and remove ToolbarSpacer

Modal sizes

It would be handy to have multiple sizes of Modal to choose from: small, medium (default) and large. Sizes should be configurable.

Document releasing and automate where possible

Steps

  1. bump version in package.json according to SemVer, merge into develop via PR
  2. merge develop into master via PR
  3. draft GitHub release
    • use the same version as in package.json in step 1
    • set target branch to master (we want to keep develop the default branch for PRs)
    • summarise the changes, preferably divided into sections
  4. npm publish — can be automated with official GH actions
  5. build and deploy the docs to GitHub Pages, must include the latest version number (relates to #67)
  6. close corresponding milestone — can be automated using third-party GH actions

A CONTRIBUTING.md file describing this workflow should be created (maybe in the .github folder?).

Extensions

Optionally:

Resources

Exclude documentation components from library

Documentation components are not needed for library consumers, they should provide necessary tools themselves when building the documentation on their side. Therefore the components should be moved to src/demo/components. They will be removed entirely once the demo is migrated to a new documentation platform (#15). This will also help us decrease the size of lib.js.

image

image

Better form layout

We need the option to align form fields to the input field from the left side, even when they have auto-sized labels in horizontal layout. It must also work with vertical field layout (applied also for horizontal layout on small screens).

Layout for centered CTA and secondary actions

We need a very specific layout for a centered CTA button and optional secondary actions on sides. This is required specifically for Load more button but it may be useful in other situations.

Decrease bundle build size

Webpack and npm report warnings:

  • production/development mode has not been set
  • recommended size limit 244 kB has been exceeded (1.12 MB)
  • refactor deprecated npm's prepublish task

image

image

image

New documentation

Current documentation is very basic. It consists of:

  1. Foundation showcase (colors, typography, icons, spacing, breakpoints)
  2. Layout components showcase
  3. UI components showcase
  4. Screens showcase
  5. Utility classes showcase

Problems:

  • Developers find the docs hard to use because it doesn't contain important information like code examples or description of components' API.
  • It is very difficult to maintain since it's held in a single file.
  • Designers (and actually no one except contributors) cannot browse the docs because it's not served anywhere in public.

Proposal:

  • Find a way to split the docs into multiple files and screens to improve maintainability and navigation in browser.
  • Provide components with code examples to help developers use the components.
  • Provide components with API description to help developers use the components. This could be generated from propTypes comments.
  • Consider using external tools like Storybook as it solves many of the problems.
  • Serve the docs as a website to encourage designers use the UI library and to make it accessible to public.

Individual issues are expected to be raised as discussion continues within this issue.

Remove automatic spacing of `Button`s in favour of `Toolbar` layout

Currently, margin is added to the right side of field/button if there is more than one field in current context (div). While this may work fine for wide screens, it breaks on small screens where vertical margin is missing. These automatic margins may also get work unexpectedly complicated eg. when there is a (invisible, absolutely positioned) modal or dropdown next to a button.

Since our existing Toolbar layout perfectly covers this problem (and does a lot more), we could get rid of this functionality.

Automatic margins don't work in vertical layout:

image

Toolbar layout:

image
image

Deploy documentation to public URL

Currently the docs isn't accessible anywhere. Everyone should be able to view it when needed.

Serve the docs as a website to encourage designers use the UI library and to make it accessible to public.

(Taken from #15)

We want to stick to GitHub Pages unless something really serious makes us not to.

The question is, where shall we store the built website and how do we get it there?

Prerequisites

  1. GH Pages require a ready-to-deploy, static HTML website when not using Jekyll.
  2. We must choose from three possible places to store the generated website.

Options

Storing the website

There are two relevant types of GH Pages:

  • project
  • organisation
  • (user — not relevant for our use case)

We can store the generated site in:

  • the original project repository
    • 👍in the same repository
    • 👎cluttering the main source code with generated code or involving awkward checkouts to the detached gh-pages branch, see below
  • a separate repository dedicated to generated docs
    • 👍the original repository stays clean from generated code
    • 👎disconnected from the original repository

For project pages, the site is required to reside in either of these:

  • gh-pages branch (project pages)
    • 👍not cluttering the main source code with generated code
    • 👎awkward to checkout locally
  • master branch, docs directory (project pages)
    • 👍no explosive checkouts involved
    • 👎cluttering the main source code with generated code

For organisation pages or docs-dedicated project pages the site can live in the master branch.

Domain

  • github.io:
    • project (the generated site is in the same repository in gh-pages or master branches): https://react-ui-org.github.io/react-ui
    • separate project (the site is generated to a different repository): https://react-ui-org.github.io/react-ui-docs
    • organisation (the generated site is in a separate repository): https://react-ui-org.github.io
  • custom domain — sexy, but requires someone to pay the domain

Deployment

Improve inner IDs of inner component

Due to Selenium testing, IDs among UI components need to be updated to be more Selenium-friendly.

ID of UI component is passed to native element without change (for input, textarea, ...). ID with prefix __label need to be added to <label> tag, because ID with this prefix is now typically at last leaf, which is typically <span> that coitains label text.

Make transferred props more DRY

Related to #86.

It would be handy to combine the definition of props to transfer with propTypes. Currently it's white-listed aside like here in Button:

  const propsToTransfer = transferProps(
    props,
    ['afterLabel', 'beforeLabel', 'block', 'clickHandler', 'disabled', 'endCorner', 'grouped', 'id',
      'label', 'labelVisibility', 'loadingIcon', 'priority', 'size', 'startCorner', 'type', 'variant'],
  );

Code could be also more DRY and easier to write and maintain then.

Enable generating documentation of advanced `propTypes` syntax

Added by @adamkudrna: This includes these useful ways of abstraction:

  • propTypes assigned as value of a constant in the same file
  • propTypes defined in another file

Based on issue: doczjs/docz#1431

We need to create documentation component that will allow us to render documentation table with all props and its description. This component should be similar to default docz PropType component, but need to be able to renders props that are composed from another proptype definitions.

I would recommend to move this component to separate repository later, because it seems that there are more people with same problem like we have.

Dense Cards

It would be handy to have more compact Cards.

Remove unnecessary builds from repository

As we publish library on NPM registry, we do not need to have builds of library and demo in repository. We can gitignore them and publish only lib.js on NPM registry.

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.