UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

101 lines (96 loc) 3.62 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var createMemoStyles = require('../../theme/create-memo-styles.js'); var getSizeValue = require('../../theme/utils/get-size-value/get-size-value.js'); var getFontStyles = require('../../theme/utils/get-font-styles/get-font-styles.js'); var getThemeColor = require('../../theme/utils/get-theme-color/get-theme-color.js'); var getFocusStyles = require('../../theme/utils/get-focus-styles/get-focus-styles.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)); const sizes = { xs: 12, sm: 16, md: 20, lg: 26, xl: 36 }; var useStyles = createMemoStyles.createMemoStyles({ root: { display: "flex", alignItems: "center" }, inner: ({ size }) => ({ position: "relative", width: getSizeValue.getSizeValue({ size, sizes }), height: getSizeValue.getSizeValue({ size, sizes }) }), label: ({ theme, size }) => __spreadProps(__spreadValues({}, getFontStyles.getFontStyles(theme)), { WebkitTapHighlightColor: "transparent", paddingLeft: theme.spacing.sm, fontSize: getSizeValue.getSizeValue({ size, sizes: theme.fontSizes }), lineHeight: `${getSizeValue.getSizeValue({ size, sizes })}px`, color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black }), input: ({ size, theme, color }) => __spreadProps(__spreadValues({}, getFocusStyles.getFocusStyles(theme)), { appearance: "none", backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.white, border: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[4]}`, width: getSizeValue.getSizeValue({ size, sizes }), height: getSizeValue.getSizeValue({ size, sizes }), borderRadius: theme.radius.sm, padding: 0, outline: 0, display: "block", margin: 0, "&:checked": { backgroundColor: getThemeColor.getThemeColor({ theme, color, shade: 7 }), borderColor: getThemeColor.getThemeColor({ theme, color, shade: 7 }), color: theme.white, "& + $icon": { color: theme.white, display: "block" } }, "&:disabled": { backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2], borderColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[3], cursor: "not-allowed", "& + $icon": { color: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[5] } } }), icon: { display: "none", pointerEvents: "none", width: "80%", height: "80%", position: "absolute", zIndex: 1, top: 0, bottom: 0, left: 0, right: 0, margin: "auto" } }); exports.default = useStyles; exports.sizes = sizes; //# sourceMappingURL=Checkbox.styles.js.map