-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(pie-docs): DSW-2211 adding overview of web components (#1589)
* docs(pie-docs): DSW-2211 add tag shortcode to pie docs This shortcode copy the web component variants. Can be removed once we are able to use our web components in pie docs. * docs(pie-docs): DSW-2211 adding overview of web components Refactors some copy and adds a guide to choose waht component library to use. * docs(pie-docs): DSW-2211 removes new lines and adds changeset file * docs(pie-docs): DSW-2211 fix formatting in headings * docs(pie-docs): DSW-2211 add missing route for testing * docs(pie-docs): DSW-2211 updates README with config for running tests locally * docs(pie-docs): DSW-2211 address PR comments * docs(pie-docs): DSW-2211 address PR comments Co-authored-by: Ashley Watson-Nolan <[email protected]> Co-authored-by: Xander Marjoram <[email protected]> * docs(pie-docs): DSW-2211 address PR comments * docs(pie-docs): DSW-2211 pr comments - intro section and Next 13 copy * Apply suggestions from code review docs(pie-docs): DSW-2211 address PR comments Co-authored-by: Xander Marjoram <[email protected]> --------- Co-authored-by: Ashley Watson-Nolan <[email protected]> Co-authored-by: Xander Marjoram <[email protected]>
- Loading branch information
1 parent
fb5138a
commit 372fd39
Showing
12 changed files
with
280 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"pie-docs": minor | ||
--- | ||
|
||
[Changed] - Updates Engineering copy and adds new Web Components index guide to current documentation in Github Wiki. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @TODO DSW-2258: be replaced once web components are integrated | ||
/** | ||
* Generate an HTML tag component. It duplicates pie tag variants. | ||
* Can be replaced by pie tag when we include pie web components | ||
* @param {string} label - string that renders within the tag | ||
* @param {string} variant - variant name: neutral, blue, green, | ||
* yellow, red, brand, neutral-alternative, outline, ghost | ||
* @returns {string} | ||
*/ | ||
module.exports = ({ | ||
label, | ||
variant, | ||
}) => `<span class="c-tag" variant="${variant}">${label}</span>`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
@use '@justeattakeaway/pie-css/scss/settings' as *; | ||
@use '@justeattakeaway/pie-css/scss' as p; | ||
|
||
.c-tag { | ||
--tag-bg-color: var(--dt-color-container-strong); | ||
--tag-color: var(--dt-color-content-default); | ||
--tag-border-radius: var(--dt-radius-rounded-b); | ||
--tag-padding-block: 2px; | ||
--tag-padding-inline: var(--dt-spacing-b); | ||
--tag-font-family: var(--dt-font-body-s-family); | ||
--tag-font-weight: var(--dt-font-body-s-weight); | ||
--tag-font-size: #{p.font-size(--dt-font-body-s-size)}; | ||
--tag-line-height: #{p.line-height(--dt-font-body-s-line-height)}; | ||
|
||
// transparent to variable to function properly in component tests | ||
--tag-transparent-bg-color: transparent; | ||
|
||
// Pie Webc Icon var that is used to ensure the correctly sized icon passed in a slot | ||
--icon-display-override: block; | ||
--icon-size-override: 16px; | ||
|
||
display: inline-flex; | ||
vertical-align: middle; | ||
align-items: center; | ||
justify-content: center; | ||
gap: var(--dt-spacing-a); | ||
padding: var(--tag-padding-block) var(--tag-padding-inline); | ||
border-radius: var(--tag-border-radius); | ||
background-color: var(--tag-bg-color); | ||
color: var(--tag-color); | ||
font-family: var(--tag-font-family); | ||
font-weight: var(--tag-font-weight); | ||
font-size: var(--tag-font-size); | ||
line-height: var(--tag-line-height); | ||
|
||
|
||
&[variant='neutral'] { | ||
// same as default styles | ||
} | ||
|
||
&[variant='blue'] { | ||
--tag-bg-color: var(--dt-color-support-info-02); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='green'] { | ||
--tag-bg-color: var(--dt-color-support-positive-02); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='yellow'] { | ||
--tag-bg-color: var(--dt-color-support-warning-02); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='red'] { | ||
--tag-bg-color: var(--dt-color-support-error-02); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='brand'] { | ||
--tag-bg-color: var(--dt-color-support-brand-02); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='neutral-alternative'] { | ||
--tag-bg-color: var(--dt-color-container-default); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
|
||
&[variant='outline'] { | ||
--tag-bg-color: var(--tag-transparent-bg-color); | ||
--tag-color: var(--dt-color-content-default); | ||
|
||
// the outline in design specs is part of the total component | ||
// height calculation, thus, we use box-shadow to mimic borders | ||
// and avoid the extra 2px from "border: 1px solid" as shadows are applied "internally" | ||
box-shadow: 0 0 0 1px var(--dt-color-border-strong); | ||
} | ||
|
||
&[variant='ghost'] { | ||
--tag-bg-color: var(--tag-transparent-bg-color); | ||
--tag-color: var(--dt-color-content-default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
eleventyNavigation: | ||
key: Overview | ||
parent: engineers-web-components | ||
order: 1 | ||
permalink: engineers/web-components/ | ||
--- | ||
|
||
## Introduction | ||
|
||
[Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) are a set of native browser technologies that allow us to build custom components. In other words, create custom HTML elements native to browsers. | ||
|
||
Currently, this technology is supported by all browsers, making it possible to have one central library that will work with most frontend frameworks. | ||
|
||
The long-term aim will be to migrate JET teams over to this Web Component System, so we have one single source of truth for our global PIE components. | ||
|
||
--- | ||
|
||
## Component status | ||
|
||
You can find the documentation for all of our components on this site in the **Components** section. | ||
|
||
For a list of which components are supported in each of our libraries, please refer to the [Component Status page](/components/component-status/). | ||
|
||
___ | ||
|
||
## Getting started | ||
|
||
For every framework, you can start with our [Prerequisites Guide](https://github.com/justeattakeaway/pie/wiki/Getting-started-with-PIE-Web-Components). | ||
|
||
For specific framework versions, please follow these guides: | ||
|
||
[Vue 3 Integration Guide](https://github.com/justeattakeaway/pie/wiki/PIE-Web-Components-%E2%80%90-Vue-Integration-Guide) | ||
|
||
[Nuxt 3 Integration Guide](https://github.com/justeattakeaway/pie/wiki/PIE-Web-Components-%E2%80%90-Nuxt-3) | ||
|
||
[Vue & Nuxt ‐ Known gotchas](https://github.com/justeattakeaway/pie/wiki/Vue-Nuxt-%E2%80%90-Known-gotchas) | ||
|
||
For existing users, you may be interested in our [Migration guide of Web Components to Lit 3](https://github.com/justeattakeaway/pie/wiki/PIE-Web-Components-%E2%80%90-Nuxt-2---Next-10---Vue-2-Integration). This guide also details some specific configurations for React, Next and Vue2. | ||
|
||
More guides coming soon! 🚀 | ||
|
||
___ | ||
|
||
## Usage | ||
|
||
The following guides are meant to support you while using our web components. | ||
|
||
For information about form elements and how to handle form data and validation, check out our [Form Usage Guide](https://github.com/justeattakeaway/pie/wiki/Form-Controls#pie-forms-usage). |
5 changes: 5 additions & 0 deletions
5
apps/pie-docs/src/engineers/web-components/web-components.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"title": "Web Components", | ||
"navKey": "engineers-web-components", | ||
"description": "In this section you’ll find all the information you need to use our PIE Web Components library." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
eleventyNavigation: | ||
key: engineers-web-components | ||
title: Web components | ||
parent: engineers | ||
order: 4 | ||
url: /engineers/web-components/ | ||
permalink: false | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters