diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-input/components/search-input.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-input/components/search-input.tsx index 54eb96a99..4eadc709f 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-input/components/search-input.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-input/components/search-input.tsx @@ -2,7 +2,7 @@ import { ARIA_LABELS, ComponentName } from "@wizleap-inc/wiz-ui-constants"; import * as styles from "@wizleap-inc/wiz-ui-styles/bases/search-input.css"; import { inputBorderStyle } from "@wizleap-inc/wiz-ui-styles/commons"; import clsx from "clsx"; -import { FC, KeyboardEventHandler, useMemo, useRef, useState } from "react"; +import { KeyboardEventHandler, useMemo, useRef, useState } from "react"; import { TIcon, @@ -15,11 +15,11 @@ import { import { BaseProps } from "@/types"; import { SearchPopupPanel } from "./search-popup-panel"; -import { SearchInputOption } from "./types"; +import { CheckboxOption, SearchInputOption } from "./types"; -type Props = BaseProps & { - options: SearchInputOption[]; - values: number[]; +type Props = BaseProps & { + options: SearchInputOption[]; + values: T[]; name?: string; placeholder?: string; disabled?: boolean; @@ -32,13 +32,13 @@ type Props = BaseProps & { icon?: TIcon; showSelectedItem?: boolean; showParentLabel?: boolean; - onChangeValues: (values: number[]) => void; + onChangeValues: (values: T[]) => void; }; -function filterOptions( - options: SearchInputOption[], +function filterOptions( + options: SearchInputOption[], text: string -): SearchInputOption[] { +): SearchInputOption[] { return options.flatMap((option) => { const isMatched = option.label.includes(text); if (!option.children || option.children.length === 0) { @@ -56,7 +56,7 @@ function filterOptions( }); } -const SearchInput: FC = ({ +const SearchInput = ({ className, style, options, @@ -74,21 +74,23 @@ const SearchInput: FC = ({ onChangeValues, showParentLabel, icon = WizISearch, -}) => { +}: Props) => { const [filteringText, setFilteringText] = useState(""); const [isFocused, setIsFocused] = useState(false); const [isPopupOpen, setIsPopupOpen] = useState(false); const inputRef = useRef(null); const filteredOptions = useMemo( - () => filterOptions(options, filteringText), + () => filterOptions(options, filteringText), [filteringText, options] ); const valueToOptions = useMemo(() => { - const map = new Map(); + const map = new Map>(); - const flatten = (options: SearchInputOption[]): SearchInputOption[] => { + const flatten = ( + options: SearchInputOption[] + ): SearchInputOption[] => { return options.flatMap((option) => { if (!option.children) return [option]; @@ -113,12 +115,12 @@ const SearchInput: FC = ({ const IconComponent = icon; - const onClear = (value: number) => { + const onClear = (value: T) => { const newValues = values.filter((v) => v !== value); onChangeValues(newValues); }; - const handleKeyDown = (value: number): KeyboardEventHandler => { + const handleKeyDown = (value: T): KeyboardEventHandler => { return (e) => { if (e.key === "Backspace") { onClear(value); @@ -128,7 +130,7 @@ const SearchInput: FC = ({ const displayingSelectedItems = showSelectedItem && values.length > 0; - const handleClickPanelItem = (value: number[]) => { + const handleClickPanelItem = (value: T[]) => { onChangeValues(value); setFilteringText(""); }; @@ -162,7 +164,7 @@ const SearchInput: FC = ({ {showSelectedItem && values.map((value) => ( = BaseProps & { + options: SearchInputOption[]; + values: T[]; width?: string; emptyMessage: string; singleSelect?: boolean; - onChangeValues: (values: number[]) => void; + onChangeValues: (values: T[]) => void; closePopup: () => void; }; -export const SearchPopupPanel: FC = ({ +export const SearchPopupPanel = ({ className, style, options, @@ -34,8 +34,8 @@ export const SearchPopupPanel: FC = ({ singleSelect, onChangeValues, closePopup, -}) => { - const [activeValue, setActiveValue] = useState(null); +}: Props) => { + const [activeValue, setActiveValue] = useState(null); const activeOption = useMemo( () => options.find((option) => activeValue === option.value), [activeValue, options] @@ -45,7 +45,7 @@ export const SearchPopupPanel: FC = ({ const isOpen = activeOptionChildren !== undefined; const handleChangeValues = useCallback( - (selectedOptionValue: number, isChecked: boolean) => { + (selectedOptionValue: T, isChecked: boolean) => { const newValues = (() => { if (isChecked) { return [...values, selectedOptionValue]; @@ -58,7 +58,7 @@ export const SearchPopupPanel: FC = ({ [onChangeValues, values] ); - const handleClickButton = (value: number) => { + const handleClickButton = (value: T) => { onChangeValues([value]); closePopup(); }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-input/components/types.ts b/packages/wiz-ui-react/src/components/base/inputs/search-input/components/types.ts index a437ced2f..a60d2070a 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-input/components/types.ts +++ b/packages/wiz-ui-react/src/components/base/inputs/search-input/components/types.ts @@ -1,10 +1,10 @@ export type Tag = { label: string; }; - -export type SearchInputOption = { +export type CheckboxOption = string | number | string[]; // WizCheckBoxNew +export type SearchInputOption = { label: string; - value: number; - children?: SearchInputOption[]; + value: T; + children?: SearchInputOption[]; tag?: Tag; }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/dummy-data.ts b/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/dummy-data.ts index df55c5413..cc0675560 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/dummy-data.ts +++ b/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/dummy-data.ts @@ -4,7 +4,7 @@ const tag = { label: "タグ", }; -export const normalOptions: SearchInputOption[] = [ +export const normalOptions: SearchInputOption[] = [ { label: "テスト会社1", value: 1, @@ -208,7 +208,7 @@ export const normalOptions: SearchInputOption[] = [ }, ]; -export const longLabelOptions: SearchInputOption[] = [ +export const longLabelOptions: SearchInputOption[] = [ { label: "テスト会社1", value: 1, @@ -233,7 +233,7 @@ export const longLabelOptions: SearchInputOption[] = [ }, ]; -export const taggedOptions: SearchInputOption[] = [ +export const taggedOptions: SearchInputOption[] = [ { label: "テスト会社1", value: 1, @@ -328,8 +328,8 @@ const getNextValue = (): number => { const generateGrandchildren = ( startValue: number, count: number -): SearchInputOption[] => { - const grandchildren: SearchInputOption[] = []; +): SearchInputOption[] => { + const grandchildren: SearchInputOption[] = []; for (let i = 0; i < count; i++) { const grandchildValue = getNextValue(); grandchildren.push({ @@ -344,8 +344,8 @@ const generateGrandchildren = ( const generateChildren = ( startValue: number, count: number -): SearchInputOption[] => { - const children: SearchInputOption[] = []; +): SearchInputOption[] => { + const children: SearchInputOption[] = []; for (let i = 0; i < count; i++) { const childValue = getNextValue(); children.push({ @@ -365,8 +365,8 @@ const generateChildren = ( const generateParentElements = ( startValue: number, count: number -): SearchInputOption[] => { - const parentElements: SearchInputOption[] = []; +): SearchInputOption[] => { + const parentElements: SearchInputOption[] = []; for (let i = 0; i < count; i++) { const parentValue = getNextValue(); parentElements.push({ @@ -378,7 +378,7 @@ const generateParentElements = ( return parentElements; }; -export const debugOptions: SearchInputOption[] = [ +export const debugOptions: SearchInputOption[] = [ { label: "親要素1", value: getNextValue(), @@ -397,7 +397,7 @@ export const debugOptions: SearchInputOption[] = [ ...generateParentElements(getNextValue(), 13), ]; -export const emptyMessageOptions: SearchInputOption[] = [ +export const emptyMessageOptions: SearchInputOption[] = [ { label: "テスト会社1", value: 1, diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/search-input.stories.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/search-input.stories.tsx index 142a2238c..13a99ef30 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/search-input.stories.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-input/stories/search-input.stories.tsx @@ -21,7 +21,7 @@ const meta: Meta = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj>; const Template: Story = { render: (args) => { diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/button-item.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/button-item.tsx index 8d91b8618..80d6f1c93 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/button-item.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/button-item.tsx @@ -6,26 +6,26 @@ import { popupButtonGroupInnerContainerStyle, } from "@wizleap-inc/wiz-ui-styles/bases/search-selector.css"; import clsx from "clsx"; -import { FC, KeyboardEvent, useMemo, useState } from "react"; +import { KeyboardEvent, useMemo, useState } from "react"; import { WizIcon } from "@/components"; import { BaseProps } from "@/types"; import { ButtonItem as ButtonItemType } from "../types"; -type Props = BaseProps & { - item: ButtonItemType; +type Props = BaseProps & { + item: ButtonItemType; disabled: boolean; depth: number; }; -export const ButtonItem: FC = ({ +export const ButtonItem = ({ className, style, item, disabled, depth, -}) => { +}: Props) => { const [isClicking, setIsClicking] = useState(false); const [isHover, setIsHover] = useState(false); diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/group-item.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/group-item.tsx index a5af626bf..4b21d4f8c 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/group-item.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/components/group-item.tsx @@ -4,7 +4,6 @@ import { popupButtonGroupTitleVariantStyle, } from "@wizleap-inc/wiz-ui-styles/bases/search-selector.css"; import clsx from "clsx"; -import { FC } from "react"; import { BaseProps } from "@/types"; @@ -12,19 +11,19 @@ import { GroupItem as GroupItemType } from "../types"; import { PopupButtonGroup } from "./popup-button-group"; -type Props = BaseProps & { - item: GroupItemType; +type Props = BaseProps & { + item: GroupItemType; disabled: boolean; depth: number; }; -export const GroupItem: FC = ({ +export const GroupItem = ({ className, style, item, disabled, depth, -}) => { +}: Props) => { return (
= BaseProps & { + options: ButtonGroupItem[]; width?: string; p?: SpacingKeys; borderRadius?: SpacingKeys; @@ -28,7 +28,7 @@ type Props = BaseProps & { depth?: number; }; -export const PopupButtonGroup: FC = ({ +export const PopupButtonGroup = ({ className, style, options, @@ -40,15 +40,15 @@ export const PopupButtonGroup: FC = ({ groupDivider = false, buttonDivider = false, depth = 0, -}) => { +}: Props) => { const items = useMemo(() => { - const divider: ItemElement = { kind: "divider" }; + const divider: ItemElement = { kind: "divider" }; const items = options .map((opt, i) => { if (opt.kind === "divider") { return [divider]; } - const optionItem: ItemElement = { + const optionItem: ItemElement = { kind: "item", item: opt, }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/types.ts b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/types.ts index 6cf36d2e4..5e8b5c72b 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/types.ts +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/popup-button-group/types.ts @@ -1,8 +1,8 @@ import { TIcon } from "@/components"; -export interface PopupButtonOption { +export interface PopupButtonOption { label: string; - value: number; + value?: T; exLabel?: string; icon?: TIcon; iconDefaultColor?: "green.800" | "gray.500"; @@ -10,27 +10,27 @@ export interface PopupButtonOption { onClick: () => void; } -export interface ButtonItem { +export interface ButtonItem { kind: "button"; - option: PopupButtonOption; + option: PopupButtonOption; } interface DividerItem { kind: "divider"; } -export interface GroupItem { +export interface GroupItem { kind: "group"; title: string; // 再帰参照を許可するためにno-use-before-define無効化 // eslint-disable-next-line no-use-before-define - items: ButtonGroupItem[]; + items: ButtonGroupItem[]; groupDivider?: boolean; buttonDivider?: boolean; } -export type ButtonGroupItem = ButtonItem | DividerItem | GroupItem; +export type ButtonGroupItem = ButtonItem | DividerItem | GroupItem; -export type ItemElement = +export type ItemElement = | DividerItem - | { kind: "item"; item: Exclude }; + | { kind: "item"; item: Exclude, DividerItem> }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector-helper.ts b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector-helper.ts index a2d025110..d968bf720 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector-helper.ts +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector-helper.ts @@ -19,8 +19,8 @@ function levenshteinDistance(s1: string, s2: string): number { return dist[s1.length][s2.length] / Math.max(s1.length, s2.length); } -export function filterOptions( - options: SearchSelectorOption[], +export function filterOptions( + options: SearchSelectorOption[], searchText: string, threshold: number ) { diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector.tsx index a4d450311..ac0b8f965 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/search-selector.tsx @@ -3,7 +3,6 @@ import * as styles from "@wizleap-inc/wiz-ui-styles/bases/search-selector.css"; import { inputBorderStyle } from "@wizleap-inc/wiz-ui-styles/commons"; import clsx from "clsx"; import { - FC, KeyboardEvent, KeyboardEventHandler, MouseEventHandler, @@ -31,9 +30,9 @@ import { ButtonGroupItem } from "./popup-button-group/types"; import { filterOptions } from "./search-selector-helper"; import { SearchSelectorOption } from "./types"; -type Props = BaseProps & { - options: SearchSelectorOption[]; - values: number[]; +type Props = BaseProps & { + options: SearchSelectorOption[]; + values: T[]; placeholder?: string; width?: string; disabled?: boolean; @@ -51,12 +50,12 @@ type Props = BaseProps & { * @default 0.75 */ threshold?: number; - onChangeValues: (values: number[]) => void; + onChangeValues: (values: T[]) => void; onCreate?: (label: string) => void; onInputSearchText?: (text: string) => void; }; -const SearchSelector: FC = ({ +const SearchSelector = ({ className, style, options, @@ -75,7 +74,7 @@ const SearchSelector: FC = ({ onChangeValues, onCreate, onInputSearchText, -}) => { +}: Props) => { const [searchText, setSearchText] = useState(""); const [isPopupOpen, setIsPopupOpen] = useState(false); const [isFocused, setIsFocused] = useState(false); @@ -100,7 +99,7 @@ const SearchSelector: FC = ({ ); }, [selectedOptions.length]); - const buttonGroupOptions: ButtonGroupItem[] = useMemo(() => { + const buttonGroupOptions: ButtonGroupItem[] = useMemo(() => { const filteredOptions = filterOptions( options, searchText, @@ -108,7 +107,7 @@ const SearchSelector: FC = ({ ).filter((matchedOption) => { return !values.some((value) => matchedOption.value === value); }); - const buttonGroupOptions: ButtonGroupItem[] = filteredOptions.map( + const buttonGroupOptions: ButtonGroupItem[] = filteredOptions.map( (option) => { return { kind: "button", @@ -143,7 +142,6 @@ const SearchSelector: FC = ({ label: searchText, icon: WizIAddCircle, iconDefaultColor: "green.800", - value: -1, onClick: () => { onCreate?.(searchText); setSearchText(""); @@ -165,7 +163,7 @@ const SearchSelector: FC = ({ values, ]); - const unselectOption = (option: SearchSelectorOption) => { + const unselectOption = (option: SearchSelectorOption) => { onChangeValues(values.filter((value) => value !== option.value)); setTimeout(() => { // input 要素が描画されるのを待ってフォーカス @@ -174,7 +172,7 @@ const SearchSelector: FC = ({ }; const handleClickClearButton = ( - option: SearchSelectorOption + option: SearchSelectorOption ): MouseEventHandler => { return (e) => { e.stopPropagation(); @@ -196,7 +194,7 @@ const SearchSelector: FC = ({ }; const keyDownHandlers = { - clearButton: (option: SearchSelectorOption): KeyboardEventHandler => { + clearButton: (option: SearchSelectorOption): KeyboardEventHandler => { return (e) => { if (e.key === "Backspace") { unselectOption(option); diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/types.ts b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/types.ts index c51ef36c5..977337fa2 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/types.ts +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/components/types.ts @@ -1,6 +1,6 @@ -export type SearchSelectorOption = { +export type SearchSelectorOption = { label: string; - value: number; + value: T; exLabel?: string; disabled?: boolean; }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/search-selector/stories/search-selector.stories.tsx b/packages/wiz-ui-react/src/components/base/inputs/search-selector/stories/search-selector.stories.tsx index 576a02e1a..aca40b43e 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/search-selector/stories/search-selector.stories.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/search-selector/stories/search-selector.stories.tsx @@ -34,10 +34,10 @@ v-modelには選択中のアイテムを渡します。 }; export default meta; -type Story = StoryObj; +type Story = StoryObj>; const getDummyOptions = (label: string, count: number, exLabel?: string) => { - const options: SearchSelectorOption[] = []; + const options: SearchSelectorOption[] = []; for (let i = 1; i <= count; i++) { options.push({ label: label + i, value: i, exLabel }); options.push({ label: label + i * 10, value: i * 10, exLabel }); @@ -49,7 +49,7 @@ const getTemplate = (initialValues: number[] = []): Story => { return { render: (args) => { const [values, setValues] = useState(initialValues); - const [options, setOptions] = useState( + const [options, setOptions] = useState[]>( args.options ); const onCreate = useCallback( diff --git a/packages/wiz-ui-react/src/components/base/inputs/selectbox/components/selectbox.tsx b/packages/wiz-ui-react/src/components/base/inputs/selectbox/components/selectbox.tsx index 230222a80..76e8a7db1 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/selectbox/components/selectbox.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/selectbox/components/selectbox.tsx @@ -3,7 +3,6 @@ import * as styles from "@wizleap-inc/wiz-ui-styles/bases/selectbox-input.css"; import { inputBorderStyle } from "@wizleap-inc/wiz-ui-styles/commons"; import clsx from "clsx"; import { - FC, KeyboardEventHandler, useCallback, useContext, @@ -22,16 +21,16 @@ import { } from "@/components"; import { FormControlContext } from "@/components/custom/form/components/form-control-context"; import { BaseProps } from "@/types"; -type SelectBoxOption = { +type SelectBoxOption = { label: string; exLabel?: string; - value: number; + value: T; disabled?: boolean; }; -type Props = BaseProps & { - options: SelectBoxOption[]; - value: number | null; +type Props = BaseProps & { + options: SelectBoxOption[]; + value: T | null; placeholder?: string; width?: string; disabled?: boolean; @@ -40,10 +39,10 @@ type Props = BaseProps & { isDirectionFixed?: boolean; showExLabel?: boolean; dropdownMaxHeight?: string; - onChange: (value: number | null) => void; + onChange: (value: T | null) => void; }; -const SelectBox: FC = ({ +const SelectBox = ({ className, style, options, @@ -57,7 +56,7 @@ const SelectBox: FC = ({ showExLabel = false, dropdownMaxHeight, onChange, -}) => { +}: Props) => { const [isOpen, setIsOpen] = useState(false); const anchorRef = useRef(null); const formControl = useContext(FormControlContext); @@ -80,7 +79,7 @@ const SelectBox: FC = ({ setIsOpen(!isOpen); }; - const handleClickOption = (option: SelectBoxOption) => { + const handleClickOption = (option: SelectBoxOption) => { setIsOpen(false); onChange(option.value); }; diff --git a/packages/wiz-ui-react/src/components/base/inputs/selectbox/stories/selectbox.stories.tsx b/packages/wiz-ui-react/src/components/base/inputs/selectbox/stories/selectbox.stories.tsx index 4f1e1d77d..5628d8ac8 100644 --- a/packages/wiz-ui-react/src/components/base/inputs/selectbox/stories/selectbox.stories.tsx +++ b/packages/wiz-ui-react/src/components/base/inputs/selectbox/stories/selectbox.stories.tsx @@ -11,7 +11,7 @@ const meta: Meta = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj>; const getDummyOptions = (label: string, length: number, exLabel?: string) => { return Array.from({ length }).map((_, i) => ({ diff --git a/packages/wiz-ui-react/src/components/custom/chat/components/chat-card.tsx b/packages/wiz-ui-react/src/components/custom/chat/components/chat-card.tsx index b3c41c99b..380c68293 100644 --- a/packages/wiz-ui-react/src/components/custom/chat/components/chat-card.tsx +++ b/packages/wiz-ui-react/src/components/custom/chat/components/chat-card.tsx @@ -3,7 +3,6 @@ import * as styles from "@wizleap-inc/wiz-ui-styles/customs/chat-card.css"; import { formatDateToMonthDayWeek } from "@wizleap-inc/wiz-ui-utils"; import { ComponentProps, - FC, Fragment, useCallback, useEffect, @@ -34,7 +33,7 @@ import { WizChatForm, WizChatItem } from "."; const TOGGLE_ANIMATION_DURATION = 300; -type Props = BaseProps & { +type Props = BaseProps & { textValue: string; username: string; isOpen: boolean; @@ -43,16 +42,16 @@ type Props = BaseProps & { haveNewMessage?: boolean; formRows?: number; typingUsername?: string; - status?: number | null; - statusOptions?: ComponentProps["options"]; + status?: T | null; + statusOptions?: ComponentProps>["options"]; statusPlaceholder?: string; - onChangeStatus?: (status: number | null) => void; + onChangeStatus?: (status: T | null) => void; onChangeTextValue: (value: string) => void; onSubmit: () => void; onToggle: () => void; }; -const ChatCard: FC = ({ +const ChatCard = ({ className, style, isOpen, @@ -70,7 +69,7 @@ const ChatCard: FC = ({ onChangeTextValue, onSubmit, onToggle, -}) => { +}: Props) => { const wrapperBoxRef = useRef(null); const dividerRef = useRef(null); const listBoxRef = useRef(null); diff --git a/packages/wiz-ui-react/src/components/custom/chat/stories/chat-card.stories.tsx b/packages/wiz-ui-react/src/components/custom/chat/stories/chat-card.stories.tsx index c5364957a..b5a46d016 100644 --- a/packages/wiz-ui-react/src/components/custom/chat/stories/chat-card.stories.tsx +++ b/packages/wiz-ui-react/src/components/custom/chat/stories/chat-card.stories.tsx @@ -65,25 +65,26 @@ const dummyMessages: Message[] = [ time: new Date("2021-08-02T04:00:00.000+09:00"), }, ]; -const dummyStatusOptions: ComponentProps["statusOptions"] = - [ - { - label: "ステータス1", - value: 1, - }, - { - label: "ステータス2", - value: 2, - }, - { - label: "ステータス3", - value: 3, - }, - { - label: "ステータス4", - value: 4, - }, - ]; +const dummyStatusOptions: ComponentProps< + typeof WizChatCard +>["statusOptions"] = [ + { + label: "ステータス1", + value: 1, + }, + { + label: "ステータス2", + value: 2, + }, + { + label: "ステータス3", + value: 3, + }, + { + label: "ステータス4", + value: 4, + }, +]; const templateArgs = { isOpen: true,