feat(sw): viewer layer popup bulb icon and all-layers switch
User-approved 2026-10-22 change to the SW Viewer layer popup.
- New public export SWLayerVisibilityIcon({ on }) + SWLayerVisibilityIconProps:
the SW Header layer bulb art reused as is (header design and behavior unchanged).
- Layer rows: eye (Eye / EyeOff) icon replaced by the bulb, 24 x 24 button kept.
- All layers: the 전체 켜기 / 전체 끄기 buttons replaced by one SWViewerField +
SWViewerSwitch on top. ON only when every layer is shown; a partial state reads
OFF and a click shows all. Derived from the hidden-layer state, so it stays synced.
- AI docs (VIEWER.md 4.1, catalog, design rules, composition, AI_GUIDE sync) and
example H follow the new rule, replacing the 2026-10-21 eye-icon rule.
- viewer.browser.mjs: layer popup checks moved to the bulb / switch behavior.
This commit is contained in:
1 parent
1dd8fb3aad
commit
8cb98b373f
16 files changed
+79
-52
No files matched your search
@@ -44,6 +44,19 @@ export function SWHeaderLayerIconArt({ kind, on }: { kind: SWHeaderLayerIconKind
|
||||
return <img className="hm-sw-header__layer-icon" src={on ? art[kind].on : art[kind].off} alt="" />
|
||||
}
|
||||
|
||||
export interface SWLayerVisibilityIconProps {
|
||||
/** Colored bulb when `true` (layer shown), gray when `false` (hidden). */
|
||||
on: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Public (2026-10-22): the header layer bulb art (20 x 20, decorative) for a program's own layer list, e.g. the
|
||||
* viewer layer popup. Art only; the program owns the button, its accessible name and the visibility state.
|
||||
*/
|
||||
export function SWLayerVisibilityIcon({ on }: SWLayerVisibilityIconProps) {
|
||||
return <SWHeaderLayerIconArt kind="visibility" on={on} />
|
||||
}
|
||||
|
||||
const labels: Record<SWHeaderLayerIconKind, string> = { visibility: "표시", freeze: "동결", lock: "잠금" }
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,4 +7,6 @@ export {
|
||||
type SWViewerSectionProps, type SWViewerFieldProps, type SWViewerSwitchProps, type SWViewerSliderProps, type SWViewerInputProps,
|
||||
type SWViewerButtonProps, type SWViewerBadgeProps, type SWViewerStatusProps, type SWViewerStatusState,
|
||||
} from "./SWViewerControls"
|
||||
// Layer popup visibility (2026-10-22): the SW header layer bulb art, reused as is.
|
||||
export { SWLayerVisibilityIcon, type SWLayerVisibilityIconProps } from "../sw-header/components/SWHeaderLayerIcons"
|
||||
export type { SWViewerHeaderItem, SWViewerHeaderGroup, SWViewerMenuEntry, SWViewerCommand } from "./types"
|
||||
Reference in new issue
Block a user