@zenkigen-inc/component-ui 1.21.1 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ElementType, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ChangeEvent, HTMLAttributes, ButtonHTMLAttributes, ReactElement, MouseEvent, MutableRefObject, RefObject, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, TextareaHTMLAttributes } from 'react';
2
+ import react__default, { ReactNode, ElementType, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ChangeEvent, HTMLAttributes, ButtonHTMLAttributes, ReactElement, MouseEvent, MutableRefObject, RefObject, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, AriaAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import * as _zenkigen_inc_component_icons from '@zenkigen-inc/component-icons';
4
4
  import { IconName } from '@zenkigen-inc/component-icons';
5
5
  import { tokens } from '@zenkigen-inc/component-config';
@@ -183,6 +183,8 @@ declare const Combobox: typeof ComboboxBase & {
183
183
  displayName: string;
184
184
  };
185
185
 
186
+ type DatePickerSize = 'small' | 'medium' | 'large' | 'x-large';
187
+
186
188
  /**
187
189
  * DatePicker のエラーメッセージを表示するコンポーネントのプロパティ
188
190
  *
@@ -220,8 +222,15 @@ type DatePickerProps = DatePickerButtonProps & {
220
222
  maxDate?: Date;
221
223
  /** 未選択時に表示されるプレースホルダーテキスト @default '日付を選択' */
222
224
  placeholder?: string;
223
- /** トリガーボタンのサイズ @default 'medium' */
224
- size?: 'small' | 'medium' | 'large';
225
+ /**
226
+ * トリガーボタンのサイズ。`'x-large'` はカレンダーも拡大される(342×437px)
227
+ *
228
+ * `'x-large'` はモバイル向け。カレンダーがスクロールしないため、ビューポート幅 358px 以上、
229
+ * かつトリガーの上下いずれかに 445px 以上の余白が確保できるレイアウトでのみ使用すること。
230
+ * 満たせない場合はフッターが画面外に出て操作できなくなるため `'large'` 以下を選ぶ。
231
+ * @default 'medium'
232
+ */
233
+ size?: DatePickerSize;
225
234
  /** 日付変換に使用するタイムゾーン。選択された日付は指定タイムゾーンの 00:00:00 として返される @default 'Asia/Tokyo' */
226
235
  timeZone?: DatePickerTimeZone;
227
236
  /** Compound Component(ErrorMessage 等) */
@@ -516,6 +525,8 @@ type Props$k = {
516
525
  state?: 'success' | 'warning' | 'information' | 'attention' | 'default';
517
526
  /** コンポーネントの縦サイズとパディングを制御する。 */
518
527
  size?: 'small' | 'medium';
528
+ /** 枠線の有無を切り替える。outline は state に応じた 1px の枠線を表示する。 */
529
+ variant?: 'default' | 'outline';
519
530
  /** 通知に表示するメッセージ本体。 */
520
531
  children?: ReactNode;
521
532
  } & ({
@@ -527,7 +538,7 @@ type Props$k = {
527
538
  /** 閉じるボタンがクリックされたときのハンドラ。 */
528
539
  onClickClose: () => void;
529
540
  });
530
- declare function NotificationInline({ state, size, ...props }: Props$k): react.JSX.Element;
541
+ declare function NotificationInline({ state, size, variant, ...props }: Props$k): react.JSX.Element;
531
542
 
532
543
  type Props$j = {
533
544
  /** 現在のページ番号 */
@@ -681,6 +692,67 @@ type Props$d = {
681
692
  };
682
693
  declare function Radio({ name, value, id, label, isChecked, isDisabled, size, onChange, }: Props$d): react.JSX.Element;
683
694
 
695
+ type RadioCardErrorMessageProps = {
696
+ children: ReactNode;
697
+ /** エラーメッセージ要素の id。未指定なら RadioCard が自動採番して注入する */
698
+ id?: string;
699
+ };
700
+ declare function RadioCardErrorMessage({ children, id }: RadioCardErrorMessageProps): react.JSX.Element | null;
701
+ declare namespace RadioCardErrorMessage {
702
+ var displayName: string;
703
+ }
704
+
705
+ type RadioCardGroupProps = {
706
+ children: ReactNode;
707
+ };
708
+ declare function RadioCardGroup({ children }: RadioCardGroupProps): react.JSX.Element;
709
+ declare namespace RadioCardGroup {
710
+ var displayName: string;
711
+ }
712
+
713
+ type RadioCardItemProps = {
714
+ /** このカードの値。グループの value と一致したとき選択状態になる */
715
+ value: string;
716
+ /** 主ラベル */
717
+ label: string;
718
+ /** 補足説明(ラベルの下に表示) */
719
+ description?: string;
720
+ /** このカード個別の無効化(グループの isDisabled と OR) */
721
+ isDisabled?: boolean;
722
+ /** input の id。未指定なら自動生成 */
723
+ id?: string;
724
+ };
725
+ declare function RadioCardItem({ value, label, description, isDisabled: itemDisabled, id }: RadioCardItemProps): react.JSX.Element;
726
+ declare namespace RadioCardItem {
727
+ var displayName: string;
728
+ }
729
+
730
+ type RadioCardProps = {
731
+ /** RadioCard.Group と任意で RadioCard.ErrorMessage */
732
+ children: ReactNode;
733
+ /** 選択されている値(controlled) */
734
+ value: string;
735
+ /** 選択変更時のハンドラー */
736
+ onChange: (value: string) => void;
737
+ /** input の name。未指定なら自動生成 */
738
+ name?: string;
739
+ /** グループ全体を無効化するか */
740
+ isDisabled?: boolean;
741
+ /** グループ全体をエラー状態にするか */
742
+ isError?: boolean;
743
+ /** radiogroup の aria-label(推奨) */
744
+ 'aria-label'?: string;
745
+ /** radiogroup の aria-labelledby */
746
+ 'aria-labelledby'?: string;
747
+ };
748
+ declare function RadioCardRoot({ children, value, onChange, name, isDisabled, isError, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, }: RadioCardProps): react.JSX.Element;
749
+ declare const RadioCard: typeof RadioCardRoot & {
750
+ Group: typeof RadioCardGroup;
751
+ Item: typeof RadioCardItem;
752
+ ErrorMessage: typeof RadioCardErrorMessage;
753
+ displayName: string;
754
+ };
755
+
684
756
  type Props$c = {
685
757
  /** サイズ */
686
758
  size?: 'medium' | 'large';
@@ -773,8 +845,12 @@ type Props$a = {
773
845
  onChange?: (option: SelectOption | null) => void;
774
846
  /** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
775
847
  matchListToTrigger?: boolean;
848
+ /** トリガーボタンに設定する aria-label。TimePicker 等のコンポジットからラベルを付与するために使用する */
849
+ 'aria-label'?: AriaAttributes['aria-label'];
850
+ /** トリガーボタンに設定する aria-describedby。エラーメッセージ等と関連付けるために使用する */
851
+ 'aria-describedby'?: AriaAttributes['aria-describedby'];
776
852
  };
777
- declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, }: PropsWithChildren<Props$a>): react.JSX.Element;
853
+ declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, }: PropsWithChildren<Props$a>): react.JSX.Element;
778
854
  declare namespace Select {
779
855
  var Option: typeof SelectItem;
780
856
  }
@@ -984,36 +1060,118 @@ type TextAreaComponent = ForwardRefExoticComponent<TextAreaProps & RefAttributes
984
1060
  };
985
1061
  declare const TextArea: TextAreaComponent;
986
1062
 
1063
+ /** TimePicker(および内部の Select)のサイズ */
1064
+ type TimePickerSize = 'x-small' | 'small' | 'medium' | 'large';
1065
+
1066
+ /**
1067
+ * TimePicker のエラーメッセージを表示するコンポーネントのプロパティ
1068
+ *
1069
+ * `isError={true}` の場合にのみレンダリングされる。
1070
+ * `className` プロパティは除外されており、内部スタイルが適用される。
1071
+ */
1072
+ type TimePickerErrorMessageProps = Omit<HTMLAttributes<HTMLDivElement>, 'className'>;
1073
+ declare const TimePickerErrorMessage: react.ForwardRefExoticComponent<TimePickerErrorMessageProps & react.RefAttributes<HTMLDivElement>>;
1074
+
1075
+ /**
1076
+ * TimePicker のユーティリティ関数・型
1077
+ *
1078
+ * 時刻の候補生成(時 / 分)と、`{ hour, minute }` 構造体 ⇄ `"HH:mm"` 文字列の相互変換を行う。
1079
+ * min/max による範囲制限は「範囲外の候補を生成リストから除外(非表示)」する方針で実装している。
1080
+ */
1081
+
1082
+ /** TimePicker の value 型。両方 `null` の場合は未入力を表す */
1083
+ type TimeValue = {
1084
+ hour: number | null;
1085
+ minute: number | null;
1086
+ };
1087
+ /** 分候補の刻み。すべて 60 の約数で等間隔に生成できる値のみを許可する */
1088
+ type MinuteStep = 1 | 5 | 10 | 15 | 30;
1089
+ /**
1090
+ * `"HH:mm"` 文字列を `{ hour, minute }` へ変換する。
1091
+ * 形式不正・範囲外(0-23 時 / 0-59 分の範囲外)の場合は `null` を返す。
1092
+ * @example parseTime('09:30') → { hour: 9, minute: 30 }
1093
+ */
1094
+ declare const parseTime: (time: string) => {
1095
+ hour: number;
1096
+ minute: number;
1097
+ } | null;
1098
+ /**
1099
+ * `{ hour, minute }` を `"HH:mm"` 文字列へ変換する。
1100
+ * 時・分のいずれかが `null`(=未入力)の場合は `null` を返す。
1101
+ * @example formatTime({ hour: 9, minute: 30 }) → '09:30'
1102
+ */
1103
+ declare const formatTime: (value: TimeValue) => string | null;
1104
+
1105
+ type TimePickerProps = {
1106
+ /** 選択時刻。`hour`・`minute` の両方が `null` の場合は未入力を表す */
1107
+ value: TimeValue;
1108
+ /** 時刻が変更されたときに呼び出されるコールバック関数。各 Select の変更ごとに新しい値を返す */
1109
+ onChange: (value: TimeValue) => void;
1110
+ /** コンポーネントのサイズ。内部の `Select` の size に 1:1 でマッピングされる @default 'medium' */
1111
+ size?: TimePickerSize;
1112
+ /** 分候補の刻み(60 の約数) @default 1 */
1113
+ minuteStep?: MinuteStep;
1114
+ /** 選択可能な最小時刻(`"HH:mm"`・inclusive)。範囲外の候補は非表示になる */
1115
+ minTime?: string;
1116
+ /** 選択可能な最大時刻(`"HH:mm"`・inclusive)。範囲外の候補は非表示になる */
1117
+ maxTime?: string;
1118
+ /** 無効状態かどうか @default false */
1119
+ isDisabled?: boolean;
1120
+ /** エラー状態かどうか。`true` の場合、両方の Select がエラー表示になる @default false */
1121
+ isError?: boolean;
1122
+ /** Compound Component(`TimePicker.ErrorMessage`) */
1123
+ children?: ReactNode;
1124
+ };
1125
+ type TimePickerComponent = ((props: TimePickerProps) => ReactElement) & {
1126
+ ErrorMessage: typeof TimePickerErrorMessage;
1127
+ displayName?: string;
1128
+ };
1129
+ declare const TimePicker: TimePickerComponent;
1130
+
987
1131
  type ToastState = 'success' | 'error' | 'warning' | 'information';
988
1132
 
989
1133
  type Props$1 = {
990
- /** 表示するメッセージの状態(色・アイコンを切り替えます) */
1134
+ /** トーストの状態を表す。表示するアイコンとタイトルの文字色が切り替わる。 */
991
1135
  state?: ToastState;
992
- /** トースト全体の幅。数値・文字列いずれも指定可能 */
1136
+ /** トースト全体の幅。数値・文字列いずれも指定できる。 */
993
1137
  width?: CSSProperties['width'];
994
- /** true 5 秒後に自動で閉じる */
1138
+ /** true のとき 5 秒後に自動で閉じ、onClickClose を呼ぶ。既定は false(ToastProvider 経由のトーストには既定で true が渡される)。 */
995
1139
  isAutoClose?: boolean;
996
- /** true でフェードイン/アウトのアニメーションを有効化 */
1140
+ /** true のときフェードイン / フェードアウトのアニメーションを有効にする。 */
997
1141
  isAnimation?: boolean;
998
- /** 表示する本文 */
1142
+ /** true のとき閉じるボタンを表示する。isAutoClose が false のときは指定に関わらず必ず表示される。 */
1143
+ hasCloseButton?: boolean;
1144
+ /** タイトルの下に表示する補足テキスト。 */
1145
+ description?: ReactNode;
1146
+ /** タイトルとして表示する本文。 */
999
1147
  children?: ReactNode;
1000
- /** クローズボタンや自動クローズ完了時に呼び出されるコールバック */
1148
+ /** 閉じるボタン押下時および自動クローズ完了時に呼ばれる、トースト終了の通知コールバック。 */
1001
1149
  onClickClose: () => void;
1002
1150
  };
1003
- declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$1): react.JSX.Element;
1151
+ declare function Toast({ state, width, isAutoClose, isAnimation, hasCloseButton, description, children, onClickClose, }: Props$1): react.JSX.Element;
1004
1152
 
1005
1153
  type AddToastArgs = {
1006
- /** 表示する本文 */
1154
+ /** タイトルとして表示する本文 */
1007
1155
  message: string;
1008
1156
  /** 表示ステート */
1009
1157
  state: ToastState;
1158
+ /** タイトルの下に表示する補足テキスト */
1159
+ description?: ReactNode;
1160
+ /** 閉じるボタンを表示するかどうか。ToastProvider の既定値を上書きする */
1161
+ hasCloseButton?: boolean;
1162
+ /** 5 秒後に自動で閉じるかどうか。既定は true */
1163
+ isAutoClose?: boolean;
1010
1164
  };
1011
- type ToastProviderProps = {
1165
+ type ToastContextValue = {
1012
1166
  addToast: (args: AddToastArgs) => void;
1013
1167
  removeToast: (id: number) => void;
1014
1168
  };
1015
- declare const ToastProvider: ({ children }: PropsWithChildren) => react.JSX.Element;
1016
- declare const useToast: () => ToastProviderProps;
1169
+ type ToastProviderProps = PropsWithChildren<{
1170
+ /** このプロバイダー配下で追加されるトーストの、閉じるボタン表示の既定値 */
1171
+ hasCloseButton?: boolean;
1172
+ }>;
1173
+ declare const ToastProvider: ({ children, hasCloseButton }: ToastProviderProps) => react.JSX.Element;
1174
+ declare const useToast: () => ToastContextValue;
1017
1175
 
1018
1176
  /** Toggle コンポーネントの公開 Props */
1019
1177
  type Props = {
@@ -1061,4 +1219,4 @@ type TooltipProps = {
1061
1219
  };
1062
1220
  declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, portalTarget, }: TooltipProps): react.JSX.Element;
1063
1221
 
1064
- export { Avatar, AvatarGroup, Breadcrumb, Button, Checkbox, type ColorVariant, Combobox, type ComboboxChangeMeta, type ComboboxInputProps, type ComboboxItemProps, type ComboboxListProps, type ComboboxProps, type ComboboxSize, type ComboboxVariant, DatePicker, type DatePickerProps, type DatePickerTimeZone, Divider, Dropdown, type DropdownHorizontalAlign, type DropdownItemType, type DropdownVerticalPosition, EvaluationStar, FileInput, type FileInputRef, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Pagination, PaginationSelect, PasswordInput, Popover, PopoverContent, type PopoverContextValue, type PopoverPlacement, PopoverTrigger, Popup, Radio, type RenderSurplusContext, Search, SegmentedControl, Select, type SelectOption, SelectSort, SortButton, type SortOrder, type StepProgress, type StepState, Steps, type StepsOrientation, type StepsProps, type StepsSize, type StepsTextOrientation, type StepsVariant, Tab, TabItem, Table, TableCell, TableRow, Tag, type TagColor, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, type UseRovingFocusProps, type UseRovingFocusReturn, useOutsideClick, useRovingFocus, useToast };
1222
+ export { Avatar, AvatarGroup, Breadcrumb, Button, Checkbox, type ColorVariant, Combobox, type ComboboxChangeMeta, type ComboboxInputProps, type ComboboxItemProps, type ComboboxListProps, type ComboboxProps, type ComboboxSize, type ComboboxVariant, DatePicker, type DatePickerProps, type DatePickerTimeZone, Divider, Dropdown, type DropdownHorizontalAlign, type DropdownItemType, type DropdownVerticalPosition, EvaluationStar, FileInput, type FileInputRef, Heading, Icon, IconButton, Loading, type MinuteStep, Modal, NotificationInline, Pagination, PaginationSelect, PasswordInput, Popover, PopoverContent, type PopoverContextValue, type PopoverPlacement, PopoverTrigger, Popup, Radio, RadioCard, type RadioCardErrorMessageProps, type RadioCardGroupProps, type RadioCardItemProps, type RadioCardProps, type RenderSurplusContext, Search, SegmentedControl, Select, type SelectOption, SelectSort, SortButton, type SortOrder, type StepProgress, type StepState, Steps, type StepsOrientation, type StepsProps, type StepsSize, type StepsTextOrientation, type StepsVariant, Tab, TabItem, Table, TableCell, TableRow, Tag, type TagColor, TextArea, TextInput, TimePicker, type TimePickerProps, type TimeValue, Toast, ToastProvider, Toggle, Tooltip, type UseRovingFocusProps, type UseRovingFocusReturn, formatTime, parseTime, useOutsideClick, useRovingFocus, useToast };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ElementType, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ChangeEvent, HTMLAttributes, ButtonHTMLAttributes, ReactElement, MouseEvent, MutableRefObject, RefObject, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, TextareaHTMLAttributes } from 'react';
2
+ import react__default, { ReactNode, ElementType, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ChangeEvent, HTMLAttributes, ButtonHTMLAttributes, ReactElement, MouseEvent, MutableRefObject, RefObject, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, AriaAttributes, TextareaHTMLAttributes } from 'react';
3
3
  import * as _zenkigen_inc_component_icons from '@zenkigen-inc/component-icons';
4
4
  import { IconName } from '@zenkigen-inc/component-icons';
5
5
  import { tokens } from '@zenkigen-inc/component-config';
@@ -183,6 +183,8 @@ declare const Combobox: typeof ComboboxBase & {
183
183
  displayName: string;
184
184
  };
185
185
 
186
+ type DatePickerSize = 'small' | 'medium' | 'large' | 'x-large';
187
+
186
188
  /**
187
189
  * DatePicker のエラーメッセージを表示するコンポーネントのプロパティ
188
190
  *
@@ -220,8 +222,15 @@ type DatePickerProps = DatePickerButtonProps & {
220
222
  maxDate?: Date;
221
223
  /** 未選択時に表示されるプレースホルダーテキスト @default '日付を選択' */
222
224
  placeholder?: string;
223
- /** トリガーボタンのサイズ @default 'medium' */
224
- size?: 'small' | 'medium' | 'large';
225
+ /**
226
+ * トリガーボタンのサイズ。`'x-large'` はカレンダーも拡大される(342×437px)
227
+ *
228
+ * `'x-large'` はモバイル向け。カレンダーがスクロールしないため、ビューポート幅 358px 以上、
229
+ * かつトリガーの上下いずれかに 445px 以上の余白が確保できるレイアウトでのみ使用すること。
230
+ * 満たせない場合はフッターが画面外に出て操作できなくなるため `'large'` 以下を選ぶ。
231
+ * @default 'medium'
232
+ */
233
+ size?: DatePickerSize;
225
234
  /** 日付変換に使用するタイムゾーン。選択された日付は指定タイムゾーンの 00:00:00 として返される @default 'Asia/Tokyo' */
226
235
  timeZone?: DatePickerTimeZone;
227
236
  /** Compound Component(ErrorMessage 等) */
@@ -516,6 +525,8 @@ type Props$k = {
516
525
  state?: 'success' | 'warning' | 'information' | 'attention' | 'default';
517
526
  /** コンポーネントの縦サイズとパディングを制御する。 */
518
527
  size?: 'small' | 'medium';
528
+ /** 枠線の有無を切り替える。outline は state に応じた 1px の枠線を表示する。 */
529
+ variant?: 'default' | 'outline';
519
530
  /** 通知に表示するメッセージ本体。 */
520
531
  children?: ReactNode;
521
532
  } & ({
@@ -527,7 +538,7 @@ type Props$k = {
527
538
  /** 閉じるボタンがクリックされたときのハンドラ。 */
528
539
  onClickClose: () => void;
529
540
  });
530
- declare function NotificationInline({ state, size, ...props }: Props$k): react.JSX.Element;
541
+ declare function NotificationInline({ state, size, variant, ...props }: Props$k): react.JSX.Element;
531
542
 
532
543
  type Props$j = {
533
544
  /** 現在のページ番号 */
@@ -681,6 +692,67 @@ type Props$d = {
681
692
  };
682
693
  declare function Radio({ name, value, id, label, isChecked, isDisabled, size, onChange, }: Props$d): react.JSX.Element;
683
694
 
695
+ type RadioCardErrorMessageProps = {
696
+ children: ReactNode;
697
+ /** エラーメッセージ要素の id。未指定なら RadioCard が自動採番して注入する */
698
+ id?: string;
699
+ };
700
+ declare function RadioCardErrorMessage({ children, id }: RadioCardErrorMessageProps): react.JSX.Element | null;
701
+ declare namespace RadioCardErrorMessage {
702
+ var displayName: string;
703
+ }
704
+
705
+ type RadioCardGroupProps = {
706
+ children: ReactNode;
707
+ };
708
+ declare function RadioCardGroup({ children }: RadioCardGroupProps): react.JSX.Element;
709
+ declare namespace RadioCardGroup {
710
+ var displayName: string;
711
+ }
712
+
713
+ type RadioCardItemProps = {
714
+ /** このカードの値。グループの value と一致したとき選択状態になる */
715
+ value: string;
716
+ /** 主ラベル */
717
+ label: string;
718
+ /** 補足説明(ラベルの下に表示) */
719
+ description?: string;
720
+ /** このカード個別の無効化(グループの isDisabled と OR) */
721
+ isDisabled?: boolean;
722
+ /** input の id。未指定なら自動生成 */
723
+ id?: string;
724
+ };
725
+ declare function RadioCardItem({ value, label, description, isDisabled: itemDisabled, id }: RadioCardItemProps): react.JSX.Element;
726
+ declare namespace RadioCardItem {
727
+ var displayName: string;
728
+ }
729
+
730
+ type RadioCardProps = {
731
+ /** RadioCard.Group と任意で RadioCard.ErrorMessage */
732
+ children: ReactNode;
733
+ /** 選択されている値(controlled) */
734
+ value: string;
735
+ /** 選択変更時のハンドラー */
736
+ onChange: (value: string) => void;
737
+ /** input の name。未指定なら自動生成 */
738
+ name?: string;
739
+ /** グループ全体を無効化するか */
740
+ isDisabled?: boolean;
741
+ /** グループ全体をエラー状態にするか */
742
+ isError?: boolean;
743
+ /** radiogroup の aria-label(推奨) */
744
+ 'aria-label'?: string;
745
+ /** radiogroup の aria-labelledby */
746
+ 'aria-labelledby'?: string;
747
+ };
748
+ declare function RadioCardRoot({ children, value, onChange, name, isDisabled, isError, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, }: RadioCardProps): react.JSX.Element;
749
+ declare const RadioCard: typeof RadioCardRoot & {
750
+ Group: typeof RadioCardGroup;
751
+ Item: typeof RadioCardItem;
752
+ ErrorMessage: typeof RadioCardErrorMessage;
753
+ displayName: string;
754
+ };
755
+
684
756
  type Props$c = {
685
757
  /** サイズ */
686
758
  size?: 'medium' | 'large';
@@ -773,8 +845,12 @@ type Props$a = {
773
845
  onChange?: (option: SelectOption | null) => void;
774
846
  /** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
775
847
  matchListToTrigger?: boolean;
848
+ /** トリガーボタンに設定する aria-label。TimePicker 等のコンポジットからラベルを付与するために使用する */
849
+ 'aria-label'?: AriaAttributes['aria-label'];
850
+ /** トリガーボタンに設定する aria-describedby。エラーメッセージ等と関連付けるために使用する */
851
+ 'aria-describedby'?: AriaAttributes['aria-describedby'];
776
852
  };
777
- declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, }: PropsWithChildren<Props$a>): react.JSX.Element;
853
+ declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, matchListToTrigger, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, }: PropsWithChildren<Props$a>): react.JSX.Element;
778
854
  declare namespace Select {
779
855
  var Option: typeof SelectItem;
780
856
  }
@@ -984,36 +1060,118 @@ type TextAreaComponent = ForwardRefExoticComponent<TextAreaProps & RefAttributes
984
1060
  };
985
1061
  declare const TextArea: TextAreaComponent;
986
1062
 
1063
+ /** TimePicker(および内部の Select)のサイズ */
1064
+ type TimePickerSize = 'x-small' | 'small' | 'medium' | 'large';
1065
+
1066
+ /**
1067
+ * TimePicker のエラーメッセージを表示するコンポーネントのプロパティ
1068
+ *
1069
+ * `isError={true}` の場合にのみレンダリングされる。
1070
+ * `className` プロパティは除外されており、内部スタイルが適用される。
1071
+ */
1072
+ type TimePickerErrorMessageProps = Omit<HTMLAttributes<HTMLDivElement>, 'className'>;
1073
+ declare const TimePickerErrorMessage: react.ForwardRefExoticComponent<TimePickerErrorMessageProps & react.RefAttributes<HTMLDivElement>>;
1074
+
1075
+ /**
1076
+ * TimePicker のユーティリティ関数・型
1077
+ *
1078
+ * 時刻の候補生成(時 / 分)と、`{ hour, minute }` 構造体 ⇄ `"HH:mm"` 文字列の相互変換を行う。
1079
+ * min/max による範囲制限は「範囲外の候補を生成リストから除外(非表示)」する方針で実装している。
1080
+ */
1081
+
1082
+ /** TimePicker の value 型。両方 `null` の場合は未入力を表す */
1083
+ type TimeValue = {
1084
+ hour: number | null;
1085
+ minute: number | null;
1086
+ };
1087
+ /** 分候補の刻み。すべて 60 の約数で等間隔に生成できる値のみを許可する */
1088
+ type MinuteStep = 1 | 5 | 10 | 15 | 30;
1089
+ /**
1090
+ * `"HH:mm"` 文字列を `{ hour, minute }` へ変換する。
1091
+ * 形式不正・範囲外(0-23 時 / 0-59 分の範囲外)の場合は `null` を返す。
1092
+ * @example parseTime('09:30') → { hour: 9, minute: 30 }
1093
+ */
1094
+ declare const parseTime: (time: string) => {
1095
+ hour: number;
1096
+ minute: number;
1097
+ } | null;
1098
+ /**
1099
+ * `{ hour, minute }` を `"HH:mm"` 文字列へ変換する。
1100
+ * 時・分のいずれかが `null`(=未入力)の場合は `null` を返す。
1101
+ * @example formatTime({ hour: 9, minute: 30 }) → '09:30'
1102
+ */
1103
+ declare const formatTime: (value: TimeValue) => string | null;
1104
+
1105
+ type TimePickerProps = {
1106
+ /** 選択時刻。`hour`・`minute` の両方が `null` の場合は未入力を表す */
1107
+ value: TimeValue;
1108
+ /** 時刻が変更されたときに呼び出されるコールバック関数。各 Select の変更ごとに新しい値を返す */
1109
+ onChange: (value: TimeValue) => void;
1110
+ /** コンポーネントのサイズ。内部の `Select` の size に 1:1 でマッピングされる @default 'medium' */
1111
+ size?: TimePickerSize;
1112
+ /** 分候補の刻み(60 の約数) @default 1 */
1113
+ minuteStep?: MinuteStep;
1114
+ /** 選択可能な最小時刻(`"HH:mm"`・inclusive)。範囲外の候補は非表示になる */
1115
+ minTime?: string;
1116
+ /** 選択可能な最大時刻(`"HH:mm"`・inclusive)。範囲外の候補は非表示になる */
1117
+ maxTime?: string;
1118
+ /** 無効状態かどうか @default false */
1119
+ isDisabled?: boolean;
1120
+ /** エラー状態かどうか。`true` の場合、両方の Select がエラー表示になる @default false */
1121
+ isError?: boolean;
1122
+ /** Compound Component(`TimePicker.ErrorMessage`) */
1123
+ children?: ReactNode;
1124
+ };
1125
+ type TimePickerComponent = ((props: TimePickerProps) => ReactElement) & {
1126
+ ErrorMessage: typeof TimePickerErrorMessage;
1127
+ displayName?: string;
1128
+ };
1129
+ declare const TimePicker: TimePickerComponent;
1130
+
987
1131
  type ToastState = 'success' | 'error' | 'warning' | 'information';
988
1132
 
989
1133
  type Props$1 = {
990
- /** 表示するメッセージの状態(色・アイコンを切り替えます) */
1134
+ /** トーストの状態を表す。表示するアイコンとタイトルの文字色が切り替わる。 */
991
1135
  state?: ToastState;
992
- /** トースト全体の幅。数値・文字列いずれも指定可能 */
1136
+ /** トースト全体の幅。数値・文字列いずれも指定できる。 */
993
1137
  width?: CSSProperties['width'];
994
- /** true 5 秒後に自動で閉じる */
1138
+ /** true のとき 5 秒後に自動で閉じ、onClickClose を呼ぶ。既定は false(ToastProvider 経由のトーストには既定で true が渡される)。 */
995
1139
  isAutoClose?: boolean;
996
- /** true でフェードイン/アウトのアニメーションを有効化 */
1140
+ /** true のときフェードイン / フェードアウトのアニメーションを有効にする。 */
997
1141
  isAnimation?: boolean;
998
- /** 表示する本文 */
1142
+ /** true のとき閉じるボタンを表示する。isAutoClose が false のときは指定に関わらず必ず表示される。 */
1143
+ hasCloseButton?: boolean;
1144
+ /** タイトルの下に表示する補足テキスト。 */
1145
+ description?: ReactNode;
1146
+ /** タイトルとして表示する本文。 */
999
1147
  children?: ReactNode;
1000
- /** クローズボタンや自動クローズ完了時に呼び出されるコールバック */
1148
+ /** 閉じるボタン押下時および自動クローズ完了時に呼ばれる、トースト終了の通知コールバック。 */
1001
1149
  onClickClose: () => void;
1002
1150
  };
1003
- declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$1): react.JSX.Element;
1151
+ declare function Toast({ state, width, isAutoClose, isAnimation, hasCloseButton, description, children, onClickClose, }: Props$1): react.JSX.Element;
1004
1152
 
1005
1153
  type AddToastArgs = {
1006
- /** 表示する本文 */
1154
+ /** タイトルとして表示する本文 */
1007
1155
  message: string;
1008
1156
  /** 表示ステート */
1009
1157
  state: ToastState;
1158
+ /** タイトルの下に表示する補足テキスト */
1159
+ description?: ReactNode;
1160
+ /** 閉じるボタンを表示するかどうか。ToastProvider の既定値を上書きする */
1161
+ hasCloseButton?: boolean;
1162
+ /** 5 秒後に自動で閉じるかどうか。既定は true */
1163
+ isAutoClose?: boolean;
1010
1164
  };
1011
- type ToastProviderProps = {
1165
+ type ToastContextValue = {
1012
1166
  addToast: (args: AddToastArgs) => void;
1013
1167
  removeToast: (id: number) => void;
1014
1168
  };
1015
- declare const ToastProvider: ({ children }: PropsWithChildren) => react.JSX.Element;
1016
- declare const useToast: () => ToastProviderProps;
1169
+ type ToastProviderProps = PropsWithChildren<{
1170
+ /** このプロバイダー配下で追加されるトーストの、閉じるボタン表示の既定値 */
1171
+ hasCloseButton?: boolean;
1172
+ }>;
1173
+ declare const ToastProvider: ({ children, hasCloseButton }: ToastProviderProps) => react.JSX.Element;
1174
+ declare const useToast: () => ToastContextValue;
1017
1175
 
1018
1176
  /** Toggle コンポーネントの公開 Props */
1019
1177
  type Props = {
@@ -1061,4 +1219,4 @@ type TooltipProps = {
1061
1219
  };
1062
1220
  declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, portalTarget, }: TooltipProps): react.JSX.Element;
1063
1221
 
1064
- export { Avatar, AvatarGroup, Breadcrumb, Button, Checkbox, type ColorVariant, Combobox, type ComboboxChangeMeta, type ComboboxInputProps, type ComboboxItemProps, type ComboboxListProps, type ComboboxProps, type ComboboxSize, type ComboboxVariant, DatePicker, type DatePickerProps, type DatePickerTimeZone, Divider, Dropdown, type DropdownHorizontalAlign, type DropdownItemType, type DropdownVerticalPosition, EvaluationStar, FileInput, type FileInputRef, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Pagination, PaginationSelect, PasswordInput, Popover, PopoverContent, type PopoverContextValue, type PopoverPlacement, PopoverTrigger, Popup, Radio, type RenderSurplusContext, Search, SegmentedControl, Select, type SelectOption, SelectSort, SortButton, type SortOrder, type StepProgress, type StepState, Steps, type StepsOrientation, type StepsProps, type StepsSize, type StepsTextOrientation, type StepsVariant, Tab, TabItem, Table, TableCell, TableRow, Tag, type TagColor, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, type UseRovingFocusProps, type UseRovingFocusReturn, useOutsideClick, useRovingFocus, useToast };
1222
+ export { Avatar, AvatarGroup, Breadcrumb, Button, Checkbox, type ColorVariant, Combobox, type ComboboxChangeMeta, type ComboboxInputProps, type ComboboxItemProps, type ComboboxListProps, type ComboboxProps, type ComboboxSize, type ComboboxVariant, DatePicker, type DatePickerProps, type DatePickerTimeZone, Divider, Dropdown, type DropdownHorizontalAlign, type DropdownItemType, type DropdownVerticalPosition, EvaluationStar, FileInput, type FileInputRef, Heading, Icon, IconButton, Loading, type MinuteStep, Modal, NotificationInline, Pagination, PaginationSelect, PasswordInput, Popover, PopoverContent, type PopoverContextValue, type PopoverPlacement, PopoverTrigger, Popup, Radio, RadioCard, type RadioCardErrorMessageProps, type RadioCardGroupProps, type RadioCardItemProps, type RadioCardProps, type RenderSurplusContext, Search, SegmentedControl, Select, type SelectOption, SelectSort, SortButton, type SortOrder, type StepProgress, type StepState, Steps, type StepsOrientation, type StepsProps, type StepsSize, type StepsTextOrientation, type StepsVariant, Tab, TabItem, Table, TableCell, TableRow, Tag, type TagColor, TextArea, TextInput, TimePicker, type TimePickerProps, type TimeValue, Toast, ToastProvider, Toggle, Tooltip, type UseRovingFocusProps, type UseRovingFocusReturn, formatTime, parseTime, useOutsideClick, useRovingFocus, useToast };