@mrshmllw/smores-react 9.6.0-crumbs-smol-input.1 → 9.7.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/dist/Dropdown/Dropdown.js +1 -1
- package/dist/IconStrict/IconStrict.d.ts +2 -4
- package/dist/IconStrict/IconStrict.js +7 -8
- package/dist/IconStrict/IconStrict.js.map +1 -1
- package/dist/Modal/Modal.js +2 -2
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/SearchInput/SearchInput.d.ts +14 -1
- package/dist/SearchInput/SearchInput.js +101 -16
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/components/SearchOptions.d.ts +7 -0
- package/dist/SearchInput/components/SearchOptions.js +55 -19
- package/dist/SearchInput/components/SearchOptions.js.map +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/Table.js +3 -3
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/types.d.ts +2 -0
- package/dist/Textarea/Textarea.js +1 -1
- package/dist/fields/components/CommonInput.js +1 -1
- package/dist/hooks/useClickOutside/index.js.map +1 -1
- package/package.json +4 -5
@@ -61,7 +61,7 @@ const StyledSelect = styled.select `
|
|
61
61
|
background-color: ${({ $fallbackStyle }) => $fallbackStyle ? theme.colors.custard : theme.colors.cream};
|
62
62
|
|
63
63
|
border-radius: 12px;
|
64
|
-
padding:
|
64
|
+
padding: 18px 14px;
|
65
65
|
border: 2px solid
|
66
66
|
${({ $error }) => ($error ? theme.colors.strawberry : theme.colors.oatmeal)};
|
67
67
|
height: auto;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FC, FormEvent } from 'react';
|
1
|
+
import { ButtonHTMLAttributes, FC, FormEvent } from 'react';
|
2
2
|
import { Icons } from '../Icon/iconsList';
|
3
3
|
import { Color } from '../theme';
|
4
4
|
import { MarginProps } from '../utils/space';
|
@@ -18,7 +18,5 @@ export type IconStrictProps = {
|
|
18
18
|
handleClick?: (e: FormEvent<HTMLButtonElement>) => void;
|
19
19
|
/** rotation degrees */
|
20
20
|
rotate?: number;
|
21
|
-
|
22
|
-
title?: string;
|
23
|
-
} & MarginProps;
|
21
|
+
} & MarginProps & Partial<ButtonHTMLAttributes<HTMLButtonElement>>;
|
24
22
|
export declare const IconStrict: FC<IconStrictProps>;
|
@@ -22,15 +22,14 @@ const iconSizes = {
|
|
22
22
|
padding: 3,
|
23
23
|
},
|
24
24
|
};
|
25
|
-
export const IconStrict = ({ id, className = '', size = 16, render, iconColor, backgroundColor, rotate, handleClick, title, ...
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
} },
|
32
|
-
React.createElement(Icon, { render: render, className: className, size: backgroundColor ? iconSizes[size].smallSize : size, color: iconColor, rotate: rotate, ...marginProps })));
|
25
|
+
export const IconStrict = ({ id, className = '', size = 16, render, iconColor, backgroundColor, rotate, handleClick, title, ...otherProps }) => {
|
26
|
+
const isButton = !!handleClick;
|
27
|
+
const defaultLabel = isButton ? (title ? title : 'icon-button') : undefined;
|
28
|
+
return (React.createElement(IconContainer, { id: id, as: isButton ? 'button' : 'div', className: className, "$size": size, "$backgroundColor": backgroundColor, onClick: handleClick, title: defaultLabel, ...otherProps },
|
29
|
+
React.createElement(Icon, { render: render, size: backgroundColor ? iconSizes[size].smallSize : size, color: iconColor, rotate: rotate })));
|
30
|
+
};
|
33
31
|
const IconContainer = styled.div(({ $size, $backgroundColor, onClick }) => css `
|
32
|
+
position: relative;
|
34
33
|
padding: ${$backgroundColor ? `${iconSizes[$size].padding}px` : 0};
|
35
34
|
width: 100%;
|
36
35
|
max-width: ${$size}px;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IconStrict.js","sourceRoot":"","sources":["../../src/IconStrict/IconStrict.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"IconStrict.js","sourceRoot":"","sources":["../../src/IconStrict/IconStrict.tsx"],"names":[],"mappings":"AAAA,OA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AEd,oBAAC,IAAI,IACH,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EACxD,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,GACd,CACY,CACjB,CAAA;AACH,CAAC,CAAA;AAQD,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAC9B,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;eAEhC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;;iBAEpD,KAAK;cACR,KAAK;;wBAEK,gBAAgB;IAClC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAChC,CAAC,CAAC,MAAM;cACA,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;;MAEvC,OAAO;IACT;;0BAGI,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,MACnE;;;KAGD;;MAEC,iBAAiB;GACpB,CACF,CAAA"}
|
package/dist/Modal/Modal.js
CHANGED
@@ -10,7 +10,7 @@ export const Modal = ({ title = '', children, rightPanel, showModal = false, han
|
|
10
10
|
const modalRef = useRef(null);
|
11
11
|
useBodyScrollLock({ node: modalRef.current, showModal });
|
12
12
|
return createPortal(React.createElement(Wrapper, { "$showModal": showModal, ref: modalRef },
|
13
|
-
React.createElement(Overlay, { onClick: () => closeOnOverlayClick && handleClick(), closeOnOverlayClick: closeOnOverlayClick }),
|
13
|
+
React.createElement(Overlay, { onClick: () => closeOnOverlayClick && handleClick(), "$closeOnOverlayClick": closeOnOverlayClick }),
|
14
14
|
React.createElement(Container, { "$drawer": drawer, "$width": width || '460px', className: containerClass },
|
15
15
|
React.createElement(Box, { flex: true, alignItems: "flex-start", justifyContent: "space-between", mb: "8px" },
|
16
16
|
React.createElement(TitleElements, { flex: true, direction: "column" },
|
@@ -34,7 +34,7 @@ const Wrapper = styled(Box)(({ $showModal }) => css `
|
|
34
34
|
const Overlay = styled.div `
|
35
35
|
position: fixed;
|
36
36
|
background: ${theme.colors.liquorice};
|
37
|
-
cursor: ${(props) => (props
|
37
|
+
cursor: ${(props) => (props.$closeOnOverlayClick ? 'pointer' : 'default')};
|
38
38
|
opacity: 0.4;
|
39
39
|
top: 0;
|
40
40
|
bottom: 0;
|
package/dist/Modal/Modal.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,MAAM,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AA4B9D,MAAM,CAAC,MAAM,KAAK,GAAmB,CAAC,EACpC,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,MAAM,GAAG,IAAI,EACb,KAAK,GAAG,IAAI,EACZ,KAAK,EACL,cAAc,EACd,eAAe,GAAG,QAAQ,CAAC,IAAI,EAC/B,mBAAmB,GAAG,IAAI,GAC3B,EAAE,EAAE;I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,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;;;;;;CAM1E,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAC1B,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;kBACZ,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;iBAKrB,MAAM;;;;;;MAMjB,OAAO,KAAK,IAAI;IAClB,GAAG,CAAA;;;;;;;;;;;;KAYF;GACF,CACF,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAEhC,CAAA"}
|
@@ -18,9 +18,11 @@ export interface SearchInputProps extends CommonFieldProps {
|
|
18
18
|
/** optional callback to run when no results found */
|
19
19
|
onNotFound?: (searchTerm: string) => void;
|
20
20
|
/** optional Component to render when no results found */
|
21
|
-
notFoundComponent?: ReactNode;
|
21
|
+
notFoundComponent?: (searchTerm: string) => ReactNode;
|
22
22
|
/** optional boolean to show search icon */
|
23
23
|
showIcon?: boolean;
|
24
|
+
/** optional boolean to show a clear search button */
|
25
|
+
clearSearch?: boolean;
|
24
26
|
/** Optional callback to run on blur */
|
25
27
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
26
28
|
/** Optional default value for input */
|
@@ -37,3 +39,14 @@ export interface SearchInputProps extends CommonFieldProps {
|
|
37
39
|
fuzzySearchOptions?: IFuseOptions<SearchInputItem>;
|
38
40
|
}
|
39
41
|
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
42
|
+
export declare const Icons: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("..").MarginProps & import("..").PaddingProps & import("../utils/flex").FlexProps & import("../utils/measure").MeasureProps & React.HTMLAttributes<HTMLElement> & {
|
43
|
+
as?: React.ElementType | undefined;
|
44
|
+
forwardedAs?: React.ElementType | undefined;
|
45
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
46
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
47
|
+
}, {
|
48
|
+
$clearSearch: boolean;
|
49
|
+
}>> & string & Omit<React.ForwardRefExoticComponent<import("..").MarginProps & import("..").PaddingProps & import("../utils/flex").FlexProps & import("../utils/measure").MeasureProps & React.HTMLAttributes<HTMLElement> & {
|
50
|
+
as?: React.ElementType | undefined;
|
51
|
+
forwardedAs?: React.ElementType | undefined;
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>, keyof React.Component<any, {}, any>>;
|
@@ -1,20 +1,34 @@
|
|
1
1
|
import Fuse from 'fuse.js';
|
2
|
-
import React, { forwardRef, useMemo, useState, } from 'react';
|
2
|
+
import React, { forwardRef, useMemo, useRef, useState, } from 'react';
|
3
|
+
import styled from 'styled-components';
|
3
4
|
import { Box } from '../Box';
|
5
|
+
import { IconStrict } from '../IconStrict';
|
4
6
|
import { Field } from '../fields/Field';
|
5
7
|
import { Input, StyledFrontIcon } from '../fields/components/CommonInput';
|
8
|
+
import { useOnClickOutside } from '../hooks';
|
9
|
+
import { theme } from '../theme';
|
6
10
|
import { useUniqueId } from '../utils/id';
|
7
11
|
import { useControllableState } from '../utils/useControlledState';
|
8
12
|
import { SearchOptions } from './components/SearchOptions';
|
9
13
|
const defaultFuzzySearchOptions = {
|
10
|
-
keys: [
|
14
|
+
keys: [
|
15
|
+
{
|
16
|
+
name: 'label',
|
17
|
+
weight: 0.6,
|
18
|
+
},
|
19
|
+
{
|
20
|
+
name: 'tags',
|
21
|
+
weight: 0.4,
|
22
|
+
},
|
23
|
+
],
|
11
24
|
findAllMatches: true,
|
12
|
-
minMatchCharLength:
|
25
|
+
minMatchCharLength: 1,
|
13
26
|
location: 0,
|
14
27
|
threshold: 0.45,
|
15
28
|
distance: 55,
|
16
29
|
};
|
17
|
-
export const SearchInput = forwardRef(function SearchInput({ id: idProp, name = 'search_input', className = '', placeholder, searchList, showIcon = false, renderAsTitle = false, value, onBlur, onFound, onNotFound, notFoundComponent, fallbackStyle, resultsRelativePosition = false, resultsBorder = true, enableFuzzySearch = false, fuzzySearchOptions, ...otherProps }, ref) {
|
30
|
+
export const SearchInput = forwardRef(function SearchInput({ id: idProp, name = 'search_input', className = '', placeholder, searchList, showIcon = false, renderAsTitle = false, value, onBlur, onFound, onNotFound, notFoundComponent, fallbackStyle, resultsRelativePosition = false, resultsBorder = true, enableFuzzySearch = false, fuzzySearchOptions, clearSearch, ...otherProps }, ref) {
|
31
|
+
const wrapperRef = useRef(null);
|
18
32
|
const id = useUniqueId(idProp);
|
19
33
|
const [showOptions, setShowOptions] = useState(false);
|
20
34
|
const [selectedValue, setSelectedValue] = useControllableState({
|
@@ -22,6 +36,23 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
22
36
|
stateProp: value,
|
23
37
|
});
|
24
38
|
const [searchQuery, setSearchQuery] = useState(null);
|
39
|
+
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
40
|
+
const selectedValueLabel = searchList.find((option) => option.label === selectedValue || option.value === selectedValue)?.label;
|
41
|
+
const handleBlur = () => {
|
42
|
+
if (selectedValue) {
|
43
|
+
setSearchQuery(selectedValueLabel ?? null);
|
44
|
+
}
|
45
|
+
else if (!selectedValue) {
|
46
|
+
setSearchQuery(null);
|
47
|
+
}
|
48
|
+
};
|
49
|
+
useOnClickOutside({
|
50
|
+
ref: wrapperRef,
|
51
|
+
callback: () => {
|
52
|
+
handleBlur();
|
53
|
+
setShowOptions(false);
|
54
|
+
},
|
55
|
+
});
|
25
56
|
const fuse = useMemo(() => {
|
26
57
|
return new Fuse(searchList, {
|
27
58
|
...defaultFuzzySearchOptions,
|
@@ -42,7 +73,7 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
42
73
|
return searchQuery;
|
43
74
|
}
|
44
75
|
if (selectedValue !== null) {
|
45
|
-
return
|
76
|
+
return selectedValueLabel || '';
|
46
77
|
}
|
47
78
|
return '';
|
48
79
|
};
|
@@ -50,11 +81,24 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
50
81
|
const displayedInputText = getDisplayedInputText();
|
51
82
|
const updateSearchQuery = (query) => {
|
52
83
|
setSearchQuery(query);
|
84
|
+
setHighlightedIndex(-1);
|
53
85
|
if (query === null) {
|
86
|
+
setSelectedValue(null);
|
54
87
|
setShowOptions(false);
|
55
88
|
}
|
56
89
|
else {
|
57
|
-
setShowOptions(
|
90
|
+
setShowOptions(true);
|
91
|
+
}
|
92
|
+
};
|
93
|
+
const handleClick = () => {
|
94
|
+
setShowOptions(true);
|
95
|
+
if (searchQuery !== null) {
|
96
|
+
updateSearchQuery(searchQuery);
|
97
|
+
setShowOptions(true);
|
98
|
+
}
|
99
|
+
else if (selectedValue !== null && searchQuery === null) {
|
100
|
+
setSearchQuery(selectedValueLabel || null);
|
101
|
+
setShowOptions(true);
|
58
102
|
}
|
59
103
|
};
|
60
104
|
const handleInputChange = (event) => {
|
@@ -66,15 +110,56 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
66
110
|
setSelectedValue(nextValue.label);
|
67
111
|
onFound(nextValue.value);
|
68
112
|
};
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
113
|
+
const handleClearSearch = () => {
|
114
|
+
updateSearchQuery(null);
|
115
|
+
setSelectedValue(null);
|
116
|
+
onFound('');
|
117
|
+
};
|
118
|
+
const handleCaretClick = () => {
|
119
|
+
setShowOptions(!showOptions);
|
120
|
+
};
|
121
|
+
const handleKeyDown = (event) => {
|
122
|
+
if (event.key === 'Enter' && highlightedIndex !== -1) {
|
123
|
+
event.preventDefault();
|
124
|
+
const focusedItem = filteredList[highlightedIndex];
|
125
|
+
handleSelect(focusedItem);
|
126
|
+
}
|
127
|
+
else if (event.key === 'ArrowDown') {
|
128
|
+
event.preventDefault();
|
129
|
+
const nextIndex = (highlightedIndex + 1) % filteredList.length;
|
130
|
+
setHighlightedIndex(nextIndex);
|
131
|
+
}
|
132
|
+
else if (event.key === 'ArrowUp') {
|
133
|
+
event.preventDefault();
|
134
|
+
const prevIndex = (highlightedIndex - 1 + filteredList.length) % filteredList.length;
|
135
|
+
setHighlightedIndex(prevIndex);
|
136
|
+
}
|
137
|
+
};
|
138
|
+
const showClearSearchButton = !!clearSearch && (!!value || !!selectedValue || !!searchQuery);
|
139
|
+
return (React.createElement(Wrapper, { ref: wrapperRef },
|
140
|
+
React.createElement(Field, { className: className, renderAsTitle: renderAsTitle, htmlFor: id, ...otherProps },
|
141
|
+
React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "flex-start" },
|
142
|
+
showIcon && React.createElement(StyledFrontIcon, { render: "search", color: "sesame" }),
|
143
|
+
React.createElement(Input, { id: id, name: name, ref: ref, placeholder: placeholder, "$error": otherProps.error, "$frontIcon": showIcon ? 'search' : undefined, "$fallbackStyle": fallbackStyle, autoComplete: "off", value: displayedInputText, onFocus: handleClick, onChange: handleInputChange, selected: isSelected, onClick: handleClick, onKeyDown: handleKeyDown, onBlur: (e) => {
|
144
|
+
onBlur?.(e);
|
145
|
+
} }),
|
146
|
+
React.createElement(Icons, { flex: true, alignItems: "center", gap: "8px", "$clearSearch": showClearSearchButton },
|
147
|
+
showClearSearchButton && (React.createElement(IconStrict, { type: "button", render: "plus", rotate: 45, iconColor: "marzipan", handleClick: handleClearSearch, size: 24 })),
|
148
|
+
React.createElement(Line, null),
|
149
|
+
React.createElement(IconStrict, { type: "button", render: "caret", iconColor: "marzipan", rotate: showOptions ? 180 : 0, handleClick: handleCaretClick, size: 24 }))),
|
150
|
+
showOptions && (React.createElement(SearchOptions, { displayedList: filteredList, selectedValue: selectedValue, highlightedIndex: highlightedIndex, setHighlightedIndex: setHighlightedIndex, onKeyDown: handleKeyDown, searchTerm: searchQuery || '', onSelect: handleSelect, positionRelative: resultsRelativePosition, resultsBorder: resultsBorder, onNotFound: onNotFound, notFoundComponent: notFoundComponent && notFoundComponent(searchQuery ?? '') })))));
|
79
151
|
});
|
152
|
+
const Wrapper = styled(Box) `
|
153
|
+
position: relative;
|
154
|
+
`;
|
155
|
+
const Line = styled(Box) `
|
156
|
+
background: ${theme.colors.oatmeal};
|
157
|
+
height: 24px;
|
158
|
+
width: 1px;
|
159
|
+
`;
|
160
|
+
export const Icons = styled(Box) `
|
161
|
+
position: relative;
|
162
|
+
right: ${({ $clearSearch }) => ($clearSearch ? '80px' : '48px')};
|
163
|
+
margin-right: ${({ $clearSearch }) => ($clearSearch ? '-80px' : '-48px')};
|
164
|
+
`;
|
80
165
|
//# sourceMappingURL=SearchInput.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAsB,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,EAIZ,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAsB,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,EAIZ,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,MAAM,MAAM,mBA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AW,IAAI,EAAE,CAAC,GAE3D,CACH,CACK,CACA,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1B,CAAA;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBACR,KAAK,CAAC,MAAM,CAAC,OAAO;;;CAGnC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;WAEhD,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;kBAC/C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;CACzE,CAAA"}
|
@@ -5,7 +5,14 @@ type Option = {
|
|
5
5
|
};
|
6
6
|
type SearchOptionsProps = {
|
7
7
|
displayedList: Array<Option>;
|
8
|
+
selectedValue: string | null;
|
9
|
+
highlightedIndex: number;
|
10
|
+
setHighlightedIndex: (arg: number) => void;
|
8
11
|
onSelect: (option: Option) => void;
|
12
|
+
onKeyDown: (e: {
|
13
|
+
key: string;
|
14
|
+
preventDefault: () => void;
|
15
|
+
}) => void;
|
9
16
|
positionRelative: boolean;
|
10
17
|
resultsBorder: boolean;
|
11
18
|
onNotFound?: (searchTerm: string) => void;
|
@@ -1,19 +1,43 @@
|
|
1
|
-
import {
|
2
|
-
import React from 'react';
|
1
|
+
import React, { createRef, useEffect, useRef } from 'react';
|
3
2
|
import styled, { css } from 'styled-components';
|
4
3
|
import { Box } from '../../Box';
|
4
|
+
import { Icon } from '../../Icon';
|
5
5
|
import { theme } from '../../theme';
|
6
6
|
import { EmptyResults } from './EmptyResults';
|
7
|
-
export const SearchOptions = ({ displayedList, onSelect, positionRelative, resultsBorder, onNotFound, searchTerm, notFoundComponent, }) => {
|
7
|
+
export const SearchOptions = ({ displayedList, selectedValue, highlightedIndex, setHighlightedIndex, onSelect, onKeyDown, positionRelative, resultsBorder, onNotFound, searchTerm, notFoundComponent, }) => {
|
8
|
+
const itemRefs = useRef([]);
|
9
|
+
useEffect(() => {
|
10
|
+
itemRefs.current = displayedList.map((_, i) => itemRefs.current[i] ?? createRef());
|
11
|
+
}, [displayedList.length]);
|
12
|
+
useEffect(() => {
|
13
|
+
const focusedListItem = itemRefs?.current[highlightedIndex]?.current;
|
14
|
+
if (highlightedIndex >= 0 && focusedListItem) {
|
15
|
+
focusedListItem.scrollIntoView({
|
16
|
+
block: 'nearest',
|
17
|
+
inline: 'start',
|
18
|
+
});
|
19
|
+
}
|
20
|
+
}, [highlightedIndex]);
|
8
21
|
return (React.createElement(BoxWithPositionRelative, null,
|
9
22
|
React.createElement(StyledResultsContainer, { "$positionRelative": positionRelative },
|
10
|
-
React.createElement(ResultsList, { "$resultsBorder": resultsBorder }, displayedList.length ? (displayedList.map((el, i) =>
|
23
|
+
React.createElement(ResultsList, { "$resultsBorder": resultsBorder, onKeyDown: onKeyDown }, displayedList.length ? (displayedList.map((el, i) => {
|
24
|
+
const isSelected = selectedValue === el.label || selectedValue === el.value;
|
25
|
+
return (React.createElement(ListButton, { key: el.label + '_list_item', "aria-label": el.label + '_list_item', ref: itemRefs.current[i], onClick: () => onSelect(el), "$isSelected": isSelected, "$showBg": highlightedIndex === i, onMouseEnter: () => {
|
26
|
+
setHighlightedIndex(i);
|
27
|
+
}, onFocus: () => {
|
28
|
+
setHighlightedIndex(i);
|
29
|
+
} },
|
30
|
+
el.label,
|
31
|
+
isSelected && (React.createElement(Icon, { render: "tick", size: 16, color: "marshmallowPink" }))));
|
32
|
+
})) : (React.createElement(EmptyResults, { onNotFound: onNotFound, searchTerm: searchTerm, notFoundComponent: notFoundComponent }))))));
|
11
33
|
};
|
12
34
|
const StyledResultsContainer = styled.div `
|
13
35
|
box-sizing: border-box;
|
14
|
-
overflow
|
36
|
+
overflow: hidden;
|
37
|
+
margin: -16px;
|
38
|
+
padding: 16px;
|
15
39
|
${({ $positionRelative }) => !$positionRelative && 'position: absolute;'}
|
16
|
-
width:
|
40
|
+
width: calc(100% + 32px);
|
17
41
|
left: 0px;
|
18
42
|
top: -8px;
|
19
43
|
|
@@ -27,14 +51,15 @@ const ResultsList = styled.ul `
|
|
27
51
|
overflow-y: auto;
|
28
52
|
padding: 0;
|
29
53
|
margin: 0;
|
30
|
-
background-color: ${theme.colors.
|
54
|
+
background-color: ${theme.colors.cream};
|
31
55
|
border-radius: 12px;
|
32
56
|
margin-top: 14px;
|
33
57
|
z-index: 1000;
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
58
|
+
border: 1px solid ${theme.colors.oatmeal};
|
59
|
+
box-shadow:
|
60
|
+
0px 10px 18px rgba(18, 18, 23, 0.03),
|
61
|
+
0px 5px 8px rgba(18, 18, 23, 0.04),
|
62
|
+
0px 2px 4px rgba(18, 18, 23, 0.04);
|
38
63
|
|
39
64
|
li {
|
40
65
|
padding: 16px 14px;
|
@@ -42,17 +67,28 @@ const ResultsList = styled.ul `
|
|
42
67
|
font-size: 16px;
|
43
68
|
color: ${theme.colors.liquorice};
|
44
69
|
cursor: pointer;
|
70
|
+
}
|
71
|
+
`;
|
72
|
+
const ListButton = styled.li `
|
73
|
+
display: flex;
|
74
|
+
justify-content: space-between;
|
45
75
|
|
46
|
-
|
76
|
+
&:focus {
|
77
|
+
outline: none;
|
78
|
+
}
|
79
|
+
&:focus-visible {
|
80
|
+
outline: none;
|
81
|
+
}
|
47
82
|
|
48
|
-
|
49
|
-
|
50
|
-
|
83
|
+
${({ $showBg }) => $showBg &&
|
84
|
+
css `
|
85
|
+
background-color: ${theme.colors.mascarpone};
|
86
|
+
`}
|
51
87
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
88
|
+
${({ $isSelected }) => $isSelected &&
|
89
|
+
css `
|
90
|
+
background-color: ${theme.colors.custard};
|
91
|
+
`}
|
56
92
|
`;
|
57
93
|
const BoxWithPositionRelative = styled(Box) `
|
58
94
|
position: relative;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchOptions.js","sourceRoot":"","sources":["../../../src/SearchInput/components/SearchOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"SearchOptions.js","sourceRoot":"","sources":["../../../src/SearchInput/components/SearchOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAqB7C,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,UAAU,EACV,iBAAiB,GAClB,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,MAAM,CAAmC,EAAE,CAAC,CAAA;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,OAAO,GAAG,aAAa,CAAC,GAAG,CAClC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,SAAS,EAAiB,CAC5D,CAAA;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;IAE1B,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,QAAQ,EAAE,OAAO,CAA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ACF,oBAAC,YAAY,IACX,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CACW,CACS,CACD,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAExC;;;;;IAKG,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC,iBAAiB,IAAI,qBAAqB;;;;;;;;CAQzE,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAE5B;;;;;;sBAMqB,KAAK,CAAC,MAAM,CAAC,KAAK;;;;sBAIlB,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;;;;;;aAU7B,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGlC,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAA4C;;;;;;;;;;;IAWpE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAChB,OAAO;IACP,GAAG,CAAA;0BACmB,KAAK,CAAC,MAAM,CAAC,UAAU;KAC5C;;IAED,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CACpB,WAAW;IACX,GAAG,CAAA;0BACmB,KAAK,CAAC,MAAM,CAAC,OAAO;KACzC;CACJ,CAAA;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1C,CAAA"}
|
package/dist/Table/Table.d.ts
CHANGED
@@ -13,4 +13,4 @@ import { TableProps } from './types';
|
|
13
13
|
* ## Improvements:
|
14
14
|
* - It would be nice if we expandable logic inside this component, e.g the presence of certain props would automatically add this
|
15
15
|
*/
|
16
|
-
export declare const Table: <T extends object>({ columns, data, fixedHeader, hasKeyline, expandable, subTable, subRows, headerHeight, headerColor, rowColor, stripedColor, rowBorderColor, rowActions, clickableRow, rowPadding, columnPadding, noDataContent, }: TableProps<T>) => React.JSX.Element;
|
16
|
+
export declare const Table: <T extends object>({ columns, data, fixedHeader, hasKeyline, expandable, subTable, subRows, headerHeight, headerColor, rowColor, stripedColor, rowBorderColor, rowActions, clickableRow, rowPadding, columnPadding, noDataContent, hideTableHeader, }: TableProps<T>) => React.JSX.Element;
|
package/dist/Table/Table.js
CHANGED
@@ -16,12 +16,12 @@ import { StyledCell, StyledTable } from './components/commonComponents';
|
|
16
16
|
* ## Improvements:
|
17
17
|
* - It would be nice if we expandable logic inside this component, e.g the presence of certain props would automatically add this
|
18
18
|
*/
|
19
|
-
export const Table = ({ columns, data, fixedHeader = true, hasKeyline = false, expandable, subTable, subRows, headerHeight, headerColor = 'mascarpone', rowColor = 'custard', stripedColor, rowBorderColor = 'oatmeal', rowActions, clickableRow, rowPadding, columnPadding, noDataContent, }) => {
|
19
|
+
export const Table = ({ columns, data, fixedHeader = true, hasKeyline = false, expandable, subTable, subRows, headerHeight, headerColor = 'mascarpone', rowColor = 'custard', stripedColor, rowBorderColor = 'oatmeal', rowActions, clickableRow, rowPadding, columnPadding, noDataContent, hideTableHeader = false, }) => {
|
20
20
|
const showActionsCell = expandable || rowActions;
|
21
21
|
const expandSubProp = showActionsCell ? columns.length + 1 : columns.length;
|
22
22
|
return (React.createElement(StyledTable, null,
|
23
|
-
React.createElement("thead", null,
|
24
|
-
React.createElement(TableHeader, { columns: columns, fixedHeader: fixedHeader, headerHeight: headerHeight, subTable: subTable, headerColor: headerColor, rowActions: rowActions, columnPadding: columnPadding, expandable: expandable, hasKeyline: hasKeyline })),
|
23
|
+
!hideTableHeader && (React.createElement("thead", null,
|
24
|
+
React.createElement(TableHeader, { columns: columns, fixedHeader: fixedHeader, headerHeight: headerHeight, subTable: subTable, headerColor: headerColor, rowActions: rowActions, columnPadding: columnPadding, expandable: expandable, hasKeyline: hasKeyline }))),
|
25
25
|
React.createElement("tbody", null,
|
26
26
|
data.length === 0 && (React.createElement(StyledCell, { colSpan: expandSubProp, "$rowPadding": rowPadding, "$columnPadding": columnPadding }, noDataContent ? (noDataContent) : (React.createElement(Text, { align: "center" }, "No available data")))),
|
27
27
|
data.length !== 0 &&
|
package/dist/Table/Table.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAGvE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAmB,EACtC,OAAO,EACP,IAAI,EACJ,WAAW,GAAG,IAAI,EAClB,UAAU,GAAG,KAAK,EAClB,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,WAAW,GAAG,YAAY,EAC1B,QAAQ,GAAG,SAAS,EACpB,YAAY,EACZ,cAAc,GAAG,SAAS,EAC1B,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,aAAa,
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAGvE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAmB,EACtC,OAAO,EACP,IAAI,EACJ,WAAW,GAAG,IAAI,EAClB,UAAU,GAAG,KAAK,EAClB,UAAU,EACV,QAAQ,EACR,OAAO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B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC,CACE,CACI,CACf,CAAA;AACH,CAAC,CAAA"}
|
package/dist/Table/types.d.ts
CHANGED
@@ -84,6 +84,8 @@ interface CommonTableProps<T> {
|
|
84
84
|
rowPadding?: string;
|
85
85
|
/** The X padding for each row. */
|
86
86
|
columnPadding?: string;
|
87
|
+
/** Hides the table header. Table defaults to always showing the header. */
|
88
|
+
hideTableHeader?: boolean;
|
87
89
|
}
|
88
90
|
export interface TableProps<T> extends CommonTableProps<T> {
|
89
91
|
/** Array of data to be displayed in the table. */
|
@@ -20,7 +20,7 @@ const StyledTextArea = styled.textarea `
|
|
20
20
|
box-sizing: border-box;
|
21
21
|
border-radius: 12px;
|
22
22
|
width: 100%;
|
23
|
-
padding:
|
23
|
+
padding: 18px 14px;
|
24
24
|
color: ${theme.colors.liquorice};
|
25
25
|
resize: ${({ $resize }) => $resize};
|
26
26
|
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'text')};
|
@@ -9,7 +9,7 @@ export const Input = styled.input `
|
|
9
9
|
outline: none;
|
10
10
|
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'initial')};
|
11
11
|
opacity: ${({ disabled }) => (disabled ? '0.5' : '1')};
|
12
|
-
padding:
|
12
|
+
padding: 18px 14px;
|
13
13
|
background-color: ${({ $fallbackStyle }) => $fallbackStyle ? theme.colors.custard : theme.colors.cream};
|
14
14
|
border: 2px solid
|
15
15
|
${({ $error }) => ($error ? theme.colors.strawberry : theme.colors.oatmeal)};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,GAAG,EACH,QAAQ,GAIT,EAAE,EAAE;IACH,MAAM,sBAAsB,GAAG,WAAW,CACxC,CAAC,KAAiB,EAAE,EAAE;QACpB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;YACvE,OAAM;QACR,CAAC;QAED,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC,EAED,CAAC,GAAG,EAAE,QAAQ,CAAC,CAChB,CAAA;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEzC,gBAAgB,CAAC;QACf,SAAS,EAAE,OAAO;QAClB,GAAG,EAAE,WAAW;QAChB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;IAEF,gBAAgB,CAAC;QACf,SAAS,EAAE,UAAU;QACrB,GAAG,EAAE,WAAW;QAChB,QAAQ,EAAE,sBAAsB;QAChC,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mrshmllw/smores-react",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.7.0",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"keywords": [
|
@@ -36,7 +36,7 @@
|
|
36
36
|
"devDependencies": {
|
37
37
|
"@babel/core": "^7.20.12",
|
38
38
|
"@babel/eslint-parser": "^7.23.10",
|
39
|
-
"@babel/plugin-
|
39
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
40
40
|
"@babel/preset-env": "^7.20.2",
|
41
41
|
"@babel/preset-react": "^7.18.6",
|
42
42
|
"@babel/preset-typescript": "^7.18.6",
|
@@ -63,9 +63,8 @@
|
|
63
63
|
"@types/node": "^20.1.2",
|
64
64
|
"@types/react": "^18.0.24",
|
65
65
|
"@types/react-dom": "^18.0.8",
|
66
|
-
"@
|
67
|
-
"@typescript-eslint/
|
68
|
-
"@typescript-eslint/parser": "^6.2.0",
|
66
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
67
|
+
"@typescript-eslint/parser": "^7.10.0",
|
69
68
|
"axe-playwright": "^2.0.1",
|
70
69
|
"conventional-changelog-conventionalcommits": "^7.0.2",
|
71
70
|
"eslint": "^8.57.0",
|