|
| 1 | +import { ComponentMeta, ComponentStoryObj } from "@storybook/react"; |
| 2 | + |
| 3 | +import { createControls, createPreviewTabs } from "../../../.storybook/utils"; |
| 4 | +import { SlotIcon } from "../../icons"; |
| 5 | + |
| 6 | +import js from "./templates/TooltipAnchorJsx"; |
| 7 | +import ts from "./templates/TooltipAnchorTsx"; |
| 8 | +import TooltipAnchor from "./TooltipAnchor.component"; |
| 9 | + |
| 10 | +type Meta = ComponentMeta<typeof TooltipAnchor>; |
| 11 | +type Story = ComponentStoryObj<typeof TooltipAnchor>; |
| 12 | + |
| 13 | +export default { |
| 14 | + title: "Popups/Tooltip/Anchor", |
| 15 | + component: TooltipAnchor, |
| 16 | + argTypes: createControls("tooltip", { |
| 17 | + ignore: [ |
| 18 | + "wrapElement", |
| 19 | + "as", |
| 20 | + "ref", |
| 21 | + "prefix", |
| 22 | + "suffix", |
| 23 | + "content", |
| 24 | + "isDragging", |
| 25 | + "visible", |
| 26 | + "defaultVisible", |
| 27 | + "setVisible", |
| 28 | + "animated", |
| 29 | + "gutter", |
| 30 | + "timeout", |
| 31 | + "getAnchorRect", |
| 32 | + "fixed", |
| 33 | + "shift", |
| 34 | + "flip", |
| 35 | + "slide", |
| 36 | + "overlap", |
| 37 | + "sameWidth", |
| 38 | + "fitViewport", |
| 39 | + "arrowPadding", |
| 40 | + "overflowPadding", |
| 41 | + "renderCallback", |
| 42 | + "wrapperProps", |
| 43 | + "portalElement", |
| 44 | + "portalRef", |
| 45 | + "hideOnEscape", |
| 46 | + "hideOnControl", |
| 47 | + ], |
| 48 | + }), |
| 49 | + parameters: { |
| 50 | + layout: "centered", |
| 51 | + options: { showPanel: true }, |
| 52 | + preview: createPreviewTabs({ js, ts }), |
| 53 | + }, |
| 54 | +} as Meta; |
| 55 | + |
| 56 | +export const Bottom: Story = { args: { placement: "bottom" } }; |
| 57 | +export const Right: Story = { args: { placement: "right" } }; |
| 58 | +export const Left: Story = { args: { placement: "left" } }; |
| 59 | +export const Top: Story = { args: { placement: "top" } }; |
| 60 | + |
| 61 | +export const ArrowBottom: Story = { |
| 62 | + args: { withArrow: true, placement: "bottom" }, |
| 63 | +}; |
| 64 | +export const ArrowRight: Story = { |
| 65 | + args: { withArrow: true, placement: "right" }, |
| 66 | +}; |
| 67 | +export const ArrowLeft: Story = { |
| 68 | + args: { withArrow: true, placement: "left" }, |
| 69 | +}; |
| 70 | +export const ArrowTop: Story = { args: { withArrow: true, placement: "top" } }; |
| 71 | + |
| 72 | +export const Prefix: Story = { |
| 73 | + args: { withArrow: true, placement: "top", prefix: <SlotIcon /> }, |
| 74 | +}; |
| 75 | + |
| 76 | +export const Suffix: Story = { |
| 77 | + args: { withArrow: true, placement: "top", suffix: <SlotIcon /> }, |
| 78 | +}; |
| 79 | +export const PrefixSuffix: Story = { |
| 80 | + args: { |
| 81 | + withArrow: true, |
| 82 | + placement: "top", |
| 83 | + prefix: <SlotIcon />, |
| 84 | + suffix: <SlotIcon />, |
| 85 | + }, |
| 86 | +}; |
0 commit comments