ui: clean up prop spreading in Flex story DecorativeBox component

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2026-04-16 15:36:33 +01:00
parent c97b9e1f73
commit 36aff3305c
@@ -40,7 +40,12 @@ const meta = preview.meta({
args: { children: null },
});
const DecorativeBox = (props: Omit<BoxProps, 'children'>) => {
const DecorativeBox = ({
width = '48px',
height = '48px',
style,
...props
}: Omit<BoxProps, 'children'>) => {
const diagonalStripePattern = (() => {
const svg = `
<svg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg">
@@ -54,9 +59,11 @@ const DecorativeBox = (props: Omit<BoxProps, 'children'>) => {
return (
<Box
width={props.width ?? '48px'}
height={props.height ?? '48px'}
{...props}
width={width}
height={height}
style={{
...style,
background: '#eaf2fd',
borderRadius: '4px',
border: '1px solid #2563eb',
@@ -67,7 +74,6 @@ const DecorativeBox = (props: Omit<BoxProps, 'children'>) => {
fontWeight: 'bold',
color: '#2563eb',
}}
{...props}
children={null}
/>
);