PromoCursed/node_modules/antd/es/config-provider/context.js
2024-08-20 23:25:37 +04:00

19 lines
750 B
JavaScript

import * as React from 'react';
export const defaultPrefixCls = 'ant';
export const defaultIconPrefixCls = 'anticon';
export const Variants = ['outlined', 'borderless', 'filled'];
const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) {
return customizePrefixCls;
}
return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
};
// zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will cause circular dependency.
export const ConfigContext = /*#__PURE__*/React.createContext({
// We provide a default function for Context without provider
getPrefixCls: defaultGetPrefixCls,
iconPrefixCls: defaultIconPrefixCls
});
export const {
Consumer: ConfigConsumer
} = ConfigContext;