@expofp/ui 3.21.0 → 3.21.1
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/package.json +1 -1
- package/dist/Alert/Alert.d.ts +0 -20
- package/dist/Alert/Alert.js +0 -23
- package/dist/Alert/index.d.ts +0 -3
- package/dist/Alert/index.js +0 -1
- package/dist/Autocomplete/Autocomplete.d.ts +0 -21
- package/dist/Autocomplete/Autocomplete.js +0 -183
- package/dist/Autocomplete/index.d.ts +0 -3
- package/dist/Autocomplete/index.js +0 -1
- package/dist/Badge/Badge.d.ts +0 -14
- package/dist/Badge/Badge.js +0 -15
- package/dist/Badge/index.d.ts +0 -3
- package/dist/Badge/index.js +0 -1
- package/dist/Button/Button.d.ts +0 -30
- package/dist/Button/Button.js +0 -41
- package/dist/Button/index.d.ts +0 -3
- package/dist/Button/index.js +0 -1
- package/dist/Checkbox/Checkbox.d.ts +0 -19
- package/dist/Checkbox/Checkbox.js +0 -19
- package/dist/Checkbox/index.d.ts +0 -3
- package/dist/Checkbox/index.js +0 -1
- package/dist/CheckboxButton/CheckboxButton.d.ts +0 -12
- package/dist/CheckboxButton/CheckboxButton.js +0 -19
- package/dist/CheckboxButton/index.d.ts +0 -3
- package/dist/CheckboxButton/index.js +0 -1
- package/dist/DownloadList/DownloadList.d.ts +0 -15
- package/dist/DownloadList/DownloadList.js +0 -9
- package/dist/DownloadList/index.d.ts +0 -3
- package/dist/DownloadList/index.js +0 -2
- package/dist/Draggable/Draggable.d.ts +0 -9
- package/dist/Draggable/Draggable.js +0 -92
- package/dist/Draggable/index.d.ts +0 -3
- package/dist/Draggable/index.js +0 -2
- package/dist/EntityItem/EntityItem.d.ts +0 -46
- package/dist/EntityItem/EntityItem.js +0 -29
- package/dist/EntityItem/index.d.ts +0 -3
- package/dist/EntityItem/index.js +0 -1
- package/dist/EventBadge/EventBadge.d.ts +0 -13
- package/dist/EventBadge/EventBadge.js +0 -10
- package/dist/EventBadge/index.d.ts +0 -3
- package/dist/EventBadge/index.js +0 -1
- package/dist/HeatmapLegend/HeatmapLegend.d.ts +0 -15
- package/dist/HeatmapLegend/HeatmapLegend.js +0 -11
- package/dist/HeatmapLegend/index.d.ts +0 -3
- package/dist/HeatmapLegend/index.js +0 -2
- package/dist/HighlightText/HighlightText.d.ts +0 -7
- package/dist/HighlightText/HighlightText.js +0 -14
- package/dist/HighlightText/index.d.ts +0 -2
- package/dist/HighlightText/index.js +0 -1
- package/dist/LevelBadge/LevelBadge.d.ts +0 -9
- package/dist/LevelBadge/LevelBadge.js +0 -10
- package/dist/LevelBadge/index.d.ts +0 -3
- package/dist/LevelBadge/index.js +0 -2
- package/dist/LevelSelector/LevelSelector.d.ts +0 -19
- package/dist/LevelSelector/LevelSelector.js +0 -91
- package/dist/LevelSelector/index.d.ts +0 -3
- package/dist/LevelSelector/index.js +0 -2
- package/dist/MapControls/MapControls.d.ts +0 -33
- package/dist/MapControls/MapControls.js +0 -38
- package/dist/MapControls/index.d.ts +0 -3
- package/dist/MapControls/index.js +0 -2
- package/dist/MobileToggleButton/MobileToggleButton.d.ts +0 -12
- package/dist/MobileToggleButton/MobileToggleButton.js +0 -8
- package/dist/MobileToggleButton/index.d.ts +0 -3
- package/dist/MobileToggleButton/index.js +0 -1
- package/dist/Modal/Modal.d.ts +0 -34
- package/dist/Modal/Modal.js +0 -98
- package/dist/Modal/index.d.ts +0 -3
- package/dist/Modal/index.js +0 -1
- package/dist/MultiSelectGroups/MultiSelectGroups.d.ts +0 -37
- package/dist/MultiSelectGroups/MultiSelectGroups.js +0 -80
- package/dist/MultiSelectGroups/index.d.ts +0 -3
- package/dist/MultiSelectGroups/index.js +0 -1
- package/dist/OverlayGrip/OverlayGrip.d.ts +0 -11
- package/dist/OverlayGrip/OverlayGrip.js +0 -8
- package/dist/OverlayGrip/index.d.ts +0 -3
- package/dist/OverlayGrip/index.js +0 -2
- package/dist/PermissionNotice/PermissionNotice.d.ts +0 -16
- package/dist/PermissionNotice/PermissionNotice.js +0 -11
- package/dist/PermissionNotice/index.d.ts +0 -3
- package/dist/PermissionNotice/index.js +0 -2
- package/dist/Radio/Radio.d.ts +0 -15
- package/dist/Radio/Radio.js +0 -13
- package/dist/Radio/index.d.ts +0 -3
- package/dist/Radio/index.js +0 -1
- package/dist/RebookingNotes/RebookingNotes.d.ts +0 -11
- package/dist/RebookingNotes/RebookingNotes.js +0 -18
- package/dist/RebookingNotes/index.d.ts +0 -3
- package/dist/RebookingNotes/index.js +0 -1
- package/dist/RebookingRadioGroup/RebookingRadioGroup.d.ts +0 -17
- package/dist/RebookingRadioGroup/RebookingRadioGroup.js +0 -13
- package/dist/RebookingRadioGroup/index.d.ts +0 -3
- package/dist/RebookingRadioGroup/index.js +0 -1
- package/dist/ScrollableRow/ScrollableRow.d.ts +0 -21
- package/dist/ScrollableRow/ScrollableRow.js +0 -155
- package/dist/ScrollableRow/index.d.ts +0 -3
- package/dist/ScrollableRow/index.js +0 -2
- package/dist/Share/Share.d.ts +0 -22
- package/dist/Share/Share.js +0 -24
- package/dist/Share/index.d.ts +0 -3
- package/dist/Share/index.js +0 -1
- package/dist/ShowMoreButton/ShowMoreButton.d.ts +0 -11
- package/dist/ShowMoreButton/ShowMoreButton.js +0 -7
- package/dist/ShowMoreButton/index.d.ts +0 -3
- package/dist/ShowMoreButton/index.js +0 -1
- package/dist/SidebarActions/SidebarActions.d.ts +0 -26
- package/dist/SidebarActions/SidebarActions.js +0 -32
- package/dist/SidebarActions/index.d.ts +0 -3
- package/dist/SidebarActions/index.js +0 -2
- package/dist/SimpleRow/SimpleRow.d.ts +0 -15
- package/dist/SimpleRow/SimpleRow.js +0 -11
- package/dist/SimpleRow/index.d.ts +0 -3
- package/dist/SimpleRow/index.js +0 -2
- package/dist/Spinner/Spinner.d.ts +0 -9
- package/dist/Spinner/Spinner.js +0 -8
- package/dist/Spinner/index.d.ts +0 -3
- package/dist/Spinner/index.js +0 -1
- package/dist/ToggleButton/ToggleButton.d.ts +0 -17
- package/dist/ToggleButton/ToggleButton.js +0 -8
- package/dist/ToggleButton/index.d.ts +0 -3
- package/dist/ToggleButton/index.js +0 -1
- package/dist/ToggleSwitch/ToggleSwitch.d.ts +0 -12
- package/dist/ToggleSwitch/ToggleSwitch.js +0 -10
- package/dist/ToggleSwitch/index.d.ts +0 -3
- package/dist/ToggleSwitch/index.js +0 -1
- package/dist/TouchHand/TouchHand.d.ts +0 -5
- package/dist/TouchHand/TouchHand.js +0 -7
- package/dist/TouchHand/index.d.ts +0 -2
- package/dist/TouchHand/index.js +0 -1
- package/dist/WayfindingFloorSelector/WayfindingFloorSelector.d.ts +0 -24
- package/dist/WayfindingFloorSelector/WayfindingFloorSelector.js +0 -27
- package/dist/WayfindingFloorSelector/index.d.ts +0 -3
- package/dist/WayfindingFloorSelector/index.js +0 -1
- package/dist/components/Gallery/Gallery.d.ts +0 -25
- package/dist/components/Gallery/Gallery.js +0 -25
- package/dist/components/Gallery/GalleryBadges/GalleryBadges.d.ts +0 -8
- package/dist/components/Gallery/GalleryBadges/GalleryBadges.js +0 -5
- package/dist/components/Gallery/GalleryControls/GalleryControls.d.ts +0 -11
- package/dist/components/Gallery/GalleryControls/GalleryControls.js +0 -5
- package/dist/components/Gallery/GalleryImg/GalleryImg.d.ts +0 -13
- package/dist/components/Gallery/GalleryImg/GalleryImg.js +0 -37
- package/dist/components/Gallery/GalleryItem/GalleryItem.d.ts +0 -14
- package/dist/components/Gallery/GalleryItem/GalleryItem.js +0 -6
- package/dist/components/Gallery/GalleryModal/GalleryModal.d.ts +0 -18
- package/dist/components/Gallery/GalleryModal/GalleryModal.js +0 -88
- package/dist/components/Gallery/GalleryPreLoader.d.ts +0 -7
- package/dist/components/Gallery/GalleryPreLoader.js +0 -29
- package/dist/components/Gallery/TransformImg/TransformImg.d.ts +0 -10
- package/dist/components/Gallery/TransformImg/TransformImg.js +0 -15
- package/dist/components/Gallery/index.d.ts +0 -3
- package/dist/components/Gallery/index.js +0 -1
- package/dist/components/Overlay/Overlay.d.ts +0 -29
- package/dist/components/Overlay/Overlay.js +0 -251
- package/dist/components/Overlay/OverlayScrollContext.d.ts +0 -7
- package/dist/components/Overlay/OverlayScrollContext.js +0 -7
- package/dist/components/Overlay/index.d.ts +0 -4
- package/dist/components/Overlay/index.js +0 -2
- package/dist/shared/debounce.d.ts +0 -2
- package/dist/shared/debounce.js +0 -9
- package/dist/shared/hooks/useDragGesture.d.ts +0 -19
- package/dist/shared/hooks/useDragGesture.js +0 -45
- package/dist/shared/hooks/useWindowSize.d.ts +0 -5
- package/dist/shared/hooks/useWindowSize.js +0 -40
package/package.json
CHANGED
package/dist/Alert/Alert.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import './Alert.scss';
|
|
2
|
-
import React, { type ReactNode } from 'react';
|
|
3
|
-
export type AlertVariant = 'info' | 'warning' | 'error' | 'success' | 'blank';
|
|
4
|
-
export type AlertSize = 'sm' | 'md';
|
|
5
|
-
export type AlertPosition = 'top-right' | 'bottom-right';
|
|
6
|
-
export interface AlertProps {
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
position?: AlertPosition;
|
|
9
|
-
variant?: AlertVariant;
|
|
10
|
-
size?: AlertSize;
|
|
11
|
-
inline?: boolean;
|
|
12
|
-
showIcon?: boolean;
|
|
13
|
-
closable?: boolean;
|
|
14
|
-
title?: string;
|
|
15
|
-
closeLabel: string;
|
|
16
|
-
onClose?: () => void;
|
|
17
|
-
}
|
|
18
|
-
declare const Alert: ({ children, position, variant, inline, showIcon, size, closable, title, closeLabel, onClose, }: AlertProps) => React.JSX.Element;
|
|
19
|
-
export default Alert;
|
|
20
|
-
//# sourceMappingURL=Alert.d.ts.map
|
package/dist/Alert/Alert.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import './Alert.scss';
|
|
4
|
-
import cn from 'classnames';
|
|
5
|
-
const Alert = ({ children, position, variant = 'info', inline = false, showIcon = true, size = 'md', closable = false, title, closeLabel, onClose, }) => {
|
|
6
|
-
const alertIcon = () => {
|
|
7
|
-
switch (variant) {
|
|
8
|
-
case 'error':
|
|
9
|
-
return 'icon-close-solid';
|
|
10
|
-
case 'success':
|
|
11
|
-
return 'icon-checkmark-solid';
|
|
12
|
-
case 'warning':
|
|
13
|
-
return 'icon-warning-solid';
|
|
14
|
-
default:
|
|
15
|
-
return 'icon-info-solid';
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
return (_jsxs("div", { className: cn('efp-alert', `efp-alert--${variant} efp-alert--${size}`, {
|
|
19
|
-
'efp-alert--inline': inline,
|
|
20
|
-
[`efp-alert--${position}`]: position,
|
|
21
|
-
}), role: variant === 'error' || variant === 'warning' ? 'alert' : 'status', "aria-live": variant === 'error' || variant === 'warning' ? 'assertive' : 'polite', children: [showIcon && (_jsx("div", { className: "efp-alert__icon", children: _jsx("i", { className: cn(alertIcon()), "aria-hidden": "true" }) })), _jsxs("div", { className: "efp-alert__content", children: [title && _jsx("div", { className: "efp-alert__title", children: title }), children] }), closable && (_jsx("button", { type: "button", className: "efp-alert__close", onClick: onClose, "aria-label": closeLabel, title: closeLabel }))] }));
|
|
22
|
-
};
|
|
23
|
-
export default Alert;
|
package/dist/Alert/index.d.ts
DELETED
package/dist/Alert/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Alert';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import './Autocomplete.scss';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface AutocompleteOptionObject {
|
|
4
|
-
value: string;
|
|
5
|
-
label: string;
|
|
6
|
-
}
|
|
7
|
-
export interface AutocompleteProps<T extends AutocompleteOptionObject = AutocompleteOptionObject> {
|
|
8
|
-
placeholder: string;
|
|
9
|
-
options: T[];
|
|
10
|
-
value?: T;
|
|
11
|
-
showClear?: boolean;
|
|
12
|
-
onChange?: (value: T | undefined) => void;
|
|
13
|
-
renderTarget?: HTMLElement | null;
|
|
14
|
-
noOptionsLabel: string;
|
|
15
|
-
ariaLabel: string;
|
|
16
|
-
clearLabel: string;
|
|
17
|
-
getOptionKey?: (option: T) => string;
|
|
18
|
-
}
|
|
19
|
-
declare const Autocomplete: <T extends AutocompleteOptionObject = AutocompleteOptionObject>({ placeholder, options, value, showClear, onChange, renderTarget, noOptionsLabel, ariaLabel, clearLabel, getOptionKey, }: AutocompleteProps<T>) => React.JSX.Element;
|
|
20
|
-
export default Autocomplete;
|
|
21
|
-
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './Autocomplete.scss';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
5
|
-
import { createPortal } from 'react-dom';
|
|
6
|
-
import useOnClickOutside from '../shared/hooks/useOnClickOutside';
|
|
7
|
-
const Autocomplete = ({ placeholder, options, value, showClear = false, onChange, renderTarget = document.body, noOptionsLabel, ariaLabel, clearLabel, getOptionKey = (option) => option.value, }) => {
|
|
8
|
-
const container = renderTarget;
|
|
9
|
-
const refAutocomplete = useRef(null);
|
|
10
|
-
const refSearchInput = useRef(null);
|
|
11
|
-
const refOptions = useRef(null);
|
|
12
|
-
const blurTimeoutRef = useRef(null);
|
|
13
|
-
const listboxId = useId();
|
|
14
|
-
const getOptionId = (index) => `${listboxId}-option-${index}`;
|
|
15
|
-
const getOptionLabel = (option) => option.label;
|
|
16
|
-
const isSameOption = (a, b) => getOptionKey(a) === getOptionKey(b);
|
|
17
|
-
const findOptionIndexByValue = (searchValue) => options.findIndex((option) => isSameOption(option, searchValue));
|
|
18
|
-
const findOptionByValue = (searchValue) => options.find((option) => isSameOption(option, searchValue));
|
|
19
|
-
const [searchText, setSearchText] = useState(null);
|
|
20
|
-
const [focusOptionIndex, setFocusOptionIndex] = useState(null);
|
|
21
|
-
const [showOptionsDropdown, setShowOptionsDropdown] = useState(false);
|
|
22
|
-
const [dropdownPosition, setDropdownPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
23
|
-
const activeOption = value ? findOptionByValue(value) : undefined;
|
|
24
|
-
const activeOptionIndex = activeOption ? findOptionIndexByValue(activeOption) : null;
|
|
25
|
-
const displayValue = searchText ?? (activeOption ? getOptionLabel(activeOption) : '');
|
|
26
|
-
const filteredOptions = useMemo(() => {
|
|
27
|
-
if (!searchText)
|
|
28
|
-
return [];
|
|
29
|
-
const lower = searchText.toLowerCase();
|
|
30
|
-
return options.filter((option) => getOptionLabel(option).toLowerCase().includes(lower));
|
|
31
|
-
}, [searchText, options]);
|
|
32
|
-
const updateDropdownPosition = () => {
|
|
33
|
-
if (refAutocomplete.current && showOptionsDropdown) {
|
|
34
|
-
const rect = refAutocomplete.current.getBoundingClientRect();
|
|
35
|
-
setDropdownPosition({
|
|
36
|
-
top: rect.bottom + window.scrollY + 4,
|
|
37
|
-
left: rect.left + window.scrollX,
|
|
38
|
-
width: rect.width,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!showOptionsDropdown)
|
|
44
|
-
return;
|
|
45
|
-
updateDropdownPosition();
|
|
46
|
-
window.addEventListener('scroll', updateDropdownPosition, true);
|
|
47
|
-
window.addEventListener('resize', updateDropdownPosition);
|
|
48
|
-
return () => {
|
|
49
|
-
window.removeEventListener('scroll', updateDropdownPosition, true);
|
|
50
|
-
window.removeEventListener('resize', updateDropdownPosition);
|
|
51
|
-
};
|
|
52
|
-
}, [showOptionsDropdown]);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (focusOptionIndex === null || !refOptions.current)
|
|
55
|
-
return;
|
|
56
|
-
const items = refOptions.current.querySelectorAll('li');
|
|
57
|
-
items[focusOptionIndex]?.scrollIntoView({ block: 'nearest' });
|
|
58
|
-
}, [focusOptionIndex]);
|
|
59
|
-
useOnClickOutside([refAutocomplete, refOptions], () => setShowOptionsDropdown(false), showOptionsDropdown);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
return () => {
|
|
62
|
-
if (blurTimeoutRef.current)
|
|
63
|
-
clearTimeout(blurTimeoutRef.current);
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
const updateValue = (newValue) => {
|
|
67
|
-
setSearchText(null);
|
|
68
|
-
onChange?.(newValue);
|
|
69
|
-
};
|
|
70
|
-
const selectOption = (option) => {
|
|
71
|
-
updateValue(option);
|
|
72
|
-
setFocusOptionIndex(null);
|
|
73
|
-
setShowOptionsDropdown(false);
|
|
74
|
-
refSearchInput.current?.blur();
|
|
75
|
-
};
|
|
76
|
-
const clearValue = (setFocus = false) => {
|
|
77
|
-
updateValue(undefined);
|
|
78
|
-
setFocusOptionIndex(null);
|
|
79
|
-
if (setFocus)
|
|
80
|
-
refSearchInput.current?.focus();
|
|
81
|
-
};
|
|
82
|
-
const onFocus = () => {
|
|
83
|
-
setShowOptionsDropdown(true);
|
|
84
|
-
};
|
|
85
|
-
const onBlur = () => {
|
|
86
|
-
if (blurTimeoutRef.current)
|
|
87
|
-
clearTimeout(blurTimeoutRef.current);
|
|
88
|
-
blurTimeoutRef.current = setTimeout(() => {
|
|
89
|
-
setSearchText(null);
|
|
90
|
-
}, 200);
|
|
91
|
-
};
|
|
92
|
-
const handleEnterKey = () => {
|
|
93
|
-
if ((!displayValue && focusOptionIndex === null) || (searchText && focusOptionIndex === null)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const currentOptions = filteredOptions.length > 0 ? filteredOptions : options;
|
|
97
|
-
if (focusOptionIndex !== null && currentOptions[focusOptionIndex]) {
|
|
98
|
-
const selectedOption = currentOptions[focusOptionIndex];
|
|
99
|
-
updateValue(selectedOption);
|
|
100
|
-
}
|
|
101
|
-
setFocusOptionIndex(null);
|
|
102
|
-
setShowOptionsDropdown(false);
|
|
103
|
-
refSearchInput.current?.blur();
|
|
104
|
-
};
|
|
105
|
-
const handleArrowUp = () => {
|
|
106
|
-
if (!showOptionsDropdown || focusOptionIndex === 0 || focusOptionIndex === null) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
setFocusOptionIndex(focusOptionIndex - 1);
|
|
110
|
-
};
|
|
111
|
-
const handleArrowDown = () => {
|
|
112
|
-
if (!showOptionsDropdown) {
|
|
113
|
-
setFocusOptionIndex(activeOptionIndex ?? 0);
|
|
114
|
-
setShowOptionsDropdown(true);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const currentOptions = filteredOptions.length > 0 ? filteredOptions : options;
|
|
118
|
-
const nextIndex = focusOptionIndex === null ? 0 : focusOptionIndex + 1;
|
|
119
|
-
if (nextIndex < currentOptions.length) {
|
|
120
|
-
setFocusOptionIndex(nextIndex);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const onKeyDown = (event) => {
|
|
124
|
-
switch (event.key) {
|
|
125
|
-
case 'Enter':
|
|
126
|
-
handleEnterKey();
|
|
127
|
-
break;
|
|
128
|
-
case 'ArrowUp':
|
|
129
|
-
handleArrowUp();
|
|
130
|
-
break;
|
|
131
|
-
case 'ArrowDown':
|
|
132
|
-
handleArrowDown();
|
|
133
|
-
break;
|
|
134
|
-
case 'Delete':
|
|
135
|
-
clearValue(true);
|
|
136
|
-
break;
|
|
137
|
-
case 'Escape':
|
|
138
|
-
if (!searchText) {
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
setShowOptionsDropdown(false);
|
|
141
|
-
refSearchInput.current?.blur();
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
setSearchText(null);
|
|
145
|
-
setFocusOptionIndex(activeOptionIndex);
|
|
146
|
-
}
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
const onInputChange = (event) => {
|
|
151
|
-
setSearchText(event.target.value);
|
|
152
|
-
setShowOptionsDropdown(true);
|
|
153
|
-
setFocusOptionIndex(null);
|
|
154
|
-
};
|
|
155
|
-
const renderOptions = () => {
|
|
156
|
-
const currentOptions = filteredOptions.length > 0 ? filteredOptions : options;
|
|
157
|
-
if (searchText && filteredOptions.length === 0) {
|
|
158
|
-
return _jsx("div", { className: "efp-autocomplete__empty", children: noOptionsLabel });
|
|
159
|
-
}
|
|
160
|
-
return (_jsx("ul", { role: "listbox", id: listboxId, children: currentOptions.map((option, index) => {
|
|
161
|
-
const isFocused = index === focusOptionIndex;
|
|
162
|
-
const isActive = filteredOptions.length === 0 && index === activeOptionIndex;
|
|
163
|
-
const className = isFocused ? 'is-focus' : isActive ? 'is-active' : undefined;
|
|
164
|
-
return (_jsx("li", { id: getOptionId(index), role: "option", "aria-selected": isActive, className: className, onMouseDown: (e) => e.preventDefault(), onClick: () => selectOption(option), children: getOptionLabel(option) }, getOptionKey(option)));
|
|
165
|
-
}) }));
|
|
166
|
-
};
|
|
167
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: refAutocomplete, className: classNames('efp-autocomplete', {
|
|
168
|
-
'is-open': showOptionsDropdown,
|
|
169
|
-
'with-clear': showOptionsDropdown && showClear,
|
|
170
|
-
}), children: _jsxs("div", { className: "efp-autocomplete__inner", children: [_jsx("input", { type: "search", className: "efp-autocomplete__input", role: "combobox", "aria-label": ariaLabel, "aria-autocomplete": "list", "aria-expanded": showOptionsDropdown, "aria-controls": showOptionsDropdown ? listboxId : undefined, "aria-activedescendant": showOptionsDropdown && focusOptionIndex !== null
|
|
171
|
-
? getOptionId(focusOptionIndex)
|
|
172
|
-
: undefined, onChange: onInputChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, value: displayValue, placeholder: placeholder, ref: refSearchInput }), showClear && showOptionsDropdown && displayValue && (_jsx("button", { type: "button", className: "efp-autocomplete__clear", "aria-label": clearLabel, onMouseDown: (e) => {
|
|
173
|
-
e.preventDefault();
|
|
174
|
-
clearValue(true);
|
|
175
|
-
} }))] }) }), showOptionsDropdown &&
|
|
176
|
-
container &&
|
|
177
|
-
createPortal(_jsx("div", { ref: refOptions, className: "efp-autocomplete-options", style: {
|
|
178
|
-
top: `${dropdownPosition.top}px`,
|
|
179
|
-
left: `${dropdownPosition.left}px`,
|
|
180
|
-
width: `${dropdownPosition.width}px`,
|
|
181
|
-
}, children: _jsx("div", { className: "efp-autocomplete-options__scroll", children: renderOptions() }) }), container)] }));
|
|
182
|
-
};
|
|
183
|
-
export default Autocomplete;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Autocomplete';
|
package/dist/Badge/Badge.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import './Badge.scss';
|
|
2
|
-
import React, { type ReactNode } from 'react';
|
|
3
|
-
export type BadgeVariant = 'primary' | 'primary-light' | 'lightgray' | 'gray' | 'ghost' | 'orange' | 'location';
|
|
4
|
-
export interface BadgeProps {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
variant?: BadgeVariant;
|
|
7
|
-
size?: 'xs' | 'md' | 'lg';
|
|
8
|
-
noMargins?: boolean;
|
|
9
|
-
rounded?: boolean;
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const Badge: ({ children, variant, size, noMargins, rounded, inline, }: BadgeProps) => React.JSX.Element;
|
|
13
|
-
export default Badge;
|
|
14
|
-
//# sourceMappingURL=Badge.d.ts.map
|
package/dist/Badge/Badge.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import './Badge.scss';
|
|
4
|
-
import cn from 'classnames';
|
|
5
|
-
const Badge = ({ children, variant = 'ghost', size = 'lg', noMargins, rounded, inline, }) => {
|
|
6
|
-
return (_jsx("div", { className: cn({
|
|
7
|
-
'efp-badge': true,
|
|
8
|
-
[`efp-badge--${variant}`]: true,
|
|
9
|
-
[`efp-badge--${size}`]: true,
|
|
10
|
-
'is-no-margin': noMargins,
|
|
11
|
-
'is-rounded': rounded,
|
|
12
|
-
'is-inline': inline,
|
|
13
|
-
}), children: children }));
|
|
14
|
-
};
|
|
15
|
-
export default Badge;
|
package/dist/Badge/index.d.ts
DELETED
package/dist/Badge/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Badge';
|
package/dist/Button/Button.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import './Button.scss';
|
|
2
|
-
import React, { type ReactNode } from 'react';
|
|
3
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'gray' | 'gray-border' | 'ghost' | 'danger';
|
|
4
|
-
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
-
export type ButtonTarget = '_self' | '_blank' | '_parent';
|
|
6
|
-
interface ButtonOwnProps {
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
inline?: boolean;
|
|
9
|
-
text?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
variant?: ButtonVariant;
|
|
12
|
-
size?: ButtonSize;
|
|
13
|
-
target?: ButtonTarget;
|
|
14
|
-
ariaLabel?: string;
|
|
15
|
-
withBadge?: boolean;
|
|
16
|
-
/** Whether the button should have a round/circular shape */
|
|
17
|
-
round?: boolean;
|
|
18
|
-
}
|
|
19
|
-
type ButtonAsButton = ButtonOwnProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonOwnProps> & {
|
|
20
|
-
link?: undefined;
|
|
21
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
22
|
-
};
|
|
23
|
-
type ButtonAsLink = ButtonOwnProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonOwnProps> & {
|
|
24
|
-
link: string;
|
|
25
|
-
ref?: React.Ref<HTMLAnchorElement>;
|
|
26
|
-
};
|
|
27
|
-
export type ButtonProps = ButtonAsButton | ButtonAsLink;
|
|
28
|
-
declare const Button: (props: ButtonProps) => React.JSX.Element;
|
|
29
|
-
export default Button;
|
|
30
|
-
//# sourceMappingURL=Button.d.ts.map
|
package/dist/Button/Button.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './Button.scss';
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
// `if (props.link)` alone doesn't narrow the union for TS; this predicate does.
|
|
5
|
-
const isLinkProps = (props) => props.link != null;
|
|
6
|
-
const processLabel = (label) => {
|
|
7
|
-
const parts = label.split(/(#\d+#)/);
|
|
8
|
-
const badgeMatch = /#(\d+)#/.exec(label);
|
|
9
|
-
const badgeValue = badgeMatch ? badgeMatch[1] : null;
|
|
10
|
-
return {
|
|
11
|
-
content: parts.map((part, index) => {
|
|
12
|
-
if (/#\d+#/.exec(part)) {
|
|
13
|
-
return (_jsx("div", { className: "efp-button-badge", children: badgeValue }, index));
|
|
14
|
-
}
|
|
15
|
-
return _jsx("span", { children: part }, index);
|
|
16
|
-
}),
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const Button = (props) => {
|
|
20
|
-
const { children, inline = false, text, disabled = false, variant = 'primary', size = 'lg', target = '_self', ariaLabel, title, withBadge = false, round, } = props;
|
|
21
|
-
const content = children ?? text;
|
|
22
|
-
const { content: processedContent } = withBadge && typeof content === 'string' ? processLabel(content) : { content };
|
|
23
|
-
const commonClassNames = cn('efp-button', `efp-button--${variant}`, `efp-button--${size}`, {
|
|
24
|
-
'efp-button--inline': inline,
|
|
25
|
-
'is-disabled': disabled,
|
|
26
|
-
'efp-button--round': round,
|
|
27
|
-
}, props.className);
|
|
28
|
-
if (isLinkProps(props)) {
|
|
29
|
-
const { link, className: _className, onClick, ...rest } = props;
|
|
30
|
-
const onKeyDown = (event) => {
|
|
31
|
-
if (disabled || event.key !== ' ')
|
|
32
|
-
return;
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
event.currentTarget.click();
|
|
35
|
-
};
|
|
36
|
-
return (_jsx("a", { ...rest, href: disabled ? undefined : link, className: commonClassNames, target: target, rel: "noopener noreferrer", onClick: disabled ? undefined : onClick, onKeyDown: onKeyDown, "aria-label": ariaLabel || undefined, title: title || ariaLabel || (typeof content === 'string' ? content : undefined), role: "button", "aria-disabled": disabled, tabIndex: disabled ? -1 : 0, children: processedContent }));
|
|
37
|
-
}
|
|
38
|
-
const { className: _className, ...rest } = props;
|
|
39
|
-
return (_jsx("button", { type: "button", ...rest, className: commonClassNames, disabled: disabled, "aria-label": ariaLabel || undefined, title: title || ariaLabel || (typeof content === 'string' ? content : undefined), children: processedContent }));
|
|
40
|
-
};
|
|
41
|
-
export default Button;
|
package/dist/Button/index.d.ts
DELETED
package/dist/Button/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Button';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import './Checkbox.scss';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface CheckboxBase {
|
|
4
|
-
name?: string;
|
|
5
|
-
value: boolean;
|
|
6
|
-
indeterminate?: boolean;
|
|
7
|
-
size?: 'sm' | 'md';
|
|
8
|
-
onChange: (value: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
export type CheckboxProps = (CheckboxBase & {
|
|
11
|
-
label: string;
|
|
12
|
-
ariaLabel?: string;
|
|
13
|
-
}) | (CheckboxBase & {
|
|
14
|
-
label?: undefined;
|
|
15
|
-
ariaLabel: string;
|
|
16
|
-
});
|
|
17
|
-
declare const Checkbox: ({ name, value, label, ariaLabel, size, indeterminate, onChange, }: CheckboxProps) => React.JSX.Element;
|
|
18
|
-
export default Checkbox;
|
|
19
|
-
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import './Checkbox.scss';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import { useEffect, useId, useRef } from 'react';
|
|
6
|
-
const Checkbox = ({ name, value, label, ariaLabel, size = 'md', indeterminate = false, onChange, }) => {
|
|
7
|
-
const id = useId();
|
|
8
|
-
const checkboxRef = useRef(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (checkboxRef.current) {
|
|
11
|
-
checkboxRef.current.indeterminate = indeterminate;
|
|
12
|
-
}
|
|
13
|
-
}, [indeterminate]);
|
|
14
|
-
return (_jsxs("div", { className: classNames({
|
|
15
|
-
'efp-checkbox': true,
|
|
16
|
-
[`efp-checkbox--${size}`]: true,
|
|
17
|
-
}), children: [_jsx("input", { ref: checkboxRef, type: "checkbox", id: id, name: name, checked: value, "aria-label": ariaLabel, onChange: () => onChange(!value) }), _jsx("label", { htmlFor: id, children: label })] }));
|
|
18
|
-
};
|
|
19
|
-
export default Checkbox;
|
package/dist/Checkbox/index.d.ts
DELETED
package/dist/Checkbox/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Checkbox';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import './CheckboxButton.scss';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface CheckboxButtonProps {
|
|
4
|
-
checked: boolean;
|
|
5
|
-
label?: string;
|
|
6
|
-
ariaLabel?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
onClick: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const CheckboxButton: ({ checked, label, ariaLabel, className, onClick }: CheckboxButtonProps) => React.JSX.Element;
|
|
11
|
-
export default CheckboxButton;
|
|
12
|
-
//# sourceMappingURL=CheckboxButton.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import './CheckboxButton.scss';
|
|
4
|
-
import cn from 'classnames';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
const CheckboxButton = ({ checked, label, ariaLabel, className, onClick }) => {
|
|
7
|
-
const [animateIcon, setAnimateIcon] = useState(false);
|
|
8
|
-
const handleClick = () => {
|
|
9
|
-
setAnimateIcon(true);
|
|
10
|
-
onClick();
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
setAnimateIcon(false);
|
|
13
|
-
}, 320);
|
|
14
|
-
};
|
|
15
|
-
return (_jsxs("button", { type: "button", role: "checkbox", "aria-checked": checked, "aria-label": ariaLabel ?? (label ? undefined : 'Toggle'), className: cn('efp-checkbox-button', className, { 'efp-checkbox-button--checked': checked }), onClick: handleClick, children: [_jsx("div", { className: cn('efp-checkbox-button__inner', {
|
|
16
|
-
'efp-checkbox-button__inner--animate': animateIcon,
|
|
17
|
-
}) }), label && _jsx("span", { className: "efp-checkbox-button__label", children: label })] }));
|
|
18
|
-
};
|
|
19
|
-
export default CheckboxButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CheckboxButton';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import './DownloadList.scss';
|
|
2
|
-
export interface DownloadItem {
|
|
3
|
-
fileName: string;
|
|
4
|
-
path: string;
|
|
5
|
-
}
|
|
6
|
-
export interface DownloadListProps {
|
|
7
|
-
list: DownloadItem[];
|
|
8
|
-
/** Section heading (e.g. a localized "Read More"). */
|
|
9
|
-
title: string;
|
|
10
|
-
/** Builds the per-item download link accessible name from its file name. */
|
|
11
|
-
downloadLabel: (fileName: string) => string;
|
|
12
|
-
}
|
|
13
|
-
declare function DownloadList({ list, title, downloadLabel }: DownloadListProps): import("react").JSX.Element;
|
|
14
|
-
export default DownloadList;
|
|
15
|
-
//# sourceMappingURL=DownloadList.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './DownloadList.scss';
|
|
3
|
-
function DownloadListItem({ fileName, path, downloadLabel }) {
|
|
4
|
-
return (_jsxs("a", { className: "efp-download-list__item", href: path, download: true, target: "_blank", rel: "noopener noreferrer", "aria-label": downloadLabel(fileName), children: [_jsx("div", { className: "efp-download-list__item-icon", children: _jsx("i", { className: "icon-file-solid", "aria-hidden": "true" }) }), _jsx("div", { className: "efp-download-list__item-name", children: _jsx("span", { children: fileName }) }), _jsx("div", { className: "efp-download-list__item-download", children: _jsx("i", { className: "icon-download", "aria-hidden": "true" }) })] }));
|
|
5
|
-
}
|
|
6
|
-
function DownloadList({ list, title, downloadLabel }) {
|
|
7
|
-
return (_jsxs("div", { className: "efp-download-list", children: [_jsx("div", { className: "efp-download-list__title font-medium", children: title }), _jsx("ul", { className: "efp-download-list__list", children: list.map((item) => (_jsx("li", { children: _jsx(DownloadListItem, { fileName: item.fileName, path: item.path, downloadLabel: downloadLabel }) }, item.path))) })] }));
|
|
8
|
-
}
|
|
9
|
-
export default DownloadList;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface DraggableProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
}
|
|
7
|
-
declare const Draggable: ({ children, className, style }: DraggableProps) => React.JSX.Element;
|
|
8
|
-
export default Draggable;
|
|
9
|
-
//# sourceMappingURL=Draggable.d.ts.map
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable @eslint-react/exhaustive-deps */
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { isInteractiveTarget } from '../shared/interactive';
|
|
5
|
-
const Draggable = ({ children, className, style }) => {
|
|
6
|
-
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
7
|
-
const [isDragging, setIsDragging] = useState(false);
|
|
8
|
-
const [dragStart, setDragStart] = useState({ x: 0, y: 0 });
|
|
9
|
-
const draggableRef = useRef(null);
|
|
10
|
-
const handleMouseDown = (e) => {
|
|
11
|
-
if (isInteractiveTarget(e.target)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
setIsDragging(true);
|
|
15
|
-
setDragStart({
|
|
16
|
-
x: e.clientX - position.x,
|
|
17
|
-
y: e.clientY - position.y,
|
|
18
|
-
});
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
};
|
|
21
|
-
const handleMouseMove = (e) => {
|
|
22
|
-
if (!isDragging)
|
|
23
|
-
return;
|
|
24
|
-
const newX = e.clientX - dragStart.x;
|
|
25
|
-
const newY = e.clientY - dragStart.y;
|
|
26
|
-
setPosition({ x: newX, y: newY });
|
|
27
|
-
};
|
|
28
|
-
const handleMouseUp = () => {
|
|
29
|
-
endDrag();
|
|
30
|
-
};
|
|
31
|
-
const handleTouchStart = (e) => {
|
|
32
|
-
if (isInteractiveTarget(e.target)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const touch = e.touches[0];
|
|
36
|
-
setIsDragging(true);
|
|
37
|
-
setDragStart({
|
|
38
|
-
x: touch.clientX - position.x,
|
|
39
|
-
y: touch.clientY - position.y,
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const handleTouchMove = (e) => {
|
|
43
|
-
if (!isDragging)
|
|
44
|
-
return;
|
|
45
|
-
const touch = e.touches[0];
|
|
46
|
-
const newX = touch.clientX - dragStart.x;
|
|
47
|
-
const newY = touch.clientY - dragStart.y;
|
|
48
|
-
setPosition({ x: newX, y: newY });
|
|
49
|
-
};
|
|
50
|
-
const handleTouchEnd = () => {
|
|
51
|
-
endDrag();
|
|
52
|
-
};
|
|
53
|
-
const endDrag = () => {
|
|
54
|
-
if (!draggableRef.current)
|
|
55
|
-
return;
|
|
56
|
-
const rect = draggableRef.current.getBoundingClientRect();
|
|
57
|
-
const viewportWidth = window.innerWidth;
|
|
58
|
-
const viewportHeight = window.innerHeight;
|
|
59
|
-
const limitWidth = rect.width / 4;
|
|
60
|
-
const limitHeight = rect.height / 4;
|
|
61
|
-
const hiddenLeft = Math.max(0, 0 - rect.left);
|
|
62
|
-
const hiddenRight = Math.max(0, rect.right - viewportWidth);
|
|
63
|
-
const hiddenTop = Math.max(0, 0 - rect.top);
|
|
64
|
-
const hiddenBottom = Math.max(0, rect.bottom - viewportHeight);
|
|
65
|
-
const isPartiallyOutX = hiddenLeft > limitWidth || hiddenRight > limitWidth;
|
|
66
|
-
const isPartiallyOutY = hiddenTop > limitHeight || hiddenBottom > limitHeight;
|
|
67
|
-
if (isPartiallyOutX || isPartiallyOutY) {
|
|
68
|
-
setPosition({ x: 0, y: 0 });
|
|
69
|
-
}
|
|
70
|
-
setIsDragging(false);
|
|
71
|
-
};
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (!isDragging)
|
|
74
|
-
return;
|
|
75
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
76
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
77
|
-
document.addEventListener('touchmove', handleTouchMove, { passive: false });
|
|
78
|
-
document.addEventListener('touchend', handleTouchEnd);
|
|
79
|
-
return () => {
|
|
80
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
81
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
82
|
-
document.removeEventListener('touchmove', handleTouchMove);
|
|
83
|
-
document.removeEventListener('touchend', handleTouchEnd);
|
|
84
|
-
};
|
|
85
|
-
}, [isDragging, dragStart]);
|
|
86
|
-
return (_jsx("div", { ref: draggableRef, className: className, style: {
|
|
87
|
-
...style,
|
|
88
|
-
transform: `translate(${position.x}px, ${position.y}px)`,
|
|
89
|
-
cursor: isDragging ? 'grabbing' : 'grab',
|
|
90
|
-
}, onMouseDown: handleMouseDown, onTouchStart: handleTouchStart, children: children }));
|
|
91
|
-
};
|
|
92
|
-
export default Draggable;
|
package/dist/Draggable/index.js
DELETED