{"version":3,"file":"Select.mjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import {\n  Label,\n  Listbox,\n  type ListboxProps,\n  ListboxButton,\n  ListboxOption,\n  ListboxOptions,\n} from '@headlessui/react';\nimport clsx from 'clsx';\n\nimport React, {\n  useCallback,\n  useContext,\n  useEffect,\n  useState,\n  type ReactNode,\n  type MouseEventHandler,\n  type ElementType,\n} from 'react';\n\nimport {\n  EDS_AUDIT_PREFIX,\n  assertNoRemovedIconProp,\n  type WithRemovedIconProps,\n} from '../../util/logging';\nimport type { ExtractProps } from '../../util/utility-types';\nimport type { Status } from '../../util/variant-types';\n\nimport Checkbox from '../Checkbox';\nimport FieldLabel from '../FieldLabel';\nimport FieldNote from '../FieldNote';\nimport { hasSlotContent, IconSlot, useSemanticIcon } from '../Icon';\nimport PopoverContainer from '../PopoverContainer';\nimport PopoverListItem from '../PopoverListItem';\nimport type { PopoverListItemProps } from '../PopoverListItem/PopoverListItem';\nimport Radio from '../Radio';\nimport Text from '../Text';\nimport { InternalText } from '../Text/Text';\n\nimport styles from './Select.module.css';\n\ntype SelectProps = ListboxProps<\n  ElementType,\n  string | { [k: string]: unknown },\n  { [k: string]: unknown }\n> & {\n  // Component API\n  /**\n   * Screen-reader text for the select's label.\n   *\n   * When possible, use a visible label by passing a <Select.Label> into `children`.\n   * In rare cases where there's no visible label, you must provide an `aria-label` for screen readers.\n   * The trigger reads it the way it reads a visible label, followed by the selected value.\n   */\n  'aria-label'?: string;\n  /**\n   * Optional className for additional styling.\n   */\n  className?: string;\n  /**\n   * Name of the form element, which triggers the generation of hidden key/value form fields (e.g. `name=$name[$key]`).\n   *\n   * See: https://headlessui.com/react/listbox#using-with-html-forms\n   */\n  name?: string;\n  /**\n   * Optional className for additional options menu styling.\n   *\n   * When not using the compact variant, if optionsClassName is provided please\n   * include the width property to define the options menu width.\n   */\n  optionsClassName?: string;\n  /**\n   * Indicates that field is required for form to be successfully submitted\n   */\n  required?: boolean;\n  // Design API\n  /**\n   * Text under the textarea used to provide validation hints or error message to describe the input error.\n   */\n  fieldNote?: ReactNode;\n  /**\n   * Visible text label for the component.\n   */\n  label?: string;\n  /**\n   * Whether the label is adjacent to the field (horizontal) or above the field (vertical)\n   *\n   * **Default is `\"vertical\"`**.\n   */\n  labelLayout?: 'vertical' | 'horizontal';\n  /**\n   * Whether it should show the field hint or not\n   *\n   * **Default is `\"false\"`**.\n   */\n  showHint?: boolean;\n  /**\n   * Status for the field state\n   *\n   * **Default is `\"default\"`**.\n   */\n  status?: 'default' | Extract<Status, 'warning' | 'critical'>;\n  /**\n   * Add additional descriptive text for the field name\n   */\n  subLabel?: ReactNode;\n};\n\ntype SelectLabelProps = ExtractProps<typeof Label> & {\n  disabled?: boolean;\n  required?: boolean;\n  showHint?: boolean;\n  /**\n   * Add additional descriptive text for the field name\n   */\n  subLabel?: ReactNode;\n};\n\ntype SelectOptionsProps = ExtractProps<typeof ListboxOptions>;\n\ntype SelectOptionProps = ExtractProps<typeof ListboxOption> &\n  Pick<PopoverListItemProps, 'subLabel'> & {\n    optionClassName?: string;\n  };\n\ntype SelectButtonProps = ExtractProps<typeof ListboxButton> & {\n  // Design API\n  /**\n   * Indicates state of the select, used to style the button.\n   */\n  isOpen?: boolean;\n};\n\ntype SelectButtonWrapperProps = {\n  // Component API\n  /**\n   * Text placed inside the button to describe the field.\n   */\n  children?: ReactNode;\n  /**\n   * Optional className for additional styling.\n   */\n  className?: string;\n  // Design API\n  /**\n   * Indicates state of the select, used to style the button.\n   */\n  isOpen?: boolean;\n  /**\n   * custom click handler for the built-in or wrapper button\n   */\n  onClick?: MouseEventHandler;\n  /**\n   * Whether we should truncate the text displayed in the select field\n   */\n  shouldTruncate?: boolean;\n  /**\n   * Status for the field state\n   *\n   * **Default is `\"default\"`**.\n   */\n  status?: 'default' | Extract<Status, 'warning' | 'critical'>;\n};\n\ntype SelectContextType = {\n  optionsClassName?: string;\n  status?: SelectButtonWrapperProps['status'];\n  multiple?: boolean; // pulls from HeadlessUI\n  /**\n   * Called by a `Select.Label` with text while it's mounted, so the root knows a visible label\n   * is naming the trigger. Returns the cleanup that unregisters it.\n   */\n  registerVisibleLabel?: () => () => void;\n};\n\nlet showNameWarning = true;\n\nconst SelectContext = React.createContext<SelectContextType>({});\n\n/**\n * ## Usage\n *\n * Supports controlled and uncontrolled behavior, using a render prop in the latter case.\n *\n * | Type/Use | Description | Example |\n * |----------|-------------|---------|\n * | Standard | A dropdown list that reveals a set of options; one can be selected. | Country selector. Sort order. Single-choice forms. |\n * | Searchable | Includes a text input for filtering options in real time. | Long lists (e.g., cities, tags). Large datasets. |\n * | Multi-select | Allows multiple options to be selected from the list. | Filter panels. Role or permission assignments. |\n * | Disabled | Non-interactive; used to show unavailable or inactive states. | Feature-gated selections. Incomplete forms. |\n * | Preselected | Default selection appears before user interacts. | Recommended settings. \"Most common\" default. |\n * | Inline | Embedded within table rows or compact UIs. | Editable data tables. Quick action cells. |\n *\n * ### Best Practices\n *\n * * Select can be used in forms and is meant to pick a value from a list of values, whereas Menus can be used for things like commands.\n * * Order the menu options logically to make it easier for users to find the option they want. Default to alphabetical order.\n * * Use a Select input for longer lists of options. A Select should never have only 2 options; 3 selections can be acceptable, but consider a Checkbox group or Radio button group instead so users can see all options at once.\n * * Keep the select menu the same width as the select field that triggered it.\n *\n * ## Interaction\n *\n * In single-select mode, only one selection can be made. In multi-select mode, one or more selections can be made from the list.\n *\n * ## Content & Accessibility\n *\n * ### Do's\n *\n * * Use short, precise labels whenever possible.\n * * Avoid truncated items.\n * * In short lists, order from most common to least common choices.\n * * In longer lists use alphabetical order, but if there are 2 or 3 very common selections, consider repeating them at the top of the list.\n * * Use sentence case.\n * * Place the most common choices at the top of the list to assist visually impaired users.\n *\n * ### Don'ts\n *\n * * Use periods at the end of labels.\n * * Place placeholder text within the field; it can cause accessibility issues with color contrast, inconsistent screen-reader behavior, and text disappearing as users type.\n *\n * ## Resources\n *\n * * https://headlessui.com/react/menu\n */\nexport function Select({\n  'aria-label': ariaLabel,\n  children,\n  className,\n  disabled,\n  fieldNote,\n  id,\n  label,\n  labelLayout = 'vertical',\n  name,\n  optionsClassName,\n  required,\n  showHint,\n  status,\n  onChange: theirOnChange,\n  subLabel,\n  ...other\n}: SelectProps) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (!name && showNameWarning) {\n      console.warn(\n        EDS_AUDIT_PREFIX +\n          \"%c`Select` won't render a form field unless you include a `name` prop.\\n\\n See https://headlessui.com/react/listbox#using-with-html-forms for more information\",\n        'font-weight: bold',\n      );\n      showNameWarning = false;\n    }\n  }\n\n  // Create a new value to track the internal state of Listbox. Added to work around\n  // behavior inherited from HeadlessUI where it will fire onChange even if there is no change\n  // Adding to support behavior synced to how <select> tags work\n  const [selectedValue, setSelectedValue] = useState(\n    other.value !== undefined ? other.value : other.defaultValue,\n  );\n\n  const componentClassName = clsx(\n    styles['select'],\n    fieldNote && styles['select--has-fieldNote'],\n    labelLayout && styles[`select--label-layout-${labelLayout}`],\n    className,\n  );\n  // Shared by both kinds of children, so a render prop reports changes the same way.\n  const handleChange: SelectProps['onChange'] = (changedValue) => {\n    if (selectedValue !== changedValue) {\n      setSelectedValue(changedValue);\n      // Use the value from the event because updates to `useState` are queued\n      theirOnChange && theirOnChange(changedValue);\n    }\n  };\n\n  const sharedProps: SelectProps = {\n    className: componentClassName,\n    // Provide a wrapping <div> element for the select. This is needed so that any props\n    // passed directly to this component have a corresponding DOM element to receive them.\n    // Otherwise we get an error.\n    as: 'div' as const,\n    disabled,\n    name,\n    ...other,\n    onChange: handleChange,\n  };\n\n  // Counts the `Select.Label`s with text, whether from the `label` prop or passed in as\n  // children, since either one is a visible label that should name the trigger.\n  const [visibleLabelCount, setVisibleLabelCount] = useState(0);\n  const registerVisibleLabel = useCallback(() => {\n    setVisibleLabelCount((count) => count + 1);\n    return () => setVisibleLabelCount((count) => count - 1);\n  }, []);\n\n  const context: SelectContextType = {\n    optionsClassName,\n    status,\n    multiple: other.multiple,\n    registerVisibleLabel,\n  };\n\n  // HeadlessUI names the trigger with `aria-labelledby`: every label in the listbox, then the\n  // button itself, so it reads as the label followed by the selected value. With no visible\n  // label, `aria-label` goes in a hidden label so it gets read the same way. An `aria-label`\n  // on the button would replace the selected value instead of coming before it. A visible\n  // label wins, so the trigger isn't named twice.\n  const hiddenLabel = !label && !visibleLabelCount && ariaLabel && (\n    <Label className={styles['select__label--hidden']}>{ariaLabel}</Label>\n  );\n\n  if (typeof children === 'function') {\n    return (\n      <SelectContext.Provider value={context}>\n        <Listbox {...sharedProps}>\n          {(renderProps) => (\n            <>\n              {hiddenLabel}\n              {children(renderProps)}\n            </>\n          )}\n        </Listbox>\n      </SelectContext.Provider>\n    );\n  }\n\n  return (\n    <SelectContext.Provider value={context}>\n      <Listbox {...sharedProps}>\n        {(label || required) && (\n          <Select.Label\n            disabled={disabled}\n            required={required}\n            showHint={showHint}\n            subLabel={subLabel}\n          >\n            {label}\n          </Select.Label>\n        )}\n        {hiddenLabel}\n        {children}\n      </Listbox>\n      {fieldNote && (\n        <div className={styles['select__footer']}>\n          <FieldNote disabled={disabled} status={status}>\n            {fieldNote}\n          </FieldNote>\n        </div>\n      )}\n    </SelectContext.Provider>\n  );\n}\n\nconst SelectLabel = ({\n  children: label,\n  required,\n  className,\n  disabled,\n  showHint,\n  subLabel,\n}: SelectLabelProps) => {\n  const { registerVisibleLabel } = useContext(SelectContext);\n  // Not `!!label`, since `0` is a valid child that renders as text.\n  const hasText = typeof label === 'function' || hasSlotContent(label);\n  useEffect(\n    () => (hasText ? registerVisibleLabel?.() : undefined),\n    [hasText, registerVisibleLabel],\n  );\n\n  const componentClassName = clsx(\n    styles['select__label'],\n    disabled && clsx(styles['select__label--disabled']),\n    className,\n  );\n\n  const requiredTextClassName = clsx(\n    styles['select__required-text'],\n    disabled && styles['select__required-text--disabled'],\n  );\n\n  const overlineClassName = clsx(\n    styles['select__overline'],\n    !hasText && styles['select__overline--no-label'],\n  );\n\n  const subLabelClassName = clsx(\n    styles['select__subLabel'],\n    disabled && styles['select__label--disabled'],\n  );\n\n  return (\n    <div className={overlineClassName}>\n      <Label\n        as={FieldLabel}\n        className={componentClassName}\n        disabled={disabled}\n        size=\"md\"\n      >\n        {label}\n      </Label>\n      {required && showHint && (\n        <Text\n          aria-disabled={disabled ?? undefined}\n          as=\"span\"\n          className={requiredTextClassName}\n          preset=\"body-sm\"\n        >\n          (Required)\n        </Text>\n      )}\n      {!required && showHint && (\n        <Text\n          aria-disabled={disabled ?? undefined}\n          as=\"span\"\n          className={requiredTextClassName}\n          preset=\"body-sm\"\n        >\n          (Optional)\n        </Text>\n      )}\n      {hasText && subLabel && (\n        <div className={subLabelClassName}>\n          {/* TODO: is there a way to coerce HeadlessUI into using aria-describedby like InputField/TextareaField */}\n          <Text as=\"span\" preset=\"body-sm\">\n            {subLabel}\n          </Text>\n        </div>\n      )}\n    </div>\n  );\n};\n\n/**\n * The trigger for the select component, which is usually a form of `Button` or some targetable/clickable component\n */\nconst SelectButton = function (props: SelectButtonProps) {\n  const {\n    children,\n    className,\n    onClick: theirOnClick,\n    // TODO(next-major): remove, with the assert below.\n    icon: removedIcon,\n    ...other\n  } = props as WithRemovedIconProps<SelectButtonProps, 'icon'>;\n\n  // TODO(next-major): remove.\n  assertNoRemovedIconProp('Select.Button', 'icon', 'expand', removedIcon);\n\n  const { status } = useContext(SelectContext);\n  return (\n    <ListboxButton\n      // Render as a fragment instead of the default element. We're rendering our own element in\n      // the render prop to control styling and positiong, and we don't want to end up with\n      // duplicate buttons.\n      as={React.Fragment}\n      {...other}\n    >\n      {(renderProps) => {\n        return typeof children === 'function' ? (\n          children(renderProps)\n        ) : (\n          <SelectButtonWrapper\n            className={className}\n            isOpen={renderProps.open}\n            onClick={(event) => {\n              theirOnClick && theirOnClick(event);\n            }}\n            status={status}\n          >\n            {children}\n          </SelectButtonWrapper>\n        );\n      }}\n    </ListboxButton>\n  );\n};\n\n/**\n * The content container showing the available options when the trigger is activated\n */\nconst SelectOptions = function (props: SelectOptionsProps) {\n  const {\n    anchor = { to: 'bottom start', gap: 12 },\n    className,\n    ...other\n  } = props;\n  const { optionsClassName } = useContext(SelectContext);\n\n  const componentClassName = clsx(\n    styles['select__options'],\n    className,\n    optionsClassName,\n  );\n\n  return (\n    <ListboxOptions\n      anchor={anchor}\n      as={PopoverContainer}\n      className={componentClassName}\n      modal={false}\n      {...other}\n    />\n  );\n};\n\n/**\n * Represents one of the available options for selection\n */\nconst SelectOption = function (props: SelectOptionProps) {\n  const {\n    children,\n    className,\n    optionClassName,\n    subLabel: optionSubLabel,\n    ...other\n  } = props;\n\n  const optionItemClassName = clsx(optionClassName, styles['select__option']);\n  const { multiple } = useContext(SelectContext);\n\n  return (\n    <ListboxOption\n      // Render as a fragment instead of the default <li>. We're rendering our own <li> in the\n      // render prop to control active/selected styling, and we don't want to end up with duplicate\n      // <li>'s.\n      as={React.Fragment}\n      {...other}\n    >\n      {typeof children === 'function'\n        ? children\n        : ({ focus, disabled, selected }) => {\n            return (\n              <PopoverListItem\n                __type=\"selectitem\"\n                className={optionItemClassName}\n                isDisabled={disabled}\n                isFocused={focus}\n                leadingContent={\n                  multiple ? (\n                    <Checkbox\n                      aria-hidden=\"true\"\n                      aria-label=\"checkbox\"\n                      checked={selected}\n                      inert\n                      readOnly\n                    />\n                  ) : (\n                    <Radio\n                      aria-hidden=\"true\"\n                      aria-label=\"radio\"\n                      checked={selected}\n                      inert\n                      readOnly\n                    />\n                  )\n                }\n                subLabel={optionSubLabel}\n              >\n                <span className={styles['select__option-text']}>\n                  {children}\n                </span>\n              </PopoverListItem>\n            );\n          }}\n    </ListboxOption>\n  );\n};\n\n/**\n * The component functioning as a styling for the trigger, selection arrow, and space to\n * show the current value.\n */\nexport const SelectButtonWrapper = React.forwardRef<\n  HTMLButtonElement,\n  SelectButtonWrapperProps\n>((props, ref) => {\n  const {\n    children,\n    className,\n    isOpen,\n    onClick: theirOnClick,\n    shouldTruncate = false,\n    // TODO(next-major): remove, with the assert below.\n    icon: removedIcon,\n    ...other\n  } = props as WithRemovedIconProps<typeof props, 'icon'>;\n\n  // TODO(next-major): remove.\n  assertNoRemovedIconProp(\n    'Select.ButtonWrapper',\n    'icon',\n    'expand',\n    removedIcon,\n  );\n\n  const { status } = useContext(SelectContext);\n\n  // The indicator marks the button as the thing that opens the options, so it is the\n  // same semantic `expand` icon a `Menu.Button` or an `Accordion` row carries. The CSS\n  // flips it when the listbox is open rather than swapping to `collapse`.\n  const expandIcon = useSemanticIcon('expand');\n\n  const componentClassName = clsx(\n    styles['select-button'],\n    status === 'warning' && styles['select-button--warning'],\n    status === 'critical' && styles['select-button--error'],\n    className,\n  );\n  const iconClassName = clsx(\n    styles['select-button__icon'],\n    isOpen && styles['select-button__icon--reversed'],\n  );\n  const textClassName = clsx(\n    shouldTruncate && styles['select-button__text--truncated'],\n  );\n\n  return (\n    <button\n      className={componentClassName}\n      onClick={(ev) => {\n        theirOnClick && theirOnClick(ev);\n      }}\n      ref={ref}\n      type=\"button\"\n      {...other}\n    >\n      {/* Wrapping span ensures that `children` and icon will be correctly pushed to\n            either side of the button even if `children` contains more than one element. */}\n      <InternalText as=\"span\" className={textClassName} preset=\"input\">\n        {children}\n      </InternalText>\n      {hasSlotContent(expandIcon) && (\n        <IconSlot\n          className={iconClassName}\n          content={expandIcon}\n          purpose=\"decorative\"\n          size=\"24px\"\n        />\n      )}\n    </button>\n  );\n});\n\nSelect.displayName = 'Select';\nSelectButton.displayName = 'Select.Button';\nSelectButtonWrapper.displayName = 'Select.ButtonWrapper';\nSelectLabel.displayName = 'Select.Label';\nSelectOption.displayName = 'Select.Option';\nSelectOptions.displayName = 'Select.Options';\n\nSelect.Button = SelectButton;\nSelect.ButtonWrapper = SelectButtonWrapper;\nSelect.Label = SelectLabel;\nSelect.Option = SelectOption;\nSelect.Options = SelectOptions;\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;AAgLA,IAAI,eAAe,GAAG,IAAI;AAE1B,MAAM,aAAa,GAAGA,cAAK,CAAC,aAAa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