-
Notifications
You must be signed in to change notification settings - Fork 957
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): style consumer dispatch actions (#221)
* refactor(ui): apply jest snapshot resolver * refactor(theme): apply jest snapshot resolver
- Loading branch information
Showing
36 changed files
with
591 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
resolveSnapshotPath: (path, extension) => { | ||
return `${path}${extension}`; | ||
}, | ||
resolveTestPath: (path, extension) => { | ||
return path.slice(0, -extension.length); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ export { | |
styled, | ||
Props as StyledComponentProps, | ||
} from './styleConsumer.component'; | ||
|
||
export * from './type'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export enum Interaction { | ||
ACTIVE = 'active', | ||
} | ||
|
||
export enum State { | ||
CHECKED = 'checked', | ||
DISABLED = 'disabled', | ||
FOCUSED = 'focused', | ||
} | ||
|
||
export namespace Interaction { | ||
export function parse(interaction: string): Interaction | undefined { | ||
return Interaction[interaction.toUpperCase()]; | ||
} | ||
} | ||
|
||
export namespace State { | ||
export function parse(state: string): State | undefined { | ||
return State[state.toUpperCase()]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ export { | |
ThemedStyleType, | ||
StyleSheetType, | ||
StyleType, | ||
Interaction, | ||
} from './component'; | ||
|
||
export { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './mappingUtil.service'; | ||
export * from './themeUtil.service'; | ||
export * from './styleUtil.service'; | ||
export * from './styleConsumer.service'; | ||
export * from './mapping'; | ||
export * from './theme'; | ||
export * from './style'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './mapping.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
src/framework/theme/service/mapping/mapping.spec.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
export const mapping = { | ||
Test: { | ||
appearance: { | ||
default: { | ||
mapping: { | ||
size: 36, | ||
innerSize: 24, | ||
borderWidth: 2, | ||
borderColor: 'grayPrimary', | ||
selectColor: 'transparent', | ||
state: { | ||
active: { | ||
borderColor: 'grayDark', | ||
}, | ||
checked: { | ||
borderColor: 'bluePrimary', | ||
selectColor: 'bluePrimary', | ||
}, | ||
disabled: { | ||
borderColor: 'grayLight', | ||
}, | ||
'active.checked': { | ||
borderColor: 'blueDark', | ||
}, | ||
'checked.disabled': { | ||
selectColor: 'grayPrimary', | ||
}, | ||
}, | ||
}, | ||
variant: { | ||
status: { | ||
info: { | ||
mapping: { | ||
state: { | ||
checked: { | ||
borderColor: 'orangePrimary', | ||
selectColor: 'orangePrimary', | ||
}, | ||
'active.checked': { | ||
borderColor: 'orangeDark', | ||
}, | ||
}, | ||
}, | ||
}, | ||
success: { | ||
mapping: { | ||
state: { | ||
checked: { | ||
borderColor: 'tealPrimary', | ||
selectColor: 'tealPrimary', | ||
}, | ||
'active.checked': { | ||
borderColor: 'tealDark', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
size: { | ||
big: { | ||
mapping: { | ||
size: 42, | ||
innerSize: 28, | ||
}, | ||
}, | ||
small: { | ||
mapping: { | ||
size: 30, | ||
innerSize: 20, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
custom: { | ||
mapping: { | ||
borderWidth: 4, | ||
state: { | ||
active: { | ||
borderColor: 'grayLight', | ||
}, | ||
}, | ||
}, | ||
variant: { | ||
status: { | ||
success: { | ||
mapping: { | ||
borderColor: 'tealPrimary', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
Empty: { | ||
appearance: {}, | ||
}, | ||
}; |
6 changes: 3 additions & 3 deletions
6
src/framework/theme/tests/mapping.spec.ts → ...ork/theme/service/mapping/mapping.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './style.service'; | ||
export * from './styleConsumer.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.