Skip to content

Commit 9eba1f5

Browse files
authored
Merge pull request #292 from bcgov/feature/header-react-component
Add Header component to @bcgov/design-system-react-components
2 parents 89fe814 + 6384e06 commit 9eba1f5

30 files changed

+2383
-1613
lines changed

packages/react-components/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 0.0.4
4+
5+
### Changed
6+
7+
- Use `react-aria-components` v1.1.1.
8+
- Updated class names in `Button`, `Select`, `Tag`, `TagGroup`, and `TagList` to add `bcds-` prefix to prevent style collisions with other instances of React Aria Components.
9+
10+
### Added
11+
12+
- Added Header component.
13+
314
## 0.0.3
415

516
### Changed

packages/react-components/README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ To use, install this package and import the components into your application.
1414

1515
`npm install @bcgov/design-system-react-components`
1616

17-
## BC Sans font dependency
17+
### BC Sans font dependency
1818

1919
This package installs [@bcgov/bc-sans](https://www.npmjs.com/package/@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.
2020

2121
**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.
2222

23-
### Use
23+
## Use
2424

2525
```jsx
2626
// App.jsx
@@ -31,18 +31,33 @@ This package installs [@bcgov/bc-sans](https://www.npmjs.com/package/@bcgov/bc-s
3131
import "@bcgov/bc-sans/css/BC_Sans.css";
3232

3333
// Import the individual components you need
34-
import { TagGroup, TagList } from "@bcgov/design-system-react-components";
34+
import {
35+
Button,
36+
Header,
37+
TagGroup,
38+
TagList
39+
} from "@bcgov/design-system-react-components";
3540

3641
export default function App() {
3742
return (
38-
<TagGroup aria-label="Tag group with two items">
39-
<TagList
40-
items={[
41-
{ id: "one", textValue: "One" },
42-
{ id: "two", textValue: "Two" },
43-
]}
44-
/>
45-
</TagGroup>
43+
<Header
44+
title="My application"
45+
skipLinks={[
46+
<a href="#main-content">Skip to main content</a>
47+
]}
48+
>
49+
<Button variant="primary" size="small">Log in</Button>
50+
</Header>
51+
<main id="main-content">
52+
<TagGroup aria-label="Tag group with two items">
53+
<TagList
54+
items={[
55+
{ id: "one", textValue: "One" },
56+
{ id: "two", textValue: "Two" },
57+
]}
58+
/>
59+
</TagGroup>
60+
</main>
4661
);
4762
}
4863
```
@@ -52,6 +67,7 @@ export default function App() {
5267
| Component | React Aria Components docs link |
5368
| ---------------------- | --------------------------------------------------------- |
5469
| Button | https://react-spectrum.adobe.com/react-aria/Button.html |
70+
| Header | N/A |
5571
| Select | https://react-spectrum.adobe.com/react-aria/Select.html |
5672
| TagGroup, TagList, Tag | https://react-spectrum.adobe.com/react-aria/TagGroup.html |
5773

@@ -67,6 +83,10 @@ By targeting v16.4.0 as a minimum, we get to use [React's modern JSX transformat
6783

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

86+
## Versions
87+
88+
This project follows semantic versioning. See [CHANGELOG.md](./CHANGELOG.md) for version details.
89+
7090
## Development
7191

7292
### Components

0 commit comments

Comments
 (0)