This is some example content to display the grid component.
This is some example content to display the grid component.
diff --git a/packages/web/src/components/gcds-grid/stories/overview.mdx b/packages/web/src/components/gcds-grid/stories/overview.mdx
index a07974852..58847cd36 100644
--- a/packages/web/src/components/gcds-grid/stories/overview.mdx
+++ b/packages/web/src/components/gcds-grid/stories/overview.mdx
@@ -15,6 +15,32 @@ A grid is a responsive, flexible column layout to position elements on a page.
+### Simple grids
+
+#### Fluid grid
+
+Each grid column takes up a fractional amount of space within the grid and has no fixed width restrictions. The grid and its columns scale to the size of the viewport. This example has 4 columns for large viewports, 2 columns for medium viewports, and 1 column for smaller viewports.
+
+
+
+#### Fixed width grid
+
+In fixed width grids each grid column has a fixed minimum and a maximum width to limit how wide they will span on any screen size. The columns scale until they either reach their minimum or their maximum width. Once a grid column reaches its minimum width, it gets moved to the next row if the space on the current row becomes smaller than its minimum width. In this example each grid column has a minimum width of 100px and a maximum width of 300px.
+
+
+
+### Hybrid grid
+
+Hybrid grid columns include either a minimum or a maximum width and one fractional width. In this example each grid column is responsive with a minimum width of 400px and no maximum width which means it takes up the available space.
+
+
+
+### Individually sized grid
+
+When using individually sized grid columns, the grid columns define their own size. Each grid column can define a base, tablet (optional) and desktop (optional) size.
+
+
+
### Grid columns
#### Columns
@@ -35,24 +61,10 @@ Use the `columns-desktop` property to define your layout for larger screens **(6
-### Equal width column
-
-#### Without width restrictions
-
-Opt out of setting the minimum and maximum width when you want to design equal-width columns without width restrictions. This will allow the grid and its columns to scale to the size of the viewport.
-
-
-
-#### Setting a minimum und maximum width
-
-Set the minimum and maximum width to design equal-width columns with restrictions to limit how wide they will span on any screen size.
-
-
-
## Resources
{/* prettier-ignore */}
-
diff --git a/packages/web/src/index.html b/packages/web/src/index.html
index 0ab536b48..003522d8e 100644
--- a/packages/web/src/index.html
+++ b/packages/web/src/index.html
@@ -154,7 +154,6 @@
columns-desktop="1fr 1fr 1fr"
columns-tablet="1fr 1fr"
columns="1fr"
- gap="250"
>
- Grid
+ Grids
+
+ Simple grids
+
+ Fluid grid
+
+ Each grid column takes up a fractional amount of space within the grid
+ and has no fixed width restrictions. The grid and its columns scale to
+ the size of the viewport. This example has 4 columns for large
+ viewports, 2 columns for medium viewports, and 1 column for smaller
+ viewports.
+
-
- Lorem Ipsum has been the industry's standard dummy text ever since the
- 1500s, when an unknown printer took a galley of type and scrambled it
- to make a type specimen book.
+
+ This is some example content to display the grid component.
-
- Lorem Ipsum has been the industry's standard dummy text ever since the
- 1500s, when an unknown printer took a galley of type and scrambled it
- to make a type specimen book.
+
+ This is some example content to display the grid component.
-
- Lorem Ipsum has been the industry's standard dummy text ever since the
- 1500s, when an unknown printer took a galley of type and scrambled it
- to make a type specimen book.
+
+ This is some example content to display the grid component.
-
- Lorem Ipsum has been the industry's standard dummy text ever since the
- 1500s, when an unknown printer took a galley of type and scrambled it
- to make a type specimen book.
+
+
+ Fixed grid
+
+ In fixed width grids each grid column has a fixed minimum and a maximum
+ width to limit how wide they will span on any screen size. The columns
+ scale until they either reach their minimum or their maximum width. Once
+ a grid column reaches its minimum width, it gets moved to the next row
+ if the space on the current row becomes smaller than its minimum width.
+ In this example each grid column has a minimum width of 100px and a
+ maximum width of 300px.
+
+
+
+ This is some example content to display the grid component.
+
+ This is some example content to display the grid component.
+
+
+ This is some example content to display the grid component.
+
+
+
+ Hybrid grid
+
+ Hybrid grid columns include either a minimum or a maximum width and one
+ fractional width. In this example each grid column is responsive with a
+ minimum width of 400px and no maximum width which means it takes up the
+ available space.
+
+
+
+ This is some example content to display the grid component.
+
+
+ This is some example content to display the grid component.
+
+
+
+ Individually sized grid
+
+ When using individually sized grid columns, the grid columns define
+ their own size. Each grid column can define a base, tablet (optional)
+ and desktop (optional) size.
+
+
+
+
diff --git a/packages/web/src/components/gcds-button/stories/overview.mdx b/packages/web/src/components/gcds-button/stories/overview.mdx
index 8f50cb268..ffadfde61 100644
--- a/packages/web/src/components/gcds-button/stories/overview.mdx
+++ b/packages/web/src/components/gcds-button/stories/overview.mdx
@@ -85,7 +85,7 @@ A button is an interactive object that highlights an important or common action.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-card/stories/overview.mdx b/packages/web/src/components/gcds-card/stories/overview.mdx
index ad1fa0761..952b69d3d 100644
--- a/packages/web/src/components/gcds-card/stories/overview.mdx
+++ b/packages/web/src/components/gcds-card/stories/overview.mdx
@@ -32,7 +32,7 @@ A card is a box containing structured, actionable content on a single topic.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-checkbox/stories/overview.mdx b/packages/web/src/components/gcds-checkbox/stories/overview.mdx
index 7aee64816..dafe9d5b1 100644
--- a/packages/web/src/components/gcds-checkbox/stories/overview.mdx
+++ b/packages/web/src/components/gcds-checkbox/stories/overview.mdx
@@ -40,7 +40,7 @@ A checkbox is a set of options for one or multiple selections.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-container/stories/overview.mdx b/packages/web/src/components/gcds-container/stories/overview.mdx
index ac1aa8220..aa7e68f5b 100644
--- a/packages/web/src/components/gcds-container/stories/overview.mdx
+++ b/packages/web/src/components/gcds-container/stories/overview.mdx
@@ -56,7 +56,7 @@ A box to group content by limiting the width.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-date-modified/stories/overview.mdx b/packages/web/src/components/gcds-date-modified/stories/overview.mdx
index a81467d62..5a7a6cf66 100644
--- a/packages/web/src/components/gcds-date-modified/stories/overview.mdx
+++ b/packages/web/src/components/gcds-date-modified/stories/overview.mdx
@@ -38,7 +38,7 @@ A timestamp of the last page update.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-details/stories/overview.mdx b/packages/web/src/components/gcds-details/stories/overview.mdx
index cbd9e0775..8c8f31e7a 100644
--- a/packages/web/src/components/gcds-details/stories/overview.mdx
+++ b/packages/web/src/components/gcds-details/stories/overview.mdx
@@ -28,7 +28,7 @@ Details is an interactive switch for a person to expand or collapse content.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-error-message/stories/overview.mdx b/packages/web/src/components/gcds-error-message/stories/overview.mdx
index 2271e15d5..4a7a61eaf 100644
--- a/packages/web/src/components/gcds-error-message/stories/overview.mdx
+++ b/packages/web/src/components/gcds-error-message/stories/overview.mdx
@@ -22,7 +22,7 @@ An error message is a description of a problem blocking a user goal.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-error-summary/stories/overview.mdx b/packages/web/src/components/gcds-error-summary/stories/overview.mdx
index 9b919ab38..2ca3e4eb9 100644
--- a/packages/web/src/components/gcds-error-summary/stories/overview.mdx
+++ b/packages/web/src/components/gcds-error-summary/stories/overview.mdx
@@ -22,7 +22,7 @@ An error summary is a list of user errors in a form.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-fieldset/stories/overview.mdx b/packages/web/src/components/gcds-fieldset/stories/overview.mdx
index 4d041f956..8c45561cd 100644
--- a/packages/web/src/components/gcds-fieldset/stories/overview.mdx
+++ b/packages/web/src/components/gcds-fieldset/stories/overview.mdx
@@ -36,7 +36,7 @@ A fieldset is a group of multiple form components or elements.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-file-uploader/stories/overview.mdx b/packages/web/src/components/gcds-file-uploader/stories/overview.mdx
index b643282f9..39bd81cce 100644
--- a/packages/web/src/components/gcds-file-uploader/stories/overview.mdx
+++ b/packages/web/src/components/gcds-file-uploader/stories/overview.mdx
@@ -86,7 +86,7 @@ By default all file formats are allowed.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-footer/stories/overview.mdx b/packages/web/src/components/gcds-footer/stories/overview.mdx
index 88c4d6cc9..b35dee49e 100644
--- a/packages/web/src/components/gcds-footer/stories/overview.mdx
+++ b/packages/web/src/components/gcds-footer/stories/overview.mdx
@@ -32,7 +32,7 @@ The footer is the responsive Government of Canada branded footer landmark.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-header/stories/overview.mdx b/packages/web/src/components/gcds-header/stories/overview.mdx
index ea3ded1d8..ca3e4e6ae 100644
--- a/packages/web/src/components/gcds-header/stories/overview.mdx
+++ b/packages/web/src/components/gcds-header/stories/overview.mdx
@@ -48,7 +48,7 @@ The header is the responsive Government of Canada branded header landmark.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-heading/stories/overview.mdx b/packages/web/src/components/gcds-heading/stories/overview.mdx
index b608e9a67..d4a5b61b0 100644
--- a/packages/web/src/components/gcds-heading/stories/overview.mdx
+++ b/packages/web/src/components/gcds-heading/stories/overview.mdx
@@ -44,7 +44,7 @@ A title that structures content by creating levels of hierarchy that organize pa
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-icon/stories/overview.mdx b/packages/web/src/components/gcds-icon/stories/overview.mdx
index 3c14e4e45..45ca6129c 100644
--- a/packages/web/src/components/gcds-icon/stories/overview.mdx
+++ b/packages/web/src/components/gcds-icon/stories/overview.mdx
@@ -48,7 +48,7 @@ If you are using an icon by itself, use the `label` to ensure that it has the pr
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-input/stories/overview.mdx b/packages/web/src/components/gcds-input/stories/overview.mdx
index 9fc6ebb06..7797992db 100644
--- a/packages/web/src/components/gcds-input/stories/overview.mdx
+++ b/packages/web/src/components/gcds-input/stories/overview.mdx
@@ -62,7 +62,7 @@ An input is a space to enter short-form information in response to a question or
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx b/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx
index 36e888e3e..bafde0208 100644
--- a/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx
+++ b/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx
@@ -28,7 +28,7 @@ The language toggle is a link to the same content in the other Official Language
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-link/stories/overview.mdx b/packages/web/src/components/gcds-link/stories/overview.mdx
index 0fd05b4d5..36f9b3ab2 100644
--- a/packages/web/src/components/gcds-link/stories/overview.mdx
+++ b/packages/web/src/components/gcds-link/stories/overview.mdx
@@ -48,7 +48,7 @@ A navigational element that allows users to navigate to a new page, website or s
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-nav-group/stories/overview.mdx b/packages/web/src/components/gcds-nav-group/stories/overview.mdx
index d24778cb2..eaaaee436 100644
--- a/packages/web/src/components/gcds-nav-group/stories/overview.mdx
+++ b/packages/web/src/components/gcds-nav-group/stories/overview.mdx
@@ -38,7 +38,7 @@ import * as NavGroup from './gcds-nav-group.stories';
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-nav-link/stories/overview.mdx b/packages/web/src/components/gcds-nav-link/stories/overview.mdx
index ebbe852f5..e8e697dd4 100644
--- a/packages/web/src/components/gcds-nav-link/stories/overview.mdx
+++ b/packages/web/src/components/gcds-nav-link/stories/overview.mdx
@@ -34,7 +34,7 @@ import * as NavLink from './gcds-nav-link.stories';
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-pagination/stories/overview.mdx b/packages/web/src/components/gcds-pagination/stories/overview.mdx
index f351cdbb7..c517601ea 100644
--- a/packages/web/src/components/gcds-pagination/stories/overview.mdx
+++ b/packages/web/src/components/gcds-pagination/stories/overview.mdx
@@ -50,7 +50,7 @@ Pagination is a division of content into multiple linked pages.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-radio/stories/overview.mdx b/packages/web/src/components/gcds-radio/stories/overview.mdx
index 9f50ac3d1..7f75436ea 100644
--- a/packages/web/src/components/gcds-radio/stories/overview.mdx
+++ b/packages/web/src/components/gcds-radio/stories/overview.mdx
@@ -36,7 +36,7 @@ A radio is a set of options for a single selection.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-search/stories/overview.mdx b/packages/web/src/components/gcds-search/stories/overview.mdx
index 9d7bc625d..b87a52420 100644
--- a/packages/web/src/components/gcds-search/stories/overview.mdx
+++ b/packages/web/src/components/gcds-search/stories/overview.mdx
@@ -32,7 +32,7 @@ Search is a way to enter keywords to find relevant information.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-select/stories/overview.mdx b/packages/web/src/components/gcds-select/stories/overview.mdx
index 3f503b919..cbec992b5 100644
--- a/packages/web/src/components/gcds-select/stories/overview.mdx
+++ b/packages/web/src/components/gcds-select/stories/overview.mdx
@@ -46,7 +46,7 @@ A list of options with a single-option choice.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-side-nav/stories/overview.mdx b/packages/web/src/components/gcds-side-nav/stories/overview.mdx
index df77d1fad..54072677c 100644
--- a/packages/web/src/components/gcds-side-nav/stories/overview.mdx
+++ b/packages/web/src/components/gcds-side-nav/stories/overview.mdx
@@ -22,7 +22,7 @@ A side navigation is a vertical list of page links on the left side of the scree
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-signature/stories/overview.mdx b/packages/web/src/components/gcds-signature/stories/overview.mdx
index 4881bbef6..9879b9791 100644
--- a/packages/web/src/components/gcds-signature/stories/overview.mdx
+++ b/packages/web/src/components/gcds-signature/stories/overview.mdx
@@ -73,7 +73,7 @@ The signature is the Government of Canada landmark identifier found in the heade
## Resources
{/* prettier-ignore */}
-
diff --git a/packages/web/src/components/gcds-stepper/stories/overview.mdx b/packages/web/src/components/gcds-stepper/stories/overview.mdx
index d06ca5856..2f977ff89 100644
--- a/packages/web/src/components/gcds-stepper/stories/overview.mdx
+++ b/packages/web/src/components/gcds-stepper/stories/overview.mdx
@@ -28,7 +28,7 @@ A stepper is a progress tracker for a multi-step process.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-text/stories/overview.mdx b/packages/web/src/components/gcds-text/stories/overview.mdx
index 424d276e8..094b398a0 100644
--- a/packages/web/src/components/gcds-text/stories/overview.mdx
+++ b/packages/web/src/components/gcds-text/stories/overview.mdx
@@ -52,7 +52,7 @@ Text is a paragraph displaying non-heading content with matching GC Design Syste
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-textarea/stories/overview.mdx b/packages/web/src/components/gcds-textarea/stories/overview.mdx
index 24f1d8962..1df4e511e 100644
--- a/packages/web/src/components/gcds-textarea/stories/overview.mdx
+++ b/packages/web/src/components/gcds-textarea/stories/overview.mdx
@@ -44,7 +44,7 @@ A text area is a space to enter long-form information in response to a question
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-top-nav/stories/overview.mdx b/packages/web/src/components/gcds-top-nav/stories/overview.mdx
index 15cf7af52..15c8c8adc 100644
--- a/packages/web/src/components/gcds-top-nav/stories/overview.mdx
+++ b/packages/web/src/components/gcds-top-nav/stories/overview.mdx
@@ -38,7 +38,7 @@ A top navigation is a horizontal list of page links.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-topic-menu/stories/overview.mdx b/packages/web/src/components/gcds-topic-menu/stories/overview.mdx
index 084d5b93a..f03fd7fbb 100644
--- a/packages/web/src/components/gcds-topic-menu/stories/overview.mdx
+++ b/packages/web/src/components/gcds-topic-menu/stories/overview.mdx
@@ -30,7 +30,7 @@ Navigate to the top tasks from all Government of Canada websites.
## Resources
{/* prettier-ignore */}
-
+
Guidance
diff --git a/packages/web/src/components/gcds-verify-banner/stories/overview.mdx b/packages/web/src/components/gcds-verify-banner/stories/overview.mdx
index 5f08579c2..e9e956b71 100644
--- a/packages/web/src/components/gcds-verify-banner/stories/overview.mdx
+++ b/packages/web/src/components/gcds-verify-banner/stories/overview.mdx
@@ -50,7 +50,7 @@ import * as VerifyBanner from './gcds-verify-banner.stories';
## Resources
{/* prettier-ignore */}
-
+
Guidance
From dfd1cee24bb628328ca724b7bde383c25886f031 Mon Sep 17 00:00:00 2001
From: "sre-read-write[bot]"
<92993749+sre-read-write[bot]@users.noreply.github.com>
Date: Mon, 18 Dec 2023 09:14:54 -0800
Subject: [PATCH 05/10] chore: synced file(s) with
cds-snc/site-reliability-engineering (#360)
* chore: synced local '.github/workflows/s3-backup.yml' with remote 'tools/sre_file_sync/s3-backup.yml'
* chore: synced local '.github/workflows/export_github_data.yml' with remote 'tools/sre_file_sync/export_github_data.yml'
* chore: synced local '.github/workflows/ossf-scorecard.yml' with remote 'tools/sre_file_sync/ossf-scorecard.yml'
---------
Co-authored-by: sre-read-write[bot] <92993749+sre-read-write[bot]@users.noreply.github.com>
---
.github/workflows/export_github_data.yml | 2 +-
.github/workflows/ossf-scorecard.yml | 4 ++--
.github/workflows/s3-backup.yml | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/export_github_data.yml b/.github/workflows/export_github_data.yml
index 941e3ba2f..d12fdc136 100644
--- a/.github/workflows/export_github_data.yml
+++ b/.github/workflows/export_github_data.yml
@@ -14,7 +14,7 @@ jobs:
DNS_PROXY_FORWARDTOSENTINEL: "true"
DNS_PROXY_LOGANALYTICSWORKSPACEID: ${{ secrets.LOG_ANALYTICS_WORKSPACE_ID }}
DNS_PROXY_LOGANALYTICSSHAREDKEY: ${{ secrets.LOG_ANALYTICS_WORKSPACE_KEY }}
- - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Export Data
uses: cds-snc/github-repository-metadata-exporter@main
with:
diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml
index c85904fca..d499643c6 100644
--- a/.github/workflows/ossf-scorecard.yml
+++ b/.github/workflows/ossf-scorecard.yml
@@ -20,12 +20,12 @@ jobs:
steps:
- name: "Checkout code"
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@2fa1e2fa153141e2950c7e1299ed05e2081ead0c
+ uses: ossf/scorecard-action@75cb7af1033cfb77c9fc7d8abc30420008f558f4
with:
results_file: ossf-results.json
results_format: json
diff --git a/.github/workflows/s3-backup.yml b/.github/workflows/s3-backup.yml
index 61e9aab06..eb41d4c82 100644
--- a/.github/workflows/s3-backup.yml
+++ b/.github/workflows/s3-backup.yml
@@ -10,7 +10,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # retrieve all history
From 34b392d39f2ca0158fd608e46dcfc0509bbc69c0 Mon Sep 17 00:00:00 2001
From: Melanie Boeckmann
Date: Mon, 18 Dec 2023 13:44:48 -0800
Subject: [PATCH 06/10] feat: add light link-variant to link component (#358)
* feat: add light link-role to link component
* pr feedback
* rename link-role prop to link-variant
---
.../src/lib/stencil-generated/components.ts | 4 +-
packages/web/.storybook/preview-head.html | 6 ++
packages/web/src/components.d.ts | 8 +++
.../src/components/gcds-link/gcds-link.css | 7 ++-
.../src/components/gcds-link/gcds-link.tsx | 22 ++++++-
.../web/src/components/gcds-link/readme.md | 21 +++----
.../gcds-link/stories/gcds-link.stories.js | 59 +++++++++++++++++++
.../components/gcds-link/stories/overview.mdx | 10 ++++
.../gcds-link/test/gcds-link.spec.ts | 17 ++++++
packages/web/src/index.html | 31 ++++++----
10 files changed, 159 insertions(+), 26 deletions(-)
diff --git a/packages/angular/src/lib/stencil-generated/components.ts b/packages/angular/src/lib/stencil-generated/components.ts
index e8a15d2ad..0e2df79ce 100644
--- a/packages/angular/src/lib/stencil-generated/components.ts
+++ b/packages/angular/src/lib/stencil-generated/components.ts
@@ -623,14 +623,14 @@ export declare interface GcdsLangToggle extends Components.GcdsLangToggle {}
@ProxyCmp({
- inputs: ['display', 'download', 'external', 'href', 'rel', 'size', 'target', 'type']
+ inputs: ['display', 'download', 'external', 'href', 'linkVariant', 'rel', 'size', 'target', 'type']
})
@Component({
selector: 'gcds-link',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
- inputs: ['display', 'download', 'external', 'href', 'rel', 'size', 'target', 'type'],
+ inputs: ['display', 'download', 'external', 'href', 'linkVariant', 'rel', 'size', 'target', 'type'],
})
export class GcdsLink {
protected el: HTMLElement;
diff --git a/packages/web/.storybook/preview-head.html b/packages/web/.storybook/preview-head.html
index 7d7e285fc..b19999dfa 100644
--- a/packages/web/.storybook/preview-head.html
+++ b/packages/web/.storybook/preview-head.html
@@ -351,6 +351,12 @@
border: var(--gcds-border-width-sm) solid var(--gcds-border-default);
}
+ /* gcds-link */
+ .sbdocs-preview .docs-story #story--components-link--variant-light {
+ background: var(--gcds-color-grayscale-900);
+ padding: var(--gcds-spacing-450);
+ }
+
/* gcds-signature */
.sbdocs-preview .docs-story #story--components-signature--signature-white,
.sbdocs-preview .docs-story #story--components-signature--wordmark-white {
diff --git a/packages/web/src/components.d.ts b/packages/web/src/components.d.ts
index af96b5d1c..ea20864da 100644
--- a/packages/web/src/components.d.ts
+++ b/packages/web/src/components.d.ts
@@ -770,6 +770,10 @@ export namespace Components {
* The href attribute specifies the URL of the page the link goes to
*/
"href": string;
+ /**
+ * Sets the main style of the link.
+ */
+ "linkVariant"?: 'default' | 'light';
/**
* The rel attribute specifies the relationship between the current document and the linked document
*/
@@ -2590,6 +2594,10 @@ declare namespace LocalJSX {
* The href attribute specifies the URL of the page the link goes to
*/
"href": string;
+ /**
+ * Sets the main style of the link.
+ */
+ "linkVariant"?: 'default' | 'light';
/**
* Emitted when the link loses focus.
*/
diff --git a/packages/web/src/components/gcds-link/gcds-link.css b/packages/web/src/components/gcds-link/gcds-link.css
index 53928d3a1..e83cbc65e 100644
--- a/packages/web/src/components/gcds-link/gcds-link.css
+++ b/packages/web/src/components/gcds-link/gcds-link.css
@@ -16,7 +16,8 @@
background-color: var(--gcds-link-focus-background);
color: var(--gcds-link-focus-text);
box-shadow: var(--gcds-link-focus-box-shadow);
- outline: var(--gcds-link-focus-outline-width) solid var(--gcds-link-focus-background);
+ outline: var(--gcds-link-focus-outline-width) solid
+ var(--gcds-link-focus-background);
outline-offset: var(--gcds-link-focus-outline-offset);
border-color: var(--gcds-link-focus-background);
text-decoration: none;
@@ -34,6 +35,10 @@
font: inherit;
}
+ &.variant-light {
+ color: var(--gcds-link-light);
+ }
+
&.d-block {
display: block;
}
diff --git a/packages/web/src/components/gcds-link/gcds-link.tsx b/packages/web/src/components/gcds-link/gcds-link.tsx
index c8ee59b76..1fb6add38 100644
--- a/packages/web/src/components/gcds-link/gcds-link.tsx
+++ b/packages/web/src/components/gcds-link/gcds-link.tsx
@@ -27,6 +27,20 @@ export class GcdsLink {
* Props
*/
+ /**
+ * Sets the main style of the link.
+ */
+ @Prop({ mutable: true }) linkVariant?: 'default' | 'light' = 'default';
+
+ @Watch('linkVariant')
+ validateLinkVariant(newValue: string) {
+ const values = ['default', 'light'];
+
+ if (!values.includes(newValue)) {
+ this.linkVariant = 'default';
+ }
+ }
+
/**
* Set the link size
*/
@@ -43,7 +57,7 @@ export class GcdsLink {
/**
* Sets the display behavior of the link
*/
- @Prop() display?: 'block' | 'inline' = 'inline';
+ @Prop({ mutable: true }) display?: 'block' | 'inline' = 'inline';
@Watch('display')
validateDisplay(newValue: string) {
const values = ['block', 'inline'];
@@ -125,6 +139,7 @@ export class GcdsLink {
componentWillLoad() {
// Validate attributes and set defaults
+ this.validateLinkVariant(this.linkVariant);
this.validateSize(this.size);
this.validateDisplay(this.display);
@@ -144,6 +159,7 @@ export class GcdsLink {
lang,
display,
href,
+ linkVariant,
rel,
target,
external,
@@ -169,7 +185,9 @@ export class GcdsLink {
role="link"
tabIndex={0}
{...attrs}
- class={`link--${size} ${display != 'inline' ? `d-${display}` : ''}`}
+ class={`link--${size} ${display != 'inline' ? `d-${display}` : ''} ${
+ linkVariant != 'default' ? `variant-${linkVariant}` : ''
+ }`}
ref={element => (this.shadowElement = element as HTMLElement)}
target={isExternal ? '_blank' : target}
rel={isExternal ? 'noopener noreferrer' : rel}
diff --git a/packages/web/src/components/gcds-link/readme.md b/packages/web/src/components/gcds-link/readme.md
index 8df7212fe..f4a790a5e 100644
--- a/packages/web/src/components/gcds-link/readme.md
+++ b/packages/web/src/components/gcds-link/readme.md
@@ -7,16 +7,17 @@
## Properties
-| Property | Attribute | Description | Type | Default |
-| ------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ----------- |
-| `display` | `display` | Sets the display behavior of the link | `"block" \| "inline"` | `'inline'` |
-| `download` | `download` | The download attribute specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink | `string` | `undefined` |
-| `external` | `external` | Whether the link is external or not | `boolean` | `false` |
-| `href` _(required)_ | `href` | The href attribute specifies the URL of the page the link goes to | `string` | `undefined` |
-| `rel` | `rel` | The rel attribute specifies the relationship between the current document and the linked document | `string` | `undefined` |
-| `size` | `size` | Set the link size | `"inherit" \| "regular" \| "small"` | `'inherit'` |
-| `target` | `target` | The target attribute specifies where to open the linked document | `string` | `'_self'` |
-| `type` | `type` | The type specifies the media type of the linked document | `string` | `undefined` |
+| Property | Attribute | Description | Type | Default |
+| ------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ----------- |
+| `display` | `display` | Sets the display behavior of the link | `"block" \| "inline"` | `'inline'` |
+| `download` | `download` | The download attribute specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink | `string` | `undefined` |
+| `external` | `external` | Whether the link is external or not | `boolean` | `false` |
+| `href` _(required)_ | `href` | The href attribute specifies the URL of the page the link goes to | `string` | `undefined` |
+| `linkVariant` | `link-variant` | Sets the main style of the link. | `"default" \| "light"` | `'default'` |
+| `rel` | `rel` | The rel attribute specifies the relationship between the current document and the linked document | `string` | `undefined` |
+| `size` | `size` | Set the link size | `"inherit" \| "regular" \| "small"` | `'inherit'` |
+| `target` | `target` | The target attribute specifies where to open the linked document | `string` | `'_self'` |
+| `type` | `type` | The type specifies the media type of the linked document | `string` | `undefined` |
## Events
diff --git a/packages/web/src/components/gcds-link/stories/gcds-link.stories.js b/packages/web/src/components/gcds-link/stories/gcds-link.stories.js
index bbfd0f2fe..683fee571 100644
--- a/packages/web/src/components/gcds-link/stories/gcds-link.stories.js
+++ b/packages/web/src/components/gcds-link/stories/gcds-link.stories.js
@@ -33,6 +33,15 @@ export default {
defaultValue: { summary: '-' },
},
},
+ linkVariant: {
+ name: 'link-variant',
+ control: { type: 'select' },
+ options: ['default', 'light'],
+ table: {
+ type: { summary: 'string' },
+ defaultValue: { summary: 'default' },
+ },
+ },
rel: {
control: 'text',
table: {
@@ -88,6 +97,8 @@ This is an example of
`
This is an example of ${args.default} link
+
This is an example of ${args.default} link
`;
+const TemplateVariant = args =>
+ `
+
+${args.default}
+
+
+${args.default}
+`.replace(/ null/g, '');
+
const TemplatePlayground = args => `
`
`;
// ------ Link Default ------
+
export const Default = Template.bind({});
Default.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'inherit',
@@ -145,10 +176,12 @@ Default.args = {
};
// ------ Link events & props ------
+
export const Props = Template.bind({});
Props.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'inherit',
@@ -158,10 +191,13 @@ Props.args = {
default: 'a GCDS Link component',
};
+// ------ Link with icon ------
+
export const External = Template.bind({});
External.args = {
display: 'inline',
href: 'http://design-system.alpha.canada.ca',
+ linkVariant: 'default',
rel: '',
target: '_blank',
size: 'inherit',
@@ -175,6 +211,7 @@ export const Download = Template.bind({});
Download.args = {
href: 'long-filename.pdf',
display: 'inline',
+ linkVariant: 'default',
target: '_self',
size: 'inherit',
download: 'file.pdf',
@@ -185,6 +222,7 @@ Download.args = {
export const Email = Template.bind({});
Email.args = {
display: 'inline',
+ linkVariant: 'default',
target: '_self',
size: 'inherit',
href: 'mailto:test@test.com?subject=Test%20Email',
@@ -194,16 +232,20 @@ Email.args = {
export const Phone = Template.bind({});
Phone.args = {
display: 'inline',
+ linkVariant: 'default',
target: '_self',
size: 'inherit',
href: 'tel:1234567890',
default: 'a phone number',
};
+// ------ Link sizes ------
+
export const SizesSmall = Template.bind({});
SizesSmall.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'small',
@@ -217,6 +259,7 @@ export const SizesRegular = Template.bind({});
SizesRegular.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'regular',
@@ -230,6 +273,7 @@ export const SizesInherit = TemplateSizeInherit.bind({});
SizesInherit.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'inherit',
@@ -239,12 +283,27 @@ SizesInherit.args = {
default: 'a size inherit',
};
+// ------ Link roles ------
+
+export const VariantDefault = TemplateVariant.bind({});
+VariantDefault.args = {
+ default: 'This is a link using the default link variant.',
+ linkVariant: 'default',
+};
+
+export const VariantLight = TemplateVariant.bind({});
+VariantLight.args = {
+ default: 'This is a link using the light link variant.',
+ linkVariant: 'light',
+};
+
// ------ Link playground ------
export const Playground = TemplatePlayground.bind({});
Playground.args = {
display: 'inline',
href: '#',
+ linkVariant: 'default',
rel: '',
target: '_self',
size: 'inherit',
diff --git a/packages/web/src/components/gcds-link/stories/overview.mdx b/packages/web/src/components/gcds-link/stories/overview.mdx
index 36f9b3ab2..a3f36b615 100644
--- a/packages/web/src/components/gcds-link/stories/overview.mdx
+++ b/packages/web/src/components/gcds-link/stories/overview.mdx
@@ -45,6 +45,16 @@ A navigational element that allows users to navigate to a new page, website or s
+### Variants
+
+#### Default
+
+
+
+#### Light
+
+
+
## Resources
{/* prettier-ignore */}
diff --git a/packages/web/src/components/gcds-link/test/gcds-link.spec.ts b/packages/web/src/components/gcds-link/test/gcds-link.spec.ts
index cb5ea864e..1c07d727d 100644
--- a/packages/web/src/components/gcds-link/test/gcds-link.spec.ts
+++ b/packages/web/src/components/gcds-link/test/gcds-link.spec.ts
@@ -254,4 +254,21 @@ describe('gcds-link', () => {
`);
});
+
+ it('renders a light link variant', async () => {
+ const { root } = await newSpecPage({
+ components: [GcdsLink],
+ html: 'Link text',
+ });
+ expect(root).toEqualHtml(`
+
+
+
+
+
+
+ Link text
+
+ `);
+ });
});
diff --git a/packages/web/src/index.html b/packages/web/src/index.html
index 003522d8e..911ac2044 100644
--- a/packages/web/src/index.html
+++ b/packages/web/src/index.html
@@ -596,9 +596,13 @@
compare it to regular text.
- This is an external link.
+ This is an external link.
+
This is a
@@ -612,9 +616,9 @@
Contact us
- via email
+
+ via email
+
or by phone.
@@ -627,15 +631,20 @@
after this link.
- This is a sample link with a referrerpolicy.
+
+ This is a sample link with a referrerpolicy.
+