Skip to content

Commit

Permalink
docs(ui): overview-examples add
Browse files Browse the repository at this point in the history
  • Loading branch information
32penkin authored Aug 21, 2019
1 parent 1b2211c commit 647f254
Show file tree
Hide file tree
Showing 37 changed files with 812 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface State {
}

/**
* ApplicationProvider component is designed to be a root of the application.
* `ApplicationProvider` component is designed to be a root of the application.
*
* This does basically two things:
* - Provides styles for basic components;
Expand All @@ -51,7 +51,7 @@ interface State {
*
* @property ThemeProviderProps
*
* @example ApplicationProvider API example
* @overview-example Simple Usage
*
* ```
* import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/modal/modal.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ModalPresentingBased } from '../../ui/support/typings';
*
* @method {(identifier: string, children: React.ReactNode) => void} update - Updates component from a modal window.
*
* @example Simple Usage example
* @example Simple Usage
*
* ```
* import React from 'react';
Expand Down
6 changes: 6 additions & 0 deletions src/framework/theme/style/style.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { ThemedStyleType } from '@eva-design/dss';
import { StyleType } from './type';
import { getThemeValue } from '../theme/theme.service';
Expand Down
6 changes: 3 additions & 3 deletions src/framework/theme/style/styleConsumer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ContextProps {
export type StyledComponentClass<P> = React.ComponentClass<StyledComponentProps & P>;

/**
* High Order Function which is used to apply style mapping on component.
* `styled` is a High Order Function which is used to apply style mapping on component.
*
* Requires component to have `styledComponentName` string property which defines
* corresponding component name in mapping. (e.g 'Button' for Button component).
Expand All @@ -57,7 +57,7 @@ export type StyledComponentClass<P> = React.ComponentClass<StyledComponentProps
*
* @param Component - Type: {React.ComponentClass}. Determines class or functional component to be styled.
*
* @example Declaring Styled Component
* @overview-example Declaring Styled Component
*
* ```
* import React from 'react';
Expand Down Expand Up @@ -111,7 +111,7 @@ export type StyledComponentClass<P> = React.ComponentClass<StyledComponentProps
* export const StyledButton = styled<StyledButtonProps>(Button);
* ```
*
* @example Styled Component Usage
* @overview-example Styled Component Usage
*
* ```
* import React from 'react';
Expand Down
6 changes: 6 additions & 0 deletions src/framework/theme/style/styleConsumer.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import {
ControlMetaType,
ControlThemedStyleType,
Expand Down
6 changes: 6 additions & 0 deletions src/framework/theme/theme/theme.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { ThemeType } from './type';

const SYMBOL_REFERENCE: string = '$';
Expand Down
11 changes: 6 additions & 5 deletions src/framework/theme/theme/themeConsumer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface Context {
export type ThemedComponentClass<P> = React.ComponentClass<ThemedComponentProps & P>;

/**
* High Order Function which is used to create themed style for non-styled component.
* `withStyles` is a High Order Function which is used to create themed style for non-styled component.
* Basically used when need to use theme variable somewhere.
* Returns component class which can be used as themed component.
*
Expand All @@ -45,7 +45,7 @@ export type ThemedComponentClass<P> = React.ComponentClass<ThemedComponentProps
*
* @param createStyles - Type: {(theme: ThemeType) => any}. Determines arrow function used to create styles.
*
* @example Declaring Themed Component
* @overview-example Declaring Themed Component
*
* ```
* import React from 'react';
Expand Down Expand Up @@ -76,13 +76,13 @@ export type ThemedComponentClass<P> = React.ComponentClass<ThemedComponentProps
* }));
* ```
*
* @example Themed Component Usage
* @overview-example Themed Component Usage
*
* ```
* import React from 'react';
* import {
* ThemedButton,
* ThemedButtonProps,
* ThemedButton,
* ThemedButtonProps,
* } from './path-to/themedButton.component';
*
* export const ThemedButtonShowcase = (props?: ThemedButtonProps): React.ReactElement<ThemedButtonProps> => {
Expand All @@ -92,6 +92,7 @@ export type ThemedComponentClass<P> = React.ComponentClass<ThemedComponentProps
* };
* ```
*/

export const withStyles = <P extends object>(Component: React.ComponentType<P>,
createStyles?: CreateStylesFunction): ThemedComponentClass<P> => {

Expand Down
6 changes: 6 additions & 0 deletions src/framework/theme/theme/themeContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import React from 'react';
import { ThemeType } from './type';

Expand Down
21 changes: 19 additions & 2 deletions src/framework/ui/avatar/avatar.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type AvatarProps = StyledComponentProps & ImageProps & ComponentProps;
export type AvatarElement = React.ReactElement<AvatarProps>;

/**
* Styled Image component.
* `Avatar` is a styled `Image` component.
*
* @extends React.Component
*
Expand All @@ -42,7 +42,7 @@ export type AvatarElement = React.ReactElement<AvatarProps>;
*
* @property StyledComponentProps
*
* @example Simple usage example
* @overview-example Simple Usage
*
* ```
* import React from 'react';
Expand All @@ -54,6 +54,23 @@ export type AvatarElement = React.ReactElement<AvatarProps>;
* );
* };
* ```
*
* @overview-example Eva Styling
*
* ```
* import React from 'react';
* import { Avatar, AvatarProps } from 'react-native-ui-kitten';
*
* export const AvatarShowcase = (props?: AvatarProps): React.ReactElement<AvatarProps> => {
* return (
* <Avatar
* source={{uri: 'https://path-to/awesome-image.png'}}
* size='large'
* shape='rounded'
* />
* );
* };
* ```
*/

export class AvatarComponent extends React.Component<AvatarProps> {
Expand Down
10 changes: 5 additions & 5 deletions src/framework/ui/bottomNavigation/bottomNavigation.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type BottomNavigationProps = StyledComponentProps & ViewProps & Component
export type BottomNavigationElement = React.ReactElement<BottomNavigationProps>;

/**
* BottomNavigation component is designed to be a Bottom Tab Bar.
* `BottomNavigation` component is designed to be a Bottom Tab Bar.
* Can be used for navigation.
*
* @extends React.Component
Expand All @@ -58,7 +58,7 @@ export type BottomNavigationElement = React.ReactElement<BottomNavigationProps>;
*
* @property StyledComponentProps
*
* @overview-example Simple usage example
* @overview-example Simple Usage
*
* ```
* import React from 'react';
Expand Down Expand Up @@ -88,7 +88,7 @@ export type BottomNavigationElement = React.ReactElement<BottomNavigationProps>;
* }
* ```
*
* @overview-example Without indicator
* @overview-example Without Indicator
*
* ```
* import React from 'react';
Expand Down Expand Up @@ -118,7 +118,7 @@ export type BottomNavigationElement = React.ReactElement<BottomNavigationProps>;
* }
* ```
*
* @example Inline styling example
* @example Inline Styling
*
* ```
* import React, { ReactElement } from 'react';
Expand All @@ -137,7 +137,7 @@ export type BottomNavigationElement = React.ReactElement<BottomNavigationProps>;
* };
* ```
*
* @example With React Navigation API and usage example
* @example With React Navigation
*
* ```
* import React, { ReactElement } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export type BottomNavigationTabProps = StyledComponentProps & TouchableOpacityPr
export type BottomNavigationTabElement = React.ReactElement<BottomNavigationTabProps>;

/**
* BottomNavigationTab component is a part of the BottomNavigation component.
* BottomNavigation tabs should be wrapped in BottomNavigation to provide usable component.
* See usage examples at BottomNavigation component documentation.
* `BottomNavigationTab` component is a part of the `BottomNavigation` component.
* `BottomNavigation` tabs should be wrapped in BottomNavigation to provide usable component.
* See usage examples at `BottomNavigation` component documentation.
*
* @extends React.Component
*
Expand Down
34 changes: 9 additions & 25 deletions src/framework/ui/button/button.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type ButtonProps = StyledComponentProps & TouchableOpacityProps & Compone
export type ButtonElement = React.ReactElement<ButtonProps>;

/**
* Styled Button component.
* Styled `Button` component.
*
* @extends React.Component
*
Expand Down Expand Up @@ -70,7 +70,7 @@ export type ButtonElement = React.ReactElement<ButtonProps>;
*
* @property StyledComponentProps
*
* @overview-example Simple usage example
* @overview-example Simple Usage
*
* ```
* import React from 'react';
Expand All @@ -93,7 +93,7 @@ export type ButtonElement = React.ReactElement<ButtonProps>;
* };
* ```
*
* @overview-example Eva-related props using example
* @overview-example Eva Styling
*
* ```
* import React from 'react';
Expand All @@ -119,27 +119,7 @@ export type ButtonElement = React.ReactElement<ButtonProps>;
* };
* ```
*
* @example Inline styling example
*
* ```
* import React from 'react';
* import {
* Button,
* ButtonProps,
* } from 'react-native-ui-kitten';
*
* export const ButtonShowcase = (props?: ButtonProps): React.ReactElement<ButtonProps> => {
* return (
* <Button
* style={styles.button}
* textStyle={styles.buttonText}>
* BUTTON
* </Button>
* );
* };
* ```
*
* @example Button with Icon usage example
* @example Inline Styling with Icon
*
* ```
* import React from 'react';
Expand All @@ -155,14 +135,18 @@ export type ButtonElement = React.ReactElement<ButtonProps>;
*
* const ButtonIcon = (style: ImageStyle): React.ReactElement<ImageProps> => {
* return (
* <Image style={style} source={{ uri: 'path/to/image' }}/>
* <Image
* style={style}
* source={{ uri: 'path/to/image' }}
* />
* );
* };
*
* export const ButtonShowcase = (props?: ButtonProps): React.ReactElement<ButtonProps> => {
* return (
* <Button
* style={styles.button}
* textStyle={styles.buttonText}
* icon={ButtonIcon}>
* BUTTON
* </Button>
Expand Down
23 changes: 21 additions & 2 deletions src/framework/ui/buttonGroup/buttonGroup.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type ButtonGroupProps = StyledComponentProps & ViewProps & ComponentProps
export type ButtonGroupElement = React.ReactElement<ButtonGroupProps>;

/**
* Renders a group of buttons.
* Renders a group of `Buttons`.
*
* @extends React.Component
*
Expand All @@ -51,7 +51,7 @@ export type ButtonGroupElement = React.ReactElement<ButtonGroupProps>;
*
* @property StyledComponentProps
*
* @example ButtonGroup usage example
* @overview-example Simple Usage
*
* ```
* import React from 'react';
Expand All @@ -67,6 +67,25 @@ export type ButtonGroupElement = React.ReactElement<ButtonGroupProps>;
* );
* };
* ```
*
* @overview-example Eva Styling
*
* ```
* import React from 'react';
* import { Button, ButtonGroup, ButtonGroupProps } from 'react-native-ui-kitten';
*
* export const ButtonGroupShowcase = (props?: ButtonGroupProps): React.ReactElement<ButtonGroupProps> => {
* return (
* <ButtonGroup
* size='large'
* status='warning'>
* <Button>Left</Button>
* <Button>Mid</Button>
* <Button>Right</Button>
* </ButtonGroup>
* );
* };
* ```
*/

class ButtonGroupComponent extends React.Component<ButtonGroupProps> {
Expand Down
Loading

0 comments on commit 647f254

Please sign in to comment.