UNPKG

@prosperitainova/dumbo-react-native

Version:
79 lines 3.16 kB
import React from 'react'; import { ViewProps, StyleProp, ViewStyle, GestureResponderEvent } from 'react-native'; import { TextBreakModes, TextTypes } from '../Text'; import type { CarbonIcon } from 'src/types/shared'; /** Item to show in the UiPanel */ export type UiPanelNestedItem = { /** Name of the navigation item to render */ text: string; /** Break mode for text. Default is to wrap text */ textBreakMode?: TextBreakModes; /** Text type to render (Standard is default. Normally only body 01 or 02 should be used) */ textType?: TextTypes; /** Left icon to render (size 20) */ leftIcon?: CarbonIcon; /** Right icon to render (size 20) */ rightIcon?: CarbonIcon; /** onPress event */ onPress?: (event: GestureResponderEvent) => void; /** onLongPress event */ onLongPress?: (event: GestureResponderEvent) => void; /** Indicate if the item should be hidden */ hidden?: boolean; /** Indicate if the item should be disabled */ disabled?: boolean; /** Style to set on the item */ style?: StyleProp<ViewStyle>; /** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */ componentProps?: ViewProps; }; /** Props for UiPanelItem component */ export type UiPanelItemProps = { /** Name of the item to render */ text: string; /** Break mode for text. Default is to wrap text */ textBreakMode?: TextBreakModes; /** Text type to render (Standard is default. Normally only body 01 or 02 should be used) */ textType?: TextTypes; /** Left icon to render (size 20) */ leftIcon?: CarbonIcon; /** Right icon to render (size 20) */ rightIcon?: CarbonIcon; /** Nested items to render */ children?: UiPanelNestedItem[]; /** onPress event */ onPress?: (event: GestureResponderEvent) => void; /** onLongPress event */ onLongPress?: (event: GestureResponderEvent) => void; /** Callback when item pressed with no children */ noChildrenPressCallback?: () => void; /** Indicate if the item should be expanded on page load */ openOnLoad?: boolean; /** Indicate if the item should be hidden */ hidden?: boolean; /** Indicate if the item should be disabled */ disabled?: boolean; /** Style to set on the item */ style?: StyleProp<ViewStyle>; /** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */ componentProps?: ViewProps; }; /** * UiPanelItem component for rendering an item in the UI Panel * This is a child of UiPanel component * * {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/UiPanel.tsx | Example code} */ export declare class UiPanelItem extends React.Component<UiPanelItemProps> { state: { open: boolean; }; private itemColor; private get styles(); private pressParent; private getStateStyle; private get nestedItems(); componentDidMount(): void; render(): React.ReactNode; } //# sourceMappingURL=index.d.ts.map