@wix/design-system
Version:
@wix/design-system
76 lines (66 loc) • 2.35 kB
TypeScript
import * as React from 'react';
import SidebarBackButton from '../SidebarBackButton';
export interface SidebarProps {
/** Sidebar menu children */
children?: React.ReactNode;
/** classNames overrides */
classNames?: SidebarClassNames;
/** The dataHook of the Sidebar */
dataHook?: string;
/** Sidebar indicator for animating out or in
* @default false
*/
isHidden?: boolean;
/** Sets the skin of the Sidebar */
skin?: SidebarSkin;
selectedKey?: string;
}
export type SidebarSkin = 'dark' | 'light';
export type SidebarClassNames = {
sideBar?: string;
content?: string;
slider?: string;
sliderOutToLeft?: string;
sliderOutToRight?: string;
sliderInFromLeft?: string;
sliderInFromRight?: string;
};
export class SidebarItem extends React.PureComponent<SidebarItemProps> {}
interface SidebarItemProps {
/** Sidebar menu children */
children?: React.ReactNode;
itemKey?: string;
innerMenu?: React.ReactNode[];
disable?: boolean;
onClick?: (itemKey: string, e: React.MouseEvent<HTMLElement>) => void;
}
export class SidebarPersistentHeader extends React.Component<SidebarPersistentHeaderProps> {}
interface SidebarPersistentHeaderProps {}
export class SidebarPersistentFooter extends React.Component<SidebarPersistentFooterProps> {}
interface SidebarPersistentFooterProps {}
export class SidebarContextConsumer extends React.Component<SidebarContextConsumerProps> {}
interface SidebarContextConsumerProps {
/** Sidebar menu children */
children(renderProps: {
itemClicked: (itemKey: string) => void;
backClicked: () => void;
getSelectedKey: () => string;
getSkin: () => SidebarSkin;
getIsMenuExpanded: () => boolean;
}): React.ReactNode;
}
export class SidebarItemContextConsumer extends React.Component<SidebarItemContextConsumerProps> {}
interface SidebarItemContextConsumerProps {
/** Sidebar menu children */
children(renderProps: {
selected: () => boolean;
getIsMenuExpanded: () => boolean;
}): React.ReactNode;
}
export default class Sidebar extends React.Component<SidebarProps> {
static Item: typeof SidebarItem;
static PersistentHeader: typeof SidebarPersistentHeader;
static PersistentFooter: typeof SidebarPersistentFooter;
static BackButton: typeof SidebarBackButton;
setSelectedKey: (setSelectedKey: string) => void;
}