RFC: added brandcolor for switch (#8213)

This commit is contained in:
Peer Richelsen authored and GitHub committed 2023-04-19 14:39:23 +00:00
1 parent bdbf9bd04d
commit de61b032b7
4 files changed
+26 -7

No files matched your search

@@ -27,7 +27,7 @@ const Switch = (
) => {
const { label, fitToHeight, classNames, ...primitiveProps } = props;
const id = useId();
const isChecked = props.checked || props.defaultChecked;
return (
<Wrapper tooltip={props.tooltip}>
<div
@@ -38,7 +38,7 @@ const Switch = (
)}>
<PrimitiveSwitch.Root
className={cx(
props.checked || props.defaultChecked ? "bg-inverted" : "bg-emphasis",
props.checked || props.defaultChecked ? "bg-brand-default" : "bg-emphasis",
primitiveProps.disabled && "cursor-not-allowed",
"focus:ring-brand-default h-5 w-[34px] rounded-full shadow-none",
props.className
@@ -48,7 +48,7 @@ const Switch = (
id={id}
className={cx(
"block h-[14px] w-[14px] rounded-full transition will-change-transform ltr:translate-x-[4px] rtl:-translate-x-[4px] ltr:[&[data-state='checked']]:translate-x-[17px] rtl:[&[data-state='checked']]:-translate-x-[17px]",
props.checked || props.defaultChecked ? "bg-default shadow-inner" : "bg-inverted",
isChecked ? "bg-brand-accent shadow-inner" : "bg-default",
classNames?.thumb
)}
/>