@lax-wp/design-system 0.14.50 → 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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),i=require("../../../_virtual/index.cjs.js"),S=require("react"),Y=require("../../tooltip/Tooltip.cjs.js"),s=require("@mui/icons-material"),e=require("./DataTypeIcon.cjs.js"),c={[e.APP_DATA_TYPES.BOOLEAN]:"#12B76A",[e.APP_DATA_TYPES.CHOICE]:"#DF5384",[e.APP_DATA_TYPES.DATE]:"#292E92",[e.APP_DATA_TYPES.EMAIL]:"#139AFA",[e.APP_DATA_TYPES.CURRENCY]:"#F99417",[e.APP_DATA_TYPES.DATETIME]:"#6E9D6D",[e.APP_DATA_TYPES.TEXT]:"#58B507",[e.APP_DATA_TYPES.STRING]:"#58B507",[e.APP_DATA_TYPES.TAG]:"#B31121",[e.APP_DATA_TYPES.MASTER_DATA]:"#CCAE00",[e.APP_DATA_TYPES.DYNAMIC]:"#DB00CD",[e.APP_DATA_TYPES.NUMBER]:"#00E4D1"},o="#98A2B3",x=({fill:t=o,size:P=16})=>A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:P,height:P,viewBox:"0 0 21 20",fill:"none",children:A.jsx("path",{d:"M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z",fill:t})}),O=({fill:t=o,size:P=16})=>A.jsx("svg",{width:P,height:P,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z",fill:t})}),d=({dataType:t="text",tooltip:P,size:T=16,className:l})=>{const E=e.APP_DATA_TYPES_OPTIONS.find(D=>D.value===t),[C,_]=S.useState(!1),a=document.documentElement.classList.contains("dark"),r=C?c[t]:o,u=C?a?e.BG_COLORS_DARK[t]:e.BG_COLORS[t]:"transparent",n={fontSize:T,color:r,transition:"color 150ms ease"};return A.jsx(Y,{title:P||E?.label,placement:"top",children:A.jsx("span",{className:i("flex items-center justify-center p-0.5 rounded-full transition-colors duration-150",l),style:{backgroundColor:u},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:(()=>{switch(t){case e.APP_DATA_TYPES.BOOLEAN:return A.jsx(s.Rule,{sx:n});case e.APP_DATA_TYPES.CHOICE:return A.jsx(s.FormatListBulleted,{sx:n});case e.APP_DATA_TYPES.DATE:return A.jsx(s.CalendarMonth,{sx:n});case e.APP_DATA_TYPES.EMAIL:return A.jsx(s.MailOutline,{sx:n});case e.APP_DATA_TYPES.CURRENCY:return A.jsx(s.AttachMoney,{sx:n});case e.APP_DATA_TYPES.DATETIME:return A.jsx(s.Schedule,{sx:n});case e.APP_DATA_TYPES.TEXT:case e.APP_DATA_TYPES.STRING:return A.jsx(s.SubjectOutlined,{sx:n});case e.APP_DATA_TYPES.TAG:return A.jsx(s.LocalOfferOutlined,{sx:n});case e.APP_DATA_TYPES.MASTER_DATA:return A.jsx(x,{size:T,fill:r});case e.APP_DATA_TYPES.DYNAMIC:return A.jsx(O,{size:T,fill:r});case e.APP_DATA_TYPES.NUMBER:return A.jsx(s.Numbers,{sx:n});default:return null}})()})})};exports.DATA_TYPE_ICON_COLORS=c;exports.LabelValueDataTypeIcon=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),i=require("../../../_virtual/index.cjs.js"),S=require("react"),Y=require("../../tooltip/Tooltip.cjs.js"),s=require("@mui/icons-material"),e=require("./DataTypeIcon.cjs.js"),c={[e.APP_DATA_TYPES.BOOLEAN]:"#12B76A",[e.APP_DATA_TYPES.CHOICE]:"#DF5384",[e.APP_DATA_TYPES.DATE]:"#292E92",[e.APP_DATA_TYPES.EMAIL]:"#139AFA",[e.APP_DATA_TYPES.CURRENCY]:"#F99417",[e.APP_DATA_TYPES.DATETIME]:"#6E9D6D",[e.APP_DATA_TYPES.TEXT]:"#58B507",[e.APP_DATA_TYPES.STRING]:"#58B507",[e.APP_DATA_TYPES.TAG]:"#B31121",[e.APP_DATA_TYPES.MASTER_DATA]:"#CCAE00",[e.APP_DATA_TYPES.DYNAMIC]:"#DB00CD",[e.APP_DATA_TYPES.NUMBER]:"#00E4D1"},o="#98A2B3",x=({fill:t=o,size:P=16})=>A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:P,height:P,viewBox:"0 0 21 20",fill:"none",children:A.jsx("path",{d:"M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z",fill:t})}),O=({fill:t=o,size:P=16})=>A.jsx("svg",{width:P,height:P,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z",fill:t})}),d=({dataType:t="text",tooltip:P,size:T=16,className:l})=>{const E=e.APP_DATA_TYPES_OPTIONS.find(D=>D.value===t),[C,_]=S.useState(!1),a=document.documentElement.classList.contains("dark"),r=C?c[t]:o,u=C?a?e.BG_COLORS_DARK[t]:e.BG_COLORS[t]:"transparent",n={fontSize:T,color:r,transition:"color 150ms ease"};return A.jsx(Y,{title:P||E?.label,placement:"top",children:A.jsx("span",{className:i("flex items-center justify-center -ml-1 p-0.5 rounded-full transition-colors duration-150",l),style:{backgroundColor:u},onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:(()=>{switch(t){case e.APP_DATA_TYPES.BOOLEAN:return A.jsx(s.Rule,{sx:n});case e.APP_DATA_TYPES.CHOICE:return A.jsx(s.FormatListBulleted,{sx:n});case e.APP_DATA_TYPES.DATE:return A.jsx(s.CalendarMonth,{sx:n});case e.APP_DATA_TYPES.EMAIL:return A.jsx(s.MailOutline,{sx:n});case e.APP_DATA_TYPES.CURRENCY:return A.jsx(s.AttachMoney,{sx:n});case e.APP_DATA_TYPES.DATETIME:return A.jsx(s.Schedule,{sx:n});case e.APP_DATA_TYPES.TEXT:case e.APP_DATA_TYPES.STRING:return A.jsx(s.SubjectOutlined,{sx:n});case e.APP_DATA_TYPES.TAG:return A.jsx(s.LocalOfferOutlined,{sx:n});case e.APP_DATA_TYPES.MASTER_DATA:return A.jsx(x,{size:T,fill:r});case e.APP_DATA_TYPES.DYNAMIC:return A.jsx(O,{size:T,fill:r});case e.APP_DATA_TYPES.NUMBER:return A.jsx(s.Numbers,{sx:n});default:return null}})()})})};exports.DATA_TYPE_ICON_COLORS=c;exports.LabelValueDataTypeIcon=d;
2
2
  //# sourceMappingURL=LabelValueDataTypeIcon.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LabelValueDataTypeIcon.cjs.js","sources":["../../../../src/components/data-display/datatype-icon/LabelValueDataTypeIcon.tsx"],"sourcesContent":["import cn from 'classnames';\nimport { useState } from 'react';\nimport Tooltip from '../../tooltip/Tooltip';\nimport {\n AttachMoney,\n CalendarMonth,\n FormatListBulleted,\n LocalOfferOutlined,\n MailOutline,\n Numbers,\n Rule,\n Schedule,\n SubjectOutlined,\n} from '@mui/icons-material';\nimport { APP_DATA_TYPES, APP_DATA_TYPES_OPTIONS, BG_COLORS, BG_COLORS_DARK } from './DataTypeIcon';\n\n/**\n * Accent color of each data type — the hover color of the icon\n */\nexport const DATA_TYPE_ICON_COLORS: Record<string, string> = {\n [APP_DATA_TYPES.BOOLEAN]: '#12B76A',\n [APP_DATA_TYPES.CHOICE]: '#DF5384',\n [APP_DATA_TYPES.DATE]: '#292E92',\n [APP_DATA_TYPES.EMAIL]: '#139AFA',\n [APP_DATA_TYPES.CURRENCY]: '#F99417',\n [APP_DATA_TYPES.DATETIME]: '#6E9D6D',\n [APP_DATA_TYPES.TEXT]: '#58B507',\n [APP_DATA_TYPES.STRING]: '#58B507',\n [APP_DATA_TYPES.TAG]: '#B31121',\n [APP_DATA_TYPES.MASTER_DATA]: '#CCAE00',\n [APP_DATA_TYPES.DYNAMIC]: '#DB00CD',\n [APP_DATA_TYPES.NUMBER]: '#00E4D1',\n};\n\n/** Neutral/400 — resting color of the icon */\nconst NEUTRAL_400 = '#98A2B3';\n\nconst DataBaseIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg xmlns='http://www.w3.org/2000/svg' width={size} height={size} viewBox='0 0 21 20' fill='none'>\n <path\n d='M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z'\n fill={fill}\n />\n </svg>\n);\n\nconst AutomationIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg width={size} height={size} viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z'\n fill={fill}\n />\n </svg>\n);\n\nexport interface LabelValueDataTypeIconProps {\n /** One of `APP_DATA_TYPES` */\n dataType: string;\n /** Overrides the default tooltip (the data type label) */\n tooltip?: React.ReactNode;\n /** Icon size in px (default: 16) */\n size?: number;\n /** Additional CSS classes on the icon wrapper */\n className?: string;\n}\n\n/**\n * Data type icon used to emphasize the data type of a `LabelValue` field.\n *\n * Unlike `DataTypeIcon` — which always renders a colored icon on a colored\n * square, as used in table headers — this one is quiet at rest: the icon sits\n * at Neutral/400 on a transparent background, and only on hover does it take\n * the data type accent color over a round, light tint of that same color.\n * A tooltip names the data type.\n *\n * @example\n * ```tsx\n * <LabelValueDataTypeIcon dataType={APP_DATA_TYPES.CURRENCY} />\n * ```\n */\nexport const LabelValueDataTypeIcon = ({\n dataType = 'text',\n tooltip,\n size = 16,\n className,\n}: LabelValueDataTypeIconProps) => {\n const dataTypeOption = APP_DATA_TYPES_OPTIONS.find((option) => option.value === dataType);\n const [isHover, setIsHover] = useState(false);\n const isDark = document.documentElement.classList.contains('dark');\n\n const color = isHover ? DATA_TYPE_ICON_COLORS[dataType] : NEUTRAL_400;\n const backgroundColor = isHover ? (isDark ? BG_COLORS_DARK[dataType] : BG_COLORS[dataType]) : 'transparent';\n const sx = { fontSize: size, color, transition: 'color 150ms ease' };\n\n return (\n <Tooltip title={tooltip || dataTypeOption?.label} placement='top'>\n <span\n className={cn('flex items-center justify-center p-0.5 rounded-full transition-colors duration-150', className)}\n style={{ backgroundColor }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n {(() => {\n switch (dataType) {\n case APP_DATA_TYPES.BOOLEAN:\n return <Rule sx={sx} />;\n case APP_DATA_TYPES.CHOICE:\n return <FormatListBulleted sx={sx} />;\n case APP_DATA_TYPES.DATE:\n return <CalendarMonth sx={sx} />;\n case APP_DATA_TYPES.EMAIL:\n return <MailOutline sx={sx} />;\n case APP_DATA_TYPES.CURRENCY:\n return <AttachMoney sx={sx} />;\n case APP_DATA_TYPES.DATETIME:\n return <Schedule sx={sx} />;\n case APP_DATA_TYPES.TEXT:\n case APP_DATA_TYPES.STRING:\n return <SubjectOutlined sx={sx} />;\n case APP_DATA_TYPES.TAG:\n return <LocalOfferOutlined sx={sx} />;\n case APP_DATA_TYPES.MASTER_DATA:\n return <DataBaseIcon size={size} fill={color} />;\n case APP_DATA_TYPES.DYNAMIC:\n return <AutomationIcon size={size} fill={color} />;\n case APP_DATA_TYPES.NUMBER:\n return <Numbers sx={sx} />;\n default:\n return null;\n }\n })()}\n </span>\n </Tooltip>\n );\n};\n"],"names":["DATA_TYPE_ICON_COLORS","APP_DATA_TYPES","NEUTRAL_400","DataBaseIcon","fill","size","jsx","AutomationIcon","LabelValueDataTypeIcon","dataType","tooltip","className","dataTypeOption","APP_DATA_TYPES_OPTIONS","option","isHover","setIsHover","useState","isDark","color","backgroundColor","BG_COLORS_DARK","BG_COLORS","sx","Tooltip","cn","Rule","FormatListBulleted","CalendarMonth","MailOutline","AttachMoney","Schedule","SubjectOutlined","LocalOfferOutlined","Numbers"],"mappings":"kSAmBaA,EAAgD,CAC3D,CAACC,EAAAA,eAAe,OAAO,EAAG,UAC1B,CAACA,EAAAA,eAAe,MAAM,EAAG,UACzB,CAACA,EAAAA,eAAe,IAAI,EAAG,UACvB,CAACA,EAAAA,eAAe,KAAK,EAAG,UACxB,CAACA,EAAAA,eAAe,QAAQ,EAAG,UAC3B,CAACA,EAAAA,eAAe,QAAQ,EAAG,UAC3B,CAACA,EAAAA,eAAe,IAAI,EAAG,UACvB,CAACA,EAAAA,eAAe,MAAM,EAAG,UACzB,CAACA,EAAAA,eAAe,GAAG,EAAG,UACtB,CAACA,EAAAA,eAAe,WAAW,EAAG,UAC9B,CAACA,EAAAA,eAAe,OAAO,EAAG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AAA,eAAe,QAClB,OAAOK,MAACoB,EAAAA,MAAK,GAAAH,EAAQ,EACvB,KAAKtB,EAAAA,eAAe,OAClB,OAAOK,MAACqB,EAAAA,oBAAmB,GAAAJ,EAAQ,EACrC,KAAKtB,EAAAA,eAAe,KAClB,OAAOK,MAACsB,EAAAA,eAAc,GAAAL,EAAQ,EAChC,KAAKtB,EAAAA,eAAe,MAClB,OAAOK,MAACuB,EAAAA,aAAY,GAAAN,EAAQ,EAC9B,KAAKtB,EAAAA,eAAe,SAClB,OAAOK,MAACwB,EAAAA,aAAY,GAAAP,EAAQ,EAC9B,KAAKtB,EAAAA,eAAe,SAClB,OAAOK,MAACyB,EAAAA,UAAS,GAAAR,EAAQ,EAC3B,KAAKtB,EAAAA,eAAe,KACpB,KAAKA,EAAAA,eAAe,OAClB,OAAOK,MAAC0B,EAAAA,iBAAgB,GAAAT,EAAQ,EAClC,KAAKtB,EAAAA,eAAe,IAClB,OAAOK,MAAC2B,EAAAA,oBAAmB,GAAAV,EAAQ,EACrC,KAAKtB,EAAAA,eAAe,YAClB,OAAOK,EAAAA,IAACH,EAAA,CAAa,KAAAE,EAAY,KAAMc,CAAA,CAAO,EAChD,KAAKlB,EAAAA,eAAe,QAClB,OAAOK,EAAAA,IAACC,EAAA,CAAe,KAAAF,EAAY,KAAMc,CAAA,CAAO,EAClD,KAAKlB,EAAAA,eAAe,OAClB,OAAOK,MAAC4B,EAAAA,SAAQ,GAAAX,EAAQ,EAC1B,QACE,OAAO,IAAA,CAEb,GAAA,CAAG,CAAA,EAEP,CAEJ"}
1
+ {"version":3,"file":"LabelValueDataTypeIcon.cjs.js","sources":["../../../../src/components/data-display/datatype-icon/LabelValueDataTypeIcon.tsx"],"sourcesContent":["import cn from 'classnames';\nimport { useState } from 'react';\nimport Tooltip from '../../tooltip/Tooltip';\nimport {\n AttachMoney,\n CalendarMonth,\n FormatListBulleted,\n LocalOfferOutlined,\n MailOutline,\n Numbers,\n Rule,\n Schedule,\n SubjectOutlined,\n} from '@mui/icons-material';\nimport { APP_DATA_TYPES, APP_DATA_TYPES_OPTIONS, BG_COLORS, BG_COLORS_DARK } from './DataTypeIcon';\n\n/**\n * Accent color of each data type — the hover color of the icon\n */\nexport const DATA_TYPE_ICON_COLORS: Record<string, string> = {\n [APP_DATA_TYPES.BOOLEAN]: '#12B76A',\n [APP_DATA_TYPES.CHOICE]: '#DF5384',\n [APP_DATA_TYPES.DATE]: '#292E92',\n [APP_DATA_TYPES.EMAIL]: '#139AFA',\n [APP_DATA_TYPES.CURRENCY]: '#F99417',\n [APP_DATA_TYPES.DATETIME]: '#6E9D6D',\n [APP_DATA_TYPES.TEXT]: '#58B507',\n [APP_DATA_TYPES.STRING]: '#58B507',\n [APP_DATA_TYPES.TAG]: '#B31121',\n [APP_DATA_TYPES.MASTER_DATA]: '#CCAE00',\n [APP_DATA_TYPES.DYNAMIC]: '#DB00CD',\n [APP_DATA_TYPES.NUMBER]: '#00E4D1',\n};\n\n/** Neutral/400 — resting color of the icon */\nconst NEUTRAL_400 = '#98A2B3';\n\nconst DataBaseIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg xmlns='http://www.w3.org/2000/svg' width={size} height={size} viewBox='0 0 21 20' fill='none'>\n <path\n d='M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z'\n fill={fill}\n />\n </svg>\n);\n\nconst AutomationIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg width={size} height={size} viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z'\n fill={fill}\n />\n </svg>\n);\n\nexport interface LabelValueDataTypeIconProps {\n /** One of `APP_DATA_TYPES` */\n dataType: string;\n /** Overrides the default tooltip (the data type label) */\n tooltip?: React.ReactNode;\n /** Icon size in px (default: 16) */\n size?: number;\n /** Additional CSS classes on the icon wrapper */\n className?: string;\n}\n\n/**\n * Data type icon used to emphasize the data type of a `LabelValue` field.\n *\n * Unlike `DataTypeIcon` — which always renders a colored icon on a colored\n * square, as used in table headers — this one is quiet at rest: the icon sits\n * at Neutral/400 on a transparent background, and only on hover does it take\n * the data type accent color over a round, light tint of that same color.\n * A tooltip names the data type.\n *\n * @example\n * ```tsx\n * <LabelValueDataTypeIcon dataType={APP_DATA_TYPES.CURRENCY} />\n * ```\n */\nexport const LabelValueDataTypeIcon = ({\n dataType = 'text',\n tooltip,\n size = 16,\n className,\n}: LabelValueDataTypeIconProps) => {\n const dataTypeOption = APP_DATA_TYPES_OPTIONS.find((option) => option.value === dataType);\n const [isHover, setIsHover] = useState(false);\n const isDark = document.documentElement.classList.contains('dark');\n\n const color = isHover ? DATA_TYPE_ICON_COLORS[dataType] : NEUTRAL_400;\n const backgroundColor = isHover ? (isDark ? BG_COLORS_DARK[dataType] : BG_COLORS[dataType]) : 'transparent';\n const sx = { fontSize: size, color, transition: 'color 150ms ease' };\n\n return (\n <Tooltip title={tooltip || dataTypeOption?.label} placement='top'>\n <span\n className={cn('flex items-center justify-center -ml-1 p-0.5 rounded-full transition-colors duration-150', className)}\n style={{ backgroundColor }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n {(() => {\n switch (dataType) {\n case APP_DATA_TYPES.BOOLEAN:\n return <Rule sx={sx} />;\n case APP_DATA_TYPES.CHOICE:\n return <FormatListBulleted sx={sx} />;\n case APP_DATA_TYPES.DATE:\n return <CalendarMonth sx={sx} />;\n case APP_DATA_TYPES.EMAIL:\n return <MailOutline sx={sx} />;\n case APP_DATA_TYPES.CURRENCY:\n return <AttachMoney sx={sx} />;\n case APP_DATA_TYPES.DATETIME:\n return <Schedule sx={sx} />;\n case APP_DATA_TYPES.TEXT:\n case APP_DATA_TYPES.STRING:\n return <SubjectOutlined sx={sx} />;\n case APP_DATA_TYPES.TAG:\n return <LocalOfferOutlined sx={sx} />;\n case APP_DATA_TYPES.MASTER_DATA:\n return <DataBaseIcon size={size} fill={color} />;\n case APP_DATA_TYPES.DYNAMIC:\n return <AutomationIcon size={size} fill={color} />;\n case APP_DATA_TYPES.NUMBER:\n return <Numbers sx={sx} />;\n default:\n return null;\n }\n })()}\n </span>\n </Tooltip>\n );\n};\n"],"names":["DATA_TYPE_ICON_COLORS","APP_DATA_TYPES","NEUTRAL_400","DataBaseIcon","fill","size","jsx","AutomationIcon","LabelValueDataTypeIcon","dataType","tooltip","className","dataTypeOption","APP_DATA_TYPES_OPTIONS","option","isHover","setIsHover","useState","isDark","color","backgroundColor","BG_COLORS_DARK","BG_COLORS","sx","Tooltip","cn","Rule","FormatListBulleted","CalendarMonth","MailOutline","AttachMoney","Schedule","SubjectOutlined","LocalOfferOutlined","Numbers"],"mappings":"kSAmBaA,EAAgD,CAC3D,CAACC,EAAAA,eAAe,OAAO,EAAG,UAC1B,CAACA,EAAAA,eAAe,MAAM,EAAG,UACzB,CAACA,EAAAA,eAAe,IAAI,EAAG,UACvB,CAACA,EAAAA,eAAe,KAAK,EAAG,UACxB,CAACA,EAAAA,eAAe,QAAQ,EAAG,UAC3B,CAACA,EAAAA,eAAe,QAAQ,EAAG,UAC3B,CAACA,EAAAA,eAAe,IAAI,EAAG,UACvB,CAACA,EAAAA,eAAe,MAAM,EAAG,UACzB,CAACA,EAAAA,eAAe,GAAG,EAAG,UACtB,CAACA,EAAAA,eAAe,WAAW,EAAG,UAC9B,CAACA,EAAAA,eAAe,OAAO,EAAG,UAC1B,CAACA,EAAAA,eAAe,MAAM,EAAG,S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AK,GAAAH,EAAQ,EACvB,KAAKtB,EAAAA,eAAe,OAClB,OAAOK,MAACqB,EAAAA,oBAAmB,GAAAJ,EAAQ,EACrC,KAAKtB,EAAAA,eAAe,KAClB,OAAOK,MAACsB,EAAAA,eAAc,GAAAL,EAAQ,EAChC,KAAKtB,EAAAA,eAAe,MAClB,OAAOK,MAACuB,EAAAA,aAAY,GAAAN,EAAQ,EAC9B,KAAKtB,EAAAA,eAAe,SAClB,OAAOK,MAACwB,EAAAA,aAAY,GAAAP,EAAQ,EAC9B,KAAKtB,EAAAA,eAAe,SAClB,OAAOK,MAACyB,EAAAA,UAAS,GAAAR,EAAQ,EAC3B,KAAKtB,EAAAA,eAAe,KACpB,KAAKA,EAAAA,eAAe,OAClB,OAAOK,MAAC0B,EAAAA,iBAAgB,GAAAT,EAAQ,EAClC,KAAKtB,EAAAA,eAAe,IAClB,OAAOK,MAAC2B,EAAAA,oBAAmB,GAAAV,EAAQ,EACrC,KAAKtB,EAAAA,eAAe,YAClB,OAAOK,EAAAA,IAACH,EAAA,CAAa,KAAAE,EAAY,KAAMc,CAAA,CAAO,EAChD,KAAKlB,EAAAA,eAAe,QAClB,OAAOK,EAAAA,IAACC,EAAA,CAAe,KAAAF,EAAY,KAAMc,CAAA,CAAO,EAClD,KAAKlB,EAAAA,eAAe,OAClB,OAAOK,MAAC4B,EAAAA,SAAQ,GAAAX,EAAQ,EAC1B,QACE,OAAO,IAAA,CAEb,GAAA,CAAG,CAAA,EAEP,CAEJ"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import m from "../../../_virtual/index.es.js";
2
+ import T from "../../../_virtual/index.es.js";
3
3
  import { useState as D } from "react";
4
4
  import f from "../../tooltip/Tooltip.es.js";
5
5
  import { Numbers as O, LocalOfferOutlined as d, SubjectOutlined as L, Schedule as h, AttachMoney as M, MailOutline as p, CalendarMonth as B, FormatListBulleted as I, Rule as R } from "@mui/icons-material";
@@ -17,13 +17,13 @@ const w = {
17
17
  [t.MASTER_DATA]: "#CCAE00",
18
18
  [t.DYNAMIC]: "#DB00CD",
19
19
  [t.NUMBER]: "#00E4D1"
20
- }, c = "#98A2B3", v = ({ fill: n = c, size: o = 16 }) => /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: o, height: o, viewBox: "0 0 21 20", fill: "none", children: /* @__PURE__ */ e(
20
+ }, l = "#98A2B3", v = ({ fill: n = l, size: o = 16 }) => /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: o, height: o, viewBox: "0 0 21 20", fill: "none", children: /* @__PURE__ */ e(
21
21
  "path",
22
22
  {
23
23
  d: "M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z",
24
24
  fill: n
25
25
  }
26
- ) }), g = ({ fill: n = c, size: o = 16 }) => /* @__PURE__ */ e("svg", { width: o, height: o, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
26
+ ) }), g = ({ fill: n = l, size: o = 16 }) => /* @__PURE__ */ e("svg", { width: o, height: o, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
27
27
  "path",
28
28
  {
29
29
  d: "M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z",
@@ -35,11 +35,11 @@ const w = {
35
35
  size: C = 16,
36
36
  className: i
37
37
  }) => {
38
- const u = N.find((T) => T.value === n), [l, a] = D(!1), A = document.documentElement.classList.contains("dark"), s = l ? w[n] : c, E = l ? A ? S[n] : _[n] : "transparent", r = { fontSize: C, color: s, transition: "color 150ms ease" };
38
+ const u = N.find((m) => m.value === n), [c, a] = D(!1), A = document.documentElement.classList.contains("dark"), s = c ? w[n] : l, E = c ? A ? S[n] : _[n] : "transparent", r = { fontSize: C, color: s, transition: "color 150ms ease" };
39
39
  return /* @__PURE__ */ e(f, { title: o || u?.label, placement: "top", children: /* @__PURE__ */ e(
40
40
  "span",
41
41
  {
42
- className: m("flex items-center justify-center p-0.5 rounded-full transition-colors duration-150", i),
42
+ className: T("flex items-center justify-center -ml-1 p-0.5 rounded-full transition-colors duration-150", i),
43
43
  style: { backgroundColor: E },
44
44
  onMouseEnter: () => a(!0),
45
45
  onMouseLeave: () => a(!1),
@@ -1 +1 @@
1
- {"version":3,"file":"LabelValueDataTypeIcon.es.js","sources":["../../../../src/components/data-display/datatype-icon/LabelValueDataTypeIcon.tsx"],"sourcesContent":["import cn from 'classnames';\nimport { useState } from 'react';\nimport Tooltip from '../../tooltip/Tooltip';\nimport {\n AttachMoney,\n CalendarMonth,\n FormatListBulleted,\n LocalOfferOutlined,\n MailOutline,\n Numbers,\n Rule,\n Schedule,\n SubjectOutlined,\n} from '@mui/icons-material';\nimport { APP_DATA_TYPES, APP_DATA_TYPES_OPTIONS, BG_COLORS, BG_COLORS_DARK } from './DataTypeIcon';\n\n/**\n * Accent color of each data type — the hover color of the icon\n */\nexport const DATA_TYPE_ICON_COLORS: Record<string, string> = {\n [APP_DATA_TYPES.BOOLEAN]: '#12B76A',\n [APP_DATA_TYPES.CHOICE]: '#DF5384',\n [APP_DATA_TYPES.DATE]: '#292E92',\n [APP_DATA_TYPES.EMAIL]: '#139AFA',\n [APP_DATA_TYPES.CURRENCY]: '#F99417',\n [APP_DATA_TYPES.DATETIME]: '#6E9D6D',\n [APP_DATA_TYPES.TEXT]: '#58B507',\n [APP_DATA_TYPES.STRING]: '#58B507',\n [APP_DATA_TYPES.TAG]: '#B31121',\n [APP_DATA_TYPES.MASTER_DATA]: '#CCAE00',\n [APP_DATA_TYPES.DYNAMIC]: '#DB00CD',\n [APP_DATA_TYPES.NUMBER]: '#00E4D1',\n};\n\n/** Neutral/400 — resting color of the icon */\nconst NEUTRAL_400 = '#98A2B3';\n\nconst DataBaseIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg xmlns='http://www.w3.org/2000/svg' width={size} height={size} viewBox='0 0 21 20' fill='none'>\n <path\n d='M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z'\n fill={fill}\n />\n </svg>\n);\n\nconst AutomationIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg width={size} height={size} viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z'\n fill={fill}\n />\n </svg>\n);\n\nexport interface LabelValueDataTypeIconProps {\n /** One of `APP_DATA_TYPES` */\n dataType: string;\n /** Overrides the default tooltip (the data type label) */\n tooltip?: React.ReactNode;\n /** Icon size in px (default: 16) */\n size?: number;\n /** Additional CSS classes on the icon wrapper */\n className?: string;\n}\n\n/**\n * Data type icon used to emphasize the data type of a `LabelValue` field.\n *\n * Unlike `DataTypeIcon` — which always renders a colored icon on a colored\n * square, as used in table headers — this one is quiet at rest: the icon sits\n * at Neutral/400 on a transparent background, and only on hover does it take\n * the data type accent color over a round, light tint of that same color.\n * A tooltip names the data type.\n *\n * @example\n * ```tsx\n * <LabelValueDataTypeIcon dataType={APP_DATA_TYPES.CURRENCY} />\n * ```\n */\nexport const LabelValueDataTypeIcon = ({\n dataType = 'text',\n tooltip,\n size = 16,\n className,\n}: LabelValueDataTypeIconProps) => {\n const dataTypeOption = APP_DATA_TYPES_OPTIONS.find((option) => option.value === dataType);\n const [isHover, setIsHover] = useState(false);\n const isDark = document.documentElement.classList.contains('dark');\n\n const color = isHover ? DATA_TYPE_ICON_COLORS[dataType] : NEUTRAL_400;\n const backgroundColor = isHover ? (isDark ? BG_COLORS_DARK[dataType] : BG_COLORS[dataType]) : 'transparent';\n const sx = { fontSize: size, color, transition: 'color 150ms ease' };\n\n return (\n <Tooltip title={tooltip || dataTypeOption?.label} placement='top'>\n <span\n className={cn('flex items-center justify-center p-0.5 rounded-full transition-colors duration-150', className)}\n style={{ backgroundColor }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n {(() => {\n switch (dataType) {\n case APP_DATA_TYPES.BOOLEAN:\n return <Rule sx={sx} />;\n case APP_DATA_TYPES.CHOICE:\n return <FormatListBulleted sx={sx} />;\n case APP_DATA_TYPES.DATE:\n return <CalendarMonth sx={sx} />;\n case APP_DATA_TYPES.EMAIL:\n return <MailOutline sx={sx} />;\n case APP_DATA_TYPES.CURRENCY:\n return <AttachMoney sx={sx} />;\n case APP_DATA_TYPES.DATETIME:\n return <Schedule sx={sx} />;\n case APP_DATA_TYPES.TEXT:\n case APP_DATA_TYPES.STRING:\n return <SubjectOutlined sx={sx} />;\n case APP_DATA_TYPES.TAG:\n return <LocalOfferOutlined sx={sx} />;\n case APP_DATA_TYPES.MASTER_DATA:\n return <DataBaseIcon size={size} fill={color} />;\n case APP_DATA_TYPES.DYNAMIC:\n return <AutomationIcon size={size} fill={color} />;\n case APP_DATA_TYPES.NUMBER:\n return <Numbers sx={sx} />;\n default:\n return null;\n }\n })()}\n </span>\n </Tooltip>\n );\n};\n"],"names":["DATA_TYPE_ICON_COLORS","APP_DATA_TYPES","NEUTRAL_400","DataBaseIcon","fill","size","jsx","AutomationIcon","LabelValueDataTypeIcon","dataType","tooltip","className","dataTypeOption","APP_DATA_TYPES_OPTIONS","option","isHover","setIsHover","useState","isDark","color","backgroundColor","BG_COLORS_DARK","BG_COLORS","sx","Tooltip","cn","Rule","FormatListBulleted","CalendarMonth","MailOutline","AttachMoney","Schedule","SubjectOutlined","LocalOfferOutlined","Numbers"],"mappings":";;;;;;AAmBO,MAAMA,IAAgD;AAAA,EAC3D,CAACC,EAAe,OAAO,GAAG;AAAA,EAC1B,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,IAAI,GAAG;AAAA,EACvB,CAACA,EAAe,KAAK,GAAG;AAAA,EACxB,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,IAAI,GAAG;AAAA,EACvB,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,GAAG,GAAG;AAAA,EACtB,CAACA,EAAe,WAAW,GAAG;AAAA,EAC9B,CAACA,EAAe,OAAO,GAAG;AAAA,EAC1B,CAACA,EAAe,MAAM,GAAG;AAC3B,GAGMC,IAAc,WAEdC,IAAe,CAAC,EAAE,MAAAC,IAAOF,GAAa,MAAAG,IAAO,SACjD,gBAAAC,EAAC,SAAI,OAAM,8BAA6B,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAC1F,UAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAAA,IACF,MAAAF;AAAA,EAAA;AACF,GACF,GAGIG,IAAiB,CAAC,EAAE,MAAAH,IAAOF,GAAa,MAAAG,IAAO,SACnD,gBAAAC,EAAC,SAAI,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAAO,OAAM,8BACpE,UAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAAA,IACF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AS,IAAAR,GAAQ;AAAA,UAC3B,KAAKtB,EAAe;AAAA,UACpB,KAAKA,EAAe;AAClB,mBAAO,gBAAAK,EAAC0B,KAAgB,IAAAT,GAAQ;AAAA,UAClC,KAAKtB,EAAe;AAClB,mBAAO,gBAAAK,EAAC2B,KAAmB,IAAAV,GAAQ;AAAA,UACrC,KAAKtB,EAAe;AAClB,mBAAO,gBAAAK,EAACH,GAAA,EAAa,MAAAE,GAAY,MAAMc,EAAA,CAAO;AAAA,UAChD,KAAKlB,EAAe;AAClB,mBAAO,gBAAAK,EAACC,GAAA,EAAe,MAAAF,GAAY,MAAMc,EAAA,CAAO;AAAA,UAClD,KAAKlB,EAAe;AAClB,mBAAO,gBAAAK,EAAC4B,KAAQ,IAAAX,GAAQ;AAAA,UAC1B;AACE,mBAAO;AAAA,QAAA;AAAA,MAEb,GAAA;AAAA,IAAG;AAAA,EAAA,GAEP;AAEJ;"}
1
+ {"version":3,"file":"LabelValueDataTypeIcon.es.js","sources":["../../../../src/components/data-display/datatype-icon/LabelValueDataTypeIcon.tsx"],"sourcesContent":["import cn from 'classnames';\nimport { useState } from 'react';\nimport Tooltip from '../../tooltip/Tooltip';\nimport {\n AttachMoney,\n CalendarMonth,\n FormatListBulleted,\n LocalOfferOutlined,\n MailOutline,\n Numbers,\n Rule,\n Schedule,\n SubjectOutlined,\n} from '@mui/icons-material';\nimport { APP_DATA_TYPES, APP_DATA_TYPES_OPTIONS, BG_COLORS, BG_COLORS_DARK } from './DataTypeIcon';\n\n/**\n * Accent color of each data type — the hover color of the icon\n */\nexport const DATA_TYPE_ICON_COLORS: Record<string, string> = {\n [APP_DATA_TYPES.BOOLEAN]: '#12B76A',\n [APP_DATA_TYPES.CHOICE]: '#DF5384',\n [APP_DATA_TYPES.DATE]: '#292E92',\n [APP_DATA_TYPES.EMAIL]: '#139AFA',\n [APP_DATA_TYPES.CURRENCY]: '#F99417',\n [APP_DATA_TYPES.DATETIME]: '#6E9D6D',\n [APP_DATA_TYPES.TEXT]: '#58B507',\n [APP_DATA_TYPES.STRING]: '#58B507',\n [APP_DATA_TYPES.TAG]: '#B31121',\n [APP_DATA_TYPES.MASTER_DATA]: '#CCAE00',\n [APP_DATA_TYPES.DYNAMIC]: '#DB00CD',\n [APP_DATA_TYPES.NUMBER]: '#00E4D1',\n};\n\n/** Neutral/400 — resting color of the icon */\nconst NEUTRAL_400 = '#98A2B3';\n\nconst DataBaseIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg xmlns='http://www.w3.org/2000/svg' width={size} height={size} viewBox='0 0 21 20' fill='none'>\n <path\n d='M10.666 17.5C8.56879 17.5 6.79449 17.1771 5.3431 16.5312C3.89171 15.8854 3.16602 15.0972 3.16602 14.1667V5.83333C3.16602 4.91667 3.89865 4.13194 5.36393 3.47917C6.82921 2.82639 8.59657 2.5 10.666 2.5C12.7355 2.5 14.5028 2.82639 15.9681 3.47917C17.4334 4.13194 18.166 4.91667 18.166 5.83333V14.1667C18.166 15.0972 17.4403 15.8854 15.9889 16.5312C14.5375 17.1771 12.7632 17.5 10.666 17.5Z'\n fill={fill}\n />\n </svg>\n);\n\nconst AutomationIcon = ({ fill = NEUTRAL_400, size = 16 }) => (\n <svg width={size} height={size} viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M3.70019 8.625C3.35019 8.91667 2.98561 9.05 2.60644 9.025C2.22727 9 1.89602 8.87083 1.61269 8.6375C1.32935 8.40417 1.1356 8.09792 1.03144 7.71875C0.927272 7.33958 0.996022 6.95 1.23769 6.55L2.17519 5C1.96685 4.81667 1.80227 4.59583 1.68144 4.3375C1.5606 4.07917 1.50019 3.8 1.50019 3.5C1.50019 2.95 1.69602 2.47917 2.08769 2.0875C2.47936 1.69583 2.95019 1.5 3.50019 1.5C4.05019 1.5 4.52102 1.69583 4.91269 2.0875C5.30436 2.47917 5.50019 2.95 5.50019 3.5C5.50019 4.05 5.30436 4.52083 4.91269 4.9125C4.52102 5.30417 4.05019 5.5 3.50019 5.5C3.42519 5.5 3.35019 5.49583 3.27519 5.4875C3.20019 5.47917 3.12935 5.46667 3.06269 5.45L2.10019 7.075C2.00852 7.225 1.97936 7.37292 2.01269 7.51875C2.04602 7.66458 2.11686 7.78333 2.22519 7.875C2.33352 7.96667 2.46269 8.01875 2.61269 8.03125C2.76269 8.04375 2.90852 7.99167 3.05019 7.875L8.30019 3.3625C8.65019 3.07083 9.01686 2.93958 9.40019 2.96875C9.78352 2.99792 10.1169 3.12917 10.4002 3.3625C10.6835 3.59583 10.8752 3.90208 10.9752 4.28125C11.0752 4.66042 11.0044 5.05 10.7627 5.45L9.82519 7C10.0335 7.18333 10.1981 7.40417 10.3189 7.6625C10.4398 7.92083 10.5002 8.2 10.5002 8.5C10.5002 9.05 10.3044 9.52083 9.91269 9.9125C9.52102 10.3042 9.05019 10.5 8.50019 10.5C7.95019 10.5 7.47936 10.3042 7.08769 9.9125C6.69602 9.52083 6.50019 9.05 6.50019 8.5C6.50019 7.95 6.69602 7.47917 7.08769 7.0875C7.47936 6.69583 7.95019 6.5 8.50019 6.5C8.57519 6.5 8.64811 6.50417 8.71894 6.5125C8.78977 6.52083 8.85852 6.53333 8.92519 6.55L9.90019 4.925C9.99186 4.775 10.021 4.62708 9.98769 4.48125C9.95436 4.33542 9.88352 4.21667 9.77519 4.125C9.66686 4.03333 9.53769 3.98125 9.38769 3.96875C9.23769 3.95625 9.09186 4.00833 8.95019 4.125L3.70019 8.625Z'\n fill={fill}\n />\n </svg>\n);\n\nexport interface LabelValueDataTypeIconProps {\n /** One of `APP_DATA_TYPES` */\n dataType: string;\n /** Overrides the default tooltip (the data type label) */\n tooltip?: React.ReactNode;\n /** Icon size in px (default: 16) */\n size?: number;\n /** Additional CSS classes on the icon wrapper */\n className?: string;\n}\n\n/**\n * Data type icon used to emphasize the data type of a `LabelValue` field.\n *\n * Unlike `DataTypeIcon` — which always renders a colored icon on a colored\n * square, as used in table headers — this one is quiet at rest: the icon sits\n * at Neutral/400 on a transparent background, and only on hover does it take\n * the data type accent color over a round, light tint of that same color.\n * A tooltip names the data type.\n *\n * @example\n * ```tsx\n * <LabelValueDataTypeIcon dataType={APP_DATA_TYPES.CURRENCY} />\n * ```\n */\nexport const LabelValueDataTypeIcon = ({\n dataType = 'text',\n tooltip,\n size = 16,\n className,\n}: LabelValueDataTypeIconProps) => {\n const dataTypeOption = APP_DATA_TYPES_OPTIONS.find((option) => option.value === dataType);\n const [isHover, setIsHover] = useState(false);\n const isDark = document.documentElement.classList.contains('dark');\n\n const color = isHover ? DATA_TYPE_ICON_COLORS[dataType] : NEUTRAL_400;\n const backgroundColor = isHover ? (isDark ? BG_COLORS_DARK[dataType] : BG_COLORS[dataType]) : 'transparent';\n const sx = { fontSize: size, color, transition: 'color 150ms ease' };\n\n return (\n <Tooltip title={tooltip || dataTypeOption?.label} placement='top'>\n <span\n className={cn('flex items-center justify-center -ml-1 p-0.5 rounded-full transition-colors duration-150', className)}\n style={{ backgroundColor }}\n onMouseEnter={() => setIsHover(true)}\n onMouseLeave={() => setIsHover(false)}\n >\n {(() => {\n switch (dataType) {\n case APP_DATA_TYPES.BOOLEAN:\n return <Rule sx={sx} />;\n case APP_DATA_TYPES.CHOICE:\n return <FormatListBulleted sx={sx} />;\n case APP_DATA_TYPES.DATE:\n return <CalendarMonth sx={sx} />;\n case APP_DATA_TYPES.EMAIL:\n return <MailOutline sx={sx} />;\n case APP_DATA_TYPES.CURRENCY:\n return <AttachMoney sx={sx} />;\n case APP_DATA_TYPES.DATETIME:\n return <Schedule sx={sx} />;\n case APP_DATA_TYPES.TEXT:\n case APP_DATA_TYPES.STRING:\n return <SubjectOutlined sx={sx} />;\n case APP_DATA_TYPES.TAG:\n return <LocalOfferOutlined sx={sx} />;\n case APP_DATA_TYPES.MASTER_DATA:\n return <DataBaseIcon size={size} fill={color} />;\n case APP_DATA_TYPES.DYNAMIC:\n return <AutomationIcon size={size} fill={color} />;\n case APP_DATA_TYPES.NUMBER:\n return <Numbers sx={sx} />;\n default:\n return null;\n }\n })()}\n </span>\n </Tooltip>\n );\n};\n"],"names":["DATA_TYPE_ICON_COLORS","APP_DATA_TYPES","NEUTRAL_400","DataBaseIcon","fill","size","jsx","AutomationIcon","LabelValueDataTypeIcon","dataType","tooltip","className","dataTypeOption","APP_DATA_TYPES_OPTIONS","option","isHover","setIsHover","useState","isDark","color","backgroundColor","BG_COLORS_DARK","BG_COLORS","sx","Tooltip","cn","Rule","FormatListBulleted","CalendarMonth","MailOutline","AttachMoney","Schedule","SubjectOutlined","LocalOfferOutlined","Numbers"],"mappings":";;;;;;AAmBO,MAAMA,IAAgD;AAAA,EAC3D,CAACC,EAAe,OAAO,GAAG;AAAA,EAC1B,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,IAAI,GAAG;AAAA,EACvB,CAACA,EAAe,KAAK,GAAG;AAAA,EACxB,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,IAAI,GAAG;AAAA,EACvB,CAACA,EAAe,MAAM,GAAG;AAAA,EACzB,CAACA,EAAe,GAAG,GAAG;AAAA,EACtB,CAACA,EAAe,WAAW,GAAG;AAAA,EAC9B,CAACA,EAAe,OAAO,GAAG;AAAA,EAC1B,CAACA,EAAe,MAAM,GAAG;AAC3B,GAGMC,IAAc,WAEdC,IAAe,CAAC,EAAE,MAAAC,IAAOF,GAAa,MAAAG,IAAO,SACjD,gBAAAC,EAAC,SAAI,OAAM,8BAA6B,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAC1F,UAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAAA,IACF,MAAAF;AAAA,EAAA;AACF,GACF,GAGIG,IAAiB,CAAC,EAAE,MAAAH,IAAOF,GAAa,MAAAG,IAAO,SACnD,gBAAAC,EAAC,SAAI,OAAOD,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QAA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,KAAY,IAAAP,GAAQ;AAAA,UAC9B,KAAKtB,EAAe;AAClB,mBAAO,gBAAAK,EAACyB,KAAS,IAAAR,GAAQ;AAAA,UAC3B,KAAKtB,EAAe;AAAA,UACpB,KAAKA,EAAe;AAClB,mBAAO,gBAAAK,EAAC0B,KAAgB,IAAAT,GAAQ;AAAA,UAClC,KAAKtB,EAAe;AAClB,mBAAO,gBAAAK,EAAC2B,KAAmB,IAAAV,GAAQ;AAAA,UACrC,KAAKtB,EAAe;AAClB,mBAAO,gBAAAK,EAACH,GAAA,EAAa,MAAAE,GAAY,MAAMc,EAAA,CAAO;AAAA,UAChD,KAAKlB,EAAe;AAClB,mBAAO,gBAAAK,EAACC,GAAA,EAAe,MAAAF,GAAY,MAAMc,EAAA,CAAO;AAAA,UAClD,KAAKlB,EAAe;AAClB,mBAAO,gBAAAK,EAAC4B,KAAQ,IAAAX,GAAQ;AAAA,UAC1B;AACE,mBAAO;AAAA,QAAA;AAAA,MAEb,GAAA;AAAA,IAAG;AAAA,EAAA,GAEP;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),I=require("@mui/icons-material"),W=require("antd"),m=require("react"),h=require("../../data-display/typography/Typography.cjs.js"),g=require("../../tooltip/Tooltip.cjs.js"),S=require("../../../hooks/useEventListener.cjs.js"),V=require("../../icon/icons.generated.cjs.js"),M=({steps:t,currentStep:a,appearance:s="linear",labelPosition:r="inline",onClick:j,className:C,showIndex:E=!0,disableOneMore:p=!1,isMainSideBarOpen:$=!1,isAuthoringOpen:T=!1})=>{const d=m.useRef(null),[c,v]=m.useState(0),[f,k]=m.useState(0),[o,z]=m.useState(0),[b,D]=m.useState(""),[R,q]=m.useState(""),F=()=>r==="top"||r==="top-right"?"flex-col":r==="bottom"||r==="bottom-right"?"flex-col-reverse":s==="linear"?"flex-row":"flex-col",w=()=>{setTimeout(()=>{v(0);const i=210,l=225;let n=0,x=0;for(let u=0;u<t.length&&(d?.current?.clientWidth&&d?.current?.clientWidth>n+l+i);u++)n+=l,x=u+1;v(x),d?.current?.clientWidth&&d?.current?.clientWidth<480&&v(t?.length)},300)};m.useEffect(()=>{w()},[$,t,a]),m.useEffect(()=>{setTimeout(()=>{w()},300)},[T]),m.useEffect(()=>{if(c>0)if(c>a){let i=t?.slice(c,t?.length)?.map(n=>n?.label)?.join(", "),l=c;p&&l===t.length-1&&(l=t.length,i=""),k(0),z(l),q(i)}else{const i=Math.floor((c+1)/2),l=a+i-t?.length;let n=a+i,x=a-Math.max(c-i,0)-(l>0?l:0),u=t?.slice(0,x)?.map(N=>N?.label)?.join(", "),L=t?.slice(n,t?.length)?.map(N=>N?.label)?.join(", ");p&&x===1&&(x=0,u=""),p&&n===t.length-1&&(n=t.length,L=""),k(x),z(n),D(u),q(L)}},[c,T,$,t,a]),S.useEventListener("resize",w);const y=(i,l,n=!1)=>e.jsx("div",{onClick:()=>j?.(l),className:`flex ${l<t.length-1||s=="parallel"?"flex flex-grow":""} min-w-[200px] ${j?"cursor-pointer":""}`,children:e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsxs("div",{className:`flex ${F()} ${r==="inline"&&s==="linear"?"items-center":""}`,children:[e.jsxs("div",{className:`${r==="inline"?"max-w-[70%]":"w-full"} flex flex-col`,children:[e.jsx("div",{className:`flex ${r==="top-right"||r==="bottom-right"?"justify-end":""}`,children:e.jsx(g,{title:i?.tooltipText,children:e.jsxs(h.Typography,{size:"small",variant:"medium",className:`truncate flex items-center ${l<=a?"text-primary-600 dark:text-primary-300":"text-neutral-400 dark:text-neutral-100"}`,appearance:"custom",children:[E?e.jsx("div",{className:`${s==="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`}`,children:i?.isLocked?e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(I.Lock,{sx:{fontSize:16}})}):e.jsx(e.Fragment,{children:a>l&&s==="linear"?e.jsx(V.CheckIcon,{size:18,className:"text-white dark:text-white"}):e.jsx(h.Typography,{size:`${s==="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<=a?"":"dark:text-black-200"}`,children:i?.label})]})})}),r!=="inline"||s==="parallel"?e.jsx("div",{className:`flex ${r==="top-right"||r==="bottom-right"?"justify-end":s==="linear"?"ml-8":""}`,children:e.jsx(h.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:i?.description||""})}):null]}),l<t.length-(s==="linear"&&r==="inline"?1:0)&&!n?e.jsx("div",{className:`w-full flex-grow h-0.5 min-w-[70px] ${r!=="inline"||s==="parallel"?"my-2":""} ${l<=a-(s==="linear"&&r==="inline"?1:0)?"bg-primary-600":"bg-neutral-300"}`}):null]}),r==="inline"&&s==="linear"?e.jsx(h.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:i?.description||""}):null]})},l);return e.jsxs("div",{className:`w-full flex ${C}`,ref:d,children:[f>0?e.jsxs("div",{className:`flex ${s==="parallel"?"flex-col":""}`,children:[j?e.jsx(W.Dropdown,{menu:{items:t.slice(0,f).map((i,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:y(i,l,!0)}),key:l}))},trigger:["click"],children:e.jsx(h.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-c>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(g,{title:b,children:e.jsxs("div",{className:"min-w-max",children:[f," More..."]})})})}):e.jsx(h.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-c>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(g,{title:b,children:e.jsxs("div",{className:"min-w-max",children:[f," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${s==="parallel"?"mt-2":"mt-[11px]"}`})]}):null,e.jsx("div",{className:"w-full flex flex-wrap gap-3 ",children:t?.map((i,l)=>f<=l&&l<o?y(i,l):null)}),t.length-o>0?e.jsxs("div",{className:"flex flex-col",children:[j?e.jsx(W.Dropdown,{menu:{items:t.slice(o,t?.length).map((i,l)=>({label:e.jsx("div",{className:"px-2 py-1",children:y(i,l+o,!0)}),key:l}))},trigger:["click"],children:e.jsx(h.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-o>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(g,{title:R,children:e.jsxs("div",{className:"min-w-max",children:[t.length-o," More..."]})})})}):e.jsx(h.Typography,{size:"small",variant:"medium",className:`px-2 ${t.length-o>0?"cursor-pointer":"cursor-not-allowed"}`,appearance:"subtitle",children:e.jsx(g,{title:R,children:e.jsxs("div",{className:"min-w-max",children:[t.length-o," More..."]})})}),e.jsx("div",{className:`h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${s==="parallel"?"mt-2":"hidden"}`})]}):null]})};M.displayName="Stepper";module.exports=M;
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,S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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,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,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"}
@@ -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 e, Fragment as q } from "react/jsx-runtime";
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 D } from "antd";
4
- import { useRef as H, useState as g, useEffect as T } from "react";
5
- import { Typography as h } from "../../data-display/typography/Typography.es.js";
6
- import v from "../../tooltip/Tooltip.es.js";
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 K } from "../../icon/icons.generated.es.js";
9
- const Q = ({
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: w,
15
- className: E,
16
- showIndex: F = !0,
17
- disableOneMore: N = !1,
18
- isMainSideBarOpen: z = !1,
19
- isAuthoringOpen: b = !1
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 f = H(null), [s, p] = g(0), [x, j] = g(0), [o, W] = g(0), [L, I] = g(""), [M, R] = g(""), V = () => r === "top" || r === "top-right" ? "flex-col" : r === "bottom" || r === "bottom-right" ? "flex-col-reverse" : a === "linear" ? "flex-row" : "flex-col", $ = () => {
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
- p(0);
24
- const i = 210, l = 225;
25
- let m = 0, d = 0;
26
- for (let u = 0; u < t.length && (f?.current?.clientWidth && f?.current?.clientWidth > m + l + i); u++)
27
- m += l, d = u + 1;
28
- p(d), f?.current?.clientWidth && f?.current?.clientWidth < 480 && p(t?.length);
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
- T(() => {
32
- $();
33
- }, [z, t, n]), T(() => {
32
+ z(() => {
33
+ k();
34
+ }, [L, t, n]), z(() => {
34
35
  setTimeout(() => {
35
- $();
36
+ k();
36
37
  }, 300);
37
- }, [b]), T(() => {
38
- if (s > 0)
39
- if (s > n) {
40
- let i = t?.slice(s, t?.length)?.map((m) => m?.label)?.join(", "), l = s;
41
- N && l === t.length - 1 && (l = t.length, i = ""), j(0), W(l), R(i);
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((s + 1) / 2), l = n + i - t?.length;
44
- let m = n + i, d = n - Math.max(s - i, 0) - (l > 0 ? l : 0), u = t?.slice(0, d)?.map((y) => y?.label)?.join(", "), C = t?.slice(m, t?.length)?.map((y) => y?.label)?.join(", ");
45
- N && d === 1 && (d = 0, u = ""), N && m === t.length - 1 && (m = t.length, C = ""), j(d), W(m), I(u), R(C);
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
- }, [s, b, z, t, n]), J("resize", $);
48
- const k = (i, l, m = !1) => /* @__PURE__ */ e(
49
- "div",
50
- {
51
- onClick: () => w?.(l),
52
- className: `flex ${l < t.length - 1 || a == "parallel" ? "flex flex-grow" : ""} min-w-[200px] ${w ? "cursor-pointer" : ""}`,
53
- children: /* @__PURE__ */ c("div", { className: "w-full flex flex-col", children: [
54
- /* @__PURE__ */ c("div", { className: `flex ${V()} ${r === "inline" && a === "linear" ? "items-center" : ""}`, children: [
55
- /* @__PURE__ */ c("div", { className: `${r === "inline" ? "max-w-[70%]" : "w-full"} flex flex-col`, children: [
56
- /* @__PURE__ */ e("div", { className: `flex ${r === "top-right" || r === "bottom-right" ? "justify-end" : ""}`, children: /* @__PURE__ */ e(v, { title: i?.tooltipText, children: /* @__PURE__ */ c(
57
- h,
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
- size: "small",
60
- variant: "medium",
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
- F ? /* @__PURE__ */ e(
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: `${a === "parallel" ? "flex items-center" : `w-6 h-6 ${l <= n ? "bg-primary-600" : "bg-neutral-400 dark:bg-black-400"} rounded-full flex items-center justify-center text-white`}`,
68
- children: i?.isLocked ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(G, { sx: { fontSize: 16 } }) }) : /* @__PURE__ */ e(q, { children: n > l && a === "linear" ? /* @__PURE__ */ e(K, { size: 18, className: "text-white dark:text-white" }) : /* @__PURE__ */ e(
69
- h,
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: `${a === "parallel" ? "small" : "extra-small"}`,
109
+ size: "extra-small",
72
110
  variant: "medium",
73
- className: "text-neutral-100",
111
+ className: `truncate ${e === n ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
74
112
  appearance: "custom",
75
- children: l + 1
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
- r !== "inline" || a === "parallel" ? /* @__PURE__ */ e(
120
+ ),
121
+ e < t.length - (a === "linear" && r === "inline" ? 1 : 0) && !m ? /* @__PURE__ */ l(
85
122
  "div",
86
123
  {
87
- className: `flex ${r === "top-right" || r === "bottom-right" ? "justify-end" : a === "linear" ? "ml-8" : ""}`,
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
- l < t.length - (a === "linear" && r === "inline" ? 1 : 0) && !m ? /* @__PURE__ */ e(
102
- "div",
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
- className: `w-full flex-grow h-0.5 min-w-[70px] ${r !== "inline" || a === "parallel" ? "my-2" : ""} ${l <= n - (a === "linear" && r === "inline" ? 1 : 0) ? "bg-primary-600" : "bg-neutral-300"}`
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
- r === "inline" && a === "linear" ? /* @__PURE__ */ e(
109
- h,
110
- {
111
- size: "extra-small",
112
- variant: "medium",
113
- className: `ml-8 truncate ${l === n ? "text-neutral-900 dark:text-white" : "text-neutral-400 dark:text-neutral-600"}`,
114
- appearance: "custom",
115
- children: i?.description || ""
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, x).map((i, l) => ({
129
- label: /* @__PURE__ */ e("div", { className: "px-2 py-1", children: k(i, l, !0) }),
130
- key: l
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__ */ e(
135
- h,
155
+ children: /* @__PURE__ */ l(
156
+ u,
136
157
  {
137
158
  size: "small",
138
159
  variant: "medium",
139
- className: `px-2 ${t.length - s > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
160
+ className: `px-2 ${t.length - d > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
140
161
  appearance: "subtitle",
141
- children: /* @__PURE__ */ e(v, { title: L, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
142
- x,
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__ */ e(
149
- h,
169
+ ) : /* @__PURE__ */ l(
170
+ u,
150
171
  {
151
172
  size: "small",
152
173
  variant: "medium",
153
- className: `px-2 ${t.length - s > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
174
+ className: `px-2 ${t.length - d > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
154
175
  appearance: "subtitle",
155
- children: /* @__PURE__ */ e(v, { title: L, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
156
- x,
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__ */ e("div", { className: `h-0.5 min-w-[40px] px-2 mr-2 bg-primary-600 ${a === "parallel" ? "mt-2" : "mt-[11px]"}` })
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__ */ e("div", { className: "w-full flex flex-wrap gap-3 ", children: t?.map((i, l) => x <= l && l < o ? k(i, l) : null) }),
164
- t.length - o > 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
165
- w ? /* @__PURE__ */ e(
166
- D,
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(o, t?.length).map((i, l) => ({
170
- label: /* @__PURE__ */ e("div", { className: "px-2 py-1", children: k(i, l + o, !0) }),
171
- key: l
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__ */ e(
176
- h,
196
+ children: /* @__PURE__ */ l(
197
+ u,
177
198
  {
178
199
  size: "small",
179
200
  variant: "medium",
180
- className: `px-2 ${t.length - o > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
201
+ className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
181
202
  appearance: "subtitle",
182
- children: /* @__PURE__ */ e(v, { title: M, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
183
- t.length - o,
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__ */ e(
190
- h,
210
+ ) : /* @__PURE__ */ l(
211
+ u,
191
212
  {
192
213
  size: "small",
193
214
  variant: "medium",
194
- className: `px-2 ${t.length - o > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
215
+ className: `px-2 ${t.length - h > 0 ? "cursor-pointer" : "cursor-not-allowed"}`,
195
216
  appearance: "subtitle",
196
- children: /* @__PURE__ */ e(v, { title: M, children: /* @__PURE__ */ c("div", { className: "min-w-max", children: [
197
- t.length - o,
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__ */ e("div", { className: `h-0.5 min-w-[40px] px-2 ml-2 bg-neutral-300 ${a === "parallel" ? "mt-2" : "hidden"}` })
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
- Q.displayName = "Stepper";
227
+ U.displayName = "Stepper";
207
228
  export {
208
- Q as default
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,IA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,aAAa,YAAYT,GAAMH,IAAQZ,GAAe,EAAI,EAAA,CAAE;AAAA,cAClF,KAAKY;AAAA,YAAA,EACL;AAAA,UAAA;AAAA,UAEJ,SAAS,CAAC,OAAO;AAAA,UAEjB,UAAA,gBAAAY;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,WAAW,QAAQ5C,EAAM,SAASiB,IAAgB,IAAI,mBAAmB,oBAAoB;AAAA,cAC7F,YAAW;AAAA,cAEX,4BAAC0B,GAAA,EAAQ,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,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,MAAAh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,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;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.14.50",
4
+ "version": "0.14.52",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",