Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carbon tutorial web components #4347

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9820c41
feat: add step 1 of tutorial
lee-chase Oct 29, 2024
a39378d
feat: step 2 complete
lee-chase Oct 30, 2024
ae716da
feat: step 3 complete
lee-chase Oct 30, 2024
9545c45
feat: step 4 complete
lee-chase Oct 30, 2024
c114079
feat: step 5 deploy
lee-chase Oct 31, 2024
24c43b8
fix: mask urls for deploy
lee-chase Oct 31, 2024
2b246f8
feat: add cdn usage
lee-chase Oct 31, 2024
53ded7e
chore: adjust github instructions
lee-chase Oct 31, 2024
c45b7d1
chore: remove wrapping up
lee-chase Oct 31, 2024
0e9e2b7
feat: update anchors on step 5
lee-chase Oct 31, 2024
b37be8f
feat: add note about deployed version cdn use
lee-chase Oct 31, 2024
0dc0097
fix: nav and previews
lee-chase Oct 31, 2024
6ed093e
fix: preview links
lee-chase Oct 31, 2024
6d2b511
fix: add links to linters
lee-chase Oct 31, 2024
7c7faaa
Merge branch 'main' into carbon-tutorial-web-components
lee-chase Oct 31, 2024
a2bcdb8
fix: angular tutorial prettier complaint
lee-chase Oct 31, 2024
68e1bc0
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
db5fd3f
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
8ad23e4
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
4c659c5
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
a79c843
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
ca7e46d
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
a303a01
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
5823295
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 4, 2024
9b8e206
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 4, 2024
edfe809
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
8b7466f
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
10dec2d
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 4, 2024
91b6796
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 4, 2024
b644434
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 4, 2024
779671a
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
2d9b62f
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
3244907
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
378c59e
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
33c18df
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
629f604
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
9532530
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 4, 2024
2de3ed3
fix: review issues with case
lee-chase Nov 4, 2024
dc36491
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 4, 2024
6c8659b
Update src/pages/all-about-carbon/who-uses-carbon.mdx
lee-chase Nov 5, 2024
2eef4ad
Merge branch 'main' into carbon-tutorial-web-components
lee-chase Nov 7, 2024
51c248b
chore: yarn format
alisonjoseph Nov 7, 2024
b10192d
fix: bump version and remove pagination issue
lee-chase Nov 11, 2024
468deb8
Merge branch 'main' into carbon-tutorial-web-components
lee-chase Nov 11, 2024
c6f3b4f
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 19, 2024
ea94362
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 19, 2024
f3dd7df
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
edfc6f9
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
b9e14b8
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
84b33c7
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
32202b8
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
f2a0017
Update src/pages/developing/web-components-tutorial/step-2.mdx
lee-chase Nov 19, 2024
36ccbfb
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 19, 2024
b758a79
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 19, 2024
2842b0c
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 19, 2024
fdd9a47
Update src/pages/developing/web-components-tutorial/step-3.mdx
lee-chase Nov 19, 2024
e0f1804
Update src/pages/developing/web-components-tutorial/step-4.mdx
lee-chase Nov 19, 2024
75c48ff
Update src/pages/developing/web-components-tutorial/overview.mdx
lee-chase Nov 19, 2024
bad9dba
Update src/pages/developing/web-components-tutorial/overview.mdx
lee-chase Nov 19, 2024
7f19216
Update src/pages/developing/web-components-tutorial/overview.mdx
lee-chase Nov 19, 2024
8d9a915
Update src/pages/developing/web-components-tutorial/step-5.mdx
lee-chase Nov 19, 2024
aeb0a2c
fix: review change to content
lee-chase Nov 19, 2024
ec86c01
Update src/pages/developing/web-components-tutorial/step-1.mdx
lee-chase Nov 19, 2024
094ec6f
feat: review update existing content
lee-chase Nov 19, 2024
eaa559e
Merge branch 'main' into carbon-tutorial-web-components
lee-chase Nov 20, 2024
c51e610
chore: yarn format
alisonjoseph Nov 20, 2024
0b7746c
Merge branch 'main' into carbon-tutorial-web-components
lee-chase Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ src/pages/data-visualization/* @theiliad # @natashadecoste
# Lee Chase for Vue tutorial

/src/pages/tutorial/vue/* @lee-chase

# Lee Chase for Web components tutorial

/src/pages/tutorial/web-components/* @lee-chase
9 changes: 7 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ exports.createPages = ({ actions }) => {
toPath: '/developing/react-tutorial/overview',
isPermanent: true,
});
createRedirect({
fromPath: '/tutorial/web-components/overview',
toPath: '/developing/web-components-tutorial/overview',
isPermanent: true,
});
createRedirect({
fromPath: '/tutorial/angular/overview',
toPath: '/developing/angular-tutorial/overview',
Expand Down Expand Up @@ -192,12 +197,12 @@ exports.createPages = ({ actions }) => {
toPath: '/elements/motion/overview',
isPermanent: true,
});
createRedirect({
createRedirect({
fromPath: '/guidelines/motion/choreography',
toPath: '/elements/motion/choreography',
isPermanent: true,
});
createRedirect({
createRedirect({
fromPath: '/guidelines/motion/code',
toPath: '/elements/motion/code',
isPermanent: true,
Expand Down
2 changes: 2 additions & 0 deletions src/data/nav-items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
path: /developing/angular-tutorial/overview/
- title: React tutorial
path: /developing/react-tutorial/overview/
- title: Web components tutorial
path: /developing/web-components-tutorial/overview/
- title: Vue tutorial
path: /developing/vue-tutorial/overview/
- title: Contributing
Expand Down
1 change: 1 addition & 0 deletions src/pages/all-about-carbon/who-uses-carbon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Here are some ways developers can begin engaging with Carbon.

- Check out a tutorial in your framework of choice
([React using Next.js](/developing/react-tutorial/overview/),
([Web components using Vaniall.js/HTML](/developing/web-components-tutorial/overview/),
lee-chase marked this conversation as resolved.
Show resolved Hide resolved
[Angular (community)](/developing/angular-tutorial/overview/) or
[Vue (community)](/developing/vue-tutorial/overview/)).

Expand Down
7 changes: 6 additions & 1 deletion src/pages/developing/angular-tutorial/step-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ Run the following command to install the packages:
npm install carbon-components carbon-components-angular @carbon/icons
```

The following links can be useful depending on the versions of Angular and Carbon you wish to use. They provide detailed information about the components and the global configuration of the design system. Additionally, they may cover alternative methods for configuring Carbon, which can vary based on the Angular version and any additional libraries available. Keep in mind that the configuration for 'styles.scss' may also vary.:
The following links can be useful depending on the versions of Angular and
Carbon you wish to use. They provide detailed information about the components
and the global configuration of the design system. Additionally, they may cover
alternative methods for configuring Carbon, which can vary based on the Angular
version and any additional libraries available. Keep in mind that the
configuration for 'styles.scss' may also vary.:

- [Getting Started with Carbon for Angular](https://angular.carbondesignsystem.com/?path=/docs/getting-started--docs)
- [Carbon Design System Documentation](https://angular.carbondesignsystem.com/documentation/index.html)
Expand Down
10 changes: 10 additions & 0 deletions src/pages/developing/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ the way.

</ResourceCard>
</Column>
<Column colLg={4} colMd={4} noGutterSm>
<ResourceCard
subTitle="Web components tutorial using Vanilla.js/HTML"
href="/developing/web-components-tutorial/overview"
>

<MdxIcon name="webcomponents" />

</ResourceCard>
</Column>
<Column colLg={4} colMd={4} noGutterSm>
<ResourceCard
subTitle="Angular tutorial"
Expand Down
11 changes: 1 addition & 10 deletions src/pages/developing/react-tutorial/wrapping-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ description:
Welcome to Carbon! This tutorial will guide you in creating a React app using
Next.js with the Carbon Design System.
tabs:
[
'Overview',
'Step 1',
'Step 2',
'Step 3',
'Step 4',
'Step 5',
'Wrapping up',
'FAQ',
]
['Overview', 'Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5', 'Wrapping up']
---

<PageDescription>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions src/pages/developing/web-components-tutorial/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: React tutorial
lee-chase marked this conversation as resolved.
Show resolved Hide resolved
description:
Welcome to Carbon! This tutorial will guide you in creating a Vanilla JS/HTML
app using Web Components from the Carbon Design System.
tabs: ['Overview', 'Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5']
---

import Preview from 'components/Preview';

<PageDescription>

Welcome to Carbon! This tutorial will guide you in creating a Vanilla JS/HTML
app using Web Components from the Carbon Design System. We'll teach you the ins
and outs of using Carbon components, while introducing web development best
practices along the way.

Web components are native custom components based on standards that can be used
in any modern browser with any JavaScript library or framework just like plain
HTML elements.

For more information
[see Web Components](https://www.webcomponents.org/introduction).

</PageDescription>

<AnchorLinks>

<AnchorLink>Audience</AnchorLink>
<AnchorLink>Prerequisites</AnchorLink>
<AnchorLink>Outline</AnchorLink>

</AnchorLinks>

Here's a [preview](https://carbon-tutorial-nextjs.vercel.app/) of what you will
build:

<Preview
height="400"
title="Carbon Tutorial"
src="https://carbon-tutorial-nextjs.vercel.app/"
frameborder="no"
allowtransparency="true"
allowfullscreen="true"
/>

## Audience

This tutorial is intended for people with all amounts of web development
experience. If you want to jump straight to code, you may want to skip this
tutorial and go to the [developers getting started](/developing/get-started)
page.

## Prerequisites

### HTML

This is a web development tutorial that uses HTML. If you're not sure that you
are quite ready then hop over to
[W3Schools](https://www.w3schools.com/html/default.asp)

### SCSS (CSS preprocessor)

This tutorial uses SASS, or rather the CSS styled flavour called SCSS. If you
need help with CSS then head again to
[W3Schools](https://www.w3schools.com/css/default.asp) for SCSS head to
[the guide](https://sass-lang.com/guide/) on sass-lang.com.
lee-chase marked this conversation as resolved.
Show resolved Hide resolved

### ECMAScript (Javascript)

Javascript is fundemental to adding interaction to your HTML. There are many
great resources out there [W3Schools](https://www.w3schools.com/js/default.asp)
is more than enough for everything in this tutorial.
lee-chase marked this conversation as resolved.
Show resolved Hide resolved

### GitHub

We'll be using GitHub to build an app together, so if you're new to GitHub, make
sure you've [made an account](https://github.com/join). Their
[getting started guide](https://guides.github.com/activities/hello-world) is a
great way to learn GitHub.

### Pnpm

This tutorial uses [Pnpm](https://pnpm.io/) for dependency management as that
was the default for `create-vite`. Make sure that you have
[Pnpm installed](https://pnpm.io/installation) prior to starting the tutorial so
you can follow along step-by-step.

## Outline

Each step in this tutorial illustrates a different aspect of developing web
applications with Carbon. We recommend starting with step 1, but you can pick up
any step and take it from there.

1. [**Installing Carbon**](/developing/web-components-tutorial/step-1)
- Create a web app with the UI shell component.
2. [**Building pages**](/developing/web-components-tutorial/step-2)
- Build out pages with the grid and various components.
lee-chase marked this conversation as resolved.
Show resolved Hide resolved
3. [**Using APIs**](/developing/web-components-tutorial/step-3)
- Populate the data table with an external data source.
4. [**Creating components**](/developing/web-components-tutorial/step-4)
- Extend Carbon by creating your own components.
5. [**Deploying**](/developing/web-components-tutorial/step-5)
- Build and host your app in a production environment.
Loading
Loading