import styled from '@emotion/styled' import { useRef } from 'react' import useResizeObserver from 'use-resize-observer' import { GlobalStyles } from '@/styles' const Wrapper = styled.div` padding: 10px; height: calc(100vh - 20px); & > * + * { margin-left: 15px; } ` const StylesWrapperDecorator = (styleFn) => { const ref = useRef(null) const { width, height } = useResizeObserver({ ref, box: 'border-box' }) return (
{width}px x {height}px
{styleFn()}
) } export const decorators = [StylesWrapperDecorator] export const parameters = { actions: { argTypesRegex: '^on[A-Z].*' }, options: { storySort: (a, b) => (a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true })), }, }