Skip to content

Commit

Permalink
Housekeeping: Create Cookbook example story for Card (#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaltoft authored Sep 16, 2024
1 parent c3daa23 commit 83323bb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { KirbyModule } from '@kirbydesign/designsystem';
import { CardModule, FlagComponent, IconModule, ItemModule } from '@kirbydesign/designsystem';

import { CardExampleComponent } from './card-example.component';
import { CardExampleBackgroundImageComponent } from './examples/background-image';
Expand All @@ -22,7 +22,7 @@ const COMPONENT_DECLARATIONS = [

@NgModule({
declarations: COMPONENT_DECLARATIONS,
imports: [CommonModule, KirbyModule],
imports: [CommonModule, CardModule, FlagComponent, IconModule, ItemModule],
exports: COMPONENT_DECLARATIONS,
})
export class CardExampleModule {}
17 changes: 15 additions & 2 deletions libs/designsystem/card/src/card.component.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { argsToTemplate, Meta, StoryObj } from '@storybook/angular';
import { argsToTemplate, type Meta, moduleMetadata, type StoryObj } from '@storybook/angular';

import { CardComponent } from '@kirbydesign/designsystem/card';
import { CardComponent, CardModule } from '@kirbydesign/designsystem/card';

import { CardExampleModule } from '~/app/examples/card-example/card-example.module';

const meta: Meta<CardComponent> = {
component: CardComponent,
title: 'Components / Card',
decorators: [
moduleMetadata({
imports: [CardModule, CardExampleModule],
}),
],
};
export default meta;
type Story = StoryObj<CardComponent>;
Expand All @@ -25,3 +32,9 @@ export const Default: Story = {
</kirby-card>`,
}),
};

export const CookbookExamples: Story = {
render: () => ({
template: `<cookbook-card-example></cookbook-card-example>`,
}),
};

0 comments on commit 83323bb

Please sign in to comment.