diff --git a/packages/web-components/src/tooltip/tooltip.stories.ts b/packages/web-components/src/tooltip/tooltip.stories.ts index 29040e851e0bd..e40180b6ec213 100644 --- a/packages/web-components/src/tooltip/tooltip.stories.ts +++ b/packages/web-components/src/tooltip/tooltip.stories.ts @@ -1,10 +1,12 @@ -import { html, render, repeat } from '@microsoft/fast-element'; +import { html, repeat } from '@microsoft/fast-element'; import { uniqueId } from '@microsoft/fast-web-utilities'; -import { Meta, renderComponent, Story } from '../helpers.stories.js'; +import { type Meta, renderComponent, type StoryObj } from '../helpers.stories.js'; import { definition } from './tooltip.definition.js'; -import { Tooltip } from './tooltip.js'; +import type { Tooltip } from './tooltip.js'; import { TooltipPositioningOption } from './tooltip.options.js'; +type Story = StoryObj; + const storyTemplate = () => { const id = uniqueId('anchor-'); @@ -48,13 +50,12 @@ export default { }, }, }, -} as unknown as Meta; +} as Meta; -export const Default: Story = args => { - return renderComponent(html`${render(args, storyTemplate)}`)(args); -}; -Default.args = { - slottedContent: () => html`Really long tooltip content goes here. lorem ipsum dolor sit amet.`, +export const Default: Story = { + args: { + slottedContent: () => html`Really long tooltip content goes here. lorem ipsum dolor sit amet.`, + }, }; const iconArrowRight = (rotation = 0) => html` ${x => x.id} `; -export const Positioning: Story = renderComponent(html` -
- -
${repeat(x => x.storyItems, positionButtonTemplate)}
- - ${repeat(x => x.storyItems, positionTooltipTemplate)} -
-`).bind({}); +export const Positioning: Story = { + parameters: { + layout: 'centered', + }, + render: renderComponent(html` +
+ +
${repeat(x => x.storyItems, positionButtonTemplate)}
-Positioning.args = { - storyItems: Object.keys(TooltipPositioningOption).map(id => ({ id })), + ${repeat(x => x.storyItems, positionTooltipTemplate)} +
+ `), + args: { + storyItems: Object.keys(TooltipPositioningOption).map(id => ({ id })), + }, };