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

feat(journey-maps): add web-component examples page #1948

Merged
merged 7 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/journey-maps/web-component/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ sass_binary(

markdown_to_html(
name = "overview",
srcs = [":web-component.md"],
srcs = glob(["*.md"]),
)
3 changes: 3 additions & 0 deletions src/journey-maps/web-component/web-component-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
For the full API, please see our [Angular API](/journey-maps/components/angular/api).

For details on how to use this API via the Web Component, please refer to the [Overview](/journey-maps/components/web-component/overview) or the [Examples](/journey-maps/components/web-component/examples) page.
11 changes: 11 additions & 0 deletions src/journey-maps/web-component/web-component-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Below are a few example implementations using the Web Component. Please let us know if you have additional use-cases you would like to see covered here.

## On your local machine

If you check out this project from GitHub, You can get a simple example of the Web Component up and running on your local machine by running `JM_API_KEY=<YOUR-API-KEY> yarn start:journey-maps-wc`.

## On Stackblitz

We have provided a React example application showcasing some of the features of the `sbb-journey-maps-wc` web-component.

=> <a href="https://stackblitz.com/edit/sbb-journey-maps-web-component-showcase" target="_blank">Web-Component Stackblitz Example using React</a>
18 changes: 18 additions & 0 deletions src/showcase/app/journey-maps/journey-maps-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ const routes: Routes = [
component: MarkdownViewerComponent,
data: { packageName: 'journey-maps' },
},
{
path: 'components/web-component',
component: ComponentViewerComponent,
data: { packageName: 'journey-maps', id: 'web-component' },
children: [
{
path: 'api',
data: { id: 'web-component/web-component-api' },
component: MarkdownViewerComponent,
},
{
path: 'examples',
data: { id: 'web-component/web-component-examples' },
component: MarkdownViewerComponent,
},
...componentViewerSubnavigation, // paths already specified above will be ignored
],
},
{
path: 'components/:id',
component: ComponentViewerComponent,
Expand Down
Loading