import React from 'react'; const styles = { box: { height: '1rem', backgroundColor: '#718096', }, table: { tableLayout: 'auto' as 'auto', }, boxCell: { verticalAlign: 'middle', }, }; interface SpaceProps { /** The different spacing values to showcase. */ scale: (string | number)[] | Record; } /** With the Styleshowcase component you can render CSS custom properties showcases based on a prefix and a style key. */ export const Space = ({ scale }: SpaceProps) => { const scaleValues = ( Array.isArray(scale) ? (scale as any[]).map((s, i) => [i, s]) : Object.entries(scale) ).map(([k, v]) => [ `${k}`.trim().replace(/var\(|\)/gi, ''), typeof v === 'number' ? `${v}px` : v, ]); return ( {scaleValues.map(([name, value]) => ( ))}
Name Size
{name}
{value}
); };