pkg-components
Version:
6 lines (5 loc) • 1.84 kB
JavaScript
import{a as _,j as n}from"./jsx-runtime-DI8_P1Ft.js";import{P as t}from"./index-B3IC6ylx.js";import"./index-XORxt8qY.js";import{g as i}from"./index-CIjh_EDQ.js";import{T as v}from"./index-Bww7KC1c.js";const m="_header_step_xvj26_1",f="_tabs_xvj26_17",y="_slider__active_xvj26_29",h="_slider_xvj26_29",x="_text_xvj26_69",r={header_step:m,tabs:f,slider__active:y,slider:h,text:x},l=({active:a=0,steps:o=[],overActive:p=null,handleOverActive:d=e=>e,setActive:u=e=>e})=>{const e=100/o.length;return _("div",{className:r.header_step,children:[o.map((c,s)=>n("div",{className:`${r.tabs} ${s===p&&r.slider__active}`,onClick:()=>{u(s)},onMouseLeave:()=>{d(a)},onMouseOver:()=>{d(s)},children:n(v,{as:"h2",className:r.text,fontFamily:"PFont-Light",fontSize:".9rem",fontWeight:"500",style:{userSelect:"none",fontWeight:i("--font-weight-bold"),color:s===a?i("--color-primary-red"):i("--color-text-gray-light")},children:c})},c)),n("span",{className:`${r.slider}`,style:{left:`${a*e}%`,width:`${e}%`}})]})};l.propTypes={active:t.number,handleOverActive:t.func,setActive:t.func,overActive:t.number,steps:t.array};try{l.displayName="HeaderSteps",l.__docgenInfo={description:"",displayName:"HeaderSteps",props:{active:{defaultValue:{value:"0"},description:"",name:"active",required:!1,type:{name:"number"}},steps:{defaultValue:{value:"[]"},description:"",name:"steps",required:!1,type:{name:"never[]"}},overActive:{defaultValue:{value:"null"},description:"",name:"overActive",required:!1,type:{name:"null"}},handleOverActive:{defaultValue:{value:`(index) => {\r
return index\r
}`},description:"",name:"handleOverActive",required:!1,type:{name:"((index: any) => any)"}},setActive:{defaultValue:{value:`(index) => {\r
return index\r
}`},description:"",name:"setActive",required:!1,type:{name:"((index: any) => any)"}}}}}catch{}export{l as H};