UNPKG

@combine-labs/combine-polaris

Version:

Combine Lab's product component library. Forked from Shopify's Polaris.

64 lines (63 loc) 2.56 kB
/// <reference types="react" /> import { ActionListItemDescriptor, IconableAction, DisableableAction, BadgeAction, LoadableAction, DestructableAction } from '../../types'; import { PaginationDescriptor } from '../Pagination'; import { Props as BreadcrumbProps } from '../Breadcrumbs'; export declare type SecondaryAction = IconableAction & DisableableAction; export interface ActionGroup extends BadgeAction { /** Action group title */ title: string; /** Icon to display */ icon?: IconableAction['icon']; /** List of actions */ actions: ActionListItemDescriptor[]; /** Action details */ details?: React.ReactNode; /** Callback when any action takes place */ onActionAnyItem?: ActionListItemDescriptor['onAction']; } export interface ActionProps { children?: string; disclosure?: boolean; url?: IconableAction['url']; external?: IconableAction['external']; icon?: IconableAction['icon']; onAction?: IconableAction['onAction']; accessibilityLabel?: IconableAction['accessibilityLabel']; disabled?: DisableableAction['disabled']; showIndicator?: boolean; hasIndicator?: boolean; } export interface PrimaryActionProps extends DisableableAction, LoadableAction, DestructableAction { /** Provides extra visual weight and identifies the primary action in a set of buttons */ primary?: boolean; } export interface HeaderProps { /** Page title, in large type */ title: string; /** Important and non-interactive status information shown immediately after the title. */ titleMetadata?: React.ReactNode; /** Visually hide the title */ titleHidden?: boolean; /** App icon, for pages that are part of Shopify apps */ icon?: string; /** Collection of breadcrumbs */ breadcrumbs?: BreadcrumbProps['breadcrumbs']; /** Adds a border to the bottom of the page header */ separator?: boolean; /** Collection of secondary page-level actions */ secondaryActions?: SecondaryAction[]; /** Collection of page-level groups of secondary actions */ actionGroups?: ActionGroup[]; /** Primary page-level action */ primaryAction?: PrimaryActionProps; /** Page-level pagination */ pagination?: PaginationDescriptor; } export interface PageProps extends HeaderProps { /** The contents of the page */ children?: React.ReactNode; /** Remove the normal max-width on the page */ fullWidth?: boolean; /** Decreases the maximum layout width. Intended for single-column layouts */ singleColumn?: boolean; }