// // Copyright 2023 DXOS.org // import { type Decorator } from '@storybook/react-vite'; import React, { type ComponentType, type PropsWithChildren } from 'react'; import { mx, surfaceShadow } from '@dxos/ui-theme'; import { type Density, type Elevation, type ThemedClassName } from '@dxos/ui-types'; type Config = ThemedClassName<{ elevations?: { elevation: Elevation; surface?: string }[]; densities?: Density[]; }>; const Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (
{children}
); const Panel = ({ Story, classNames, elevations, densities }: ThemedClassName<{ Story: ComponentType } & Config>) => { return (
{elevations?.map(({ elevation, surface }) => densities?.map((density) => ( )), )}
); }; export const withLayoutVariants = ({ classNames, densities = ['md'], elevations = [ { elevation: 'dialog', surface: 'dx-modal-surface', }, { elevation: 'positioned', surface: 'dx-card-surface', }, { elevation: 'base', surface: 'dx-base-surface', }, ], }: Config = {}): Decorator => { return (Story) => ; };