@nuskin/react-search-components 1.0.0 → 1.1.0-cx130-2624.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/components/Icon/iconConstants.ts","../src/components/Icon/Icon.tsx","../src/components/SearchPanelLayout/SearchPanelLayout.styled.tsx","../src/components/SearchPanelLayout/SearchPanelLayout.tsx","../src/components/arrowKeys.ts","../src/components/SearchMessageInput/SearchMessageInput.styled.tsx","../src/components/SearchMessageInput/SearchMessageInput.tsx","../src/components/SearchPanel/SearchPanel.styled.tsx","../src/components/SearchPanel/RecentSearches.tsx","../src/components/SuggestionRow/SuggestionRow.styled.tsx","../src/components/SuggestionRow/helpers.ts","../src/components/SuggestionRow/SuggestionRow.tsx","../src/components/SeeMoreLink/SeeMoreLink.styled.tsx","../src/components/SeeMoreLink/SeeMoreLink.tsx","../src/components/SearchPanel/SearchSuggestions.tsx","../src/components/SearchPanel/SearchPanel.tsx"],"names":["styled","SearchPanelLayout","jsx","jsxs","colors","nuskinTheme","SuggestionRow","forwardRef","SearchSuggestions","useState","useRef","_a"],"mappings":";;;;;;;;;;AAAO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,YAAA,EAAc,aAAA;AAAA,EACd,eAAA,EAAiB,gBAAA;AAAA,EACjB,gBAAA,EAAkB,iBAAA;AAAA,EAClB,eAAA,EAAiB;AACnB,CAAA;AAEO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AAEO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS;AACX,CAAA;ACJA,IAAM,iBAAA,GAAoB;AAAA,EACxB,CAAC,UAAA,CAAW,KAAK,GAAG,EAAA;AAAA,EACpB,CAAC,UAAA,CAAW,KAAK,GAAG;AACtB,CAAA;AAGA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AA,kBACjB,WAAW,IAAA,CAAK;AAAA;AAAA;AAClB,aAAA,EAEJ;AAAA;AAAA;AAEJ;AAAA,KACF;AAAA,IACA,QAAA,CAAS;AAAA,GACX;AACF","file":"index.mjs","sourcesContent":["export const ICON_TYPES = {\n CLOSE: 'close',\n SEARCH_FIELD: 'searchField',\n SUGGESTION_CART: 'suggestionCart',\n SUGGESTION_CLOSE: 'suggestionClose',\n SUGGESTION_TASK: 'suggestionTask',\n} as const;\n\nexport const ICON_SIZES = {\n LARGE: 'large',\n SMALL: 'small',\n} as const;\n\nexport const ICON_CURSORS = {\n DEFAULT: 'default',\n POINTER: 'pointer',\n} as const;\n\nexport type IconType = (typeof ICON_TYPES)[keyof typeof ICON_TYPES];\nexport type IconSize = (typeof ICON_SIZES)[keyof typeof ICON_SIZES];\nexport type IconCursor = (typeof ICON_CURSORS)[keyof typeof ICON_CURSORS];\n","import styled from '@emotion/styled';\nimport type { ReactElement, ReactNode } from 'react';\nimport { NsIcon, type NsIconNameType, type NsIconSizeType } from '@nuskin/foundation-ui-components';\nimport {\n ICON_CURSORS,\n ICON_SIZES,\n ICON_TYPES,\n type IconCursor,\n type IconSize,\n type IconType,\n} from './iconConstants';\n\nconst SIDE_BY_ICON_SIZE = {\n [ICON_SIZES.LARGE]: 24,\n [ICON_SIZES.SMALL]: 16,\n} as const satisfies Record<IconSize, number>;\n\n// These icons come from the foundation design system.\nconst FOUNDATION_ICON_NAME_BY_ICON_TYPE: Partial<Record<IconType, NsIconNameType>> = {\n [ICON_TYPES.CLOSE]: 'close',\n [ICON_TYPES.SEARCH_FIELD]: 'search',\n};\n\nconst FOUNDATION_SIZE_BY_ICON_SIZE = {\n [ICON_SIZES.LARGE]: 'large',\n [ICON_SIZES.SMALL]: 'small',\n} as const satisfies Record<IconSize, NsIconSizeType>;\n\ninterface CustomIconProps {\n className?: string;\n color: string;\n cursor: IconCursor;\n size: IconSize;\n testId: string;\n}\n\ninterface FoundationIconProps extends CustomIconProps {\n name: NsIconNameType;\n}\n\ntype IconView = (props: Readonly<CustomIconProps>) => ReactElement;\n\nexport interface IconProps {\n className?: string;\n color?: string;\n cursor?: IconCursor;\n size?: IconSize;\n testId?: string;\n type: IconType;\n}\n\nconst IconSvg = styled.svg<{ $color: string; $cursor: IconCursor }>`\n color: ${({ $color }) => $color};\n cursor: ${({ $cursor }) => $cursor};\n display: block;\n`;\n\n/**\n * What every custom icon shares: the element, its decorative role, its color and cursor, and the\n * round-ended 2px line it is drawn with.\n */\nfunction OutlinedIcon({\n children,\n className,\n color,\n cursor,\n size,\n testId,\n}: Readonly<CustomIconProps & { children: ReactNode }>) {\n const side = SIDE_BY_ICON_SIZE[size];\n\n return (\n <IconSvg\n $color={color}\n $cursor={cursor}\n aria-hidden=\"true\"\n className={className}\n data-testid={testId}\n fill=\"none\"\n height={side}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n viewBox=\"0 0 24 24\"\n width={side}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {children}\n </IconSvg>\n );\n}\n\nfunction FoundationIcon({\n className,\n color,\n cursor,\n name,\n size,\n testId,\n}: Readonly<FoundationIconProps>) {\n return (\n <NsIcon\n aria-hidden\n {...(className === undefined ? {} : { className })}\n colorOverride={color}\n cursor={cursor}\n name={name}\n size={FOUNDATION_SIZE_BY_ICON_SIZE[size]}\n testId={testId}\n />\n );\n}\n\nconst SuggestionCloseIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <line x1={18} y1={6} x2={6} y2={18} />\n <line x1={6} y1={6} x2={18} y2={18} />\n </OutlinedIcon>\n);\n\nconst SuggestionCartIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <circle cx={9} cy={21} r={1} />\n <circle cx={20} cy={21} r={1} />\n <path d=\"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6\" />\n </OutlinedIcon>\n);\n\nconst SuggestionTaskIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <rect x={9} y={9} width={13} height={13} rx={2} ry={2} />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </OutlinedIcon>\n);\n\nconst ICON_VIEW_BY_TYPE: Partial<Record<IconType, IconView>> = {\n [ICON_TYPES.SUGGESTION_CART]: SuggestionCartIcon,\n [ICON_TYPES.SUGGESTION_CLOSE]: SuggestionCloseIcon,\n [ICON_TYPES.SUGGESTION_TASK]: SuggestionTaskIcon,\n};\n\nexport default function Icon({\n className,\n color = 'currentColor',\n cursor = ICON_CURSORS.DEFAULT,\n size = ICON_SIZES.LARGE,\n testId,\n type,\n}: Readonly<IconProps>) {\n const customProps = {\n ...(className === undefined ? {} : { className }),\n color,\n cursor,\n size,\n testId: testId ?? `icon-${type}`,\n };\n const foundationName = FOUNDATION_ICON_NAME_BY_ICON_TYPE[type];\n\n if (foundationName !== undefined) {\n return <FoundationIcon {...customProps} name={foundationName} />;\n }\n\n const IconView = ICON_VIEW_BY_TYPE[type];\n return IconView === undefined ? null : <IconView {...customProps} />;\n}\n\nexport { ICON_CURSORS, ICON_SIZES, ICON_TYPES };\nexport type { IconCursor, IconSize, IconType };\n","import styled from '@emotion/styled';\nimport { nuskinTheme } from '@nuskin/foundation-theme';\n\nconst { colors } = nuskinTheme;\n\n/** The old search's breakpoint: from here up the panel is a band across the top of the page. */\nconst DESKTOP_MIN_PX = 1025;\n\n/**\n * An embedded agent fills its host and adds no height of its own, so on desktop the panel needs a\n * definite height to give it. Below the breakpoint the panel is full screen, which is definite.\n */\nconst AGENT_DESKTOP_BLOCK_SIZE = '70dvh';\n\n/**\n * The panel is a native dialog, shown in place with `open` so that it is not modal. The browser's\n * dialog styling (centered, bordered, padded, size-limited) is reset above, and the panel is laid\n * out by the overlay that holds it.\n *\n * Below the breakpoint the panel fills the screen and scrolls inside itself, without passing the\n * scroll on to the page. From the breakpoint up it is as tall as its content, up to the screen.\n */\nexport const SearchPanelLayoutRoot = styled.dialog<{ $agentMode?: boolean }>`\n background-color: ${colors.primary.white};\n block-size: 100%;\n border: 0;\n border-block-end: 1px solid ${colors.neutral[30]};\n box-sizing: border-box;\n color: ${colors.primary.black};\n inline-size: 100%;\n inset: auto;\n margin: 0;\n max-block-size: 100%;\n max-inline-size: none;\n outline: none;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n position: static;\n\n /* Full screen: keep the scroll in the panel. On desktop the wheel carries on to the page. */\n @media (max-width: ${DESKTOP_MIN_PX - 1}px) {\n overscroll-behavior: contain;\n }\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n block-size: auto;\n }\n\n ${({ $agentMode }) =>\n $agentMode &&\n `\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n block-size: min(${AGENT_DESKTOP_BLOCK_SIZE}, 100%);\n }\n `}\n`;\n\nexport const SearchPanelLayoutInner = styled.div<{ $agentMode?: boolean }>`\n box-sizing: border-box;\n display: grid;\n gap: 1.5rem;\n inline-size: min(100%, 75rem);\n margin-inline: auto;\n padding: clamp(1rem, 2vw, 2rem);\n ${({ $agentMode }) =>\n $agentMode &&\n `\n display: flex;\n flex-direction: column;\n flex: 1;\n min-block-size: 0;\n overflow: hidden;\n `}\n`;\n\n/** Hosts an embedded agent below the header; the agent brings its own scrolling and input. */\nexport const SearchPanelLayoutAgentContent = styled.div`\n flex: 1;\n min-block-size: 0;\n min-inline-size: 0;\n overflow: hidden;\n position: relative;\n`;\n\nexport const SearchPanelLayoutHeader = styled.header<{ $agentMode?: boolean }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n ${({ $agentMode }) =>\n $agentMode &&\n `\n /* keep the close button on the right even when no logo is rendered */\n justify-content: flex-end;\n `}\n`;\n\nexport const SearchPanelLayoutLogoSlot = styled.div`\n flex: 0 0 auto;\n /* when header is flex-end (agent mode), push the logo to the far left */\n margin-inline-end: auto;\n`;\n\nexport const SearchPanelLayoutCloseButton = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n border: 0;\n color: inherit;\n cursor: pointer;\n display: inline-flex;\n font: inherit;\n gap: 0.375rem;\n padding: 0.5rem;\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n`;\n\nexport const SearchPanelLayoutContent = styled.div`\n min-inline-size: 0;\n`;\n\nexport const SearchPanelLayoutInputSlot = styled.div`\n inline-size: min(100%, 44rem);\n justify-self: center;\n width: 100%;\n`;\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport Icon, { ICON_CURSORS, ICON_SIZES, ICON_TYPES } from '../Icon';\nimport {\n SearchPanelLayoutAgentContent,\n SearchPanelLayoutCloseButton,\n SearchPanelLayoutContent,\n SearchPanelLayoutHeader,\n SearchPanelLayoutInner,\n SearchPanelLayoutInputSlot,\n SearchPanelLayoutLogoSlot,\n SearchPanelLayoutRoot,\n} from './SearchPanelLayout.styled';\n\nexport interface SearchPanelLayoutProps extends Omit<\n ComponentPropsWithoutRef<'dialog'>,\n 'aria-label' | 'children'\n> {\n 'aria-label': string;\n children: ReactNode;\n closeLabel: string;\n onClose: () => void;\n inputSlot?: ReactNode;\n logoSlot?: ReactNode;\n /**\n * When true: the panel hosts an embedded agent. Children fill the space below the header\n * and bring their own scrolling and input, so no input slot renders.\n */\n agentMode?: boolean;\n}\n\nconst SearchPanelLayout = forwardRef<HTMLDialogElement, Readonly<SearchPanelLayoutProps>>(\n function SearchPanelLayout(\n {\n 'aria-label': ariaLabel,\n agentMode = false,\n children,\n closeLabel,\n inputSlot,\n logoSlot,\n onClose,\n ...props\n },\n ref,\n ) {\n return (\n <SearchPanelLayoutRoot\n ref={ref}\n {...props}\n open\n aria-label={ariaLabel}\n $agentMode={agentMode}\n >\n <SearchPanelLayoutInner $agentMode={agentMode}>\n <SearchPanelLayoutHeader $agentMode={agentMode}>\n {logoSlot && <SearchPanelLayoutLogoSlot>{logoSlot}</SearchPanelLayoutLogoSlot>}\n <SearchPanelLayoutCloseButton\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onClose}\n >\n <Icon cursor={ICON_CURSORS.POINTER} size={ICON_SIZES.SMALL} type={ICON_TYPES.CLOSE} />\n {closeLabel}\n </SearchPanelLayoutCloseButton>\n </SearchPanelLayoutHeader>\n\n {!agentMode && inputSlot && (\n <SearchPanelLayoutInputSlot>{inputSlot}</SearchPanelLayoutInputSlot>\n )}\n\n {agentMode ? (\n <SearchPanelLayoutAgentContent data-agent-container=\"\">\n {children}\n </SearchPanelLayoutAgentContent>\n ) : (\n <SearchPanelLayoutContent>{children}</SearchPanelLayoutContent>\n )}\n </SearchPanelLayoutInner>\n </SearchPanelLayoutRoot>\n );\n },\n);\n\nexport default SearchPanelLayout;\n","import type { KeyboardEvent } from 'react';\n\n/** Which way an unmodified ArrowDown (1) or ArrowUp (-1) points; null for any other key press. */\nexport function getArrowDirection(event: KeyboardEvent): 1 | -1 | null {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return null;\n if (event.key === 'ArrowDown') return 1;\n if (event.key === 'ArrowUp') return -1;\n return null;\n}\n","import styled from '@emotion/styled';\nimport { nuskinTheme } from '@nuskin/foundation-theme';\n\nconst { colors } = nuskinTheme;\n\nconst focusColor = '#6964f1';\n\n/** The pill: magnifier, text, and a clear button once there is text. */\nexport const SearchMessageInputRoot = styled.form`\n align-items: center;\n background-color: ${colors.primary.white};\n border: 1px solid ${colors.primary.black};\n border-radius: 999px;\n box-sizing: border-box;\n display: flex;\n gap: 0.25rem;\n inline-size: 100%;\n min-block-size: 3rem;\n padding: 0.25rem 0.5rem;\n\n &:focus-within {\n border-color: ${focusColor};\n box-shadow: 0 0 0 1px ${focusColor};\n }\n`;\n\nexport const SearchMessageInputField = styled.input`\n appearance: none;\n background: transparent;\n border: 0;\n box-sizing: border-box;\n color: ${colors.primary.black};\n flex: 1 1 auto;\n font: inherit;\n min-inline-size: 0;\n outline: 0;\n padding: 0.5rem;\n\n &::placeholder {\n color: ${colors.neutral[20]};\n opacity: 1;\n }\n`;\n\nexport const SearchMessageInputSubmit = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n block-size: 2.125rem;\n border: 0;\n border-radius: 999px;\n color: ${colors.neutral[20]};\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n inline-size: 2.125rem;\n justify-content: center;\n margin: 0;\n padding: 0;\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n`;\n\nexport const SearchMessageInputClear = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n block-size: 2.125rem;\n border: 0;\n border-radius: 999px;\n color: ${colors.primary.black};\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n inline-size: 2.125rem;\n justify-content: center;\n margin: 0;\n padding: 0;\n\n &:hover {\n opacity: 0.7;\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n`;\n","import {\n useCallback,\n useRef,\n type ComponentPropsWithoutRef,\n type FormEvent,\n type KeyboardEvent,\n type MutableRefObject,\n type RefCallback,\n} from 'react';\nimport Icon, { ICON_CURSORS, ICON_SIZES, ICON_TYPES } from '../Icon';\nimport { getArrowDirection } from '../arrowKeys';\nimport {\n SearchMessageInputClear,\n SearchMessageInputField,\n SearchMessageInputRoot,\n SearchMessageInputSubmit,\n} from './SearchMessageInput.styled';\n\nexport interface SearchMessageInputProps extends Omit<\n ComponentPropsWithoutRef<'form'>,\n 'children' | 'onSubmit' | 'onChange'\n> {\n /** The accessible name of the clear button, shown while there is text. */\n clearLabel: string;\n inputLabel: string;\n /** Receives the text box, so the host can move focus into it. */\n inputRef?: RefCallback<HTMLInputElement> | MutableRefObject<HTMLInputElement | null>;\n /**\n * Called when ArrowDown is pressed, to move focus on to whatever is below. Return whether focus\n * moved: only then is the key kept from doing its default.\n */\n onArrowDown?: () => boolean;\n /** Called on every keystroke with the new text. The host owns `value` and passes it back. */\n onChange: (value: string) => void;\n /** Called with the trimmed text on Enter or on the magnifier. Never called for an empty box. */\n onSubmit: (message: string) => void;\n placeholder: string;\n /** The accessible name of the magnifier, which submits the search. */\n submitLabel: string;\n value: string;\n}\n\n/**\n * The search box, controlled by the host: a magnifier that submits, the text, and a clear button\n * once there is text. Enter submits too.\n */\nexport default function SearchMessageInput({\n clearLabel,\n inputLabel,\n inputRef,\n onArrowDown,\n onChange,\n onSubmit,\n placeholder,\n submitLabel,\n value,\n ...props\n}: Readonly<SearchMessageInputProps>) {\n const field = useRef<HTMLInputElement | null>(null);\n const setField = useCallback(\n (node: HTMLInputElement | null) => {\n field.current = node;\n if (typeof inputRef === 'function') inputRef(node);\n else if (inputRef) inputRef.current = node;\n },\n [inputRef],\n );\n\n function submitMessage() {\n const message = value.trim();\n\n if (message.length > 0) {\n onSubmit(message);\n }\n }\n\n function handleSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n submitMessage();\n }\n\n function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {\n if (event.key === 'Enter' && !event.nativeEvent.isComposing) {\n event.preventDefault();\n submitMessage();\n return;\n }\n\n if (getArrowDirection(event) === 1 && onArrowDown?.()) {\n event.preventDefault();\n }\n }\n\n return (\n <SearchMessageInputRoot\n {...props}\n role=\"search\"\n aria-label={inputLabel}\n onSubmit={handleSubmit}\n >\n <SearchMessageInputSubmit type=\"submit\" aria-label={submitLabel}>\n <Icon\n cursor={ICON_CURSORS.POINTER}\n size={ICON_SIZES.LARGE}\n type={ICON_TYPES.SEARCH_FIELD}\n />\n </SearchMessageInputSubmit>\n\n <SearchMessageInputField\n ref={setField}\n aria-label={inputLabel}\n autoComplete=\"off\"\n enterKeyHint=\"search\"\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n spellCheck={false}\n type=\"text\"\n value={value}\n />\n\n {value !== '' && (\n <SearchMessageInputClear\n type=\"button\"\n aria-label={clearLabel}\n onClick={() => {\n onChange('');\n field.current?.focus();\n }}\n >\n <Icon\n cursor={ICON_CURSORS.POINTER}\n size={ICON_SIZES.SMALL}\n type={ICON_TYPES.SUGGESTION_CLOSE}\n />\n </SearchMessageInputClear>\n )}\n </SearchMessageInputRoot>\n );\n}\n","import styled from '@emotion/styled';\n\nconst MOBILE_MAX_PX = 1024;\n\nconst colors = {\n text: '#111827',\n muted: '#6b7280',\n hover: '#f3f4f6',\n surface: '#ffffff',\n borderLight: '#e5e7eb',\n} as const;\n\nconst SEARCH_PANEL_Z_INDEX = 10000;\n\n/**\n * The layer that holds the panel and catches a press outside it, so the panel closes. It is\n * invisible: the old search did not dim the page either. It is not scrollable, so the wheel passes\n * through to the page, which keeps scrolling while the panel is open.\n */\nexport const SearchPanelOverlay = styled.div`\n -webkit-tap-highlight-color: transparent;\n align-items: stretch;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n inset: 0;\n overflow: hidden;\n position: fixed;\n z-index: ${SEARCH_PANEL_Z_INDEX};\n`;\n\n/** Read out by assistive technology, never drawn. */\nexport const SearchPanelStatus = styled.output`\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n\nexport const SearchSuggestionsPanel = styled.div`\n position: relative;\n width: 100%;\n margin-top: 8px;\n`;\n\nexport const SearchSuggestionsList = styled.ul`\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nconst SearchSuggestionOption = styled.li`\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 58px;\n padding: 4px 24px;\n box-sizing: border-box;\n color: ${colors.text};\n`;\n\nexport const PassiveSuggestionOption = styled(SearchSuggestionOption)`\n cursor: default;\n color: ${colors.muted};\n`;\n\nexport const SuggestionSectionHeading = styled.h3`\n padding: 12px 24px 8px;\n margin: 0 0 4px;\n font-size: 16px;\n font-weight: 700;\n color: ${colors.text};\n background: ${colors.surface};\n border-bottom: 1px solid ${colors.borderLight};\n`;\n\nexport const RecentSearchesSection = styled.section`\n padding: 24px 35px 18px;\n background: ${colors.surface};\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n padding: 18px 20px 16px;\n }\n`;\n\nexport const RecentSearchesHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n margin-bottom: 13px;\n`;\n\nexport const RecentSearchesTitle = styled.h3`\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: ${colors.text};\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n font-size: 15px;\n line-height: 1.35;\n }\n`;\n\nexport const RecentSearchesClearButton = styled.button`\n margin: 0;\n padding: 0;\n border: none;\n background: transparent;\n color: ${colors.text};\n font-size: 16px;\n cursor: pointer;\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n border-radius: 4px;\n }\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n font-size: 14px;\n }\n`;\n\nexport const RecentSearchesList = styled.div`\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n`;\n\nexport const RecentSearchChip = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 40px;\n padding: 8px 16px;\n border: 1px solid ${colors.borderLight};\n border-radius: 999px;\n background: ${colors.surface};\n color: ${colors.text};\n font-size: 16px;\n cursor: pointer;\n\n &:hover {\n background: ${colors.hover};\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n }\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n min-height: 36px;\n padding: 6px 14px;\n font-size: 14px;\n border-radius: 10px;\n }\n`;\n","import React, { useState } from 'react';\nimport {\n RecentSearchChip,\n RecentSearchesClearButton,\n RecentSearchesHeader,\n RecentSearchesList,\n RecentSearchesSection,\n RecentSearchesTitle,\n} from './SearchPanel.styled';\nimport type { SearchPanelRecentSearches } from './SearchPanel.types';\n\n/** How many recent searches show before the \"+N more\" chip. */\nexport const MAX_RECENT = 6;\n\nexport interface RecentSearchesProps extends SearchPanelRecentSearches {\n title: string;\n clearLabel: string;\n /** The text of the chip that shows the rest, given how many are hidden. */\n moreLabel: (hiddenCount: number) => string;\n}\n\n/** The recent-search chips, a clear control and an expander for the ones past the first few. */\nexport function RecentSearches({\n items,\n title,\n clearLabel,\n moreLabel,\n onSelect,\n onClear,\n}: Readonly<RecentSearchesProps>): React.ReactElement {\n const [showAll, setShowAll] = useState(false);\n const visible = showAll ? items : items.slice(0, MAX_RECENT);\n\n return (\n <RecentSearchesSection aria-label={title}>\n <RecentSearchesHeader>\n <RecentSearchesTitle>{title}</RecentSearchesTitle>\n <RecentSearchesClearButton\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onClear}\n >\n {clearLabel}\n </RecentSearchesClearButton>\n </RecentSearchesHeader>\n <RecentSearchesList>\n {visible.map((query) => (\n <RecentSearchChip\n key={query}\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onSelect(query)}\n >\n {query}\n </RecentSearchChip>\n ))}\n {!showAll && items.length > MAX_RECENT && (\n <RecentSearchChip\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setShowAll(true)}\n >\n {moreLabel(items.length - MAX_RECENT)}\n </RecentSearchChip>\n )}\n </RecentSearchesList>\n </RecentSearchesSection>\n );\n}\n","import styled from '@emotion/styled';\n\nexport const SUGGESTION_MOBILE_MAX_PX = 1024;\n\nconst colors = {\n text: '#111827',\n muted: '#6b7280',\n hover: '#f3f4f6',\n surface: '#ffffff',\n borderLight: '#e5e7eb',\n} as const;\n\nconst SuggestionOption = styled.li`\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 58px;\n padding: 4px 24px;\n box-sizing: border-box;\n color: ${colors.text};\n`;\n\nexport const SuggestionRow = styled(SuggestionOption)`\n display: grid;\n grid-template-columns: minmax(0, 1fr) 18px;\n align-items: center;\n column-gap: 12px;\n width: 100%;\n background: transparent;\n\n &[data-highlighted='true'],\n &:hover {\n background: var(--suggestion-row-hover-bg, #e9ecef);\n }\n\n &[data-out-of-stock='true'] {\n opacity: 0.75;\n }\n\n &[data-suggestion-type='did-you-mean'] {\n grid-template-columns: minmax(0, 1fr);\n }\n\n @media (max-width: ${SUGGESTION_MOBILE_MAX_PX}px) {\n padding: 6px 24px;\n column-gap: 8px;\n }\n`;\n\nexport const SuggestionContentWrapper = styled.button`\n appearance: none;\n background: transparent;\n border: 0;\n display: grid;\n grid-template-columns: 50px minmax(0, 1fr);\n align-items: center;\n column-gap: 16px;\n width: 100%;\n min-width: 0;\n margin: 0;\n padding: 0;\n color: inherit;\n cursor: pointer;\n font: inherit;\n outline: none;\n border-radius: 6px;\n text-align: start;\n\n &[data-out-of-stock='true'] {\n cursor: default;\n }\n\n &[data-has-image='false'] {\n grid-template-columns: minmax(0, 1fr);\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 3px;\n }\n\n &[data-suggestion-type='did-you-mean'] {\n grid-template-columns: minmax(0, 1fr);\n }\n`;\n\nexport const SuggestionThumbnail = styled.img`\n width: 50px;\n height: 50px;\n object-fit: contain;\n flex-shrink: 0;\n align-self: center;\n`;\n\nexport const SuggestionLabel = styled.span`\n display: block;\n min-width: 0;\n line-height: 24px;\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n font-size: 16px;\n color: ${colors.text};\n\n @media (max-width: ${SUGGESTION_MOBILE_MAX_PX}px) {\n font-size: 14px;\n line-height: 20px;\n }\n`;\n\nexport const SuggestionActionIcon = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n color: var(--suggestion-icon-color, ${colors.text});\n flex-shrink: 0;\n align-self: center;\n\n &[data-cart-disabled='true'] {\n color: var(--suggestion-muted, ${colors.muted});\n }\n\n svg {\n width: 24px;\n height: 24px;\n display: block;\n }\n`;\n\nexport const SuggestionActionButton = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n margin: 0;\n padding: 0;\n border: none;\n background: transparent;\n color: var(--suggestion-icon-color, ${colors.text});\n flex-shrink: 0;\n align-self: center;\n cursor: pointer;\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 3px;\n border-radius: 4px;\n }\n\n svg {\n width: 24px;\n height: 24px;\n display: block;\n }\n`;\n","import type { SuggestionDisplayData, SuggestionOption } from './types';\n\n/** The page a product suggestion leads to, for tracking. Empty for a \"did you mean\" term. */\nexport function getSuggestionUrl(option: SuggestionOption): string {\n return 'url' in option ? (option.url ?? option.href ?? '') : '';\n}\n\n/** What a row shows and which actions it offers. Stock and cart availability are the SDK's call. */\nexport function getSuggestionDisplayData(option: SuggestionOption): SuggestionDisplayData {\n if ('suggestionType' in option) {\n return {\n imageSrc: '',\n displayLabel: option.value,\n isBundle: false,\n isDidYouMean: true,\n isOutOfStock: false,\n isCartActionDisabled: false,\n };\n }\n\n return {\n imageSrc: option.imageURL.trim() || option.thumbnail.trim(),\n displayLabel: option.value,\n isBundle: option.productType === 'bundle',\n isDidYouMean: false,\n isOutOfStock: option.outOfStock,\n isCartActionDisabled: option.cartActionDisabled,\n };\n}\n","import React, { type Ref } from 'react';\nimport { getArrowDirection } from '../arrowKeys';\nimport type { SuggestionDisplayData, SuggestionRowProps } from './types';\nimport {\n SuggestionRow as StyledSuggestionRow,\n SuggestionContentWrapper,\n SuggestionThumbnail,\n SuggestionLabel,\n SuggestionActionIcon,\n SuggestionActionButton,\n} from './SuggestionRow.styled';\nimport Icon, { ICON_CURSORS, ICON_SIZES, ICON_TYPES } from '../Icon';\nimport { getSuggestionDisplayData, getSuggestionUrl } from './helpers';\n\nconst GTM_SEARCH_RESULT_CLICK = 'searchResultClick';\n\n/** `true` or `false`, as the text a data attribute carries. */\nconst flag = (value: boolean): 'true' | 'false' => (value ? 'true' : 'false');\n\n/** The product button and the action button both pass their arrow keys up to the row. */\nfunction passArrowKeysToList(\n event: React.KeyboardEvent,\n onNavigate: SuggestionRowProps['onNavigate'],\n) {\n const direction = getArrowDirection(event);\n if (direction === null) return;\n event.preventDefault();\n onNavigate(direction);\n}\n\ntype RowControls = Pick<\n SuggestionRowProps,\n 'onHighlightSuggestion' | 'suggestionIndex' | 'suggestionOption'\n>;\n\nfunction SuggestionImage({\n fallbackImageUrl,\n id,\n src,\n}: Readonly<{ fallbackImageUrl: string; id: string; src: string }>) {\n return (\n <SuggestionThumbnail\n src={src || fallbackImageUrl}\n alt=\"\"\n aria-hidden\n data-testid={`suggestion-thumbnail-${id}`}\n onError={(event) => {\n // Compare the attribute, as written, not `src`, which the browser makes absolute. Otherwise a\n // relative fallback never matches and a fallback that fails too would be swapped in forever.\n const image = event.currentTarget;\n if (fallbackImageUrl && image.getAttribute('src') !== fallbackImageUrl) {\n image.src = fallbackImageUrl;\n }\n }}\n />\n );\n}\n\n/** The row's main control: the image and the name, which selects the suggestion. */\nfunction SuggestionContent({\n controlRef,\n display,\n fallbackImageUrl,\n onHighlightSuggestion,\n onSelectSuggestion,\n suggestionIndex,\n suggestionOption,\n}: Readonly<\n RowControls & {\n controlRef: Ref<HTMLButtonElement> | undefined;\n display: SuggestionDisplayData;\n fallbackImageUrl: string;\n onSelectSuggestion: SuggestionRowProps['onSelectSuggestion'];\n }\n>) {\n const { displayLabel, imageSrc, isDidYouMean, isOutOfStock } = display;\n\n return (\n <SuggestionContentWrapper\n ref={controlRef}\n type=\"button\"\n aria-disabled={isOutOfStock ? true : undefined}\n data-testid={`suggestion-content-${suggestionOption.id}`}\n data-suggestion-type={isDidYouMean ? 'did-you-mean' : 'product'}\n data-has-image={flag(!isDidYouMean)}\n data-out-of-stock={flag(isOutOfStock)}\n data-gtm-type={GTM_SEARCH_RESULT_CLICK}\n data-gtm-result-title={displayLabel}\n data-gtm-result-url={getSuggestionUrl(suggestionOption)}\n onFocus={() => onHighlightSuggestion(suggestionIndex)}\n onClick={() => {\n if (!isOutOfStock) onSelectSuggestion(suggestionOption);\n }}\n >\n {!isDidYouMean && (\n <SuggestionImage\n fallbackImageUrl={fallbackImageUrl}\n id={suggestionOption.id}\n src={imageSrc}\n />\n )}\n <SuggestionLabel>{displayLabel}</SuggestionLabel>\n </SuggestionContentWrapper>\n );\n}\n\nfunction ActionIcon({\n id,\n isBundle,\n isInteractive,\n}: Readonly<{ id: string; isBundle: boolean; isInteractive: boolean }>) {\n return (\n <Icon\n color=\"currentColor\"\n cursor={isInteractive ? ICON_CURSORS.POINTER : ICON_CURSORS.DEFAULT}\n size={ICON_SIZES.LARGE}\n testId={isBundle ? `suggestion-bundle-icon-${id}` : `suggestion-cart-icon-${id}`}\n type={isBundle ? ICON_TYPES.SUGGESTION_TASK : ICON_TYPES.SUGGESTION_CART}\n />\n );\n}\n\n/**\n * The row's second control: add to cart, or the bundle action. When the SDK has turned the cart\n * action off, it is only an icon.\n */\nfunction SuggestionAction({\n actionLabel,\n isBundle,\n isCartActionDisabled,\n onHighlightSuggestion,\n onRunSuggestionAction,\n suggestionIndex,\n suggestionOption,\n}: Readonly<\n RowControls & {\n actionLabel: string;\n isBundle: boolean;\n isCartActionDisabled: boolean;\n onRunSuggestionAction: SuggestionRowProps['onRunSuggestionAction'];\n }\n>) {\n const { id } = suggestionOption;\n const icon = <ActionIcon id={id} isBundle={isBundle} isInteractive={!isCartActionDisabled} />;\n const testId = `suggestion-icon-${id}`;\n const kind = isBundle ? 'bundle' : 'single';\n\n if (isCartActionDisabled) {\n return (\n <SuggestionActionIcon\n data-testid={testId}\n data-suggestion-type={kind}\n data-cart-disabled=\"true\"\n >\n {icon}\n </SuggestionActionIcon>\n );\n }\n\n return (\n <SuggestionActionButton\n type=\"button\"\n data-testid={testId}\n data-suggestion-type={kind}\n aria-label={actionLabel}\n onFocus={() => onHighlightSuggestion(suggestionIndex)}\n onClick={() => onRunSuggestionAction(suggestionOption)}\n >\n {icon}\n </SuggestionActionButton>\n );\n}\n\nexport function SuggestionRow({\n addToCartLabel,\n controlRef,\n isHighlighted,\n onHighlightSuggestion,\n onNavigate,\n onRunSuggestionAction,\n onSelectSuggestion,\n openBundleLabel,\n suggestionIndex,\n suggestionOption,\n fallbackImageUrl = '',\n}: Readonly<SuggestionRowProps>): React.ReactElement {\n const display = getSuggestionDisplayData(suggestionOption);\n const { displayLabel, isBundle, isDidYouMean, isOutOfStock, isCartActionDisabled } = display;\n const controls = { onHighlightSuggestion, suggestionIndex, suggestionOption };\n\n return (\n <StyledSuggestionRow\n data-testid={`suggestion-row-${suggestionOption.id}`}\n data-highlighted={flag(isHighlighted)}\n data-suggestion-type={isDidYouMean ? 'did-you-mean' : 'product'}\n onMouseEnter={() => onHighlightSuggestion(suggestionIndex)}\n onKeyDown={(event) => passArrowKeysToList(event, onNavigate)}\n data-out-of-stock={flag(isOutOfStock)}\n >\n <SuggestionContent\n {...controls}\n controlRef={controlRef}\n display={display}\n fallbackImageUrl={fallbackImageUrl}\n onSelectSuggestion={onSelectSuggestion}\n />\n\n {!isDidYouMean && (\n <SuggestionAction\n {...controls}\n actionLabel={isBundle ? openBundleLabel(displayLabel) : addToCartLabel(displayLabel)}\n isBundle={isBundle}\n isCartActionDisabled={isCartActionDisabled}\n onRunSuggestionAction={onRunSuggestionAction}\n />\n )}\n </StyledSuggestionRow>\n );\n}\n","import styled from '@emotion/styled';\n\nconst colors = {\n text: '#111827',\n surface: '#ffffff',\n borderLight: '#e5e7eb',\n} as const;\n\nexport const SeeMoreLinkContainer = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 48px;\n padding: 0 16px;\n box-sizing: border-box;\n background: ${colors.surface};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 50%;\n width: 100vw;\n border-top: 1px solid ${colors.borderLight};\n transform: translateX(-50%);\n pointer-events: none;\n }\n`;\n\nexport const SeeMoreLinkText = styled.button`\n width: auto;\n height: auto;\n padding: 8px 0;\n border: none;\n background: transparent;\n font-size: 16px;\n font-weight: 400;\n line-height: 1.4;\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n color: ${colors.text};\n\n &:hover {\n opacity: 0.8;\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n border-radius: 4px;\n text-decoration-thickness: 2px;\n }\n`;\n","import React from 'react';\nimport { getArrowDirection } from '../arrowKeys';\nimport type { SeeMoreLinkProps } from './types';\nimport { SeeMoreLinkContainer, SeeMoreLinkText } from './SeeMoreLink.styled';\n\nconst GTM_SEARCH_SEE_MORE = 'searchSeeMore';\n\nexport function SeeMoreLink({\n buttonRef,\n onNavigate,\n onSeeMoreResults,\n seeMoreResultsText,\n searchQuery = '',\n}: Readonly<SeeMoreLinkProps>): React.ReactElement {\n return (\n <SeeMoreLinkContainer>\n <SeeMoreLinkText\n ref={buttonRef}\n type=\"button\"\n data-testid=\"autocomplete-see-more-button\"\n data-gtm-type={GTM_SEARCH_SEE_MORE}\n data-gtm-search-term={searchQuery.trim()}\n onClick={onSeeMoreResults}\n onKeyDown={(event) => {\n const direction = getArrowDirection(event);\n if (direction === null) return;\n event.preventDefault();\n onNavigate(direction);\n }}\n >\n {seeMoreResultsText}\n </SeeMoreLinkText>\n </SeeMoreLinkContainer>\n );\n}\n","import React, { forwardRef, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { SuggestionRow } from '../SuggestionRow/SuggestionRow';\nimport { SeeMoreLink } from '../SeeMoreLink/SeeMoreLink';\nimport {\n PassiveSuggestionOption,\n SearchSuggestionsList,\n SuggestionSectionHeading,\n} from './SearchPanel.styled';\nimport type { SearchPanelSuggestionsProps } from './SearchPanel.types';\n\nexport interface SearchSuggestionsProps extends SearchPanelSuggestionsProps {\n addToCartLabel: (productName: string) => string;\n didYouMeanText: string;\n noSuggestionsText: string;\n openBundleLabel: (productName: string) => string;\n seeMoreText: string;\n suggestionsLabel: string;\n fallbackImageUrl: string;\n /** Called when ArrowUp is pressed on the first suggestion, to move focus above the list. */\n onLeaveTop: () => void;\n}\n\n/** What the panel can ask of the list. */\nexport interface SearchSuggestionsHandle {\n /** Moves focus to the first suggestion, or to \"See more\" when there are none. False if neither. */\n focusFirst: () => boolean;\n}\n\n/** The suggestion rows, the \"did you mean\" heading, the empty state and \"see more results\". */\nexport const SearchSuggestions = forwardRef<\n SearchSuggestionsHandle,\n Readonly<SearchSuggestionsProps>\n>(function SearchSuggestions(\n {\n addToCartLabel,\n items,\n loading,\n showNoResults,\n showDidYouMean,\n hasMore,\n query,\n didYouMeanText,\n noSuggestionsText,\n openBundleLabel,\n seeMoreText,\n suggestionsLabel,\n fallbackImageUrl,\n onSelect,\n onRunAction,\n onSeeMore,\n onLeaveTop,\n },\n ref,\n) {\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const headingId = useId();\n const rowControls = useRef<Array<HTMLButtonElement | null>>([]);\n const seeMoreButton = useRef<HTMLButtonElement>(null);\n\n const rowCount = loading ? 0 : items.length;\n const showSeeMore = !loading && hasMore && !showDidYouMean;\n // The places focus can go, top to bottom: each row, then \"See more\".\n const stopCount = rowCount + (showSeeMore ? 1 : 0);\n\n function focusStop(index: number) {\n const stop = index < rowCount ? rowControls.current[index] : seeMoreButton.current;\n stop?.focus();\n }\n\n function moveFrom(index: number, direction: 1 | -1) {\n const next = index + direction;\n if (next < 0) onLeaveTop();\n else if (next < stopCount) focusStop(next);\n }\n\n useImperativeHandle(ref, () => ({\n focusFirst() {\n if (stopCount === 0) return false;\n focusStop(0);\n return true;\n },\n }));\n\n return (\n <>\n {showDidYouMean && (\n <SuggestionSectionHeading id={headingId} data-testid=\"autocomplete-did-you-mean-heading\">\n {didYouMeanText}\n </SuggestionSectionHeading>\n )}\n <SearchSuggestionsList\n aria-label={showDidYouMean ? undefined : suggestionsLabel}\n aria-labelledby={showDidYouMean ? headingId : undefined}\n aria-busy={loading}\n data-testid=\"autocomplete-results-list\"\n >\n {!loading &&\n items.map((option, index) => (\n <SuggestionRow\n key={option.id}\n addToCartLabel={addToCartLabel}\n openBundleLabel={openBundleLabel}\n controlRef={(control) => {\n rowControls.current[index] = control;\n }}\n isHighlighted={index === highlightedIndex}\n onHighlightSuggestion={setHighlightedIndex}\n onNavigate={(direction) => moveFrom(index, direction)}\n onRunSuggestionAction={onRunAction}\n onSelectSuggestion={onSelect}\n suggestionIndex={index}\n suggestionOption={option}\n fallbackImageUrl={fallbackImageUrl}\n />\n ))}\n {showNoResults && (\n <PassiveSuggestionOption data-highlighted=\"false\">\n {noSuggestionsText}\n </PassiveSuggestionOption>\n )}\n </SearchSuggestionsList>\n\n {showSeeMore && (\n <SeeMoreLink\n buttonRef={seeMoreButton}\n onNavigate={(direction) => moveFrom(rowCount, direction)}\n onSeeMoreResults={onSeeMore}\n seeMoreResultsText={seeMoreText}\n searchQuery={query}\n />\n )}\n </>\n );\n});\n","import React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport SearchPanelLayout from '../SearchPanelLayout/SearchPanelLayout';\nimport SearchMessageInput from '../SearchMessageInput/SearchMessageInput';\nimport {\n SearchPanelOverlay,\n SearchPanelStatus,\n SearchSuggestionsPanel,\n} from './SearchPanel.styled';\nimport { RecentSearches } from './RecentSearches';\nimport { SearchSuggestions, type SearchSuggestionsHandle } from './SearchSuggestions';\nimport type { SearchPanelCopy, SearchPanelProps } from './SearchPanel.types';\n\nexport type {\n SearchPanelCopy,\n SearchPanelInputProps,\n SearchPanelProps,\n SearchPanelRecentSearches,\n SearchPanelSuggestionsProps,\n} from './SearchPanel.types';\n\n/** True once mounted in a browser, so nothing that needs `document` renders on the server. */\nfunction useIsMounted(): boolean {\n const [isMounted, setIsMounted] = useState(false);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n return isMounted;\n}\n\n/** Gives focus back to whatever had it when the panel opened, once the panel closes. */\nfunction useRestoreFocus(isOpen: boolean): void {\n useEffect(() => {\n if (!isOpen) return undefined;\n\n const opener = document.activeElement;\n\n return () => {\n if (opener instanceof HTMLElement && opener.isConnected) opener.focus();\n };\n }, [isOpen]);\n}\n\n/** Closes on Escape, unless something inside the panel already used the key. */\nfunction useEscapeToClose(isOpen: boolean, onClose: () => void): void {\n useEffect(() => {\n if (!isOpen) return undefined;\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && !event.defaultPrevented) onClose();\n }\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, onClose]);\n}\n\n/**\n * Moves focus to `target` when the panel opens: the search box, or, when an agent fills the panel,\n * the panel itself so that Tab goes on into the agent.\n */\nfunction useFocusOnOpen(target: React.RefObject<HTMLElement>, isShown: boolean): void {\n useEffect(() => {\n if (!isShown) return undefined;\n\n const frame = requestAnimationFrame(() => target.current?.focus());\n\n return () => cancelAnimationFrame(frame);\n }, [target, isShown]);\n}\n\n/** What a screen reader is told about the suggestions as they change. Empty says nothing. */\nfunction getStatusText(\n { loading, showNoResults, items }: SearchPanelProps['suggestions'],\n copy: SearchPanelCopy,\n): string {\n if (loading) return copy.suggestionsLoading;\n if (showNoResults) return copy.noSuggestions;\n return items.length > 0 ? copy.suggestionsCount(items.length) : '';\n}\n\n/**\n * The search panel: a search box, suggestions and recent searches or, when `agentPanel` is set, a\n * header over an embedded agent. Full screen on small screens, a band across the top from the\n * desktop breakpoint up.\n *\n * It is a panel, not a modal: the page behind it keeps scrolling, keyboard focus is not trapped,\n * and the page is not hidden from assistive technology. It closes on Escape and on a press outside\n * it, and puts focus back where it was when it closes.\n *\n * Presentational: it holds only UI state (highlighted row, expanded recent searches). Fetching,\n * routing, navigation and all of its text belong to the host.\n */\nexport function SearchPanel({\n isOpen,\n onClose,\n logo,\n fallbackImageUrl = '',\n copy,\n input,\n suggestions,\n recentSearches,\n agentPanel,\n}: Readonly<SearchPanelProps>): React.ReactElement | null {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const layoutRef = useRef<HTMLDialogElement>(null);\n const suggestionsRef = useRef<SearchSuggestionsHandle>(null);\n const isMounted = useIsMounted();\n const hasAgent = agentPanel != null;\n const isShown = isOpen && isMounted;\n\n useRestoreFocus(isOpen);\n useEscapeToClose(isOpen, onClose);\n useFocusOnOpen(hasAgent ? layoutRef : inputRef, isShown);\n\n if (!isShown) return null;\n\n const hasQuery = input.value.trim() !== '';\n const hasRecentSearches = (recentSearches?.items.length ?? 0) > 0;\n\n const searchInput = (\n <SearchMessageInput\n clearLabel={copy.clearInput}\n inputLabel={copy.searchLabel}\n inputRef={inputRef}\n onArrowDown={() => suggestionsRef.current?.focusFirst() ?? false}\n onChange={input.onChange}\n onSubmit={input.onSubmit}\n placeholder={copy.searchPlaceholder}\n submitLabel={copy.submitSearch}\n value={input.value}\n data-testid=\"search-panel-input\"\n />\n );\n\n return createPortal(\n <SearchPanelOverlay\n data-testid=\"search-panel-overlay\"\n onPointerDown={(event) => {\n if (event.target === event.currentTarget) onClose();\n }}\n >\n <SearchPanelLayout\n ref={layoutRef}\n aria-label={copy.searchLabel}\n tabIndex={-1}\n closeLabel={copy.cancel}\n onClose={onClose}\n logoSlot={logo}\n agentMode={hasAgent}\n inputSlot={hasAgent ? undefined : searchInput}\n >\n {agentPanel ?? (\n <SearchSuggestionsPanel data-testid=\"autocomplete-suggestions-panel\">\n <SearchPanelStatus aria-atomic=\"true\" data-testid=\"search-panel-status\">\n {getStatusText(suggestions, copy)}\n </SearchPanelStatus>\n <SearchSuggestions\n {...suggestions}\n ref={suggestionsRef}\n onLeaveTop={() => inputRef.current?.focus()}\n addToCartLabel={copy.addToCart}\n didYouMeanText={copy.didYouMean}\n noSuggestionsText={copy.noSuggestions}\n openBundleLabel={copy.openBundle}\n seeMoreText={copy.seeMoreResults}\n suggestionsLabel={copy.suggestionsLabel}\n fallbackImageUrl={fallbackImageUrl}\n />\n {!hasQuery && recentSearches && hasRecentSearches && (\n <RecentSearches\n {...recentSearches}\n title={copy.recentSearches}\n clearLabel={copy.clearRecentSearches}\n moreLabel={copy.moreRecentSearches}\n />\n )}\n </SearchSuggestionsPanel>\n )}\n </SearchPanelLayout>\n </SearchPanelOverlay>,\n document.body,\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/Icon/iconConstants.ts","../src/components/Icon/Icon.tsx","../src/components/SearchPanelLayout/SearchPanelLayout.styled.tsx","../src/components/SearchPanelLayout/SearchPanelLayout.tsx","../src/components/arrowKeys.ts","../src/components/SearchMessageInput/SearchMessageInput.styled.tsx","../src/components/SearchMessageInput/nuiIcons.tsx","../src/components/SearchMessageInput/useMobileSearchLayout.ts","../src/components/SearchMessageInput/useRotatingPlaceholder.ts","../src/components/SearchMessageInput/SearchMessageInput.tsx","../src/components/SearchPanel/SearchPanel.styled.tsx","../src/components/SearchPanel/RecentSearches.tsx","../src/components/SuggestionRow/helpers.ts","../src/components/SuggestionRow/SuggestionRow.styled.tsx","../src/components/SuggestionRow/ProductSuggestionSnippet.tsx","../src/components/SuggestionRow/SuggestionRow.tsx","../src/components/SeeMoreLink/SeeMoreLink.styled.tsx","../src/components/SeeMoreLink/SeeMoreLink.tsx","../src/components/SearchPanel/SearchSuggestions.tsx","../src/components/SearchPanel/SearchPanel.tsx"],"names":["styled","jsxs","jsx","SearchPanelLayout","colors","nuskinTheme","useState","useEffect","_a","useRef","useCallback","SuggestionRow","forwardRef","SearchSuggestions","useId","Fragment"],"mappings":";;;;;;;;;;AAAO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,YAAA,EAAc,aAAA;AAAA,EACd,eAAA,EAAiB,gBAAA;AAAA,EACjB,gBAAA,EAAkB,iBAAA;AAAA,EAClB,eAAA,EAAiB;AACnB,CAAA;AAEO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AAEO,IAAM,YAAA,GAAe;AAAA,EAC1B,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS;AACX,CAAA;ACJA,IAAM,iBAAA,GAAoB;AAAA,EACxB,CAAC,UAAA,CAAW,KAAK,GAAG,EAAA;AAAA,EACpB,CAAC,UA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ESTION_CART: 'suggestionCart',\n SUGGESTION_CLOSE: 'suggestionClose',\n SUGGESTION_TASK: 'suggestionTask',\n} as const;\n\nexport const ICON_SIZES = {\n LARGE: 'large',\n SMALL: 'small',\n} as const;\n\nexport const ICON_CURSORS = {\n DEFAULT: 'default',\n POINTER: 'pointer',\n} as const;\n\nexport type IconType = (typeof ICON_TYPES)[keyof typeof ICON_TYPES];\nexport type IconSize = (typeof ICON_SIZES)[keyof typeof ICON_SIZES];\nexport type IconCursor = (typeof ICON_CURSORS)[keyof typeof ICON_CURSORS];\n","import styled from '@emotion/styled';\nimport type { ReactElement, ReactNode } from 'react';\nimport { NsIcon, type NsIconNameType, type NsIconSizeType } from '@nuskin/foundation-ui-components';\nimport {\n ICON_CURSORS,\n ICON_SIZES,\n ICON_TYPES,\n type IconCursor,\n type IconSize,\n type IconType,\n} from './iconConstants';\n\nconst SIDE_BY_ICON_SIZE = {\n [ICON_SIZES.LARGE]: 24,\n [ICON_SIZES.SMALL]: 16,\n} as const satisfies Record<IconSize, number>;\n\n// These icons come from the foundation design system.\nconst FOUNDATION_ICON_NAME_BY_ICON_TYPE: Partial<Record<IconType, NsIconNameType>> = {\n [ICON_TYPES.CLOSE]: 'close',\n [ICON_TYPES.SEARCH_FIELD]: 'search',\n};\n\nconst FOUNDATION_SIZE_BY_ICON_SIZE = {\n [ICON_SIZES.LARGE]: 'large',\n [ICON_SIZES.SMALL]: 'small',\n} as const satisfies Record<IconSize, NsIconSizeType>;\n\ninterface CustomIconProps {\n className?: string;\n color: string;\n cursor: IconCursor;\n size: IconSize;\n testId: string;\n}\n\ninterface FoundationIconProps extends CustomIconProps {\n name: NsIconNameType;\n}\n\ntype IconView = (props: Readonly<CustomIconProps>) => ReactElement;\n\nexport interface IconProps {\n className?: string;\n color?: string;\n cursor?: IconCursor;\n size?: IconSize;\n testId?: string;\n type: IconType;\n}\n\nconst IconSvg = styled.svg<{ $color: string; $cursor: IconCursor }>`\n color: ${({ $color }) => $color};\n cursor: ${({ $cursor }) => $cursor};\n display: block;\n`;\n\n/**\n * What every custom icon shares: the element, its decorative role, its color and cursor, and the\n * round-ended 2px line it is drawn with.\n */\nfunction OutlinedIcon({\n children,\n className,\n color,\n cursor,\n size,\n testId,\n}: Readonly<CustomIconProps & { children: ReactNode }>) {\n const side = SIDE_BY_ICON_SIZE[size];\n\n return (\n <IconSvg\n $color={color}\n $cursor={cursor}\n aria-hidden=\"true\"\n className={className}\n data-testid={testId}\n fill=\"none\"\n height={side}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n viewBox=\"0 0 24 24\"\n width={side}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {children}\n </IconSvg>\n );\n}\n\nfunction FoundationIcon({\n className,\n color,\n cursor,\n name,\n size,\n testId,\n}: Readonly<FoundationIconProps>) {\n return (\n <NsIcon\n aria-hidden\n {...(className === undefined ? {} : { className })}\n colorOverride={color}\n cursor={cursor}\n name={name}\n size={FOUNDATION_SIZE_BY_ICON_SIZE[size]}\n testId={testId}\n />\n );\n}\n\nconst SuggestionCloseIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <line x1={18} y1={6} x2={6} y2={18} />\n <line x1={6} y1={6} x2={18} y2={18} />\n </OutlinedIcon>\n);\n\nconst SuggestionCartIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <circle cx={9} cy={21} r={1} />\n <circle cx={20} cy={21} r={1} />\n <path d=\"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6\" />\n </OutlinedIcon>\n);\n\nconst SuggestionTaskIcon: IconView = (props) => (\n <OutlinedIcon {...props}>\n <rect x={9} y={9} width={13} height={13} rx={2} ry={2} />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </OutlinedIcon>\n);\n\nconst ICON_VIEW_BY_TYPE: Partial<Record<IconType, IconView>> = {\n [ICON_TYPES.SUGGESTION_CART]: SuggestionCartIcon,\n [ICON_TYPES.SUGGESTION_CLOSE]: SuggestionCloseIcon,\n [ICON_TYPES.SUGGESTION_TASK]: SuggestionTaskIcon,\n};\n\nexport default function Icon({\n className,\n color = 'currentColor',\n cursor = ICON_CURSORS.DEFAULT,\n size = ICON_SIZES.LARGE,\n testId,\n type,\n}: Readonly<IconProps>) {\n const customProps = {\n ...(className === undefined ? {} : { className }),\n color,\n cursor,\n size,\n testId: testId ?? `icon-${type}`,\n };\n const foundationName = FOUNDATION_ICON_NAME_BY_ICON_TYPE[type];\n\n if (foundationName !== undefined) {\n return <FoundationIcon {...customProps} name={foundationName} />;\n }\n\n const IconView = ICON_VIEW_BY_TYPE[type];\n return IconView === undefined ? null : <IconView {...customProps} />;\n}\n\nexport { ICON_CURSORS, ICON_SIZES, ICON_TYPES };\nexport type { IconCursor, IconSize, IconType };\n","import styled from '@emotion/styled';\nimport { nuskinTheme } from '@nuskin/foundation-theme';\n\nconst { colors } = nuskinTheme;\n\n/** The old search's breakpoint: from here up the panel is a band across the top of the page. */\nconst DESKTOP_MIN_PX = 1025;\n\n/**\n * Desktop search field and suggestion column width from production search.\n */\nconst DESKTOP_SEARCH_COLUMN_MAX = '860px';\n\n/**\n * An embedded agent fills its host and adds no height of its own, so on desktop the panel needs a\n * definite height to give it. Below the breakpoint the panel is full screen, which is definite.\n */\nconst AGENT_DESKTOP_BLOCK_SIZE = '70dvh';\n\n/**\n * The panel is a native dialog, shown in place with `open` so that it is not modal. The browser's\n * dialog styling (centered, bordered, padded, size-limited) is reset above, and the panel is laid\n * out by the overlay that holds it.\n *\n * Below the breakpoint the panel fills the screen and scrolls inside itself, without passing the\n * scroll on to the page. From the breakpoint up it is as tall as its content, up to the screen.\n */\nexport const SearchPanelLayoutRoot = styled.dialog<{ $agentMode?: boolean }>`\n background-color: ${colors.primary.white};\n block-size: 100%;\n border: 0;\n border-block-end: 1px solid ${colors.neutral[30]};\n box-sizing: border-box;\n color: ${colors.primary.black};\n inline-size: 100%;\n inset: auto;\n margin: 0;\n max-block-size: 100%;\n max-inline-size: none;\n outline: none;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n position: static;\n\n /* Full screen: keep the scroll in the panel. On desktop the wheel carries on to the page. */\n @media (max-width: ${DESKTOP_MIN_PX - 1}px) {\n overscroll-behavior: contain;\n }\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n block-size: auto;\n }\n\n ${({ $agentMode }) =>\n $agentMode &&\n `\n display: flex;\n flex-direction: column;\n overflow: hidden;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n block-size: min(${AGENT_DESKTOP_BLOCK_SIZE}, 100%);\n }\n `}\n`;\n\nexport const SearchPanelLayoutInner = styled.div<{ $agentMode?: boolean }>`\n align-items: ${({ $agentMode }) => ($agentMode ? 'stretch' : 'center')};\n box-sizing: border-box;\n display: grid;\n justify-items: stretch;\n grid-template-areas:\n 'input cancel'\n 'content content';\n grid-template-columns: minmax(0, 1fr) auto;\n inline-size: 100%;\n margin-inline: auto;\n padding: 30px 0;\n row-gap: 0;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n grid-template-areas:\n 'logo cancel'\n 'input input'\n 'content content';\n padding: 20px clamp(12px, 4vw, 32px) 30px;\n }\n\n ${({ $agentMode }) =>\n $agentMode &&\n `\n display: flex;\n flex-direction: column;\n flex: 1;\n gap: 1.5rem;\n min-block-size: 0;\n overflow: hidden;\n padding: clamp(1rem, 2vw, 2rem);\n `}\n`;\n\n/** Hosts an embedded agent below the header; the agent brings its own scrolling and input. */\nexport const SearchPanelLayoutAgentContent = styled.div`\n align-self: stretch;\n flex: 1;\n inline-size: 100%;\n min-block-size: 0;\n min-inline-size: 0;\n overflow: hidden;\n position: relative;\n width: 100%;\n`;\n\nexport const SearchPanelLayoutHeader = styled.header<{ $agentMode?: boolean }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n ${({ $agentMode }) =>\n $agentMode &&\n `\n /* keep the close button on the right even when no logo is rendered */\n justify-content: flex-end;\n `}\n`;\n\nexport const SearchPanelLayoutLogoSlot = styled.div<{ $agentMode?: boolean }>`\n display: none;\n flex: 0 0 auto;\n grid-area: logo;\n margin-inline-end: auto;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n display: block;\n }\n\n ${({ $agentMode }) => $agentMode && `display: block;`}\n`;\n\n/** The close glyph is a desktop affordance. Small screens show the cancel label only. */\nexport const SearchPanelLayoutCloseIcon = styled.span`\n display: none;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n display: inline-flex;\n }\n`;\n\nexport const SearchPanelLayoutCloseButton = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n border: 0;\n color: inherit;\n cursor: pointer;\n display: inline-flex;\n font: inherit;\n gap: 0.375rem;\n grid-area: cancel;\n justify-self: end;\n padding: 0.5rem 20px 0.5rem 12px;\n text-transform: uppercase;\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n padding: 0.5rem;\n text-transform: none;\n }\n`;\n\nexport const SearchPanelLayoutContent = styled.div`\n grid-area: content;\n min-inline-size: 0;\n width: 100%;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n inline-size: min(100%, ${DESKTOP_SEARCH_COLUMN_MAX});\n justify-self: center;\n }\n`;\n\nexport const SearchPanelLayoutInputSlot = styled.div`\n grid-area: input;\n min-inline-size: 0;\n overflow: visible;\n padding-inline: 20px 0;\n width: 100%;\n\n @media (min-width: ${DESKTOP_MIN_PX}px) {\n inline-size: min(100%, ${DESKTOP_SEARCH_COLUMN_MAX});\n justify-self: center;\n margin-block-start: 30px;\n padding-inline: 0;\n }\n`;\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport Icon, { ICON_CURSORS, ICON_SIZES, ICON_TYPES } from '../Icon';\nimport {\n SearchPanelLayoutAgentContent,\n SearchPanelLayoutCloseButton,\n SearchPanelLayoutCloseIcon,\n SearchPanelLayoutContent,\n SearchPanelLayoutHeader,\n SearchPanelLayoutInner,\n SearchPanelLayoutInputSlot,\n SearchPanelLayoutLogoSlot,\n SearchPanelLayoutRoot,\n} from './SearchPanelLayout.styled';\n\nexport interface SearchPanelLayoutProps extends Omit<\n ComponentPropsWithoutRef<'dialog'>,\n 'aria-label' | 'children'\n> {\n 'aria-label': string;\n children: ReactNode;\n closeLabel: string;\n /** Desktop only. Mobile never shows a cancel icon. Defaults to showing it. */\n showCancelIcon?: boolean;\n /** Live-preview tag for the cancel label text. */\n cancelLabelTag?: Record<string, string>;\n /** Live-preview tag for the show-cancel-icon field. */\n cancelShowIconTag?: Record<string, string>;\n onClose: () => void;\n inputSlot?: ReactNode;\n logoSlot?: ReactNode;\n /**\n * When true: the panel hosts an embedded agent. Children fill the space below the header\n * and bring their own scrolling and input, so no input slot renders.\n */\n agentMode?: boolean;\n}\n\nfunction SearchPanelCloseControl({\n cancelLabelTag,\n cancelShowIconTag,\n closeLabel,\n onClose,\n showCancelIcon,\n}: Readonly<{\n cancelLabelTag?: Record<string, string>;\n cancelShowIconTag?: Record<string, string>;\n closeLabel: string;\n onClose: () => void;\n showCancelIcon: boolean;\n}>) {\n return (\n <SearchPanelLayoutCloseButton\n type=\"button\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={onClose}\n {...(showCancelIcon ? {} : (cancelShowIconTag ?? {}))}\n >\n {showCancelIcon ? (\n <SearchPanelLayoutCloseIcon {...(cancelShowIconTag ?? {})}>\n <Icon cursor={ICON_CURSORS.POINTER} size={ICON_SIZES.SMALL} type={ICON_TYPES.CLOSE} />\n </SearchPanelLayoutCloseIcon>\n ) : null}\n <span {...(cancelLabelTag ?? {})}>{closeLabel}</span>\n </SearchPanelLayoutCloseButton>\n );\n}\n\nconst SearchPanelLayout = forwardRef<HTMLDialogElement, Readonly<SearchPanelLayoutProps>>(\n function SearchPanelLayout(\n {\n 'aria-label': ariaLabel,\n agentMode = false,\n children,\n closeLabel,\n showCancelIcon = true,\n cancelLabelTag,\n cancelShowIconTag,\n inputSlot,\n logoSlot,\n onClose,\n ...props\n },\n ref,\n ) {\n const logo = logoSlot ? (\n <SearchPanelLayoutLogoSlot $agentMode={agentMode}>{logoSlot}</SearchPanelLayoutLogoSlot>\n ) : null;\n const closeControl = (\n <SearchPanelCloseControl\n closeLabel={closeLabel}\n onClose={onClose}\n showCancelIcon={showCancelIcon}\n {...(cancelLabelTag ? { cancelLabelTag } : {})}\n {...(cancelShowIconTag ? { cancelShowIconTag } : {})}\n />\n );\n\n return (\n <SearchPanelLayoutRoot\n ref={ref}\n {...props}\n open\n aria-label={ariaLabel}\n $agentMode={agentMode}\n >\n <SearchPanelLayoutInner $agentMode={agentMode}>\n {agentMode ? (\n <SearchPanelLayoutHeader $agentMode>\n {logo}\n {closeControl}\n </SearchPanelLayoutHeader>\n ) : (\n <>\n {logo}\n {closeControl}\n </>\n )}\n {!agentMode && inputSlot ? (\n <SearchPanelLayoutInputSlot>{inputSlot}</SearchPanelLayoutInputSlot>\n ) : null}\n {agentMode ? (\n <SearchPanelLayoutAgentContent data-agent-container=\"\">\n {children}\n </SearchPanelLayoutAgentContent>\n ) : (\n <SearchPanelLayoutContent>{children}</SearchPanelLayoutContent>\n )}\n </SearchPanelLayoutInner>\n </SearchPanelLayoutRoot>\n );\n },\n);\n\nexport default SearchPanelLayout;\n","import type { KeyboardEvent } from 'react';\n\n/** Which way an unmodified ArrowDown (1) or ArrowUp (-1) points; null for any other key press. */\nexport function getArrowDirection(event: KeyboardEvent): 1 | -1 | null {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return null;\n if (event.key === 'ArrowDown') return 1;\n if (event.key === 'ArrowUp') return -1;\n return null;\n}\n","import styled from '@emotion/styled';\nimport { nuskinTheme } from '@nuskin/foundation-theme';\n\nconst { colors } = nuskinTheme;\n\nconst focusColor = '#6964f1';\n\n/** The pill: magnifier, text, and a clear button once there is text. */\nexport const SearchMessageInputRoot = styled.form`\n align-items: center;\n background-color: ${colors.primary.white};\n border: 1px solid ${colors.primary.black};\n border-radius: 999px;\n box-sizing: border-box;\n display: flex;\n flex-wrap: nowrap;\n gap: 0.25rem;\n inline-size: 100%;\n min-block-size: 3rem;\n min-inline-size: 0;\n padding: 0.25rem 0.5rem;\n\n &:focus-within {\n border-color: ${focusColor};\n box-shadow: 0 0 0 1px ${focusColor};\n }\n`;\n\nexport const SearchMessageInputField = styled.input`\n appearance: none;\n background: transparent;\n border: 0;\n box-sizing: border-box;\n color: ${colors.primary.black};\n display: block;\n font: inherit;\n inline-size: 100%;\n min-inline-size: 0;\n outline: 0;\n padding: 0.5rem;\n text-overflow: clip;\n white-space: nowrap;\n\n &::placeholder {\n color: ${colors.neutral[20]};\n opacity: 1;\n overflow: visible;\n text-overflow: clip;\n white-space: nowrap;\n }\n\n &[type='search']::-webkit-search-cancel-button,\n &[type='search']::-webkit-search-decoration {\n appearance: none;\n }\n`;\n\nexport const SearchMessageInputSubmit = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n block-size: 2.125rem;\n border: 0;\n border-radius: 999px;\n color: ${colors.neutral[20]};\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n inline-size: 2.125rem;\n justify-content: center;\n margin: 0;\n padding: 0;\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n`;\n\nexport const SearchMessageInputClear = styled.button`\n align-items: center;\n appearance: none;\n background: transparent;\n block-size: 2.125rem;\n border: 0;\n border-radius: 999px;\n color: ${colors.primary.black};\n cursor: pointer;\n display: inline-flex;\n flex: 0 0 auto;\n inline-size: 2.125rem;\n justify-content: center;\n margin: 0;\n padding: 0;\n\n &:hover {\n opacity: 0.7;\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.primary.black};\n outline-offset: 2px;\n }\n`;\n\nexport const SearchMessageInputAuxiliary = styled.span`\n align-items: center;\n display: inline-flex;\n flex: 0 0 auto;\n gap: 0.25rem;\n margin-inline-start: auto;\n\n > span {\n align-items: center;\n display: inline-flex;\n flex-shrink: 0;\n inline-size: 2.125rem;\n block-size: 2.125rem;\n justify-content: center;\n line-height: 0;\n }\n\n svg {\n display: block;\n overflow: visible;\n }\n\n [data-testid='search-nui-voice'] svg {\n block-size: 2.125rem;\n inline-size: 2.125rem;\n }\n\n @media (max-width: 1024px) {\n > span {\n block-size: 1.75rem;\n inline-size: 1.75rem;\n }\n\n [data-testid='search-nui-voice'] svg {\n block-size: 1.75rem;\n inline-size: 1.75rem;\n }\n }\n`;\n\nexport const SearchMessageInputFieldWrap = styled.span`\n display: block;\n flex: 1 1 auto;\n min-inline-size: 0;\n position: relative;\n`;\n\nexport const SearchMessageInputRotatingPlaceholder = styled.span`\n color: ${colors.neutral[20]};\n inset-block-start: 50%;\n inset-inline: 0.5rem;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n transform: translateY(-50%);\n white-space: nowrap;\n`;\n","import { useId, type ReactElement } from 'react';\n\n/** Presentational NUi marks. They are not buttons: the agent is reached by submitting a search. */\nexport function BrandedSparkleIcon(): ReactElement {\n const reactId = useId();\n const largeId = `${reactId}-sparkle-large`;\n const smallId = `${reactId}-sparkle-small`;\n\n return (\n <svg\n width=\"18\"\n height=\"26\"\n viewBox=\"0 0 18 26\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path\n d=\"M7.72184 7.28096C7.74702 7.14678 8.02273 7.14678 8.04791 7.28096C8.29593 8.60232 8.86587 10.8381 10.0145 11.9867C11.1631 13.1353 13.3989 13.7053 14.7202 13.9533C14.8544 13.9785 14.8544 14.2542 14.7202 14.2794C13.3989 14.5274 11.1631 15.0973 10.0145 16.246C8.86587 17.3946 8.29593 19.6303 8.04791 20.9517C8.02273 21.0859 7.74702 21.0859 7.72184 20.9517C7.47382 19.6303 6.90388 17.3946 5.75524 16.246C4.60661 15.0973 2.37088 14.5274 1.04952 14.2794C0.915335 14.2542 0.915335 13.9785 1.04952 13.9533C2.37088 13.7053 4.60661 13.1353 5.75524 11.9867C6.90388 10.8381 7.47382 8.60232 7.72184 7.28096Z\"\n fill={`url(#${largeId})`}\n />\n <path\n d=\"M14.0975 4.49258C14.1092 4.42963 14.2378 4.42963 14.2495 4.49258C14.3682 5.13172 14.6448 6.23139 15.2073 6.79394C15.7699 7.35648 16.8696 7.63311 17.5087 7.7518C17.5716 7.76349 17.5716 7.89209 17.5087 7.90378C16.8696 8.02246 15.7699 8.29909 15.2073 8.86164C14.6448 9.42418 14.3682 10.5239 14.2495 11.163C14.2378 11.2259 14.1092 11.2259 14.0975 11.163C13.9788 10.5239 13.7022 9.42418 13.1396 8.86164C12.5771 8.29909 11.4774 8.02246 10.8383 7.90378C10.7753 7.89209 10.7753 7.76349 10.8383 7.7518C11.4774 7.63311 12.5771 7.35648 13.1396 6.79394C13.7022 6.23139 13.9788 5.13172 14.0975 4.49258Z\"\n fill={`url(#${smallId})`}\n />\n <defs>\n <linearGradient\n id={largeId}\n x1=\"0.985745\"\n y1=\"8.72141\"\n x2=\"15.9969\"\n y2=\"10.2253\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#6964F1\" />\n <stop offset=\"0.361696\" stopColor=\"#7561F3\" />\n <stop offset=\"0.743652\" stopColor=\"#855EF5\" />\n </linearGradient>\n <linearGradient\n id={smallId}\n x1=\"10.8242\"\n y1=\"5.20877\"\n x2=\"18.1115\"\n y2=\"5.93885\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#6964F1\" />\n <stop offset=\"0.361696\" stopColor=\"#7561F3\" />\n <stop offset=\"0.743652\" stopColor=\"#855EF5\" />\n </linearGradient>\n </defs>\n </svg>\n );\n}\n\nexport function BrandedVoiceSearchIcon(): ReactElement {\n return (\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect width=\"32\" height=\"32\" rx=\"16\" fill=\"#EDEDED\" />\n <path\n d=\"M12.125 21V11H13.625V21H12.125ZM15.25 24V8H16.75V24H15.25ZM9 18V14H10.5V18H9ZM18.375 21V11H19.875V21H18.375ZM21.5 18V14H23V18H21.5Z\"\n fill=\"#5F5F5F\"\n />\n </svg>\n );\n}\n","import { useEffect, useState } from 'react';\n\n/** Matches `SearchPanel` / `SuggestionRow`: at this width and below, the panel is full screen. */\nexport const SEARCH_MOBILE_MAX_PX = 1024;\n\nconst MOBILE_QUERY = `(max-width: ${SEARCH_MOBILE_MAX_PX}px)`;\n\nexport function useMobileSearchLayout(mediaQuery = MOBILE_QUERY): boolean {\n const [isMobile, setIsMobile] = useState(() => {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(mediaQuery).matches;\n });\n\n useEffect(() => {\n if (typeof window === 'undefined') return undefined;\n const mq = window.matchMedia(mediaQuery);\n const onChange = () => setIsMobile(mq.matches);\n onChange();\n mq.addEventListener('change', onChange);\n return () => mq.removeEventListener('change', onChange);\n }, [mediaQuery]);\n\n return isMobile;\n}\n","import { useEffect, useState } from 'react';\n\nexport const DEFAULT_PLACEHOLDER_ROTATION_MS = 3000;\n\nfunction normalizeMessages(messages: ReadonlyArray<string> | undefined): string[] {\n if (!messages) return [];\n return messages.filter((message) => message.trim() !== '');\n}\n\n/** Cycles through `messages` while `enabled`. One message, or reduced motion, stays on the first. */\nexport function useRotatingPlaceholder(\n enabled: boolean,\n messages: ReadonlyArray<string> | undefined,\n intervalMs: number | undefined,\n): string {\n const [index, setIndex] = useState(0);\n const rotationMs = intervalMs && intervalMs > 0 ? intervalMs : DEFAULT_PLACEHOLDER_ROTATION_MS;\n const safeMessages = normalizeMessages(messages);\n const messagesKey = safeMessages.join('\\u0000');\n\n useEffect(() => {\n if (!enabled || safeMessages.length <= 1) {\n setIndex(0);\n return undefined;\n }\n\n const prefersReducedMotion =\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n if (prefersReducedMotion) {\n setIndex(0);\n return undefined;\n }\n\n const timerId = window.setInterval(\n () => setIndex((current) => (current + 1) % safeMessages.length),\n rotationMs,\n );\n\n return () => window.clearInterval(timerId);\n }, [enabled, rotationMs, messagesKey, safeMessages.length]);\n\n if (!enabled || safeMessages.length === 0) return '';\n return safeMessages[index % safeMessages.length] ?? '';\n}\n","import {\n useCallback,\n useRef,\n type ComponentPropsWithoutRef,\n type FormEvent,\n type KeyboardEvent,\n type MutableRefObject,\n type RefCallback,\n} from 'react';\nimport Icon, { ICON_CURSORS, ICON_SIZES, ICON_TYPES } from '../Icon';\nimport { getArrowDirection } from '../arrowKeys';\nimport {\n SearchMessageInputAuxiliary,\n SearchMessageInputClear,\n SearchMessageInputField,\n SearchMessageInputFieldWrap,\n SearchMessageInputRoot,\n SearchMessageInputRotatingPlaceholder,\n SearchMessageInputSubmit,\n} from './SearchMessageInput.styled';\nimport { BrandedSparkleIcon, BrandedVoiceSearchIcon } from './nuiIcons';\nimport { useMobileSearchLayout } from './useMobileSearchLayout';\nimport { useRotatingPlaceholder } from './useRotatingPlaceholder';\n\nexport interface SearchMessageInputProps extends Omit<\n ComponentPropsWithoutRef<'form'>,\n 'children' | 'onSubmit' | 'onChange'\n> {\n /** The accessible name of the clear button, shown while there is text. */\n clearLabel: string;\n inputLabel: string;\n /** Receives the text box, so the host can move focus into it. */\n inputRef?: RefCallback<HTMLInputElement> | MutableRefObject<HTMLInputElement | null>;\n /**\n * Called when ArrowDown is pressed, to move focus on to whatever is below. Return whether focus\n * moved: only then is the key kept from doing its default.\n */\n onArrowDown?: () => boolean;\n /** Called on every keystroke with the new text. The host owns `value` and passes it back. */\n onChange: (value: string) => void;\n /** Called with the trimmed text on Enter or on the magnifier. Never called for an empty box. */\n onSubmit: (message: string) => void;\n placeholder: string;\n /** The accessible name of the magnifier, which submits the search. */\n submitLabel: string;\n value: string;\n /**\n * When true, the branded voice and sparkle marks sit after the text. They are not controls:\n * submitting a search with no products is what reaches the agent.\n */\n showNuiIcons?: boolean;\n /** Accessible name of the voice mark, when `showNuiIcons` is on. */\n voiceSearchLabel?: string;\n /** Accessible name of the sparkle mark, when `showNuiIcons` is on. */\n askNuiLabel?: string;\n /** Placeholder phrases that rotate on small screens while the box is empty. */\n rotatingPlaceholders?: ReadonlyArray<string>;\n /** How long each rotating phrase is shown, in milliseconds. */\n rotatingPlaceholderIntervalMs?: number;\n /** Live-preview tag for the extended search placeholder. */\n placeholderTag?: Record<string, string>;\n /** Live-preview tag for the extended search box aria label. */\n inputLabelTag?: Record<string, string>;\n /** Live-preview tag for the mobile rotating placeholder. */\n rotatingPlaceholderTag?: Record<string, string>;\n}\n\n/**\n * The search box, controlled by the host: a magnifier that submits, the text, and a clear button\n * once there is text. Enter submits too.\n */\nexport default function SearchMessageInput({\n clearLabel,\n inputLabel,\n inputRef,\n onArrowDown,\n onChange,\n onSubmit,\n placeholder,\n submitLabel,\n value,\n showNuiIcons = false,\n voiceSearchLabel = '',\n askNuiLabel = '',\n rotatingPlaceholders,\n rotatingPlaceholderIntervalMs,\n placeholderTag,\n rotatingPlaceholderTag,\n ...props\n}: Readonly<SearchMessageInputProps>) {\n const field = useRef<HTMLInputElement | null>(null);\n const setField = useCallback(\n (node: HTMLInputElement | null) => {\n field.current = node;\n if (typeof inputRef === 'function') inputRef(node);\n else if (inputRef) inputRef.current = node;\n },\n [inputRef],\n );\n\n function submitMessage() {\n const message = value.trim();\n\n if (message.length > 0) {\n onSubmit(message);\n }\n }\n\n function handleSubmit(event: FormEvent<HTMLFormElement>) {\n event.preventDefault();\n submitMessage();\n }\n\n const isMobile = useMobileSearchLayout();\n const hasQuery = value.trim() !== '';\n const showRotatingPlaceholder = isMobile && !hasQuery && (rotatingPlaceholders?.length ?? 0) > 0;\n const rotatingPlaceholderText = useRotatingPlaceholder(\n showRotatingPlaceholder,\n rotatingPlaceholders,\n rotatingPlaceholderIntervalMs,\n );\n\n function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {\n if (event.key === 'Enter' && !event.nativeEvent.isComposing) {\n event.preventDefault();\n submitMessage();\n return;\n }\n\n if (getArrowDirection(event) === 1 && onArrowDown?.()) {\n event.preventDefault();\n }\n }\n\n return (\n <SearchMessageInputRoot\n {...props}\n role=\"search\"\n aria-label={inputLabel}\n onSubmit={handleSubmit}\n >\n <SearchMessageInputSubmit type=\"submit\" aria-label={submitLabel}>\n <Icon\n cursor={ICON_CURSORS.POINTER}\n size={ICON_SIZES.LARGE}\n type={ICON_TYPES.SEARCH_FIELD}\n />\n </SearchMessageInputSubmit>\n\n <SearchMessageInputFieldWrap\n data-testid=\"search-message-input-wrap\"\n data-rotating-placeholder={showRotatingPlaceholder ? 'true' : undefined}\n >\n {showRotatingPlaceholder ? (\n <SearchMessageInputRotatingPlaceholder\n data-testid=\"search-rotating-placeholder\"\n {...(rotatingPlaceholderTag ?? {})}\n >\n {rotatingPlaceholderText}\n </SearchMessageInputRotatingPlaceholder>\n ) : null}\n <SearchMessageInputField\n {...(placeholderTag ?? {})}\n ref={setField}\n id=\"header-product-search\"\n name=\"header-product-search\"\n aria-label={inputLabel}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n enterKeyHint=\"search\"\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={showRotatingPlaceholder ? '' : placeholder}\n spellCheck={false}\n type=\"text\"\n value={value}\n />\n </SearchMessageInputFieldWrap>\n\n {value !== '' && (\n <SearchMessageInputClear\n type=\"button\"\n aria-label={clearLabel}\n onClick={() => {\n onChange('');\n field.current?.focus();\n }}\n >\n <Icon\n cursor={ICON_CURSORS.POINTER}\n size={ICON_SIZES.SMALL}\n type={ICON_TYPES.SUGGESTION_CLOSE}\n />\n </SearchMessageInputClear>\n )}\n\n {showNuiIcons ? (\n <SearchMessageInputAuxiliary data-testid=\"search-nui-icons\">\n <span aria-label={voiceSearchLabel} data-testid=\"search-nui-voice\">\n <BrandedVoiceSearchIcon />\n </span>\n <span aria-label={askNuiLabel} data-testid=\"search-nui-sparkle\">\n <BrandedSparkleIcon />\n </span>\n </SearchMessageInputAuxiliary>\n ) : null}\n </SearchMessageInputRoot>\n );\n}\n","import styled from '@emotion/styled';\n\nconst MOBILE_MAX_PX = 1024;\n\nconst colors = {\n text: '#111827',\n muted: '#6b7280',\n hover: '#f3f4f6',\n surface: '#ffffff',\n borderLight: '#e5e7eb',\n} as const;\n\nconst SEARCH_PANEL_Z_INDEX = 10000;\n\n/**\n * The layer that holds the panel and catches a press outside it, so the panel closes. It is\n * invisible: the old search did not dim the page either. It is not scrollable, so the wheel passes\n * through to the page, which keeps scrolling while the panel is open.\n */\nexport const SearchPanelOverlay = styled.div`\n -webkit-tap-highlight-color: transparent;\n align-items: stretch;\n background-color: transparent;\n display: flex;\n flex-direction: column;\n inset: 0;\n overflow: hidden;\n position: fixed;\n z-index: ${SEARCH_PANEL_Z_INDEX};\n`;\n\n/** Read out by assistive technology, never drawn. */\nexport const SearchPanelStatus = styled.output`\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n\nexport const SearchSuggestionsPanel = styled.div`\n position: relative;\n width: 100%;\n margin-top: 8px;\n`;\n\nexport const SearchSuggestionsList = styled.ul`\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: 0;\n`;\n\nconst SearchSuggestionOption = styled.li`\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 58px;\n padding: 4px 24px;\n box-sizing: border-box;\n color: ${colors.text};\n`;\n\nexport const PassiveSuggestionOption = styled(SearchSuggestionOption)`\n cursor: default;\n color: ${colors.muted};\n`;\n\nexport const SuggestionSectionHeading = styled.h3`\n padding: 12px 24px 8px;\n margin: 0 0 4px;\n font-size: 16px;\n font-weight: 700;\n color: ${colors.text};\n background: ${colors.surface};\n border-bottom: 1px solid ${colors.borderLight};\n`;\n\nexport const RecentSearchesSection = styled.section`\n padding: 24px 35px 18px;\n background: ${colors.surface};\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n padding: 18px 20px 16px;\n }\n`;\n\nexport const RecentSearchesHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n margin-bottom: 13px;\n`;\n\nexport const RecentSearchesTitle = styled.h3`\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: ${colors.text};\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n font-size: 15px;\n line-height: 1.35;\n }\n`;\n\nexport const RecentSearchesClearButton = styled.button`\n margin: 0;\n padding: 0;\n border: none;\n background: transparent;\n color: ${colors.text};\n font-size: 16px;\n cursor: pointer;\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n border-radius: 4px;\n }\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n font-size: 14px;\n }\n`;\n\nexport const RecentSearchesList = styled.div`\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n`;\n\nexport const RecentSearchChip = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 40px;\n padding: 8px 16px;\n border: 1px solid ${colors.borderLight};\n border-radius: 999px;\n background: ${colors.surface};\n color: ${colors.text};\n font-size: 16px;\n cursor: pointer;\n\n &:hover {\n background: ${colors.hover};\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n }\n\n @media (max-width: ${MOBILE_MAX_PX}px) {\n min-height: 36px;\n padding: 6px 14px;\n font-size: 14px;\n border-radius: 10px;\n }\n`;\n","import React, { useState } from 'react';\nimport {\n RecentSearchChip,\n RecentSearchesClearButton,\n RecentSearchesHeader,\n RecentSearchesList,\n RecentSearchesSection,\n RecentSearchesTitle,\n} from './SearchPanel.styled';\nimport type { SearchPanelRecentSearches } from './SearchPanel.types';\n\n/** How many recent searches show before the \"+N more\" chip. */\nexport const MAX_RECENT = 6;\n\nexport interface RecentSearchesProps extends SearchPanelRecentSearches {\n title: string;\n clearLabel: string;\n /** The text of the chip that shows the rest, given how many are hidden. */\n moreLabel: (hiddenCount: number) => string;\n titleTag?: Record<string, string>;\n clearTag?: Record<string, string>;\n enableTag?: Record<string, string>;\n}\n\n/** The recent-search chips, a clear control and an expander for the ones past the first few. */\nexport function RecentSearches({\n items,\n title,\n clearLabel,\n moreLabel,\n onSelect,\n onClear,\n titleTag,\n clearTag,\n enableTag,\n}: Readonly<RecentSearchesProps>): React.ReactElement {\n const [showAll, setShowAll] = useState(false);\n const visible = showAll ? items : items.slice(0, MAX_RECENT);\n\n return (\n <RecentSearchesSection aria-label={title} {...(enableTag ?? {})}>\n <RecentSearchesHeader>\n <RecentSearchesTitle {...(titleTag ?? {})}>{title}</RecentSearchesTitle>\n <RecentSearchesClearButton\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onClear}\n {...(clearTag ?? {})}\n >\n {clearLabel}\n </RecentSearchesClearButton>\n </RecentSearchesHeader>\n <RecentSearchesList>\n {visible.map((query) => (\n <RecentSearchChip\n key={query}\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onSelect(query)}\n >\n {query}\n </RecentSearchChip>\n ))}\n {!showAll && items.length > MAX_RECENT && (\n <RecentSearchChip\n type=\"button\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setShowAll(true)}\n >\n {moreLabel(items.length - MAX_RECENT)}\n </RecentSearchChip>\n )}\n </RecentSearchesList>\n </RecentSearchesSection>\n );\n}\n","import type { CatalogSuggestionItem, SuggestionDisplayData, SuggestionOption } from './types';\n\n/** The page a product suggestion leads to, for tracking. Empty for a \"did you mean\" term. */\nexport function getSuggestionUrl(option: SuggestionOption): string {\n return 'url' in option ? (option.url ?? option.href ?? '') : '';\n}\n\nfunction suggestionRequiresProductPage(option: CatalogSuggestionItem): boolean {\n if (option.requiresProductPage === true) {\n return true;\n }\n if (option.requiresProductPage === false) {\n return false;\n }\n if (option.productType === 'bundle') {\n return true;\n }\n const skuCount = Number(option.skuCount ?? 0);\n return skuCount > 1;\n}\n\n/** What a row shows and which actions it offers. Stock and cart availability are the SDK's call. */\nexport function getSuggestionDisplayData(option: SuggestionOption): SuggestionDisplayData {\n if ('suggestionType' in option) {\n return {\n imageSrc: '',\n displayLabel: option.value,\n requiresProductPage: false,\n isBundle: false,\n isDidYouMean: true,\n isOutOfStock: false,\n isCartActionDisabled: false,\n };\n }\n\n const requiresProductPage = suggestionRequiresProductPage(option);\n\n return {\n imageSrc: option.imageURL.trim() || option.thumbnail.trim(),\n displayLabel: option.value,\n requiresProductPage,\n isBundle: requiresProductPage,\n isDidYouMean: false,\n isOutOfStock: option.outOfStock,\n isCartActionDisabled: option.cartActionDisabled,\n };\n}\n\ntype AddToCartHandler = (option: SuggestionOption) => void;\n\n/** Props spread onto `ProductSuggestionSnippet` when the host wires direct add-to-cart. */\nexport function optionalAddToCartHandlerProps(\n onAddSuggestionToCart?: AddToCartHandler,\n): { onAddSuggestionToCart?: AddToCartHandler } {\n if (!onAddSuggestionToCart) {\n return {};\n }\n return { onAddSuggestionToCart };\n}\n","import styled from '@emotion/styled';\n\nexport const SUGGESTION_MOBILE_MAX_PX = 1024;\n\nconst colors = {\n text: '#111827',\n} as const;\n\nexport const SuggestionRow = styled.li`\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n align-items: center;\n justify-items: stretch;\n width: 100%;\n min-height: 58px;\n padding: 4px 24px;\n box-sizing: border-box;\n color: ${colors.text};\n background: transparent;\n\n &[data-highlighted='true'],\n &:hover {\n background: var(--suggestion-row-hover-bg, #e9ecef);\n }\n\n &[data-out-of-stock='true'] {\n opacity: 0.75;\n }\n\n @media (max-width: ${SUGGESTION_MOBILE_MAX_PX}px) {\n padding: 6px 24px;\n }\n`;\n\nexport const SuggestionProductSnippet = styled.div`\n display: block;\n min-width: 0;\n width: 100%;\n\n /* ProductSnippet Icon SVGs default to cursor:default and cover the CTA hit target. */\n button svg {\n cursor: inherit;\n }\n`;\n\nexport const SuggestionContentWrapper = styled.button`\n appearance: none;\n background: transparent;\n border: 0;\n display: block;\n width: 100%;\n min-width: 0;\n margin: 0;\n padding: 0;\n color: inherit;\n cursor: pointer;\n font: inherit;\n outline: none;\n text-align: start;\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 3px;\n }\n`;\n\nexport const SuggestionLabel = styled.span`\n display: block;\n min-width: 0;\n line-height: 24px;\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n font-size: 16px;\n color: ${colors.text};\n\n @media (max-width: ${SUGGESTION_MOBILE_MAX_PX}px) {\n font-size: 14px;\n line-height: 20px;\n }\n`;\n","import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { getArrowDirection } from '../arrowKeys';\nimport type { SuggestionRowProps } from './types';\nimport { SuggestionLabel, SuggestionProductSnippet } from './SuggestionRow.styled';\nimport { getSuggestionDisplayData } from './helpers';\n\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ntype RowControls = Pick<\n SuggestionRowProps,\n 'onHighlightSuggestion' | 'onNavigate' | 'suggestionIndex' | 'suggestionOption'\n>;\n\ntype ProductSnippetModule = typeof import('@nuskin/react-product-components');\n\nfunction assignProductControlRef(\n node: HTMLDivElement | null,\n controlRef: SuggestionRowProps['controlRef'],\n) {\n const productButton = node?.querySelector<HTMLButtonElement>('button');\n controlRef?.(productButton ?? null);\n}\n\nfunction snippetCtaProps(\n display: ReturnType<typeof getSuggestionDisplayData>,\n addToCartLabel: SuggestionRowProps['addToCartLabel'],\n openBundleLabel: SuggestionRowProps['openBundleLabel'],\n logos: ProductSnippetModule['PRODUCT_SNIPPET_CTA_LOGOS'],\n) {\n if (display.requiresProductPage) {\n return {\n ctaDisabled: false,\n ctaLogo: logos.PRODUCT_PAGE_LOGO,\n ctaAriaLabel: openBundleLabel(display.displayLabel),\n };\n }\n return {\n ctaDisabled: display.isCartActionDisabled,\n ctaLogo: logos.CART_LOGO,\n ctaAriaLabel: addToCartLabel(display.displayLabel),\n };\n}\n\nexport function ProductSuggestionSnippet({\n addToCartLabel,\n controlRef,\n display,\n fallbackImageUrl,\n onHighlightSuggestion,\n onNavigate,\n onRunSuggestionAction,\n onAddSuggestionToCart,\n onSelectSuggestion,\n openBundleLabel,\n openProductPageLabel,\n suggestionIndex,\n suggestionOption,\n}: Readonly<\n RowControls & {\n addToCartLabel: SuggestionRowProps['addToCartLabel'];\n controlRef: SuggestionRowProps['controlRef'];\n display: ReturnType<typeof getSuggestionDisplayData>;\n fallbackImageUrl: string;\n onRunSuggestionAction: SuggestionRowProps['onRunSuggestionAction'];\n onAddSuggestionToCart?: SuggestionRowProps['onAddSuggestionToCart'];\n onSelectSuggestion: SuggestionRowProps['onSelectSuggestion'];\n openBundleLabel: SuggestionRowProps['openBundleLabel'];\n openProductPageLabel: SuggestionRowProps['openProductPageLabel'];\n }\n>): React.ReactElement {\n const [productModule, setProductModule] = useState<ProductSnippetModule | null>(null);\n const hostRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (typeof window === 'undefined') {\n return undefined;\n }\n let canceled = false;\n void import('@nuskin/react-product-components').then((module) => {\n if (!canceled) {\n setProductModule(module);\n }\n });\n return () => {\n canceled = true;\n };\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n if (productModule) {\n assignProductControlRef(hostRef.current, controlRef);\n }\n }, [productModule, controlRef]);\n\n const { displayLabel, imageSrc } = display;\n const imageUrl = imageSrc || fallbackImageUrl;\n\n const setSnippetRef = useCallback(\n (node: HTMLDivElement | null) => {\n hostRef.current = node;\n assignProductControlRef(node, controlRef);\n },\n [controlRef],\n );\n\n const onFocusCapture = useCallback(\n () => onHighlightSuggestion(suggestionIndex),\n [onHighlightSuggestion, suggestionIndex],\n );\n\n const onKeyDownCapture = useCallback(\n (event: React.KeyboardEvent) => {\n const direction = getArrowDirection(event);\n if (direction === null) return;\n event.preventDefault();\n onNavigate(direction);\n },\n [onNavigate],\n );\n\n if (!productModule) {\n return (\n <SuggestionProductSnippet\n ref={setSnippetRef}\n data-testid=\"suggestion-product-snippet\"\n onFocusCapture={onFocusCapture}\n onKeyDownCapture={onKeyDownCapture}\n aria-busy=\"true\"\n >\n <SuggestionLabel>{displayLabel}</SuggestionLabel>\n </SuggestionProductSnippet>\n );\n }\n\n const { ProductSnippet, PRODUCT_SNIPPET_CTA_LOGOS } = productModule;\n const { ctaDisabled, ctaLogo, ctaAriaLabel } = snippetCtaProps(\n display,\n addToCartLabel,\n openBundleLabel,\n PRODUCT_SNIPPET_CTA_LOGOS,\n );\n\n return (\n <SuggestionProductSnippet\n ref={setSnippetRef}\n data-testid=\"suggestion-product-snippet\"\n onFocusCapture={onFocusCapture}\n onKeyDownCapture={onKeyDownCapture}\n >\n <ProductSnippet\n title={displayLabel}\n imageUrl={imageUrl}\n imageAlt=\"\"\n productAriaLabel={openProductPageLabel(displayLabel)}\n ctaLogo={ctaLogo}\n ctaAriaLabel={ctaAriaLabel}\n ctaDisabled={ctaDisabled}\n onProductClick={() => onSelectSuggestion(suggestionOption)}\n onCtaClick={() => {\n onHighlightSuggestion(suggestionIndex);\n if (ctaDisabled) {\n return;\n }\n if (display.requiresProductPage) {\n onRunSuggestionAction(suggestionOption);\n return;\n }\n if (onAddSuggestionToCart) {\n onAddSuggestionToCart(suggestionOption);\n return;\n }\n onRunSuggestionAction(suggestionOption);\n }}\n />\n </SuggestionProductSnippet>\n );\n}\n","import React from 'react';\nimport { getArrowDirection } from '../arrowKeys';\nimport type { SuggestionRowProps } from './types';\nimport {\n SuggestionRow as StyledSuggestionRow,\n SuggestionContentWrapper,\n SuggestionLabel,\n} from './SuggestionRow.styled';\nimport {\n getSuggestionDisplayData,\n getSuggestionUrl,\n optionalAddToCartHandlerProps,\n} from './helpers';\nimport { ProductSuggestionSnippet } from './ProductSuggestionSnippet';\n\nconst GTM_SEARCH_RESULT_CLICK = 'searchResultClick';\n\n/** `true` or `false`, as the text a data attribute carries. */\nconst flag = (value: boolean): 'true' | 'false' => (value ? 'true' : 'false');\n\n/** The product button and the action button both pass their arrow keys up to the row. */\nfunction passArrowKeysToList(\n event: React.KeyboardEvent,\n onNavigate: SuggestionRowProps['onNavigate'],\n) {\n const direction = getArrowDirection(event);\n if (direction === null) return;\n event.preventDefault();\n onNavigate(direction);\n}\n\nfunction cartDisabledAttr(\n isDidYouMean: boolean,\n display: ReturnType<typeof getSuggestionDisplayData>,\n): 'true' | 'false' {\n if (isDidYouMean || display.requiresProductPage) return 'false';\n return flag(display.isCartActionDisabled);\n}\n\nexport function SuggestionRow({\n addToCartLabel,\n controlRef,\n isHighlighted,\n onHighlightSuggestion,\n onNavigate,\n onRunSuggestionAction,\n onAddSuggestionToCart,\n onSelectSuggestion,\n openBundleLabel,\n openProductPageLabel,\n suggestionIndex,\n suggestionOption,\n fallbackImageUrl = '',\n}: Readonly<SuggestionRowProps>): React.ReactElement {\n const display = getSuggestionDisplayData(suggestionOption);\n const { displayLabel, isDidYouMean, isOutOfStock } = display;\n const controls = { onHighlightSuggestion, suggestionIndex, suggestionOption };\n const addToCartHandlerProps = optionalAddToCartHandlerProps(onAddSuggestionToCart);\n\n return (\n <StyledSuggestionRow\n data-testid={`suggestion-row-${suggestionOption.id}`}\n data-highlighted={flag(isHighlighted)}\n data-suggestion-type={isDidYouMean ? 'did-you-mean' : 'product'}\n data-product-snippet={isDidYouMean ? 'false' : 'true'}\n data-cart-disabled={cartDisabledAttr(isDidYouMean, display)}\n onMouseEnter={() => onHighlightSuggestion(suggestionIndex)}\n onKeyDown={(event) => passArrowKeysToList(event, onNavigate)}\n data-out-of-stock={flag(isOutOfStock)}\n data-gtm-type={GTM_SEARCH_RESULT_CLICK}\n data-gtm-result-title={displayLabel}\n data-gtm-result-url={getSuggestionUrl(suggestionOption)}\n >\n {isDidYouMean ? (\n <SuggestionContentWrapper\n type=\"button\"\n data-testid={`suggestion-content-${suggestionOption.id}`}\n data-suggestion-type=\"did-you-mean\"\n onFocus={() => onHighlightSuggestion(suggestionIndex)}\n onClick={() => onSelectSuggestion(suggestionOption)}\n >\n <SuggestionLabel>{displayLabel}</SuggestionLabel>\n </SuggestionContentWrapper>\n ) : (\n <ProductSuggestionSnippet\n {...controls}\n addToCartLabel={addToCartLabel}\n controlRef={controlRef}\n display={display}\n fallbackImageUrl={fallbackImageUrl}\n onNavigate={onNavigate}\n onRunSuggestionAction={onRunSuggestionAction}\n {...addToCartHandlerProps}\n onSelectSuggestion={onSelectSuggestion}\n openBundleLabel={openBundleLabel}\n openProductPageLabel={openProductPageLabel}\n />\n )}\n </StyledSuggestionRow>\n );\n}\n","import styled from '@emotion/styled';\n\nconst colors = {\n text: '#111827',\n surface: '#ffffff',\n borderLight: '#e5e7eb',\n} as const;\n\nexport const SeeMoreLinkContainer = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 48px;\n padding: 0 16px;\n box-sizing: border-box;\n background: ${colors.surface};\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 50%;\n width: 100vw;\n border-top: 1px solid ${colors.borderLight};\n transform: translateX(-50%);\n pointer-events: none;\n }\n`;\n\nexport const SeeMoreLinkText = styled.button`\n width: auto;\n height: auto;\n padding: 8px 0;\n border: none;\n background: transparent;\n font-size: 16px;\n font-weight: 400;\n line-height: 1.4;\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n color: ${colors.text};\n\n &:hover {\n opacity: 0.8;\n }\n\n &:focus-visible {\n outline: 2px solid ${colors.text};\n outline-offset: 2px;\n border-radius: 4px;\n text-decoration-thickness: 2px;\n }\n`;\n","import React from 'react';\nimport { getArrowDirection } from '../arrowKeys';\nimport type { SeeMoreLinkProps } from './types';\nimport { SeeMoreLinkContainer, SeeMoreLinkText } from './SeeMoreLink.styled';\n\nconst GTM_SEARCH_SEE_MORE = 'searchSeeMore';\n\nexport function SeeMoreLink({\n buttonRef,\n onNavigate,\n onSeeMoreResults,\n seeMoreResultsText,\n searchQuery = '',\n}: Readonly<SeeMoreLinkProps>): React.ReactElement {\n return (\n <SeeMoreLinkContainer>\n <SeeMoreLinkText\n ref={buttonRef}\n type=\"button\"\n data-testid=\"autocomplete-see-more-button\"\n data-gtm-type={GTM_SEARCH_SEE_MORE}\n data-gtm-search-term={searchQuery.trim()}\n onClick={onSeeMoreResults}\n onKeyDown={(event) => {\n const direction = getArrowDirection(event);\n if (direction === null) return;\n event.preventDefault();\n onNavigate(direction);\n }}\n >\n {seeMoreResultsText}\n </SeeMoreLinkText>\n </SeeMoreLinkContainer>\n );\n}\n","import React, { forwardRef, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { optionalAddToCartHandlerProps } from '../SuggestionRow/helpers';\nimport { SuggestionRow } from '../SuggestionRow/SuggestionRow';\nimport { SeeMoreLink } from '../SeeMoreLink/SeeMoreLink';\nimport {\n PassiveSuggestionOption,\n SearchSuggestionsList,\n SuggestionSectionHeading,\n} from './SearchPanel.styled';\nimport type { SearchPanelSuggestionsProps } from './SearchPanel.types';\n\nexport interface SearchSuggestionsProps extends SearchPanelSuggestionsProps {\n addToCartLabel: (productName: string) => string;\n didYouMeanText: string;\n noSuggestionsText: string;\n openBundleLabel: (productName: string) => string;\n openProductPageLabel: (productName: string) => string;\n seeMoreText: string;\n suggestionsLabel: string;\n fallbackImageUrl: string;\n /** Called when ArrowUp is pressed on the first suggestion, to move focus above the list. */\n onLeaveTop: () => void;\n}\n\n/** What the panel can ask of the list. */\nexport interface SearchSuggestionsHandle {\n /** Moves focus to the first suggestion, or to \"See more\" when there are none. False if neither. */\n focusFirst: () => boolean;\n}\n\n/** The suggestion rows, the \"did you mean\" heading, the empty state and \"see more results\". */\nexport const SearchSuggestions = forwardRef<\n SearchSuggestionsHandle,\n Readonly<SearchSuggestionsProps>\n>(function SearchSuggestions(\n {\n addToCartLabel,\n items,\n loading,\n showNoResults,\n showDidYouMean,\n hasMore,\n query,\n didYouMeanText,\n noSuggestionsText,\n openBundleLabel,\n openProductPageLabel,\n seeMoreText,\n suggestionsLabel,\n fallbackImageUrl,\n onSelect,\n onRunAction,\n onAddToCartAction,\n onSeeMore,\n onLeaveTop,\n },\n ref,\n) {\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const headingId = useId();\n const rowControls = useRef<Array<HTMLButtonElement | null>>([]);\n const seeMoreButton = useRef<HTMLButtonElement>(null);\n const pendingFirstFocus = useRef(false);\n\n const rowCount = loading ? 0 : items.length;\n const showSeeMore = !loading && hasMore && !showDidYouMean;\n const showDidYouMeanHeading = showDidYouMean && didYouMeanText.trim() !== '';\n // The places focus can go, top to bottom: each row, then \"See more\".\n const stopCount = rowCount + (showSeeMore ? 1 : 0);\n\n function focusStop(index: number) {\n const stop = index < rowCount ? rowControls.current[index] : seeMoreButton.current;\n stop?.focus();\n return Boolean(stop);\n }\n\n function moveFrom(index: number, direction: 1 | -1) {\n let next = index + direction;\n while (next >= 0 && next < stopCount) {\n if (focusStop(next)) return;\n next += direction;\n }\n if (next < 0) {\n if (index === 0) onLeaveTop();\n else focusStop(index);\n }\n }\n\n useImperativeHandle(ref, () => ({\n focusFirst() {\n if (rowCount > 0) {\n const stop = rowControls.current[0];\n if (!stop) {\n pendingFirstFocus.current = true;\n return false;\n }\n pendingFirstFocus.current = false;\n stop.focus();\n return true;\n }\n if (showSeeMore && seeMoreButton.current) {\n seeMoreButton.current.focus();\n return true;\n }\n return false;\n },\n }));\n\n return (\n <>\n {showDidYouMeanHeading ? (\n <SuggestionSectionHeading id={headingId} data-testid=\"autocomplete-did-you-mean-heading\">\n {didYouMeanText}\n </SuggestionSectionHeading>\n ) : null}\n <SearchSuggestionsList\n aria-label={showDidYouMeanHeading ? undefined : suggestionsLabel}\n aria-labelledby={showDidYouMeanHeading ? headingId : undefined}\n aria-busy={loading}\n data-testid=\"autocomplete-results-list\"\n >\n {!loading &&\n items.map((option, index) => {\n const addToCartHandlerProps = optionalAddToCartHandlerProps(onAddToCartAction);\n\n return (\n <SuggestionRow\n key={option.id}\n addToCartLabel={addToCartLabel}\n openBundleLabel={openBundleLabel}\n openProductPageLabel={openProductPageLabel}\n controlRef={(control) => {\n rowControls.current[index] = control;\n if (control && index === 0 && pendingFirstFocus.current) {\n pendingFirstFocus.current = false;\n control.focus();\n }\n }}\n isHighlighted={index === highlightedIndex}\n onHighlightSuggestion={setHighlightedIndex}\n onNavigate={(direction) => moveFrom(index, direction)}\n onRunSuggestionAction={onRunAction}\n {...addToCartHandlerProps}\n onSelectSuggestion={onSelect}\n suggestionIndex={index}\n suggestionOption={option}\n fallbackImageUrl={fallbackImageUrl}\n />\n );\n })}\n {showNoResults && (\n <PassiveSuggestionOption data-highlighted=\"false\">\n {noSuggestionsText}\n </PassiveSuggestionOption>\n )}\n </SearchSuggestionsList>\n\n {showSeeMore && (\n <SeeMoreLink\n buttonRef={seeMoreButton}\n onNavigate={(direction) => moveFrom(rowCount, direction)}\n onSeeMoreResults={onSeeMore}\n seeMoreResultsText={seeMoreText}\n searchQuery={query}\n />\n )}\n </>\n );\n});\n","import React, { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport SearchPanelLayout from '../SearchPanelLayout/SearchPanelLayout';\nimport SearchMessageInput from '../SearchMessageInput/SearchMessageInput';\nimport {\n SearchPanelOverlay,\n SearchPanelStatus,\n SearchSuggestionsPanel,\n} from './SearchPanel.styled';\nimport { RecentSearches } from './RecentSearches';\nimport { SearchSuggestions, type SearchSuggestionsHandle } from './SearchSuggestions';\nimport type {\n SearchEditTags,\n SearchPanelCopy,\n SearchPanelProps,\n SearchPanelRecentSearches,\n} from './SearchPanel.types';\n\nexport type {\n SearchEditTags,\n SearchPanelCopy,\n SearchPanelInputProps,\n SearchPanelProps,\n SearchPanelRecentSearches,\n SearchPanelSuggestionsProps,\n} from './SearchPanel.types';\n\nfunction shouldShowRecentSearches(\n hasQuery: boolean,\n recentSearches: SearchPanelProps['recentSearches'],\n): boolean {\n if (hasQuery || !recentSearches) return false;\n return recentSearches.items.length > 0 || Boolean(recentSearches.showWhenEmpty);\n}\n\n/** True once mounted in a browser, so nothing that needs `document` renders on the server. */\nfunction useIsMounted(): boolean {\n const [isMounted, setIsMounted] = useState(false);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n return isMounted;\n}\n\n/** Gives focus back to whatever had it when the panel opened, once the panel closes. */\nfunction useRestoreFocus(isOpen: boolean): void {\n useEffect(() => {\n if (!isOpen) return undefined;\n\n const opener = document.activeElement;\n\n return () => {\n if (opener instanceof HTMLElement && opener.isConnected) opener.focus();\n };\n }, [isOpen]);\n}\n\n/** Closes on Escape, unless something inside the panel already used the key. */\nfunction useEscapeToClose(isOpen: boolean, onClose: () => void): void {\n useEffect(() => {\n if (!isOpen) return undefined;\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && !event.defaultPrevented) onClose();\n }\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [isOpen, onClose]);\n}\n\n/**\n * Moves focus to `target` when the panel opens: the search box, or, when an agent fills the panel,\n * the panel itself so that Tab goes on into the agent.\n */\nfunction useFocusOnOpen(target: React.RefObject<HTMLElement>, isShown: boolean): void {\n useEffect(() => {\n if (!isShown) return undefined;\n\n const frame = requestAnimationFrame(() => target.current?.focus());\n\n return () => cancelAnimationFrame(frame);\n }, [target, isShown]);\n}\n\n/** What a screen reader is told about the suggestions as they change. Empty says nothing. */\nfunction getStatusText(\n { loading, showNoResults, items }: SearchPanelProps['suggestions'],\n copy: SearchPanelCopy,\n): string {\n if (loading) return copy.suggestionsLoading;\n if (showNoResults) return copy.noSuggestions;\n return items.length > 0 ? copy.suggestionsCount(items.length) : '';\n}\n\nfunction messageInputEditProps(editTags: SearchEditTags | undefined) {\n if (!editTags) return {};\n const props: {\n placeholderTag?: Record<string, string>;\n rotatingPlaceholderTag?: Record<string, string>;\n } = {};\n if (editTags.searchPlaceholder) props.placeholderTag = editTags.searchPlaceholder;\n if (editTags.mobileRotatingPlaceholder) {\n props.rotatingPlaceholderTag = editTags.mobileRotatingPlaceholder;\n }\n return props;\n}\n\nfunction layoutCancelEditProps(editTags: SearchEditTags | undefined) {\n if (!editTags) return {};\n const props: {\n cancelLabelTag?: Record<string, string>;\n cancelShowIconTag?: Record<string, string>;\n } = {};\n if (editTags.cancelLabel) props.cancelLabelTag = editTags.cancelLabel;\n if (editTags.cancelShowIcon) props.cancelShowIconTag = editTags.cancelShowIcon;\n return props;\n}\n\nfunction recentSearchesEditProps(editTags: SearchEditTags | undefined) {\n if (!editTags) return {};\n const props: {\n titleTag?: Record<string, string>;\n clearTag?: Record<string, string>;\n enableTag?: Record<string, string>;\n } = {};\n if (editTags.recentSearchesHeading) props.titleTag = editTags.recentSearchesHeading;\n if (editTags.clearAllLabel) props.clearTag = editTags.clearAllLabel;\n if (editTags.enableRecentSearches) props.enableTag = editTags.enableRecentSearches;\n return props;\n}\n\ntype SearchPanelAutocompleteBodyProps = Readonly<{\n copy: SearchPanelCopy;\n editTags: SearchEditTags | undefined;\n fallbackImageUrl: string;\n hasQuery: boolean;\n inputRef: React.RefObject<HTMLInputElement | null>;\n recentSearches: SearchPanelRecentSearches | undefined;\n showSuggestions: boolean;\n suggestions: SearchPanelProps['suggestions'];\n suggestionsRef: React.Ref<SearchSuggestionsHandle>;\n}>;\n\nfunction SearchPanelAutocompleteBody({\n copy,\n editTags,\n fallbackImageUrl,\n hasQuery,\n inputRef,\n recentSearches,\n showSuggestions,\n suggestions,\n suggestionsRef,\n}: SearchPanelAutocompleteBodyProps): React.ReactElement {\n const showRecent = shouldShowRecentSearches(hasQuery, recentSearches);\n\n return (\n <SearchSuggestionsPanel\n data-testid=\"autocomplete-suggestions-panel\"\n {...(editTags?.enableAutocomplete ?? {})}\n >\n <SearchPanelStatus aria-atomic=\"true\" data-testid=\"search-panel-status\">\n {showSuggestions ? getStatusText(suggestions, copy) : ''}\n </SearchPanelStatus>\n {showSuggestions ? (\n <SearchSuggestions\n {...suggestions}\n ref={suggestionsRef}\n onLeaveTop={() => inputRef.current?.focus()}\n addToCartLabel={copy.addToCart}\n didYouMeanText={copy.didYouMean}\n noSuggestionsText={copy.noSuggestions}\n openBundleLabel={copy.openBundle}\n openProductPageLabel={copy.openProductPage}\n seeMoreText={copy.seeMoreResults}\n suggestionsLabel={copy.suggestionsLabel}\n fallbackImageUrl={fallbackImageUrl}\n />\n ) : null}\n {showRecent && recentSearches ? (\n <RecentSearches\n {...recentSearches}\n title={copy.recentSearches}\n clearLabel={copy.clearRecentSearches}\n moreLabel={copy.moreRecentSearches}\n {...recentSearchesEditProps(editTags)}\n />\n ) : null}\n </SearchSuggestionsPanel>\n );\n}\n\n/**\n * The search panel: a search box, suggestions and recent searches or, when `agentPanel` is set, a\n * header over an embedded agent. Full screen on small screens, a band across the top from the\n * desktop breakpoint up.\n *\n * It is a panel, not a modal: the page behind it keeps scrolling, keyboard focus is not trapped,\n * and the page is not hidden from assistive technology. It closes on Escape and on a press outside\n * it, and puts focus back where it was when it closes.\n *\n * Presentational: it holds only UI state (highlighted row, expanded recent searches). Fetching,\n * routing, navigation and all of its text belong to the host.\n */\nexport function SearchPanel({\n isOpen,\n onClose,\n logo,\n fallbackImageUrl = '',\n copy,\n input,\n suggestions,\n showSuggestions = true,\n recentSearches,\n agentPanel,\n showNuiIcons = false,\n showCancelIcon = true,\n rotatingPlaceholders,\n rotatingPlaceholderIntervalMs,\n editTags,\n}: Readonly<SearchPanelProps>): React.ReactElement | null {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const layoutRef = useRef<HTMLDialogElement>(null);\n const suggestionsRef = useRef<SearchSuggestionsHandle>(null);\n const isMounted = useIsMounted();\n const hasAgent = agentPanel != null;\n const isShown = isOpen && isMounted;\n\n useRestoreFocus(isOpen);\n useEscapeToClose(isOpen, onClose);\n useFocusOnOpen(hasAgent ? layoutRef : inputRef, isShown);\n\n if (!isShown) return null;\n\n const hasQuery = input.value.trim() !== '';\n\n const searchInput = (\n <SearchMessageInput\n clearLabel={copy.clearInput}\n inputLabel={copy.searchLabel}\n inputRef={inputRef}\n onArrowDown={() => suggestionsRef.current?.focusFirst() ?? false}\n onChange={input.onChange}\n onSubmit={input.onSubmit}\n placeholder={copy.searchPlaceholder}\n submitLabel={copy.submitSearch}\n value={input.value}\n showNuiIcons={showNuiIcons}\n voiceSearchLabel={copy.voiceSearch}\n askNuiLabel={copy.askNui}\n {...messageInputEditProps(editTags)}\n {...(rotatingPlaceholders ? { rotatingPlaceholders } : {})}\n {...(rotatingPlaceholderIntervalMs != null ? { rotatingPlaceholderIntervalMs } : {})}\n data-testid=\"search-panel-input\"\n />\n );\n\n return createPortal(\n <SearchPanelOverlay\n data-testid=\"search-panel-overlay\"\n onPointerDown={(event) => {\n if (event.target === event.currentTarget) onClose();\n }}\n >\n <SearchPanelLayout\n ref={layoutRef}\n aria-label={copy.searchLabel}\n tabIndex={-1}\n closeLabel={copy.cancel}\n showCancelIcon={showCancelIcon}\n {...layoutCancelEditProps(editTags)}\n onClose={onClose}\n logoSlot={logo}\n agentMode={hasAgent}\n inputSlot={hasAgent ? undefined : searchInput}\n >\n {agentPanel ?? (\n <SearchPanelAutocompleteBody\n copy={copy}\n editTags={editTags}\n fallbackImageUrl={fallbackImageUrl}\n hasQuery={hasQuery}\n inputRef={inputRef}\n recentSearches={recentSearches}\n showSuggestions={showSuggestions}\n suggestions={suggestions}\n suggestionsRef={suggestionsRef}\n />\n )}\n </SearchPanelLayout>\n </SearchPanelOverlay>,\n document.body,\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/react-search-components",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-cx130-2624.2",
4
4
  "description": "UI-only React component library for Nu Skin search experiences",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -59,6 +59,7 @@
59
59
  "@emotion/styled": "^11.14.1",
60
60
  "@nuskin/foundation-theme": "1.8.1",
61
61
  "@nuskin/foundation-ui-components": "4.1.1",
62
+ "@nuskin/react-product-components": "^1.8.0",
62
63
  "@storybook/addon-a11y": "^8.4.7",
63
64
  "@storybook/addon-essentials": "^8.4.7",
64
65
  "@storybook/react": "^8.4.7",
@@ -99,6 +100,7 @@
99
100
  "@emotion/styled": "^11.14.0",
100
101
  "@nuskin/foundation-theme": "1.x",
101
102
  "@nuskin/foundation-ui-components": "4.x",
103
+ "@nuskin/react-product-components": "^1.8.0",
102
104
  "react": "^18.2.0",
103
105
  "react-dom": "^18.2.0"
104
106
  },