mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-28 02:34:10 +00:00
* feature: size adjust * feature: design adjust * fix: popover width, height added * fix: li style override * refactor: improve component readability and maintainability per PR feedback - Replace CardGridList component with createGridStyle utility function - Add runtime validation for grid column values - Remove !important usage in MultiSelect, use cn() function instead - Extract popover sizing logic into usePopoverSizing composable - Improve class string readability by splitting into logical groups - Use Tailwind size utilities (size-8, size-10) instead of separate width/height - Remove magic numbers in SearchBox, align with button sizes - Rename BaseWidgetLayout to BaseModalLayout for clarity - Enhance SearchBox click area to cover entire component - Refactor long class strings using cn() utility across components * fix: BaseWidgetLayout => BaseModalLayout * fix: CardGrid deleted * fix: unused exported types * Update test expectations [skip ci] * chore: code review * Update test expectations [skip ci] * chore: restore screenshot --------- Co-authored-by: github-actions <github-actions@github.com>
70 lines
1.7 KiB
TypeScript
70 lines
1.7 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
|
|
import { createGridStyle } from '@/utils/gridUtil'
|
|
|
|
import CardBottom from './CardBottom.vue'
|
|
import CardContainer from './CardContainer.vue'
|
|
import CardTop from './CardTop.vue'
|
|
|
|
const meta: Meta = {
|
|
title: 'Components/Card/CardGridList',
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
minWidth: {
|
|
control: 'text',
|
|
description: 'Minimum width for each grid item'
|
|
},
|
|
maxWidth: {
|
|
control: 'text',
|
|
description: 'Maximum width for each grid item'
|
|
},
|
|
padding: {
|
|
control: 'text',
|
|
description: 'Padding around the grid'
|
|
},
|
|
gap: {
|
|
control: 'text',
|
|
description: 'Gap between grid items'
|
|
},
|
|
columns: {
|
|
control: 'number',
|
|
description: 'Fixed number of columns (overrides auto-fill)'
|
|
}
|
|
},
|
|
args: {
|
|
minWidth: '15rem',
|
|
maxWidth: '1fr',
|
|
padding: '0rem',
|
|
gap: '1rem'
|
|
}
|
|
}
|
|
|
|
export default meta
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const Default: Story = {
|
|
render: (args) => ({
|
|
components: { CardContainer, CardTop, CardBottom },
|
|
setup() {
|
|
const gridStyle = createGridStyle(args)
|
|
return { gridStyle }
|
|
},
|
|
template: `
|
|
<div :style="gridStyle">
|
|
<CardContainer v-for="i in 12" :key="i" ratio="square">
|
|
<template #top>
|
|
<CardTop ratio="landscape">
|
|
<template #default>
|
|
<div class="w-full h-full bg-blue-500"></div>
|
|
</template>
|
|
</CardTop>
|
|
</template>
|
|
<template #bottom>
|
|
<CardBottom class="bg-neutral-200"></CardBottom>
|
|
</template>
|
|
</CardContainer>
|
|
</div>
|
|
`
|
|
})
|
|
}
|