diff --git a/packages/ui/src/components/banner/banner.tsx b/packages/ui/src/components/banner/banner.tsx index 570dde959..bf16f82d5 100644 --- a/packages/ui/src/components/banner/banner.tsx +++ b/packages/ui/src/components/banner/banner.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { createClassName } from '../../utilities/create-class-name.js' import { createComponent } from '../../utilities/create-component.js' @@ -14,7 +14,7 @@ export type BannerVariant = 'success' | 'warning' export const Banner = createComponent(function ( { children, icon, variant, ...rest }, ref -): JSX.Element { +) { return (
(function ( ...rest }, ref -): JSX.Element { +) { const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] @@ -72,10 +71,8 @@ export const Button = createComponent(function ( {...rest} ref={ref} disabled={disabled === true} - onClick={disabled === true || loading === true ? undefined : onClick} - onKeyDown={ - disabled === true || loading === true ? undefined : handleKeyDown - } + onClick={loading === true ? undefined : onClick} + onKeyDown={handleKeyDown} tabIndex={0} >
{children}
diff --git a/packages/ui/src/components/checkbox/checkbox.tsx b/packages/ui/src/components/checkbox/checkbox.tsx index 75381e60a..b84d2747d 100644 --- a/packages/ui/src/components/checkbox/checkbox.tsx +++ b/packages/ui/src/components/checkbox/checkbox.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { useCallback } from 'preact/hooks' import { IconControlCheckboxChecked12 } from '../../icons/icon-12/icon-control-checkbox-checked-12.js' @@ -32,27 +32,26 @@ export const Checkbox = createComponent( ...rest }, ref - ): JSX.Element { + ) { const handleChange = useCallback( - function (event: Event.onChange): void { - const newValue = event.currentTarget.checked - onValueChange(newValue) + function (event: Event.onChange) { onChange(event) + const newValue = event.currentTarget.checked === true + onValueChange(newValue) }, [onChange, onValueChange] ) const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] diff --git a/packages/ui/src/components/disclosure/disclosure.tsx b/packages/ui/src/components/disclosure/disclosure.tsx index eac7437f0..cc3b82c3d 100644 --- a/packages/ui/src/components/disclosure/disclosure.tsx +++ b/packages/ui/src/components/disclosure/disclosure.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, Fragment, h, JSX } from 'preact' +import { ComponentChildren, Fragment, h } from 'preact' import { useCallback } from 'preact/hooks' import { IconCaretRight16 } from '../../icons/icon-16/icon-caret-right-16.js' @@ -29,18 +29,17 @@ export const Disclosure = createComponent( ...rest }, ref - ): JSX.Element { + ) { const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] diff --git a/packages/ui/src/components/divider/divider.tsx b/packages/ui/src/components/divider/divider.tsx index c3f175a64..5abde0821 100644 --- a/packages/ui/src/components/divider/divider.tsx +++ b/packages/ui/src/components/divider/divider.tsx @@ -1,10 +1,10 @@ -import { h, JSX } from 'preact' +import { h } from 'preact' import { createComponent } from '../../utilities/create-component.js' import styles from './divider.module.css' export const Divider = createComponent>( - function (rest, ref): JSX.Element { + function (rest, ref) { return
} ) diff --git a/packages/ui/src/components/dropdown/dropdown.tsx b/packages/ui/src/components/dropdown/dropdown.tsx index 1e7d20bd4..d7d94063c 100644 --- a/packages/ui/src/components/dropdown/dropdown.tsx +++ b/packages/ui/src/components/dropdown/dropdown.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX, RefObject } from 'preact' +import { ComponentChildren, h, RefObject } from 'preact' import { useCallback, useRef, useState } from 'preact/hooks' import menuStyles from '../../css/menu.module.css' @@ -58,7 +58,7 @@ export const Dropdown = createComponent( ...rest }, ref - ): JSX.Element { + ) { if (typeof icon === 'string' && icon.length !== 1) { throw new Error(`String \`icon\` must be a single character: "${icon}"`) } @@ -91,11 +91,11 @@ export const Dropdown = createComponent( setSelectedId: setSelectedId }) - const triggerBlur = useCallback(function (): void { + const triggerBlur = useCallback(function () { getCurrentFromRef(rootElementRef).blur() }, []) - const triggerHideMenu = useCallback(function (): void { + const triggerHideMenu = useCallback(function () { setIsMenuVisible(false) setSelectedId(INVALID_ID) }, []) @@ -166,7 +166,7 @@ export const Dropdown = createComponent( ) const handleRootKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { const key = event.key if (key === 'ArrowUp' || key === 'ArrowDown') { if (isMenuVisible === false) { @@ -239,7 +239,7 @@ export const Dropdown = createComponent( []) const handleOptionChange = useCallback( - function (event: Event.onChange): void { + function (event: Event.onChange) { const id = event.currentTarget.getAttribute( ITEM_ID_DATA_ATTRIBUTE_NAME ) as string @@ -343,10 +343,7 @@ export const Dropdown = createComponent( ])} onMouseDown={handleMenuMouseDown} > - {options.map(function ( - option: DropdownOption, - index: number - ): JSX.Element { + {options.map(function (option: DropdownOption, index: number) { if (typeof option === 'string') { return
} diff --git a/packages/ui/src/components/file-upload/file-upload-button/file-upload-button.tsx b/packages/ui/src/components/file-upload/file-upload-button/file-upload-button.tsx index f888adc54..79431be11 100644 --- a/packages/ui/src/components/file-upload/file-upload-button/file-upload-button.tsx +++ b/packages/ui/src/components/file-upload/file-upload-button/file-upload-button.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { useCallback } from 'preact/hooks' import { Event, EventHandler } from '../../../types/event-handler.js' @@ -21,6 +21,7 @@ export interface FileUploadButtonProps multiple?: boolean onChange?: EventHandler.onChange onClick?: EventHandler.onClick + onMouseDown?: EventHandler.onMouseDown onSelectedFiles?: EventHandler.onSelectedFiles secondary?: boolean } @@ -39,50 +40,58 @@ export const FileUploadButton = createComponent< multiple = false, onChange = noop, onClick = noop, - onSelectedFiles = noop, onKeyDown = noop, + onMouseDown = noop, + onSelectedFiles = noop, propagateEscapeKeyDown = true, secondary = false, ...rest }, ref -): JSX.Element { +) { const handleChange = useCallback( - function (event: Event.onChange): void { + function (event: Event.onChange) { onChange(event) - if (disabled === true || loading === true) { - return + const fileList = event.currentTarget.files + if (fileList === null) { + throw new Error('`event.currentTarget.files` is `null`') + } + const files = parseFileList(fileList) + if (files.length > 0) { + onSelectedFiles(files) } - const files = Array.prototype.slice - .call(event.currentTarget.files) - .sort(fileComparator) - onSelectedFiles(files) }, - [disabled, loading, onChange, onSelectedFiles] + [onChange, onSelectedFiles] ) const handleClick = useCallback( - function (event: Event.onClick): void { + function (event: Event.onClick) { onClick(event) - if (disabled === true || loading === true) { - return + if (loading === true) { + event.preventDefault() } + }, + [onClick, loading] + ) + + const handleMouseDown = useCallback( + function (event: Event.onClick) { + onMouseDown(event) event.currentTarget.focus() }, - [disabled, loading, onClick] + [onMouseDown] ) const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] @@ -121,6 +130,7 @@ export const FileUploadButton = createComponent< onChange={handleChange} onClick={handleClick} onKeyDown={handleKeyDown} + onMouseDown={handleMouseDown} tabIndex={0} title="" type="file" @@ -131,3 +141,7 @@ export const FileUploadButton = createComponent<
) }) + +function parseFileList(fileList: FileList): Array { + return Array.prototype.slice.call(fileList).sort(fileComparator) +} diff --git a/packages/ui/src/components/file-upload/file-upload-button/stories/file-upload-button-default.stories.tsx b/packages/ui/src/components/file-upload/file-upload-button/stories/file-upload-button-default.stories.tsx index 9e8093ead..61ff7ac6d 100644 --- a/packages/ui/src/components/file-upload/file-upload-button/stories/file-upload-button-default.stories.tsx +++ b/packages/ui/src/components/file-upload/file-upload-button/stories/file-upload-button-default.stories.tsx @@ -59,8 +59,8 @@ export const Loading = function () { } export const LoadingFocused = function () { - function handleSelectedFiles(files: Array) { - console.log(files) + function handleSelectedFiles() { + throw new Error('This function should not be called') } return ( ) { - console.log(files) + function handleSelectedFiles() { + throw new Error('This function should not be called') } return ( (false) const handleBlur = useCallback( - function (event: Event.onBlur): void { + function (event: Event.onBlur) { onBlur(event) setIsDropActive(false) }, @@ -56,13 +56,16 @@ export const FileUploadDropzone = createComponent< ) const handleChange = useCallback( - function (event: Event.onChange): void { + function (event: Event.onChange) { onChange(event) - const files = event.currentTarget.files - if (files === null) { + const fileList = event.currentTarget.files + if (fileList === null) { throw new Error('`event.currentTarget.files` is `null`') } - onSelectedFiles(filterFiles({ acceptedFileTypes, files })) + const files = parseFileList({ acceptedFileTypes, fileList }) + if (files.length > 0) { + onSelectedFiles(files) + } }, [acceptedFileTypes, onChange, onSelectedFiles] ) @@ -76,7 +79,7 @@ export const FileUploadDropzone = createComponent< ) const handleDragOver = useCallback( - function (event: Event.onDragOver): void { + function (event: Event.onDragOver) { onDragOver(event) event.preventDefault() setIsDropActive(true) @@ -85,7 +88,7 @@ export const FileUploadDropzone = createComponent< ) const handleDragEnd = useCallback( - function (event: Event.onDragEnd): void { + function (event: Event.onDragEnd) { onDragEnd(event) event.preventDefault() setIsDropActive(false) @@ -94,30 +97,32 @@ export const FileUploadDropzone = createComponent< ) const handleDrop = useCallback( - function (event: Event.onDrop): void { + function (event: Event.onDrop) { onDrop(event) if (event.dataTransfer === null) { throw new Error('`event.dataTransfer` is `null`') } event.preventDefault() - const files = event.dataTransfer.files - onSelectedFiles(filterFiles({ acceptedFileTypes, files })) + const fileList = event.dataTransfer.files + const files = parseFileList({ acceptedFileTypes, fileList }) + if (files.length > 0) { + onSelectedFiles(files) + } setIsDropActive(false) }, [acceptedFileTypes, onDrop, onSelectedFiles] ) const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] @@ -158,12 +163,12 @@ export const FileUploadDropzone = createComponent< ) }) -function filterFiles(options: { - files: FileList +function parseFileList(options: { + fileList: FileList acceptedFileTypes: Array }): Array { - const { files, acceptedFileTypes } = options - const result = Array.prototype.slice.call(files).sort(fileComparator) + const { fileList, acceptedFileTypes } = options + const result = Array.prototype.slice.call(fileList).sort(fileComparator) if (acceptedFileTypes.length === 0) { return result } diff --git a/packages/ui/src/components/icon-button/icon-button.tsx b/packages/ui/src/components/icon-button/icon-button.tsx index aaf146297..ca685cfb2 100644 --- a/packages/ui/src/components/icon-button/icon-button.tsx +++ b/packages/ui/src/components/icon-button/icon-button.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { useCallback } from 'preact/hooks' import { Event, EventHandler } from '../../types/event-handler.js' @@ -26,18 +26,17 @@ export const IconButton = createComponent( ...rest }, ref - ): JSX.Element { + ) { const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] @@ -49,8 +48,8 @@ export const IconButton = createComponent( ref={ref} class={styles.iconButton} disabled={disabled === true} - onClick={disabled === true ? undefined : onClick} - onKeyDown={disabled === true ? undefined : handleKeyDown} + onClick={onClick} + onKeyDown={handleKeyDown} tabIndex={0} >
{children}
diff --git a/packages/ui/src/components/icon-toggle-button/icon-toggle-button.tsx b/packages/ui/src/components/icon-toggle-button/icon-toggle-button.tsx index 07d537e14..c884511ea 100644 --- a/packages/ui/src/components/icon-toggle-button/icon-toggle-button.tsx +++ b/packages/ui/src/components/icon-toggle-button/icon-toggle-button.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { useCallback } from 'preact/hooks' import { Event, EventHandler } from '../../types/event-handler.js' @@ -33,26 +33,26 @@ export const IconToggleButton = createComponent< ...rest }, ref -): JSX.Element { +) { const handleChange = useCallback( - function (event: Event.onChange): void { - onValueChange(!(value === true)) + function (event: Event.onChange) { onChange(event) + const newValue = event.currentTarget.checked === true + onValueChange(newValue) }, - [onChange, onValueChange, value] + [onChange, onValueChange] ) const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] @@ -72,7 +72,7 @@ export const IconToggleButton = createComponent< class={styles.input} disabled={disabled === true} onChange={handleChange} - onKeyDown={disabled === true ? undefined : handleKeyDown} + onKeyDown={handleKeyDown} tabIndex={0} type="checkbox" /> diff --git a/packages/ui/src/components/layer/layer.tsx b/packages/ui/src/components/layer/layer.tsx index e80f148db..841bae153 100644 --- a/packages/ui/src/components/layer/layer.tsx +++ b/packages/ui/src/components/layer/layer.tsx @@ -1,4 +1,4 @@ -import { ComponentChildren, h, JSX } from 'preact' +import { ComponentChildren, h } from 'preact' import { useCallback } from 'preact/hooks' import { Event, EventHandler } from '../../types/event-handler.js' @@ -35,9 +35,9 @@ export const Layer = createComponent(function ( ...rest }, ref -): JSX.Element { +) { const handleChange = useCallback( - function (event: Event.onChange): void { + function (event: Event.onChange) { onChange(event) const newValue = event.currentTarget.checked === true onValueChange(newValue) @@ -46,16 +46,15 @@ export const Layer = createComponent(function ( ) const handleKeyDown = useCallback( - function (event: Event.onKeyDown): void { + function (event: Event.onKeyDown) { onKeyDown(event) - if (event.key !== 'Escape') { - return - } - if (propagateEscapeKeyDown === false) { - event.stopPropagation() - } - if (blurOnEscapeKeyDown === true) { - event.currentTarget.blur() + if (event.key === 'Escape') { + if (propagateEscapeKeyDown === false) { + event.stopPropagation() + } + if (blurOnEscapeKeyDown === true) { + event.currentTarget.blur() + } } }, [blurOnEscapeKeyDown, onKeyDown, propagateEscapeKeyDown] diff --git a/packages/ui/src/components/layer/stories/layer-selected.stories.tsx b/packages/ui/src/components/layer/stories/layer-selected.stories.tsx index fedbaa305..2d4b4be17 100644 --- a/packages/ui/src/components/layer/stories/layer-selected.stories.tsx +++ b/packages/ui/src/components/layer/stories/layer-selected.stories.tsx @@ -57,7 +57,6 @@ export const Bold = function () { return ( } onChange={handleChange} value={value} diff --git a/packages/ui/src/components/layer/stories/layer-unselected.stories.tsx b/packages/ui/src/components/layer/stories/layer-unselected.stories.tsx index c1d89e251..b086c218b 100644 --- a/packages/ui/src/components/layer/stories/layer-unselected.stories.tsx +++ b/packages/ui/src/components/layer/stories/layer-unselected.stories.tsx @@ -57,7 +57,6 @@ export const Bold = function () { return ( } onChange={handleChange} value={value} diff --git a/packages/ui/src/components/loading-indicator/loading-indicator.tsx b/packages/ui/src/components/loading-indicator/loading-indicator.tsx index eb4a1dd92..b227f9421 100644 --- a/packages/ui/src/components/loading-indicator/loading-indicator.tsx +++ b/packages/ui/src/components/loading-indicator/loading-indicator.tsx @@ -1,4 +1,4 @@ -import { h, JSX } from 'preact' +import { h } from 'preact' import { IconColor } from '../../types/colors.js' import { createComponent } from '../../utilities/create-component.js' @@ -11,7 +11,7 @@ export type LoadingIndicatorProps = { export const LoadingIndicator = createComponent< HTMLDivElement, LoadingIndicatorProps ->(function ({ color, ...rest }, ref): JSX.Element { +>(function ({ color, ...rest }, ref) { return (
+ transition?: boolean + onCloseButtonClick?: EventHandler.onClick onEscapeKeyDown?: (event: KeyboardEvent) => void - onOverlayClick?: JSX.MouseEventHandler + onOverlayClick?: EventHandler.onClick position?: ModalPosition title?: string } @@ -26,33 +28,36 @@ export type ModalPosition = 'bottom' | 'center' | 'left' | 'right' const rootElements: Array = [] // Stack of currently-open modals -export const Modal = function ({ - children, - closeButtonIcon = , - closeButtonPosition = 'right', - open, - noTransition = false, - onCloseButtonClick, - onEscapeKeyDown, - onOverlayClick, - position = 'center', - title, - ...rest -}: ModalProps): null { +export const Modal = createComponent(function ( + { + children, + closeButtonIcon = , + closeButtonPosition = 'right', + open, + transition = true, + onCloseButtonClick, + onEscapeKeyDown, + onOverlayClick, + position = 'center', + title, + ...rest + }, + ref +): null { const rootElementRef: RefObject = useRef(null) const previousFocusedElementRef: RefObject = useRef(null) - useEffect(function (): () => void { + useEffect(function () { const rootElement = document.createElement('div') document.body.appendChild(rootElement) rootElementRef.current = rootElement - return function (): void { + return function () { document.body.removeChild(rootElement) } }, []) useEffect( - function (): () => void { + function () { if (rootElementRef.current === null) { throw new Error('`rootElementRef.current` is `null`') } @@ -65,7 +70,7 @@ export const Modal = function ({ } } window.addEventListener('keydown', handleTabKeyDown) - return function (): void { + return function () { window.removeEventListener('keydown', handleTabKeyDown) } }, @@ -73,7 +78,7 @@ export const Modal = function ({ ) useEffect( - function (): () => void { + function () { function handleEscapeKeyDown(event: KeyboardEvent) { if ( open === false || @@ -86,7 +91,7 @@ export const Modal = function ({ onEscapeKeyDown(event) } window.addEventListener('keydown', handleEscapeKeyDown) - return function (): void { + return function () { window.removeEventListener('keydown', handleEscapeKeyDown) } }, @@ -94,7 +99,7 @@ export const Modal = function ({ ) useEffect( - function (): () => void { + function () { if (rootElementRef.current === null) { throw new Error('`rootElementRef.current` is `null`') } @@ -126,7 +131,7 @@ export const Modal = function ({ rootElements.pop() rootElementRef.current.style.cssText = 'position:static' } - return function (): void { + return function () { if (previousFocusedElementRef.current !== null) { previousFocusedElementRef.current.focus() } @@ -136,7 +141,22 @@ export const Modal = function ({ ) useEffect( - function (): void { + function () { + if (ref === null) { + return + } + const rootElement = rootElementRef.current + if (typeof ref === 'function') { + ref(rootElement) + return + } + ref.current = rootElement + }, + [ref] + ) + + useEffect( + function () { if (rootElementRef.current === null) { throw new Error('`rootElementRef.current` is `null`') } @@ -147,7 +167,7 @@ export const Modal = function ({ class={createClassName([ styles.modal, open === true ? styles.open : null, - noTransition === true ? styles.noTransition : null, + transition === false ? styles.noTransition : null, styles[position] ])} > @@ -192,15 +212,15 @@ export const Modal = function ({ children, closeButtonIcon, closeButtonPosition, - noTransition, onCloseButtonClick, onOverlayClick, open, position, rest, - title + title, + transition ] ) return null -} +}) diff --git a/packages/ui/src/components/modal/stories/modal-bottom.stories.tsx b/packages/ui/src/components/modal/stories/modal-bottom.stories.tsx index 9e5d69fd0..7caec00a3 100644 --- a/packages/ui/src/components/modal/stories/modal-bottom.stories.tsx +++ b/packages/ui/src/components/modal/stories/modal-bottom.stories.tsx @@ -42,7 +42,7 @@ export const Default = function () { ) } -export const NoTransition = function () { +export const TransitionFalse = function () { const [open, setOpen] = useState(false) function handleOpenButtonClick( event: JSX.TargetedMouseEvent @@ -60,7 +60,7 @@ export const NoTransition = function () { return ( - +
- +
- +
- +