2.21.1 • Published 7 months ago

@govtechsg/tradetrust-ui-components v2.21.1

Weekly downloads
68
License
Apache-2.0
Repository
github
Last release
7 months ago

UI-Component Library For TradeTrust

Install

npm i --save @govtechsg/tradetrust-ui-components

Development

In the project directory, you can run:

npm run start

Runs the app in the storybook mode. Open http://localhost:9009 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

ignore running npm run storybook command directly for this repo, use npm run start instead

npm run test

Launches the test runner in the interactive watch mode. See the section about running tests for more information.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!


Why?

This repository was created when repeated common styled components were being developed between 2 sites: tradetrust.io and creator.tradetrust.io.

Hence, the decision is to host any common ui components that are shared between the 2 sites here. This ensures DRY and design consistency between both sites.

How is it determined what goes here?

As of now, any potential common components that are used between tradetrust.io and creator.tradetrust.io will be developed here. This repository is always on the work, do look out for any updates that happen along the way : )

What's here?

Checkout the documentation for the available components.

Styleguide

Color palette here.

Styles management

  • The components here are built with Tailwind css.
  • Note that exported components are bare without styles.
  • It is expected for external application(s) to setup their own tailwind config, using the exported tailwind config from /build folder. It may look something like this:
    const commonUiConfig = require("@govtechsg/tradetrust-ui-components/build/tailwind")
    Thereafter, do a deep merge with your local tailwind config if there is any.
  • Do include "./node_modules/@govtechsg/tradetrust-ui-components/src/**/*.tsx", in tailwind config's purge content option, so that the classes will be retained after purged.
  • Otherwise, can use the stylesheet in /build/styles.css directly. Be careful of any conflicting css class names that your application may have.

Fonts management

We will not be providing the usage of Gilroy font. Please use alternatives.

However, for TradeTrust related applications, install by defining the following in tailwind.css.

@font-face {
  font-family: "Gilroy-Light";
  src: url('https://ui.tradetrust.io/static/fonts/GilroyLight/font.woff2') format('woff2'),
    url('https://ui.tradetrust.io/static/fonts/GilroyLight/font.woff') format('woff');
}
@font-face {
  font-family: "Gilroy-Medium";
  src: url('https://ui.tradetrust.io/static/fonts/GilroyMedium/font.woff2') format('woff2'),
    url('https://ui.tradetrust.io/static/fonts/GilroyMedium/font.woff') format('woff');
}
@font-face {
  font-family: "Gilroy-Bold";
  src: url('https://ui.tradetrust.io/static/fonts/GilroyBold/font.woff2') format('woff2'),
    url('https://ui.tradetrust.io/static/fonts/GilroyBold/font.woff') format('woff');
}
@font-face {
  font-family: "Gilroy-ExtraBold";
  src: url('https://ui.tradetrust.io/static/fonts/GilroyExtraBold/font.woff2') format('woff2'),
    url('https://ui.tradetrust.io/static/fonts/GilroyExtraBold/font.woff') format('woff');
}
2.21.0

9 months ago

2.21.1

7 months ago

2.20.0

9 months ago

2.19.2

12 months ago

2.19.0

1 year ago

2.19.1

1 year ago

2.18.16

1 year ago

2.18.15

1 year ago

2.18.12

2 years ago

2.18.13

2 years ago

2.18.14

1 year ago

2.18.10

2 years ago

2.18.11

2 years ago

2.18.9

2 years ago

2.18.8

2 years ago

2.18.7

2 years ago

2.18.5

2 years ago

2.18.6

2 years ago

2.18.3

2 years ago

2.18.4

2 years ago

2.18.1

2 years ago

2.18.2

2 years ago

2.18.0

2 years ago

2.17.0

2 years ago

2.16.0

2 years ago

2.15.0

2 years ago

2.15.1

2 years ago

2.13.0

2 years ago

2.12.0

2 years ago

2.12.1

2 years ago

2.14.0

2 years ago

2.11.0

2 years ago

2.10.1

2 years ago

2.10.2

2 years ago

2.10.0

3 years ago

2.9.0

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.7.4

3 years ago

2.7.3

3 years ago

2.7.2

3 years ago

2.7.1

3 years ago

2.7.0

3 years ago

2.6.4

3 years ago

2.6.3

3 years ago

2.6.2

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.3.2

3 years ago

2.3.3

3 years ago

2.3.0

3 years ago

2.3.1

3 years ago

2.2.7

3 years ago

2.2.8

3 years ago

2.2.6

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.0.3

3 years ago

2.2.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.12.0

3 years ago

1.13.2

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.11.2

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.2

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago