@charcoal-ui/react 3.11.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -8
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +80 -58
- package/src/components/Checkbox/index.story.tsx +31 -23
- package/src/components/Checkbox/index.tsx +6 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1646,7 +1646,7 @@ var Checkbox = (0, import_react25.forwardRef)(function CheckboxInner({
|
|
|
1646
1646
|
const {
|
|
1647
1647
|
inputProps
|
|
1648
1648
|
} = (0, import_checkbox.useCheckbox)(ariaCheckboxProps, state, objectRef);
|
|
1649
|
-
const isDisabled =
|
|
1649
|
+
const isDisabled = props.disabled ?? false;
|
|
1650
1650
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
|
|
1651
1651
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxRoot, { children: [
|
|
1652
1652
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInput, { type: "checkbox", ...inputProps, readOnly: props.readonly }),
|
|
@@ -1659,13 +1659,13 @@ var Checkbox_default = (0, import_react25.memo)(Checkbox);
|
|
|
1659
1659
|
var hiddenCss = (0, import_styled_components22.css)(["visibility:hidden;"]);
|
|
1660
1660
|
var InputRoot = import_styled_components22.default.label.withConfig({
|
|
1661
1661
|
componentId: "ccl__sc-wrdmwj-0"
|
|
1662
|
-
})(["position:relative;display:flex;cursor:pointer;gap:4px;&:disabled,&[aria-disabled]:not([aria-disabled='false']){cursor:default;opacity:0.32;}"]);
|
|
1662
|
+
})(["position:relative;display:flex;cursor:pointer;gap:4px;&:has(input[readonly]){cursor:default;}&:disabled,&[aria-disabled]:not([aria-disabled='false']){cursor:default;opacity:0.32;}"]);
|
|
1663
1663
|
var CheckboxRoot = import_styled_components22.default.div.withConfig({
|
|
1664
1664
|
componentId: "ccl__sc-wrdmwj-1"
|
|
1665
1665
|
})(["position:relative;"]);
|
|
1666
1666
|
var CheckboxInput = import_styled_components22.default.input.withConfig({
|
|
1667
1667
|
componentId: "ccl__sc-wrdmwj-2"
|
|
1668
|
-
})(["&[type='checkbox']{appearance:none;display:block;cursor:pointer;margin:0;width:20px;height:20px;border-radius:4px;transition:0.2s box-shadow,0.2s background-color;&:disabled{cursor:default;}
|
|
1668
|
+
})(["&[type='checkbox']{appearance:none;display:block;cursor:pointer;margin:0;width:20px;height:20px;border-radius:4px;transition:0.2s box-shadow,0.2s background-color;&:disabled{cursor:default;}&[readonly]{cursor:default;opacity:0.32;}&:checked{background-color:var(--charcoal-brand);&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{background-color:var(--charcoal-brand-hover);}&:active{background-color:var(--charcoal-brand-press);}}}&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", " &[aria-invalid='true']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}}&:not(:checked){border-width:2px;border-style:solid;border-color:var(--charcoal-text4);}}"], import_styled9.focusVisibleFocusRingCss);
|
|
1669
1669
|
var CheckboxInputOverlay = import_styled_components22.default.div.withConfig({
|
|
1670
1670
|
componentId: "ccl__sc-wrdmwj-3"
|
|
1671
1671
|
})(["position:absolute;top:-2px;left:-2px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--charcoal-text5);", ";"], ({
|