import{a as s}from"./chunk.UFTAQNZB.js";import{a as l}from"./chunk.NYKJXI3Q.js";import{a as c,b as i,c as r,h as o}from"./chunk.XJAJO727.js";import{b as a,e as d}from"./chunk.OBAEIKIV.js";import{e as t}from"./chunk.6EV4YU6C.js";var e=class extends o{constructor(){super(...arguments);this.checked=!1;this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.invalid=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){!this.disabled&&!this.visuallyDisabled&&(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled||this.visuallyDisabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return d`<span part="base" class="${s("sd-radio group flex items-center text-base leading-normal text-black cursor-pointer",(this.disabled||this.visuallyDisabled)&&"hover:cursor-not-allowed",{sm:"small-size text-sm",md:"text-base",lg:"text-base"}[this.size])}"><span part="${`${this.checked?"control--checked":"control--unchecked"}`}" class="${s("flex-initial shrink-0 relative inline-flex items-center justify-center border sd-radio-border-width rounded-full bg-white h-4 w-4 duration-fast ease-in-out",this.disabled||this.visuallyDisabled?"border-neutral-500":this.invalid?s("border-error hover:border-error-400 group-hover:border-error-400",this.checked?"sd-radio--checked--invalid--default-color-background":"sd-radio--default--invalid-color-background"):this.checked?"sd-radio--checked--default-color-background hover:sd-radio--checked--hover-color-background group-hover:sd-radio--checked--hover-color-background border-accent hover:border-accent-550 group-hover:border-accent-550":"form-control-color-border hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span part="checked" class="${s("rounded-full inline-flex text-white sd-radio__checked-height sd-radio__checked-width transition-[transform, colors] duration-medium ease-in-out",this.checked?"scale-100":"scale-0",this.disabled?"sd-radio--checked--disabled__icon-color-background":this.visuallyDisabled?"bg-white":this.invalid?"sd-radio--checked--invalid--default__icon-color-background hover:sd-radio--checked--invalid--hover__icon-color-background group-hover:sd-radio--checked--invalid--hover__icon-color-background":this.checked?"sd-radio--checked--default__icon-color-background hover:sd-radio--checked--hover__icon-color-background group-hover:sd-radio--checked--hover__icon-color-background":"bg-neutral-800")}"></span></span><slot part="label" class="${s("ml-2 select-none inline-block",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-black")}"></slot></span>`}};e.styles=[...o.styles,a`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){--tw-outline-style:none;outline-style:none}[part=control--checked],[part=control--unchecked]{outline-color:transparent}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-width:1px;outline-style:var(--tw-outline-style);outline-width:2px;outline-offset:2px;outline-color:rgba(var(--sd-color-border-primary,var(--sd-color-primary)))}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}`],t([r()],e.prototype,"checked",2),t([r()],e.prototype,"hasFocus",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],e.prototype,"visuallyDisabled",2),t([i()],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"invalid",2),t([l("checked")],e.prototype,"handleCheckedChange",1),t([l(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([c("sd-radio")],e);export{e as a};
