@zenkigen-inc/component-ui 1.22.0 → 1.24.0
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 +40 -15
- package/dist/index.d.ts +40 -15
- package/dist/index.js +449 -226
- package/dist/index.mjs +342 -119
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -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
|
-
/**
|
|
224
|
-
|
|
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 等) */
|
|
@@ -824,7 +833,7 @@ type Props$a = {
|
|
|
824
833
|
placeholderIcon?: IconName;
|
|
825
834
|
/** 現在選択されているオプション */
|
|
826
835
|
selectedOption?: SelectOption | null;
|
|
827
|
-
/**
|
|
836
|
+
/** オプションリストの最大高さ。未指定の場合はオプション 8.5 個分(x-small / small / medium: 282px、large: 350px)。"none" で制限を解除する */
|
|
828
837
|
optionListMaxHeight?: CSSProperties['height'];
|
|
829
838
|
/** 無効状態の制御 */
|
|
830
839
|
isDisabled?: boolean;
|
|
@@ -832,6 +841,8 @@ type Props$a = {
|
|
|
832
841
|
isError?: boolean;
|
|
833
842
|
/** 選択状態の見た目を適用するかどうか */
|
|
834
843
|
isOptionSelected?: boolean;
|
|
844
|
+
/** 「選択解除」を表示するかどうか。未指定の場合は後方互換の挙動(placeholder の有無に従う)となる */
|
|
845
|
+
hasDeselectButton?: boolean;
|
|
835
846
|
/** 選択変更時のコールバック関数 */
|
|
836
847
|
onChange?: (option: SelectOption | null) => void;
|
|
837
848
|
/** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
|
|
@@ -841,7 +852,7 @@ type Props$a = {
|
|
|
841
852
|
/** トリガーボタンに設定する aria-describedby。エラーメッセージ等と関連付けるために使用する */
|
|
842
853
|
'aria-describedby'?: AriaAttributes['aria-describedby'];
|
|
843
854
|
};
|
|
844
|
-
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;
|
|
855
|
+
declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, hasDeselectButton, onChange, optionListMaxHeight, matchListToTrigger, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, }: PropsWithChildren<Props$a>): react.JSX.Element;
|
|
845
856
|
declare namespace Select {
|
|
846
857
|
var Option: typeof SelectItem;
|
|
847
858
|
}
|
|
@@ -1122,33 +1133,47 @@ declare const TimePicker: TimePickerComponent;
|
|
|
1122
1133
|
type ToastState = 'success' | 'error' | 'warning' | 'information';
|
|
1123
1134
|
|
|
1124
1135
|
type Props$1 = {
|
|
1125
|
-
/**
|
|
1136
|
+
/** トーストの状態を表す。表示するアイコンとタイトルの文字色が切り替わる。 */
|
|
1126
1137
|
state?: ToastState;
|
|
1127
|
-
/**
|
|
1138
|
+
/** トースト全体の幅。数値・文字列いずれも指定できる。 */
|
|
1128
1139
|
width?: CSSProperties['width'];
|
|
1129
|
-
/** true
|
|
1140
|
+
/** true のとき 5 秒後に自動で閉じ、onClickClose を呼ぶ。既定は false(ToastProvider 経由のトーストには既定で true が渡される)。 */
|
|
1130
1141
|
isAutoClose?: boolean;
|
|
1131
|
-
/** true
|
|
1142
|
+
/** true のときフェードイン / フェードアウトのアニメーションを有効にする。 */
|
|
1132
1143
|
isAnimation?: boolean;
|
|
1133
|
-
/**
|
|
1144
|
+
/** true のとき閉じるボタンを表示する。isAutoClose が false のときは指定に関わらず必ず表示される。 */
|
|
1145
|
+
hasCloseButton?: boolean;
|
|
1146
|
+
/** タイトルの下に表示する補足テキスト。 */
|
|
1147
|
+
description?: ReactNode;
|
|
1148
|
+
/** タイトルとして表示する本文。 */
|
|
1134
1149
|
children?: ReactNode;
|
|
1135
|
-
/**
|
|
1150
|
+
/** 閉じるボタン押下時および自動クローズ完了時に呼ばれる、トースト終了の通知コールバック。 */
|
|
1136
1151
|
onClickClose: () => void;
|
|
1137
1152
|
};
|
|
1138
|
-
declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$1): react.JSX.Element;
|
|
1153
|
+
declare function Toast({ state, width, isAutoClose, isAnimation, hasCloseButton, description, children, onClickClose, }: Props$1): react.JSX.Element;
|
|
1139
1154
|
|
|
1140
1155
|
type AddToastArgs = {
|
|
1141
|
-
/**
|
|
1156
|
+
/** タイトルとして表示する本文 */
|
|
1142
1157
|
message: string;
|
|
1143
1158
|
/** 表示ステート */
|
|
1144
1159
|
state: ToastState;
|
|
1160
|
+
/** タイトルの下に表示する補足テキスト */
|
|
1161
|
+
description?: ReactNode;
|
|
1162
|
+
/** 閉じるボタンを表示するかどうか。ToastProvider の既定値を上書きする */
|
|
1163
|
+
hasCloseButton?: boolean;
|
|
1164
|
+
/** 5 秒後に自動で閉じるかどうか。既定は true */
|
|
1165
|
+
isAutoClose?: boolean;
|
|
1145
1166
|
};
|
|
1146
|
-
type
|
|
1167
|
+
type ToastContextValue = {
|
|
1147
1168
|
addToast: (args: AddToastArgs) => void;
|
|
1148
1169
|
removeToast: (id: number) => void;
|
|
1149
1170
|
};
|
|
1150
|
-
|
|
1151
|
-
|
|
1171
|
+
type ToastProviderProps = PropsWithChildren<{
|
|
1172
|
+
/** このプロバイダー配下で追加されるトーストの、閉じるボタン表示の既定値 */
|
|
1173
|
+
hasCloseButton?: boolean;
|
|
1174
|
+
}>;
|
|
1175
|
+
declare const ToastProvider: ({ children, hasCloseButton }: ToastProviderProps) => react.JSX.Element;
|
|
1176
|
+
declare const useToast: () => ToastContextValue;
|
|
1152
1177
|
|
|
1153
1178
|
/** Toggle コンポーネントの公開 Props */
|
|
1154
1179
|
type Props = {
|
package/dist/index.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
224
|
-
|
|
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 等) */
|
|
@@ -824,7 +833,7 @@ type Props$a = {
|
|
|
824
833
|
placeholderIcon?: IconName;
|
|
825
834
|
/** 現在選択されているオプション */
|
|
826
835
|
selectedOption?: SelectOption | null;
|
|
827
|
-
/**
|
|
836
|
+
/** オプションリストの最大高さ。未指定の場合はオプション 8.5 個分(x-small / small / medium: 282px、large: 350px)。"none" で制限を解除する */
|
|
828
837
|
optionListMaxHeight?: CSSProperties['height'];
|
|
829
838
|
/** 無効状態の制御 */
|
|
830
839
|
isDisabled?: boolean;
|
|
@@ -832,6 +841,8 @@ type Props$a = {
|
|
|
832
841
|
isError?: boolean;
|
|
833
842
|
/** 選択状態の見た目を適用するかどうか */
|
|
834
843
|
isOptionSelected?: boolean;
|
|
844
|
+
/** 「選択解除」を表示するかどうか。未指定の場合は後方互換の挙動(placeholder の有無に従う)となる */
|
|
845
|
+
hasDeselectButton?: boolean;
|
|
835
846
|
/** 選択変更時のコールバック関数 */
|
|
836
847
|
onChange?: (option: SelectOption | null) => void;
|
|
837
848
|
/** ドロップダウンリストの幅をトリガーボタンの幅に合わせる */
|
|
@@ -841,7 +852,7 @@ type Props$a = {
|
|
|
841
852
|
/** トリガーボタンに設定する aria-describedby。エラーメッセージ等と関連付けるために使用する */
|
|
842
853
|
'aria-describedby'?: AriaAttributes['aria-describedby'];
|
|
843
854
|
};
|
|
844
|
-
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;
|
|
855
|
+
declare function Select({ children, size, variant, width, maxWidth, placeholder, placeholderIcon, selectedOption, isDisabled, isError, isOptionSelected, hasDeselectButton, onChange, optionListMaxHeight, matchListToTrigger, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, }: PropsWithChildren<Props$a>): react.JSX.Element;
|
|
845
856
|
declare namespace Select {
|
|
846
857
|
var Option: typeof SelectItem;
|
|
847
858
|
}
|
|
@@ -1122,33 +1133,47 @@ declare const TimePicker: TimePickerComponent;
|
|
|
1122
1133
|
type ToastState = 'success' | 'error' | 'warning' | 'information';
|
|
1123
1134
|
|
|
1124
1135
|
type Props$1 = {
|
|
1125
|
-
/**
|
|
1136
|
+
/** トーストの状態を表す。表示するアイコンとタイトルの文字色が切り替わる。 */
|
|
1126
1137
|
state?: ToastState;
|
|
1127
|
-
/**
|
|
1138
|
+
/** トースト全体の幅。数値・文字列いずれも指定できる。 */
|
|
1128
1139
|
width?: CSSProperties['width'];
|
|
1129
|
-
/** true
|
|
1140
|
+
/** true のとき 5 秒後に自動で閉じ、onClickClose を呼ぶ。既定は false(ToastProvider 経由のトーストには既定で true が渡される)。 */
|
|
1130
1141
|
isAutoClose?: boolean;
|
|
1131
|
-
/** true
|
|
1142
|
+
/** true のときフェードイン / フェードアウトのアニメーションを有効にする。 */
|
|
1132
1143
|
isAnimation?: boolean;
|
|
1133
|
-
/**
|
|
1144
|
+
/** true のとき閉じるボタンを表示する。isAutoClose が false のときは指定に関わらず必ず表示される。 */
|
|
1145
|
+
hasCloseButton?: boolean;
|
|
1146
|
+
/** タイトルの下に表示する補足テキスト。 */
|
|
1147
|
+
description?: ReactNode;
|
|
1148
|
+
/** タイトルとして表示する本文。 */
|
|
1134
1149
|
children?: ReactNode;
|
|
1135
|
-
/**
|
|
1150
|
+
/** 閉じるボタン押下時および自動クローズ完了時に呼ばれる、トースト終了の通知コールバック。 */
|
|
1136
1151
|
onClickClose: () => void;
|
|
1137
1152
|
};
|
|
1138
|
-
declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props$1): react.JSX.Element;
|
|
1153
|
+
declare function Toast({ state, width, isAutoClose, isAnimation, hasCloseButton, description, children, onClickClose, }: Props$1): react.JSX.Element;
|
|
1139
1154
|
|
|
1140
1155
|
type AddToastArgs = {
|
|
1141
|
-
/**
|
|
1156
|
+
/** タイトルとして表示する本文 */
|
|
1142
1157
|
message: string;
|
|
1143
1158
|
/** 表示ステート */
|
|
1144
1159
|
state: ToastState;
|
|
1160
|
+
/** タイトルの下に表示する補足テキスト */
|
|
1161
|
+
description?: ReactNode;
|
|
1162
|
+
/** 閉じるボタンを表示するかどうか。ToastProvider の既定値を上書きする */
|
|
1163
|
+
hasCloseButton?: boolean;
|
|
1164
|
+
/** 5 秒後に自動で閉じるかどうか。既定は true */
|
|
1165
|
+
isAutoClose?: boolean;
|
|
1145
1166
|
};
|
|
1146
|
-
type
|
|
1167
|
+
type ToastContextValue = {
|
|
1147
1168
|
addToast: (args: AddToastArgs) => void;
|
|
1148
1169
|
removeToast: (id: number) => void;
|
|
1149
1170
|
};
|
|
1150
|
-
|
|
1151
|
-
|
|
1171
|
+
type ToastProviderProps = PropsWithChildren<{
|
|
1172
|
+
/** このプロバイダー配下で追加されるトーストの、閉じるボタン表示の既定値 */
|
|
1173
|
+
hasCloseButton?: boolean;
|
|
1174
|
+
}>;
|
|
1175
|
+
declare const ToastProvider: ({ children, hasCloseButton }: ToastProviderProps) => react.JSX.Element;
|
|
1176
|
+
declare const useToast: () => ToastContextValue;
|
|
1152
1177
|
|
|
1153
1178
|
/** Toggle コンポーネントの公開 Props */
|
|
1154
1179
|
type Props = {
|