@contentful/f36-autocomplete 6.7.1 → 6.7.2

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Autocomplete.tsx","../../src/Autocomplete.styles.ts","../../src/AutocompleteItems.tsx"],"names":["getAutocompleteStyles","listMaxHeight","css","tokens","isActive","isDisabled","cx","getMenuItemStyles","AutocompleteItems","props","items","elementStartIndex","highlightedIndex","getItemProps","renderItem","inputValue","styles","renderHighlightedItem","item","React","HighlightedItem","index","itemIndex","itemProps","Text","__spreadProps","__spreadValues","before","match","after","getStringMatch","AutocompleteBase","ref","isOpenProp","onClose","onOpen","id","className","textOnAfterSelect","closeAfterSelect","defaultValue","selectedItem","inputValueProp","onInputValueChange","onSelectItem","onFocus","onBlur","icon","CaretDownIcon","itemToString","isInvalid","isRequired","isReadOnly","showEmptyList","noMatchesMessage","placeholder","inputRefProp","toggleRef","listRef","listWidth","isGrouped","isLoading","usePortal","testId","popoverTestId","showClearButtonProp","aria","_inputValue","setInputValue","useState","inputRef","useRef","handleInputValueChange","useCallback","value","handleNativeChangeEvent","event","flattenItems","isUsingGroups","acc","group","isShowingNoMatches","getInputProps","getMenuProps","getToggleButtonProps","isOpen","toggleMenu","useCombobox","state","type","changes","_a","_labelledby","_inputId","inputProps","__objRest","toggleProps","menuRef","menuProps","showClearButton","Popover","TextInput","mergeRefs","IconButton","XIcon","_","ListItemLoadingState","Subheading","render","SectionHeading","Skeleton","Autocomplete"],"mappings":"4kBAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,EAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,IAAA,EAAA,CAAA,MAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,oBAAA,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CAKJ,SAAShC,EACPlB,CAAAA,CACAlD,CAAAA,CACuC,CACvC,OAAOkD,CACT,CAOO,IAAMmD,EAAAA,CAAe5F,CAAAA,CAAM,WAAWY,EAAgB","file":"index.js","sourcesContent":["import React, { useCallback, useRef, useState } from 'react';\nimport { cx } from '@emotion/css';\nimport { useCombobox } from 'downshift';\n\nimport {\n mergeRefs,\n type CommonProps,\n type ExpandProps,\n} from '@contentful/f36-core';\nimport { IconButton } from '@contentful/f36-button';\nimport { TextInput, type TextInputProps } from '@contentful/f36-forms';\nimport { XIcon, CaretDownIcon } from '@contentful/f36-icons';\nimport { Skeleton } from '@contentful/f36-skeleton';\nimport { Popover } from '@contentful/f36-popover';\nimport { Subheading, SectionHeading } from '@contentful/f36-typography';\n\nimport { AutocompleteItems } from './AutocompleteItems';\nimport { getAutocompleteStyles } from './Autocomplete.styles';\nimport tokens from '@contentful/f36-tokens';\n\nexport interface GenericGroupType<ItemType> {\n groupTitle: string;\n options: ItemType[];\n}\nexport interface AutocompleteProps<ItemType>\n extends CommonProps,\n Pick<\n TextInputProps,\n | 'isDisabled'\n | 'isInvalid'\n | 'isReadOnly'\n | 'isRequired'\n | 'id'\n | 'defaultValue'\n > {\n /**\n * It’s an array of data to be used as \"options\" by the autocomplete component.\n * This can either be a plain list of items or a list of groups of items.\n */\n items: ItemType[] | GenericGroupType<ItemType>[];\n\n /**\n * Boolean to control whether the Autocomplete menu is open\n */\n isOpen?: boolean;\n\n /**\n * Callback fired when the Autocomplete menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Autocomplete menu closes\n */\n onClose?: () => void;\n\n /**\n * Set a custom icon for the text input\n */\n icon?: React.ReactElement;\n\n /**\n * Tells if the item is a object with groups\n */\n isGrouped?: boolean;\n\n /**\n * Set the value of the text input\n */\n inputValue?: string;\n /**\n * Function called whenever the input value changes\n */\n onInputValueChange?: (value: string) => void;\n /**\n * This is the function that will be called when the user selects one of the \"options\" in the list.\n * The component will pass the selected \"item\" as an argument to the function..\n */\n onSelectItem: (item: ItemType) => void;\n\n /**\n * Applying the selectedItem property turns autocomplete into a controlled component.\n * Can be used to display e.g. previously selected element. If it is an object the itemToString function will apply to it.\n */\n selectedItem?: ItemType;\n\n /**\n * This is the function that will be called for each \"item\" passed in the `items` prop.\n * It receives the \"item\" and \"inputValue\" as arguments and returns a ReactNode.\n * The inputValue is passed in case you want to highlight the match on the render.\n */\n renderItem?: (item: ItemType, inputValue: string) => React.ReactNode;\n /**\n * When using objects as `items`, we recommend passing a function that tells Downshift how to extract a string\n * from those objetcs to be used as inputValue\n */\n itemToString?: (item: ItemType) => string;\n /**\n * Text input behaviour after an item is selected\n * @default \"replace\"\n */\n textOnAfterSelect?: 'clear' | 'preserve' | 'replace';\n /**\n * If this is set to `false` the dropdown menu will stay open after selecting an item\n * @default true\n */\n closeAfterSelect?: boolean;\n /**\n * This is the value will be passed to the `placeholder` prop of the input.\n * @default \"Search\"\n */\n placeholder?: string;\n /**\n * Defines if the list should be shown even if empty, when input is focused\n * @default false\n */\n showEmptyList?: boolean;\n /**\n * A message that will be shown when it is not possible to find any option that matches the input value\n * @default \"No matches\"\n */\n noMatchesMessage?: string;\n /**\n * Use this prop to get a ref to the input element of the component\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Use this prop to get a ref to the toggle button of the component\n */\n toggleRef?: React.Ref<HTMLButtonElement>;\n /**\n * Use this prop to get a ref to the list of items of the component\n */\n listRef?: React.Ref<HTMLUListElement>;\n /**\n * It sets the width of the list\n * @default \"auto\"\n */\n listWidth?: 'auto' | 'full';\n /**\n * It sets the max-height, in pixels, of the list\n * The default value is the height of 5 single line items\n * @default 180\n */\n listMaxHeight?: number;\n /**\n * Sets the list to show its loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * Boolean to control whether or not to render the suggestions box in a React Portal.\n * Rendering content inside a Portal allows the suggestions box to escape the bounds\n * of its parent while still being positioned correctly.\n * Defaults to `false`\n */\n usePortal?: boolean;\n\n /**\n * A [data-test-id] attribute for the suggestions box used for testing purposes\n */\n popoverTestId?: string;\n\n /**\n * Function called when the input is focused\n *\n * @param event\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Function called when the input is blurred\n * @param event\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Manually control when the button to clear the input value is shown\n */\n showClearButton?: boolean;\n /**\n * Additional aria attributes\n */\n aria?: {\n showListIconLabel?: string;\n clearSelectionIconLabel?: string;\n };\n}\n\nfunction AutocompleteBase<ItemType>(\n props: AutocompleteProps<ItemType>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n isOpen: isOpenProp,\n onClose,\n onOpen,\n id,\n className,\n textOnAfterSelect = 'replace',\n closeAfterSelect = true,\n defaultValue = '',\n selectedItem,\n items,\n inputValue: inputValueProp,\n onInputValueChange,\n onSelectItem,\n onFocus,\n onBlur,\n renderItem,\n icon = <CaretDownIcon color={tokens.gray600} />,\n itemToString = (item: ItemType) => item as unknown as string,\n isInvalid,\n isDisabled,\n isRequired,\n isReadOnly,\n showEmptyList,\n noMatchesMessage = 'No matches found',\n placeholder = 'Search',\n inputRef: inputRefProp,\n toggleRef,\n listRef,\n listWidth = 'auto',\n listMaxHeight = 180,\n isGrouped = false,\n isLoading = false,\n usePortal = false,\n testId = 'cf-autocomplete',\n popoverTestId = 'cf-autocomplete-container',\n showClearButton: showClearButtonProp,\n aria = {\n clearSelectionIconLabel: 'Clear',\n showListIconLabel: 'Show list',\n },\n } = props;\n\n type GroupType = GenericGroupType<ItemType>;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const [_inputValue, setInputValue] = useState(defaultValue);\n const inputValue =\n typeof inputValueProp === 'undefined' ? _inputValue : inputValueProp;\n const inputRef = useRef(null);\n\n const handleInputValueChange = useCallback(\n (value: string) => {\n setInputValue(value);\n\n onInputValueChange?.(value);\n },\n [onInputValueChange],\n );\n\n // Handle manually to avoid a jumping cursor, see https://github.com/downshift-js/downshift/issues/1108#issuecomment-842407759\n const handleNativeChangeEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = event.target.value;\n handleInputValueChange(value);\n },\n [handleInputValueChange],\n );\n\n const flattenItems = isUsingGroups(isGrouped, items)\n ? items.reduce(\n (acc: ItemType[], group: GroupType) => [...acc, ...group.options],\n [],\n )\n : items;\n\n const isShowingNoMatches = isUsingGroups(isGrouped, items)\n ? items.every((group: GroupType) => group.options.length === 0)\n : items.length === 0;\n\n const {\n getInputProps,\n getItemProps,\n getMenuProps,\n getToggleButtonProps,\n highlightedIndex,\n isOpen,\n toggleMenu,\n } = useCombobox({\n isOpen: isOpenProp,\n onIsOpenChange: ({ isOpen }) => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n },\n stateReducer: (state, { type, changes }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputBlur: {\n // don't change input value on blur\n return { ...changes, inputValue: state.inputValue };\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick: {\n // prevent the menu from being closed when the user selects an item with a keyboard or mouse\n if (!closeAfterSelect) {\n return {\n ...changes,\n isOpen: state.isOpen,\n };\n }\n\n return changes;\n }\n default:\n return changes;\n }\n },\n items: flattenItems,\n selectedItem,\n inputValue,\n itemToString,\n onInputValueChange: ({ type, inputValue }) => {\n switch (type) {\n // value is set directly from the TextInput onChange handler\n case useCombobox.stateChangeTypes.InputChange: {\n return;\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.ItemClick:\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n // clear the TextInput value\n if (textOnAfterSelect === 'clear') {\n handleInputValueChange('');\n return;\n }\n\n // keep the current TextInput value\n if (textOnAfterSelect === 'preserve') {\n return;\n }\n }\n }\n\n handleInputValueChange(inputValue);\n },\n onStateChange: ({ type, selectedItem }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick:\n if (selectedItem) {\n onSelectItem(selectedItem);\n }\n break;\n default:\n break;\n }\n },\n });\n\n const {\n 'aria-labelledby': _labelledby,\n id: _inputId,\n ...inputProps\n } = getInputProps({ ref: inputRef });\n const toggleProps = getToggleButtonProps();\n const menuRef = useRef(null);\n const menuProps = getMenuProps({ ref: menuRef });\n let elementStartIndex = 0;\n\n const showClearButton = showClearButtonProp ?? inputValue;\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles.autocomplete, className)}\n ref={ref}\n >\n <Popover\n usePortal={usePortal}\n isOpen={isOpen}\n isFullWidth={listWidth === 'full'}\n renderOnlyWhenOpen={false}\n // This is necessary, otherwise the focus will change from the input to the Popover\n // and the user won't be able to type in the input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n id={menuProps.id}\n >\n <Popover.Trigger>\n <div>\n <TextInput\n className={styles.inputField}\n {...inputProps}\n onFocus={(e) => {\n onFocus?.(e as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n onBlur?.(e as React.FocusEvent<HTMLInputElement>);\n inputProps.onBlur(e);\n }}\n id={id}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n ref={mergeRefs(inputProps.ref, inputRefProp)}\n testId=\"cf-autocomplete-input\"\n placeholder={placeholder}\n onChange={(event) => {\n inputProps.onChange(event);\n handleNativeChangeEvent(event);\n }}\n />\n <IconButton\n {...toggleProps}\n ref={mergeRefs(toggleProps.ref, toggleRef)}\n aria-label={\n showClearButton\n ? aria.clearSelectionIconLabel\n : aria.showListIconLabel\n }\n className={styles.toggleButton}\n variant=\"transparent\"\n icon={showClearButton ? <XIcon color={tokens.gray600} /> : icon}\n onClick={() => {\n if (showClearButton) {\n handleInputValueChange('');\n } else {\n toggleMenu();\n }\n }}\n isDisabled={isDisabled}\n size=\"small\"\n />\n </div>\n </Popover.Trigger>\n\n {items.length > 0 || inputValue.length > 0 || showEmptyList ? (\n <Popover.Content\n {...menuProps}\n ref={mergeRefs(menuProps.ref, listRef)}\n className={styles.content}\n testId={popoverTestId}\n >\n {isLoading &&\n [...Array(3)].map((_, index) => (\n <div\n key={index}\n className={cx(styles.item({ isDisabled: true }))}\n >\n <ListItemLoadingState />\n </div>\n ))}\n\n {!isLoading && isShowingNoMatches && (\n <div className={styles.item({})}>\n <Subheading className={styles.noMatchesTitle}>\n {noMatchesMessage}\n </Subheading>\n </div>\n )}\n\n {!isLoading &&\n isUsingGroups(isGrouped, items) &&\n items.map((group: GroupType, index: number) => {\n if (group.options.length < 1) {\n return;\n }\n const render = (\n <div key={index}>\n <SectionHeading\n key={index}\n data-test-id=\"cf-autocomplete-grouptitle\"\n marginBottom=\"none\"\n className={styles.groupTitle}\n >\n {group.groupTitle}\n </SectionHeading>\n <AutocompleteItems<ItemType>\n items={group.options}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n elementStartIndex={elementStartIndex}\n />\n </div>\n );\n elementStartIndex += group.options.length;\n return render;\n })}\n\n {!isLoading &&\n !isUsingGroups(isGrouped, items) &&\n items.length > 0 && (\n <AutocompleteItems<ItemType>\n items={items}\n elementStartIndex={elementStartIndex}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n />\n )}\n </Popover.Content>\n ) : (\n // We need to render an empty hidden div, so we can pass the menuProps or downshift will show a warning about it\n // https://github.com/downshift-js/downshift/issues/1167#issuecomment-1088022842\n <div {...menuProps} className={cx(styles.hidden)} />\n )}\n </Popover>\n </div>\n );\n}\n\nconst ListItemLoadingState = () => {\n return (\n <Skeleton.Container svgHeight={16}>\n <Skeleton.BodyText numberOfLines={1} />\n </Skeleton.Container>\n );\n};\n\n// This is required to infer correct typings when differentiating groups and items\nfunction isUsingGroups<ItemType>(\n isGrouped: boolean,\n items: ItemType[] | GenericGroupType<ItemType>[],\n): items is GenericGroupType<ItemType>[] {\n return isGrouped;\n}\n\n/**\n * The Autocomplete is a component that will show a `TextInput` where a user can type any word which will be used\n * to filter a list of items. That list of filtered items will be shown to the user as possible options for the input.\n * Once one of the options is selected, that option becomes the value of the `TextInput`.\n */\nexport const Autocomplete = React.forwardRef(AutocompleteBase) as <T>(\n props: ExpandProps<AutocompleteProps<T>> & {\n ref?: React.Ref<HTMLDivElement>;\n },\n) => ReturnType<typeof AutocompleteBase>;\n","import { css, cx } from '@emotion/css';\nimport tokens from '@contentful/f36-tokens';\nimport { getMenuItemStyles } from '@contentful/f36-core';\n\nexport const getAutocompleteStyles = (listMaxHeight: number) => ({\n autocomplete: css({\n position: 'relative',\n width: '100%',\n }),\n inputField: css({\n paddingRight: tokens.spacingXl,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n toggleButton: css({\n position: 'absolute',\n top: '1px',\n right: '1px',\n zIndex: 1,\n padding: tokens.spacing2Xs,\n minHeight: 'calc(100% - 2px)',\n }),\n content: css({\n overflow: 'auto',\n maxHeight: `${listMaxHeight}px`,\n }),\n list: css({\n listStyle: 'none',\n padding: `${tokens.spacingXs} ${tokens.spacing2Xs}`,\n margin: 0,\n }),\n groupTitle: css({\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n }),\n noMatchesTitle: css({\n color: tokens.gray500,\n margin: `${tokens.spacingM} 0 ${tokens.spacingM} 0`,\n }),\n item: ({\n isActive = false,\n isDisabled = false,\n }: {\n isActive?: boolean;\n isDisabled?: boolean;\n }) => cx(getMenuItemStyles({ isActive, isDisabled })),\n highlighted: css({\n backgroundColor: tokens.gray100,\n }),\n hidden: css({\n display: 'none',\n }),\n});\n","import React, { HTMLAttributes } from 'react';\nimport { cx } from '@emotion/css';\nimport { getStringMatch } from '@contentful/f36-utils';\nimport type { UseComboboxGetItemPropsOptions } from 'downshift';\nimport { Text } from '@contentful/f36-typography';\n\nimport { getAutocompleteStyles } from './Autocomplete.styles';\n\ninterface AutocompleteItemsProps<ItemType> {\n items: ItemType[];\n elementStartIndex: number;\n highlightedIndex: number;\n getItemProps: (\n options: UseComboboxGetItemPropsOptions<ItemType>,\n ) => HTMLAttributes<HTMLLIElement>;\n renderItem: (item: ItemType, inputValue: string) => React.ReactNode;\n inputValue: string;\n listMaxHeight?: number;\n}\n\nexport const AutocompleteItems = <ItemType,>(\n props: AutocompleteItemsProps<ItemType>,\n) => {\n const {\n items,\n elementStartIndex,\n highlightedIndex,\n getItemProps,\n renderItem,\n inputValue,\n listMaxHeight = 180,\n } = props;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const renderHighlightedItem = (item: ItemType, inputValue) => {\n if (renderItem) {\n return renderItem(item, inputValue);\n }\n if (typeof item === 'string') {\n return <HighlightedItem item={item} inputValue={inputValue} />;\n }\n if (!React.isValidElement(item)) {\n // eslint-disable-next-line no-console\n console.error(\n 'Only valid React elements are supported - https://react.dev/reference/react/isValidElement',\n );\n return null;\n }\n return item;\n };\n\n return (\n <ul className={styles.list} data-test-id=\"cf-autocomplete-list\">\n {items.map((item: ItemType, index: number) => {\n const itemIndex = elementStartIndex + index;\n const itemProps = getItemProps({ item, index: itemIndex });\n return (\n <Text\n {...itemProps}\n as=\"li\"\n key={itemIndex}\n className={cx([\n styles.item({}),\n highlightedIndex === itemIndex && styles.highlighted,\n ])}\n data-highlighted={highlightedIndex === itemIndex}\n data-test-id={`cf-autocomplete-list-item-${itemIndex}`}\n >\n {renderHighlightedItem(item, inputValue)}\n </Text>\n );\n })}\n </ul>\n );\n};\n\nAutocompleteItems.displayName = 'AutocompleteItems';\n\nfunction HighlightedItem({\n item,\n inputValue,\n}: {\n item: string;\n inputValue: string;\n}) {\n const { before, match, after } = getStringMatch(item, inputValue);\n\n return (\n <>\n {before}\n <b>{match}</b>\n {after}\n </>\n );\n}\n\nHighlightedItem.displayName = 'HighlightedItem';\n"]}
1
+ {"version":3,"sources":["../../src/Autocomplete.tsx","../../src/Autocomplete.styles.ts","../../src/AutocompleteItems.tsx"],"names":["getAutocompleteStyles","listMaxHeight","css","tokens","isActive","isDisabled","cx","getMenuItemStyles","AutocompleteItems","props","items","elementStartIndex","highlightedIndex","getItemProps","renderItem","inputValue","styles","renderHighlightedItem","item","React","HighlightedItem","index","itemIndex","itemProps","Text","__spreadProps","__spreadValues","before","match","after","getStringMatch","AutocompleteBase","ref","isOpenProp","onClose","onOpen","id","className","textOnAfterSelect","closeAfterSelect","defaultValue","selectedItem","inputValueProp","onInputValueChange","onSelectItem","onFocus","onBlur","icon","CaretDownIcon","itemToString","isInvalid","isRequired","isReadOnly","showEmptyList","noMatchesMessage","placeholder","inputRefProp","toggleRef","listRef","listWidth","isGrouped","isLoading","usePortal","testId","popoverTestId","showClearButtonProp","aria","_inputValue","setInputValue","useState","inputRef","useRef","handleInputValueChange","useCallback","value","handleNativeChangeEvent","event","flattenItems","isUsingGroups","acc","group","isShowingNoMatches","getInputProps","getMenuProps","getToggleButtonProps","isOpen","toggleMenu","useCombobox","state","type","changes","_a","_labelledby","_inputId","inputProps","__objRest","toggleProps","menuRef","menuProps","showClearButton","Popover","TextInput","mergeRefs","IconButton","XIcon","_","ListItemLoadingState","Subheading","render","SectionHeading","Skeleton","Autocomplete"],"mappings":"4kBAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,EAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,IAAA,EAAA,CAAA,MAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,YAAA,CAAA,IAAA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port { cx } from '@emotion/css';\nimport { useCombobox } from 'downshift';\n\nimport {\n mergeRefs,\n type CommonProps,\n type ExpandProps,\n} from '@contentful/f36-core';\nimport { IconButton } from '@contentful/f36-button';\nimport { TextInput, type TextInputProps } from '@contentful/f36-forms';\nimport { XIcon, CaretDownIcon } from '@contentful/f36-icons';\nimport { Skeleton } from '@contentful/f36-skeleton';\nimport { Popover } from '@contentful/f36-popover';\nimport { Subheading, SectionHeading } from '@contentful/f36-typography';\n\nimport { AutocompleteItems } from './AutocompleteItems';\nimport { getAutocompleteStyles } from './Autocomplete.styles';\nimport tokens from '@contentful/f36-tokens';\n\nexport interface GenericGroupType<ItemType> {\n groupTitle: string;\n options: ItemType[];\n}\nexport interface AutocompleteProps<ItemType>\n extends\n CommonProps,\n Pick<\n TextInputProps,\n | 'isDisabled'\n | 'isInvalid'\n | 'isReadOnly'\n | 'isRequired'\n | 'id'\n | 'defaultValue'\n > {\n /**\n * It’s an array of data to be used as \"options\" by the autocomplete component.\n * This can either be a plain list of items or a list of groups of items.\n */\n items: ItemType[] | GenericGroupType<ItemType>[];\n\n /**\n * Boolean to control whether the Autocomplete menu is open\n */\n isOpen?: boolean;\n\n /**\n * Callback fired when the Autocomplete menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Autocomplete menu closes\n */\n onClose?: () => void;\n\n /**\n * Set a custom icon for the text input\n */\n icon?: React.ReactElement;\n\n /**\n * Tells if the item is a object with groups\n */\n isGrouped?: boolean;\n\n /**\n * Set the value of the text input\n */\n inputValue?: string;\n /**\n * Function called whenever the input value changes\n */\n onInputValueChange?: (value: string) => void;\n /**\n * This is the function that will be called when the user selects one of the \"options\" in the list.\n * The component will pass the selected \"item\" as an argument to the function..\n */\n onSelectItem: (item: ItemType) => void;\n\n /**\n * Applying the selectedItem property turns autocomplete into a controlled component.\n * Can be used to display e.g. previously selected element. If it is an object the itemToString function will apply to it.\n */\n selectedItem?: ItemType;\n\n /**\n * This is the function that will be called for each \"item\" passed in the `items` prop.\n * It receives the \"item\" and \"inputValue\" as arguments and returns a ReactNode.\n * The inputValue is passed in case you want to highlight the match on the render.\n */\n renderItem?: (item: ItemType, inputValue: string) => React.ReactNode;\n /**\n * When using objects as `items`, we recommend passing a function that tells Downshift how to extract a string\n * from those objetcs to be used as inputValue\n */\n itemToString?: (item: ItemType) => string;\n /**\n * Text input behaviour after an item is selected\n * @default \"replace\"\n */\n textOnAfterSelect?: 'clear' | 'preserve' | 'replace';\n /**\n * If this is set to `false` the dropdown menu will stay open after selecting an item\n * @default true\n */\n closeAfterSelect?: boolean;\n /**\n * This is the value will be passed to the `placeholder` prop of the input.\n * @default \"Search\"\n */\n placeholder?: string;\n /**\n * Defines if the list should be shown even if empty, when input is focused\n * @default false\n */\n showEmptyList?: boolean;\n /**\n * A message that will be shown when it is not possible to find any option that matches the input value\n * @default \"No matches\"\n */\n noMatchesMessage?: string;\n /**\n * Use this prop to get a ref to the input element of the component\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Use this prop to get a ref to the toggle button of the component\n */\n toggleRef?: React.Ref<HTMLButtonElement>;\n /**\n * Use this prop to get a ref to the list of items of the component\n */\n listRef?: React.Ref<HTMLUListElement>;\n /**\n * It sets the width of the list\n * @default \"auto\"\n */\n listWidth?: 'auto' | 'full';\n /**\n * It sets the max-height, in pixels, of the list\n * The default value is the height of 5 single line items\n * @default 180\n */\n listMaxHeight?: number;\n /**\n * Sets the list to show its loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * Boolean to control whether or not to render the suggestions box in a React Portal.\n * Rendering content inside a Portal allows the suggestions box to escape the bounds\n * of its parent while still being positioned correctly.\n * Defaults to `false`\n */\n usePortal?: boolean;\n\n /**\n * A [data-test-id] attribute for the suggestions box used for testing purposes\n */\n popoverTestId?: string;\n\n /**\n * Function called when the input is focused\n *\n * @param event\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Function called when the input is blurred\n * @param event\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Manually control when the button to clear the input value is shown\n */\n showClearButton?: boolean;\n /**\n * Additional aria attributes\n */\n aria?: {\n showListIconLabel?: string;\n clearSelectionIconLabel?: string;\n };\n}\n\nfunction AutocompleteBase<ItemType>(\n props: AutocompleteProps<ItemType>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n isOpen: isOpenProp,\n onClose,\n onOpen,\n id,\n className,\n textOnAfterSelect = 'replace',\n closeAfterSelect = true,\n defaultValue = '',\n selectedItem,\n items,\n inputValue: inputValueProp,\n onInputValueChange,\n onSelectItem,\n onFocus,\n onBlur,\n renderItem,\n icon = <CaretDownIcon color={tokens.gray600} />,\n itemToString = (item: ItemType) => item as unknown as string,\n isInvalid,\n isDisabled,\n isRequired,\n isReadOnly,\n showEmptyList,\n noMatchesMessage = 'No matches found',\n placeholder = 'Search',\n inputRef: inputRefProp,\n toggleRef,\n listRef,\n listWidth = 'auto',\n listMaxHeight = 180,\n isGrouped = false,\n isLoading = false,\n usePortal = false,\n testId = 'cf-autocomplete',\n popoverTestId = 'cf-autocomplete-container',\n showClearButton: showClearButtonProp,\n aria = {\n clearSelectionIconLabel: 'Clear',\n showListIconLabel: 'Show list',\n },\n } = props;\n\n type GroupType = GenericGroupType<ItemType>;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const [_inputValue, setInputValue] = useState(defaultValue);\n const inputValue =\n typeof inputValueProp === 'undefined' ? _inputValue : inputValueProp;\n const inputRef = useRef(null);\n\n const handleInputValueChange = useCallback(\n (value: string) => {\n setInputValue(value);\n\n onInputValueChange?.(value);\n },\n [onInputValueChange],\n );\n\n // Handle manually to avoid a jumping cursor, see https://github.com/downshift-js/downshift/issues/1108#issuecomment-842407759\n const handleNativeChangeEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = event.target.value;\n handleInputValueChange(value);\n },\n [handleInputValueChange],\n );\n\n const flattenItems = isUsingGroups(isGrouped, items)\n ? items.reduce(\n (acc: ItemType[], group: GroupType) => [...acc, ...group.options],\n [],\n )\n : items;\n\n const isShowingNoMatches = isUsingGroups(isGrouped, items)\n ? items.every((group: GroupType) => group.options.length === 0)\n : items.length === 0;\n\n const {\n getInputProps,\n getItemProps,\n getMenuProps,\n getToggleButtonProps,\n highlightedIndex,\n isOpen,\n toggleMenu,\n } = useCombobox({\n isOpen: isOpenProp,\n onIsOpenChange: ({ isOpen }) => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n },\n stateReducer: (state, { type, changes }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputBlur: {\n // don't change input value on blur\n return { ...changes, inputValue: state.inputValue };\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick: {\n // prevent the menu from being closed when the user selects an item with a keyboard or mouse\n if (!closeAfterSelect) {\n return {\n ...changes,\n isOpen: state.isOpen,\n };\n }\n\n return changes;\n }\n default:\n return changes;\n }\n },\n items: flattenItems,\n selectedItem,\n inputValue,\n itemToString,\n onInputValueChange: ({ type, inputValue }) => {\n switch (type) {\n // value is set directly from the TextInput onChange handler\n case useCombobox.stateChangeTypes.InputChange: {\n return;\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.ItemClick:\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n // clear the TextInput value\n if (textOnAfterSelect === 'clear') {\n handleInputValueChange('');\n return;\n }\n\n // keep the current TextInput value\n if (textOnAfterSelect === 'preserve') {\n return;\n }\n }\n }\n\n handleInputValueChange(inputValue);\n },\n onStateChange: ({ type, selectedItem }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick:\n if (selectedItem) {\n onSelectItem(selectedItem);\n }\n break;\n default:\n break;\n }\n },\n });\n\n const {\n 'aria-labelledby': _labelledby,\n id: _inputId,\n ...inputProps\n } = getInputProps({ ref: inputRef });\n const toggleProps = getToggleButtonProps();\n const menuRef = useRef(null);\n const menuProps = getMenuProps({ ref: menuRef });\n let elementStartIndex = 0;\n\n const showClearButton = showClearButtonProp ?? inputValue;\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles.autocomplete, className)}\n ref={ref}\n >\n <Popover\n usePortal={usePortal}\n isOpen={isOpen}\n isFullWidth={listWidth === 'full'}\n renderOnlyWhenOpen={false}\n // This is necessary, otherwise the focus will change from the input to the Popover\n // and the user won't be able to type in the input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n id={menuProps.id}\n >\n <Popover.Trigger>\n <div>\n <TextInput\n className={styles.inputField}\n {...inputProps}\n onFocus={(e) => {\n onFocus?.(e as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n onBlur?.(e as React.FocusEvent<HTMLInputElement>);\n inputProps.onBlur(e);\n }}\n id={id}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n ref={mergeRefs(inputProps.ref, inputRefProp)}\n testId=\"cf-autocomplete-input\"\n placeholder={placeholder}\n onChange={(event) => {\n inputProps.onChange(event);\n handleNativeChangeEvent(event);\n }}\n />\n <IconButton\n {...toggleProps}\n ref={mergeRefs(toggleProps.ref, toggleRef)}\n aria-label={\n showClearButton\n ? aria.clearSelectionIconLabel\n : aria.showListIconLabel\n }\n className={styles.toggleButton}\n variant=\"transparent\"\n icon={showClearButton ? <XIcon color={tokens.gray600} /> : icon}\n onClick={() => {\n if (showClearButton) {\n handleInputValueChange('');\n } else {\n toggleMenu();\n }\n }}\n isDisabled={isDisabled}\n size=\"small\"\n />\n </div>\n </Popover.Trigger>\n\n {items.length > 0 || inputValue.length > 0 || showEmptyList ? (\n <Popover.Content\n {...menuProps}\n ref={mergeRefs(menuProps.ref, listRef)}\n className={styles.content}\n testId={popoverTestId}\n >\n {isLoading &&\n [...Array(3)].map((_, index) => (\n <div\n key={index}\n className={cx(styles.item({ isDisabled: true }))}\n >\n <ListItemLoadingState />\n </div>\n ))}\n\n {!isLoading && isShowingNoMatches && (\n <div className={styles.item({})}>\n <Subheading className={styles.noMatchesTitle}>\n {noMatchesMessage}\n </Subheading>\n </div>\n )}\n\n {!isLoading &&\n isUsingGroups(isGrouped, items) &&\n items.map((group: GroupType, index: number) => {\n if (group.options.length < 1) {\n return;\n }\n const render = (\n <div key={index}>\n <SectionHeading\n key={index}\n data-test-id=\"cf-autocomplete-grouptitle\"\n marginBottom=\"none\"\n className={styles.groupTitle}\n >\n {group.groupTitle}\n </SectionHeading>\n <AutocompleteItems<ItemType>\n items={group.options}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n elementStartIndex={elementStartIndex}\n />\n </div>\n );\n elementStartIndex += group.options.length;\n return render;\n })}\n\n {!isLoading &&\n !isUsingGroups(isGrouped, items) &&\n items.length > 0 && (\n <AutocompleteItems<ItemType>\n items={items}\n elementStartIndex={elementStartIndex}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n />\n )}\n </Popover.Content>\n ) : (\n // We need to render an empty hidden div, so we can pass the menuProps or downshift will show a warning about it\n // https://github.com/downshift-js/downshift/issues/1167#issuecomment-1088022842\n <div {...menuProps} className={cx(styles.hidden)} />\n )}\n </Popover>\n </div>\n );\n}\n\nconst ListItemLoadingState = () => {\n return (\n <Skeleton.Container svgHeight={16}>\n <Skeleton.BodyText numberOfLines={1} />\n </Skeleton.Container>\n );\n};\n\n// This is required to infer correct typings when differentiating groups and items\nfunction isUsingGroups<ItemType>(\n isGrouped: boolean,\n items: ItemType[] | GenericGroupType<ItemType>[],\n): items is GenericGroupType<ItemType>[] {\n return isGrouped;\n}\n\n/**\n * The Autocomplete is a component that will show a `TextInput` where a user can type any word which will be used\n * to filter a list of items. That list of filtered items will be shown to the user as possible options for the input.\n * Once one of the options is selected, that option becomes the value of the `TextInput`.\n */\nexport const Autocomplete = React.forwardRef(AutocompleteBase) as <T>(\n props: ExpandProps<AutocompleteProps<T>> & {\n ref?: React.Ref<HTMLDivElement>;\n },\n) => ReturnType<typeof AutocompleteBase>;\n","import { css, cx } from '@emotion/css';\nimport tokens from '@contentful/f36-tokens';\nimport { getMenuItemStyles } from '@contentful/f36-core';\n\nexport const getAutocompleteStyles = (listMaxHeight: number) => ({\n autocomplete: css({\n position: 'relative',\n width: '100%',\n }),\n inputField: css({\n paddingRight: tokens.spacingXl,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n toggleButton: css({\n position: 'absolute',\n top: '1px',\n right: '1px',\n zIndex: 1,\n padding: tokens.spacing2Xs,\n minHeight: 'calc(100% - 2px)',\n }),\n content: css({\n overflow: 'auto',\n maxHeight: `${listMaxHeight}px`,\n }),\n list: css({\n listStyle: 'none',\n padding: `${tokens.spacingXs} ${tokens.spacing2Xs}`,\n margin: 0,\n }),\n groupTitle: css({\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n }),\n noMatchesTitle: css({\n color: tokens.gray500,\n margin: `${tokens.spacingM} 0 ${tokens.spacingM} 0`,\n }),\n item: ({\n isActive = false,\n isDisabled = false,\n }: {\n isActive?: boolean;\n isDisabled?: boolean;\n }) => cx(getMenuItemStyles({ isActive, isDisabled })),\n highlighted: css({\n backgroundColor: tokens.gray100,\n }),\n hidden: css({\n display: 'none',\n }),\n});\n","import React, { HTMLAttributes } from 'react';\nimport { cx } from '@emotion/css';\nimport { getStringMatch } from '@contentful/f36-utils';\nimport type { UseComboboxGetItemPropsOptions } from 'downshift';\nimport { Text } from '@contentful/f36-typography';\n\nimport { getAutocompleteStyles } from './Autocomplete.styles';\n\ninterface AutocompleteItemsProps<ItemType> {\n items: ItemType[];\n elementStartIndex: number;\n highlightedIndex: number;\n getItemProps: (\n options: UseComboboxGetItemPropsOptions<ItemType>,\n ) => HTMLAttributes<HTMLLIElement>;\n renderItem: (item: ItemType, inputValue: string) => React.ReactNode;\n inputValue: string;\n listMaxHeight?: number;\n}\n\nexport const AutocompleteItems = <ItemType,>(\n props: AutocompleteItemsProps<ItemType>,\n) => {\n const {\n items,\n elementStartIndex,\n highlightedIndex,\n getItemProps,\n renderItem,\n inputValue,\n listMaxHeight = 180,\n } = props;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const renderHighlightedItem = (item: ItemType, inputValue) => {\n if (renderItem) {\n return renderItem(item, inputValue);\n }\n if (typeof item === 'string') {\n return <HighlightedItem item={item} inputValue={inputValue} />;\n }\n if (!React.isValidElement(item)) {\n // eslint-disable-next-line no-console\n console.error(\n 'Only valid React elements are supported - https://react.dev/reference/react/isValidElement',\n );\n return null;\n }\n return item;\n };\n\n return (\n <ul className={styles.list} data-test-id=\"cf-autocomplete-list\">\n {items.map((item: ItemType, index: number) => {\n const itemIndex = elementStartIndex + index;\n const itemProps = getItemProps({ item, index: itemIndex });\n return (\n <Text\n {...itemProps}\n as=\"li\"\n key={itemIndex}\n className={cx([\n styles.item({}),\n highlightedIndex === itemIndex && styles.highlighted,\n ])}\n data-highlighted={highlightedIndex === itemIndex}\n data-test-id={`cf-autocomplete-list-item-${itemIndex}`}\n >\n {renderHighlightedItem(item, inputValue)}\n </Text>\n );\n })}\n </ul>\n );\n};\n\nAutocompleteItems.displayName = 'AutocompleteItems';\n\nfunction HighlightedItem({\n item,\n inputValue,\n}: {\n item: string;\n inputValue: string;\n}) {\n const { before, match, after } = getStringMatch(item, inputValue);\n\n return (\n <>\n {before}\n <b>{match}</b>\n {after}\n </>\n );\n}\n\nHighlightedItem.displayName = 'HighlightedItem';\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Autocomplete.tsx","../src/Autocomplete.styles.ts","../src/AutocompleteItems.tsx"],"names":["getAutocompleteStyles","listMaxHeight","css","tokens","isActive","isDisabled","cx","getMenuItemStyles","AutocompleteItems","props","items","elementStartIndex","highlightedIndex","getItemProps","renderItem","inputValue","styles","renderHighlightedItem","item","React","HighlightedItem","index","itemIndex","itemProps","Text","__spreadProps","__spreadValues","before","match","after","getStringMatch","AutocompleteBase","ref","isOpenProp","onClose","onOpen","id","className","textOnAfterSelect","closeAfterSelect","defaultValue","selectedItem","inputValueProp","onInputValueChange","onSelectItem","onFocus","onBlur","icon","CaretDownIcon","itemToString","isInvalid","isRequired","isReadOnly","showEmptyList","noMatchesMessage","placeholder","inputRefProp","toggleRef","listRef","listWidth","isGrouped","isLoading","usePortal","testId","popoverTestId","showClearButtonProp","aria","_inputValue","setInputValue","useState","inputRef","useRef","handleInputValueChange","useCallback","value","handleNativeChangeEvent","event","flattenItems","isUsingGroups","acc","group","isShowingNoMatches","getInputProps","getMenuProps","getToggleButtonProps","isOpen","toggleMenu","useCombobox","state","type","changes","_a","_labelledby","_inputId","inputProps","__objRest","toggleProps","menuRef","menuProps","showClearButton","Popover","TextInput","mergeRefs","IconButton","XIcon","_","ListItemLoadingState","Subheading","render","SectionHeading","Skeleton","Autocomplete"],"mappings":"soBAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,EAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,IAAA,EAAA,CAAA,MAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,YAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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X,CAAAA,CAAA,CACC,KAAA,CAAOwE,CAAAA,CAAM,OAAA,CACb,gBAAA,CAAkBpE,EAClB,YAAA,CAAcC,CAAAA,CACd,UAAA,CAAYC,CAAAA,CACZ,UAAA,CAAYC,CAAAA,CACZ,iBAAA,CAAmBJ,CAAAA,CACrB,CACF,CAAA,CAEF,OAAAA,CAAAA,EAAqBqE,CAAAA,CAAM,QAAQ,MAAA,CAC5B4B,CACT,CAAC,CAAA,CAEF,CAAC/C,CAAAA,EACA,CAACiB,CAAAA,CAAclB,CAAgB,CAAA,EAC/BlD,CAAAA,CAAM,MAAA,CAAS,GACbS,kBAAAA,CAAA,aAAA,CAACX,CAAAA,CAAA,CACC,KAAA,CAAOE,CAAAA,CACP,iBAAA,CAAmBC,CAAAA,CACnB,iBAAkBC,CAAAA,CAClB,YAAA,CAAcC,CAAAA,CACd,UAAA,CAAYC,CAAAA,CACZ,UAAA,CAAYC,CAAAA,CACd,CAEN,EAIAI,kBAAAA,CAAA,aAAA,CAAC,KAAA,CAAAM,CAAAA,CAAAC,EAAA,EAAA,CAAQwE,CAAAA,CAAAA,CAAR,CAAmB,SAAA,CAAW5F,OAAGU,CAAAA,CAAO,MAAM,CAAA,CAAA,CAAG,CAEtD,CACF,CAEJ,CAEA,IAAM0F,GAAuB,IAEzBvF,kBAAAA,CAAA,aAAA,CAAC2F,oBAAAA,CAAS,UAAT,CAAmB,SAAA,CAAW,EAAA,CAAA,CAC7B3F,kBAAAA,CAAA,cAAC2F,oBAAAA,CAAS,QAAA,CAAT,CAAkB,aAAA,CAAe,CAAA,CAAG,CACvC,CAAA,CAKJ,SAAShC,EACPlB,CAAAA,CACAlD,CAAAA,CACuC,CACvC,OAAOkD,CACT,CAOO,IAAMmD,EAAAA,CAAe5F,kBAAAA,CAAM,WAAWY,EAAgB","file":"index.js","sourcesContent":["import React, { useCallback, useRef, useState } from 'react';\nimport { cx } from '@emotion/css';\nimport { useCombobox } from 'downshift';\n\nimport {\n mergeRefs,\n type CommonProps,\n type ExpandProps,\n} from '@contentful/f36-core';\nimport { IconButton } from '@contentful/f36-button';\nimport { TextInput, type TextInputProps } from '@contentful/f36-forms';\nimport { XIcon, CaretDownIcon } from '@contentful/f36-icons';\nimport { Skeleton } from '@contentful/f36-skeleton';\nimport { Popover } from '@contentful/f36-popover';\nimport { Subheading, SectionHeading } from '@contentful/f36-typography';\n\nimport { AutocompleteItems } from './AutocompleteItems';\nimport { getAutocompleteStyles } from './Autocomplete.styles';\nimport tokens from '@contentful/f36-tokens';\n\nexport interface GenericGroupType<ItemType> {\n groupTitle: string;\n options: ItemType[];\n}\nexport interface AutocompleteProps<ItemType>\n extends CommonProps,\n Pick<\n TextInputProps,\n | 'isDisabled'\n | 'isInvalid'\n | 'isReadOnly'\n | 'isRequired'\n | 'id'\n | 'defaultValue'\n > {\n /**\n * It’s an array of data to be used as \"options\" by the autocomplete component.\n * This can either be a plain list of items or a list of groups of items.\n */\n items: ItemType[] | GenericGroupType<ItemType>[];\n\n /**\n * Boolean to control whether the Autocomplete menu is open\n */\n isOpen?: boolean;\n\n /**\n * Callback fired when the Autocomplete menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Autocomplete menu closes\n */\n onClose?: () => void;\n\n /**\n * Set a custom icon for the text input\n */\n icon?: React.ReactElement;\n\n /**\n * Tells if the item is a object with groups\n */\n isGrouped?: boolean;\n\n /**\n * Set the value of the text input\n */\n inputValue?: string;\n /**\n * Function called whenever the input value changes\n */\n onInputValueChange?: (value: string) => void;\n /**\n * This is the function that will be called when the user selects one of the \"options\" in the list.\n * The component will pass the selected \"item\" as an argument to the function..\n */\n onSelectItem: (item: ItemType) => void;\n\n /**\n * Applying the selectedItem property turns autocomplete into a controlled component.\n * Can be used to display e.g. previously selected element. If it is an object the itemToString function will apply to it.\n */\n selectedItem?: ItemType;\n\n /**\n * This is the function that will be called for each \"item\" passed in the `items` prop.\n * It receives the \"item\" and \"inputValue\" as arguments and returns a ReactNode.\n * The inputValue is passed in case you want to highlight the match on the render.\n */\n renderItem?: (item: ItemType, inputValue: string) => React.ReactNode;\n /**\n * When using objects as `items`, we recommend passing a function that tells Downshift how to extract a string\n * from those objetcs to be used as inputValue\n */\n itemToString?: (item: ItemType) => string;\n /**\n * Text input behaviour after an item is selected\n * @default \"replace\"\n */\n textOnAfterSelect?: 'clear' | 'preserve' | 'replace';\n /**\n * If this is set to `false` the dropdown menu will stay open after selecting an item\n * @default true\n */\n closeAfterSelect?: boolean;\n /**\n * This is the value will be passed to the `placeholder` prop of the input.\n * @default \"Search\"\n */\n placeholder?: string;\n /**\n * Defines if the list should be shown even if empty, when input is focused\n * @default false\n */\n showEmptyList?: boolean;\n /**\n * A message that will be shown when it is not possible to find any option that matches the input value\n * @default \"No matches\"\n */\n noMatchesMessage?: string;\n /**\n * Use this prop to get a ref to the input element of the component\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Use this prop to get a ref to the toggle button of the component\n */\n toggleRef?: React.Ref<HTMLButtonElement>;\n /**\n * Use this prop to get a ref to the list of items of the component\n */\n listRef?: React.Ref<HTMLUListElement>;\n /**\n * It sets the width of the list\n * @default \"auto\"\n */\n listWidth?: 'auto' | 'full';\n /**\n * It sets the max-height, in pixels, of the list\n * The default value is the height of 5 single line items\n * @default 180\n */\n listMaxHeight?: number;\n /**\n * Sets the list to show its loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * Boolean to control whether or not to render the suggestions box in a React Portal.\n * Rendering content inside a Portal allows the suggestions box to escape the bounds\n * of its parent while still being positioned correctly.\n * Defaults to `false`\n */\n usePortal?: boolean;\n\n /**\n * A [data-test-id] attribute for the suggestions box used for testing purposes\n */\n popoverTestId?: string;\n\n /**\n * Function called when the input is focused\n *\n * @param event\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Function called when the input is blurred\n * @param event\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Manually control when the button to clear the input value is shown\n */\n showClearButton?: boolean;\n /**\n * Additional aria attributes\n */\n aria?: {\n showListIconLabel?: string;\n clearSelectionIconLabel?: string;\n };\n}\n\nfunction AutocompleteBase<ItemType>(\n props: AutocompleteProps<ItemType>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n isOpen: isOpenProp,\n onClose,\n onOpen,\n id,\n className,\n textOnAfterSelect = 'replace',\n closeAfterSelect = true,\n defaultValue = '',\n selectedItem,\n items,\n inputValue: inputValueProp,\n onInputValueChange,\n onSelectItem,\n onFocus,\n onBlur,\n renderItem,\n icon = <CaretDownIcon color={tokens.gray600} />,\n itemToString = (item: ItemType) => item as unknown as string,\n isInvalid,\n isDisabled,\n isRequired,\n isReadOnly,\n showEmptyList,\n noMatchesMessage = 'No matches found',\n placeholder = 'Search',\n inputRef: inputRefProp,\n toggleRef,\n listRef,\n listWidth = 'auto',\n listMaxHeight = 180,\n isGrouped = false,\n isLoading = false,\n usePortal = false,\n testId = 'cf-autocomplete',\n popoverTestId = 'cf-autocomplete-container',\n showClearButton: showClearButtonProp,\n aria = {\n clearSelectionIconLabel: 'Clear',\n showListIconLabel: 'Show list',\n },\n } = props;\n\n type GroupType = GenericGroupType<ItemType>;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const [_inputValue, setInputValue] = useState(defaultValue);\n const inputValue =\n typeof inputValueProp === 'undefined' ? _inputValue : inputValueProp;\n const inputRef = useRef(null);\n\n const handleInputValueChange = useCallback(\n (value: string) => {\n setInputValue(value);\n\n onInputValueChange?.(value);\n },\n [onInputValueChange],\n );\n\n // Handle manually to avoid a jumping cursor, see https://github.com/downshift-js/downshift/issues/1108#issuecomment-842407759\n const handleNativeChangeEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = event.target.value;\n handleInputValueChange(value);\n },\n [handleInputValueChange],\n );\n\n const flattenItems = isUsingGroups(isGrouped, items)\n ? items.reduce(\n (acc: ItemType[], group: GroupType) => [...acc, ...group.options],\n [],\n )\n : items;\n\n const isShowingNoMatches = isUsingGroups(isGrouped, items)\n ? items.every((group: GroupType) => group.options.length === 0)\n : items.length === 0;\n\n const {\n getInputProps,\n getItemProps,\n getMenuProps,\n getToggleButtonProps,\n highlightedIndex,\n isOpen,\n toggleMenu,\n } = useCombobox({\n isOpen: isOpenProp,\n onIsOpenChange: ({ isOpen }) => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n },\n stateReducer: (state, { type, changes }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputBlur: {\n // don't change input value on blur\n return { ...changes, inputValue: state.inputValue };\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick: {\n // prevent the menu from being closed when the user selects an item with a keyboard or mouse\n if (!closeAfterSelect) {\n return {\n ...changes,\n isOpen: state.isOpen,\n };\n }\n\n return changes;\n }\n default:\n return changes;\n }\n },\n items: flattenItems,\n selectedItem,\n inputValue,\n itemToString,\n onInputValueChange: ({ type, inputValue }) => {\n switch (type) {\n // value is set directly from the TextInput onChange handler\n case useCombobox.stateChangeTypes.InputChange: {\n return;\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.ItemClick:\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n // clear the TextInput value\n if (textOnAfterSelect === 'clear') {\n handleInputValueChange('');\n return;\n }\n\n // keep the current TextInput value\n if (textOnAfterSelect === 'preserve') {\n return;\n }\n }\n }\n\n handleInputValueChange(inputValue);\n },\n onStateChange: ({ type, selectedItem }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick:\n if (selectedItem) {\n onSelectItem(selectedItem);\n }\n break;\n default:\n break;\n }\n },\n });\n\n const {\n 'aria-labelledby': _labelledby,\n id: _inputId,\n ...inputProps\n } = getInputProps({ ref: inputRef });\n const toggleProps = getToggleButtonProps();\n const menuRef = useRef(null);\n const menuProps = getMenuProps({ ref: menuRef });\n let elementStartIndex = 0;\n\n const showClearButton = showClearButtonProp ?? inputValue;\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles.autocomplete, className)}\n ref={ref}\n >\n <Popover\n usePortal={usePortal}\n isOpen={isOpen}\n isFullWidth={listWidth === 'full'}\n renderOnlyWhenOpen={false}\n // This is necessary, otherwise the focus will change from the input to the Popover\n // and the user won't be able to type in the input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n id={menuProps.id}\n >\n <Popover.Trigger>\n <div>\n <TextInput\n className={styles.inputField}\n {...inputProps}\n onFocus={(e) => {\n onFocus?.(e as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n onBlur?.(e as React.FocusEvent<HTMLInputElement>);\n inputProps.onBlur(e);\n }}\n id={id}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n ref={mergeRefs(inputProps.ref, inputRefProp)}\n testId=\"cf-autocomplete-input\"\n placeholder={placeholder}\n onChange={(event) => {\n inputProps.onChange(event);\n handleNativeChangeEvent(event);\n }}\n />\n <IconButton\n {...toggleProps}\n ref={mergeRefs(toggleProps.ref, toggleRef)}\n aria-label={\n showClearButton\n ? aria.clearSelectionIconLabel\n : aria.showListIconLabel\n }\n className={styles.toggleButton}\n variant=\"transparent\"\n icon={showClearButton ? <XIcon color={tokens.gray600} /> : icon}\n onClick={() => {\n if (showClearButton) {\n handleInputValueChange('');\n } else {\n toggleMenu();\n }\n }}\n isDisabled={isDisabled}\n size=\"small\"\n />\n </div>\n </Popover.Trigger>\n\n {items.length > 0 || inputValue.length > 0 || showEmptyList ? (\n <Popover.Content\n {...menuProps}\n ref={mergeRefs(menuProps.ref, listRef)}\n className={styles.content}\n testId={popoverTestId}\n >\n {isLoading &&\n [...Array(3)].map((_, index) => (\n <div\n key={index}\n className={cx(styles.item({ isDisabled: true }))}\n >\n <ListItemLoadingState />\n </div>\n ))}\n\n {!isLoading && isShowingNoMatches && (\n <div className={styles.item({})}>\n <Subheading className={styles.noMatchesTitle}>\n {noMatchesMessage}\n </Subheading>\n </div>\n )}\n\n {!isLoading &&\n isUsingGroups(isGrouped, items) &&\n items.map((group: GroupType, index: number) => {\n if (group.options.length < 1) {\n return;\n }\n const render = (\n <div key={index}>\n <SectionHeading\n key={index}\n data-test-id=\"cf-autocomplete-grouptitle\"\n marginBottom=\"none\"\n className={styles.groupTitle}\n >\n {group.groupTitle}\n </SectionHeading>\n <AutocompleteItems<ItemType>\n items={group.options}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n elementStartIndex={elementStartIndex}\n />\n </div>\n );\n elementStartIndex += group.options.length;\n return render;\n })}\n\n {!isLoading &&\n !isUsingGroups(isGrouped, items) &&\n items.length > 0 && (\n <AutocompleteItems<ItemType>\n items={items}\n elementStartIndex={elementStartIndex}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n />\n )}\n </Popover.Content>\n ) : (\n // We need to render an empty hidden div, so we can pass the menuProps or downshift will show a warning about it\n // https://github.com/downshift-js/downshift/issues/1167#issuecomment-1088022842\n <div {...menuProps} className={cx(styles.hidden)} />\n )}\n </Popover>\n </div>\n );\n}\n\nconst ListItemLoadingState = () => {\n return (\n <Skeleton.Container svgHeight={16}>\n <Skeleton.BodyText numberOfLines={1} />\n </Skeleton.Container>\n );\n};\n\n// This is required to infer correct typings when differentiating groups and items\nfunction isUsingGroups<ItemType>(\n isGrouped: boolean,\n items: ItemType[] | GenericGroupType<ItemType>[],\n): items is GenericGroupType<ItemType>[] {\n return isGrouped;\n}\n\n/**\n * The Autocomplete is a component that will show a `TextInput` where a user can type any word which will be used\n * to filter a list of items. That list of filtered items will be shown to the user as possible options for the input.\n * Once one of the options is selected, that option becomes the value of the `TextInput`.\n */\nexport const Autocomplete = React.forwardRef(AutocompleteBase) as <T>(\n props: ExpandProps<AutocompleteProps<T>> & {\n ref?: React.Ref<HTMLDivElement>;\n },\n) => ReturnType<typeof AutocompleteBase>;\n","import { css, cx } from '@emotion/css';\nimport tokens from '@contentful/f36-tokens';\nimport { getMenuItemStyles } from '@contentful/f36-core';\n\nexport const getAutocompleteStyles = (listMaxHeight: number) => ({\n autocomplete: css({\n position: 'relative',\n width: '100%',\n }),\n inputField: css({\n paddingRight: tokens.spacingXl,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n toggleButton: css({\n position: 'absolute',\n top: '1px',\n right: '1px',\n zIndex: 1,\n padding: tokens.spacing2Xs,\n minHeight: 'calc(100% - 2px)',\n }),\n content: css({\n overflow: 'auto',\n maxHeight: `${listMaxHeight}px`,\n }),\n list: css({\n listStyle: 'none',\n padding: `${tokens.spacingXs} ${tokens.spacing2Xs}`,\n margin: 0,\n }),\n groupTitle: css({\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n }),\n noMatchesTitle: css({\n color: tokens.gray500,\n margin: `${tokens.spacingM} 0 ${tokens.spacingM} 0`,\n }),\n item: ({\n isActive = false,\n isDisabled = false,\n }: {\n isActive?: boolean;\n isDisabled?: boolean;\n }) => cx(getMenuItemStyles({ isActive, isDisabled })),\n highlighted: css({\n backgroundColor: tokens.gray100,\n }),\n hidden: css({\n display: 'none',\n }),\n});\n","import React, { HTMLAttributes } from 'react';\nimport { cx } from '@emotion/css';\nimport { getStringMatch } from '@contentful/f36-utils';\nimport type { UseComboboxGetItemPropsOptions } from 'downshift';\nimport { Text } from '@contentful/f36-typography';\n\nimport { getAutocompleteStyles } from './Autocomplete.styles';\n\ninterface AutocompleteItemsProps<ItemType> {\n items: ItemType[];\n elementStartIndex: number;\n highlightedIndex: number;\n getItemProps: (\n options: UseComboboxGetItemPropsOptions<ItemType>,\n ) => HTMLAttributes<HTMLLIElement>;\n renderItem: (item: ItemType, inputValue: string) => React.ReactNode;\n inputValue: string;\n listMaxHeight?: number;\n}\n\nexport const AutocompleteItems = <ItemType,>(\n props: AutocompleteItemsProps<ItemType>,\n) => {\n const {\n items,\n elementStartIndex,\n highlightedIndex,\n getItemProps,\n renderItem,\n inputValue,\n listMaxHeight = 180,\n } = props;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const renderHighlightedItem = (item: ItemType, inputValue) => {\n if (renderItem) {\n return renderItem(item, inputValue);\n }\n if (typeof item === 'string') {\n return <HighlightedItem item={item} inputValue={inputValue} />;\n }\n if (!React.isValidElement(item)) {\n // eslint-disable-next-line no-console\n console.error(\n 'Only valid React elements are supported - https://react.dev/reference/react/isValidElement',\n );\n return null;\n }\n return item;\n };\n\n return (\n <ul className={styles.list} data-test-id=\"cf-autocomplete-list\">\n {items.map((item: ItemType, index: number) => {\n const itemIndex = elementStartIndex + index;\n const itemProps = getItemProps({ item, index: itemIndex });\n return (\n <Text\n {...itemProps}\n as=\"li\"\n key={itemIndex}\n className={cx([\n styles.item({}),\n highlightedIndex === itemIndex && styles.highlighted,\n ])}\n data-highlighted={highlightedIndex === itemIndex}\n data-test-id={`cf-autocomplete-list-item-${itemIndex}`}\n >\n {renderHighlightedItem(item, inputValue)}\n </Text>\n );\n })}\n </ul>\n );\n};\n\nAutocompleteItems.displayName = 'AutocompleteItems';\n\nfunction HighlightedItem({\n item,\n inputValue,\n}: {\n item: string;\n inputValue: string;\n}) {\n const { before, match, after } = getStringMatch(item, inputValue);\n\n return (\n <>\n {before}\n <b>{match}</b>\n {after}\n </>\n );\n}\n\nHighlightedItem.displayName = 'HighlightedItem';\n"]}
1
+ {"version":3,"sources":["../src/Autocomplete.tsx","../src/Autocomplete.styles.ts","../src/AutocompleteItems.tsx"],"names":["getAutocompleteStyles","listMaxHeight","css","tokens","isActive","isDisabled","cx","getMenuItemStyles","AutocompleteItems","props","items","elementStartIndex","highlightedIndex","getItemProps","renderItem","inputValue","styles","renderHighlightedItem","item","React","HighlightedItem","index","itemIndex","itemProps","Text","__spreadProps","__spreadValues","before","match","after","getStringMatch","AutocompleteBase","ref","isOpenProp","onClose","onOpen","id","className","textOnAfterSelect","closeAfterSelect","defaultValue","selectedItem","inputValueProp","onInputValueChange","onSelectItem","onFocus","onBlur","icon","CaretDownIcon","itemToString","isInvalid","isRequired","isReadOnly","showEmptyList","noMatchesMessage","placeholder","inputRefProp","toggleRef","listRef","listWidth","isGrouped","isLoading","usePortal","testId","popoverTestId","showClearButtonProp","aria","_inputValue","setInputValue","useState","inputRef","useRef","handleInputValueChange","useCallback","value","handleNativeChangeEvent","event","flattenItems","isUsingGroups","acc","group","isShowingNoMatches","getInputProps","getMenuProps","getToggleButtonProps","isOpen","toggleMenu","useCombobox","state","type","changes","_a","_labelledby","_inputId","inputProps","__objRest","toggleProps","menuRef","menuProps","showClearButton","Popover","TextInput","mergeRefs","IconButton","XIcon","_","ListItemLoadingState","Subheading","render","SectionHeading","Skeleton","Autocomplete"],"mappings":"soBAAA,IAAA,EAAA,CAAA,MAAA,CAAA,cAAA,CAAA,EAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,IAAA,EAAA,CAAA,MAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,qBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,YAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,IAAA,C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A,CACd,UAAA,CAAYC,CAAAA,CACZ,UAAA,CAAYC,CAAAA,CACZ,iBAAA,CAAmBJ,CAAAA,CACrB,CACF,CAAA,CAEF,OAAAA,CAAAA,EAAqBqE,CAAAA,CAAM,QAAQ,MAAA,CAC5B4B,CACT,CAAC,CAAA,CAEF,CAAC/C,CAAAA,EACA,CAACiB,CAAAA,CAAclB,CAAgB,CAAA,EAC/BlD,CAAAA,CAAM,MAAA,CAAS,GACbS,kBAAAA,CAAA,aAAA,CAACX,CAAAA,CAAA,CACC,KAAA,CAAOE,CAAAA,CACP,iBAAA,CAAmBC,CAAAA,CACnB,iBAAkBC,CAAAA,CAClB,YAAA,CAAcC,CAAAA,CACd,UAAA,CAAYC,CAAAA,CACZ,UAAA,CAAYC,CAAAA,CACd,CAEN,EAIAI,kBAAAA,CAAA,aAAA,CAAC,KAAA,CAAAM,CAAAA,CAAAC,EAAA,EAAA,CAAQwE,CAAAA,CAAAA,CAAR,CAAmB,SAAA,CAAW5F,OAAGU,CAAAA,CAAO,MAAM,CAAA,CAAA,CAAG,CAEtD,CACF,CAEJ,CAEA,IAAM0F,GAAuB,IAEzBvF,kBAAAA,CAAA,aAAA,CAAC2F,oBAAAA,CAAS,UAAT,CAAmB,SAAA,CAAW,EAAA,CAAA,CAC7B3F,kBAAAA,CAAA,cAAC2F,oBAAAA,CAAS,QAAA,CAAT,CAAkB,aAAA,CAAe,CAAA,CAAG,CACvC,CAAA,CAKJ,SAAShC,EACPlB,CAAAA,CACAlD,CAAAA,CACuC,CACvC,OAAOkD,CACT,CAOO,IAAMmD,EAAAA,CAAe5F,kBAAAA,CAAM,WAAWY,EAAgB","file":"index.js","sourcesContent":["import React, { useCallback, useRef, useState } from 'react';\nimport { cx } from '@emotion/css';\nimport { useCombobox } from 'downshift';\n\nimport {\n mergeRefs,\n type CommonProps,\n type ExpandProps,\n} from '@contentful/f36-core';\nimport { IconButton } from '@contentful/f36-button';\nimport { TextInput, type TextInputProps } from '@contentful/f36-forms';\nimport { XIcon, CaretDownIcon } from '@contentful/f36-icons';\nimport { Skeleton } from '@contentful/f36-skeleton';\nimport { Popover } from '@contentful/f36-popover';\nimport { Subheading, SectionHeading } from '@contentful/f36-typography';\n\nimport { AutocompleteItems } from './AutocompleteItems';\nimport { getAutocompleteStyles } from './Autocomplete.styles';\nimport tokens from '@contentful/f36-tokens';\n\nexport interface GenericGroupType<ItemType> {\n groupTitle: string;\n options: ItemType[];\n}\nexport interface AutocompleteProps<ItemType>\n extends\n CommonProps,\n Pick<\n TextInputProps,\n | 'isDisabled'\n | 'isInvalid'\n | 'isReadOnly'\n | 'isRequired'\n | 'id'\n | 'defaultValue'\n > {\n /**\n * It’s an array of data to be used as \"options\" by the autocomplete component.\n * This can either be a plain list of items or a list of groups of items.\n */\n items: ItemType[] | GenericGroupType<ItemType>[];\n\n /**\n * Boolean to control whether the Autocomplete menu is open\n */\n isOpen?: boolean;\n\n /**\n * Callback fired when the Autocomplete menu opens\n */\n onOpen?: () => void;\n\n /**\n * Callback fired when the Autocomplete menu closes\n */\n onClose?: () => void;\n\n /**\n * Set a custom icon for the text input\n */\n icon?: React.ReactElement;\n\n /**\n * Tells if the item is a object with groups\n */\n isGrouped?: boolean;\n\n /**\n * Set the value of the text input\n */\n inputValue?: string;\n /**\n * Function called whenever the input value changes\n */\n onInputValueChange?: (value: string) => void;\n /**\n * This is the function that will be called when the user selects one of the \"options\" in the list.\n * The component will pass the selected \"item\" as an argument to the function..\n */\n onSelectItem: (item: ItemType) => void;\n\n /**\n * Applying the selectedItem property turns autocomplete into a controlled component.\n * Can be used to display e.g. previously selected element. If it is an object the itemToString function will apply to it.\n */\n selectedItem?: ItemType;\n\n /**\n * This is the function that will be called for each \"item\" passed in the `items` prop.\n * It receives the \"item\" and \"inputValue\" as arguments and returns a ReactNode.\n * The inputValue is passed in case you want to highlight the match on the render.\n */\n renderItem?: (item: ItemType, inputValue: string) => React.ReactNode;\n /**\n * When using objects as `items`, we recommend passing a function that tells Downshift how to extract a string\n * from those objetcs to be used as inputValue\n */\n itemToString?: (item: ItemType) => string;\n /**\n * Text input behaviour after an item is selected\n * @default \"replace\"\n */\n textOnAfterSelect?: 'clear' | 'preserve' | 'replace';\n /**\n * If this is set to `false` the dropdown menu will stay open after selecting an item\n * @default true\n */\n closeAfterSelect?: boolean;\n /**\n * This is the value will be passed to the `placeholder` prop of the input.\n * @default \"Search\"\n */\n placeholder?: string;\n /**\n * Defines if the list should be shown even if empty, when input is focused\n * @default false\n */\n showEmptyList?: boolean;\n /**\n * A message that will be shown when it is not possible to find any option that matches the input value\n * @default \"No matches\"\n */\n noMatchesMessage?: string;\n /**\n * Use this prop to get a ref to the input element of the component\n */\n inputRef?: React.Ref<HTMLInputElement>;\n /**\n * Use this prop to get a ref to the toggle button of the component\n */\n toggleRef?: React.Ref<HTMLButtonElement>;\n /**\n * Use this prop to get a ref to the list of items of the component\n */\n listRef?: React.Ref<HTMLUListElement>;\n /**\n * It sets the width of the list\n * @default \"auto\"\n */\n listWidth?: 'auto' | 'full';\n /**\n * It sets the max-height, in pixels, of the list\n * The default value is the height of 5 single line items\n * @default 180\n */\n listMaxHeight?: number;\n /**\n * Sets the list to show its loading state\n * @default false\n */\n isLoading?: boolean;\n /**\n * Boolean to control whether or not to render the suggestions box in a React Portal.\n * Rendering content inside a Portal allows the suggestions box to escape the bounds\n * of its parent while still being positioned correctly.\n * Defaults to `false`\n */\n usePortal?: boolean;\n\n /**\n * A [data-test-id] attribute for the suggestions box used for testing purposes\n */\n popoverTestId?: string;\n\n /**\n * Function called when the input is focused\n *\n * @param event\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Function called when the input is blurred\n * @param event\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n /**\n * Manually control when the button to clear the input value is shown\n */\n showClearButton?: boolean;\n /**\n * Additional aria attributes\n */\n aria?: {\n showListIconLabel?: string;\n clearSelectionIconLabel?: string;\n };\n}\n\nfunction AutocompleteBase<ItemType>(\n props: AutocompleteProps<ItemType>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n isOpen: isOpenProp,\n onClose,\n onOpen,\n id,\n className,\n textOnAfterSelect = 'replace',\n closeAfterSelect = true,\n defaultValue = '',\n selectedItem,\n items,\n inputValue: inputValueProp,\n onInputValueChange,\n onSelectItem,\n onFocus,\n onBlur,\n renderItem,\n icon = <CaretDownIcon color={tokens.gray600} />,\n itemToString = (item: ItemType) => item as unknown as string,\n isInvalid,\n isDisabled,\n isRequired,\n isReadOnly,\n showEmptyList,\n noMatchesMessage = 'No matches found',\n placeholder = 'Search',\n inputRef: inputRefProp,\n toggleRef,\n listRef,\n listWidth = 'auto',\n listMaxHeight = 180,\n isGrouped = false,\n isLoading = false,\n usePortal = false,\n testId = 'cf-autocomplete',\n popoverTestId = 'cf-autocomplete-container',\n showClearButton: showClearButtonProp,\n aria = {\n clearSelectionIconLabel: 'Clear',\n showListIconLabel: 'Show list',\n },\n } = props;\n\n type GroupType = GenericGroupType<ItemType>;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const [_inputValue, setInputValue] = useState(defaultValue);\n const inputValue =\n typeof inputValueProp === 'undefined' ? _inputValue : inputValueProp;\n const inputRef = useRef(null);\n\n const handleInputValueChange = useCallback(\n (value: string) => {\n setInputValue(value);\n\n onInputValueChange?.(value);\n },\n [onInputValueChange],\n );\n\n // Handle manually to avoid a jumping cursor, see https://github.com/downshift-js/downshift/issues/1108#issuecomment-842407759\n const handleNativeChangeEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = event.target.value;\n handleInputValueChange(value);\n },\n [handleInputValueChange],\n );\n\n const flattenItems = isUsingGroups(isGrouped, items)\n ? items.reduce(\n (acc: ItemType[], group: GroupType) => [...acc, ...group.options],\n [],\n )\n : items;\n\n const isShowingNoMatches = isUsingGroups(isGrouped, items)\n ? items.every((group: GroupType) => group.options.length === 0)\n : items.length === 0;\n\n const {\n getInputProps,\n getItemProps,\n getMenuProps,\n getToggleButtonProps,\n highlightedIndex,\n isOpen,\n toggleMenu,\n } = useCombobox({\n isOpen: isOpenProp,\n onIsOpenChange: ({ isOpen }) => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n },\n stateReducer: (state, { type, changes }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputBlur: {\n // don't change input value on blur\n return { ...changes, inputValue: state.inputValue };\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick: {\n // prevent the menu from being closed when the user selects an item with a keyboard or mouse\n if (!closeAfterSelect) {\n return {\n ...changes,\n isOpen: state.isOpen,\n };\n }\n\n return changes;\n }\n default:\n return changes;\n }\n },\n items: flattenItems,\n selectedItem,\n inputValue,\n itemToString,\n onInputValueChange: ({ type, inputValue }) => {\n switch (type) {\n // value is set directly from the TextInput onChange handler\n case useCombobox.stateChangeTypes.InputChange: {\n return;\n }\n\n // item is selected by click or keydown\n case useCombobox.stateChangeTypes.ItemClick:\n case useCombobox.stateChangeTypes.InputKeyDownEnter: {\n // clear the TextInput value\n if (textOnAfterSelect === 'clear') {\n handleInputValueChange('');\n return;\n }\n\n // keep the current TextInput value\n if (textOnAfterSelect === 'preserve') {\n return;\n }\n }\n }\n\n handleInputValueChange(inputValue);\n },\n onStateChange: ({ type, selectedItem }) => {\n switch (type) {\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\n case useCombobox.stateChangeTypes.ItemClick:\n if (selectedItem) {\n onSelectItem(selectedItem);\n }\n break;\n default:\n break;\n }\n },\n });\n\n const {\n 'aria-labelledby': _labelledby,\n id: _inputId,\n ...inputProps\n } = getInputProps({ ref: inputRef });\n const toggleProps = getToggleButtonProps();\n const menuRef = useRef(null);\n const menuProps = getMenuProps({ ref: menuRef });\n let elementStartIndex = 0;\n\n const showClearButton = showClearButtonProp ?? inputValue;\n\n return (\n <div\n data-test-id={testId}\n className={cx(styles.autocomplete, className)}\n ref={ref}\n >\n <Popover\n usePortal={usePortal}\n isOpen={isOpen}\n isFullWidth={listWidth === 'full'}\n renderOnlyWhenOpen={false}\n // This is necessary, otherwise the focus will change from the input to the Popover\n // and the user won't be able to type in the input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={false}\n id={menuProps.id}\n >\n <Popover.Trigger>\n <div>\n <TextInput\n className={styles.inputField}\n {...inputProps}\n onFocus={(e) => {\n onFocus?.(e as React.FocusEvent<HTMLInputElement>);\n }}\n onBlur={(e) => {\n onBlur?.(e as React.FocusEvent<HTMLInputElement>);\n inputProps.onBlur(e);\n }}\n id={id}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n ref={mergeRefs(inputProps.ref, inputRefProp)}\n testId=\"cf-autocomplete-input\"\n placeholder={placeholder}\n onChange={(event) => {\n inputProps.onChange(event);\n handleNativeChangeEvent(event);\n }}\n />\n <IconButton\n {...toggleProps}\n ref={mergeRefs(toggleProps.ref, toggleRef)}\n aria-label={\n showClearButton\n ? aria.clearSelectionIconLabel\n : aria.showListIconLabel\n }\n className={styles.toggleButton}\n variant=\"transparent\"\n icon={showClearButton ? <XIcon color={tokens.gray600} /> : icon}\n onClick={() => {\n if (showClearButton) {\n handleInputValueChange('');\n } else {\n toggleMenu();\n }\n }}\n isDisabled={isDisabled}\n size=\"small\"\n />\n </div>\n </Popover.Trigger>\n\n {items.length > 0 || inputValue.length > 0 || showEmptyList ? (\n <Popover.Content\n {...menuProps}\n ref={mergeRefs(menuProps.ref, listRef)}\n className={styles.content}\n testId={popoverTestId}\n >\n {isLoading &&\n [...Array(3)].map((_, index) => (\n <div\n key={index}\n className={cx(styles.item({ isDisabled: true }))}\n >\n <ListItemLoadingState />\n </div>\n ))}\n\n {!isLoading && isShowingNoMatches && (\n <div className={styles.item({})}>\n <Subheading className={styles.noMatchesTitle}>\n {noMatchesMessage}\n </Subheading>\n </div>\n )}\n\n {!isLoading &&\n isUsingGroups(isGrouped, items) &&\n items.map((group: GroupType, index: number) => {\n if (group.options.length < 1) {\n return;\n }\n const render = (\n <div key={index}>\n <SectionHeading\n key={index}\n data-test-id=\"cf-autocomplete-grouptitle\"\n marginBottom=\"none\"\n className={styles.groupTitle}\n >\n {group.groupTitle}\n </SectionHeading>\n <AutocompleteItems<ItemType>\n items={group.options}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n elementStartIndex={elementStartIndex}\n />\n </div>\n );\n elementStartIndex += group.options.length;\n return render;\n })}\n\n {!isLoading &&\n !isUsingGroups(isGrouped, items) &&\n items.length > 0 && (\n <AutocompleteItems<ItemType>\n items={items}\n elementStartIndex={elementStartIndex}\n highlightedIndex={highlightedIndex}\n getItemProps={getItemProps}\n renderItem={renderItem}\n inputValue={inputValue}\n />\n )}\n </Popover.Content>\n ) : (\n // We need to render an empty hidden div, so we can pass the menuProps or downshift will show a warning about it\n // https://github.com/downshift-js/downshift/issues/1167#issuecomment-1088022842\n <div {...menuProps} className={cx(styles.hidden)} />\n )}\n </Popover>\n </div>\n );\n}\n\nconst ListItemLoadingState = () => {\n return (\n <Skeleton.Container svgHeight={16}>\n <Skeleton.BodyText numberOfLines={1} />\n </Skeleton.Container>\n );\n};\n\n// This is required to infer correct typings when differentiating groups and items\nfunction isUsingGroups<ItemType>(\n isGrouped: boolean,\n items: ItemType[] | GenericGroupType<ItemType>[],\n): items is GenericGroupType<ItemType>[] {\n return isGrouped;\n}\n\n/**\n * The Autocomplete is a component that will show a `TextInput` where a user can type any word which will be used\n * to filter a list of items. That list of filtered items will be shown to the user as possible options for the input.\n * Once one of the options is selected, that option becomes the value of the `TextInput`.\n */\nexport const Autocomplete = React.forwardRef(AutocompleteBase) as <T>(\n props: ExpandProps<AutocompleteProps<T>> & {\n ref?: React.Ref<HTMLDivElement>;\n },\n) => ReturnType<typeof AutocompleteBase>;\n","import { css, cx } from '@emotion/css';\nimport tokens from '@contentful/f36-tokens';\nimport { getMenuItemStyles } from '@contentful/f36-core';\n\nexport const getAutocompleteStyles = (listMaxHeight: number) => ({\n autocomplete: css({\n position: 'relative',\n width: '100%',\n }),\n inputField: css({\n paddingRight: tokens.spacingXl,\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n toggleButton: css({\n position: 'absolute',\n top: '1px',\n right: '1px',\n zIndex: 1,\n padding: tokens.spacing2Xs,\n minHeight: 'calc(100% - 2px)',\n }),\n content: css({\n overflow: 'auto',\n maxHeight: `${listMaxHeight}px`,\n }),\n list: css({\n listStyle: 'none',\n padding: `${tokens.spacingXs} ${tokens.spacing2Xs}`,\n margin: 0,\n }),\n groupTitle: css({\n padding: `${tokens.spacingXs} ${tokens.spacingM}`,\n lineHeight: tokens.lineHeightM,\n }),\n noMatchesTitle: css({\n color: tokens.gray500,\n margin: `${tokens.spacingM} 0 ${tokens.spacingM} 0`,\n }),\n item: ({\n isActive = false,\n isDisabled = false,\n }: {\n isActive?: boolean;\n isDisabled?: boolean;\n }) => cx(getMenuItemStyles({ isActive, isDisabled })),\n highlighted: css({\n backgroundColor: tokens.gray100,\n }),\n hidden: css({\n display: 'none',\n }),\n});\n","import React, { HTMLAttributes } from 'react';\nimport { cx } from '@emotion/css';\nimport { getStringMatch } from '@contentful/f36-utils';\nimport type { UseComboboxGetItemPropsOptions } from 'downshift';\nimport { Text } from '@contentful/f36-typography';\n\nimport { getAutocompleteStyles } from './Autocomplete.styles';\n\ninterface AutocompleteItemsProps<ItemType> {\n items: ItemType[];\n elementStartIndex: number;\n highlightedIndex: number;\n getItemProps: (\n options: UseComboboxGetItemPropsOptions<ItemType>,\n ) => HTMLAttributes<HTMLLIElement>;\n renderItem: (item: ItemType, inputValue: string) => React.ReactNode;\n inputValue: string;\n listMaxHeight?: number;\n}\n\nexport const AutocompleteItems = <ItemType,>(\n props: AutocompleteItemsProps<ItemType>,\n) => {\n const {\n items,\n elementStartIndex,\n highlightedIndex,\n getItemProps,\n renderItem,\n inputValue,\n listMaxHeight = 180,\n } = props;\n\n const styles = getAutocompleteStyles(listMaxHeight);\n\n const renderHighlightedItem = (item: ItemType, inputValue) => {\n if (renderItem) {\n return renderItem(item, inputValue);\n }\n if (typeof item === 'string') {\n return <HighlightedItem item={item} inputValue={inputValue} />;\n }\n if (!React.isValidElement(item)) {\n // eslint-disable-next-line no-console\n console.error(\n 'Only valid React elements are supported - https://react.dev/reference/react/isValidElement',\n );\n return null;\n }\n return item;\n };\n\n return (\n <ul className={styles.list} data-test-id=\"cf-autocomplete-list\">\n {items.map((item: ItemType, index: number) => {\n const itemIndex = elementStartIndex + index;\n const itemProps = getItemProps({ item, index: itemIndex });\n return (\n <Text\n {...itemProps}\n as=\"li\"\n key={itemIndex}\n className={cx([\n styles.item({}),\n highlightedIndex === itemIndex && styles.highlighted,\n ])}\n data-highlighted={highlightedIndex === itemIndex}\n data-test-id={`cf-autocomplete-list-item-${itemIndex}`}\n >\n {renderHighlightedItem(item, inputValue)}\n </Text>\n );\n })}\n </ul>\n );\n};\n\nAutocompleteItems.displayName = 'AutocompleteItems';\n\nfunction HighlightedItem({\n item,\n inputValue,\n}: {\n item: string;\n inputValue: string;\n}) {\n const { before, match, after } = getStringMatch(item, inputValue);\n\n return (\n <>\n {before}\n <b>{match}</b>\n {after}\n </>\n );\n}\n\nHighlightedItem.displayName = 'HighlightedItem';\n"]}
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@contentful/f36-autocomplete",
3
- "version": "6.7.1",
3
+ "version": "6.7.2",
4
4
  "description": "Forma 36: Autocomplete component",
5
5
  "scripts": {
6
6
  "build": "tsup"
7
7
  },
8
8
  "dependencies": {
9
- "@contentful/f36-button": "^6.7.1",
10
- "@contentful/f36-core": "^6.7.1",
11
- "@contentful/f36-forms": "^6.7.1",
12
- "@contentful/f36-popover": "^6.7.1",
13
- "@contentful/f36-skeleton": "^6.7.1",
14
- "@contentful/f36-icons": "^6.7.1",
9
+ "@contentful/f36-button": "^6.7.2",
10
+ "@contentful/f36-core": "^6.7.2",
11
+ "@contentful/f36-forms": "^6.7.2",
12
+ "@contentful/f36-popover": "^6.7.2",
13
+ "@contentful/f36-skeleton": "^6.7.2",
14
+ "@contentful/f36-icons": "^6.7.2",
15
15
  "@contentful/f36-tokens": "^6.1.0",
16
- "@contentful/f36-typography": "^6.7.1",
16
+ "@contentful/f36-typography": "^6.7.2",
17
17
  "@contentful/f36-utils": "^6.1.0",
18
18
  "downshift": "^9.0.10",
19
19
  "@emotion/css": "^11.13.5"