-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
9 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
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,47 @@ | ||
// import { renderHook } from '@testing-library/react-hooks'; | ||
// | ||
// import type { ThemedDict } from '../@types/ThemedDict'; | ||
// import type { ThemedTypings } from '../@types/ThemedTypings'; | ||
// | ||
// import { useSxToken } from './useSxToken'; | ||
// | ||
// const emptyTheme: ThemedDict = { | ||
// colors: {}, | ||
// sizes: {}, | ||
// space: {}, | ||
// }; | ||
// | ||
// const baseTheme: ThemedDict = { | ||
// colors: { | ||
// red: 'red', | ||
// blue: 'blue', | ||
// green: 'green', | ||
// }, | ||
// sizes: { | ||
// 1: 4, | ||
// 2: 8, | ||
// pagePadding: 20, | ||
// }, | ||
// space: { 1: 4, 2: 8, pagePadding: 20 }, | ||
// }; | ||
// | ||
// export function expectResult<T extends keyof ThemedTypings>( | ||
// theme: ThemedDict, | ||
// tokenGroup: T, | ||
// tokenValue: string, | ||
// expectation: any, | ||
// ) { | ||
// const { | ||
// result: { current }, | ||
// } = renderHook(() => useSxToken(tokenGroup, tokenValue, { theme })); | ||
// | ||
// return expect(current).toEqual(expectation); | ||
// } | ||
// | ||
// describe('', () => { | ||
// it('', () => { | ||
// expectResult(baseTheme, 'colors', 'red', 'red'); | ||
// }); | ||
// }); | ||
|
||
it('', () => {}); |
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,24 @@ | ||
// import { useContext } from 'react'; | ||
// | ||
// import type { ThemedDict } from '../@types/ThemedDict'; | ||
// import type { ThemedTypings } from '../@types/ThemedTypings'; | ||
// import { StyledSystemContext } from '../provider/StyledSystemProvider'; | ||
// | ||
// export type UseSxTokenOptions = { | ||
// theme?: ThemedDict; | ||
// }; | ||
// export const useSxToken = <T extends keyof ThemedTypings>( | ||
// tokenType: T, | ||
// tokenValue: string, | ||
// { theme: optionTheme }: UseSxTokenOptions = {}, | ||
// ): undefined | ThemedTypings[T][keyof ThemedTypings[T]] => { | ||
// const styledSystemContext = useContext(StyledSystemContext); | ||
// | ||
// const theme = optionTheme ?? styledSystemContext?.theme; | ||
// | ||
// if (!theme || tokenType! in theme) { | ||
// return; | ||
// } | ||
// | ||
// return theme[tokenType][tokenValue] as any; | ||
// }; |
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