{"version":3,"file":"TimeZonePicker.mjs","names":["size","sizeMiddleware"],"sources":["../../../src/timezone-picker/TimeZonePicker.tsx"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n  autoUpdate,\n  type Boundary,\n  flip,\n  FloatingFocusManager,\n  FloatingPortal,\n  offset,\n  shift,\n  size as sizeMiddleware,\n  useDismiss,\n  useFloating,\n  useInteractions,\n  useMergeRefs,\n  useTransitionStyles,\n} from '@floating-ui/react';\nimport { ChevronDownIcon } from '@heroicons/react/24/outline';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n  useEffect,\n  useId,\n  useImperativeHandle,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport {\n  FormFieldLabel,\n  FormFieldMessage,\n  useFormField,\n} from '../_common/form-control';\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme';\nimport {\n  formatTimeZone,\n  generateTimeZoneOptions,\n  generateUTCTimeZoneOptions,\n  isValidUTCFormat,\n  parseCustomUTCOffset,\n} from './generate-timezone-options';\nimport {\n  useKeyboardNavigation,\n  useTimeZonePickerPopover,\n} from './timezone-picker-hooks';\n\nexport type TimeZonePickerProps = {\n  /** The value of the timezone picker (IANA timezone identifier) */\n  value?: string;\n  /** Whether the timezone picker is fluid */\n  isFluid?: boolean;\n  /** Whether the timezone picker is read only */\n  isReadOnly?: boolean;\n  /** Whether the timezone picker is required */\n  isRequired?: boolean;\n  /** Whether the timezone picker is disabled */\n  isDisabled?: boolean;\n  /** The label of the timezone picker */\n  label?: string;\n  /** The size of the timezone picker */\n  size?: 'small' | 'medium' | 'large';\n  /** Assistive text displayed below the input. Replaced by `errorText` or an internal validation error while there is one */\n  helpText?: React.ReactNode;\n  /** Manually set the error text */\n  errorText?: string;\n  /** Callback function triggered when the timezone picker value changes */\n  onChange?: (timezone: string) => void;\n  /** Callback function triggered when the timezone picker encounters an error */\n  onError?: (error: string, timezone: string) => void;\n  /**\n   * Strategy for the dropdown floating element.\n   * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n   * If this prop is set, no auto-detection of Dialog is done.\n   */\n  floatingStrategy?: 'absolute' | 'fixed';\n  /** Whether the dropdown element is rendered in a portal. */\n  isPortaled?: boolean;\n  /** Reference date for calculating timezone offsets (useful for DST-aware offset display) */\n  referenceDate?: Date;\n  /**\n   * Display mode: 'city', 'utc', or 'both'\n   * 'city' - shows city-based timezones, This should be used when the user needs to select a timezone for themselves or if they are selecting a timezone that's related to a date.\n   * 'utc' - shows UTC timezones, This should be used when the user needs to select a timezone for a database entry or a technical application.\n   * 'both' - shows both city-based and UTC timezones in separate sections, This should be used when the user needs to select a timezone for a database entry or a technical application, but also wants to see the city-based timezones for context for example a zoned date time.\n   * @default 'city'\n   * @example\n   * <TimeZonePicker mode=\"city\" />\n   * <TimeZonePicker mode=\"utc\" />\n   * <TimeZonePicker mode=\"both\" />\n   */\n  mode?: 'city' | 'utc' | 'both';\n};\n\nexport const TimeZonePicker = ({\n  isDisabled,\n  isFluid,\n  isReadOnly,\n  isRequired,\n  value,\n  label,\n  onChange,\n  className,\n  onError,\n  style,\n  size = 'medium',\n  helpText,\n  errorText,\n  htmlAttributes,\n  floatingStrategy,\n  isPortaled: isPortaledProp,\n  referenceDate,\n  mode = 'city',\n  ref,\n  ...restProps\n}: CommonProps<'input', TimeZonePickerProps>) => {\n  const [inputValue, setInputValue] = useState<string>(\n    value\n      ? formatTimeZone(value, referenceDate)\n      : formatTimeZone(\n          new Date().toISOString().split('T')[1].split('.')[0],\n          referenceDate,\n        ),\n  );\n  const [searchQuery, setSearchQuery] = useState<string>('');\n  const listRef = useRef<HTMLUListElement>(null);\n  const inputRef = useRef<HTMLInputElement>(null);\n  useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n  const [error, setError] = useState<string | undefined>(undefined);\n  const listboxId = useId();\n\n  const timezoneOptions = useMemo(() => {\n    if (mode === 'utc') {\n      return generateUTCTimeZoneOptions(referenceDate);\n    } else if (mode === 'city') {\n      return generateTimeZoneOptions(referenceDate);\n    } else {\n      // 'both' mode - combine both lists, excluding UTC from city list to avoid duplication\n      return [\n        ...generateUTCTimeZoneOptions(referenceDate),\n        ...generateTimeZoneOptions(referenceDate, true), // excludeUTC = true\n      ];\n    }\n  }, [referenceDate, mode]);\n\n  const { themeClassName } = useNeedleTheme();\n  const { isPopoverOpen, setIsPopoverOpen } = useTimeZonePickerPopover(false);\n\n  // Filter options based on search query\n  const filteredOptions = useMemo(() => {\n    if (!searchQuery) {\n      return timezoneOptions;\n    }\n\n    const query = searchQuery.toLowerCase();\n    return timezoneOptions.filter(\n      (option) =>\n        option.label.toLowerCase().includes(query) ||\n        option.value.toLowerCase().includes(query),\n    );\n  }, [timezoneOptions, searchQuery]);\n\n  // Split options into UTC and city-based sections for 'both' mode\n  const { utcOptions, cityOptions } = useMemo(() => {\n    if (mode !== 'both') {\n      return { cityOptions: filteredOptions, utcOptions: [] };\n    }\n\n    const utc: typeof filteredOptions = [];\n    const city: typeof filteredOptions = [];\n\n    filteredOptions.forEach((option) => {\n      // UTC options are those that start with \"UTC\" in their value or label\n      if (\n        option.value.toUpperCase().startsWith('UTC') ||\n        option.label.toUpperCase().startsWith('UTC')\n      ) {\n        utc.push(option);\n      } else {\n        city.push(option);\n      }\n    });\n\n    return { cityOptions: city, utcOptions: utc };\n  }, [filteredOptions, mode]);\n\n  const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n    useKeyboardNavigation(filteredOptions.length);\n\n  const errorToShow =\n    errorText !== undefined && errorText !== '' ? errorText : error;\n  // The shared form field resolves the ids and which message is displayed -\n  // an error, set manually or by internal validation, replaces the help text.\n  const { field, controlProps } = useFormField({\n    errorText: errorToShow,\n    helpText,\n    isRequired,\n    label,\n  });\n\n  const classes = {\n    'ndl-disabled': isDisabled,\n    'ndl-error': errorToShow !== undefined,\n    'ndl-fluid': isFluid,\n    'ndl-large': size === 'large',\n    'ndl-medium': size === 'medium',\n    'ndl-read-only': isReadOnly,\n    'ndl-small': size === 'small',\n  };\n\n  const inputWidth = isFluid === true ? '100%' : '16rem';\n\n  useEffect(() => {\n    if (error !== undefined) {\n      onError?.(error, inputValue);\n    }\n  }, [error, inputValue, onError]);\n\n  useEffect(() => {\n    setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n  }, [value, referenceDate]);\n\n  useEffect(() => {\n    if (isPopoverOpen) {\n      setTimeout(() => {\n        listRef.current?.children[focusedIndex]?.scrollIntoView({\n          block: 'center',\n          inline: 'nearest',\n        });\n      }, 0);\n    } else {\n      setTimeout(() => {\n        const selectedIndex =\n          filteredOptions.findIndex((opt) => opt.value === value) ?? 0;\n        setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);\n      }, 0);\n    }\n  }, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);\n\n  const handleOnClick = (timezone: string) => {\n    if (onChange) {\n      onChange(timezone);\n    }\n    setError(undefined);\n    setInputValue(formatTimeZone(timezone, referenceDate));\n    setIsPopoverOpen(false);\n    setSearchQuery('');\n  };\n\n  const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n    const query = event.target.value;\n    setSearchQuery(query);\n    setInputValue(query);\n\n    // In UTC mode (utc or both), validate custom UTC input\n    if (\n      (mode === 'utc' || mode === 'both') &&\n      query.trim().toUpperCase().startsWith('UTC')\n    ) {\n      if (isValidUTCFormat(query.trim())) {\n        setError(undefined);\n      } else {\n        setError('Invalid UTC format. Use UTC+H:MM or UTC-H:MM');\n      }\n      return;\n    }\n\n    // Try to find a matching timezone\n    const matchingOption = timezoneOptions.find(\n      (opt) =>\n        opt.label.toLowerCase().includes(query.toLowerCase()) ||\n        opt.value.toLowerCase().includes(query.toLowerCase()),\n    );\n\n    if (matchingOption) {\n      setError(undefined);\n    }\n  };\n\n  const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n    if (isReadOnly === true || isDisabled === true) {\n      event.preventDefault();\n      return;\n    }\n\n    if (event.key === 'Escape') {\n      setIsPopoverOpen(false);\n      setSearchQuery('');\n      setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n    }\n\n    setIsPopoverOpen(true);\n\n    if (event.key === 'Enter') {\n      // In UTC mode (utc or both), allow custom UTC input\n      if (\n        (mode === 'utc' || mode === 'both') &&\n        inputValue.trim().toUpperCase().startsWith('UTC')\n      ) {\n        const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n        if (parsedOffset) {\n          handleOnClick(parsedOffset);\n          return;\n        }\n      }\n\n      if (filteredOptions.length > 0) {\n        const selectedOption = filteredOptions[focusedIndex];\n        if (selectedOption) {\n          handleOnClick(selectedOption.value);\n        }\n      }\n    } else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n      event.preventDefault();\n      handleArrowNavigation(event.key);\n    }\n  };\n\n  /** Custom floating ui solution */\n  const isInsideDialog = useIsInsideDialog();\n  const isPortaled = isPortaledProp ?? !isInsideDialog;\n  // Inside a Dialog the popover is fixed and not portaled. A transformed\n  // ancestor (e.g. Popover) can make Floating UI under-measure available\n  // space, so use the viewport as the boundary instead.\n  const floatingBoundary: Boundary = isInsideDialog ? [] : 'clippingAncestors';\n  const containerRef = useRef<HTMLDivElement>(null);\n  const { refs, floatingStyles, context } = useFloating({\n    elements: {\n      reference: containerRef.current,\n    },\n    middleware: [\n      offset(10),\n      flip({\n        fallbackPlacements: ['top'],\n        fallbackStrategy: 'bestFit',\n      }),\n      shift({ boundary: floatingBoundary, padding: 5 }),\n      sizeMiddleware({\n        apply({ availableHeight, elements }) {\n          Object.assign(elements.floating.style, {\n            maxHeight: `${availableHeight}px`,\n          });\n        },\n        boundary: floatingBoundary,\n        padding: 5,\n      }),\n    ],\n    onOpenChange: (open) => {\n      setIsPopoverOpen(open);\n    },\n    open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n    placement: 'bottom',\n    strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n    whileElementsMounted: autoUpdate,\n  });\n  const dismiss = useDismiss(context);\n  const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n  const { styles: transitionStyles } = useTransitionStyles(context, {\n    duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n  });\n\n  const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n  return (\n    <>\n      <div\n        className={classNames('ndl-timezone-picker', className, {\n          ...classes,\n        })}\n        ref={mergedRef}\n        {...getReferenceProps()}\n        style={{\n          width: isFluid === true ? '100%' : 'fit-content',\n        }}\n      >\n        <label className=\"ndl-timezone-picker-label\">\n          {label !== undefined && (\n            <FormFieldLabel field={field} size={size} association=\"implicit\" />\n          )}\n          <div\n            className=\"ndl-timezone-picker-input-wrapper\"\n            style={{\n              width: inputWidth,\n              ...style,\n            }}\n          >\n            <input\n              role=\"combobox\"\n              aria-expanded={isPopoverOpen}\n              aria-controls={listboxId}\n              aria-activedescendant={\n                isPopoverOpen && focusedIndex >= 0\n                  ? `${listboxId}-option-${focusedIndex}`\n                  : undefined\n              }\n              aria-label={label}\n              {...controlProps}\n              className=\"ndl-timezone-picker-input\"\n              type=\"text\"\n              ref={inputRef}\n              value={inputValue}\n              disabled={isDisabled}\n              readOnly={isReadOnly}\n              required={isRequired}\n              onChange={handleInputChange}\n              onKeyDown={handleKeyDown}\n              onClick={(event) => {\n                if (isReadOnly === true || isDisabled === true) {\n                  return;\n                }\n                setIsPopoverOpen(true);\n                // Select all text on click for easy searching\n                event.currentTarget.select();\n              }}\n              onFocus={(event) => {\n                if (isReadOnly === true || isDisabled === true) {\n                  return;\n                }\n                // Select all text on focus for easy searching\n                event.currentTarget.select();\n              }}\n              onBlur={(event) => {\n                if (isReadOnly === true || isDisabled === true) {\n                  return;\n                }\n\n                if (\n                  event.relatedTarget?.classList.contains(\n                    'ndl-timezone-picker-popover-item',\n                  ) === true\n                ) {\n                  return;\n                }\n\n                // In UTC mode (utc or both), try to parse custom input on blur.\n                // An empty search query means nothing was typed since the last\n                // commit, e.g. the blur that follows selecting with Enter.\n                if (\n                  (mode === 'utc' || mode === 'both') &&\n                  searchQuery !== '' &&\n                  inputValue.trim().toUpperCase().startsWith('UTC')\n                ) {\n                  const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n                  if (parsedOffset) {\n                    handleOnClick(parsedOffset);\n                    setError(undefined);\n                    return;\n                  }\n                }\n\n                // Reset to the current value if no valid selection was made\n                if (value) {\n                  setInputValue(formatTimeZone(value, referenceDate));\n                } else {\n                  setInputValue('');\n                }\n                setSearchQuery('');\n                setError(undefined);\n              }}\n              placeholder={\n                mode === 'city'\n                  ? 'Select timezone'\n                  : mode === 'utc'\n                    ? 'Select or type UTC offset (e.g., UTC+5:30)'\n                    : 'Select timezone or type UTC offset'\n              }\n              {...htmlAttributes}\n              {...restProps}\n            />\n            <ChevronDownIcon className=\"ndl-icon-svg ndl-timezone-picker-icon\" />\n          </div>\n        </label>\n        <FormFieldMessage field={field} size={size} />\n      </div>\n\n      {context.open && (\n        <ConditionalWrap\n          shouldWrap={isPortaled}\n          wrap={(wrapChildren) => (\n            <FloatingPortal>{wrapChildren}</FloatingPortal>\n          )}\n        >\n          <FloatingFocusManager\n            context={context}\n            modal={false}\n            initialFocus={-1}\n          >\n            <div\n              ref={refs.setFloating}\n              className={classNames(\n                themeClassName,\n                'ndl-timezone-picker-popover',\n                {\n                  ...classes,\n                },\n              )}\n              style={{\n                ...transitionStyles,\n                ...floatingStyles,\n                width:\n                  isFluid === true\n                    ? containerRef.current?.clientWidth\n                    : undefined,\n              }}\n              {...getFloatingProps()}\n            >\n              <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n                {mode === 'both' ? (\n                  <>\n                    {utcOptions.length > 0 && (\n                      <>\n                        <li className=\"ndl-timezone-picker-section-header\">\n                          UTC Offsets\n                        </li>\n                        {utcOptions.map((option, index) => (\n                          <li\n                            id={`${listboxId}-option-${index}`}\n                            key={option.value}\n                            role=\"option\"\n                            aria-selected={value === option.value}\n                            value={option.value}\n                            onClick={(event) => {\n                              event.stopPropagation();\n                              event.preventDefault();\n                              handleOnClick(option.value);\n                              setIsPopoverOpen(false);\n                            }}\n                            onMouseDown={(event) => {\n                              event.stopPropagation();\n                              event.preventDefault();\n                            }}\n                            tabIndex={-1}\n                            className={classNames(\n                              focusedIndex === index ? 'focused' : '',\n                              'ndl-timezone-picker-popover-item',\n                            )}\n                            onKeyDown={(event) => {\n                              if (event.key === 'Enter') {\n                                event.stopPropagation();\n                                handleOnClick(option.value);\n                              }\n                            }}\n                          >\n                            {option.label}\n                          </li>\n                        ))}\n                      </>\n                    )}\n                    {cityOptions.length > 0 && (\n                      <>\n                        <li className=\"ndl-timezone-picker-section-header\">\n                          City-Based Timezones\n                        </li>\n                        {cityOptions.map((option, index) => {\n                          const adjustedIndex = index + utcOptions.length;\n                          return (\n                            <li\n                              id={`${listboxId}-option-${adjustedIndex}`}\n                              key={option.value}\n                              role=\"option\"\n                              aria-selected={value === option.value}\n                              value={option.value}\n                              onClick={(event) => {\n                                event.stopPropagation();\n                                event.preventDefault();\n                                handleOnClick(option.value);\n                                setIsPopoverOpen(false);\n                              }}\n                              onMouseDown={(event) => {\n                                event.stopPropagation();\n                                event.preventDefault();\n                              }}\n                              tabIndex={-1}\n                              className={classNames(\n                                focusedIndex === adjustedIndex ? 'focused' : '',\n                                'ndl-timezone-picker-popover-item',\n                              )}\n                              onKeyDown={(event) => {\n                                if (event.key === 'Enter') {\n                                  event.stopPropagation();\n                                  handleOnClick(option.value);\n                                }\n                              }}\n                            >\n                              {option.label}\n                            </li>\n                          );\n                        })}\n                      </>\n                    )}\n                    {utcOptions.length === 0 && cityOptions.length === 0 && (\n                      <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n                        No timezones found\n                      </li>\n                    )}\n                  </>\n                ) : (\n                  <>\n                    {filteredOptions.length > 0 ? (\n                      filteredOptions.map((option, index) => (\n                        <li\n                          id={`${listboxId}-option-${index}`}\n                          key={option.value}\n                          role=\"option\"\n                          aria-selected={value === option.value}\n                          value={option.value}\n                          onClick={(event) => {\n                            event.stopPropagation();\n                            event.preventDefault();\n                            handleOnClick(option.value);\n                            setIsPopoverOpen(false);\n                          }}\n                          onMouseDown={(event) => {\n                            event.stopPropagation();\n                            event.preventDefault();\n                          }}\n                          tabIndex={-1}\n                          className={classNames(\n                            focusedIndex === index ? 'focused' : '',\n                            'ndl-timezone-picker-popover-item',\n                          )}\n                          onKeyDown={(event) => {\n                            if (event.key === 'Enter') {\n                              event.stopPropagation();\n                              handleOnClick(option.value);\n                            }\n                          }}\n                        >\n                          {option.label}\n                        </li>\n                      ))\n                    ) : (\n                      <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n                        No timezones found\n                      </li>\n                    )}\n                  </>\n                )}\n              </ul>\n            </div>\n          </FloatingFocusManager>\n        </ConditionalWrap>\n      )}\n    </>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqHE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAnBF,MAAa,kBAAkB,SAqBkB;;CArBlB,IAAA,EAC7B,YACA,SACA,YACA,YACA,OACA,OACA,UACA,WACA,SACA,OACA,MAAA,SAAO,UACP,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