@mrshmllw/smores-react 16.13.1 → 16.15.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/ActionDropdown/ActionDropdown.js +54 -20
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/Icon/iconFiles/Braze.d.ts +2 -0
- package/dist/Icon/iconFiles/Braze.js +4 -0
- package/dist/Icon/iconFiles/Braze.js.map +1 -0
- package/dist/Icon/iconFiles/Verified.d.ts +2 -0
- package/dist/Icon/iconFiles/Verified.js +4 -0
- package/dist/Icon/iconFiles/Verified.js.map +1 -0
- package/dist/Icon/iconsList.d.ts +4 -0
- package/dist/Icon/iconsList.js +4 -0
- package/dist/Icon/iconsList.js.map +1 -1
- package/dist/SearchInput/SearchInput.js +4 -2
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/components/SearchOptions.d.ts +5 -0
- package/dist/SearchInput/components/SearchOptions.js +94 -18
- package/dist/SearchInput/components/SearchOptions.js.map +1 -1
- package/dist/utils/storybookHelpers/ScrollingModal.d.ts +18 -0
- package/dist/utils/storybookHelpers/ScrollingModal.js +28 -0
- package/dist/utils/storybookHelpers/ScrollingModal.js.map +1 -0
- package/package.json +22 -22
|
@@ -8,8 +8,11 @@ import { resolveToThemeColor } from '../ThemeProvider/utils/colourMap';
|
|
|
8
8
|
import { faChevronDown } from '@awesome.me/kit-46ca99185c/icons/classic/solid';
|
|
9
9
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
10
10
|
import { IconContainer } from '../sharedStyles/shared.styles';
|
|
11
|
-
import { FloatingFocusManager, useClick, useDismiss, useFloating, useInteractions, useListNavigation, useRole, } from '@floating-ui/react';
|
|
11
|
+
import { autoUpdate, flip, FloatingFocusManager, offset, shift, size, useClick, useDismiss, useFloating, useInteractions, useListNavigation, useRole, } from '@floating-ui/react';
|
|
12
12
|
import { focusOutlineStyle } from '../utils/focusOutline';
|
|
13
|
+
// The gap between the menu and the edge of the viewport
|
|
14
|
+
const VIEWPORT_PADDING = 8;
|
|
15
|
+
const MENU_MAX_HEIGHT = 192;
|
|
13
16
|
export const ActionDropdown = ({ id: idProp, className = '', label, value, list, onSelect, ...marginProps }) => {
|
|
14
17
|
const [open, setOpen] = useState(false);
|
|
15
18
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
@@ -20,16 +23,43 @@ export const ActionDropdown = ({ id: idProp, className = '', label, value, list,
|
|
|
20
23
|
const theme = useTheme();
|
|
21
24
|
const resolvedBgColor = resolveToThemeColor(value.bgColor ?? 'color.background.100', theme);
|
|
22
25
|
const resolvedTextColor = resolveToThemeColor(value.textColor ?? 'color.text.base', theme);
|
|
23
|
-
const { refs, context } = useFloating({
|
|
26
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
24
27
|
open,
|
|
25
28
|
onOpenChange: (nextOpen) => {
|
|
26
29
|
setOpen(nextOpen);
|
|
27
30
|
if (!nextOpen)
|
|
28
31
|
setActiveIndex(null);
|
|
29
32
|
},
|
|
33
|
+
// `position: fixed` lets the menu escape a scrolling or overflow hidden
|
|
34
|
+
// parent such as a Modal. It stays in the DOM next to the trigger rather
|
|
35
|
+
// than in a portal, so it remains inside the Modal's focus trap and Escape
|
|
36
|
+
// handling.
|
|
37
|
+
strategy: 'fixed',
|
|
38
|
+
placement: 'bottom-start',
|
|
39
|
+
middleware: [
|
|
40
|
+
offset(parseInt(theme.space[100])),
|
|
41
|
+
flip({ padding: VIEWPORT_PADDING }),
|
|
42
|
+
shift({ padding: VIEWPORT_PADDING }),
|
|
43
|
+
size({
|
|
44
|
+
padding: VIEWPORT_PADDING,
|
|
45
|
+
apply({ rects, availableHeight, elements }) {
|
|
46
|
+
Object.assign(elements.floating.style, {
|
|
47
|
+
width: `${rects.reference.width}px`,
|
|
48
|
+
maxHeight: `${Math.min(MENU_MAX_HEIGHT, availableHeight)}px`,
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
whileElementsMounted: autoUpdate,
|
|
30
54
|
});
|
|
31
55
|
const click = useClick(context);
|
|
32
|
-
|
|
56
|
+
// Escape is handled below, so it can stop the keypress reaching a
|
|
57
|
+
// surrounding Modal, which would otherwise close as well. The menu closes
|
|
58
|
+
// when a parent scrolls, so it doesn't come loose from the trigger.
|
|
59
|
+
const dismiss = useDismiss(context, {
|
|
60
|
+
escapeKey: false,
|
|
61
|
+
ancestorScroll: true,
|
|
62
|
+
});
|
|
33
63
|
const role = useRole(context, { role: 'listbox' });
|
|
34
64
|
const listNavigation = useListNavigation(context, {
|
|
35
65
|
listRef,
|
|
@@ -44,19 +74,28 @@ export const ActionDropdown = ({ id: idProp, className = '', label, value, list,
|
|
|
44
74
|
setOpen(false);
|
|
45
75
|
setActiveIndex(null);
|
|
46
76
|
};
|
|
77
|
+
const closeOnEscape = (event) => {
|
|
78
|
+
if (event.key !== 'Escape' || !open)
|
|
79
|
+
return;
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
setOpen(false);
|
|
83
|
+
setActiveIndex(null);
|
|
84
|
+
};
|
|
47
85
|
const handleListKeyDown = (event) => {
|
|
86
|
+
closeOnEscape(event);
|
|
48
87
|
if ((event.key === 'Enter' || event.key === ' ') && activeIndex !== null) {
|
|
49
88
|
event.preventDefault();
|
|
50
89
|
selectOption(list[activeIndex]);
|
|
51
90
|
}
|
|
52
91
|
};
|
|
53
|
-
return (_jsxs(Container, { id: idProp, className: className, ...marginProps, children: [label && (_jsx(Text, { tag: "label", htmlFor: buttonId, color: "sesame", typo: "label", children: label })), _jsxs(Label, { ref: refs.setReference, id: buttonId, type: "button", "aria-label": label ? undefined : 'Select an option', $text: resolvedTextColor, $bg: resolvedBgColor, ...getReferenceProps(), children: [_jsx(SelectedOption, { children: value.label }), _jsx(IconContainer, { $size: 20, style: {
|
|
92
|
+
return (_jsxs(Container, { id: idProp, className: className, ...marginProps, children: [label && (_jsx(Text, { tag: "label", htmlFor: buttonId, color: "sesame", typo: "label", children: label })), _jsxs(Label, { ref: refs.setReference, id: buttonId, type: "button", "aria-label": label ? undefined : 'Select an option', $text: resolvedTextColor, $bg: resolvedBgColor, ...getReferenceProps({ onKeyDown: closeOnEscape }), children: [_jsx(SelectedOption, { children: value.label }), _jsx(IconContainer, { $size: 20, style: {
|
|
54
93
|
rotate: open ? '180deg' : '0deg',
|
|
55
|
-
}, children: _jsx(FontAwesomeIcon, { icon: faChevronDown, color: resolvedTextColor }) })] }),
|
|
94
|
+
}, children: _jsx(FontAwesomeIcon, { icon: faChevronDown, color: resolvedTextColor }) })] }), open && (_jsx(FloatingFocusManager, { context: context, modal: false, returnFocus: true, children: _jsx(Menu
|
|
95
|
+
// oxlint-disable-next-line react/react-compiler
|
|
96
|
+
, {
|
|
56
97
|
// oxlint-disable-next-line react/react-compiler
|
|
57
|
-
, {
|
|
58
|
-
// oxlint-disable-next-line react/react-compiler
|
|
59
|
-
ref: refs.setFloating, ...getFloatingProps({ onKeyDown: handleListKeyDown }), children: _jsx(ListItems, { options: list, selectedValue: value.value, activeIndex: activeIndex, listRef: listRef, getItemProps: getItemProps, onSelect: selectOption }) }) })) })] }));
|
|
98
|
+
ref: refs.setFloating, style: floatingStyles, ...getFloatingProps({ onKeyDown: handleListKeyDown }), children: _jsx(ListItems, { options: list, selectedValue: value.value, activeIndex: activeIndex, listRef: listRef, getItemProps: getItemProps, onSelect: selectOption }) }) }))] }));
|
|
60
99
|
};
|
|
61
100
|
const Label = styled.button(({ $text, $bg }) => css `
|
|
62
101
|
color: ${$text};
|
|
@@ -91,16 +130,11 @@ const Container = styled(Box) `
|
|
|
91
130
|
text-align: center;
|
|
92
131
|
border-radius: 8px;
|
|
93
132
|
`;
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
background-color: ${({ theme }) => theme.color.surface.base[300]};
|
|
102
|
-
overflow-y: ${open ? 'auto' : 'hidden'};
|
|
103
|
-
z-index: 4;
|
|
104
|
-
transition: all 0.2s ease-in-out;
|
|
105
|
-
`);
|
|
133
|
+
const Menu = styled(ListContainer) `
|
|
134
|
+
border-radius: 12px;
|
|
135
|
+
background-color: ${({ theme }) => theme.color.surface.base[300]};
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
/* Matches the SearchInput results and Tooltip */
|
|
138
|
+
z-index: 1000;
|
|
139
|
+
`;
|
|
106
140
|
//# sourceMappingURL=ActionDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDropdown.js","sourceRoot":"","sources":["../../src/ActionDropdown/ActionDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAkB,aAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAezD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EACtD,EAAE,EAAE,MAAM,EACV,SAAS,GAA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AAG,CAAA;;;;kBAID,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;eAClC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;kBACpB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;wBACjB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;kBAClD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;;;GAGvC,CACF,CAAA","sourcesContent":["import { FC, KeyboardEvent, useId, useRef, useState } from 'react'\nimport styled, { css, useTheme } from 'styled-components'\n\nimport { Box } from '../Box'\nimport { Text } from '../Text'\nimport { ActionListItem, ListContainer, ListItems } from './List'\n\nimport { MarginProps } from '../utils/space'\nimport { resolveToThemeColor } from '../ThemeProvider/utils/colourMap'\nimport { faChevronDown } from '@awesome.me/kit-46ca99185c/icons/classic/solid'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { IconContainer } from '../sharedStyles/shared.styles'\nimport {\n FloatingFocusManager,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListNavigation,\n useRole,\n} from '@floating-ui/react'\nimport { focusOutlineStyle } from '../utils/focusOutline'\n\nexport type ActionDropdownProps = {\n id?: string\n className?: string\n /** label displayed above the dropdown */\n label?: string\n /** value */\n value: ActionListItem\n /** list of items for the dropdown list */\n list: ActionListItem[]\n /** onSelect handler */\n onSelect: (action: ActionListItem) => void\n} & MarginProps\n\nexport const ActionDropdown: FC<ActionDropdownProps> = ({\n id: idProp,\n className = '',\n label,\n value,\n list,\n onSelect,\n ...marginProps\n}) => {\n const [open, setOpen] = useState(false)\n const [activeIndex, setActiveIndex] = useState<number | null>(null)\n const listRef = useRef<Array<HTMLElement | null>>([])\n\n const generatedId = useId()\n const id = idProp ?? generatedId\n const buttonId = `${id}-button`\n\n const theme = useTheme()\n\n const resolvedBgColor = resolveToThemeColor(\n value.bgColor ?? 'color.background.100',\n theme,\n )\n const resolvedTextColor = resolveToThemeColor(\n value.textColor ?? 'color.text.base',\n theme,\n )\n\n const { refs, context } = useFloating({\n open,\n onOpenChange: (nextOpen) => {\n setOpen(nextOpen)\n if (!nextOpen) setActiveIndex(null)\n },\n })\n\n const click = useClick(context)\n const dismiss = useDismiss(context)\n const role = useRole(context, { role: 'listbox' })\n const listNavigation = useListNavigation(context, {\n listRef,\n activeIndex,\n selectedIndex: list.findIndex((item) => item.value === value.value),\n onNavigate: setActiveIndex,\n loop: true,\n })\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [click, dismiss, role, listNavigation],\n )\n\n const selectOption = (option: ActionListItem) => {\n onSelect(option)\n setOpen(false)\n setActiveIndex(null)\n }\n\n const handleListKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if ((event.key === 'Enter' || event.key === ' ') && activeIndex !== null) {\n event.preventDefault()\n selectOption(list[activeIndex])\n }\n }\n\n return (\n <Container id={idProp} className={className} {...marginProps}>\n {label && (\n <Text tag=\"label\" htmlFor={buttonId} color=\"sesame\" typo=\"label\">\n {label}\n </Text>\n )}\n\n <Label\n ref={refs.setReference}\n id={buttonId}\n type=\"button\"\n aria-label={label ? undefined : 'Select an option'}\n $text={resolvedTextColor}\n $bg={resolvedBgColor}\n {...getReferenceProps()}\n >\n <SelectedOption>{value.label}</SelectedOption>\n <IconContainer\n $size={20}\n style={{\n rotate: open ? '180deg' : '0deg',\n }}\n >\n <FontAwesomeIcon icon={faChevronDown} color={resolvedTextColor} />\n </IconContainer>\n </Label>\n <OuterContainer open={open}>\n {open && (\n <FloatingFocusManager context={context} modal={false} returnFocus>\n <ListContainer\n // oxlint-disable-next-line react/react-compiler\n ref={refs.setFloating}\n {...getFloatingProps({ onKeyDown: handleListKeyDown })}\n >\n <ListItems\n options={list}\n selectedValue={value.value}\n activeIndex={activeIndex}\n listRef={listRef}\n getItemProps={getItemProps}\n onSelect={selectOption}\n />\n </ListContainer>\n </FloatingFocusManager>\n )}\n </OuterContainer>\n </Container>\n )\n}\n\ninterface ISelected {\n $text: string\n $bg: string\n}\n\nconst Label = styled.button<ISelected>(\n ({ $text, $bg }) => css`\n color: ${$text};\n background-color: ${$bg};\n position: relative;\n width: 100%;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: center;\n border: 0;\n border-radius: 100px;\n padding: 16px 16px 14px;\n box-sizing: border-box;\n font: inherit;\n cursor: pointer;\n user-select: none;\n ${focusOutlineStyle}\n `,\n)\n\nconst SelectedOption = styled.span`\n font-size: 14px;\n font-weight: bold;\n white-space: nowrap;\n text-overflow: ellipsis;\n`\n\nconst Container = styled(Box)`\n position: relative;\n display: block;\n width: 210px;\n height: 48px;\n text-align: center;\n border-radius: 8px;\n`\n\ninterface IOpen {\n open: boolean\n}\n\nconst OuterContainer = styled.div<IOpen>(\n ({ open }) => css`\n position: absolute;\n width: 100%;\n border-radius: 12px;\n margin-top: ${({ theme }) => theme.space[100]};\n display: ${open ? 'block' : 'none'};\n max-height: ${open ? '235px' : '48px'};\n background-color: ${({ theme }) => theme.color.surface.base[300]};\n overflow-y: ${open ? 'auto' : 'hidden'};\n z-index: 4;\n transition: all 0.2s ease-in-out;\n `,\n)\n"]}
|
|
1
|
+
{"version":3,"file":"ActionDropdown.js","sourceRoot":"","sources":["../../src/ActionDropdown/ActionDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAkB,aAAa,EAAE,SAA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B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,GACtB,GACG,GACc,CACxB,IACS,CACb,CAAA;AACH,CAAC,CAAA;AAOD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CACzB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;aACZ,KAAK;wBACM,GAAG;;;;;;;;;;;;;;;MAerB,iBAAiB;GACpB,CACF,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;CAKjC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;CAO5B,CAAA;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;sBAEZ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;;;;CAIjE,CAAA","sourcesContent":["import { FC, KeyboardEvent, useId, useRef, useState } from 'react'\nimport styled, { css, useTheme } from 'styled-components'\n\nimport { Box } from '../Box'\nimport { Text } from '../Text'\nimport { ActionListItem, ListContainer, ListItems } from './List'\n\nimport { MarginProps } from '../utils/space'\nimport { resolveToThemeColor } from '../ThemeProvider/utils/colourMap'\nimport { faChevronDown } from '@awesome.me/kit-46ca99185c/icons/classic/solid'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { IconContainer } from '../sharedStyles/shared.styles'\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n offset,\n shift,\n size,\n useClick,\n useDismiss,\n useFloating,\n useInteractions,\n useListNavigation,\n useRole,\n} from '@floating-ui/react'\nimport { focusOutlineStyle } from '../utils/focusOutline'\n\n// The gap between the menu and the edge of the viewport\nconst VIEWPORT_PADDING = 8\nconst MENU_MAX_HEIGHT = 192\n\nexport type ActionDropdownProps = {\n id?: string\n className?: string\n /** label displayed above the dropdown */\n label?: string\n /** value */\n value: ActionListItem\n /** list of items for the dropdown list */\n list: ActionListItem[]\n /** onSelect handler */\n onSelect: (action: ActionListItem) => void\n} & MarginProps\n\nexport const ActionDropdown: FC<ActionDropdownProps> = ({\n id: idProp,\n className = '',\n label,\n value,\n list,\n onSelect,\n ...marginProps\n}) => {\n const [open, setOpen] = useState(false)\n const [activeIndex, setActiveIndex] = useState<number | null>(null)\n const listRef = useRef<Array<HTMLElement | null>>([])\n\n const generatedId = useId()\n const id = idProp ?? generatedId\n const buttonId = `${id}-button`\n\n const theme = useTheme()\n\n const resolvedBgColor = resolveToThemeColor(\n value.bgColor ?? 'color.background.100',\n theme,\n )\n const resolvedTextColor = resolveToThemeColor(\n value.textColor ?? 'color.text.base',\n theme,\n )\n\n const { refs, floatingStyles, context } = useFloating({\n open,\n onOpenChange: (nextOpen) => {\n setOpen(nextOpen)\n if (!nextOpen) setActiveIndex(null)\n },\n // `position: fixed` lets the menu escape a scrolling or overflow hidden\n // parent such as a Modal. It stays in the DOM next to the trigger rather\n // than in a portal, so it remains inside the Modal's focus trap and Escape\n // handling.\n strategy: 'fixed',\n placement: 'bottom-start',\n middleware: [\n offset(parseInt(theme.space[100])),\n flip({ padding: VIEWPORT_PADDING }),\n shift({ padding: VIEWPORT_PADDING }),\n size({\n padding: VIEWPORT_PADDING,\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n width: `${rects.reference.width}px`,\n maxHeight: `${Math.min(MENU_MAX_HEIGHT, availableHeight)}px`,\n })\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n })\n\n const click = useClick(context)\n // Escape is handled below, so it can stop the keypress reaching a\n // surrounding Modal, which would otherwise close as well. The menu closes\n // when a parent scrolls, so it doesn't come loose from the trigger.\n const dismiss = useDismiss(context, {\n escapeKey: false,\n ancestorScroll: true,\n })\n const role = useRole(context, { role: 'listbox' })\n const listNavigation = useListNavigation(context, {\n listRef,\n activeIndex,\n selectedIndex: list.findIndex((item) => item.value === value.value),\n onNavigate: setActiveIndex,\n loop: true,\n })\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [click, dismiss, role, listNavigation],\n )\n\n const selectOption = (option: ActionListItem) => {\n onSelect(option)\n setOpen(false)\n setActiveIndex(null)\n }\n\n const closeOnEscape = (event: KeyboardEvent<HTMLElement>) => {\n if (event.key !== 'Escape' || !open) return\n event.preventDefault()\n event.stopPropagation()\n setOpen(false)\n setActiveIndex(null)\n }\n\n const handleListKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n closeOnEscape(event)\n if ((event.key === 'Enter' || event.key === ' ') && activeIndex !== null) {\n event.preventDefault()\n selectOption(list[activeIndex])\n }\n }\n\n return (\n <Container id={idProp} className={className} {...marginProps}>\n {label && (\n <Text tag=\"label\" htmlFor={buttonId} color=\"sesame\" typo=\"label\">\n {label}\n </Text>\n )}\n\n <Label\n ref={refs.setReference}\n id={buttonId}\n type=\"button\"\n aria-label={label ? undefined : 'Select an option'}\n $text={resolvedTextColor}\n $bg={resolvedBgColor}\n {...getReferenceProps({ onKeyDown: closeOnEscape })}\n >\n <SelectedOption>{value.label}</SelectedOption>\n <IconContainer\n $size={20}\n style={{\n rotate: open ? '180deg' : '0deg',\n }}\n >\n <FontAwesomeIcon icon={faChevronDown} color={resolvedTextColor} />\n </IconContainer>\n </Label>\n {open && (\n <FloatingFocusManager context={context} modal={false} returnFocus>\n <Menu\n // oxlint-disable-next-line react/react-compiler\n ref={refs.setFloating}\n style={floatingStyles}\n {...getFloatingProps({ onKeyDown: handleListKeyDown })}\n >\n <ListItems\n options={list}\n selectedValue={value.value}\n activeIndex={activeIndex}\n listRef={listRef}\n getItemProps={getItemProps}\n onSelect={selectOption}\n />\n </Menu>\n </FloatingFocusManager>\n )}\n </Container>\n )\n}\n\ninterface ISelected {\n $text: string\n $bg: string\n}\n\nconst Label = styled.button<ISelected>(\n ({ $text, $bg }) => css`\n color: ${$text};\n background-color: ${$bg};\n position: relative;\n width: 100%;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n text-align: center;\n border: 0;\n border-radius: 100px;\n padding: 16px 16px 14px;\n box-sizing: border-box;\n font: inherit;\n cursor: pointer;\n user-select: none;\n ${focusOutlineStyle}\n `,\n)\n\nconst SelectedOption = styled.span`\n font-size: 14px;\n font-weight: bold;\n white-space: nowrap;\n text-overflow: ellipsis;\n`\n\nconst Container = styled(Box)`\n position: relative;\n display: block;\n width: 210px;\n height: 48px;\n text-align: center;\n border-radius: 8px;\n`\n\nconst Menu = styled(ListContainer)`\n border-radius: 12px;\n background-color: ${({ theme }) => theme.color.surface.base[300]};\n overflow-y: auto;\n /* Matches the SearchInput results and Tooltip */\n z-index: 1000;\n`\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const Braze = () => (_jsxs("svg", { width: "100%", height: "100%", viewBox: "3.156 2.869 29.072 29.072", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "m17.6919 5.32469c-6.6717 0-12.0803 5.40851-12.0803 12.08031s5.4086 12.0804 12.0803 12.0804c6.6718 0 12.0804-5.4086 12.0804-12.0804s-5.4086-12.08031-12.0804-12.08031zm-14.53614 12.08031c0-8.02808 6.50807-14.53615 14.53614-14.53615 8.0282 0 14.5362 6.50807 14.5362 14.53615 0 8.0281-6.508 14.5362-14.5362 14.5362-8.02807 0-14.53614-6.5081-14.53614-14.5362z", fill: "currentColor" }), _jsx("path", { d: "m18.7692 26.4679c2.5469-.2828 4.0925-2.627 4.7477-3.8382.6433-1.2208 1.0093-2.5232 1.1558-3.7868.0515-.3826.08-.7217.088-1.037.0261-1.0092-.1276-1.8728-.469-2.642-.7407-1.666-2.0439-2.539-3.8739-2.5945-.9039-.0277-1.7983.1719-2.5977.576.1965-.7772.7582-3.0952 1.0663-5.3696.0476-.34936-.0467-.68446-.2638-.94351-.2154-.25826-.5268-.40799-.8761-.42304-.6473-.02931-1.1923.43334-1.2755 1.07265-.4642 3.5879-1.5694 8.2263-2.7497 11.5424-.6132 1.7231-1.7706 3.1475-3.3463 4.1187-.0563.0349-.1363.0776-.2369.1283-.5775.2908-.84527.9634-.62187 1.5639.12359.3327.38343.5989.71377.7312.3304.1315.7019.118 1.0204-.0381.9847-.4816 1.8569-1.1201 2.5937-1.8981.915 1.9774 2.4407 3.1126 4.9243 2.8369zm-2.0201-3.0864c-.4381-.4247-.6988-.9919-.7748-1.6843-.2123-1.9187.3533-3.6869 1.6819-5.2555.3422-.404.7367-.7288 1.1724-.9649.3858-.2091.7946-.3097 1.1875-.3097.694 0 1.3373.3145 1.7104.8991.2979.4666.4603 1.0236.4959 1.7017.0135.2606.0064.5268 0 .7407-.0024.08-.0039.1537-.0047.2163-.2615 1.7983-.9253 3.1585-2.0899 4.2819-.423.4079-.8595.6765-1.3348.8191-.8144.2456-1.4838.0998-2.0439-.4444z", fill: "currentColor" })] }));
|
|
3
|
+
export default Braze;
|
|
4
|
+
//# sourceMappingURL=Braze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Braze.js","sourceRoot":"","sources":["../../../src/Icon/iconFiles/Braze.tsx"],"names":[],"mappings":";AAAA,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAClB,eACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,2BAA2B,EACnC,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,eACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,oWAAoW,EACtW,IAAI,EAAC,cAAc,GACnB,EACF,eACE,CAAC,EAAC,4jCAA4jC,EAC9jC,IAAI,EAAC,cAAc,GACnB,IACE,CACP,CAAA;AAED,eAAe,KAAK,CAAA","sourcesContent":["const Braze = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"3.156 2.869 29.072 29.072\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m17.6919 5.32469c-6.6717 0-12.0803 5.40851-12.0803 12.08031s5.4086 12.0804 12.0803 12.0804c6.6718 0 12.0804-5.4086 12.0804-12.0804s-5.4086-12.08031-12.0804-12.08031zm-14.53614 12.08031c0-8.02808 6.50807-14.53615 14.53614-14.53615 8.0282 0 14.5362 6.50807 14.5362 14.53615 0 8.0281-6.508 14.5362-14.5362 14.5362-8.02807 0-14.53614-6.5081-14.53614-14.5362z\"\n fill=\"currentColor\"\n />\n <path\n d=\"m18.7692 26.4679c2.5469-.2828 4.0925-2.627 4.7477-3.8382.6433-1.2208 1.0093-2.5232 1.1558-3.7868.0515-.3826.08-.7217.088-1.037.0261-1.0092-.1276-1.8728-.469-2.642-.7407-1.666-2.0439-2.539-3.8739-2.5945-.9039-.0277-1.7983.1719-2.5977.576.1965-.7772.7582-3.0952 1.0663-5.3696.0476-.34936-.0467-.68446-.2638-.94351-.2154-.25826-.5268-.40799-.8761-.42304-.6473-.02931-1.1923.43334-1.2755 1.07265-.4642 3.5879-1.5694 8.2263-2.7497 11.5424-.6132 1.7231-1.7706 3.1475-3.3463 4.1187-.0563.0349-.1363.0776-.2369.1283-.5775.2908-.84527.9634-.62187 1.5639.12359.3327.38343.5989.71377.7312.3304.1315.7019.118 1.0204-.0381.9847-.4816 1.8569-1.1201 2.5937-1.8981.915 1.9774 2.4407 3.1126 4.9243 2.8369zm-2.0201-3.0864c-.4381-.4247-.6988-.9919-.7748-1.6843-.2123-1.9187.3533-3.6869 1.6819-5.2555.3422-.404.7367-.7288 1.1724-.9649.3858-.2091.7946-.3097 1.1875-.3097.694 0 1.3373.3145 1.7104.8991.2979.4666.4603 1.0236.4959 1.7017.0135.2606.0064.5268 0 .7407-.0024.08-.0039.1537-.0047.2163-.2615 1.7983-.9253 3.1585-2.0899 4.2819-.423.4079-.8595.6765-1.3348.8191-.8144.2456-1.4838.0998-2.0439-.4444z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport default Braze\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const Verified = () => (_jsx("svg", { width: "100%", height: "100%", viewBox: "0 0 22 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.625 10.9357L8.175 9.51071C7.99167 9.32738 7.7625 9.23571 7.4875 9.23571C7.2125 9.23571 6.975 9.33571 6.775 9.53571C6.59167 9.71905 6.5 9.95238 6.5 10.2357C6.5 10.519 6.59167 10.7524 6.775 10.9357L8.925 13.0857C9.125 13.2857 9.35833 13.3857 9.625 13.3857C9.89167 13.3857 10.125 13.2857 10.325 13.0857L14.575 8.83571C14.775 8.63571 14.8708 8.40238 14.8625 8.13571C14.8542 7.86905 14.7583 7.63571 14.575 7.43571C14.375 7.23571 14.1375 7.13155 13.8625 7.12321C13.5875 7.11488 13.35 7.21071 13.15 7.41071L9.625 10.9357ZM6.825 19.9857L5.375 17.5357L2.625 16.9357C2.375 16.8857 2.175 16.7565 2.025 16.5482C1.875 16.3399 1.81667 16.1107 1.85 15.8607L2.125 13.0357L0.25 10.8857C0.0833333 10.7024 0 10.4857 0 10.2357C0 9.98571 0.0833333 9.76905 0.25 9.58571L2.125 7.43571L1.85 4.61071C1.81667 4.36071 1.875 4.13155 2.025 3.92321C2.175 3.71488 2.375 3.58571 2.625 3.53571L5.375 2.93571L6.825 0.485714C6.95833 0.269048 7.14167 0.123214 7.375 0.0482143C7.60833 -0.0267857 7.84167 -0.0142857 8.075 0.0857143L10.675 1.18571L13.275 0.0857143C13.5083 -0.0142857 13.7417 -0.0267857 13.975 0.0482143C14.2083 0.123214 14.3917 0.269048 14.525 0.485714L15.975 2.93571L18.725 3.53571C18.975 3.58571 19.175 3.71488 19.325 3.92321C19.475 4.13155 19.5333 4.36071 19.5 4.61071L19.225 7.43571L21.1 9.58571C21.2667 9.76905 21.35 9.98571 21.35 10.2357C21.35 10.4857 21.2667 10.7024 21.1 10.8857L19.225 13.0357L19.5 15.8607C19.5333 16.1107 19.475 16.3399 19.325 16.5482C19.175 16.7565 18.975 16.8857 18.725 16.9357L15.975 17.5357L14.525 19.9857C14.3917 20.2024 14.2083 20.3482 13.975 20.4232C13.7417 20.4982 13.5083 20.4857 13.275 20.3857L10.675 19.2857L8.075 20.3857C7.84167 20.4857 7.60833 20.4982 7.375 20.4232C7.14167 20.3482 6.95833 20.2024 6.825 19.9857Z", fill: "currentColor" }) }));
|
|
3
|
+
export default Verified;
|
|
4
|
+
//# sourceMappingURL=Verified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Verified.js","sourceRoot":"","sources":["../../../src/Icon/iconFiles/Verified.tsx"],"names":[],"mappings":";AAAA,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CACrB,cACE,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,MAAM,EACb,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,eACE,CAAC,EAAC,ssDAAssD,EACxsD,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAA;AAED,eAAe,QAAQ,CAAA","sourcesContent":["const Verified = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 22 21\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.625 10.9357L8.175 9.51071C7.99167 9.32738 7.7625 9.23571 7.4875 9.23571C7.2125 9.23571 6.975 9.33571 6.775 9.53571C6.59167 9.71905 6.5 9.95238 6.5 10.2357C6.5 10.519 6.59167 10.7524 6.775 10.9357L8.925 13.0857C9.125 13.2857 9.35833 13.3857 9.625 13.3857C9.89167 13.3857 10.125 13.2857 10.325 13.0857L14.575 8.83571C14.775 8.63571 14.8708 8.40238 14.8625 8.13571C14.8542 7.86905 14.7583 7.63571 14.575 7.43571C14.375 7.23571 14.1375 7.13155 13.8625 7.12321C13.5875 7.11488 13.35 7.21071 13.15 7.41071L9.625 10.9357ZM6.825 19.9857L5.375 17.5357L2.625 16.9357C2.375 16.8857 2.175 16.7565 2.025 16.5482C1.875 16.3399 1.81667 16.1107 1.85 15.8607L2.125 13.0357L0.25 10.8857C0.0833333 10.7024 0 10.4857 0 10.2357C0 9.98571 0.0833333 9.76905 0.25 9.58571L2.125 7.43571L1.85 4.61071C1.81667 4.36071 1.875 4.13155 2.025 3.92321C2.175 3.71488 2.375 3.58571 2.625 3.53571L5.375 2.93571L6.825 0.485714C6.95833 0.269048 7.14167 0.123214 7.375 0.0482143C7.60833 -0.0267857 7.84167 -0.0142857 8.075 0.0857143L10.675 1.18571L13.275 0.0857143C13.5083 -0.0142857 13.7417 -0.0267857 13.975 0.0482143C14.2083 0.123214 14.3917 0.269048 14.525 0.485714L15.975 2.93571L18.725 3.53571C18.975 3.58571 19.175 3.71488 19.325 3.92321C19.475 4.13155 19.5333 4.36071 19.5 4.61071L19.225 7.43571L21.1 9.58571C21.2667 9.76905 21.35 9.98571 21.35 10.2357C21.35 10.4857 21.2667 10.7024 21.1 10.8857L19.225 13.0357L19.5 15.8607C19.5333 16.1107 19.475 16.3399 19.325 16.5482C19.175 16.7565 18.975 16.8857 18.725 16.9357L15.975 17.5357L14.525 19.9857C14.3917 20.2024 14.2083 20.3482 13.975 20.4232C13.7417 20.4982 13.5083 20.4857 13.275 20.3857L10.675 19.2857L8.075 20.3857C7.84167 20.4857 7.60833 20.4982 7.375 20.4232C7.14167 20.3482 6.95833 20.2024 6.825 19.9857Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport default Verified\n"]}
|
package/dist/Icon/iconsList.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import Bank from './iconFiles/Bank';
|
|
|
21
21
|
import Basket from './iconFiles/Basket';
|
|
22
22
|
import Bicycle from './iconFiles/Bicycle';
|
|
23
23
|
import Boost from './iconFiles/Boost';
|
|
24
|
+
import Braze from './iconFiles/Braze';
|
|
24
25
|
import Breakdown from './iconFiles/Breakdown';
|
|
25
26
|
import BreakdownAlt from './iconFiles/BreakdownAlt';
|
|
26
27
|
import Briefcase from './iconFiles/Briefcase';
|
|
@@ -207,6 +208,7 @@ import Upload from './iconFiles/Upload';
|
|
|
207
208
|
import UploadDocuments from './iconFiles/UploadDocuments';
|
|
208
209
|
import UploadEmail from './iconFiles/UploadEmail';
|
|
209
210
|
import Vandalism from './iconFiles/Vandalism';
|
|
211
|
+
import Verified from './iconFiles/Verified';
|
|
210
212
|
import Village from './iconFiles/Village';
|
|
211
213
|
import Visa from './iconFiles/Visa';
|
|
212
214
|
import Warning from './iconFiles/Warning';
|
|
@@ -333,6 +335,7 @@ export declare const iconList: {
|
|
|
333
335
|
basket: typeof Basket;
|
|
334
336
|
bicycle: typeof Bicycle;
|
|
335
337
|
boost: typeof Boost;
|
|
338
|
+
braze: typeof Braze;
|
|
336
339
|
breakdown: typeof Breakdown;
|
|
337
340
|
briefcase: typeof Briefcase;
|
|
338
341
|
bullets: typeof Bullets;
|
|
@@ -437,6 +440,7 @@ export declare const iconList: {
|
|
|
437
440
|
twitter: typeof Twitter;
|
|
438
441
|
upload: typeof Upload;
|
|
439
442
|
vandalism: typeof Vandalism;
|
|
443
|
+
verified: typeof Verified;
|
|
440
444
|
village: typeof Village;
|
|
441
445
|
visa: typeof Visa;
|
|
442
446
|
warning: typeof Warning;
|
package/dist/Icon/iconsList.js
CHANGED
|
@@ -21,6 +21,7 @@ import Bank from './iconFiles/Bank';
|
|
|
21
21
|
import Basket from './iconFiles/Basket';
|
|
22
22
|
import Bicycle from './iconFiles/Bicycle';
|
|
23
23
|
import Boost from './iconFiles/Boost';
|
|
24
|
+
import Braze from './iconFiles/Braze';
|
|
24
25
|
import Breakdown from './iconFiles/Breakdown';
|
|
25
26
|
import BreakdownAlt from './iconFiles/BreakdownAlt';
|
|
26
27
|
import Briefcase from './iconFiles/Briefcase';
|
|
@@ -208,6 +209,7 @@ import Upload from './iconFiles/Upload';
|
|
|
208
209
|
import UploadDocuments from './iconFiles/UploadDocuments';
|
|
209
210
|
import UploadEmail from './iconFiles/UploadEmail';
|
|
210
211
|
import Vandalism from './iconFiles/Vandalism';
|
|
212
|
+
import Verified from './iconFiles/Verified';
|
|
211
213
|
import Village from './iconFiles/Village';
|
|
212
214
|
import Visa from './iconFiles/Visa';
|
|
213
215
|
import Warning from './iconFiles/Warning';
|
|
@@ -332,6 +334,7 @@ export const iconList = {
|
|
|
332
334
|
basket: Basket,
|
|
333
335
|
bicycle: Bicycle,
|
|
334
336
|
boost: Boost,
|
|
337
|
+
braze: Braze,
|
|
335
338
|
breakdown: Breakdown,
|
|
336
339
|
briefcase: Briefcase,
|
|
337
340
|
bullets: Bullets,
|
|
@@ -436,6 +439,7 @@ export const iconList = {
|
|
|
436
439
|
twitter: Twitter,
|
|
437
440
|
upload: Upload,
|
|
438
441
|
vandalism: Vandalism,
|
|
442
|
+
verified: Verified,
|
|
439
443
|
village: Village,
|
|
440
444
|
visa: Visa,
|
|
441
445
|
warning: Warning,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconsList.js","sourceRoot":"","sources":["../../src/Icon/iconsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,iBAAiB,MAAM,+BAA+B,CAAA;AAC7D,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO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E,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,UAAU;IACtB,GAAG,EAAE,GAAG;CACT,CAAA","sourcesContent":["import Aa from './iconFiles/Aa'\nimport AaInverted from './iconFiles/AaInverted'\nimport AccidentalDamage from './iconFiles/AccidentalDamage'\nimport AccountBreakdown from './iconFiles/AccountBreakdown'\nimport AccountMlp from './iconFiles/AccountMlp'\nimport ActivityClipboard from './iconFiles/ActivityClipboard'\nimport AddOns from './iconFiles/AddOns'\nimport AddressMta from './iconFiles/AddressMta'\nimport Ai from './iconFiles/Ai'\nimport AlbumAudio from './iconFiles/AlbumAudio'\nimport Alert from './iconFiles/Alert'\nimport AlertEngine from './iconFiles/AlertEngine'\nimport Amex from './iconFiles/Amex'\nimport ApplePay from './iconFiles/ApplePay'\nimport ApprovedFile from './iconFiles/ApprovedFile'\nimport Archive from './iconFiles/Archive'\nimport Arrow from './iconFiles/Arrow'\nimport At from './iconFiles/At'\nimport Axa from './iconFiles/Axa'\nimport Bank from './iconFiles/Bank'\nimport Basket from './iconFiles/Basket'\nimport Bicycle from './iconFiles/Bicycle'\nimport Boost from './iconFiles/Boost'\nimport Breakdown from './iconFiles/Breakdown'\nimport BreakdownAlt from './iconFiles/BreakdownAlt'\nimport Briefcase from './iconFiles/Briefcase'\nimport Bullets from './iconFiles/Bullets'\nimport Burger from './iconFiles/Burger'\nimport Calendar from './iconFiles/Calendar'\nimport Camera from './iconFiles/Camera'\nimport Cancel from './iconFiles/Cancel'\nimport CancelBw from './iconFiles/CancelBw'\nimport Car from './iconFiles/Car'\nimport CarMta from './iconFiles/CarMta'\nimport CarRepairs from './iconFiles/CarRepairs'\nimport CarReplacement from './iconFiles/CarReplacement'\nimport CarUsage from './iconFiles/CarUsage'\nimport Card from './iconFiles/Card'\nimport Caret from './iconFiles/Caret'\nimport CaretUp from './iconFiles/CaretUp'\nimport Charge from './iconFiles/Charge'\nimport Chat from './iconFiles/Chat'\nimport ChatBubble from './iconFiles/ChatBubble'\nimport Checkout from './iconFiles/Checkout'\nimport CheckoutWithText from './iconFiles/CheckoutWithText'\nimport CircleInfoFilled from './iconFiles/CircleInfoFilled'\nimport CircleTick from './iconFiles/CircleTick'\nimport City from './iconFiles/City'\nimport Claim from './iconFiles/Claim'\nimport ClaimLine from './iconFiles/ClaimLine'\nimport Clipboard from './iconFiles/Clipboard'\nimport ClipboardCheck from './iconFiles/ClipboardCheck'\nimport Clock from './iconFiles/Clock'\nimport ClosePanel from './iconFiles/ClosePanel'\nimport Collapse from './iconFiles/Collapse'\nimport Confused from './iconFiles/Confused'\nimport ConfusedBlue from './iconFiles/ConfusedBlue'\nimport ContactEmail from './iconFiles/ContactEmail'\nimport Copy from './iconFiles/Copy'\nimport Crop from './iconFiles/Crop'\nimport Cross from './iconFiles/Cross'\nimport DashboardHigh from './iconFiles/DashboardHigh'\nimport DirectDebit from './iconFiles/DirectDebit'\nimport DocDownload from './iconFiles/DocDownload'\nimport DocUpload from './iconFiles/DocUpload'\nimport Download from './iconFiles/Download'\nimport Earth from './iconFiles/Earth'\nimport Edit from './iconFiles/Edit'\nimport EditContact from './iconFiles/EditContact'\nimport EditOutline from './iconFiles/EditOutline'\nimport EmailFilled from './iconFiles/EmailFilled'\nimport Engine from './iconFiles/Engine'\nimport Europe from './iconFiles/Europe'\nimport Excluded from './iconFiles/Excluded'\nimport Expand from './iconFiles/Expand'\nimport Facebook from './iconFiles/Facebook'\nimport FallingItems from './iconFiles/FallingItems'\nimport Fence from './iconFiles/Fence'\nimport File from './iconFiles/File'\nimport FileBadge2 from './iconFiles/FileBadge2'\nimport FileCabinet from './iconFiles/FileCabinet'\nimport Filter from './iconFiles/Filter'\nimport Fire from './iconFiles/Fire'\nimport Flag from './iconFiles/Flag'\nimport FlagFilled from './iconFiles/FlagFilled'\nimport Folder from './iconFiles/Folder'\nimport FraudAlert from './iconFiles/FraudAlert'\nimport FreezerFood from './iconFiles/FreezerFood'\nimport Fuel from './iconFiles/Fuel'\nimport Globe from './iconFiles/Globe'\nimport GooglePlayBadge from './iconFiles/GooglePlayBadge'\nimport Gpay from './iconFiles/Gpay'\nimport HelpAboutus from './iconFiles/HelpAboutus'\nimport HelpBuypolicy from './iconFiles/HelpBuypolicy'\nimport HelpCenter from './iconFiles/HelpCenter'\nimport HelpIdcheck from './iconFiles/HelpIdcheck'\nimport HelpManagePolicy from './iconFiles/HelpManagePolicy'\nimport HelpNcd from './iconFiles/HelpNcd'\nimport HelpVerification from './iconFiles/HelpVerification'\nimport HomeExcluded from './iconFiles/HomeExcluded'\nimport House from './iconFiles/House'\nimport HouseTree from './iconFiles/HouseTree'\nimport Id from './iconFiles/Id'\nimport Inbox from './iconFiles/Inbox'\nimport Included from './iconFiles/Included'\nimport Info from './iconFiles/Info'\nimport Injury from './iconFiles/Injury'\nimport Instagram from './iconFiles/Instagram'\nimport Intercom from './iconFiles/Intercom'\nimport Intercom2 from './iconFiles/Intercom2'\nimport IosStoreBadge from './iconFiles/IosStoreBadge'\nimport Iphone from './iconFiles/Iphone'\nimport Jewellery from './iconFiles/Jewellery'\nimport Key from './iconFiles/Key'\nimport Laptop from './iconFiles/Laptop'\nimport Leaks from './iconFiles/Leaks'\nimport Lightbulb from './iconFiles/Lightbulb'\nimport Link from './iconFiles/Link'\nimport Linkedin from './iconFiles/Linkedin'\nimport LiveChat from './iconFiles/LiveChat'\nimport LiveChat2 from './iconFiles/LiveChat2'\nimport Location from './iconFiles/Location'\nimport LogOut from './iconFiles/LogOut'\nimport MailTime from './iconFiles/MailTime'\nimport ManageDrivers from './iconFiles/ManageDrivers'\nimport ManagePolicy from './iconFiles/ManagePolicy'\nimport Marshmallow from './iconFiles/Marshmallow'\nimport Mastercard from './iconFiles/Mastercard'\nimport Maximise from './iconFiles/Maximise'\nimport MaximiseWindow from './iconFiles/MaximiseWindow'\nimport Medical from './iconFiles/Medical'\nimport Minimise from './iconFiles/Minimise'\nimport Minus from './iconFiles/Minus'\nimport MinusCircle from './iconFiles/MinusCircle'\nimport MoneyBag from './iconFiles/MoneyBag'\nimport MoneyHeart from './iconFiles/MoneyHeart'\nimport MoreDots from './iconFiles/MoreDots'\nimport Mulsanne from './iconFiles/Mulsanne'\nimport NewWindow from './iconFiles/NewWindow'\nimport NoExcess from './iconFiles/NoExcess'\nimport Notes from './iconFiles/Notes'\nimport Notification from './iconFiles/Notification'\nimport Onfido from './iconFiles/Onfido'\nimport OpenPanel from './iconFiles/OpenPanel'\nimport Other from './iconFiles/Other'\nimport OutOfHome from './iconFiles/OutOfHome'\nimport Padlock from './iconFiles/Padlock'\nimport PadlockOutline from './iconFiles/PadlockOutline'\nimport Paperclip from './iconFiles/Paperclip'\nimport People from './iconFiles/People'\nimport Person from './iconFiles/Person'\nimport PhoneFilled from './iconFiles/PhoneFilled'\nimport PhoneOutline from './iconFiles/PhoneOutline'\nimport Photo from './iconFiles/Photo'\nimport PinCode from './iconFiles/PinCode'\nimport Plus from './iconFiles/Plus'\nimport PlusCircle from './iconFiles/PlusCircle'\nimport Policy from './iconFiles/Policy'\nimport PolicyDetails from './iconFiles/PolicyDetails'\nimport PolicyDoc from './iconFiles/PolicyDoc'\nimport PolicyDocs from './iconFiles/PolicyDocs'\nimport PoundBold from './iconFiles/PoundBold'\nimport PoundFilledCircle from './iconFiles/PoundFilledCircle'\nimport PoundMedium from './iconFiles/PoundMedium'\nimport PoundOutline from './iconFiles/PoundOutline'\nimport PoundRegular from './iconFiles/PoundRegular'\nimport Premfina from './iconFiles/Premfina'\nimport Profile from './iconFiles/Profile'\nimport { Progress } from './iconFiles/Progress'\nimport Prohibited from './iconFiles/Prohibited'\nimport Property from './iconFiles/Property'\nimport QuestionHelp from './iconFiles/QuestionHelp'\nimport Rac from './iconFiles/Rac'\nimport Ravelin from './iconFiles/Ravelin'\nimport ReferAFriend from './iconFiles/ReferAFriend'\nimport Refund from './iconFiles/Refund'\nimport RegPlate from './iconFiles/RegPlate'\nimport Renewal from './iconFiles/Renewal'\nimport RenewalLine from './iconFiles/RenewalLine'\nimport RepeatCharge from './iconFiles/RepeatCharge'\nimport Reply from './iconFiles/Reply'\nimport Return from './iconFiles/Return'\nimport ScheduleQuote from './iconFiles/ScheduleQuote'\nimport Search from './iconFiles/Search'\nimport Security from './iconFiles/Security'\nimport SendMessage from './iconFiles/SendMessage'\nimport Settings from './iconFiles/Settings'\nimport Shield from './iconFiles/Shield'\nimport ShieldCheck from './iconFiles/ShieldCheck'\nimport Shopping from './iconFiles/Shopping'\nimport Sofa from './iconFiles/Sofa'\nimport Stack from './iconFiles/Stack'\nimport Storm from './iconFiles/Storm'\nimport Stripe from './iconFiles/Stripe'\nimport Subsidence from './iconFiles/Subsidence'\nimport Theft from './iconFiles/Theft'\nimport ThumbsDown from './iconFiles/ThumbsDown'\nimport ThumbsUp from './iconFiles/ThumbsUp'\nimport Tick from './iconFiles/Tick'\nimport TowTruck from './iconFiles/TowTruck'\nimport TraceAndAccess from './iconFiles/TraceAndAccess'\nimport Training from './iconFiles/Training'\nimport Trash from './iconFiles/Trash'\nimport TriangleExclamationSolid from './iconFiles/TriangleExclamationSolid'\nimport Twitter from './iconFiles/Twitter'\nimport UpDown from './iconFiles/UpDown'\nimport Upload from './iconFiles/Upload'\nimport UploadDocuments from './iconFiles/UploadDocuments'\nimport UploadEmail from './iconFiles/UploadEmail'\nimport Vandalism from './iconFiles/Vandalism'\nimport Village from './iconFiles/Village'\nimport Visa from './iconFiles/Visa'\nimport Warning from './iconFiles/Warning'\nimport WarningCircle from './iconFiles/WarningCircle'\nimport Watch from './iconFiles/Watch'\nimport Wave from './iconFiles/Wave'\nimport Wellbeing from './iconFiles/Wellbeing'\nimport WheelFlat from './iconFiles/WheelFlat'\nimport Windscreen from './iconFiles/Windscreen'\nimport WindscreenRepair from './iconFiles/WindscreenRepair'\nimport WindscreenReplacement from './iconFiles/WindscreenReplacement'\nimport Cmt from './iconFiles/Cmt'\n\nexport const iconList = {\n 'aa-inverted': AaInverted,\n 'accidental-damage': AccidentalDamage,\n 'account-breakdown': AccountBreakdown,\n 'account-mlp': AccountMlp,\n 'activity-clipboard': ActivityClipboard,\n 'add-ons': AddOns,\n 'address-mta': AddressMta,\n 'album-audio': AlbumAudio,\n 'alert-engine': AlertEngine,\n 'apple-pay': ApplePay,\n 'approved-file': ApprovedFile,\n 'breakdown-alt': BreakdownAlt,\n 'cancel-bw': CancelBw,\n 'car-mta': CarMta,\n 'car-repairs': CarRepairs,\n 'car-replacement': CarReplacement,\n 'car-usage': CarUsage,\n 'caret-up': CaretUp,\n 'chat-bubble': ChatBubble,\n 'checkout-with-text': CheckoutWithText,\n 'circle-tick': CircleTick,\n 'circle-info-filled': CircleInfoFilled,\n 'claim-line': ClaimLine,\n 'clipboard-check': ClipboardCheck,\n 'close-panel': ClosePanel,\n 'confused-blue': ConfusedBlue,\n 'contact-email': ContactEmail,\n 'dashboard-high': DashboardHigh,\n 'direct-debit': DirectDebit,\n 'doc-download': DocDownload,\n 'doc-upload': DocUpload,\n 'edit-contact': EditContact,\n 'edit-outline': EditOutline,\n 'email-filled': EmailFilled,\n 'falling-items': FallingItems,\n 'file-badge-2': FileBadge2,\n 'file-cabinet': FileCabinet,\n 'fraud-alert': FraudAlert,\n 'freezer-food': FreezerFood,\n 'google-play-badge': GooglePlayBadge,\n 'help-aboutus': HelpAboutus,\n 'help-buypolicy': HelpBuypolicy,\n 'help-center': HelpCenter,\n 'help-idcheck': HelpIdcheck,\n 'help-manage-policy': HelpManagePolicy,\n 'help-ncd': HelpNcd,\n 'help-verification': HelpVerification,\n 'home-excluded': HomeExcluded,\n 'house-tree': HouseTree,\n 'ios-store-badge': IosStoreBadge,\n 'live-chat': LiveChat,\n 'live-chat2': LiveChat2,\n 'log-out': LogOut,\n 'mail-time': MailTime,\n 'manage-drivers': ManageDrivers,\n 'manage-policy': ManagePolicy,\n 'maximise-window': MaximiseWindow,\n 'minus-circle': MinusCircle,\n 'money-bag': MoneyBag,\n 'money-heart': MoneyHeart,\n 'more-dots': MoreDots,\n 'new-window': NewWindow,\n 'no-excess': NoExcess,\n 'open-panel': OpenPanel,\n 'out-of-home': OutOfHome,\n 'padlock-outline': PadlockOutline,\n 'phone-filled': PhoneFilled,\n 'phone-outline': PhoneOutline,\n 'pin-code': PinCode,\n 'plus-circle': PlusCircle,\n 'policy-details': PolicyDetails,\n 'policy-doc': PolicyDoc,\n 'policy-docs': PolicyDocs,\n 'pound-bold': PoundBold,\n 'pound-filled-circle': PoundFilledCircle,\n 'pound-medium': PoundMedium,\n 'pound-outline': PoundOutline,\n 'pound-regular': PoundRegular,\n 'question-help': QuestionHelp,\n 'refer-a-friend': ReferAFriend,\n 'reg-plate': RegPlate,\n 'renewal-line': RenewalLine,\n 'repeat-charge': RepeatCharge,\n 'schedule-quote': ScheduleQuote,\n 'send-message': SendMessage,\n 'shield-check': ShieldCheck,\n 'thumbs-down': ThumbsDown,\n 'thumbs-up': ThumbsUp,\n 'tow-truck': TowTruck,\n 'trace-and-access': TraceAndAccess,\n 'triangle-exclamation-solid': TriangleExclamationSolid,\n 'up-down': UpDown,\n 'upload-documents': UploadDocuments,\n 'upload-email': UploadEmail,\n 'warning-circle': WarningCircle,\n 'wheel-flat': WheelFlat,\n 'windscreen-repair': WindscreenRepair,\n 'windscreen-replacement': WindscreenReplacement,\n aa: Aa,\n addons: AddOns,\n ai: Ai,\n alert: Alert,\n amex: Amex,\n archive: Archive,\n arrow: Arrow,\n at: At,\n axa: Axa,\n bank: Bank,\n basket: Basket,\n bicycle: Bicycle,\n boost: Boost,\n breakdown: Breakdown,\n briefcase: Briefcase,\n bullets: Bullets,\n burger: Burger,\n calendar: Calendar,\n camera: Camera,\n cancel: Cancel,\n car: Car,\n card: Card,\n caret: Caret,\n charge: Charge,\n chat: Chat,\n checkout: Checkout,\n city: City,\n claim: Claim,\n clipboard: Clipboard,\n clock: Clock,\n collpase: Collapse,\n confused: Confused,\n copy: Copy,\n crop: Crop,\n cross: Cross,\n download: Download,\n earth: Earth,\n edit: Edit,\n engine: Engine,\n europe: Europe,\n excluded: Excluded,\n expand: Expand,\n facebook: Facebook,\n fence: Fence,\n file: File,\n filter: Filter,\n fire: Fire,\n flag: Flag,\n flagFilled: FlagFilled,\n folder: Folder,\n fuel: Fuel,\n globe: Globe,\n gpay: Gpay,\n house: House,\n id: Id,\n inbox: Inbox,\n included: Included,\n info: Info,\n injury: Injury,\n instagram: Instagram,\n intercom: Intercom,\n intercom2: Intercom2,\n iphone: Iphone,\n jewellery: Jewellery,\n key: Key,\n laptop: Laptop,\n leaks: Leaks,\n lightbulb: Lightbulb,\n link: Link,\n linkedin: Linkedin,\n location: Location,\n marshmallow: Marshmallow,\n mastercard: Mastercard,\n maximise: Maximise,\n medical: Medical,\n minimise: Minimise,\n minus: Minus,\n mulsanne: Mulsanne,\n notes: Notes,\n notification: Notification,\n onfido: Onfido,\n other: Other,\n padlock: Padlock,\n paperclip: Paperclip,\n people: People,\n person: Person,\n photo: Photo,\n plus: Plus,\n policy: Policy,\n premfina: Premfina,\n profile: Profile,\n progress: Progress,\n prohibited: Prohibited,\n property: Property,\n rac: Rac,\n ravelin: Ravelin,\n refund: Refund,\n renewal: Renewal,\n reply: Reply,\n return: Return,\n search: Search,\n security: Security,\n settings: Settings,\n shield: Shield,\n shopping: Shopping,\n sofa: Sofa,\n stack: Stack,\n storm: Storm,\n stripe: Stripe,\n subsidence: Subsidence,\n theft: Theft,\n tick: Tick,\n training: Training,\n trash: Trash,\n twitter: Twitter,\n upload: Upload,\n vandalism: Vandalism,\n village: Village,\n visa: Visa,\n warning: Warning,\n watch: Watch,\n wave: Wave,\n wellbeing: Wellbeing,\n windscreen: Windscreen,\n cmt: Cmt,\n}\n\nexport type Icons = keyof typeof iconList\n"]}
|
|
1
|
+
{"version":3,"file":"iconsList.js","sourceRoot":"","sources":["../../src/Icon/iconsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,iBAAiB,MAAM,+BAA+B,CAAA;AAC7D,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO,UAAU,MAAM,wBAAwB,CAAA;AAC/C,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,WAAW,MAAM,yBAAyB,CAAA;AACjD,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAC3C,OAAO,YAAY,MAAM,0BAA0B,CAAA;AACnD,OAAO,OAAO,MAAM,qBAAqB,CAAA;AACzC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC/B,OAAO,GAAG,MAAM,iBAAiB,CAAA;AACjC,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,OAAO,MAAM,qBAAqB,CAAA;AACzC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,SAAS,MAAM,uBAAuB,CAAA;AAC7C,OAAO,YAAY,MAAM,0BAA0B,CAAA;AACnD,OAAO,SAAS,MAAM,uBAAuB,CAAA;AAC7C,OAAO,OAAO,MAAM,qBA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IACd,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,UAAU;IACtB,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,UAAU;IACtB,GAAG,EAAE,GAAG;CACT,CAAA","sourcesContent":["import Aa from './iconFiles/Aa'\nimport AaInverted from './iconFiles/AaInverted'\nimport AccidentalDamage from './iconFiles/AccidentalDamage'\nimport AccountBreakdown from './iconFiles/AccountBreakdown'\nimport AccountMlp from './iconFiles/AccountMlp'\nimport ActivityClipboard from './iconFiles/ActivityClipboard'\nimport AddOns from './iconFiles/AddOns'\nimport AddressMta from './iconFiles/AddressMta'\nimport Ai from './iconFiles/Ai'\nimport AlbumAudio from './iconFiles/AlbumAudio'\nimport Alert from './iconFiles/Alert'\nimport AlertEngine from './iconFiles/AlertEngine'\nimport Amex from './iconFiles/Amex'\nimport ApplePay from './iconFiles/ApplePay'\nimport ApprovedFile from './iconFiles/ApprovedFile'\nimport Archive from './iconFiles/Archive'\nimport Arrow from './iconFiles/Arrow'\nimport At from './iconFiles/At'\nimport Axa from './iconFiles/Axa'\nimport Bank from './iconFiles/Bank'\nimport Basket from './iconFiles/Basket'\nimport Bicycle from './iconFiles/Bicycle'\nimport Boost from './iconFiles/Boost'\nimport Braze from './iconFiles/Braze'\nimport Breakdown from './iconFiles/Breakdown'\nimport BreakdownAlt from './iconFiles/BreakdownAlt'\nimport Briefcase from './iconFiles/Briefcase'\nimport Bullets from './iconFiles/Bullets'\nimport Burger from './iconFiles/Burger'\nimport Calendar from './iconFiles/Calendar'\nimport Camera from './iconFiles/Camera'\nimport Cancel from './iconFiles/Cancel'\nimport CancelBw from './iconFiles/CancelBw'\nimport Car from './iconFiles/Car'\nimport CarMta from './iconFiles/CarMta'\nimport CarRepairs from './iconFiles/CarRepairs'\nimport CarReplacement from './iconFiles/CarReplacement'\nimport CarUsage from './iconFiles/CarUsage'\nimport Card from './iconFiles/Card'\nimport Caret from './iconFiles/Caret'\nimport CaretUp from './iconFiles/CaretUp'\nimport Charge from './iconFiles/Charge'\nimport Chat from './iconFiles/Chat'\nimport ChatBubble from './iconFiles/ChatBubble'\nimport Checkout from './iconFiles/Checkout'\nimport CheckoutWithText from './iconFiles/CheckoutWithText'\nimport CircleInfoFilled from './iconFiles/CircleInfoFilled'\nimport CircleTick from './iconFiles/CircleTick'\nimport City from './iconFiles/City'\nimport Claim from './iconFiles/Claim'\nimport ClaimLine from './iconFiles/ClaimLine'\nimport Clipboard from './iconFiles/Clipboard'\nimport ClipboardCheck from './iconFiles/ClipboardCheck'\nimport Clock from './iconFiles/Clock'\nimport ClosePanel from './iconFiles/ClosePanel'\nimport Collapse from './iconFiles/Collapse'\nimport Confused from './iconFiles/Confused'\nimport ConfusedBlue from './iconFiles/ConfusedBlue'\nimport ContactEmail from './iconFiles/ContactEmail'\nimport Copy from './iconFiles/Copy'\nimport Crop from './iconFiles/Crop'\nimport Cross from './iconFiles/Cross'\nimport DashboardHigh from './iconFiles/DashboardHigh'\nimport DirectDebit from './iconFiles/DirectDebit'\nimport DocDownload from './iconFiles/DocDownload'\nimport DocUpload from './iconFiles/DocUpload'\nimport Download from './iconFiles/Download'\nimport Earth from './iconFiles/Earth'\nimport Edit from './iconFiles/Edit'\nimport EditContact from './iconFiles/EditContact'\nimport EditOutline from './iconFiles/EditOutline'\nimport EmailFilled from './iconFiles/EmailFilled'\nimport Engine from './iconFiles/Engine'\nimport Europe from './iconFiles/Europe'\nimport Excluded from './iconFiles/Excluded'\nimport Expand from './iconFiles/Expand'\nimport Facebook from './iconFiles/Facebook'\nimport FallingItems from './iconFiles/FallingItems'\nimport Fence from './iconFiles/Fence'\nimport File from './iconFiles/File'\nimport FileBadge2 from './iconFiles/FileBadge2'\nimport FileCabinet from './iconFiles/FileCabinet'\nimport Filter from './iconFiles/Filter'\nimport Fire from './iconFiles/Fire'\nimport Flag from './iconFiles/Flag'\nimport FlagFilled from './iconFiles/FlagFilled'\nimport Folder from './iconFiles/Folder'\nimport FraudAlert from './iconFiles/FraudAlert'\nimport FreezerFood from './iconFiles/FreezerFood'\nimport Fuel from './iconFiles/Fuel'\nimport Globe from './iconFiles/Globe'\nimport GooglePlayBadge from './iconFiles/GooglePlayBadge'\nimport Gpay from './iconFiles/Gpay'\nimport HelpAboutus from './iconFiles/HelpAboutus'\nimport HelpBuypolicy from './iconFiles/HelpBuypolicy'\nimport HelpCenter from './iconFiles/HelpCenter'\nimport HelpIdcheck from './iconFiles/HelpIdcheck'\nimport HelpManagePolicy from './iconFiles/HelpManagePolicy'\nimport HelpNcd from './iconFiles/HelpNcd'\nimport HelpVerification from './iconFiles/HelpVerification'\nimport HomeExcluded from './iconFiles/HomeExcluded'\nimport House from './iconFiles/House'\nimport HouseTree from './iconFiles/HouseTree'\nimport Id from './iconFiles/Id'\nimport Inbox from './iconFiles/Inbox'\nimport Included from './iconFiles/Included'\nimport Info from './iconFiles/Info'\nimport Injury from './iconFiles/Injury'\nimport Instagram from './iconFiles/Instagram'\nimport Intercom from './iconFiles/Intercom'\nimport Intercom2 from './iconFiles/Intercom2'\nimport IosStoreBadge from './iconFiles/IosStoreBadge'\nimport Iphone from './iconFiles/Iphone'\nimport Jewellery from './iconFiles/Jewellery'\nimport Key from './iconFiles/Key'\nimport Laptop from './iconFiles/Laptop'\nimport Leaks from './iconFiles/Leaks'\nimport Lightbulb from './iconFiles/Lightbulb'\nimport Link from './iconFiles/Link'\nimport Linkedin from './iconFiles/Linkedin'\nimport LiveChat from './iconFiles/LiveChat'\nimport LiveChat2 from './iconFiles/LiveChat2'\nimport Location from './iconFiles/Location'\nimport LogOut from './iconFiles/LogOut'\nimport MailTime from './iconFiles/MailTime'\nimport ManageDrivers from './iconFiles/ManageDrivers'\nimport ManagePolicy from './iconFiles/ManagePolicy'\nimport Marshmallow from './iconFiles/Marshmallow'\nimport Mastercard from './iconFiles/Mastercard'\nimport Maximise from './iconFiles/Maximise'\nimport MaximiseWindow from './iconFiles/MaximiseWindow'\nimport Medical from './iconFiles/Medical'\nimport Minimise from './iconFiles/Minimise'\nimport Minus from './iconFiles/Minus'\nimport MinusCircle from './iconFiles/MinusCircle'\nimport MoneyBag from './iconFiles/MoneyBag'\nimport MoneyHeart from './iconFiles/MoneyHeart'\nimport MoreDots from './iconFiles/MoreDots'\nimport Mulsanne from './iconFiles/Mulsanne'\nimport NewWindow from './iconFiles/NewWindow'\nimport NoExcess from './iconFiles/NoExcess'\nimport Notes from './iconFiles/Notes'\nimport Notification from './iconFiles/Notification'\nimport Onfido from './iconFiles/Onfido'\nimport OpenPanel from './iconFiles/OpenPanel'\nimport Other from './iconFiles/Other'\nimport OutOfHome from './iconFiles/OutOfHome'\nimport Padlock from './iconFiles/Padlock'\nimport PadlockOutline from './iconFiles/PadlockOutline'\nimport Paperclip from './iconFiles/Paperclip'\nimport People from './iconFiles/People'\nimport Person from './iconFiles/Person'\nimport PhoneFilled from './iconFiles/PhoneFilled'\nimport PhoneOutline from './iconFiles/PhoneOutline'\nimport Photo from './iconFiles/Photo'\nimport PinCode from './iconFiles/PinCode'\nimport Plus from './iconFiles/Plus'\nimport PlusCircle from './iconFiles/PlusCircle'\nimport Policy from './iconFiles/Policy'\nimport PolicyDetails from './iconFiles/PolicyDetails'\nimport PolicyDoc from './iconFiles/PolicyDoc'\nimport PolicyDocs from './iconFiles/PolicyDocs'\nimport PoundBold from './iconFiles/PoundBold'\nimport PoundFilledCircle from './iconFiles/PoundFilledCircle'\nimport PoundMedium from './iconFiles/PoundMedium'\nimport PoundOutline from './iconFiles/PoundOutline'\nimport PoundRegular from './iconFiles/PoundRegular'\nimport Premfina from './iconFiles/Premfina'\nimport Profile from './iconFiles/Profile'\nimport { Progress } from './iconFiles/Progress'\nimport Prohibited from './iconFiles/Prohibited'\nimport Property from './iconFiles/Property'\nimport QuestionHelp from './iconFiles/QuestionHelp'\nimport Rac from './iconFiles/Rac'\nimport Ravelin from './iconFiles/Ravelin'\nimport ReferAFriend from './iconFiles/ReferAFriend'\nimport Refund from './iconFiles/Refund'\nimport RegPlate from './iconFiles/RegPlate'\nimport Renewal from './iconFiles/Renewal'\nimport RenewalLine from './iconFiles/RenewalLine'\nimport RepeatCharge from './iconFiles/RepeatCharge'\nimport Reply from './iconFiles/Reply'\nimport Return from './iconFiles/Return'\nimport ScheduleQuote from './iconFiles/ScheduleQuote'\nimport Search from './iconFiles/Search'\nimport Security from './iconFiles/Security'\nimport SendMessage from './iconFiles/SendMessage'\nimport Settings from './iconFiles/Settings'\nimport Shield from './iconFiles/Shield'\nimport ShieldCheck from './iconFiles/ShieldCheck'\nimport Shopping from './iconFiles/Shopping'\nimport Sofa from './iconFiles/Sofa'\nimport Stack from './iconFiles/Stack'\nimport Storm from './iconFiles/Storm'\nimport Stripe from './iconFiles/Stripe'\nimport Subsidence from './iconFiles/Subsidence'\nimport Theft from './iconFiles/Theft'\nimport ThumbsDown from './iconFiles/ThumbsDown'\nimport ThumbsUp from './iconFiles/ThumbsUp'\nimport Tick from './iconFiles/Tick'\nimport TowTruck from './iconFiles/TowTruck'\nimport TraceAndAccess from './iconFiles/TraceAndAccess'\nimport Training from './iconFiles/Training'\nimport Trash from './iconFiles/Trash'\nimport TriangleExclamationSolid from './iconFiles/TriangleExclamationSolid'\nimport Twitter from './iconFiles/Twitter'\nimport UpDown from './iconFiles/UpDown'\nimport Upload from './iconFiles/Upload'\nimport UploadDocuments from './iconFiles/UploadDocuments'\nimport UploadEmail from './iconFiles/UploadEmail'\nimport Vandalism from './iconFiles/Vandalism'\nimport Verified from './iconFiles/Verified'\nimport Village from './iconFiles/Village'\nimport Visa from './iconFiles/Visa'\nimport Warning from './iconFiles/Warning'\nimport WarningCircle from './iconFiles/WarningCircle'\nimport Watch from './iconFiles/Watch'\nimport Wave from './iconFiles/Wave'\nimport Wellbeing from './iconFiles/Wellbeing'\nimport WheelFlat from './iconFiles/WheelFlat'\nimport Windscreen from './iconFiles/Windscreen'\nimport WindscreenRepair from './iconFiles/WindscreenRepair'\nimport WindscreenReplacement from './iconFiles/WindscreenReplacement'\nimport Cmt from './iconFiles/Cmt'\n\nexport const iconList = {\n 'aa-inverted': AaInverted,\n 'accidental-damage': AccidentalDamage,\n 'account-breakdown': AccountBreakdown,\n 'account-mlp': AccountMlp,\n 'activity-clipboard': ActivityClipboard,\n 'add-ons': AddOns,\n 'address-mta': AddressMta,\n 'album-audio': AlbumAudio,\n 'alert-engine': AlertEngine,\n 'apple-pay': ApplePay,\n 'approved-file': ApprovedFile,\n 'breakdown-alt': BreakdownAlt,\n 'cancel-bw': CancelBw,\n 'car-mta': CarMta,\n 'car-repairs': CarRepairs,\n 'car-replacement': CarReplacement,\n 'car-usage': CarUsage,\n 'caret-up': CaretUp,\n 'chat-bubble': ChatBubble,\n 'checkout-with-text': CheckoutWithText,\n 'circle-tick': CircleTick,\n 'circle-info-filled': CircleInfoFilled,\n 'claim-line': ClaimLine,\n 'clipboard-check': ClipboardCheck,\n 'close-panel': ClosePanel,\n 'confused-blue': ConfusedBlue,\n 'contact-email': ContactEmail,\n 'dashboard-high': DashboardHigh,\n 'direct-debit': DirectDebit,\n 'doc-download': DocDownload,\n 'doc-upload': DocUpload,\n 'edit-contact': EditContact,\n 'edit-outline': EditOutline,\n 'email-filled': EmailFilled,\n 'falling-items': FallingItems,\n 'file-badge-2': FileBadge2,\n 'file-cabinet': FileCabinet,\n 'fraud-alert': FraudAlert,\n 'freezer-food': FreezerFood,\n 'google-play-badge': GooglePlayBadge,\n 'help-aboutus': HelpAboutus,\n 'help-buypolicy': HelpBuypolicy,\n 'help-center': HelpCenter,\n 'help-idcheck': HelpIdcheck,\n 'help-manage-policy': HelpManagePolicy,\n 'help-ncd': HelpNcd,\n 'help-verification': HelpVerification,\n 'home-excluded': HomeExcluded,\n 'house-tree': HouseTree,\n 'ios-store-badge': IosStoreBadge,\n 'live-chat': LiveChat,\n 'live-chat2': LiveChat2,\n 'log-out': LogOut,\n 'mail-time': MailTime,\n 'manage-drivers': ManageDrivers,\n 'manage-policy': ManagePolicy,\n 'maximise-window': MaximiseWindow,\n 'minus-circle': MinusCircle,\n 'money-bag': MoneyBag,\n 'money-heart': MoneyHeart,\n 'more-dots': MoreDots,\n 'new-window': NewWindow,\n 'no-excess': NoExcess,\n 'open-panel': OpenPanel,\n 'out-of-home': OutOfHome,\n 'padlock-outline': PadlockOutline,\n 'phone-filled': PhoneFilled,\n 'phone-outline': PhoneOutline,\n 'pin-code': PinCode,\n 'plus-circle': PlusCircle,\n 'policy-details': PolicyDetails,\n 'policy-doc': PolicyDoc,\n 'policy-docs': PolicyDocs,\n 'pound-bold': PoundBold,\n 'pound-filled-circle': PoundFilledCircle,\n 'pound-medium': PoundMedium,\n 'pound-outline': PoundOutline,\n 'pound-regular': PoundRegular,\n 'question-help': QuestionHelp,\n 'refer-a-friend': ReferAFriend,\n 'reg-plate': RegPlate,\n 'renewal-line': RenewalLine,\n 'repeat-charge': RepeatCharge,\n 'schedule-quote': ScheduleQuote,\n 'send-message': SendMessage,\n 'shield-check': ShieldCheck,\n 'thumbs-down': ThumbsDown,\n 'thumbs-up': ThumbsUp,\n 'tow-truck': TowTruck,\n 'trace-and-access': TraceAndAccess,\n 'triangle-exclamation-solid': TriangleExclamationSolid,\n 'up-down': UpDown,\n 'upload-documents': UploadDocuments,\n 'upload-email': UploadEmail,\n 'warning-circle': WarningCircle,\n 'wheel-flat': WheelFlat,\n 'windscreen-repair': WindscreenRepair,\n 'windscreen-replacement': WindscreenReplacement,\n aa: Aa,\n addons: AddOns,\n ai: Ai,\n alert: Alert,\n amex: Amex,\n archive: Archive,\n arrow: Arrow,\n at: At,\n axa: Axa,\n bank: Bank,\n basket: Basket,\n bicycle: Bicycle,\n boost: Boost,\n braze: Braze,\n breakdown: Breakdown,\n briefcase: Briefcase,\n bullets: Bullets,\n burger: Burger,\n calendar: Calendar,\n camera: Camera,\n cancel: Cancel,\n car: Car,\n card: Card,\n caret: Caret,\n charge: Charge,\n chat: Chat,\n checkout: Checkout,\n city: City,\n claim: Claim,\n clipboard: Clipboard,\n clock: Clock,\n collpase: Collapse,\n confused: Confused,\n copy: Copy,\n crop: Crop,\n cross: Cross,\n download: Download,\n earth: Earth,\n edit: Edit,\n engine: Engine,\n europe: Europe,\n excluded: Excluded,\n expand: Expand,\n facebook: Facebook,\n fence: Fence,\n file: File,\n filter: Filter,\n fire: Fire,\n flag: Flag,\n flagFilled: FlagFilled,\n folder: Folder,\n fuel: Fuel,\n globe: Globe,\n gpay: Gpay,\n house: House,\n id: Id,\n inbox: Inbox,\n included: Included,\n info: Info,\n injury: Injury,\n instagram: Instagram,\n intercom: Intercom,\n intercom2: Intercom2,\n iphone: Iphone,\n jewellery: Jewellery,\n key: Key,\n laptop: Laptop,\n leaks: Leaks,\n lightbulb: Lightbulb,\n link: Link,\n linkedin: Linkedin,\n location: Location,\n marshmallow: Marshmallow,\n mastercard: Mastercard,\n maximise: Maximise,\n medical: Medical,\n minimise: Minimise,\n minus: Minus,\n mulsanne: Mulsanne,\n notes: Notes,\n notification: Notification,\n onfido: Onfido,\n other: Other,\n padlock: Padlock,\n paperclip: Paperclip,\n people: People,\n person: Person,\n photo: Photo,\n plus: Plus,\n policy: Policy,\n premfina: Premfina,\n profile: Profile,\n progress: Progress,\n prohibited: Prohibited,\n property: Property,\n rac: Rac,\n ravelin: Ravelin,\n refund: Refund,\n renewal: Renewal,\n reply: Reply,\n return: Return,\n search: Search,\n security: Security,\n settings: Settings,\n shield: Shield,\n shopping: Shopping,\n sofa: Sofa,\n stack: Stack,\n storm: Storm,\n stripe: Stripe,\n subsidence: Subsidence,\n theft: Theft,\n tick: Tick,\n training: Training,\n trash: Trash,\n twitter: Twitter,\n upload: Upload,\n vandalism: Vandalism,\n verified: Verified,\n village: Village,\n visa: Visa,\n warning: Warning,\n watch: Watch,\n wave: Wave,\n wellbeing: Wellbeing,\n windscreen: Windscreen,\n cmt: Cmt,\n}\n\nexport type Icons = keyof typeof iconList\n"]}
|
|
@@ -33,6 +33,8 @@ const defaultFuzzySearchOptions = {
|
|
|
33
33
|
};
|
|
34
34
|
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) {
|
|
35
35
|
const wrapperRef = useRef(null);
|
|
36
|
+
// The results are positioned against the input row
|
|
37
|
+
const [inputRow, setInputRow] = useState(null);
|
|
36
38
|
const theme = useTheme();
|
|
37
39
|
const id = useUniqueId(idProp);
|
|
38
40
|
const { assistiveTextId, errorMsgId, controlAria } = getFieldAria(id, {
|
|
@@ -197,7 +199,7 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
|
197
199
|
}
|
|
198
200
|
};
|
|
199
201
|
const showClearSearchButton = !!clearSearch && (!!value || !!selectedValue || !!searchQuery);
|
|
200
|
-
return (_jsxs(Wrapper, { ref: wrapperRef, children: [_jsxs(Field, { className: className, renderAsTitle: renderAsTitle, htmlFor: id, assistiveTextId: assistiveTextId, errorMsgId: errorMsgId, ...otherProps, children: [_jsxs(Box, { flex: true, alignItems: "center", justifyContent: "flex-start", children: [showIcon && (_jsx(InputLeadingIconContainer, { $size: 20, children: _jsx(FontAwesomeIcon, { icon: faSearch, color: theme.color.text.subtle }) })), _jsx(Input, { id: id, name: name, ref: ref, placeholder: placeholder, $error: otherProps.error, $frontIcon: showIcon, $fallbackStyle: fallbackStyle, autoComplete: "off", role: "combobox", "aria-autocomplete": "list", "aria-expanded": hasResults, "aria-controls": hasResults ? listboxId : undefined, "aria-activedescendant": hasHighlight ? getOptionId(highlightedIndex) : undefined, value: displayedInputText, onFocus: handleClick, onChange: handleInputChange, selected: isSelected, onClick: handleClick, onMouseDown: handleMouseDown, onKeyDown: (event) => {
|
|
202
|
+
return (_jsxs(Wrapper, { ref: wrapperRef, children: [_jsxs(Field, { className: className, renderAsTitle: renderAsTitle, htmlFor: id, assistiveTextId: assistiveTextId, errorMsgId: errorMsgId, ...otherProps, children: [_jsxs(Box, { ref: setInputRow, flex: true, alignItems: "center", justifyContent: "flex-start", children: [showIcon && (_jsx(InputLeadingIconContainer, { $size: 20, children: _jsx(FontAwesomeIcon, { icon: faSearch, color: theme.color.text.subtle }) })), _jsx(Input, { id: id, name: name, ref: ref, placeholder: placeholder, $error: otherProps.error, $frontIcon: showIcon, $fallbackStyle: fallbackStyle, autoComplete: "off", role: "combobox", "aria-autocomplete": "list", "aria-expanded": hasResults, "aria-controls": hasResults ? listboxId : undefined, "aria-activedescendant": hasHighlight ? getOptionId(highlightedIndex) : undefined, value: displayedInputText, onFocus: handleClick, onChange: handleInputChange, selected: isSelected, onClick: handleClick, onMouseDown: handleMouseDown, onKeyDown: (event) => {
|
|
201
203
|
if (event.key === 'ArrowDown' && shouldSelectLabel) {
|
|
202
204
|
event.currentTarget.select();
|
|
203
205
|
}
|
|
@@ -206,7 +208,7 @@ export const SearchInput = forwardRef(function SearchInput({ id: idProp, name =
|
|
|
206
208
|
onBlur?.(e);
|
|
207
209
|
}, ...controlAria }), _jsxs(Icons, { flex: true, alignItems: "center", gap: "space.100", $clearSearch: showClearSearchButton, children: [showClearSearchButton && (_jsx(IconContainer, { title: "Clear search", onClick: handleClearSearch, type: "button", as: "button", $size: 20, style: { cursor: 'pointer' }, children: _jsx(FontAwesomeIcon, { icon: faXmark, color: theme.color.illustration.neutral[400] }) })), _jsx(Line, {}), _jsx(IconContainer, { type: "button", title: "icon-button", as: "button", onClick: handleCaretClick, $size: 20, children: _jsx(FontAwesomeIcon, { style: {
|
|
208
210
|
rotate: showOptions ? '180deg' : '0deg',
|
|
209
|
-
}, icon: faChevronDown, color: theme.color.illustration.neutral[400] }) })] })] }), showOptions && (_jsx(SearchOptions, { displayedList: filteredList, selectedValue: selectedValue, highlightedIndex: highlightedIndex, setHighlightedIndex: setHighlightedIndex, onKeyDown: handleKeyDown, listboxId: listboxId, listboxLabel: otherProps.label ?? placeholder ?? 'Search results', getOptionId: getOptionId, searchTerm: searchQuery || '', onSelect: handleSelect, positionRelative: resultsRelativePosition, resultsBorder: resultsBorder, onNotFound: onNotFound, onEmptyMessageChange: setEmptyMessage, notFoundComponent: notFoundComponent?.(searchQuery ?? '') }))] }), _jsx(LiveRegion, { role: "status", children: noResults ? emptyMessage : '' })] }));
|
|
211
|
+
}, icon: faChevronDown, color: theme.color.illustration.neutral[400] }) })] })] }), showOptions && (_jsx(SearchOptions, { displayedList: filteredList, selectedValue: selectedValue, highlightedIndex: highlightedIndex, setHighlightedIndex: setHighlightedIndex, onKeyDown: handleKeyDown, listboxId: listboxId, listboxLabel: otherProps.label ?? placeholder ?? 'Search results', getOptionId: getOptionId, searchTerm: searchQuery || '', onSelect: handleSelect, anchorElement: inputRow, positionRelative: resultsRelativePosition, resultsBorder: resultsBorder, onNotFound: onNotFound, onEmptyMessageChange: setEmptyMessage, notFoundComponent: notFoundComponent?.(searchQuery ?? '') }))] }), _jsx(LiveRegion, { role: "status", children: noResults ? emptyMessage : '' })] }));
|
|
210
212
|
});
|
|
211
213
|
const Wrapper = styled(Box) `
|
|
212
214
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAsB,MAAM,SAAS,CAAA;AAC5C,OAAO,EAKL,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,OAAO,EACL,KAAK,EACL,yBAAyB,GAC1B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAkB,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EACL,OAAO,EACP,aAAa,EACb,QAAQ,GACT,MAAM,k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,EAAE,eAAe,EACrC,iBAAiB,EAAE,iBAAiB,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,GACzD,CACH,IACK,EACR,KAAC,UAAU,IAAC,IAAI,EAAC,QAAQ,YAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAc,IAC9D,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1B,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;IACzB,cAAc;CACjB,CAAA;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBACR,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;;;CAGvD,CAAA;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;WAEzC,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","sourcesContent":["import Fuse, { IFuseOptions } from 'fuse.js'\nimport {\n ChangeEvent,\n FocusEvent,\n MouseEvent,\n ReactNode,\n forwardRef,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport styled, { useTheme } from 'styled-components'\nimport { Box } from '../Box'\nimport { Field } from '../fields/Field'\nimport { CommonFieldProps } from '../fields/commonFieldTypes'\nimport {\n Input,\n InputLeadingIconContainer,\n} from '../fields/components/CommonInput'\nimport { useOnClickOutside } from '../hooks'\nimport { useUniqueId } from '../utils/id'\nimport { getFieldAria } from '../fields/fieldAria'\nimport { useControllableState } from '../utils/useControlledState'\nimport { SearchKeyEvent, SearchOptions } from './components/SearchOptions'\nimport { visuallyHidden } from '../utils/visuallyHidden'\nimport { IconContainer } from '../sharedStyles/shared.styles'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport {\n faXmark,\n faChevronDown,\n faSearch,\n} from '@awesome.me/kit-46ca99185c/icons/classic/regular'\n\nexport type SearchInputItem = {\n label: string\n value: string\n tags?: any[]\n}\n\nexport interface SearchInputProps extends CommonFieldProps {\n /** Optional input className */\n name?: string\n /** Optional placeholder text */\n placeholder?: string\n /** List of input items to search on*/\n searchList: SearchInputItem[]\n /** callback to handle found item click */\n onFound: (element: string) => void\n /** optional callback to run when no results found */\n onNotFound?: (searchTerm: string) => void\n /** optional Component to render when no results found */\n notFoundComponent?: (searchTerm: string) => ReactNode\n /** optional boolean to show search icon */\n showIcon?: boolean\n /** optional boolean to show a clear search button */\n clearSearch?: boolean\n /** Optional callback to run on blur */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Optional default value for input */\n value?: string\n /** Optional boolean to move results to a realtive position */\n resultsRelativePosition?: boolean\n /** optional boolean to add border to results */\n resultsBorder?: boolean\n /** optional boolean to enable fuzzy search via fuse.js */\n enableFuzzySearch?: boolean\n /** optional config of fuzzy search\n * passing a value to this prop, automatically enables fuzzy search\n */\n fuzzySearchOptions?: IFuseOptions<SearchInputItem>\n}\n\nconst defaultFuzzySearchOptions = {\n keys: [\n {\n name: 'label',\n weight: 0.6,\n },\n {\n name: 'tags',\n weight: 0.4,\n },\n ],\n findAllMatches: true,\n minMatchCharLength: 1,\n location: 0,\n threshold: 0.45,\n distance: 55,\n}\n\nexport const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(\n function SearchInput(\n {\n id: idProp,\n name = 'search_input',\n className = '',\n placeholder,\n searchList,\n showIcon = false,\n renderAsTitle = false,\n value,\n onBlur,\n onFound,\n onNotFound,\n notFoundComponent,\n fallbackStyle,\n resultsRelativePosition = false,\n resultsBorder = true,\n enableFuzzySearch = false,\n fuzzySearchOptions,\n clearSearch,\n ...otherProps\n },\n ref,\n ) {\n const wrapperRef = useRef(null)\n const theme = useTheme()\n const id = useUniqueId(idProp)\n const { assistiveTextId, errorMsgId, controlAria } = getFieldAria(id, {\n ...otherProps,\n renderAsTitle,\n })\n const [showOptions, setShowOptions] = useState(false)\n const [selectedValue, setSelectedValue] = useControllableState<\n string | null\n >({\n initialState: null,\n stateProp: value,\n })\n const [searchQuery, setSearchQuery] = useState<string | null>(null)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [emptyMessage, setEmptyMessage] = useState('')\n\n const selectedValueLabel = searchList.find(\n (option) =>\n option.label === selectedValue || option.value === selectedValue,\n )?.label\n\n const handleBlur = () => {\n setSearchQuery(null)\n }\n\n // Every way of closing the list goes through here, so a reopened list\n // never starts with a stale highlighted option.\n const closeOptions = () => {\n setShowOptions(false)\n setHighlightedIndex(-1)\n }\n\n useOnClickOutside({\n ref: wrapperRef,\n callback: () => {\n handleBlur()\n closeOptions()\n },\n })\n\n const isFuzzySearch = enableFuzzySearch || !!fuzzySearchOptions\n\n const fuse = useMemo(() => {\n if (!isFuzzySearch) {\n return null\n }\n return new Fuse(searchList, {\n ...defaultFuzzySearchOptions,\n ...fuzzySearchOptions,\n })\n }, [isFuzzySearch, searchList, fuzzySearchOptions])\n\n const filteredList = useMemo(() => {\n if (searchQuery === null || searchQuery === '') {\n return searchList\n }\n\n if (fuse) {\n return fuse.search(searchQuery).map(({ item }) => item)\n }\n\n return searchList.filter(({ label }) =>\n label.toLowerCase().includes(searchQuery.toLocaleLowerCase()),\n )\n }, [searchQuery, searchList, fuse])\n\n // If the options change under a highlighted one (e.g. searchList is\n // swapped), clear the highlight so Enter can't pick a different option.\n // Compare values, not identity, so an inline searchList that re-renders\n // with the same options keeps the highlight.\n const optionsKey = useMemo(\n () => filteredList.map((option) => option.value).join('\\n'),\n [filteredList],\n )\n const [highlightedOptionsKey, setHighlightedOptionsKey] =\n useState(optionsKey)\n if (optionsKey !== highlightedOptionsKey) {\n setHighlightedOptionsKey(optionsKey)\n setHighlightedIndex(-1)\n }\n\n const getDisplayedInputText = () => {\n if (searchQuery !== null) {\n return searchQuery\n }\n if (selectedValue !== null) {\n return selectedValueLabel || ''\n }\n return ''\n }\n\n const isSelected = selectedValue !== null\n const displayedInputText = getDisplayedInputText()\n\n const updateSearchQuery = (query: string | null) => {\n setSearchQuery(query)\n setHighlightedIndex(-1)\n\n if (query === null) {\n setSelectedValue(null)\n closeOptions()\n } else {\n setShowOptions(true)\n }\n }\n\n // Reopening a field with a selection usually means changing it, so\n // select the label and let typing replace it rather than append to it\n const shouldSelectLabel =\n !showOptions && searchQuery === null && selectedValue !== null\n\n const handleMouseDown = (event: MouseEvent<HTMLInputElement>) => {\n // Focus and select ourselves, so the browser doesn't place a caret\n // (Safari can otherwise undo the selection on mouseup)\n const input = event.currentTarget\n if (shouldSelectLabel && document.activeElement !== input) {\n event.preventDefault()\n input.focus()\n }\n }\n\n const handleClick = (event: { currentTarget: HTMLInputElement }) => {\n if (shouldSelectLabel) {\n event.currentTarget.select()\n }\n setShowOptions(true)\n if (searchQuery !== null) {\n updateSearchQuery(searchQuery)\n setShowOptions(true)\n }\n }\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>): void => {\n const nextValue = event.currentTarget.value\n updateSearchQuery(nextValue)\n }\n\n const handleSelect = (nextValue: SearchInputItem): void => {\n updateSearchQuery(null)\n setSelectedValue(nextValue.label)\n onFound(nextValue.value)\n }\n\n const handleClearSearch = () => {\n updateSearchQuery(null)\n setSelectedValue(null)\n onFound('')\n }\n\n const handleCaretClick = () => {\n if (showOptions) {\n closeOptions()\n } else {\n setShowOptions(true)\n }\n }\n\n const listboxId = `${id}-listbox`\n const getOptionId = (index: number) => `${id}-option-${index}`\n const hasResults = showOptions && filteredList.length > 0\n const hasHighlight =\n hasResults &&\n highlightedIndex >= 0 &&\n highlightedIndex < filteredList.length\n const noResults = showOptions && filteredList.length === 0\n\n const handleKeyDown = (event: SearchKeyEvent) => {\n if (event.key === 'Escape') {\n if (!showOptions) return\n event.preventDefault()\n event.stopPropagation()\n closeOptions()\n } else if (event.key === 'Enter') {\n if (hasHighlight) {\n event.preventDefault()\n handleSelect(filteredList[highlightedIndex])\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault()\n if (!showOptions) {\n setShowOptions(true)\n } else if (filteredList.length > 0) {\n setHighlightedIndex((highlightedIndex + 1) % filteredList.length)\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n if (showOptions && filteredList.length > 0) {\n setHighlightedIndex(\n (highlightedIndex - 1 + filteredList.length) % filteredList.length,\n )\n }\n }\n }\n\n const showClearSearchButton =\n !!clearSearch && (!!value || !!selectedValue || !!searchQuery)\n\n return (\n <Wrapper ref={wrapperRef}>\n <Field\n className={className}\n renderAsTitle={renderAsTitle}\n htmlFor={id}\n assistiveTextId={assistiveTextId}\n errorMsgId={errorMsgId}\n {...otherProps}\n >\n <Box flex alignItems=\"center\" justifyContent=\"flex-start\">\n {showIcon && (\n <InputLeadingIconContainer $size={20}>\n <FontAwesomeIcon\n icon={faSearch}\n color={theme.color.text.subtle}\n />\n </InputLeadingIconContainer>\n )}\n <Input\n id={id}\n name={name}\n ref={ref}\n placeholder={placeholder}\n $error={otherProps.error}\n $frontIcon={showIcon}\n $fallbackStyle={fallbackStyle}\n autoComplete=\"off\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={hasResults}\n aria-controls={hasResults ? listboxId : undefined}\n aria-activedescendant={\n hasHighlight ? getOptionId(highlightedIndex) : undefined\n }\n value={displayedInputText}\n onFocus={handleClick}\n onChange={handleInputChange}\n selected={isSelected}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown' && shouldSelectLabel) {\n event.currentTarget.select()\n }\n handleKeyDown(event)\n }}\n onBlur={(e) => {\n onBlur?.(e)\n }}\n {...controlAria}\n />\n <Icons\n flex\n alignItems=\"center\"\n gap=\"space.100\"\n $clearSearch={showClearSearchButton}\n >\n {showClearSearchButton && (\n <IconContainer\n title=\"Clear search\"\n onClick={handleClearSearch}\n type=\"button\"\n as=\"button\"\n $size={20}\n style={{ cursor: 'pointer' }}\n >\n <FontAwesomeIcon\n icon={faXmark}\n color={theme.color.illustration.neutral[400]}\n />\n </IconContainer>\n )}\n <Line />\n <IconContainer\n type=\"button\"\n title=\"icon-button\"\n as=\"button\"\n onClick={handleCaretClick}\n $size={20}\n >\n <FontAwesomeIcon\n style={{\n rotate: showOptions ? '180deg' : '0deg',\n }}\n icon={faChevronDown}\n color={theme.color.illustration.neutral[400]}\n />\n </IconContainer>\n </Icons>\n </Box>\n\n {showOptions && (\n <SearchOptions\n displayedList={filteredList}\n selectedValue={selectedValue}\n highlightedIndex={highlightedIndex}\n setHighlightedIndex={setHighlightedIndex}\n onKeyDown={handleKeyDown}\n listboxId={listboxId}\n listboxLabel={otherProps.label ?? placeholder ?? 'Search results'}\n getOptionId={getOptionId}\n searchTerm={searchQuery || ''}\n onSelect={handleSelect}\n positionRelative={resultsRelativePosition}\n resultsBorder={resultsBorder}\n onNotFound={onNotFound}\n onEmptyMessageChange={setEmptyMessage}\n notFoundComponent={notFoundComponent?.(searchQuery ?? '')}\n />\n )}\n </Field>\n <LiveRegion role=\"status\">{noResults ? emptyMessage : ''}</LiveRegion>\n </Wrapper>\n )\n },\n)\n\nconst Wrapper = styled(Box)`\n position: relative;\n`\n\nconst LiveRegion = styled.div`\n ${visuallyHidden}\n`\n\nconst Line = styled(Box)`\n background: ${({ theme }) => theme.color.border.subtle};\n height: 24px;\n width: 1px;\n`\n\nconst Icons = styled(Box)<{ $clearSearch: boolean }>`\n position: relative;\n right: ${({ $clearSearch }) => ($clearSearch ? '80px' : '48px')};\n margin-right: ${({ $clearSearch }) => ($clearSearch ? '-80px' : '-48px')};\n`\n"]}
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"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AAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1B,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;IACzB,cAAc;CACjB,CAAA;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBACR,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;;;CAGvD,CAAA;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;WAEzC,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","sourcesContent":["import Fuse, { IFuseOptions } from 'fuse.js'\nimport {\n ChangeEvent,\n FocusEvent,\n MouseEvent,\n ReactNode,\n forwardRef,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport styled, { useTheme } from 'styled-components'\nimport { Box } from '../Box'\nimport { Field } from '../fields/Field'\nimport { CommonFieldProps } from '../fields/commonFieldTypes'\nimport {\n Input,\n InputLeadingIconContainer,\n} from '../fields/components/CommonInput'\nimport { useOnClickOutside } from '../hooks'\nimport { useUniqueId } from '../utils/id'\nimport { getFieldAria } from '../fields/fieldAria'\nimport { useControllableState } from '../utils/useControlledState'\nimport { SearchKeyEvent, SearchOptions } from './components/SearchOptions'\nimport { visuallyHidden } from '../utils/visuallyHidden'\nimport { IconContainer } from '../sharedStyles/shared.styles'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport {\n faXmark,\n faChevronDown,\n faSearch,\n} from '@awesome.me/kit-46ca99185c/icons/classic/regular'\n\nexport type SearchInputItem = {\n label: string\n value: string\n tags?: any[]\n}\n\nexport interface SearchInputProps extends CommonFieldProps {\n /** Optional input className */\n name?: string\n /** Optional placeholder text */\n placeholder?: string\n /** List of input items to search on*/\n searchList: SearchInputItem[]\n /** callback to handle found item click */\n onFound: (element: string) => void\n /** optional callback to run when no results found */\n onNotFound?: (searchTerm: string) => void\n /** optional Component to render when no results found */\n notFoundComponent?: (searchTerm: string) => ReactNode\n /** optional boolean to show search icon */\n showIcon?: boolean\n /** optional boolean to show a clear search button */\n clearSearch?: boolean\n /** Optional callback to run on blur */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Optional default value for input */\n value?: string\n /** Optional boolean to move results to a realtive position */\n resultsRelativePosition?: boolean\n /** optional boolean to add border to results */\n resultsBorder?: boolean\n /** optional boolean to enable fuzzy search via fuse.js */\n enableFuzzySearch?: boolean\n /** optional config of fuzzy search\n * passing a value to this prop, automatically enables fuzzy search\n */\n fuzzySearchOptions?: IFuseOptions<SearchInputItem>\n}\n\nconst defaultFuzzySearchOptions = {\n keys: [\n {\n name: 'label',\n weight: 0.6,\n },\n {\n name: 'tags',\n weight: 0.4,\n },\n ],\n findAllMatches: true,\n minMatchCharLength: 1,\n location: 0,\n threshold: 0.45,\n distance: 55,\n}\n\nexport const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(\n function SearchInput(\n {\n id: idProp,\n name = 'search_input',\n className = '',\n placeholder,\n searchList,\n showIcon = false,\n renderAsTitle = false,\n value,\n onBlur,\n onFound,\n onNotFound,\n notFoundComponent,\n fallbackStyle,\n resultsRelativePosition = false,\n resultsBorder = true,\n enableFuzzySearch = false,\n fuzzySearchOptions,\n clearSearch,\n ...otherProps\n },\n ref,\n ) {\n const wrapperRef = useRef(null)\n // The results are positioned against the input row\n const [inputRow, setInputRow] = useState<HTMLDivElement | null>(null)\n const theme = useTheme()\n const id = useUniqueId(idProp)\n const { assistiveTextId, errorMsgId, controlAria } = getFieldAria(id, {\n ...otherProps,\n renderAsTitle,\n })\n const [showOptions, setShowOptions] = useState(false)\n const [selectedValue, setSelectedValue] = useControllableState<\n string | null\n >({\n initialState: null,\n stateProp: value,\n })\n const [searchQuery, setSearchQuery] = useState<string | null>(null)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [emptyMessage, setEmptyMessage] = useState('')\n\n const selectedValueLabel = searchList.find(\n (option) =>\n option.label === selectedValue || option.value === selectedValue,\n )?.label\n\n const handleBlur = () => {\n setSearchQuery(null)\n }\n\n // Every way of closing the list goes through here, so a reopened list\n // never starts with a stale highlighted option.\n const closeOptions = () => {\n setShowOptions(false)\n setHighlightedIndex(-1)\n }\n\n useOnClickOutside({\n ref: wrapperRef,\n callback: () => {\n handleBlur()\n closeOptions()\n },\n })\n\n const isFuzzySearch = enableFuzzySearch || !!fuzzySearchOptions\n\n const fuse = useMemo(() => {\n if (!isFuzzySearch) {\n return null\n }\n return new Fuse(searchList, {\n ...defaultFuzzySearchOptions,\n ...fuzzySearchOptions,\n })\n }, [isFuzzySearch, searchList, fuzzySearchOptions])\n\n const filteredList = useMemo(() => {\n if (searchQuery === null || searchQuery === '') {\n return searchList\n }\n\n if (fuse) {\n return fuse.search(searchQuery).map(({ item }) => item)\n }\n\n return searchList.filter(({ label }) =>\n label.toLowerCase().includes(searchQuery.toLocaleLowerCase()),\n )\n }, [searchQuery, searchList, fuse])\n\n // If the options change under a highlighted one (e.g. searchList is\n // swapped), clear the highlight so Enter can't pick a different option.\n // Compare values, not identity, so an inline searchList that re-renders\n // with the same options keeps the highlight.\n const optionsKey = useMemo(\n () => filteredList.map((option) => option.value).join('\\n'),\n [filteredList],\n )\n const [highlightedOptionsKey, setHighlightedOptionsKey] =\n useState(optionsKey)\n if (optionsKey !== highlightedOptionsKey) {\n setHighlightedOptionsKey(optionsKey)\n setHighlightedIndex(-1)\n }\n\n const getDisplayedInputText = () => {\n if (searchQuery !== null) {\n return searchQuery\n }\n if (selectedValue !== null) {\n return selectedValueLabel || ''\n }\n return ''\n }\n\n const isSelected = selectedValue !== null\n const displayedInputText = getDisplayedInputText()\n\n const updateSearchQuery = (query: string | null) => {\n setSearchQuery(query)\n setHighlightedIndex(-1)\n\n if (query === null) {\n setSelectedValue(null)\n closeOptions()\n } else {\n setShowOptions(true)\n }\n }\n\n // Reopening a field with a selection usually means changing it, so\n // select the label and let typing replace it rather than append to it\n const shouldSelectLabel =\n !showOptions && searchQuery === null && selectedValue !== null\n\n const handleMouseDown = (event: MouseEvent<HTMLInputElement>) => {\n // Focus and select ourselves, so the browser doesn't place a caret\n // (Safari can otherwise undo the selection on mouseup)\n const input = event.currentTarget\n if (shouldSelectLabel && document.activeElement !== input) {\n event.preventDefault()\n input.focus()\n }\n }\n\n const handleClick = (event: { currentTarget: HTMLInputElement }) => {\n if (shouldSelectLabel) {\n event.currentTarget.select()\n }\n setShowOptions(true)\n if (searchQuery !== null) {\n updateSearchQuery(searchQuery)\n setShowOptions(true)\n }\n }\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>): void => {\n const nextValue = event.currentTarget.value\n updateSearchQuery(nextValue)\n }\n\n const handleSelect = (nextValue: SearchInputItem): void => {\n updateSearchQuery(null)\n setSelectedValue(nextValue.label)\n onFound(nextValue.value)\n }\n\n const handleClearSearch = () => {\n updateSearchQuery(null)\n setSelectedValue(null)\n onFound('')\n }\n\n const handleCaretClick = () => {\n if (showOptions) {\n closeOptions()\n } else {\n setShowOptions(true)\n }\n }\n\n const listboxId = `${id}-listbox`\n const getOptionId = (index: number) => `${id}-option-${index}`\n const hasResults = showOptions && filteredList.length > 0\n const hasHighlight =\n hasResults &&\n highlightedIndex >= 0 &&\n highlightedIndex < filteredList.length\n const noResults = showOptions && filteredList.length === 0\n\n const handleKeyDown = (event: SearchKeyEvent) => {\n if (event.key === 'Escape') {\n if (!showOptions) return\n event.preventDefault()\n event.stopPropagation()\n closeOptions()\n } else if (event.key === 'Enter') {\n if (hasHighlight) {\n event.preventDefault()\n handleSelect(filteredList[highlightedIndex])\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault()\n if (!showOptions) {\n setShowOptions(true)\n } else if (filteredList.length > 0) {\n setHighlightedIndex((highlightedIndex + 1) % filteredList.length)\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n if (showOptions && filteredList.length > 0) {\n setHighlightedIndex(\n (highlightedIndex - 1 + filteredList.length) % filteredList.length,\n )\n }\n }\n }\n\n const showClearSearchButton =\n !!clearSearch && (!!value || !!selectedValue || !!searchQuery)\n\n return (\n <Wrapper ref={wrapperRef}>\n <Field\n className={className}\n renderAsTitle={renderAsTitle}\n htmlFor={id}\n assistiveTextId={assistiveTextId}\n errorMsgId={errorMsgId}\n {...otherProps}\n >\n <Box\n ref={setInputRow}\n flex\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n >\n {showIcon && (\n <InputLeadingIconContainer $size={20}>\n <FontAwesomeIcon\n icon={faSearch}\n color={theme.color.text.subtle}\n />\n </InputLeadingIconContainer>\n )}\n <Input\n id={id}\n name={name}\n ref={ref}\n placeholder={placeholder}\n $error={otherProps.error}\n $frontIcon={showIcon}\n $fallbackStyle={fallbackStyle}\n autoComplete=\"off\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={hasResults}\n aria-controls={hasResults ? listboxId : undefined}\n aria-activedescendant={\n hasHighlight ? getOptionId(highlightedIndex) : undefined\n }\n value={displayedInputText}\n onFocus={handleClick}\n onChange={handleInputChange}\n selected={isSelected}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown' && shouldSelectLabel) {\n event.currentTarget.select()\n }\n handleKeyDown(event)\n }}\n onBlur={(e) => {\n onBlur?.(e)\n }}\n {...controlAria}\n />\n <Icons\n flex\n alignItems=\"center\"\n gap=\"space.100\"\n $clearSearch={showClearSearchButton}\n >\n {showClearSearchButton && (\n <IconContainer\n title=\"Clear search\"\n onClick={handleClearSearch}\n type=\"button\"\n as=\"button\"\n $size={20}\n style={{ cursor: 'pointer' }}\n >\n <FontAwesomeIcon\n icon={faXmark}\n color={theme.color.illustration.neutral[400]}\n />\n </IconContainer>\n )}\n <Line />\n <IconContainer\n type=\"button\"\n title=\"icon-button\"\n as=\"button\"\n onClick={handleCaretClick}\n $size={20}\n >\n <FontAwesomeIcon\n style={{\n rotate: showOptions ? '180deg' : '0deg',\n }}\n icon={faChevronDown}\n color={theme.color.illustration.neutral[400]}\n />\n </IconContainer>\n </Icons>\n </Box>\n\n {showOptions && (\n <SearchOptions\n displayedList={filteredList}\n selectedValue={selectedValue}\n highlightedIndex={highlightedIndex}\n setHighlightedIndex={setHighlightedIndex}\n onKeyDown={handleKeyDown}\n listboxId={listboxId}\n listboxLabel={otherProps.label ?? placeholder ?? 'Search results'}\n getOptionId={getOptionId}\n searchTerm={searchQuery || ''}\n onSelect={handleSelect}\n anchorElement={inputRow}\n positionRelative={resultsRelativePosition}\n resultsBorder={resultsBorder}\n onNotFound={onNotFound}\n onEmptyMessageChange={setEmptyMessage}\n notFoundComponent={notFoundComponent?.(searchQuery ?? '')}\n />\n )}\n </Field>\n <LiveRegion role=\"status\">{noResults ? emptyMessage : ''}</LiveRegion>\n </Wrapper>\n )\n },\n)\n\nconst Wrapper = styled(Box)`\n position: relative;\n`\n\nconst LiveRegion = styled.div`\n ${visuallyHidden}\n`\n\nconst Line = styled(Box)`\n background: ${({ theme }) => theme.color.border.subtle};\n height: 24px;\n width: 1px;\n`\n\nconst Icons = styled(Box)<{ $clearSearch: boolean }>`\n position: relative;\n right: ${({ $clearSearch }) => ($clearSearch ? '80px' : '48px')};\n margin-right: ${({ $clearSearch }) => ($clearSearch ? '-80px' : '-48px')};\n`\n"]}
|
|
@@ -18,6 +18,11 @@ type SearchOptionsProps = {
|
|
|
18
18
|
listboxId: string;
|
|
19
19
|
listboxLabel: string;
|
|
20
20
|
getOptionId: (index: number) => string;
|
|
21
|
+
/**
|
|
22
|
+
* The element the results sit under. Unless `positionRelative` is set, the
|
|
23
|
+
* results are positioned against it with Floating UI.
|
|
24
|
+
*/
|
|
25
|
+
anchorElement: HTMLElement | null;
|
|
21
26
|
positionRelative: boolean;
|
|
22
27
|
resultsBorder: boolean;
|
|
23
28
|
onNotFound?: (searchTerm: string) => void;
|
|
@@ -1,13 +1,64 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createRef, useEffect, useLayoutEffect, useRef, } from 'react';
|
|
2
|
+
import { createRef, useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
3
|
+
import { autoUpdate, flip, hide, offset, shift, size, useFloating, } from '@floating-ui/react';
|
|
3
4
|
import styled, { css } from 'styled-components';
|
|
4
5
|
import { Box } from '../../Box';
|
|
5
6
|
import { Icon } from '../../Icon';
|
|
6
7
|
import { EmptyResults } from './EmptyResults';
|
|
7
8
|
import { fontStyleMapping } from '../../Text/fontMapping';
|
|
8
|
-
|
|
9
|
+
// The gap between the input and the results, and between the results and the
|
|
10
|
+
// edge of the viewport
|
|
11
|
+
const RESULTS_GAP = 6;
|
|
12
|
+
const VIEWPORT_PADDING = 8;
|
|
13
|
+
const RESULTS_MAX_HEIGHT = 194;
|
|
14
|
+
const AVAILABLE_HEIGHT_VAR = '--search-options-available-height';
|
|
15
|
+
// Records whether the input has a size, which it doesn't without layout
|
|
16
|
+
const recordReferenceSize = {
|
|
17
|
+
name: 'referenceSize',
|
|
18
|
+
fn: ({ rects }) => ({
|
|
19
|
+
data: { hasSize: rects.reference.width > 0 && rects.reference.height > 0 },
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
export const SearchOptions = ({ displayedList, selectedValue, highlightedIndex, setHighlightedIndex, onSelect, onKeyDown, listboxId, listboxLabel, getOptionId, anchorElement, positionRelative, resultsBorder, onNotFound, onEmptyMessageChange, searchTerm, notFoundComponent, }) => {
|
|
9
23
|
const itemRefs = useRef([]);
|
|
10
24
|
const resultsListRef = useRef(null);
|
|
25
|
+
// The side the results open on is decided when they open and then kept, so
|
|
26
|
+
// they don't jump between above and below the input as the list gets
|
|
27
|
+
// shorter or longer while typing.
|
|
28
|
+
const [lockedPlacement, setLockedPlacement] = useState(null);
|
|
29
|
+
// `position: fixed` lets the results escape a scrolling or overflow hidden
|
|
30
|
+
// parent such as a Modal. They stay in the DOM next to the input rather
|
|
31
|
+
// than in a portal, so they remain inside the Modal's focus trap and
|
|
32
|
+
// Escape handling.
|
|
33
|
+
const { refs, floatingStyles, isPositioned, placement, middlewareData } = useFloating({
|
|
34
|
+
elements: { reference: positionRelative ? null : anchorElement },
|
|
35
|
+
strategy: 'fixed',
|
|
36
|
+
placement: lockedPlacement ?? 'bottom-start',
|
|
37
|
+
middleware: [
|
|
38
|
+
offset(RESULTS_GAP),
|
|
39
|
+
lockedPlacement ? undefined : flip({ padding: VIEWPORT_PADDING }),
|
|
40
|
+
shift({ padding: VIEWPORT_PADDING }),
|
|
41
|
+
size({
|
|
42
|
+
padding: VIEWPORT_PADDING,
|
|
43
|
+
apply({ rects, availableHeight, elements }) {
|
|
44
|
+
elements.floating.style.width = `${rects.reference.width}px`;
|
|
45
|
+
elements.floating.style.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight}px`);
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
recordReferenceSize,
|
|
49
|
+
hide(),
|
|
50
|
+
],
|
|
51
|
+
whileElementsMounted: autoUpdate,
|
|
52
|
+
});
|
|
53
|
+
// Set during render rather than in an effect, as Modal does, because the
|
|
54
|
+
// React Compiler lint rule doesn't allow setState in an effect
|
|
55
|
+
if (isPositioned && !lockedPlacement) {
|
|
56
|
+
setLockedPlacement(placement);
|
|
57
|
+
}
|
|
58
|
+
// Hide the results when the input has scrolled out of view. Without layout,
|
|
59
|
+
// as in jsdom, every rect is zero and Floating UI would always hide them.
|
|
60
|
+
const isAnchorHidden = !!middlewareData.hide?.referenceHidden &&
|
|
61
|
+
!!middlewareData.referenceSize?.hasSize;
|
|
11
62
|
useEffect(() => {
|
|
12
63
|
itemRefs.current = displayedList.map((_, i) => itemRefs.current[i] ?? createRef());
|
|
13
64
|
}, [displayedList.length]);
|
|
@@ -53,10 +104,12 @@ export const SearchOptions = ({ displayedList, selectedValue, highlightedIndex,
|
|
|
53
104
|
setHighlightedIndex(-1);
|
|
54
105
|
}, [searchTerm, setHighlightedIndex]);
|
|
55
106
|
// When the list opens, centre the selected option in it. This sets the
|
|
56
|
-
// list's own scrollTop so the page doesn't scroll.
|
|
107
|
+
// list's own scrollTop so the page doesn't scroll. Wait for the position,
|
|
108
|
+
// because that sets the list's final height.
|
|
57
109
|
const hasScrolledToSelected = useRef(false);
|
|
110
|
+
const isReadyToMeasure = positionRelative || isPositioned;
|
|
58
111
|
useLayoutEffect(() => {
|
|
59
|
-
if (hasScrolledToSelected.current)
|
|
112
|
+
if (hasScrolledToSelected.current || !isReadyToMeasure)
|
|
60
113
|
return;
|
|
61
114
|
hasScrolledToSelected.current = true;
|
|
62
115
|
const list = resultsListRef.current;
|
|
@@ -67,30 +120,53 @@ export const SearchOptions = ({ displayedList, selectedValue, highlightedIndex,
|
|
|
67
120
|
selectedItem.offsetTop -
|
|
68
121
|
(list.clientHeight - selectedItem.offsetHeight) / 2;
|
|
69
122
|
}
|
|
70
|
-
}, [displayedList, selectedValue]);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
123
|
+
}, [displayedList, selectedValue, isReadyToMeasure]);
|
|
124
|
+
const results = (_jsx(ResultsList, { $inFlow: positionRelative, ref: resultsListRef, id: listboxId, role: displayedList.length ? 'listbox' : undefined, "aria-label": displayedList.length ? listboxLabel : undefined, $resultsBorder: resultsBorder, onKeyDown: onKeyDown, children: displayedList.length ? (
|
|
125
|
+
// oxlint-disable-next-line react/react-compiler
|
|
126
|
+
displayedList.map((el, i) => {
|
|
127
|
+
const isSelected = selectedValue === el.label || selectedValue === el.value;
|
|
128
|
+
return (_jsxs(ListButton, { id: getOptionId(i), role: "option", "aria-selected": highlightedIndex === i, ref: itemRefs.current[i], onClick: () => onSelect(el), $isSelected: isSelected, $showBg: highlightedIndex === i,
|
|
129
|
+
// Mouse move, not enter, so an option scrolling under a
|
|
130
|
+
// still cursor doesn't take the highlight
|
|
131
|
+
onMouseMove: (event) => highlightWithMouse(i, event.currentTarget), children: [el.label, isSelected && (_jsx(Icon, { render: "tick", size: 16, color: "color.surface.brand.300" }))] }, el.label + '_list_item'));
|
|
132
|
+
})) : (_jsx(EmptyResults, { onNotFound: onNotFound, onMessageChange: onEmptyMessageChange, searchTerm: searchTerm, notFoundComponent: notFoundComponent })) }));
|
|
133
|
+
if (positionRelative) {
|
|
134
|
+
return (_jsx(BoxWithPositionRelative, { children: _jsx(StyledResultsContainer, { children: results }) }));
|
|
135
|
+
}
|
|
136
|
+
return (_jsx(FloatingResults
|
|
137
|
+
// oxlint-disable-next-line react/react-compiler
|
|
138
|
+
, {
|
|
139
|
+
// oxlint-disable-next-line react/react-compiler
|
|
140
|
+
ref: refs.setFloating, style: isAnchorHidden
|
|
141
|
+
? { ...floatingStyles, visibility: 'hidden' }
|
|
142
|
+
: floatingStyles, children: results }));
|
|
80
143
|
};
|
|
144
|
+
// In normal layout flow (`resultsRelativePosition`)
|
|
81
145
|
const StyledResultsContainer = styled.div `
|
|
82
146
|
box-sizing: border-box;
|
|
83
147
|
overflow: hidden;
|
|
84
148
|
margin: -16px;
|
|
85
149
|
padding: ${({ theme }) => theme.space[200]};
|
|
86
|
-
|
|
87
|
-
width: calc(100% + 32px);
|
|
150
|
+
width: calc(100% + 32px);
|
|
88
151
|
left: 0px;
|
|
89
152
|
top: -8px;
|
|
90
153
|
|
|
91
154
|
ul {
|
|
92
155
|
box-sizing: border-box;
|
|
93
|
-
max-height:
|
|
156
|
+
max-height: ${RESULTS_MAX_HEIGHT}px;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
// Positioned by Floating UI. Its width is set to the input's, and the list
|
|
160
|
+
// shrinks to fit the space left in the viewport.
|
|
161
|
+
const FloatingResults = styled.div `
|
|
162
|
+
z-index: 1000;
|
|
163
|
+
|
|
164
|
+
ul {
|
|
165
|
+
box-sizing: border-box;
|
|
166
|
+
max-height: min(
|
|
167
|
+
${RESULTS_MAX_HEIGHT}px,
|
|
168
|
+
var(${AVAILABLE_HEIGHT_VAR}, ${RESULTS_MAX_HEIGHT}px)
|
|
169
|
+
);
|
|
94
170
|
}
|
|
95
171
|
`;
|
|
96
172
|
const ResultsList = styled.ul `
|
|
@@ -101,7 +177,7 @@ const ResultsList = styled.ul `
|
|
|
101
177
|
margin: 0;
|
|
102
178
|
background-color: ${({ theme }) => theme.color.background['000']};
|
|
103
179
|
border-radius: 12px;
|
|
104
|
-
margin-top: 14px;
|
|
180
|
+
${({ $inFlow }) => $inFlow && 'margin-top: 14px;'}
|
|
105
181
|
z-index: 1000;
|
|
106
182
|
border: 1px solid ${({ theme }) => theme.color.border.subtle};
|
|
107
183
|
box-shadow:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchOptions.js","sourceRoot":"","sources":["../../../src/SearchInput/components/SearchOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,SAAS,EACT,SAAS,EACT,eAAe,EACf,MAAM,GACP,MAAM,OAAO,CAAA;AACd,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,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AA+BzD,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,aAAa,E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,EAAE,EAAE,EAAE,CACpB,WAAW;IACX,GAAG,CAAA;0BACmB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;KACjE;CACJ,CAAA;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1C,CAAA","sourcesContent":["import {\n FC,\n ReactNode,\n RefObject,\n createRef,\n useEffect,\n useLayoutEffect,\n useRef,\n} from 'react'\nimport styled, { css } from 'styled-components'\nimport { TransientProps } from '../../utils/utilTypes'\nimport { Box } from '../../Box'\nimport { Icon } from '../../Icon'\nimport { EmptyResults } from './EmptyResults'\nimport { fontStyleMapping } from '../../Text/fontMapping'\n\ntype Option = {\n label: string\n value: string\n}\n\nexport type SearchKeyEvent = {\n key: string\n preventDefault: () => void\n stopPropagation: () => void\n}\n\ntype SearchOptionsProps = {\n displayedList: Array<Option>\n selectedValue: string | null\n highlightedIndex: number\n setHighlightedIndex: (arg: number) => void\n onSelect: (option: Option) => void\n onKeyDown: (e: SearchKeyEvent) => void\n listboxId: string\n listboxLabel: string\n getOptionId: (index: number) => string\n positionRelative: boolean\n resultsBorder: boolean\n onNotFound?: (searchTerm: string) => void\n onEmptyMessageChange: (message: string) => void\n searchTerm: string\n notFoundComponent?: ReactNode\n}\n\nexport const SearchOptions: FC<SearchOptionsProps> = ({\n displayedList,\n selectedValue,\n highlightedIndex,\n setHighlightedIndex,\n onSelect,\n onKeyDown,\n listboxId,\n listboxLabel,\n getOptionId,\n positionRelative,\n resultsBorder,\n onNotFound,\n onEmptyMessageChange,\n searchTerm,\n notFoundComponent,\n}) => {\n const itemRefs = useRef<RefObject<HTMLLIElement | null>[]>([])\n const resultsListRef = useRef<HTMLUListElement>(null)\n\n useEffect(() => {\n itemRefs.current = displayedList.map(\n (_, i) => itemRefs.current[i] ?? createRef<HTMLLIElement>(),\n )\n }, [displayedList.length])\n\n // Only keyboard highlights scroll the list. Scrolling to a hovered option\n // moves the next one under the cursor, which then highlights and scrolls\n // too, so the list runs away from the mouse.\n const highlightedByMouse = useRef(false)\n const highlightWithMouse = (index: number, option: HTMLLIElement) => {\n if (index === highlightedIndex) return\n // The list's edge hit-tests to the option just past it, which is hidden\n const list = resultsListRef.current\n if (\n list?.clientHeight &&\n (option.offsetTop >= list.scrollTop + list.clientHeight ||\n option.offsetTop + option.offsetHeight <= list.scrollTop)\n ) {\n return\n }\n highlightedByMouse.current = true\n setHighlightedIndex(index)\n }\n\n useEffect(() => {\n if (highlightedByMouse.current) {\n highlightedByMouse.current = false\n return\n }\n const focusedListItem = itemRefs?.current[highlightedIndex]?.current\n if (highlightedIndex >= 0 && focusedListItem) {\n focusedListItem.scrollIntoView({\n block: 'nearest',\n inline: 'start',\n })\n }\n }, [highlightedIndex])\n\n // Only reset the scroll when the search term changes, not when the list\n // opens, so the selected option stays centred\n const scrollResetForSearchTerm = useRef(searchTerm)\n useEffect(() => {\n if (\n resultsListRef.current &&\n scrollResetForSearchTerm.current !== searchTerm\n ) {\n resultsListRef.current.scrollTop = 0\n }\n scrollResetForSearchTerm.current = searchTerm\n setHighlightedIndex(-1)\n }, [searchTerm, setHighlightedIndex])\n\n // When the list opens, centre the selected option in it. This sets the\n // list's own scrollTop so the page doesn't scroll.\n const hasScrolledToSelected = useRef(false)\n useLayoutEffect(() => {\n if (hasScrolledToSelected.current) return\n hasScrolledToSelected.current = true\n\n const list = resultsListRef.current\n const selectedIndex = displayedList.findIndex(\n (el) => selectedValue === el.label || selectedValue === el.value,\n )\n const selectedItem = list?.children[selectedIndex] as\n HTMLElement | undefined\n if (list && selectedItem) {\n list.scrollTop =\n selectedItem.offsetTop -\n (list.clientHeight - selectedItem.offsetHeight) / 2\n }\n }, [displayedList, selectedValue])\n\n return (\n <BoxWithPositionRelative>\n <StyledResultsContainer $positionRelative={positionRelative}>\n <ResultsList\n ref={resultsListRef}\n id={listboxId}\n role={displayedList.length ? 'listbox' : undefined}\n aria-label={displayedList.length ? listboxLabel : undefined}\n $resultsBorder={resultsBorder}\n onKeyDown={onKeyDown}\n >\n {displayedList.length ? (\n // oxlint-disable-next-line react/react-compiler\n displayedList.map((el, i) => {\n const isSelected =\n selectedValue === el.label || selectedValue === el.value\n\n return (\n <ListButton\n key={el.label + '_list_item'}\n id={getOptionId(i)}\n role=\"option\"\n aria-selected={highlightedIndex === i}\n ref={itemRefs.current[i]}\n onClick={() => onSelect(el)}\n $isSelected={isSelected}\n $showBg={highlightedIndex === i}\n // Mouse move, not enter, so an option scrolling under a\n // still cursor doesn't take the highlight\n onMouseMove={(event) =>\n highlightWithMouse(i, event.currentTarget)\n }\n >\n {el.label}\n {isSelected && (\n <Icon\n render=\"tick\"\n size={16}\n color=\"color.surface.brand.300\"\n />\n )}\n </ListButton>\n )\n })\n ) : (\n <EmptyResults\n onNotFound={onNotFound}\n onMessageChange={onEmptyMessageChange}\n searchTerm={searchTerm}\n notFoundComponent={notFoundComponent}\n />\n )}\n </ResultsList>\n </StyledResultsContainer>\n </BoxWithPositionRelative>\n )\n}\n\nconst StyledResultsContainer = styled.div<\n TransientProps<Pick<SearchOptionsProps, 'positionRelative'>>\n>`\n box-sizing: border-box;\n overflow: hidden;\n margin: -16px;\n padding: ${({ theme }) => theme.space[200]};\n ${({ $positionRelative }) => !$positionRelative && 'position: absolute;'}\n width: calc(100% + 32px);\n left: 0px;\n top: -8px;\n\n ul {\n box-sizing: border-box;\n max-height: 194px;\n }\n`\n\nconst ResultsList = styled.ul<\n TransientProps<Pick<SearchOptionsProps, 'resultsBorder'>>\n>`\n position: relative;\n list-style: none;\n overflow-y: auto;\n padding: 0;\n margin: 0;\n background-color: ${({ theme }) => theme.color.background['000']};\n border-radius: 12px;\n margin-top: 14px;\n z-index: 1000;\n border: 1px solid ${({ theme }) => theme.color.border.subtle};\n box-shadow:\n 0px 10px 18px rgba(18, 18, 23, 0.03),\n 0px 5px 8px rgba(18, 18, 23, 0.04),\n 0px 2px 4px rgba(18, 18, 23, 0.04);\n\n li {\n padding: 14px;\n box-sizing: border-box;\n ${fontStyleMapping['body-regular']};\n color: ${({ theme }) => theme.color.text.base};\n cursor: pointer;\n }\n`\n\nconst ListButton = styled.li<{ $isSelected: boolean; $showBg: boolean }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n &:focus {\n outline: none;\n }\n &:focus-visible {\n outline: none;\n }\n\n ${({ $showBg }) =>\n $showBg &&\n css`\n background-color: ${({ theme }) => theme.color.background[200]};\n `}\n\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n background-color: ${({ theme }) => theme.color.surface.base[300]};\n `}\n`\n\nconst BoxWithPositionRelative = styled(Box)`\n position: relative;\n`\n"]}
|
|
1
|
+
{"version":3,"file":"SearchOptions.js","sourceRoot":"","sources":["../../../src/SearchInput/components/SearchOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,SAAS,EACT,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,WAAW,GAGZ,MAAM,oBAAoB,CAAA;AAC3B,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,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAoCzD,6EAA6E;AAC7E,uBAAuB;AACvB,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAC1B,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,oBAAoB,GAAG,mCAAmC,CAAA;AAEhE,wEAAwE;AACxE,MAAM,mBAA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,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;KACjE;CACJ,CAAA;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1C,CAAA","sourcesContent":["import {\n FC,\n ReactNode,\n RefObject,\n createRef,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\nimport {\n autoUpdate,\n flip,\n hide,\n offset,\n shift,\n size,\n useFloating,\n type Middleware,\n type Placement,\n} from '@floating-ui/react'\nimport styled, { css } from 'styled-components'\nimport { TransientProps } from '../../utils/utilTypes'\nimport { Box } from '../../Box'\nimport { Icon } from '../../Icon'\nimport { EmptyResults } from './EmptyResults'\nimport { fontStyleMapping } from '../../Text/fontMapping'\n\ntype Option = {\n label: string\n value: string\n}\n\nexport type SearchKeyEvent = {\n key: string\n preventDefault: () => void\n stopPropagation: () => void\n}\n\ntype SearchOptionsProps = {\n displayedList: Array<Option>\n selectedValue: string | null\n highlightedIndex: number\n setHighlightedIndex: (arg: number) => void\n onSelect: (option: Option) => void\n onKeyDown: (e: SearchKeyEvent) => void\n listboxId: string\n listboxLabel: string\n getOptionId: (index: number) => string\n /**\n * The element the results sit under. Unless `positionRelative` is set, the\n * results are positioned against it with Floating UI.\n */\n anchorElement: HTMLElement | null\n positionRelative: boolean\n resultsBorder: boolean\n onNotFound?: (searchTerm: string) => void\n onEmptyMessageChange: (message: string) => void\n searchTerm: string\n notFoundComponent?: ReactNode\n}\n\n// The gap between the input and the results, and between the results and the\n// edge of the viewport\nconst RESULTS_GAP = 6\nconst VIEWPORT_PADDING = 8\nconst RESULTS_MAX_HEIGHT = 194\nconst AVAILABLE_HEIGHT_VAR = '--search-options-available-height'\n\n// Records whether the input has a size, which it doesn't without layout\nconst recordReferenceSize: Middleware = {\n name: 'referenceSize',\n fn: ({ rects }) => ({\n data: { hasSize: rects.reference.width > 0 && rects.reference.height > 0 },\n }),\n}\n\nexport const SearchOptions: FC<SearchOptionsProps> = ({\n displayedList,\n selectedValue,\n highlightedIndex,\n setHighlightedIndex,\n onSelect,\n onKeyDown,\n listboxId,\n listboxLabel,\n getOptionId,\n anchorElement,\n positionRelative,\n resultsBorder,\n onNotFound,\n onEmptyMessageChange,\n searchTerm,\n notFoundComponent,\n}) => {\n const itemRefs = useRef<RefObject<HTMLLIElement | null>[]>([])\n const resultsListRef = useRef<HTMLUListElement>(null)\n\n // The side the results open on is decided when they open and then kept, so\n // they don't jump between above and below the input as the list gets\n // shorter or longer while typing.\n const [lockedPlacement, setLockedPlacement] = useState<Placement | null>(null)\n\n // `position: fixed` lets the results escape a scrolling or overflow hidden\n // parent such as a Modal. They stay in the DOM next to the input rather\n // than in a portal, so they remain inside the Modal's focus trap and\n // Escape handling.\n const { refs, floatingStyles, isPositioned, placement, middlewareData } =\n useFloating({\n elements: { reference: positionRelative ? null : anchorElement },\n strategy: 'fixed',\n placement: lockedPlacement ?? 'bottom-start',\n middleware: [\n offset(RESULTS_GAP),\n lockedPlacement ? undefined : flip({ padding: VIEWPORT_PADDING }),\n shift({ padding: VIEWPORT_PADDING }),\n size({\n padding: VIEWPORT_PADDING,\n apply({ rects, availableHeight, elements }) {\n elements.floating.style.width = `${rects.reference.width}px`\n elements.floating.style.setProperty(\n AVAILABLE_HEIGHT_VAR,\n `${availableHeight}px`,\n )\n },\n }),\n recordReferenceSize,\n hide(),\n ],\n whileElementsMounted: autoUpdate,\n })\n\n // Set during render rather than in an effect, as Modal does, because the\n // React Compiler lint rule doesn't allow setState in an effect\n if (isPositioned && !lockedPlacement) {\n setLockedPlacement(placement)\n }\n\n // Hide the results when the input has scrolled out of view. Without layout,\n // as in jsdom, every rect is zero and Floating UI would always hide them.\n const isAnchorHidden =\n !!middlewareData.hide?.referenceHidden &&\n !!middlewareData.referenceSize?.hasSize\n\n useEffect(() => {\n itemRefs.current = displayedList.map(\n (_, i) => itemRefs.current[i] ?? createRef<HTMLLIElement>(),\n )\n }, [displayedList.length])\n\n // Only keyboard highlights scroll the list. Scrolling to a hovered option\n // moves the next one under the cursor, which then highlights and scrolls\n // too, so the list runs away from the mouse.\n const highlightedByMouse = useRef(false)\n const highlightWithMouse = (index: number, option: HTMLLIElement) => {\n if (index === highlightedIndex) return\n // The list's edge hit-tests to the option just past it, which is hidden\n const list = resultsListRef.current\n if (\n list?.clientHeight &&\n (option.offsetTop >= list.scrollTop + list.clientHeight ||\n option.offsetTop + option.offsetHeight <= list.scrollTop)\n ) {\n return\n }\n highlightedByMouse.current = true\n setHighlightedIndex(index)\n }\n\n useEffect(() => {\n if (highlightedByMouse.current) {\n highlightedByMouse.current = false\n return\n }\n const focusedListItem = itemRefs?.current[highlightedIndex]?.current\n if (highlightedIndex >= 0 && focusedListItem) {\n focusedListItem.scrollIntoView({\n block: 'nearest',\n inline: 'start',\n })\n }\n }, [highlightedIndex])\n\n // Only reset the scroll when the search term changes, not when the list\n // opens, so the selected option stays centred\n const scrollResetForSearchTerm = useRef(searchTerm)\n useEffect(() => {\n if (\n resultsListRef.current &&\n scrollResetForSearchTerm.current !== searchTerm\n ) {\n resultsListRef.current.scrollTop = 0\n }\n scrollResetForSearchTerm.current = searchTerm\n setHighlightedIndex(-1)\n }, [searchTerm, setHighlightedIndex])\n\n // When the list opens, centre the selected option in it. This sets the\n // list's own scrollTop so the page doesn't scroll. Wait for the position,\n // because that sets the list's final height.\n const hasScrolledToSelected = useRef(false)\n const isReadyToMeasure = positionRelative || isPositioned\n useLayoutEffect(() => {\n if (hasScrolledToSelected.current || !isReadyToMeasure) return\n hasScrolledToSelected.current = true\n\n const list = resultsListRef.current\n const selectedIndex = displayedList.findIndex(\n (el) => selectedValue === el.label || selectedValue === el.value,\n )\n const selectedItem = list?.children[selectedIndex] as\n HTMLElement | undefined\n if (list && selectedItem) {\n list.scrollTop =\n selectedItem.offsetTop -\n (list.clientHeight - selectedItem.offsetHeight) / 2\n }\n }, [displayedList, selectedValue, isReadyToMeasure])\n\n const results = (\n <ResultsList\n $inFlow={positionRelative}\n ref={resultsListRef}\n id={listboxId}\n role={displayedList.length ? 'listbox' : undefined}\n aria-label={displayedList.length ? listboxLabel : undefined}\n $resultsBorder={resultsBorder}\n onKeyDown={onKeyDown}\n >\n {displayedList.length ? (\n // oxlint-disable-next-line react/react-compiler\n displayedList.map((el, i) => {\n const isSelected =\n selectedValue === el.label || selectedValue === el.value\n\n return (\n <ListButton\n key={el.label + '_list_item'}\n id={getOptionId(i)}\n role=\"option\"\n aria-selected={highlightedIndex === i}\n ref={itemRefs.current[i]}\n onClick={() => onSelect(el)}\n $isSelected={isSelected}\n $showBg={highlightedIndex === i}\n // Mouse move, not enter, so an option scrolling under a\n // still cursor doesn't take the highlight\n onMouseMove={(event) =>\n highlightWithMouse(i, event.currentTarget)\n }\n >\n {el.label}\n {isSelected && (\n <Icon render=\"tick\" size={16} color=\"color.surface.brand.300\" />\n )}\n </ListButton>\n )\n })\n ) : (\n <EmptyResults\n onNotFound={onNotFound}\n onMessageChange={onEmptyMessageChange}\n searchTerm={searchTerm}\n notFoundComponent={notFoundComponent}\n />\n )}\n </ResultsList>\n )\n\n if (positionRelative) {\n return (\n <BoxWithPositionRelative>\n <StyledResultsContainer>{results}</StyledResultsContainer>\n </BoxWithPositionRelative>\n )\n }\n\n return (\n <FloatingResults\n // oxlint-disable-next-line react/react-compiler\n ref={refs.setFloating}\n style={\n isAnchorHidden\n ? { ...floatingStyles, visibility: 'hidden' }\n : floatingStyles\n }\n >\n {results}\n </FloatingResults>\n )\n}\n\n// In normal layout flow (`resultsRelativePosition`)\nconst StyledResultsContainer = styled.div`\n box-sizing: border-box;\n overflow: hidden;\n margin: -16px;\n padding: ${({ theme }) => theme.space[200]};\n width: calc(100% + 32px);\n left: 0px;\n top: -8px;\n\n ul {\n box-sizing: border-box;\n max-height: ${RESULTS_MAX_HEIGHT}px;\n }\n`\n\n// Positioned by Floating UI. Its width is set to the input's, and the list\n// shrinks to fit the space left in the viewport.\nconst FloatingResults = styled.div`\n z-index: 1000;\n\n ul {\n box-sizing: border-box;\n max-height: min(\n ${RESULTS_MAX_HEIGHT}px,\n var(${AVAILABLE_HEIGHT_VAR}, ${RESULTS_MAX_HEIGHT}px)\n );\n }\n`\n\nconst ResultsList = styled.ul<\n TransientProps<Pick<SearchOptionsProps, 'resultsBorder'>> & {\n $inFlow: boolean\n }\n>`\n position: relative;\n list-style: none;\n overflow-y: auto;\n padding: 0;\n margin: 0;\n background-color: ${({ theme }) => theme.color.background['000']};\n border-radius: 12px;\n ${({ $inFlow }) => $inFlow && 'margin-top: 14px;'}\n z-index: 1000;\n border: 1px solid ${({ theme }) => theme.color.border.subtle};\n box-shadow:\n 0px 10px 18px rgba(18, 18, 23, 0.03),\n 0px 5px 8px rgba(18, 18, 23, 0.04),\n 0px 2px 4px rgba(18, 18, 23, 0.04);\n\n li {\n padding: 14px;\n box-sizing: border-box;\n ${fontStyleMapping['body-regular']};\n color: ${({ theme }) => theme.color.text.base};\n cursor: pointer;\n }\n`\n\nconst ListButton = styled.li<{ $isSelected: boolean; $showBg: boolean }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n &:focus {\n outline: none;\n }\n &:focus-visible {\n outline: none;\n }\n\n ${({ $showBg }) =>\n $showBg &&\n css`\n background-color: ${({ theme }) => theme.color.background[200]};\n `}\n\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n background-color: ${({ theme }) => theme.color.surface.base[300]};\n `}\n`\n\nconst BoxWithPositionRelative = styled(Box)`\n position: relative;\n`\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* An open Modal whose content scrolls, with `children` placed after a long
|
|
7
|
+
* block of text and just before the end. Scrolled to the bottom, `children`
|
|
8
|
+
* sit close to the bottom edge of the viewport, where a menu that opens below
|
|
9
|
+
* them would be clipped by the Modal. Once closed, it can be opened again
|
|
10
|
+
* with a button.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ScrollingModal: FC<Props>;
|
|
13
|
+
/**
|
|
14
|
+
* Scrolls the modal that contains `element` to the bottom, and waits for the
|
|
15
|
+
* scroll event, so that it can't close a menu that is opened straight after
|
|
16
|
+
*/
|
|
17
|
+
export declare const scrollModalToBottom: (element: HTMLElement) => Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button } from '../../Button';
|
|
4
|
+
import { Modal } from '../../Modal';
|
|
5
|
+
import { Text } from '../../Text';
|
|
6
|
+
/**
|
|
7
|
+
* An open Modal whose content scrolls, with `children` placed after a long
|
|
8
|
+
* block of text and just before the end. Scrolled to the bottom, `children`
|
|
9
|
+
* sit close to the bottom edge of the viewport, where a menu that opens below
|
|
10
|
+
* them would be clipped by the Modal. Once closed, it can be opened again
|
|
11
|
+
* with a button.
|
|
12
|
+
*/
|
|
13
|
+
export const ScrollingModal = ({ children }) => {
|
|
14
|
+
const [showModal, setShowModal] = useState(true);
|
|
15
|
+
return (_jsxs(_Fragment, { children: [!showModal && (_jsx(Button, { onClick: () => setShowModal(true), children: "Open modal" })), _jsxs(Modal, { title: "Scrolling modal", showModal: showModal, handleClick: () => setShowModal(false), stickyHeader: true, children: [Array.from({ length: 10 }, (_, index) => (_jsx(Text, { mb: "space.200", children: "The content of this modal is longer than the screen, so the modal scrolls. Scroll down to the field at the bottom." }, index))), children, _jsx(Text, { mt: "space.200", children: "The end of the modal." })] })] }));
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Scrolls the modal that contains `element` to the bottom, and waits for the
|
|
19
|
+
* scroll event, so that it can't close a menu that is opened straight after
|
|
20
|
+
*/
|
|
21
|
+
export const scrollModalToBottom = async (element) => {
|
|
22
|
+
const scrollArea = element.closest('[role="dialog"]')?.firstElementChild;
|
|
23
|
+
if (!scrollArea)
|
|
24
|
+
return;
|
|
25
|
+
scrollArea.scrollTop = scrollArea.scrollHeight;
|
|
26
|
+
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ScrollingModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollingModal.js","sourceRoot":"","sources":["../../../src/utils/storybookHelpers/ScrollingModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAMjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEhD,OAAO,CACL,8BACG,CAAC,SAAS,IAAI,CACb,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,2BAAqB,CAC/D,EACD,MAAC,KAAK,IACJ,KAAK,EAAC,iBAAiB,EACvB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EACtC,YAAY,mBAEX,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,KAAC,IAAI,IAAa,EAAE,EAAC,WAAW,oIAArB,KAAK,CAGT,CACR,CAAC,EACD,QAAQ,EACT,KAAC,IAAI,IAAC,EAAE,EAAC,WAAW,sCAA6B,IAC3C,IACP,CACJ,CAAA;AACH,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,OAAoB,EAAE,EAAE;IAChE,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACxE,IAAI,CAAC,UAAU;QAAE,OAAM;IACvB,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,YAAY,CAAA;IAC9C,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,qBAAqB,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAC5D,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { FC, ReactNode, useState } from 'react'\nimport { Button } from '../../Button'\nimport { Modal } from '../../Modal'\nimport { Text } from '../../Text'\n\ntype Props = {\n children: ReactNode\n}\n\n/**\n * An open Modal whose content scrolls, with `children` placed after a long\n * block of text and just before the end. Scrolled to the bottom, `children`\n * sit close to the bottom edge of the viewport, where a menu that opens below\n * them would be clipped by the Modal. Once closed, it can be opened again\n * with a button.\n */\nexport const ScrollingModal: FC<Props> = ({ children }) => {\n const [showModal, setShowModal] = useState(true)\n\n return (\n <>\n {!showModal && (\n <Button onClick={() => setShowModal(true)}>Open modal</Button>\n )}\n <Modal\n title=\"Scrolling modal\"\n showModal={showModal}\n handleClick={() => setShowModal(false)}\n stickyHeader\n >\n {Array.from({ length: 10 }, (_, index) => (\n <Text key={index} mb=\"space.200\">\n The content of this modal is longer than the screen, so the modal\n scrolls. Scroll down to the field at the bottom.\n </Text>\n ))}\n {children}\n <Text mt=\"space.200\">The end of the modal.</Text>\n </Modal>\n </>\n )\n}\n\n/**\n * Scrolls the modal that contains `element` to the bottom, and waits for the\n * scroll event, so that it can't close a menu that is opened straight after\n */\nexport const scrollModalToBottom = async (element: HTMLElement) => {\n const scrollArea = element.closest('[role=\"dialog\"]')?.firstElementChild\n if (!scrollArea) return\n scrollArea.scrollTop = scrollArea.scrollHeight\n await new Promise((resolve) =>\n requestAnimationFrame(() => requestAnimationFrame(resolve)),\n )\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrshmllw/smores-react",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.15.0",
|
|
4
4
|
"description": "Collection of React components used by Marshmallow Technology",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -52,49 +52,49 @@
|
|
|
52
52
|
"@floating-ui/react": "0.27.20",
|
|
53
53
|
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
54
54
|
"@fortawesome/react-fontawesome": "^3.1.1",
|
|
55
|
-
"@lexical/code-core": "^0.
|
|
56
|
-
"@lexical/code-shiki": "^0.
|
|
57
|
-
"@lexical/react": "^0.
|
|
58
|
-
"@lexical/selection": "^0.
|
|
59
|
-
"@lexical/utils": "^0.
|
|
55
|
+
"@lexical/code-core": "^0.53.0",
|
|
56
|
+
"@lexical/code-shiki": "^0.53.0",
|
|
57
|
+
"@lexical/react": "^0.53.0",
|
|
58
|
+
"@lexical/selection": "^0.53.0",
|
|
59
|
+
"@lexical/utils": "^0.53.0",
|
|
60
60
|
"@mrshmllw/smores-foundations": "^1.2.0",
|
|
61
61
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
62
62
|
"date-fns": "^4.4.0",
|
|
63
|
-
"dompurify": "^3.4.
|
|
63
|
+
"dompurify": "^3.4.18",
|
|
64
64
|
"fuse.js": "^7.5.0",
|
|
65
|
-
"lexical": "^0.
|
|
65
|
+
"lexical": "^0.53.0",
|
|
66
66
|
"polished": "^4.3.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@commitlint/cli": "^21.2.
|
|
69
|
+
"@commitlint/cli": "^21.2.4",
|
|
70
70
|
"@mrshmllw/campfire": "^7.1.0",
|
|
71
|
-
"@snyk/protect": "^1.
|
|
72
|
-
"@storybook/addon-a11y": "^10.6.
|
|
71
|
+
"@snyk/protect": "^1.1309.0",
|
|
72
|
+
"@storybook/addon-a11y": "^10.6.7",
|
|
73
73
|
"@storybook/addon-coverage": "^3.0.2",
|
|
74
|
-
"@storybook/addon-docs": "^10.6.
|
|
75
|
-
"@storybook/addon-links": "^10.6.
|
|
76
|
-
"@storybook/react-vite": "^10.6.
|
|
77
|
-
"@storybook/test-runner": "^0.26.
|
|
74
|
+
"@storybook/addon-docs": "^10.6.7",
|
|
75
|
+
"@storybook/addon-links": "^10.6.7",
|
|
76
|
+
"@storybook/react-vite": "^10.6.7",
|
|
77
|
+
"@storybook/test-runner": "^0.26.1",
|
|
78
78
|
"@testing-library/jest-dom": "^7.0.1",
|
|
79
79
|
"@testing-library/react": "^16.3.3",
|
|
80
80
|
"@types/body-scroll-lock": "^3.1.2",
|
|
81
|
-
"@types/node": "^26.6.
|
|
81
|
+
"@types/node": "^26.6.6",
|
|
82
82
|
"@types/react": "^19.3.0",
|
|
83
83
|
"@types/react-dom": "^19.3.0",
|
|
84
84
|
"axe-playwright": "^2.2.2",
|
|
85
|
-
"concurrently": "^10.0.
|
|
85
|
+
"concurrently": "^10.0.7",
|
|
86
86
|
"eslint-plugin-prettier": "^5.5.7",
|
|
87
87
|
"husky": "^9.1.7",
|
|
88
|
-
"jest-styled-components": "^7.4.
|
|
89
|
-
"jsdom": "^
|
|
90
|
-
"lint-staged": "^17.6.
|
|
88
|
+
"jest-styled-components": "^7.4.1",
|
|
89
|
+
"jsdom": "^31.0.1",
|
|
90
|
+
"lint-staged": "^17.6.1",
|
|
91
91
|
"oxlint": "^1.78.0",
|
|
92
|
-
"oxlint-tsgolint": "^7.0.
|
|
92
|
+
"oxlint-tsgolint": "^7.0.2007",
|
|
93
93
|
"playwright": "^1.62.1",
|
|
94
94
|
"prettier": "^3.9.6",
|
|
95
95
|
"react": "^19.3.1",
|
|
96
96
|
"react-dom": "^19.3.1",
|
|
97
|
-
"rimraf": "^6.1.
|
|
97
|
+
"rimraf": "^6.1.4",
|
|
98
98
|
"storybook": "^10.2.13",
|
|
99
99
|
"styled-components": "^6.6.0",
|
|
100
100
|
"typescript": "^7.0.2",
|