├── .github
├── ISSUE_TEMPLATE
│ ├── 1-component.yml
│ ├── 2-enhancement.yml
│ ├── 3-bug.yml
│ └── config.yml
└── workflows
│ ├── build_react_component_library_apps.yaml
│ ├── publish_design_tokens.yaml
│ ├── publish_react_component_library.yaml
│ ├── test_design_tokens_build.yaml
│ └── test_react_component_library.yaml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── COMPLIANCE.yaml
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── assets
├── Design-System-v6.xd
└── badge
│ ├── component-draft-blue.png
│ ├── component-draft-blue.svg
│ ├── component-published-green.png
│ └── component-published-green.svg
├── components
├── abbreviations
│ ├── README.md
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── about
│ ├── about.md
│ ├── accessibility.md
│ ├── browser_support_guidance.md
│ ├── component_workflow.md
│ ├── propose_a_component.md
│ └── prototyping_tools.md
├── alert_banners
│ ├── README.md
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── assets
│ ├── images
│ │ ├── BCID_H_rgb_rev.svg
│ │ ├── BC_Logo_Horizontal.svg
│ │ ├── logo-banner.png
│ │ ├── logo-banner.svg
│ │ └── logo.svg
│ └── unsupported-browsers
│ │ ├── chrome-icon.png
│ │ ├── edge-icon.png
│ │ ├── firefox-icon.png
│ │ ├── ie-error-graphic.png
│ │ └── safari-icon.png
├── beta
│ ├── README.md
│ ├── images
│ │ └── beta-status-bc.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── callout
│ ├── callout.md
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── checkbox
│ ├── README.md
│ ├── images
│ │ └── checkbox.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── date_input
│ ├── README.md
│ ├── images
│ │ └── date_input.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── disabled_button
│ ├── README.md
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── dropdown
│ ├── README.md
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── footer
│ ├── README.md
│ ├── images
│ │ └── footer.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── forms
│ ├── Form-structure.png
│ ├── README.md
│ └── optional-example.png
├── header
│ ├── README.md
│ ├── images
│ │ └── header.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── link
│ ├── README.md
│ ├── images
│ │ └── link.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── navbar
│ ├── README.md
│ ├── images
│ │ ├── navbar.gif
│ │ ├── screenshot 1.png
│ │ ├── screenshot 2.png
│ │ └── screenshot 3.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── primary_button
│ ├── README.md
│ ├── images
│ │ └── primary_button.png
│ ├── index-dark.html
│ ├── index.html
│ ├── sample-dark.html
│ ├── sample.html
│ ├── style-dark.css
│ └── style.css
├── radio
│ ├── README.md
│ ├── images
│ │ └── radio.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── secondary_button
│ ├── README.md
│ ├── index-dark.html
│ ├── index.html
│ ├── sample-dark.html
│ ├── sample.html
│ ├── style-dark.css
│ └── style.css
├── table
│ ├── README.md
│ ├── images
│ │ └── table.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── text_input
│ ├── README.md
│ ├── images
│ │ ├── dummy.md
│ │ └── text_input.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
└── textarea
│ ├── README.md
│ ├── images
│ ├── dummy
│ └── textarea.png
│ ├── index.html
│ ├── sample.html
│ └── style.css
├── packages
├── design-tokens
│ ├── .gitignore
│ ├── .nvmrc
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── build-output.js
│ ├── build-output.test.js
│ ├── build
│ │ ├── .gitignore
│ │ ├── cjs-prefixed
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ ├── cjs
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ ├── css-prefixed
│ │ │ └── variables.css
│ │ ├── css
│ │ │ └── variables.css
│ │ ├── js-prefixed
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ └── js
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ ├── dist
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── cjs-prefixed
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ ├── cjs
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ ├── css-prefixed
│ │ │ └── variables.css
│ │ ├── css
│ │ │ └── variables.css
│ │ ├── js-prefixed
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ ├── js
│ │ │ ├── index.d.ts
│ │ │ └── index.js
│ │ └── package.json
│ ├── input
│ │ ├── README.md
│ │ └── tokens.json
│ ├── package-lock.json
│ ├── package.json
│ ├── run-build.sh
│ ├── run-prepare-npm-package.sh
│ ├── run-publish-npm-package.sh
│ └── tmp.199.json
└── react-components
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── .nvmrc
│ ├── .storybook
│ ├── bcdsTheme.js
│ ├── global.css
│ ├── main.ts
│ ├── manager.js
│ ├── preview.ts
│ └── test-runner.ts
│ ├── CHANGELOG.md
│ ├── Dockerfile.storybook
│ ├── Dockerfile.vite
│ ├── README.md
│ ├── index.html
│ ├── jest.config.ts
│ ├── nginx.storybook.conf
│ ├── nginx.vite.conf
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ └── vite.svg
│ ├── rollup.config.js
│ ├── src
│ ├── App.css
│ ├── App.tsx
│ ├── Changelog.mdx
│ ├── assets
│ │ ├── BCID_H_rgb_pos.svg
│ │ ├── close.svg
│ │ ├── icon-exclamation.svg
│ │ ├── icon-menu.svg
│ │ ├── icon-placeholder.svg
│ │ └── tooltip-arrow-up.svg
│ ├── components
│ │ ├── Accordion
│ │ │ ├── Accordion.css
│ │ │ ├── Accordion.tsx
│ │ │ └── index.ts
│ │ ├── AccordionGroup
│ │ │ ├── AccordionGroup.css
│ │ │ ├── AccordionGroup.tsx
│ │ │ └── index.ts
│ │ ├── AlertBanner
│ │ │ ├── AlertBanner.css
│ │ │ ├── AlertBanner.tsx
│ │ │ └── index.ts
│ │ ├── AlertDialog
│ │ │ ├── AlertDialog.css
│ │ │ ├── AlertDialog.test.tsx
│ │ │ ├── AlertDialog.tsx
│ │ │ └── index.ts
│ │ ├── Button
│ │ │ ├── Button.css
│ │ │ ├── Button.test.tsx
│ │ │ ├── Button.tsx
│ │ │ └── index.ts
│ │ ├── ButtonGroup
│ │ │ ├── ButtonGroup.css
│ │ │ ├── ButtonGroup.test.tsx
│ │ │ ├── ButtonGroup.tsx
│ │ │ └── index.ts
│ │ ├── Callout
│ │ │ ├── Callout.css
│ │ │ ├── Callout.tsx
│ │ │ └── index.ts
│ │ ├── Checkbox
│ │ │ ├── Checkbox.css
│ │ │ ├── Checkbox.test.tsx
│ │ │ ├── Checkbox.tsx
│ │ │ └── index.ts
│ │ ├── CheckboxGroup
│ │ │ ├── CheckboxGroup.css
│ │ │ ├── CheckboxGroup.test.tsx
│ │ │ ├── CheckboxGroup.tsx
│ │ │ └── index.ts
│ │ ├── Dialog
│ │ │ ├── Dialog.css
│ │ │ ├── Dialog.test.tsx
│ │ │ ├── Dialog.tsx
│ │ │ └── index.ts
│ │ ├── Footer
│ │ │ ├── Footer.css
│ │ │ ├── Footer.test.tsx
│ │ │ ├── Footer.tsx
│ │ │ └── index.ts
│ │ ├── Form
│ │ │ ├── Form.test.tsx
│ │ │ ├── Form.tsx
│ │ │ └── index.ts
│ │ ├── Header
│ │ │ ├── Header.css
│ │ │ ├── Header.test.tsx
│ │ │ ├── Header.tsx
│ │ │ └── index.ts
│ │ ├── Heading
│ │ │ ├── Heading.css
│ │ │ ├── Heading.tsx
│ │ │ └── index.ts
│ │ ├── Icons
│ │ │ ├── SvgBcLogo
│ │ │ │ ├── SvgBcLogo.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgBcOutlineIcon
│ │ │ │ ├── SvgBcOutlineIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgBetaIcon
│ │ │ │ ├── SvgBetaIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgCheckCircleIcon
│ │ │ │ ├── SvgCheckCircleIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgCheckIcon
│ │ │ │ ├── SvgCheckIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgChevronDownIcon
│ │ │ │ ├── SvgChevronDownIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgChevronUpIcon
│ │ │ │ ├── SvgChevronUpIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgCloseIcon
│ │ │ │ ├── SvgCloseIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgDashIcon
│ │ │ │ ├── SvgDashIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgExclamationCircleIcon
│ │ │ │ ├── SvgExclamationCircleIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgExclamationIcon
│ │ │ │ ├── SvgExclamationIcon.tsx
│ │ │ │ └── index.ts
│ │ │ ├── SvgInfoIcon
│ │ │ │ ├── SvgInfoIcon.tsx
│ │ │ │ └── index.ts
│ │ │ └── SvgTooltipArrowUp
│ │ │ │ ├── SvgTooltipArrowUp.tsx
│ │ │ │ └── index.ts
│ │ ├── InlineAlert
│ │ │ ├── InlineAlert.css
│ │ │ ├── InlineAlert.test.tsx
│ │ │ ├── InlineAlert.tsx
│ │ │ └── index.ts
│ │ ├── Link
│ │ │ ├── Link.css
│ │ │ ├── Link.tsx
│ │ │ └── index.ts
│ │ ├── Modal
│ │ │ ├── Modal.css
│ │ │ ├── Modal.test.tsx
│ │ │ ├── Modal.tsx
│ │ │ └── index.ts
│ │ ├── Radio
│ │ │ ├── Radio.css
│ │ │ ├── Radio.test.tsx
│ │ │ ├── Radio.tsx
│ │ │ └── index.ts
│ │ ├── RadioGroup
│ │ │ ├── RadioGroup.css
│ │ │ ├── RadioGroup.test.tsx
│ │ │ ├── RadioGroup.tsx
│ │ │ └── index.ts
│ │ ├── Select
│ │ │ ├── Select.css
│ │ │ ├── Select.tsx
│ │ │ └── index.ts
│ │ ├── Switch
│ │ │ ├── Switch.css
│ │ │ ├── Switch.test.tsx
│ │ │ ├── Switch.tsx
│ │ │ └── index.ts
│ │ ├── Tag
│ │ │ ├── Tag.css
│ │ │ ├── Tag.tsx
│ │ │ └── index.ts
│ │ ├── TagGroup
│ │ │ ├── TagGroup.css
│ │ │ ├── TagGroup.tsx
│ │ │ └── index.ts
│ │ ├── TagList
│ │ │ ├── TagList.css
│ │ │ ├── TagList.tsx
│ │ │ └── index.ts
│ │ ├── Text
│ │ │ ├── Text.css
│ │ │ ├── Text.tsx
│ │ │ └── index.ts
│ │ ├── TextArea
│ │ │ ├── TextArea.css
│ │ │ ├── TextArea.tsx
│ │ │ └── index.ts
│ │ ├── TextField
│ │ │ ├── TextField.css
│ │ │ ├── TextField.tsx
│ │ │ └── index.ts
│ │ ├── Tooltip
│ │ │ ├── Tooltip.css
│ │ │ ├── Tooltip.tsx
│ │ │ └── index.ts
│ │ └── index.ts
│ ├── hooks
│ │ └── useWindowDimensions.ts
│ ├── index.ts
│ ├── main.tsx
│ ├── pages
│ │ ├── AccordionGroup
│ │ │ ├── AccordionGroup.tsx
│ │ │ └── index.ts
│ │ ├── AlertBanner
│ │ │ ├── AlertBanner.tsx
│ │ │ └── index.ts
│ │ ├── Button
│ │ │ ├── Button.tsx
│ │ │ ├── ButtonDanger.tsx
│ │ │ ├── ButtonLink.tsx
│ │ │ ├── ButtonPrimary.tsx
│ │ │ ├── ButtonSecondary.tsx
│ │ │ ├── ButtonTertiary.tsx
│ │ │ └── index.ts
│ │ ├── ButtonGroup
│ │ │ ├── ButtonGroup.tsx
│ │ │ └── index.ts
│ │ ├── Callout
│ │ │ ├── Callout.tsx
│ │ │ └── index.ts
│ │ ├── CheckboxGroup
│ │ │ ├── CheckboxGroup.tsx
│ │ │ └── index.ts
│ │ ├── InlineAlert
│ │ │ ├── InlineAlert.tsx
│ │ │ └── index.ts
│ │ ├── ModalDialog
│ │ │ ├── ModalDialog.tsx
│ │ │ └── index.ts
│ │ ├── RadioGroup
│ │ │ ├── RadioGroup.tsx
│ │ │ └── index.ts
│ │ ├── Select
│ │ │ ├── Select.tsx
│ │ │ ├── UseStateExample.tsx
│ │ │ └── index.ts
│ │ ├── Switch
│ │ │ ├── Switch.tsx
│ │ │ └── index.ts
│ │ ├── TagGroup
│ │ │ ├── Disabled.tsx
│ │ │ ├── Horizontal.tsx
│ │ │ ├── NonRemovable.tsx
│ │ │ ├── TagGroup.tsx
│ │ │ ├── Vertical.tsx
│ │ │ ├── data.json
│ │ │ └── index.ts
│ │ ├── TextArea
│ │ │ ├── TextArea.tsx
│ │ │ └── index.ts
│ │ ├── TextField
│ │ │ ├── TextField.tsx
│ │ │ └── index.ts
│ │ ├── TextPage
│ │ │ ├── TextPage.tsx
│ │ │ └── index.ts
│ │ ├── Tooltip
│ │ │ ├── Tooltip.tsx
│ │ │ └── index.ts
│ │ └── index.ts
│ ├── stories
│ │ ├── Accordion.stories.tsx
│ │ ├── AccordionGroup.mdx
│ │ ├── AccordionGroup.stories.tsx
│ │ ├── AlertBanner.mdx
│ │ ├── AlertBanner.stories.tsx
│ │ ├── AlertDialog.mdx
│ │ ├── AlertDialog.stories.tsx
│ │ ├── Button.mdx
│ │ ├── Button.stories.tsx
│ │ ├── ButtonGroup.mdx
│ │ ├── ButtonGroup.stories.tsx
│ │ ├── Callout.mdx
│ │ ├── Callout.stories.tsx
│ │ ├── Checkbox.stories.tsx
│ │ ├── CheckboxGroup.mdx
│ │ ├── CheckboxGroup.stories.tsx
│ │ ├── Dialog.stories.tsx
│ │ ├── Dialogs.mdx
│ │ ├── Footer.mdx
│ │ ├── Footer.stories.tsx
│ │ ├── Form.css
│ │ ├── Form.mdx
│ │ ├── Form.stories.tsx
│ │ ├── Header.mdx
│ │ ├── Header.stories.tsx
│ │ ├── Heading.mdx
│ │ ├── Heading.stories.tsx
│ │ ├── InlineAlert.mdx
│ │ ├── InlineAlert.stories.tsx
│ │ ├── Introduction.mdx
│ │ ├── Link.mdx
│ │ ├── Link.stories.tsx
│ │ ├── Modal.stories.tsx
│ │ ├── RadioGroup.mdx
│ │ ├── RadioGroup.stories.tsx
│ │ ├── Select.mdx
│ │ ├── Select.stories.tsx
│ │ ├── Switch.mdx
│ │ ├── Switch.stories.tsx
│ │ ├── Tag.stories.tsx
│ │ ├── TagGroup.mdx
│ │ ├── TagGroup.stories.tsx
│ │ ├── TagList.stories.tsx
│ │ ├── Text.mdx
│ │ ├── Text.stories.tsx
│ │ ├── TextArea.mdx
│ │ ├── TextArea.stories.tsx
│ │ ├── TextField.mdx
│ │ ├── TextField.stories.tsx
│ │ ├── Tooltip.mdx
│ │ └── Tooltip.stories.tsx
│ └── vite-env.d.ts
│ ├── storybook-public
│ └── BCID_H_rgb_pos.svg
│ ├── tsconfig.json
│ ├── tsconfig.vite.json
│ └── vite.config.ts
└── styles
├── Icons
├── icon-contrast.png
├── icon-label.png
├── icon-pngs
│ ├── bars-solid.png
│ ├── chevron-down-solid.png
│ ├── chevron-left-solid.png
│ ├── chevron-right-solid.png
│ ├── chevron-up-solid.png
│ ├── envelope-solid.png
│ ├── external-link-alt-solid.png
│ ├── phone-solid.png
│ ├── search.png
│ └── upload-solid.png
├── icon-svgs
│ ├── bars-solid.svg
│ ├── chevron-down-solid.svg
│ ├── chevron-left-solid.svg
│ ├── chevron-right-solid.svg
│ ├── chevron-up-solid.svg
│ ├── envelope-solid.svg
│ ├── external-link-alt-solid.svg
│ ├── phone-solid.svg
│ ├── search.svg
│ └── upload-solid.svg
├── icons.md
└── target-area.png
├── colours
├── colourpalette.md
└── images
│ ├── 002663.png
│ ├── 003366.png
│ ├── 1a5a96.png
│ ├── 38598a.png
│ ├── 481124.png
│ ├── 486446.png
│ ├── 494949.png
│ ├── 5091cd.png
│ ├── 5475a7.png
│ ├── 616265.png
│ ├── 8a9198.png
│ ├── 96c0e6.png
│ ├── a12622.png
│ ├── afafaf.png
│ ├── bcbec5.png
│ ├── d0d0d1.png
│ ├── d8292f.png
│ ├── f2f2f2.png
│ ├── f3bd48.png
│ ├── f3cd65.png
│ ├── fade81.png
│ ├── fcba19.png
│ └── ffffff.png
└── typography
├── fonts
├── BCSans-Bold.css
├── BCSans-Bold.eot
├── BCSans-Bold.otf
├── BCSans-Bold.ttf
├── BCSans-Bold.woff
├── BCSans-Bold.woff2
├── BCSans-BoldItalic.css
├── BCSans-BoldItalic.eot
├── BCSans-BoldItalic.otf
├── BCSans-BoldItalic.ttf
├── BCSans-BoldItalic.woff
├── BCSans-BoldItalic.woff2
├── BCSans-Italic.css
├── BCSans-Italic.eot
├── BCSans-Italic.otf
├── BCSans-Italic.ttf
├── BCSans-Italic.woff
├── BCSans-Italic.woff2
├── BCSans-Regular.css
├── BCSans-Regular.eot
├── BCSans-Regular.otf
├── BCSans-Regular.ttf
├── BCSans-Regular.woff
├── BCSans-Regular.woff2
├── FONTLOG_README.txt
└── LICENSE_OFL.txt
├── header-sample.html
├── paragraph-sample.html
└── typography.md
/.github/ISSUE_TEMPLATE/1-component.yml:
--------------------------------------------------------------------------------
1 | name: New component
2 | description: Propose a new component to be added to the design system
3 | labels: ["component"]
4 | projects: ["bcgov/121"]
5 | assignees:
6 | - mkernohanbc
7 | body:
8 | - type: markdown
9 | attributes:
10 | value: |
11 | We evaluate prospective new components based on:
12 | * Demonstrable impact in terms of functionality or usability of government digital service
13 | * Evidence that the functional need can't be met using existing components
14 | * Demand from the user community
15 | - type: input
16 | id: name
17 | attributes:
18 | label: Component name
19 | description: A short, descriptive name for this component
20 | validations:
21 | required: true
22 | - type: textarea
23 | id: description
24 | attributes:
25 | label: Description
26 | description: Summary of what the component does, and its expected behaviour
27 | validations:
28 | required: true
29 | - type: textarea
30 | id: rationale
31 | attributes:
32 | label: Rationale
33 | description: Brief explanation of why this component is required, and how it will enhance application or service functionality and usability
34 | validations:
35 | required: true
36 | - type: textarea
37 | id: additional
38 | attributes:
39 | label: Additional information
40 | description: Links to any examples, research or code to support your proposal, if available
41 | validations:
42 | required: true
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2-enhancement.yml:
--------------------------------------------------------------------------------
1 | name: Enhancement
2 | description: Suggest a change to how an existing component looks or behaves
3 | labels: ["enhancement"]
4 | projects: ["bcgov/121"]
5 | assignees:
6 | - mkernohanbc
7 | body:
8 | - type: markdown
9 | attributes:
10 | value: |
11 | We evaluate prospective enhancements based on:
12 | * Demonstrable impact in terms of functionality or usability of government digital service
13 | * Technical complexity and impact on existing services
14 | * Demand from the user community
15 | - type: input
16 | id: name
17 | attributes:
18 | label: Related component
19 | description: Which component does this proposed enhancement affect?
20 | validations:
21 | required: true
22 | - type: textarea
23 | id: description
24 | attributes:
25 | label: Description
26 | description: Describe the proposed change
27 | validations:
28 | required: true
29 | - type: textarea
30 | id: rationale
31 | attributes:
32 | label: Rationale
33 | description: Explain why you are proposing this change, and the expected benefit to the user
34 | validations:
35 | required: true
36 | - type: textarea
37 | id: additional
38 | attributes:
39 | label: Additional information
40 | description: Links to any examples, research or code to support your proposal, if available
41 | validations:
42 | required: true
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3-bug.yml:
--------------------------------------------------------------------------------
1 | name: Bug
2 | description: Report an error or unexpected behaviour in a component
3 | labels: ["bug"]
4 | projects: ["bcgov/121"]
5 | assignees:
6 | - mkernohanbc
7 | body:
8 | - type: markdown
9 | attributes:
10 | value: |
11 | Thanks for taking the time to fill out this bug report! Please provide as much information as possible, including screenshots if possible.
12 | - type: input
13 | id: component
14 | attributes:
15 | label: Component
16 | description: Which component does this bug affect?
17 | validations:
18 | required: true
19 | - type: textarea
20 | id: description
21 | attributes:
22 | label: Description
23 | description: Describe the error or unexpected behaviour you observed, and provide screenshots if possible
24 | placeholder: Tell us what's going wrong
25 | validations:
26 | required: true
27 | - type: textarea
28 | id: reproduction
29 | attributes:
30 | label: Steps to reproduce
31 | description: Describe the circumstances under which the bug occurs
32 | placeholder: What were you doing when the bug occurred?
33 | validations:
34 | required: true
35 | - type: textarea
36 | id: technical
37 | attributes:
38 | label: Technical information
39 | description: What browsers or platforms does the bug affect?
40 | placeholder: Desktop or mobile? All browsers, or only one?
41 | validations:
42 | required: true
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 |
--------------------------------------------------------------------------------
/.github/workflows/test_design_tokens_build.yaml:
--------------------------------------------------------------------------------
1 | name: Test design tokens build script
2 |
3 | on:
4 | pull_request:
5 | paths:
6 | - packages/design-tokens/**
7 | workflow_dispatch:
8 |
9 | # Cancel any currently running builds to save GitHub Actions hours.
10 | concurrency:
11 | group: ${{ github.workflow }}-${{ github.ref }}
12 | cancel-in-progress: true
13 |
14 | jobs:
15 | run-tests:
16 | name: Run tests
17 | runs-on: ubuntu-latest
18 |
19 | steps:
20 | - name: Checkout code
21 | uses: actions/checkout@v4
22 |
23 | - name: Read .nvmrc
24 | run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
25 | working-directory: ./packages/design-tokens
26 |
27 | - name: Set up Node.js
28 | uses: actions/setup-node@v4
29 | with:
30 | node-version: ${{ env.GITHUB_NVMRC_VERSION }}
31 |
32 | - name: Install dependencies
33 | run: npm install
34 | working-directory: ./packages/design-tokens
35 |
36 | - name: Run test suite with npm script
37 | run: npm run test
38 | working-directory: ./packages/design-tokens
39 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 |
--------------------------------------------------------------------------------
/COMPLIANCE.yaml:
--------------------------------------------------------------------------------
1 | name: compliance
2 | description: |
3 | This document is used to track a project's PIA and STRA
4 | compliance.
5 | spec:
6 | - name: PIA
7 | status: TBD
8 | last-updated: '2020-10-02T00:00:00.000Z'
9 | - name: STRA
10 | status: TBD
11 | last-updated: '2020-10-02T00:00:00.000Z'
12 |
--------------------------------------------------------------------------------
/assets/Design-System-v6.xd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/assets/Design-System-v6.xd
--------------------------------------------------------------------------------
/assets/badge/component-draft-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/assets/badge/component-draft-blue.png
--------------------------------------------------------------------------------
/assets/badge/component-draft-blue.svg:
--------------------------------------------------------------------------------
1 | component component draft draft
--------------------------------------------------------------------------------
/assets/badge/component-published-green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/assets/badge/component-published-green.png
--------------------------------------------------------------------------------
/assets/badge/component-published-green.svg:
--------------------------------------------------------------------------------
1 | component component published published
--------------------------------------------------------------------------------
/components/abbreviations/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Abbreviations
8 |
9 |
10 |
11 | On September 1, 2018, the Affordable Child Care Benefit (ACCB) replaced the Child Care Subsidy. Parents who need financial help with childcare should apply for the new ACCB
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/abbreviations/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Abbreviations
8 |
9 |
17 |
18 |
19 | On September 1, 2018, the Affordable Child Care Benefit (ACCB) replaced the Child Care Subsidy. Parents who need financial help with childcare should apply for the new ACCB
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/components/abbreviations/style.css:
--------------------------------------------------------------------------------
1 | p {
2 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
3 | font-size: 18px;
4 | line-height: 1.6;
5 | color: #313132;
6 | }
7 |
--------------------------------------------------------------------------------
/components/about/accessibility.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Accessibility considerations in the design system
3 | title: Accessibility
4 | author: orinevares
5 | ---
6 |
7 | ## Accessibility
8 |
9 | The [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG20/) are the internationally recognized guidelines for web accessibility. The Province is committed to meeting WCAG 2.0 and 2.1 Level AA. All design system components meet or exceed these standards.
10 |
11 | Visit the [Accessibility and Inclusion Toolkit](https://www2.gov.bc.ca/gov/content?id=5D5C4759BC7E494AB9E8EDB7AD3D3D78)
12 | for information on how to create accessible content.
13 |
--------------------------------------------------------------------------------
/components/about/prototyping_tools.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: How to use the design system prototyping libraries
3 | title: Prototype with the Design System
4 | author: orinevares
5 | ---
6 |
7 | # Prototype with the Design System
8 |
9 | ## Adobe XD
10 | 
11 |
12 | The design system components have been created in Adobe XD by a community member to use for mockups and prototyping.
13 | [Download XD File](https://github.com/bcgov/design-system/raw/main/assets/Design-System-v6.xd)
14 |
15 | A Figma template is also being started [here](https://github.com/bcgov/figma).
16 |
--------------------------------------------------------------------------------
/components/alert_banners/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Alert Banners
9 |
10 |
11 |
12 |
13 |
The email address cannot be empty.
14 |
15 |
16 |
19 |
20 |
21 |
The deadline for submission has been extended to March 1, 2020.
22 |
23 |
24 |
25 |
Your application has been successfully submitted.
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/components/alert_banners/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'BC Sans', 'Noto Sans', Arial, 'sans serif';
3 | color: #313132;
4 | font-size: 16px;
5 | line-height: 1.5em;
6 | }
7 |
8 | a {
9 | text-decoration: underline;
10 | }
11 |
12 | .bc-gov-alertbanner {
13 | border: 1px solid transparent;
14 | border-radius: 4px;
15 | font-weight: 700;
16 | margin-bottom: 20px;
17 | padding: 15px;
18 | }
19 |
20 | .bc-gov-alertbanner:before {
21 | float: left;
22 | font-family: 'Font Awesome 5 Free';
23 | font-size: larger;
24 | font-style: normal;
25 | line-height: 1;
26 | margin-right: 10px;
27 | position: relative;
28 | top: 3px;
29 | -moz-osx-font-smoothing: grayscale;
30 | -webkit-font-smoothing: antialiased;
31 | }
32 |
33 | .bc-gov-alertbanner p {
34 | font-size: 18px;
35 | margin: 0;
36 | padding-left: 35px;
37 | }
38 |
39 | .bc-gov-alertbanner-error {
40 | background-color: #f2dede;
41 | border-color: #ebccd1;
42 | color: #a12622;
43 | }
44 |
45 | .bc-gov-alertbanner-error:before {
46 | content: "\f06a";
47 | }
48 |
49 | .bc-gov-alertbanner-error a {
50 | color: #843534;
51 | }
52 |
53 | .bc-gov-alertbanner-warning {
54 | background-color: #f9f1c6;
55 | border-color: #faebcc;
56 | color: #6c4a00;
57 | }
58 |
59 | .bc-gov-alertbanner-warning:before {
60 | content: "\f071";
61 | }
62 |
63 | .bc-gov-alertbanner-warning a {
64 | color: #66512c;
65 | }
66 |
67 | .bc-gov-alertbanner-info {
68 | background-color: #d9eaf7;
69 | }
70 |
71 | .bc-gov-alertbanner-info:before {
72 | content: "\f05a";
73 | }
74 |
75 | .bc-gov-alertbanner-info a {
76 | color: #1a5a96;
77 | }
78 |
79 | .bc-gov-alertbanner-success {
80 | background-color: #dff0d8;
81 | border-color: #d6e9c6;
82 | color: #2d4821;
83 | }
84 |
85 | .bc-gov-alertbanner-success:before {
86 | content: "\f058";
87 | }
88 |
89 | .bc-gov-alertbanner-success a {
90 | color: #2b542c;
91 | }
92 |
--------------------------------------------------------------------------------
/components/assets/images/logo-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/images/logo-banner.png
--------------------------------------------------------------------------------
/components/assets/unsupported-browsers/chrome-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/unsupported-browsers/chrome-icon.png
--------------------------------------------------------------------------------
/components/assets/unsupported-browsers/edge-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/unsupported-browsers/edge-icon.png
--------------------------------------------------------------------------------
/components/assets/unsupported-browsers/firefox-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/unsupported-browsers/firefox-icon.png
--------------------------------------------------------------------------------
/components/assets/unsupported-browsers/ie-error-graphic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/unsupported-browsers/ie-error-graphic.png
--------------------------------------------------------------------------------
/components/assets/unsupported-browsers/safari-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/assets/unsupported-browsers/safari-icon.png
--------------------------------------------------------------------------------
/components/beta/images/beta-status-bc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/beta/images/beta-status-bc.png
--------------------------------------------------------------------------------
/components/beta/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Beta Indicator
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Hello British Columbia
21 |
22 | Beta
23 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/components/beta/style.css:
--------------------------------------------------------------------------------
1 | header {
2 | background-color: #036;
3 | border-bottom: 2px solid #fcba19;
4 | padding: 0 65px 0 65px;
5 | color: #fff;
6 | display: flex;
7 | height: 65px;
8 | top: 0px;
9 | position: fixed;
10 | width: 100%;
11 | }
12 |
13 | header h1 {
14 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
15 | font-weight: normal; /* 400 */
16 | margin: 5px 5px 0 18px;
17 | visibility: hidden;
18 | }
19 |
20 | header .banner {
21 | display: flex;
22 | justify-content: flex-start;
23 | align-items: center;
24 | margin: 0 10px 0 0;
25 | /* border-style: dotted;
26 | border-width: 1px;
27 | border-color: lightgrey; */
28 | }
29 |
30 | header .other {
31 | display: flex;
32 | flex-grow: 1;
33 | /* border-style: dotted;
34 | border-width: 1px;
35 | border-color: lightgrey; */
36 | }
37 |
38 | .Beta-PhaseBanner {
39 | color: #fcba19;
40 | margin-top: -1em;
41 | text-transform: uppercase;
42 | font-weight: 600;
43 | font-size: 16px;
44 | }
45 |
46 | :focus {
47 | outline: 4px solid #3B99FC;
48 | outline-offset: 1px;
49 | }
50 |
51 | /*
52 | These are sample media queries only. Media queries are quite subjective
53 | but, in general, should be made for the three different classes of screen
54 | size: phone, tablet, full.
55 | */
56 |
57 | @media screen and (min-width: 600px) and (max-width: 899px) {
58 | header h1 {
59 | font-size: calc(7px + 2.2vw);
60 | visibility: visible;
61 | }
62 | }
63 |
64 | @media screen and (min-width: 900px) {
65 | header h1 {
66 | font-size: 2.0em;
67 | visibility: visible;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/components/callout/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sample Callout
6 |
7 |
8 |
9 |
By March 1, 2018, eligible residents of B.C. are expected to renew enrolment in the Medical Services Plan (MSP) and get a BC Services Card.
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/components/callout/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sample Callout
6 |
7 |
24 |
25 |
26 |
By March 1, 2018, eligible residents of B.C. are expected to renew enrolment in the Medical Services Plan (MSP) and get a BC Services Card.
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/components/callout/style.css:
--------------------------------------------------------------------------------
1 | .bcgov-callout {
2 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
3 | font-weight: 400;
4 | line-height: 1.6;
5 | font-size: 18px;
6 | color: #313132;
7 | padding: 25px;
8 | border-left: 10px solid #38598a;
9 | margin: 16px 0;
10 | background-color: #f2f2f2;
11 | }
12 |
13 | .bcgov-callout, h1, h2, h3, h4 {
14 | margin: 0;
15 | }
16 |
--------------------------------------------------------------------------------
/components/checkbox/images/checkbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/checkbox/images/checkbox.png
--------------------------------------------------------------------------------
/components/checkbox/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Checkbox
8 |
9 |
10 |
11 | This is a selected checkbox
12 |
13 |
14 |
15 |
16 | This is an unselected checkbox
17 |
18 |
19 |
20 |
21 | This is an unselected checkbox
22 |
23 |
24 |
25 |
26 | This is an unselected checkbox
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/components/checkbox/style.css:
--------------------------------------------------------------------------------
1 | /* Customize the label (the container) */
2 | .checkbox {
3 | display: block;
4 | position: relative;
5 | padding-left: 25px;
6 | margin-bottom: 12px;
7 | cursor: pointer;
8 | Font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
9 | font-size: 18px;
10 | -webkit-user-select: none;
11 | -moz-user-select: none;
12 | -ms-user-select: none;
13 | user-select: none;
14 | }
15 |
16 | /* Hide the browser's default checkbox */
17 | .checkbox input {
18 | position: absolute;
19 | opacity: 0;
20 | cursor: pointer;
21 | height: 0;
22 | width: 0;
23 | }
24 |
25 | /* Create a custom checkbox */
26 | .checkmark {
27 | position: absolute;
28 | top: 3px;
29 | left: 0;
30 | height: 18px;
31 | width: 18px;
32 | outline: 2px solid #606060;
33 | }
34 |
35 | /* When the checkbox is checked, add a blue background */
36 | .checkbox input:checked ~ .checkmark {
37 | background-color: #606060;
38 | }
39 |
40 | /* Custom checkbox has blue outline when in focus */
41 | .checkbox input:focus ~ .checkmark {
42 | outline: 4px solid #3B99FC;
43 | }
44 |
45 | /* Create the checkmark/indicator (hidden when not checked) */
46 | .checkmark:after {
47 | content: "\2713";
48 | color: white;
49 | position: absolute;
50 | left: 50%;
51 | top: 50%;
52 | transform: translate(-50%, -50%);
53 | display: none;
54 | }
55 |
56 | /* Show the checkmark when checked */
57 | .checkbox input:checked ~ .checkmark:after {
58 | display: block;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/components/date_input/images/date_input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/date_input/images/date_input.png
--------------------------------------------------------------------------------
/components/date_input/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Text Input
8 |
9 |
10 |
11 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/components/date_input/style.css:
--------------------------------------------------------------------------------
1 | form {
2 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
3 | font-size: 16px;
4 | display: flex;
5 | }
6 |
7 | .date_input_day, .date_input_month {
8 | height: 25px;
9 | border: 2px solid #606060;
10 | margin-top: 5px;
11 | margin-bottom: 15px;
12 | border-radius: 4px;
13 | padding: 5px;
14 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
15 | font-size: 16px;
16 | width: 32px;
17 | }
18 |
19 | .date_input_year {
20 | height: 25px;
21 | border: 2px solid #606060;
22 | margin-top: 5px;
23 | margin-bottom: 15px;
24 | border-radius: 4px;
25 | padding: 5px;
26 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
27 | font-size: 16px;
28 | width: 64px;
29 | }
30 |
31 | .date_input_day[type="text"]:focus {
32 | outline: 4px solid #3B99FC;
33 | outline-offset: 1px;
34 | }
35 |
36 | .date_input_month[type="text"]:focus {
37 | outline: 4px solid #3B99FC;
38 | outline-offset: 1px;
39 | }
40 |
41 | .date_input_year[type="text"]:focus {
42 | outline: 4px solid #3B99FC;
43 | outline-offset: 1px;
44 | }
45 |
46 | .text_label {
47 | display: flex;
48 | }
49 |
50 | .date_field {
51 | margin-right: 20px;
52 | }
53 |
--------------------------------------------------------------------------------
/components/disabled_button/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button
8 |
9 |
10 | Submit
11 | Cancel
12 |
13 |
14 |
--------------------------------------------------------------------------------
/components/disabled_button/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button
8 |
9 |
45 |
46 | Submit
47 | Cancel
48 |
49 |
50 |
--------------------------------------------------------------------------------
/components/disabled_button/style.css:
--------------------------------------------------------------------------------
1 | .BC-Gov-PrimaryButton-disabled {
2 | background-color: #003366;
3 | opacity: 0.3;
4 | border: none;
5 | border-radius: 4px;
6 | color: white;
7 | padding: 12px 32px;
8 | text-align: center;
9 | text-decoration: none;
10 | display: block;
11 | font-size: 18px;
12 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
13 | font-weight: 700;
14 | letter-spacing: 1px;
15 | cursor: not-allowed;
16 | }
17 |
18 | .BC-Gov-SecondaryButton-disabled {
19 | background-color: white;
20 | opacity: 0.3;
21 | border: 2px solid #003366;
22 | border-radius: 4px;
23 | color: #003366;
24 | padding: 10px 30px;
25 | text-align: center;
26 | text-decoration: none;
27 | display: block;
28 | font-size: 18px;
29 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
30 | font-weight: 700;
31 | letter-spacing: 1px;
32 | cursor: not-allowed;
33 | }
34 |
--------------------------------------------------------------------------------
/components/dropdown/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Dropdown
9 |
10 |
11 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/components/dropdown/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: "Noto Sans", Verdana, Arial, sans-serif;
3 | font-size: 18px;
4 | }
5 |
6 | .bc-gov-form {
7 | display: flex;
8 | flex-direction: column;
9 | align-items: flex-start;
10 | }
11 |
12 | .bc-gov-dropdown-label {
13 | margin-bottom: 10px;
14 | }
15 |
16 | .bc-gov-dropdown {
17 | font-family: "Noto Sans", Verdana, Arial, sans-serif;
18 | font-size: 18px;
19 | color: #313132;
20 | background: white;
21 | box-shadow: none;
22 | border: 2px solid #606060;
23 | min-width: 200px;
24 | padding: 8px 45px 8px 15px;
25 | -webkit-appearance:none;
26 | -moz-appearance:none;
27 | appearance:none;
28 | }
29 |
30 | .fa-chevron-down {
31 | pointer-events: none;
32 | position: absolute;
33 | top: calc(1em - 4px);
34 | right: 1em;
35 | }
36 |
37 | .bc-gov-dropdown-wrapper {
38 | position: relative;
39 | display: inline;
40 | }
41 |
42 | :focus {
43 | outline: 4px solid #3B99FC;
44 | outline-offset: 1px;
45 | }
46 |
--------------------------------------------------------------------------------
/components/footer/images/footer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/footer/images/footer.png
--------------------------------------------------------------------------------
/components/footer/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Footer
8 |
9 |
10 |
11 |
12 |
Sample Footer
13 |
14 |
15 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/components/footer/style.css:
--------------------------------------------------------------------------------
1 | footer {
2 | background-color: #036;
3 | border-top: 2px solid #fcba19;
4 | color: #fff;
5 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
6 | }
7 |
8 | footer .container {
9 | display: flex;
10 | justify-content: center;
11 | flex-direction: column;
12 | text-align: center;
13 | height: 46px;
14 | }
15 |
16 | footer ul {
17 | display: flex;
18 | flex-direction: row;
19 | flex-wrap: wrap;
20 | margin: 0;
21 | color: #fff;
22 | list-style: none;
23 | align-items: center;
24 | height: 100%;
25 | }
26 |
27 | footer ul li a {
28 | font-size: 0.813em;
29 | font-weight: normal; /* 400 */
30 | color: #fff;
31 | border-right: 1px solid #4b5e7e;
32 | padding-left: 5px;
33 | padding-right: 5px;
34 | }
35 |
36 | a:hover {
37 | color: #fff;
38 | text-decoration: underline;
39 | }
40 |
41 | :focus {
42 | outline: 4px solid #3B99FC;
43 | outline-offset: 1px;
44 | }
45 |
--------------------------------------------------------------------------------
/components/forms/Form-structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/forms/Form-structure.png
--------------------------------------------------------------------------------
/components/forms/optional-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/forms/optional-example.png
--------------------------------------------------------------------------------
/components/header/images/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/header/images/header.png
--------------------------------------------------------------------------------
/components/header/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Header
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Hello British Columbia
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/components/header/style.css:
--------------------------------------------------------------------------------
1 | header {
2 | background-color: #036;
3 | border-bottom: 2px solid #fcba19;
4 | padding: 0 65px 0 65px;
5 | color: #fff;
6 | display: flex;
7 | height: 65px;
8 | top: 0px;
9 | position: fixed;
10 | width: 100%;
11 | }
12 |
13 | header h1 {
14 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
15 | font-weight: normal; /* 400 */
16 | margin: 5px 5px 0 18px;
17 | visibility: hidden;
18 | }
19 |
20 | header .banner {
21 | display: flex;
22 | justify-content: flex-start;
23 | align-items: center;
24 | margin: 0 10px 0 0;
25 | /* border-style: dotted;
26 | border-width: 1px;
27 | border-color: lightgrey; */
28 | }
29 |
30 | header .other {
31 | display: flex;
32 | flex-grow: 1;
33 | /* border-style: dotted;
34 | border-width: 1px;
35 | border-color: lightgrey; */
36 | }
37 |
38 | :focus {
39 | outline: 4px solid #3B99FC;
40 | outline-offset: 1px;
41 | }
42 |
43 | /*
44 | These are sample media queries only. Media queries are quite subjective
45 | but, in general, should be made for the three different classes of screen
46 | size: phone, tablet, full.
47 | */
48 |
49 | @media screen and (min-width: 600px) and (max-width: 899px) {
50 | header h1 {
51 | font-size: calc(7px + 2.2vw);
52 | visibility: visible;
53 | }
54 | }
55 |
56 | @media screen and (min-width: 900px) {
57 | header h1 {
58 | font-size: 2.0em;
59 | visibility: visible;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/components/link/images/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/link/images/link.png
--------------------------------------------------------------------------------
/components/link/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Sample Link
9 |
10 |
11 |
12 | This is an internal example of a link to access your application .
13 | Here is another example of an internal link to apply .
14 | This is an example of an External Link
15 | Here is an example of a telephone link: 250-555-0123
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/components/link/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Sample Link
9 |
33 |
34 |
35 |
36 | This is an internal example of a link to access your application .
37 | Here is another example of an internal link to apply .
38 | This is an example of an External Link
39 | Here is an example of a telephone link: 250-555-0123
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/components/link/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'Noto Sans', Verdana, Arial, sans-serif;
3 | font-size: 18px;
4 | }
5 |
6 | a {
7 | color: #1a5a96;
8 | }
9 |
10 | a:hover {
11 | text-decoration: none;
12 | color: blue;
13 | }
14 |
15 | i.fa-external-link-alt {
16 | color: #1a5a96;
17 | }
18 |
19 | :focus {
20 | outline: 4px solid #3B99FC;
21 | outline-offset: 1px;
22 | }
23 |
--------------------------------------------------------------------------------
/components/navbar/images/navbar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/navbar/images/navbar.gif
--------------------------------------------------------------------------------
/components/navbar/images/screenshot 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/navbar/images/screenshot 1.png
--------------------------------------------------------------------------------
/components/navbar/images/screenshot 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/navbar/images/screenshot 2.png
--------------------------------------------------------------------------------
/components/navbar/images/screenshot 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/navbar/images/screenshot 3.png
--------------------------------------------------------------------------------
/components/primary_button/images/primary_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/primary_button/images/primary_button.png
--------------------------------------------------------------------------------
/components/primary_button/index-dark.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button Dark
8 |
9 |
10 |
11 | Submit
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/primary_button/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button
8 |
9 |
10 | Submit
11 |
12 |
13 |
--------------------------------------------------------------------------------
/components/primary_button/sample-dark.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button Dark
8 |
9 |
49 |
50 |
51 | Submit
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/components/primary_button/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Primary Button
8 |
39 |
40 |
41 | Submit
42 |
43 |
44 |
--------------------------------------------------------------------------------
/components/primary_button/style-dark.css:
--------------------------------------------------------------------------------
1 | .BC-Gov-PrimaryButton-Dark {
2 | background-color: #fff;
3 | border: none;
4 | border-radius: 4px;
5 | color: #313132;
6 | padding: 12px 32px;
7 | text-align: center;
8 | text-decoration: none;
9 | display: inline-block;
10 | font-size: 18px;
11 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
12 | font-weight: 700;
13 | letter-spacing: 1px;
14 | cursor: pointer;
15 | }
16 |
17 | .BC-Gov-PrimaryButton-Dark:hover {
18 | text-decoration: underline;
19 | background-color: #f2f2f2
20 | }
21 |
22 | :focus {
23 | outline: 4px solid #3B99FC;
24 | outline-offset: 1px;
25 | }
26 |
27 | .BC-Gov-PrimaryButton-Dark:active {
28 | background-color: #fff;
29 | }
30 |
31 | .background-colour {
32 | background-color: #003366;
33 | height: 100px;
34 | width: 300px;
35 | display: flex;
36 | align-items: center;
37 | justify-content: center;
38 | }
39 |
--------------------------------------------------------------------------------
/components/primary_button/style.css:
--------------------------------------------------------------------------------
1 | .BC-Gov-PrimaryButton {
2 | background-color: #003366;
3 | border: none;
4 | border-radius: 4px;
5 | color: white;
6 | padding: 12px 32px;
7 | text-align: center;
8 | text-decoration: none;
9 | display: inline-block;
10 | font-size: 18px;
11 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
12 | font-weight: 700;
13 | letter-spacing: 1px;
14 | cursor: pointer;
15 | }
16 |
17 | .BC-Gov-PrimaryButton:hover {
18 | text-decoration: underline;
19 | background-color: #336699;
20 | }
21 |
22 | :focus {
23 | outline: 4px solid #3B99FC;
24 | outline-offset: 1px;
25 | }
26 |
27 | .BC-Gov-PrimaryButton:active {
28 | opacity: 1;
29 | }
30 |
--------------------------------------------------------------------------------
/components/radio/images/radio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/radio/images/radio.png
--------------------------------------------------------------------------------
/components/radio/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Radio Button
8 |
9 |
10 |
11 | One
12 |
13 |
14 |
15 |
16 | Two
17 |
18 |
19 |
20 |
21 | Three
22 |
23 |
24 |
25 |
26 | Four
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/components/radio/style.css:
--------------------------------------------------------------------------------
1 | /* Customize the label (the container) */
2 | .radio {
3 | display: block;
4 | position: relative;
5 | padding-left: 30px;
6 | margin-bottom: 12px;
7 | cursor: pointer;
8 | font-size: 18px;
9 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
10 | -webkit-user-select: none;
11 | -moz-user-select: none;
12 | -ms-user-select: none;
13 | user-select: none;
14 | }
15 |
16 | /* Hide the browser's default radio button */
17 | .radio input {
18 | position: absolute;
19 | opacity: 0;
20 | cursor: pointer;
21 | height: 0;
22 | width: 0;
23 | }
24 |
25 | /* Create a custom radio button */
26 | .dot {
27 | position: absolute;
28 | top: 1px;
29 | left: 0;
30 | height: 18px;
31 | width: 18px;
32 | border-radius: 50%;
33 | border: 2px solid #606060;
34 | }
35 |
36 | /* When the radio button is checked, add a blue background */
37 | .radio input:checked ~ .dot {
38 | background-color: #ffffff;
39 | }
40 |
41 | /* Custom checkbox has blue outline when in focus */
42 | .radio input:focus ~ .dot {
43 | outline: 4px solid #3B99FC;
44 | outline-offset: 1px;
45 | }
46 |
47 | /* Create the indicator (the dot/circle - hidden when not checked) */
48 | .dot:after {
49 | content: "";
50 | position: absolute;
51 | display: none;
52 | top: 50%;
53 | left: 50%;
54 | width: 12px;
55 | height: 12px;
56 | border-radius: 50%;
57 | background: #606060;
58 | transform: translate(-50%, -50%);
59 | }
60 |
61 | /* Show the indicator (dot/circle) when checked */
62 | .radio input:checked ~ .dot:after {
63 | display: block;
64 | }
65 |
--------------------------------------------------------------------------------
/components/secondary_button/index-dark.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Secondary Button Dark
8 |
9 |
10 |
11 | Cancel
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/secondary_button/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Secondary Button
8 |
9 |
10 | Cancel
11 |
12 |
13 |
--------------------------------------------------------------------------------
/components/secondary_button/sample-dark.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Secondary Button Dark
8 |
9 |
51 |
52 |
53 | Cancel
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/components/secondary_button/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Secondary Button
8 |
38 |
39 |
40 | Cancel
41 |
42 |
43 |
--------------------------------------------------------------------------------
/components/secondary_button/style-dark.css:
--------------------------------------------------------------------------------
1 | .BC-Gov-SecondaryButton-Dark {
2 | background: none;
3 | border-radius: 4px;
4 | border: 2px solid #fff;
5 | padding: 10px 30px;
6 | text-align: center;
7 | text-decoration: none;
8 | display: block;
9 | font-size: 18px;
10 | Font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
11 | font-weight: 700;
12 | letter-spacing: 1px;
13 | cursor: pointer;
14 | color: #fff;
15 | }
16 |
17 | .BC-Gov-SecondaryButton-Dark:hover {
18 | text-decoration: underline;
19 | background-color: #fff;
20 | color: #313132;
21 | }
22 |
23 | :focus {
24 | outline-offset: 1px;
25 | outline: 4px solid #3B99FC;
26 | }
27 |
28 | .BC-Gov-SecondaryButton-Dark:active {
29 | background-color: #f2f2f2;
30 | color: #313132;
31 | }
32 |
33 | .background-colour {
34 | background-color: #003366;
35 | height: 100px;
36 | width: 300px;
37 | display: flex;
38 | align-items: center;
39 | justify-content: center;
40 | }
41 |
--------------------------------------------------------------------------------
/components/secondary_button/style.css:
--------------------------------------------------------------------------------
1 | .BC-Gov-SecondaryButton {
2 | background: none;
3 | border-radius: 4px;
4 | border: 2px solid #003366;
5 | padding: 10px 30px;
6 | text-align: center;
7 | text-decoration: none;
8 | display: block;
9 | font-size: 18px;
10 | Font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
11 | font-weight: 700;
12 | letter-spacing: 1px;
13 | cursor: pointer;
14 | color: #003366;
15 | }
16 | .BC-Gov-SecondaryButton:hover {
17 | opacity: 0.80;
18 | text-decoration: underline;
19 | background-color: #003366;
20 | color: #FFFFFF;
21 | }
22 | :focus {
23 | outline-offset: 1px;
24 | outline: 4px solid #3B99FC;
25 | }
26 | .BC-Gov-SecondaryButton:active {
27 | opacity: 1;
28 | }
29 |
--------------------------------------------------------------------------------
/components/table/images/table.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/table/images/table.png
--------------------------------------------------------------------------------
/components/table/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Table
8 |
9 |
10 |
11 | Roll Call
12 |
13 | Firstname
14 | Lastname
15 | Age
16 |
17 |
18 | Jill
19 | Smith
20 | 50
21 |
22 |
23 | Eve
24 | Jackson
25 | 94
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/components/table/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Table
8 |
32 |
33 |
34 |
35 | Roll Call
36 |
37 | Firstname
38 | Lastname
39 | Age
40 |
41 |
42 | Jill
43 | Smith
44 | 50
45 |
46 |
47 | Eve
48 | Jackson
49 | 94
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/components/table/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-size: 16px;
3 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
4 | }
5 |
6 | table, th, td {
7 | border: 1px solid black;
8 | border-collapse: collapse;
9 | }
10 |
11 | th, td {
12 | padding: 15px;
13 | }
14 |
15 | th {
16 | text-align: left;
17 | background-color: #d0d0d1;
18 | }
19 |
20 | caption {
21 | padding: 15px;
22 | }
23 |
--------------------------------------------------------------------------------
/components/text_input/images/dummy.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/components/text_input/images/text_input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/text_input/images/text_input.png
--------------------------------------------------------------------------------
/components/text_input/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Text Input
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/components/text_input/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sample Text Input
8 |
37 |
38 |
39 |
40 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/components/text_input/style.css:
--------------------------------------------------------------------------------
1 | form {
2 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
3 | font-size: 18px;
4 | }
5 |
6 | .text_input {
7 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
8 | font-size: 18px;
9 | }
10 |
11 | .text_input {
12 | height: 34px;
13 | border: 2px solid #606060;
14 | margin-top: 5px;
15 | margin-bottom: 15px;
16 | border-radius: 4px;
17 | padding: 5px 5px 5px 7px;
18 | }
19 |
20 | .text_input[type="text"]:focus {
21 | outline: 4px solid #3B99FC;
22 | outline-offset: 1px;
23 | }
24 |
25 | .text_label {
26 | display: flex;
27 | }
28 |
--------------------------------------------------------------------------------
/components/textarea/images/dummy:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/components/textarea/images/textarea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/components/textarea/images/textarea.png
--------------------------------------------------------------------------------
/components/textarea/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Textarea
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/components/textarea/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Textarea
8 |
34 |
35 |
36 |
37 |
38 |
39 | Can you provide more detail?
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/components/textarea/style.css:
--------------------------------------------------------------------------------
1 | form {
2 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
3 | font-size: 18px;
4 | }
5 |
6 | .text_input {
7 | font-family: ‘Noto Sans’, Verdana, Arial, sans-serif;
8 | font-size: 18px;
9 | border: 2px solid #606060;
10 | margin-top: 5px;
11 | margin-bottom: 15px;
12 | border-radius: 4px;
13 | padding: 5px;
14 | resize: none;
15 | }
16 |
17 | .text_input:focus {
18 | outline: 4px solid #3B99FC;
19 | outline-offset: 1px;
20 | }
21 |
22 | .text_label {
23 | display: flex;
24 | }
25 |
--------------------------------------------------------------------------------
/packages/design-tokens/.gitignore:
--------------------------------------------------------------------------------
1 | # Include build and dist folders
2 | !build/*
3 | !dist/*
4 |
5 | .DS_Store
6 | node_modules
7 |
--------------------------------------------------------------------------------
/packages/design-tokens/.nvmrc:
--------------------------------------------------------------------------------
1 | 20
2 |
--------------------------------------------------------------------------------
/packages/design-tokens/build/.gitignore:
--------------------------------------------------------------------------------
1 | # Include this folder in the repo even if it's empty
2 |
--------------------------------------------------------------------------------
/packages/design-tokens/dist/.gitignore:
--------------------------------------------------------------------------------
1 | # Include this folder in the repo even if it's empty
2 |
--------------------------------------------------------------------------------
/packages/design-tokens/dist/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@bcgov/design-tokens",
3 | "version": "3.1.1",
4 | "description": "Design tokens for B.C. Design System",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/bcgov/design-system.git"
8 | },
9 | "keywords": [
10 | "design system",
11 | "design tokens",
12 | "figma",
13 | "tokens studio",
14 | "style-dictionary"
15 | ],
16 | "author": "Tyler Krys ",
17 | "license": "Apache-2.0",
18 | "bugs": {
19 | "url": "https://github.com/bcgov/design-system/issues"
20 | },
21 | "homepage": "https://github.com/bcgov/design-system#readme",
22 | "private": false
23 | }
24 |
--------------------------------------------------------------------------------
/packages/design-tokens/input/README.md:
--------------------------------------------------------------------------------
1 | This folder holds design token JSON data from Tokens Studio for Figma.
2 |
--------------------------------------------------------------------------------
/packages/design-tokens/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "design-tokens",
3 | "version": "3.2.0",
4 | "description": "Transformation pipeline for design tokens for B.C. Design System",
5 | "scripts": {
6 | "build": "./run-build.sh",
7 | "prepare-npm-package": "./run-prepare-npm-package.sh",
8 | "publish-npm-package": "./run-publish-npm-package.sh",
9 | "test": "node --test build-output.test.js"
10 | },
11 | "type": "module",
12 | "repository": {
13 | "type": "git",
14 | "url": "git+https://github.com/bcgov/design-system.git"
15 | },
16 | "keywords": [
17 | "design system",
18 | "design tokens",
19 | "figma",
20 | "tokens studio",
21 | "style-dictionary"
22 | ],
23 | "author": "Tyler Krys ",
24 | "license": "Apache-2.0",
25 | "bugs": {
26 | "url": "https://github.com/bcgov/design-system/issues"
27 | },
28 | "homepage": "https://github.com/bcgov/design-system#readme",
29 | "dependencies": {
30 | "@tokens-studio/sd-transforms": "1.2.3",
31 | "style-dictionary": "4.0.1"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/packages/design-tokens/run-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Remove existing build target directories
4 | rm -rf build/cjs*
5 | rm -rf build/css*
6 | rm -rf build/js*
7 |
8 | # Run the tokens transformation script
9 | node build-output.js
10 |
--------------------------------------------------------------------------------
/packages/design-tokens/run-prepare-npm-package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Remove existing dist target directories
4 | rm -rf dist/cjs*
5 | rm -rf dist/css*
6 | rm -rf dist/js*
7 |
8 | # Copy the contents of build into dist
9 | cp -R build/* dist
10 |
11 | # Update the version in dist/package.json to match the root package.json version
12 | ROOT_VERSION=$(jq -r '.version' package.json)
13 | jq --arg version "$ROOT_VERSION" '.version = $version' dist/package.json > tmp.$$.json && mv tmp.$$.json dist/package.json
14 |
--------------------------------------------------------------------------------
/packages/design-tokens/run-publish-npm-package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # The dist directory is used as the root for the published design tokens package
4 | cd dist
5 |
6 | # Publish to npm using any extra command line arguments passed to this script
7 | npm publish "$@"
8 |
--------------------------------------------------------------------------------
/packages/design-tokens/tmp.199.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/packages/design-tokens/tmp.199.json
--------------------------------------------------------------------------------
/packages/react-components/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | "eslint:recommended",
6 | "plugin:@typescript-eslint/recommended",
7 | "plugin:react-hooks/recommended",
8 | "plugin:storybook/recommended",
9 | ],
10 | ignorePatterns: ["dist", ".eslintrc.cjs"],
11 | parser: "@typescript-eslint/parser",
12 | plugins: ["react-refresh"],
13 | rules: {
14 | "react-refresh/only-export-components": [
15 | "warn",
16 | { allowConstantExport: true },
17 | ],
18 | },
19 | };
20 |
--------------------------------------------------------------------------------
/packages/react-components/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | storybook-static
14 | vite-dist
15 | *.local
16 |
17 | # Editor directories and files
18 | .vscode/*
19 | !.vscode/extensions.json
20 | .idea
21 | .DS_Store
22 | *.suo
23 | *.ntvs*
24 | *.njsproj
25 | *.sln
26 | *.sw?
27 |
--------------------------------------------------------------------------------
/packages/react-components/.nvmrc:
--------------------------------------------------------------------------------
1 | 20
2 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/bcdsTheme.js:
--------------------------------------------------------------------------------
1 | import { create } from "@storybook/theming/create";
2 | import "@bcgov/bc-sans/css/BC_Sans.css";
3 | import * as tokens from "@bcgov/design-tokens/js";
4 |
5 | export default create({
6 | // Typography
7 | fontBase: '"BC Sans", sans-serif',
8 | fontCode: "monospace",
9 |
10 | // Colour
11 | colorPrimary: tokens.themePrimaryGold,
12 | colorSecondary: tokens.themePrimaryBlue,
13 |
14 | // UI
15 | appBg: tokens.surfaceColorBackgroundLightBlue,
16 | appContentBg: tokens.surfaceColorBackgroundWhite,
17 | appPreviewBg: tokens.surfaceColorBackgroundWhite,
18 | appBorderColor: tokens.surfaceColorBorderDefault,
19 | appBorderRadius: tokens.layoutBorderRadiusMedium,
20 |
21 | // Text colors
22 | textColor: tokens.typographyColorPrimary,
23 | textInverseColor: tokens.typographyColorPrimaryInvert,
24 | textMutedColor: tokens.typographyColorSecondary,
25 |
26 | // Toolbar default and active colors
27 | barTextColor: tokens.typographyColorSecondary,
28 | barSelectedColor: tokens.surfaceColorBorderActive,
29 | barHoverColor: tokens.surfaceColorBorderActive,
30 | barBg: tokens.surfaceColorBackgroundLightGray,
31 |
32 | // Form colors
33 | inputBg: tokens.surfaceColorFormsDefault,
34 | inputBorder: tokens.surfaceColorBorderDefault,
35 | inputTextColor: tokens.typographyColorSecondary,
36 | inputBorderRadius: tokens.layoutBorderRadiusMedium,
37 |
38 | base: "light",
39 | brandTitle: "B.C. Design System",
40 | brandImage: "BCID_H_rgb_pos.svg", // This lives in storybook-public
41 | });
42 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/global.css:
--------------------------------------------------------------------------------
1 | #storybook-root {
2 | overflow-x: hidden;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | import type { StorybookConfig } from "@storybook/react-vite";
2 | import * as tokens from "@bcgov/design-tokens/cjs";
3 |
4 | const config: StorybookConfig = {
5 | stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
6 | addons: [
7 | "@storybook/addon-links",
8 | "@storybook/addon-essentials",
9 | "@storybook/addon-interactions",
10 | "@storybook/addon-a11y",
11 | ],
12 | framework: {
13 | name: "@storybook/react-vite",
14 | options: {
15 | builder: {
16 | viteConfigPath: "vite.config.ts",
17 | },
18 | strictMode: false,
19 | },
20 | },
21 | staticDirs: ["../storybook-public"],
22 |
23 | // extra CSS for Storybook docs and UI, injected into
24 | previewHead: (head) => `
25 | ${head}
26 |
32 | `,
33 | };
34 | export default config;
35 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/manager.js:
--------------------------------------------------------------------------------
1 | import { addons } from "@storybook/manager-api";
2 | import bcdsTheme from "./bcdsTheme";
3 |
4 | addons.setConfig({
5 | theme: bcdsTheme,
6 | panelPosition: 'bottom',
7 | });
8 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/preview.ts:
--------------------------------------------------------------------------------
1 | import type { Preview } from "@storybook/react";
2 | import bcdsTheme from "./bcdsTheme";
3 |
4 | import "@bcgov/bc-sans/css/BC_Sans.css";
5 |
6 | import "./global.css";
7 |
8 | const preview: Preview = {
9 | parameters: {
10 | actions: { argTypesRegex: "^on[A-Z].*" },
11 | docs: {
12 | theme: bcdsTheme,
13 | canvas: {
14 | withToolbar: true,
15 | },
16 | },
17 | controls: {
18 | matchers: {
19 | color: /(background|color)$/i,
20 | date: /Date$/i,
21 | },
22 | },
23 | options: {
24 | storySort: {
25 | order: ["Introduction", "Changelog"],
26 | },
27 | },
28 | },
29 | };
30 |
31 | export default preview;
32 |
--------------------------------------------------------------------------------
/packages/react-components/.storybook/test-runner.ts:
--------------------------------------------------------------------------------
1 | // .storybook/test-runner.ts
2 | // From: https://storybook.js.org/docs/writing-tests/accessibility-testing#setup
3 |
4 | import type { TestRunnerConfig } from "@storybook/test-runner";
5 | import { injectAxe, checkA11y } from "axe-playwright";
6 |
7 | /*
8 | * See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api
9 | * to learn more about the test-runner hooks API.
10 | */
11 | const config: TestRunnerConfig = {
12 | async preVisit(page) {
13 | await injectAxe(page);
14 | },
15 | async postVisit(page) {
16 | await checkA11y(page, "#storybook-root");
17 | },
18 | };
19 |
20 | export default config;
21 |
--------------------------------------------------------------------------------
/packages/react-components/Dockerfile.storybook:
--------------------------------------------------------------------------------
1 | # Dockerfile.storybook
2 |
3 | # -----------
4 | # Build stage
5 | # -----------
6 | FROM node:lts-alpine AS build-stage
7 | ARG GITHUB_SHA
8 | ENV GITHUB_SHA=$GITHUB_SHA
9 |
10 | # Copy package.json and package-lock.json
11 | WORKDIR /app
12 | COPY package.json .
13 | COPY vite.config.ts .
14 |
15 | # Print npm config
16 | RUN npm config list
17 |
18 | # Install dependencies
19 | RUN npm install
20 |
21 | # Copy required files
22 | COPY CHANGELOG.md ./CHANGELOG.md
23 | COPY src ./src
24 | COPY .storybook ./.storybook
25 | COPY storybook-public ./storybook-public
26 |
27 | # Run Storybook build script, which places built files in /app/storybook-static
28 | RUN STORYBOOK_GITHUB_SHA=$GITHUB_SHA npm run storybook-build
29 |
30 | # -----------
31 | # Serve stage
32 | # -----------
33 | FROM nginxinc/nginx-unprivileged:alpine AS serve-stage
34 |
35 | # Copy nginx configuration
36 | COPY ./nginx.storybook.conf /etc/nginx/nginx.conf
37 |
38 | # Copy built Storybook files to nginx public web root folder
39 | COPY --from=build-stage /app/storybook-static /usr/share/nginx/html
40 |
41 | EXPOSE 8080
42 | CMD ["nginx", "-g", "daemon off;"]
43 |
--------------------------------------------------------------------------------
/packages/react-components/Dockerfile.vite:
--------------------------------------------------------------------------------
1 | # Dockerfile.vite
2 |
3 | # -----------
4 | # Build stage
5 | # -----------
6 | FROM node:lts-alpine AS build-stage
7 |
8 | # Copy package.json and package-lock.json
9 | WORKDIR /app
10 | COPY package.json .
11 |
12 | # Print npm config
13 | RUN npm config list
14 |
15 | # Install dependencies
16 | RUN npm install
17 |
18 | # Copy required files
19 | COPY index.html ./
20 | COPY tsconfig.json ./
21 | COPY tsconfig.vite.json ./
22 | COPY vite.config.ts ./
23 | COPY src ./src
24 |
25 | # Run Vite build script, which places built files in /app/vite-dist
26 | RUN npm run vite-build
27 |
28 | # -----------
29 | # Serve stage
30 | # -----------
31 | FROM nginxinc/nginx-unprivileged:alpine AS serve-stage
32 |
33 | # Copy nginx configuration
34 | COPY ./nginx.vite.conf /etc/nginx/nginx.conf
35 |
36 | # Copy built Vite files to nginx public web root folder
37 | COPY --from=build-stage /app/vite-dist /usr/share/nginx/html
38 |
39 | EXPOSE 5555
40 | CMD ["nginx", "-g", "daemon off;"]
41 |
--------------------------------------------------------------------------------
/packages/react-components/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | BC Design System React Components Vite Kitchen Sink
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/react-components/jest.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from "jest";
2 |
3 | const config: Config = {
4 | // Limit search for tests to the `components` directory
5 | roots: ["./src/components"],
6 |
7 | // Start with the presets from the `ts-jest` package
8 | preset: "ts-jest",
9 |
10 | // Use `jsdom` as the test environment because we are testing React components
11 | testEnvironment: "jsdom",
12 |
13 | // Mocks for static file imports
14 | moduleNameMapper: {
15 | // Necessary because of our CSS file imports like `import "./Button.css"`
16 | "\\.(css)$": "identity-obj-proxy",
17 | },
18 |
19 | // Log each test result instead of a summary
20 | verbose: true,
21 | };
22 |
23 | export default config;
24 |
--------------------------------------------------------------------------------
/packages/react-components/nginx.storybook.conf:
--------------------------------------------------------------------------------
1 | # nginx.storybook.conf
2 | # Adapted from https://cloud.redhat.com/blog/deploy-vuejs-applications-on-openshift
3 | worker_processes auto;
4 |
5 | pid /tmp/nginx.pid;
6 |
7 | events {
8 | worker_connections 1024;
9 | }
10 |
11 | http {
12 | include /etc/nginx/mime.types;
13 | client_body_temp_path /tmp/client_temp;
14 | proxy_temp_path /tmp/proxy_temp_path;
15 | fastcgi_temp_path /tmp/fastcgi_temp;
16 | uwsgi_temp_path /tmp/uwsgi_temp;
17 | scgi_temp_path /tmp/scgi_temp;
18 |
19 | server {
20 | listen 8080;
21 | server_name _;
22 | gzip on;
23 | gzip_types *;
24 |
25 | index index.html;
26 | error_log /tmp/error.log;
27 | access_log /tmp/access.log;
28 |
29 | # Redirect requests for root to gov.bc.ca B.C. Design System landing page
30 | # Perma-link: https://www2.gov.bc.ca/gov/content?id=67906B3698E44F4592AD4C6DC375B8F1
31 | location = / {
32 | return 301 https://gov.bc.ca/designsystem;
33 | }
34 |
35 | # Requests within /react-components/ path get served the Storybook app
36 | location /react-components/ {
37 | alias /usr/share/nginx/html/;
38 | try_files $uri $uri/ /index.html;
39 | }
40 |
41 | # Redirect /react-components to /react-components/
42 | location = /react-components {
43 | return 301 /react-components/;
44 | }
45 |
46 | # Redirect 404 errors to the Design System landing page
47 | error_page 404 =301 https://gov.bc.ca/designsystem;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/packages/react-components/nginx.vite.conf:
--------------------------------------------------------------------------------
1 | # nginx.vite.conf
2 | # Adapted from https://cloud.redhat.com/blog/deploy-vuejs-applications-on-openshift
3 | worker_processes auto;
4 |
5 | pid /tmp/nginx.pid;
6 |
7 | events {
8 | worker_connections 1024;
9 | }
10 |
11 | http {
12 | include /etc/nginx/mime.types;
13 | client_body_temp_path /tmp/client_temp;
14 | proxy_temp_path /tmp/proxy_temp_path;
15 | fastcgi_temp_path /tmp/fastcgi_temp;
16 | uwsgi_temp_path /tmp/uwsgi_temp;
17 | scgi_temp_path /tmp/scgi_temp;
18 |
19 | server {
20 | listen 5555;
21 | server_name _;
22 | gzip on;
23 | gzip_types *;
24 |
25 | index index.html;
26 | error_log /tmp/error.log;
27 | access_log /tmp/access.log;
28 |
29 | location / {
30 | root /usr/share/nginx/html;
31 | try_files $uri /index.html;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/react-components/public/vite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/react-components/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import { dts } from "rollup-plugin-dts";
5 | import postcss from "rollup-plugin-postcss";
6 | import peerDepsExternal from "rollup-plugin-peer-deps-external";
7 |
8 | // eslint-disable-next-line @typescript-eslint/no-var-requires, no-undef
9 | const packageJson = require("./package.json");
10 |
11 | export default [
12 | {
13 | input: "src/index.ts",
14 | output: [
15 | {
16 | file: packageJson.main,
17 | format: "cjs",
18 | sourcemap: true,
19 | },
20 | {
21 | file: packageJson.module,
22 | format: "esm",
23 | sourcemap: true,
24 | },
25 | ],
26 | plugins: [
27 | peerDepsExternal(),
28 | resolve(),
29 | commonjs(),
30 | typescript({
31 | tsconfig: "./tsconfig.json",
32 | include: ["src/index.ts", "src/components/**/*"],
33 | }),
34 | postcss(),
35 | ],
36 | },
37 | {
38 | input: "dist/esm/types/index.d.ts",
39 | output: [{ file: "dist/index.d.ts", format: "esm" }],
40 | plugins: [dts()],
41 | external: [/\.css$/],
42 | },
43 | ];
44 |
--------------------------------------------------------------------------------
/packages/react-components/src/App.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | }
4 |
5 | h1,
6 | h2,
7 | h3,
8 | h4,
9 | h5,
10 | h6 {
11 | font-family: var(--typography-font-families-bc-sans);
12 | }
13 |
14 | main {
15 | margin: 0 auto;
16 | padding: 2rem;
17 | max-width: 1100px;
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-components/src/Changelog.mdx:
--------------------------------------------------------------------------------
1 | import { Markdown } from "@storybook/blocks";
2 | import Changelog from '../CHANGELOG.md?raw';
3 |
4 | { Changelog }
5 |
--------------------------------------------------------------------------------
/packages/react-components/src/assets/close.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/react-components/src/assets/icon-exclamation.svg:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/react-components/src/assets/icon-menu.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/react-components/src/assets/icon-placeholder.svg:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/packages/react-components/src/assets/tooltip-arrow-up.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Accordion/Accordion.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Disclosure,
3 | DisclosurePanel,
4 | DisclosureProps as DisclosureProps,
5 | } from "react-aria-components";
6 |
7 | import "./Accordion.css";
8 | import Button from "../Button";
9 | import SvgChevronUpIcon from "../Icons/SvgChevronUpIcon";
10 | import SvgChevronDownIcon from "../Icons/SvgChevronDownIcon";
11 |
12 | export interface AccordionProps extends DisclosureProps {
13 | /* Button label text */
14 | label?: string;
15 | }
16 |
17 | export default function Accordion({
18 | label,
19 | children,
20 | ...props
21 | }: AccordionProps) {
22 | return (
23 |
24 | {({ isExpanded }) => (
25 | <>
26 |
32 | {label}
33 | {isExpanded ? : }
34 |
35 |
36 | <>{children}>
37 |
38 | >
39 | )}
40 |
41 | );
42 | }
43 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Accordion/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Accordion";
2 | export type { AccordionProps } from "./Accordion";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/AccordionGroup/AccordionGroup.tsx:
--------------------------------------------------------------------------------
1 | import { DisclosureGroup, DisclosureGroupProps } from "react-aria-components";
2 |
3 | import "./AccordionGroup.css";
4 |
5 | export interface AccordionGroupProps extends DisclosureGroupProps {
6 | /* Sets label displayed above accordion group */
7 | title?: string;
8 | /* Sets element type for accordion group title. If not set, defaults to */
9 | titleElement?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
10 | }
11 |
12 | export default function AccordionGroup({
13 | title,
14 | titleElement,
15 | children,
16 | ...props
17 | }: AccordionGroupProps) {
18 | function getTitle() {
19 | switch (titleElement) {
20 | case "h1":
21 | return {title} ;
22 | case "h2":
23 | return {title} ;
24 | case "h3":
25 | return {title} ;
26 | case "h4":
27 | return {title} ;
28 | case "h5":
29 | return {title} ;
30 | case "h6":
31 | return {title} ;
32 | default:
33 | return {title} ;
34 | }
35 | }
36 | return (
37 | <>
38 | {title && (
39 |
40 | {getTitle()}
41 |
42 | )}
43 |
44 | {children}
45 |
46 | >
47 | );
48 | }
49 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/AccordionGroup/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./AccordionGroup";
2 | export type { AccordionGroupProps } from "./AccordionGroup";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/AlertBanner/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./AlertBanner";
2 | export type { AlertBannerProps } from "./AlertBanner";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/AlertDialog/index.ts:
--------------------------------------------------------------------------------
1 | export { default, DialogTrigger } from "./AlertDialog";
2 | export type { AlertDialogProps } from "./AlertDialog";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Button/Button.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Button as ReactAriaButton,
3 | ButtonProps as ReactAriaButtonProps,
4 | } from "react-aria-components";
5 |
6 | import "./Button.css";
7 |
8 | export interface ButtonProps extends ReactAriaButtonProps {
9 | /**
10 | * Defaults to `medium`. `small` is shorter vertically.
11 | */
12 | size?: "small" | "medium";
13 | /**
14 | * Defaults to `primary`.
15 | */
16 | variant?: "primary" | "secondary" | "tertiary" | "link";
17 | /**
18 | * For destructive/deletion actions.
19 | */
20 | danger?: boolean;
21 | /**
22 | * If true, renders a square button intended for a single icon.
23 | */
24 | isIconButton?: boolean;
25 | }
26 |
27 | export default function Button({
28 | size = "medium",
29 | variant = "primary",
30 | danger = false,
31 | isIconButton = false,
32 | ...props
33 | }: ButtonProps) {
34 | return (
35 |
41 | );
42 | }
43 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Button/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Button";
2 | export type { ButtonProps } from "./Button";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/ButtonGroup/ButtonGroup.css:
--------------------------------------------------------------------------------
1 | .bcds-ButtonGroup {
2 | display: flex;
3 | gap: var(--layout-margin-small);
4 | flex-grow: 1;
5 | }
6 |
7 | .bcds-ButtonGroup.horizontal {
8 | flex-direction: row;
9 | }
10 |
11 | .bcds-ButtonGroup.vertical {
12 | flex-direction: column;
13 | }
14 |
15 | .bcds-ButtonGroup.start {
16 | justify-content: flex-start;
17 | }
18 |
19 | .bcds-ButtonGroup.center {
20 | justify-content: center;
21 | }
22 |
23 | .bcds-ButtonGroup.end {
24 | justify-content: flex-end;
25 | }
26 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/ButtonGroup/ButtonGroup.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { render, screen } from "@testing-library/react";
3 |
4 | import ButtonGroup from "./ButtonGroup";
5 |
6 | describe("ButtonGroup", () => {
7 | render( );
8 | render(
9 |
10 | );
11 | render( );
12 | render( );
13 | const defaultButtonGroup = screen.getByTestId("button-group");
14 | const verticalButtonGroup = screen.getByTestId("orientation-vertical");
15 | const endButtonGroup = screen.getByTestId("alignment-end");
16 | const centerButtonGroup = screen.getByTestId("alignment-center");
17 |
18 | it("has default classes", () => {
19 | expect(defaultButtonGroup).toHaveClass("bcds-ButtonGroup horizontal start");
20 | });
21 | it("has the role='group' attribute", () => {
22 | expect(defaultButtonGroup).toHaveAttribute("role", "group");
23 | });
24 | it("passing orientation adds the correct class", () => {
25 | expect(verticalButtonGroup).toHaveClass("bcds-ButtonGroup vertical start");
26 | });
27 | it("passing 'end' alignment adds the correct class", () => {
28 | expect(endButtonGroup).toHaveClass("bcds-ButtonGroup horizontal end");
29 | });
30 | it("passing 'center' alignment adds the correct class", () => {
31 | expect(centerButtonGroup).toHaveClass("bcds-ButtonGroup horizontal center");
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/ButtonGroup/ButtonGroup.tsx:
--------------------------------------------------------------------------------
1 | import "./ButtonGroup.css";
2 |
3 | export interface ButtonGroupProps extends React.PropsWithChildren {
4 | /* Sets layout of button group */
5 | orientation?: "horizontal" | "vertical";
6 | /* Sets alignment of button group */
7 | alignment?: "start" | "center" | "end";
8 | /* Semantic label for button group */
9 | ariaLabel?: string | undefined;
10 | }
11 |
12 | export default function ButtonGroup({
13 | orientation = "horizontal",
14 | alignment = "start",
15 | ariaLabel,
16 | children,
17 | ...props
18 | }: ButtonGroupProps) {
19 | return (
20 |
26 | {children}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/ButtonGroup/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./ButtonGroup";
2 | export type { ButtonGroupProps } from "./ButtonGroup";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Callout/Callout.tsx:
--------------------------------------------------------------------------------
1 | import ButtonGroup from "../ButtonGroup";
2 |
3 | import "./Callout.css";
4 |
5 | export interface CalloutProps extends React.PropsWithChildren {
6 | /* Callout theme */
7 | variant?: "lightGrey" | "lightBlue" | "lightGold" | "Blue" | "Grey" | "Black";
8 | /* Title */
9 | title?: string;
10 | /* Description */
11 | description?: string;
12 | /* Button group */
13 | buttons?: React.ReactNode;
14 | /* ARIA role */
15 | role?: React.AriaRole | undefined;
16 | /* */
17 | isLeftBorderDisabled?: boolean;
18 | }
19 |
20 | export default function Callout({
21 | variant = "lightGrey",
22 | title,
23 | description,
24 | buttons,
25 | role = "note",
26 | isLeftBorderDisabled = false,
27 | children,
28 | ...props
29 | }: CalloutProps) {
30 | return (
31 |
38 | {children ? (
39 | children
40 | ) : (
41 | <>
42 |
47 | {title && (
48 |
49 | {title}
50 |
51 | )}
52 | {description && (
53 | {description}
54 | )}
55 | {buttons && (
56 |
57 | {buttons}
58 |
59 | )}
60 |
61 | >
62 | )}
63 |
64 | );
65 | }
66 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Callout/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Callout";
2 | export type { CalloutProps } from "./Callout";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Checkbox/Checkbox.test.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen, fireEvent } from "@testing-library/react";
2 | import "@testing-library/jest-dom"; // for matchers like toBeChecked
3 |
4 | import Checkbox from "./Checkbox";
5 |
6 | describe("Checkbox component", () => {
7 | test("Checkbox renders unchecked, user clicks it, checkbox is checked", () => {
8 | render(I agree );
9 | const checkbox = screen.getByLabelText(/i agree/i);
10 | expect(checkbox).not.toBeChecked();
11 | fireEvent.click(checkbox);
12 | expect(checkbox).toBeChecked();
13 | });
14 |
15 | test("Checkbox renders checked, user clicks it, checkbox is unchecked", () => {
16 | render(Email me my results );
17 | const checkbox = screen.getByLabelText(/email me my results/i);
18 | expect(checkbox).toBeChecked();
19 | fireEvent.click(checkbox);
20 | expect(checkbox).not.toBeChecked();
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Checkbox/Checkbox.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Checkbox as ReactAriaCheckbox,
3 | CheckboxProps,
4 | CheckboxRenderProps,
5 | } from "react-aria-components";
6 |
7 | import SvgCheckIcon from "../Icons/SvgCheckIcon";
8 | import SvgDashIcon from "../Icons/SvgDashIcon";
9 |
10 | import "./Checkbox.css";
11 |
12 | export default function Checkbox({ value, children, ...props }: CheckboxProps) {
13 | return (
14 |
19 | {({ isRequired, isSelected, isIndeterminate }: CheckboxRenderProps) => (
20 | <>
21 |
22 | {isSelected && !isIndeterminate && }
23 | {isIndeterminate && }
24 |
25 |
26 | <>{children}> {isRequired && "(required)"}
27 |
28 | >
29 | )}
30 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Checkbox/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Checkbox";
2 | export type { CheckboxProps } from "react-aria-components";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/CheckboxGroup/CheckboxGroup.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-CheckboxGroup {
2 | display: flex;
3 | flex-direction: column;
4 | gap: var(--layout-margin-small);
5 | }
6 |
7 | /* Orientation */
8 | .bcds-react-aria-CheckboxGroup--options {
9 | display: flex;
10 | }
11 |
12 | .bcds-react-aria-CheckboxGroup--options.vertical {
13 | flex-direction: column;
14 | gap: var(--layout-margin-small);
15 | }
16 |
17 | .bcds-react-aria-CheckboxGroup--options.horizontal {
18 | flex-direction: row;
19 | gap: var(--layout-margin-medium);
20 | }
21 | .bcds-react-aria-CheckboxGroup--options.horizontal.flex-wrap-nowrap {
22 | flex-wrap: nowrap;
23 | }
24 | .bcds-react-aria-CheckboxGroup--options.horizontal.flex-wrap-wrap {
25 | flex-wrap: wrap;
26 | }
27 | .bcds-react-aria-CheckboxGroup--options.horizontal.flex-wrap-wrap-reverse {
28 | flex-wrap: wrap-reverse;
29 | }
30 |
31 | /* Parts */
32 | .bcds-react-aria-CheckboxGroup--label {
33 | font: var(--typography-regular-small-body);
34 | color: var(--typography-color-primary);
35 | }
36 |
37 | .bcds-react-aria-CheckboxGroup--description {
38 | font: var(--typography-regular-small-body);
39 | color: var(--typography-color-secondary);
40 | }
41 |
42 | .bcds-react-aria-CheckboxGroup--error {
43 | display: inline-flex;
44 | flex-direction: row;
45 | gap: var(--layout-margin-xsmall);
46 | font: var(--typography-regular-small-body);
47 | color: var(--typography-color-danger);
48 | }
49 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/CheckboxGroup/CheckboxGroup.test.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen, fireEvent } from "@testing-library/react";
2 | import "@testing-library/jest-dom"; // for matchers like toBeChecked
3 |
4 | import CheckboxGroup from "./CheckboxGroup";
5 | import Checkbox from "../Checkbox/Checkbox";
6 |
7 | describe("CheckboxGroup component", () => {
8 | beforeEach(() => {
9 | render(
10 |
11 | Apple
12 | Orange
13 | Banana
14 |
15 | );
16 | });
17 |
18 | test("renders 3 checkboxes with middle one checked", () => {
19 | const checkboxes = screen.getAllByRole("checkbox");
20 | expect(checkboxes).toHaveLength(3);
21 | expect(checkboxes[0]).not.toBeChecked();
22 | expect(checkboxes[1]).toBeChecked();
23 | expect(checkboxes[2]).not.toBeChecked();
24 | });
25 |
26 | test("user clicks 'orange' option, it is no longer checked", () => {
27 | const checkboxOrange = screen.getByLabelText(/orange/i);
28 | expect(checkboxOrange).toBeChecked();
29 | fireEvent.click(checkboxOrange);
30 | expect(checkboxOrange).not.toBeChecked();
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/CheckboxGroup/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./CheckboxGroup";
2 | export type { CheckboxGroupProps } from "./CheckboxGroup";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Dialog/Dialog.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-Dialog {
2 | display: flex;
3 | flex-direction: column;
4 | min-height: var(--layout-margin-xxxlarge);
5 | }
6 |
7 | .bcds-react-aria-Dialog--Container {
8 | position: relative;
9 | }
10 |
11 | /* Close icon */
12 | .bcds-react-aria-Dialog--closeIcon {
13 | color: var(--icons-color-primary);
14 | position: absolute;
15 | top: 0;
16 | right: 0;
17 | padding: var(--layout-padding-small);
18 | }
19 | .bcds-react-aria-Dialog--closeIcon > svg {
20 | min-width: var(--icons-size-medium);
21 | height: var(--icons-size-medium);
22 | }
23 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Dialog/Dialog.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Dialog as ReactAriaDialog,
3 | DialogTrigger,
4 | DialogProps as ReactAriaDialogProps,
5 | } from "react-aria-components";
6 |
7 | import Button from "../Button";
8 | import SvgCloseIcon from "../Icons/SvgCloseIcon";
9 |
10 | import "./Dialog.css";
11 |
12 | export interface DialogProps extends ReactAriaDialogProps {
13 | /* Show or hide close button */
14 | isCloseable?: boolean;
15 | }
16 |
17 | // This is not currently exported by RAC but we need it to type `close`.
18 | export interface DialogRenderProps {
19 | /** Handler function to close the Dialog */
20 | close: () => void;
21 | }
22 |
23 | export default function Dialog({
24 | isCloseable = true,
25 | role = "dialog",
26 | children,
27 | ...props
28 | }: DialogProps) {
29 | return (
30 |
31 | {({ close }: DialogRenderProps) => (
32 | <>
33 |
34 | {isCloseable && (
35 |
36 |
44 |
45 |
46 |
47 | )}
48 | <>{children}>
49 |
50 | >
51 | )}
52 |
53 | );
54 | }
55 |
56 | export { DialogTrigger };
57 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Dialog/index.ts:
--------------------------------------------------------------------------------
1 | export { default, DialogTrigger } from "./Dialog";
2 | export type { DialogProps } from "./Dialog";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Footer/Footer.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { render, screen } from "@testing-library/react";
3 |
4 | import Footer from "./Footer";
5 |
6 | describe("Footer", () => {
7 | render();
8 |
9 | // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/contentinfo_role
10 | const contentInfoElements = screen.getAllByRole("contentinfo");
11 |
12 | it("renders an HTML footer component", () => {
13 | expect(contentInfoElements).toHaveLength(1);
14 | expect(contentInfoElements[0].tagName).toBe("FOOTER");
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Footer/index.ts:
--------------------------------------------------------------------------------
1 | export { default, FooterLinks } from "./Footer";
2 | export type { FooterProps, FooterLinksProps } from "./Footer";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Form/Form.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { render, screen } from "@testing-library/react";
3 |
4 | import Form from "./Form";
5 |
6 | describe("Form", () => {
7 | render( );
8 |
9 | const form = screen.getByTestId("form-element");
10 |
11 | it("renders an HTML form component", () => {
12 | expect(form.tagName).toBe("FORM");
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Form/Form.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Form as ReactAriaForm,
3 | FormProps as ReactAriaFormProps,
4 | } from "react-aria-components";
5 |
6 | export default function Form({ ...props }: ReactAriaFormProps) {
7 | return ;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Form/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Form";
2 | export type { FormProps } from "react-aria-components";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Header/Header.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { render, screen } from "@testing-library/react";
3 |
4 | import Header from "./Header";
5 |
6 | describe("Header", () => {
7 | render();
8 |
9 | // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/banner_role
10 | const bannerElements = screen.getAllByRole("banner");
11 |
12 | it("renders an HTML header component", () => {
13 | expect(bannerElements).toHaveLength(1);
14 | expect(bannerElements[0].tagName).toBe("HEADER");
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Header/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Header";
2 | export type { HeaderProps } from "./Header";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Heading/Heading.css:
--------------------------------------------------------------------------------
1 | /* Headings */
2 | h1.bcds-react-aria-Heading {
3 | font: var(--typography-bold-h1);
4 | }
5 |
6 | h2.bcds-react-aria-Heading {
7 | font: var(--typography-bold-h2);
8 | }
9 |
10 | h3.bcds-react-aria-Heading {
11 | font: var(--typography-bold-h3);
12 | }
13 |
14 | h4.bcds-react-aria-Heading {
15 | font: var(--typography-bold-h4);
16 | }
17 |
18 | h5.bcds-react-aria-Heading {
19 | font: var(--typography-bold-h5);
20 | }
21 |
22 | h6.bcds-react-aria-Heading {
23 | font: var(--typography-bold-h6);
24 | }
25 |
26 | /* Text colour */
27 | .bcds-react-aria-Heading.primary {
28 | color: var(--typography-color-primary);
29 | }
30 | .bcds-react-aria-Heading.primaryInvert {
31 | color: var(--typography-color-primary-invert);
32 | }
33 | .bcds-react-aria-Heading.secondary {
34 | color: var(--typography-color-secondary);
35 | }
36 | .bcds-react-aria-Heading.secondaryInvert {
37 | color: var(--typography-color-secondary-invert);
38 | }
39 | .bcds-react-aria-Heading.disabled {
40 | color: var(--typography-color-disabled);
41 | }
42 | .bcds-react-aria-Heading.danger {
43 | color: var(--typography-color-danger);
44 | }
45 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Heading/Heading.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Heading as ReactAriaHeading,
3 | HeadingProps as ReactAriaHeadingProps,
4 | } from "react-aria-components";
5 |
6 | import "./Heading.css";
7 |
8 | export interface HeadingProps extends ReactAriaHeadingProps {
9 | /* Sets text color, defaults to primary */
10 | color?:
11 | | "primary"
12 | | "primaryInvert"
13 | | "secondary"
14 | | "secondaryInvert"
15 | | "disabled"
16 | | "danger";
17 | /* If true, renders component without CSS class */
18 | isUnstyled?: boolean;
19 | }
20 |
21 | export default function Heading({
22 | color = "primary",
23 | isUnstyled = false,
24 | ...props
25 | }: HeadingProps) {
26 | return (
27 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Heading/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Heading";
2 | export type { HeadingProps } from "./Heading";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgBcLogo/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgBcLogo";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgBcOutlineIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgBcOutlineIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgBetaIcon/SvgBetaIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Flask icon from Font Awesome: https://fontawesome.com/icons/flask */
2 | export default function SvgBetaIcon({ id = "beta-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgBetaIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgBetaIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Circle Check icon from Font Awesome: https://fontawesome.com/icons/circle-check */
2 | export default function SvgCheckCircleIcon({ id = "check-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCheckCircleIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgCheckCircleIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCheckIcon/SvgCheckIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Check icon from Font Awesome: https://fontawesome.com/icons/check */
2 | export default function SvgCheckIcon({ id = "check-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCheckIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgCheckIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgChevronDownIcon/SvgChevronDownIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Chevron Down icon from Font Awesome: https://fontawesome.com/icons/chevron-down */
2 | export default function SvgChevronDownIcon({ id = "chevron-down-icon" }) {
3 | return (
4 |
12 |
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgChevronDownIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgChevronDownIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgChevronUpIcon/SvgChevronUpIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Chevron Up icon from Font Awesome: https://fontawesome.com/icons/chevron-up */
2 | export default function SvgChevronUpIcon({ id = "chevron-up-icon" }) {
3 | return (
4 |
12 |
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgChevronUpIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgChevronUpIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCloseIcon/SvgCloseIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the X Mark icon from Font Awesome: https://fontawesome.com/icons/xmark */
2 | export default function SvgCloseIcon({ id = "close-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgCloseIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgCloseIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgDashIcon/SvgDashIcon.tsx:
--------------------------------------------------------------------------------
1 | export default function SvgDashIcon({ id = "dash-icon" }) {
2 | return (
3 |
10 |
14 |
15 | );
16 | }
17 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgDashIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgDashIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Circle Exclamation icon from Font Awesome: https://fontawesome.com/icons/circle-exclamation */
2 | export default function SvgExclamationCircleIcon({
3 | id = "exclamation-icon-circle",
4 | }) {
5 | return (
6 |
13 |
14 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgExclamationCircleIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgExclamationCircleIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgExclamationIcon/SvgExclamationIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Triangle Exclamation icon from Font Awesome: https://fontawesome.com/icons/triangle-exclamation */
2 | export default function SvgExclamationIcon({ id = "exclamation-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgExclamationIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgExclamationIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgInfoIcon/SvgInfoIcon.tsx:
--------------------------------------------------------------------------------
1 | /* The component implements the Circle Info icon from Font Awesome: https://fontawesome.com/icons/circle-info */
2 | export default function SvgInfoIcon({ id = "information-icon" }) {
3 | return (
4 |
11 |
12 |
16 |
17 |
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgInfoIcon/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgInfoIcon";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgTooltipArrowUp/SvgTooltipArrowUp.tsx:
--------------------------------------------------------------------------------
1 | export default function SvgTooltipArrowUp({ id = "tooltip-arrow" }) {
2 | return (
3 |
10 |
11 |
15 |
16 |
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Icons/SvgTooltipArrowUp/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./SvgTooltipArrowUp";
2 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/InlineAlert/InlineAlert.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { cleanup, fireEvent, render, screen } from "@testing-library/react";
3 |
4 | import InlineAlert from "./InlineAlert";
5 |
6 | afterEach(() => {
7 | cleanup();
8 | });
9 |
10 | describe("InlineAlert", () => {
11 | it("renders a div with role='note'", () => {
12 | render( );
13 | render( );
14 | render( );
15 | render( );
16 |
17 | const alertElements = screen.getAllByRole("note");
18 |
19 | expect(alertElements).toHaveLength(4);
20 | expect(alertElements[0].tagName).toBe("DIV");
21 | });
22 |
23 | it("isCloseable prop causes a close button to be rendered", () => {
24 | const handleClose = jest.fn();
25 | render(
26 |
27 | );
28 |
29 | const closeButtons = screen.getAllByRole("button");
30 |
31 | expect(closeButtons[0]).toHaveAccessibleName(/close this alert/i);
32 |
33 | fireEvent.click(closeButtons[0]);
34 |
35 | expect(handleClose).toHaveBeenCalledTimes(1);
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/InlineAlert/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./InlineAlert";
2 | export type { InlineAlertProps } from "./InlineAlert";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Link/Link.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-Link {
2 | color: var(--typography-color-link);
3 | text-decoration: underline;
4 | text-underline-offset: var(--layout-padding-hair);
5 | cursor: pointer;
6 | }
7 |
8 | /* Icon slots */
9 | .bcds-react-aria-Link--Icon {
10 | display: inline-flex;
11 | flex-direction: row;
12 | vertical-align: text-bottom;
13 | margin: var(--layout-margin-none) var(--layout-margin-xsmall);
14 | }
15 |
16 | /* Sizing */
17 | .bcds-react-aria-Link.small {
18 | font: var(--typography-regular-small-body);
19 | }
20 |
21 | .bcds-react-aria-Link.medium {
22 | font: var(--typography-regular-body);
23 | }
24 |
25 | .bcds-react-aria-Link.large {
26 | font: var(--typography-regular-large-body);
27 | }
28 |
29 | /* Placeholder large button style */
30 | .bcds-react-aria-Button.large {
31 | min-height: 40px;
32 | }
33 |
34 | /* Hover */
35 | .bcds-react-aria-Link[data-hovered] {
36 | color: var(--surface-color-border-active);
37 | }
38 |
39 | .bcds-react-aria-Link[data-hovered].danger {
40 | color: var(--surface-color-primary-danger-button-hover);
41 | }
42 |
43 | /* Selected */
44 | .bcds-react-aria-Link[data-current] {
45 | color: var(--surface-color-border-active);
46 | }
47 |
48 | /* Focus */
49 | .bcds-react-aria-Link[data-focus-visible] {
50 | outline: solid var(--layout-border-width-medium)
51 | var(--surface-color-border-active);
52 | outline-offset: var(--layout-margin-hair);
53 | border-radius: var(--layout-border-radius-small);
54 | }
55 |
56 | /* Disabled */
57 | .bcds-react-aria-Link[data-disabled],
58 | .bcds-react-aria-Link[data-disabled].danger {
59 | color: var(--typography-color-disabled);
60 | cursor: not-allowed;
61 | }
62 |
63 | /* Danger */
64 | .bcds-react-aria-Link.danger {
65 | color: var(--typography-color-danger);
66 | }
67 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Link/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Link";
2 | export type { LinkProps } from "./Link";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Modal/Modal.css:
--------------------------------------------------------------------------------
1 | /* Styles for overlay element */
2 | .react-aria-ModalOverlay:has(.bcds-react-aria-Modal) {
3 | position: fixed;
4 | inset: 0;
5 | display: flex;
6 | flex-direction: column;
7 | justify-content: center;
8 | align-items: center;
9 | gap: var(--layout-margin-small);
10 | background: var(--surface-color-overlay-default);
11 | height: 100vh;
12 | width: 100vw;
13 | z-index: 1000;
14 | }
15 | .react-aria-ModalOverlay:has(.bcds-react-aria-Modal)[data-entering] {
16 | animation: modal-fade 200ms;
17 | }
18 | .react-aria-ModalOverlay:has(.bcds-react-aria-Modal)[data-exiting] {
19 | animation: modal-fade 150ms reverse ease-in;
20 | }
21 | @media (prefers-reduced-motion) {
22 | /* Don't animate modal fade in/out if prefers-reduced-motion is on */
23 | .react-aria-ModalOverlay:has(.bcds-react-aria-Modal)[data-entering] {
24 | animation: unset;
25 | }
26 | .react-aria-ModalOverlay:has(.bcds-react-aria-Modal)[data-exiting] {
27 | animation: unset;
28 | }
29 | }
30 |
31 | @keyframes modal-fade {
32 | from {
33 | opacity: 0;
34 | }
35 |
36 | to {
37 | opacity: 1;
38 | }
39 | }
40 |
41 | /* Styles for content container */
42 | .bcds-react-aria-Modal {
43 | box-sizing: border-box;
44 | max-width: 100vw;
45 | width: 600px;
46 | max-height: 100vh;
47 | min-height: var(--layout-margin-xxxlarge);
48 | height: auto;
49 | margin: var(--layout-margin-large);
50 | border-radius: var(--layout-border-radius-medium);
51 | border: var(--layout-border-width-small) solid
52 | var(--surface-color-border-default);
53 | background: var(--surface-color-forms-default);
54 | box-shadow: var(--surface-shadow-large);
55 | }
56 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Modal/Modal.test.tsx:
--------------------------------------------------------------------------------
1 | import { fireEvent, render, screen } from "@testing-library/react";
2 | import "@testing-library/jest-dom";
3 |
4 | import Button from "../Button";
5 | import { DialogTrigger } from "../Dialog";
6 | import Modal from "./Modal";
7 |
8 | describe("Modal", () => {
9 | beforeEach(() => {
10 | render(
11 |
12 | Open
13 | Lorem ipsum
14 |
15 | );
16 | });
17 |
18 | it("text within Modal is not initially visible", () => {
19 | const text = screen.queryByText(/lorem ipsum/i);
20 | expect(text).not.toBeInTheDocument();
21 | });
22 |
23 | it("text within Modal is visible after pressing open button", () => {
24 | const button = screen.getByText(/open/i);
25 | fireEvent.click(button);
26 | const text = screen.queryByText(/lorem ipsum/i);
27 | expect(text).toBeInTheDocument();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Modal/Modal.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Modal as ReactAriaModal,
3 | ModalOverlayProps,
4 | } from "react-aria-components";
5 |
6 | import "./Modal.css";
7 |
8 | export default function Modal({ children, ...props }: ModalOverlayProps) {
9 | return (
10 |
11 | {children}
12 |
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Modal/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Modal";
2 | export type { ModalOverlayProps } from "react-aria-components";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Radio/Radio.test.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen } from "@testing-library/react";
2 | import "@testing-library/jest-dom";
3 |
4 | import Radio from "./Radio";
5 | import RadioGroup from "../RadioGroup";
6 |
7 | describe("Radio", () => {
8 | beforeEach(() => {
9 | render(
10 |
11 |
12 | Option 1
13 |
14 |
15 | Option 2
16 |
17 |
18 | Option 3
19 |
20 |
21 | );
22 | });
23 |
24 | it("renders an input option with a label", () => {
25 | const radio = screen.getAllByRole("radio");
26 | expect(radio).toHaveLength(3);
27 | expect(radio[0].tagName).toBe("INPUT");
28 | const label = radio[0].parentElement?.parentElement;
29 | expect(label).toHaveTextContent(/option 1/i);
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Radio/Radio.tsx:
--------------------------------------------------------------------------------
1 | import { Radio as ReactAriaRadio, RadioProps } from "react-aria-components";
2 |
3 | import "./Radio.css";
4 |
5 | export default function Radio({ value, children, ...props }: RadioProps) {
6 | return (
7 |
8 | {children}
9 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Radio/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Radio";
2 | export type { RadioProps } from "react-aria-components";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/RadioGroup/RadioGroup.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-RadioGroup {
2 | display: flex;
3 | flex-direction: column;
4 | gap: var(--layout-margin-small);
5 | }
6 |
7 | /* Orientation */
8 | .bcds-react-aria-RadioGroup--options {
9 | display: inline-flex;
10 | }
11 |
12 | .bcds-react-aria-RadioGroup--options.vertical {
13 | flex-direction: column;
14 | gap: var(--layout-margin-small);
15 | }
16 |
17 | .bcds-react-aria-RadioGroup--options.horizontal {
18 | flex-direction: row;
19 | gap: var(--layout-margin-medium);
20 | }
21 | .bcds-react-aria-RadioGroup--options.horizontal.flex-wrap-nowrap {
22 | flex-wrap: nowrap;
23 | }
24 | .bcds-react-aria-RadioGroup--options.horizontal.flex-wrap-wrap {
25 | flex-wrap: wrap;
26 | }
27 | .bcds-react-aria-RadioGroup--options.horizontal.flex-wrap-nowrap {
28 | flex-wrap: wrap-reverse;
29 | }
30 |
31 | /* Parts */
32 | .bcds-react-aria-RadioGroup--label {
33 | font: var(--typography-regular-small-body);
34 | color: var(--typography-color-primary);
35 | }
36 |
37 | .bcds-react-aria-RadioGroup--description {
38 | font: var(--typography-regular-small-body);
39 | color: var(--typography-color-secondary);
40 | }
41 |
42 | .bcds-react-aria-RadioGroup--error {
43 | display: inline-flex;
44 | flex-direction: row;
45 | gap: var(--layout-margin-xsmall);
46 | font: var(--typography-regular-small-body);
47 | color: var(--typography-color-danger);
48 | }
49 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/RadioGroup/RadioGroup.test.tsx:
--------------------------------------------------------------------------------
1 | import { fireEvent, render, screen } from "@testing-library/react";
2 | import "@testing-library/jest-dom";
3 |
4 | import RadioGroup from ".";
5 | import Radio from "../Radio";
6 |
7 | describe("RadioGroup", () => {
8 | beforeEach(() => {
9 | render(
10 |
11 |
12 | Option 1
13 |
14 |
15 | Option 2
16 |
17 |
18 | Option 3
19 |
20 |
21 | );
22 | });
23 |
24 | it("renders three radio input options", () => {
25 | const radios: HTMLFormElement[] = screen.getAllByRole("radio");
26 | expect(radios).toHaveLength(3);
27 | });
28 |
29 | it("user can select a radio input option with a click", () => {
30 | const optionOne: HTMLFormElement = screen.getByTestId("one");
31 | expect(optionOne).not.toHaveAttribute("data-selected");
32 | fireEvent.click(optionOne);
33 | expect(optionOne).toHaveAttribute("data-selected");
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/RadioGroup/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./RadioGroup";
2 | export type { RadioGroupProps } from "./RadioGroup";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Select/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Select";
2 | export type { SelectProps } from "./Select";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Switch/Switch.test.tsx:
--------------------------------------------------------------------------------
1 | import "@testing-library/jest-dom";
2 | import { cleanup, fireEvent, render, screen } from "@testing-library/react";
3 |
4 | import Switch from "./Switch";
5 |
6 | afterEach(() => {
7 | cleanup();
8 | });
9 |
10 | describe("Switch", () => {
11 | it("renders an HTML input component", () => {
12 | render(Flip me );
13 |
14 | const switchElements = screen.getAllByLabelText(/flip me/i);
15 |
16 | expect(switchElements).toHaveLength(1);
17 | expect(switchElements[0].tagName).toBe("INPUT");
18 | expect(switchElements[0]).toHaveAccessibleName(/flip me/i);
19 | });
20 |
21 | it("onChange handler fires on click", () => {
22 | const handleChange = jest.fn();
23 | render(Power );
24 |
25 | const switchElement = screen.getByLabelText(/power/i);
26 |
27 | fireEvent.click(switchElement);
28 |
29 | expect(handleChange).toHaveBeenCalled();
30 | });
31 |
32 | it("defaultSelected adds checked attribute", () => {
33 | render(Standby );
34 |
35 | const switchElement = screen.getByLabelText(/standby/i);
36 |
37 | expect(switchElement).toHaveAttribute("checked");
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Switch/Switch.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Switch as ReactAriaSwitch,
3 | SwitchProps as ReactAriaSwitchProps,
4 | } from "react-aria-components";
5 |
6 | import "./Switch.css";
7 |
8 | export interface SwitchProps extends ReactAriaSwitchProps {
9 | /* Label positioning relative to switch */
10 | labelPosition?: "left" | "right";
11 | }
12 |
13 | export default function Switch({
14 | labelPosition = "right",
15 | children,
16 | ...props
17 | }: SwitchProps) {
18 | return (
19 |
20 | {labelPosition === "left" && <>{children}>}
21 |
22 | {labelPosition === "right" && <>{children}>}
23 |
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Switch/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Switch";
2 | export type { SwitchProps } from "./Switch";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Tag/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Tag";
2 | export type { TagProps } from "./Tag";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagGroup/TagGroup.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-TagGroup {
2 | color: var(--typography-color-primary);
3 | font: var(--typography-regular-small-body);
4 | }
5 |
6 | .bcds-react-aria-TagGroup--Label,
7 | .bcds-react-aria-TagGroup--Text-description,
8 | .bcds-react-aria-TagGroup--Text-error {
9 | display: block;
10 | padding: var(--layout-padding-xsmall) var(--layout-padding-none);
11 | }
12 |
13 | .bcds-react-aria-TagGroup--Text-error {
14 | display: flex;
15 | color: var(--typography-color-danger);
16 | }
17 |
18 | .bcds-react-aria-TagGroup--Text-error > svg {
19 | padding-right: var(--layout-padding-xsmall);
20 | color: var(--icons-color-danger);
21 | min-width: var(--icons-size-medium);
22 | height: var(--icons-size-medium);
23 | }
24 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagGroup/TagGroup.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Label,
3 | TagGroup as ReactAriaTagGroup,
4 | TagGroupProps as ReactAriaTagGroupProps,
5 | Text,
6 | } from "react-aria-components";
7 |
8 | import "./TagGroup.css";
9 |
10 | import SvgExclamationIcon from "../Icons/SvgExclamationIcon";
11 |
12 | export interface TagGroupProps extends ReactAriaTagGroupProps {
13 | /**
14 | * Labels the TagGroup, appears above the tags.
15 | */
16 | label?: string;
17 | /**
18 | * Extended description of the TagGroup, appears below the tags.
19 | */
20 | description?: string;
21 | /**
22 | * Error message, appears below the tags and below the optional description.
23 | */
24 | errorMessage?: string;
25 | }
26 |
27 | export default function TagGroup({
28 | children,
29 | label,
30 | description,
31 | errorMessage,
32 | ...props
33 | }: TagGroupProps) {
34 | return (
35 |
36 | {label && (
37 | {label}
38 | )}
39 | {children}
40 | {description && (
41 |
45 | {description}
46 |
47 | )}
48 | {errorMessage && (
49 |
53 |
54 | {errorMessage}
55 |
56 | )}
57 |
58 | );
59 | }
60 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagGroup/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./TagGroup";
2 | export type { TagGroupProps } from "./TagGroup";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagList/TagList.css:
--------------------------------------------------------------------------------
1 | .bcds-react-aria-TagList {
2 | display: flex;
3 | flex-wrap: wrap;
4 | gap: var(--layout-padding-small);
5 | width: fit-content;
6 | }
7 |
8 | .bcds-react-aria-TagList.horizontal {
9 | flex-direction: row;
10 | }
11 |
12 | .bcds-react-aria-TagList.vertical {
13 | flex-direction: column;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagList/TagList.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | TagList as ReactAriaTagList,
3 | TagListProps as ReactAriaTagListProps,
4 | } from "react-aria-components";
5 |
6 | import Tag, { TagProps } from "../Tag";
7 |
8 | import "./TagList.css";
9 |
10 | export interface TagListProps
11 | extends Pick, "children" | "renderEmptyState"> {
12 | items: TagProps[];
13 | /**
14 | * Used to set the `flex-direction` on the TagList.
15 | */
16 | orientation?: "horizontal" | "vertical";
17 | }
18 |
19 | export default function TagList({
20 | items,
21 | orientation = "horizontal",
22 | renderEmptyState,
23 | ...props
24 | }: TagListProps) {
25 | return (
26 |
32 | {(item) => }
33 |
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TagList/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./TagList";
2 | export type { TagListProps } from "./TagList";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Text/Text.css:
--------------------------------------------------------------------------------
1 | /* Medium size (default) */
2 | .bcds-react-aria-Text.medium {
3 | font: var(--typography-regular-body);
4 | }
5 |
6 | .bcds-react-aria-Text.medium b,
7 | .bcds-react-aria-Text.medium strong {
8 | font: var(--typography-bold-body);
9 | }
10 |
11 | .bcds-react-aria-Text.medium i,
12 | .bcds-react-aria-Text.medium em {
13 | font: var(--typography-italic-body);
14 | }
15 |
16 | /* Small size */
17 | .bcds-react-aria-Text.small {
18 | font: var(--typography-regular-small-body);
19 | }
20 |
21 | .bcds-react-aria-Text.small b,
22 | .bcds-react-aria-Text.small strong {
23 | font: var(--typography-bold-small-body);
24 | }
25 |
26 | .bcds-react-aria-Text.small i,
27 | .bcds-react-aria-Text.small em {
28 | font: var(--typography-italic-small-body);
29 | }
30 |
31 | /* Large size */
32 | .bcds-react-aria-Text.large {
33 | font: var(--typography-regular-large-body);
34 | }
35 |
36 | .bcds-react-aria-Text.large b,
37 | .bcds-react-aria-Text.large strong {
38 | font: var(--typography-bold-large-body);
39 | }
40 |
41 | .bcds-react-aria-Text.large i,
42 | .bcds-react-aria-Text.large em {
43 | font: var(--typography-italic-large-body);
44 | }
45 |
46 | /* Text color */
47 | .bcds-react-aria-Text.primary {
48 | color: var(--typography-color-primary);
49 | }
50 | .bcds-react-aria-Text.primaryInvert {
51 | color: var(--typography-color-primary-invert);
52 | }
53 | .bcds-react-aria-Text.secondary {
54 | color: var(--typography-color-secondary);
55 | }
56 | .bcds-react-aria-Text.secondaryInvert {
57 | color: var(--typography-color-secondary-invert);
58 | }
59 | .bcds-react-aria-Text.disabled {
60 | color: var(--typography-color-disabled);
61 | }
62 | .bcds-react-aria-Text.danger {
63 | color: var(--typography-color-danger);
64 | }
65 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Text/Text.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Text as ReactAriaText,
3 | TextProps as ReactAriaTextProps,
4 | } from "react-aria-components";
5 |
6 | import "./Text.css";
7 |
8 | export interface TextProps extends ReactAriaTextProps {
9 | /* Sets text size, defaults to medium */
10 | size?: "small" | "medium" | "large";
11 | /* Sets text color, defaults to primary */
12 | color?:
13 | | "primary"
14 | | "primaryInvert"
15 | | "secondary"
16 | | "secondaryInvert"
17 | | "disabled"
18 | | "danger";
19 | /* If true, renders component without CSS class */
20 | isUnstyled?: boolean;
21 | }
22 |
23 | export default function Text({
24 | elementType = "span",
25 | size = "medium",
26 | color = "primary",
27 | isUnstyled = false,
28 | ...props
29 | }: TextProps) {
30 | return (
31 |
38 | {props.children}
39 |
40 | );
41 | }
42 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Text/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./Text";
2 | export type { TextProps } from "./Text";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TextArea/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./TextArea";
2 | export type { TextAreaProps } from "./TextArea";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/TextField/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from "./TextField";
2 | export type { TextFieldProps } from "./TextField";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Tooltip/Tooltip.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | OverlayArrow,
3 | Tooltip as ReactAriaTooltip,
4 | TooltipProps,
5 | TooltipTrigger,
6 | } from "react-aria-components";
7 |
8 | import "./Tooltip.css";
9 | import SvgTooltipArrowUp from "../Icons/SvgTooltipArrowUp";
10 |
11 | export default function Tooltip(props: TooltipProps) {
12 | return (
13 |
14 |
15 | {/* Up arrow gets rotated by CSS depending on `data-placement` attribute */}
16 |
17 |
18 | <>{props.children}>
19 |
20 | );
21 | }
22 |
23 | export { TooltipTrigger };
24 | export type { TooltipProps };
25 |
--------------------------------------------------------------------------------
/packages/react-components/src/components/Tooltip/index.ts:
--------------------------------------------------------------------------------
1 | export { default, TooltipTrigger } from "./Tooltip";
2 | export type { TooltipProps } from "./Tooltip";
3 |
--------------------------------------------------------------------------------
/packages/react-components/src/hooks/useWindowDimensions.ts:
--------------------------------------------------------------------------------
1 | // This React hook is designed for use in the Vite kitchen sink application, and
2 | // not required by any components in the exported component library.
3 |
4 | import { useCallback, useEffect, useState } from "react";
5 |
6 | export default function useWindowDimensions() {
7 | const hasWindow = typeof window !== "undefined";
8 |
9 | const getWindowDimensions = useCallback(() => {
10 | const width = hasWindow ? window.innerWidth : null;
11 | const height = hasWindow ? window.innerHeight : null;
12 |
13 | return {
14 | width,
15 | height,
16 | isExtraExtraLarge: width ? width >= 1400 : false,
17 | isExtraLarge: width ? width >= 1200 : false,
18 | isLarge: width ? width >= 992 : false,
19 | isMedium: width ? width >= 768 : false,
20 | isSmall: width ? width >= 576 : false,
21 | };
22 | }, [hasWindow]);
23 |
24 | const [windowDimensions, setWindowDimensions] = useState(
25 | getWindowDimensions()
26 | );
27 |
28 | useEffect(() => {
29 | if (hasWindow) {
30 | // eslint-disable-next-line no-inner-declarations
31 | function handleResize() {
32 | setWindowDimensions(getWindowDimensions());
33 | }
34 |
35 | window.addEventListener("resize", handleResize);
36 | return () => window.removeEventListener("resize", handleResize);
37 | }
38 | }, [getWindowDimensions, hasWindow]);
39 |
40 | return windowDimensions;
41 | }
42 |
--------------------------------------------------------------------------------
/packages/react-components/src/index.ts:
--------------------------------------------------------------------------------
1 | // index.ts
2 | // --------
3 | // This file exports all of our components and acts as an entrypoint for Rollup.
4 |
5 | export * from "./components";
6 |
--------------------------------------------------------------------------------
/packages/react-components/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App.tsx";
4 |
5 | ReactDOM.createRoot(document.getElementById("root")!).render(
6 |
7 |
8 |
9 | );
10 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/AccordionGroup/index.ts:
--------------------------------------------------------------------------------
1 | import AccordionGroupPage from "./AccordionGroup";
2 |
3 | export default AccordionGroupPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/AlertBanner/index.ts:
--------------------------------------------------------------------------------
1 | import AlertBannerPage from "./AlertBanner";
2 |
3 | export default AlertBannerPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Button/ButtonLink.tsx:
--------------------------------------------------------------------------------
1 | import Button from "@/components/Button";
2 |
3 | function ButtonLinkMedium() {
4 | return (
5 |
6 | Link Button Medium
7 |
8 | );
9 | }
10 |
11 | function ButtonLinkMediumDisabled() {
12 | return (
13 |
14 | Link Button Medium Disabled
15 |
16 | );
17 | }
18 |
19 | function ButtonLinkSmall() {
20 | return (
21 |
22 | Link Button Small
23 |
24 | );
25 | }
26 |
27 | function ButtonLinkSmallDisabled() {
28 | return (
29 |
30 | Link Button Small Disabled
31 |
32 | );
33 | }
34 |
35 | export {
36 | ButtonLinkMedium,
37 | ButtonLinkMediumDisabled,
38 | ButtonLinkSmall,
39 | ButtonLinkSmallDisabled,
40 | };
41 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Button/index.ts:
--------------------------------------------------------------------------------
1 | import ButtonPage from "./Button";
2 |
3 | export default ButtonPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/ButtonGroup/ButtonGroup.tsx:
--------------------------------------------------------------------------------
1 | import { Button, ButtonGroup } from "@/components";
2 |
3 | export default function ButtonGroupPage() {
4 | return (
5 | <>
6 | ButtonGroup
7 |
8 | Button 1
9 | Button 2
10 | Button 3
11 | Button 4
12 |
13 | >
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/ButtonGroup/index.ts:
--------------------------------------------------------------------------------
1 | import ButtonGroupPage from "./ButtonGroup";
2 |
3 | export default ButtonGroupPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Callout/Callout.tsx:
--------------------------------------------------------------------------------
1 | import { Button, Callout } from "@/components";
2 |
3 | export default function CalloutPage() {
4 | return (
5 | <>
6 | Callout
7 | Take an action,
12 |
13 | Take a different action
14 | ,
15 | ]}
16 | />
17 | >
18 | );
19 | }
20 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Callout/index.ts:
--------------------------------------------------------------------------------
1 | import CalloutPage from "./Callout";
2 |
3 | export default CalloutPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/CheckboxGroup/index.ts:
--------------------------------------------------------------------------------
1 | import CheckboxGroupPage from "./CheckboxGroup";
2 |
3 | export default CheckboxGroupPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/InlineAlert/index.ts:
--------------------------------------------------------------------------------
1 | import InlineAlertPage from "./InlineAlert";
2 |
3 | export default InlineAlertPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/ModalDialog/index.ts:
--------------------------------------------------------------------------------
1 | import ModalDialogPage from "./ModalDialog";
2 |
3 | export default ModalDialogPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/RadioGroup/RadioGroup.tsx:
--------------------------------------------------------------------------------
1 | import { RadioGroup, Radio } from "@/components";
2 |
3 | export default function RadioGroupPage() {
4 | return (
5 | <>
6 | RadioGroup
7 | Required RadioGroup
8 |
13 | Option 1
14 | Option 2
15 | Option 3
16 | Option 4
17 |
18 | RadioGroup with default value
19 |
20 | Option 1
21 | Option 2
22 | Option 3
23 | Option 4
24 |
25 | Horizontal RadioGroup
26 |
31 | Option 1
32 | Option 2
33 | Option 3
34 | Option 4
35 | Option 5
36 |
37 | >
38 | );
39 | }
40 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/RadioGroup/index.ts:
--------------------------------------------------------------------------------
1 | import RadioGroupPage from "./RadioGroup";
2 |
3 | export default RadioGroupPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Select/Select.tsx:
--------------------------------------------------------------------------------
1 | import UseStateExample from "./UseStateExample";
2 |
3 | export default function SelectPage() {
4 | return (
5 | <>
6 | Select
7 |
8 |
9 |
10 | Select with useState
11 |
12 | >
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Select/UseStateExample.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import Select, { ListBoxItemProps } from "@/components/Select/Select";
3 | import { Key } from "react-aria-components";
4 |
5 | const items: ListBoxItemProps[] = [
6 | {
7 | id: "1",
8 | label: "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
9 | },
10 | {
11 | id: "2",
12 | label: "Suspendisse mi leo, gravida non consectetur vel, tincidunt eu nisl",
13 | },
14 | {
15 | id: "3",
16 | label:
17 | "Nunc faucibus, magna nec condimentum venenatis, nunc dui euismod metus, et vehicula elit purus in ex",
18 | },
19 | {
20 | id: "4",
21 | label:
22 | "Quisque velit tortor, facilisis eu orci vitae, tristique convallis nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae",
23 | },
24 | ];
25 |
26 | export default function UseStateExample() {
27 | const [selected, setSelected] = useState();
28 |
29 | return (
30 | <>
31 | setSelected(selected)}
35 | />
36 | Selected Key: {selected}
37 | >
38 | );
39 | }
40 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Select/index.ts:
--------------------------------------------------------------------------------
1 | import SelectPage from "./Select";
2 |
3 | export default SelectPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Switch/Switch.tsx:
--------------------------------------------------------------------------------
1 | import { Switch } from "@/components";
2 |
3 | export default function SwitchPage() {
4 | return (
5 | <>
6 | Switch
7 |
14 | Label
15 | Reversed label position
16 | Disabled switch
17 |
18 | Switch on by default
19 |
20 |
21 | >
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Switch/index.ts:
--------------------------------------------------------------------------------
1 | import SwitchPage from "./Switch";
2 |
3 | export default SwitchPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/Disabled.tsx:
--------------------------------------------------------------------------------
1 | import { useListData } from "@react-stately/data";
2 |
3 | import { TagProps } from "@/components/Tag";
4 | import TagGroup from "@/components/TagGroup";
5 | import TagList from "@/components/TagList";
6 |
7 | import * as data from "./data.json";
8 |
9 | export default function DisabledTagGroup() {
10 | const list = useListData({
11 | initialItems: data.fileTypes as TagProps[],
12 | });
13 |
14 | return (
15 |
22 | No file types selected }
25 | />
26 |
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/Horizontal.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import type { Selection } from "react-aria-components";
3 | import { useListData } from "@react-stately/data";
4 |
5 | import { TagProps } from "@/components/Tag";
6 | import TagGroup from "@/components/TagGroup";
7 | import TagList from "@/components/TagList";
8 |
9 | import * as data from "./data.json";
10 |
11 | export default function HorizontalTagGroup() {
12 | const [selected, setSelected] = useState(new Set([]));
13 | const list = useListData({
14 | initialItems: data.colors as TagProps[],
15 | });
16 |
17 | return (
18 | list.remove(...keys)}
21 | selectionMode="multiple"
22 | selectedKeys={selected}
23 | onSelectionChange={setSelected}
24 | >
25 | No tags selected }
28 | />
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/NonRemovable.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import type { Selection } from "react-aria-components";
3 | import { useListData } from "@react-stately/data";
4 |
5 | import { TagProps } from "@/components/Tag";
6 | import TagGroup from "@/components/TagGroup";
7 | import TagList from "@/components/TagList";
8 |
9 | import * as data from "./data.json";
10 |
11 | export default function NonRemovable() {
12 | const [selected, setSelected] = useState(new Set([]));
13 | const list = useListData({
14 | initialItems: data.fish as TagProps[],
15 | });
16 |
17 | return (
18 |
24 |
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/TagGroup.tsx:
--------------------------------------------------------------------------------
1 | import HorizontalTagGroup from "./Horizontal";
2 | import VerticalTagGroup from "./Vertical";
3 | import NonRemovableTagGroup from "./NonRemovable";
4 | import DisabledTagGroup from "./Disabled";
5 |
6 | export default function TagGroupPage() {
7 | return (
8 | <>
9 | TagGroup
10 |
11 | Horizontal
12 |
13 |
14 | Vertical
15 |
16 |
17 | Non-removable
18 |
19 |
20 | Disabled
21 |
22 | >
23 | );
24 | }
25 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/Vertical.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import type { Selection } from "react-aria-components";
3 | import { useListData } from "@react-stately/data";
4 |
5 | import { TagProps } from "@/components/Tag";
6 | import TagGroup from "@/components/TagGroup";
7 | import TagList from "@/components/TagList";
8 |
9 | import * as data from "./data.json";
10 |
11 | export default function VerticalTagGroup() {
12 | const [selected, setSelected] = useState(new Set([]));
13 | const list = useListData({
14 | initialItems: data.pets,
15 | });
16 |
17 | return (
18 | list.remove(...keys)}
21 | selectionMode="multiple"
22 | selectedKeys={selected}
23 | onSelectionChange={setSelected}
24 | >
25 | No pets selected }
29 | />
30 |
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TagGroup/index.ts:
--------------------------------------------------------------------------------
1 | import TagGroupPage from "./TagGroup";
2 |
3 | export default TagGroupPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextArea/TextArea.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 |
3 | import { TextArea } from "@/components";
4 |
5 | export default function TextAreaPage() {
6 | const [text, setText] = useState("initial text state");
7 |
8 | function handleTextChange(text: string) {
9 | console.log("new text value: ", text);
10 |
11 | setText(text);
12 | }
13 |
14 | return (
15 | <>
16 | TextArea
17 |
18 |
19 | text
: {text}{" "}
20 |
21 |
27 |
28 |
29 |
30 |
31 | >
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextArea/index.ts:
--------------------------------------------------------------------------------
1 | import TextAreaPage from "./TextArea";
2 |
3 | export default TextAreaPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextField/TextField.tsx:
--------------------------------------------------------------------------------
1 | import { TextField } from "@/components";
2 |
3 | export default function TextFieldPage() {
4 | return (
5 | <>
6 | TextField
7 |
8 | >
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextField/index.ts:
--------------------------------------------------------------------------------
1 | import TextFieldPage from "./TextField";
2 |
3 | export default TextFieldPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextPage/TextPage.tsx:
--------------------------------------------------------------------------------
1 | import { Heading, Text } from "@/components";
2 |
3 | export default function TextPage() {
4 | return (
5 | <>
6 | Headings and text
7 |
8 | The Heading and Text components provide an easy way to populate sections
9 | of content. They implement the B.C. Design System's typescale.
10 |
11 | Headings
12 |
13 | The Heading component supports standard HTML heading levels (H1 to H6).
14 |
15 | Text size
16 | The text component supports 3 different sizes:
17 |
18 |
19 | Large
20 |
21 |
22 | Medium (default)
23 |
24 |
25 | Small
26 |
27 |
28 | Text styling
29 |
30 | The text component also supports standard text styling, like bold {" "}
31 | and italic .
32 |
33 | Text colour
34 | You can modify the colour of text via prop:
35 |
36 |
37 | Primary (default)
38 |
39 |
40 | Secondary
41 |
42 |
43 | Disabled
44 |
45 |
46 | Danger
47 |
48 |
49 |
50 | Inverted versions of the primary and secondary colours for use on dark
51 | backgrounds are also supported.
52 |
53 | >
54 | );
55 | }
56 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/TextPage/index.ts:
--------------------------------------------------------------------------------
1 | import TextPage from "./TextPage";
2 |
3 | export default TextPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/Tooltip/index.ts:
--------------------------------------------------------------------------------
1 | import TooltipPage from "./Tooltip";
2 |
3 | export default TooltipPage;
4 |
--------------------------------------------------------------------------------
/packages/react-components/src/pages/index.ts:
--------------------------------------------------------------------------------
1 | import AccordionGroupPage from "./AccordionGroup";
2 | import AlertBannerPage from "./AlertBanner";
3 | import ButtonPage from "./Button";
4 | import ButtonGroupPage from "./ButtonGroup";
5 | import CalloutPage from "./Callout";
6 | import CheckboxGroupPage from "./CheckboxGroup";
7 | import InlineAlertPage from "./InlineAlert";
8 | import ModalDialogPage from "./ModalDialog";
9 | import RadioGroupPage from "./RadioGroup";
10 | import SelectPage from "./Select";
11 | import TagGroupPage from "./TagGroup";
12 | import TextPage from "./TextPage";
13 | import TextAreaPage from "./TextArea";
14 | import TextFieldPage from "./TextField";
15 | import SwitchPage from "./Switch";
16 | import TooltipPage from "./Tooltip";
17 |
18 | export {
19 | AccordionGroupPage,
20 | AlertBannerPage,
21 | ButtonPage,
22 | ButtonGroupPage,
23 | CalloutPage,
24 | CheckboxGroupPage,
25 | InlineAlertPage,
26 | ModalDialogPage,
27 | RadioGroupPage,
28 | SelectPage,
29 | TagGroupPage,
30 | TextPage,
31 | TextAreaPage,
32 | TextFieldPage,
33 | SwitchPage,
34 | TooltipPage,
35 | };
36 |
--------------------------------------------------------------------------------
/packages/react-components/src/stories/Accordion.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from "@storybook/react";
2 |
3 | import { Accordion } from "../components";
4 | import { AccordionProps } from "@/components/Accordion";
5 |
6 | const meta = {
7 | title: "Components/AccordionGroup/Accordion",
8 | component: Accordion,
9 | parameters: { layout: "centered" },
10 | argTypes: {
11 | label: {
12 | control: { type: "text" },
13 | description: "Button text for accordion",
14 | },
15 | id: {
16 | control: {
17 | type: "text",
18 | },
19 | description: "Unique identifier for the accordion item",
20 | },
21 | isDisabled: {
22 | control: "boolean",
23 | description: "Disables an accordion item",
24 | },
25 | isExpanded: {
26 | control: "boolean",
27 | description: "Whether the disclosure is expanded (controlled)",
28 | },
29 | defaultExpanded: {
30 | control: "boolean",
31 | description:
32 | "Whether the disclosure is expanded by default (uncontrolled)",
33 | },
34 | children: {
35 | control: { type: "object" },
36 | description: "Accordion content",
37 | },
38 | },
39 | args: {},
40 | } satisfies Meta;
41 |
42 | export default meta;
43 | type Story = StoryObj;
44 |
45 | export const AccordionTemplate: Story = {
46 | args: {
47 | label: "Accordion panel title",
48 | children: "This is some content inside an accordion panel.",
49 | },
50 | render: ({ ...args }: AccordionProps) => ,
51 | };
52 |
53 | export const DisabledAccordion: Story = {
54 | args: {
55 | label: "This accordion item is disabled",
56 | children: "This is some content inside an accordion panel.",
57 | isDisabled: true,
58 | },
59 | };
60 |
--------------------------------------------------------------------------------
/packages/react-components/src/stories/Form.css:
--------------------------------------------------------------------------------
1 | /* Boilerplate CSS used to style the example form in Storybook */
2 | .bcds-react-aria-Form {
3 | display: flex;
4 | flex-direction: column;
5 | gap: var(--layout-margin-small);
6 | width: 100%;
7 | max-width: 100%;
8 | }
9 |
10 | .bcds-react-aria-Form > .field {
11 | display: flex;
12 | gap: var(--layout-margin-xsmall);
13 | width: 100%;
14 | max-width: 100%;
15 | }
16 |
17 | .bcds-react-aria-Form > .buttonGroup {
18 | display: inline-flex;
19 | flex-direction: row;
20 | align-items: flex-start;
21 | gap: var(--layout-margin-none) var(--layout-margin-small);
22 | margin: var(--layout-margin-small) var(--layout-margin-none);
23 | }
24 |
--------------------------------------------------------------------------------
/packages/react-components/src/stories/Tag.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from "@storybook/react";
2 |
3 | import { TagGroup, TagList, Tag } from "../components";
4 | import { TagProps } from "../components/Tag";
5 |
6 | const meta = {
7 | title: "Components/TagGroup/Tag",
8 | component: Tag,
9 | parameters: {
10 | layout: "centered",
11 | },
12 | argTypes: {
13 | id: { control: "text", description: "Unique ID for the tag" },
14 | color: { control: "text", description: "Tag color" },
15 | textValue: { control: "text", description: "The text value of the tag" },
16 | },
17 | } satisfies Meta;
18 |
19 | export default meta;
20 | type Story = StoryObj;
21 |
22 | export const SingleTag: Story = {
23 | args: {
24 | id: "single-tag",
25 | color: "blue",
26 | tagStyle: "rectangular",
27 | size: "small",
28 | textValue: "Single tag",
29 | },
30 | render: (args: TagProps) => (
31 |
32 |
33 |
34 | ),
35 | };
36 |
--------------------------------------------------------------------------------
/packages/react-components/src/stories/TagList.stories.tsx:
--------------------------------------------------------------------------------
1 | import type { Meta, StoryObj } from "@storybook/react";
2 |
3 | import { TagGroup, TagList } from "../components";
4 |
5 | const meta = {
6 | title: "Components/TagGroup/TagList",
7 | component: TagList,
8 | parameters: {
9 | layout: "centered",
10 | },
11 | argTypes: {
12 | items: {
13 | value: {
14 | id: { control: "text", description: "Unique ID for the tag" },
15 | color: { control: "text", description: "Tag color" },
16 | textValue: {
17 | control: "text",
18 | description: "The text value of the tag",
19 | },
20 | },
21 | },
22 | },
23 | } satisfies Meta;
24 |
25 | export default meta;
26 | type Story = StoryObj;
27 |
28 | export const ThreeTagList: Story = {
29 | args: {
30 | items: [
31 | {
32 | id: "1",
33 | textValue: "One",
34 | },
35 | {
36 | id: "2",
37 | textValue: "Two",
38 | },
39 | {
40 | id: "3",
41 | textValue: "Three",
42 | },
43 | ],
44 | },
45 | render: (args) => (
46 |
47 |
48 |
49 | ),
50 | };
51 |
--------------------------------------------------------------------------------
/packages/react-components/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/packages/react-components/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true,
22 |
23 | /* Rollup types */
24 | "declaration": true,
25 | "declarationDir": "types",
26 |
27 | /* Path alias for Vite app */
28 | "baseUrl": ".",
29 | "paths": {
30 | "@/*": ["src/*"]
31 | }
32 | },
33 | "include": ["src"],
34 | "references": [{ "path": "./tsconfig.vite.json" }]
35 | }
36 |
--------------------------------------------------------------------------------
/packages/react-components/tsconfig.vite.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/react-components/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import react from "@vitejs/plugin-react";
3 | import path from "path";
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | resolve: {
8 | alias: {
9 | "@": path.resolve(__dirname, "./src"),
10 | },
11 | },
12 | plugins: [react()],
13 | root: ".",
14 | build: {
15 | outDir: "vite-dist",
16 | },
17 | });
18 |
--------------------------------------------------------------------------------
/styles/Icons/icon-contrast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-contrast.png
--------------------------------------------------------------------------------
/styles/Icons/icon-label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-label.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/bars-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/bars-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/chevron-down-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/chevron-down-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/chevron-left-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/chevron-left-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/chevron-right-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/chevron-right-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/chevron-up-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/chevron-up-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/envelope-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/envelope-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/external-link-alt-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/external-link-alt-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/phone-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/phone-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/search.png
--------------------------------------------------------------------------------
/styles/Icons/icon-pngs/upload-solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/icon-pngs/upload-solid.png
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/bars-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/chevron-down-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/chevron-left-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/chevron-right-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/chevron-up-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/envelope-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/external-link-alt-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/phone-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/search.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/icon-svgs/upload-solid.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/Icons/target-area.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/Icons/target-area.png
--------------------------------------------------------------------------------
/styles/colours/images/002663.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/002663.png
--------------------------------------------------------------------------------
/styles/colours/images/003366.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/003366.png
--------------------------------------------------------------------------------
/styles/colours/images/1a5a96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/1a5a96.png
--------------------------------------------------------------------------------
/styles/colours/images/38598a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/38598a.png
--------------------------------------------------------------------------------
/styles/colours/images/481124.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/481124.png
--------------------------------------------------------------------------------
/styles/colours/images/486446.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/486446.png
--------------------------------------------------------------------------------
/styles/colours/images/494949.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/494949.png
--------------------------------------------------------------------------------
/styles/colours/images/5091cd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/5091cd.png
--------------------------------------------------------------------------------
/styles/colours/images/5475a7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/5475a7.png
--------------------------------------------------------------------------------
/styles/colours/images/616265.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/616265.png
--------------------------------------------------------------------------------
/styles/colours/images/8a9198.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/8a9198.png
--------------------------------------------------------------------------------
/styles/colours/images/96c0e6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/96c0e6.png
--------------------------------------------------------------------------------
/styles/colours/images/a12622.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/a12622.png
--------------------------------------------------------------------------------
/styles/colours/images/afafaf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/afafaf.png
--------------------------------------------------------------------------------
/styles/colours/images/bcbec5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/bcbec5.png
--------------------------------------------------------------------------------
/styles/colours/images/d0d0d1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/d0d0d1.png
--------------------------------------------------------------------------------
/styles/colours/images/d8292f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/d8292f.png
--------------------------------------------------------------------------------
/styles/colours/images/f2f2f2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/f2f2f2.png
--------------------------------------------------------------------------------
/styles/colours/images/f3bd48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/f3bd48.png
--------------------------------------------------------------------------------
/styles/colours/images/f3cd65.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/f3cd65.png
--------------------------------------------------------------------------------
/styles/colours/images/fade81.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/fade81.png
--------------------------------------------------------------------------------
/styles/colours/images/fcba19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/fcba19.png
--------------------------------------------------------------------------------
/styles/colours/images/ffffff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/colours/images/ffffff.png
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.css:
--------------------------------------------------------------------------------
1 | /* Webfont: BCSans-Bold */@font-face {
2 | font-family: 'BCSans';
3 | src: url('BCSans-Bold.eot'); /* IE9 Compat Modes */
4 | src: url('BCSans-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('BCSans-Bold.woff') format('woff'), /* Modern Browsers */
6 | url('BCSans-Bold.ttf') format('truetype'); /* Safari, Android, iOS */
7 | font-style: normal;
8 | font-weight: bold;
9 | text-rendering: optimizeLegibility;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Bold.eot
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Bold.otf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Bold.ttf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Bold.woff
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Bold.woff2
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.css:
--------------------------------------------------------------------------------
1 | /* Webfont: BCSans-BoldItalic */@font-face {
2 | font-family: 'BCSans';
3 | src: url('BCSans-BoldItalic.eot'); /* IE9 Compat Modes */
4 | src: url('BCSans-BoldItalic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('BCSans-BoldItalic.woff') format('woff'), /* Modern Browsers */
6 | url('BCSans-BoldItalic.ttf') format('truetype'); /* Safari, Android, iOS */
7 | font-style: italic;
8 | font-weight: bold;
9 | text-rendering: optimizeLegibility;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-BoldItalic.eot
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-BoldItalic.otf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-BoldItalic.ttf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-BoldItalic.woff
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-BoldItalic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-BoldItalic.woff2
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.css:
--------------------------------------------------------------------------------
1 | /* Webfont: BCSans-Italic */@font-face {
2 | font-family: 'BCSans';
3 | src: url('BCSans-Italic.eot'); /* IE9 Compat Modes */
4 | src: url('BCSans-Italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('BCSans-Italic.woff') format('woff'), /* Modern Browsers */
6 | url('BCSans-Italic.ttf') format('truetype'); /* Safari, Android, iOS */
7 | font-style: italic;
8 | font-weight: normal;
9 | text-rendering: optimizeLegibility;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Italic.eot
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Italic.otf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Italic.ttf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Italic.woff
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Italic.woff2
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.css:
--------------------------------------------------------------------------------
1 | /* Webfont: BCSans-Regular */@font-face {
2 | font-family: 'BCSans';
3 | src: url('BCSans-Regular.eot'); /* IE9 Compat Modes */
4 | src: url('BCSans-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
5 | url('BCSans-Regular.woff') format('woff'), /* Modern Browsers */
6 | url('BCSans-Regular.ttf') format('truetype'); /* Safari, Android, iOS */
7 | font-style: normal;
8 | font-weight: normal;
9 | text-rendering: optimizeLegibility;
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Regular.eot
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Regular.otf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Regular.ttf
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Regular.woff
--------------------------------------------------------------------------------
/styles/typography/fonts/BCSans-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bcgov/design-system/096e495488948dd1c0a984d4d0b4b6c0ca694e4c/styles/typography/fonts/BCSans-Regular.woff2
--------------------------------------------------------------------------------
/styles/typography/fonts/FONTLOG_README.txt:
--------------------------------------------------------------------------------
1 | FONTLOG for the BC Sans font
2 |
3 | This file provides detailed information on the BC Sans font software.
4 |
5 | This information should be distributed along with the BC Sans fonts and any derivative works.
6 |
7 | Basic Font Information
8 |
9 | BC Sans is a Unicode typeface family that supports languages that use the Latin and syllabic scripts, and it's variants.
10 |
11 | BC Sans is a modified version of Noto Sans, developed by Google. Modifications have been done to provide support for Indigenous languages unique to British Columbia.
12 |
13 | BC Sans comes in four styles: regular, bold, italic, and bold italic
14 |
15 | ChangeLog
16 |
17 | 20 July 2019 (B.C Government) BCSansFontFamily Version 1.0
18 | - Initial release
19 | - Combined NotoSans font with NotoSansCanadianAboriginal font into single font file
20 | - Renamed Noto Sans to BC Sans
21 | - Fixed combining position of "combining lowline" (U+0332) for dz and ts combinations
22 | - Added right spacing to the "combining comma above right" (U+0315)
23 | - Added syllabic variant positioning for the Dakelh syllabics
24 |
25 | Acknowledgements
26 |
27 | N: Chris Harvey
28 | E: languagegeek@gmail.com
29 | W: http://www.languagegeek.com
30 | D: Contributor
31 |
--------------------------------------------------------------------------------
/styles/typography/header-sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Headings
8 |
34 |
35 |
36 |
37 | Heading 1 - 2.074em (37.32px)
38 | Heading 2 - 1.728em (31.10px)
39 | Heading 3 - 1.44em (25.92px)
40 | Heading 4 - 1.2em (21.60px)
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/styles/typography/paragraph-sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Headings
8 |
21 |
22 |
23 |
24 | Members of the public service are the politically impartial government employees who are responsible for carrying out the day-to-day activities of government and for delivering public services to the citizens of B.C.
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------