index.js 961 B

123456789101112131415161718192021222324252627
  1. /* eslint-disable import/prefer-default-export */
  2. import { defaultConfig, useToken as useInternalToken } from './internal';
  3. import defaultAlgorithm from './themes/default';
  4. import darkAlgorithm from './themes/dark';
  5. import compactAlgorithm from './themes/compact';
  6. // ZombieJ: We export as object to user but array in internal.
  7. // This is used to minimize the bundle size for antd package but safe to refactor as object also.
  8. // Please do not export internal `useToken` directly to avoid something export unexpected.
  9. /** Get current context Design Token. Will be different if you are using nest theme config. */
  10. function useToken() {
  11. const [theme, token, hashId] = useInternalToken();
  12. return {
  13. theme,
  14. token,
  15. hashId
  16. };
  17. }
  18. export default {
  19. /** @private Test Usage. Do not use in production. */
  20. defaultConfig,
  21. /** Default seedToken */
  22. defaultSeed: defaultConfig.token,
  23. useToken,
  24. defaultAlgorithm,
  25. darkAlgorithm,
  26. compactAlgorithm
  27. };