Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zopapublic/react-components
Shared React components for the Zopa projects.
https://github.com/zopapublic/react-components
react-components react-styleguidist styled-components typescript zopa
Last synced: about 22 hours ago
JSON representation
Shared React components for the Zopa projects.
- Host: GitHub
- URL: https://github.com/zopapublic/react-components
- Owner: ZopaPublic
- License: mit
- Created: 2019-05-22T09:51:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-13T15:18:46.000Z (4 months ago)
- Last Synced: 2024-12-31T01:15:35.194Z (about 22 hours ago)
- Topics: react-components, react-styleguidist, styled-components, typescript, zopa
- Language: TypeScript
- Homepage: https://zrc.netlify.app
- Size: 11.1 MB
- Stars: 41
- Watchers: 16
- Forks: 14
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# React components
![CI/CD](https://github.com/zopaUK/react-components/workflows/CI/badge.svg)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Dependencies - Always up to date](https://img.shields.io/badge/always-up_to_date-brightgreen.svg)](https://help.github.com/en/articles/configuring-automated-security-fixes)Shared react styled components for all the Zopa projects.
This repo contains 2 things at the same time:
- The Typescript library for the react components
- Documentation for the components managed with [React-styleguidist](https://react-styleguidist.js.org)
[Check the docs 💕](https://zrc.netlify.app/)
## Migrating from version 3
There are a number of breaking changes which will need to be addressed when upgrading from Zopa React Components v3 to v4.
[The migration guide](/etc/docs/migration-v4.md) will walk you through the major changes such as colours and typography.
## Installation
```bash
git clone https://github.com/zopaUK/react-components.git
pnpm i
```## Local linking
Local linking with Next.js applications can be particularly challenging due to the way Next.js handles module resolution and its own optimization processes. When attempting to link local packages, such as `react-components`, with a Next.js application, developers might encounter issues related to module resolution, duplicate React instances, or unexpected behavior in hot module reloading (HMR).
To mitigate these issues, you can use `pnpm dev:zrc`.
Follow these steps:
1. In the `react-components` directory, run the following command to start the watcher:
```bash
pnpm dev:zrc
```2. In the application directory, run the following command to link the `react-components` library (if it exists):
```bash
pnpm dev:zrc
```Now, any changes made in the `react-components` codebase will be reflected in the linked application after a delay (~500ms).
NOTE: It is named "zrc" (specifically) to allow the developer to run the same command on both projects.
## Running the project
Execute the development environment:
```bash
pnpm dev
```The docs will run at [localhost:6060](http://localhost:6060).
## Local development (working on a linked application)
We start a watcher using [esbuild](https://esbuild.github.io/) and [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html) by running:
```bash
pnpm dev:code
```##
Your locally running app will have its own way of linking to local dependencies but making changes in react-components codebase should now show in the application.
## Motivation
The aim of this project is to share with the frontend community how we code in Zopa.
We think it might be useful for someone who wants to start a new react components library and want to re-use some of our code.
## Types
You can access typings for specific components under `@zopauk/react-components/types`:
```tsx
import { Button } from '@zopauk/react-components';
import { IButtonProps } from '@zopauk/react-components/types/components/atoms/Button';
```To inspect the folder structure within `@zopauk/react-components/types` you can run `yarn compile:types` and navigate the generated `types/` folder in the project root.
## Contributing
In case you want to contribute to this library, please have a look at our [contributing guidelines](./CONTRIBUTING.md) 🙌🏼
## Contributors
moshie
thegrinder
raff-r
ubbe-xyz
admmasters
dfvalero
OlenaKashuba
Gabss405
JuliaHempel
katebeavis
charlielizzy
khumbon
calvin-fung-zopa
MichelleXBai
poteirard
gbkr
endymion1818
emilfjellstrom
MillieClare
steedems
tlaak
t-phamm
TomGroombridge
rominamoya
zopa-stephanie-senoner
rorydpayne
Blimeys
grabbeh
rory-payne
## License
This repository is [MIT-licensed](./LICENSE).
## Trade marks
No permission is granted to use the trade names, trade marks, service marks, or product names of Zopa, except as required for reasonable and customary use in describing the origin of this library and reproducing the content of the notice in the [license](./LICENSE).
## Fonts
Zopa uses Open Sans in its sites and applications. If you want to make use of this font outside of Zopa, you will need to license it directly from [Google Fonts](https://fonts.google.com/).