UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

56 lines (53 loc) 2.09 kB
import { createStyles, rem } from '@mantine/styles'; import { GROUP_POSITIONS } from '../../Group/Group.styles.js'; var __defProp = Object.defineProperty; 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; }; function getVariantStyles({ orientation, inverted, placement }, theme, variant) { const vertical = orientation === "vertical"; if (variant === "default") { return { [vertical ? placement === "left" ? "borderRight" : "borderLeft" : inverted ? "borderTop" : "borderBottom"]: `${rem(2)} solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}` }; } if (variant === "outline") { return { [vertical ? placement === "left" ? "borderRight" : "borderLeft" : inverted ? "borderTop" : "borderBottom"]: `${rem(1)} solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}` }; } if (variant === "pills") { return { gap: `calc(${theme.spacing.sm} / 2)` }; } return {}; } var useStyles = createStyles((theme, params, { variant }) => { const vertical = params.orientation === "vertical"; return { tabsList: __spreadValues({ display: "flex", flexWrap: "wrap", flexDirection: vertical ? "column" : "row", justifyContent: GROUP_POSITIONS[params.position], '& [role="tab"]': { flex: params.grow ? 1 : void 0 } }, getVariantStyles(params, theme, variant)) }; }); export default useStyles; //# sourceMappingURL=TabsList.styles.js.map