@osrd-project/ui-core 0.0.83 → 0.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +382 -20
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2101 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.css +1202 -983
- package/package.json +16 -16
- package/dist/components/Button.d.ts +0 -16
- package/dist/components/Checkbox/Checkbox.d.ts +0 -9
- package/dist/components/Checkbox/CheckboxList.d.ts +0 -12
- package/dist/components/Checkbox/CheckboxTree.d.ts +0 -11
- package/dist/components/Checkbox/__tests__/utils.spec.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -4
- package/dist/components/Checkbox/type.d.ts +0 -14
- package/dist/components/Checkbox/utils.d.ts +0 -15
- package/dist/components/ComboBox/ComboBox.d.ts +0 -34
- package/dist/components/ComboBox/index.d.ts +0 -2
- package/dist/components/ComboBox/useDefaultComboBox.d.ts +0 -6
- package/dist/components/DatePicker/Calendar.d.ts +0 -10
- package/dist/components/DatePicker/CalendarPicker.d.ts +0 -19
- package/dist/components/DatePicker/DatePicker.d.ts +0 -28
- package/dist/components/DatePicker/__tests__/useCalendar.spec.d.ts +0 -9
- package/dist/components/DatePicker/__tests__/useCalendarPicker.spec.d.ts +0 -1
- package/dist/components/DatePicker/__tests__/useDatePicker.spec.d.ts +0 -1
- package/dist/components/DatePicker/__tests__/utils.spec.d.ts +0 -1
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/DatePicker/type.d.ts +0 -4
- package/dist/components/DatePicker/useCalendar.d.ts +0 -7
- package/dist/components/DatePicker/useCalendarPicker.d.ts +0 -9
- package/dist/components/DatePicker/useDatePicker.d.ts +0 -18
- package/dist/components/DatePicker/utils.d.ts +0 -113
- package/dist/components/Dialog.d.ts +0 -22
- package/dist/components/FieldWrapper.d.ts +0 -22
- package/dist/components/Hint.d.ts +0 -6
- package/dist/components/Input.d.ts +0 -27
- package/dist/components/InputModal.d.ts +0 -10
- package/dist/components/InputStatusIcon.d.ts +0 -9
- package/dist/components/Label.d.ts +0 -11
- package/dist/components/PasswordInput.d.ts +0 -21
- package/dist/components/RadioButton.d.ts +0 -9
- package/dist/components/RadioGroup.d.ts +0 -17
- package/dist/components/SegmentedControl.d.ts +0 -12
- package/dist/components/Select.d.ts +0 -12
- package/dist/components/Slider.d.ts +0 -9
- package/dist/components/StatusMessage.d.ts +0 -17
- package/dist/components/Table/Table.d.ts +0 -15
- package/dist/components/Table/tableAmbientThemes.d.ts +0 -22
- package/dist/components/TextArea.d.ts +0 -5
- package/dist/components/TimePicker.d.ts +0 -16
- package/dist/components/TokenInput.d.ts +0 -7
- package/dist/components/TolerancePicker/TolerancePicker.d.ts +0 -14
- package/dist/components/TolerancePicker/ToleranceRangeGrid.d.ts +0 -8
- package/dist/components/TolerancePicker/consts.d.ts +0 -4
- package/dist/hooks/__tests__/useOutsideClick.spec.d.ts +0 -1
- package/dist/hooks/useFocusByTab.d.ts +0 -11
- package/dist/hooks/useModalPosition.d.ts +0 -7
- package/dist/hooks/useOutsideClick.d.ts +0 -2
- package/dist/index.esm.js +0 -1462
- package/dist/index.esm.js.map +0 -1
- package/dist/theme.css.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["computeNewItemsTree","defaultComputeNewItemsTree","CalendarIcon","Popover"],"sources":["../src/components/Button.tsx","../src/hooks/useOutsideClick.tsx","../src/hooks/useFocusByTab.tsx","../src/components/Hint.tsx","../src/components/InputStatusIcon.tsx","../src/components/Label.tsx","../src/components/StatusMessage.tsx","../src/components/FieldWrapper.tsx","../src/components/Input.tsx","../src/components/ComboBox/ComboBox.tsx","../src/components/ComboBox/useDefaultComboBox.ts","../src/components/Checkbox/Checkbox.tsx","../src/components/Checkbox/CheckboxList.tsx","../src/components/Checkbox/utils.ts","../src/components/Checkbox/CheckboxTree.tsx","../src/hooks/usePopoverPosition.tsx","../src/components/InputPopover.tsx","../src/components/DatePicker/utils.ts","../src/components/DatePicker/useCalendar.ts","../src/components/DatePicker/Calendar.tsx","../src/components/DatePicker/useCalendarPicker.ts","../src/components/DatePicker/CalendarPicker.tsx","../src/components/DatePicker/useDatePicker.ts","../src/components/DatePicker/DatePicker.tsx","../src/components/Switch.tsx","../src/components/DurationInput/DurationInput.tsx","../src/components/PasswordInput.tsx","../src/components/RadioButton.tsx","../src/components/RadioGroup.tsx","../src/components/Select.tsx","../src/components/TextArea.tsx","../src/components/TimePicker.tsx","../src/components/Slider.tsx","../src/components/TolerancePicker/consts.ts","../src/components/TolerancePicker/ToleranceRangeGrid.tsx","../src/components/TolerancePicker/TolerancePicker.tsx","../src/components/TokenInput.tsx","../src/components/Table/tableAmbientThemes.ts","../src/components/Table/Table.tsx","../src/components/Dialog.tsx","../src/components/OptionGroup.tsx","../src/components/SegmentedControl.tsx"],"sourcesContent":["import React, { type ButtonHTMLAttributes, type ReactNode } from 'react';\n\nimport cx from 'classnames';\n\ntype ButtonVariant = 'Normal' | 'Cancel' | 'Quiet' | 'Destructive' | 'Primary';\ntype ButtonSize = 'large' | 'medium' | 'small';\n\nexport type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'> & {\n label: string;\n variant?: ButtonVariant;\n isLoading?: boolean;\n isDisabled?: boolean;\n leadingIcon?: ReactNode;\n counter?: number | null;\n size?: ButtonSize;\n dataTestID?: string;\n onClick: () => void;\n};\n\nconst Button = ({\n label,\n variant = 'Primary',\n isLoading = false,\n isDisabled = false,\n leadingIcon = null,\n counter = null,\n size = 'large',\n onClick,\n dataTestID,\n ...btnAttrs\n}: ButtonProps) => {\n const handleClick = () => {\n if (!isLoading && !isDisabled && onClick) {\n onClick();\n }\n };\n\n return (\n <button\n {...btnAttrs}\n className={cx(\n 'ui-button flex items-center',\n btnAttrs.className,\n variant.toLowerCase(),\n size.toLowerCase(),\n {\n loading: isLoading,\n }\n )}\n data-testid={dataTestID}\n onClick={handleClick}\n disabled={isDisabled || isLoading}\n >\n {leadingIcon && <span className=\"leading-icon mr-2\">{leadingIcon}</span>}\n {label}\n {counter !== null && <span className=\"counter ml-2\">{counter}</span>}\n </button>\n );\n};\n\nexport default Button;\n","import { useEffect, useEffectEvent } from 'react';\n\nconst useOutsideClick = (\n ref: React.RefObject<HTMLElement | null> | null,\n handler: (event: MouseEvent) => void\n) => {\n const handleClickOutside = useEffectEvent((event: MouseEvent) => {\n if (ref?.current && !ref.current.contains(event.target as Node)) {\n handler(event);\n }\n });\n\n useEffect(() => {\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, []);\n};\n\nexport default useOutsideClick;\n","import {\n useState,\n useCallback,\n type FocusEvent,\n type KeyboardEvent,\n type FocusEventHandler,\n type KeyboardEventHandler,\n} from 'react';\n\ntype UseFocusByTabProps = {\n onBlur?: FocusEventHandler<HTMLElement>;\n onKeyUp?: KeyboardEventHandler<HTMLElement>;\n};\n\nfunction useFocusByTab({ onBlur, onKeyUp }: UseFocusByTabProps) {\n const [isFocusByTab, setIsFocusByTab] = useState(false);\n\n const handleKeyUp = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Tab') setIsFocusByTab(true);\n onKeyUp?.(event);\n },\n [onKeyUp]\n );\n\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLElement>) => {\n setIsFocusByTab(false);\n onBlur?.(event);\n },\n [onBlur]\n );\n\n return { handleKeyUp, handleBlur, isFocusByTab };\n}\n\nexport default useFocusByTab;\n","import React from 'react';\n\ntype HintProps = {\n text: string;\n};\n\nconst Hint = ({ text }: HintProps) => <span className=\"ui-hint\">{text}</span>;\n\nexport default Hint;\n","import React from 'react';\n\nimport { Gear, CheckCircle, Info, Alert, Blocked } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nexport type status = 'success' | 'info' | 'error' | 'warning' | 'loading';\n\ntype InputStatusIconProps = {\n status: status;\n small?: boolean;\n className?: string;\n};\n\nconst InputStatusIcon = ({ status, small, className }: InputStatusIconProps) => {\n const size = small ? 'sm' : 'lg';\n return (\n <span className={cx('ui-status-icon', className, status)}>\n {status === 'loading' && <Gear size={size} />}\n {status === 'info' && <Info variant=\"fill\" size={size} />}\n {status === 'success' && <CheckCircle variant=\"fill\" size={size} />}\n {status === 'warning' && <Alert variant=\"fill\" size={size} />}\n {status === 'error' && <Blocked variant=\"fill\" size={size} />}\n </span>\n );\n};\n\nexport default InputStatusIcon;\n","import React from 'react';\n\nimport { RequiredInput } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\ntype LabelProps = {\n htmlFor: string;\n text: string;\n required?: boolean;\n hasHint?: boolean;\n disabled?: boolean;\n small: boolean;\n};\n\nconst Label = ({ htmlFor, text, required, hasHint, disabled, small = false }: LabelProps) => (\n <div className={cx('ui-label-wrapper', { 'has-hint': hasHint, small })}>\n {required && (\n <span className=\"required\">\n <RequiredInput />\n </span>\n )}\n <label className={cx('label', { disabled: disabled })} htmlFor={htmlFor}>\n {text}\n </label>\n </div>\n);\n\nexport default Label;\n","import React from 'react';\n\nimport { X } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport InputStatusIcon from './InputStatusIcon';\n\nexport type Status = 'success' | 'info' | 'error' | 'warning' | 'loading';\nexport type TooltipType = 'left' | 'right';\n\nexport type StatusWithMessage = {\n tooltip?: TooltipType;\n status: Status;\n message?: string;\n};\n\nexport type StatusMessageProps = {\n statusWithMessage: StatusWithMessage;\n showIcon?: boolean;\n small?: boolean;\n onClose?: () => void;\n testIdPrefix?: string;\n};\n\nconst StatusMessage = ({\n statusWithMessage,\n showIcon,\n small,\n onClose,\n testIdPrefix,\n}: StatusMessageProps) => {\n const { tooltip, status, message } = statusWithMessage;\n if (message === undefined) return null;\n\n return (\n <div\n className={cx({\n 'ui-status-message-wrapper': !tooltip,\n 'ui-status-message-wrapper-tooltip': tooltip,\n 'tooltip-left': tooltip === 'left',\n 'tooltip-right': tooltip === 'right',\n [status]: status,\n })}\n >\n {showIcon && <InputStatusIcon status={status} small={small} />}\n <span\n data-testid={testIdPrefix ? `${testIdPrefix}-${status}` : undefined}\n className={cx('status-message', { [status]: status })}\n >\n {message}\n </span>\n {status === 'info' && tooltip && (\n <button className=\"status-close\" onClick={onClose}>\n <X size=\"sm\" />\n </button>\n )}\n </div>\n );\n};\n\nexport default StatusMessage;\n","import React from 'react';\n\nimport cx from 'classnames';\n\nimport Hint from './Hint';\nimport InputStatusIcon from './InputStatusIcon';\nimport Label from './Label';\nimport StatusMessage, { type StatusWithMessage } from './StatusMessage';\n\nexport type FieldWrapperProps = {\n id: string;\n label?: string;\n hint?: string;\n required?: boolean;\n disabled?: boolean;\n statusWithMessage?: StatusWithMessage;\n statusIconPosition?: 'next-to-field' | 'before-status-message';\n /**\n * Input without any wrapper padding.\n * Should not be used with required or statusWithMessage with no tooltip.\n */\n narrow?: boolean;\n small?: boolean;\n children?: React.ReactNode;\n className?: string;\n onCloseStatusMessage?: () => void;\n};\n\nconst FieldWrapper = ({\n id,\n label,\n hint,\n required,\n disabled,\n statusWithMessage,\n statusIconPosition = 'next-to-field',\n narrow = false,\n small = false,\n className,\n children,\n onCloseStatusMessage,\n}: FieldWrapperProps) => {\n const statusClassname = statusWithMessage ? { [statusWithMessage.status]: true } : {};\n const defaultTooltip: StatusWithMessage['tooltip'] = narrow ? 'left' : undefined;\n\n if (narrow && required) {\n throw new Error('narrow should not be used with required for now. This breaks the input UI.');\n }\n\n return (\n <div className={cx('ui-feedback', statusClassname, className, { small, narrow })}>\n <div className=\"custom-field\">\n {/* LABEL AND HINT */}\n {label && (\n <Label\n htmlFor={id}\n text={label}\n required={required}\n hasHint={Boolean(hint)}\n disabled={disabled}\n small={small}\n />\n )}\n {hint && <Hint text={hint} />}\n\n {/* FIELD WRAPPER AND STATUS ICON */}\n <div className=\"field-and-status-icon\">\n {children}\n {statusWithMessage && statusIconPosition === 'next-to-field' && (\n <InputStatusIcon\n status={statusWithMessage.status}\n small={small}\n className=\"next-to-field\"\n />\n )}\n </div>\n\n {/* STATUS MESSAGE */}\n {statusWithMessage && (\n <StatusMessage\n testIdPrefix=\"status-message\"\n small={small}\n statusWithMessage={{\n ...statusWithMessage,\n tooltip: statusWithMessage?.tooltip ?? defaultTooltip,\n }}\n showIcon={statusIconPosition === 'before-status-message'}\n onClose={onCloseStatusMessage}\n />\n )}\n </div>\n </div>\n );\n};\n\nexport default FieldWrapper;\n","import React from 'react';\n\nimport cx from 'classnames';\n\nimport useFocusByTab from '../hooks/useFocusByTab';\nimport FieldWrapper, { type FieldWrapperProps } from './FieldWrapper';\n\ntype InputAffixProps = {\n value: InputAffixContent | InputAffixContentWithCallback;\n type: 'leading' | 'trailing';\n disabled: boolean;\n readOnly: boolean;\n};\n\nconst InputAffix = ({ value, type, disabled, readOnly }: InputAffixProps) => {\n const isContentWithCallback =\n typeof value === 'object' && value !== null && 'onClickCallback' in value;\n const spanContent = isContentWithCallback\n ? (value as InputAffixContentWithCallback).content\n : (value as InputAffixContent);\n const wrapperProps = isContentWithCallback\n ? { onClick: (value as InputAffixContentWithCallback).onClickCallback }\n : {};\n\n return (\n <div\n className={cx(`${type}-content-wrapper`, { disabled, 'read-only': readOnly })}\n {...wrapperProps}\n >\n <span className={`${type}-content`}>{spanContent}</span>\n </div>\n );\n};\n\ntype InputAffixContent = string | React.ReactNode;\n\ntype InputAffixContentWithCallback = {\n content: string | React.ReactNode;\n onClickCallback: () => void;\n};\n\ntype IconConfig = {\n icon: React.ReactNode;\n action: () => void;\n className?: string;\n testId?: string;\n};\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement> &\n Omit<FieldWrapperProps, 'children'> & {\n leadingContent?: InputAffixContent | InputAffixContentWithCallback;\n trailingContent?: InputAffixContent | InputAffixContentWithCallback;\n inputFieldWrapperClassname?: string;\n withIcons?: IconConfig[];\n testIdPrefix?: string;\n };\n\nconst DEFAULT_ICONS: IconConfig[] = [];\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n id,\n label,\n type,\n hint,\n leadingContent,\n trailingContent,\n required,\n disabled = false,\n readOnly = false,\n statusWithMessage,\n narrow,\n inputFieldWrapperClassname = '',\n small = false,\n withIcons = DEFAULT_ICONS,\n onKeyUp,\n onBlur,\n onCloseStatusMessage,\n testIdPrefix,\n ...rest\n },\n ref\n ) => {\n const { handleKeyUp, handleBlur, isFocusByTab } = useFocusByTab({ onBlur, onKeyUp });\n\n return (\n <FieldWrapper\n id={id}\n label={label}\n hint={hint}\n statusWithMessage={statusWithMessage}\n disabled={disabled}\n required={required}\n small={small}\n statusIconPosition={\n statusWithMessage?.tooltip || narrow ? 'before-status-message' : undefined\n }\n narrow={narrow}\n className={cx('ui-input-field-wrapper', inputFieldWrapperClassname)}\n onCloseStatusMessage={onCloseStatusMessage}\n >\n {leadingContent && (\n <InputAffix\n value={leadingContent}\n type=\"leading\"\n disabled={disabled}\n readOnly={readOnly}\n />\n )}\n <div\n className={cx('input-container', {\n 'focused-by-tab': isFocusByTab,\n })}\n >\n <input\n data-testid={testIdPrefix ? `${testIdPrefix}-input` : undefined}\n ref={ref}\n className={cx('input', {\n 'with-leading-only': leadingContent && !trailingContent,\n 'with-trailing-only': trailingContent && !leadingContent,\n 'with-leading-and-trailing': leadingContent && trailingContent,\n [`with-icons-${withIcons.length}`]: withIcons.length > 0,\n [statusWithMessage?.status || '']: !!statusWithMessage,\n })}\n id={id}\n type={type}\n disabled={disabled}\n readOnly={readOnly}\n onKeyUp={handleKeyUp}\n onBlur={handleBlur}\n {...rest}\n />\n <div\n className={cx('input-icons', {\n small,\n })}\n >\n {withIcons.map((iconConfig, index) => (\n <span\n key={index}\n className={iconConfig?.className}\n onClick={iconConfig.action}\n data-testid={\n iconConfig.testId ?? (testIdPrefix ? `${testIdPrefix}-icon` : undefined)\n }\n >\n {iconConfig.icon}\n </span>\n ))}\n </div>\n </div>\n {trailingContent && (\n <InputAffix\n value={trailingContent}\n type=\"trailing\"\n disabled={disabled}\n readOnly={readOnly}\n />\n )}\n </FieldWrapper>\n );\n }\n);\nInput.displayName = 'Input';\nexport default Input;\n","import React, {\n type ChangeEventHandler,\n type FocusEventHandler,\n type KeyboardEventHandler,\n type ReactNode,\n useMemo,\n useRef,\n useState,\n useCallback,\n} from 'react';\n\nimport { ChevronDown, XCircle } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport useOutsideClick from '../../hooks/useOutsideClick';\nimport Input, { type InputProps } from '../Input';\n\nexport type ComboBoxProps<T> = Omit<InputProps, 'value' | 'onChange'> & {\n value?: T;\n suggestions: Array<T>;\n customLabel?: ReactNode;\n numberOfSuggestionsToShow?: number;\n getSuggestionLabel: (option: T) => string;\n onSelectSuggestion: (option: T | undefined) => void;\n resetSuggestions: () => void;\n testIdPrefix?: string;\n renderListElementComponent?: (params: {\n suggestion: T;\n index: number;\n isActive: boolean;\n isSelected: boolean;\n }) => ReactNode;\n renderFooterItem?: () => ReactNode;\n onChange: (inputValue: string) => void;\n\n allowCustomValue?: boolean;\n onAddCustomValue?: (value: string) => void;\n addCustomValueLabel?: string;\n\n emptyValue?: T;\n};\n\n/**\n * ComboBox component\n *\n * You can use the hook useDefaultComboBox to get the default behavior.\n * See the stories.\n *\n * When `allowCustomValue` is true, an option appears at the bottom of the dropdown\n * when the typed value doesn't match any existing suggestion.\n * Defocusing without selecting cancels the input.\n *\n * When `emptyValue` is given (ex: a \"None\" option), it is displayed when there is no value,\n * so the field is never left empty. The clear icon on a real value goes back to `emptyValue`.\n */\nconst ComboBox = <T,>({\n suggestions,\n customLabel,\n numberOfSuggestionsToShow = 5,\n value,\n small,\n getSuggestionLabel,\n onChange,\n onSelectSuggestion,\n resetSuggestions,\n testIdPrefix,\n renderListElementComponent,\n renderFooterItem,\n allowCustomValue = false,\n onAddCustomValue,\n addCustomValueLabel,\n emptyValue,\n ...inputProps\n}: ComboBoxProps<T>) => {\n const [activeSuggestionIndex, setActiveSuggestionIndex] = useState(-1);\n const displayedValue = value ?? emptyValue;\n const suggestionLabel = displayedValue ? getSuggestionLabel(displayedValue) : '';\n const [inputValue, setInputValue] = useState(suggestionLabel);\n\n const [prevSuggestionLabel, setPrevSuggestionLabel] = useState(suggestionLabel);\n if (suggestionLabel !== prevSuggestionLabel) {\n setPrevSuggestionLabel(suggestionLabel);\n setInputValue(suggestionLabel);\n }\n\n const [isInputFocused, setIsInputFocused] = useState(false);\n const suggestionRefs = useRef<(HTMLLIElement | null)[]>([]);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const wrapperRef = useRef<HTMLInputElement>(null);\n\n const removeFocus = useCallback(() => {\n setIsInputFocused(false);\n setActiveSuggestionIndex(-1);\n setTimeout(() => {\n inputRef.current?.blur();\n }, 0);\n resetSuggestions();\n }, [resetSuggestions]);\n\n const closeSuggestions = useCallback(() => {\n setInputValue(displayedValue ? getSuggestionLabel(displayedValue) : '');\n removeFocus();\n }, [displayedValue, getSuggestionLabel, removeFocus]);\n\n const focusInput = useCallback(() => {\n if (isInputFocused) {\n closeSuggestions();\n } else {\n inputRef.current?.focus();\n }\n }, [inputRef, isInputFocused, closeSuggestions]);\n\n const normalizedInputValue = useMemo(() => inputValue.trim().toLowerCase(), [inputValue]);\n\n const suggestionsByLabel = useMemo(() => {\n const map = new Map<string, T>();\n for (const suggestion of suggestions) {\n map.set(getSuggestionLabel(suggestion).trim().toLowerCase(), suggestion);\n }\n return map;\n }, [suggestions, getSuggestionLabel]);\n\n const showAddCustomValue = useMemo(() => {\n if (!allowCustomValue || !normalizedInputValue) return false;\n\n return !suggestionsByLabel.has(normalizedInputValue);\n }, [allowCustomValue, normalizedInputValue, suggestionsByLabel]);\n\n const showSuggestions = useMemo(\n () => isInputFocused && (suggestions.length > 0 || showAddCustomValue) && !inputProps.disabled,\n [isInputFocused, suggestions.length, showAddCustomValue, inputProps.disabled]\n );\n\n // behavior\n const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n onChange?.(e.currentTarget.value);\n setInputValue(e.currentTarget.value);\n };\n\n const selectSuggestion = (selectedSuggestion: T) => {\n onSelectSuggestion(selectedSuggestion);\n setInputValue(getSuggestionLabel(selectedSuggestion));\n removeFocus();\n };\n\n const confirmCustomValue = () => {\n const trimmed = inputValue.trim();\n if (!trimmed) return;\n onAddCustomValue?.(trimmed);\n removeFocus();\n };\n\n const onFieldBlur = () => {\n const exactSuggestion = suggestionsByLabel.get(normalizedInputValue);\n if (activeSuggestionIndex === -1 && !showAddCustomValue) {\n if (normalizedInputValue === '') {\n onSelectSuggestion(undefined);\n } else if (exactSuggestion) {\n onSelectSuggestion(exactSuggestion);\n } else {\n onAddCustomValue?.(inputValue);\n }\n }\n closeSuggestions();\n };\n\n const totalItems = suggestions.length + (showAddCustomValue ? 1 : 0);\n const customValueIndex = showAddCustomValue ? suggestions.length : -1;\n\n const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = (e) => {\n const confirmSelected = () => {\n if (showAddCustomValue && activeSuggestionIndex === customValueIndex) {\n confirmCustomValue();\n }\n\n const suggestion = suggestions.at(activeSuggestionIndex);\n if (suggestion) {\n selectSuggestion(suggestion);\n }\n };\n\n switch (e.key) {\n case 'ArrowDown': {\n setActiveSuggestionIndex((prev) => {\n const newIndex = prev < totalItems - 1 ? prev + 1 : prev;\n suggestionRefs.current[newIndex]?.scrollIntoView({ block: 'nearest' });\n return newIndex;\n });\n break;\n }\n case 'ArrowUp': {\n setActiveSuggestionIndex((prev) => {\n const newIndex = prev > 0 ? prev - 1 : prev;\n suggestionRefs.current[newIndex]?.scrollIntoView({ block: 'nearest' });\n return newIndex;\n });\n break;\n }\n case 'Enter': {\n e.preventDefault();\n\n if (activeSuggestionIndex >= 0) {\n confirmSelected();\n } else {\n // No item selected\n\n const exactSuggestion = suggestionsByLabel.get(normalizedInputValue);\n if (exactSuggestion) {\n selectSuggestion(exactSuggestion);\n } else if (showAddCustomValue) {\n confirmCustomValue();\n } else {\n onAddCustomValue?.(inputValue);\n }\n }\n break;\n }\n case 'Tab': {\n if (activeSuggestionIndex >= 0) {\n confirmSelected();\n }\n onFieldBlur();\n\n break;\n }\n case 'Escape': {\n onFieldBlur();\n break;\n }\n default:\n break;\n }\n };\n\n const handleInputFocus: FocusEventHandler<HTMLInputElement> = (e) => {\n e.stopPropagation();\n setIsInputFocused(true);\n };\n\n const clearInput = useCallback(() => {\n // A real value is selected: the clear icon goes back to emptyValue\n if (emptyValue && value) {\n onSelectSuggestion(undefined);\n resetSuggestions();\n return;\n }\n setInputValue('');\n onChange?.('');\n resetSuggestions();\n setIsInputFocused(true);\n inputRef.current?.focus();\n }, [emptyValue, value, onSelectSuggestion, resetSuggestions, onChange]);\n\n useOutsideClick(showSuggestions || isInputFocused ? wrapperRef : null, onFieldBlur);\n\n const inputIcons = useMemo(() => {\n if (inputProps.readOnly || inputProps.disabled) return undefined;\n return [\n // Conditionally include the clear icon only when input is not empty\n ...(inputValue\n ? [\n {\n icon: <XCircle variant=\"fill\" />,\n action: clearInput,\n className: 'clear-icon',\n testId: 'clear-icon',\n },\n ]\n : []),\n // chevron of the select\n {\n icon: <ChevronDown size={small ? 'sm' : 'lg'} />,\n action: focusInput,\n className: cx('chevron-icon', {\n disabled: inputProps.disabled,\n open: isInputFocused,\n }),\n },\n ];\n }, [\n inputProps.readOnly,\n inputProps.disabled,\n clearInput,\n inputValue,\n small,\n focusInput,\n isInputFocused,\n ]);\n\n return (\n <div\n data-testid={testIdPrefix ? testIdPrefix : undefined}\n className=\"ui-combo-box\"\n style={{ '--number-of-suggestions': numberOfSuggestionsToShow } as React.CSSProperties}\n ref={wrapperRef}\n >\n {customLabel && <label htmlFor={inputProps.id}>{customLabel}</label>}\n <Input\n testIdPrefix={inputProps.id}\n {...inputProps}\n ref={inputRef}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={handleInputFocus}\n withIcons={inputIcons}\n small={small}\n />\n {showSuggestions && (\n <ul\n className=\"suggestions-list\"\n data-testid={testIdPrefix ? `${testIdPrefix}-list` : undefined}\n onMouseLeave={() => setActiveSuggestionIndex(-1)}\n tabIndex={-1}\n >\n {suggestions.map((suggestion, index) => (\n <li\n ref={(el) => {\n if (suggestionRefs) {\n suggestionRefs.current[index] = el;\n }\n }}\n key={`${getSuggestionLabel(suggestion)}-${index}`}\n data-testid={testIdPrefix ? `${testIdPrefix}-item` : undefined}\n className={cx('suggestion-item', {\n active: index === activeSuggestionIndex,\n selected:\n displayedValue &&\n getSuggestionLabel(displayedValue) === getSuggestionLabel(suggestion),\n small,\n 'suggestion-item--custom': renderListElementComponent,\n })}\n onClick={() => selectSuggestion(suggestion)}\n onMouseEnter={() => setActiveSuggestionIndex(index)}\n >\n {renderListElementComponent\n ? renderListElementComponent({\n suggestion,\n index,\n isActive: index === activeSuggestionIndex,\n isSelected:\n !!displayedValue &&\n getSuggestionLabel(displayedValue) === getSuggestionLabel(suggestion),\n })\n : getSuggestionLabel(suggestion)}\n </li>\n ))}\n\n {showAddCustomValue && (\n <li\n ref={(el) => {\n suggestionRefs.current[suggestions.length] = el;\n }}\n className={cx('suggestion-item', 'suggestion-item--add-custom', {\n active: activeSuggestionIndex === customValueIndex,\n small,\n })}\n onClick={confirmCustomValue}\n onMouseEnter={() => setActiveSuggestionIndex(customValueIndex)}\n data-testid={testIdPrefix ? `${testIdPrefix}-add-custom` : undefined}\n >\n {addCustomValueLabel ?? `Add \"${inputValue.trim()}\"`}\n </li>\n )}\n\n {renderFooterItem && renderFooterItem()}\n </ul>\n )}\n </div>\n );\n};\n\nexport default ComboBox;\n","import { useCallback, useMemo, useState } from 'react';\n\n/**\n * Removes the accents and lowercases the input.\n */\nexport const normalizeString = (str: string) =>\n str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n\n/**\n * Filter the options, keeping only the one that have a suggestion label that contain\n * the query, and sorting them so the one that starts with the query come first.\n */\nexport const defaultFilterSuggestions = <T>(\n labels: { label: string; suggestion: T }[],\n query: string\n) => {\n const input = normalizeString(query).trim();\n if (!input) {\n return labels.map(({ suggestion }) => suggestion);\n }\n\n const getSuggestionScore = (label: string) => {\n if (label.startsWith(input)) {\n return 2;\n }\n if (label.includes(input)) {\n return 1;\n }\n return 0;\n };\n\n return labels\n .map(({ label, suggestion }) => ({\n suggestion,\n score: getSuggestionScore(label),\n }))\n .filter(({ score }) => score > 0)\n .sort(({ score: scoreA }, { score: scoreB }) => scoreB - scoreA)\n .map(({ suggestion }) => suggestion);\n};\n\n/**\n * Create relevant props for a basic combo box with suggestions, ready to be spread in a `ComboBox`\n * component. Suggestions are filtered and ordered using a very simple algorithm: options with\n * a labels that starts with the query are shown first, and other options that contains the query\n * follows, trimming spaces, accents and ignoring case.\n *\n * The second parameter, `getSuggestionLabel`, should be stable to prevent rerender and useless\n * recomputations (see `useCallback`).\n */\nconst useDefaultComboBox = <T>(suggestions: T[], getSuggestionLabel: (suggestion: T) => string) => {\n const [query, setQuery] = useState('');\n\n const labels = useMemo(\n () =>\n suggestions.map((suggestion: T) => ({\n label: normalizeString(getSuggestionLabel(suggestion)),\n suggestion,\n })),\n [suggestions, getSuggestionLabel]\n );\n\n const filteredSuggestions = useMemo(\n () => defaultFilterSuggestions(labels, query),\n [labels, query]\n );\n\n const onChange = useCallback((newValue: string) => {\n setQuery(newValue);\n }, []);\n\n const resetSuggestions = useCallback(() => {\n setQuery('');\n }, []);\n\n return { suggestions: filteredSuggestions, onChange, resetSuggestions };\n};\n\nexport default useDefaultComboBox;\n","import React, { type InputHTMLAttributes, type MouseEvent } from 'react';\n\nimport cx from 'classnames';\n\nexport type CheckboxProps = React.PropsWithChildren<\n Omit<InputHTMLAttributes<HTMLInputElement>, 'children'> & {\n label?: string;\n small?: boolean;\n hint?: string;\n isIndeterminate?: boolean;\n ref?: React.RefObject<HTMLInputElement | null>;\n }\n>;\n\nconst Checkbox = ({\n label,\n small,\n hint,\n disabled,\n checked,\n readOnly,\n isIndeterminate = false,\n onClick,\n children,\n ref,\n ...rest\n}: CheckboxProps) => {\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n onClick?.(e);\n }\n };\n return (\n <label\n className={cx('ui-checkbox', { small, 'with-label': label || children, 'with-hint': hint })}\n >\n <input\n // Browsers' read-only attribute is not working on checkboxes. See: https://stackoverflow.com/a/70375659\n className={cx({ 'read-only': readOnly })}\n type=\"checkbox\"\n checked={checked}\n disabled={disabled}\n ref={(input) => {\n if (input) {\n input.indeterminate = isIndeterminate;\n }\n if (ref) {\n ref.current = input;\n }\n }}\n onClick={handleClick}\n {...rest}\n />\n {label && <div className=\"label\">{label}</div>}\n {children && <div className=\"label\">{children}</div>}\n {hint && <span className=\"hint\">{hint}</span>}\n </label>\n );\n};\n\nexport default Checkbox;\n","import React from 'react';\n\nimport cx from 'classnames';\n\nimport Checkbox from './Checkbox';\nimport { type CheckboxTreeItem } from './type';\n\nexport type CheckboxListProps = {\n items: CheckboxTreeItem[];\n onClickItem: (e: React.MouseEvent<HTMLInputElement>, item: CheckboxTreeItem) => void;\n small?: boolean;\n label?: string;\n readOnly?: boolean;\n disabled?: boolean;\n};\n\nconst CheckboxList = (checkBoxListprops: CheckboxListProps) => {\n const {\n items,\n onClickItem,\n small = false,\n label = '',\n readOnly = false,\n disabled = false,\n } = checkBoxListprops;\n\n return (\n <>\n <span className=\"checkbox-list-label\">{label}</span>\n <ul className={cx('checkbox-list', { small: small })}>\n {items.map((item) => {\n const { id, props, items: subItems } = item;\n return (\n <li key={id}>\n <Checkbox\n small={small}\n onClick={(e) => onClickItem(e, item)}\n checked={item.props.checked}\n isIndeterminate={item.props.isIndeterminate}\n {...props}\n disabled={disabled}\n readOnly={readOnly}\n />\n {subItems && <CheckboxList {...checkBoxListprops} items={subItems} />}\n </li>\n );\n })}\n </ul>\n </>\n );\n};\n\nexport default CheckboxList;\n","import {\n CheckboxState,\n type CheckboxTreeItem,\n type ChildrenParentMap,\n type ItemStates,\n type ParentChildrenMap,\n} from './type';\n\nexport const traverseTree = (\n items: CheckboxTreeItem[],\n onVisit: (item: CheckboxTreeItem, parent?: CheckboxTreeItem) => void,\n parent?: CheckboxTreeItem\n) => {\n items.forEach((item) => {\n onVisit(item, parent);\n\n if (item.items && item.items.length > 0) {\n traverseTree(item.items, onVisit, item);\n }\n });\n};\n\nexport const buildRelationshipMaps = (items: CheckboxTreeItem[]) => {\n const parentChildrenMap: ParentChildrenMap = {};\n const childrenParentMap: ChildrenParentMap = {};\n\n traverseTree(items, (item, parent) => {\n if (parent?.id !== undefined) {\n if (!parentChildrenMap[parent.id]) {\n parentChildrenMap[parent.id] = [];\n }\n parentChildrenMap[parent.id].push(item.id);\n childrenParentMap[item.id] = parent.id;\n }\n });\n\n return { parentChildrenMap, childrenParentMap };\n};\n\nexport const updateItemAndDescendantsStates = (\n itemId: number,\n newItemStates: CheckboxState,\n parentChildrenMap: ParentChildrenMap,\n itemStates: ItemStates\n) => {\n itemStates[itemId] = newItemStates;\n parentChildrenMap[itemId]?.forEach((child) =>\n updateItemAndDescendantsStates(child, newItemStates, parentChildrenMap, itemStates)\n );\n};\n\nexport const updateAscendantsStates = (\n childId: number,\n itemStates: ItemStates,\n relastionShipMap: {\n parentChildrenMap: ParentChildrenMap;\n childrenParentMap: ChildrenParentMap;\n }\n) => {\n const { parentChildrenMap, childrenParentMap } = relastionShipMap;\n const parentId = childrenParentMap[childId];\n if (parentId === undefined) return;\n\n const siblings = parentChildrenMap[parentId];\n\n const siblingStates = siblings.map((siblingId) => itemStates[siblingId]);\n\n let parentState: CheckboxState;\n if (siblingStates.every((state) => state === CheckboxState.CHECKED)) {\n parentState = CheckboxState.CHECKED;\n } else if (siblingStates.every((state) => state === CheckboxState.UNCHECKED)) {\n parentState = CheckboxState.UNCHECKED;\n } else {\n parentState = CheckboxState.INDETERMINATE;\n }\n itemStates[parentId] = parentState;\n updateAscendantsStates(parentId, itemStates, { parentChildrenMap, childrenParentMap });\n};\n\nexport const updateItemStates = (\n itemsTree: CheckboxTreeItem[],\n initialItemStates: ItemStates,\n clickedItemId: number\n): ItemStates => {\n const newItemStates = { ...initialItemStates };\n const newClickedItemState =\n newItemStates[clickedItemId] === CheckboxState.CHECKED\n ? CheckboxState.UNCHECKED\n : CheckboxState.CHECKED;\n const { parentChildrenMap, childrenParentMap } = buildRelationshipMaps(itemsTree);\n updateItemAndDescendantsStates(\n clickedItemId,\n newClickedItemState,\n parentChildrenMap,\n newItemStates\n );\n updateAscendantsStates(clickedItemId, newItemStates, { parentChildrenMap, childrenParentMap });\n\n return newItemStates;\n};\n\nexport const computeInitialItemStates = (items: CheckboxTreeItem[]): ItemStates => {\n const itemStates: ItemStates = {};\n traverseTree(items, (item) => {\n if (item.props.isIndeterminate) itemStates[item.id] = CheckboxState.INDETERMINATE;\n else itemStates[item.id] = item.props.checked ? CheckboxState.CHECKED : CheckboxState.UNCHECKED;\n });\n return itemStates;\n};\n\nexport const applyStateToItem = (itemsTree: CheckboxTreeItem[], itemStates: ItemStates) => {\n const clonedItemsTree = JSON.parse(JSON.stringify(itemsTree));\n traverseTree(clonedItemsTree, (item) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { checked, isIndeterminate, ...otherProps } = item.props;\n item.props = otherProps;\n if (itemStates[item.id] === CheckboxState.INDETERMINATE) item.props.isIndeterminate = true;\n else if (itemStates[item.id] === CheckboxState.CHECKED) item.props.checked = true;\n else item.props.checked = false;\n });\n\n return clonedItemsTree;\n};\n\nexport const computeNewItemsTree = (\n itemsTree: CheckboxTreeItem[],\n clickedItem: CheckboxTreeItem\n): CheckboxTreeItem[] => {\n const initialItemStates = computeInitialItemStates(itemsTree);\n const updatedItemStates = updateItemStates(itemsTree, initialItemStates, clickedItem.id);\n return applyStateToItem(itemsTree, updatedItemStates);\n};\n","import React from 'react';\n\nimport FieldWrapper, { type FieldWrapperProps } from '../FieldWrapper';\nimport CheckboxList from './CheckboxList';\nimport { type CheckboxTreeItem } from './type';\nimport { computeNewItemsTree as defaultComputeNewItemsTree } from './utils';\n\nexport type CheckboxesTreeProps = Omit<FieldWrapperProps, 'children'> & {\n readOnly?: boolean;\n items: CheckboxTreeItem[];\n onChange?: (newItems: CheckboxTreeItem[], item: CheckboxTreeItem) => void;\n computeNewItemsTree?: (\n prevItemsTree: CheckboxTreeItem[],\n item: CheckboxTreeItem\n ) => CheckboxTreeItem[];\n};\n\nconst CheckboxesTree = ({\n items,\n small,\n id,\n label,\n hint,\n statusWithMessage,\n disabled,\n required,\n readOnly,\n onChange,\n computeNewItemsTree,\n}: CheckboxesTreeProps) => {\n const handleClick = (e: React.MouseEvent<HTMLInputElement>, item: CheckboxTreeItem) => {\n const newItems = computeNewItemsTree\n ? computeNewItemsTree(items, item)\n : defaultComputeNewItemsTree(items, item);\n onChange?.(newItems, item);\n item.props.onClick?.(e);\n };\n\n return (\n <FieldWrapper\n id={id}\n label={label}\n hint={hint}\n statusWithMessage={statusWithMessage}\n statusIconPosition=\"before-status-message\"\n disabled={disabled}\n required={required}\n small={small}\n >\n <CheckboxList\n small={small}\n items={items}\n disabled={disabled}\n readOnly={readOnly}\n onClickItem={handleClick}\n />\n </FieldWrapper>\n );\n};\n\nexport default CheckboxesTree;\n","import { useState, useEffect, useCallback } from 'react';\n\nexport const usePopoverPosition = (\n inputRef: React.RefObject<HTMLElement | null>,\n popoverRef: React.RefObject<HTMLElement | null>,\n verticalOffset: number = -3, // Default offset below the input\n align: 'center' | 'start' = 'center',\n verticalAnchor: 'bottom' | 'top' = 'bottom'\n) => {\n const [popoverPosition, setPopoverPosition] = useState<{ top: number; left: number }>({\n top: 0,\n left: 0,\n });\n\n const calculatePosition = useCallback(() => {\n if (inputRef.current) {\n const inputRect = inputRef.current.getBoundingClientRect();\n const popoverWidth = popoverRef.current?.getBoundingClientRect()?.width ?? 0;\n\n const anchorY = verticalAnchor === 'top' ? inputRect.top : inputRect.bottom;\n const top = anchorY + window.scrollY + verticalOffset;\n\n const isCentered = align === 'center';\n const popoverViewportLeft =\n inputRect.left + window.scrollX + (isCentered ? inputRect.width / 2 : 0);\n // When centered, the popover is shifted by half its width\n const offsetX = isCentered ? popoverWidth / 2 : 0;\n\n // Keep popover inside the viewport bounds horizontally\n const left = Math.max(\n offsetX,\n Math.min(popoverViewportLeft, window.innerWidth - popoverWidth + offsetX)\n );\n\n setPopoverPosition({ top, left });\n }\n }, [inputRef, popoverRef, verticalOffset, align, verticalAnchor]);\n\n useEffect(() => {\n const handleResizeScroll = () => calculatePosition();\n window.addEventListener('resize', handleResizeScroll);\n // TODO: Get rid of this as soon as we can, using CSS native anchoring\n window.addEventListener('scroll', handleResizeScroll, true);\n return () => {\n window.removeEventListener('resize', handleResizeScroll);\n window.removeEventListener('scroll', handleResizeScroll, true);\n };\n }, [calculatePosition]);\n\n return { popoverPosition, calculatePosition };\n};\n","import React, { useEffect, useRef } from 'react';\n\nimport { X } from '@osrd-project/ui-icons';\n\nimport useOutsideClick from '../hooks/useOutsideClick';\nimport { usePopoverPosition } from '../hooks/usePopoverPosition';\n\ntype PopoverProps = {\n inputRef: React.RefObject<HTMLInputElement | null>;\n isOpen: boolean;\n onClose: () => void;\n children: React.ReactNode;\n verticalOffset?: number;\n testIdPrefix?: string;\n};\n\nconst InputPopover = ({\n inputRef,\n isOpen,\n onClose,\n children,\n verticalOffset,\n testIdPrefix,\n}: PopoverProps) => {\n const popoverRef = useRef<HTMLDivElement>(null);\n const { popoverPosition, calculatePosition } = usePopoverPosition(\n inputRef,\n popoverRef,\n verticalOffset\n );\n\n useEffect(() => {\n if (isOpen && popoverRef.current && !popoverRef.current.matches(':popover-open')) {\n popoverRef.current.showPopover();\n calculatePosition();\n }\n }, [isOpen, calculatePosition]);\n\n useOutsideClick(popoverRef, onClose);\n\n if (!isOpen) return null;\n\n return (\n <div\n ref={popoverRef}\n className=\"input-popover\"\n style={{ top: popoverPosition.top, left: popoverPosition.left }}\n popover=\"manual\"\n >\n <button\n data-testid={testIdPrefix ? `${testIdPrefix}-close-button` : undefined}\n className=\"close-button\"\n onClick={onClose}\n >\n <X size=\"lg\" />\n </button>\n {children}\n </div>\n );\n};\n\nexport default InputPopover;\n","import { type DatePickerProps, type CalendarSlot } from './index';\n\nexport const INVALID_SELECTED_SLOT_ERROR =\n 'Invalid selectedSlot: If start and end are defined, the start date must be before the end date.';\nexport const INVALID_SELECTABLE_SLOT_ERROR =\n 'Invalid selectableSlot: If start and end are defined, the start date must be before the end date.';\nexport const INVALID_SELECTED_SLOT_BASED_ON_SELECTABLE_SLOT_ERROR =\n 'selectedSlot must be within selectableSlot';\nexport const INVALID_INITIAL_DATE_ERROR = 'initialDate must be within selectableSlot';\n\nexport const containsOnlyNumbersAndSlashes = (s: string) => /^[0-9/]+$/.test(s);\n\n/**\n * Normalize the given date to midnight\n * @param date The date to normalize\n * @returns The normalized date\n */\nexport function normalizeDate(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\n/**\n * Check if the given slot is valid\n * @param slot The slot to check\n * @returns True if the slot is valid, false otherwise\n */\nexport function isValidSlot(slot: CalendarSlot) {\n if (slot.start && slot.end) {\n return normalizeDate(slot.start).getTime() <= normalizeDate(slot.end).getTime();\n }\n return true;\n}\n\n/**\n * Get the dates from the previous month that are in the first week of the current month\n * @param month The month of the current date\n * @param fullYear The year of the current date\n * @returns An array of dates from the previous month that are in the first week of the current month\n */\nexport function getDatesFromPreviousMonthInFirstWeek(month: number, fullYear: number): Date[] {\n const firstDayOfMonth = new Date(fullYear, month, 1);\n const firstDayOfWeek = firstDayOfMonth.getDay();\n\n // if the first day of the week is Monday, we don't need to return any dates from the previous month\n if (firstDayOfWeek === 1) {\n return [];\n }\n\n const daysFromPrevMonth = firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;\n const lastDayPrevMonth = new Date(fullYear, month, 0);\n\n const dates: Date[] = [];\n for (let i = 0; i < daysFromPrevMonth; i++) {\n const day = lastDayPrevMonth.getDate() - i;\n dates.unshift(new Date(lastDayPrevMonth.getFullYear(), lastDayPrevMonth.getMonth(), day));\n }\n\n return dates;\n}\n\n/**\n * Get the dates from the next month that are in the last week of the current month\n * @param month The month of the current date\n * @param fullYear The year of the current date\n * @returns An array of dates from the next month that are in the last week of the current month\n */\nexport function getDatesFromNextMonthInLastWeek(month: number, fullYear: number) {\n const lastDayOfMonth = new Date(fullYear, month + 1, 0);\n const lastDayOfWeek = lastDayOfMonth.getDay();\n const daysFromNextMonth = (7 - lastDayOfWeek) % 7;\n\n if (daysFromNextMonth === 0) {\n return [];\n }\n\n const nextMonth = new Date(fullYear, month + 1, 1);\n\n const dates: Date[] = [];\n for (let i = 0; i < daysFromNextMonth; i++) {\n const day = i + 1;\n dates.push(new Date(nextMonth.getFullYear(), nextMonth.getMonth(), day));\n }\n\n return dates;\n}\n\n/**\n * Get all the dates in the month of the given date\n * @param month The month of the current date\n * @param fullYear The year of the current date\n * @returns An array of all the dates in the month of the given date\n */\nexport function getAllDatesInMonth(month: number, fullYear: number) {\n const lastDayOfMonth = new Date(fullYear, month + 1, 0);\n const totalDaysInMonth = lastDayOfMonth.getDate();\n\n const dates: Date[] = [];\n for (let day = 1; day <= totalDaysInMonth; day++) {\n dates.push(new Date(fullYear, month, day));\n }\n\n return dates;\n}\n\n/**\n * Check if the given dates are the same day\n * @param date1 The first date\n * @param date2 The second date\n * @returns True if the dates are the same day, false otherwise\n */\nexport function isSameDay(date1: Date | null, date2: Date | null) {\n if (!date1 || !date2) {\n return false;\n }\n\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n}\n\n/**\n * Check if the given date is within the given slot\n * if the slot is not provided, the date is considered to be within the slot\n * if a boundary of the slot is not provided, it's considered to be an open boundary\n * @param date The date to check\n * @param slot The slot to check\n * @returns True if the date is within the slot, false otherwise\n */\nexport function isWithinInterval(date: Date, slot?: CalendarSlot) {\n if (!slot) return true;\n\n const normalizedDate = normalizeDate(date);\n const normalizedStart = slot.start ? normalizeDate(slot.start) : undefined;\n const normalizedEnd = slot.end ? normalizeDate(slot.end) : undefined;\n\n const isAfterStart = normalizedStart ? normalizedDate >= normalizedStart : true;\n const isBeforeEnd = normalizedEnd ? normalizedDate <= normalizedEnd : true;\n\n return isAfterStart && isBeforeEnd;\n}\n\n/**\n * Generates a list of dates, each representing the start of a month,\n * starting from a given date and continuing for a specified number of months.\n * This function correctly handles year rollover.\n * @param startDate - The date from which to start generating month start dates.\n * @param monthsCount - The number of month start dates to generate.\n * @returns An array of Dates, each set to the first day of consecutive months starting from startDate.\n */\nexport function generateSequentialDates(startDate: Date, monthsCount: number) {\n const dates = [];\n for (let i = 0; i < monthsCount; i++) {\n const date = new Date(startDate);\n date.setMonth(startDate.getMonth() + i, 1);\n dates.push(new Date(date.getFullYear(), date.getMonth(), 1));\n }\n return dates;\n}\n/**\n * Format the given date as a string in the format 'dd/mm/yy'.\n * @param date The date to format\n * @returns The formatted date string\n */\nexport function formatDateString(date?: Date | null) {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = String(date.getFullYear()).slice(-2);\n return `${day}/${month}/${year}`;\n}\n\n/**\n * Handles the logic for when a day is clicked on the calendar.\n *\n * @param clickedDate - The date that was clicked.\n * @param isRangeMode - Whether the calendar is in range mode.\n * @param prevSelectedSlot - The previously selected slot.\n * Spec 1: If the user clicks on a single date, that date is set as the start date of the slot.\n * Spec 2: If the user selects the same end date as the start date, clear the slot\n * Spec 3: If the user clicks on a date that is before the currently selected start date, the new date becomes the start date and the previous start date becomes the end date.\n * Spec 4: If the user clicks on a date that is after the currently selected start date, that date becomes the end date of the slot.\n * Spec 5: If a slot is already defined (i.e., both start and end dates are defined) and the user clicks on a new date, the existing slot is cleared and the new date becomes the start date of the new slot.\n */\nexport function computeNewSelectedSlot(\n clickedDate: Date,\n prevSelectedSlot: CalendarSlot | undefined\n): CalendarSlot | undefined {\n if (!prevSelectedSlot || prevSelectedSlot?.start === null) {\n // Spec 1\n\n return { start: clickedDate, end: null };\n } else if (!prevSelectedSlot.end) {\n if (normalizeDate(clickedDate).getTime() === normalizeDate(prevSelectedSlot.start).getTime()) {\n // Spec 2\n return undefined;\n } else if (normalizeDate(clickedDate) < normalizeDate(prevSelectedSlot.start)) {\n // Spec 3\n return { start: clickedDate, end: prevSelectedSlot.start };\n } else {\n // Spec 4\n return { start: prevSelectedSlot.start, end: clickedDate };\n }\n } else {\n // Spec 5\n return { start: clickedDate, end: null };\n }\n}\n\n/**\n * Format the selected slot to a string that can be displayed in the input field.\n * @param slot The new selected slot\n * @returns The formatted string\n * Spec 0: If the slot is undefined, return an empty string.\n * Spec 1: If the start and end dates are the same, return the formatted date of the start date.\n * Spec 2: If the start and end dates are in the same year, return the formatted start date without the year and end date.\n * Spec 3: If the start and end dates are in different years, return the formatted start date and end date with the year.\n */\nexport function formatSlotToInputValue(slot: CalendarSlot | undefined) {\n let formattedDate = '';\n if (slot) {\n const { start, end } = slot;\n\n if (isSameDay(start, end)) {\n formattedDate = formatDateString(start);\n } else {\n let formattedStartDate = formatDateString(start);\n\n if (start && end && start.getFullYear() === end.getFullYear()) {\n formattedStartDate = formattedStartDate.slice(0, 5);\n }\n\n formattedDate = `${formattedStartDate} - ${formatDateString(end)}`;\n }\n }\n return formattedDate;\n}\n\n/**\n * Format the new value to a string that can be displayed in the input field.\n * @param value The new value\n * @param isRangeMode Whether the calendar is in range mode\n * @returns The formatted string\n */\nexport function formatInputValue({ value, isRangeMode }: DatePickerProps) {\n if (isRangeMode) {\n return formatSlotToInputValue(value);\n }\n return formatDateString(value);\n}\n\nexport function formatValueToSlot({ value, isRangeMode }: DatePickerProps) {\n if (isRangeMode) {\n return value;\n }\n\n return value ? { start: value, end: value } : value;\n}\n\n/**\n * Validates the selected and selectable slots as well as the initial date.\n * @param selectedSlot The selected slot to validate.\n * @param selectableSlot The selectable slot to validate.\n * @param date The date to validate.\n *\n * Three main validation checks are performed:\n * - Check if the selected and selectable slots are valid.\n * - Ensures the selected slot is within the selectable slot.\n * - Ensures the initial date is within the selectable slot\n */\nexport function validateSlots(\n selectedSlot: CalendarSlot | undefined,\n selectableSlot: CalendarSlot | undefined,\n date: Date | undefined\n) {\n if (selectedSlot && !isValidSlot(selectedSlot)) {\n throw new Error(INVALID_SELECTED_SLOT_ERROR);\n }\n\n if (selectableSlot && !isValidSlot(selectableSlot)) {\n throw new Error(INVALID_SELECTABLE_SLOT_ERROR);\n }\n\n if (\n selectedSlot?.start &&\n selectedSlot?.end &&\n selectableSlot?.start &&\n selectableSlot?.end &&\n (normalizeDate(selectedSlot.start) < normalizeDate(selectableSlot.start) ||\n normalizeDate(selectedSlot.end) > normalizeDate(selectableSlot.end))\n ) {\n throw new Error(INVALID_SELECTED_SLOT_BASED_ON_SELECTABLE_SLOT_ERROR);\n }\n\n if (\n date &&\n selectableSlot?.start &&\n selectableSlot?.end &&\n (normalizeDate(date) < normalizeDate(selectableSlot.start) ||\n normalizeDate(date) > normalizeDate(selectableSlot.end))\n ) {\n throw new Error(INVALID_INITIAL_DATE_ERROR);\n }\n}\n","import cx from 'classnames';\n\nimport { type CalendarProps } from './Calendar';\nimport {\n getAllDatesInMonth,\n getDatesFromNextMonthInLastWeek,\n getDatesFromPreviousMonthInFirstWeek,\n isSameDay,\n isWithinInterval,\n normalizeDate,\n} from './utils';\n\nexport const getLocalizedWeekdays = (locale: string = navigator.language) => {\n const formatter = new Intl.DateTimeFormat(locale, { weekday: 'narrow' });\n return [...Array(7).keys()].map((dayIndex) => {\n // January 1st 2024 is a Monday, so dayIndex 0 → Monday ... dayIndex 6 → Sunday.\n const date = new Date(Date.UTC(2024, 0, 1 + dayIndex));\n return formatter.format(date);\n });\n};\n\nexport default function useCalendar({\n displayedMonthStartDate,\n selectableSlot,\n selectedSlot,\n locale,\n}: CalendarProps) {\n const now = new Date();\n const weekDays = getLocalizedWeekdays(locale);\n now.setHours(0, 0, 0, 0);\n const referenceDate = selectableSlot?.start ?? now;\n referenceDate.setHours(0, 0, 0, 0);\n const displayedYear = displayedMonthStartDate.getFullYear();\n const displayedMonth = displayedMonthStartDate.getMonth();\n const daysInMonth = getAllDatesInMonth(displayedMonth, displayedYear);\n const daysInLastMonth = getDatesFromPreviousMonthInFirstWeek(displayedMonth, displayedYear);\n const daysInNextMonth = getDatesFromNextMonthInLastWeek(displayedMonth, displayedYear);\n const allDays = [...daysInLastMonth, ...daysInMonth, ...daysInNextMonth];\n\n const buildDayWrapperClassName = (date: Date) => {\n const isStart = (selectedSlot && isSameDay(date, selectedSlot.start)) || false;\n const isEnd = (selectedSlot && isSameDay(date, selectedSlot.end)) || false;\n const withinSelectedSlot =\n (selectedSlot?.start && selectedSlot.end && isWithinInterval(date, selectedSlot)) ||\n isStart ||\n isEnd;\n const insideSelectableSlot = isWithinInterval(date, selectableSlot);\n\n let classNames = {\n 'inside-selectable-slot': insideSelectableSlot,\n 'outside-selectable-slot': !insideSelectableSlot,\n 'current-month': date.getMonth() === displayedMonth,\n past: normalizeDate(date) < normalizeDate(referenceDate),\n } as Record<string, boolean | null>;\n\n if (selectedSlot) {\n classNames = {\n ...classNames,\n start: isStart,\n end: isEnd,\n 'within-selected-slot': withinSelectedSlot,\n };\n }\n\n return cx('day-wrapper', classNames);\n };\n\n const isDateSelectable = (date: Date) => isWithinInterval(date, selectableSlot);\n\n return {\n days: allDays,\n isToday: (date: Date) => normalizeDate(date).getTime() === normalizeDate(now).getTime(),\n buildDayWrapperClassName,\n isDateSelectable,\n weekDays,\n };\n}\n","import React from 'react';\n\nimport { type CalendarSlot } from './type';\nimport useCalendar from './useCalendar';\n\nexport type CalendarProps = {\n selectedSlot?: CalendarSlot;\n selectableSlot?: CalendarSlot;\n displayedMonthStartDate: Date;\n onDayClick: (date: Date) => void;\n locale?: string;\n};\n\ntype DayProps = {\n date: Date;\n isSelectable: boolean;\n isToday: boolean;\n dayWrapperClassName: string;\n onClick: (date: Date) => void;\n};\n\nconst Day = ({ date, isToday, isSelectable, dayWrapperClassName, onClick }: DayProps) => (\n <div\n onClick={() => {\n if (isSelectable) onClick(date);\n }}\n className=\"day-background\"\n >\n <div className={dayWrapperClassName}>\n <span className=\"day\">{date.getDate()}</span>\n {isToday && <span className=\"current-date-highlight\" />}\n </div>\n </div>\n);\n\nconst Calendar = (props: CalendarProps) => {\n const { days, isToday, isDateSelectable, buildDayWrapperClassName, weekDays } =\n useCalendar(props);\n const { displayedMonthStartDate, onDayClick, locale } = props;\n return (\n <div className=\"calendar-wrapper\">\n <div className=\"calendar-anatomy\">\n <p className=\"calendar-month-label\">\n {displayedMonthStartDate.toLocaleString(locale || navigator.language, { month: 'short' })}\n </p>\n <div className=\"calendar-grid-wrapper\">\n <div className=\"calendar-weekday-labels\">\n {weekDays.map((label, index) => (\n <p key={`${label}-${index}`}>{label}</p>\n ))}\n </div>\n <div className=\"calendar-days-grid\">\n {days.map((date) => (\n <Day\n key={date.getTime()}\n date={date}\n isToday={isToday(date)}\n isSelectable={isDateSelectable(date)}\n dayWrapperClassName={buildDayWrapperClassName(date)}\n onClick={onDayClick}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Calendar;\n","import { useEffect, useState } from 'react';\n\nimport { type CalendarPickerProps } from './CalendarPicker';\nimport { generateSequentialDates, validateSlots } from './utils';\n\nexport default function useCalendarPicker({\n initialDate,\n selectedSlot,\n selectableSlot,\n numberOfMonths = 1,\n}: Omit<CalendarPickerProps, 'modalPosition' | 'calendarPickerRef' | 'onDayClick'>) {\n validateSlots(selectedSlot, selectableSlot, initialDate);\n\n const [activeDate, setActiveDate] = useState(() => new Date());\n\n const displayedMonthsStartDates = generateSequentialDates(activeDate, numberOfMonths);\n\n const activeYear = activeDate.getFullYear();\n const activeMonth = activeDate.getMonth();\n const firstDayOfMonth = new Date(activeYear, activeMonth, 1);\n const lastDayOfMonth = new Date(activeYear, activeMonth + 1, 0);\n\n const canGoToPreviousMonth =\n selectableSlot === undefined || selectableSlot.start === null\n ? true\n : selectableSlot.start < firstDayOfMonth;\n\n const canGoToNextMonth =\n selectableSlot === undefined || selectableSlot.end === null\n ? true\n : selectableSlot.end > lastDayOfMonth;\n\n const showNavigationBtn = canGoToPreviousMonth || canGoToNextMonth;\n\n const handleGoToPreviousMonth = () => {\n if (canGoToPreviousMonth) {\n const previousActiveMonth = activeMonth === 0 ? 11 : activeMonth - 1;\n const previousActiveYear = activeMonth === 0 ? activeYear - 1 : activeYear;\n setActiveDate(new Date(previousActiveYear, previousActiveMonth, 1));\n }\n };\n\n const handleGoToNextMonth = () => {\n if (canGoToNextMonth) {\n const nextActiveMonth = activeMonth === 11 ? 0 : activeMonth + 1;\n const nextActiveYear = activeMonth === 11 ? activeYear + 1 : activeYear;\n setActiveDate(new Date(nextActiveYear, nextActiveMonth, 1));\n }\n };\n\n useEffect(() => {\n // TODO: fix this lint\n // eslint-disable-next-line react/set-state-in-effect\n setActiveDate(initialDate ?? selectedSlot?.start ?? selectableSlot?.start ?? new Date());\n }, [initialDate, selectedSlot, selectableSlot]);\n\n return {\n displayedMonthsStartDates,\n showNavigationBtn,\n canGoToPreviousMonth,\n canGoToNextMonth,\n handleGoToPreviousMonth,\n handleGoToNextMonth,\n };\n}\n","import React from 'react';\n\nimport { ChevronLeft, ChevronRight } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport Calendar from './Calendar';\nimport { type CalendarSlot } from './type';\nimport useCalendarPicker from './useCalendarPicker';\n\nexport type CalendarPickerPrivateProps = {\n selectedSlot?: CalendarSlot;\n onDayClick: (day: Date) => void;\n calendarPickerRef: React.RefObject<HTMLDivElement | null>;\n selectableSlot?: CalendarSlot;\n};\n\nexport type CalendarPickerPublicProps = {\n initialDate?: Date;\n numberOfMonths?: 1 | 2 | 3;\n locale?: string;\n};\n\nexport type CalendarPickerProps = CalendarPickerPrivateProps & CalendarPickerPublicProps;\n\nconst CalendarPicker = ({\n initialDate,\n selectedSlot,\n selectableSlot,\n numberOfMonths = 1,\n onDayClick,\n calendarPickerRef,\n locale,\n}: CalendarPickerProps) => {\n const {\n displayedMonthsStartDates,\n showNavigationBtn,\n canGoToNextMonth,\n canGoToPreviousMonth,\n handleGoToNextMonth,\n handleGoToPreviousMonth,\n } = useCalendarPicker({\n initialDate,\n selectedSlot,\n selectableSlot,\n numberOfMonths,\n });\n\n return (\n <div ref={calendarPickerRef} className=\"calendar-picker\">\n {showNavigationBtn && (\n <span\n className={cx('calendar-navigation-btn', 'previous', {\n disabled: !canGoToPreviousMonth,\n })}\n onClick={handleGoToPreviousMonth}\n >\n <ChevronLeft size=\"lg\" />\n </span>\n )}\n <div className={cx('calendar-list', { 'navigation-btn-hidden': !showNavigationBtn })}>\n {displayedMonthsStartDates.map((date) => (\n <Calendar\n key={date.getTime()}\n displayedMonthStartDate={date}\n selectableSlot={selectableSlot}\n selectedSlot={selectedSlot}\n onDayClick={onDayClick}\n locale={locale}\n />\n ))}\n </div>\n {showNavigationBtn && (\n <span\n className={cx('calendar-navigation-btn', 'next', {\n disabled: !canGoToNextMonth,\n })}\n onClick={handleGoToNextMonth}\n >\n <ChevronRight size=\"lg\" />\n </span>\n )}\n </div>\n );\n};\n\nexport default CalendarPicker;\n","import { useState, useRef, useEffect } from 'react';\n\nimport type { StatusWithMessage } from '../StatusMessage';\nimport type { DatePickerProps } from './DatePicker';\nimport {\n computeNewSelectedSlot,\n containsOnlyNumbersAndSlashes,\n formatInputValue,\n formatValueToSlot,\n isWithinInterval,\n} from './utils';\n\n// Regex for \"xx/xx/xx\"\nconst SINGLE_DATE_REGEX = /^\\d{2}\\/\\d{2}\\/\\d{2}$/;\n// Same as above, but each group can be one or two digits\nconst FIXABLE_DATE_REGEX = /^\\d{1,2}\\/\\d{1,2}\\/\\d{1,2}$/;\n\nexport default function useDatePicker(datePickerProps: DatePickerProps) {\n const { value, isRangeMode, selectableSlot, errorMessages, onDateChange } = datePickerProps;\n const [showPicker, setShowPicker] = useState(false);\n const [inputValue, setInputValue] = useState(formatInputValue(datePickerProps));\n const [selectedSlot, setSelectedSlot] = useState(formatValueToSlot(datePickerProps));\n const [statusWithMessage, setStatusWithMessage] = useState<StatusWithMessage>();\n const calendarPickerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleInputClick = () => {\n if (isRangeMode) {\n setShowPicker(true);\n }\n };\n\n const handleDayClick = (clickedDate: Date) => {\n if (isRangeMode) {\n const newSelectedSlot = computeNewSelectedSlot(clickedDate, value);\n onDateChange(clickedDate, newSelectedSlot);\n } else {\n onDateChange(clickedDate);\n }\n };\n\n const handleInputOnChange = (newValue: string) => {\n if (isRangeMode) {\n return;\n }\n\n setInputValue(newValue);\n const inputIsDate = SINGLE_DATE_REGEX.test(newValue);\n\n if (inputIsDate) {\n const [day, month, year] = newValue.split('/').map(Number);\n const date = new Date(year + 2000, month - 1, day);\n const isRealDate = !Number.isNaN(date.getTime());\n const isValid = isRealDate && isWithinInterval(date, selectableSlot);\n if (isValid) {\n setStatusWithMessage(undefined);\n onDateChange(date);\n } else {\n setStatusWithMessage({ status: 'error', message: errorMessages?.invalidDate });\n onDateChange(undefined);\n }\n return;\n }\n\n if (containsOnlyNumbersAndSlashes(newValue) && newValue.length < 8) {\n setStatusWithMessage(undefined);\n onDateChange(undefined);\n return;\n }\n onDateChange(undefined);\n setStatusWithMessage({\n status: 'error',\n message: errorMessages?.invalidInput,\n });\n };\n\n const handleBlur = () => {\n const isDate = SINGLE_DATE_REGEX.test(inputValue);\n const isFixableDate = !isDate && FIXABLE_DATE_REGEX.test(inputValue);\n if (isFixableDate) {\n const [day, month, year] = inputValue\n .split('/')\n .map((s: string) => (s.length === 1 ? `0${s}` : s));\n handleInputOnChange(`${day}/${month}/${year}`);\n } else if (!isDate) {\n setStatusWithMessage({\n status: 'error',\n message: errorMessages?.invalidInput,\n });\n }\n };\n\n useEffect(() => {\n const newInput = formatInputValue(datePickerProps);\n if (newInput !== inputValue) {\n // we only set the input value if it has changed\n // otherwise the user loses the focus\n setInputValue(newInput);\n }\n setStatusWithMessage(undefined);\n setSelectedSlot(formatValueToSlot(datePickerProps));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n return {\n showPicker,\n inputValue,\n statusWithMessage,\n selectedSlot,\n inputRef,\n calendarPickerRef,\n setShowPicker,\n handleDayClick,\n handleInputClick,\n handleInputOnChange,\n handleBlur,\n };\n}\n","import React from 'react';\n\nimport { Calendar as CalendarIcon } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport { type CalendarSlot } from '.';\nimport Input, { type InputProps } from '../Input';\nimport InputPopover from '../InputPopover';\nimport CalendarPicker, { type CalendarPickerPublicProps } from './CalendarPicker';\nimport useDatePicker from './useDatePicker';\n\ntype BaseDatePickerProps = {\n selectableSlot?: CalendarSlot;\n inputProps: InputProps;\n calendarPickerProps?: CalendarPickerPublicProps;\n errorMessages?: { invalidInput?: string; invalidDate?: string };\n width?: number;\n testIdPrefix?: string;\n};\n\nexport type SingleDatePickerProps = BaseDatePickerProps & {\n isRangeMode?: false;\n onDateChange: (nextDate?: Date) => void;\n value?: Date;\n};\n\nexport type RangeDatePickerProps = BaseDatePickerProps & {\n isRangeMode: true;\n onDateChange: (clickedDate: Date, nextSelectedSlot?: CalendarSlot) => void;\n value?: CalendarSlot;\n};\n\nexport type DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;\n\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n inputValue,\n statusWithMessage,\n selectedSlot,\n showPicker,\n inputRef,\n calendarPickerRef,\n setShowPicker,\n handleDayClick,\n handleInputClick,\n handleInputOnChange,\n handleBlur,\n } = useDatePicker(props);\n\n const { inputFieldWrapperClassname, ...otherInputProps } = props.inputProps;\n const { selectableSlot } = props;\n const { testIdPrefix } = props;\n\n return (\n <div data-testid={testIdPrefix ? testIdPrefix : undefined} className=\"ui-date-picker\">\n <div>\n <Input\n testIdPrefix={testIdPrefix}\n {...otherInputProps}\n ref={inputRef}\n value={inputValue}\n onClick={handleInputClick}\n type=\"text\"\n trailingContent={{\n content: <CalendarIcon />,\n onClickCallback: () => setShowPicker(!showPicker),\n }}\n inputFieldWrapperClassname={cx('date-picker-input', inputFieldWrapperClassname, {\n 'range-mode': props.isRangeMode,\n })}\n autoComplete=\"off\"\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleInputOnChange(e.target.value)}\n onBlur={handleBlur}\n statusWithMessage={statusWithMessage}\n />\n </div>\n <InputPopover\n inputRef={inputRef}\n isOpen={showPicker}\n onClose={() => setShowPicker(false)}\n testIdPrefix=\"modal\"\n >\n <CalendarPicker\n {...props.calendarPickerProps}\n selectedSlot={selectedSlot}\n onDayClick={handleDayClick}\n calendarPickerRef={calendarPickerRef}\n selectableSlot={selectableSlot}\n />\n </InputPopover>\n </div>\n );\n};\n\nexport default DatePicker;\n","import React, { type InputHTMLAttributes } from 'react';\n\nimport cx from 'classnames';\n\nexport type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {\n label?: string;\n size?: 'xs' | 'sm' | 'md';\n dataTestId?: string;\n};\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n ({ label, size, id: providedId, dataTestId, ...rest }, ref) => {\n const generatedId = React.useId();\n const id = providedId ?? generatedId;\n\n return (\n <label\n className={cx('ui-switch', { [`size-${size}`]: size, 'with-label': !!label })}\n htmlFor={id}\n >\n <input ref={ref} id={id} type=\"checkbox\" data-testid={dataTestId} {...rest} />\n {label && <div className=\"label\">{label}</div>}\n </label>\n );\n }\n);\n\nSwitch.displayName = 'Switch';\nexport default Switch;\n","import React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport cx from 'classnames';\n\nimport FieldWrapper, { type FieldWrapperProps } from '../FieldWrapper';\n\ntype UnitConfig = {\n key: string;\n label: string;\n msPerUnit: number;\n digits?: number;\n};\n\nexport type Units = 'h' | 'm' | 's' | 'ms';\n\nexport type UnitProps =\n | Units\n | (Partial<UnitConfig> & Pick<UnitConfig, 'key'>)\n | (Partial<UnitConfig> & Pick<UnitConfig, 'label'>);\n\ntype UnitSetting = UnitConfig & {\n max: number;\n padChar: string;\n};\n\nexport type DurationInputProps = {\n id: string;\n units: UnitProps[];\n value: number;\n padChar: string;\n onChange?: (ms: number) => void;\n max?: number;\n small?: boolean;\n hint?: string;\n label?: string;\n statusWithMessage?: FieldWrapperProps['statusWithMessage'];\n dataTestId?: string;\n} & Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'>;\n\nexport const PRESETS: Record<string, Omit<UnitConfig, 'key'>> = {\n h: { label: 'h', digits: 2, msPerUnit: 3_600_000 },\n m: { label: 'm', digits: 2, msPerUnit: 60_000 },\n s: { label: 's', digits: 2, msPerUnit: 1_000 },\n ms: { label: 'ms', digits: 3, msPerUnit: 1 },\n};\n\nexport function normalizeUnits(units: UnitProps[], padChar: string, max: number): UnitSetting[] {\n const configs: UnitConfig[] = units.map((u) => {\n if (typeof u === 'string') {\n return { key: u, ...PRESETS[u] };\n }\n\n const key = (u.key ?? u.label)!;\n const base = PRESETS[key] ?? {};\n\n return {\n key,\n label: u.label ?? base.label ?? key,\n msPerUnit: u.msPerUnit ?? base.msPerUnit ?? 1,\n digits: u.digits ?? base.digits ?? 2,\n };\n });\n\n configs.sort((a, b) => b.msPerUnit - a.msPerUnit);\n\n return configs.map((unit, idx): UnitSetting => {\n const prev = idx > 0 ? configs[idx - 1] : null;\n const digits = prev\n ? unit.digits\n : max < Infinity\n ? String(Math.floor(max / unit.msPerUnit)).length\n : undefined;\n\n return {\n ...unit,\n digits,\n max: prev ? Math.floor(prev.msPerUnit / unit.msPerUnit) : Infinity,\n padChar,\n };\n });\n}\n\ntype FormattedValues = Record<string, string>;\n\nexport function toUnitField(ms: number, unit: UnitSetting): [string, string] {\n const value = Math.floor(ms / (unit.msPerUnit || 1)) % (unit.max ?? Infinity);\n return [unit.key, String(value || unit.padChar).padStart(unit.digits ?? 0, unit.padChar)];\n}\n\nexport function toFormattedValues(units: UnitSetting[], ms: number): FormattedValues {\n return Object.fromEntries(units.map((u) => toUnitField(ms, u)));\n}\n\nexport function toTotalMilliseconds(fields: UnitSetting[], values: FormattedValues): number {\n return fields.reduce((acc, f) => {\n const cleaned = values[f.key].replace(/[^0-9]/g, '');\n const value = parseInt(cleaned, 10) || 0;\n return acc + value * (f.msPerUnit || 1);\n }, 0);\n}\n\nexport function useDurationInput({\n units,\n value,\n onChange,\n padChar,\n max,\n containerRef,\n}: Omit<DurationInputProps, 'id' | 'max'> & {\n max: number;\n containerRef: React.RefObject<HTMLDivElement | null>;\n}) {\n const fields = useMemo(() => normalizeUnits(units, padChar, max), [units, padChar, max]);\n const inputRefs = useRef<Record<string, HTMLInputElement>>({});\n\n const [initialValue, setInitialValue] = useState(value);\n const [formattedValues, setFormattedValues] = useState<FormattedValues>(() =>\n toFormattedValues(fields, Math.min(max, value))\n );\n\n if (initialValue !== value) {\n setInitialValue(value);\n setFormattedValues(toFormattedValues(fields, Math.min(max, value)));\n }\n\n const focusField = useCallback((key: string) => {\n requestAnimationFrame(() => {\n inputRefs.current[key]?.focus();\n inputRefs.current[key]?.select();\n });\n }, []);\n\n const focusNext = useCallback(\n (currentKey: string) => {\n const idx = fields.findIndex((f) => f.key === currentKey);\n const next = fields[idx + 1];\n if (next) focusField(next.key);\n },\n [fields, focusField]\n );\n\n const focusPrevious = useCallback(\n (currentKey: string) => {\n const idx = fields.findIndex((f) => f.key === currentKey);\n const previous = fields[idx - 1];\n if (previous) focusField(previous.key);\n },\n [fields, focusField]\n );\n\n const handleChange = useCallback(\n (setting: UnitSetting, inputValue: string) => {\n const cleaned = inputValue.replace(/[^0-9]/g, '').slice(0, setting.digits);\n setFormattedValues((prev) => ({ ...prev, [setting.key]: cleaned }));\n if (cleaned.length === setting.digits) {\n focusNext(setting.key);\n }\n },\n [focusNext]\n );\n\n const submitChange = useCallback(() => {\n const ms = toTotalMilliseconds(fields, formattedValues);\n const clamped = Math.min(max, ms);\n const next = toFormattedValues(fields, clamped);\n\n setFormattedValues(next);\n onChange?.(toTotalMilliseconds(fields, next));\n }, [fields, formattedValues, max, onChange]);\n\n const handleKeyDown = useCallback(\n (setting: UnitSetting, e: React.KeyboardEvent<HTMLInputElement>) => {\n const input = e.currentTarget;\n\n if (!input) return;\n\n const cursorAtTheEnd = input.selectionStart === input.value.length;\n const keyFirstLetter = setting.key.at(0)?.toLowerCase();\n if (\n (e.key === 'ArrowRight' || e.key === ':' || e.key.toLowerCase() === keyFirstLetter) &&\n cursorAtTheEnd\n ) {\n e.preventDefault();\n focusNext(setting.key);\n }\n\n if (e.key === 'ArrowLeft' && input.selectionStart === 0) {\n e.preventDefault();\n focusPrevious(setting.key);\n }\n\n if (e.key === 'Enter') {\n submitChange();\n }\n },\n [focusNext, focusPrevious, submitChange]\n );\n\n const handleFocus = useCallback((setting: UnitSetting) => focusField(setting.key), [focusField]);\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n const nextTarget = e.relatedTarget as Node | null;\n if (nextTarget && containerRef.current?.contains(nextTarget)) {\n return;\n }\n\n submitChange();\n },\n [containerRef, submitChange]\n );\n\n return {\n fields,\n formattedValues,\n inputRefs,\n containerRef,\n handleChange,\n handleFocus,\n handleBlur,\n handleKeyDown,\n };\n}\n\ntype UnitFieldProps = {\n setting: UnitSetting;\n value: string;\n inputRef: (el: HTMLInputElement | null) => void;\n onChange: (value: string) => void;\n onFocus: () => void;\n onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n tabIndex: number;\n dataTestId?: string;\n};\n\nconst UnitField = function UnitField({\n setting,\n value,\n inputRef,\n onChange,\n onFocus,\n onBlur,\n onKeyDown,\n tabIndex,\n dataTestId,\n}: UnitFieldProps) {\n const { label, digits, padChar } = setting;\n const placeholder = padChar.repeat(digits ?? 2);\n\n return (\n <span className=\"unit-field\">\n <input\n ref={inputRef}\n type=\"text\"\n inputMode=\"numeric\"\n style={{\n width: digits ? `${digits ?? 2}ch` : `${value.length || 1}ch`,\n }}\n tabIndex={tabIndex}\n value={value}\n placeholder={placeholder}\n aria-label={label}\n onChange={(e) => onChange(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n data-testid={dataTestId}\n />\n <span aria-hidden onClick={onFocus}>\n {label}\n </span>\n </span>\n );\n};\n\nconst DEFAULT_UNITS: UnitProps[] = ['m', 's'];\n\n/**\n * Duration units can be set up via their shorthand strings (h, m, s, ms)\n * or more precisely through objects.\n * The value of the component is a number representing the milliseconds of the duration.\n */\nexport const DurationInput = ({\n id,\n units = DEFAULT_UNITS,\n value = 0,\n onChange,\n padChar = '0',\n small = false,\n max = Infinity,\n label,\n hint,\n statusWithMessage,\n dataTestId,\n ...rest\n}: DurationInputProps) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const {\n fields,\n formattedValues,\n inputRefs,\n handleChange,\n handleFocus,\n handleBlur,\n handleKeyDown,\n } = useDurationInput({\n units,\n value,\n onChange,\n containerRef,\n padChar,\n max,\n });\n\n return (\n <FieldWrapper\n id={id}\n label={label}\n hint={hint}\n small={small}\n statusWithMessage={statusWithMessage}\n >\n <div\n ref={containerRef}\n id={id}\n className={cx('ui-duration-input', { small })}\n role=\"group\"\n aria-label=\"Duration Input\"\n onMouseDown={(e) => {\n if (e.currentTarget === e.target) inputRefs.current[fields[0].key]?.focus();\n }}\n {...rest}\n >\n {fields.map((setting, idx) => (\n <UnitField\n key={setting.key}\n setting={setting}\n value={formattedValues[setting.key]}\n inputRef={(el) => {\n if (el) inputRefs.current[setting.key] = el;\n }}\n tabIndex={idx === 0 ? 0 : -1}\n onChange={(val) => handleChange(setting, val)}\n onFocus={() => handleFocus(setting)}\n onBlur={(e) => handleBlur(e)}\n onKeyDown={(e) => handleKeyDown(setting, e)}\n dataTestId={dataTestId ? `${dataTestId}-${setting.key}` : undefined}\n />\n ))}\n </div>\n </FieldWrapper>\n );\n};\n","import React, { useState } from 'react';\n\nimport { Eye, EyeClosed } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport Input, { type InputProps } from './Input';\n\nexport type PasswordInputProps = InputProps;\nconst PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n ({ inputFieldWrapperClassname, ...otherProps }, ref) => {\n const [showPassword, toggleShowPassword] = useState(false);\n\n return (\n <Input\n {...otherProps}\n type={showPassword ? 'text' : 'password'}\n trailingContent={{\n content: showPassword ? <EyeClosed /> : <Eye />,\n onClickCallback: () => toggleShowPassword(!showPassword),\n }}\n inputFieldWrapperClassname={cx('ui-password-input', inputFieldWrapperClassname)}\n ref={ref}\n />\n );\n }\n);\n\nPasswordInput.displayName = 'PasswordInput';\n\nexport default PasswordInput;\n","import React, { type InputHTMLAttributes, type MouseEvent } from 'react';\n\nimport cx from 'classnames';\n\nexport type RadioButtonProps = React.PropsWithChildren<\n Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'children'> & {\n label: string;\n value: string;\n hint?: string;\n small?: boolean;\n ref?: React.RefObject<HTMLInputElement | null>;\n }\n>;\n\nconst RadioButton = ({\n id,\n label,\n value,\n hint,\n readOnly,\n onClick,\n small,\n children,\n ref,\n ...rest\n}: RadioButtonProps) => {\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n onClick?.(e);\n }\n };\n\n return (\n <label\n className={cx('ui-radio-button', {\n small,\n 'with-label': label || children,\n 'with-hint': hint,\n })}\n >\n <input\n // Browsers' read-only attribute is not working on radio buttons. See: https://stackoverflow.com/a/70375659\n className={cx({ 'read-only': readOnly })}\n type=\"radio\"\n id={id || value}\n value={value}\n onClick={handleClick}\n ref={ref}\n {...rest}\n />\n {label && <div className=\"radio-label\">{label}</div>}\n {children && <div className=\"radio-label\">{children}</div>}\n {hint && <div className=\"hint\">{hint}</div>}\n </label>\n );\n};\n\nexport default RadioButton;\n","import React, { type ChangeEvent, useEffect, useState } from 'react';\n\nimport { RequiredInput } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport InputStatusIcon from './InputStatusIcon';\nimport RadioButton, { type RadioButtonProps } from './RadioButton';\nimport { type StatusWithMessage } from './StatusMessage';\n\nexport type RadioGroupProps = {\n label?: string;\n subtitle?: string;\n readOnly?: boolean;\n disabled?: boolean;\n required?: boolean;\n small?: boolean;\n value?: string;\n options: RadioButtonProps[];\n statusWithMessage?: StatusWithMessage;\n onChange?: (value: string) => void;\n};\n\nconst RadioGroup = ({\n label,\n value,\n subtitle,\n readOnly,\n disabled,\n options,\n statusWithMessage,\n required,\n small,\n onChange,\n}: RadioGroupProps) => {\n const [selectedValue, setSelectedValue] = useState<string | undefined>(value);\n\n useEffect(() => {\n /* eslint-disable-next-line react/set-state-in-effect react/no-deriving-state-in-effects */\n setSelectedValue(value);\n }, [value]);\n\n const statusClassname = statusWithMessage?.status ? { [statusWithMessage.status]: true } : {};\n\n const handleOptionChange = (e: ChangeEvent<HTMLInputElement>, nextOption: RadioButtonProps) => {\n if (!readOnly) {\n setSelectedValue(nextOption.value);\n nextOption.onChange?.(e);\n onChange?.(nextOption.value);\n }\n };\n\n return (\n <div className={cx('ui-radio-button-wrapper', statusClassname)}>\n {label && (\n <label className=\"label\">\n {required && (\n <span className=\"required\">\n <RequiredInput />\n </span>\n )}\n {label} {subtitle && <span className=\"subtitle\">{subtitle}</span>}\n </label>\n )}\n\n {options.map((option) => (\n <RadioButton\n key={option.value}\n {...option}\n readOnly={readOnly}\n disabled={disabled}\n checked={selectedValue === option.value}\n onChange={(e) => {\n handleOptionChange(e, option);\n }}\n small={small}\n />\n ))}\n {statusWithMessage?.message && (\n <div className=\"status-with-message\">\n <InputStatusIcon status={statusWithMessage.status} />\n <span className={cx('status-message', statusClassname)}>{statusWithMessage.message}</span>\n </div>\n )}\n </div>\n );\n};\n\nexport default RadioGroup;\n","import React, { useEffect, useState } from 'react';\n\nimport cx from 'classnames';\n\nimport FieldWrapper, { type FieldWrapperProps } from './FieldWrapper';\n\nexport type SelectProps<T> = Omit<\n React.InputHTMLAttributes<HTMLSelectElement>,\n 'value' | 'onChange'\n> &\n Omit<FieldWrapperProps, 'children'> & {\n options: Array<T>;\n value?: T;\n dataTestId?: string;\n getOptionLabel: (option: T) => string;\n getOptionValue: (option: T) => string;\n onChange: (option?: T) => void;\n };\n\nconst PLACEHOLDER_VALUE = '__PLACEHOLDER__';\n\nconst Select = <T,>({\n id,\n label,\n hint,\n value,\n options,\n placeholder,\n statusWithMessage,\n required,\n disabled,\n narrow,\n readOnly,\n small,\n getOptionLabel,\n getOptionValue,\n onChange,\n dataTestId,\n ...props\n}: SelectProps<T>) => {\n const [selectedOption, setSelectedOption] = useState<T | undefined>(value);\n const handleOnChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n const newSelectedOption =\n e.target.value === PLACEHOLDER_VALUE\n ? undefined\n : options.find((option) => getOptionValue(option) === e.target.value);\n setSelectedOption(newSelectedOption);\n onChange(newSelectedOption);\n };\n\n useEffect(() => {\n // TODO: fix this lint\n /* eslint-disable-next-line react/set-state-in-effect react/no-deriving-state-in-effects */\n setSelectedOption(value);\n }, [value]);\n\n return (\n <FieldWrapper\n id={id}\n label={label}\n hint={hint}\n statusWithMessage={statusWithMessage}\n required={required}\n disabled={disabled}\n small={small}\n narrow={narrow}\n >\n <select\n id={id}\n data-testid={dataTestId}\n className={cx('ui-select', statusWithMessage?.status, {\n 'placeholder-selected': placeholder && !selectedOption,\n small,\n 'read-only': readOnly,\n })}\n value={selectedOption ? getOptionValue(selectedOption) : PLACEHOLDER_VALUE}\n required={required}\n disabled={disabled || readOnly}\n onChange={handleOnChange}\n {...props}\n >\n {placeholder ? (\n <option\n value={PLACEHOLDER_VALUE}\n className=\"placeholder-option\"\n >{`– ${placeholder} –`}</option>\n ) : (\n <option value={PLACEHOLDER_VALUE} hidden />\n )}\n {options.map((option) => (\n <option key={getOptionValue(option)} value={getOptionValue(option)}>\n {getOptionLabel(option)}\n </option>\n ))}\n </select>\n </FieldWrapper>\n );\n};\n\nexport default Select;\n","import React from 'react';\n\nimport cx from 'classnames';\n\nimport useFocusByTab from '../hooks/useFocusByTab';\nimport FieldWrapper, { type FieldWrapperProps } from './FieldWrapper';\n\nexport type TextAreaProps = React.InputHTMLAttributes<HTMLTextAreaElement> &\n Omit<FieldWrapperProps, 'children'>;\n\nconst CHAR_COUNT_ERROR_THRESHOLD = 40;\nconst TextArea = ({\n id,\n label,\n value = '',\n hint,\n required,\n disabled,\n statusWithMessage,\n maxLength,\n onChange,\n onKeyUp,\n onBlur,\n ...rest\n}: TextAreaProps) => {\n const charCount = (value as string)?.length || 0;\n const { handleKeyUp, handleBlur, isFocusByTab } = useFocusByTab({ onBlur, onKeyUp });\n\n return (\n <FieldWrapper\n id={id}\n label={label}\n hint={hint}\n statusWithMessage={statusWithMessage}\n disabled={disabled}\n required={required}\n className=\"ui-text-area-field-wrapper\"\n >\n <div className={cx('text-area-wrapper', { 'focused-by-tab': isFocusByTab })}>\n {maxLength && (\n <div\n className={cx('char-count', {\n error: charCount === maxLength,\n warning: maxLength - charCount <= CHAR_COUNT_ERROR_THRESHOLD,\n })}\n >\n {charCount}/{maxLength}\n </div>\n )}\n <textarea\n className={cx('text-area', { [statusWithMessage?.status || '']: !!statusWithMessage })}\n id={id}\n value={value}\n disabled={disabled}\n maxLength={maxLength}\n onChange={onChange}\n onBlur={handleBlur}\n onKeyUp={handleKeyUp}\n {...rest}\n />\n </div>\n </FieldWrapper>\n );\n};\n\nexport default TextArea;\n","import React, { useState, useRef, useCallback } from 'react';\n\nimport cx from 'classnames';\n\nimport Input, { type InputProps } from './Input';\nimport InputPopover from './InputPopover';\n\nexport type TimePickerProps = Omit<\n InputProps,\n 'type' | 'name' | 'value' | 'onClick' | 'onChange' | 'ref' | 'step'\n> & {\n hours?: number;\n minutes?: number;\n seconds?: number;\n displaySeconds?: boolean;\n onTimeChange: ({\n hours,\n minutes,\n seconds,\n }: {\n hours: number;\n minutes: number;\n seconds?: number;\n }) => void;\n testIdPrefix?: string;\n};\n\ntype TimeRangeProps = {\n range: number[];\n selectedItem: number;\n className: string;\n onSelectItem: (item: number) => void;\n};\n\nconst TimeRange = ({ range, selectedItem, className, onSelectItem }: TimeRangeProps) => (\n <div className=\"time-grid\" data-testid=\"time-grid\">\n {range.map((item) => {\n const formattedItem = item.toString().padStart(2, '0');\n\n return (\n <div\n key={item}\n className={cx(className, { selected: selectedItem === item })}\n data-testid={className === 'hour' ? `hour-${formattedItem}` : `minute-${formattedItem}`}\n onClick={() => onSelectItem(item)}\n >\n {formattedItem}\n </div>\n );\n })}\n </div>\n);\n\nfunction formatTimeValue(value: number, max: number) {\n return Math.max(0, Math.min(max, value)).toString().padStart(2, '0');\n}\n\nconst TimePicker = ({\n onTimeChange,\n hours = 0,\n minutes = 0,\n seconds = 0,\n displaySeconds = false,\n testIdPrefix,\n ...otherProps\n}: TimePickerProps) => {\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const incrementMinute = useCallback(\n (increment: number) => {\n let newMinutes = minutes + increment;\n let newHours = hours;\n\n if (newMinutes >= 60) {\n newMinutes = 0;\n newHours = (newHours + 1) % 24;\n } else if (newMinutes < 0) {\n newMinutes = 59;\n newHours = (newHours + 23) % 24; // minus 1 hour\n }\n onTimeChange({ hours: newHours, minutes: newMinutes, seconds });\n },\n [hours, minutes, seconds, onTimeChange]\n );\n\n const incrementSeconds = useCallback(\n (increment: number) => {\n let newSeconds = seconds + increment;\n let newMinutes = minutes;\n let newHours = hours;\n\n if (newSeconds >= 60) {\n newSeconds = 0;\n newMinutes += 1;\n\n if (newMinutes >= 60) {\n newMinutes = 0;\n newHours = (newHours + 1) % 24;\n }\n } else if (newSeconds < 0) {\n newSeconds = 59;\n newMinutes -= 1;\n\n if (newMinutes < 0) {\n newMinutes = 59;\n newHours = (newHours + 23) % 24; // minus 1 hour\n }\n }\n onTimeChange({ hours: newHours, minutes: newMinutes, seconds: newSeconds });\n },\n [hours, minutes, seconds, onTimeChange]\n );\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n if (!displaySeconds) {\n const [h, m] = value.split(':');\n if (h !== undefined && m !== undefined) {\n onTimeChange({ hours: parseInt(h, 10), minutes: parseInt(m, 10) });\n }\n } else {\n const [h, m, s] = value.split(':');\n if (h !== undefined && m !== undefined && s !== undefined) {\n onTimeChange({\n hours: parseInt(h, 10),\n minutes: parseInt(m, 10),\n seconds: parseInt(s, 10),\n });\n }\n }\n },\n [displaySeconds, onTimeChange]\n );\n\n const displayedSecondsPart = displaySeconds ? `:${formatTimeValue(seconds, 59)}` : '';\n const selectedTime = `${formatTimeValue(hours, 23)}:${formatTimeValue(minutes, 59)}${displayedSecondsPart}`;\n const hoursRange = [...Array(24).keys()];\n const minutesAndSecondsRange = [...Array(12).keys()].map((i) => i * 5);\n\n const openModal = useCallback(() => setIsModalOpen(true), []);\n const closeModal = useCallback(() => setIsModalOpen(false), []);\n\n return (\n <div data-testid={testIdPrefix ? testIdPrefix : undefined} className=\"ui-time-picker\">\n <Input\n testIdPrefix={testIdPrefix ? testIdPrefix : undefined}\n {...otherProps}\n className={cx('input', 'time-input', otherProps.className)}\n type=\"time\"\n name=\"time\"\n value={selectedTime}\n onClick={openModal}\n onChange={handleChange}\n ref={inputRef}\n step={displaySeconds ? 1 : 60}\n />\n <InputPopover\n inputRef={inputRef}\n isOpen={isModalOpen}\n onClose={closeModal}\n testIdPrefix={testIdPrefix ? `${testIdPrefix}-modal` : undefined}\n >\n <div className=\"time-picker-container\">\n <TimeRange\n range={hoursRange}\n selectedItem={hours}\n className=\"hour\"\n onSelectItem={(h) => onTimeChange({ hours: h, minutes, seconds })}\n />\n\n <div className=\"time-separator\">:</div>\n\n <div className=\"minute-container\">\n <TimeRange\n range={minutesAndSecondsRange}\n selectedItem={minutes}\n className=\"minute\"\n onSelectItem={(m) => onTimeChange({ hours, minutes: m, seconds })}\n />\n <div className=\"minute-buttons\">\n <button\n data-testid={testIdPrefix ? `${testIdPrefix}-decrement-minute` : undefined}\n onClick={() => incrementMinute(-1)}\n className=\"minute-button\"\n >\n -1mn\n </button>\n <button\n data-testid={testIdPrefix ? `${testIdPrefix}-increment-minute` : undefined}\n onClick={() => incrementMinute(1)}\n className=\"minute-button\"\n >\n +1mn\n </button>\n </div>\n </div>\n {displaySeconds && (\n <>\n <div className=\"time-separator\">:</div>\n <div className=\"second-container\">\n <TimeRange\n range={minutesAndSecondsRange}\n selectedItem={seconds}\n className=\"second\"\n onSelectItem={(s) => onTimeChange({ hours, minutes, seconds: s })}\n />\n <div className=\"second-buttons\">\n <button onClick={() => incrementSeconds(-1)} className=\"second-button\">\n -1s\n </button>\n <button onClick={() => incrementSeconds(1)} className=\"second-button\">\n +1s\n </button>\n </div>\n </div>\n </>\n )}\n </div>\n </InputPopover>\n </div>\n );\n};\n\nexport default TimePicker;\n","import React, { useEffect, useState } from 'react';\nimport type { ChangeEvent, MouseEvent, KeyboardEvent, InputHTMLAttributes } from 'react';\n\nimport cx from 'classnames';\n\nexport type SliderProps = InputHTMLAttributes<HTMLInputElement> & {\n width?: number;\n onChangeCommitted?: (e: MouseEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => void;\n containerClassName?: string;\n};\n\n// onChange returns an event or number\nconst Slider = ({\n id,\n value: initialValue,\n min = 0,\n max = 100,\n step = 1,\n width = 112,\n onChange,\n onChangeCommitted,\n disabled,\n className,\n containerClassName,\n ...rest\n}: SliderProps) => {\n const [value, setValue] = useState<number>(\n initialValue !== undefined ? Number(initialValue) : Number(min)\n );\n\n useEffect(() => {\n // TODO: fix this lint\n /* eslint-disable-next-line react/set-state-in-effect react/no-deriving-state-in-effects */\n setValue(Number(initialValue));\n }, [initialValue]);\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number(e.target.value);\n setValue(newValue);\n onChange?.(e);\n };\n\n const handleCommit = (e: MouseEvent<HTMLInputElement> | KeyboardEvent<HTMLInputElement>) => {\n if (onChangeCommitted) {\n onChangeCommitted(e);\n }\n };\n\n // margin to keep the colored track aligned with the thumb\n const visualMargin = 5;\n const visualMin = Number(min) - visualMargin;\n const visualMax = Number(max) + visualMargin;\n const visualProgress = ((value - visualMin) / (visualMax - visualMin)) * 100;\n\n return (\n <div\n className={cx('ui-range-wrapper', containerClassName, { disabled })}\n style={{ width: `${width}px` }}\n >\n <input\n data-testid=\"range-slider\"\n type=\"range\"\n className={cx('range-slider', className)}\n id={id}\n value={value}\n min={min}\n max={max}\n step={step}\n onChange={handleChange}\n onMouseUp={handleCommit}\n onKeyUp={handleCommit}\n disabled={disabled}\n style={\n {\n '--slider-progress': `${visualProgress}%`,\n } as React.CSSProperties\n }\n {...rest}\n />\n </div>\n );\n};\n\nexport default Slider;\n","export const TOLERANCE_RANGES = [\n { label: '00', value: 0 },\n { label: '05', value: 300 },\n { label: '10', value: 600 },\n { label: '15', value: 900 },\n { label: '20', value: 1200 },\n { label: '25', value: 1500 },\n { label: '30', value: 1800 },\n { label: '35', value: 2100 },\n { label: '40', value: 2400 },\n { label: '45', value: 2700 },\n { label: '60', value: 3600 },\n { label: '75', value: 4500 },\n { label: '90', value: 5400 },\n { label: '105', value: 6300 },\n { label: '120', value: 7200 },\n { label: '150', value: 9000 },\n { label: '180', value: 10800 },\n { label: '210', value: 12600 },\n { label: '240', value: 14400 },\n];\n","import React from 'react';\n\nimport cx from 'classnames';\n\nimport { TOLERANCE_RANGES } from './consts';\n\nexport type ToleranceRangeGridProps = {\n onSelection: (value: number) => void;\n selectedTolerance: number;\n toleranceSign: 'minus' | 'plus';\n};\n\nconst ToleranceRangeGrid = ({\n onSelection,\n selectedTolerance,\n toleranceSign,\n}: ToleranceRangeGridProps) => (\n <div className=\"tolerance-picker-section\">\n <div className={`tolerance-grid ${toleranceSign}-tolerance`}>\n {TOLERANCE_RANGES.map(({ label, value }, index) => (\n <button\n key={`${label}-${index}`}\n className={cx('minute', { selected: selectedTolerance === value })}\n style={{ gridArea: `a${index + 1}` }}\n onClick={() => onSelection(value)}\n >\n {`${toleranceSign === 'minus' ? '-' : '+'}${label}`}\n </button>\n ))}\n </div>\n </div>\n);\n\nexport default ToleranceRangeGrid;\n","import React, { useState, useRef, useEffect, useCallback } from 'react';\n\nimport Input, { type InputProps } from '../Input';\nimport Popover from '../InputPopover';\nimport { type StatusWithMessage } from '../StatusMessage';\nimport { TOLERANCE_RANGES } from './consts';\nimport ToleranceRangeGrid from './ToleranceRangeGrid';\n\nconst DEFAULT_TOLERANCE_VALUES = {\n minusTolerance: TOLERANCE_RANGES[0].value,\n plusTolerance: TOLERANCE_RANGES[0].value,\n};\n\nexport type ToleranceValues = {\n minusTolerance: number;\n plusTolerance: number;\n};\n\nexport type TolerancePickerProps = Omit<InputProps, 'value'> & {\n onToleranceChange: (toleranceValues: ToleranceValues) => void;\n toleranceValues?: ToleranceValues;\n translateWarningMessage?: (invalidTolerance: number) => string;\n testIdPrefix?: string;\n};\n\nconst TolerancePicker = ({\n onToleranceChange,\n toleranceValues: { minusTolerance, plusTolerance } = DEFAULT_TOLERANCE_VALUES,\n translateWarningMessage,\n testIdPrefix,\n ...inputProps\n}: TolerancePickerProps) => {\n const formatToleranceValue = useCallback(\n (minusIndex: number, plusIndex: number) =>\n `-${TOLERANCE_RANGES[minusIndex]?.label || ''}/+${TOLERANCE_RANGES[plusIndex]?.label || ''}`,\n []\n );\n\n const [showPicker, setShowPicker] = useState(false);\n const [inputValue, setInputValue] = useState(formatToleranceValue(0, 0));\n const [warningStatus, setWarningStatus] = useState<StatusWithMessage | undefined>(undefined);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n const minusToleranceIndex = TOLERANCE_RANGES.findIndex(\n (range) => range.value === minusTolerance\n );\n const plusToleranceIndex = TOLERANCE_RANGES.findIndex((range) => range.value === plusTolerance);\n if (minusToleranceIndex < 0 || plusToleranceIndex < 0) {\n const invalidTolerance = minusToleranceIndex < 0 ? minusTolerance : plusTolerance;\n\n /* eslint-disable-next-line react/set-state-in-effect */\n setWarningStatus({\n status: 'warning',\n message:\n translateWarningMessage?.(invalidTolerance) ||\n `${invalidTolerance} is not a valid tolerance value.`,\n });\n } else {\n setWarningStatus(undefined);\n }\n\n setInputValue(formatToleranceValue(minusToleranceIndex, plusToleranceIndex));\n }, [formatToleranceValue, minusTolerance, plusTolerance, translateWarningMessage]);\n\n return (\n <div data-testid={testIdPrefix ? testIdPrefix : undefined} className=\"ui-tolerance-picker\">\n <div>\n <Input\n testIdPrefix={testIdPrefix}\n {...inputProps}\n value={inputValue}\n statusWithMessage={warningStatus}\n onClick={() => setShowPicker(!showPicker)}\n type=\"text\"\n ref={inputRef}\n />\n </div>\n\n <Popover\n testIdPrefix=\"modal\"\n inputRef={inputRef}\n isOpen={showPicker}\n onClose={() => setShowPicker(false)}\n >\n <div className=\"time-tolerance\">\n <ToleranceRangeGrid\n onSelection={(e) => onToleranceChange({ minusTolerance: e, plusTolerance })}\n selectedTolerance={minusTolerance}\n toleranceSign=\"minus\"\n />\n\n <div className=\"divider\" />\n\n <ToleranceRangeGrid\n onSelection={(e) => onToleranceChange({ minusTolerance, plusTolerance: e })}\n selectedTolerance={plusTolerance}\n toleranceSign=\"plus\"\n />\n </div>\n </Popover>\n </div>\n );\n};\n\nexport default TolerancePicker;\n","import React, { useRef, useState } from 'react';\n\nimport { X } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nexport type TokenInputProps = {\n label: string;\n tokens: string[];\n small?: boolean;\n onChange?: (tokens: string[]) => void;\n onBlur?: () => void;\n className?: string;\n dataTestId?: string;\n autoFocus?: boolean;\n};\n\nconst TokenInput = ({\n label,\n tokens: initialTokens,\n small,\n onChange,\n onBlur,\n className,\n dataTestId,\n autoFocus,\n}: TokenInputProps) => {\n const [tokens, setTokens] = useState(initialTokens);\n\n // Allow to update the tokens state when an update comes from outside the component\n // See react docs: https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes\n const [prevInitialTokens, setPrevInitialTokens] = useState(initialTokens);\n if (initialTokens !== prevInitialTokens) {\n setPrevInitialTokens(initialTokens);\n setTokens(initialTokens);\n }\n\n const [newToken, setNewToken] = useState('');\n const [selectedToken, setSelectedToken] = useState<number | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const addToken = (token: string) => {\n const newTokens = [...tokens, token];\n setTokens(newTokens);\n onChange?.(newTokens);\n };\n\n const removeToken = (index: number) => {\n const newTokens = tokens.toSpliced(index, 1);\n setTokens(newTokens);\n onChange?.(newTokens);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case 'Enter':\n // Prevent the keypress from submitting a surrounding form\n e.preventDefault();\n if (newToken.trim() !== '') {\n addToken(newToken);\n setNewToken('');\n }\n break;\n case 'Backspace':\n if (tokens.length > 0 && newToken === '') removeToken(tokens.length - 1);\n break;\n default:\n break;\n }\n };\n\n const focusInput = (e: React.MouseEvent<HTMLDivElement>) => {\n if (e.target === e.currentTarget) {\n inputRef.current?.focus();\n }\n };\n\n return (\n <div className={cx('ui-token-input-wrapper', { small }, className)} data-testid={dataTestId}>\n <label className=\"input-label\">{label}</label>\n <div className=\"tokens-wrapper\" onClick={focusInput}>\n {tokens.map((token, index) => (\n <div\n key={`${token}-${index}`}\n onClick={() => setSelectedToken(index)}\n className={cx('token-item-wrapper', { selected: selectedToken === index })}\n data-testid={dataTestId ? `${dataTestId}-token` : undefined}\n >\n <span className=\"token-label\">{token}</span>\n <span\n className=\"token-close-btn\"\n onClick={() => removeToken(index)}\n data-testid={dataTestId ? `${dataTestId}-token-remove` : undefined}\n >\n <X size={small ? 'sm' : 'lg'} />\n </span>\n </div>\n ))}\n <input\n type=\"text\"\n value={newToken}\n onChange={(e) => setNewToken(e.target.value)}\n onKeyDown={handleKeyDown}\n onBlur={onBlur}\n className=\"token-input\"\n ref={inputRef}\n data-testid={dataTestId ? `${dataTestId}-input` : undefined}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={autoFocus}\n />\n </div>\n </div>\n );\n};\n\nexport default TokenInput;\n","export type AmbientVariant = 'A' | 'B' | 'C' | 'D';\n\nexport const colors = {\n ambientA5: 'rgb(246, 248, 249)',\n ambientA10: 'rgb(239, 243, 245)',\n ambientA15: 'rgb(233, 239, 242)',\n ambientB5: 'rgb(250, 249, 245)',\n ambientB10: 'rgb(247, 246, 238)',\n ambientB15: 'rgb(242, 240, 228)',\n ambientC5: 'rgb(246, 249, 246)',\n ambientC10: 'rgb(240, 244, 241)',\n ambientC15: 'rgb(234, 240, 235)',\n ambientD5: 'rgb(248, 247, 253)',\n ambientD10: 'rgb(244, 243, 252)',\n ambientD15: 'rgb(239, 237, 247)',\n blackAlpha: 'rgba(0, 0, 0)',\n};\n\nexport const TABLE_AMBIENT_THEMES: Record<\n AmbientVariant,\n {\n mix1: string;\n mix2: string;\n odd: string;\n even: string;\n }\n> = {\n A: {\n mix1: colors.blackAlpha,\n mix2: colors.ambientA5,\n odd: colors.ambientA10,\n even: colors.ambientA15,\n },\n B: {\n mix1: colors.blackAlpha,\n mix2: colors.ambientB5,\n odd: colors.ambientB10,\n even: colors.ambientB15,\n },\n C: {\n mix1: colors.blackAlpha,\n mix2: colors.ambientC5,\n odd: colors.ambientC10,\n even: colors.ambientC15,\n },\n D: {\n mix1: colors.blackAlpha,\n mix2: colors.ambientD5,\n odd: colors.ambientD10,\n even: colors.ambientD15,\n },\n};\n","import React from 'react';\n\nimport { type AmbientVariant, TABLE_AMBIENT_THEMES } from './tableAmbientThemes';\n\ninterface TableColumn {\n key: string;\n label: string;\n className?: string;\n}\n\ntype TableValue = string | number | boolean | null | undefined;\ninterface TableProps {\n columns: Array<TableColumn>;\n data: Array<Record<string, TableValue>>;\n ambientVariant?: AmbientVariant;\n}\n\nconst Table = ({ columns, data, ambientVariant = 'B' }: TableProps) => {\n const theme = TABLE_AMBIENT_THEMES[ambientVariant];\n return (\n <table\n className=\"table-container ambient\"\n style={\n {\n '--mix-color-1': theme.mix1,\n '--mix-color-2': theme.mix2,\n '--row-bg-odd': theme.odd,\n '--row-bg-even': theme.even,\n } as React.CSSProperties\n }\n >\n <thead>\n <tr>\n {columns.map((col) => (\n <td key={col.key} className={col.className}>\n {col.label}\n </td>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.map((row, i) => (\n <tr key={i}>\n {columns.map((col) => (\n <td key={col.key} className={col.className}>\n {row[col.key]}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n\nexport default Table;\n","import React, { useEffect, useRef, type DialogHTMLAttributes } from 'react';\n\nimport cx from 'classnames';\n\ntype ModalProps = DialogHTMLAttributes<HTMLDialogElement> & {\n fullscreen?: boolean;\n headerClassname?: string;\n bodyClassname?: string;\n footerClassname?: string;\n header: React.ReactNode;\n footer: React.ReactNode;\n};\n\n/**\n * Display a styled dialog box.\n * You are in charge of its lifecycle (open & close), this componant just display it.\n *\n * Children must be an array of 3 items, where :\n * - the first one is for the header\n * - the second one is for the content\n * - the last is for the footer\n *\n * NB: Inside header, only title tags have the good style (font weight and size)\n */\nconst Dialog = ({\n children,\n className,\n fullscreen = false,\n header,\n headerClassname,\n footer,\n footerClassname,\n bodyClassname,\n ...dialogProps\n}: ModalProps) => {\n const overlayRef = useRef<HTMLDivElement>(null);\n const dialogRef = useRef<HTMLDialogElement>(null);\n\n /**\n * When the dialog height change\n * => check if there is a scroll on the overlay and if so add a 'scroll' class on it\n */\n useEffect(() => {\n if (fullscreen) return;\n if (!overlayRef.current || !dialogRef.current) return;\n const resizeObserver = new ResizeObserver(() => {\n if (overlayRef.current) {\n if (overlayRef.current.scrollHeight > overlayRef.current.clientHeight) {\n overlayRef.current.classList.add('scroll');\n } else {\n overlayRef.current.classList.remove('scroll');\n }\n }\n });\n resizeObserver.observe(dialogRef.current);\n return () => resizeObserver.disconnect();\n }, [overlayRef, dialogRef, fullscreen]);\n\n return (\n <div\n ref={overlayRef}\n className=\"ui-dialog-overlay flex items-center justify-center\"\n tabIndex={-1}\n >\n <dialog\n ref={dialogRef}\n {...dialogProps}\n className={cx('dialog-content', className, fullscreen && 'fullscreen')}\n open\n >\n <header className={cx(headerClassname)}>{header}</header>\n <section className={cx(bodyClassname)}>{children}</section>\n <footer className={cx(footerClassname)}>{footer}</footer>\n </dialog>\n </div>\n );\n};\n\nexport default Dialog;\n","import React, { useEffect, useRef, useState, type ReactNode } from 'react';\n\nimport { ChevronDown, ChevronUp } from '@osrd-project/ui-icons';\nimport cx from 'classnames';\n\nimport useOutsideClick from '../hooks/useOutsideClick';\nimport { usePopoverPosition } from '../hooks/usePopoverPosition';\n\nexport type OptionGroupItem<T> = {\n value: T;\n label: string;\n};\n\nexport type OptionGroupSection<T> = {\n title: string;\n items: OptionGroupItem<T>[];\n icon?: ReactNode;\n};\n\nexport type OptionGroupProps<T> = {\n sections: OptionGroupSection<T>[];\n selectedValue?: T;\n onSelect: (value: T) => void;\n getItemKey: (value: T) => string;\n};\n\nconst OptionGroup = <T,>({\n sections,\n selectedValue,\n onSelect,\n getItemKey,\n}: OptionGroupProps<T>) => {\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const { popoverPosition, calculatePosition } = usePopoverPosition(\n triggerRef,\n panelRef,\n 0,\n 'start',\n 'top'\n );\n\n const selectedKey = selectedValue !== undefined ? getItemKey(selectedValue) : undefined;\n const selectedSection = sections.find(({ items }) =>\n items.some(({ value }) => getItemKey(value) === selectedKey)\n );\n const selectedItem = selectedSection?.items.find(\n ({ value }) => getItemKey(value) === selectedKey\n );\n\n useEffect(() => {\n if (isOpen && panelRef.current && !panelRef.current.matches(':popover-open')) {\n panelRef.current.showPopover();\n calculatePosition();\n }\n }, [isOpen, calculatePosition]);\n\n useOutsideClick(isOpen ? panelRef : null, () => setIsOpen(false));\n\n return (\n <>\n <button\n ref={triggerRef}\n type=\"button\"\n className=\"ui-option-group-trigger\"\n title={selectedItem?.label}\n onClick={() => setIsOpen(true)}\n >\n {!isOpen && selectedSection?.icon}\n <span className=\"option-group-trigger-label\">{selectedItem?.label}</span>\n {isOpen ? <ChevronUp size=\"sm\" /> : <ChevronDown size=\"sm\" />}\n </button>\n {isOpen && (\n <div\n ref={panelRef}\n className=\"ui-option-group\"\n popover=\"manual\"\n style={{ top: popoverPosition.top, left: popoverPosition.left }}\n >\n {sections.map((section) => (\n <div key={section.title} className=\"option-group-section\">\n <div className=\"option-group-section-title\">{section.title}</div>\n {section.items.map((item) => {\n const itemKey = getItemKey(item.value);\n return (\n <button\n key={itemKey}\n type=\"button\"\n className={cx('option-group-item', { selected: itemKey === selectedKey })}\n title={item.label}\n onClick={() => {\n onSelect(item.value);\n setIsOpen(false);\n }}\n >\n <span className=\"option-group-item-label\">{item.label}</span>\n </button>\n );\n })}\n </div>\n ))}\n </div>\n )}\n </>\n );\n};\n\nexport default OptionGroup;\n","import React, { useMemo } from 'react';\n\nimport cx from 'classnames';\n\nexport type SegmentedControlProps<T> = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'value' | 'onChange' | 'checked'\n> & {\n options: Array<T>;\n onChange: (option: T) => void;\n value: T;\n getOptionLabel: (option: T) => string;\n getOptionValue: (option: T) => string;\n getOptionIcon?: (option: T) => React.ReactNode;\n small?: boolean;\n};\n\nconst SegmentedControl = <T,>({\n options,\n onChange,\n value,\n getOptionLabel,\n getOptionValue,\n getOptionIcon,\n small = false,\n ...inputProps\n}: SegmentedControlProps<T>) => {\n const opts = useMemo(\n () =>\n options.map((e) => ({\n value: getOptionValue(e),\n label: getOptionLabel(e),\n icon: getOptionIcon ? getOptionIcon(e) : null,\n source: e,\n })),\n [options, getOptionValue, getOptionLabel, getOptionIcon]\n );\n return (\n <div className={cx('segmented-control', { small })}>\n {opts.map((option) => (\n <label\n key={option.value}\n className={cx(\n 'segmented-control-option',\n option.value === getOptionValue(value) && 'checked'\n )}\n title={option.label}\n data-testid={`segmented-control-${option.value}`}\n >\n <div className=\"segmented-control-option-content\">\n {option.icon ? option.icon : option.label}\n </div>\n <input\n {...inputProps}\n type=\"radio\"\n checked={option.value === getOptionValue(value)}\n onChange={() => onChange(option.source)}\n />\n </label>\n ))}\n </div>\n );\n};\n\nexport default SegmentedControl;\n"],"mappings":";;;;AAmBA,MAAM,UAAU,EACd,OACA,UAAU,WACV,YAAY,OACZ,aAAa,OACb,cAAc,MACd,UAAU,MACV,OAAO,SACP,SACA,YACA,GAAG,eACc;CACjB,MAAM,oBAAoB;EACxB,IAAI,CAAC,aAAa,CAAC,cAAc,SAC/B,QAAQ;CAEZ;CAEA,OACE,sBAAA,cAAC,UAAD;EACE,GAAI;EACJ,WAAW,GACT,+BACA,SAAS,WACT,QAAQ,YAAY,GACpB,KAAK,YAAY,GACjB,EACE,SAAS,UACX,CACF;EACA,eAAa;EACb,SAAS;EACT,UAAU,cAAc;CAKlB,GAHL,eAAe,sBAAA,cAAC,QAAD,EAAM,WAAU,oBAAuC,GAAlB,WAAkB,GACtE,OACA,YAAY,QAAQ,sBAAA,cAAC,QAAD,EAAM,WAAU,eAA8B,GAAd,OAAc,CAC7D;AAEZ;;ACxDA,MAAM,mBACJ,KACA,YACG;CACH,MAAM,qBAAqB,gBAAgB,UAAsB;EAC/D,IAAI,KAAK,WAAW,CAAC,IAAI,QAAQ,SAAS,MAAM,MAAc,GAC5D,QAAQ,KAAK;CAEjB,CAAC;CAED,gBAAgB;EACd,SAAS,iBAAiB,aAAa,kBAAkB;EACzD,aAAa;GACX,SAAS,oBAAoB,aAAa,kBAAkB;EAC9D;CACF,GAAG,CAAC,CAAC;AACP;;ACJA,SAAS,cAAc,EAAE,QAAQ,WAA+B;CAC9D,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CAkBtD,OAAO;EAAE,aAhBW,aACjB,UAAsC;GACrC,IAAI,MAAM,QAAQ,OAAO,gBAAgB,IAAI;GAC7C,UAAU,KAAK;EACjB,GACA,CAAC,OAAO,CAWS;EAAG,YARH,aAChB,UAAmC;GAClC,gBAAgB,KAAK;GACrB,SAAS,KAAK;EAChB,GACA,CAAC,MAAM,CAGsB;EAAG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