@zenkigen-inc/component-ui 1.18.1 → 1.18.3

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,23 +1,29 @@
1
1
  import * as react from 'react';
2
- import react__default, { PropsWithChildren, ElementType, ComponentPropsWithoutRef, CSSProperties, ReactNode, ChangeEvent, MouseEvent, MutableRefObject, ReactElement, RefObject, HTMLAttributes, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, ButtonHTMLAttributes, TextareaHTMLAttributes } from 'react';
2
+ import react__default, { ReactNode, ElementType, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ChangeEvent, MouseEvent, MutableRefObject, ReactElement, RefObject, HTMLAttributes, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, FormEvent, ButtonHTMLAttributes, 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 { iconColors, tagLightColors } from '@zenkigen-inc/component-theme';
6
6
  import { tokens } from '@zenkigen-inc/component-config';
7
7
  import { useFloating } from '@floating-ui/react';
8
8
 
9
- type Props$y = {
9
+ type Props$x = {
10
10
  size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
11
11
  userId?: number;
12
12
  firstName?: string;
13
13
  lastName?: string;
14
14
  isDisabled?: boolean;
15
15
  };
16
- declare function Avatar({ size, ...props }: Props$y): react.JSX.Element;
16
+ declare function Avatar({ size, ...props }: Props$x): react.JSX.Element;
17
17
 
18
- declare function Breadcrumb({ children }: PropsWithChildren): react.JSX.Element;
18
+ type BreadcrumbProps = {
19
+ /** パンくずとして表示する要素。通常は複数の Breadcrumb.Item を渡す。 */
20
+ children: ReactNode;
21
+ };
22
+ declare function Breadcrumb({ children }: BreadcrumbProps): react.JSX.Element;
19
23
  declare namespace Breadcrumb {
20
- var Item: ({ children }: PropsWithChildren) => react.JSX.Element;
24
+ var Item: ({ children }: {
25
+ children: ReactNode;
26
+ }) => react.JSX.Element;
21
27
  }
22
28
 
23
29
  type Size$3 = 'small' | 'medium' | 'large';
@@ -49,24 +55,36 @@ type PublicProps<T extends ElementAs> = BaseProps$1<T> & {
49
55
  };
50
56
  declare const Button: <T extends ElementAs = "button">(props: PublicProps<T>) => react.JSX.Element;
51
57
 
52
- type Props$x = {
58
+ type Props$w = {
59
+ /** フォーム送信用の name 属性 */
53
60
  name?: string;
61
+ /** フォーム送信用の値 */
54
62
  value?: string;
63
+ /** 入力要素の ID。label と関連付ける場合に指定する */
55
64
  id?: string;
65
+ /** チェック状態(制御用) */
56
66
  isChecked?: boolean;
67
+ /** 色バリエーション。default: インタラクティブ色 / gray: グレー系 / error: エラー色 */
57
68
  color?: 'default' | 'gray' | 'error';
69
+ /** インデターミネイト表示を行うか(表示時は isChecked も true を推奨) */
58
70
  isIndeterminate?: boolean;
71
+ /** 無効状態にするか */
59
72
  isDisabled?: boolean;
73
+ /** 右側に表示するラベルテキスト */
60
74
  label?: string;
75
+ /** 状態変化時のハンドラー。isDisabled=true の場合は呼ばれない */
61
76
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
62
77
  };
63
- declare function Checkbox({ name, value, id, isChecked, isIndeterminate, isDisabled, onChange, label, color, }: Props$x): react.JSX.Element;
78
+ declare function Checkbox({ name, value, id, isChecked, isIndeterminate, isDisabled, onChange, label, color, }: Props$w): react.JSX.Element;
64
79
 
65
- type Props$w = {
80
+ /** Dropdown.Item コンポーネントのプロパティ */
81
+ type Props$v = {
82
+ /** 項目の配色。red は破壊的アクションに用いる。 */
66
83
  color?: 'gray' | 'red';
84
+ /** 項目をクリックしたときに呼び出されるハンドラ。 */
67
85
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
68
86
  };
69
- declare function DropdownItem({ children, color, onClick }: PropsWithChildren<Props$w>): react.JSX.Element;
87
+ declare function DropdownItem({ children, color, onClick }: PropsWithChildren<Props$v>): react.JSX.Element;
70
88
 
71
89
  type DropdownItemType = {
72
90
  id: string;
@@ -77,43 +95,62 @@ type DropdownItemType = {
77
95
  type DropdownVerticalPosition = 'top' | 'bottom';
78
96
  type DropdownHorizontalAlign = 'left' | 'center' | 'right';
79
97
 
80
- type Props$v = {
98
+ /** Dropdown.Menu コンポーネントのプロパティ */
99
+ type Props$u = {
100
+ /** メニュー全体の最大高さ。スクロール領域を制限したい場合に設定する。 */
81
101
  maxHeight?: CSSProperties['height'];
102
+ /** true のとき上下の余白を取り除き、完全にカスタムなコンテンツを配置する。 */
82
103
  isNoPadding?: boolean;
104
+ /** トリガーからの垂直方向(上側か下側か)を指定する。 */
83
105
  verticalPosition?: DropdownVerticalPosition;
106
+ /** トリガーに対する水平方向の揃えを決める。 */
84
107
  horizontalAlign?: DropdownHorizontalAlign;
85
108
  };
86
- declare function DropdownMenu({ children, maxHeight, isNoPadding, verticalPosition, horizontalAlign, }: PropsWithChildren<Props$v>): false | react.JSX.Element;
109
+ declare function DropdownMenu({ children, maxHeight, isNoPadding, verticalPosition, horizontalAlign, }: PropsWithChildren<Props$u>): false | react.JSX.Element;
87
110
 
88
- type Props$u = {
111
+ /** Dropdown コンポーネントのプロパティ */
112
+ type Props$t = {
113
+ /** ボタンサイズを指定し、高さとタイポグラフィを切り替える。 */
89
114
  size?: 'x-small' | 'small' | 'medium' | 'large';
115
+ /** テキストスタイルかアウトラインスタイルかを選択する。 */
90
116
  variant?: 'text' | 'outline';
117
+ /** ネイティブの title 属性経由でトリガーボタンにヒントを付与する。 */
91
118
  title?: string;
119
+ /** true のときトリガーとメニューを無効化し、クリックを受け付けない。 */
92
120
  isDisabled?: boolean;
121
+ /** true のとき組み込みの矢印アイコンを非表示にする。 */
93
122
  isArrowHidden?: boolean;
123
+ /** メニューを別コンテナへポータル描画するためのターゲット要素参照。 */
94
124
  portalTargetRef?: MutableRefObject<HTMLElement | null>;
95
125
  } & ({
126
+ /** 自前のReact要素をトリガーとして描画する場合に渡す。 */
96
127
  target: ReactElement;
97
128
  label?: never;
98
129
  icon?: never;
99
130
  } | {
131
+ /** ラベルボタンを描画する場合に必須となる表示文字列。 */
100
132
  target?: undefined;
101
133
  label: string;
134
+ /** ラベルの先頭に配置する公式アイコン。 */
102
135
  icon?: IconName;
103
136
  });
104
- declare function Dropdown({ children, target, label, icon, size, variant, title, isDisabled, isArrowHidden, portalTargetRef, }: PropsWithChildren<Props$u>): react.JSX.Element;
137
+ declare function Dropdown({ children, target, label, icon, size, variant, title, isDisabled, isArrowHidden, portalTargetRef, }: PropsWithChildren<Props$t>): react.JSX.Element;
105
138
  declare namespace Dropdown {
106
139
  var Menu: typeof DropdownMenu;
107
140
  var Item: typeof DropdownItem;
108
141
  }
109
142
 
110
- type Props$t = {
143
+ type Props$s = {
144
+ /** 表示・初期化に使用する評価値(0〜5の整数を推奨) */
111
145
  value: number;
146
+ /** 星をクリックして評価を変更できるかを制御する */
112
147
  isEditable?: boolean;
148
+ /** 評価が変更された際に新しい値を通知するコールバック */
113
149
  onChangeRating?: (newRating: number) => void | null;
150
+ /** 星アイコンのサイズ(medium: 16px, large: 24px) */
114
151
  size?: 'medium' | 'large';
115
152
  };
116
- declare function EvaluationStar({ value, isEditable, onChangeRating, size }: Props$t): react.JSX.Element;
153
+ declare function EvaluationStar({ value, isEditable, onChangeRating, size }: Props$s): react.JSX.Element;
117
154
 
118
155
  type Size$2 = 'small' | 'medium' | 'large';
119
156
  declare const ERROR_TYPES: {
@@ -161,13 +198,17 @@ type FileInputRef = {
161
198
  declare const FileInput: react.ForwardRefExoticComponent<FileInputProps & react.RefAttributes<FileInputRef>>;
162
199
 
163
200
  type Level = 1 | 2 | 3 | 4 | 5;
164
- type Props$s = {
201
+ type Props$r = {
202
+ /** DOMの見出しレベル(`<h1>`〜`<h5>`)を指定する */
165
203
  level: Level;
204
+ /** 見出しテキストの前に配置するアイコンやアバターなど */
166
205
  before?: ReactNode;
206
+ /** 見出しテキストの後に配置する補助アクションやラベル */
167
207
  after?: ReactNode;
208
+ /** 表示する見出しコンテンツ */
168
209
  children?: ReactNode;
169
210
  };
170
- declare function Heading(props: Props$s): react.JSX.Element;
211
+ declare function Heading(props: Props$r): react.JSX.Element;
171
212
 
172
213
  declare const useOutsideClick: <T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: (event: Event) => void, enabled?: boolean) => void;
173
214
 
@@ -238,7 +279,7 @@ type ColorToken = UserColorToken | TextColorToken | LinkColorToken | BackgroundC
238
279
 
239
280
  type Size$1 = 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
240
281
  type Color = keyof typeof iconColors;
241
- type Props$r = {
282
+ type Props$q = {
242
283
  name: IconName;
243
284
  size?: Size$1;
244
285
  color?: Color;
@@ -246,11 +287,11 @@ type Props$r = {
246
287
  isDisabled?: boolean;
247
288
  className?: string;
248
289
  };
249
- declare const Icon: ({ size, isDisabled, ...props }: Props$r) => react.JSX.Element;
290
+ declare const Icon: ({ size, isDisabled, ...props }: Props$q) => react.JSX.Element;
250
291
 
251
292
  type Size = 'small' | 'medium' | 'large';
252
293
  type Variant = 'outline' | 'text';
253
- type Props$q = {
294
+ type Props$p = {
254
295
  /** 表示するアイコン名 */
255
296
  icon: IconName;
256
297
  /** ボタンのサイズ */
@@ -270,28 +311,31 @@ type Props$q = {
270
311
  } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'className'>) | ({
271
312
  isAnchor?: false;
272
313
  } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'disabled' | 'className'>));
273
- declare function IconButton({ icon, size, variant, isNoPadding, isDisabled, isSelected, ...props }: Props$q): react.JSX.Element;
314
+ declare function IconButton({ icon, size, variant, isNoPadding, isDisabled, isSelected, ...props }: Props$p): react.JSX.Element;
274
315
 
275
- type Props$p = {
316
+ type Props$o = {
317
+ /** インジケーターのサイズ。small=16px / medium=32px / large=64px */
276
318
  size?: 'small' | 'medium' | 'large';
319
+ /** Loading を重ねる位置。Tailwind の position ユーティリティを切り替えます */
277
320
  position?: 'fixed' | 'absolute' | 'static';
321
+ /** ラッパー要素の高さ。ビュー全体を覆う場合は `100%` や `100vh` を指定します */
278
322
  height?: string;
279
323
  };
280
- declare function Loading({ size, position, height }: Props$p): react.JSX.Element;
324
+ declare function Loading({ size, position, height }: Props$o): react.JSX.Element;
281
325
 
282
326
  declare function ModalBody({ children }: PropsWithChildren): react.JSX.Element;
283
327
 
284
- type Props$o = {
328
+ type Props$n = {
285
329
  isNoBorder?: boolean;
286
330
  };
287
- declare function ModalFooter({ children, isNoBorder }: PropsWithChildren<Props$o>): react__default.JSX.Element;
331
+ declare function ModalFooter({ children, isNoBorder }: PropsWithChildren<Props$n>): react__default.JSX.Element;
288
332
 
289
- type Props$n = {
333
+ type Props$m = {
290
334
  isNoBorder?: boolean;
291
335
  };
292
- declare function ModalHeader({ children, isNoBorder }: PropsWithChildren<Props$n>): react.JSX.Element;
336
+ declare function ModalHeader({ children, isNoBorder }: PropsWithChildren<Props$m>): react.JSX.Element;
293
337
 
294
- type Props$m = {
338
+ type Props$l = {
295
339
  width?: CSSProperties['width'];
296
340
  height?: CSSProperties['height'];
297
341
  maxWidth?: CSSProperties['maxWidth'];
@@ -299,26 +343,32 @@ type Props$m = {
299
343
  onClose?: () => void;
300
344
  portalTargetRef?: MutableRefObject<HTMLElement | null>;
301
345
  };
302
- declare function Modal({ children, width, height, maxWidth, isOpen, onClose, portalTargetRef, }: PropsWithChildren<Props$m>): react.JSX.Element | null;
346
+ declare function Modal({ children, width, height, maxWidth, isOpen, onClose, portalTargetRef, }: PropsWithChildren<Props$l>): react.JSX.Element | null;
303
347
  declare namespace Modal {
304
348
  var Body: typeof ModalBody;
305
349
  var Header: typeof ModalHeader;
306
350
  var Footer: typeof ModalFooter;
307
351
  }
308
352
 
309
- type Props$l = {
353
+ type Props$k = {
354
+ /** 通知の状態を表す。表示する背景色とアイコンが切り替わる。 */
310
355
  state?: 'success' | 'warning' | 'information' | 'attention' | 'default';
356
+ /** コンポーネントの縦サイズとパディングを制御する。 */
311
357
  size?: 'small' | 'medium';
358
+ /** 通知に表示するメッセージ本体。 */
312
359
  children?: ReactNode;
313
360
  } & ({
361
+ /** 閉じるボタンを表示しない場合の設定。 */
314
362
  showClose?: false;
315
363
  } | {
364
+ /** 閉じるボタンを表示する場合の設定。 */
316
365
  showClose: true;
366
+ /** 閉じるボタンがクリックされたときのハンドラ。 */
317
367
  onClickClose: () => void;
318
368
  });
319
- declare function NotificationInline({ state, size, ...props }: Props$l): react.JSX.Element;
369
+ declare function NotificationInline({ state, size, ...props }: Props$k): react.JSX.Element;
320
370
 
321
- type Props$k = {
371
+ type Props$j = {
322
372
  /** 現在のページ番号 */
323
373
  currentPage: number;
324
374
  /** トータルのページ数 */
@@ -328,29 +378,29 @@ type Props$k = {
328
378
  /** ボタンが押されたときのイベントハンドラ */
329
379
  onClick: (value: number) => void;
330
380
  };
331
- declare function Pagination({ currentPage, totalPage, sideNumPagesToShow, onClick }: Props$k): react.JSX.Element | null;
381
+ declare function Pagination({ currentPage, totalPage, sideNumPagesToShow, onClick }: Props$j): react.JSX.Element | null;
332
382
 
333
- type Props$j = {
334
- /** トータル件数 */
383
+ type Props$i = {
384
+ /** データの総件数。Selectのオプション数と件数表示の上下限計算に用いる。 */
335
385
  totalSize: number;
336
- /** ページあたり件数 */
386
+ /** 1ページに表示する件数。pageMax = Math.ceil(totalSize / sizePerPage) の計算に利用する。 */
337
387
  sizePerPage: number;
338
- /** 現在のページ番号 */
388
+ /** 現在のページ番号(1起算)。Selectの選択状態と前後ボタンの活性状態を決定する。 */
339
389
  currentPage: number;
340
- /** 件数表示単位ラベル */
390
+ /** 件数範囲表示の末尾に付与する単位ラベル(例: 件 / results)。 */
341
391
  countLabel?: string;
342
- /** ページ表示単位ラベル */
392
+ /** 「/ pageMax」表示に付与する単位ラベル(例: ページ)。 */
343
393
  pageLabel?: string;
344
- /** Selectのリストの最大の高さ */
394
+ /** Selectのドロップダウンリストに設定する最大高さ(px)。 */
345
395
  optionListMaxHeight?: number;
346
- /** 戻るボタンクリック時のイベントハンドラ */
396
+ /** 戻るボタンクリック時のイベントハンドラ。呼び出し側でcurrentPageを減算する。 */
347
397
  onClickPrevButton: () => void;
348
- /** 進むボタンクリック時のイベントハンドラ */
398
+ /** 進むボタンクリック時のイベントハンドラ。呼び出し側でcurrentPageを加算する。 */
349
399
  onClickNextButton: () => void;
350
- /** Selectが切り替わった時のイベントハンドラ */
400
+ /** Selectが別のページに切り替わった時のイベントハンドラ。引数は選択されたページ番号。 */
351
401
  onChange: (value: number) => void;
352
402
  };
353
- declare function PaginationSelect({ totalSize, currentPage, sizePerPage, countLabel, pageLabel, optionListMaxHeight, onClickPrevButton, onClickNextButton, onChange, }: Props$j): react.JSX.Element;
403
+ declare function PaginationSelect({ totalSize, currentPage, sizePerPage, countLabel, pageLabel, optionListMaxHeight, onClickPrevButton, onClickNextButton, onChange, }: Props$i): react.JSX.Element;
354
404
 
355
405
  type TextInputErrorMessageProps = Omit<HTMLAttributes<HTMLDivElement>, 'className'>;
356
406
  declare const TextInputErrorMessage: react.ForwardRefExoticComponent<TextInputErrorMessageProps & react.RefAttributes<HTMLDivElement>>;
@@ -371,8 +421,8 @@ type TextInputComponent = ForwardRefExoticComponent<TextInputProps & RefAttribut
371
421
  };
372
422
  declare const TextInput: TextInputComponent;
373
423
 
374
- type Props$i = Omit<ComponentPropsWithoutRef<typeof TextInput>, 'type' | 'onClickClearButton' | 'className'>;
375
- declare const PasswordInput: ForwardRefExoticComponent<Props$i & RefAttributes<HTMLInputElement>> & {
424
+ type Props$h = Omit<ComponentPropsWithoutRef<typeof TextInput>, 'type' | 'onClickClearButton' | 'className'>;
425
+ declare const PasswordInput: ForwardRefExoticComponent<Props$h & RefAttributes<HTMLInputElement>> & {
376
426
  HelperMessage: ForwardRefExoticComponent<TextInputHelperMessageProps & RefAttributes<HTMLDivElement>>;
377
427
  ErrorMessage: ForwardRefExoticComponent<TextInputErrorMessageProps & RefAttributes<HTMLDivElement>>;
378
428
  displayName: string;
@@ -406,14 +456,14 @@ type PopoverContextValue = {
406
456
  onClose?: (event: PopoverCloseEvent) => void;
407
457
  };
408
458
 
409
- type Props$h = {
459
+ type Props$g = {
410
460
  isOpen: boolean;
411
461
  placement?: PopoverPlacement;
412
462
  offset?: number;
413
463
  onClose?: (event: PopoverCloseEvent) => void;
414
464
  anchorRef?: React.RefObject<HTMLElement | null>;
415
465
  };
416
- declare function Popover({ isOpen, children, placement, offset: offsetValue, onClose, anchorRef, }: PropsWithChildren<Props$h>): react.JSX.Element;
466
+ declare function Popover({ isOpen, children, placement, offset: offsetValue, onClose, anchorRef, }: PropsWithChildren<Props$g>): react.JSX.Element;
417
467
  declare namespace Popover {
418
468
  var Trigger: react.ForwardRefExoticComponent<{
419
469
  children: React.ReactElement;
@@ -437,45 +487,59 @@ declare function PopupBody({ children }: PropsWithChildren): react.JSX.Element;
437
487
 
438
488
  declare function PopupFooter({ children }: PropsWithChildren): react__default.JSX.Element;
439
489
 
440
- type Props$g = PropsWithChildren<{
490
+ type Props$f = PropsWithChildren<{
441
491
  before?: ReactNode;
442
492
  }>;
443
- declare function PopupHeader({ children, before }: Props$g): react.JSX.Element;
493
+ declare function PopupHeader({ children, before }: Props$f): react.JSX.Element;
444
494
 
445
- type Props$f = {
495
+ type Props$e = {
446
496
  isOpen?: boolean;
447
497
  width?: CSSProperties['width'];
448
498
  height?: CSSProperties['height'];
449
499
  onClose?: () => void;
450
500
  };
451
- declare function Popup({ children, isOpen: controlledIsOpen, width, height, onClose }: PropsWithChildren<Props$f>): react.JSX.Element | null;
501
+ declare function Popup({ children, isOpen: controlledIsOpen, width, height, onClose }: PropsWithChildren<Props$e>): react.JSX.Element | null;
452
502
  declare namespace Popup {
453
503
  var Body: typeof PopupBody;
454
504
  var Header: typeof PopupHeader;
455
505
  var Footer: typeof PopupFooter;
456
506
  }
457
507
 
458
- type Props$e = {
508
+ type Props$d = {
509
+ /** フォーム送信用の name 属性。グループ化して単一選択を扱う場合に指定する */
459
510
  name?: string;
511
+ /** フォーム送信用の値 */
460
512
  value?: string;
513
+ /** 入力要素の ID。label と関連付ける場合に指定する */
461
514
  id?: string;
515
+ /** 右側に表示するラベルテキスト */
462
516
  label?: string;
517
+ /** 選択状態(制御用) */
463
518
  isChecked?: boolean;
519
+ /** 無効状態にするか */
464
520
  isDisabled?: boolean;
521
+ /** 状態変化時のハンドラー。isDisabled=true の場合は呼ばれない */
465
522
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
466
523
  };
467
- declare function Radio({ name, value, id, label, isChecked, isDisabled, onChange }: Props$e): react.JSX.Element;
524
+ declare function Radio({ name, value, id, label, isChecked, isDisabled, onChange }: Props$d): react.JSX.Element;
468
525
 
469
- type Props$d = {
526
+ type Props$c = {
527
+ /** サイズ */
470
528
  size?: 'medium' | 'large';
529
+ /** 入力欄に表示するプレースホルダー */
471
530
  placeholder?: string;
531
+ /** 入力フィールドの幅。CSSの幅指定文字列を渡す */
472
532
  width?: string;
533
+ /** 現在の入力値 */
473
534
  value: string;
535
+ /** 入力値変更時に呼び出されるハンドラ */
474
536
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
537
+ /** Enterキーなどでフォーム送信された際のハンドラ */
475
538
  onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
539
+ /** クリアボタン押下時のハンドラ。指定時のみボタンを描画する */
476
540
  onClickClearButton?: () => void;
477
541
  };
478
- declare const Search: react.ForwardRefExoticComponent<Props$d & react.RefAttributes<HTMLDivElement>>;
542
+ declare const Search: react.ForwardRefExoticComponent<Props$c & react.RefAttributes<HTMLDivElement>>;
479
543
 
480
544
  type BaseProps = Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'className'> & {
481
545
  value: string;
@@ -519,12 +583,12 @@ type SelectOption = {
519
583
  icon?: IconName;
520
584
  };
521
585
 
522
- type Props$c = {
586
+ type Props$b = {
523
587
  option: SelectOption;
524
588
  };
525
- declare function SelectItem({ option }: Props$c): react.JSX.Element;
589
+ declare function SelectItem({ option }: Props$b): react.JSX.Element;
526
590
 
527
- type Props$b = {
591
+ type Props$a = {
528
592
  size?: 'x-small' | 'small' | 'medium' | 'large';
529
593
  variant?: 'outline' | 'text';
530
594
  width?: CSSProperties['width'];
@@ -538,27 +602,36 @@ type Props$b = {
538
602
  isOptionSelected?: boolean;
539
603
  onChange?: (option: SelectOption | null) => void;
540
604
  };
541
- declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, }: PropsWithChildren<Props$b>): react.JSX.Element;
605
+ declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, onChange, optionListMaxHeight, }: PropsWithChildren<Props$a>): react.JSX.Element;
542
606
  declare namespace Select {
543
607
  var Option: typeof SelectItem;
544
608
  }
545
609
 
546
610
  type SortOrder = 'ascend' | 'descend' | null;
547
611
 
548
- type Props$a = {
612
+ type Props$9 = {
613
+ /** ボタンとドロップダウンの高さ・タイポグラフィを切り替えるサイズ。 */
549
614
  size?: 'x-small' | 'small' | 'medium' | 'large';
615
+ /** スタイルバリエーション。 */
550
616
  variant?: 'outline' | 'text';
617
+ /** コンポーネント全体の幅。省略時は内容幅に合わせる。 */
551
618
  width?: CSSProperties['width'];
619
+ /** トリガーボタンに表示する列名。 */
552
620
  label: string;
621
+ /** 現在の並び替え方向。外部状態で `'ascend' | 'descend' | null` を制御する。 */
553
622
  sortOrder: SortOrder;
623
+ /** true の場合はボタンやリストの操作を無効化する。 */
554
624
  isDisabled?: boolean;
625
+ /** この列が現在のソートキーであるかどうか。矢印アイコンと選択スタイルを切り替える。 */
555
626
  isSortKey?: boolean;
627
+ /** 並び替え方向を選択したときに呼ばれるコールバック。 */
556
628
  onChange?: (value: SortOrder) => void;
629
+ /** ドロップダウン内の「選択解除」をクリックしたときに呼ばれるコールバック。 */
557
630
  onClickDeselect?: () => void;
558
631
  };
559
- declare function SelectSort({ size, variant, width, label, sortOrder, isDisabled, isSortKey, onChange, onClickDeselect, }: Props$a): react.JSX.Element;
632
+ declare function SelectSort({ size, variant, width, label, sortOrder, isDisabled, isSortKey, onChange, onClickDeselect, }: Props$9): react.JSX.Element;
560
633
 
561
- type Props$9 = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'type' | 'disabled' | 'onClick' | 'aria-disabled' | 'aria-label'> & {
634
+ type Props$8 = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'type' | 'disabled' | 'onClick' | 'aria-disabled' | 'aria-label'> & {
562
635
  size?: 'x-small' | 'small' | 'medium' | 'large';
563
636
  width?: CSSProperties['width'];
564
637
  label: string;
@@ -567,14 +640,14 @@ type Props$9 = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'type
567
640
  'aria-label': string;
568
641
  onClick?: () => void;
569
642
  };
570
- declare function SortButton({ size, width, label, sortOrder, isDisabled, onClick, 'aria-label': ariaLabel, ...rest }: Props$9): react.JSX.Element;
643
+ declare function SortButton({ size, width, label, sortOrder, isDisabled, onClick, 'aria-label': ariaLabel, ...rest }: Props$8): react.JSX.Element;
571
644
 
572
- type Props$8 = {
645
+ type Props$7 = {
573
646
  children?: ReactNode;
574
647
  /** レイアウトタイプ */
575
648
  layout?: 'auto' | 'equal';
576
649
  };
577
- declare function Tab({ children, layout }: Props$8): react.JSX.Element;
650
+ declare function Tab({ children, layout }: Props$7): react.JSX.Element;
578
651
  declare namespace Tab {
579
652
  var Item: ({ isSelected, isDisabled, icon, ...props }: {
580
653
  id: string;
@@ -586,7 +659,7 @@ declare namespace Tab {
586
659
  }) => react.JSX.Element;
587
660
  }
588
661
 
589
- type Props$7 = {
662
+ type Props$6 = {
590
663
  id: string;
591
664
  isSelected?: boolean;
592
665
  isDisabled?: boolean;
@@ -594,29 +667,29 @@ type Props$7 = {
594
667
  children?: ReactNode;
595
668
  onClick: (id: string) => void;
596
669
  };
597
- declare const TabItem: ({ isSelected, isDisabled, icon, ...props }: Props$7) => react.JSX.Element;
670
+ declare const TabItem: ({ isSelected, isDisabled, icon, ...props }: Props$6) => react.JSX.Element;
598
671
 
599
- type Props$6 = {
672
+ type Props$5 = {
600
673
  children?: ReactNode;
601
674
  className?: string;
602
675
  isHeader?: boolean;
603
676
  };
604
- declare function TableCell({ children, className, isHeader }: Props$6): react.JSX.Element;
677
+ declare function TableCell({ children, className, isHeader }: Props$5): react.JSX.Element;
605
678
 
606
- type Props$5 = {
679
+ type Props$4 = {
607
680
  children?: ReactNode;
608
681
  isHoverBackgroundVisible?: boolean;
609
682
  };
610
- declare function TableRow({ children, isHoverBackgroundVisible }: Props$5): react.JSX.Element;
683
+ declare function TableRow({ children, isHoverBackgroundVisible }: Props$4): react.JSX.Element;
611
684
 
612
- type Props$4 = {
685
+ type Props$3 = {
613
686
  width?: CSSProperties['width'];
614
687
  templateRows?: CSSProperties['gridTemplateRows'];
615
688
  templateColumns?: CSSProperties['gridTemplateColumns'];
616
689
  autoColumns?: CSSProperties['gridAutoColumns'];
617
690
  autoRows?: CSSProperties['gridAutoRows'];
618
691
  };
619
- declare function Table({ width, templateRows, templateColumns, autoColumns, autoRows, children, }: PropsWithChildren<Props$4>): react.JSX.Element;
692
+ declare function Table({ width, templateRows, templateColumns, autoColumns, autoRows, children, }: PropsWithChildren<Props$3>): react.JSX.Element;
620
693
  declare namespace Table {
621
694
  var Row: typeof TableRow;
622
695
  var Cell: typeof TableCell;
@@ -625,21 +698,31 @@ declare namespace Table {
625
698
  type TagColor = keyof typeof tagLightColors;
626
699
  type ColorVariant = 'normal' | 'light';
627
700
 
628
- type Props$3 = {
701
+ type Props$2 = {
702
+ /** 削除イベントで使用するタグの一意なID。 */
629
703
  id: string;
704
+ /** タグに表示する1行のテキスト。 */
630
705
  children: string;
706
+ /** `tagColors`/`tagLightColors` で定義されたカラートークンのキー。 */
631
707
  color: TagColor;
708
+ /** `'normal'` は濃色、`'light'` は淡色のスタイルを適用する。 */
632
709
  variant?: ColorVariant;
633
710
  } & ({
711
+ /** 削除ボタンを表示してタグを編集可能にする。 */
634
712
  isEditable: true;
713
+ /** 削除ボタン押下時にタグのIDを受け取るハンドラ。 */
635
714
  onDelete: (id: string) => void;
715
+ /** 編集可能なタグは `medium` のみサポートする。 */
636
716
  size?: 'medium';
637
717
  } | {
718
+ /** 標準表示のため `isEditable` は指定しない。 */
638
719
  isEditable?: undefined;
720
+ /** 編集不可のタグでは `onDelete` を受け付けない。 */
639
721
  onDelete?: never;
722
+ /** 標準表示時に選択可能なサイズ。 */
640
723
  size?: 'x-small' | 'small' | 'medium';
641
724
  });
642
- declare function Tag({ id, children, color, variant, size, isEditable, onDelete }: Props$3): react.JSX.Element;
725
+ declare function Tag({ id, children, color, variant, size, isEditable, onDelete }: Props$2): react.JSX.Element;
643
726
 
644
727
  type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className'> & {
645
728
  size?: 'medium' | 'large';
@@ -674,18 +757,26 @@ declare const TextArea: TextAreaComponent;
674
757
 
675
758
  type ToastState = 'success' | 'error' | 'warning' | 'information';
676
759
 
677
- type Props$2 = {
760
+ type Props$1 = {
761
+ /** 表示するメッセージの状態(色・アイコンを切り替えます) */
678
762
  state?: ToastState;
763
+ /** トースト全体の幅。数値・文字列いずれも指定可能 */
679
764
  width?: CSSProperties['width'];
765
+ /** true で 5 秒後に自動で閉じる */
680
766
  isAutoClose?: boolean;
767
+ /** true でフェードイン/アウトのアニメーションを有効化 */
681
768
  isAnimation?: boolean;
769
+ /** 表示する本文 */
682
770
  children?: ReactNode;
771
+ /** クローズボタンや自動クローズ完了時に呼び出されるコールバック */
683
772
  onClickClose: () => void;
684
773
  };
685
- declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$2): react.JSX.Element;
774
+ declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$1): react.JSX.Element;
686
775
 
687
776
  type AddToastArgs = {
777
+ /** 表示する本文 */
688
778
  message: string;
779
+ /** 表示ステート */
689
780
  state: ToastState;
690
781
  };
691
782
  type ToastProviderProps = {
@@ -695,30 +786,50 @@ type ToastProviderProps = {
695
786
  declare const ToastProvider: ({ children }: PropsWithChildren) => react.JSX.Element;
696
787
  declare const useToast: () => ToastProviderProps;
697
788
 
698
- type Props$1 = {
789
+ /** Toggle コンポーネントの公開 Props */
790
+ type Props = {
791
+ /** `label` と関連付けるための input 要素の id/name */
699
792
  id: string;
793
+ /** トラックとインジケーターのサイズを決定する */
700
794
  size: 'small' | 'medium' | 'large';
795
+ /** 現在の ON/OFF 状態(制御コンポーネント) */
701
796
  isChecked: boolean;
797
+ /** ON/OFF の切り替え時に呼び出されるハンドラー */
702
798
  onChange: () => void;
799
+ /** トグル横に表示するラベル。文字列以外の ReactNode も可 */
703
800
  label?: ReactNode;
801
+ /** ラベル配置を右または左から選択する */
704
802
  labelPosition?: 'left' | 'right';
803
+ /** 無効状態の制御。true の場合は操作不可となる */
705
804
  isDisabled?: boolean;
706
805
  };
707
- declare function Toggle({ id, size, isChecked, onChange, label, labelPosition, isDisabled, }: Props$1): react.JSX.Element;
806
+ declare function Toggle({ id, size, isChecked, onChange, label, labelPosition, isDisabled, }: Props): react.JSX.Element;
708
807
 
709
808
  type TooltipSize = 'small' | 'medium';
710
809
  type TooltipVerticalPosition = 'top' | 'bottom';
711
810
  type TooltipHorizontalAlign = 'left' | 'center' | 'right';
712
811
 
713
- type Props = {
812
+ /**
813
+ * Tooltipコンポーネントに渡すProps。
814
+ */
815
+ type TooltipProps = {
816
+ /** Tooltipを表示させるトリガー要素。hover対象となる。 */
817
+ children: ReactNode;
818
+ /** Tooltip内に表示する内容。テキストに限らず複数行の要素を渡せる。 */
714
819
  content: ReactNode;
820
+ /** Tooltipのタイポグラフィとパディングを切り替えるサイズ。 */
715
821
  size?: TooltipSize;
822
+ /** Tooltip本体の最大幅。未指定時は内容に合わせて伸縮する。 */
716
823
  maxWidth?: CSSProperties['maxWidth'];
824
+ /** トリガーに対してTooltipを上下どちらに配置するか。 */
717
825
  verticalPosition?: TooltipVerticalPosition;
826
+ /** 水平方向の揃え位置。左右端または中央に合わせる。 */
718
827
  horizontalAlign?: TooltipHorizontalAlign;
828
+ /** trueの場合、hoverしてもTooltipを表示しない。 */
719
829
  isDisabledHover?: boolean;
830
+ /** Tooltipを別DOMツリー(例: document.body)に描画したい場合のポータル先。 */
720
831
  portalTarget?: HTMLElement;
721
832
  };
722
- declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, portalTarget, }: PropsWithChildren<Props>): react.JSX.Element;
833
+ declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, portalTarget, }: TooltipProps): react.JSX.Element;
723
834
 
724
835
  export { Avatar, Breadcrumb, Button, Checkbox, type ColorVariant, 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, Search, SegmentedControl, Select, type SelectOption, SelectSort, SortButton, type SortOrder, Tab, TabItem, Table, TableCell, TableRow, Tag, type TagColor, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, type UseRovingFocusProps, type UseRovingFocusReturn, useOutsideClick, useRovingFocus, useToast };