2022-06-28 15:38:30 +08:00
|
|
|
/* eslint-disable import/prefer-default-export */
|
2022-11-01 15:06:38 +08:00
|
|
|
import { defaultConfig, useToken as useInternalToken } from '.';
|
2022-06-29 20:34:00 +08:00
|
|
|
import defaultAlgorithm from './themes/default';
|
|
|
|
import darkAlgorithm from './themes/dark';
|
2022-10-25 17:04:36 +08:00
|
|
|
import compactAlgorithm from './themes/compact';
|
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-10-25 17:04:36 +08:00
|
|
|
compactAlgorithm,
|
2022-06-29 20:34:00 +08:00
|
|
|
};
|