import type { JSX } from './components'; type Optional = Partial> & Omit; /** * See https://github.com/Sidnioulz/storybook-addon-tag-badges for customizing * the Badges. Any changes requires additional styles in the blazor storybook * at blazor/BlazingStory/BlazingStory/Internals/Components/SideBar/NavigationTree/TagBadges.razor.scss * Make sure to reflect any changes in the documentation as well. docs/feature-flags.md * Also update the storybook manager.ts file in the respective packages: * - packages/angular/.storybook/manager.ts * - packages/react/.storybook/manager.ts * - packages/vue/.storybook/manager.ts * - packages/native/.storybook/manager.ts */ export type NovaBadge = 'new' | 'beta' | 'deprecated' | 'danger'; export type NovaTemplate = string; export type NovaComponent = keyof JSX.IntrinsicElements; export type NovaDocs = T extends NovaTemplate ? Omit, 'component'> : NovaDocsGeneric; /** * Generic Interface for the NovaDocs object */ export interface NovaDocsGeneric { /** * Will not render the component in storybook, useful for composed components */ skip?: boolean; /** * Add a badge to the sidebar in storybook group */ badge?: NovaBadge; /** * Parent grouping name for organizing related components together. * When set, creates a hierarchy under components: "components/parent-component/sub-component" * Use the parent component name (e.g., 'nv-breadcrumbs') to group child components. * Example: parentGroup: 'nv-breadcrumbs' creates "components/nv-breadcrumbs/nv-breadcrumb" */ parentGroup?: string; /** * Tag name of the component */ component: T extends NovaTemplate ? undefined : NovaComponent; /** * List of components that will be rendered inside the component's docs, * required for correct imports */ subcomponents?: Array; /** * List of components that will be used for composition. Will render * additional docs tabs with props etc. for them. */ composedComponents?: Array; /** * Each item will be rendered as a story in each storybook. */ stories?: Array< { /** * Name of the story */ name: string; /** * Add a badge to the sidebar in individual story */ badge?: NovaBadge; /** * Props to pass to the component */ args?: T extends NovaTemplate ? undefined : Partial; /** * Template to render the component with the args passed in the story args * object above (optional) */ template: JSX.Element; /** * Skips rendering the source code for the story, useful for very long * lists of elements that demo the component, and improves performance */ disableSource?: boolean; } & StoryDescription >; } type StoryDescription = T extends NovaTemplate ? { /** * Description of the story, required for template stories */ description: string; } : { /** * Description of the story, leave blank to automatically infer from prop * descriptions */ description?: string; /** * If the description is not provided, infer it from the prop descriptions * from another component (for example child components that are described * in the parent story, see nv-dialog as an example) */ descriptionSource?: NovaComponent; };