UNPKG

@atlaskit/checkbox

Version:

A checkbox is an input control that allows a user to select one or more options from a number of choices.

45 lines (41 loc) 1.86 kB
/* label.tsx generated by @compiled/babel-plugin v0.39.1 */ /** * Base state styles with CSS custom properties. * Pseudo-selectors (:hover, :focus-within, :active) on the label element * update CSS variables that cascade to the CheckboxIcon. * This avoids nested sibling selectors. * * Uses `css` over `cssMap` to work around a bug in Compiled types when * using CSS variables in pseudo-selectors. */ import "./label.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; const baseStyles = null; const textLabelLayoutStyles = null; // Checked/Indeterminate state const checkedStyles = null; // Invalid state - must override hover/active to maintain red border const invalidStyles = null; // Disabled state - must override hover/active to maintain disabled appearance const disabledStyles = null; // Disabled + Checked/Indeterminate const disabledCheckedStyles = null; export default function Label({ children, isDisabled, isChecked, isIndeterminate, isInvalid, testId, label, id, xcss }) { return /*#__PURE__*/React.createElement("label", { className: ax(["_11c8fhey _1e0c11p5 _1ejihkll _umai184x _1qwn1j9a _f0grrsbi _1c53glyw _1e9d1j28 _syazi7uo _80om73ad _ljcgdfik _1vj5l4ek _dh4gr01l _cz1u1l7x _jom5wc43 _1s071onz _106f1onz", label && "_zulp1nu5 _yv0ey09t", (isChecked || isIndeterminate) && "_1qwnjmqp _f0grjmqp _1e9d5w2r _1vj51q28 _q29q1q28 _dh4gr01l _cz1u1l7x _zoo95w2r _jom5wc43 _1s071onz _106f1onz", isInvalid && "_f0gr1bqt _q29q1bqt _cz1u1bqt _1s07gir2", isDisabled && "_1qwnby5v _f0grby5v _syaz1gmx _80om13gf _1vj5by5v _q29qby5v _dh4gby5v _cz1uby5v _jom5wc43 _1s0718qt _106f18qt", isDisabled && (isChecked || isIndeterminate) && "_1e9d2sac _9js12sac _zoo92sac", xcss]), "data-testid": testId, "data-disabled": isDisabled || undefined, id: id }, children); }