@mediaradar/design-components 0.4.0 → 0.5.1
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 +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -444,7 +444,7 @@ function OptionRow({
|
|
|
444
444
|
// src/CheckBox.tsx
|
|
445
445
|
var import_lucide_react4 = require("lucide-react");
|
|
446
446
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
447
|
-
function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId }) {
|
|
447
|
+
function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId, title }) {
|
|
448
448
|
const on = checked || indeterminate;
|
|
449
449
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
450
450
|
"button",
|
|
@@ -453,6 +453,7 @@ function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testI
|
|
|
453
453
|
role: "checkbox",
|
|
454
454
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
455
455
|
"aria-label": ariaLabel,
|
|
456
|
+
title,
|
|
456
457
|
disabled,
|
|
457
458
|
"data-testid": testId,
|
|
458
459
|
onClick: (e) => {
|
|
@@ -463,7 +464,13 @@ function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testI
|
|
|
463
464
|
"flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
|
|
464
465
|
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
|
|
465
466
|
on ? "border-transparent bg-brand-primaryAction text-white" : "border-border-interactive bg-input hover:border-brand-primaryAction",
|
|
466
|
-
|
|
467
|
+
// Cancels the unchecked hover-border preview when disabled -- without
|
|
468
|
+
// this, a disabled box still visually previews the "you can click
|
|
469
|
+
// this" affordance on hover even though the click does nothing.
|
|
470
|
+
// Found empirically reconciling this against insights-studio-
|
|
471
|
+
// prototype's own (more complete) local CheckBox during its
|
|
472
|
+
// migration -- that version already had this guard.
|
|
473
|
+
disabled && "cursor-not-allowed opacity-50 hover:border-border-interactive"
|
|
467
474
|
].filter(Boolean).join(" "),
|
|
468
475
|
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Minus, { size: 13, strokeWidth: 3 }) : checked ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.Check, { size: 13, strokeWidth: 3 }) : null
|
|
469
476
|
}
|