refactor: iconProps control to constant

This commit is contained in:
2025-08-23 21:48:47 -03:00
parent b552a453dd
commit 4491934f69
3 changed files with 11 additions and 12 deletions

View File

@@ -32,4 +32,9 @@ export const whom: InputType = {
control: 'text',
description: 'Expense/income payer or payee',
table: {defaultValue: {detail: 'Defaults to none (empty string)', summary: '(empty string)'}},
}
export const iconProps: InputType ={
control: 'object',
description: 'Properties for the rendered icon'
}

View File

@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ExpenseIncomeCategoryByAccountDetailComponent } from '../../lib/molecules/expense-income-category-by-account-detail/expense-income-category-by-account-detail.component';
import { amount, category, description, variant, whom } from '../control-constants/expense-income-detail';
import { amount, category, description, iconProps, variant, whom } from '../control-constants/expense-income-detail';
import { backgroundColor } from '../control-constants/circled-icon';
import { color, symbol } from '../control-constants/svg';
@@ -41,10 +41,7 @@ const meta: Meta<ExpenseIncomeCategoryByAccountDetailComponent> = {
},
},
description,
iconProps: {
control: 'object',
description: 'Properties for the rendered icon'
},
iconProps,
showCheckbox: {
control: 'boolean',
description: 'Whether or not the element should show a checkbox',

View File

@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/angular";
import { ExpenseIncomeCategoryDetailComponent } from "../../lib/molecules/expense-income-category-detail/expense-income-category-detail.component";
import { amount, category, description, variant, whom } from "../control-constants/expense-income-detail";
import { amount, category, description, iconProps, variant, whom } from "../control-constants/expense-income-detail";
import { backgroundColor } from "../control-constants/circled-icon";
import { color, symbol } from "../control-constants/svg";
@@ -10,13 +10,13 @@ const meta: Meta<ExpenseIncomeCategoryDetailComponent> = {
tags: ['autodocs'],
args: {
amount: 9494,
category:"Ocio, recreación y snacks",
description:"Pizza",
iconProps:{
backgroundColor: '#FFC3CD',
color: '#ffffff',
symbol: 'riding-line'
},
category:"Ocio, recreación y snacks",
description:"Pizza",
variant:"expense",
whom:"Rappi",
/*iconProps*/
@@ -28,10 +28,7 @@ const meta: Meta<ExpenseIncomeCategoryDetailComponent> = {
amount,
category,
description,
iconProps: {
control: 'object',
description: 'Properties for the rendered icon'
},
iconProps,
variant,
whom,
/*icon props */