diff --git a/alfa-client/apps/demo/src/app/app.component.html b/alfa-client/apps/demo/src/app/app.component.html index f11b4884f22682b0ae9288880fa5d3b353e55e16..25e02f33b59d8a32db4332a88a6fef1d2e675c76 100644 --- a/alfa-client/apps/demo/src/app/app.component.html +++ b/alfa-client/apps/demo/src/app/app.component.html @@ -19,7 +19,7 @@ <a href="#" class="flex flex-col items-start justify-between gap-2 rounded-t-md border-primary-600/50 px-6 py-4 hover:bg-background-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus lg:flex-row lg:gap-6" - [tooltip]="'This is tooltip attached to link element'" + tooltip="This is tooltip attached to link element" > <div class="flex-1 basis-5/6"> <div class="flex flex-wrap items-center gap-x-3"> @@ -397,7 +397,7 @@ </form> <app-bescheid-dialog-button></app-bescheid-dialog-button> <div class="my-4 flex gap-4"> - <ods-button text="Button 1" [tooltip]="'Sample tooltip'" /> + <ods-button text="Button 1" tooltip="Sample tooltip" /> <ods-button size="medium" [isLoading]="true" text="Button 2" /> <ods-button type="outline" text="Button 3" /> </div> diff --git a/alfa-client/libs/design-system/src/lib/tooltip/tooltip.stories.ts b/alfa-client/libs/design-system/src/lib/tooltip/tooltip.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..f380cd055b3215670369b0d30fbbe2e00ef18921 --- /dev/null +++ b/alfa-client/libs/design-system/src/lib/tooltip/tooltip.stories.ts @@ -0,0 +1,29 @@ +import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular'; +import { TooltipDirective } from './tooltip.directive'; + +const meta: Meta = { + title: 'Tooltip', + excludeStories: /.*Data$/, + tags: ['autodocs'], + decorators: [ + moduleMetadata({ + imports: [TooltipDirective], + }), + ], + parameters: { + docs: { + description: { + component: 'Tooltip directive that can be used with every element (check out default story to see tooltip working).', + }, + }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: () => ({ + template: '<button tooltip="Hello">I have a tooltip!</button>', + }), +};