Skip to content

Commit

Permalink
Merge branch 'next' into fix/modal-closing
Browse files Browse the repository at this point in the history
  • Loading branch information
32penkin committed Mar 7, 2019
2 parents 3099644 + 47a4ed7 commit 297887c
Show file tree
Hide file tree
Showing 47 changed files with 2,320 additions and 1,135 deletions.
102 changes: 79 additions & 23 deletions src/framework/theme/component/application/application.spec.config.ts
@@ -1,30 +1,77 @@
import { ThemeMappingType } from 'eva/packages/common';
import { ThemeMappingType } from 'eva/packages/types';
import { ThemeType } from '../../type';

export const mapping: ThemeMappingType = {
Test: {
meta: {
scope: 'mobile',
mapping: {
size: {
type: 'number',
},
innerSize: {
type: 'number',
},
borderWidth: {
type: 'number',
},
borderColor: {
type: 'color',
},
selectColor: {
type: 'color',
},
},
appearances: {
default: {
default: true,
},
custom: {
default: false,
},
},
variants: {
status: [
'success',
'info',
],
size: [
'small',
'big',
],
status: {
success: {
default: false,
},
info: {
default: false,
},
},
size: {
small: {
default: false,
},
medium: {
default: true,
},
large: {
default: false,
},
},
},
states: {
checked: {
default: false,
priority: 0,
scope: 'mobile',
},
disabled: {
default: false,
priority: 1,
scope: 'mobile',
},
active: {
default: false,
priority: 2,
scope: 'mobile',
},
},
states: [
'checked',
'disabled',
'active',
],
},
appearance: {
default: {
mapping: {
size: 36,
innerSize: 24,
borderWidth: 2,
borderColor: 'grayPrimary',
selectColor: 'transparent',
Expand Down Expand Up @@ -77,18 +124,24 @@ export const mapping: ThemeMappingType = {
},
},
size: {
big: {
mapping: {
size: 42,
innerSize: 28,
},
},
small: {
mapping: {
size: 30,
innerSize: 20,
},
},
medium: {
mapping: {
size: 36,
innerSize: 24,
},
},
large: {
mapping: {
size: 42,
innerSize: 28,
},
},
},
},
},
Expand All @@ -115,8 +168,11 @@ export const mapping: ThemeMappingType = {
},
Empty: {
meta: {
scope: 'mobile',
mapping: {},
appearances: {},
variants: {},
states: [],
states: {},
},
appearance: {},
},
Expand Down
Expand Up @@ -14,15 +14,15 @@ import {
} from './application.spec.config';
import {
ThemeMappingType,
ThemeMapType,
} from 'eva/packages/common';
ThemeStyleType,
} from 'eva/packages/types';
import { ThemeType } from '../../type';

describe('@app: application wrapper check', () => {

interface ApplicationState {
mapping: ThemeMappingType;
styles: ThemeMapType;
styles: ThemeStyleType;
theme: ThemeType;
}

Expand Down
@@ -1,8 +1,8 @@
import React from 'react';
import {
ThemeMappingType,
ThemeMapType,
} from 'eva/packages/common';
ThemeStyleType,
} from 'eva/packages/types';
import { MappingProviderProps } from '../mapping';
import { ThemeProviderProps } from '../theme';
import { ThemeType } from '../../type';
Expand All @@ -17,7 +17,7 @@ export type Props = MappingProviderProps & ThemeProviderProps & ApplicationProvi

interface State {
mapping: ThemeMappingType;
styles: ThemeMapType;
styles: ThemeStyleType;
theme: ThemeType;
}

Expand Down
6 changes: 3 additions & 3 deletions src/framework/theme/component/mapping/mapping.spec.tsx
Expand Up @@ -3,8 +3,8 @@ import { View } from 'react-native';
import { render } from 'react-native-testing-library';
import {
ThemeMappingType,
ThemeMapType,
} from 'eva/packages/common';
ThemeStyleType,
} from 'eva/packages/types';
import {
MappingContext,
MappingContextValueType,
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('@mapping: ui component checks', () => {

describe('* consumer', () => {
const mapping: ThemeMappingType = {};
const styles: ThemeMapType = {};
const styles: ThemeStyleType = {};

it('receives mapping prop', () => {

Expand Down
6 changes: 3 additions & 3 deletions src/framework/theme/component/mapping/mappingContext.ts
@@ -1,12 +1,12 @@
import React from 'react';
import {
ThemeMappingType,
ThemeMapType,
} from 'eva/packages/common';
ThemeStyleType,
} from 'eva/packages/types';

export interface MappingContextValueType {
mapping: ThemeMappingType;
styles: ThemeMapType;
styles: ThemeStyleType;
}

const defaultValue: MappingContextValueType = {
Expand Down
@@ -1,13 +1,13 @@
import React from 'react';
import {
ThemeMappingType,
ThemeMapType,
} from 'eva/packages/common';
ThemeStyleType,
} from 'eva/packages/types';
import { MappingContext } from './mappingContext';

export interface Props {
mapping: ThemeMappingType;
styles: ThemeMapType;
styles: ThemeStyleType;
children: React.ReactNode;
}

Expand Down
102 changes: 79 additions & 23 deletions src/framework/theme/component/style/style.spec.config.ts
@@ -1,30 +1,77 @@
import { ThemeMappingType } from 'eva/packages/common';
import { ThemeMappingType } from 'eva/packages/types';
import { ThemeType } from '../../type';

export const mapping: ThemeMappingType = {
Test: {
meta: {
scope: 'mobile',
mapping: {
size: {
type: 'number',
},
innerSize: {
type: 'number',
},
borderWidth: {
type: 'number',
},
borderColor: {
type: 'color',
},
selectColor: {
type: 'color',
},
},
appearances: {
default: {
default: true,
},
custom: {
default: false,
},
},
variants: {
status: [
'success',
'info',
],
size: [
'small',
'big',
],
status: {
success: {
default: false,
},
info: {
default: false,
},
},
size: {
small: {
default: false,
},
medium: {
default: true,
},
large: {
default: false,
},
},
},
states: {
checked: {
default: false,
priority: 0,
scope: 'mobile',
},
disabled: {
default: false,
priority: 1,
scope: 'mobile',
},
active: {
default: false,
priority: 2,
scope: 'mobile',
},
},
states: [
'checked',
'disabled',
'active',
],
},
appearance: {
default: {
mapping: {
size: 36,
innerSize: 24,
borderWidth: 2,
borderColor: 'grayPrimary',
selectColor: 'transparent',
Expand Down Expand Up @@ -77,18 +124,24 @@ export const mapping: ThemeMappingType = {
},
},
size: {
big: {
mapping: {
size: 42,
innerSize: 28,
},
},
small: {
mapping: {
size: 30,
innerSize: 20,
},
},
medium: {
mapping: {
size: 36,
innerSize: 24,
},
},
large: {
mapping: {
size: 42,
innerSize: 28,
},
},
},
},
},
Expand All @@ -115,8 +168,11 @@ export const mapping: ThemeMappingType = {
},
Empty: {
meta: {
scope: 'mobile',
mapping: {},
appearances: {},
variants: {},
states: [],
states: {},
},
appearance: {},
},
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/component/style/style.spec.tsx
Expand Up @@ -39,7 +39,7 @@ describe('@style: ui component checks', () => {
class ComplexStyleProvider extends React.Component<ComplexStyleProviderProps & StyleProviderProps> {

state = {
mappings: [],
mappings: {},
styles: {},
theme: {},
};
Expand Down

0 comments on commit 297887c

Please sign in to comment.