@pega/cosmos-react-core 5.0.0-dev.9.3 → 6.0.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.
- package/SECURITY.md +11 -0
- package/lib/components/AppShell/AppShell.js +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +3 -3
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts.map +1 -1
- package/lib/components/AppShell/Operator.js +5 -2
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +10 -10
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +2 -0
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +5 -3
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +22 -15
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts +2 -0
- package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -0
- package/lib/components/Banner/Banner.test-ids.js +10 -0
- package/lib/components/Banner/Banner.test-ids.js.map +1 -0
- package/lib/components/Button/Button.js +1 -1
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +3 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +20 -12
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/index.d.ts +1 -0
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +1 -0
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/Configuration/withConfiguration.d.ts +8 -0
- package/lib/components/Configuration/withConfiguration.d.ts.map +1 -0
- package/lib/components/Configuration/withConfiguration.js +9 -0
- package/lib/components/Configuration/withConfiguration.js.map +1 -0
- package/lib/components/DateTime/DateTime.types.d.ts +1 -4
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts +7 -3
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +2 -2
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +3 -5
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +2 -17
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +2 -4
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +33 -84
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +2 -1
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +17 -36
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +2 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +5 -0
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +14 -6
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +1 -1
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +5 -0
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +13 -24
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +2 -4
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +25 -64
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +3 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +19 -16
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +3 -3
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +2 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js +37 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +3 -3
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +13 -2
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +7 -13
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/FormDialog.js +1 -1
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +1 -1
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +5 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +1 -0
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +1 -1
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/HTML/HTML.js +1 -1
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +66 -19
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +3 -3
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.js +29 -16
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.js +3 -1
- package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +19 -8
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +61 -51
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +4 -0
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +41 -8
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +2 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +8 -4
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +3 -3
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +4 -4
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts +2 -0
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.js +26 -2
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts +0 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.js +26 -29
- package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +27 -11
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/NoValue/NoValue.d.ts.map +1 -1
- package/lib/components/NoValue/NoValue.js +6 -1
- package/lib/components/NoValue/NoValue.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +9 -0
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +3 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +15 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.js +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +16 -8
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/TextArea.styles.d.ts +1 -0
- package/lib/components/TextArea/TextArea.styles.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.styles.js +32 -4
- package/lib/components/TextArea/TextArea.styles.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +1 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/hooks/useArrows.d.ts +2 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +47 -22
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useFocusTrap.d.ts.map +1 -1
- package/lib/hooks/useFocusTrap.js +30 -3
- package/lib/hooks/useFocusTrap.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +17 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +17 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +21 -2
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +17 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +11 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/utils/focusHeadingOrContainer.d.ts +1 -1
- package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -1
- package/lib/utils/focusHeadingOrContainer.js +1 -1
- package/lib/utils/focusHeadingOrContainer.js.map +1 -1
- package/lib/utils/getFocusables.d.ts +7 -3
- package/lib/utils/getFocusables.d.ts.map +1 -1
- package/lib/utils/getFocusables.js +31 -9
- package/lib/utils/getFocusables.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState, forwardRef } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, forwardRef, useCallback } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { cap, withTestIds } from '../../utils';
|
|
5
5
|
import Flex from '../Flex';
|
|
6
6
|
import MetaList from '../MetaList';
|
|
7
7
|
import Icon from '../Icon';
|
|
8
|
+
import Image from '../Image';
|
|
8
9
|
import Text from '../Text';
|
|
9
10
|
import { useConfiguration, useConsolidatedRef, useDirection, useEvent, useFocusTrap, useI18n, useScrollToggle, useTestIds } from '../../hooks';
|
|
10
11
|
import ErrorState from '../ErrorState';
|
|
11
12
|
import Progress from '../Progress';
|
|
12
|
-
import
|
|
13
|
+
import FileVisual from '../File/FileVisual';
|
|
14
|
+
import Button from '../Button';
|
|
15
|
+
import Link from '../Link/Link';
|
|
16
|
+
import mimeTypes from '../File/mimeTypes.json';
|
|
17
|
+
import { getKindFromMimeType } from '../File/utils';
|
|
18
|
+
import { StyledHeader, StyledCountTracker, StyledInfo, StyledPreviewRegion, StyledNavButton, StyledMediaContainer, StyledLiveRegion, StyledLightbox, StyledContainer, StyledObject } from './Lightbox.styles';
|
|
13
19
|
import { getLightboxTestIds } from './Lightbox.test-ids';
|
|
14
|
-
const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0, cycle, onItemLoad, onItemError, onNavigate, onItemDownload, onAfterClose, ...restProps }, refArg) {
|
|
20
|
+
const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0, cycle = false, onItemLoad, onItemError, onNavigate, onItemDownload, onAfterClose, ...restProps }, refArg) {
|
|
15
21
|
const t = useI18n();
|
|
16
22
|
const { start, end } = useDirection();
|
|
17
23
|
const { portalTarget } = useConfiguration();
|
|
@@ -24,8 +30,7 @@ const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0,
|
|
|
24
30
|
const prevButtonRef = useRef(null);
|
|
25
31
|
const nextButtonRef = useRef(null);
|
|
26
32
|
const [open, setOpen] = useState(true);
|
|
27
|
-
const
|
|
28
|
-
const [error, setError] = useState(false);
|
|
33
|
+
const mediaRef = useConsolidatedRef(currentItem.ref);
|
|
29
34
|
const [liveText, setLiveText] = useState('');
|
|
30
35
|
const countTrackerText = items.length > 1 ? t('x_of_y', [currentIndex + 1, items.length]) : '';
|
|
31
36
|
const testIds = useTestIds(testId, getLightboxTestIds);
|
|
@@ -36,20 +41,16 @@ const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0,
|
|
|
36
41
|
if (direction === 1) {
|
|
37
42
|
if (currentIndex < items.length - 1) {
|
|
38
43
|
setCurrentIndex(cur => cur + 1);
|
|
39
|
-
setError(false);
|
|
40
44
|
}
|
|
41
45
|
else if (cycle) {
|
|
42
46
|
setCurrentIndex(0);
|
|
43
|
-
setError(false);
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
else if (currentIndex > 0) {
|
|
47
50
|
setCurrentIndex(cur => cur - 1);
|
|
48
|
-
setError(false);
|
|
49
51
|
}
|
|
50
52
|
else if (cycle) {
|
|
51
53
|
setCurrentIndex(items.length - 1);
|
|
52
|
-
setError(false);
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
const keyDownHandler = (e) => {
|
|
@@ -76,6 +77,58 @@ const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0,
|
|
|
76
77
|
useEffect(() => {
|
|
77
78
|
lightboxRef.current?.focus();
|
|
78
79
|
}, []);
|
|
80
|
+
const handleLoad = useCallback((e) => {
|
|
81
|
+
onItemLoad?.(currentItem.id, e);
|
|
82
|
+
}, [onItemLoad, currentItem.id]);
|
|
83
|
+
const handleError = useCallback((e) => {
|
|
84
|
+
onItemError?.(currentItem.id, e);
|
|
85
|
+
}, [onItemError, currentItem.id]);
|
|
86
|
+
// Object elements appear to need native event handlers bound as JSX does not work.
|
|
87
|
+
// TODO: Follow up on reason why.
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (!mediaRef.current || currentItem.format !== 'pdf')
|
|
90
|
+
return;
|
|
91
|
+
const pdfObject = mediaRef.current;
|
|
92
|
+
pdfObject.addEventListener('load', handleLoad);
|
|
93
|
+
pdfObject.addEventListener('error', handleError);
|
|
94
|
+
return () => {
|
|
95
|
+
pdfObject.removeEventListener('load', handleLoad);
|
|
96
|
+
pdfObject.removeEventListener('error', handleError);
|
|
97
|
+
};
|
|
98
|
+
}, [currentItem]);
|
|
99
|
+
let media;
|
|
100
|
+
let validContent;
|
|
101
|
+
let attachmentType = 'generic';
|
|
102
|
+
if (currentItem.format === undefined || currentItem.error) {
|
|
103
|
+
validContent = false;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const extractMimeType = mimeTypes[currentItem.format.toLowerCase()];
|
|
107
|
+
const getType = currentItem.format === 'url' ? 'link' : 'generic';
|
|
108
|
+
attachmentType = extractMimeType ? getKindFromMimeType(extractMimeType) : getType;
|
|
109
|
+
const previewableAttachmentTypes = ['pdf', 'image', 'link'];
|
|
110
|
+
validContent = previewableAttachmentTypes.includes(attachmentType)
|
|
111
|
+
? currentItem.src
|
|
112
|
+
: attachmentType;
|
|
113
|
+
}
|
|
114
|
+
if (validContent) {
|
|
115
|
+
const nonPreviewableContent = (_jsxs(_Fragment, { children: [_jsx(Text, { children: t('non_previewable', [currentItem.format ? currentItem.format.toUpperCase() : '']) }), onItemDownload && (_jsx(Button, { "aria-label": t('download'), onClick: () => onItemDownload(currentItem.id), "data-testid": testIds.nonPreviewableDownload, children: t('download') }))] }));
|
|
116
|
+
const defaultContent = (_jsxs(Flex, { container: { direction: 'column', gap: 2, alignItems: 'center' }, as: StyledInfo, "data-testid": testIds.content, children: [_jsx(FileVisual, { type: attachmentType, size: 'l' }), attachmentType === 'link' && currentItem.src ? (_jsx(Link, { href: currentItem.src, "data-testid": testIds.link, children: currentItem.name })) : (nonPreviewableContent)] }));
|
|
117
|
+
switch (attachmentType) {
|
|
118
|
+
case 'image':
|
|
119
|
+
media = currentItem.src && (_jsx(Image, { "data-testid": testIds.content, src: currentItem.src, alt: currentItem.description, onLoad: handleLoad, onError: handleError, ref: mediaRef }));
|
|
120
|
+
break;
|
|
121
|
+
case 'pdf':
|
|
122
|
+
media = currentItem.src && (_jsx(_Fragment, { children: navigator.pdfViewerEnabled ? (_jsx(StyledObject, { "data-testid": testIds.content, data: currentItem.src, type: 'application/pdf', ref: mediaRef, children: currentItem.description })) : ({ defaultContent }) }));
|
|
123
|
+
break;
|
|
124
|
+
default: {
|
|
125
|
+
media = defaultContent;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
media = _jsx(Progress, { placement: 'block', delay: true });
|
|
131
|
+
}
|
|
79
132
|
const content = (_jsxs(StyledLightbox, { "data-testid": testIds.root, ...restProps, tabIndex: -1, ref: lightboxRef, open: open, role: 'dialog', "aria-modal": 'true', container: { alignItems: 'start', justify: 'start', direction: 'column' }, alpha: 0.9, variant: 'dark', transitionSpeed: 'slow', onBeforeTransitionIn: disableScroll, onAfterTransitionOut: () => {
|
|
80
133
|
enableScroll();
|
|
81
134
|
onAfterClose?.();
|
|
@@ -94,20 +147,14 @@ const Lightbox = forwardRef(function Lightbox({ testId, items, defaultIndex = 0,
|
|
|
94
147
|
justify: 'center',
|
|
95
148
|
colGap: 2,
|
|
96
149
|
rowGap: 0.5
|
|
97
|
-
}, children: [_jsx(Text, { "data-testid": testIds.name, variant: 'primary', as: 'h2', children: currentItem.name }), currentItem.metadata && (_jsx(MetaList, { "data-testid": testIds.metadata, items: currentItem.metadata }))] }), _jsxs(Flex, { container: true, children: [onItemDownload && (_jsx(
|
|
150
|
+
}, children: [_jsx(Text, { "data-testid": testIds.name, variant: 'primary', as: 'h2', children: currentItem.name }), currentItem.metadata && (_jsx(MetaList, { "data-testid": testIds.metadata, items: currentItem.metadata }))] }), _jsxs(Flex, { container: true, as: StyledContainer, children: [attachmentType !== 'link' && onItemDownload && (_jsx(Button, { "data-testid": testIds.download, variant: 'simple', "aria-label": t('download'), icon: true, onClick: () => onItemDownload(currentItem.id), children: _jsx(Icon, { name: 'download' }) })), _jsx(Button, { "data-testid": testIds.close, variant: 'simple', ref: closeButtonRef, "aria-label": t('close'), icon: true, onClick: close, children: _jsx(Icon, { name: 'times' }) })] })] }), _jsxs(Flex, { container: { justify: 'between' }, as: StyledPreviewRegion, item: { grow: 1, shrink: 0 }, children: [items.length > 1 && (_jsx(StyledNavButton, { "data-testid": testIds.prev, ref: prevButtonRef, variant: 'simple', "aria-label": t('pagination_prev'), hidden: !cycle && currentIndex === 0, icon: true, onClick: () => {
|
|
98
151
|
navigate(-1);
|
|
99
|
-
}, children: _jsx("span", { children: _jsx(Icon, { name: 'caret-left' }) }) })), _jsx(Flex, { item: { grow: 1 }, as:
|
|
152
|
+
}, children: _jsx("span", { children: _jsx(Icon, { name: 'caret-left' }) }) })), _jsx(Flex, { item: { grow: 1 }, as: StyledMediaContainer, children: _jsx(Flex, { container: { alignItems: 'center', justify: 'center' }, onMouseDown: (e) => {
|
|
100
153
|
if (e.button !== 0)
|
|
101
154
|
return;
|
|
102
155
|
if (e.target === e.currentTarget)
|
|
103
156
|
close();
|
|
104
|
-
}, children:
|
|
105
|
-
(currentItem.src ? (_jsx(StyledImage, { "data-testid": testIds.content, ref: imageRef, src: currentItem.src, alt: currentItem.description, onLoad: (e) => {
|
|
106
|
-
onItemLoad?.(currentItem.id, e);
|
|
107
|
-
}, onError: (e) => {
|
|
108
|
-
onItemError?.(currentItem.id, e);
|
|
109
|
-
setError(true);
|
|
110
|
-
} })) : (_jsx(Progress, { placement: 'block', delay: true })))] }) }), items.length > 1 && (_jsx(StyledNavButton, { "data-testid": testIds.next, ref: nextButtonRef, variant: 'simple', "aria-label": t('pagination_next'), hidden: !cycle && currentIndex === items.length - 1, icon: true, onClick: () => {
|
|
157
|
+
}, children: currentItem.error ? _jsx(ErrorState, { message: t('content_load_error') }) : media }) }), items.length > 1 && (_jsx(StyledNavButton, { "data-testid": testIds.next, ref: nextButtonRef, variant: 'simple', "aria-label": t('pagination_next'), hidden: !cycle && currentIndex === items.length - 1, icon: true, onClick: () => {
|
|
111
158
|
navigate(1);
|
|
112
159
|
}, children: _jsx("span", { children: _jsx(Icon, { name: 'caret-right' }) }) }))] }), _jsx(StyledLiveRegion, { "aria-live": 'polite', "aria-label": liveText })] }));
|
|
113
160
|
return portalTarget ? createPortal(content, portalTarget) : content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,O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O,EAAC,QAAQ,gBACJ,CAAC,CAAC,iBAAiB,CAAC,EAChC,MAAM,EAAE,CAAC,KAAK,IAAI,YAAY,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EACnD,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE;4BACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACd,CAAC,YAED,yBACE,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GACtB,GACS,CACnB,IACI,EACP,KAAC,gBAAgB,iBAAW,QAAQ,gBAAa,QAAQ,GAAI,IAC9C,CAClB,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState, forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref, MouseEvent, SyntheticEvent } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ForwardProps } from '../../types';\nimport { cap, withTestIds } from '../../utils';\nimport Flex from '../Flex';\nimport MetaList from '../MetaList';\nimport Icon from '../Icon';\nimport Text from '../Text';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useEvent,\n useFocusTrap,\n useI18n,\n useScrollToggle,\n useTestIds\n} from '../../hooks';\nimport ErrorState from '../ErrorState';\nimport Progress from '../Progress';\n\nimport {\n StyledHeader,\n StyledCountTracker,\n StyledInfo,\n StyledActionButton,\n StyledPreviewRegion,\n StyledNavButton,\n StyledImageContainer,\n StyledImage,\n StyledLiveRegion,\n StyledLightbox\n} from './Lightbox.styles';\nimport type { LightboxProps } from './Lightbox.types';\nimport { getLightboxTestIds } from './Lightbox.test-ids';\n\nconst Lightbox: FunctionComponent<LightboxProps & ForwardProps> = forwardRef(function Lightbox(\n {\n testId,\n items,\n defaultIndex = 0,\n cycle,\n onItemLoad,\n onItemError,\n onNavigate,\n onItemDownload,\n onAfterClose,\n ...restProps\n }: PropsWithoutRef<LightboxProps>,\n refArg: Ref<HTMLDivElement>\n) {\n const t = useI18n();\n const { start, end } = useDirection();\n const { portalTarget } = useConfiguration();\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n const currentItem = items[currentIndex];\n const { disableScroll, enableScroll } = useScrollToggle();\n const lightboxRef = useConsolidatedRef(refArg);\n const headerRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const prevButtonRef = useRef<HTMLButtonElement>(null);\n const nextButtonRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(true);\n const imageRef = useConsolidatedRef(currentItem.ref);\n const [error, setError] = useState(false);\n const [liveText, setLiveText] = useState('');\n const countTrackerText = items.length > 1 ? t('x_of_y', [currentIndex + 1, items.length]) : '';\n const testIds = useTestIds(testId, getLightboxTestIds);\n\n const close = () => {\n setOpen(false);\n };\n\n const navigate = (direction: 1 | -1) => {\n if (direction === 1) {\n if (currentIndex < items.length - 1) {\n setCurrentIndex(cur => cur + 1);\n setError(false);\n } else if (cycle) {\n setCurrentIndex(0);\n setError(false);\n }\n } else if (currentIndex > 0) {\n setCurrentIndex(cur => cur - 1);\n setError(false);\n } else if (cycle) {\n setCurrentIndex(items.length - 1);\n setError(false);\n }\n };\n const keyDownHandler = (e: KeyboardEvent) => {\n if (e.repeat) return;\n\n if (e.key === 'Escape') {\n close();\n } else if (e.key === `Arrow${cap(end)}`) {\n navigate(1);\n } else if (e.key === `Arrow${cap(start)}`) {\n navigate(-1);\n }\n };\n\n useEvent('keydown', keyDownHandler);\n useFocusTrap(lightboxRef);\n\n useEffect(() => {\n setLiveText(\n `${currentItem.name}. ${countTrackerText ? `${countTrackerText}.` : ''} ${\n currentItem.description\n }.`\n );\n }, [currentItem.name, countTrackerText, currentItem.description]);\n\n useEffect(() => {\n onNavigate?.(currentItem.id, currentIndex);\n }, [currentIndex]);\n\n useEffect(() => {\n lightboxRef.current?.focus();\n }, []);\n\n const content = (\n <StyledLightbox\n data-testid={testIds.root}\n {...restProps}\n tabIndex={-1}\n ref={lightboxRef}\n open={open}\n role='dialog'\n aria-modal='true'\n container={{ alignItems: 'start', justify: 'start', direction: 'column' }}\n alpha={0.9}\n variant='dark'\n transitionSpeed='slow'\n onBeforeTransitionIn={disableScroll}\n onAfterTransitionOut={() => {\n enableScroll();\n onAfterClose?.();\n }}\n >\n <Flex\n as={StyledHeader}\n ref={headerRef}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 2\n }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n <StyledCountTracker data-testid={testIds.pagination} aria-hidden='true'>\n {countTrackerText}\n </StyledCountTracker>\n\n <Flex\n as={StyledInfo}\n container={{\n wrap: 'wrap',\n alignItems: 'center',\n justify: 'center',\n colGap: 2,\n rowGap: 0.5\n }}\n >\n <Text data-testid={testIds.name} variant='primary' as='h2'>\n {currentItem.name}\n </Text>\n {currentItem.metadata && (\n <MetaList data-testid={testIds.metadata} items={currentItem.metadata} />\n )}\n </Flex>\n\n <Flex container>\n {onItemDownload && (\n <StyledActionButton\n data-testid={testIds.download}\n variant='simple'\n aria-label={t('download')}\n icon\n onClick={() => onItemDownload(currentItem.id)}\n >\n <Icon name='download' />\n </StyledActionButton>\n )}\n <StyledActionButton\n data-testid={testIds.close}\n variant='simple'\n ref={closeButtonRef}\n aria-label={t('close')}\n icon\n onClick={close}\n >\n <Icon name='times' />\n </StyledActionButton>\n </Flex>\n </Flex>\n\n <Flex\n container={{ justify: 'between' }}\n as={StyledPreviewRegion}\n item={{ grow: 1, shrink: 0 }}\n >\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.prev}\n ref={prevButtonRef}\n variant='simple'\n aria-label={t('pagination_prev')}\n hidden={!cycle && currentIndex === 0}\n icon\n onClick={() => {\n navigate(-1);\n }}\n >\n <span>\n <Icon name='caret-left' />\n </span>\n </StyledNavButton>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledImageContainer}>\n <Flex\n container={{ alignItems: 'center' }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n {error && <ErrorState message={t('image_load_error')} />}\n\n {!error &&\n (currentItem.src ? (\n <StyledImage\n data-testid={testIds.content}\n ref={imageRef}\n src={currentItem.src}\n alt={currentItem.description}\n onLoad={(e: SyntheticEvent<HTMLImageElement>) => {\n onItemLoad?.(currentItem.id, e);\n }}\n onError={(e: SyntheticEvent<HTMLImageElement>) => {\n onItemError?.(currentItem.id, e);\n setError(true);\n }}\n />\n ) : (\n <Progress placement='block' delay />\n ))}\n </Flex>\n </Flex>\n\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.next}\n ref={nextButtonRef}\n variant='simple'\n aria-label={t('pagination_next')}\n hidden={!cycle && currentIndex === items.length - 1}\n icon\n onClick={() => {\n navigate(1);\n }}\n >\n <span>\n <Icon name='caret-right' />\n </span>\n </StyledNavButton>\n )}\n </Flex>\n <StyledLiveRegion aria-live='polite' aria-label={liveText} />\n </StyledLightbox>\n );\n\n return portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default withTestIds(Lightbox, getLightboxTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Lightbox.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OA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AC,CAA6B,EAAE,EAAE;gCAC7C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;oCAAE,OAAO;gCAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa;oCAAE,KAAK,EAAE,CAAC;4BAC5C,CAAC,YAEA,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAI,CAAC,CAAC,CAAC,KAAK,GACxE,GACF,EAEN,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,KAAC,eAAe,mBACD,OAAO,CAAC,IAAI,EACzB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAC,QAAQ,gBACJ,CAAC,CAAC,iBAAiB,CAAC,EAChC,MAAM,EAAE,CAAC,KAAK,IAAI,YAAY,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EACnD,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE;4BACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACd,CAAC,YAED,yBACE,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,GACtB,GACS,CACnB,IACI,EACP,KAAC,gBAAgB,iBAAW,QAAQ,gBAAa,QAAQ,GAAI,IAC9C,CAClB,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState, forwardRef, useCallback } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n MouseEvent,\n SyntheticEvent,\n RefObject\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ForwardProps } from '../../types';\nimport { cap, withTestIds } from '../../utils';\nimport Flex from '../Flex';\nimport MetaList from '../MetaList';\nimport Icon from '../Icon';\nimport Image from '../Image';\nimport Text from '../Text';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useEvent,\n useFocusTrap,\n useI18n,\n useScrollToggle,\n useTestIds\n} from '../../hooks';\nimport ErrorState from '../ErrorState';\nimport Progress from '../Progress';\nimport FileVisual from '../File/FileVisual';\nimport Button from '../Button';\nimport Link from '../Link/Link';\nimport mimeTypes from '../File/mimeTypes.json';\nimport { getKindFromMimeType } from '../File/utils';\nimport type { AttachmentType } from '../File/utils';\n\nimport {\n StyledHeader,\n StyledCountTracker,\n StyledInfo,\n StyledPreviewRegion,\n StyledNavButton,\n StyledMediaContainer,\n StyledLiveRegion,\n StyledLightbox,\n StyledContainer,\n StyledObject\n} from './Lightbox.styles';\nimport type { LightboxProps } from './Lightbox.types';\nimport { getLightboxTestIds } from './Lightbox.test-ids';\n\nconst Lightbox: FunctionComponent<LightboxProps & ForwardProps> = forwardRef(function Lightbox(\n {\n testId,\n items,\n defaultIndex = 0,\n cycle = false,\n onItemLoad,\n onItemError,\n onNavigate,\n onItemDownload,\n onAfterClose,\n ...restProps\n }: PropsWithoutRef<LightboxProps>,\n refArg: Ref<HTMLDivElement>\n) {\n const t = useI18n();\n const { start, end } = useDirection();\n const { portalTarget } = useConfiguration();\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n const currentItem = items[currentIndex];\n const { disableScroll, enableScroll } = useScrollToggle();\n const lightboxRef = useConsolidatedRef(refArg);\n const headerRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const prevButtonRef = useRef<HTMLButtonElement>(null);\n const nextButtonRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(true);\n const mediaRef = useConsolidatedRef(currentItem.ref);\n const [liveText, setLiveText] = useState('');\n const countTrackerText = items.length > 1 ? t('x_of_y', [currentIndex + 1, items.length]) : '';\n const testIds = useTestIds(testId, getLightboxTestIds);\n\n const close = () => {\n setOpen(false);\n };\n\n const navigate = (direction: 1 | -1) => {\n if (direction === 1) {\n if (currentIndex < items.length - 1) {\n setCurrentIndex(cur => cur + 1);\n } else if (cycle) {\n setCurrentIndex(0);\n }\n } else if (currentIndex > 0) {\n setCurrentIndex(cur => cur - 1);\n } else if (cycle) {\n setCurrentIndex(items.length - 1);\n }\n };\n const keyDownHandler = (e: KeyboardEvent) => {\n if (e.repeat) return;\n\n if (e.key === 'Escape') {\n close();\n } else if (e.key === `Arrow${cap(end)}`) {\n navigate(1);\n } else if (e.key === `Arrow${cap(start)}`) {\n navigate(-1);\n }\n };\n\n useEvent('keydown', keyDownHandler);\n useFocusTrap(lightboxRef);\n\n useEffect(() => {\n setLiveText(\n `${currentItem.name}. ${countTrackerText ? `${countTrackerText}.` : ''} ${\n currentItem.description\n }.`\n );\n }, [currentItem.name, countTrackerText, currentItem.description]);\n\n useEffect(() => {\n onNavigate?.(currentItem.id, currentIndex);\n }, [currentIndex]);\n\n useEffect(() => {\n lightboxRef.current?.focus();\n }, []);\n\n const handleLoad = useCallback(\n (e: SyntheticEvent<HTMLImageElement | HTMLObjectElement> | Event) => {\n onItemLoad?.(currentItem.id, e);\n },\n [onItemLoad, currentItem.id]\n );\n\n const handleError = useCallback(\n (e: SyntheticEvent<HTMLImageElement | HTMLObjectElement> | Event) => {\n onItemError?.(currentItem.id, e);\n },\n [onItemError, currentItem.id]\n );\n\n // Object elements appear to need native event handlers bound as JSX does not work.\n // TODO: Follow up on reason why.\n useEffect(() => {\n if (!mediaRef.current || currentItem.format !== 'pdf') return;\n const pdfObject = mediaRef.current;\n pdfObject.addEventListener('load', handleLoad);\n pdfObject.addEventListener('error', handleError);\n\n return () => {\n pdfObject.removeEventListener('load', handleLoad);\n pdfObject.removeEventListener('error', handleError);\n };\n }, [currentItem]);\n\n let media;\n let validContent;\n let attachmentType: AttachmentType = 'generic';\n if (currentItem.format === undefined || currentItem.error) {\n validContent = false;\n } else {\n const extractMimeType = (mimeTypes as Record<string, string>)[currentItem.format.toLowerCase()];\n const getType = currentItem.format === 'url' ? 'link' : 'generic';\n attachmentType = extractMimeType ? getKindFromMimeType(extractMimeType) : getType;\n const previewableAttachmentTypes = ['pdf', 'image', 'link'];\n validContent = previewableAttachmentTypes.includes(attachmentType)\n ? currentItem.src\n : attachmentType;\n }\n\n if (validContent) {\n const nonPreviewableContent = (\n <>\n <Text>\n {t('non_previewable', [currentItem.format ? currentItem.format.toUpperCase() : ''])}\n </Text>\n {onItemDownload && (\n <Button\n aria-label={t('download')}\n onClick={() => onItemDownload(currentItem.id)}\n data-testid={testIds.nonPreviewableDownload}\n >\n {t('download')}\n </Button>\n )}\n </>\n );\n\n const defaultContent = (\n <Flex\n container={{ direction: 'column', gap: 2, alignItems: 'center' }}\n as={StyledInfo}\n data-testid={testIds.content}\n >\n <FileVisual type={attachmentType} size='l' />\n {attachmentType === 'link' && currentItem.src ? (\n <Link href={currentItem.src} data-testid={testIds.link}>\n {currentItem.name}\n </Link>\n ) : (\n nonPreviewableContent\n )}\n </Flex>\n );\n\n switch (attachmentType) {\n case 'image':\n media = currentItem.src && (\n <Image\n data-testid={testIds.content}\n src={currentItem.src}\n alt={currentItem.description}\n onLoad={handleLoad}\n onError={handleError}\n ref={mediaRef as RefObject<HTMLImageElement>}\n />\n );\n break;\n case 'pdf':\n media = currentItem.src && (\n <>\n {navigator.pdfViewerEnabled ? (\n <StyledObject\n data-testid={testIds.content}\n data={currentItem.src}\n type='application/pdf'\n ref={mediaRef as RefObject<HTMLObjectElement>}\n >\n {currentItem.description}\n </StyledObject>\n ) : (\n { defaultContent }\n )}\n </>\n );\n break;\n default: {\n media = defaultContent;\n }\n }\n } else {\n media = <Progress placement='block' delay />;\n }\n\n const content = (\n <StyledLightbox\n data-testid={testIds.root}\n {...restProps}\n tabIndex={-1}\n ref={lightboxRef}\n open={open}\n role='dialog'\n aria-modal='true'\n container={{ alignItems: 'start', justify: 'start', direction: 'column' }}\n alpha={0.9}\n variant='dark'\n transitionSpeed='slow'\n onBeforeTransitionIn={disableScroll}\n onAfterTransitionOut={() => {\n enableScroll();\n onAfterClose?.();\n }}\n >\n <Flex\n as={StyledHeader}\n ref={headerRef}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 2\n }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n <StyledCountTracker data-testid={testIds.pagination} aria-hidden='true'>\n {countTrackerText}\n </StyledCountTracker>\n\n <Flex\n as={StyledInfo}\n container={{\n wrap: 'wrap',\n alignItems: 'center',\n justify: 'center',\n colGap: 2,\n rowGap: 0.5\n }}\n >\n <Text data-testid={testIds.name} variant='primary' as='h2'>\n {currentItem.name}\n </Text>\n {currentItem.metadata && (\n <MetaList data-testid={testIds.metadata} items={currentItem.metadata} />\n )}\n </Flex>\n\n <Flex container as={StyledContainer}>\n {attachmentType !== 'link' && onItemDownload && (\n <Button\n data-testid={testIds.download}\n variant='simple'\n aria-label={t('download')}\n icon\n onClick={() => onItemDownload(currentItem.id)}\n >\n <Icon name='download' />\n </Button>\n )}\n <Button\n data-testid={testIds.close}\n variant='simple'\n ref={closeButtonRef}\n aria-label={t('close')}\n icon\n onClick={close}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n </Flex>\n\n <Flex\n container={{ justify: 'between' }}\n as={StyledPreviewRegion}\n item={{ grow: 1, shrink: 0 }}\n >\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.prev}\n ref={prevButtonRef}\n variant='simple'\n aria-label={t('pagination_prev')}\n hidden={!cycle && currentIndex === 0}\n icon\n onClick={() => {\n navigate(-1);\n }}\n >\n <span>\n <Icon name='caret-left' />\n </span>\n </StyledNavButton>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledMediaContainer}>\n <Flex\n container={{ alignItems: 'center', justify: 'center' }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n {currentItem.error ? <ErrorState message={t('content_load_error')} /> : media}\n </Flex>\n </Flex>\n\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.next}\n ref={nextButtonRef}\n variant='simple'\n aria-label={t('pagination_next')}\n hidden={!cycle && currentIndex === items.length - 1}\n icon\n onClick={() => {\n navigate(1);\n }}\n >\n <span>\n <Icon name='caret-right' />\n </span>\n </StyledNavButton>\n )}\n </Flex>\n <StyledLiveRegion aria-live='polite' aria-label={liveText} />\n </StyledLightbox>\n );\n\n return portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default withTestIds(Lightbox, getLightboxTestIds);\n"]}
|
|
@@ -2,10 +2,10 @@ export declare const StyledHeader: import("styled-components").StyledComponent<"
|
|
|
2
2
|
export declare const StyledCountTracker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const StyledInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const StyledNavButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledMediaContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledObject: import("styled-components").StyledComponent<"object", import("styled-components").DefaultTheme, {}, never>;
|
|
7
8
|
export declare const StyledPreviewRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const StyledImage: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Image").ImageProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
9
9
|
export declare const StyledLiveRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
10
|
export declare const StyledLightbox: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../Backdrop").BackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
11
11
|
getTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Lightbox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,4GAkBvB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAY7B,CAAC;AAIH,eAAO,MAAM,UAAU,yGAUrB,CAAC;AAIH,eAAO,MAAM,eAAe,oNAgE1B,CAAC;AAIH,eAAO,MAAM,eAAe,yGAW1B,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAyB/B,CAAC;AAEH,eAAO,MAAM,YAAY,4GAKxB,CAAC;AAIF,eAAO,MAAM,mBAAmB,yGAG/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,yGAE5B,CAAC;AAEF,eAAO,MAAM,cAAc;;uDAQzB,CAAC"}
|
|
@@ -3,8 +3,6 @@ import { hideVisually, rgba } from 'polished';
|
|
|
3
3
|
import { defaultThemeProp } from '../../theme';
|
|
4
4
|
import { tryCatch } from '../../utils';
|
|
5
5
|
import { calculateFontSize } from '../../styles';
|
|
6
|
-
import Image from '../Image';
|
|
7
|
-
import Button from '../Button';
|
|
8
6
|
import BareButton from '../Button/BareButton';
|
|
9
7
|
import { StyledIcon } from '../Icon';
|
|
10
8
|
import { StyledMetaList } from '../MetaList/MetaList';
|
|
@@ -12,6 +10,7 @@ import { StyledErrorState } from '../ErrorState';
|
|
|
12
10
|
import { StyledText } from '../Text';
|
|
13
11
|
import { useDirection } from '../../hooks';
|
|
14
12
|
import Backdrop from '../Backdrop';
|
|
13
|
+
import { StyledLink } from '../Link/Link';
|
|
15
14
|
export const StyledHeader = styled.header(({ theme }) => {
|
|
16
15
|
const color = tryCatch(() => rgba(theme.base.palette.light, theme.base.transparency['transparent-2']));
|
|
17
16
|
return css `
|
|
@@ -46,6 +45,11 @@ export const StyledInfo = styled.div(({ theme }) => {
|
|
|
46
45
|
return css `
|
|
47
46
|
color: ${theme.base.palette.light};
|
|
48
47
|
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
48
|
+
|
|
49
|
+
${StyledLink} {
|
|
50
|
+
color: inherit;
|
|
51
|
+
text-decoration: underline;
|
|
52
|
+
}
|
|
49
53
|
`;
|
|
50
54
|
});
|
|
51
55
|
StyledInfo.defaultProps = defaultThemeProp;
|
|
@@ -114,18 +118,20 @@ export const StyledNavButton = styled(BareButton)(({ theme }) => {
|
|
|
114
118
|
`;
|
|
115
119
|
});
|
|
116
120
|
StyledNavButton.defaultProps = defaultThemeProp;
|
|
117
|
-
export const
|
|
121
|
+
export const StyledContainer = styled.div(({ theme }) => {
|
|
118
122
|
return css `
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
button {
|
|
124
|
+
padding: ${theme.base.spacing};
|
|
125
|
+
color: ${theme.base.palette.light};
|
|
121
126
|
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
&:focus:enabled {
|
|
128
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
129
|
+
}
|
|
124
130
|
}
|
|
125
131
|
`;
|
|
126
132
|
});
|
|
127
|
-
|
|
128
|
-
export const
|
|
133
|
+
StyledContainer.defaultProps = defaultThemeProp;
|
|
134
|
+
export const StyledMediaContainer = styled.div(({ theme }) => {
|
|
129
135
|
return css `
|
|
130
136
|
position: relative;
|
|
131
137
|
|
|
@@ -142,19 +148,26 @@ export const StyledImageContainer = styled.div(({ theme }) => {
|
|
|
142
148
|
color: ${theme.base.palette.light};
|
|
143
149
|
}
|
|
144
150
|
}
|
|
151
|
+
|
|
152
|
+
img {
|
|
153
|
+
display: block;
|
|
154
|
+
max-width: 100%;
|
|
155
|
+
max-height: 100%;
|
|
156
|
+
margin: auto;
|
|
157
|
+
}
|
|
145
158
|
`;
|
|
146
159
|
});
|
|
147
|
-
|
|
160
|
+
export const StyledObject = styled.object `
|
|
161
|
+
display: block;
|
|
162
|
+
margin: auto;
|
|
163
|
+
width: calc(100% - 5rem);
|
|
164
|
+
height: 100%;
|
|
165
|
+
`;
|
|
166
|
+
StyledMediaContainer.defaultProps = defaultThemeProp;
|
|
148
167
|
export const StyledPreviewRegion = styled.div `
|
|
149
168
|
position: relative;
|
|
150
169
|
width: 100%;
|
|
151
170
|
`;
|
|
152
|
-
export const StyledImage = styled(Image) `
|
|
153
|
-
display: block;
|
|
154
|
-
max-width: 100%;
|
|
155
|
-
max-height: 100%;
|
|
156
|
-
margin: auto;
|
|
157
|
-
`;
|
|
158
171
|
export const StyledLiveRegion = styled.div `
|
|
159
172
|
${hideVisually}
|
|
160
173
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.styles.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"Lightbox.styles.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CA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AAEF,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG5C,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IACtC,YAAY;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG;;;;;GAKrC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, rgba } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport BareButton from '../Button/BareButton';\nimport { StyledIcon } from '../Icon';\nimport { StyledMetaList } from '../MetaList/MetaList';\nimport { StyledErrorState } from '../ErrorState';\nimport { StyledText } from '../Text';\nimport { useDirection } from '../../hooks';\nimport Backdrop from '../Backdrop';\nimport { StyledLink } from '../Link/Link';\n\nexport const StyledHeader = styled.header(({ theme }) => {\n const color: string | undefined = tryCatch(() =>\n rgba(theme.base.palette.light, theme.base.transparency['transparent-2'])\n );\n\n return css`\n position: relative;\n width: 100%;\n padding: ${theme.base.spacing};\n color: ${color};\n\n ${StyledMetaList} {\n justify-content: center;\n li {\n color: ${color};\n }\n }\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCountTracker = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xs};\n text-align: center;\n min-width: calc(2 * ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n min-width: calc(2 * ${theme.base['hit-area']['finger-min']});\n }\n `;\n});\n\nStyledCountTracker.defaultProps = defaultThemeProp;\n\nexport const StyledInfo = styled.div(({ theme }) => {\n return css`\n color: ${theme.base.palette.light};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n\n ${StyledLink} {\n color: inherit;\n text-decoration: underline;\n }\n `;\n});\n\nStyledInfo.defaultProps = defaultThemeProp;\n\nexport const StyledNavButton = styled(BareButton)(({ theme }) => {\n const bg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.5));\n const hoverBg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.7));\n const { rtl } = useDirection();\n\n return css`\n position: absolute;\n z-index: 1;\n inset-block: 0;\n min-width: ${theme.base['hit-area']['mouse-min']};\n color: ${theme.base.palette['foreground-color']};\n box-shadow: none;\n border-radius: 0;\n\n @media (pointer: coarse) {\n min-width: ${theme.base['hit-area']['finger-min']};\n }\n\n &[hidden] {\n display: none;\n }\n\n & > span {\n display: inline-block;\n background-color: ${bg};\n\n ${StyledIcon} {\n color: ${theme.base.palette.light};\n width: 2rem;\n height: 3rem;\n\n ${rtl &&\n css`\n transform: rotateZ(180deg);\n `}\n }\n }\n\n &:nth-of-type(1) {\n inset-inline-start: 0;\n text-align: start;\n & > span {\n border-start-end-radius: calc(${theme.base['border-radius']} / 2);\n border-end-end-radius: calc(${theme.base['border-radius']} / 2);\n }\n }\n\n &:nth-of-type(2) {\n inset-inline-end: 0;\n text-align: end;\n & > span {\n border-start-start-radius: calc(${theme.base['border-radius']} / 2);\n border-end-start-radius: calc(${theme.base['border-radius']} / 2);\n }\n }\n\n &:hover > span {\n background-color: ${hoverBg};\n }\n\n &:focus > span {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledNavButton.defaultProps = defaultThemeProp;\n\nexport const StyledContainer = styled.div(({ theme }) => {\n return css`\n button {\n padding: ${theme.base.spacing};\n color: ${theme.base.palette.light};\n\n &:focus:enabled {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n `;\n});\n\nStyledContainer.defaultProps = defaultThemeProp;\n\nexport const StyledMediaContainer = styled.div(({ theme }) => {\n return css`\n position: relative;\n\n & > div {\n position: absolute;\n inset-block-start: 0;\n inset-block-end: calc(2 * ${theme.base.spacing});\n inset-inline: 0;\n }\n\n ${StyledErrorState} {\n margin: auto;\n & > ${StyledText} {\n color: ${theme.base.palette.light};\n }\n }\n\n img {\n display: block;\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n }\n `;\n});\n\nexport const StyledObject = styled.object`\n display: block;\n margin: auto;\n width: calc(100% - 5rem);\n height: 100%;\n`;\n\nStyledMediaContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPreviewRegion = styled.div`\n position: relative;\n width: 100%;\n`;\n\nexport const StyledLiveRegion = styled.div`\n ${hideVisually}\n`;\n\nexport const StyledLightbox = styled(Backdrop)(({ theme }) => {\n return css`\n z-index: ${theme.base['z-index'].max};\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledLightbox.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getLightboxTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["content", "name", "metadata", "download", "close", "prev", "next", "pagination"]>;
|
|
1
|
+
export declare const getLightboxTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["content", "name", "metadata", "download", "close", "prev", "next", "pagination", "non-previewable-download", "link"]>;
|
|
2
2
|
//# sourceMappingURL=Lightbox.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Lightbox.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,qMAWpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.test-ids.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,EAAE;IAC1D,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,YAAY;
|
|
1
|
+
{"version":3,"file":"Lightbox.test-ids.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,EAAE;IAC1D,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,YAAY;IACZ,0BAA0B;IAC1B,MAAM;CACE,CAAC,CAAC","sourcesContent":["import { createTestIds } from '../../utils';\n\nexport const getLightboxTestIds = createTestIds('lightbox', [\n 'content',\n 'name',\n 'metadata',\n 'download',\n 'close',\n 'prev',\n 'next',\n 'pagination',\n 'non-previewable-download',\n 'link'\n] as const);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactNode, SyntheticEvent } from 'react';
|
|
1
|
+
import type { ReactNode, Ref, SyntheticEvent } from 'react';
|
|
2
2
|
import type { NoChildrenProp, BaseProps, TestIdProp } from '../../types';
|
|
3
3
|
import type { BackdropProps } from '../Backdrop/Backdrop';
|
|
4
|
-
|
|
4
|
+
type MediaElement = HTMLImageElement | HTMLObjectElement;
|
|
5
5
|
export interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {
|
|
6
6
|
/** A list of compatible content to present in the lightbox. */
|
|
7
7
|
items: LightboxItem[];
|
|
@@ -10,12 +10,15 @@ export interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {
|
|
|
10
10
|
* @default 0
|
|
11
11
|
*/
|
|
12
12
|
defaultIndex?: number;
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Allow cycling through the items in either direction.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
cycle?: boolean;
|
|
15
18
|
/** Called when an item's file is loaded. */
|
|
16
|
-
onItemLoad?: (id: LightboxItem['id'], e: SyntheticEvent<
|
|
19
|
+
onItemLoad?: (id: LightboxItem['id'], e: SyntheticEvent<MediaElement> | Event) => void;
|
|
17
20
|
/** Called when an item's file encounters an error while loading. */
|
|
18
|
-
onItemError?: (id: LightboxItem['id'], e: SyntheticEvent<
|
|
21
|
+
onItemError?: (id: LightboxItem['id'], e: SyntheticEvent<MediaElement> | Event) => void;
|
|
19
22
|
/** Called when the user navigates between items. */
|
|
20
23
|
onNavigate?: (id: LightboxItem['id'], index: number) => void;
|
|
21
24
|
/** Called when a download action is triggered for an item's file. */
|
|
@@ -31,12 +34,20 @@ export interface LightboxItem {
|
|
|
31
34
|
/** The item's name e.g. filename. */
|
|
32
35
|
name: string;
|
|
33
36
|
/** Text to describe the item. */
|
|
34
|
-
description:
|
|
37
|
+
description: string;
|
|
35
38
|
/** URL for the item's binary file. Pass null for when src is not yet available. */
|
|
36
39
|
src: string | null;
|
|
40
|
+
/** File extension. Use 'url' for link */
|
|
41
|
+
format: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Prop for showing Error state
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
error?: boolean;
|
|
37
47
|
/** Additional info about the item. */
|
|
38
48
|
metadata?: ReactNode[];
|
|
39
49
|
/** A ref to the item's underlying element. */
|
|
40
|
-
ref?:
|
|
50
|
+
ref?: Ref<MediaElement>;
|
|
41
51
|
}
|
|
52
|
+
export {};
|
|
42
53
|
//# sourceMappingURL=Lightbox.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,KAAK,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEzD,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS,EAAE,UAAU;IAC1E,+DAA+D;IAC/D,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC;IACvF,oEAAoE;IACpE,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC;IACxF,oDAAoD;IACpD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,qEAAqE;IACrE,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAClD,sDAAsD;IACtD,YAAY,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACrD,4DAA4D;IAC5D,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,yCAAyC;IACzC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.types.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, SyntheticEvent } from 'react';\n\nimport type { NoChildrenProp, BaseProps, TestIdProp } from '../../types';\nimport type { BackdropProps } from '../Backdrop/Backdrop';\
|
|
1
|
+
{"version":3,"file":"Lightbox.types.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, Ref, SyntheticEvent } from 'react';\n\nimport type { NoChildrenProp, BaseProps, TestIdProp } from '../../types';\nimport type { BackdropProps } from '../Backdrop/Backdrop';\n\ntype MediaElement = HTMLImageElement | HTMLObjectElement;\n\nexport interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {\n /** A list of compatible content to present in the lightbox. */\n items: LightboxItem[];\n /**\n * The index of the item to present on mount.\n * @default 0\n */\n defaultIndex?: number;\n /**\n * Allow cycling through the items in either direction.\n * @default false\n */\n cycle?: boolean;\n /** Called when an item's file is loaded. */\n onItemLoad?: (id: LightboxItem['id'], e: SyntheticEvent<MediaElement> | Event) => void;\n /** Called when an item's file encounters an error while loading. */\n onItemError?: (id: LightboxItem['id'], e: SyntheticEvent<MediaElement> | Event) => void;\n /** Called when the user navigates between items. */\n onNavigate?: (id: LightboxItem['id'], index: number) => void;\n /** Called when a download action is triggered for an item's file. */\n onItemDownload?: (id: LightboxItem['id']) => void;\n /** Called after the lightbox has transitioned out. */\n onAfterClose?: BackdropProps['onAfterTransitionOut'];\n /** A ref to the underlying root element of the lightbox. */\n ref?: BackdropProps['ref'];\n}\n\nexport interface LightboxItem {\n /** A unique identifier for the item. */\n id: string;\n /** The item's name e.g. filename. */\n name: string;\n /** Text to describe the item. */\n description: string;\n /** URL for the item's binary file. Pass null for when src is not yet available. */\n src: string | null;\n /** File extension. Use 'url' for link */\n format: string | undefined;\n /**\n * Prop for showing Error state\n * @default false\n */\n error?: boolean;\n /** Additional info about the item. */\n metadata?: ReactNode[];\n /** A ref to the item's underlying element. */\n ref?: Ref<MediaElement>;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
|
|
|
2
2
|
import type { ForwardProps } from '../../types';
|
|
3
3
|
import type { ListToolbarProps } from './ListToolbar.types';
|
|
4
4
|
declare const _default: FunctionComponent<ListToolbarProps & ForwardProps> & {
|
|
5
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["view-selector", "count", "heading"]>;
|
|
5
|
+
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["view-selector", "count", "heading", "info"]>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
//# sourceMappingURL=ListToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA8C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,aAAa,CAAC;AAuCxD,OAAO,KAAK,EACV,gBAAgB,EAMjB,MAAM,qBAAqB,CAAC;;;;AA6a7B,wBAA+D"}
|