mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 16:58:00 +08:00
f0c105d262
* feat: remove the hardcode of `use client` * chore: update `@ant-design/tools` * test: update * fix: incorrect dictionary * chore: update dep * ci: check use client * chore: update ci * fix: should be LIB_DIR * ci: should only run in dist * chore: update check tsx files
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
/* eslint-disable import/prefer-default-export */
|
|
import getDesignToken from './getDesignToken';
|
|
import type { GlobalToken, MappingAlgorithm } from './interface';
|
|
import { defaultConfig, useToken as useInternalToken } from './internal';
|
|
import compactAlgorithm from './themes/compact';
|
|
import darkAlgorithm from './themes/dark';
|
|
import defaultAlgorithm from './themes/default';
|
|
|
|
// 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.
|
|
/** Get current context Design Token. Will be different if you are using nest theme config. */
|
|
function useToken() {
|
|
const [theme, token, hashId] = useInternalToken();
|
|
|
|
return { theme, token, hashId };
|
|
}
|
|
|
|
export type { GlobalToken, MappingAlgorithm };
|
|
|
|
export default {
|
|
/** @private Test Usage. Do not use in production. */
|
|
defaultConfig,
|
|
|
|
/** Default seedToken */
|
|
defaultSeed: defaultConfig.token,
|
|
|
|
useToken,
|
|
defaultAlgorithm,
|
|
darkAlgorithm,
|
|
compactAlgorithm,
|
|
getDesignToken,
|
|
};
|