Files
wdi-dashboard/node_modules/@chakra-ui/theme/dist/components/alert.js
2024-08-16 15:06:52 +05:30

149 lines
3.9 KiB
JavaScript

"use strict";
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/components/alert.ts
var alert_exports = {};
__export(alert_exports, {
alertTheme: () => alertTheme
});
module.exports = __toCommonJS(alert_exports);
var import_anatomy = require("@chakra-ui/anatomy");
var import_styled_system = require("@chakra-ui/styled-system");
var import_theme_tools = require("@chakra-ui/theme-tools");
var { definePartsStyle, defineMultiStyleConfig } = (0, import_styled_system.createMultiStyleConfigHelpers)(import_anatomy.alertAnatomy.keys);
var $fg = (0, import_styled_system.cssVar)("alert-fg");
var $bg = (0, import_styled_system.cssVar)("alert-bg");
var baseStyle = definePartsStyle({
container: {
bg: $bg.reference,
px: "4",
py: "3"
},
title: {
fontWeight: "bold",
lineHeight: "6",
marginEnd: "2"
},
description: {
lineHeight: "6"
},
icon: {
color: $fg.reference,
flexShrink: 0,
marginEnd: "3",
w: "5",
h: "6"
},
spinner: {
color: $fg.reference,
flexShrink: 0,
marginEnd: "3",
w: "5",
h: "5"
}
});
function getBg(props) {
const { theme, colorScheme: c } = props;
const darkBg = (0, import_theme_tools.transparentize)(`${c}.200`, 0.16)(theme);
return {
light: `colors.${c}.100`,
dark: darkBg
};
}
var variantSubtle = definePartsStyle((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
}
}
};
});
var variantLeftAccent = definePartsStyle((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
},
paddingStart: "3",
borderStartWidth: "4px",
borderStartColor: $fg.reference
}
};
});
var variantTopAccent = definePartsStyle((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
},
pt: "2",
borderTopWidth: "4px",
borderTopColor: $fg.reference
}
};
});
var variantSolid = definePartsStyle((props) => {
const { colorScheme: c } = props;
return {
container: {
[$fg.variable]: `colors.white`,
[$bg.variable]: `colors.${c}.600`,
_dark: {
[$fg.variable]: `colors.gray.900`,
[$bg.variable]: `colors.${c}.200`
},
color: $fg.reference
}
};
});
var variants = {
subtle: variantSubtle,
"left-accent": variantLeftAccent,
"top-accent": variantTopAccent,
solid: variantSolid
};
var alertTheme = defineMultiStyleConfig({
baseStyle,
variants,
defaultProps: {
variant: "subtle",
colorScheme: "blue"
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
alertTheme
});
//# sourceMappingURL=alert.js.map