Files
HMDesign/src/sw/sw-story-notice.tsx
T
shkim4 9394050c72 feat(storybook): add shared SW notice and refine SW previews
- Add StoryNotice and a withSWNotice decorator so every visible SW Story
  shows the common notice above its title; non-SW Stories are unaffected.
- Align the SW Header overview with the common SW Story page layout, let the
  preview Stage fill the available width and keep inner scroll on narrow screens.
- Rename SW/Footer to SW/하단 명령어바 (sidebar title only, Story IDs fixed via
  id: "sw-footer"), drop the top SWHeader from its preview and lower the
  workspace height bounds by the removed 49px.
2026-11-09 19:23:17 +09:00

23 lines
1.0 KiB
TypeScript

import type { Decorator } from "@storybook/react-vite"
import { StoryNotice } from "@/components/story-page"
// Storybook presentation only. Common notice shown above the page title of every SW Story (SW/* groups only):
// each SW stories file opts in with `decorators: [withSWNotice]`, so other menus never render it.
// Hidden verification / internal Stories are skipped; `parameters.swNotice: false` opts a Story out
// (use it where the page already carries the same notice, so it is never shown twice).
export const SW_NOTICE_TEXT =
"SW UI는 공통 컴포넌트의 기능과 동작을 유지하면서, 제품별 특성에 따라 시각적 스타일을 다르게 적용할 수 있습니다."
const HIDDEN_TAGS = ["verification", "internal"]
export const withSWNotice: Decorator = (Story, context) => {
const hidden = (context.tags ?? []).some(tag => HIDDEN_TAGS.includes(tag))
if (hidden || context.parameters.swNotice === false) return <Story />
return (
<>
<StoryNotice>{SW_NOTICE_TEXT}</StoryNotice>
<Story />
</>
)
}