// // Copyright 2023 DXOS.org // import { type Decorator } from '@storybook/react'; import React, { type ComponentType, type PropsWithChildren } from 'react'; import { mx, surfaceShadow } from '@dxos/react-ui-theme'; import { type Density, type Elevation } from '@dxos/react-ui-types'; type Config = { elevations?: { elevation: Elevation; surface?: string }[]; densities?: Density[]; }; const Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (
{children}
); const Panel = ({ Story, elevations, densities, className, }: { Story: ComponentType } & Config & { className?: string }) => (
{elevations?.map(({ elevation, surface }) => densities?.map((density) => ( )), )}
); export const withSurfaceVariantsLayout = ({ elevations = [ { elevation: 'base', surface: 'bg-baseSurface' }, { elevation: 'positioned', surface: 'bg-cardSurface' }, { elevation: 'dialog', surface: 'bg-modalSurface' }, ], densities = ['coarse'], }: Config = {}): Decorator => { return (Story) => (
); };