@stackone/malachite 2.135.0 → 2.136.0

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 +1 @@
1
- {"version":3,"file":"StepList.js","sources":["../../src/components/StepList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport CheckmarkIcon from './CustomIcons/CheckmarkIcon';\nimport Text from './Typography/Text';\nimport { focusSection, holdsFocus, isFocusDropped } from './collapseFocus';\nimport { isRenderableNode } from './renderableNode';\n\nexport type StepListStatus = 'complete' | 'open' | 'locked';\n\nexport type StepListSize = 'medium' | 'small';\n\nexport type StepListVariant = 'numbered' | 'focused';\n\nexport interface StepListItem {\n /** Keys the row; falls back to its position, so pass one when steps come and go. */\n key?: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n /**\n * `complete` fills the marker with a tick, `open` rings it in the accent, and `locked`\n * dims the marker and the text. The first `open` step is the current one.\n */\n status: StepListStatus;\n /** Right of the text, e.g. the step's button. See `completeLabel` for a complete step. */\n action?: React.ReactNode;\n /** Under the description, shown only while this is the current step. */\n children?: React.ReactNode;\n}\n\nexport interface StepListProps {\n steps: StepListItem[];\n /** `small` is the compact list for a sidebar: tighter rows and smaller text. */\n size?: StepListSize;\n /**\n * `focused` marks each step with a ring around a square and a \"Step N\" label, in the accent\n * on the current step only, and fades every other step, any locked one, and the lines.\n */\n variant?: StepListVariant;\n /** Rules a line under each row, for a list that fills its container edge to edge. */\n dividers?: boolean;\n /**\n * Shown, with a dot, in the action column of a complete step that has no `action`, e.g.\n * \"Completed\". Hidden from assistive tech, which already hears the state after the title.\n */\n completeLabel?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** On the list. Each connector runs to the next row's marker, so add no gap between rows. */\n className?: string;\n}\n\nconst MARKER_SIZE = 24;\nconst DIVIDER_WIDTH = 1;\n\nconst SIZES: Record<\n StepListSize,\n {\n padding: { x: number; y: number };\n title: 'medium' | 'small';\n description: 'small' | 'xsmall';\n childrenGap: number;\n }\n> = {\n medium: { padding: { x: 28, y: 16 }, title: 'medium', description: 'small', childrenGap: 10 },\n small: { padding: { x: 20, y: 12 }, title: 'small', description: 'xsmall', childrenGap: 6 },\n};\n\n// Read out after the title: the marker is hidden, and the dimmed text alone says nothing.\nconst STATUS_LABELS: Record<StepListStatus, string | undefined> = {\n complete: 'Completed',\n open: undefined,\n locked: 'Locked',\n};\n\n// From a marker's foot, through the next row's top padding and any rule, to its marker.\nconst connectorStyle = (\n padding: { x: number; y: number },\n divider: boolean,\n): React.CSSProperties => ({\n insetInlineStart: padding.x + MARKER_SIZE / 2 - 1,\n top: padding.y + MARKER_SIZE,\n height: `calc(100% - ${MARKER_SIZE - (divider ? DIVIDER_WIDTH : 0)}px)`,\n});\n\nconst BORDER = 'var(--malachite-card-border, rgb(232, 232, 232))';\nconst ACCENT = 'var(--malachite-accent-background, rgb(0, 175, 102))';\n\nconst ACCENT_FOREGROUND = 'var(--malachite-accent-foreground, rgb(2, 122, 66))';\nconst NEUTRAL = 'var(--malachite-text-secondary, rgb(123, 123, 123))';\nconst DIMMED = 'var(--malachite-text-dimmed, rgb(161, 161, 161))';\nconst FADED_OPACITY = 0.4;\n\nconst dashed = (color: string) =>\n `repeating-linear-gradient(to bottom, ${color} 0px, ${color} 4px, transparent 4px, transparent 8px)`;\n\n// White on the accent fill in both themes, as Checkbox draws its tick.\nconst MARKER_CLASSES: Record<StepListStatus, string> = {\n complete: 'bg-[var(--malachite-accent-background,rgb(0,175,102))] text-white',\n open: 'border-[1.5px] border-solid border-[var(--malachite-accent-background,rgb(0,175,102))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-accent-foreground,rgb(2,122,66))]',\n locked: 'border-[1.5px] border-solid border-[var(--malachite-text-dimmed,rgb(153,153,153))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-dimmed,rgb(153,153,153))]',\n};\n\n// A locked step keeps an empty ring, so it reads apart from an open step waiting its turn.\nconst FocusedMarker: React.FC<{ status: StepListStatus; color: string; opacity?: number }> = ({\n status,\n color,\n opacity,\n}) => (\n <span\n aria-hidden=\"true\"\n className=\"relative z-[2] box-border flex shrink-0 items-center justify-center rounded-full border-[1.5px] border-solid bg-[var(--malachite-card-background,rgb(255,255,255))]\"\n style={{ width: MARKER_SIZE, height: MARKER_SIZE, borderColor: color, color, opacity }}\n >\n {status === 'complete' && <CheckmarkIcon size={12} />}\n {status === 'open' && (\n <span className=\"size-[10px] rounded-[3px]\" style={{ background: color }} />\n )}\n </span>\n);\n\nconst focusedMarkerColor = (status: StepListStatus, isCurrent: boolean): string => {\n if (isCurrent) {\n return ACCENT;\n }\n return status === 'locked' ? DIMMED : NEUTRAL;\n};\n\ninterface StepFocusHandOffProps {\n listRef: React.RefObject<HTMLOListElement | null>;\n currentRef: React.RefObject<HTMLLIElement | null>;\n}\n\ninterface RowSnapshot {\n row: HTMLElement;\n wasCurrent: boolean;\n}\n\nconst rowHolding = (list: HTMLOListElement): HTMLElement | undefined =>\n Array.from(list.children).find(\n (row): row is HTMLElement =>\n row instanceof HTMLElement && holdsFocus(row, list.getRootNode()),\n );\n\n/** A class for `getSnapshotBeforeUpdate`, which sees focus before the update drops it. */\nclass StepFocusHandOff extends React.Component<StepFocusHandOffProps> {\n getSnapshotBeforeUpdate(): RowSnapshot | null {\n const list = this.props.listRef.current;\n const row = list ? rowHolding(list) : undefined;\n return row ? { row, wasCurrent: row === this.props.currentRef.current } : null;\n }\n\n componentDidUpdate(\n _previous: StepFocusHandOffProps,\n _state: unknown,\n snapshot: RowSnapshot | null,\n ): void {\n if (!snapshot || !isFocusDropped(snapshot.row.ownerDocument)) {\n return;\n }\n const { row, wasCurrent } = snapshot;\n const current = this.props.currentRef.current;\n // Leaving the current step moves on to the next; any other row keeps the reader in it.\n const nearest = wasCurrent ? [current, row] : [row, current];\n const target = [...nearest, this.props.listRef.current].find(\n (element) => element?.isConnected,\n );\n focusSection(null, target ?? null, { preventScroll: false });\n }\n\n render(): null {\n return null;\n }\n}\n\n// The position, not the title: two steps may share one. `#` keeps it off consumers' keys.\nconst keyOf = (step: StepListItem, index: number): string => step.key ?? `#${index}`;\n\n/**\n * A numbered, vertical list of setup steps: a marker per step joined by a line that turns\n * solid once a step is done, the step's title and description, and an optional action.\n */\nconst StepList: React.FC<StepListProps> = ({\n steps,\n size = 'medium',\n variant = 'numbered',\n dividers = false,\n completeLabel,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}) => {\n const sizing = SIZES[size];\n const listRef = useRef<HTMLOListElement>(null);\n const currentRef = useRef<HTMLLIElement>(null);\n const current = steps.findIndex((step) => step.status === 'open');\n const focused = variant === 'focused';\n const fadesOthers = focused && current !== -1;\n const lineColor = focused ? NEUTRAL : BORDER;\n const solidLine = focused ? NEUTRAL : ACCENT;\n const showsCompleteLabel = (step: StepListItem) =>\n Boolean(completeLabel) && step.status === 'complete' && !isRenderableNode(step.action);\n const completeMark = (\n <span aria-hidden=\"true\" className=\"flex items-center gap-[6px]\">\n {/* Success, as its text: the label reports a status, not a choice. */}\n <span className=\"size-[8px] shrink-0 rounded-full bg-[var(--malachite-text-success,rgb(2,122,66))]\" />\n <Text size=\"small\" fontWeight=\"semi-bold\" color=\"success\">\n {completeLabel}\n </Text>\n </span>\n );\n // Every row keeps the column once any step has an action or a complete label, so the text\n // wraps alike.\n const hasActions = steps.some(\n (step) => isRenderableNode(step.action) || showsCompleteLabel(step),\n );\n\n return (\n <>\n {/* `role=\"list\"`: Safari drops the list role from a list styled `list-none`. */}\n <ol\n ref={listRef}\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`isolate m-0 list-none p-0 ${className}`}\n >\n {steps.map((step, index) => {\n const isCurrent = index === current;\n const locked = !focused && step.status === 'locked';\n const statusLabel = STATUS_LABELS[step.status];\n const faded =\n focused && ((fadesOthers && !isCurrent) || step.status === 'locked');\n const fade = faded ? FADED_OPACITY : undefined;\n return (\n <li\n key={keyOf(step, index)}\n ref={isCurrent ? currentRef : undefined}\n aria-current={isCurrent ? 'step' : undefined}\n style={{\n padding: `${sizing.padding.y}px ${sizing.padding.x}px`,\n borderBottom: dividers\n ? `${DIVIDER_WIDTH}px solid ${BORDER}`\n : undefined,\n }}\n className=\"relative flex items-start gap-[12px]\"\n >\n {index < steps.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute z-[1] w-[2px]\"\n style={{\n ...connectorStyle(sizing.padding, dividers),\n background:\n step.status === 'complete'\n ? solidLine\n : dashed(lineColor),\n opacity: fadesOthers ? FADED_OPACITY : undefined,\n }}\n />\n )}\n {focused ? (\n <FocusedMarker\n status={step.status}\n color={focusedMarkerColor(step.status, isCurrent)}\n opacity={fade}\n />\n ) : (\n <span\n aria-hidden=\"true\"\n className={`relative z-[2] box-border flex shrink-0 items-center justify-center rounded-full text-[length:var(--malachite-font-size-xsmall,11px)] [font-weight:600] ${MARKER_CLASSES[step.status]}`}\n style={{ width: MARKER_SIZE, height: MARKER_SIZE }}\n >\n {step.status === 'complete' ? (\n <CheckmarkIcon size={12} />\n ) : (\n index + 1\n )}\n </span>\n )}\n <div\n className=\"flex min-w-0 flex-1 flex-col gap-[2px] pt-[2px]\"\n style={{ opacity: fade }}\n >\n {focused && (\n <div\n aria-hidden=\"true\"\n style={{ color: isCurrent ? ACCENT_FOREGROUND : NEUTRAL }}\n >\n <Text size=\"xsmall\" fontWeight=\"semi-bold\" color=\"inherit\">\n Step {index + 1}\n </Text>\n </div>\n )}\n <Text\n size={sizing.title}\n fontWeight=\"semi-bold\"\n color={locked ? 'dimmed' : 'primary'}\n >\n {step.title}\n {statusLabel && (\n <span className=\"sr-only\">, {statusLabel}</span>\n )}\n </Text>\n {isRenderableNode(step.description) && (\n <Text\n size={sizing.description}\n color={locked ? 'dimmed' : 'secondary'}\n >\n {step.description}\n </Text>\n )}\n {isCurrent && isRenderableNode(step.children) && (\n <div\n className=\"min-w-0\"\n style={{ marginTop: sizing.childrenGap }}\n >\n {step.children}\n </div>\n )}\n </div>\n {hasActions && (\n <span\n className=\"ml-[16px] flex min-w-[120px] items-center justify-end\"\n style={{ opacity: fade }}\n >\n {showsCompleteLabel(step) ? completeMark : step.action}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n {/* After the list, so the hand-off reads the rows this commit rendered. */}\n <StepFocusHandOff listRef={listRef} currentRef={currentRef} />\n </>\n );\n};\n\nexport default StepList;\nexport { StepList };\n"],"names":["MARKER_SIZE","DIVIDER_WIDTH","SIZES","STATUS_LABELS","connectorStyle","padding","divider","BORDER","ACCENT","ACCENT_FOREGROUND","NEUTRAL","DIMMED","FADED_OPACITY","dashed","color","MARKER_CLASSES","FocusedMarker","status","opacity","jsxs","jsx","CheckmarkIcon","focusedMarkerColor","isCurrent","rowHolding","list","row","holdsFocus","StepFocusHandOff","React","_previous","_state","snapshot","isFocusDropped","wasCurrent","current","target","element","focusSection","keyOf","step","index","StepList","steps","size","variant","dividers","completeLabel","ariaLabel","ariaLabelledBy","className","sizing","listRef","useRef","currentRef","focused","fadesOthers","lineColor","solidLine","showsCompleteLabel","isRenderableNode","completeMark","Text","hasActions","Fragment","locked","statusLabel","fade"],"mappings":";;;;;;AAkDA,MAAMA,IAAc,IACdC,IAAgB,GAEhBC,IAQF;AAAA,EACA,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,MAAM,OAAO,UAAU,aAAa,SAAS,aAAa,GAAA;AAAA,EACzF,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,GAAA,GAAM,OAAO,SAAS,aAAa,UAAU,aAAa,EAAA;AAC5F,GAGMC,IAA4D;AAAA,EAC9D,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AACZ,GAGMC,IAAiB,CACnBC,GACAC,OACuB;AAAA,EACvB,kBAAkBD,EAAQ,IAAIL,IAAc,IAAI;AAAA,EAChD,KAAKK,EAAQ,IAAIL;AAAA,EACjB,QAAQ,eAAeA,KAAeM,IAAUL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AAA,0BACG,MAAMX,EAAO;AAAA,0BACb,OAAOc,IAAS,WAAW;AAAA,0BAE1B,UAAAzB,EAAK;AAAA,wBAAA;AAAA,sBAAA;AAAA,sBAGbjB,KAAaqC,EAAiBpB,EAAK,QAAQ,KACxC,gBAAApB;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACG,WAAU;AAAA,0BACV,OAAO,EAAE,WAAW+B,EAAO,YAAA;AAAA,0BAE1B,UAAAX,EAAK;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACV;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGPuB,KACG,gBAAA3C;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACG,WAAU;AAAA,oBACV,OAAO,EAAE,SAAS+C,EAAA;AAAA,oBAEjB,UAAAR,EAAmBnB,CAAI,IAAIqB,IAAerB,EAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACpD;AAAA,YAAA;AAAA,YA3FCD,EAAMC,GAAMC,CAAK;AAAA,UAAA;AAAA,QA+FlC,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGL,gBAAArB,EAACQ,GAAA,EAAiB,SAAAwB,GAAkB,YAAAE,EAAA,CAAwB;AAAA,EAAA,GAChE;AAER;"}
1
+ {"version":3,"file":"StepList.js","sources":["../../src/components/StepList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport CheckmarkIcon from './CustomIcons/CheckmarkIcon';\nimport Text from './Typography/Text';\nimport { focusSection, holdsFocus, isFocusDropped } from './collapseFocus';\nimport { isRenderableNode } from './renderableNode';\n\nexport type StepListStatus = 'complete' | 'open' | 'locked';\n\nexport type StepListSize = 'medium' | 'small';\n\nexport type StepListVariant = 'numbered' | 'focused';\n\nexport interface StepListItem {\n /** Keys the row; falls back to its position, so pass one when steps come and go. */\n key?: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n /**\n * `complete` fills the marker with a tick, `open` rings it in the accent, and `locked`\n * dims the marker and the text. The first `open` step is the current one.\n */\n status: StepListStatus;\n /** Right of the text, e.g. a button, in place of `completeLabel`; never faded once complete. */\n action?: React.ReactNode;\n /** Under the taller of the text and the action, across both; only while the step is current. */\n children?: React.ReactNode;\n}\n\nexport interface StepListProps {\n steps: StepListItem[];\n /** `small` is the compact list for a sidebar: tighter rows and smaller text. */\n size?: StepListSize;\n /**\n * `focused` marks each step with a ring around a square and a \"Step N\" label, in the accent\n * on the current step only, and fades every other step, any locked one, and the lines. A\n * complete step's own `action` stays at full opacity.\n */\n variant?: StepListVariant;\n /** Rules a line under each row, for a list that fills its container edge to edge. */\n dividers?: boolean;\n /**\n * Shown, with a dot, in the action column of a complete step that has no `action`, e.g.\n * \"Completed\". Hidden from assistive tech, which already hears the state after the title.\n */\n completeLabel?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** On the list. Each connector runs to the next row's marker, so add no gap between rows. */\n className?: string;\n}\n\nconst MARKER_SIZE = 24;\nconst DIVIDER_WIDTH = 1;\n\nconst SIZES: Record<\n StepListSize,\n {\n padding: { x: number; y: number };\n title: 'medium' | 'small';\n description: 'small' | 'xsmall';\n childrenGap: number;\n }\n> = {\n medium: { padding: { x: 28, y: 16 }, title: 'medium', description: 'small', childrenGap: 12 },\n small: { padding: { x: 20, y: 12 }, title: 'small', description: 'xsmall', childrenGap: 8 },\n};\n\n// Read out after the title: the marker is hidden, and the dimmed text alone says nothing.\nconst STATUS_LABELS: Record<StepListStatus, string | undefined> = {\n complete: 'Completed',\n open: undefined,\n locked: 'Locked',\n};\n\n// From a marker's foot, through the next row's top padding and any rule, to its marker.\nconst connectorStyle = (\n padding: { x: number; y: number },\n divider: boolean,\n): React.CSSProperties => ({\n insetInlineStart: padding.x + MARKER_SIZE / 2 - 1,\n top: padding.y + MARKER_SIZE,\n height: `calc(100% - ${MARKER_SIZE - (divider ? DIVIDER_WIDTH : 0)}px)`,\n});\n\nconst BORDER = 'var(--malachite-card-border, rgb(232, 232, 232))';\nconst ACCENT = 'var(--malachite-accent-background, rgb(0, 175, 102))';\n\nconst ACCENT_FOREGROUND = 'var(--malachite-accent-foreground, rgb(2, 122, 66))';\nconst NEUTRAL = 'var(--malachite-text-secondary, rgb(123, 123, 123))';\nconst DIMMED = 'var(--malachite-text-dimmed, rgb(161, 161, 161))';\nconst FADED_OPACITY = 0.4;\n\nconst dashed = (color: string) =>\n `repeating-linear-gradient(to bottom, ${color} 0px, ${color} 4px, transparent 4px, transparent 8px)`;\n\n// White on the accent fill in both themes, as Checkbox draws its tick.\nconst MARKER_CLASSES: Record<StepListStatus, string> = {\n complete: 'bg-[var(--malachite-accent-background,rgb(0,175,102))] text-white',\n open: 'border-[1.5px] border-solid border-[var(--malachite-accent-background,rgb(0,175,102))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-accent-foreground,rgb(2,122,66))]',\n locked: 'border-[1.5px] border-solid border-[var(--malachite-text-dimmed,rgb(153,153,153))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-dimmed,rgb(153,153,153))]',\n};\n\n// A locked step keeps an empty ring, so it reads apart from an open step waiting its turn.\nconst FocusedMarker: React.FC<{ status: StepListStatus; color: string; opacity?: number }> = ({\n status,\n color,\n opacity,\n}) => (\n <span\n aria-hidden=\"true\"\n className=\"relative z-[2] box-border flex items-center justify-center rounded-full border-[1.5px] border-solid bg-[var(--malachite-card-background,rgb(255,255,255))]\"\n style={{ width: MARKER_SIZE, height: MARKER_SIZE, borderColor: color, color, opacity }}\n >\n {status === 'complete' && <CheckmarkIcon size={12} />}\n {status === 'open' && (\n <span className=\"size-[10px] rounded-[3px]\" style={{ background: color }} />\n )}\n </span>\n);\n\nconst focusedMarkerColor = (status: StepListStatus, isCurrent: boolean): string => {\n if (isCurrent) {\n return ACCENT;\n }\n return status === 'locked' ? DIMMED : NEUTRAL;\n};\n\ninterface StepFocusHandOffProps {\n listRef: React.RefObject<HTMLOListElement | null>;\n currentRef: React.RefObject<HTMLLIElement | null>;\n}\n\ninterface RowSnapshot {\n row: HTMLElement;\n wasCurrent: boolean;\n}\n\nconst rowHolding = (list: HTMLOListElement): HTMLElement | undefined =>\n Array.from(list.children).find(\n (row): row is HTMLElement =>\n row instanceof HTMLElement && holdsFocus(row, list.getRootNode()),\n );\n\n/** A class for `getSnapshotBeforeUpdate`, which sees focus before the update drops it. */\nclass StepFocusHandOff extends React.Component<StepFocusHandOffProps> {\n getSnapshotBeforeUpdate(): RowSnapshot | null {\n const list = this.props.listRef.current;\n const row = list ? rowHolding(list) : undefined;\n return row ? { row, wasCurrent: row === this.props.currentRef.current } : null;\n }\n\n componentDidUpdate(\n _previous: StepFocusHandOffProps,\n _state: unknown,\n snapshot: RowSnapshot | null,\n ): void {\n if (!snapshot || !isFocusDropped(snapshot.row.ownerDocument)) {\n return;\n }\n const { row, wasCurrent } = snapshot;\n const current = this.props.currentRef.current;\n // Leaving the current step moves on to the next; any other row keeps the reader in it.\n const nearest = wasCurrent ? [current, row] : [row, current];\n const target = [...nearest, this.props.listRef.current].find(\n (element) => element?.isConnected,\n );\n focusSection(null, target ?? null, { preventScroll: false });\n }\n\n render(): null {\n return null;\n }\n}\n\n// The position, not the title: two steps may share one. `#` keeps it off consumers' keys.\nconst keyOf = (step: StepListItem, index: number): string => step.key ?? `#${index}`;\n\n/**\n * A numbered, vertical list of setup steps: a marker per step joined by a line that turns\n * solid once a step is done, the step's title and description, and an optional action.\n */\nconst StepList: React.FC<StepListProps> = ({\n steps,\n size = 'medium',\n variant = 'numbered',\n dividers = false,\n completeLabel,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}) => {\n const sizing = SIZES[size];\n const listRef = useRef<HTMLOListElement>(null);\n const currentRef = useRef<HTMLLIElement>(null);\n const current = steps.findIndex((step) => step.status === 'open');\n const focused = variant === 'focused';\n const fadesOthers = focused && current !== -1;\n const lineColor = focused ? NEUTRAL : BORDER;\n const solidLine = focused ? NEUTRAL : ACCENT;\n const showsCompleteLabel = (step: StepListItem) =>\n Boolean(completeLabel) && step.status === 'complete' && !isRenderableNode(step.action);\n const completeMark = (\n <span aria-hidden=\"true\" className=\"flex items-center gap-[6px]\">\n {/* Success, as its text: the label reports a status, not a choice. */}\n <span className=\"size-[8px] shrink-0 rounded-full bg-[var(--malachite-text-success,rgb(2,122,66))]\" />\n <Text size=\"small\" fontWeight=\"semi-bold\" color=\"success\">\n {completeLabel}\n </Text>\n </span>\n );\n // Every row keeps the column once any step has an action or a complete label, so the text\n // wraps alike while each action fits its 120px; each row sizes its own column past that.\n // A complete step's own action stays live; its completeLabel fades with the row.\n const actionFade = (step: StepListItem, fade: number | undefined) =>\n step.status === 'complete' && !showsCompleteLabel(step) ? undefined : fade;\n const hasActions = steps.some(\n (step) => isRenderableNode(step.action) || showsCompleteLabel(step),\n );\n const columns = `${MARKER_SIZE}px minmax(0, 1fr)${hasActions ? ' auto' : ''}`;\n\n return (\n <>\n {/* `role=\"list\"`: Safari drops the list role from a list styled `list-none`. */}\n <ol\n ref={listRef}\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`isolate m-0 list-none p-0 ${className}`}\n >\n {steps.map((step, index) => {\n const isCurrent = index === current;\n const locked = !focused && step.status === 'locked';\n const statusLabel = STATUS_LABELS[step.status];\n const faded =\n focused && ((fadesOthers && !isCurrent) || step.status === 'locked');\n const fade = faded ? FADED_OPACITY : undefined;\n return (\n <li\n key={keyOf(step, index)}\n ref={isCurrent ? currentRef : undefined}\n aria-current={isCurrent ? 'step' : undefined}\n style={{\n padding: `${sizing.padding.y}px ${sizing.padding.x}px`,\n borderBottom: dividers\n ? `${DIVIDER_WIDTH}px solid ${BORDER}`\n : undefined,\n gridTemplateColumns: columns,\n rowGap: sizing.childrenGap,\n }}\n className=\"relative grid items-start gap-x-[12px]\"\n >\n {index < steps.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute z-[1] w-[2px]\"\n style={{\n ...connectorStyle(sizing.padding, dividers),\n background:\n step.status === 'complete'\n ? solidLine\n : dashed(lineColor),\n opacity: fadesOthers ? FADED_OPACITY : undefined,\n }}\n />\n )}\n {focused ? (\n <FocusedMarker\n status={step.status}\n color={focusedMarkerColor(step.status, isCurrent)}\n opacity={fade}\n />\n ) : (\n <span\n aria-hidden=\"true\"\n className={`relative z-[2] box-border flex items-center justify-center rounded-full text-[length:var(--malachite-font-size-xsmall,11px)] [font-weight:600] ${MARKER_CLASSES[step.status]}`}\n style={{ width: MARKER_SIZE, height: MARKER_SIZE }}\n >\n {step.status === 'complete' ? (\n <CheckmarkIcon size={12} />\n ) : (\n index + 1\n )}\n </span>\n )}\n <div\n className=\"flex min-w-0 flex-col gap-[2px] pt-[2px]\"\n style={{ opacity: fade }}\n >\n {focused && (\n <div\n aria-hidden=\"true\"\n style={{ color: isCurrent ? ACCENT_FOREGROUND : NEUTRAL }}\n >\n <Text size=\"xsmall\" fontWeight=\"semi-bold\" color=\"inherit\">\n Step {index + 1}\n </Text>\n </div>\n )}\n <Text\n size={sizing.title}\n fontWeight=\"semi-bold\"\n color={locked ? 'dimmed' : 'primary'}\n >\n {step.title}\n {statusLabel && (\n <span className=\"sr-only\">, {statusLabel}</span>\n )}\n </Text>\n {isRenderableNode(step.description) && (\n <Text\n size={sizing.description}\n color={locked ? 'dimmed' : 'secondary'}\n >\n {step.description}\n </Text>\n )}\n </div>\n {hasActions && (\n <span\n className=\"ml-[16px] flex min-w-[120px] items-center justify-end\"\n style={{\n opacity: actionFade(step, fade),\n }}\n >\n {showsCompleteLabel(step) ? completeMark : step.action}\n </span>\n )}\n {isCurrent && isRenderableNode(step.children) && (\n <div className=\"min-w-0\" style={{ gridColumn: '2 / -1' }}>\n {step.children}\n </div>\n )}\n </li>\n );\n })}\n </ol>\n {/* After the list, so the hand-off reads the rows this commit rendered. */}\n <StepFocusHandOff listRef={listRef} currentRef={currentRef} />\n </>\n );\n};\n\nexport default StepList;\nexport { StepList };\n"],"names":["MARKER_SIZE","DIVIDER_WIDTH","SIZES","STATUS_LABELS","connectorStyle","padding","divider","BORDER","ACCENT","ACCENT_FOREGROUND","NEUTRAL","DIMMED","FADED_OPACITY","dashed","color","MARKER_CLASSES","FocusedMarker","status","opacity","jsxs","jsx","CheckmarkIcon","focusedMarkerColor","isCurrent","rowHolding","list","row","holdsFocus","StepFocusHandOff","React","_previous","_state","snapshot","isFocusDropped","wasCurrent","current","target","element","focusSection","keyOf","step","index","StepList","steps","size","variant","dividers","completeLabel","ariaLabel","ariaLabelledBy","className","sizing","listRef","useRef","currentRef","focused","fadesOthers","lineColor","solidLine","showsCompleteLabel","isRenderableNode","completeMark","Text","actionFade","fade","hasActions","columns","Fragment","locked","statusLabel"],"mappings":";;;;;;AAmDA,MAAMA,IAAc,IACdC,IAAgB,GAEhBC,IAQF;AAAA,EACA,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,MAAM,OAAO,UAAU,aAAa,SAAS,aAAa,GAAA;AAAA,EACzF,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,GAAA,GAAM,OAAO,SAAS,aAAa,UAAU,aAAa,EAAA;AAC5F,GAGMC,IAA4D;AAAA,EAC9D,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AACZ,GAGMC,IAAiB,CACnBC,GACAC,OACuB;AAAA,EACvB,kBAAkBD,EAAQ,IAAIL,IAAc,IAAI;AAAA,EAChD,KAAKK,EAAQ,IAAIL;AAAA,EACjB,QAAQ,eAAeA,KAAeM,IAAUL,IAAgB,EAAE;AACtE,IAEMM,IAAS,oDACTC,IAAS,wDAETC,IAAoB,uDACpBC,IAAU,uDACVC,IAAS,oDACTC,IAAgB,KAEhBC,IAAS,CAACC,MACZ,wCAAwCA,CAAK,SAASA,CAAK,2CAGzDC,IAAiD;AAAA,EACnD,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AACZ,GAGMC,IAAuF,CAAC;AAAA,EAC1F,QAAAC;AAAA,EACA,OAAAH;AAAA,EACA,SAAAI;AACJ,MACI,gBAAA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AA,kBAAA;AAAA,gBAAA;AAAA,gBAGPyB,KACG,gBAAA7C;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACG,WAAU;AAAA,oBACV,OAAO;AAAA,sBACH,SAAS2C,EAAWvB,GAAMwB,CAAI;AAAA,oBAAA;AAAA,oBAGjC,UAAAL,EAAmBnB,CAAI,IAAIqB,IAAerB,EAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGvDjB,KAAaqC,EAAiBpB,EAAK,QAAQ,KACxC,gBAAApB,EAAC,OAAA,EAAI,WAAU,WAAU,OAAO,EAAE,YAAY,SAAA,GACzC,YAAK,SAAA,CACV;AAAA,cAAA;AAAA,YAAA;AAAA,YA5FCmB,GAAMC,GAAMC,CAAK;AAAA,UAAA;AAAA,QAgGlC,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAGL,gBAAArB,EAACQ,IAAA,EAAiB,SAAAwB,GAAkB,YAAAE,EAAA,CAAwB;AAAA,EAAA,GAChE;AAER;"}
package/dist/index.d.ts CHANGED
@@ -4718,7 +4718,7 @@ export declare const PageActions: default_2.FC<{
4718
4718
  }>;
4719
4719
 
4720
4720
  export declare interface PageColumnProps {
4721
- /** `narrow` fits a single-column form. */
4721
+ /** `narrow` fits a single-column form; `medium` wider content, such as a checklist. */
4722
4722
  width: PageContentWidth;
4723
4723
  gap?: PageContentGap;
4724
4724
  /**
@@ -4740,7 +4740,7 @@ export declare interface PageColumnsProps {
4740
4740
 
4741
4741
  export declare type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';
4742
4742
 
4743
- export declare type PageContentWidth = 'narrow';
4743
+ export declare type PageContentWidth = 'narrow' | 'medium';
4744
4744
 
4745
4745
  export declare const PageLayout: {
4746
4746
  Regular: FC<RegularLayoutProps>;
@@ -5204,7 +5204,7 @@ export declare interface RegularLayoutProps {
5204
5204
  centered?: boolean;
5205
5205
  noPadding?: boolean;
5206
5206
  contentGap?: PageContentGap;
5207
- /** Caps the content column and centres it; `narrow` fits a single-column form. */
5207
+ /** Caps the content column and centres it: `narrow` fits a form, `medium` a checklist. */
5208
5208
  contentWidth?: PageContentWidth;
5209
5209
  alert?: {
5210
5210
  message: string;
@@ -6101,9 +6101,9 @@ export declare interface StepListItem {
6101
6101
  * dims the marker and the text. The first `open` step is the current one.
6102
6102
  */
6103
6103
  status: StepListStatus;
6104
- /** Right of the text, e.g. the step's button. See `completeLabel` for a complete step. */
6104
+ /** Right of the text, e.g. a button, in place of `completeLabel`; never faded once complete. */
6105
6105
  action?: default_2.ReactNode;
6106
- /** Under the description, shown only while this is the current step. */
6106
+ /** Under the taller of the text and the action, across both; only while the step is current. */
6107
6107
  children?: default_2.ReactNode;
6108
6108
  }
6109
6109
 
@@ -6113,7 +6113,8 @@ export declare interface StepListProps {
6113
6113
  size?: StepListSize;
6114
6114
  /**
6115
6115
  * `focused` marks each step with a ring around a square and a "Step N" label, in the accent
6116
- * on the current step only, and fades every other step, any locked one, and the lines.
6116
+ * on the current step only, and fades every other step, any locked one, and the lines. A
6117
+ * complete step's own `action` stays at full opacity.
6117
6118
  */
6118
6119
  variant?: StepListVariant;
6119
6120
  /** Rules a line under each row, for a list that fills its container edge to edge. */