19 lines
750 B
JavaScript
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;
|