@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
98 lines (95 loc) • 3.64 kB
JavaScript
import { createMemoStyles } from '../../../theme/create-memo-styles.js';
import { getFocusStyles } from '../../../theme/utils/get-focus-styles/get-focus-styles.js';
import { getFontStyles } from '../../../theme/utils/get-font-styles/get-font-styles.js';
import { getThemeColor } from '../../../theme/utils/get-theme-color/get-theme-color.js';
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var useStyles = createMemoStyles({
tabActive: {},
tabLabel: {},
tabControl: ({ theme }) => __spreadProps(__spreadValues(__spreadValues({}, getFontStyles(theme)), getFocusStyles(theme)), {
WebkitTapHighlightColor: "transparent",
boxSizing: "border-box",
display: "block",
height: 40,
backgroundColor: "transparent",
border: 0,
padding: [0, theme.spacing.md],
fontSize: theme.fontSizes.sm,
cursor: "pointer",
"&:disabled": {
cursor: "not-allowed",
color: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[5]
}
}),
default: ({ theme, reduceMotion, color }) => ({
transition: reduceMotion ? "none" : "border-color 150ms ease, color 150ms ease",
color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black,
borderBottom: "2px solid transparent",
"&$tabActive": {
color: getThemeColor({ theme, color, shade: theme.colorScheme === "dark" ? 6 : 7 }),
borderBottomColor: getThemeColor({
theme,
color,
shade: theme.colorScheme === "dark" ? 6 : 7
})
}
}),
outline: ({ theme }) => ({
borderTopRightRadius: theme.radius.sm,
borderTopLeftRadius: theme.radius.sm,
border: "1px solid transparent",
borderBottom: 0,
color: theme.colorScheme === "dark" ? theme.colors.dark[1] : theme.colors.gray[7],
"&$tabActive": {
color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black,
borderColor: theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2],
background: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white
}
}),
pills: ({ theme, color }) => ({
borderRadius: 1e3,
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[0],
color: theme.colorScheme === "dark" ? theme.colors.dark[1] : theme.colors.gray[7],
fontSize: theme.fontSizes.md,
"&$tabActive": {
color: theme.white,
background: getThemeColor({ theme, color, shade: 7 })
}
}),
tabInner: {
boxSizing: "border-box",
display: "flex",
alignItems: "center",
justifyContent: "center",
lineHeight: 1,
height: "100%"
},
tabIcon: ({ theme }) => ({
"&:not(:only-child)": {
marginRight: theme.spacing.xs
},
"& *": {
display: "block"
}
})
});
export default useStyles;
//# sourceMappingURL=TabControl.styles.js.map