Skip to content

Commit

Permalink
refactor(storybook): refactor tooltip simple story interface (#9538)
Browse files Browse the repository at this point in the history
**Related Issue:**
[#9537](#9537)

## Summary
Refactors the interface within
[`tooltip.stories.ts`](https://github.com/Esri/calcite-design-system/blob/main/packages/calcite-components/src/components/tooltip/tooltip.stories.ts)
to use props from the component's class.
  • Loading branch information
aPreciado88 authored Jun 7, 2024
1 parent bb45bdb commit 8b80757
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ const contentHTML = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, se

const referenceElementHTML = `Ut enim ad minim veniam, quis <calcite-button appearance="transparent" kind="neutral" id="reference-element">nostrud exercitation</calcite-button> ullamco laboris nisi ut aliquip ex ea commodo consequat.`;

interface TooltipStoryArgs {
placements: string;
offsetDistance: number;
offsetSkidding: number;
open: Tooltip["open"];
}
type TooltipStoryArgs = Pick<Tooltip, "placement" | "offsetDistance" | "offsetSkidding" | "open">;

export default {
title: "Components/Tooltip",
args: {
placements: placements[0],
placement: placements[0],
offsetDistance: 6,
offsetSkidding: 0,
open: false,
Expand All @@ -35,7 +30,7 @@ export const simple = (args: TooltipStoryArgs): string => html`
${referenceElementHTML}
<calcite-tooltip
reference-element="reference-element"
placement="${args.placements}"
placement="${args.placement}"
offset-distance="${args.offsetDistance}"
offset-skidding="${args.offsetSkidding}"
${boolean("open", args.open)}
Expand Down

0 comments on commit 8b80757

Please sign in to comment.