0.0.28 • Published 2 months ago

@ty2k/design-system-react-components-test v0.0.28

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 months ago

@bcgov/design-system-react-components

Lifecycle:Experimental

This package contains a library of React components built using React Aria Components to implement the BC Design System.

Questions? Please email the GDX OSS Design Team.

See repository: https://github.com/bcgov/design-system

To use, install this package and import the components into your application.

Install

npm install @bcgov/design-system-react-components

BC Sans font dependency

This package installs @bcgov/bc-sans as a peer dependency. You must import the font-face declarations from @bcgov/bc-sans and ensure the font is reachable for your end user. The React components require that the BC Sans font-face is available to display correctly. The components do not ship their own copies of the font to minimize your bundle size.

Important! If you are on a BC Government-provisioned laptop, you already have the BC Sans font installed on your machine. This package uses BC Sans (with a space) for its font styles. If you are using this component library but not supplying the font, it's possible that your machine will still display the font correctly for you, but not your end user. Make sure to check this by disabling the font on your machine or by testing with another machine.

Use

// App.jsx

// If you're already importing the BC Sans font-face somewhere else in your
// project, there is no need to import it again. Just make sure the `BC Sans`
// declaration and font files are available.
import "@bcgov/bc-sans/css/BC_Sans.css";

// Import the individual components you need
import {
  Button,
  Footer,
  Header,
  TagGroup,
  TagList
} from "@bcgov/design-system-react-components";

export default function App() {
  return (
    <Header
      title="My application"
      skipLinks={[
        <a href="#main-content">Skip to main content</a>
      ]}
    >
      <Button variant="primary" size="small">Log in</Button>
    </Header>
    <main id="main-content">
      <TagGroup aria-label="Tag group with two items">
        <TagList
          items={[
            { id: "one", textValue: "One" },
            { id: "two", textValue: "Two" },
          ]}
        />
      </TagGroup>
    </main>
    <Footer/>
  );
}

Component list

ComponentReact Aria Components docs link
Buttonhttps://react-spectrum.adobe.com/react-aria/Button.html
FooterN/A
HeaderN/A
Selecthttps://react-spectrum.adobe.com/react-aria/Select.html
TagGroup, TagList, Taghttps://react-spectrum.adobe.com/react-aria/TagGroup.html

Supported React versions

This package has a peer dependency on react and react-dom at these versions: "^16.14.0 || ^17.0.0-rc.1 || ^18.0.0"

By targeting v16.4.0 as a minimum, we get to use React's modern JSX transformation in tsconfig.json:

"jsx": "react-jsx",

This means there's no need for unused import React from "react" statements in your JSX files.

Versions

This project follows semantic versioning. See CHANGELOG.md for version details.

Development

Components

Components live in ./src/components and are targeted by the build process with an export in ./src/index.ts.

Storybook

Storybook stories live in ./src/stories.

Run npm run storybook-dev to access the Storybook instance for the component library.

Vite kitchen sink application

Vite uses the components code directly from ./src/components in groups of content in ./src/pages.

Run npm run vite-dev to access the Vite React demo app.

Publish new versions

To generate an updated copy of the package for distribution, run the included Rollup script: npm run rollup.

This will place artifacts in the dist folder, which is targeted for publishing in package.json with the files field.

Update the package version in package.json and run npm publish to push a new version.

0.0.26

2 months ago

0.0.27

2 months ago

0.0.28

2 months ago

0.0.25

2 months ago

0.0.24

2 months ago

0.0.23

2 months ago

0.0.21

2 months ago

0.0.22

2 months ago

0.0.20

2 months ago

0.0.19

3 months ago

0.0.17

3 months ago

0.0.18

3 months ago

0.0.14

4 months ago

0.0.15

4 months ago

0.0.16

4 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago