@12-apps/ui 6.45.1 → 6.45.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +1 -1
- package/dist/_internal/components/data-display/index.js +1 -1
- package/dist/_internal/components/index.js +4 -4
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.js +3 -3
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStep.parts.js +1 -1
- package/dist/_internal/components/utility/WorkflowStep/WorkflowStepRow.js +2 -2
- package/dist/_internal/components/utility/index.js +3 -3
- package/dist/{chunk-6S25ZCEW.js → chunk-KNWG77FB.js} +5 -5
- package/dist/chunk-KNWG77FB.js.map +1 -0
- package/dist/{chunk-JHW62I7Z.js → chunk-LOLR2BWW.js} +2 -2
- package/dist/{chunk-Y6RSQEOU.js → chunk-LV4WSWQZ.js} +2 -2
- package/dist/{chunk-IIXMTC65.js → chunk-SPZAEMGW.js} +8 -2
- package/dist/chunk-SPZAEMGW.js.map +1 -0
- package/dist/data-display/Lightbox.js +1 -1
- package/dist/types/components/data-display/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/utility/WorkflowStep.js +3 -3
- package/package.json +1 -1
- package/src/components/data-display/Lightbox/Lightbox.tsx +7 -1
- package/src/components/utility/WorkflowStep/WorkflowStep.parts.tsx +4 -4
- package/dist/chunk-6S25ZCEW.js.map +0 -1
- package/dist/chunk-IIXMTC65.js.map +0 -1
- /package/dist/{chunk-JHW62I7Z.js.map → chunk-LOLR2BWW.js.map} +0 -0
- /package/dist/{chunk-Y6RSQEOU.js.map → chunk-LV4WSWQZ.js.map} +0 -0
|
@@ -97,7 +97,7 @@ import "../../../chunk-724ZONOL.js";
|
|
|
97
97
|
import "../../../chunk-UM35GGCS.js";
|
|
98
98
|
import {
|
|
99
99
|
Lightbox_default
|
|
100
|
-
} from "../../../chunk-
|
|
100
|
+
} from "../../../chunk-SPZAEMGW.js";
|
|
101
101
|
import "../../../chunk-UOS7DEQZ.js";
|
|
102
102
|
import "../../../chunk-HJPPNVCF.js";
|
|
103
103
|
import "../../../chunk-M6PWPEAV.js";
|
|
@@ -28,9 +28,9 @@ import "../../chunk-PVM7XTLZ.js";
|
|
|
28
28
|
import "../../chunk-IO36MEBD.js";
|
|
29
29
|
import {
|
|
30
30
|
WorkflowStep
|
|
31
|
-
} from "../../chunk-
|
|
32
|
-
import "../../chunk-
|
|
33
|
-
import "../../chunk-
|
|
31
|
+
} from "../../chunk-LOLR2BWW.js";
|
|
32
|
+
import "../../chunk-LV4WSWQZ.js";
|
|
33
|
+
import "../../chunk-KNWG77FB.js";
|
|
34
34
|
import "../../chunk-TM5QQJTF.js";
|
|
35
35
|
import {
|
|
36
36
|
Paragraph
|
|
@@ -525,7 +525,7 @@ import "../../chunk-724ZONOL.js";
|
|
|
525
525
|
import "../../chunk-UM35GGCS.js";
|
|
526
526
|
import {
|
|
527
527
|
Lightbox_default
|
|
528
|
-
} from "../../chunk-
|
|
528
|
+
} from "../../chunk-SPZAEMGW.js";
|
|
529
529
|
import "../../chunk-UOS7DEQZ.js";
|
|
530
530
|
import "../../chunk-HJPPNVCF.js";
|
|
531
531
|
import "../../chunk-M6PWPEAV.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowStep,
|
|
3
3
|
WorkflowStep_default
|
|
4
|
-
} from "../../../../chunk-
|
|
5
|
-
import "../../../../chunk-
|
|
6
|
-
import "../../../../chunk-
|
|
4
|
+
} from "../../../../chunk-LOLR2BWW.js";
|
|
5
|
+
import "../../../../chunk-LV4WSWQZ.js";
|
|
6
|
+
import "../../../../chunk-KNWG77FB.js";
|
|
7
7
|
import "../../../../chunk-TM5QQJTF.js";
|
|
8
8
|
import "../../../../chunk-FHWXRHMA.js";
|
|
9
9
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
StepContentComponent,
|
|
4
4
|
StepIndicatorComponent,
|
|
5
5
|
StepItemRow
|
|
6
|
-
} from "../../../../chunk-
|
|
6
|
+
} from "../../../../chunk-KNWG77FB.js";
|
|
7
7
|
import "../../../../chunk-TM5QQJTF.js";
|
|
8
8
|
import "../../../../chunk-FHWXRHMA.js";
|
|
9
9
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StepRow
|
|
3
|
-
} from "../../../../chunk-
|
|
4
|
-
import "../../../../chunk-
|
|
3
|
+
} from "../../../../chunk-LV4WSWQZ.js";
|
|
4
|
+
import "../../../../chunk-KNWG77FB.js";
|
|
5
5
|
import "../../../../chunk-TM5QQJTF.js";
|
|
6
6
|
import "../../../../chunk-FHWXRHMA.js";
|
|
7
7
|
import "../../../../chunk-7ZPUN7TV.js";
|
|
@@ -17,9 +17,9 @@ import "../../../chunk-PVM7XTLZ.js";
|
|
|
17
17
|
import "../../../chunk-IO36MEBD.js";
|
|
18
18
|
import {
|
|
19
19
|
WorkflowStep
|
|
20
|
-
} from "../../../chunk-
|
|
21
|
-
import "../../../chunk-
|
|
22
|
-
import "../../../chunk-
|
|
20
|
+
} from "../../../chunk-LOLR2BWW.js";
|
|
21
|
+
import "../../../chunk-LV4WSWQZ.js";
|
|
22
|
+
import "../../../chunk-KNWG77FB.js";
|
|
23
23
|
import "../../../chunk-TM5QQJTF.js";
|
|
24
24
|
import "../../../chunk-H2PTB6FD.js";
|
|
25
25
|
import {
|
|
@@ -178,18 +178,18 @@ var StepIndicatorComponent = forwardRef(({
|
|
|
178
178
|
}, ref) => {
|
|
179
179
|
const isDisabled = Boolean(disabled || step.disabled);
|
|
180
180
|
const handleClick = useCallback(() => {
|
|
181
|
-
if (interactive && !
|
|
181
|
+
if (interactive && !isDisabled && onClick) {
|
|
182
182
|
onClick(index, step);
|
|
183
183
|
}
|
|
184
|
-
}, [interactive,
|
|
184
|
+
}, [interactive, isDisabled, onClick, index, step]);
|
|
185
185
|
const handleKeyDown = useCallback((event) => {
|
|
186
|
-
if (interactive && !
|
|
186
|
+
if (interactive && !isDisabled && (event.key === "Enter" || event.key === " ")) {
|
|
187
187
|
event.preventDefault();
|
|
188
188
|
if (onClick) {
|
|
189
189
|
onClick(index, step);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
}, [interactive,
|
|
192
|
+
}, [interactive, isDisabled, onClick, index, step]);
|
|
193
193
|
const renderIndicatorContent = () => {
|
|
194
194
|
if (isError && errorIcon) {
|
|
195
195
|
return errorIcon;
|
|
@@ -283,4 +283,4 @@ export {
|
|
|
283
283
|
StepContentComponent,
|
|
284
284
|
StepItemRow
|
|
285
285
|
};
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
286
|
+
//# sourceMappingURL=chunk-KNWG77FB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.parts.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport type { CSSObject, Theme } from '@mui/material/styles/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback } from 'react';\n\nimport type { StepColors } from './WorkflowStep.helpers';\nimport { indicatorSizeFor, stepColors, stepPalette } from './WorkflowStep.helpers';\nimport type {\n StepConnectorProps,\n StepContentProps,\n StepIndicatorProps,\n WorkflowStepProps,\n} from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { rem } from '../../../tokens/relative';\n\n// `outlined` shows the surface through a coloured rim; the other three fill it and\n// differ only in what border they keep.\nconst indicatorVariantStyles = (\n theme: Theme,\n variant: WorkflowStepProps['variant'],\n { backgroundColor, borderColor, textColor }: StepColors,\n): CSSObject => {\n if (variant === 'outlined') {\n return {\n border: `${rem(theme, 2)} solid ${borderColor}`,\n backgroundColor: theme.palette.background.paper,\n };\n }\n\n const filled = { backgroundColor, color: textColor };\n\n switch (variant) {\n case 'filled':\n return filled;\n case 'minimal':\n return { ...filled, border: 'none' };\n case 'default':\n return { ...filled, border: `1px solid ${borderColor}` };\n default:\n return {};\n }\n};\n\nconst StepItem = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isLast'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n}>(({ orientation, isLast }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n flex: orientation === 'horizontal' && !isLast ? 1 : 'none',\n position: 'relative',\n minWidth: 0, // Allow content to shrink\n}));\n\nconst StepIndicator = styled(Box, {\n shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'animated', 'disabled'].includes(prop as string),\n})<{\n size: WorkflowStepProps['size'];\n variant: WorkflowStepProps['variant'];\n color: WorkflowStepProps['color'];\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n interactive: boolean;\n animated: boolean;\n disabled: boolean;\n}>(({ theme, size, variant, color, isActive, isCompleted, isError, interactive, animated, disabled }) => {\n const indicatorSize = indicatorSizeFor(size);\n const palette = stepPalette(theme, color);\n const { backgroundColor, borderColor, textColor } = stepColors(theme, palette, {\n isActive,\n isCompleted,\n isError,\n variant,\n });\n\n return {\n width: rem(theme, indicatorSize),\n height: rem(theme, indicatorSize),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: rem(theme, 12),\n fontWeight: theme.typography.fontWeightMedium,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n transition: animated\n ? theme.transitions.create(['background-color', 'border-color', 'transform'], {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n flexShrink: 0,\n\n ...indicatorVariantStyles(theme, variant, { backgroundColor, borderColor, textColor }),\n\n // Interactive states\n ...(interactive && !disabled && {\n '&:hover': {\n transform: 'scale(1.1)',\n boxShadow: theme.shadows[2],\n },\n '&:focus-visible': {\n outline: `${rem(theme, 2)} solid ${palette.main}`,\n outlineOffset: rem(theme, 2),\n },\n }),\n\n // Disabled state\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n }),\n };\n});\n\nconst StepContent = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'interactive', 'disabled'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n interactive: boolean;\n disabled: boolean;\n}>(({ theme, orientation, disabled }) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n textAlign: orientation === 'vertical' ? 'left' : 'center',\n marginTop: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n marginLeft: orientation === 'horizontal' ? theme.spacing(1) : 0,\n // Inert (FUT-2773): the content block has no click handling of its own —\n // the indicator is the step's one interactive element — so its cursor\n // never claims to be clickable, whatever `interactive` says.\n cursor: 'default',\n minWidth: 0,\n flex: 1,\n\n '& .step-title': {\n fontSize: rem(theme, 14),\n fontWeight: theme.typography.fontWeightMedium,\n color: theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n '& .step-description': {\n fontSize: rem(theme, 12),\n color: theme.palette.text.secondary,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n ...(disabled && {\n opacity: 0.5,\n }),\n}));\n\nconst StepConnector = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isCompleted', 'color', 'variant', 'animated'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isCompleted: boolean;\n color: WorkflowStepProps['color'];\n variant: WorkflowStepProps['variant'];\n animated: boolean;\n}>(({ theme, orientation, isCompleted, color, variant, animated }) => {\n const connectorColor = isCompleted ? stepPalette(theme, color).main : neutralTones(theme).track;\n\n return {\n flex: 1,\n position: 'relative',\n\n ...(orientation === 'horizontal' && {\n height: rem(theme, 2),\n backgroundColor: connectorColor,\n margin: `0 ${theme.spacing(1)}`,\n minWidth: theme.spacing(2),\n }),\n\n ...(orientation === 'vertical' && {\n width: rem(theme, 2),\n backgroundColor: connectorColor,\n minHeight: theme.spacing(3),\n marginLeft: theme.spacing(2),\n position: 'absolute',\n left: '50%',\n transform: 'translateX(-50%)',\n top: '100%',\n }),\n\n transition: animated\n ? theme.transitions.create('background-color', {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n\n ...(variant === 'minimal' && {\n opacity: 0.6,\n }),\n };\n});\n\n/**\n * Individual step indicator component\n */\nconst StepIndicatorComponent = forwardRef<HTMLDivElement, StepIndicatorProps>(({\n step,\n index,\n isActive,\n isCompleted,\n isError,\n variant,\n color,\n size,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n interactive,\n animated,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const isDisabled = Boolean(disabled || step.disabled);\n\n const handleClick = useCallback(() => {\n if (interactive && !isDisabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, isDisabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !isDisabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, isDisabled, onClick, index, step]);\n\n const renderIndicatorContent = () => {\n if (isError && errorIcon) {\n return errorIcon;\n }\n if (isCompleted && completedIcon) {\n return completedIcon;\n }\n if (showIcons && step.icon) {\n return step.icon;\n }\n if (showNumbers) {\n return index + 1;\n }\n return null;\n };\n\n return (\n <StepIndicator\n ref={ref}\n size={size}\n variant={variant}\n color={color}\n isActive={isActive}\n isCompleted={isCompleted}\n isError={isError}\n interactive={interactive}\n animated={animated}\n disabled={isDisabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={!interactive ? undefined : isDisabled ? -1 : 0}\n aria-label={`Step ${index + 1}: ${step.title}`}\n aria-current={isActive ? 'step' : undefined}\n aria-disabled={interactive && isDisabled ? true : undefined}\n data-testid={dataTestId}\n >\n {renderIndicatorContent()}\n </StepIndicator>\n );\n});\n\nStepIndicatorComponent.displayName = 'StepIndicator';\n\n/**\n * Step connector component\n */\nconst StepConnectorComponent = forwardRef<HTMLDivElement, StepConnectorProps>(({\n isCompleted,\n orientation,\n variant,\n color,\n // Defaults to the connector's own prior, unconditional behaviour (FUT-2773):\n // an external caller building a `StepConnectorProps` value that predates\n // this field keeps the transition it always had.\n animated = true,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepConnector\n ref={ref}\n orientation={orientation}\n isCompleted={isCompleted}\n color={color}\n variant={variant}\n animated={animated}\n data-testid={dataTestId}\n />\n));\n\nStepConnectorComponent.displayName = 'StepConnector';\n\n/**\n * Step content component.\n *\n * Inert on purpose (FUT-2773): the indicator is the step's one focusable\n * `role=\"button\"` element — it already carries `aria-label=\"Step N: <title>\"`\n * — so the title/description block gets no `role`, `tabIndex`, click or key\n * handling of its own. Two independently-interactive elements per step gave\n * assistive tech two tab stops for what a caller means as a single control.\n */\nconst StepContentComponent = forwardRef<HTMLDivElement, StepContentProps>(({\n step,\n orientation,\n interactive,\n disabled,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepContent\n ref={ref}\n orientation={orientation}\n interactive={interactive}\n disabled={Boolean(disabled || step.disabled)}\n data-testid={dataTestId}\n >\n <div className=\"step-title\">{step.title}</div>\n {step.description && (\n <div className=\"step-description\">{step.description}</div>\n )}\n </StepContent>\n));\n\nStepContentComponent.displayName = 'StepContent';\n\n/**\n * A plain wrapper around the styled row. Exporting the styled component itself\n * trips TS2742 — its inferred type names a pnpm-internal @mui/system path.\n */\nexport const StepItemRow: React.FC<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n children: React.ReactNode;\n}> = ({ orientation, isLast, children }) => (\n <StepItem orientation={orientation} isLast={isLast}>\n {children}\n </StepItem>\n);\n\nexport { StepConnectorComponent, StepCont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AAa;AAAA,IAEb;AAAA,0BAAC,SAAI,WAAU,cAAc,eAAK,OAAM;AAAA,MACvC,KAAK,eACJ,oBAAC,SAAI,WAAU,oBAAoB,eAAK,aAAY;AAAA;AAAA;AAExD,CACD;AAED,qBAAqB,cAAc;AAM5B,IAAM,cAIR,CAAC,EAAE,aAAa,QAAQ,SAAS,MACpC,oBAAC,YAAS,aAA0B,QACjC,UACH;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StepRow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LV4WSWQZ.js";
|
|
4
4
|
import {
|
|
5
5
|
progressValueRange,
|
|
6
6
|
progressValueText,
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
WorkflowStep,
|
|
108
108
|
WorkflowStep_default
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-LOLR2BWW.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
StepContentComponent,
|
|
4
4
|
StepIndicatorComponent,
|
|
5
5
|
StepItemRow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KNWG77FB.js";
|
|
7
7
|
|
|
8
8
|
// src/components/utility/WorkflowStep/WorkflowStepRow.tsx
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -79,4 +79,4 @@ var StepRow = ({
|
|
|
79
79
|
export {
|
|
80
80
|
StepRow
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-LV4WSWQZ.js.map
|
|
@@ -49,8 +49,14 @@ var DIALOG_STATIC_PROPS = {
|
|
|
49
49
|
// second, non-modal `role="dialog"` this component sets of its own accord
|
|
50
50
|
// — duplicating (and, as a static English literal, contradicting) the name
|
|
51
51
|
// the Paper already carries.
|
|
52
|
+
//
|
|
53
|
+
// For the same reason, `role` is deliberately NOT set here (FUT-2861):
|
|
54
|
+
// `Dialog` destructures `aria-labelledby` and `aria-modal` by name and
|
|
55
|
+
// applies them to the Paper alongside its own hard-coded `role="dialog"`,
|
|
56
|
+
// but `role` itself is not one of the props it destructures — a `role`
|
|
57
|
+
// passed here falls into `...other` and lands a second, unlabelled
|
|
58
|
+
// `role="dialog"` on the outer Modal root instead of the Paper.
|
|
52
59
|
"aria-labelledby": "lightbox-title",
|
|
53
|
-
role: "dialog",
|
|
54
60
|
"aria-modal": "true"
|
|
55
61
|
};
|
|
56
62
|
var Lightbox = React.forwardRef((componentProps, ref) => {
|
|
@@ -142,4 +148,4 @@ export {
|
|
|
142
148
|
Lightbox,
|
|
143
149
|
Lightbox_default
|
|
144
150
|
};
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
151
|
+
//# sourceMappingURL=chunk-SPZAEMGW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/Lightbox/Lightbox.tsx"],"sourcesContent":["import Dialog from '@mui/material/Dialog/index.js';\nimport Fade from '@mui/material/Fade/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { makeTestId } from './Lightbox.constants';\nimport { resolveLightboxProps } from './Lightbox.helpers';\nimport { LightboxCopyProvider } from './lightbox-copy-context';\nimport type { LightboxProps, LightboxRef } from './Lightbox.types';\nimport { LightboxCurrentMedia } from './LightboxCurrentMedia';\nimport { LightboxOverlay } from './LightboxOverlay';\nimport { LightboxStage } from './LightboxStage';\nimport { LightboxThumbnails } from './LightboxThumbnails';\nimport { useLightbox } from './useLightbox';\nimport { scrim } from '../../../tokens/ink';\nimport { rem, sxRem } from '../../../tokens/relative';\n\nconst DIALOG_STATIC_PROPS = {\n maxWidth: false,\n fullScreen: true,\n TransitionComponent: Fade,\n TransitionProps: { timeout: 300 },\n PaperProps: { sx: { background: (theme: Theme) => scrim(theme, 0.9), backdropFilter: (theme: Theme) => `blur(${rem(theme, 2)})` } },\n // `aria-labelledby` is the one accessible name for the modal itself: MUI\n // forwards it (with `aria-modal` and its own `role=\"dialog\"`) onto the\n // Paper, the element that is actually the WAI-ARIA dialog. A plain\n // `aria-label` alongside it would land on the OUTER root instead — a\n // second, non-modal `role=\"dialog\"` this component sets of its own accord\n // — duplicating (and, as a static English literal, contradicting) the name\n // the Paper already carries.\n //\n // For the same reason, `role` is deliberately NOT set here (FUT-2861):\n // `Dialog` destructures `aria-labelledby` and `aria-modal` by name and\n // applies them to the Paper alongside its own hard-coded `role=\"dialog\"`,\n // but `role` itself is not one of the props it destructures — a `role`\n // passed here falls into `...other` and lands a second, unlabelled\n // `role=\"dialog\"` on the outer Modal root instead of the Paper.\n 'aria-labelledby': 'lightbox-title',\n 'aria-modal': 'true',\n} as const;\n\nexport const Lightbox = React.forwardRef<LightboxRef, LightboxProps>((componentProps, ref) => {\n const props = resolveLightboxProps(componentProps);\n const { isOpen, items, loop, autoplay, showControls, showCaptions, thumbnails, zoomable } = props;\n const { className, style, dataTestId } = props;\n\n const testId = makeTestId(dataTestId);\n const lightbox = useLightbox(props, ref);\n const { currentIndex, currentItem, zoom } = lightbox;\n\n return (\n <LightboxCopyProvider copy={props.copy}>\n <Dialog\n open={isOpen}\n onClose={lightbox.close}\n {...DIALOG_STATIC_PROPS}\n className={className}\n style={style}\n onTouchStart={lightbox.handleTouchStart}\n onTouchEnd={lightbox.handleTouchEnd}\n data-testid={dataTestId || 'lightbox'}\n >\n {/* Visually hidden title for screen readers */}\n <Typography id=\"lightbox-title\" variant=\"h6\" sx={{ position: 'absolute', left: sxRem(-10000) }}>\n {props.copy.dialogLabel} - {currentItem?.alt || props.copy.itemPosition(currentIndex + 1, items.length)}\n </Typography>\n\n <LightboxOverlay\n testId={testId}\n itemCount={items.length}\n currentIndex={currentIndex}\n showControls={showControls}\n loop={loop}\n autoplay={autoplay}\n canZoom={lightbox.canZoom}\n isAutoPlaying={lightbox.isAutoPlaying}\n onClose={lightbox.close}\n onPrev={lightbox.prev}\n onNext={lightbox.next}\n onZoomIn={zoom.zoomIn}\n onZoomOut={zoom.zoomOut}\n onResetZoom={zoom.resetZoom}\n onToggleAutoplay={() => lightbox.setIsAutoPlaying((playing) => !playing)}\n />\n\n <LightboxStage\n items={items}\n currentItem={currentItem}\n currentIndex={currentIndex}\n isLoading={lightbox.isLoading}\n showCaptions={showCaptions}\n thumbnails={thumbnails}\n testId={testId}\n media={\n <LightboxCurrentMedia\n item={currentItem}\n index={currentIndex}\n total={items.length}\n zoomable={zoomable}\n zoom={zoom}\n testId={testId}\n onLoadingChange={lightbox.setIsLoading}\n onWheel={lightbox.handleWheel}\n />\n }\n thumbnailStrip={\n thumbnails &&\n items.length > 1 && (\n <LightboxThumbnails\n items={items}\n currentIndex={currentIndex}\n testId={testId}\n onSelect={lightbox.goToIndex}\n />\n )\n }\n />\n </Dialog>\n </LightboxCopyProvider>\n );\n});\n\nLightbox.displayName = 'Lightbox';\n\nexport default Lightbox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AAEvB,OAAO,WAAW;AA4DZ,SAIA,KAJA;AA9CN,IAAM,sBAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,iBAAiB,EAAE,SAAS,IAAI;AAAA,EAChC,YAAY,EAAE,IAAI,EAAE,YAAY,CAAC,UAAiB,MAAM,OAAO,GAAG,GAAG,gBAAgB,CAAC,UAAiB,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAelI,mBAAmB;AAAA,EACnB,cAAc;AAChB;AAEO,IAAM,WAAW,MAAM,WAAuC,CAAC,gBAAgB,QAAQ;AAC5F,QAAM,QAAQ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MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,OAAO,MAAM;AAAA,gBACb;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,iBAAiB,SAAS;AAAA,gBAC1B,SAAS,SAAS;AAAA;AAAA,YACpB;AAAA,YAEF,gBACE,cACA,MAAM,SAAS,KACb;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,UAAU,SAAS;AAAA;AAAA,YACrB;AAAA;AAAA,QAGN;AAAA;AAAA;AAAA,EACF,GACA;AAEJ,CAAC;AAED,SAAS,cAAc;AAEvB,IAAO,mBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiCnE,eAAO,MAAM,QAAQ,mFA+EnB,CAAC;AAIH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../chunk-IO36MEBD.js";
|
|
2
2
|
import {
|
|
3
3
|
WorkflowStep
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-LOLR2BWW.js";
|
|
5
|
+
import "../chunk-LV4WSWQZ.js";
|
|
6
|
+
import "../chunk-KNWG77FB.js";
|
|
7
7
|
import "../chunk-TM5QQJTF.js";
|
|
8
8
|
import "../chunk-FHWXRHMA.js";
|
|
9
9
|
import "../chunk-7ZPUN7TV.js";
|
package/package.json
CHANGED
|
@@ -29,8 +29,14 @@ const DIALOG_STATIC_PROPS = {
|
|
|
29
29
|
// second, non-modal `role="dialog"` this component sets of its own accord
|
|
30
30
|
// — duplicating (and, as a static English literal, contradicting) the name
|
|
31
31
|
// the Paper already carries.
|
|
32
|
+
//
|
|
33
|
+
// For the same reason, `role` is deliberately NOT set here (FUT-2861):
|
|
34
|
+
// `Dialog` destructures `aria-labelledby` and `aria-modal` by name and
|
|
35
|
+
// applies them to the Paper alongside its own hard-coded `role="dialog"`,
|
|
36
|
+
// but `role` itself is not one of the props it destructures — a `role`
|
|
37
|
+
// passed here falls into `...other` and lands a second, unlabelled
|
|
38
|
+
// `role="dialog"` on the outer Modal root instead of the Paper.
|
|
32
39
|
'aria-labelledby': 'lightbox-title',
|
|
33
|
-
role: 'dialog',
|
|
34
40
|
'aria-modal': 'true',
|
|
35
41
|
} as const;
|
|
36
42
|
|
|
@@ -232,19 +232,19 @@ const StepIndicatorComponent = forwardRef<HTMLDivElement, StepIndicatorProps>(({
|
|
|
232
232
|
const isDisabled = Boolean(disabled || step.disabled);
|
|
233
233
|
|
|
234
234
|
const handleClick = useCallback(() => {
|
|
235
|
-
if (interactive && !
|
|
235
|
+
if (interactive && !isDisabled && onClick) {
|
|
236
236
|
onClick(index, step);
|
|
237
237
|
}
|
|
238
|
-
}, [interactive,
|
|
238
|
+
}, [interactive, isDisabled, onClick, index, step]);
|
|
239
239
|
|
|
240
240
|
const handleKeyDown = useCallback((event: React.KeyboardEvent) => {
|
|
241
|
-
if (interactive && !
|
|
241
|
+
if (interactive && !isDisabled && (event.key === 'Enter' || event.key === ' ')) {
|
|
242
242
|
event.preventDefault();
|
|
243
243
|
if (onClick) {
|
|
244
244
|
onClick(index, step);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
}, [interactive,
|
|
247
|
+
}, [interactive, isDisabled, onClick, index, step]);
|
|
248
248
|
|
|
249
249
|
const renderIndicatorContent = () => {
|
|
250
250
|
if (isError && errorIcon) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/utility/WorkflowStep/WorkflowStep.parts.tsx"],"sourcesContent":["import Box from '@mui/material/Box/index.js';\nimport type { CSSObject, Theme } from '@mui/material/styles/index.js';\nimport { styled } from '@mui/material/styles/index.js';\nimport React, { forwardRef, useCallback } from 'react';\n\nimport type { StepColors } from './WorkflowStep.helpers';\nimport { indicatorSizeFor, stepColors, stepPalette } from './WorkflowStep.helpers';\nimport type {\n StepConnectorProps,\n StepContentProps,\n StepIndicatorProps,\n WorkflowStepProps,\n} from './WorkflowStep.types';\nimport { neutralTones } from '../../../tokens/ink';\nimport { rem } from '../../../tokens/relative';\n\n// `outlined` shows the surface through a coloured rim; the other three fill it and\n// differ only in what border they keep.\nconst indicatorVariantStyles = (\n theme: Theme,\n variant: WorkflowStepProps['variant'],\n { backgroundColor, borderColor, textColor }: StepColors,\n): CSSObject => {\n if (variant === 'outlined') {\n return {\n border: `${rem(theme, 2)} solid ${borderColor}`,\n backgroundColor: theme.palette.background.paper,\n };\n }\n\n const filled = { backgroundColor, color: textColor };\n\n switch (variant) {\n case 'filled':\n return filled;\n case 'minimal':\n return { ...filled, border: 'none' };\n case 'default':\n return { ...filled, border: `1px solid ${borderColor}` };\n default:\n return {};\n }\n};\n\nconst StepItem = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isLast'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n}>(({ orientation, isLast }) => ({\n display: 'flex',\n flexDirection: orientation === 'vertical' ? 'column' : 'row',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n flex: orientation === 'horizontal' && !isLast ? 1 : 'none',\n position: 'relative',\n minWidth: 0, // Allow content to shrink\n}));\n\nconst StepIndicator = styled(Box, {\n shouldForwardProp: (prop) => !['size', 'variant', 'color', 'isActive', 'isCompleted', 'isError', 'interactive', 'animated', 'disabled'].includes(prop as string),\n})<{\n size: WorkflowStepProps['size'];\n variant: WorkflowStepProps['variant'];\n color: WorkflowStepProps['color'];\n isActive: boolean;\n isCompleted: boolean;\n isError: boolean;\n interactive: boolean;\n animated: boolean;\n disabled: boolean;\n}>(({ theme, size, variant, color, isActive, isCompleted, isError, interactive, animated, disabled }) => {\n const indicatorSize = indicatorSizeFor(size);\n const palette = stepPalette(theme, color);\n const { backgroundColor, borderColor, textColor } = stepColors(theme, palette, {\n isActive,\n isCompleted,\n isError,\n variant,\n });\n\n return {\n width: rem(theme, indicatorSize),\n height: rem(theme, indicatorSize),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: rem(theme, 12),\n fontWeight: theme.typography.fontWeightMedium,\n cursor: interactive && !disabled ? 'pointer' : 'default',\n transition: animated\n ? theme.transitions.create(['background-color', 'border-color', 'transform'], {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n flexShrink: 0,\n\n ...indicatorVariantStyles(theme, variant, { backgroundColor, borderColor, textColor }),\n\n // Interactive states\n ...(interactive && !disabled && {\n '&:hover': {\n transform: 'scale(1.1)',\n boxShadow: theme.shadows[2],\n },\n '&:focus-visible': {\n outline: `${rem(theme, 2)} solid ${palette.main}`,\n outlineOffset: rem(theme, 2),\n },\n }),\n\n // Disabled state\n ...(disabled && {\n opacity: 0.5,\n cursor: 'not-allowed',\n }),\n };\n});\n\nconst StepContent = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'interactive', 'disabled'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n interactive: boolean;\n disabled: boolean;\n}>(({ theme, orientation, disabled }) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: orientation === 'vertical' ? 'flex-start' : 'center',\n textAlign: orientation === 'vertical' ? 'left' : 'center',\n marginTop: orientation === 'vertical' ? theme.spacing(1) : theme.spacing(0.5),\n marginLeft: orientation === 'horizontal' ? theme.spacing(1) : 0,\n // Inert (FUT-2773): the content block has no click handling of its own —\n // the indicator is the step's one interactive element — so its cursor\n // never claims to be clickable, whatever `interactive` says.\n cursor: 'default',\n minWidth: 0,\n flex: 1,\n\n '& .step-title': {\n fontSize: rem(theme, 14),\n fontWeight: theme.typography.fontWeightMedium,\n color: theme.palette.text.primary,\n marginBottom: theme.spacing(0.5),\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n '& .step-description': {\n fontSize: rem(theme, 12),\n color: theme.palette.text.secondary,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n maxWidth: '100%',\n },\n\n ...(disabled && {\n opacity: 0.5,\n }),\n}));\n\nconst StepConnector = styled(Box, {\n shouldForwardProp: (prop) => !['orientation', 'isCompleted', 'color', 'variant', 'animated'].includes(prop as string),\n})<{\n orientation: WorkflowStepProps['orientation'];\n isCompleted: boolean;\n color: WorkflowStepProps['color'];\n variant: WorkflowStepProps['variant'];\n animated: boolean;\n}>(({ theme, orientation, isCompleted, color, variant, animated }) => {\n const connectorColor = isCompleted ? stepPalette(theme, color).main : neutralTones(theme).track;\n\n return {\n flex: 1,\n position: 'relative',\n\n ...(orientation === 'horizontal' && {\n height: rem(theme, 2),\n backgroundColor: connectorColor,\n margin: `0 ${theme.spacing(1)}`,\n minWidth: theme.spacing(2),\n }),\n\n ...(orientation === 'vertical' && {\n width: rem(theme, 2),\n backgroundColor: connectorColor,\n minHeight: theme.spacing(3),\n marginLeft: theme.spacing(2),\n position: 'absolute',\n left: '50%',\n transform: 'translateX(-50%)',\n top: '100%',\n }),\n\n transition: animated\n ? theme.transitions.create('background-color', {\n duration: theme.transitions.duration.short,\n })\n : 'none',\n\n ...(variant === 'minimal' && {\n opacity: 0.6,\n }),\n };\n});\n\n/**\n * Individual step indicator component\n */\nconst StepIndicatorComponent = forwardRef<HTMLDivElement, StepIndicatorProps>(({\n step,\n index,\n isActive,\n isCompleted,\n isError,\n variant,\n color,\n size,\n showNumbers,\n showIcons,\n completedIcon,\n errorIcon,\n interactive,\n animated,\n disabled,\n onClick,\n 'data-testid': dataTestId,\n}, ref) => {\n const isDisabled = Boolean(disabled || step.disabled);\n\n const handleClick = useCallback(() => {\n if (interactive && !disabled && onClick) {\n onClick(index, step);\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const handleKeyDown = useCallback((event: React.KeyboardEvent) => {\n if (interactive && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n if (onClick) {\n onClick(index, step);\n }\n }\n }, [interactive, disabled, onClick, index, step]);\n\n const renderIndicatorContent = () => {\n if (isError && errorIcon) {\n return errorIcon;\n }\n if (isCompleted && completedIcon) {\n return completedIcon;\n }\n if (showIcons && step.icon) {\n return step.icon;\n }\n if (showNumbers) {\n return index + 1;\n }\n return null;\n };\n\n return (\n <StepIndicator\n ref={ref}\n size={size}\n variant={variant}\n color={color}\n isActive={isActive}\n isCompleted={isCompleted}\n isError={isError}\n interactive={interactive}\n animated={animated}\n disabled={isDisabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n role={interactive ? 'button' : undefined}\n tabIndex={!interactive ? undefined : isDisabled ? -1 : 0}\n aria-label={`Step ${index + 1}: ${step.title}`}\n aria-current={isActive ? 'step' : undefined}\n aria-disabled={interactive && isDisabled ? true : undefined}\n data-testid={dataTestId}\n >\n {renderIndicatorContent()}\n </StepIndicator>\n );\n});\n\nStepIndicatorComponent.displayName = 'StepIndicator';\n\n/**\n * Step connector component\n */\nconst StepConnectorComponent = forwardRef<HTMLDivElement, StepConnectorProps>(({\n isCompleted,\n orientation,\n variant,\n color,\n // Defaults to the connector's own prior, unconditional behaviour (FUT-2773):\n // an external caller building a `StepConnectorProps` value that predates\n // this field keeps the transition it always had.\n animated = true,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepConnector\n ref={ref}\n orientation={orientation}\n isCompleted={isCompleted}\n color={color}\n variant={variant}\n animated={animated}\n data-testid={dataTestId}\n />\n));\n\nStepConnectorComponent.displayName = 'StepConnector';\n\n/**\n * Step content component.\n *\n * Inert on purpose (FUT-2773): the indicator is the step's one focusable\n * `role=\"button\"` element — it already carries `aria-label=\"Step N: <title>\"`\n * — so the title/description block gets no `role`, `tabIndex`, click or key\n * handling of its own. Two independently-interactive elements per step gave\n * assistive tech two tab stops for what a caller means as a single control.\n */\nconst StepContentComponent = forwardRef<HTMLDivElement, StepContentProps>(({\n step,\n orientation,\n interactive,\n disabled,\n 'data-testid': dataTestId,\n}, ref) => (\n <StepContent\n ref={ref}\n orientation={orientation}\n interactive={interactive}\n disabled={Boolean(disabled || step.disabled)}\n data-testid={dataTestId}\n >\n <div className=\"step-title\">{step.title}</div>\n {step.description && (\n <div className=\"step-description\">{step.description}</div>\n )}\n </StepContent>\n));\n\nStepContentComponent.displayName = 'StepContent';\n\n/**\n * A plain wrapper around the styled row. Exporting the styled component itself\n * trips TS2742 — its inferred type names a pnpm-internal @mui/system path.\n */\nexport const StepItemRow: React.FC<{\n orientation: WorkflowStepProps['orientation'];\n isLast: boolean;\n children: React.ReactNode;\n}> = ({ orientation, isLast, children }) => (\n <StepItem orientation={orientation} isLast={isLast}>\n {children}\n </StepItem>\n);\n\nexport { StepConnectorComponent, StepContentComponent, StepIndicatorComponent };\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAO,SAAS;AAEhB,SAAS,cAAc;AACvB,SAAgB,YAAY,mBAAmB;AAsQ3C,cAsEF,YAtEE;AAvPJ,IAAM,yBAAyB,CAC7B,OACA,SACA,EAAE,iBAAiB,aAAa,UAAU,MAC5B;AACd,MAAI,YAAY,YAAY;AAC1B,WAAO;AAAA,MACL,QAAQ,GAAG,IAAI,OAAO,CAAC,CAAC,UAAU,WAAW;AAAA,MAC7C,iBAAiB,MAAM,QAAQ,WAAW;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,SAAS,EAAE,iBAAiB,OAAO,UAAU;AAEnD,UAAQ,SAAS;AAAA,IACf,KAAK;A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c,WAAW;AAAA,MAC/B,UAAU,CAAC,cAAc,SAAY,aAAa,KAAK;AAAA,MACvD,cAAY,QAAQ,QAAQ,CAAC,KAAK,KAAK,KAAK;AAAA,MAC5C,gBAAc,WAAW,SAAS;AAAA,MAClC,iBAAe,eAAe,aAAa,OAAO;AAAA,MAClD,eAAa;AAAA,MAEZ,iCAAuB;AAAA;AAAA,EAC1B;AAEJ,CAAC;AAED,uBAAuB,cAAc;AAKrC,IAAM,yBAAyB,WAA+C,CAAC;AAAA,EAC7E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAIA,WAAW;AAAA,EACX,eAAe;AACjB,GAAG,QACD;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAa;AAAA;AACf,CACD;AAED,uBAAuB,cAAc;AAWrC,IAAM,uBAAuB,WAA6C,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAAG,QACD;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,QAAQ,YAAY,KAAK,QAAQ;AAAA,IAC3C,eAAa;AAAA,IAEb;AAAA,0BAAC,SAAI,WAAU,cAAc,eAAK,OAAM;AAAA,MACvC,KAAK,eACJ,oBAAC,SAAI,WAAU,oBAAoB,eAAK,aAAY;AAAA;AAAA;AAExD,CACD;AAED,qBAAqB,cAAc;AAM5B,IAAM,cAIR,CAAC,EAAE,aAAa,QAAQ,SAAS,MACpC,oBAAC,YAAS,aAA0B,QACjC,UACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Lightbox/Lightbox.tsx"],"sourcesContent":["import Dialog from '@mui/material/Dialog/index.js';\nimport Fade from '@mui/material/Fade/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { makeTestId } from './Lightbox.constants';\nimport { resolveLightboxProps } from './Lightbox.helpers';\nimport { LightboxCopyProvider } from './lightbox-copy-context';\nimport type { LightboxProps, LightboxRef } from './Lightbox.types';\nimport { LightboxCurrentMedia } from './LightboxCurrentMedia';\nimport { LightboxOverlay } from './LightboxOverlay';\nimport { LightboxStage } from './LightboxStage';\nimport { LightboxThumbnails } from './LightboxThumbnails';\nimport { useLightbox } from './useLightbox';\nimport { scrim } from '../../../tokens/ink';\nimport { rem, sxRem } from '../../../tokens/relative';\n\nconst DIALOG_STATIC_PROPS = {\n maxWidth: false,\n fullScreen: true,\n TransitionComponent: Fade,\n TransitionProps: { timeout: 300 },\n PaperProps: { sx: { background: (theme: Theme) => scrim(theme, 0.9), backdropFilter: (theme: Theme) => `blur(${rem(theme, 2)})` } },\n // `aria-labelledby` is the one accessible name for the modal itself: MUI\n // forwards it (with `aria-modal` and its own `role=\"dialog\"`) onto the\n // Paper, the element that is actually the WAI-ARIA dialog. A plain\n // `aria-label` alongside it would land on the OUTER root instead — a\n // second, non-modal `role=\"dialog\"` this component sets of its own accord\n // — duplicating (and, as a static English literal, contradicting) the name\n // the Paper already carries.\n 'aria-labelledby': 'lightbox-title',\n role: 'dialog',\n 'aria-modal': 'true',\n} as const;\n\nexport const Lightbox = React.forwardRef<LightboxRef, LightboxProps>((componentProps, ref) => {\n const props = resolveLightboxProps(componentProps);\n const { isOpen, items, loop, autoplay, showControls, showCaptions, thumbnails, zoomable } = props;\n const { className, style, dataTestId } = props;\n\n const testId = makeTestId(dataTestId);\n const lightbox = useLightbox(props, ref);\n const { currentIndex, currentItem, zoom } = lightbox;\n\n return (\n <LightboxCopyProvider copy={props.copy}>\n <Dialog\n open={isOpen}\n onClose={lightbox.close}\n {...DIALOG_STATIC_PROPS}\n className={className}\n style={style}\n onTouchStart={lightbox.handleTouchStart}\n onTouchEnd={lightbox.handleTouchEnd}\n data-testid={dataTestId || 'lightbox'}\n >\n {/* Visually hidden title for screen readers */}\n <Typography id=\"lightbox-title\" variant=\"h6\" sx={{ position: 'absolute', left: sxRem(-10000) }}>\n {props.copy.dialogLabel} - {currentItem?.alt || props.copy.itemPosition(currentIndex + 1, items.length)}\n </Typography>\n\n <LightboxOverlay\n testId={testId}\n itemCount={items.length}\n currentIndex={currentIndex}\n showControls={showControls}\n loop={loop}\n autoplay={autoplay}\n canZoom={lightbox.canZoom}\n isAutoPlaying={lightbox.isAutoPlaying}\n onClose={lightbox.close}\n onPrev={lightbox.prev}\n onNext={lightbox.next}\n onZoomIn={zoom.zoomIn}\n onZoomOut={zoom.zoomOut}\n onResetZoom={zoom.resetZoom}\n onToggleAutoplay={() => lightbox.setIsAutoPlaying((playing) => !playing)}\n />\n\n <LightboxStage\n items={items}\n currentItem={currentItem}\n currentIndex={currentIndex}\n isLoading={lightbox.isLoading}\n showCaptions={showCaptions}\n thumbnails={thumbnails}\n testId={testId}\n media={\n <LightboxCurrentMedia\n item={currentItem}\n index={currentIndex}\n total={items.length}\n zoomable={zoomable}\n zoom={zoom}\n testId={testId}\n onLoadingChange={lightbox.setIsLoading}\n onWheel={lightbox.handleWheel}\n />\n }\n thumbnailStrip={\n thumbnails &&\n items.length > 1 && (\n <LightboxThumbnails\n items={items}\n currentIndex={currentIndex}\n testId={testId}\n onSelect={lightbox.goToIndex}\n />\n )\n }\n />\n </Dialog>\n </LightboxCopyProvider>\n );\n});\n\nLightbox.displayName = 'Lightbox';\n\nexport default Lightbox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AAEvB,OAAO,WAAW;AAsDZ,SAIA,KAJA;AAxCN,IAAM,sBAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,iBAAiB,EAAE,SAAS,IAAI;AAAA,EAChC,YAAY,EAAE,IAAI,EAAE,Y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