2022-06-28 15:38:30 +08:00
|
|
|
/* eslint-disable import/prefer-default-export */
|
2022-08-19 17:45:03 +08:00
|
|
|
import { useToken as useInternalToken, defaultConfig } from '.';
|
2022-06-29 20:34:00 +08:00
|
|
|
import defaultAlgorithm from './themes/default';
|
|
|
|
import darkAlgorithm from './themes/dark';
|
2022-08-19 13:57:19 +08:00
|
|
|
import { defaultAlgorithmV4, darkAlgorithmV4 } from './themes/v4';
|
2022-06-28 15:38:30 +08:00
|
|
|
|
|
|
|
// ZombieJ: We export as object to user but array in internal.
|
|
|
|
// This is used to minimize the bundle size for antd package but safe to refactor as object also.
|
|
|
|
// Please do not export internal `useToken` directly to avoid something export unexpected.
|
2022-06-29 20:34:00 +08:00
|
|
|
/** Get current context Design Token. Will be different if you using nest theme config. */
|
|
|
|
function useToken() {
|
|
|
|
const [theme, token, hashId] = useInternalToken();
|
2022-06-28 15:38:30 +08:00
|
|
|
|
|
|
|
return { theme, token, hashId };
|
|
|
|
}
|
2022-06-29 20:34:00 +08:00
|
|
|
|
|
|
|
export default {
|
2022-08-19 17:45:03 +08:00
|
|
|
/** @private Test Usage. Do not use in production. */
|
|
|
|
defaultConfig,
|
|
|
|
|
2022-06-29 20:34:00 +08:00
|
|
|
useToken,
|
|
|
|
defaultAlgorithm,
|
|
|
|
darkAlgorithm,
|
2022-08-19 13:57:19 +08:00
|
|
|
defaultAlgorithmV4,
|
|
|
|
darkAlgorithmV4,
|
2022-06-29 20:34:00 +08:00
|
|
|
};
|