/* * (c) Copyright 2026 Palantir Technologies Inc. All rights reserved. */ import type { Meta, StoryObj } from "@storybook/react-vite"; import { storybookLayoutDecorator, StoryLabel } from "@storybook-common"; import { Flex } from "@blueprintjs/labs"; import { Intent } from "../../common"; import { Callout } from "./callout"; const meta: Meta = { title: "Core/Callout", component: Callout, decorators: [storybookLayoutDecorator], tags: ["autodocs"], args: { children: "This is a callout with some informational content.", intent: undefined, icon: undefined, title: undefined, compact: false, minimal: false, }, argTypes: { intent: { control: "select", options: [...Object.values(Intent)], }, icon: { control: "text", }, compact: { control: "boolean", }, minimal: { control: "boolean", }, title: { control: "text", }, }, } satisfies Meta; export default meta; type Story = StoryObj; /** * A basic callout with default styling. */ export const Default: Story = { args: { children: "This is a callout with some informational content.", }, }; /** * Use the `intent` prop to apply a semantic color that conveys the purpose or status of the callout. * When an intent is set, a default icon is also rendered. */ export const IntentExample: Story = { name: "Intent", argTypes: { intent: { table: { disable: true } }, }, render: args => ( {Object.values(Intent).map(intent => ( {intent.charAt(0).toUpperCase() + intent.slice(1)} intent callout. ))} ), }; /** * Use the `minimal` prop to render a callout without a background color fill. */ export const VariantExample: Story = { name: "Variant", argTypes: { minimal: { table: { disable: true } }, }, render: args => ( Default callout with background fill. Minimal callout without background fill. ), }; /** * Use the `compact` prop to reduce the visual padding around callout content. */ export const CompactExample: Story = { name: "Compact", argTypes: { compact: { table: { disable: true } }, }, render: args => ( Default padding callout. Compact padding callout. ), }; /** * Use the `icon` prop to render an icon on the left side. If omitted, the intent prop determines a default icon. * Set `icon={null}` to explicitly hide the icon. */ export const IconExample: Story = { name: "Icons", argTypes: { icon: { table: { disable: true } }, }, render: args => ( Custom icon callout. Intent-driven default icon. Intent with icon explicitly hidden. ), }; /** * All intents across default and minimal variants. */ export const AllIntentsAllVariants: Story = { argTypes: { intent: { table: { disable: true } }, minimal: { table: { disable: true } }, }, render: args => ( {[false, true].map(minimal => ( No intent callout. {Object.values(Intent).map(intent => ( {intent.charAt(0).toUpperCase() + intent.slice(1)} intent callout content. ))} ))} ), }; /** * Interactive playground with all props togglable via Storybook controls. */ export const Playground: Story = { args: { children: "Adjust the controls to customize this callout.", intent: "primary", title: "Playground Callout", icon: undefined, compact: false, minimal: false, }, };