安全バナーSafetyBannerExperimental

Persistent, assertive, acknowledgeable safety alert: a loud banner for a critical condition (allergy, contraindication, panic value, over-dose) that announces assertively, requires an explicit acknowledgement, and exposes that acked state so the consumer can block a sign-off until it's cleared. Stronger than Alert (which is presentational and has no acknowledge contract).

プレビュー

相互作用:中等度

ワルファリンとの併用で出血リスクが上昇します。INR をモニタリングしてください。
未確認の警告があります

Props

表は横にスクロールできます
プロパティ初期値説明
titleReactNode-The headline (the critical condition).
tone"destructive" | "warning" | "info""destructive"destructive (アレルギー/禁忌/異常) announces assertively (role=alert); warning/info announce politely (role=status).
titleAs"h2" | "h3" | "h4" | "p""h3"Heading level for the title (keep page heading order correct).
requireAckboolean-Require an explicit acknowledgement — renders the ack control and reflects the acked state.
acknowledged / defaultAcknowledgedboolean-Controlled / initial acknowledged state. Read it to block a sign-off until cleared.
onAcknowledge() => void-Fired when the user acknowledges.
ackLabel / acknowledgedLabelReactNode-Ack button label (default "確認しました") / acknowledged note (default "確認済み").
icon / actionsReactNode-Leading icon override (defaults to a tone icon) / trailing actions (報告 / 詳細).
childrenReactNode-Details / body.

Usage

import { SafetyBanner, Button } from "@gunjo/ui"

// require acknowledgement, then gate the sign-off on the acked state
const [acked, setAcked] = useState(false)

<SafetyBanner
  tone="destructive"
  title="アレルギー警告:ペニシリン"
  requireAck
  acknowledged={acked}
  onAcknowledge={() => setAcked(true)}
>
  処方薬「アモキシシリン」は患者のアレルギーに該当します。投与は禁忌です。
</SafetyBanner>

<Button disabled={!acked}>処方を署名</Button>