mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
<img width="842" height="488" alt="스크린샷 2026-03-07 오후 9 39 20" src="https://github.com/user-attachments/assets/9ac8bfcd-c882-4661-851f-b08838d4fed1" /> ## Summary - Add Storybook stories for WidgetInputText, WidgetTextarea, and ScrubableNumberInput - Reorganize story titles under `Components/Input/` to align with Figma design system - Fix PrimeIcons not rendering in Storybook (caused by `[&_*]:!font-inter` override) - Fix knip unused export warnings (dead code removal + workspace config) ## Test plan - [ ] Run `pnpm storybook` and verify Components/Input/InputText stories render - [ ] Verify Components/Input/TextArea stories render with label and copy button - [ ] Verify Components/Input/Number stories render with -/+ icons - [ ] Toggle Storybook theme between Light/Dark and confirm Number story adapts - [ ] Verify existing Button stories still render correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9527-feat-add-text-widget-stories-and-Number-input-stories-31c6d73d3650817ba351cdef26a356c8) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
101 lines
2.4 KiB
TypeScript
101 lines
2.4 KiB
TypeScript
import { definePreset } from '@primevue/themes'
|
|
import Aura from '@primevue/themes/aura'
|
|
import { setup } from '@storybook/vue3'
|
|
import type { Preview, StoryContext, StoryFn } from '@storybook/vue3-vite'
|
|
import { createPinia } from 'pinia'
|
|
import 'primeicons/primeicons.css'
|
|
import PrimeVue from 'primevue/config'
|
|
import ConfirmationService from 'primevue/confirmationservice'
|
|
import ToastService from 'primevue/toastservice'
|
|
import Tooltip from 'primevue/tooltip'
|
|
|
|
import { i18n } from '@/i18n'
|
|
import '@/lib/litegraph/public/css/litegraph.css'
|
|
import '@/assets/css/style.css'
|
|
|
|
const ComfyUIPreset = definePreset(Aura, {
|
|
semantic: {
|
|
// @ts-expect-error fix me
|
|
primary: Aura['primitive'].blue
|
|
}
|
|
})
|
|
|
|
// Setup Vue app for Storybook
|
|
setup((app) => {
|
|
app.directive('tooltip', Tooltip)
|
|
|
|
// Create Pinia instance
|
|
const pinia = createPinia()
|
|
|
|
app.use(pinia)
|
|
app.use(i18n)
|
|
app.use(PrimeVue, {
|
|
theme: {
|
|
preset: ComfyUIPreset,
|
|
options: {
|
|
prefix: 'p',
|
|
cssLayer: {
|
|
name: 'primevue',
|
|
order: 'primevue, tailwind-utilities'
|
|
},
|
|
darkModeSelector: '.dark-theme, :root:has(.dark-theme)'
|
|
}
|
|
}
|
|
})
|
|
app.use(ConfirmationService)
|
|
app.use(ToastService)
|
|
})
|
|
|
|
// Theme and dialog decorator
|
|
export const withTheme = (Story: StoryFn, context: StoryContext) => {
|
|
const theme = context.globals.theme || 'light'
|
|
|
|
// Apply theme class to document root
|
|
if (theme === 'dark') {
|
|
document.documentElement.classList.add('dark-theme')
|
|
document.body.classList.add('dark-theme')
|
|
} else {
|
|
document.documentElement.classList.remove('dark-theme')
|
|
document.body.classList.remove('dark-theme')
|
|
}
|
|
document.body.classList.add('font-inter')
|
|
|
|
return Story(context.args, context)
|
|
}
|
|
|
|
const preview: Preview = {
|
|
parameters: {
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/i
|
|
}
|
|
},
|
|
backgrounds: {
|
|
default: 'light',
|
|
values: [
|
|
{ name: 'light', value: '#ffffff' },
|
|
{ name: 'dark', value: '#0a0a0a' }
|
|
]
|
|
}
|
|
},
|
|
globalTypes: {
|
|
theme: {
|
|
name: 'Theme',
|
|
description: 'Global theme for components',
|
|
defaultValue: 'light',
|
|
toolbar: {
|
|
icon: 'circlehollow',
|
|
items: [
|
|
{ value: 'light', icon: 'sun', title: 'Light' },
|
|
{ value: 'dark', icon: 'moon', title: 'Dark' }
|
|
],
|
|
dynamicTitle: true
|
|
}
|
|
}
|
|
},
|
|
decorators: [withTheme]
|
|
}
|
|
|
|
export default preview
|