diff --git a/docs/src/app/@theme/services/tabbed.service.ts b/docs/src/app/@theme/services/tabbed.service.ts
index 9b2b3e828..3ef923293 100644
--- a/docs/src/app/@theme/services/tabbed.service.ts
+++ b/docs/src/app/@theme/services/tabbed.service.ts
@@ -45,6 +45,10 @@ export class NgdTabbedService {
return component.types && component.types.length > 0;
}
+ componentHasParams(component: any): boolean {
+ return component.params && component.params.length > 0;
+ }
+
componentHasMethods(component): boolean {
return component &&
component.methods &&
diff --git a/docs/src/app/blocks/blocks.module.ts b/docs/src/app/blocks/blocks.module.ts
index ba9c25961..372fb0e59 100644
--- a/docs/src/app/blocks/blocks.module.ts
+++ b/docs/src/app/blocks/blocks.module.ts
@@ -31,6 +31,7 @@ import {
NgdPagerBlockComponent,
NgdComponentsOverviewBlockComponent,
NgdTypesBlockComponent,
+ NgdHocParamsBlockComponent,
} from './components/';
const blocks = [
@@ -55,6 +56,7 @@ const blocks = [
NgdPagerBlockComponent,
NgdComponentsOverviewBlockComponent,
NgdTypesBlockComponent,
+ NgdHocParamsBlockComponent,
];
@NgModule({
diff --git a/docs/src/app/blocks/components/api-block/api-block.component.ts b/docs/src/app/blocks/components/api-block/api-block.component.ts
index 753f242bb..67d87ef50 100644
--- a/docs/src/app/blocks/components/api-block/api-block.component.ts
+++ b/docs/src/app/blocks/components/api-block/api-block.component.ts
@@ -20,6 +20,7 @@ import { NgdTabbedService } from '../../../@theme/services';
+
`,
@@ -44,4 +45,8 @@ export class NgdApiBlockComponent {
hasTypes(component): boolean {
return this.tabbedService.componentHasTypes(component);
}
+
+ hasParams(component: any): boolean {
+ return this.tabbedService.componentHasParams(component);
+ }
}
diff --git a/docs/src/app/blocks/components/hoc-params-block/hoc-params-block.component.ts b/docs/src/app/blocks/components/hoc-params-block/hoc-params-block.component.ts
new file mode 100644
index 000000000..4b32e3c57
--- /dev/null
+++ b/docs/src/app/blocks/components/hoc-params-block/hoc-params-block.component.ts
@@ -0,0 +1,39 @@
+/**
+ * @license
+ * Copyright Akveo. All Rights Reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ */
+
+import {
+ ChangeDetectionStrategy,
+ Component,
+ Input,
+} from '@angular/core';
+import { NgdMetadataService } from '../../../@theme/services';
+
+@Component({
+ selector: 'ngd-hoc-params-block',
+ template: `
+ 0"
+ [properties]="params"
+ name="Parameters"
+ [slag]="slag"
+ class="widget-block">
+
+ `,
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class NgdHocParamsBlockComponent {
+ slag: string;
+
+ params: any[] = [];
+
+ @Input('source')
+ set setSource(source: any) {
+ this.params = source.params;
+ this.slag = source.slag;
+ }
+
+ constructor(private metadataService: NgdMetadataService) {
+ }
+}
diff --git a/docs/src/app/blocks/components/index.ts b/docs/src/app/blocks/components/index.ts
index df50cc121..1fdce1ffc 100644
--- a/docs/src/app/blocks/components/index.ts
+++ b/docs/src/app/blocks/components/index.ts
@@ -19,3 +19,4 @@ export * from './examples-block/examples-block.component';
export * from './pager-block/pager-block.component';
export * from './components-overview-block/components-overview-block.component';
export * from './types-block/types-block.component';
+export * from './hoc-params-block/hoc-params-block.component';
diff --git a/docs/src/app/blocks/components/overview-block/overview-block.component.ts b/docs/src/app/blocks/components/overview-block/overview-block.component.ts
index 7d5560585..aa994e4c6 100644
--- a/docs/src/app/blocks/components/overview-block/overview-block.component.ts
+++ b/docs/src/app/blocks/components/overview-block/overview-block.component.ts
@@ -31,22 +31,7 @@ export class NgdOverviewBlockComponent {
@Input('source')
set setSource(source: any) {
- this.source = this.prepareDescription(source);
+ this.source = source;
}
- private prepareDescription(source: any): any {
- const description: string = source.description;
- source.description = description
- .replace(/./g, (character: string, index: number) => {
- if (index === description.indexOf('`')) {
- return '';
- } else if (index === description.lastIndexOf('`')) {
- return '';
- } else {
- return character;
-
- }
- });
- return source;
- }
}
diff --git a/docs/src/guides/theme-switching.md b/docs/src/guides/theme-switching.md
new file mode 100644
index 000000000..49a4d749b
--- /dev/null
+++ b/docs/src/guides/theme-switching.md
@@ -0,0 +1,55 @@
+# React Native UI Kitten Theme Switching
+
+React Native UI Kitten Theme System allows the developer to change the theme.
+To do this, it is enough to replace the configuration object of the `theme` and pass it
+through the property into the `ApplicationProvider`.
+
+
+
+### Changing Theme Example
+
+```tsx
+import { mapping } from '@eva/eva';
+import { theme } from '@eva/theme-eva';
+import { customTheme } from './path-to/custom-theme;
+import {
+ ApplicationProvider,
+ ThemeType,
+} from '@kitten/theme';
+import { Application } from './path-to/root.component';
+
+interface AppState {
+ theme: ThemeType;
+}
+
+export default class App extends React.Component {
+
+ public state: State = {
+ theme: theme,
+ };
+
+ private changeTheme = (): void => {
+ this.setState({ theme: customTheme });
+ }
+
+ public render(): React.ReactNode {
+ return (
+
+
+
+ );
+ }
+}
+```
+
+
+
+### Other theme management options
+
+This is not the only way to change the `theme` of the application. It is also possible to use one of the libraries that provide state management services, such as:
+
+- [MobX](https://mobx.js.org/getting-started.html)
+- [Redux](https://redux.js.org/)
+
diff --git a/docs/src/structure.ts b/docs/src/structure.ts
index f52193832..7bacd87cd 100644
--- a/docs/src/structure.ts
+++ b/docs/src/structure.ts
@@ -75,6 +75,17 @@ export const structure = [
},
],
},
+ {
+ type: 'page',
+ name: 'Theme Switching',
+ children: [
+ {
+ type: 'block',
+ block: 'markdown',
+ source: 'theme-switching.md',
+ },
+ ],
+ },
],
},
{
@@ -91,6 +102,34 @@ export const structure = [
},
],
},
+ {
+ type: 'group',
+ name: 'Styling & Theming',
+ },
+ {
+ type: 'tabs',
+ name: 'ApplicationProvider',
+ icon: 'layout.svg',
+ source: [
+ 'ApplicationProvider',
+ ],
+ },
+ {
+ type: 'tabs',
+ name: 'styled',
+ icon: 'layout.svg',
+ source: [
+ 'styled',
+ ],
+ },
+ {
+ type: 'tabs',
+ name: 'withStyles',
+ icon: 'layout.svg',
+ source: [
+ 'withStyles',
+ ],
+ },
{
type: 'group',
name: 'Global',
@@ -171,6 +210,14 @@ export const structure = [
'Radio',
],
},
+ {
+ type: 'tabs',
+ name: 'RadioGroup',
+ icon: 'radio.svg',
+ source: [
+ 'RadioGroup',
+ ],
+ },
{
type: 'tabs',
name: 'Toggle',
diff --git a/src/framework/theme/application/applicationProvider.component.tsx b/src/framework/theme/application/applicationProvider.component.tsx
index cc63423db..666290a5f 100644
--- a/src/framework/theme/application/applicationProvider.component.tsx
+++ b/src/framework/theme/application/applicationProvider.component.tsx
@@ -33,20 +33,20 @@ interface State {
* The `ApplicationProvider` component is designed to be a root of the application.
*
* This does basically two things:
- * - Provides styles for react-native-ui-kitten basic components (e.g `Button`);
+ * - Provides styles for react-native-ui-kitten basic components (e.g 'Button');
* - Renders modal window which is used to be common for all elements presented as modal;
*
* @extends React.Component
*
* @property {SchemaType} mapping - Determines the mapping for basic components.
- * This is designed to be provided by developers team and can be imported from npm package (e.g `@eva/eva`).
+ * This is designed to be provided by developers team and can be imported from npm package (e.g. `@eva/eva`).
*
* @property {CustomSchemaType} customMapping - Determines the customization mapping.
* This is merged with `mapping` property and designed to be used components customization.
* Optional.
*
* @property {ThemeType} theme - Determines the theme for basic components.
- * This is designed to be provided by developers team and can be imported from npm package (e.v `@eva/theme-eva`).
+ * This is designed to be provided by developers team and can be imported from npm package (e.g. `@eva/theme-eva`).
*
* @property {React.ReactNode} children - Determines application root component.
*
diff --git a/src/framework/theme/style/styleConsumer.component.tsx b/src/framework/theme/style/styleConsumer.component.tsx
index 894632556..1cf2f0036 100644
--- a/src/framework/theme/style/styleConsumer.component.tsx
+++ b/src/framework/theme/style/styleConsumer.component.tsx
@@ -43,17 +43,19 @@ export type StyledComponentClass
= React.ComponentClass void} - Determines function
* for dispatching current state of component. This is designed to be used as style request function.
* Calls component re-render if style for requested state differ from current.
*
- * @param {React.ComponentClass} Component - Determines class of component to be styled.
+ * @param Component - Type: {React.ComponentClass}. Determines class of component to be styled.
*
* @example Declaring Styled Component
*
@@ -115,8 +117,8 @@ export type StyledComponentClass
= React.ComponentClass {
@@ -125,8 +127,6 @@ export type StyledComponentClass