import{textEllipsis as m,resetComponent as c}from"../../style/index.mjs";import"../../theme/internal.mjs";import b from"../../theme/util/genComponentStyleHook.mjs";import{merge as u}from"../../theme/util/statistic.mjs";function t(i,e){return{[`${i}, ${i}:hover, ${i}:focus`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}}function r(i){return{backgroundColor:i.bgColorSelected,boxShadow:i.boxShadow}}const $={overflow:"hidden",...m},p=i=>{const{componentCls:e}=i;return{[e]:{...c(i),display:"inline-block",padding:i.segmentedContainerPadding,color:i.labelColor,backgroundColor:i.bgColor,borderRadius:i.borderRadius,transition:`all ${i.motionDurationMid} ${i.motionEaseInOut}`,[`${e}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",width:"100%"},[`&${e}-rtl`]:{direction:"rtl"},[`&${e}-block`]:{display:"flex"},[`&${e}-block ${e}-item`]:{flex:1,minWidth:0},[`${e}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${i.motionDurationMid} ${i.motionEaseInOut}`,borderRadius:i.borderRadiusSM,"&-selected":{...r(i),color:i.labelColorHover},"&::after":{content:'""',position:"absolute",width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",transition:`background-color ${i.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${e}-item-selected):not(${e}-item-disabled)`]:{color:i.labelColorHover,"&::after":{backgroundColor:i.bgColorHover}},"&-label":{minHeight:i.controlHeight-i.segmentedContainerPadding*2,lineHeight:`${i.controlHeight-i.segmentedContainerPadding*2}px`,padding:`0 ${i.segmentedPaddingHorizontal}px`,...$},"&-icon + *":{marginInlineStart:i.marginSM/2},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${e}-thumb`]:{...r(i),position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${i.paddingXXS}px 0`,borderRadius:i.borderRadiusSM,[`& ~ ${e}-item:not(${e}-item-selected):not(${e}-item-disabled)::after`]:{backgroundColor:"transparent"}},[`&${e}-lg`]:{borderRadius:i.borderRadiusLG,[`${e}-item-label`]:{minHeight:i.controlHeightLG-i.segmentedContainerPadding*2,lineHeight:`${i.controlHeightLG-i.segmentedContainerPadding*2}px`,padding:`0 ${i.segmentedPaddingHorizontal}px`,fontSize:i.fontSizeLG},[`${e}-item, ${e}-thumb`]:{borderRadius:i.borderRadius}},[`&${e}-sm`]:{borderRadius:i.borderRadiusSM,[`${e}-item-label`]:{minHeight:i.controlHeightSM-i.segmentedContainerPadding*2,lineHeight:`${i.controlHeightSM-i.segmentedContainerPadding*2}px`,padding:`0 ${i.segmentedPaddingHorizontalSM}px`},[`${e}-item, ${e}-thumb`]:{borderRadius:i.borderRadiusXS}},...t(`&-disabled ${e}-item`,i),...t(`${e}-item-disabled`,i),[`${e}-thumb-motion-appear-active`]:{transition:`transform ${i.motionDurationSlow} ${i.motionEaseInOut}, width ${i.motionDurationSlow} ${i.motionEaseInOut}`,willChange:"transform, width"}}}},f=b("Segmented",i=>{const{lineWidthBold:e,lineWidth:o,colorTextLabel:n,colorText:d,colorFillSecondary:l,colorBgLayout:a,colorBgElevated:s}=i,g=u(i,{segmentedPaddingHorizontal:i.controlPaddingHorizontal-o,segmentedPaddingHorizontalSM:i.controlPaddingHorizontalSM-o,segmentedContainerPadding:e,labelColor:n,labelColorHover:d,bgColor:a,bgColorHover:l,bgColorSelected:s});return[p(g)]});export{f as default};
