@lax-wp/design-system 0.14.54 → 0.14.55
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),K=require("@mui/icons-material"),M=require("antd"),h=require("react"),x=require("../../data-display/typography/Typography.cjs.js"),j=require("../../tooltip/Tooltip.cjs.js"),S=require("../../../hooks/useEventListener.cjs.js"),V=require("../../icon/icons.generated.cjs.js"),E=({steps:t,currentStep:a,appearance:i="linear",labelPosition:s="inline",onClick:m,isStepClickable:$,className:I,showIndex:B=!0,disableOneMore:w=!1,isMainSideBarOpen:k=!1,isAuthoringOpen:T=!1})=>{const p=h.useRef(null),[u,y]=h.useState(0),[v,z]=h.useState(0),[d,R]=h.useState(0),[L,C]=h.useState(""),[q,W]=h.useState(""),F=()=>s==="top"||s==="top-right"?"flex-col":s==="bottom"||s==="bottom-right"?"flex-col-reverse":i==="linear"?"flex-row":"flex-col",N=()=>{setTimeout(()=>{y(0);const r=210,l=225;let o=0,c=0;for(let n=0;n<t.length&&(p?.current?.clientWidth&&p?.current?.clientWidth>o+l+r);n++)o+=l,c=n+1;y(c),p?.current?.clientWidth&&p?.current?.clientWidth<480&&y(t?.length)},300)};h.useEffect(()=>{N()},[k,t,a]),h.useEffect(()=>{setTimeout(()=>{N()},300)},[T]),h.useEffect(()=>{if(u>0)if(u>a){let r=t?.slice(u,t?.length)?.map(o=>o?.label)?.join(", "),l=u;w&&l===t.length-1&&(l=t.length,r=""),z(0),R(l),W(r)}else{const r=Math.floor((u+1)/2),l=a+r-t?.length;let o=a+r,c=a-Math.max(u-r,0)-(l>0?l:0),n=t?.slice(0,c)?.map(g=>g?.label)?.join(", "),f=t?.slice(o,t?.length)?.map(g=>g?.label)?.join(", ");w&&c===1&&(c=0,n=""),w&&o===t.length-1&&(o=t.length,f=""),z(c),R(o),C(n),W(f)}},[u,T,k,t,a]),S.useEventListener("resize",N);const b=(r,l,o=!1)=>{const c=!!r?.isLocked||!!r?.isDisabled||($?!$(l,r):!1),n=!!m&&!c,f=l<=a,g=()=>{n&&m?.(l)},A=m?{role:"button",tabIndex:n?0:-1,"aria-disabled":!n,onClick:g,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())}}:{},D=m?n?"group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 rounded-sm":"group cursor-not-allowed":"",H=m?`rounded-full transition-colors duration-200 w-24 h-9 ${n?f?"group-hover:bg-primary-50 dark:group-hover:bg-primary-950":"group-hover:bg-neutral-100 dark:group-hover:bg-black-700":"group-hover:bg-neutral-50 dark:group-hover:bg-black-800"}`:"";return e.jsx("div",{"aria-current":l===a?"step":void 0,className:`flex ${l<t.length-1||i=="parallel"?"flex flex-grow":""} min-w-[200px]`,children:e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsxs("div",{className:`flex ${F()} ${s==="inline"&&i==="linear"?"items-center":""}`,children:[e.jsxs("div",{...A,className:`${s==="inline"?"max-w-[70%]":"w-full"} flex flex-col ${D}`,children:[e.jsx("div",{className:`flex ${s==="top-right"||s==="bottom-right"?"justify-end":""} ${H}`,children:e.jsx(j,{title:c&&r?.disabledTooltipText||r?.tooltipText,className:"w-full",children:e.jsxs(x.Typography,{size:"small",variant:"medium",className:`truncate flex items-center justify-center gap-2 h-9 ${l<=a?"text-primary-600 dark:text-primary-300":"text-neutral-400 dark:text-neutral-100"}`,appearance:"custom",children:[B?e.jsx("div",{className:`${i==="parallel"?"flex items-center":`w-6 h-6 ${l<=a?"bg-primary-600":"bg-neutral-400 dark:bg-black-400"} rounded-full flex items-center justify-center text-white transition-transform duration-200 ${m?c?`group-hover:animate-nudge ${f?"group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.15)]":"group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.15)]"}`:`group-hover:scale-105 ${f?"group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.18)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.25)]":"group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.15)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.25)]"}`:""}`}`,children:r?.isLocked?e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(K.Lock,{sx:{fontSize:16}})}):e.jsx(e.Fragment,{children:a>l&&i==="linear"?e.jsx(V.CheckIcon,{size:18,className:"text-white dark:text-white"}):e.jsx(x.Typography,{size:`${i==="parallel"?"small":"extra-small"}`,variant:"medium",className:"text-neutral-100",appearance:"custom",children:l+1})})}):null,e.jsx("div",{className:`truncate mr-3 ${l<=a?"":"dark:text-black-200"}`,children:r?.label})]})})}),s!=="inline"||i==="parallel"?e.jsx("div",{className:`flex ${s==="top-right"||s==="bottom-right"?"justify-end":i==="linear"?"ml-8":""}`,children:e.jsx(x.Typography,{size:"extra-small",variant:"medium",className:`truncate ${l===a?"text-neutral-900 dark:text-white":"text-neutral-400 dark:text-neutral-600"}`,appearance:"custom",children:r?.description||""})}):null]}),l<t.length-(i==="linear"&&s==="inline"?1:0)&&!o?e.jsx("div",{className:`w-full flex-grow h-0.5 min-w-[70px] ${s!=="inline"||i==="parallel"?"my-2":""} ${l<=a-(i==="linear"&&s==="inline"?1:0)?"bg-primary-600":"bg-neutral-300"}`}):null]}),s==="inline"&&i==="linear"?e.jsx("div",{className:`w-fit max-w-full ${D}`,onClick:g,children:e.jsx(x.Typography,{size:"extra-small",variant:"medium",className:`ml-8 truncate ${l===a?"text-neutral-900 dark:text-white":"text-neutral-400 dark:text-neutral-600"}`,appearance:"custom",children:r?.description||""})}):null]})},l)};return e.jsxs("div",{className:`w-full flex ${I}`,ref:p,children:[v>0?e.jsxs("div",{className:`flex ${i==="parallel"?"flex-col":""}`,children:[m?e.jsx(M.Dropdown,{menu:{items:t.slice(0,v).map((r,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:b(r,l,!0)}),key:l}))},trigger:["click"],children:e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-u>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(j,{title:L,children:e.jsxs("div",{className:"min-w-max",children:[v," More..."]})})})}):e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-u>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(j,{title:L,children:e.jsxs("div",{className:"min-w-max",children:[v," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${i==="parallel"?"mt-2":"mt-[11px]"}`})]}):null,e.jsx("div",{className:"w-full flex flex-wrap",children:t?.map((r,l)=>v<=l&&l<d?b(r,l):null)}),t.length-d>0?e.jsxs("div",{className:"flex flex-col",children:[m?e.jsx(M.Dropdown,{menu:{items:t.slice(d,t?.length).map((r,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:b(r,l+d,!0)}),key:l}))},trigger:["click"],children:e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-d>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(j,{title:q,children:e.jsxs("div",{className:"min-w-max",children:[t.length-d," More..."]})})})}):e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-d>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(j,{title:q,children:e.jsxs("div",{className:"min-w-max",children:[t.length-d," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${i==="parallel"?"mt-2":"hidden"}`})]}):null]})};E.displayName="Stepper";module.exports=E;
|
|
2
2
|
//# sourceMappingURL=Stepper.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.cjs.js","sources":["../../../../src/components/navigation/stepper/Stepper.tsx"],"sourcesContent":["import { Lock } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport type { KeyboardEvent } from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Typography } from '../../data-display/typography/Typography';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { CheckIcon } from '../../icon';\n\nexport type TStep = {\n label: string;\n description?: string;\n isLocked?: boolean;\n tooltipText?: string;\n /** Prevents navigating to this step (e.g. validation not satisfied yet). Locked steps are always non-navigable. */\n isDisabled?: boolean;\n /** Tooltip shown when the step cannot be navigated to. Falls back to `tooltipText`. */\n disabledTooltipText?: string;\n};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n /**\n * Called when a navigable step title is clicked (or activated with Enter/Space).\n * Steps that are locked, disabled or rejected by `isStepClickable` never invoke it.\n */\n onClick?: (index: number) => void;\n /**\n * Optional gate for step navigation, so consumers can enforce their own validation\n * and step-access rules (e.g. only allow jumping to already visited steps).\n * Returning `false` renders the step title as non-navigable.\n */\n isStepClickable?: (index: number, step: TStep) => boolean;\n appearance?: 'linear' | 'parallel';\n labelPosition?: 'top' | 'bottom' | 'inline' | 'top-right' | 'bottom-right';\n className?: string;\n showIndex?: boolean;\n disableOneMore?: boolean;\n lockConfig?: {\n isLocked?: boolean;\n tooltipText?: string;\n };\n /** Whether the main sidebar is open (affects responsive calculations) */\n isMainSideBarOpen?: boolean;\n /** Whether the authoring panel is open (affects responsive calculations) */\n isAuthoringOpen?: boolean;\n};\n\n/**\n * Stepper component for multi-step workflows\n *\n * @example\n * ```tsx\n * <Stepper\n * steps={[\n * { label: 'Step 1', description: 'First step' },\n * { label: 'Step 2', description: 'Second step' },\n * { label: 'Step 3', description: 'Third step' },\n * ]}\n * currentStep={1}\n * onClick={(index) => setCurrentStep(index)}\n * // only allow jumping to steps the user has already reached\n * isStepClickable={(index) => index <= furthestVisitedStep}\n * />\n * ```\n *\n * Step titles are clickable whenever `onClick` is provided. A step is not navigable\n * when it is `isLocked`, `isDisabled`, or rejected by `isStepClickable`.\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\n isStepClickable,\n className,\n showIndex = true,\n disableOneMore = false,\n isMainSideBarOpen = false,\n isAuthoringOpen = false,\n}: TStepperProps) => {\n const stepsRef = useRef<HTMLDivElement | null>(null);\n const [visibleStepCounts, setVisibleStepCounts] = useState<number>(0);\n const [leftMostStep, setLeftMostStep] = useState<number>(0);\n const [rightMostStep, setRightMostStep] = useState<number>(0);\n const [leftTooltip, setLeftTooltip] = useState<string>('');\n const [rightTooltip, setRightTooltip] = useState<string>('');\n\n const getLabelDescriptionPosition = () => {\n if (labelPosition === 'top' || labelPosition === 'top-right') {\n return 'flex-col';\n } else if (labelPosition === 'bottom' || labelPosition === 'bottom-right') {\n return 'flex-col-reverse';\n } else if (appearance === 'linear') {\n return 'flex-row';\n } else {\n return 'flex-col';\n }\n };\n\n const handleClientWidth = () => {\n setTimeout(() => {\n setVisibleStepCounts(0);\n const moreWidth = 210;\n const stepTitleWidth = 225;\n let stepWidth = 0;\n let count = 0;\n for (let index = 0; index < steps.length; index++) {\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth > stepWidth + stepTitleWidth + moreWidth) {\n stepWidth += stepTitleWidth;\n count = index + 1;\n } else {\n break;\n }\n }\n setVisibleStepCounts(count);\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth < 480) {\n setVisibleStepCounts(steps?.length);\n }\n }, 300);\n };\n\n useEffect(() => {\n handleClientWidth();\n }, [isMainSideBarOpen, steps, currentStep]);\n\n useEffect(() => {\n setTimeout(() => {\n handleClientWidth();\n }, 300);\n }, [isAuthoringOpen]);\n\n useEffect(() => {\n if (visibleStepCounts > 0) {\n if (visibleStepCounts > currentStep) {\n let newRightTooltip = steps\n ?.slice(visibleStepCounts, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n let rightCount = visibleStepCounts;\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(0);\n setRightMostStep(rightCount);\n setRightTooltip(newRightTooltip);\n } else {\n const mid = Math.floor((visibleStepCounts + 1) / 2);\n const remainingStepsFromRight = currentStep + mid - steps?.length;\n let rightCount = currentStep + mid;\n let leftCount = currentStep - Math.max(visibleStepCounts - mid, 0) - (remainingStepsFromRight > 0 ? remainingStepsFromRight : 0);\n let newLeftTooltip = steps\n ?.slice(0, leftCount)\n ?.map((step) => step?.label)\n ?.join(', ');\n let newRightTooltip = steps\n ?.slice(rightCount, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n if (disableOneMore && leftCount === 1) {\n leftCount = 0;\n newLeftTooltip = '';\n }\n\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(leftCount);\n setRightMostStep(rightCount);\n setLeftTooltip(newLeftTooltip);\n setRightTooltip(newRightTooltip);\n }\n }\n }, [visibleStepCounts, isAuthoringOpen, isMainSideBarOpen, steps, currentStep]);\n\n useEventListener('resize', handleClientWidth);\n\n const stepDetails = (step: TStep, index: number, hideLine = false) => {\n const isStepBlocked = Boolean(step?.isLocked) || Boolean(step?.isDisabled) || (isStepClickable ? !isStepClickable(index, step) : false);\n const isNavigable = Boolean(onClick) && !isStepBlocked;\n\n const handleStepActivate = () => {\n if (!isNavigable) return;\n onClick?.(index);\n };\n\n /** Applied to the step title/description so only they react to clicks, not the connector line. */\n const titleInteractionProps = onClick\n ? {\n role: 'button' as const,\n tabIndex: isNavigable ? 0 : -1,\n 'aria-disabled': !isNavigable,\n onClick: handleStepActivate,\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleStepActivate();\n }\n },\n }\n : {};\n\n const titleInteractionClassName = onClick\n ? isNavigable\n ? 'cursor-pointer rounded-sm transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600'\n : 'cursor-not-allowed'\n : '';\n\n return (\n <div\n key={index}\n aria-current={index === currentStep ? 'step' : undefined}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px]`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div\n {...titleInteractionProps}\n className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col ${titleInteractionClassName}`}\n >\n <div className={`flex ${labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''}`}>\n <Tooltip title={isStepBlocked ? step?.disabledTooltipText || step?.tooltipText : step?.tooltipText}>\n <Typography\n size='small'\n variant='medium'\n className={`truncate flex items-center ${\n index <= currentStep ? 'text-primary-600 dark:text-primary-300' : 'text-neutral-400 dark:text-neutral-100'\n }`}\n appearance='custom'\n >\n {showIndex ? (\n <div\n className={`${\n appearance === 'parallel'\n ? 'flex items-center'\n : `w-6 h-6 ${\n index <= currentStep ? 'bg-primary-600' : 'bg-neutral-400 dark:bg-black-400'\n } rounded-full flex items-center justify-center text-white`\n }`}\n >\n {step?.isLocked ? (\n <div className='flex items-center justify-center'>\n <Lock sx={{ fontSize: 16 }} />\n </div>\n ) : (\n <>\n {currentStep > index && appearance === 'linear' ? (\n <CheckIcon size={18} className='text-white dark:text-white' />\n ) : (\n <Typography\n size={`${appearance === 'parallel' ? 'small' : 'extra-small'}`}\n variant='medium'\n className='text-neutral-100'\n appearance='custom'\n >\n {index + 1}\n </Typography>\n )}\n </>\n )}\n </div>\n ) : null}\n\n <div className={`truncate ${labelPosition === 'inline' ? 'mx-2' : 'ml-2'} ${index <= currentStep ? '' : 'dark:text-black-200'}`}>\n {step?.label}\n </div>\n </Typography>\n </Tooltip>\n </div>\n\n {labelPosition !== 'inline' || appearance === 'parallel' ? (\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : appearance === 'linear' ? 'ml-8' : ''\n }`}\n >\n <Typography\n size='extra-small'\n variant='medium'\n className={`truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n {index < steps.length - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) && !hideLine ? (\n <div\n className={`w-full flex-grow h-0.5 min-w-[70px] ${labelPosition !== 'inline' || appearance === 'parallel' ? 'my-2' : ''} ${\n index <= currentStep - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) ? 'bg-primary-600' : 'bg-neutral-300'\n }`}\n />\n ) : null}\n </div>\n {labelPosition === 'inline' && appearance === 'linear' ? (\n <div className={`w-fit max-w-full ${titleInteractionClassName}`} onClick={handleStepActivate}>\n <Typography\n size='extra-small'\n variant='medium'\n className={`ml-8 truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n </div>\n );\n };\n\n return (\n <div className={`w-full flex ${className}`} ref={stepsRef}>\n {leftMostStep > 0 ? (\n <div className={`flex ${appearance === 'parallel' ? 'flex-col' : ''}`}>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(0, leftMostStep).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n <div className={`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${appearance === 'parallel' ? 'mt-2' : 'mt-[11px]'}`} />\n </div>\n ) : null}\n\n <div className='w-full flex flex-wrap gap-3 '>\n {steps?.map((step: TStep, index: number) => {\n if (leftMostStep <= index && index < rightMostStep) {\n return stepDetails(step, index);\n }\n return null;\n })}\n </div>\n\n {steps.length - rightMostStep > 0 ? (\n <div className='flex flex-col'>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(rightMostStep, steps?.length).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index + rightMostStep, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n\n <div className={`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${appearance === 'parallel' ? 'mt-2' : 'hidden'}`} />\n </div>\n ) : null}\n </div>\n );\n};\n\nStepper.displayName = 'Stepper';\n\nexport default Stepper;\n\n\n\n"],"names":["Stepper","steps","currentStep","appearance","labelPosition","onClick","isStepClickable","className","showIndex","disableOneMore","isMainSideBarOpen","isAuthoringOpen","stepsRef","useRef","visibleStepCounts","setVisibleStepCounts","useState","leftMostStep","setLeftMostStep","rightMostStep","setRightMostStep","leftTooltip","setLeftTooltip","rightTooltip","setRightTooltip","getLabelDescriptionPosition","handleClientWidth","moreWidth","stepTitleWidth","stepWidth","count","index","useEffect","newRightTooltip","step","rightCount","mid","remainingStepsFromRight","leftCount","newLeftTooltip","useEventListener","stepDetails","hideLine","isStepBlocked","isNavigable","handleStepActivate","titleInteractionProps","event","titleInteractionClassName","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":"kUAuEMA,EAAU,CAAC,CACf,MAAAC,EACA,YAAAC,EACA,WAAAC,EAAa,SACb,cAAAC,EAAgB,SAChB,QAAAC,EACA,gBAAAC,EACA,UAAAC,EACA,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,kBAAAC,EAAoB,GACpB,gBAAAC,EAAkB,EACpB,IAAqB,CACnB,MAAMC,EAAWC,EAAAA,OAA8B,IAAI,EAC7C,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAiB,CAAC,EAC9D,CAACC,EAAcC,CAAe,EAAIF,EAAAA,SAAiB,CAAC,EACpD,CAACG,EAAeC,CAAgB,EAAIJ,EAAAA,SAAiB,CAAC,EACtD,CAACK,EAAaC,CAAc,EAAIN,EAAAA,SAAiB,EAAE,EACnD,CAACO,EAAcC,CAAe,EAAIR,EAAAA,SAAiB,EAAE,EAErDS,EAA8B,IAC9BrB,IAAkB,OAASA,IAAkB,YACxC,WACEA,IAAkB,UAAYA,IAAkB,eAClD,mBACED,IAAe,SACjB,WAEA,WAILuB,EAAoB,IAAM,CAC9B,WAAW,IAAM,CACfX,EAAqB,CAAC,EACtB,MAAMY,EAAY,IACZC,EAAiB,IACvB,IAAIC,EAAY,EACZC,EAAQ,EACZ,QAASC,EAAQ,EAAGA,EAAQ9B,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WAEX,eAACgC,EAAA,CAAQ,MAAO5B,EACd,SAAA2B,EAAAA,KAAC,MAAA,CAAI,UAAU,YACZ,SAAA,CAAAjD,EAAM,OAASkB,EAAc,UAAA,CAAA,CAChC,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EAGF8B,EAAAA,IAACG,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAW,QAAQnD,EAAM,OAASkB,EAAgB,EAAI,iBAAmB,oBAAoB,GAC7F,WAAW,WAEX,eAACgC,EAAA,CAAQ,MAAO5B,EACd,SAAA2B,EAAAA,KAAC,MAAA,CAAI,UAAU,YACZ,SAAA,CAAAjD,EAAM,OAASkB,EAAc,UAAA,CAAA,CAChC,CAAA,CACF,CAAA,CAAA,EAIJ8B,MAAC,OAAI,UAAW,+CAA+C9C,IAAe,WAAa,OAAS,QAAQ,EAAA,CAAI,CAAA,CAAA,CAClH,EACE,IAAA,EACN,CAEJ,EAEAH,EAAQ,YAAc"}
|
|
1
|
+
{"version":3,"file":"Stepper.cjs.js","sources":["../../../../src/components/navigation/stepper/Stepper.tsx"],"sourcesContent":["import { Lock } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport type { KeyboardEvent } from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Typography } from '../../data-display/typography/Typography';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { CheckIcon } from '../../icon';\n\nexport type TStep = {\n label: string;\n description?: string;\n isLocked?: boolean;\n tooltipText?: string;\n /** Prevents navigating to this step (e.g. validation not satisfied yet). Locked steps are always non-navigable. */\n isDisabled?: boolean;\n /** Tooltip shown when the step cannot be navigated to. Falls back to `tooltipText`. */\n disabledTooltipText?: string;\n};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n /**\n * Called when a navigable step title is clicked (or activated with Enter/Space).\n * Steps that are locked, disabled or rejected by `isStepClickable` never invoke it.\n */\n onClick?: (index: number) => void;\n /**\n * Optional gate for step navigation, so consumers can enforce their own validation\n * and step-access rules (e.g. only allow jumping to already visited steps).\n * Returning `false` renders the step title as non-navigable.\n */\n isStepClickable?: (index: number, step: TStep) => boolean;\n appearance?: 'linear' | 'parallel';\n labelPosition?: 'top' | 'bottom' | 'inline' | 'top-right' | 'bottom-right';\n className?: string;\n showIndex?: boolean;\n disableOneMore?: boolean;\n lockConfig?: {\n isLocked?: boolean;\n tooltipText?: string;\n };\n /** Whether the main sidebar is open (affects responsive calculations) */\n isMainSideBarOpen?: boolean;\n /** Whether the authoring panel is open (affects responsive calculations) */\n isAuthoringOpen?: boolean;\n};\n\n/**\n * Stepper component for multi-step workflows\n *\n * @example\n * ```tsx\n * <Stepper\n * steps={[\n * { label: 'Step 1', description: 'First step' },\n * { label: 'Step 2', description: 'Second step' },\n * { label: 'Step 3', description: 'Third step' },\n * ]}\n * currentStep={1}\n * onClick={(index) => setCurrentStep(index)}\n * // only allow jumping to steps the user has already reached\n * isStepClickable={(index) => index <= furthestVisitedStep}\n * />\n * ```\n *\n * Step titles are clickable whenever `onClick` is provided. A step is not navigable\n * when it is `isLocked`, `isDisabled`, or rejected by `isStepClickable`.\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\n isStepClickable,\n className,\n showIndex = true,\n disableOneMore = false,\n isMainSideBarOpen = false,\n isAuthoringOpen = false,\n}: TStepperProps) => {\n const stepsRef = useRef<HTMLDivElement | null>(null);\n const [visibleStepCounts, setVisibleStepCounts] = useState<number>(0);\n const [leftMostStep, setLeftMostStep] = useState<number>(0);\n const [rightMostStep, setRightMostStep] = useState<number>(0);\n const [leftTooltip, setLeftTooltip] = useState<string>('');\n const [rightTooltip, setRightTooltip] = useState<string>('');\n\n const getLabelDescriptionPosition = () => {\n if (labelPosition === 'top' || labelPosition === 'top-right') {\n return 'flex-col';\n } else if (labelPosition === 'bottom' || labelPosition === 'bottom-right') {\n return 'flex-col-reverse';\n } else if (appearance === 'linear') {\n return 'flex-row';\n } else {\n return 'flex-col';\n }\n };\n\n const handleClientWidth = () => {\n setTimeout(() => {\n setVisibleStepCounts(0);\n const moreWidth = 210;\n const stepTitleWidth = 225;\n let stepWidth = 0;\n let count = 0;\n for (let index = 0; index < steps.length; index++) {\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth > stepWidth + stepTitleWidth + moreWidth) {\n stepWidth += stepTitleWidth;\n count = index + 1;\n } else {\n break;\n }\n }\n setVisibleStepCounts(count);\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth < 480) {\n setVisibleStepCounts(steps?.length);\n }\n }, 300);\n };\n\n useEffect(() => {\n handleClientWidth();\n }, [isMainSideBarOpen, steps, currentStep]);\n\n useEffect(() => {\n setTimeout(() => {\n handleClientWidth();\n }, 300);\n }, [isAuthoringOpen]);\n\n useEffect(() => {\n if (visibleStepCounts > 0) {\n if (visibleStepCounts > currentStep) {\n let newRightTooltip = steps\n ?.slice(visibleStepCounts, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n let rightCount = visibleStepCounts;\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(0);\n setRightMostStep(rightCount);\n setRightTooltip(newRightTooltip);\n } else {\n const mid = Math.floor((visibleStepCounts + 1) / 2);\n const remainingStepsFromRight = currentStep + mid - steps?.length;\n let rightCount = currentStep + mid;\n let leftCount = currentStep - Math.max(visibleStepCounts - mid, 0) - (remainingStepsFromRight > 0 ? remainingStepsFromRight : 0);\n let newLeftTooltip = steps\n ?.slice(0, leftCount)\n ?.map((step) => step?.label)\n ?.join(', ');\n let newRightTooltip = steps\n ?.slice(rightCount, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n if (disableOneMore && leftCount === 1) {\n leftCount = 0;\n newLeftTooltip = '';\n }\n\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(leftCount);\n setRightMostStep(rightCount);\n setLeftTooltip(newLeftTooltip);\n setRightTooltip(newRightTooltip);\n }\n }\n }, [visibleStepCounts, isAuthoringOpen, isMainSideBarOpen, steps, currentStep]);\n\n useEventListener('resize', handleClientWidth);\n\n const stepDetails = (step: TStep, index: number, hideLine = false) => {\n const isStepBlocked = Boolean(step?.isLocked) || Boolean(step?.isDisabled) || (isStepClickable ? !isStepClickable(index, step) : false);\n const isNavigable = Boolean(onClick) && !isStepBlocked;\n /** Steps already reached (done/current) get the primary-tinted hover, upcoming steps get the neutral one. */\n const isReached = index <= currentStep;\n\n const handleStepActivate = () => {\n if (!isNavigable) return;\n onClick?.(index);\n };\n\n /** Applied to the step title/description so only they react to clicks, not the connector line. */\n const titleInteractionProps = onClick\n ? {\n role: 'button' as const,\n tabIndex: isNavigable ? 0 : -1,\n 'aria-disabled': !isNavigable,\n onClick: handleStepActivate,\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleStepActivate();\n }\n },\n }\n : {};\n\n /**\n * `group` lets the icon+label row and the dot (both nested below) react to hovering the\n * whole title via `group-hover:*`, even though the visible pill background only paints on\n * the icon+label row itself — not the description under it.\n */\n const titleInteractionClassName = onClick\n ? isNavigable\n ? 'group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 rounded-sm'\n : 'group cursor-not-allowed'\n : '';\n\n /**\n * Background for the icon+label row only (never the description below it), and sized to\n * the row's own natural box — no padding is added, so the pill can never need to paint\n * outside the element's existing bounds. That matters because the Stepper is often nested\n * inside headers/panels with little to no vertical slack (fixed row heights, `overflow-hidden`\n * wrappers), where even reserved-but-added padding gets visibly clipped.\n */\n const titleRowHoverClassName = onClick\n ? `rounded-full transition-colors duration-200 w-24 h-9 ${\n isNavigable\n ? isReached\n ? 'group-hover:bg-primary-50 dark:group-hover:bg-primary-950'\n : 'group-hover:bg-neutral-100 dark:group-hover:bg-black-700'\n : 'group-hover:bg-neutral-50 dark:group-hover:bg-black-800'\n }`\n : '';\n\n return (\n <div\n key={index}\n aria-current={index === currentStep ? 'step' : undefined}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px]`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div\n {...titleInteractionProps}\n className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col ${titleInteractionClassName}`}\n >\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''\n } ${titleRowHoverClassName}`}\n >\n <Tooltip title={isStepBlocked ? step?.disabledTooltipText || step?.tooltipText : step?.tooltipText} className='w-full'>\n <Typography\n size='small'\n variant='medium'\n className={`truncate flex items-center justify-center gap-2 h-9 ${\n index <= currentStep ? 'text-primary-600 dark:text-primary-300' : 'text-neutral-400 dark:text-neutral-100'\n }`}\n appearance='custom'\n >\n {showIndex ? (\n <div\n className={`${\n appearance === 'parallel'\n ? 'flex items-center'\n : `w-6 h-6 ${\n index <= currentStep ? 'bg-primary-600' : 'bg-neutral-400 dark:bg-black-400'\n } rounded-full flex items-center justify-center text-white transition-transform duration-200 ${\n onClick\n ? isStepBlocked\n ? `group-hover:animate-nudge ${\n isReached\n ? 'group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.15)]'\n : 'group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.15)]'\n }`\n : `group-hover:scale-105 ${\n isReached\n ? 'group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.18)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.25)]'\n : 'group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.15)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.25)]'\n }`\n : ''\n }`\n }`}\n >\n {step?.isLocked ? (\n <div className='flex items-center justify-center'>\n <Lock sx={{ fontSize: 16 }} />\n </div>\n ) : (\n <>\n {currentStep > index && appearance === 'linear' ? (\n <CheckIcon size={18} className='text-white dark:text-white' />\n ) : (\n <Typography\n size={`${appearance === 'parallel' ? 'small' : 'extra-small'}`}\n variant='medium'\n className='text-neutral-100'\n appearance='custom'\n >\n {index + 1}\n </Typography>\n )}\n </>\n )}\n </div>\n ) : null}\n\n <div className={`truncate mr-3 ${index <= currentStep ? '' : 'dark:text-black-200'}`}>\n {step?.label}\n </div>\n </Typography>\n </Tooltip>\n </div>\n\n {labelPosition !== 'inline' || appearance === 'parallel' ? (\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : appearance === 'linear' ? 'ml-8' : ''\n }`}\n >\n <Typography\n size='extra-small'\n variant='medium'\n className={`truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n {index < steps.length - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) && !hideLine ? (\n <div\n className={`w-full flex-grow h-0.5 min-w-[70px] ${labelPosition !== 'inline' || appearance === 'parallel' ? 'my-2' : ''} ${\n index <= currentStep - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) ? 'bg-primary-600' : 'bg-neutral-300'\n }`}\n />\n ) : null}\n </div>\n {labelPosition === 'inline' && appearance === 'linear' ? (\n <div className={`w-fit max-w-full ${titleInteractionClassName}`} onClick={handleStepActivate}>\n <Typography\n size='extra-small'\n variant='medium'\n className={`ml-8 truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n </div>\n );\n };\n\n return (\n <div className={`w-full flex ${className}`} ref={stepsRef}>\n {leftMostStep > 0 ? (\n <div className={`flex ${appearance === 'parallel' ? 'flex-col' : ''}`}>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(0, leftMostStep).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n <div className={`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${appearance === 'parallel' ? 'mt-2' : 'mt-[11px]'}`} />\n </div>\n ) : null}\n\n <div className='w-full flex flex-wrap'>\n {steps?.map((step: TStep, index: number) => {\n if (leftMostStep <= index && index < rightMostStep) {\n return stepDetails(step, index);\n }\n return null;\n })}\n </div>\n\n {steps.length - rightMostStep > 0 ? (\n <div className='flex flex-col'>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(rightMostStep, steps?.length).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index + rightMostStep, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n\n <div className={`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${appearance === 'parallel' ? 'mt-2' : 'hidden'}`} />\n </div>\n ) : null}\n </div>\n );\n};\n\nStepper.displayName = 'Stepper';\n\nexport default Stepper;\n\n\n\n"],"names":["Stepper","steps","currentStep","appearance","labelPosition","onClick","isStepClickable","className","showIndex","disableOneMore","isMainSideBarOpen","isAuthoringOpen","stepsRef","useRef","visibleStepCounts","setVisibleStepCounts","useState","leftMostStep","setLeftMostStep","rightMostStep","setRightMostStep","leftTooltip","setLeftTooltip","rightTooltip","setRightTooltip","getLabelDescriptionPosition","handleClientWidth","moreWidth","stepTitleWidth","stepWidth","count","index","useEffect","newRightTooltip","step","rightCount","mid","remainingStepsFromRight","leftCount","newLeftTooltip","useEventListener","stepDetails","hideLine","isStepBlocked","isNavigable","isReached","handleStepActivate","titleInteractionProps","event","titleInteractionClassName","titleRowHoverClassName","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":"kUAuEMA,EAAU,CAAC,CACf,MAAAC,EACA,YAAAC,EACA,WAAAC,EAAa,SACb,cAAAC,EAAgB,SAChB,QAAAC,EACA,gBAAAC,EACA,UAAAC,EACA,UAAAC,EAAY,GACZ,eAAAC,EAAiB,GACjB,kBAAAC,EAAoB,GACpB,gBAAAC,EAAkB,EACpB,IAAqB,CACnB,MAAMC,EAAWC,EAAAA,OAA8B,IAAI,EAC7C,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAiB,CAAC,EAC9D,CAACC,EAAcC,CAAe,EAAIF,EAAAA,SAAiB,CAAC,EACpD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,122 @@
|
|
|
1
1
|
import { jsxs as c, jsx as l, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { Lock as G } from "@mui/icons-material";
|
|
3
|
-
import { Dropdown as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import
|
|
7
|
-
import { useEventListener as
|
|
8
|
-
import { CheckIcon as
|
|
9
|
-
const
|
|
3
|
+
import { Dropdown as C } from "antd";
|
|
4
|
+
import { useRef as J, useState as w, useEffect as T } from "react";
|
|
5
|
+
import { Typography as f } from "../../data-display/typography/Typography.es.js";
|
|
6
|
+
import N from "../../tooltip/Tooltip.es.js";
|
|
7
|
+
import { useEventListener as Q } from "../../../hooks/useEventListener.es.js";
|
|
8
|
+
import { CheckIcon as U } from "../../icon/icons.generated.es.js";
|
|
9
|
+
const X = ({
|
|
10
10
|
steps: t,
|
|
11
|
-
currentStep:
|
|
11
|
+
currentStep: i,
|
|
12
12
|
appearance: a = "linear",
|
|
13
|
-
labelPosition:
|
|
14
|
-
onClick:
|
|
15
|
-
isStepClickable:
|
|
16
|
-
className:
|
|
17
|
-
showIndex:
|
|
18
|
-
disableOneMore:
|
|
19
|
-
isMainSideBarOpen:
|
|
20
|
-
isAuthoringOpen:
|
|
13
|
+
labelPosition: o = "inline",
|
|
14
|
+
onClick: d,
|
|
15
|
+
isStepClickable: z,
|
|
16
|
+
className: E,
|
|
17
|
+
showIndex: F = !0,
|
|
18
|
+
disableOneMore: b = !1,
|
|
19
|
+
isMainSideBarOpen: j = !1,
|
|
20
|
+
isAuthoringOpen: R = !1
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
22
|
+
const p = J(null), [h, _] = w(0), [v, L] = w(0), [u, W] = w(0), [M, H] = w(""), [D, I] = w(""), K = () => o === "top" || o === "top-right" ? "flex-col" : o === "bottom" || o === "bottom-right" ? "flex-col-reverse" : a === "linear" ? "flex-row" : "flex-col", $ = () => {
|
|
23
23
|
setTimeout(() => {
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
for (let
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
_(0);
|
|
25
|
+
const r = 210, e = 225;
|
|
26
|
+
let s = 0, m = 0;
|
|
27
|
+
for (let n = 0; n < t.length && (p?.current?.clientWidth && p?.current?.clientWidth > s + e + r); n++)
|
|
28
|
+
s += e, m = n + 1;
|
|
29
|
+
_(m), p?.current?.clientWidth && p?.current?.clientWidth < 480 && _(t?.length);
|
|
30
30
|
}, 300);
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [
|
|
32
|
+
T(() => {
|
|
33
|
+
$();
|
|
34
|
+
}, [j, t, i]), T(() => {
|
|
35
35
|
setTimeout(() => {
|
|
36
|
-
|
|
36
|
+
$();
|
|
37
37
|
}, 300);
|
|
38
|
-
}, [
|
|
39
|
-
if (
|
|
40
|
-
if (
|
|
41
|
-
let
|
|
42
|
-
|
|
38
|
+
}, [R]), T(() => {
|
|
39
|
+
if (h > 0)
|
|
40
|
+
if (h > i) {
|
|
41
|
+
let r = t?.slice(h, t?.length)?.map((s) => s?.label)?.join(", "), e = h;
|
|
42
|
+
b && e === t.length - 1 && (e = t.length, r = ""), L(0), W(e), I(r);
|
|
43
43
|
} else {
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
|
|
44
|
+
const r = Math.floor((h + 1) / 2), e = i + r - t?.length;
|
|
45
|
+
let s = i + r, m = i - Math.max(h - r, 0) - (e > 0 ? e : 0), n = t?.slice(0, m)?.map((g) => g?.label)?.join(", "), x = t?.slice(s, t?.length)?.map((g) => g?.label)?.join(", ");
|
|
46
|
+
b && m === 1 && (m = 0, n = ""), b && s === t.length - 1 && (s = t.length, x = ""), L(m), W(s), H(n), I(x);
|
|
47
47
|
}
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
48
|
+
}, [h, R, j, t, i]), Q("resize", $);
|
|
49
|
+
const k = (r, e, s = !1) => {
|
|
50
|
+
const m = !!r?.isLocked || !!r?.isDisabled || (z ? !z(e, r) : !1), n = !!d && !m, x = e <= i, g = () => {
|
|
51
|
+
n && d?.(e);
|
|
52
|
+
}, V = d ? {
|
|
53
53
|
role: "button",
|
|
54
|
-
tabIndex:
|
|
55
|
-
"aria-disabled": !
|
|
56
|
-
onClick:
|
|
57
|
-
onKeyDown: (
|
|
58
|
-
(
|
|
54
|
+
tabIndex: n ? 0 : -1,
|
|
55
|
+
"aria-disabled": !n,
|
|
56
|
+
onClick: g,
|
|
57
|
+
onKeyDown: (y) => {
|
|
58
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), g());
|
|
59
59
|
}
|
|
60
|
-
} : {}, B =
|
|
60
|
+
} : {}, B = d ? n ? "group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 rounded-sm" : "group cursor-not-allowed" : "", q = d ? `rounded-full transition-colors duration-200 w-24 h-9 ${n ? x ? "group-hover:bg-primary-50 dark:group-hover:bg-primary-950" : "group-hover:bg-neutral-100 dark:group-hover:bg-black-700" : "group-hover:bg-neutral-50 dark:group-hover:bg-black-800"}` : "";
|
|
61
61
|
return /* @__PURE__ */ l(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
|
-
"aria-current": e ===
|
|
64
|
+
"aria-current": e === i ? "step" : void 0,
|
|
65
65
|
className: `flex ${e < t.length - 1 || a == "parallel" ? "flex flex-grow" : ""} min-w-[200px]`,
|
|
66
66
|
children: /* @__PURE__ */ c("div", { className: "w-full flex flex-col", children: [
|
|
67
|
-
/* @__PURE__ */ c("div", { className: `flex ${
|
|
67
|
+
/* @__PURE__ */ c("div", { className: `flex ${K()} ${o === "inline" && a === "linear" ? "items-center" : ""}`, children: [
|
|
68
68
|
/* @__PURE__ */ c(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
|
-
...
|
|
72
|
-
className: `${
|
|
71
|
+
...V,
|
|
72
|
+
className: `${o === "inline" ? "max-w-[70%]" : "w-full"} flex flex-col ${B}`,
|
|
73
73
|
children: [
|
|
74
|
-
/* @__PURE__ */ l(
|
|
75
|
-
|
|
74
|
+
/* @__PURE__ */ l(
|
|
75
|
+
"div",
|
|
76
76
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
className: `flex ${o === "top-right" || o === "bottom-right" ? "justify-end" : ""} ${q}`,
|
|
78
|
+
children: /* @__PURE__ */ l(N, { title: m && r?.disabledTooltipText || r?.tooltipText, className: "w-full", children: /* @__PURE__ */ c(
|
|
79
|
+
f,
|
|
80
|
+
{
|
|
81
|
+
size: "small",
|
|
82
|
+
variant: "medium",
|
|
83
|
+
className: `truncate flex items-center justify-center gap-2 h-9 ${e <= i ? "text-primary-600 dark:text-primary-300" : "text-neutral-400 dark:text-neutral-100"}`,
|
|
84
|
+
appearance: "custom",
|
|
85
|
+
children: [
|
|
86
|
+
F ? /* @__PURE__ */ l(
|
|
87
|
+
"div",
|
|
88
88
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
className: `${a === "parallel" ? "flex items-center" : `w-6 h-6 ${e <= i ? "bg-primary-600" : "bg-neutral-400 dark:bg-black-400"} rounded-full flex items-center justify-center text-white transition-transform duration-200 ${d ? m ? `group-hover:animate-nudge ${x ? "group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.15)]" : "group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.15)]"}` : `group-hover:scale-105 ${x ? "group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.18)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.25)]" : "group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.15)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.25)]"}` : ""}`}`,
|
|
90
|
+
children: r?.isLocked ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ l(G, { sx: { fontSize: 16 } }) }) : /* @__PURE__ */ l(A, { children: i > e && a === "linear" ? /* @__PURE__ */ l(U, { size: 18, className: "text-white dark:text-white" }) : /* @__PURE__ */ l(
|
|
91
|
+
f,
|
|
92
|
+
{
|
|
93
|
+
size: `${a === "parallel" ? "small" : "extra-small"}`,
|
|
94
|
+
variant: "medium",
|
|
95
|
+
className: "text-neutral-100",
|
|
96
|
+
appearance: "custom",
|
|
97
|
+
children: e + 1
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
94
100
|
}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
) : null,
|
|
102
|
+
/* @__PURE__ */ l("div", { className: `truncate mr-3 ${e <= i ? "" : "dark:text-black-200"}`, children: r?.label })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
) })
|
|
100
106
|
}
|
|
101
|
-
)
|
|
102
|
-
|
|
107
|
+
),
|
|
108
|
+
o !== "inline" || a === "parallel" ? /* @__PURE__ */ l(
|
|
103
109
|
"div",
|
|
104
110
|
{
|
|
105
|
-
className: `flex ${
|
|
111
|
+
className: `flex ${o === "top-right" || o === "bottom-right" ? "justify-end" : a === "linear" ? "ml-8" : ""}`,
|
|
106
112
|
children: /* @__PURE__ */ l(
|
|
107
|
-
|
|
113
|
+
f,
|
|
108
114
|
{
|
|
109
115
|
size: "extra-small",
|
|
110
116
|
variant: "medium",
|
|
111
|
-
className: `truncate ${e ===
|
|
117
|
+
className: `truncate ${e === i ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
|
|
112
118
|
appearance: "custom",
|
|
113
|
-
children:
|
|
119
|
+
children: r?.description || ""
|
|
114
120
|
}
|
|
115
121
|
)
|
|
116
122
|
}
|
|
@@ -118,21 +124,21 @@ const U = ({
|
|
|
118
124
|
]
|
|
119
125
|
}
|
|
120
126
|
),
|
|
121
|
-
e < t.length - (a === "linear" &&
|
|
127
|
+
e < t.length - (a === "linear" && o === "inline" ? 1 : 0) && !s ? /* @__PURE__ */ l(
|
|
122
128
|
"div",
|
|
123
129
|
{
|
|
124
|
-
className: `w-full flex-grow h-0.5 min-w-[70px] ${
|
|
130
|
+
className: `w-full flex-grow h-0.5 min-w-[70px] ${o !== "inline" || a === "parallel" ? "my-2" : ""} ${e <= i - (a === "linear" && o === "inline" ? 1 : 0) ? "bg-primary-600" : "bg-neutral-300"}`
|
|
125
131
|
}
|
|
126
132
|
) : null
|
|
127
133
|
] }),
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
o === "inline" && a === "linear" ? /* @__PURE__ */ l("div", { className: `w-fit max-w-full ${B}`, onClick: g, children: /* @__PURE__ */ l(
|
|
135
|
+
f,
|
|
130
136
|
{
|
|
131
137
|
size: "extra-small",
|
|
132
138
|
variant: "medium",
|
|
133
|
-
className: `ml-8 truncate ${e ===
|
|
139
|
+
className: `ml-8 truncate ${e === i ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
|
|
134
140
|
appearance: "custom",
|
|
135
|
-
children:
|
|
141
|
+
children: r?.description || ""
|
|
136
142
|
}
|
|
137
143
|
) }) : null
|
|
138
144
|
] })
|
|
@@ -140,26 +146,26 @@ const U = ({
|
|
|
140
146
|
e
|
|
141
147
|
);
|
|
142
148
|
};
|
|
143
|
-
return /* @__PURE__ */ c("div", { className: `w-full flex ${
|
|
149
|
+
return /* @__PURE__ */ c("div", { className: `w-full flex ${E}`, ref: p, children: [
|
|
144
150
|
v > 0 ? /* @__PURE__ */ c("div", { className: `flex ${a === "parallel" ? "flex-col" : ""}`, children: [
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
d ? /* @__PURE__ */ l(
|
|
152
|
+
C,
|
|
147
153
|
{
|
|
148
154
|
menu: {
|
|
149
|
-
items: t.slice(0, v).map((
|
|
150
|
-
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children:
|
|
155
|
+
items: t.slice(0, v).map((r, e) => ({
|
|
156
|
+
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children: k(r, e, !0) }),
|
|
151
157
|
key: e
|
|
152
158
|
}))
|
|
153
159
|
},
|
|
154
160
|
trigger: ["click"],
|
|
155
161
|
children: /* @__PURE__ */ l(
|
|
156
|
-
|
|
162
|
+
f,
|
|
157
163
|
{
|
|
158
164
|
size: "small",
|
|
159
165
|
variant: "medium",
|
|
160
|
-
className: `px-2 ${t.length -
|
|
166
|
+
className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
161
167
|
appearance: "subtitle",
|
|
162
|
-
children: /* @__PURE__ */ l(
|
|
168
|
+
children: /* @__PURE__ */ l(N, { title: M, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
163
169
|
v,
|
|
164
170
|
" More..."
|
|
165
171
|
] }) })
|
|
@@ -167,13 +173,13 @@ const U = ({
|
|
|
167
173
|
)
|
|
168
174
|
}
|
|
169
175
|
) : /* @__PURE__ */ l(
|
|
170
|
-
|
|
176
|
+
f,
|
|
171
177
|
{
|
|
172
178
|
size: "small",
|
|
173
179
|
variant: "medium",
|
|
174
|
-
className: `px-2 ${t.length -
|
|
180
|
+
className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
175
181
|
appearance: "subtitle",
|
|
176
|
-
children: /* @__PURE__ */ l(
|
|
182
|
+
children: /* @__PURE__ */ l(N, { title: M, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
177
183
|
v,
|
|
178
184
|
" More..."
|
|
179
185
|
] }) })
|
|
@@ -181,41 +187,41 @@ const U = ({
|
|
|
181
187
|
),
|
|
182
188
|
/* @__PURE__ */ l("div", { className: `h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${a === "parallel" ? "mt-2" : "mt-[11px]"}` })
|
|
183
189
|
] }) : null,
|
|
184
|
-
/* @__PURE__ */ l("div", { className: "w-full flex flex-wrap
|
|
185
|
-
t.length -
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
/* @__PURE__ */ l("div", { className: "w-full flex flex-wrap", children: t?.map((r, e) => v <= e && e < u ? k(r, e) : null) }),
|
|
191
|
+
t.length - u > 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
192
|
+
d ? /* @__PURE__ */ l(
|
|
193
|
+
C,
|
|
188
194
|
{
|
|
189
195
|
menu: {
|
|
190
|
-
items: t.slice(
|
|
191
|
-
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children:
|
|
196
|
+
items: t.slice(u, t?.length).map((r, e) => ({
|
|
197
|
+
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children: k(r, e + u, !0) }),
|
|
192
198
|
key: e
|
|
193
199
|
}))
|
|
194
200
|
},
|
|
195
201
|
trigger: ["click"],
|
|
196
202
|
children: /* @__PURE__ */ l(
|
|
197
|
-
|
|
203
|
+
f,
|
|
198
204
|
{
|
|
199
205
|
size: "small",
|
|
200
206
|
variant: "medium",
|
|
201
|
-
className: `px-2 ${t.length -
|
|
207
|
+
className: `px-2 ${t.length - u > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
202
208
|
appearance: "subtitle",
|
|
203
|
-
children: /* @__PURE__ */ l(
|
|
204
|
-
t.length -
|
|
209
|
+
children: /* @__PURE__ */ l(N, { title: D, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
210
|
+
t.length - u,
|
|
205
211
|
" More..."
|
|
206
212
|
] }) })
|
|
207
213
|
}
|
|
208
214
|
)
|
|
209
215
|
}
|
|
210
216
|
) : /* @__PURE__ */ l(
|
|
211
|
-
|
|
217
|
+
f,
|
|
212
218
|
{
|
|
213
219
|
size: "small",
|
|
214
220
|
variant: "medium",
|
|
215
|
-
className: `px-2 ${t.length -
|
|
221
|
+
className: `px-2 ${t.length - u > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
216
222
|
appearance: "subtitle",
|
|
217
|
-
children: /* @__PURE__ */ l(
|
|
218
|
-
t.length -
|
|
223
|
+
children: /* @__PURE__ */ l(N, { title: D, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
224
|
+
t.length - u,
|
|
219
225
|
" More..."
|
|
220
226
|
] }) })
|
|
221
227
|
}
|
|
@@ -224,8 +230,8 @@ const U = ({
|
|
|
224
230
|
] }) : null
|
|
225
231
|
] });
|
|
226
232
|
};
|
|
227
|
-
|
|
233
|
+
X.displayName = "Stepper";
|
|
228
234
|
export {
|
|
229
|
-
|
|
235
|
+
X as default
|
|
230
236
|
};
|
|
231
237
|
//# sourceMappingURL=Stepper.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.es.js","sources":["../../../../src/components/navigation/stepper/Stepper.tsx"],"sourcesContent":["import { Lock } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport type { KeyboardEvent } from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Typography } from '../../data-display/typography/Typography';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { CheckIcon } from '../../icon';\n\nexport type TStep = {\n label: string;\n description?: string;\n isLocked?: boolean;\n tooltipText?: string;\n /** Prevents navigating to this step (e.g. validation not satisfied yet). Locked steps are always non-navigable. */\n isDisabled?: boolean;\n /** Tooltip shown when the step cannot be navigated to. Falls back to `tooltipText`. */\n disabledTooltipText?: string;\n};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n /**\n * Called when a navigable step title is clicked (or activated with Enter/Space).\n * Steps that are locked, disabled or rejected by `isStepClickable` never invoke it.\n */\n onClick?: (index: number) => void;\n /**\n * Optional gate for step navigation, so consumers can enforce their own validation\n * and step-access rules (e.g. only allow jumping to already visited steps).\n * Returning `false` renders the step title as non-navigable.\n */\n isStepClickable?: (index: number, step: TStep) => boolean;\n appearance?: 'linear' | 'parallel';\n labelPosition?: 'top' | 'bottom' | 'inline' | 'top-right' | 'bottom-right';\n className?: string;\n showIndex?: boolean;\n disableOneMore?: boolean;\n lockConfig?: {\n isLocked?: boolean;\n tooltipText?: string;\n };\n /** Whether the main sidebar is open (affects responsive calculations) */\n isMainSideBarOpen?: boolean;\n /** Whether the authoring panel is open (affects responsive calculations) */\n isAuthoringOpen?: boolean;\n};\n\n/**\n * Stepper component for multi-step workflows\n *\n * @example\n * ```tsx\n * <Stepper\n * steps={[\n * { label: 'Step 1', description: 'First step' },\n * { label: 'Step 2', description: 'Second step' },\n * { label: 'Step 3', description: 'Third step' },\n * ]}\n * currentStep={1}\n * onClick={(index) => setCurrentStep(index)}\n * // only allow jumping to steps the user has already reached\n * isStepClickable={(index) => index <= furthestVisitedStep}\n * />\n * ```\n *\n * Step titles are clickable whenever `onClick` is provided. A step is not navigable\n * when it is `isLocked`, `isDisabled`, or rejected by `isStepClickable`.\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\n isStepClickable,\n className,\n showIndex = true,\n disableOneMore = false,\n isMainSideBarOpen = false,\n isAuthoringOpen = false,\n}: TStepperProps) => {\n const stepsRef = useRef<HTMLDivElement | null>(null);\n const [visibleStepCounts, setVisibleStepCounts] = useState<number>(0);\n const [leftMostStep, setLeftMostStep] = useState<number>(0);\n const [rightMostStep, setRightMostStep] = useState<number>(0);\n const [leftTooltip, setLeftTooltip] = useState<string>('');\n const [rightTooltip, setRightTooltip] = useState<string>('');\n\n const getLabelDescriptionPosition = () => {\n if (labelPosition === 'top' || labelPosition === 'top-right') {\n return 'flex-col';\n } else if (labelPosition === 'bottom' || labelPosition === 'bottom-right') {\n return 'flex-col-reverse';\n } else if (appearance === 'linear') {\n return 'flex-row';\n } else {\n return 'flex-col';\n }\n };\n\n const handleClientWidth = () => {\n setTimeout(() => {\n setVisibleStepCounts(0);\n const moreWidth = 210;\n const stepTitleWidth = 225;\n let stepWidth = 0;\n let count = 0;\n for (let index = 0; index < steps.length; index++) {\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth > stepWidth + stepTitleWidth + moreWidth) {\n stepWidth += stepTitleWidth;\n count = index + 1;\n } else {\n break;\n }\n }\n setVisibleStepCounts(count);\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth < 480) {\n setVisibleStepCounts(steps?.length);\n }\n }, 300);\n };\n\n useEffect(() => {\n handleClientWidth();\n }, [isMainSideBarOpen, steps, currentStep]);\n\n useEffect(() => {\n setTimeout(() => {\n handleClientWidth();\n }, 300);\n }, [isAuthoringOpen]);\n\n useEffect(() => {\n if (visibleStepCounts > 0) {\n if (visibleStepCounts > currentStep) {\n let newRightTooltip = steps\n ?.slice(visibleStepCounts, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n let rightCount = visibleStepCounts;\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(0);\n setRightMostStep(rightCount);\n setRightTooltip(newRightTooltip);\n } else {\n const mid = Math.floor((visibleStepCounts + 1) / 2);\n const remainingStepsFromRight = currentStep + mid - steps?.length;\n let rightCount = currentStep + mid;\n let leftCount = currentStep - Math.max(visibleStepCounts - mid, 0) - (remainingStepsFromRight > 0 ? remainingStepsFromRight : 0);\n let newLeftTooltip = steps\n ?.slice(0, leftCount)\n ?.map((step) => step?.label)\n ?.join(', ');\n let newRightTooltip = steps\n ?.slice(rightCount, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n if (disableOneMore && leftCount === 1) {\n leftCount = 0;\n newLeftTooltip = '';\n }\n\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(leftCount);\n setRightMostStep(rightCount);\n setLeftTooltip(newLeftTooltip);\n setRightTooltip(newRightTooltip);\n }\n }\n }, [visibleStepCounts, isAuthoringOpen, isMainSideBarOpen, steps, currentStep]);\n\n useEventListener('resize', handleClientWidth);\n\n const stepDetails = (step: TStep, index: number, hideLine = false) => {\n const isStepBlocked = Boolean(step?.isLocked) || Boolean(step?.isDisabled) || (isStepClickable ? !isStepClickable(index, step) : false);\n const isNavigable = Boolean(onClick) && !isStepBlocked;\n\n const handleStepActivate = () => {\n if (!isNavigable) return;\n onClick?.(index);\n };\n\n /** Applied to the step title/description so only they react to clicks, not the connector line. */\n const titleInteractionProps = onClick\n ? {\n role: 'button' as const,\n tabIndex: isNavigable ? 0 : -1,\n 'aria-disabled': !isNavigable,\n onClick: handleStepActivate,\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleStepActivate();\n }\n },\n }\n : {};\n\n const titleInteractionClassName = onClick\n ? isNavigable\n ? 'cursor-pointer rounded-sm transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600'\n : 'cursor-not-allowed'\n : '';\n\n return (\n <div\n key={index}\n aria-current={index === currentStep ? 'step' : undefined}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px]`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div\n {...titleInteractionProps}\n className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col ${titleInteractionClassName}`}\n >\n <div className={`flex ${labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''}`}>\n <Tooltip title={isStepBlocked ? step?.disabledTooltipText || step?.tooltipText : step?.tooltipText}>\n <Typography\n size='small'\n variant='medium'\n className={`truncate flex items-center ${\n index <= currentStep ? 'text-primary-600 dark:text-primary-300' : 'text-neutral-400 dark:text-neutral-100'\n }`}\n appearance='custom'\n >\n {showIndex ? (\n <div\n className={`${\n appearance === 'parallel'\n ? 'flex items-center'\n : `w-6 h-6 ${\n index <= currentStep ? 'bg-primary-600' : 'bg-neutral-400 dark:bg-black-400'\n } rounded-full flex items-center justify-center text-white`\n }`}\n >\n {step?.isLocked ? (\n <div className='flex items-center justify-center'>\n <Lock sx={{ fontSize: 16 }} />\n </div>\n ) : (\n <>\n {currentStep > index && appearance === 'linear' ? (\n <CheckIcon size={18} className='text-white dark:text-white' />\n ) : (\n <Typography\n size={`${appearance === 'parallel' ? 'small' : 'extra-small'}`}\n variant='medium'\n className='text-neutral-100'\n appearance='custom'\n >\n {index + 1}\n </Typography>\n )}\n </>\n )}\n </div>\n ) : null}\n\n <div className={`truncate ${labelPosition === 'inline' ? 'mx-2' : 'ml-2'} ${index <= currentStep ? '' : 'dark:text-black-200'}`}>\n {step?.label}\n </div>\n </Typography>\n </Tooltip>\n </div>\n\n {labelPosition !== 'inline' || appearance === 'parallel' ? (\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : appearance === 'linear' ? 'ml-8' : ''\n }`}\n >\n <Typography\n size='extra-small'\n variant='medium'\n className={`truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n {index < steps.length - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) && !hideLine ? (\n <div\n className={`w-full flex-grow h-0.5 min-w-[70px] ${labelPosition !== 'inline' || appearance === 'parallel' ? 'my-2' : ''} ${\n index <= currentStep - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) ? 'bg-primary-600' : 'bg-neutral-300'\n }`}\n />\n ) : null}\n </div>\n {labelPosition === 'inline' && appearance === 'linear' ? (\n <div className={`w-fit max-w-full ${titleInteractionClassName}`} onClick={handleStepActivate}>\n <Typography\n size='extra-small'\n variant='medium'\n className={`ml-8 truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n </div>\n );\n };\n\n return (\n <div className={`w-full flex ${className}`} ref={stepsRef}>\n {leftMostStep > 0 ? (\n <div className={`flex ${appearance === 'parallel' ? 'flex-col' : ''}`}>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(0, leftMostStep).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n <div className={`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${appearance === 'parallel' ? 'mt-2' : 'mt-[11px]'}`} />\n </div>\n ) : null}\n\n <div className='w-full flex flex-wrap gap-3 '>\n {steps?.map((step: TStep, index: number) => {\n if (leftMostStep <= index && index < rightMostStep) {\n return stepDetails(step, index);\n }\n return null;\n })}\n </div>\n\n {steps.length - rightMostStep > 0 ? (\n <div className='flex flex-col'>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(rightMostStep, steps?.length).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index + rightMostStep, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n\n <div className={`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${appearance === 'parallel' ? 'mt-2' : 'hidden'}`} />\n </div>\n ) : null}\n </div>\n );\n};\n\nStepper.displayName = 'Stepper';\n\nexport default Stepper;\n\n\n\n"],"names":["Stepper","steps","currentStep","appearance","labelPosition","onClick","isStepClickable","className","showIndex","disableOneMore","isMainSideBarOpen","isAuthoringOpen","stepsRef","useRef","visibleStepCounts","setVisibleStepCounts","useState","leftMostStep","setLeftMostStep","rightMostStep","setRightMostStep","leftTooltip","setLeftTooltip","rightTooltip","setRightTooltip","getLabelDescriptionPosition","handleClientWidth","moreWidth","stepTitleWidth","stepWidth","count","index","useEffect","newRightTooltip","step","rightCount","mid","remainingStepsFromRight","leftCount","newLeftTooltip","useEventListener","stepDetails","hideLine","isStepBlocked","isNavigable","handleStepActivate","titleInteractionProps","event","titleInteractionClassName","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":";;;;;;;;AAuEA,MAAMA,IAAU,CAAC;AAAA,EACf,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAAA,EAChB,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,gBAAAC,IAAiB;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,OAAmB;AAAA,cACpF,OAAO,gBAAAkB,EAAC,OAAA,EAAI,WAAU,aAAa,YAAYf,GAAMH,IAAQZ,GAAe,EAAI,EAAA,CAAE;AAAA,cAClF,KAAKY;AAAA,YAAA,EACL;AAAA,UAAA;AAAA,UAEJ,SAAS,CAAC,OAAO;AAAA,UAEjB,UAAA,gBAAAkB;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,WAAW,QAAQnD,EAAM,SAASkB,IAAgB,IAAI,mBAAmB,oBAAoB;AAAA,cAC7F,YAAW;AAAA,cAEX,4BAACgC,GAAA,EAAQ,OAAO5B,GACd,UAAA,gBAAA2B,EAAC,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,gBAAAjD,EAAM,SAASkB;AAAA,gBAAc;AAAA,cAAA,EAAA,CAChC,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,IAGF,gBAAA8B;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAW,QAAQnD,EAAM,SAASkB,IAAgB,IAAI,mBAAmB,oBAAoB;AAAA,UAC7F,YAAW;AAAA,UAEX,4BAACgC,GAAA,EAAQ,OAAO5B,GACd,UAAA,gBAAA2B,EAAC,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,YAAAjD,EAAM,SAASkB;AAAA,YAAc;AAAA,UAAA,EAAA,CAChC,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,MAIJ,gBAAA8B,EAAC,SAAI,WAAW,+CAA+C9C,MAAe,aAAa,SAAS,QAAQ,GAAA,CAAI;AAAA,IAAA,EAAA,CAClH,IACE;AAAA,EAAA,GACN;AAEJ;AAEAH,EAAQ,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Stepper.es.js","sources":["../../../../src/components/navigation/stepper/Stepper.tsx"],"sourcesContent":["import { Lock } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport type { KeyboardEvent } from 'react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { Typography } from '../../data-display/typography/Typography';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { CheckIcon } from '../../icon';\n\nexport type TStep = {\n label: string;\n description?: string;\n isLocked?: boolean;\n tooltipText?: string;\n /** Prevents navigating to this step (e.g. validation not satisfied yet). Locked steps are always non-navigable. */\n isDisabled?: boolean;\n /** Tooltip shown when the step cannot be navigated to. Falls back to `tooltipText`. */\n disabledTooltipText?: string;\n};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n /**\n * Called when a navigable step title is clicked (or activated with Enter/Space).\n * Steps that are locked, disabled or rejected by `isStepClickable` never invoke it.\n */\n onClick?: (index: number) => void;\n /**\n * Optional gate for step navigation, so consumers can enforce their own validation\n * and step-access rules (e.g. only allow jumping to already visited steps).\n * Returning `false` renders the step title as non-navigable.\n */\n isStepClickable?: (index: number, step: TStep) => boolean;\n appearance?: 'linear' | 'parallel';\n labelPosition?: 'top' | 'bottom' | 'inline' | 'top-right' | 'bottom-right';\n className?: string;\n showIndex?: boolean;\n disableOneMore?: boolean;\n lockConfig?: {\n isLocked?: boolean;\n tooltipText?: string;\n };\n /** Whether the main sidebar is open (affects responsive calculations) */\n isMainSideBarOpen?: boolean;\n /** Whether the authoring panel is open (affects responsive calculations) */\n isAuthoringOpen?: boolean;\n};\n\n/**\n * Stepper component for multi-step workflows\n *\n * @example\n * ```tsx\n * <Stepper\n * steps={[\n * { label: 'Step 1', description: 'First step' },\n * { label: 'Step 2', description: 'Second step' },\n * { label: 'Step 3', description: 'Third step' },\n * ]}\n * currentStep={1}\n * onClick={(index) => setCurrentStep(index)}\n * // only allow jumping to steps the user has already reached\n * isStepClickable={(index) => index <= furthestVisitedStep}\n * />\n * ```\n *\n * Step titles are clickable whenever `onClick` is provided. A step is not navigable\n * when it is `isLocked`, `isDisabled`, or rejected by `isStepClickable`.\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\n isStepClickable,\n className,\n showIndex = true,\n disableOneMore = false,\n isMainSideBarOpen = false,\n isAuthoringOpen = false,\n}: TStepperProps) => {\n const stepsRef = useRef<HTMLDivElement | null>(null);\n const [visibleStepCounts, setVisibleStepCounts] = useState<number>(0);\n const [leftMostStep, setLeftMostStep] = useState<number>(0);\n const [rightMostStep, setRightMostStep] = useState<number>(0);\n const [leftTooltip, setLeftTooltip] = useState<string>('');\n const [rightTooltip, setRightTooltip] = useState<string>('');\n\n const getLabelDescriptionPosition = () => {\n if (labelPosition === 'top' || labelPosition === 'top-right') {\n return 'flex-col';\n } else if (labelPosition === 'bottom' || labelPosition === 'bottom-right') {\n return 'flex-col-reverse';\n } else if (appearance === 'linear') {\n return 'flex-row';\n } else {\n return 'flex-col';\n }\n };\n\n const handleClientWidth = () => {\n setTimeout(() => {\n setVisibleStepCounts(0);\n const moreWidth = 210;\n const stepTitleWidth = 225;\n let stepWidth = 0;\n let count = 0;\n for (let index = 0; index < steps.length; index++) {\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth > stepWidth + stepTitleWidth + moreWidth) {\n stepWidth += stepTitleWidth;\n count = index + 1;\n } else {\n break;\n }\n }\n setVisibleStepCounts(count);\n if (stepsRef?.current?.clientWidth && stepsRef?.current?.clientWidth < 480) {\n setVisibleStepCounts(steps?.length);\n }\n }, 300);\n };\n\n useEffect(() => {\n handleClientWidth();\n }, [isMainSideBarOpen, steps, currentStep]);\n\n useEffect(() => {\n setTimeout(() => {\n handleClientWidth();\n }, 300);\n }, [isAuthoringOpen]);\n\n useEffect(() => {\n if (visibleStepCounts > 0) {\n if (visibleStepCounts > currentStep) {\n let newRightTooltip = steps\n ?.slice(visibleStepCounts, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n let rightCount = visibleStepCounts;\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(0);\n setRightMostStep(rightCount);\n setRightTooltip(newRightTooltip);\n } else {\n const mid = Math.floor((visibleStepCounts + 1) / 2);\n const remainingStepsFromRight = currentStep + mid - steps?.length;\n let rightCount = currentStep + mid;\n let leftCount = currentStep - Math.max(visibleStepCounts - mid, 0) - (remainingStepsFromRight > 0 ? remainingStepsFromRight : 0);\n let newLeftTooltip = steps\n ?.slice(0, leftCount)\n ?.map((step) => step?.label)\n ?.join(', ');\n let newRightTooltip = steps\n ?.slice(rightCount, steps?.length)\n ?.map((step) => step?.label)\n ?.join(', ');\n\n if (disableOneMore && leftCount === 1) {\n leftCount = 0;\n newLeftTooltip = '';\n }\n\n if (disableOneMore && rightCount === steps.length - 1) {\n rightCount = steps.length;\n newRightTooltip = '';\n }\n setLeftMostStep(leftCount);\n setRightMostStep(rightCount);\n setLeftTooltip(newLeftTooltip);\n setRightTooltip(newRightTooltip);\n }\n }\n }, [visibleStepCounts, isAuthoringOpen, isMainSideBarOpen, steps, currentStep]);\n\n useEventListener('resize', handleClientWidth);\n\n const stepDetails = (step: TStep, index: number, hideLine = false) => {\n const isStepBlocked = Boolean(step?.isLocked) || Boolean(step?.isDisabled) || (isStepClickable ? !isStepClickable(index, step) : false);\n const isNavigable = Boolean(onClick) && !isStepBlocked;\n /** Steps already reached (done/current) get the primary-tinted hover, upcoming steps get the neutral one. */\n const isReached = index <= currentStep;\n\n const handleStepActivate = () => {\n if (!isNavigable) return;\n onClick?.(index);\n };\n\n /** Applied to the step title/description so only they react to clicks, not the connector line. */\n const titleInteractionProps = onClick\n ? {\n role: 'button' as const,\n tabIndex: isNavigable ? 0 : -1,\n 'aria-disabled': !isNavigable,\n onClick: handleStepActivate,\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleStepActivate();\n }\n },\n }\n : {};\n\n /**\n * `group` lets the icon+label row and the dot (both nested below) react to hovering the\n * whole title via `group-hover:*`, even though the visible pill background only paints on\n * the icon+label row itself — not the description under it.\n */\n const titleInteractionClassName = onClick\n ? isNavigable\n ? 'group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600 rounded-sm'\n : 'group cursor-not-allowed'\n : '';\n\n /**\n * Background for the icon+label row only (never the description below it), and sized to\n * the row's own natural box — no padding is added, so the pill can never need to paint\n * outside the element's existing bounds. That matters because the Stepper is often nested\n * inside headers/panels with little to no vertical slack (fixed row heights, `overflow-hidden`\n * wrappers), where even reserved-but-added padding gets visibly clipped.\n */\n const titleRowHoverClassName = onClick\n ? `rounded-full transition-colors duration-200 w-24 h-9 ${\n isNavigable\n ? isReached\n ? 'group-hover:bg-primary-50 dark:group-hover:bg-primary-950'\n : 'group-hover:bg-neutral-100 dark:group-hover:bg-black-700'\n : 'group-hover:bg-neutral-50 dark:group-hover:bg-black-800'\n }`\n : '';\n\n return (\n <div\n key={index}\n aria-current={index === currentStep ? 'step' : undefined}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px]`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div\n {...titleInteractionProps}\n className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col ${titleInteractionClassName}`}\n >\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''\n } ${titleRowHoverClassName}`}\n >\n <Tooltip title={isStepBlocked ? step?.disabledTooltipText || step?.tooltipText : step?.tooltipText} className='w-full'>\n <Typography\n size='small'\n variant='medium'\n className={`truncate flex items-center justify-center gap-2 h-9 ${\n index <= currentStep ? 'text-primary-600 dark:text-primary-300' : 'text-neutral-400 dark:text-neutral-100'\n }`}\n appearance='custom'\n >\n {showIndex ? (\n <div\n className={`${\n appearance === 'parallel'\n ? 'flex items-center'\n : `w-6 h-6 ${\n index <= currentStep ? 'bg-primary-600' : 'bg-neutral-400 dark:bg-black-400'\n } rounded-full flex items-center justify-center text-white transition-transform duration-200 ${\n onClick\n ? isStepBlocked\n ? `group-hover:animate-nudge ${\n isReached\n ? 'group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.15)]'\n : 'group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.10)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.15)]'\n }`\n : `group-hover:scale-105 ${\n isReached\n ? 'group-hover:shadow-[0_0_0_4px_rgba(1,109,207,0.18)] dark:group-hover:shadow-[0_0_0_4px_rgba(138,192,242,0.25)]'\n : 'group-hover:shadow-[0_0_0_4px_rgba(102,112,133,0.15)] dark:group-hover:shadow-[0_0_0_4px_rgba(152,162,179,0.25)]'\n }`\n : ''\n }`\n }`}\n >\n {step?.isLocked ? (\n <div className='flex items-center justify-center'>\n <Lock sx={{ fontSize: 16 }} />\n </div>\n ) : (\n <>\n {currentStep > index && appearance === 'linear' ? (\n <CheckIcon size={18} className='text-white dark:text-white' />\n ) : (\n <Typography\n size={`${appearance === 'parallel' ? 'small' : 'extra-small'}`}\n variant='medium'\n className='text-neutral-100'\n appearance='custom'\n >\n {index + 1}\n </Typography>\n )}\n </>\n )}\n </div>\n ) : null}\n\n <div className={`truncate mr-3 ${index <= currentStep ? '' : 'dark:text-black-200'}`}>\n {step?.label}\n </div>\n </Typography>\n </Tooltip>\n </div>\n\n {labelPosition !== 'inline' || appearance === 'parallel' ? (\n <div\n className={`flex ${\n labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : appearance === 'linear' ? 'ml-8' : ''\n }`}\n >\n <Typography\n size='extra-small'\n variant='medium'\n className={`truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n {index < steps.length - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) && !hideLine ? (\n <div\n className={`w-full flex-grow h-0.5 min-w-[70px] ${labelPosition !== 'inline' || appearance === 'parallel' ? 'my-2' : ''} ${\n index <= currentStep - (appearance === 'linear' && labelPosition === 'inline' ? 1 : 0) ? 'bg-primary-600' : 'bg-neutral-300'\n }`}\n />\n ) : null}\n </div>\n {labelPosition === 'inline' && appearance === 'linear' ? (\n <div className={`w-fit max-w-full ${titleInteractionClassName}`} onClick={handleStepActivate}>\n <Typography\n size='extra-small'\n variant='medium'\n className={`ml-8 truncate ${index === currentStep ? 'text-neutral-900 dark:text-white' : 'text-neutral-400 dark:text-neutral-600'}`}\n appearance='custom'\n >\n {step?.description || ''}\n </Typography>\n </div>\n ) : null}\n </div>\n </div>\n );\n };\n\n return (\n <div className={`w-full flex ${className}`} ref={stepsRef}>\n {leftMostStep > 0 ? (\n <div className={`flex ${appearance === 'parallel' ? 'flex-col' : ''}`}>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(0, leftMostStep).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - visibleStepCounts > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={leftTooltip}>\n <div className='min-w-max'>\n {leftMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n <div className={`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${appearance === 'parallel' ? 'mt-2' : 'mt-[11px]'}`} />\n </div>\n ) : null}\n\n <div className='w-full flex flex-wrap'>\n {steps?.map((step: TStep, index: number) => {\n if (leftMostStep <= index && index < rightMostStep) {\n return stepDetails(step, index);\n }\n return null;\n })}\n </div>\n\n {steps.length - rightMostStep > 0 ? (\n <div className='flex flex-col'>\n {onClick ? (\n <Dropdown\n menu={{\n items: steps.slice(rightMostStep, steps?.length).map((step: TStep, index: number) => ({\n label: <div className='px-2 py-1'>{stepDetails(step, index + rightMostStep, true)}</div>,\n key: index,\n })),\n }}\n trigger={['click']}\n >\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n </Dropdown>\n ) : (\n <Typography\n size='small'\n variant='medium'\n className={`px-2 ${steps.length - rightMostStep > 0 ? 'cursor-pointer' : 'cursor-not-allowed'}`}\n appearance='subtitle'\n >\n <Tooltip title={rightTooltip}>\n <div className='min-w-max'>\n {steps.length - rightMostStep} More...\n </div>\n </Tooltip>\n </Typography>\n )}\n\n <div className={`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${appearance === 'parallel' ? 'mt-2' : 'hidden'}`} />\n </div>\n ) : null}\n </div>\n );\n};\n\nStepper.displayName = 'Stepper';\n\nexport default Stepper;\n\n\n\n"],"names":["Stepper","steps","currentStep","appearance","labelPosition","onClick","isStepClickable","className","showIndex","disableOneMore","isMainSideBarOpen","isAuthoringOpen","stepsRef","useRef","visibleStepCounts","setVisibleStepCounts","useState","leftMostStep","setLeftMostStep","rightMostStep","setRightMostStep","leftTooltip","setLeftTooltip","rightTooltip","setRightTooltip","getLabelDescriptionPosition","handleClientWidth","moreWidth","stepTitleWidth","stepWidth","count","index","useEffect","newRightTooltip","step","rightCount","mid","remainingStepsFromRight","leftCount","newLeftTooltip","useEventListener","stepDetails","hideLine","isStepBlocked","isNavigable","isReached","handleStepActivate","titleInteractionProps","event","titleInteractionClassName","titleRowHoverClassName","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":";;;;;;;;AAuEA,MAAMA,IAAU,CAAC;AAAA,EACf,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAAA,EAChB,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC,IAAoB;AAAA,EACpB,iBAAAC,IAAkB;AACpB,MAAqB;AACnB,QAAMC,IAAWC,EAA8B,IAAI,GAC7C,CAACC,GAAmBC,CAAoB,IAAIC,EAAiB,CAAC,GAC9D,CAACC,GAAcC,CAAe,IAAIF,EAAiB,CAAC,GACpD,CAACG,GAAeC,CAAgB,IAAIJ,EAAiB,CAAC,GACtD,CAACK,GAAaC,CAAc,IAAIN,EAAiB,EAAE,GACnD,CAACO,GAAcC,CAAe,IAAIR,EAAiB,EAAE,GAErDS,IAA8B,MAC9BrB,MAAkB,SAASA,MAAkB,cACxC,aACEA,MAAkB,YAAYA,MAAkB,iBAClD,qBACED,MAAe,WACjB,aAEA,YAILuB,IAAoB,MAAM;AAC9B,eAAW,MAAM;AACf,MAAAX,EAAqB,CAAC;AACtB,YAAMY,IAAY,KACZC,IAAiB;AACvB,UAAIC,IAAY,GACZC,IAAQ;AACZ,eAASC,IAAQ,GAAGA,IAAQ9B,EAAM,WAC5BW,GAAU,SAAS,eAAeA,GAAU,SAAS,cAAciB,IAAYD,IAAiBD,IAD5DI;AAEtC,QAAAF,KAAaD,GACbE,IAAQC,IAAQ;AAKpB,MAAAhB,EAAqBe,CAAK,GACtBlB,GAAU,SAAS,eAAeA,GAAU,SAAS,cAAc,OACrEG,EAAqBd,GAAO,MAAM;AAAA,IAEtC,GAAG,GAAG;AAAA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