@oceanbase/design
Version:
The Design System of OceanBase
115 lines (113 loc) • 3.59 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/modal/style/index.ts
var style_exports = {};
__export(style_exports, {
default: () => style_default,
genModalStyle: () => genModalStyle
});
module.exports = __toCommonJS(style_exports);
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
var genModalStyle = (token) => {
const {
antCls,
componentCls,
marginXXS,
marginLG,
paddingMD,
borderRadius,
controlHeight,
fontSizeHeading5,
lineHeightHeading5
} = token;
const top = 100;
const bottom = 100;
const titleHeight = fontSizeHeading5 * lineHeightHeading5;
return {
/* Modal */
[`${componentCls}:not(${componentCls}-confirm)`]: {
[`${componentCls}-header`]: {
marginBottom: marginLG
},
[`${componentCls}-footer`]: {
marginTop: marginLG,
[`${componentCls}-footer-content`]: {
display: "flex",
justifyContent: "space-between",
alignItems: "center",
[`${componentCls}-footer-extra`]: {
marginInlineEnd: token.margin,
// make extra align to start
textAlign: "start"
}
}
}
},
/* Modal.Progress */
[`${componentCls}${componentCls}-progress`]: {
[`${componentCls}-content`]: {
padding: `${token.paddingXL + token.padding}px ${token.paddingLG + token.padding}px`,
[`${componentCls}-header`]: {
textAlign: "center",
marginBottom: token.marginXXL,
[`${componentCls}-title`]: {
fontSize: token.fontSizeHeading4
}
},
[`${componentCls}-body`]: {
textAlign: "center",
[`${componentCls}-progress-loading`]: {
fontSize: 200,
color: token.colorInfo
},
[`${componentCls}-progress-description`]: {
marginTop: token.marginXXL,
color: token.colorTextTertiary
},
// should align to left for Alert
[`${antCls}-alert`]: {
textAlign: "left"
}
},
[`${componentCls}-footer`]: {
textAlign: "center"
}
}
},
/* Modal.method() */
[`${componentCls}-confirm`]: {
[`${componentCls}-body ${componentCls}-confirm-title +${componentCls}-confirm-content`]: {
marginBlockStart: marginXXS,
color: token.colorTextSecondary
},
[`${componentCls}-confirm-btns`]: {
marginTop: marginLG
}
}
};
};
var style_default = (prefixCls) => {
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Modal", (token) => {
return [genModalStyle(token)];
});
return useStyle(prefixCls);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
genModalStyle
});