Skip to content

Commit 8af44de

Browse files
authored
Merge pull request #294 from bcgov/feature/footer-react-component
Add Footer component to @bcgov/design-system-react-components
2 parents edec660 + ea6cff5 commit 8af44de

File tree

21 files changed

+1353
-510
lines changed

21 files changed

+1353
-510
lines changed

packages/react-components/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Changelog
22

3+
## 0.0.5
4+
5+
### Added
6+
7+
- Added Footer component.
8+
39
## 0.0.4
410

511
### Changed
612

713
- 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.
14+
- 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.
915

1016
### Added
1117

packages/react-components/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import "@bcgov/bc-sans/css/BC_Sans.css";
3333
// Import the individual components you need
3434
import {
3535
Button,
36+
Footer,
3637
Header,
3738
TagGroup,
3839
TagList
@@ -58,6 +59,7 @@ export default function App() {
5859
/>
5960
</TagGroup>
6061
</main>
62+
<Footer/>
6163
);
6264
}
6365
```
@@ -67,6 +69,7 @@ export default function App() {
6769
| Component | React Aria Components docs link |
6870
| ---------------------- | --------------------------------------------------------- |
6971
| Button | https://react-spectrum.adobe.com/react-aria/Button.html |
72+
| Footer | N/A |
7073
| Header | N/A |
7174
| Select | https://react-spectrum.adobe.com/react-aria/Select.html |
7275
| TagGroup, TagList, Tag | https://react-spectrum.adobe.com/react-aria/TagGroup.html |

packages/react-components/package-lock.json

Lines changed: 503 additions & 387 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-components/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bcgov/design-system-react-components",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"type": "module",
55
"scripts": {
66
"rollup": "rollup -c --bundleConfigAsCjs",
@@ -32,15 +32,15 @@
3232
"@rollup/plugin-json": "^6.1.0",
3333
"@rollup/plugin-node-resolve": "^15.2.3",
3434
"@rollup/plugin-typescript": "^11.1.6",
35-
"@storybook/addon-essentials": "^8.0.0-rc.1",
36-
"@storybook/addon-interactions": "^8.0.0-rc.1",
37-
"@storybook/addon-links": "^8.0.0-rc.1",
38-
"@storybook/blocks": "^8.0.0-rc.1",
39-
"@storybook/react": "^8.0.0-rc.1",
40-
"@storybook/react-vite": "^8.0.0-rc.1",
35+
"@storybook/addon-essentials": "^8.0.0-rc.3",
36+
"@storybook/addon-interactions": "^8.0.0-rc.3",
37+
"@storybook/addon-links": "^8.0.0-rc.3",
38+
"@storybook/blocks": "^8.0.0-rc.3",
39+
"@storybook/react": "^8.0.0-rc.3",
40+
"@storybook/react-vite": "^8.0.0-rc.3",
4141
"@storybook/testing-library": "^0.2.2",
4242
"@types/react": "^18.2.64",
43-
"@types/react-dom": "^18.2.20",
43+
"@types/react-dom": "^18.2.21",
4444
"@typescript-eslint/eslint-plugin": "^7.1.1",
4545
"@typescript-eslint/parser": "^7.1.1",
4646
"@vitejs/plugin-react": "^4.2.1",
@@ -52,7 +52,7 @@
5252
"rollup-plugin-dts": "^6.1.0",
5353
"rollup-plugin-peer-deps-external": "^2.2.4",
5454
"rollup-plugin-postcss": "^4.0.2",
55-
"storybook": "^8.0.0-rc.1",
55+
"storybook": "^8.0.0-rc.3",
5656
"tslib": "^2.6.2",
5757
"typescript": "^5.4.2",
5858
"vite": "^5.1.5"

packages/react-components/src/App.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "@bcgov/design-tokens/css/variables.css";
55
import "@bcgov/bc-sans/css/BC_Sans.css";
66

77
import Button from "@/components/Button";
8+
import Footer from "./components/Footer";
89
import Header from "@/components/Header";
910
import useWindowDimensions from "@/hooks/useWindowDimensions";
1011
import { ButtonPage, SelectPage, TagGroupPage } from "@/pages";
@@ -119,6 +120,34 @@ function App() {
119120
<SelectPage />
120121
<TagGroupPage />
121122
</main>
123+
<Footer />
124+
<Footer
125+
acknowledgement={<p>Optional land acknowledgement slot.</p>}
126+
logo={<SvgMenuIcon />}
127+
contact={<p>Optional contact information slot.</p>}
128+
links={
129+
<>
130+
<span className="more-info">Optional links list</span>
131+
<ul>
132+
<li>This is a very long link, far longer than the average</li>
133+
<li>Link</li>
134+
<li>Link</li>
135+
<li>Link</li>
136+
<li>Link</li>
137+
<li>Link</li>
138+
<li>Link</li>
139+
<li>Link</li>
140+
<li>Link</li>
141+
<li>Link</li>
142+
<li>Link</li>
143+
<li>Link</li>
144+
<li>Link</li>
145+
<li>Link</li>
146+
</ul>
147+
</>
148+
}
149+
copyright="Copyright 2025 BC Gov"
150+
/>
122151
</>
123152
);
124153
}

packages/react-components/src/components/Button/Button.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@ import {
66
import "./Button.css";
77

88
export interface ButtonProps extends ReactAriaButtonProps {
9+
/**
10+
* Defaults to `medium`. `small` is shorter vertically.
11+
*/
912
size?: "small" | "medium";
13+
/**
14+
* Defaults to `primary`.
15+
*/
1016
variant?: "primary" | "secondary" | "tertiary" | "link";
17+
/**
18+
* For destructive/deletion actions.
19+
*/
1120
danger?: boolean;
21+
/**
22+
* If true, renders a square button intended for a single icon.
23+
*/
1224
isIconButton?: boolean;
1325
}
1426

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
.bcds-footer {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: stretch;
5+
width: 100%;
6+
}
7+
8+
.bcds-footer > .bcds-footer--acknowledgement {
9+
display: flex;
10+
flex-direction: column;
11+
align-items: center;
12+
justify-content: space-around;
13+
border-top: var(--layout-border-width-large) solid
14+
var(--surface-brand-gold-60);
15+
border-bottom: var(--layout-border-width-large) solid
16+
var(--surface-brand-gold-60);
17+
background-color: var(--surface-brand-gray-110);
18+
width: 100%;
19+
}
20+
21+
.bcds-footer
22+
> .bcds-footer--acknowledgement
23+
> .bcds-footer--acknowledgement-text {
24+
display: flex;
25+
flex-direction: column;
26+
align-items: center;
27+
justify-content: stretch;
28+
color: var(--typography-color-primary-invert);
29+
font: var(--typography-regular-label);
30+
max-width: 1100px;
31+
padding: var(--layout-padding-xlarge);
32+
}
33+
34+
.bcds-footer
35+
> .bcds-footer--acknowledgement
36+
> .bcds-footer--acknowledgement-text
37+
> p {
38+
margin: var(--layout-margin-none);
39+
}
40+
41+
.bcds-footer > .bcds-footer--container {
42+
display: flex;
43+
flex-direction: column;
44+
align-items: center;
45+
justify-content: space-around;
46+
background-color: var(--surface-background-light);
47+
padding: var(--layout-padding-xlarge);
48+
}
49+
50+
.bcds-footer > .bcds-footer--container > .bcds-footer--container-content {
51+
display: flex;
52+
flex-direction: column;
53+
align-items: stretch;
54+
gap: var(--layout-padding-xlarge);
55+
max-width: 1100px;
56+
width: 100%;
57+
}
58+
59+
.bcds-footer
60+
> .bcds-footer--container
61+
> .bcds-footer--container-content
62+
> .bcds-footer--logo-links {
63+
display: flex;
64+
flex-direction: row;
65+
flex-wrap: nowrap;
66+
align-items: flex-start;
67+
column-gap: var(--layout-padding-xlarge);
68+
row-gap: var(--layout-padding-medium);
69+
justify-content: space-between;
70+
width: 100%;
71+
}
72+
73+
.bcds-footer
74+
> .bcds-footer--container
75+
> .bcds-footer--container-content
76+
> .bcds-footer--logo-links
77+
> .bcds-footer--logo {
78+
display: flex;
79+
flex-direction: column;
80+
gap: var(--layout-padding-large);
81+
min-width: 324px;
82+
width: 576px;
83+
}
84+
85+
.bcds-footer
86+
> .bcds-footer--container
87+
> .bcds-footer--container-content
88+
> .bcds-footer--logo-links
89+
> .bcds-footer--logo
90+
> #bcgov-logo-footer {
91+
width: 146px;
92+
min-width: 146px;
93+
}
94+
95+
.bcds-footer
96+
> .bcds-footer--container
97+
> .bcds-footer--container-content
98+
> .bcds-footer--logo-links
99+
> .bcds-footer--logo
100+
> p {
101+
font: var(--typography-regular-label);
102+
margin: var(--layout-margin-none);
103+
}
104+
105+
.bcds-footer
106+
> .bcds-footer--container
107+
> .bcds-footer--container-content
108+
> .bcds-footer--logo-links
109+
> .bcds-footer--logo
110+
> p
111+
> a {
112+
color: var(--typography-color-secondary);
113+
font: var(--typography-regular-label);
114+
text-decoration: underline;
115+
}
116+
117+
.bcds-footer
118+
> .bcds-footer--container
119+
> .bcds-footer--container-content
120+
> .bcds-footer--logo-links
121+
> .bcds-footer--logo
122+
> p
123+
> a:hover {
124+
text-decoration: none;
125+
}
126+
127+
.bcds-footer
128+
> .bcds-footer--container
129+
> .bcds-footer--container-content
130+
> .bcds-footer--logo-links
131+
> .bcds-footer--links
132+
> .more-info {
133+
font: var(--typography-bold-label);
134+
margin-bottom: var(--layout-padding-small);
135+
text-transform: uppercase;
136+
}
137+
138+
.bcds-footer
139+
> .bcds-footer--container
140+
> .bcds-footer--container-content
141+
> .bcds-footer--logo-links
142+
> .bcds-footer--links
143+
> ul {
144+
column-count: 2;
145+
column-width: var(--layout-padding-medium);
146+
list-style: none;
147+
padding: var(--layout-padding-none);
148+
width: 320px;
149+
}
150+
151+
.bcds-footer
152+
> .bcds-footer--container
153+
> .bcds-footer--container-content
154+
> .bcds-footer--logo-links
155+
> .bcds-footer--links
156+
> ul
157+
> li {
158+
font: var(--typography-regular-label);
159+
margin-bottom: var(--layout-padding-small);
160+
}
161+
162+
.bcds-footer
163+
> .bcds-footer--container
164+
> .bcds-footer--container-content
165+
> .bcds-footer--logo-links
166+
> .bcds-footer--links
167+
> ul
168+
> li
169+
> a {
170+
color: var(--typography-color-primary);
171+
text-decoration: none;
172+
}
173+
174+
.bcds-footer
175+
> .bcds-footer--container
176+
> .bcds-footer--container-content
177+
> .bcds-footer--logo-links
178+
> .bcds-footer--links
179+
> ul
180+
> li
181+
> a:hover {
182+
text-decoration: underline;
183+
}
184+
185+
.bcds-footer > .bcds-footer--container > .bcds-footer--container-content > hr {
186+
background-color: var(--surface-border-dark);
187+
border: var(--layout-border-width-none);
188+
height: var(--surface-border-width-small);
189+
margin: var(--layout-margin-none);
190+
width: 100%;
191+
}
192+
193+
p.bcds-footer--copyright {
194+
color: var(--typography-color-secondary);
195+
font: var(--typography-regular-body);
196+
margin: var(--layout-margin-none);
197+
}
198+
199+
/* Tablet - let links drop beneath logo */
200+
@media (max-width: 991px) {
201+
.bcds-footer
202+
> .bcds-footer--container
203+
> .bcds-footer--container-content
204+
> .bcds-footer--logo-links {
205+
flex-wrap: wrap;
206+
}
207+
208+
.bcds-footer
209+
> .bcds-footer--container
210+
> .bcds-footer--container-content
211+
> .bcds-footer--logo-links
212+
> .bcds-footer--logo {
213+
max-width: 324px;
214+
}
215+
}
216+
217+
/* Extra small screens */
218+
@media (max-width: 575px) {
219+
.bcds-footer
220+
> .bcds-footer--acknowledgement
221+
> .bcds-footer--acknowledgement-text {
222+
padding: var(--layout-padding-xlarge) var(--layout-padding-medium);
223+
}
224+
225+
.bcds-footer > .bcds-footer--container {
226+
padding: var(--layout-padding-medium);
227+
}
228+
229+
.bcds-footer > .bcds-footer--container > .bcds-footer--container-content {
230+
gap: var(--layout-padding-medium);
231+
}
232+
233+
.bcds-footer
234+
> .bcds-footer--container
235+
> .bcds-footer--container-content
236+
> .bcds-footer--logo-links
237+
> .bcds-footer--logo {
238+
gap: var(--layout-padding-medium);
239+
}
240+
}

0 commit comments

Comments
 (0)