@lax-wp/design-system 0.14.51 → 0.14.52
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.
- package/dist/components/navigation/stepper/Stepper.cjs.js +1 -1
- package/dist/components/navigation/stepper/Stepper.cjs.js.map +1 -1
- package/dist/components/navigation/stepper/Stepper.d.ts +20 -1
- package/dist/components/navigation/stepper/Stepper.es.js +148 -127
- package/dist/components/navigation/stepper/Stepper.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),A=require("@mui/icons-material"),E=require("antd"),u=require("react"),x=require("../../data-display/typography/Typography.cjs.js"),v=require("../../tooltip/Tooltip.cjs.js"),K=require("../../../hooks/useEventListener.cjs.js"),V=require("../../icon/icons.generated.cjs.js"),I=({steps:t,currentStep:s,appearance:a="linear",labelPosition:r="inline",onClick:d,isStepClickable:k,className:C,showIndex:B=!0,disableOneMore:y=!1,isMainSideBarOpen:b=!1,isAuthoringOpen:z=!1})=>{const g=u.useRef(null),[m,w]=u.useState(0),[j,L]=u.useState(0),[h,R]=u.useState(0),[q,F]=u.useState(""),[W,D]=u.useState(""),S=()=>r==="top"||r==="top-right"?"flex-col":r==="bottom"||r==="bottom-right"?"flex-col-reverse":a==="linear"?"flex-row":"flex-col",N=()=>{setTimeout(()=>{w(0);const i=210,l=225;let n=0,o=0;for(let c=0;c<t.length&&(g?.current?.clientWidth&&g?.current?.clientWidth>n+l+i);c++)n+=l,o=c+1;w(o),g?.current?.clientWidth&&g?.current?.clientWidth<480&&w(t?.length)},300)};u.useEffect(()=>{N()},[b,t,s]),u.useEffect(()=>{setTimeout(()=>{N()},300)},[z]),u.useEffect(()=>{if(m>0)if(m>s){let i=t?.slice(m,t?.length)?.map(n=>n?.label)?.join(", "),l=m;y&&l===t.length-1&&(l=t.length,i=""),L(0),R(l),D(i)}else{const i=Math.floor((m+1)/2),l=s+i-t?.length;let n=s+i,o=s-Math.max(m-i,0)-(l>0?l:0),c=t?.slice(0,o)?.map(p=>p?.label)?.join(", "),f=t?.slice(n,t?.length)?.map(p=>p?.label)?.join(", ");y&&o===1&&(o=0,c=""),y&&n===t.length-1&&(n=t.length,f=""),L(o),R(n),F(c),D(f)}},[m,z,b,t,s]),K.useEventListener("resize",N);const $=(i,l,n=!1)=>{const o=!!i?.isLocked||!!i?.isDisabled||(k?!k(l,i):!1),c=!!d&&!o,f=()=>{c&&d?.(l)},p=d?{role:"button",tabIndex:c?0:-1,"aria-disabled":!c,onClick:f,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())}}:{},M=d?c?"cursor-pointer rounded-sm transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600":"cursor-not-allowed":"";return e.jsx("div",{"aria-current":l===s?"step":void 0,className:`flex ${l<t.length-1||a=="parallel"?"flex flex-grow":""} min-w-[200px]`,children:e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsxs("div",{className:`flex ${S()} ${r==="inline"&&a==="linear"?"items-center":""}`,children:[e.jsxs("div",{...p,className:`${r==="inline"?"max-w-[70%]":"w-full"} flex flex-col ${M}`,children:[e.jsx("div",{className:`flex ${r==="top-right"||r==="bottom-right"?"justify-end":""}`,children:e.jsx(v,{title:o&&i?.disabledTooltipText||i?.tooltipText,children:e.jsxs(x.Typography,{size:"small",variant:"medium",className:`truncate flex items-center ${l<=s?"text-primary-600 dark:text-primary-300":"text-neutral-400 dark:text-neutral-100"}`,appearance:"custom",children:[B?e.jsx("div",{className:`${a==="parallel"?"flex items-center":`w-6 h-6 ${l<=s?"bg-primary-600":"bg-neutral-400 dark:bg-black-400"} rounded-full flex items-center justify-center text-white`}`,children:i?.isLocked?e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(A.Lock,{sx:{fontSize:16}})}):e.jsx(e.Fragment,{children:s>l&&a==="linear"?e.jsx(V.CheckIcon,{size:18,className:"text-white dark:text-white"}):e.jsx(x.Typography,{size:`${a==="parallel"?"small":"extra-small"}`,variant:"medium",className:"text-neutral-100",appearance:"custom",children:l+1})})}):null,e.jsx("div",{className:`truncate ${r==="inline"?"mx-2":"ml-2"} ${l<=s?"":"dark:text-black-200"}`,children:i?.label})]})})}),r!=="inline"||a==="parallel"?e.jsx("div",{className:`flex ${r==="top-right"||r==="bottom-right"?"justify-end":a==="linear"?"ml-8":""}`,children:e.jsx(x.Typography,{size:"extra-small",variant:"medium",className:`truncate ${l===s?"text-neutral-900 dark:text-white":"text-neutral-400 dark:text-neutral-600"}`,appearance:"custom",children:i?.description||""})}):null]}),l<t.length-(a==="linear"&&r==="inline"?1:0)&&!n?e.jsx("div",{className:`w-full flex-grow h-0.5 min-w-[70px] ${r!=="inline"||a==="parallel"?"my-2":""} ${l<=s-(a==="linear"&&r==="inline"?1:0)?"bg-primary-600":"bg-neutral-300"}`}):null]}),r==="inline"&&a==="linear"?e.jsx("div",{className:`w-fit max-w-full ${M}`,onClick:f,children:e.jsx(x.Typography,{size:"extra-small",variant:"medium",className:`ml-8 truncate ${l===s?"text-neutral-900 dark:text-white":"text-neutral-400 dark:text-neutral-600"}`,appearance:"custom",children:i?.description||""})}):null]})},l)};return e.jsxs("div",{className:`w-full flex ${C}`,ref:g,children:[j>0?e.jsxs("div",{className:`flex ${a==="parallel"?"flex-col":""}`,children:[d?e.jsx(E.Dropdown,{menu:{items:t.slice(0,j).map((i,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:$(i,l,!0)}),key:l}))},trigger:["click"],children:e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-m>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(v,{title:q,children:e.jsxs("div",{className:"min-w-max",children:[j," More..."]})})})}):e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-m>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(v,{title:q,children:e.jsxs("div",{className:"min-w-max",children:[j," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${a==="parallel"?"mt-2":"mt-[11px]"}`})]}):null,e.jsx("div",{className:"w-full flex flex-wrap gap-3 ",children:t?.map((i,l)=>j<=l&&l<h?$(i,l):null)}),t.length-h>0?e.jsxs("div",{className:"flex flex-col",children:[d?e.jsx(E.Dropdown,{menu:{items:t.slice(h,t?.length).map((i,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:$(i,l+h,!0)}),key:l}))},trigger:["click"],children:e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-h>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(v,{title:W,children:e.jsxs("div",{className:"min-w-max",children:[t.length-h," More..."]})})})}):e.jsx(x.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-h>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(v,{title:W,children:e.jsxs("div",{className:"min-w-max",children:[t.length-h," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${a==="parallel"?"mt-2":"hidden"}`})]}):null]})};I.displayName="Stepper";module.exports=I;
|
|
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 { 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};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n onClick?: (index: number) => void;\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 * />\n * ```\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\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 return (\n <div\n key={index}\n onClick={() => onClick?.(index)}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px] ${\n onClick ? 'cursor-pointer' : ''\n }`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col`}>\n <div className={`flex ${labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''}`}>\n <Tooltip title={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 <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 ) : 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","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","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":"kUAmDMA,EAAU,CAAC,CACf,MAAAC,EACA,YAAAC,EACA,WAAAC,EAAa,SACb,cAAAC,EAAgB,SAChB,QAAAC,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,IAC9BpB,IAAkB,OAASA,IAAkB,YACxC,WACEA,IAAkB,UAAYA,IAAkB,eAClD,mBACED,IAAe,SACjB,WAEA,WAILsB,EAAoB,IAAM,CAC9B,WAAW,IAAM,CACfX,EAAqB,CAAC,EACtB,MAAMY,EAAY,IACZC,EAAiB,IACvB,IAAIC,EAAY,EACZC,EAAQ,EACZ,QAASC,EAAQ,EAAGA,EAAQ7B,EAAM,SAC5BU,GAAU,SAAS,aAAeA,GAAU,SAAS,YAAciB,EAAYD,EAAiBD,GAD5DI,IAEtCF,GAAaD,EACbE,EAAQC,EAAQ,EAKpBhB,EAAqBe,CAAK,EACtBlB,GAAU,SAAS,aAAeA,GAAU,SAAS,YAAc,KACrEG,EAAqBb,GAAO,MAAM,CAEtC,EAAG,GAAG,CACR,EAEA8B,EAAAA,UAAU,IAAM,CACdN,EAAA,CACF,EAAG,CAAChB,EAAmBR,EAAOC,CAAW,CAAC,EAE1C6B,EAAAA,UAAU,IAAM,CACd,WAAW,IAAM,CACf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MAAA,CAAI,UAAU,YAAa,WAAYT,EAAMH,EAAQZ,EAAe,EAAI,CAAA,CAAE,EAClF,IAAKY,CAAA,EACL,CAAA,EAEJ,QAAS,CAAC,OAAO,EAEjB,SAAAY,EAAAA,IAACG,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAW,QAAQ5C,EAAM,OAASiB,EAAgB,EAAI,iBAAmB,oBAAoB,GAC7F,WAAW,WAEX,eAAC0B,EAAA,CAAQ,MAAOtB,EACd,SAAAqB,EAAAA,KAAC,MAAA,CAAI,UAAU,YACZ,SAAA,CAAA1C,EAAM,OAASiB,EAAc,UAAA,CAAA,CAChC,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EAGFwB,EAAAA,IAACG,EAAAA,WAAA,CACC,KAAK,QACL,QAAQ,SACR,UAAW,QAAQ5C,EAAM,OAASiB,EAAgB,EAAI,iBAAmB,oBAAoB,GAC7F,WAAW,WAEX,eAAC0B,EAAA,CAAQ,MAAOtB,EACd,SAAAqB,EAAAA,KAAC,MAAA,CAAI,UAAU,YACZ,SAAA,CAAA1C,EAAM,OAASiB,EAAc,UAAA,CAAA,CAChC,CAAA,CACF,CAAA,CAAA,EAIJwB,MAAC,OAAI,UAAW,+CAA+CvC,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\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,EAAM,SAC5BW,GAAU,SAAS,aAAeA,GAAU,SAAS,YAAciB,EAAYD,EAAiBD,GAD5DI,IAEtCF,GAAaD,EACbE,EAAQC,EAAQ,EAKpBhB,EAAqBe,CAAK,EACtBlB,GAAU,SAAS,aAAeA,GAAU,SAAS,YAAc,KACrEG,EAAqBd,GAAO,MAAM,CAEtC,EAAG,GAAG,CACR,EAEA+B,EAAAA,UAAU,IAAM,CACdN,EAAA,CACF,EAAG,CAAChB,EAAmBT,EAAOC,CAAW,CAAC,EAE1C8B,EAAAA,UAAU,IAAM,CACd,W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AAA,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"}
|
|
@@ -3,11 +3,25 @@ export type TStep = {
|
|
|
3
3
|
description?: string;
|
|
4
4
|
isLocked?: boolean;
|
|
5
5
|
tooltipText?: string;
|
|
6
|
+
/** Prevents navigating to this step (e.g. validation not satisfied yet). Locked steps are always non-navigable. */
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
/** Tooltip shown when the step cannot be navigated to. Falls back to `tooltipText`. */
|
|
9
|
+
disabledTooltipText?: string;
|
|
6
10
|
};
|
|
7
11
|
export type TStepperProps = {
|
|
8
12
|
steps: TStep[];
|
|
9
13
|
currentStep: number;
|
|
14
|
+
/**
|
|
15
|
+
* Called when a navigable step title is clicked (or activated with Enter/Space).
|
|
16
|
+
* Steps that are locked, disabled or rejected by `isStepClickable` never invoke it.
|
|
17
|
+
*/
|
|
10
18
|
onClick?: (index: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Optional gate for step navigation, so consumers can enforce their own validation
|
|
21
|
+
* and step-access rules (e.g. only allow jumping to already visited steps).
|
|
22
|
+
* Returning `false` renders the step title as non-navigable.
|
|
23
|
+
*/
|
|
24
|
+
isStepClickable?: (index: number, step: TStep) => boolean;
|
|
11
25
|
appearance?: 'linear' | 'parallel';
|
|
12
26
|
labelPosition?: 'top' | 'bottom' | 'inline' | 'top-right' | 'bottom-right';
|
|
13
27
|
className?: string;
|
|
@@ -35,11 +49,16 @@ export type TStepperProps = {
|
|
|
35
49
|
* ]}
|
|
36
50
|
* currentStep={1}
|
|
37
51
|
* onClick={(index) => setCurrentStep(index)}
|
|
52
|
+
* // only allow jumping to steps the user has already reached
|
|
53
|
+
* isStepClickable={(index) => index <= furthestVisitedStep}
|
|
38
54
|
* />
|
|
39
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* Step titles are clickable whenever `onClick` is provided. A step is not navigable
|
|
58
|
+
* when it is `isLocked`, `isDisabled`, or rejected by `isStepClickable`.
|
|
40
59
|
*/
|
|
41
60
|
declare const Stepper: {
|
|
42
|
-
({ steps, currentStep, appearance, labelPosition, onClick, className, showIndex, disableOneMore, isMainSideBarOpen, isAuthoringOpen, }: TStepperProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
({ steps, currentStep, appearance, labelPosition, onClick, isStepClickable, className, showIndex, disableOneMore, isMainSideBarOpen, isAuthoringOpen, }: TStepperProps): import("react/jsx-runtime").JSX.Element;
|
|
43
62
|
displayName: string;
|
|
44
63
|
};
|
|
45
64
|
export default Stepper;
|
|
@@ -1,210 +1,231 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
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 H, useState as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import
|
|
3
|
+
import { Dropdown as E } from "antd";
|
|
4
|
+
import { useRef as H, useState as N, useEffect as z } from "react";
|
|
5
|
+
import { Typography as u } from "../../data-display/typography/Typography.es.js";
|
|
6
|
+
import p from "../../tooltip/Tooltip.es.js";
|
|
7
7
|
import { useEventListener as J } from "../../../hooks/useEventListener.es.js";
|
|
8
|
-
import { CheckIcon as
|
|
9
|
-
const
|
|
8
|
+
import { CheckIcon as Q } from "../../icon/icons.generated.es.js";
|
|
9
|
+
const U = ({
|
|
10
10
|
steps: t,
|
|
11
11
|
currentStep: n,
|
|
12
12
|
appearance: a = "linear",
|
|
13
13
|
labelPosition: r = "inline",
|
|
14
|
-
onClick:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
onClick: f,
|
|
15
|
+
isStepClickable: j,
|
|
16
|
+
className: F,
|
|
17
|
+
showIndex: K = !0,
|
|
18
|
+
disableOneMore: $ = !1,
|
|
19
|
+
isMainSideBarOpen: L = !1,
|
|
20
|
+
isAuthoringOpen: W = !1
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
+
const g = H(null), [d, y] = N(0), [v, M] = N(0), [h, R] = N(0), [D, V] = N(""), [C, I] = N(""), q = () => r === "top" || r === "top-right" ? "flex-col" : r === "bottom" || r === "bottom-right" ? "flex-col-reverse" : a === "linear" ? "flex-row" : "flex-col", k = () => {
|
|
22
23
|
setTimeout(() => {
|
|
23
|
-
|
|
24
|
-
const i = 210,
|
|
25
|
-
let m = 0,
|
|
26
|
-
for (let
|
|
27
|
-
m +=
|
|
28
|
-
|
|
24
|
+
y(0);
|
|
25
|
+
const i = 210, e = 225;
|
|
26
|
+
let m = 0, s = 0;
|
|
27
|
+
for (let o = 0; o < t.length && (g?.current?.clientWidth && g?.current?.clientWidth > m + e + i); o++)
|
|
28
|
+
m += e, s = o + 1;
|
|
29
|
+
y(s), g?.current?.clientWidth && g?.current?.clientWidth < 480 && y(t?.length);
|
|
29
30
|
}, 300);
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [
|
|
32
|
+
z(() => {
|
|
33
|
+
k();
|
|
34
|
+
}, [L, t, n]), z(() => {
|
|
34
35
|
setTimeout(() => {
|
|
35
|
-
|
|
36
|
+
k();
|
|
36
37
|
}, 300);
|
|
37
|
-
}, [
|
|
38
|
-
if (
|
|
39
|
-
if (
|
|
40
|
-
let i = t?.slice(
|
|
41
|
-
|
|
38
|
+
}, [W]), z(() => {
|
|
39
|
+
if (d > 0)
|
|
40
|
+
if (d > n) {
|
|
41
|
+
let i = t?.slice(d, t?.length)?.map((m) => m?.label)?.join(", "), e = d;
|
|
42
|
+
$ && e === t.length - 1 && (e = t.length, i = ""), M(0), R(e), I(i);
|
|
42
43
|
} else {
|
|
43
|
-
const i = Math.floor((
|
|
44
|
-
let m = n + i,
|
|
45
|
-
|
|
44
|
+
const i = Math.floor((d + 1) / 2), e = n + i - t?.length;
|
|
45
|
+
let m = n + i, s = n - Math.max(d - i, 0) - (e > 0 ? e : 0), o = t?.slice(0, s)?.map((w) => w?.label)?.join(", "), x = t?.slice(m, t?.length)?.map((w) => w?.label)?.join(", ");
|
|
46
|
+
$ && s === 1 && (s = 0, o = ""), $ && m === t.length - 1 && (m = t.length, x = ""), M(s), R(m), V(o), I(x);
|
|
46
47
|
}
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
}, [d, W, L, t, n]), J("resize", k);
|
|
49
|
+
const b = (i, e, m = !1) => {
|
|
50
|
+
const s = !!i?.isLocked || !!i?.isDisabled || (j ? !j(e, i) : !1), o = !!f && !s, x = () => {
|
|
51
|
+
o && f?.(e);
|
|
52
|
+
}, w = f ? {
|
|
53
|
+
role: "button",
|
|
54
|
+
tabIndex: o ? 0 : -1,
|
|
55
|
+
"aria-disabled": !o,
|
|
56
|
+
onClick: x,
|
|
57
|
+
onKeyDown: (T) => {
|
|
58
|
+
(T.key === "Enter" || T.key === " ") && (T.preventDefault(), x());
|
|
59
|
+
}
|
|
60
|
+
} : {}, B = f ? o ? "cursor-pointer rounded-sm transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600" : "cursor-not-allowed" : "";
|
|
61
|
+
return /* @__PURE__ */ l(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"aria-current": e === n ? "step" : void 0,
|
|
65
|
+
className: `flex ${e < t.length - 1 || a == "parallel" ? "flex flex-grow" : ""} min-w-[200px]`,
|
|
66
|
+
children: /* @__PURE__ */ c("div", { className: "w-full flex flex-col", children: [
|
|
67
|
+
/* @__PURE__ */ c("div", { className: `flex ${q()} ${r === "inline" && a === "linear" ? "items-center" : ""}`, children: [
|
|
68
|
+
/* @__PURE__ */ c(
|
|
69
|
+
"div",
|
|
58
70
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: `truncate flex items-center ${l <= n ? "text-primary-600 dark:text-primary-300" : "text-neutral-400 dark:text-neutral-100"}`,
|
|
62
|
-
appearance: "custom",
|
|
71
|
+
...w,
|
|
72
|
+
className: `${r === "inline" ? "max-w-[70%]" : "w-full"} flex flex-col ${B}`,
|
|
63
73
|
children: [
|
|
64
|
-
|
|
74
|
+
/* @__PURE__ */ l("div", { className: `flex ${r === "top-right" || r === "bottom-right" ? "justify-end" : ""}`, children: /* @__PURE__ */ l(p, { title: s && i?.disabledTooltipText || i?.tooltipText, children: /* @__PURE__ */ c(
|
|
75
|
+
u,
|
|
76
|
+
{
|
|
77
|
+
size: "small",
|
|
78
|
+
variant: "medium",
|
|
79
|
+
className: `truncate flex items-center ${e <= n ? "text-primary-600 dark:text-primary-300" : "text-neutral-400 dark:text-neutral-100"}`,
|
|
80
|
+
appearance: "custom",
|
|
81
|
+
children: [
|
|
82
|
+
K ? /* @__PURE__ */ l(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: `${a === "parallel" ? "flex items-center" : `w-6 h-6 ${e <= n ? "bg-primary-600" : "bg-neutral-400 dark:bg-black-400"} rounded-full flex items-center justify-center text-white`}`,
|
|
86
|
+
children: i?.isLocked ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ l(G, { sx: { fontSize: 16 } }) }) : /* @__PURE__ */ l(A, { children: n > e && a === "linear" ? /* @__PURE__ */ l(Q, { size: 18, className: "text-white dark:text-white" }) : /* @__PURE__ */ l(
|
|
87
|
+
u,
|
|
88
|
+
{
|
|
89
|
+
size: `${a === "parallel" ? "small" : "extra-small"}`,
|
|
90
|
+
variant: "medium",
|
|
91
|
+
className: "text-neutral-100",
|
|
92
|
+
appearance: "custom",
|
|
93
|
+
children: e + 1
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
}
|
|
97
|
+
) : null,
|
|
98
|
+
/* @__PURE__ */ l("div", { className: `truncate ${r === "inline" ? "mx-2" : "ml-2"} ${e <= n ? "" : "dark:text-black-200"}`, children: i?.label })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
) }) }),
|
|
102
|
+
r !== "inline" || a === "parallel" ? /* @__PURE__ */ l(
|
|
65
103
|
"div",
|
|
66
104
|
{
|
|
67
|
-
className:
|
|
68
|
-
children:
|
|
69
|
-
|
|
105
|
+
className: `flex ${r === "top-right" || r === "bottom-right" ? "justify-end" : a === "linear" ? "ml-8" : ""}`,
|
|
106
|
+
children: /* @__PURE__ */ l(
|
|
107
|
+
u,
|
|
70
108
|
{
|
|
71
|
-
size:
|
|
109
|
+
size: "extra-small",
|
|
72
110
|
variant: "medium",
|
|
73
|
-
className: "text-neutral-
|
|
111
|
+
className: `truncate ${e === n ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
|
|
74
112
|
appearance: "custom",
|
|
75
|
-
children:
|
|
113
|
+
children: i?.description || ""
|
|
76
114
|
}
|
|
77
|
-
)
|
|
115
|
+
)
|
|
78
116
|
}
|
|
79
|
-
) : null
|
|
80
|
-
/* @__PURE__ */ e("div", { className: `truncate ${r === "inline" ? "mx-2" : "ml-2"} ${l <= n ? "" : "dark:text-black-200"}`, children: i?.label })
|
|
117
|
+
) : null
|
|
81
118
|
]
|
|
82
119
|
}
|
|
83
|
-
)
|
|
84
|
-
|
|
120
|
+
),
|
|
121
|
+
e < t.length - (a === "linear" && r === "inline" ? 1 : 0) && !m ? /* @__PURE__ */ l(
|
|
85
122
|
"div",
|
|
86
123
|
{
|
|
87
|
-
className: `flex ${r
|
|
88
|
-
children: /* @__PURE__ */ e(
|
|
89
|
-
h,
|
|
90
|
-
{
|
|
91
|
-
size: "extra-small",
|
|
92
|
-
variant: "medium",
|
|
93
|
-
className: `truncate ${l === n ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
|
|
94
|
-
appearance: "custom",
|
|
95
|
-
children: i?.description || ""
|
|
96
|
-
}
|
|
97
|
-
)
|
|
124
|
+
className: `w-full flex-grow h-0.5 min-w-[70px] ${r !== "inline" || a === "parallel" ? "my-2" : ""} ${e <= n - (a === "linear" && r === "inline" ? 1 : 0) ? "bg-primary-600" : "bg-neutral-300"}`
|
|
98
125
|
}
|
|
99
126
|
) : null
|
|
100
127
|
] }),
|
|
101
|
-
|
|
102
|
-
|
|
128
|
+
r === "inline" && a === "linear" ? /* @__PURE__ */ l("div", { className: `w-fit max-w-full ${B}`, onClick: x, children: /* @__PURE__ */ l(
|
|
129
|
+
u,
|
|
103
130
|
{
|
|
104
|
-
|
|
131
|
+
size: "extra-small",
|
|
132
|
+
variant: "medium",
|
|
133
|
+
className: `ml-8 truncate ${e === n ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
|
|
134
|
+
appearance: "custom",
|
|
135
|
+
children: i?.description || ""
|
|
105
136
|
}
|
|
106
|
-
) : null
|
|
107
|
-
] })
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
) : null
|
|
118
|
-
] })
|
|
119
|
-
},
|
|
120
|
-
l
|
|
121
|
-
);
|
|
122
|
-
return /* @__PURE__ */ c("div", { className: `w-full flex ${E}`, ref: f, children: [
|
|
123
|
-
x > 0 ? /* @__PURE__ */ c("div", { className: `flex ${a === "parallel" ? "flex-col" : ""}`, children: [
|
|
124
|
-
w ? /* @__PURE__ */ e(
|
|
125
|
-
D,
|
|
137
|
+
) }) : null
|
|
138
|
+
] })
|
|
139
|
+
},
|
|
140
|
+
e
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
return /* @__PURE__ */ c("div", { className: `w-full flex ${F}`, ref: g, children: [
|
|
144
|
+
v > 0 ? /* @__PURE__ */ c("div", { className: `flex ${a === "parallel" ? "flex-col" : ""}`, children: [
|
|
145
|
+
f ? /* @__PURE__ */ l(
|
|
146
|
+
E,
|
|
126
147
|
{
|
|
127
148
|
menu: {
|
|
128
|
-
items: t.slice(0,
|
|
129
|
-
label: /* @__PURE__ */
|
|
130
|
-
key:
|
|
149
|
+
items: t.slice(0, v).map((i, e) => ({
|
|
150
|
+
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children: b(i, e, !0) }),
|
|
151
|
+
key: e
|
|
131
152
|
}))
|
|
132
153
|
},
|
|
133
154
|
trigger: ["click"],
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
|
|
155
|
+
children: /* @__PURE__ */ l(
|
|
156
|
+
u,
|
|
136
157
|
{
|
|
137
158
|
size: "small",
|
|
138
159
|
variant: "medium",
|
|
139
|
-
className: `px-2 ${t.length -
|
|
160
|
+
className: `px-2 ${t.length - d > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
140
161
|
appearance: "subtitle",
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
|
|
162
|
+
children: /* @__PURE__ */ l(p, { title: D, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
163
|
+
v,
|
|
143
164
|
" More..."
|
|
144
165
|
] }) })
|
|
145
166
|
}
|
|
146
167
|
)
|
|
147
168
|
}
|
|
148
|
-
) : /* @__PURE__ */
|
|
149
|
-
|
|
169
|
+
) : /* @__PURE__ */ l(
|
|
170
|
+
u,
|
|
150
171
|
{
|
|
151
172
|
size: "small",
|
|
152
173
|
variant: "medium",
|
|
153
|
-
className: `px-2 ${t.length -
|
|
174
|
+
className: `px-2 ${t.length - d > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
154
175
|
appearance: "subtitle",
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
-
|
|
176
|
+
children: /* @__PURE__ */ l(p, { title: D, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
177
|
+
v,
|
|
157
178
|
" More..."
|
|
158
179
|
] }) })
|
|
159
180
|
}
|
|
160
181
|
),
|
|
161
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ l("div", { className: `h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${a === "parallel" ? "mt-2" : "mt-[11px]"}` })
|
|
162
183
|
] }) : null,
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
t.length -
|
|
165
|
-
|
|
166
|
-
|
|
184
|
+
/* @__PURE__ */ l("div", { className: "w-full flex flex-wrap gap-3 ", children: t?.map((i, e) => v <= e && e < h ? b(i, e) : null) }),
|
|
185
|
+
t.length - h > 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
186
|
+
f ? /* @__PURE__ */ l(
|
|
187
|
+
E,
|
|
167
188
|
{
|
|
168
189
|
menu: {
|
|
169
|
-
items: t.slice(
|
|
170
|
-
label: /* @__PURE__ */
|
|
171
|
-
key:
|
|
190
|
+
items: t.slice(h, t?.length).map((i, e) => ({
|
|
191
|
+
label: /* @__PURE__ */ l("div", { className: "px-2 py-1", children: b(i, e + h, !0) }),
|
|
192
|
+
key: e
|
|
172
193
|
}))
|
|
173
194
|
},
|
|
174
195
|
trigger: ["click"],
|
|
175
|
-
children: /* @__PURE__ */
|
|
176
|
-
|
|
196
|
+
children: /* @__PURE__ */ l(
|
|
197
|
+
u,
|
|
177
198
|
{
|
|
178
199
|
size: "small",
|
|
179
200
|
variant: "medium",
|
|
180
|
-
className: `px-2 ${t.length -
|
|
201
|
+
className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
181
202
|
appearance: "subtitle",
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
t.length -
|
|
203
|
+
children: /* @__PURE__ */ l(p, { title: C, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
204
|
+
t.length - h,
|
|
184
205
|
" More..."
|
|
185
206
|
] }) })
|
|
186
207
|
}
|
|
187
208
|
)
|
|
188
209
|
}
|
|
189
|
-
) : /* @__PURE__ */
|
|
190
|
-
|
|
210
|
+
) : /* @__PURE__ */ l(
|
|
211
|
+
u,
|
|
191
212
|
{
|
|
192
213
|
size: "small",
|
|
193
214
|
variant: "medium",
|
|
194
|
-
className: `px-2 ${t.length -
|
|
215
|
+
className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
|
|
195
216
|
appearance: "subtitle",
|
|
196
|
-
children: /* @__PURE__ */
|
|
197
|
-
t.length -
|
|
217
|
+
children: /* @__PURE__ */ l(p, { title: C, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
|
|
218
|
+
t.length - h,
|
|
198
219
|
" More..."
|
|
199
220
|
] }) })
|
|
200
221
|
}
|
|
201
222
|
),
|
|
202
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ l("div", { className: `h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${a === "parallel" ? "mt-2" : "hidden"}` })
|
|
203
224
|
] }) : null
|
|
204
225
|
] });
|
|
205
226
|
};
|
|
206
|
-
|
|
227
|
+
U.displayName = "Stepper";
|
|
207
228
|
export {
|
|
208
|
-
|
|
229
|
+
U as default
|
|
209
230
|
};
|
|
210
231
|
//# 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 { 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};\n\nexport type TStepperProps = {\n steps: TStep[];\n currentStep: number;\n onClick?: (index: number) => void;\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 * />\n * ```\n */\nconst Stepper = ({\n steps,\n currentStep,\n appearance = 'linear',\n labelPosition = 'inline',\n onClick,\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 return (\n <div\n key={index}\n onClick={() => onClick?.(index)}\n className={`flex ${index < steps.length - 1 || appearance == 'parallel' ? 'flex flex-grow' : ''} min-w-[200px] ${\n onClick ? 'cursor-pointer' : ''\n }`}\n >\n <div className={`w-full flex flex-col`}>\n <div className={`flex ${getLabelDescriptionPosition()} ${labelPosition === 'inline' && appearance === 'linear' ? 'items-center' : ''}`}>\n <div className={`${labelPosition === 'inline' ? 'max-w-[70%]' : 'w-full'} flex flex-col`}>\n <div className={`flex ${labelPosition === 'top-right' || labelPosition === 'bottom-right' ? 'justify-end' : ''}`}>\n <Tooltip title={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 <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 ) : 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","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","jsx","jsxs","Tooltip","Typography","Lock","Fragment","CheckIcon","Dropdown"],"mappings":";;;;;;;;AAmDA,MAAMA,IAAU,CAAC;AAAA,EACf,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAAA,EAChB,SAAAC;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,MAC9BpB,MAAkB,SAASA,MAAkB,cACxC,aACEA,MAAkB,YAAYA,MAAkB,iBAClD,qBACED,MAAe,WACjB,aAEA,YAILsB,IAAoB,MAAM;AAC9B,eAAW,MAAM;AACf,MAAAX,EAAqB,CAAC;AACtB,YAAMY,IAAY,KACZC,IAAiB;AACvB,UAAIC,IAAY,GACZC,IAAQ;AACZ,eAASC,IAAQ,GAAGA,IAAQ7B,EAAM,WAC5BU,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,EAAqBb,GAAO,MAAM;AAAA,IAEtC,GAAG,GAAG;AAAA,EACR;AAEA,EAAA8B,EAAU,MAAM;AACd,IAAAN,EAAA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,OAAOtB,GACd,UAAA,gBAAAqB,EAAC,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,gBAAA1C,EAAM,SAASiB;AAAA,gBAAc;AAAA,cAAA,EAAA,CAChC,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,IAGF,gBAAAwB;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAW,QAAQ5C,EAAM,SAASiB,IAAgB,IAAI,mBAAmB,oBAAoB;AAAA,UAC7F,YAAW;AAAA,UAEX,4BAAC0B,GAAA,EAAQ,OAAOtB,GACd,UAAA,gBAAAqB,EAAC,OAAA,EAAI,WAAU,aACZ,UAAA;AAAA,YAAA1C,EAAM,SAASiB;AAAA,YAAc;AAAA,UAAA,EAAA,CAChC,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,MAIJ,gBAAAwB,EAAC,SAAI,WAAW,+CAA+CvC,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\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,E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