Files
wdi-dashboard/node_modules/@chakra-ui/theme/dist/components/table.js

199 lines
4.7 KiB
JavaScript
Raw Normal View History

2024-08-16 15:06:52 +05:30
"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/table.ts
var table_exports = {};
__export(table_exports, {
tableTheme: () => tableTheme
});
module.exports = __toCommonJS(table_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 { defineMultiStyleConfig, definePartsStyle } = (0, import_styled_system.createMultiStyleConfigHelpers)(import_anatomy.tableAnatomy.keys);
var baseStyle = definePartsStyle({
table: {
fontVariantNumeric: "lining-nums tabular-nums",
borderCollapse: "collapse",
width: "full"
},
th: {
fontFamily: "heading",
fontWeight: "bold",
textTransform: "uppercase",
letterSpacing: "wider",
textAlign: "start"
},
td: {
textAlign: "start"
},
caption: {
mt: 4,
fontFamily: "heading",
textAlign: "center",
fontWeight: "medium"
}
});
var numericStyles = (0, import_styled_system.defineStyle)({
"&[data-is-numeric=true]": {
textAlign: "end"
}
});
var variantSimple = definePartsStyle((props) => {
const { colorScheme: c } = props;
return {
th: {
color: (0, import_theme_tools.mode)("gray.600", "gray.400")(props),
borderBottom: "1px",
borderColor: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
td: {
borderBottom: "1px",
borderColor: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
caption: {
color: (0, import_theme_tools.mode)("gray.600", "gray.100")(props)
},
tfoot: {
tr: {
"&:last-of-type": {
th: { borderBottomWidth: 0 }
}
}
}
};
});
var variantStripe = definePartsStyle((props) => {
const { colorScheme: c } = props;
return {
th: {
color: (0, import_theme_tools.mode)("gray.600", "gray.400")(props),
borderBottom: "1px",
borderColor: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
td: {
borderBottom: "1px",
borderColor: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
caption: {
color: (0, import_theme_tools.mode)("gray.600", "gray.100")(props)
},
tbody: {
tr: {
"&:nth-of-type(odd)": {
"th, td": {
borderBottomWidth: "1px",
borderColor: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props)
},
td: {
background: (0, import_theme_tools.mode)(`${c}.100`, `${c}.700`)(props)
}
}
}
},
tfoot: {
tr: {
"&:last-of-type": {
th: { borderBottomWidth: 0 }
}
}
}
};
});
var variants = {
simple: variantSimple,
striped: variantStripe,
unstyled: (0, import_styled_system.defineStyle)({})
};
var sizes = {
sm: definePartsStyle({
th: {
px: "4",
py: "1",
lineHeight: "4",
fontSize: "xs"
},
td: {
px: "4",
py: "2",
fontSize: "sm",
lineHeight: "4"
},
caption: {
px: "4",
py: "2",
fontSize: "xs"
}
}),
md: definePartsStyle({
th: {
px: "6",
py: "3",
lineHeight: "4",
fontSize: "xs"
},
td: {
px: "6",
py: "4",
lineHeight: "5"
},
caption: {
px: "6",
py: "2",
fontSize: "sm"
}
}),
lg: definePartsStyle({
th: {
px: "8",
py: "4",
lineHeight: "5",
fontSize: "sm"
},
td: {
px: "8",
py: "5",
lineHeight: "6"
},
caption: {
px: "6",
py: "2",
fontSize: "md"
}
})
};
var tableTheme = defineMultiStyleConfig({
baseStyle,
variants,
sizes,
defaultProps: {
variant: "simple",
size: "md",
colorScheme: "gray"
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
tableTheme
});
//# sourceMappingURL=table.js.map