diff --git a/_data/components.json b/_data/components.json index 64dc2a214d..54599d78de 100644 --- a/_data/components.json +++ b/_data/components.json @@ -272,25 +272,38 @@ "modified": "dct:modified" }, "title": { - "en": "Featured link - Documentation and working example", - "fr": "Lien en vedette - Documentation et example pratique" + "en": "Featured link", + "fr": "Lien en vedette" }, "description": { "en": "This adds a featured link to a page that your institution needs to feature prominently.", "fr": "Ceci ajoute un lien en vedette court et descriptif vers une page que votre institution doit mettre en évidence." }, - "modified": "2021-05-20", + "modified": "2024-02-21", "componentName": "gc-featured-link", - "status": "provisional", + "status": "stable", + "version": "1.0.0", "pages": { + "docs": [ + { + "title": "Featured link", + "language": "en", + "path": "gc-featured-link-doc-en.html" + }, + { + "title": "Lien en vedette", + "language": "fr", + "path": "gc-featured-link-doc-fr.html" + } + ], "examples": [ { - "title": "Featured link - Documentation and working example", + "title": "Featured link", "language": "en", "path": "gc-featured-link-en.html" }, - { - "title": "Lien en vedette - Documentation et example pratique", + { + "title": "Lien en vedette", "language": "fr", "path": "gc-featured-link-fr.html" } @@ -317,7 +330,235 @@ "path": "reports/a11y-2-fr.html" } ] - } + }, + "dependencies": "No dependency.", + "a11yGuidance": "No accessibility guidance.", + "variations": [ + { + "name": { + "en": "Featured link - default", + "fr": "Lien en vedette - par défaut" + }, + "status": "stable", + "description": { + "en": "This adds a featured link to a page that your institution needs to feature prominently.", + "fr": "Ceci ajoute un lien en vedette court et descriptif vers une page que votre institution doit mettre en évidence." + }, + "iteration": "_:iteration_featuredLink_3", + "example": [ + { + "en": { "href": "gc-featured-link-en.html", "text": "Featured link" }, + "fr": { "href": "gc-featured-link-fr.html", "text": "Lien en vedette" } + } + ], + "implementation": [ + "_:implement_featuredLink", + "_:implement_migrationProvisional" + ], + "history": [ + { + "en": "March 2024 - Stabilizing component.", + "fr": "Mars 2024 - Stabilisation de la composante." + }, + { + "en": "August 2023 - Adding possibility to customize the background color.", + "fr": "Août 2023 - Ajout de la possibilité de personnaliser la couleur de fond." + }, + { + "en": "June 2021 - Initial provisional implementation to gather user experience data.", + "fr": "Juin 2021 - Implémentation provisoire initiale pour recueillir des données sur l'expérience utilisateur." + } + ] + } + ], + "implementation": [ + { + "@id": "_:implement_featuredLink", + "iteration": "_:iteration_featuredLink_3", + "name": { + "en": "Standard", + "fr": "Standard" + }, + "introduction": { + "en": "This implementation is meant for developers/publishers adding the component manually.", + "fr": "Cette implémentation est destinée aux développeurs/éditeurs qui ajoutent le composant manuellement." + }, + "instructions": { + "en": [ + "Refer to the following code sample.", + "You can optionally add a description under the featured link.", + "To customize the background color, add the attribute data-bg-color to the <section> element. The value should be the hexadecimal code of the desired color, for example: #005B61." + ], + "fr": [ + "Référez-vous au code qui suit.", + "Vous pouvez facultativement ajouter une description sous le lien en vedette.", + "Pour personnaliser la couleur d'arrière-plan, ajoutez l'attribut data-bg-color à l'élément <section>. La valeur doit être le code hexadécimal de la couleur souhaitée, par exemple : #005B61." + ] + }, + "notes": { + "en": [ + "When customizing the background color, the component will automatically apply the correct color to the text: #FFFFFF for dark colors, #333333 for light colors, #000000 for colors in-between." + ], + "fr": [ + "Lorsque la couleur de fond est personnalisée, la composante appliquera automatiquement la bonne couleur au texte : #FFFFFF pour les couleurs sombres, #333333 pour les couleurs claires, #000000 pour les couleurs intermédiaires." + ] + }, + "sample": { + "en": [ + { + "@type": "source-code", + "description": "Code sample:", + "code": "" + } + ], + "fr": [ + { + "@type": "source-code", + "description": "Exemple de code :", + "code": "" + } + ] + } + }, + { + "@id": "_:implement_migrationProvisional", + "iteration": "_:iteration_featuredLink_3", + "name": { + "en": "Migration from provisional to stable v1.0.0", + "fr": "Migration de provisoire à stable v1.0.0" + }, + "introduction": { + "en": "This implementation is meant for developers/publishers attempting to update the component from its provisional state to its stable state version 1.0.0.", + "fr": "Cette implémentation est destinée aux développeurs/éditeurs tentant de mettre à jour la composante à partir de l'état provoire vers l'état stable version 1.0.0." + }, + "instructions": { + "en": [ + "Remove the CSS class \"provisional\".", + "Remove the starting and end tags for both <div class=\"row\"></div> and <div class=\"col-xs-12\"></div>.", + "Update the <h2 class=\"wb-inv\"> title to \"Spotlight on\"." + ], + "fr": [ + "Supprimer la classe CSS \"provisoire\".", + "Supprimez les balises de début et de fin pour <div class=\"row\"></div> et <div class=\"col-xs-12\" ></div>.", + "Mettez à jour le titre <h2 class=\"wb-inv\"> à \"Pleins feux sur\"." + ] + }, + "sample": { + "en": [ + { + "@type": "source-code", + "description": "Code before:", + "code": "
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Featured

\n\t\t\t\t

[Promotion title]

\n\t\t\t
\n\t\t
\n\t
\n
" + }, + { + "@type": "source-code", + "description": "Code after:", + "code": "" + } + ], + "fr": [ + { + "@type": "source-code", + "description": "Code avant :", + "code": "
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

En vedette

\n\t\t\t\t

[Titre de la promotion]

\n\t\t\t
\n\t\t
\n\t
\n
" + }, + { + "@type": "source-code", + "description": "Code après :", + "code": "" + } + ] + } + } + ], + "iteration": [ + { + "@id": "_:iteration_featuredLink_3", + "name": "Featured link - Iteration 3", + "date": "2024-03", + "detectableBy": ".gc-featured-link:not(.provisional)", + "breaking": [ + "Removed unnecessary grid", + "Changed hidden heading" + ], + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "" + } + ] + }, + { + "@id": "_:iteration_featuredLink_2", + "name": "Featured link - Iteration 2", + "date": "2023-08", + "detectableBy": ".provisional.gc-featured-link[data-bg-color]", + "additions": [ + "Adding possibility to customize the background color." + ], + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Featured

\n\t\t\t\t

[Promotion title]

\n\t\t\t
\n\t\t
\n\t
\n
" + } + ] + }, + { + "@id": "_:iteration_featuredLink_1", + "name": "Featured link - Iteration 1", + "date": "2021-06", + "detectableBy": ".provisional.gc-featured-link", + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Featured

\n\t\t\t\t

[Promotion title]

\n\t\t\t
\n\t\t
\n\t
\n
" + } + ] + }, + { + "@id": "_:iteration_featuredLinkHelpers_1", + "name": "Featured link with helpers - Iteration 1", + "date": "unknown", + "detectableBy": ".bg-gctheme.opct-90 a.stretched-link", + "assets": [ + { + "@type": "source-code", + "@language": "en", + "description": "Code sample", + "code": "
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Featured:

\n\t\t\t\t

[Promotion title]

\n\t\t\t
\n\t\t
\n\t
\n
" + } + ] + } + ], + "changesets": [ + { + "@id": "_:cs_featuredLink", + "name": "Featured link", + "status": "stable", + "baseOnIteration": "_:iteration_featuredLink_1", + "detectableBy": ".gc-featured-link", + "layout": "Component spans across viewport width, link spans across container width.", + "semantic": "section>h2+a", + "style": "By default, the background color of the component is blue with white text.", + "static": [ + "Featured", + "En vedette" + ], + "schema": [ + "Link title (type: STRING)", + "Link URL (type: STRING)", + "Link description (type: STRING)", + "Background color (type: STRING) - optional" + ], + "configuration": "data-bg-color: customize the background color" + } + ] } ,{ "@context": { diff --git a/components/gc-featured-link/_base.scss b/components/gc-featured-link/_base.scss index 7944f0b7c1..f88eb8c82b 100644 --- a/components/gc-featured-link/_base.scss +++ b/components/gc-featured-link/_base.scss @@ -1,4 +1,4 @@ -/* Provisional featured link component */ +/* featured link component */ .gc-featured-link { background-color: $bg-gctheme; @@ -7,8 +7,9 @@ opacity: .9; padding-bottom: $space-md; padding-top: $space-md; + position: relative; - p:first-of-type { + p { margin-bottom: $space-0; } diff --git a/components/gc-featured-link/gc-featured-link-doc-en.html b/components/gc-featured-link/gc-featured-link-doc-en.html new file mode 100644 index 0000000000..c4260f6676 --- /dev/null +++ b/components/gc-featured-link/gc-featured-link-doc-en.html @@ -0,0 +1,9 @@ +--- +title: Featured link +description: Documentation for the Featured link component +language: en +altLangPage: gc-featured-link-doc-fr.html +dateModified: 2024-03-08 +layout: documentation +index_json: index.json-ld +--- diff --git a/components/gc-featured-link/gc-featured-link-doc-fr.html b/components/gc-featured-link/gc-featured-link-doc-fr.html new file mode 100644 index 0000000000..3c477e2f45 --- /dev/null +++ b/components/gc-featured-link/gc-featured-link-doc-fr.html @@ -0,0 +1,9 @@ +--- +title: Lien en vedette +description: Documentation pour la composante Lien en vedette +language: fr +altLangPage: gc-featured-link-doc-en.html +dateModified: 2024-03-08 +layout: documentation +index_json: index.json-ld +--- diff --git a/components/gc-featured-link/gc-featured-link-en.html b/components/gc-featured-link/gc-featured-link-en.html index cfa1493528..cf4ee10a88 100644 --- a/components/gc-featured-link/gc-featured-link-en.html +++ b/components/gc-featured-link/gc-featured-link-en.html @@ -1,84 +1,61 @@ --- -title: Featured link -description: Documentation and working example for the featured link - provisional feature -language: en -altLangPage: gc-featured-link-fr.html -dateModified: 2021-07-07 -layout: no-container +{ + "title": Featured link, + "description": Working examples for the Featured link component, + "language": en, + "altLangPage": gc-featured-link-fr.html, + "dateModified": 2024-03-08, + "breadcrumbs": [ + { "title": "Featured link - Documentation", "link": "components/gc-featured-link/gc-featured-link-doc-en.html" } + ], + "layout": no-container +} --- + +
-

{{ page.title }}

- - {% include alert-provisional.html %} - - - -
-
Status
-
Provisional
-
Type
-
Canada.ca design pattern
-
Last review
-
2021-07-07
-
Conforming to
-
Content and IA Specification - Version 2.1.2
-
Guidance
-
n/a
-
Technical name
-
gc-featured-link
-
- -

Purpose

-

This adds a featured link to a page that your institution needs to feature prominently. It should be used to bring attention to warnings or notices.

- -

Working examples

- -

Featured link (provisional v1.0)

-

The logic semantic structure of headings have not been followed to accommodate the following working example. You can go directly to the source code.

+

{{ page.title }}

+

Below are working examples for the "Featured link" component.

+ +
+

Headings structure

+

The logic semantic structure of headings have not been followed to accommodate the following working examples.

+
+ +

On this page

+ + +

Default example

-