1+ import type { Meta , StoryObj } from '@storybook/nextjs' ;
2+ import Button from './button' ;
3+ import Download from '../illustration/download' ;
4+
5+ const meta : Meta < typeof Button > = {
6+ title : 'Components/Buttons' ,
7+ component : Button ,
8+ argTypes : {
9+ children : {
10+ control : { type : 'text' } ,
11+ description : 'Button content (alternative to text prop)' ,
12+ defaultValue : 'Button' ,
13+ } ,
14+ text : {
15+ control : { type : 'text' } ,
16+ description : 'Button text (alternative to children)' ,
17+ } ,
18+ type : {
19+ options : [ 'button' , 'submit' , 'reset' ] ,
20+ control : { type : 'select' } ,
21+ defaultValue : 'button' ,
22+ } ,
23+ className : {
24+ control : { type : 'text' } ,
25+ description : 'Custom CSS classes' ,
26+ } ,
27+ outline : {
28+ control : { type : 'boolean' } ,
29+ description : 'Remove gradient background if true' ,
30+ } ,
31+ disabled : {
32+ control : { type : 'boolean' } ,
33+ description : 'Disable the button' ,
34+ } ,
35+ test : {
36+ control : { type : 'text' } ,
37+ description : 'Test attribute' ,
38+ } ,
39+ icon : {
40+ control : { type : 'object' } ,
41+ description : 'Icon component to display' ,
42+ } ,
43+ iconPosition : {
44+ options : [ 'left' , 'right' , 'center' ] ,
45+ control : { type : 'select' } ,
46+ description : 'Position of the icon relative to text' ,
47+ defaultValue : 'right' ,
48+ } ,
49+ onClick : { action : 'clicked' } ,
50+ } ,
51+ } ;
52+
53+ export default meta ;
54+
55+ type Story = StoryObj < typeof Button > ;
56+
57+ export const Default : Story = {
58+ args : {
59+ text : 'Default Button' ,
60+ type : 'button' ,
61+ } ,
62+ } ;
63+
64+ export const Outline : Story = {
65+ args : {
66+ text : 'Outline Button' ,
67+ outline : true ,
68+ className : 'border' ,
69+ type : 'button' ,
70+ } ,
71+ } ;
72+
73+ export const Submit : Story = {
74+ args : {
75+ text : 'Submit Button' ,
76+ type : 'submit' ,
77+ } ,
78+ } ;
79+
80+ export const Reset : Story = {
81+ args : {
82+ text : 'Reset Button' ,
83+ type : 'reset' ,
84+ } ,
85+ } ;
86+
87+ export const WithIconRight : Story = {
88+ args : {
89+ text : 'Download File' ,
90+ icon : < Download /> ,
91+ iconPosition : 'right' ,
92+ type : 'button' ,
93+ } ,
94+ } ;
95+
96+ export const WithIconLeft : Story = {
97+ args : {
98+ text : 'Download File' ,
99+ icon : < Download /> ,
100+ iconPosition : 'left' ,
101+ type : 'button' ,
102+ } ,
103+ } ;
104+
105+ export const IconWithOutline : Story = {
106+ args : {
107+ text : 'Sponsorship Prospectus' ,
108+ icon : < Download /> ,
109+ iconPosition : 'left' ,
110+ outline : true ,
111+ className : 'w-[240px] border' ,
112+ type : 'button' ,
113+ } ,
114+ } ;
0 commit comments