diff --git a/.changeset/lazy-rings-march.md b/.changeset/lazy-rings-march.md new file mode 100644 index 0000000000..23cabaae80 --- /dev/null +++ b/.changeset/lazy-rings-march.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-documentation': minor +--- + +Added a documentation page for the post stepper component. diff --git a/packages/documentation/.storybook/preview.ts b/packages/documentation/.storybook/preview.ts index 9410fcce2e..7e96a4c4d7 100644 --- a/packages/documentation/.storybook/preview.ts +++ b/packages/documentation/.storybook/preview.ts @@ -57,6 +57,7 @@ const preview: Preview = { 'Pagination', 'Popover', 'Progressbar', + 'Stepper', 'Table', 'Tabs', 'Timepicker', diff --git a/packages/documentation/src/shared/post-component-demo-link.mdx b/packages/documentation/src/shared/post-component-demo-link.mdx new file mode 100644 index 0000000000..6f1acdaa79 --- /dev/null +++ b/packages/documentation/src/shared/post-component-demo-link.mdx @@ -0,0 +1,8 @@ + + See archived documentation + diff --git a/packages/documentation/src/stories/components/stepper/stepper-component.sample.ts b/packages/documentation/src/stories/components/stepper/stepper-component.sample.ts new file mode 100644 index 0000000000..5df6b5129d --- /dev/null +++ b/packages/documentation/src/stories/components/stepper/stepper-component.sample.ts @@ -0,0 +1,18 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'post-stepper', + templateUrl: 'template.html', +}) +export class StepperDemoComponent { + steps = ['Sender', 'Product', 'Other details', 'Order summary']; + currentIndex = 2; + + isCurrent(step: string): boolean { + return step === this.steps[this.currentIndex]; + } + + getPathTo(step: string): string { + return step.toLowerCase().split(' ').join('-'); + } +} diff --git a/packages/documentation/src/stories/components/stepper/stepper-template.sample.html b/packages/documentation/src/stories/components/stepper/stepper-template.sample.html new file mode 100644 index 0000000000..b91caf9142 --- /dev/null +++ b/packages/documentation/src/stories/components/stepper/stepper-template.sample.html @@ -0,0 +1,23 @@ +
Conveys progress through numbered steps.
+ +The stepper uses ng-bootstrap's progressbar component.
+