GithubHelp home page GithubHelp logo

canonical / react-components Goto Github PK

View Code? Open in Web Editor NEW
82.0 17.0 49.0 30.27 MB

A set of components based on Vanilla Framework

Home Page: https://canonical.github.io/react-components

JavaScript 1.73% HTML 0.39% Shell 3.13% TypeScript 72.32% Dockerfile 0.12% SCSS 0.66% MDX 21.65%
npm package npm-package web-and-design

react-components's Introduction

React components for Vanilla Framework

CI

This is a collection of components designed to be the way to consume Vanilla Framework when using React.

Storybook contains component docs with usage instructions.

Requirements

Canonical react components currently require that your build is configured with sass-loader (or equivalent), to compile sass.

Install

To use the NPM package do:

yarn add @canonical/react-components

Or if you use NPM:

npm install @canonical/react-components

Issues

Please file any issues at GitHub.

Contributing

You might want to:

Developing locally using this repository

You may wish to link this library directly to your projects while developing locally.

You can do this by cloning this repo to your local workspace;

git clone https://github.com/canonical/react-components

If you then drop into that folder and run;

yarn run link-packages

...this will add this project, react and react-dom to a local yarn registry.

Switching back to the project you are developing, run;

yarn install
yarn link react
yarn link react-dom
yarn link @canonical/react-components

...to pull the linked deps from the local registry. If you now run yarn build-watch in your react-components folder, your project should pick up any changes on refresh or hot module reload.

Note: When you're finished working locally - don't forget to go back and unlink;

cd react-components
yarn run unlink-packages

react-components's People

Contributors

aaryanporwal avatar akmittal avatar andesol avatar anthonydillon avatar barrymcgee avatar bartaz avatar bethcollins92 avatar caleb-ellis avatar carkod avatar clementchaumel avatar dependabot[bot] avatar edlerd avatar hatched avatar huwshimi avatar ilayda21 avatar jpmartinspt avatar lorumic avatar mas-who avatar minkyngkm avatar moisesbenzan avatar mtruj013 avatar petermakowski avatar petesfrench avatar renovate-bot avatar renovate[bot] avatar shdq avatar sowasred2012 avatar squidsoup avatar steverydz avatar vladimir-cucu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-components's Issues

Pass the onClick to Button

The recent change to handle disabled buttons broke onClick because the user defined onClick is not passed to the prop.

Add a doc for publishing to npm

Prepare for release

Check out a new release branch from master

git checkout -b prepare-0.1.1-release master

Update the changelog

Update CHANGELOG.md, changing the [Unreleased] section to the version number from above e.g. [0.1.1] - 2019-11-06. Consider looking at git log and adding any missed changes.

git commit -m "Update changelog for 0.1.1."

Build the docs

Build and Commit the docs for this version.

yarn build-docs
git commit -m "Build docs for 0.1.1."

Update the version

yarn version --new-version [0.1.1]

Push

Push your branch to GitHub, create a PR and land it (this might require approval).

Publish to NPM

Get a fresh copy of master

git clone [email protected]:canonical-web-and-design/react-components.git react-components-release

Build and publish the package.

cd react-components-release
npm publish --access public

Tag the release

  • Get the released package link.
npm view @canonical/react-components dist.tarball

Download the package from the link.

Create a new release on GitHub, remembering to:

  • Add the tag against against the correct commit using the new version number.
  • Copy the changelog section for this release into the description.
  • Upload the package (downloaded above).

Get demo service working

It's possible that the port might not be working due to this line in package.json: "docs": "start-storybook --port 8403"

Modal requires title

It would be nice if the Modal didn't require a title when you want to use it to display something like an image.

Add a hacking doc

Developing

Use Storybook to develop new components.

yarn install
yarn docs

And remember to yarn test and yarn lint.

Using with another project

Both projects will need to be running on the same machine/container.

In react-components run:

yarn install
yarn build
yarn link

To prevent multiple copies of React being loaded you'll also need to link React:

cd node_modules/react
yarn link

In the project you're working on:

yarn link "@canonical/react-components"
yarn link "react"
yarn install

If using a monorepo you'll need to run those commands at the top level (not inside a workspace).

You'll then need to start you project with yarn, not ./run.

Then when you're finished run:

yarn unlink react
yarn unlink "@canonical/react-components"

More details on yarn link in the docs.

MainTable doesn't allow for double rows

The MainTable component currently only allows single rows. In MAAS we use double rows in a lot of places (see screenshot) and need the flexibility to use the component in this way.

Screen Shot 2019-11-21 at 12 16 51 pm

Expose individual components at nice paths

To prevent having to import all components in the index.js it'd be nice to be able to import individual components.

At the moment these paths look like: import MainTable from "@canonical/react-components/dist/components/MainTable";

It'd be nice if this was import MainTable from "@canonical/react-components/MainTable";

Add a watch command

babel src --watch --out-dir dist --copy-files --ignore .test.js,.md,__snapshots__,testing

Accordion: aria attribute error

When opening the accordion there is an error:

Warning: Invalid ARIA attribute `ariaMultiselectable`. Did you mean `aria-multiselectable`?

Storybook doesn't use latest version of Vanilla

Even that project has Vanilla as dependency in package.json and is kept up to date with renovate the styles used by storybook are actually coming from hardcoded old version of Vanilla.

This makes impossible to make sure that the react component work and look correctly with latest version of vanilla.

https://github.com/canonical-web-and-design/react-components/blob/1527b939a5a12935ee274c3800c9529d3669d70c/.storybook/preview-head.html#L1-L4

Expected

Storybook should include the same version of Vanilla as is used in dependencies.

Add custom class name to table rows

We have a use case on jaas-dashboard where we want to add nested table rows for subordinate units. Example:

Screenshot 2019-11-14 at 13 49 56

However, the designs dictate that these rows should not have a border-top but I have no way to target that row with CSS.

Can the row prop on MainTable have a className property?

Allow columns to be sized in MainTable

Currently it appears as though all the columns are the same width. It would be helpful to allow columns to be sized so that some are bigger or smaller than they would be by default.

Fix babel ignores

The build command is not correctly ignoring files that don't need to be in the release.

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.