@mediaradar/design-components 0.18.7 → 0.18.8
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 +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3909,6 +3909,7 @@ var SIZES2 = {
|
|
|
3909
3909
|
sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-[18px]" },
|
|
3910
3910
|
md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-[22px]" }
|
|
3911
3911
|
};
|
|
3912
|
+
var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
|
|
3912
3913
|
function Toggle({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }) {
|
|
3913
3914
|
const s = SIZES2[size];
|
|
3914
3915
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
@@ -3921,10 +3922,11 @@ function Toggle({ checked, onChange, label, size = "md", disabled, className, te
|
|
|
3921
3922
|
disabled,
|
|
3922
3923
|
"data-testid": testIdPrefix && `${testIdPrefix}-toggle`,
|
|
3923
3924
|
onClick: () => onChange(!checked),
|
|
3925
|
+
style: checked ? void 0 : { backgroundColor: OFF_TRACK },
|
|
3924
3926
|
className: cn(
|
|
3925
3927
|
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
3926
3928
|
s.track,
|
|
3927
|
-
checked
|
|
3929
|
+
checked && "bg-brand-primaryAction",
|
|
3928
3930
|
disabled && "cursor-not-allowed opacity-50",
|
|
3929
3931
|
className
|
|
3930
3932
|
),
|