@dtdot/lego 2.0.0-9 → 2.1.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/LICENSE +21 -0
- package/README.md +51 -0
- package/build/components/ActionMenu/ActionMenu.component.d.ts +4 -4
- package/build/components/ActionMenu/ActionMenu.component.js +3 -3
- package/build/components/ActionMenu/_ActionMenuCheckbox.component.d.ts +2 -2
- package/build/components/ActionMenu/_ActionMenuCheckbox.component.js +2 -2
- package/build/components/ActionMenu/_ActionMenuItem.component.d.ts +2 -2
- package/build/components/ActionMenu/_ActionMenuItem.component.js +2 -2
- package/build/components/ActionMenu/_ActionMenuPanel.component.js +1 -1
- package/build/components/ActionMessage/ActionMessage.component.js +1 -1
- package/build/components/Alert/Alert.component.js +3 -3
- package/build/components/Badge/Badge.component.js +1 -1
- package/build/components/BadgeSelector/BadgeSelector.component.js +1 -1
- package/build/components/Button/Button.component.d.ts +1 -1
- package/build/components/Button/Button.component.js +15 -11
- package/build/components/Button/Button.context.d.ts +1 -0
- package/build/components/Button/Button.context.js +1 -0
- package/build/components/Card/Card.component.d.ts +7 -6
- package/build/components/Card/Card.component.js +2 -2
- package/build/components/Card/_CardHeader.component.js +4 -2
- package/build/components/Card/_CardToggleSection.component.d.ts +6 -5
- package/build/components/Card/_CardToggleSection.component.js +2 -2
- package/build/components/Checklist/Checklist.component.js +1 -1
- package/build/components/Checklist/_ChecklistItem.component.js +1 -1
- package/build/components/ControlLine/ControlLine.component.d.ts +7 -0
- package/build/components/ControlLine/ControlLine.component.js +33 -0
- package/build/components/FancyCheckbox/FancyCheckbox.component.js +1 -1
- package/build/components/FloatingActionButton/FloatingActionButton.component.d.ts +13 -0
- package/build/components/FloatingActionButton/FloatingActionButton.component.js +21 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.context.d.ts +15 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.context.js +6 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.internal.d.ts +10 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.internal.js +45 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.provider.d.ts +6 -0
- package/build/components/FloatingActionButton/_FloatingActionButton.provider.js +15 -0
- package/build/components/Form/_NestedFormArray.js +0 -2
- package/build/components/ImageUpload/ImageUpload.component.d.ts +2 -2
- package/build/components/ImageUpload/ImageUpload.component.js +10 -10
- package/build/components/InlineCard/InlineCard.component.d.ts +8 -7
- package/build/components/InlineCard/InlineCard.component.js +2 -2
- package/build/components/InlineCard/_InlineCardContent.component.js +2 -0
- package/build/components/InlineCard/_InlineCardMeta.component.js +1 -0
- package/build/components/Input/Input.component.d.ts +5 -1
- package/build/components/Input/Input.component.js +38 -8
- package/build/components/LiveInput/LiveInput.component.d.ts +2 -2
- package/build/components/LiveInput/LiveInput.component.js +2 -2
- package/build/components/LiveList/LiveList.component.js +2 -2
- package/build/components/LiveList/_LiveListRow.js +3 -3
- package/build/components/Loader/Loader.component.d.ts +7 -2
- package/build/components/Loader/Loader.component.js +28 -8
- package/build/components/Menu/_MenuHeading.component.js +2 -2
- package/build/components/Menu/_MenuItem.component.js +1 -1
- package/build/components/Menu/_MenuPanel.component.js +1 -1
- package/build/components/MinimalMenu/MinimalMenu.component.d.ts +2 -2
- package/build/components/MinimalMenu/MinimalMenu.context.d.ts +7 -0
- package/build/components/MinimalMenu/MinimalMenu.context.js +6 -0
- package/build/components/MinimalMenu/_MinimalMenuHeader.component.d.ts +2 -1
- package/build/components/MinimalMenu/_MinimalMenuHeader.component.js +3 -3
- package/build/components/MinimalMenu/_MinimalMenuItem.component.d.ts +3 -2
- package/build/components/MinimalMenu/_MinimalMenuItem.component.js +3 -3
- package/build/components/MinimalMenu/_MinimalMenuPage.component.js +10 -3
- package/build/components/MinimalMenu/desktop/_DesktopMinimalMenuItem.component.d.ts +2 -2
- package/build/components/MinimalMenu/desktop/_DesktopMinimalMenuItem.component.js +2 -2
- package/build/components/MinimalMenu/mobile/_MobileMenu.constants.js +1 -1
- package/build/components/MinimalMenu/mobile/_MobileMinimalMenuContainer.component.js +4 -24
- package/build/components/MinimalMenu/mobile/_MobileMinimalMenuItem.component.d.ts +3 -2
- package/build/components/MinimalMenu/mobile/_MobileMinimalMenuItem.component.js +22 -24
- package/build/components/Modal/Modal.component.d.ts +6 -5
- package/build/components/Modal/Modal.component.js +2 -2
- package/build/components/Modal/_ModalHeader.component.js +2 -2
- package/build/components/Notification/Notification.component.js +1 -1
- package/build/components/ProfileImage/ProfileImage.component.js +2 -2
- package/build/components/QrCode/QrCode.component.js +2 -2
- package/build/components/Select/Select.component.d.ts +3 -5
- package/build/components/Select/Select.component.js +13 -30
- package/build/components/SquareButton/SquareButton.component.d.ts +2 -2
- package/build/components/SquareButton/SquareButton.component.js +2 -2
- package/build/components/Table/Table.component.d.ts +3 -3
- package/build/components/Table/Table.component.js +1 -0
- package/build/components/Table/_TableAction.d.ts +2 -2
- package/build/components/Table/_TableAction.js +2 -2
- package/build/components/Table/_TableActionMenu.d.ts +2 -2
- package/build/components/Table/_TableActionMenu.js +2 -2
- package/build/components/Table/_TableRow.component.d.ts +3 -2
- package/build/components/Table/_TableRow.component.js +10 -4
- package/build/components/Text/Text.component.d.ts +5 -3
- package/build/components/Text/Text.component.js +21 -3
- package/build/components/TextArea/TextArea.component.d.ts +1 -1
- package/build/components/TextArea/TextArea.component.js +5 -5
- package/build/components/Toggle/Toggle.component.d.ts +2 -1
- package/build/components/Toggle/Toggle.component.js +14 -3
- package/build/components/common/Options.component.d.ts +19 -0
- package/build/components/common/Options.component.js +50 -0
- package/build/constants/zIndex.constants.d.ts +1 -0
- package/build/constants/zIndex.constants.js +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +3 -0
- package/build/screens/Login/Login.screen.js +4 -4
- package/build/screens/Register/Register.screen.js +3 -3
- package/build/screens/Verification/Verification.screen.js +2 -2
- package/build/shared/ControlStyles.js +1 -1
- package/build/theme/dark.theme.js +4 -2
- package/package.json +14 -14
- package/build/components/MinimalMenu/mobile/_MobileMenuBump.component.d.ts +0 -3
- package/build/components/MinimalMenu/mobile/_MobileMenuBump.component.js +0 -4
- package/build/components/MinimalMenu/mobile/_MobileMenuBump.context.d.ts +0 -6
- package/build/components/MinimalMenu/mobile/_MobileMenuBump.context.js +0 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { AnimatePresence } from 'framer-motion';
|
|
3
|
+
import FloatingActionButtonContext from './_FloatingActionButton.context';
|
|
4
|
+
import FloatingActionButtonInternal from './_FloatingActionButton.internal';
|
|
5
|
+
const FloatingActionButtonProvider = ({ children }) => {
|
|
6
|
+
const [fab, setFab] = useState();
|
|
7
|
+
const contextVal = useMemo(() => ({
|
|
8
|
+
contextExists: true,
|
|
9
|
+
setButton: setFab,
|
|
10
|
+
}), [setFab]);
|
|
11
|
+
return (React.createElement(FloatingActionButtonContext.Provider, { value: contextVal },
|
|
12
|
+
children,
|
|
13
|
+
React.createElement(AnimatePresence, null, fab?.icon && (React.createElement(FloatingActionButtonInternal, { key: fab.id, icon: fab.icon, onClick: fab.onClick, variant: fab.variant })))));
|
|
14
|
+
};
|
|
15
|
+
export default FloatingActionButtonProvider;
|
|
@@ -7,12 +7,10 @@ const NestedFormArray = ({ name, index, children }) => {
|
|
|
7
7
|
const safeError = Array.from(Array(Math.max(index + 1, value?.length || 0))).map((_, i) => error?.[i] || {});
|
|
8
8
|
const nestedValue = safeValue[index];
|
|
9
9
|
const nestedErrors = safeError[index];
|
|
10
|
-
console.log('safe', safeValue);
|
|
11
10
|
const onChangeFn = (key, fieldValue) => {
|
|
12
11
|
const newValue = [
|
|
13
12
|
...safeValue.map((item, i) => (i === index ? { ...item, [key]: fieldValue } : item)),
|
|
14
13
|
];
|
|
15
|
-
console.log(newValue);
|
|
16
14
|
onChange && onChange(newValue);
|
|
17
15
|
};
|
|
18
16
|
const contextValue = {
|
|
@@ -8,7 +8,7 @@ interface ImageUploadProps {
|
|
|
8
8
|
'onChange'?: (value: string) => void;
|
|
9
9
|
'onSearch'?: () => void;
|
|
10
10
|
'uploadFn'?: (file: File) => Promise<string>;
|
|
11
|
-
'data-
|
|
11
|
+
'data-testid'?: string;
|
|
12
12
|
}
|
|
13
|
-
declare const ImageUpload: ({ name, value, "error": propsError, "uploading": uploadingProp, onChange, onSearch, "data-
|
|
13
|
+
declare const ImageUpload: ({ name, value, "error": propsError, "uploading": uploadingProp, onChange, onSearch, "data-testid": dataTestId, }: ImageUploadProps) => JSX.Element;
|
|
14
14
|
export default ImageUpload;
|
|
@@ -94,7 +94,7 @@ const ErrorInner = styled.div `
|
|
|
94
94
|
const errorVariants = {
|
|
95
95
|
show: { opacity: 1 },
|
|
96
96
|
};
|
|
97
|
-
const ImageUpload = ({ name, value, 'error': propsError, 'uploading': uploadingProp, onChange, onSearch, 'data-
|
|
97
|
+
const ImageUpload = ({ name, value, 'error': propsError, 'uploading': uploadingProp, onChange, onSearch, 'data-testid': dataTestId, }) => {
|
|
98
98
|
const { upload, getUrl } = useContext(FileContext);
|
|
99
99
|
const [uploading, setUploading] = useState(false);
|
|
100
100
|
const { value: contextValue, error: contextError, onChange: contextOnChange } = useFormNode(name);
|
|
@@ -125,26 +125,26 @@ const ImageUpload = ({ name, value, 'error': propsError, 'uploading': uploadingP
|
|
|
125
125
|
};
|
|
126
126
|
const internalValue = value ? value : contextValue;
|
|
127
127
|
if (uploading || uploadingProp) {
|
|
128
|
-
return (React.createElement(UploadContainer, { "data-
|
|
128
|
+
return (React.createElement(UploadContainer, { "data-testid": dataTestId },
|
|
129
129
|
React.createElement(LoaderContainer, null,
|
|
130
130
|
React.createElement(Loader, null))));
|
|
131
131
|
}
|
|
132
132
|
if (!internalValue) {
|
|
133
|
-
return (React.createElement(UploadContainer, { "data-
|
|
133
|
+
return (React.createElement(UploadContainer, { "data-testid": dataTestId },
|
|
134
134
|
React.createElement(UploadInnerContainer, null,
|
|
135
|
-
React.createElement(IconContainer, { whileHover: { scale: 1.05 }, onClick: handleUploadClicked, "data-
|
|
135
|
+
React.createElement(IconContainer, { whileHover: { scale: 1.05 }, onClick: handleUploadClicked, "data-testid": 'button-image-upload' },
|
|
136
136
|
React.createElement(FontAwesomeIcon, { icon: faCloudUploadAlt })),
|
|
137
137
|
onSearch && (React.createElement(React.Fragment, null,
|
|
138
138
|
React.createElement(UploadVerticalDivider, null),
|
|
139
|
-
React.createElement(IconContainer, { whileHover: { scale: 1.05 }, onClick: onSearch, "data-
|
|
139
|
+
React.createElement(IconContainer, { whileHover: { scale: 1.05 }, onClick: onSearch, "data-testid": 'button-image-search' },
|
|
140
140
|
React.createElement(FontAwesomeIcon, { icon: faSearch }))))),
|
|
141
|
-
React.createElement(HiddenInput, { value: '', ref: inputRef, type: 'file', onChange: handleUpload, "data-
|
|
142
|
-
error && (React.createElement(ErrorContainer, { animate: error ? 'show' : undefined, style: { opacity: 0 }, variants: errorVariants, transition: { type: 'spring', duration: 0.3 }, "data-
|
|
141
|
+
React.createElement(HiddenInput, { value: '', ref: inputRef, type: 'file', onChange: handleUpload, "data-testid": 'input-image-hidden' }),
|
|
142
|
+
error && (React.createElement(ErrorContainer, { animate: error ? 'show' : undefined, style: { opacity: 0 }, variants: errorVariants, transition: { type: 'spring', duration: 0.3 }, "data-testid": 'error-indicator' },
|
|
143
143
|
React.createElement(ErrorInner, null,
|
|
144
144
|
React.createElement(FontAwesomeIcon, { icon: faExclamationCircle })),
|
|
145
|
-
React.createElement(ErrorMessage, { "data-
|
|
145
|
+
React.createElement(ErrorMessage, { "data-testid": 'error-message' }, error)))));
|
|
146
146
|
}
|
|
147
|
-
return (React.createElement("div", { "data-
|
|
148
|
-
React.createElement(Image, { "data-
|
|
147
|
+
return (React.createElement("div", { "data-testid": dataTestId },
|
|
148
|
+
React.createElement(Image, { "data-testid": 'uploaded-image', src: getUrl(internalValue) })));
|
|
149
149
|
};
|
|
150
150
|
export default ImageUpload;
|
|
@@ -4,15 +4,16 @@ import { Status } from '../../theme/theme.types';
|
|
|
4
4
|
export type InlineCardSize = 'fill' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
5
|
export type DragVariant = Status;
|
|
6
6
|
export interface InlineCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
size?: InlineCardSize;
|
|
9
|
-
value?: string;
|
|
10
|
-
gestureLeftIcon?: IconProp;
|
|
11
|
-
gestureLeftVariant?: DragVariant;
|
|
12
|
-
onGestureLeft?: () => void;
|
|
7
|
+
'children': React.ReactNode;
|
|
8
|
+
'size'?: InlineCardSize;
|
|
9
|
+
'value'?: string;
|
|
10
|
+
'gestureLeftIcon'?: IconProp;
|
|
11
|
+
'gestureLeftVariant'?: DragVariant;
|
|
12
|
+
'onGestureLeft'?: () => void;
|
|
13
|
+
'data-testid'?: string;
|
|
13
14
|
}
|
|
14
15
|
declare const InlineCard: {
|
|
15
|
-
({ children, size, value, onClick, gestureLeftIcon, gestureLeftVariant, onGestureLeft, }: InlineCardProps): JSX.Element;
|
|
16
|
+
({ children, size, value, onClick, gestureLeftIcon, gestureLeftVariant, onGestureLeft, "data-testid": dataTestId, }: InlineCardProps): JSX.Element;
|
|
16
17
|
Media: ({ children, variant }: import("./_InlineCardMedia.component").InlineCardMediaProps) => JSX.Element;
|
|
17
18
|
Content: ({ children, center }: import("./_InlineCardContent.component").InlineCardContentProps) => JSX.Element;
|
|
18
19
|
Meta: ({ children }: import("./_InlineCardMeta.component").InlineCardMetaProps) => JSX.Element;
|
|
@@ -105,7 +105,7 @@ const SelectIconContainer = styled.div `
|
|
|
105
105
|
|
|
106
106
|
color: ${(props) => props.theme.colours.statusInfo.contrast};
|
|
107
107
|
`;
|
|
108
|
-
const InlineCard = ({ children, size, value, onClick, gestureLeftIcon, gestureLeftVariant, onGestureLeft, }) => {
|
|
108
|
+
const InlineCard = ({ children, size, value, onClick, gestureLeftIcon, gestureLeftVariant, onGestureLeft, 'data-testid': dataTestId, }) => {
|
|
109
109
|
const { value: selectedValues, onToggle } = useContext(InlineCardSelectionContext);
|
|
110
110
|
const isSelectable = !!onToggle;
|
|
111
111
|
const isSelected = selectedValues?.length && value && selectedValues.includes(value);
|
|
@@ -136,7 +136,7 @@ const InlineCard = ({ children, size, value, onClick, gestureLeftIcon, gestureLe
|
|
|
136
136
|
};
|
|
137
137
|
return (React.createElement(CardWrapper, { size: size },
|
|
138
138
|
React.createElement(CardActionBackground, { style: { opacity, backgroundColor: gestureLeftTheme.main } }, gestureLeftIcon && (React.createElement(FontAwesomeIcon, { style: { fontSize: '20px', color: gestureLeftTheme.contrast }, icon: gestureLeftIcon }))),
|
|
139
|
-
React.createElement(CardOuter, { drag: onGestureLeft ? 'x' : undefined, onDragEnd: handleDragEnd, ref: ref, style: { x }, animate: { x: gestureLeftActivated ? -bounds.width : undefined, opacity: gestureLeftActivated ? 0 : undefined }, dragConstraints: { left: 0, right: 0 }, usePointer: !!onClick || isSelectable, onClick: handleClick, "data-
|
|
139
|
+
React.createElement(CardOuter, { drag: onGestureLeft ? 'x' : undefined, onDragEnd: handleDragEnd, ref: ref, style: { x }, animate: { x: gestureLeftActivated ? -bounds.width : undefined, opacity: gestureLeftActivated ? 0 : undefined }, dragConstraints: { left: 0, right: 0 }, usePointer: !!onClick || isSelectable, onClick: handleClick, "data-testid": dataTestId || 'inline-card' }, children),
|
|
140
140
|
isSelectable && isSelected ? (React.createElement(SelectChecked, null,
|
|
141
141
|
React.createElement(SelectIconContainer, null,
|
|
142
142
|
React.createElement(FontAwesomeIcon, { icon: faCheck })))) : null));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SelectOption } from '../common/Options.component';
|
|
2
3
|
export interface IInputProps {
|
|
3
4
|
'name'?: string;
|
|
4
5
|
'label'?: string;
|
|
@@ -12,7 +13,10 @@ export interface IInputProps {
|
|
|
12
13
|
'onChange'?: (value: any) => void;
|
|
13
14
|
'onFocus'?: () => void;
|
|
14
15
|
'onBlur'?: () => void;
|
|
15
|
-
'data-
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
'suggestions'?: SelectOption[];
|
|
18
|
+
'loading'?: boolean;
|
|
19
|
+
'loadingVariant'?: 'default' | 'background';
|
|
16
20
|
}
|
|
17
21
|
declare const Input: React.ForwardRefExoticComponent<IInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
18
22
|
export default Input;
|
|
@@ -8,9 +8,11 @@ import ControlDescription from '../../shared/ControlDescription';
|
|
|
8
8
|
import ControlLabel from '../../shared/ControlLabel';
|
|
9
9
|
import { ControlStyles } from '../../shared/ControlStyles';
|
|
10
10
|
import useFormNode, { getValue } from '../Form/useFormNode.hook';
|
|
11
|
+
import { OptionsPopper } from '../common/Options.component';
|
|
12
|
+
import Loader from '../Loader/Loader.component';
|
|
11
13
|
const InputContainer = styled.div `
|
|
12
14
|
position: relative;
|
|
13
|
-
|
|
15
|
+
border-radius: 2px;
|
|
14
16
|
|
|
15
17
|
background-color: ${(props) => props.theme.colours.controlBackground};
|
|
16
18
|
`;
|
|
@@ -51,6 +53,16 @@ const ErrorInner = styled.div `
|
|
|
51
53
|
align-items: center;
|
|
52
54
|
cursor: pointer;
|
|
53
55
|
`;
|
|
56
|
+
const LoadingContainer = styled.div `
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
height: 100%;
|
|
61
|
+
width: 40px;
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
`;
|
|
54
66
|
const errorVariants = {
|
|
55
67
|
show: { opacity: 1, x: 10 },
|
|
56
68
|
};
|
|
@@ -62,11 +74,22 @@ const messageVariants = {
|
|
|
62
74
|
errorFocus: { opacity: 1, y: -4 },
|
|
63
75
|
};
|
|
64
76
|
const Input = React.forwardRef(function ForwardRefInput(props, ref) {
|
|
65
|
-
const { label, name, description, placeholder, disabled, type = 'text', autoFocus, value, 'error': propsError, onChange, onFocus, onBlur, 'data-
|
|
77
|
+
const { label, name, description, placeholder, disabled, type = 'text', autoFocus, value, 'error': propsError, onChange, onFocus, onBlur, 'data-testid': dataTestId, suggestions, loading, loadingVariant, } = props;
|
|
78
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
66
79
|
const [isFocused, setIsFocused] = useState(false);
|
|
80
|
+
const [referenceElement, setReferenceElement] = useState();
|
|
67
81
|
const { value: contextValue, error: contextError, onChange: contextOnChange } = useFormNode(name);
|
|
68
82
|
const error = contextError || propsError;
|
|
69
83
|
const splitDescription = description ? description.split('\\n').map((str) => str.trim()) : undefined;
|
|
84
|
+
const handleSetSuggestion = (value) => {
|
|
85
|
+
setIsOpen(false);
|
|
86
|
+
if (onChange) {
|
|
87
|
+
onChange(value);
|
|
88
|
+
}
|
|
89
|
+
if (contextOnChange) {
|
|
90
|
+
contextOnChange(value);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
70
93
|
const handleChange = (e) => {
|
|
71
94
|
if (onChange) {
|
|
72
95
|
onChange(e.target.value);
|
|
@@ -87,17 +110,24 @@ const Input = React.forwardRef(function ForwardRefInput(props, ref) {
|
|
|
87
110
|
onBlur();
|
|
88
111
|
}
|
|
89
112
|
};
|
|
113
|
+
const handleClick = () => {
|
|
114
|
+
setIsOpen(true);
|
|
115
|
+
};
|
|
90
116
|
const animationVariant = error ? (isFocused ? 'errorFocus' : 'error') : undefined;
|
|
117
|
+
const filteredOptions = suggestions?.filter((option) => !value || option.label.toLowerCase().includes(value.toLowerCase()));
|
|
91
118
|
return (React.createElement("div", null,
|
|
92
119
|
label && React.createElement(ControlLabel, { htmlFor: name }, label),
|
|
93
|
-
React.createElement(InputContainer, { "data-
|
|
94
|
-
React.createElement(StyledInput, { ref: ref, animate: animationVariant, variants: inputVariants, transition: { type: 'spring', duration: 0.3 }, type: type, name: name, placeholder: placeholder, disabled: disabled, value: getValue(value, contextValue), onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, autoFocus: autoFocus, "data-
|
|
95
|
-
React.createElement(ErrorContainer, { animate: error ? 'show' : undefined, style: { opacity: 0 }, variants: errorVariants, transition: { type: 'spring', duration: 0.3 }, "data-
|
|
120
|
+
React.createElement(InputContainer, { "data-testid": dataTestId, ref: setReferenceElement },
|
|
121
|
+
React.createElement(StyledInput, { ref: ref, animate: animationVariant, variants: inputVariants, transition: { type: 'spring', duration: 0.3 }, type: type, name: name, placeholder: placeholder, disabled: disabled, value: getValue(value, contextValue), onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onClick: handleClick, autoFocus: autoFocus, "data-testid": 'input' }),
|
|
122
|
+
React.createElement(ErrorContainer, { animate: error ? 'show' : undefined, style: { opacity: 0 }, variants: errorVariants, transition: { type: 'spring', duration: 0.3 }, "data-testid": 'error-indicator' },
|
|
96
123
|
React.createElement(ErrorInner, null,
|
|
97
124
|
React.createElement(FontAwesomeIcon, { icon: faExclamationCircle }))),
|
|
98
|
-
error && (React.createElement(ErrorMessage, { style: { opacity: 0, y: 0 }, animate: animationVariant, variants: messageVariants, transition: { type: 'spring', duration: 0.3 }, "data-
|
|
99
|
-
|
|
125
|
+
error && (React.createElement(ErrorMessage, { style: { opacity: 0, y: 0 }, animate: animationVariant, variants: messageVariants, transition: { type: 'spring', duration: 0.3 }, "data-testid": 'error-message' }, error)),
|
|
126
|
+
loading && (React.createElement(LoadingContainer, null,
|
|
127
|
+
React.createElement(Loader, { size: 'sm', variant: loadingVariant })))),
|
|
128
|
+
splitDescription && (React.createElement(ControlDescription, null, splitDescription.map((line, index) => (React.createElement("span", { key: index },
|
|
100
129
|
index !== 0 && React.createElement("br", null),
|
|
101
|
-
line)))))
|
|
130
|
+
line))))),
|
|
131
|
+
filteredOptions && isOpen && (React.createElement(OptionsPopper, { referenceElement: referenceElement, options: filteredOptions, onSelect: handleSetSuggestion, onClose: () => setIsOpen(false) }))));
|
|
102
132
|
});
|
|
103
133
|
export default Input;
|
|
@@ -5,7 +5,7 @@ interface LiveInputProps {
|
|
|
5
5
|
'type'?: string;
|
|
6
6
|
'value'?: string;
|
|
7
7
|
'onChange'?: (value: string) => void;
|
|
8
|
-
'data-
|
|
8
|
+
'data-testid'?: string;
|
|
9
9
|
}
|
|
10
|
-
declare const LiveInput: ({ name, type, placeholder, value, onChange, "data-
|
|
10
|
+
declare const LiveInput: ({ name, type, placeholder, value, onChange, "data-testid": dataTestId, }: LiveInputProps) => JSX.Element;
|
|
11
11
|
export default LiveInput;
|
|
@@ -14,7 +14,7 @@ const StyledInput = styled.input `
|
|
|
14
14
|
color: ${(props) => props.theme.colours.controlPlaceholder};
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
|
-
const LiveInput = ({ name, type = 'text', placeholder, value, onChange, 'data-
|
|
17
|
+
const LiveInput = ({ name, type = 'text', placeholder, value, onChange, 'data-testid': dataTestId, }) => {
|
|
18
18
|
const { value: contextValue, onChange: contextOnChange } = useFormNode(name);
|
|
19
19
|
const handleChange = (e) => {
|
|
20
20
|
if (onChange) {
|
|
@@ -25,6 +25,6 @@ const LiveInput = ({ name, type = 'text', placeholder, value, onChange, 'data-cy
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
return (React.createElement("div", null,
|
|
28
|
-
React.createElement(StyledInput, { name: name, type: type, value: value || contextValue, placeholder: placeholder, onChange: handleChange, "data-
|
|
28
|
+
React.createElement(StyledInput, { name: name, type: type, value: value || contextValue, placeholder: placeholder, onChange: handleChange, "data-testid": dataTestId || 'live-input' })));
|
|
29
29
|
};
|
|
30
30
|
export default LiveInput;
|
|
@@ -100,10 +100,10 @@ const LiveList = ({ value: inputValue, name, onChange: propsOnChange }) => {
|
|
|
100
100
|
if (!value?.length) {
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
|
-
return (React.createElement("div", { "data-
|
|
103
|
+
return (React.createElement("div", { "data-testid": 'live-list' },
|
|
104
104
|
value.map((val) => (React.createElement(LiveListRow, { key: val.id, id: val.id, value: val.value, error: contextError ? contextError[val.id] : undefined, onChange: (newVal) => handleRowChange(val.id, newVal), onRemove: () => handleRowRemove(val.id) }))),
|
|
105
105
|
React.createElement(AddRow, null,
|
|
106
|
-
React.createElement(AddRowInner, { style: { scale: 1 }, whileHover: 'hover', variants: addVariants, onClick: handleRowAdd, "data-
|
|
106
|
+
React.createElement(AddRowInner, { style: { scale: 1 }, whileHover: 'hover', variants: addVariants, onClick: handleRowAdd, "data-testid": 'button-add-list-item' },
|
|
107
107
|
React.createElement(IconContainer, null,
|
|
108
108
|
React.createElement(FontAwesomeIcon, { icon: faPlusCircle })),
|
|
109
109
|
"add"))));
|
|
@@ -59,10 +59,10 @@ const LiveListRow = ({ id, value, error, onChange, onRemove }) => {
|
|
|
59
59
|
setIsFocused(false);
|
|
60
60
|
onBlur(id);
|
|
61
61
|
};
|
|
62
|
-
return (React.createElement(InputContainer, { whileHover: 'hover', "data-
|
|
63
|
-
React.createElement(Input, { onFocus: handleFocus, onBlur: handleBlur, ref: inputRef, value: value || '', error: error, onChange: handleChange, "data-
|
|
62
|
+
return (React.createElement(InputContainer, { whileHover: 'hover', "data-testid": 'live-list-row' },
|
|
63
|
+
React.createElement(Input, { onFocus: handleFocus, onBlur: handleBlur, ref: inputRef, value: value || '', error: error, onChange: handleChange, "data-testid": 'live-list-input' }),
|
|
64
64
|
React.createElement(RemoveContainer, { animate: isFocused ? 'focus' : undefined, style: { opacity: 0 }, variants: removeVariants, transition: { type: 'spring', duration: 0.3 } },
|
|
65
|
-
React.createElement(RemoveInner, { onClick: onRemove, "data-
|
|
65
|
+
React.createElement(RemoveInner, { onClick: onRemove, "data-testid": 'live-list-remove' },
|
|
66
66
|
React.createElement(FontAwesomeIcon, { icon: faTimes })))));
|
|
67
67
|
};
|
|
68
68
|
export default LiveListRow;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export interface BaseLoaderProps {
|
|
3
|
+
variant?: 'default' | 'background';
|
|
4
|
+
size: 'sm' | 'md';
|
|
5
|
+
}
|
|
2
6
|
export interface LoaderProps {
|
|
3
|
-
variant?: 'page-loader' | 'default';
|
|
7
|
+
variant?: 'page-loader' | 'default' | 'background';
|
|
8
|
+
size?: 'sm' | 'md';
|
|
4
9
|
}
|
|
5
|
-
declare const Loader: ({ variant }: LoaderProps) => JSX.Element;
|
|
10
|
+
declare const Loader: ({ variant, size }: LoaderProps) => JSX.Element;
|
|
6
11
|
export default Loader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import colours from '../../colours/colours';
|
|
@@ -47,15 +47,35 @@ const loadingCircleTransition = {
|
|
|
47
47
|
repeatType: 'reverse',
|
|
48
48
|
ease: 'easeInOut',
|
|
49
49
|
}; // Framer motion isn't accepting 'repeatType' but animation breaks without it
|
|
50
|
-
const BaseLoader = (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const BaseLoader = ({ size, variant }) => {
|
|
51
|
+
const loadingCircleWithSize = useMemo(() => {
|
|
52
|
+
const sizePx = size === 'md' ? '10px' : '5px';
|
|
53
|
+
return {
|
|
54
|
+
...loadingCircle,
|
|
55
|
+
width: sizePx,
|
|
56
|
+
height: sizePx,
|
|
57
|
+
backgroundColor: variant === 'default' ? colours.grey30 : colours.grey50,
|
|
58
|
+
};
|
|
59
|
+
}, [size, variant]);
|
|
60
|
+
const loadingContainerWithSize = useMemo(() => {
|
|
61
|
+
const widthPx = size === 'md' ? '40px' : '20px';
|
|
62
|
+
const heightPx = size === 'md' ? '26px' : '13px';
|
|
63
|
+
return {
|
|
64
|
+
...loadingContainer,
|
|
65
|
+
width: widthPx,
|
|
66
|
+
height: heightPx,
|
|
67
|
+
};
|
|
68
|
+
}, [size]);
|
|
69
|
+
return (React.createElement(motion.div, { style: loadingContainerWithSize, variants: loadingContainerVariants, initial: 'start', animate: 'end', "data-testid": 'loader' },
|
|
70
|
+
React.createElement(motion.span, { style: loadingCircleWithSize, variants: loadingCircleVariants, transition: loadingCircleTransition }),
|
|
71
|
+
React.createElement(motion.span, { style: loadingCircleWithSize, variants: loadingCircleVariants, transition: loadingCircleTransition }),
|
|
72
|
+
React.createElement(motion.span, { style: loadingCircleWithSize, variants: loadingCircleVariants, transition: loadingCircleTransition })));
|
|
73
|
+
};
|
|
74
|
+
const Loader = ({ variant = 'default', size = 'md' }) => {
|
|
55
75
|
if (variant === 'page-loader') {
|
|
56
76
|
return (React.createElement(PageLoaderContainer, null,
|
|
57
|
-
React.createElement(BaseLoader,
|
|
77
|
+
React.createElement(BaseLoader, { size: size })));
|
|
58
78
|
}
|
|
59
|
-
return React.createElement(BaseLoader,
|
|
79
|
+
return React.createElement(BaseLoader, { size: size, variant: variant });
|
|
60
80
|
};
|
|
61
81
|
export default Loader;
|
|
@@ -38,8 +38,8 @@ const MenuToggle = styled.div `
|
|
|
38
38
|
`;
|
|
39
39
|
const MenuHeading = ({ children, onOpen, onClose, isOpen }) => (React.createElement(MenuHeadingDiv, null,
|
|
40
40
|
React.createElement(MenuHeadingInner, null,
|
|
41
|
-
isOpen ? (React.createElement(MenuToggle, { onClick: onClose, "data-
|
|
42
|
-
React.createElement(FontAwesomeIcon, { icon: faBars }))) : (React.createElement(MenuToggle, { onClick: onOpen, "data-
|
|
41
|
+
isOpen ? (React.createElement(MenuToggle, { onClick: onClose, "data-testid": 'button-menu-close' },
|
|
42
|
+
React.createElement(FontAwesomeIcon, { icon: faBars }))) : (React.createElement(MenuToggle, { onClick: onOpen, "data-testid": 'button-menu-open' },
|
|
43
43
|
React.createElement(FontAwesomeIcon, { icon: faBars }))),
|
|
44
44
|
children)));
|
|
45
45
|
export default MenuHeading;
|
|
@@ -41,7 +41,7 @@ const MenuActivePlaceholder = styled.div `
|
|
|
41
41
|
height: 100%;
|
|
42
42
|
width: 4px;
|
|
43
43
|
`;
|
|
44
|
-
const MenuItem = ({ children, icon, active, onClick }) => (React.createElement(MenuItemOuter, { onClick: onClick, "data-
|
|
44
|
+
const MenuItem = ({ children, icon, active, onClick }) => (React.createElement(MenuItemOuter, { onClick: onClick, "data-testid": 'menu-item' },
|
|
45
45
|
active ? React.createElement(MenuActiveBar, null) : React.createElement(MenuActivePlaceholder, null),
|
|
46
46
|
React.createElement(MenuItemDiv, { active: active },
|
|
47
47
|
icon && (React.createElement(MenuIconContainer, null,
|
|
@@ -55,6 +55,6 @@ ${(props) => responsive.useStylesFor('desktop').andLarger(props.scrollable
|
|
|
55
55
|
: ``)}
|
|
56
56
|
`;
|
|
57
57
|
const MenuPanel = ({ children, scrollable, panelSize = 'sm' }) => {
|
|
58
|
-
return (React.createElement(MenuPanelDiv, { panelSize: panelSize, scrollable: scrollable, "data-
|
|
58
|
+
return (React.createElement(MenuPanelDiv, { panelSize: panelSize, scrollable: scrollable, "data-testid": 'menu-panel' }, children));
|
|
59
59
|
};
|
|
60
60
|
export default MenuPanel;
|
|
@@ -4,8 +4,8 @@ export interface MinimalMenuProps {
|
|
|
4
4
|
}
|
|
5
5
|
declare const MinimalMenu: {
|
|
6
6
|
({ children }: MinimalMenuProps): JSX.Element;
|
|
7
|
-
Header: ({ hiddenMenu, text, rightContent }: import("./_MinimalMenuHeader.component").MinimalMenuHeaderProps) => JSX.Element;
|
|
8
|
-
Item: ({ icon, active, onClick, "data-
|
|
7
|
+
Header: ({ hiddenMenu, text, rightContent, size }: import("./_MinimalMenuHeader.component").MinimalMenuHeaderProps) => JSX.Element;
|
|
8
|
+
Item: ({ icon, label, active, onClick, "data-testid": dataTestId }: import("./_MinimalMenuItem.component").MinimalMenuItemProps) => JSX.Element;
|
|
9
9
|
Page: ({ children, hiddenMenu }: import("./_MinimalMenuPage.component").MinimalMenuPageProps) => JSX.Element;
|
|
10
10
|
};
|
|
11
11
|
export default MinimalMenu;
|
|
@@ -6,10 +6,11 @@ export interface MinimalMenuHeaderProps {
|
|
|
6
6
|
hiddenMenu?: boolean;
|
|
7
7
|
text?: string;
|
|
8
8
|
rightContent?: React.ReactNode;
|
|
9
|
+
size?: 'sm' | 'md';
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* A header that is designed to be nested within the page content.
|
|
12
13
|
* You can use a header per page or simply use a single header for your entire application.
|
|
13
14
|
*/
|
|
14
|
-
declare const MinimalMenuHeader: ({ hiddenMenu, text, rightContent }: MinimalMenuHeaderProps) => JSX.Element;
|
|
15
|
+
declare const MinimalMenuHeader: ({ hiddenMenu, text, rightContent, size }: MinimalMenuHeaderProps) => JSX.Element;
|
|
15
16
|
export default MinimalMenuHeader;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
const MinimalMenuHeaderContainer = styled.div ``;
|
|
4
4
|
const Header = styled.div `
|
|
5
|
-
height: 48px;
|
|
5
|
+
height: ${(props) => (props.size === 'sm' ? '48px' : '64px')};
|
|
6
6
|
background-color: ${(props) => props.theme.colours.cardBackground};
|
|
7
7
|
|
|
8
8
|
display: flex;
|
|
@@ -22,9 +22,9 @@ const TitleText = styled.div `
|
|
|
22
22
|
* A header that is designed to be nested within the page content.
|
|
23
23
|
* You can use a header per page or simply use a single header for your entire application.
|
|
24
24
|
*/
|
|
25
|
-
const MinimalMenuHeader = ({ hiddenMenu, text, rightContent }) => {
|
|
25
|
+
const MinimalMenuHeader = ({ hiddenMenu, text, rightContent, size = 'sm' }) => {
|
|
26
26
|
return (React.createElement(MinimalMenuHeaderContainer, { hiddenMenu: !!hiddenMenu },
|
|
27
|
-
React.createElement(Header,
|
|
27
|
+
React.createElement(Header, { size: size },
|
|
28
28
|
React.createElement(HeaderItem, null, text && React.createElement(TitleText, null, text)),
|
|
29
29
|
React.createElement(HeaderItem, null, rightContent))));
|
|
30
30
|
};
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
export interface MinimalMenuItemProps {
|
|
4
4
|
'icon'?: IconProp;
|
|
5
|
+
'label': string;
|
|
5
6
|
'active'?: boolean;
|
|
6
7
|
'onClick'?: () => void;
|
|
7
|
-
'data-
|
|
8
|
+
'data-testid'?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const MinimalMenuItem: ({ icon, active, onClick, "data-
|
|
10
|
+
declare const MinimalMenuItem: ({ icon, label, active, onClick, "data-testid": dataTestId }: MinimalMenuItemProps) => JSX.Element;
|
|
10
11
|
export default MinimalMenuItem;
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { useIsScreenSize } from '../../responsive/responsive';
|
|
3
3
|
import DesktopMinimalMenuItem from './desktop/_DesktopMinimalMenuItem.component';
|
|
4
4
|
import MobileMinimalMenuItem from './mobile/_MobileMinimalMenuItem.component';
|
|
5
|
-
const MinimalMenuItem = ({ icon, active, onClick, 'data-
|
|
5
|
+
const MinimalMenuItem = ({ icon, label, active, onClick, 'data-testid': dataTestId }) => {
|
|
6
6
|
const isMobile = useIsScreenSize('mobile');
|
|
7
7
|
if (isMobile) {
|
|
8
|
-
return React.createElement(MobileMinimalMenuItem, { icon: icon, active: active, onClick: onClick, "data-
|
|
8
|
+
return (React.createElement(MobileMinimalMenuItem, { icon: icon, label: label, active: active, onClick: onClick, "data-testid": dataTestId }));
|
|
9
9
|
}
|
|
10
|
-
return React.createElement(DesktopMinimalMenuItem, { icon: icon, active: active, onClick: onClick, "data-
|
|
10
|
+
return React.createElement(DesktopMinimalMenuItem, { icon: icon, active: active, onClick: onClick, "data-testid": dataTestId });
|
|
11
11
|
};
|
|
12
12
|
export default MinimalMenuItem;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import responsive from '../../responsive/responsive';
|
|
3
|
+
import responsive, { useIsScreenSize } from '../../responsive/responsive';
|
|
4
|
+
import MinimalMenuContext from './MinimalMenu.context';
|
|
4
5
|
const MinimalMenuPageContainer = styled.div `
|
|
5
6
|
${responsive.useStylesFor('tablet').andLarger(`
|
|
6
7
|
padding-left: 64px;
|
|
@@ -17,6 +18,12 @@ const MinimalMenuPageContainer = styled.div `
|
|
|
17
18
|
`}
|
|
18
19
|
`;
|
|
19
20
|
const MinimalMenuPage = ({ children, hiddenMenu }) => {
|
|
20
|
-
|
|
21
|
+
const isMobile = useIsScreenSize('mobile');
|
|
22
|
+
const contextState = useMemo(() => ({
|
|
23
|
+
menuExists: true,
|
|
24
|
+
isMobile,
|
|
25
|
+
}), [isMobile]);
|
|
26
|
+
return (React.createElement(MinimalMenuContext.Provider, { value: contextState },
|
|
27
|
+
React.createElement(MinimalMenuPageContainer, { hiddenMenu: !!hiddenMenu }, children)));
|
|
21
28
|
};
|
|
22
29
|
export default MinimalMenuPage;
|
|
@@ -4,7 +4,7 @@ export interface DesktopMinimalMenuItemProps {
|
|
|
4
4
|
'icon'?: IconProp;
|
|
5
5
|
'active'?: boolean;
|
|
6
6
|
'onClick'?: () => void;
|
|
7
|
-
'data-
|
|
7
|
+
'data-testid'?: string;
|
|
8
8
|
}
|
|
9
|
-
declare const DesktopMinimalMenuItem: ({ icon, active, onClick, "data-
|
|
9
|
+
declare const DesktopMinimalMenuItem: ({ icon, active, onClick, "data-testid": dataTestId }: DesktopMinimalMenuItemProps) => JSX.Element;
|
|
10
10
|
export default DesktopMinimalMenuItem;
|
|
@@ -27,14 +27,14 @@ const iconContainerVariants = {
|
|
|
27
27
|
active: { x: 2 },
|
|
28
28
|
hoverActive: { x: 2 },
|
|
29
29
|
};
|
|
30
|
-
const DesktopMinimalMenuItem = ({ icon, active, onClick, 'data-
|
|
30
|
+
const DesktopMinimalMenuItem = ({ icon, active, onClick, 'data-testid': dataTestId }) => {
|
|
31
31
|
const theme = useTheme();
|
|
32
32
|
const barVariants = useMemo(() => ({
|
|
33
33
|
hover: { opacity: 1, backgroundColor: theme.colours.defaultBorder, width: 4 },
|
|
34
34
|
active: { opacity: 1, backgroundColor: theme.colours.primary.main, width: 4 },
|
|
35
35
|
hoverActive: { opacity: 1, backgroundColor: theme.colours.primary.main, width: 4 },
|
|
36
36
|
}), [theme]);
|
|
37
|
-
return (React.createElement(ItemContainer, { whileHover: active ? 'hoverActive' : 'hover', animate: active ? 'active' : undefined, onClick: onClick, "data-
|
|
37
|
+
return (React.createElement(ItemContainer, { whileHover: active ? 'hoverActive' : 'hover', animate: active ? 'active' : undefined, onClick: onClick, "data-testid": dataTestId || 'menu-item' },
|
|
38
38
|
React.createElement(MenuIconBar, { style: { backgroundColor: theme.colours.cardBackground, opacity: 0 }, variants: barVariants, transition: { type: 'spring', duration: 0.3 } }),
|
|
39
39
|
icon && (React.createElement(motion.div, { variants: iconContainerVariants },
|
|
40
40
|
React.createElement(FontAwesomeIcon, { icon: icon })))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const mobileMenuDefaultTransition = { type: 'spring', duration: 0.
|
|
1
|
+
export const mobileMenuDefaultTransition = { type: 'spring', duration: 0.1, bounce: 0 };
|
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
|
-
import { mobileMenuDefaultTransition } from './_MobileMenu.constants';
|
|
5
|
-
import MobileMenuBump from './_MobileMenuBump.component';
|
|
6
|
-
import MobileMenuBumpContext from './_MobileMenuBump.context';
|
|
7
3
|
const MobileMinimalMenuOuter = styled.div `
|
|
8
4
|
position: fixed;
|
|
9
5
|
bottom: 0;
|
|
10
6
|
left: 0;
|
|
11
7
|
|
|
12
8
|
width: 100%;
|
|
13
|
-
height:
|
|
9
|
+
height: 56px;
|
|
14
10
|
z-index: 10;
|
|
15
11
|
|
|
16
12
|
display: flex;
|
|
17
13
|
justify-content: space-evenly;
|
|
14
|
+
align-items: center;
|
|
18
15
|
|
|
19
16
|
background-color: ${(props) => props.theme.colours.cardBackground};
|
|
20
17
|
`;
|
|
21
|
-
const AnimatedMenuBumpContainer = styled(motion.div) `
|
|
22
|
-
position: fixed;
|
|
23
|
-
bottom: 46px;
|
|
24
|
-
left: 0;
|
|
25
|
-
|
|
26
|
-
width: 86px;
|
|
27
|
-
height: 24px;
|
|
28
|
-
|
|
29
|
-
svg {
|
|
30
|
-
fill: ${(props) => props.theme.colours.cardBackground};
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
18
|
const MobileMinimalMenuContainer = ({ children }) => {
|
|
34
|
-
|
|
35
|
-
return (React.createElement(MobileMenuBumpContext.Provider, { value: { setBumpX } },
|
|
36
|
-
React.createElement(MobileMinimalMenuOuter, null,
|
|
37
|
-
React.createElement(AnimatedMenuBumpContainer, { animate: { opacity: bumpX ? 1 : 0, x: bumpX ? bumpX - 86 / 2 : undefined, y: bumpX ? 0 : 100 }, transition: mobileMenuDefaultTransition },
|
|
38
|
-
React.createElement(MobileMenuBump, null)),
|
|
39
|
-
children)));
|
|
19
|
+
return React.createElement(MobileMinimalMenuOuter, null, children);
|
|
40
20
|
};
|
|
41
21
|
export default MobileMinimalMenuContainer;
|