import { StatusColor, StatusType } from '@c-fo/vibes'; import { MessageNoteType } from '../../types'; type SummaryDataCommonContentType = { /** * 表示するラベル */ label: string; /** * 表示する値 */ value: string; /** * 値を強調表示するかどうか */ emphasized?: boolean; /** * ラベルに対する注釈 */ labelNote?: MessageNoteType; /** * 値に対して補足情報を表示する場合に指定 * 現時点では type: 'traits' のみ対応しており、StatusIconで表示 */ subValue?: { type: 'traits'; trait?: StatusType; label: string; }; /** * 値情報を読み込んでいる状態を表す場合に指定 */ isLoading?: boolean; }; export type SummaryDataContentType = ({ /** * valueとして文字列を表示する場合 */ type: 'text' | 'amount'; } & SummaryDataCommonContentType) | ({ /** * valueに表示する文字列をリンクとして扱う場合 * SummaryDataAreaコンポーネントにlinkプロパティが指定されている場合、このコンテンツはtextとして表示される */ type: 'link'; url: string; targetBlank?: boolean; } & SummaryDataCommonContentType) | { /** * valueをStatusIconの表示で表す場合 */ type: 'status'; value: string; color: StatusColor; }; /** * オブジェクトに紐付いたサマリー情報を表示するコンポーネント * * @experimental v3のリリースまでは、型定義に変更が入る可能性があります */ export type SummaryDataAreaProps = { /** * SummaryDataArea 内に表示するコンテンツの指定 */ contents?: SummaryDataContentType[]; /** * SummaryDataArea 全体のクリックでページ遷移を行えるようにする場合に指定 * このプロパティを指定する場合、コンテンツに type: 'link' のコンテンツを含めないでください */ link?: { /** * リンク先URL */ url: string; /** * 外部リンクであるかどうか */ targetBlank?: boolean; }; }; export {};