Files
dify/web/app/components/base/button/add-button.stories.tsx
Stephen Zhou 47d0e400ae
Some checks failed
autofix.ci / autofix (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Has been cancelled
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Has been cancelled
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Has been cancelled
Main CI Pipeline / Check Changed Files (push) Has been cancelled
Main CI Pipeline / API Tests (push) Has been cancelled
Main CI Pipeline / Web Tests (push) Has been cancelled
Main CI Pipeline / Style Check (push) Has been cancelled
Main CI Pipeline / VDB Tests (push) Has been cancelled
Main CI Pipeline / DB Migration Test (push) Has been cancelled
Trigger i18n Sync on Push / trigger (push) Has been cancelled
chore: update to story book nextjs-vite (#31536)
2026-01-26 17:07:20 +08:00

53 lines
1.3 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import AddButton from './add-button'
const meta = {
title: 'Base/General/AddButton',
component: AddButton,
parameters: {
layout: 'centered',
docs: {
description: {
component: 'Compact icon-only button used for inline “add” actions in lists, cards, and modals.',
},
},
},
tags: ['autodocs'],
argTypes: {
className: {
control: 'text',
description: 'Extra classes appended to the clickable container.',
},
onClick: {
control: false,
description: 'Triggered when the add button is pressed.',
},
},
args: {
onClick: () => console.log('Add button clicked'),
},
} satisfies Meta<typeof AddButton>
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
className: 'bg-white/80 shadow-sm backdrop-blur-sm',
},
}
export const InToolbar: Story = {
render: args => (
<div className="flex items-center gap-2 rounded-lg border border-divider-subtle bg-components-panel-bg p-3">
<span className="text-xs text-text-tertiary">Attachments</span>
<div className="ml-auto flex items-center gap-2">
<AddButton {...args} />
</div>
</div>
),
args: {
className: 'border border-dashed border-primary-200',
},
}