diff --git a/.github/workflows/backstage-catalog-helper.yml b/.github/workflows/backstage-catalog-helper.yml index 6a9863317..ddfe9c329 100644 --- a/.github/workflows/backstage-catalog-helper.yml +++ b/.github/workflows/backstage-catalog-helper.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Update catalog-info.yaml - uses: cds-snc/backstage-catalog-info-helper-action@v0.2.0 + uses: cds-snc/backstage-catalog-info-helper-action@v0.3.0 with: github-app-id: ${{ secrets.SRE_BOT_RW_APP_ID }} github-app-private-key: ${{ secrets.SRE_BOT_RW_APP_PRIVATE_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 795ec6b63..a38ace4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. +## v0.16.0 + +### New features + +- Heading component (`gcds-heading`) + - New `gcds-heading` to render headings in GCDS styles + +### Minor + +- https://github.com/cds-snc/gcds-components/pull/306 - [c972bef](https://github.com/cds-snc/gcds-components/commit/c972befacb6961fed73c983df1fb4fda6cbc9ca5) - Add `gcds-heading` to component library + +### Patch + +- https://github.com/cds-snc/gcds-components/pull/325 - [3ec8925](https://github.com/cds-snc/gcds-components/commit/3ec89251bf56b346df50ed67ad0a8992631240ff) - Fix slot CSS in gcds-breadcrumbs-item to display text underline + ## v0.15.0 ### New features diff --git a/lerna.json b/lerna.json index 351e765bc..65604a4a6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useNx": true, - "version": "0.15.0", + "version": "0.16.0", "packages": [ "packages/web", "packages/react", diff --git a/packages/angular/package-lock.json b/packages/angular/package-lock.json index 5905c83eb..c8490bad5 100644 --- a/packages/angular/package-lock.json +++ b/packages/angular/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cdssnc/gcds-components-angular", - "version": "0.15.0", + "version": "0.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cdssnc/gcds-components-angular", - "version": "0.15.0", + "version": "0.16.0", "dependencies": { "tslib": "^2.3.0" }, diff --git a/packages/angular/package.json b/packages/angular/package.json index 2ded7a5bb..2ad51e471 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,6 +1,6 @@ { "name": "@cdssnc/gcds-components-angular", - "version": "0.15.0", + "version": "0.16.0", "author": "Government of Canada / Gouvernement du Canada", "description": "Angular wrapper for gcds-components", "homepage": "https://design-system.alpha.canada.ca/", @@ -20,7 +20,7 @@ "peerDependencies": { "@angular/common": "^16.0.0", "@angular/core": "^16.0.0", - "@cdssnc/gcds-components": "^0.15.0" + "@cdssnc/gcds-components": "^0.16.0" }, "dependencies": { "tslib": "^2.3.0" diff --git a/packages/angular/src/lib/stencil-generated/components.ts b/packages/angular/src/lib/stencil-generated/components.ts index 4c05b0f34..682e122a8 100644 --- a/packages/angular/src/lib/stencil-generated/components.ts +++ b/packages/angular/src/lib/stencil-generated/components.ts @@ -445,6 +445,28 @@ export class GcdsHeader { export declare interface GcdsHeader extends Components.GcdsHeader {} +@ProxyCmp({ + inputs: ['characterLimit', 'marginBottom', 'marginTop', 'tag'] +}) +@Component({ + selector: 'gcds-heading', + changeDetection: ChangeDetectionStrategy.OnPush, + template: '', + // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property + inputs: ['characterLimit', 'marginBottom', 'marginTop', 'tag'], +}) +export class GcdsHeading { + protected el: HTMLElement; + constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) { + c.detach(); + this.el = r.nativeElement; + } +} + + +export declare interface GcdsHeading extends Components.GcdsHeading {} + + @ProxyCmp({ inputs: ['hint', 'hintId'] }) diff --git a/packages/angular/src/lib/stencil-generated/index.ts b/packages/angular/src/lib/stencil-generated/index.ts index 6dff23ba1..dd7225def 100644 --- a/packages/angular/src/lib/stencil-generated/index.ts +++ b/packages/angular/src/lib/stencil-generated/index.ts @@ -18,6 +18,7 @@ export const DIRECTIVES = [ d.GcdsFooter, d.GcdsGrid, d.GcdsHeader, + d.GcdsHeading, d.GcdsHint, d.GcdsIcon, d.GcdsInput, diff --git a/packages/react/package-lock.json b/packages/react/package-lock.json index b89b9e578..88be7b21d 100644 --- a/packages/react/package-lock.json +++ b/packages/react/package-lock.json @@ -1,15 +1,15 @@ { "name": "@cdssnc/gcds-components-react", - "version": "0.15.0", + "version": "0.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cdssnc/gcds-components-react", - "version": "0.15.0", + "version": "0.16.0", "license": "MIT", "dependencies": { - "@cdssnc/gcds-components": "^0.15.0" + "@cdssnc/gcds-components": "^0.16.0" }, "devDependencies": { "@types/react": "^18.0.28", diff --git a/packages/react/package.json b/packages/react/package.json index 3c1db7377..6dbb2176a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@cdssnc/gcds-components-react", - "version": "0.15.0", + "version": "0.16.0", "author": "Government of Canada / Gouvernement du Canada", "description": "React wrapper for gcds-components", "homepage": "https://design-system.alpha.canada.ca/", @@ -29,7 +29,7 @@ "gcds.css" ], "dependencies": { - "@cdssnc/gcds-components": "^0.15.0" + "@cdssnc/gcds-components": "^0.16.0" }, "devDependencies": { "@types/react": "^18.0.28", diff --git a/packages/react/src/components/stencil-generated/index.ts b/packages/react/src/components/stencil-generated/index.ts index b3c000cd9..bdb869dee 100644 --- a/packages/react/src/components/stencil-generated/index.ts +++ b/packages/react/src/components/stencil-generated/index.ts @@ -24,6 +24,7 @@ export const GcdsFileUploader = /*@__PURE__*/createReactComponent('gcds-footer'); export const GcdsGrid = /*@__PURE__*/createReactComponent('gcds-grid'); export const GcdsHeader = /*@__PURE__*/createReactComponent('gcds-header'); +export const GcdsHeading = /*@__PURE__*/createReactComponent('gcds-heading'); export const GcdsHint = /*@__PURE__*/createReactComponent('gcds-hint'); export const GcdsIcon = /*@__PURE__*/createReactComponent('gcds-icon'); export const GcdsInput = /*@__PURE__*/createReactComponent('gcds-input'); diff --git a/packages/web/package-lock.json b/packages/web/package-lock.json index a820971e5..83b216b0a 100644 --- a/packages/web/package-lock.json +++ b/packages/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cdssnc/gcds-components", - "version": "0.15.0", + "version": "0.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cdssnc/gcds-components", - "version": "0.15.0", + "version": "0.16.0", "license": "MIT", "dependencies": { "@stencil/core": "^4.0.0", @@ -2072,9 +2072,9 @@ "dev": true }, "node_modules/@cdssnc/gcds-tokens": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@cdssnc/gcds-tokens/-/gcds-tokens-1.9.0.tgz", - "integrity": "sha512-zsWsqralW8uCaTPiFxyFKGqKOHEgLWirmExoK+fY99kzKDzvhw4QBIhy/h/+LhIG8EgClKZb12RPjfp6Tcl9Kg==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@cdssnc/gcds-tokens/-/gcds-tokens-1.9.2.tgz", + "integrity": "sha512-xMTe1LxQ9Rmz2gp7wj7gs6J7U0dGpMlMuX6ks+0QRERAfpDCWVXK3Acq8sTvAB/CAu0HP8M53vq4pU7RxARFig==", "dev": true }, "node_modules/@colors/colors": { diff --git a/packages/web/package.json b/packages/web/package.json index 8e175547e..7d072e4d6 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@cdssnc/gcds-components", - "version": "0.15.0", + "version": "0.16.0", "author": "Government of Canada / Gouvernement du Canada", "description": "Web components for the GCDS", "homepage": "https://design-system.alpha.canada.ca/", diff --git a/packages/web/src/components.d.ts b/packages/web/src/components.d.ts index 6ebf3f2d2..696e63640 100644 --- a/packages/web/src/components.d.ts +++ b/packages/web/src/components.d.ts @@ -539,6 +539,54 @@ export namespace Components { */ "skipToHref": string; } + interface GcdsHeading { + /** + * Sets the line length to a maximum amount of characters per line for each heading level, ensuring a comfortable, accessible reading length. + */ + "characterLimit"?: boolean; + /** + * Adds margin below the heading. The default margin-botttom is 400. + */ + "marginBottom"?: | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000'; + /** + * Adds margin above the heading. The default margin-top for h1 is set to 0, while for h2 to h6 headings, it's 500. + */ + "marginTop"?: | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000'; + /** + * Sets the appropriate HTML tag for the selected level. + */ + "tag": 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; + } interface GcdsHint { /** * Hint displayed below the label and above the input field. @@ -1302,6 +1350,12 @@ declare global { prototype: HTMLGcdsHeaderElement; new (): HTMLGcdsHeaderElement; }; + interface HTMLGcdsHeadingElement extends Components.GcdsHeading, HTMLStencilElement { + } + var HTMLGcdsHeadingElement: { + prototype: HTMLGcdsHeadingElement; + new (): HTMLGcdsHeadingElement; + }; interface HTMLGcdsHintElement extends Components.GcdsHint, HTMLStencilElement { } var HTMLGcdsHintElement: { @@ -1445,6 +1499,7 @@ declare global { "gcds-footer": HTMLGcdsFooterElement; "gcds-grid": HTMLGcdsGridElement; "gcds-header": HTMLGcdsHeaderElement; + "gcds-heading": HTMLGcdsHeadingElement; "gcds-hint": HTMLGcdsHintElement; "gcds-icon": HTMLGcdsIconElement; "gcds-input": HTMLGcdsInputElement; @@ -2056,6 +2111,54 @@ declare namespace LocalJSX { */ "skipToHref": string; } + interface GcdsHeading { + /** + * Sets the line length to a maximum amount of characters per line for each heading level, ensuring a comfortable, accessible reading length. + */ + "characterLimit"?: boolean; + /** + * Adds margin below the heading. The default margin-botttom is 400. + */ + "marginBottom"?: | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000'; + /** + * Adds margin above the heading. The default margin-top for h1 is set to 0, while for h2 to h6 headings, it's 500. + */ + "marginTop"?: | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000'; + /** + * Sets the appropriate HTML tag for the selected level. + */ + "tag": 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; + } interface GcdsHint { /** * Hint displayed below the label and above the input field. @@ -2750,6 +2853,7 @@ declare namespace LocalJSX { "gcds-footer": GcdsFooter; "gcds-grid": GcdsGrid; "gcds-header": GcdsHeader; + "gcds-heading": GcdsHeading; "gcds-hint": GcdsHint; "gcds-icon": GcdsIcon; "gcds-input": GcdsInput; @@ -2793,6 +2897,7 @@ declare module "@stencil/core" { "gcds-footer": LocalJSX.GcdsFooter & JSXBase.HTMLAttributes; "gcds-grid": LocalJSX.GcdsGrid & JSXBase.HTMLAttributes; "gcds-header": LocalJSX.GcdsHeader & JSXBase.HTMLAttributes; + "gcds-heading": LocalJSX.GcdsHeading & JSXBase.HTMLAttributes; "gcds-hint": LocalJSX.GcdsHint & JSXBase.HTMLAttributes; "gcds-icon": LocalJSX.GcdsIcon & JSXBase.HTMLAttributes; "gcds-input": LocalJSX.GcdsInput & JSXBase.HTMLAttributes; diff --git a/packages/web/src/components/gcds-breadcrumbs/gcds-breadcrumbs-item.css b/packages/web/src/components/gcds-breadcrumbs/gcds-breadcrumbs-item.css index d1bad4d04..4c2996931 100644 --- a/packages/web/src/components/gcds-breadcrumbs/gcds-breadcrumbs-item.css +++ b/packages/web/src/components/gcds-breadcrumbs/gcds-breadcrumbs-item.css @@ -24,7 +24,7 @@ white-space: normal; slot { - display: inherit; + display: block; } } } diff --git a/packages/web/src/components/gcds-breadcrumbs/stories/overview.mdx b/packages/web/src/components/gcds-breadcrumbs/stories/overview.mdx index 4d692d954..58008b17a 100644 --- a/packages/web/src/components/gcds-breadcrumbs/stories/overview.mdx +++ b/packages/web/src/components/gcds-breadcrumbs/stories/overview.mdx @@ -9,32 +9,25 @@ _Also called: breadcrumb trail._ A path to the current page from each preceding level of the site’s hierarchy. - + ## Examples -
+ +
### Canada.ca link #### Default - + #### Without Canda.ca link - + ## Resources +{/* prettier-ignore */}
  • Guidance diff --git a/packages/web/src/components/gcds-button/stories/overview.mdx b/packages/web/src/components/gcds-button/stories/overview.mdx index c67bac420..147598a9b 100644 --- a/packages/web/src/components/gcds-button/stories/overview.mdx +++ b/packages/web/src/components/gcds-button/stories/overview.mdx @@ -9,124 +9,81 @@ _Also called: call to action, CTA, link._ A button is an interactive object that highlights an important or common action. - + ## Examples -
    + +
    ### Types - + ### Roles - + ### Styles - + ### Primary button #### States - + #### Size - + ### Secondary button #### States - + #### Size - + ### Danger button #### States - + #### Size - + ### Skip-to-content button #### States - + #### Size - + ### Text-only button #### States - + #### Size - + ### Button with icon - + ## 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 2861964a6..b888928fb 100644 --- a/packages/web/src/components/gcds-card/stories/overview.mdx +++ b/packages/web/src/components/gcds-card/stories/overview.mdx @@ -9,39 +9,29 @@ _Also called: tile, content card._ A card is a box containing structured, actionable content on a single topic. - + ## Examples -
      + +
      ### Types #### Link - + #### Action - + ### With image - + ## 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 2d8dd5615..16fca6be3 100644 --- a/packages/web/src/components/gcds-checkbox/stories/overview.mdx +++ b/packages/web/src/components/gcds-checkbox/stories/overview.mdx @@ -9,54 +9,37 @@ _Also called: checklist, check list._ A checkbox is a set of options for one or multiple selections. - + ## Examples -
        + +
        ### State #### Default - + #### Required - - + #### Error - + #### Disabled - + #### Checked - + ## 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 f1206e5d2..4d86f873c 100644 --- a/packages/web/src/components/gcds-container/stories/overview.mdx +++ b/packages/web/src/components/gcds-container/stories/overview.mdx @@ -9,81 +9,53 @@ _Also called: wrapper, box._ A box to group content by limiting the width. - + ## Examples -
          + +
          ### Container sizes #### Size: full - + #### Size: xl - + #### Size: lg - + #### Size: md - + #### Size: sm - + #### Size: xs - + ### Centered - + ### Margin - + ### Padding - + ## 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 9691a56ae..82e48ccb1 100644 --- a/packages/web/src/components/gcds-date-modified/stories/overview.mdx +++ b/packages/web/src/components/gcds-date-modified/stories/overview.mdx @@ -9,48 +9,35 @@ _Also called: version date, last updated._ A timestamp of the last page update. - + ## Examples -
            + +
            ### Type #### Date - + #### Version - + ### Language #### English - + #### French - + ## 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 70034c53c..fbc0c22cc 100644 --- a/packages/web/src/components/gcds-details/stories/overview.mdx +++ b/packages/web/src/components/gcds-details/stories/overview.mdx @@ -9,32 +9,25 @@ _Also called: accordion, collapse._ Details is an interactive switch for a person to expand or collapse content. - + ## Examples -
              + +
              ### State #### Default - + #### Open - + ## 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 f79f35ea3..947807eca 100644 --- a/packages/web/src/components/gcds-error-message/stories/overview.mdx +++ b/packages/web/src/components/gcds-error-message/stories/overview.mdx @@ -9,23 +9,19 @@ _Also called: error, inline error._ An error message is a description of a problem blocking a user goal. - + ## Examples -
                + +
                ### Default - + ## 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 ef92e5283..c23143ba5 100644 --- a/packages/web/src/components/gcds-error-summary/stories/overview.mdx +++ b/packages/web/src/components/gcds-error-summary/stories/overview.mdx @@ -9,23 +9,19 @@ _Also called: error list._ An error summary is a list of user errors in a form. - + ## Examples -
                  + +
                  ### Default - + ## 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 703cb0913..552d8e250 100644 --- a/packages/web/src/components/gcds-fieldset/stories/overview.mdx +++ b/packages/web/src/components/gcds-fieldset/stories/overview.mdx @@ -9,46 +9,33 @@ _Also called: form field._ A fieldset is a group of multiple form components or elements. - + ## Examples -
                    + +
                    ### State #### Default - + #### Required - + #### Error - + #### Disabled - + ## 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 95bf4ff84..7d4a39eb8 100644 --- a/packages/web/src/components/gcds-file-uploader/stories/overview.mdx +++ b/packages/web/src/components/gcds-file-uploader/stories/overview.mdx @@ -9,44 +9,29 @@ _Also called: file upload, file input, dropzone._ A file uploader is a space to select and add supporting documentation. - + ## Examples -
                      + +
                      ### State #### Default - + #### Required - - + #### Error - + #### Disabled - + ### Multiple files @@ -54,19 +39,13 @@ A file uploader is a space to select and add supporting documentation. By default the user can only choose one file. - + #### Multiple files Setting `multiple` to `true` allows the user to choose multiple files. - + ### Accepted file formats @@ -74,62 +53,39 @@ Setting `multiple` to `true` allows the user to choose multiple files. By default all file formats are allowed. - + #### Images only - + #### JPG only - + #### PNG only - + #### SVG only - + #### PDF only - + #### Audio only - + #### Videos only - + ## 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 0d07d13d9..f1fe40453 100644 --- a/packages/web/src/components/gcds-footer/stories/overview.mdx +++ b/packages/web/src/components/gcds-footer/stories/overview.mdx @@ -9,39 +9,29 @@ _Also called: site footer._ The footer is the responsive Government of Canada branded footer landmark. - + ## Examples -
                        + +
                        ### Display #### Compact / default - + ### Full - + #### Display with contextual links - + ## Resources +{/* prettier-ignore */}
                        • Guidance diff --git a/packages/web/src/components/gcds-grid/stories/overview.mdx b/packages/web/src/components/gcds-grid/stories/overview.mdx index 170381d11..dd6d53b91 100644 --- a/packages/web/src/components/gcds-grid/stories/overview.mdx +++ b/packages/web/src/components/gcds-grid/stories/overview.mdx @@ -9,13 +9,11 @@ _Also called: layout, columns, columns layout, grid container._ A grid is a responsive, flexible column layout to position elements on a page. - + ## Examples -
                          + +
                          ### Grid columns @@ -23,28 +21,19 @@ A grid is a responsive, flexible column layout to position elements on a page. Use the `columns` property to add your layout for smaller screens or if you are using the same layout for all screens. - + #### Columns tablet Use the `columns-tablet` property to set your tablet layout **(48em and 768px and above)** or if you are using the same layout for medium and large screens. - + #### Columns desktop Use the `columns-desktop` property to define your layout for larger screens **(64em and 1024px and above)**. - + ### Equal width column @@ -52,22 +41,17 @@ Use the `columns-desktop` property to define your layout for larger screens **(6 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 */}
                          • Guidance diff --git a/packages/web/src/components/gcds-header/stories/overview.mdx b/packages/web/src/components/gcds-header/stories/overview.mdx index 621c5b92b..444d7a395 100644 --- a/packages/web/src/components/gcds-header/stories/overview.mdx +++ b/packages/web/src/components/gcds-header/stories/overview.mdx @@ -9,67 +9,45 @@ _Also called: global header, brand header._ The header is the responsive Government of Canada branded header landmark. - + ## Examples -
                            + +
                            ### Default - + ### Slots #### Skip-to-nav - + #### Banner - + #### Toggle - + #### Menu - + #### Breadcrumb - + #### All slots - + ## Resources +{/* prettier-ignore */}
                            • Guidance diff --git a/packages/web/src/components/gcds-heading/gcds-heading.css b/packages/web/src/components/gcds-heading/gcds-heading.css new file mode 100644 index 000000000..a1d3cf948 --- /dev/null +++ b/packages/web/src/components/gcds-heading/gcds-heading.css @@ -0,0 +1,260 @@ +@layer reset, +defaults, +variants; + +@layer reset { + :host { + display: block; + color: var(--gcds-heading-default-text); + + h1, + h2, + h3, + h4, + h5, + h6 { + box-sizing: border-box; + margin: 0; + } + + slot { + display: inherit; + } + } +} + +@layer defaults { + :host { + h1, + h2, + h3, + h4, + h5, + h6 { + text-wrap: balance; + } + + h1.gcds-heading { + font: var(--gcds-heading-h1-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h1-mobile); + } + + &:after { + content: ''; + display: block; + width: var(--gcds-heading-h1-border-width); + margin-block-start: var(--gcds-heading-h1-border-margin); + height: var(--gcds-heading-h1-border-height); + background-color: var(--gcds-heading-h1-border-background); + } + } + + h2.gcds-heading { + font: var(--gcds-heading-h2-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h2-mobile); + } + } + + h3.gcds-heading { + font: var(--gcds-heading-h3-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h3-mobile); + } + } + + h4.gcds-heading { + font: var(--gcds-heading-h4-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h4-mobile); + } + } + + h5.gcds-heading { + font: var(--gcds-heading-h5-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h5-mobile); + } + } + + h6.gcds-heading { + font: var(--gcds-heading-h6-desktop); + + @media only screen and (width < 48em) { + font: var(--gcds-heading-h6-mobile); + } + } + } +} + +@layer variants { + :host { + h1, + h2, + h3, + h4, + h5, + h6 { + /* Margin top */ + &.mt-0 { + margin-block-start: var(--gcds-heading-spacing-0); + } + + &.mt-50 { + margin-block-start: var(--gcds-heading-spacing-50); + } + + &.mt-100 { + margin-block-start: var(--gcds-heading-spacing-100); + } + + &.mt-150 { + margin-block-start: var(--gcds-heading-spacing-150); + } + + &.mt-200 { + margin-block-start: var(--gcds-heading-spacing-200); + } + + &.mt-250 { + margin-block-start: var(--gcds-heading-spacing-250); + } + + &.mt-300 { + margin-block-start: var(--gcds-heading-spacing-300); + } + + &.mt-400 { + margin-block-start: var(--gcds-heading-spacing-400); + } + + &.mt-450 { + margin-block-start: var(--gcds-heading-spacing-450); + } + + &.mt-500 { + margin-block-start: var(--gcds-heading-spacing-500); + } + + &.mt-550 { + margin-block-start: var(--gcds-heading-spacing-550); + } + + &.mt-600 { + margin-block-start: var(--gcds-heading-spacing-600); + } + + &.mt-700 { + margin-block-start: var(--gcds-heading-spacing-700); + } + + &.mt-800 { + margin-block-start: var(--gcds-heading-spacing-800); + } + + &.mt-900 { + margin-block-start: var(--gcds-heading-spacing-900); + } + + &.mt-1000 { + margin-block-start: var(--gcds-heading-spacing-1000); + } + + /* Margin bottom */ + &.mb-0 { + margin-block-end: var(--gcds-heading-spacing-0); + } + + &.mb-50 { + margin-block-end: var(--gcds-heading-spacing-50); + } + + &.mb-100 { + margin-block-end: var(--gcds-heading-spacing-100); + } + + &.mb-150 { + margin-block-end: var(--gcds-heading-spacing-150); + } + + &.mb-200 { + margin-block-end: var(--gcds-heading-spacing-200); + } + + &.mb-250 { + margin-block-end: var(--gcds-heading-spacing-250); + } + + &.mb-300 { + margin-block-end: var(--gcds-heading-spacing-300); + } + + &.mb-400 { + margin-block-end: var(--gcds-heading-spacing-400); + } + + &.mb-450 { + margin-block-end: var(--gcds-heading-spacing-450); + } + + &.mb-500 { + margin-block-end: var(--gcds-heading-spacing-500); + } + + &.mb-550 { + margin-block-end: var(--gcds-heading-spacing-550); + } + + &.mb-600 { + margin-block-end: var(--gcds-heading-spacing-600); + } + + &.mb-700 { + margin-block-end: var(--gcds-heading-spacing-700); + } + + &.mb-800 { + margin-block-end: var(--gcds-heading-spacing-800); + } + + &.mb-900 { + margin-block-end: var(--gcds-heading-spacing-900); + } + + &.mb-1000 { + margin-block-end: var(--gcds-heading-spacing-1000); + } + } + + /* Character limit */ + h1.limit { + max-width: var(--gcds-heading-character-limit-h1); + } + + h2.limit { + max-width: var(--gcds-heading-character-limit-h2); + } + + h3.limit { + max-width: var(--gcds-heading-character-limit-h3); + } + + h4.limit { + max-width: var(--gcds-heading-character-limit-h4); + } + + h5.limit { + max-width: var(--gcds-heading-character-limit-h5); + } + + h6.limit { + max-width: var(--gcds-heading-character-limit-h6); + } + } +} diff --git a/packages/web/src/components/gcds-heading/gcds-heading.tsx b/packages/web/src/components/gcds-heading/gcds-heading.tsx new file mode 100644 index 000000000..0352d83ab --- /dev/null +++ b/packages/web/src/components/gcds-heading/gcds-heading.tsx @@ -0,0 +1,161 @@ +import { Component, Element, Host, Watch, Prop, h } from '@stencil/core'; + +@Component({ + tag: 'gcds-heading', + styleUrl: 'gcds-heading.css', + shadow: true, +}) +export class GcdsHeading { + @Element() el: HTMLElement; + + /** + * Props + */ + + /** + * Sets the appropriate HTML tag for the selected level. + */ + @Prop({ mutable: true }) tag!: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; + + @Watch('tag') + validateTag(newValue: string) { + const values = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + + if (!values.includes(newValue)) { + console.error('Not a valid tag.'); + } + } + + /** + * Sets the line length to a maximum amount of characters per line for + * each heading level, ensuring a comfortable, accessible reading length. + */ + @Prop() characterLimit?: boolean = true; + + /** + * Adds margin above the heading. The default margin-top for h1 is set to 0, + * while for h2 to h6 headings, it's 500. + */ + @Prop({ mutable: true }) marginTop?: + | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000'; + + @Watch('marginTop') + validateMarginTop(newValue: string) { + const values = [ + '0', + '50', + '100', + '150', + '200', + '250', + '300', + '400', + '450', + '500', + '550', + '600', + '700', + '800', + '900', + '1000', + ]; + + if (!this.marginTop || (this.marginTop && !values.includes(newValue))) { + if (this.tag !== 'h1') { + this.marginTop = '500'; + } else { + this.marginTop = '0'; + } + } + } + + /** + * Adds margin below the heading. The default margin-botttom is 400. + */ + @Prop({ mutable: true }) marginBottom?: + | '0' + | '50' + | '100' + | '150' + | '200' + | '250' + | '300' + | '400' + | '450' + | '500' + | '550' + | '600' + | '700' + | '800' + | '900' + | '1000' = '400'; + + @Watch('marginBottom') + validateMarginBottom(newValue: string) { + const values = [ + '0', + '50', + '100', + '150', + '200', + '250', + '300', + '400', + '450', + '500', + '550', + '600', + '700', + '800', + '900', + '1000', + ]; + + if (this.marginBottom && !values.includes(newValue)) { + this.marginBottom = '400'; + } + } + + componentWillLoad() { + // Validate attributes and set defaults + this.validateTag(this.tag); + this.validateMarginTop(this.marginTop); + this.validateMarginBottom(this.marginBottom); + } + + render() { + const { characterLimit, marginTop, marginBottom, tag } = this; + + const Tag = tag; + + return ( + + + + + + ); + } +} diff --git a/packages/web/src/components/gcds-heading/readme.md b/packages/web/src/components/gcds-heading/readme.md new file mode 100644 index 000000000..583d94a77 --- /dev/null +++ b/packages/web/src/components/gcds-heading/readme.md @@ -0,0 +1,20 @@ +# gcds-heading + + + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | +| `characterLimit` | `character-limit` | Sets the line length to a maximum amount of characters per line for each heading level, ensuring a comfortable, accessible reading length. | `boolean` | `true` | +| `marginBottom` | `margin-bottom` | Adds margin below the heading. The default margin-botttom is 400. | `"0" \| "100" \| "1000" \| "150" \| "200" \| "250" \| "300" \| "400" \| "450" \| "50" \| "500" \| "550" \| "600" \| "700" \| "800" \| "900"` | `'400'` | +| `marginTop` | `margin-top` | Adds margin above the heading. The default margin-top for h1 is set to 0, while for h2 to h6 headings, it's 500. | `"0" \| "100" \| "1000" \| "150" \| "200" \| "250" \| "300" \| "400" \| "450" \| "50" \| "500" \| "550" \| "600" \| "700" \| "800" \| "900"` | `undefined` | +| `tag` _(required)_ | `tag` | Sets the appropriate HTML tag for the selected level. | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/web/src/components/gcds-heading/stories/gcds-heading.stories.tsx b/packages/web/src/components/gcds-heading/stories/gcds-heading.stories.tsx new file mode 100644 index 000000000..66715fc78 --- /dev/null +++ b/packages/web/src/components/gcds-heading/stories/gcds-heading.stories.tsx @@ -0,0 +1,190 @@ +export default { + title: 'Components/Heading', + + argTypes: { + // Props + tag: { + control: { type: 'select' }, + options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], + table: { + type: { summary: 'string' }, + defaultValue: { summary: '-' }, + }, + type: { + required: true, + }, + }, + characterLimit: { + name: 'character-limit', + control: 'boolean', + table: { + type: { summary: 'boolean' }, + defaultValue: { summary: true }, + }, + }, + marginTop: { + name: 'margin-top', + control: { type: 'select' }, + options: [ + '0', + '50', + '100', + '150', + '200', + '250', + '300', + '400', + '450', + '500', + '550', + '600', + '700', + '800', + '900', + '1000', + ], + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'h1: 0, h2-h6: 500' }, + }, + }, + marginBottom: { + name: 'margin-bottom', + control: { type: 'select' }, + options: [ + '0', + '50', + '100', + '150', + '200', + '250', + '300', + '400', + '450', + '500', + '550', + '600', + '700', + '800', + '900', + '1000', + ], + table: { + type: { summary: 'string' }, + defaultValue: { summary: '400' }, + }, + }, + + // Slots + default: { + control: { + type: 'text', + }, + table: { + category: 'Slots | Fentes', + }, + }, + }, +}; + +const Template = args => + ` + + + ${args.default} + + + + + ${args.default} + +`.replace(/ null/g, ''); + +const TemplatePlayground = args => ` + + ${args.default} + +`; + +// ------ Heading default ------ + +export const Default = Template.bind({}); +Default.args = { + tag: 'h2', + characterLimit: true, + default: 'Heading', +}; + +// ------ Heading level ------ + +export const LevelH1 = Template.bind({}); +LevelH1.args = { + tag: 'h1', + characterLimit: true, + default: 'Heading level 1', +}; + +export const LevelH2 = Template.bind({}); +LevelH2.args = { + tag: 'h2', + characterLimit: true, + default: 'Heading level 2', +}; + +export const LevelH3 = Template.bind({}); +LevelH3.args = { + tag: 'h3', + characterLimit: true, + default: 'Heading level 3', +}; + +export const LevelH4 = Template.bind({}); +LevelH4.args = { + tag: 'h4', + characterLimit: true, + default: 'Heading level 4', +}; + +export const LevelH5 = Template.bind({}); +LevelH5.args = { + tag: 'h5', + characterLimit: true, + default: 'Heading level 5', +}; + +export const LevelH6 = Template.bind({}); +LevelH6.args = { + tag: 'h6', + characterLimit: true, + default: 'Heading level 6', +}; + +// ------ Heading events & props ------ + +export const Props = Template.bind({}); +Props.args = { + tag: 'h2', + characterLimit: true, + default: 'Heading', +}; + +// ------ Heading playground ------ + +export const Playground = TemplatePlayground.bind({}); +Playground.args = { + tag: 'h2', + characterLimit: true, + default: 'Heading', +}; diff --git a/packages/web/src/components/gcds-heading/stories/overview.mdx b/packages/web/src/components/gcds-heading/stories/overview.mdx new file mode 100644 index 000000000..a62c9109c --- /dev/null +++ b/packages/web/src/components/gcds-heading/stories/overview.mdx @@ -0,0 +1,57 @@ +import { Meta, Canvas, Story } from '@storybook/blocks'; +import * as Heading from './gcds-heading.stories'; + + + +# Heading
                              `` + +_Also called: title, section heading, subheading._ + +A title that structures content by creating levels of hierarchy that organize page content visually and mentally, using GCDS styles. + + + +## Examples + +
                              + +### Tag + +#### Level H1 + + + +#### Level H2 + + + +#### Level H3 + + + +#### Level H4 + + + +#### Level H5 + + + +#### Level H6 + + + +## Resources + +{/* prettier-ignore */} +
                                +
                              • + Guidance +
                              • +
                              • + Github +
                              • +
                              • + Figma +
                              • +
                              diff --git a/packages/web/src/components/gcds-heading/stories/properties.mdx b/packages/web/src/components/gcds-heading/stories/properties.mdx new file mode 100644 index 000000000..ca7bb5aed --- /dev/null +++ b/packages/web/src/components/gcds-heading/stories/properties.mdx @@ -0,0 +1,15 @@ +import { Meta, Canvas, Controls } from '@storybook/blocks'; +import * as Heading from './gcds-heading.stories'; + + + +{!(new URLSearchParams(window.location.search)).get('demo') &&

                              Events & properties

                              } + + + + diff --git a/packages/web/src/components/gcds-heading/test/gcds-heading.e2e.ts b/packages/web/src/components/gcds-heading/test/gcds-heading.e2e.ts new file mode 100644 index 000000000..fa9f3b3aa --- /dev/null +++ b/packages/web/src/components/gcds-heading/test/gcds-heading.e2e.ts @@ -0,0 +1,38 @@ +import { newE2EPage } from '@stencil/core/testing'; +const { AxePuppeteer } = require('@axe-core/puppeteer'); + +describe('gcds-heading', () => { + it('renders', async () => { + const page = await newE2EPage(); + await page.setContent( + 'Heading level 2', + ); + + const element = await page.find('gcds-heading'); + expect(element).toHaveClass('hydrated'); + }); +}); + +/** + * Accessibility tests + * Axe-core rules: https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md#wcag-21-level-a--aa-rules + */ + +describe('gcds-heading a11y tests', () => { + /** + * Colour contrast test + */ + it('colour contrast', async () => { + const page = await newE2EPage(); + await page.setContent(` + Heading level 2 + `); + + const colorContrastTest = new AxePuppeteer(page) + .withRules('color-contrast') + .analyze(); + const results = await colorContrastTest; + + expect(results.violations.length).toBe(0); + }); +}); diff --git a/packages/web/src/components/gcds-heading/test/gcds-heading.spec.ts b/packages/web/src/components/gcds-heading/test/gcds-heading.spec.ts new file mode 100644 index 000000000..784ddba6a --- /dev/null +++ b/packages/web/src/components/gcds-heading/test/gcds-heading.spec.ts @@ -0,0 +1,257 @@ +import { newSpecPage } from '@stencil/core/testing'; +import { GcdsHeading } from '../gcds-heading'; + +describe('gcds-heading', () => { + it('renders heading level 1', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 1 + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Heading level 1 +
                              + `); + }); + + it('renders heading level 2', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 2 + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Heading level 2 +
                              + `); + }); + + it('renders heading level 3', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 3 + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Heading level 3 +
                              + `); + }); + + it('renders heading level 4', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 4 + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Heading level 4 +
                              + `); + }); + + it('renders heading level 5', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 5 + `, + }); + expect(root).toEqualHtml(` + + +
                              + +
                              +
                              + Heading level 5 +
                              + `); + }); + + it('renders heading level 6', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Heading level 6 + `, + }); + expect(root).toEqualHtml(` + + +
                              + +
                              +
                              + Heading level 6 +
                              + `); + }); + + /** + * Spacing tests + */ + it('renders margin top', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Margin top + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Margin top +
                              + `); + }); + + it('renders default margin top if incorrect value is passed', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Margin top + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Margin top +
                              + `); + }); + + it('renders default margin top for h1 if incorrect value is passed', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Margin top + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Margin top +
                              + `); + }); + + it('renders margin bottom', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Margin bottom + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Margin bottom +
                              + `); + }); + + it('renders default margin bottom if incorrect value is passed', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Margin bottom + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Margin bottom +
                              + `); + }); + + /** + * Character limits + */ + it('renders heading with character limits', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + Character limits + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + Character limits +
                              + `); + }); + + it('renders heading without character limits', async () => { + const { root } = await newSpecPage({ + components: [GcdsHeading], + html: ` + No character limits + `, + }); + expect(root).toEqualHtml(` + + +

                              + +

                              +
                              + No character limits +
                              + `); + }); +}); diff --git a/packages/web/src/components/gcds-icon/stories/overview.mdx b/packages/web/src/components/gcds-icon/stories/overview.mdx index 98ff394ea..046f8203e 100644 --- a/packages/web/src/components/gcds-icon/stories/overview.mdx +++ b/packages/web/src/components/gcds-icon/stories/overview.mdx @@ -9,64 +9,45 @@ _Also called: glyphs, graphic, symbol._ Icons are a visual cue to help users understand the context. - + ## Examples -
                              + +
                              ### Name Our icon component uses Font Awesome icons. You can find an overview of all available icons on fontawesome.com. - + ### Size - + ### Margin #### Margin left - + #### Margin right - + ### Fixed width vs variable width - + ### Label If you are using an icon by itself, use the `label` to ensure that it has the proper screen reader text attached to it in these cases. - + ## 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 ff69cfd9f..4d7dc96a8 100644 --- a/packages/web/src/components/gcds-input/stories/overview.mdx +++ b/packages/web/src/components/gcds-input/stories/overview.mdx @@ -9,91 +9,59 @@ _Also called: text input, input field._ An input is a space to enter short-form information in response to a question or instruction. - + ## Examples -
                                + +
                                ### State #### Default - + #### Required - - + #### Error - + #### Disabled - + ### Type #### Email - + #### Number - + #### Password - + #### Search - + #### Text - + #### Url - + ## 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 d31fbe3b4..c1af9aefe 100644 --- a/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx +++ b/packages/web/src/components/gcds-lang-toggle/stories/overview.mdx @@ -9,32 +9,25 @@ _Also called: language switch, language selector._ The language toggle is a link to the same content in the other Official Language. - + ## Examples -
                                  + +
                                  ### Language #### English - + #### French - + ## 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 a2577ca9b..49b92009f 100644 --- a/packages/web/src/components/gcds-nav-group/stories/overview.mdx +++ b/packages/web/src/components/gcds-nav-group/stories/overview.mdx @@ -5,55 +5,39 @@ import * as NavGroup from './gcds-nav-group.stories'; # NavGroup
                                    `` - + ## Examples -
                                    + +
                                    ### State #### Default - + #### Open - + ### Labels #### Open / close triggers - + #### Menu - + ### In top navigation - + ## Resources +{/* prettier-ignore */}
                                    • Github 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 b1c4f1462..323a3df5e 100644 --- a/packages/web/src/components/gcds-nav-link/stories/overview.mdx +++ b/packages/web/src/components/gcds-nav-link/stories/overview.mdx @@ -5,48 +5,35 @@ import * as NavLink from './gcds-nav-link.stories'; # NavLink
                                      `` - + ## Examples -
                                      + +
                                      ### State #### Default - + #### Current - + ### In top navigation #### Default - + #### Current - + ## Resources +{/* prettier-ignore */}
                                      • Github diff --git a/packages/web/src/components/gcds-pagination/stories/overview.mdx b/packages/web/src/components/gcds-pagination/stories/overview.mdx index 4291dce9e..9d8db3355 100644 --- a/packages/web/src/components/gcds-pagination/stories/overview.mdx +++ b/packages/web/src/components/gcds-pagination/stories/overview.mdx @@ -9,13 +9,11 @@ _Also called: page index, page navigation._ Pagination is a division of content into multiple linked pages. - + ## Examples -
                                        + +
                                        ### Display @@ -23,52 +21,35 @@ Pagination is a division of content into multiple linked pages. #### Simple - + #### List - + #### French ##### Simple - + ##### List - + ## Url object ### ::offset - + ### ::match - + ## 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 501fc2bd3..ef8cf9925 100644 --- a/packages/web/src/components/gcds-radio/stories/overview.mdx +++ b/packages/web/src/components/gcds-radio/stories/overview.mdx @@ -9,46 +9,33 @@ _Also called: radio button, radio group._ A radio is a set of options for a single selection. - + ## Examples -
                                          + +
                                          ### State #### Default - + #### Disabled - + #### Checked - + #### Error (with fieldset) - + ## 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 d21a02cc7..a560e537c 100644 --- a/packages/web/src/components/gcds-search/stories/overview.mdx +++ b/packages/web/src/components/gcds-search/stories/overview.mdx @@ -9,39 +9,29 @@ _Also called: search box._ Search is a way to enter keywords to find relevant information. - + ## Examples -
                                            + +
                                            ### Default #### English - + #### French - + ### Custom - + ## 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 6bfffefdb..042271ec2 100644 --- a/packages/web/src/components/gcds-select/stories/overview.mdx +++ b/packages/web/src/components/gcds-select/stories/overview.mdx @@ -9,63 +9,43 @@ _Also called: dropdown, select menu._ A list of options with a single-option choice. - + ## Examples -
                                              + +
                                              ### State #### Default - + #### Required - - + #### Error - + #### Disabled - + ### Default value #### Select with default value - + #### Select without default value - + ## 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 0a3e75b30..76c932ec6 100644 --- a/packages/web/src/components/gcds-side-nav/stories/overview.mdx +++ b/packages/web/src/components/gcds-side-nav/stories/overview.mdx @@ -9,23 +9,19 @@ _Also called: sidebar menu, lefhand nav, vertical navigation._ A side navigation is a vertical list of page links on the left side of the screen. - + ## Examples -
                                                + +
                                                ### Label - + ## 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 fa90fffdc..1a42d0911 100644 --- a/packages/web/src/components/gcds-signature/stories/overview.mdx +++ b/packages/web/src/components/gcds-signature/stories/overview.mdx @@ -9,103 +9,78 @@ _Also called: wordmark._ The signature is the Government of Canada landmark identifier found in the header or footer. - + ## Examples -
                                                  + +
                                                  ### Type property #### Signature Type - + #### Wordmark Type - + ### Language #### English Signature - + #### French Signature - + #### English Wordmark - + #### French Wordmark - - + ### hasLink property #### hasLink = false - + #### hasLink = true - + ### Colour variants #### Signature variant = colour - + #### Wordmark variant = colour - + #### Signature variant = white - + #### Wordmark variant = white - \ No newline at end of file + +## Resources + +{/* prettier-ignore */} +
                                                    +
                                                  • + Guidance +
                                                  • +
                                                  • + Github +
                                                  • +
                                                  • + Figma +
                                                  • +
                                                  diff --git a/packages/web/src/components/gcds-stepper/stories/overview.mdx b/packages/web/src/components/gcds-stepper/stories/overview.mdx index 010b5afd7..5f20bfcea 100644 --- a/packages/web/src/components/gcds-stepper/stories/overview.mdx +++ b/packages/web/src/components/gcds-stepper/stories/overview.mdx @@ -9,32 +9,25 @@ _Also called: progress indicator, steps._ A stepper is a progress tracker for a multi-step process. - + ## Examples -
                                                  + +
                                                  ### Language #### English - + #### French - + ## 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 702e6976b..6d2fb7c02 100644 --- a/packages/web/src/components/gcds-textarea/stories/overview.mdx +++ b/packages/web/src/components/gcds-textarea/stories/overview.mdx @@ -9,61 +9,41 @@ _Also called: text box._ A text area is a space to enter long-form information in response to a question or instruction. - + ## Examples -
                                                    + +
                                                    ### State #### Default - + #### Required - - + #### Error - + #### Disabled - + ### Character count - + ### Rows - + ## 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 3c31f8180..361c2df5d 100644 --- a/packages/web/src/components/gcds-top-nav/stories/overview.mdx +++ b/packages/web/src/components/gcds-top-nav/stories/overview.mdx @@ -9,48 +9,35 @@ _Also called: site menu, navigation, navbar._ A top navigation is a horizontal list of page links. - + ## Examples -
                                                      + +
                                                      ### Alignment #### Right - + #### Center - + #### Left - + ### Slots #### Home - + ## 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 58ebee9e6..c15a7184e 100644 --- a/packages/web/src/components/gcds-topic-menu/stories/overview.mdx +++ b/packages/web/src/components/gcds-topic-menu/stories/overview.mdx @@ -7,45 +7,35 @@ import * as TopicMenu from './gcds-topic-menu.stories'; Navigate to the top tasks from all Government of Canada websites. - + ## Examples -
                                                        + +
                                                        ### Default #### English - + #### French - + ### Home page - + ## Resources +{/* prettier-ignore */}
                                                        • Guidance
                                                        • - Github + Github
                                                        • Figma 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 03464d800..4fe37d7d6 100644 --- a/packages/web/src/components/gcds-verify-banner/stories/overview.mdx +++ b/packages/web/src/components/gcds-verify-banner/stories/overview.mdx @@ -5,76 +5,51 @@ import * as VerifyBanner from './gcds-verify-banner.stories'; # VerifyBanner
                                                          `` - + ## Examples -
                                                          + +
                                                          ### Language #### English - + #### French - + ### Container sizes #### Size: full - + #### Size: xl - + #### Size: lg - + #### Size: md - + #### Size: sm - + #### Size: xs - + ## Resources +{/* prettier-ignore */}
                                                          • Github diff --git a/packages/web/src/index.html b/packages/web/src/index.html index a8d4036bd..802f64f90 100644 --- a/packages/web/src/index.html +++ b/packages/web/src/index.html @@ -52,6 +52,7 @@ html { font-size: 16px; } + body { font-size: var(--gcds-font-sizes-text); line-height: var(--gcds-line-heights-text); @@ -62,6 +63,7 @@ } + @@ -397,6 +399,16 @@

                                                            Grid

                                                            + + +

                                                            Heading

                                                            + Heading level 1 + Heading level 2 + Heading level 3 + Heading level 4 + Heading level 5 + Heading level 6 +

                                                            Text