{"version":3,"file":"form.cjs","sources":["../src/FeedbackText.tsx","../src/InputGroupContext.tsx","../src/InputGroupLabel.tsx","../src/VariantProvider.tsx","../src/BaseFormControl.tsx","../src/Checkbox.tsx","../src/Fieldset.tsx","../src/RadioGroupContext.tsx","../src/Radio.tsx","../src/inputPanel/InputPanelBase.tsx","../src/inputPanel/RadioPanel.tsx","../src/inputPanel/CheckboxPanel.tsx","../src/RadioGroup.tsx","../src/Switch.tsx","../src/utils.ts","../src/TextArea.tsx","../src/TextField.tsx","../src/segmentedControl/SegmentedControl.tsx","../src/segmentedControl/utils.ts","../src/segmentedControl/SegmentedChoice.tsx","../src/segmentedControl/index.ts","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n  ValidationErrorFilledIcon,\n  ValidationExclamationFilledIcon,\n  ValidationSuccessFilledIcon,\n} from '@entur/icons';\nimport { SubLabel } from '@entur/typography';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport './FeedbackText.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst AlertIcon = ({\n  variant,\n}: {\n  variant: VariantType | typeof info | typeof error;\n}) => {\n  const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n  switch (variant) {\n    case 'success':\n      return (\n        <ValidationSuccessFilledIcon aria-hidden=\"true\" className={iconClass} />\n      );\n    case 'negative':\n      return (\n        <ValidationErrorFilledIcon aria-hidden=\"true\" className={iconClass} />\n      );\n    case 'information':\n      return null;\n    case 'warning':\n      return (\n        <ValidationExclamationFilledIcon\n          aria-hidden=\"true\"\n          className={iconClass}\n        />\n      );\n    case error:\n      return (\n        <ValidationErrorFilledIcon aria-hidden=\"true\" className={iconClass} />\n      );\n    case info:\n      return null;\n    default:\n      return null;\n  }\n};\n\nexport type FeedbackTextProps = {\n  /** Teksten som vises. Uten tekst rendres en tom (usynlig) container,\n   * slik at en aria-live-region kan eksistere i DOM før meldingen settes */\n  children?: React.ReactNode;\n  /** Skjuler ikonet */\n  hideIcon?: boolean;\n  /** Feedbackvarianten*/\n  variant?: VariantType | typeof error | typeof info;\n  /** Ekstra klassenavn */\n  className?: string;\n  [key: string]: any;\n};\nexport const FeedbackText = ({\n  children,\n  hideIcon = false,\n  variant,\n  className,\n  ...rest\n}: FeedbackTextProps) => {\n  const hasContent = children !== undefined && children !== null;\n  return (\n    <SubLabel\n      className={classNames(\n        'eds-feedback-text',\n        {\n          'eds-feedback-text--information':\n            variant === info || variant === 'information',\n          'eds-feedback-text--empty': !hasContent,\n        },\n        className,\n      )}\n      {...rest}\n    >\n      {hasContent && !hideIcon && variant && <AlertIcon variant={variant} />}\n      {hasContent && (\n        <span className=\"eds-feedback-text__text\">{children}</span>\n      )}\n    </SubLabel>\n  );\n};\n","import * as React from 'react';\n\ntype InputGroupContextType = {\n  isFilled: boolean;\n  setFilled: (e: boolean) => void;\n};\n\nconst InputGroupContext = React.createContext<InputGroupContextType>({\n  isFilled: false,\n  setFilled: () => null,\n});\n\nexport const InputGroupContextProvider = ({\n  children,\n}: {\n  children: React.ReactNode;\n}) => {\n  const [filled, setFilled] = React.useState(false);\n\n  const value = React.useMemo(\n    () => ({ isFilled: filled, setFilled }),\n    [filled, setFilled],\n  );\n\n  return (\n    <InputGroupContext.Provider value={value}>\n      {children}\n    </InputGroupContext.Provider>\n  );\n};\n\nexport const useInputGroupContext = (): InputGroupContextType =>\n  React.useContext(InputGroupContext);\n","import classNames from 'classnames';\nimport React from 'react';\nimport { useInputGroupContext } from './InputGroupContext';\nimport './InputGroupLabel.scss';\n\nexport type InputGroupLabelProps = {\n  label?: React.ReactNode;\n  required?: boolean;\n  labelTooltip?: string;\n  labelId: string;\n  isFilled?: boolean;\n  staticAnimation?: boolean;\n} & React.DetailedHTMLProps<\n  React.LabelHTMLAttributes<HTMLLabelElement>,\n  HTMLLabelElement\n>;\n\nexport const InputGroupLabel = ({\n  label,\n  required,\n  labelId,\n  staticAnimation = false,\n  className,\n  isFilled: forceIsFilled,\n  ...rest\n}: InputGroupLabelProps) => {\n  const { isFilled } = useInputGroupContext();\n  const filler = staticAnimation || (forceIsFilled ?? isFilled);\n  return (\n    <label\n      className={classNames(className, {\n        'eds-input-group-label-wrapper--filled': filler,\n        'eds-input-group-label-wrapper--controlled-label-position':\n          forceIsFilled !== undefined,\n      })}\n      id={labelId}\n      {...rest}\n    >\n      <span\n        className={classNames('eds-input-group__label', {\n          'eds-input-group__label--filled': filler,\n        })}\n      >\n        {label} {required && <span>*</span>}\n      </span>\n    </label>\n  );\n};\n","import React from 'react';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst VariantContext = React.createContext<\n  VariantType | typeof error | typeof info | null\n>(null);\n\nexport type VariantProviderProps = {\n  children: React.ReactNode;\n  variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider = ({\n  children,\n  variant,\n}: VariantProviderProps) => {\n  return (\n    <VariantContext.Provider value={variant ?? null}>\n      {children}\n    </VariantContext.Provider>\n  );\n};\n\nexport const useVariant: () =>\n  | VariantType\n  | typeof error\n  | typeof info\n  | null = () => {\n  const context = React.useContext(VariantContext);\n  return context;\n};\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType } from '@entur/utils';\nimport { QuestionIcon } from '@entur/icons';\nimport { Placement, Tooltip } from '@entur/tooltip';\nimport { IconButton } from '@entur/button';\n\nimport { FeedbackText } from './FeedbackText';\nimport { InputGroupContextProvider } from './InputGroupContext';\nimport { InputGroupLabel } from './InputGroupLabel';\nimport { useVariant } from './VariantProvider';\n\nimport './BaseFormControl.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\n/** Props som styrer hvordan feedback-teksten annonseres av skjermlesere.\n * Deles av alle skjemakomponentene som rendrer en feedback-tekst */\nexport type FeedbackAnnouncementProps = {\n  /** Styrer hvordan feedback-teksten annonseres av skjermlesere.\n   * Standarden 'status' lar skjermleseren annonsere meldingen når\n   * brukeren er ferdig med det den holder på med, og live region-en\n   * rendres da alltid i DOM, også før meldingen finnes.\n   * true/'alert' gir role=\"alert\", som avbryter skjermleseren og\n   * annonserer meldingen umiddelbart – bruk den bare til meldinger som\n   * hindrer brukeren i å komme videre. false skrur av automatisk\n   * annonsering.\n   * @default 'status'\n   */\n  ariaAlertOnFeedback?: boolean | 'alert' | 'status';\n  /** Ekstra props som sendes til feedback-teksten. Egne `role`- og\n   * `aria-live`-verdier her overstyrer ariaAlertOnFeedback */\n  feedbackProps?: React.HTMLAttributes<HTMLElement>;\n};\n\nexport type BaseFormControlProps = React.HTMLAttributes<HTMLDivElement> &\n  FeedbackAnnouncementProps & {\n    /** Et skjemaelement med `eds-form-control`-klassen */\n    children: React.ReactNode;\n    /** Ekstra klassenavn */\n    className?: string;\n    /** Sett til true om skjema-elementet er disabled */\n    disabled?: boolean;\n    /** Sett til true om skjema-elementet er i read-only modus */\n    readOnly?: boolean;\n    /** Tekst eller ikon som vises foran skjema-elementet */\n    prepend?: React.ReactNode;\n    /** Tekst eller ikon som vises etter skjema-elementet */\n    append?: React.ReactNode;\n    /** Valideringsvariant */\n    variant?: VariantType | typeof error | typeof info;\n    /**Størrelsen på skjemaelementet\n     * @default \"medium\"\n     */\n    size?: 'medium' | 'large';\n    /** Label til inputfeltet */\n    label: React.ReactNode;\n    /** En tooltip som forklarer labelen til inputfeltet */\n    labelTooltip?: React.ReactNode;\n    /** Forklarende tekst for knappen som åpner labelTooltip */\n    labelTooltipButtonAriaLabel?: string;\n    labelTooltipPlacement?: Placement;\n    /** Illustrerer om inputfeltet er påkrevd eller ikke */\n    required?: boolean;\n    /** ID som settes på labelen til inputfeltet */\n    labelId: string;\n    /** Varselmelding, som vil komme under form-komponenten */\n    feedback?: string;\n    /** Om inputfeltet er fylt med data. Brukes for plassering av label */\n    isFilled?: boolean;\n    /**Ekstra props som sendes til label */\n    labelProps?: { [key: string]: any };\n    /** Ekstra styling */\n    style?: React.CSSProperties;\n    /** Plasserer labelen statisk på toppen av inputfeltet */\n    disableLabelAnimation?: boolean;\n    onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n    /** Legg til et element etter feltet */\n    after?: React.ReactNode;\n    /** Legg til et element før feltet */\n    before?: React.ReactNode;\n    /** Aria-label som brukes når inputfeltet er i read-only modus */\n    ariaLabelOnReadOnly?: string;\n  };\n\nexport const BaseFormControl = React.forwardRef<\n  HTMLDivElement,\n  BaseFormControlProps\n>(\n  (\n    {\n      after,\n      before,\n      children,\n      className,\n      disabled = false,\n      readOnly = false,\n      variant,\n      prepend,\n      append,\n      size = 'medium',\n      isFilled,\n      label,\n      required,\n      labelTooltip,\n      labelTooltipButtonAriaLabel = `Klikk for tilleggsinfo om ${label}-feltet`,\n      labelTooltipPlacement = 'top',\n      feedback,\n      labelId,\n      labelProps,\n      style,\n      disableLabelAnimation = false,\n      ariaAlertOnFeedback = 'status',\n      feedbackProps,\n      ariaLabelOnReadOnly = 'Dette skjemafeltet kan bare leses',\n      ...rest\n    },\n    ref,\n  ) => {\n    const contextVariant = useVariant();\n    const currentVariant = variant || contextVariant || undefined;\n\n    const {\n      role: feedbackRoleOverride,\n      'aria-live': feedbackAriaLive,\n      ...restFeedbackProps\n    } = feedbackProps ?? {};\n\n    const defaultFeedbackRole =\n      ariaAlertOnFeedback === true || ariaAlertOnFeedback === 'alert'\n        ? 'alert'\n        : ariaAlertOnFeedback === 'status'\n        ? 'status'\n        : undefined;\n\n    // role and aria-live passed by the developer win over our own props\n    const feedbackRole =\n      feedbackRoleOverride ??\n      (feedbackAriaLive !== undefined ? undefined : defaultFeedbackRole);\n    const isLiveRegion =\n      feedbackRole !== undefined || feedbackAriaLive !== undefined;\n    const showFeedback = Boolean(feedback && currentVariant);\n\n    return (\n      <InputGroupContextProvider>\n        <div\n          className={classNames(\n            'eds-form-control__field-and-feedback-text',\n            className,\n            {\n              'eds-form-control__field-and-feedback-text--has-tooltip':\n                labelTooltip !== undefined,\n            },\n          )}\n          style={style}\n        >\n          {before}\n          <div\n            className={classNames(\n              'eds-form-control-wrapper',\n              `eds-form-control-wrapper--size-${size}`,\n              {\n                'eds-form-control-wrapper--success':\n                  currentVariant === 'success',\n                'eds-form-control-wrapper--negative':\n                  currentVariant === 'negative' || currentVariant === error,\n                'eds-form-control-wrapper--disabled': disabled,\n                'eds-form-control-wrapper--readonly': readOnly,\n                'eds-form-control-wrapper--is-filled': isFilled,\n              },\n            )}\n            ref={ref}\n            tabIndex={readOnly ? -1 : undefined}\n            {...rest}\n          >\n            {prepend && (\n              <div className=\"eds-form-control__prepend\">{prepend}</div>\n            )}\n            <InputGroupLabel\n              label={label}\n              required={required}\n              labelId={labelId}\n              staticAnimation={disableLabelAnimation}\n              aria-label={\n                readOnly ? `${label}, ${ariaLabelOnReadOnly}` : undefined\n              }\n              {...labelProps}\n            />\n            {labelTooltip && (\n              <Tooltip\n                content={labelTooltip}\n                placement={labelTooltipPlacement}\n                showCloseButton={false}\n                disableFocusListener={true}\n                disableHoverListener={true}\n                disableClickListener={false}\n                disableKeyboardListener={false}\n              >\n                <IconButton\n                  as=\"span\"\n                  tabIndex={0}\n                  role=\"button\"\n                  className=\"eds-form-control__append eds-form-control__append--tooltip\"\n                  aria-label={labelTooltipButtonAriaLabel}\n                >\n                  <QuestionIcon\n                    className=\"eds-input-group__label-tooltip-icon\"\n                    aria-hidden=\"true\"\n                  />\n                </IconButton>\n              </Tooltip>\n            )}\n            {children}\n            {append && <div className=\"eds-form-control__append\">{append}</div>}\n          </div>\n          {(isLiveRegion || showFeedback) && (\n            // Live region-en rendres alltid, slik at den finnes i DOM før\n            // feedback-teksten settes — ellers annonserer ikke skjermlesere\n            // innholdet pålitelig\n            <FeedbackText\n              variant={currentVariant}\n              role={feedbackRole}\n              aria-live={feedbackAriaLive}\n              {...restFeedbackProps}\n            >\n              {showFeedback ? feedback : undefined}\n            </FeedbackText>\n          )}\n          {after}\n        </div>\n      </InputGroupContextProvider>\n    );\n  },\n);\n","import React, { CSSProperties } from 'react';\nimport cx from 'classnames';\nimport { Paragraph } from '@entur/typography';\nimport { mergeRefs } from '@entur/utils';\n\nimport './Checkbox.scss';\n\nexport type CheckboxProps = {\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Label for checkboxen, som vises ved høyre side. */\n  children?: React.ReactNode;\n  /** Om Checkbox er avmerket, eller om den er i en indeterminate state */\n  checked?: 'indeterminate' | boolean;\n  /** Callback for Checkbox */\n  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n  /** Om checkboxen er disabled eller ikke\n   * @default false\n   */\n  disabled?: boolean;\n  /** Sett til true om skjema-elementet er i read-only modus\n   * @default false\n   */\n  readOnly?: boolean;\n  /**Ekstra styling til komponenten */\n  style?: CSSProperties;\n  /** Reduserer klikkflaten for Checkbox'en\n   * @default false\n   */\n  reduceClickArea?: boolean;\n  /** Om animasjon skal deaktiveres\n   * @default false\n   */\n  disableAnimation?: boolean;\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'checked'>;\n\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n  (\n    {\n      checked,\n      className,\n      children,\n      style,\n      disabled = false,\n      readOnly = false,\n      reduceClickArea,\n      disableAnimation = false,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const inputRef = React.useRef<HTMLInputElement>(null);\n\n    const isIndeterminate = checked === 'indeterminate';\n    const isControlled = checked !== undefined;\n\n    React.useEffect(() => {\n      if (inputRef && inputRef.current) {\n        inputRef.current.indeterminate = isIndeterminate;\n      }\n    }, [isIndeterminate]);\n\n    return (\n      <label\n        className={cx('eds-checkbox', 'eds-checkbox__container', className, {\n          'eds-checkbox--disabled': disabled,\n          'eds-checkbox--readonly': readOnly,\n          'eds-checkbox__container--reduced-click-area': reduceClickArea,\n        })}\n        style={style}\n      >\n        <input\n          type=\"checkbox\"\n          ref={mergeRefs(ref, inputRef)}\n          checked={isControlled ? checked === true : undefined}\n          disabled={disabled}\n          onKeyDown={e => {\n            if (readOnly && (e.key === ' ' || e.key === 'Enter')) {\n              e.preventDefault();\n              e.stopPropagation();\n            }\n          }}\n          aria-label={\n            readOnly ? ` ${children?.toString()}. Kan ikke endres` : undefined\n          }\n          {...rest}\n        />\n        <span\n          className={cx('eds-checkbox__icon', {\n            'eds-checkbox__icon--disabled': disabled,\n            'eds-checkbox__icon--readonly': readOnly,\n            'eds-checkbox__icon--reduced-click-area': reduceClickArea,\n            'eds-checkbox__icon--no-animation':\n              disableAnimation || disabled || readOnly,\n          })}\n        >\n          <CheckboxIcon indeterminate={isIndeterminate} />\n        </span>\n        {children && (\n          <Paragraph className=\"eds-checkbox__label\" margin=\"none\" as=\"span\">\n            {children}\n          </Paragraph>\n        )}\n      </label>\n    );\n  },\n);\n\nconst CheckboxIcon = ({\n  indeterminate = false,\n}: {\n  indeterminate: boolean;\n}) => {\n  return (\n    <svg\n      className=\"eds-checkbox-icon\"\n      width=\"11px\"\n      height=\"9px\"\n      viewBox=\"6 11 37 33\"\n      aria-hidden={true}\n    >\n      {indeterminate ? (\n        <rect x=\"10\" y=\"25\" width=\"28\" height=\"5\" fill=\"white\" />\n      ) : (\n        <path d=\"M14.1 27.2l7.1 7.2 14.6-14.8\" fill=\"none\" />\n      )}\n    </svg>\n  );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { Heading5 } from '@entur/typography';\nimport './Fieldset.scss';\n\nexport type FieldsetProps = {\n  /** Innholdet i felt-gruppen. */\n  children: React.ReactNode;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Labelen til felt-gruppen. */\n  label?: React.ReactNode;\n  [key: string]: any;\n};\n\nexport const Fieldset = ({\n  children,\n  className,\n  label,\n  ...rest\n}: FieldsetProps) => (\n  <fieldset className={classNames('eds-fieldset', className)} {...rest}>\n    {label && <Heading5 as=\"legend\">{label}</Heading5>}\n    {children}\n  </fieldset>\n);\n","import React from 'react';\n\ntype RadioGroupContextProps = {\n  name: string;\n  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n  value: string | null;\n  readOnly?: boolean;\n  disabled?: boolean;\n};\n\nconst RadioGroupContext = React.createContext<RadioGroupContextProps | null>(\n  null,\n);\n\nexport const RadioGroupContextProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext: () => RadioGroupContextProps = () => {\n  const context = React.useContext(RadioGroupContext);\n  if (!context) {\n    throw new Error(\n      'You need to wrap your RadioButtons in a RadioGroup component',\n    );\n  }\n  return context;\n};\n","import React from 'react';\nimport cx from 'classnames';\nimport { Paragraph } from '@entur/typography';\nimport { useRadioGroupContext } from './RadioGroupContext';\nimport './Radio.scss';\n\nexport type RadioProps = {\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Label til radio-button. Vises ved høyre side. */\n  children?: React.ReactNode;\n  /** Verdien til radioknappen */\n  value: string;\n  /** Om radiobutton er disabled eller ikke\n   * @default false\n   */\n  disabled?: boolean;\n  /** Beskrivelse som leses opp av skjermlesere når radiobutton er readonly */\n  readOnlyLabelDescription?: string;\n} & React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n  (\n    { className, children, value, disabled, readOnlyLabelDescription, ...rest },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const {\n      name,\n      value: selectedValue,\n      onChange,\n      readOnly,\n    } = useRadioGroupContext();\n\n    const classList = cx(className, 'eds-form-component--radio__radio', {\n      'eds-form-component--radio__radio--disabled': disabled,\n      'eds-form-component--radio__radio--readonly': readOnly,\n    });\n\n    return (\n      <label className=\"eds-form-component--radio__container\">\n        <input\n          type=\"radio\"\n          name={rest.name ?? name}\n          ref={ref}\n          value={value}\n          checked={rest.checked ?? selectedValue === value}\n          onChange={e => {\n            if (readOnly) {\n              e.preventDefault();\n              return;\n            }\n            (rest.onChange ?? onChange)?.(e);\n          }}\n          onClick={e => {\n            if (readOnly) {\n              e.preventDefault();\n            }\n          }}\n          disabled={disabled}\n          aria-label={\n            readOnly\n              ? `${children?.toString()}. ${\n                  readOnlyLabelDescription ?? 'Kan ikke endres'\n                }`\n              : undefined\n          }\n          {...rest}\n        />\n        <span className={classList}>\n          <span className=\"eds-form-component--radio__circle\"></span>\n        </span>\n        {children && (\n          <Paragraph\n            margin=\"none\"\n            as=\"span\"\n            className=\"eds-form-component--radio__label\"\n          >\n            {children}\n          </Paragraph>\n        )}\n      </label>\n    );\n  },\n);\n","import React, { useId, useRef } from 'react';\nimport classNames from 'classnames';\nimport { VisuallyHidden } from '@entur/a11y';\nimport { mergeRefs, useForceUpdate } from '@entur/utils';\nimport { Checkbox } from '../Checkbox';\nimport { Radio } from '../Radio';\n\nimport './InputPanelBase.scss';\n\nexport type InputPanelProps = {\n  /** Om det er en radio- eller checkbox-variant */\n  type: string;\n  /** Verdien til input-panelet */\n  value: string;\n  /** Om input-panelet skal være valgt eller ikke */\n  checked?: boolean;\n  /** Hovedtittelen til input-panelet */\n  title: React.ReactNode;\n  /** Ektstra label som står høyrestilt, til venstre for Checkboxen/Radio-button-en */\n  secondaryLabel?: React.ReactNode;\n  /** Ekstra informasjon som legges nederst i input-panelet */\n  children?: React.ReactNode;\n  /** Størrelse på input-panelet\n   * @default \"medium\"\n   */\n  size?: 'medium' | 'large';\n  /**Skjuler checkbox-/radio-button-en i input-panelet\n   * @default false\n   */\n  hideSelectionIndicator?: boolean;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Om input-panelet er deaktivert eller ikke\n   * @default false\n   */\n  disabled?: boolean;\n  /** Om input-panelet er skrivebeskyttet (readonly) eller ikke\n   * @default false\n   */\n  readOnly?: boolean;\n  /** Beskrivelse som leses opp av skjermlesere når input-panelet er skrivebeskyttet (readonly)\n   * @default 'Kan ikke endres'\n   */\n  readOnlyLabelDescription?: string;\n  /** */\n  style?: React.CSSProperties;\n} & Omit<\n  React.DetailedHTMLProps<\n    React.InputHTMLAttributes<HTMLInputElement>,\n    HTMLInputElement\n  >,\n  'title' | 'size'\n>;\n\nconst joinIds = (...ids: (string | false | undefined)[]) =>\n  ids.filter(Boolean).join(' ') || undefined;\n\nexport const InputPanelBase = React.forwardRef<\n  HTMLInputElement,\n  InputPanelProps\n>(\n  (\n    {\n      className,\n      children,\n      value,\n      title,\n      secondaryLabel,\n      size = 'medium',\n      hideSelectionIndicator = false,\n      style,\n      id,\n      disabled = false,\n      readOnly = false,\n      readOnlyLabelDescription = 'Kan ikke endres',\n      type = 'radio',\n      onChange,\n      checked,\n      name,\n      'aria-label': ariaLabel,\n      'aria-labelledby': ariaLabelledby,\n      'aria-describedby': ariaDescribedby,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const classList = classNames('eds-input-panel', {\n      'eds-input-panel--readonly': readOnly,\n      'eds-input-panel--disabled': disabled,\n    });\n\n    const panelClassList = classNames(\n      className,\n      'eds-input-panel__container',\n      `eds-input-panel--${size}`,\n    );\n\n    const inputRef = useRef<HTMLInputElement>(null);\n\n    const defaultId = `eds-inputpanel${useId()}`;\n    const inputPanelId = id || defaultId;\n    const titleId = `${inputPanelId}-title`;\n    const secondaryLabelId = `${inputPanelId}-secondary-label`;\n    const additionalContentId = `${inputPanelId}-additional-content`;\n    const readOnlyDescriptionId = `${inputPanelId}-readonly-description`;\n\n    const hasSecondaryLabel = secondaryLabel !== undefined;\n    const hasCustomLabel = ariaLabelledby !== undefined || !!ariaLabel;\n\n    // title/secondaryLabel are ReactNode, so aria-labelledby (reading the\n    // referenced elements directly) is used instead of stringifying them.\n    const labelledBy = hasCustomLabel\n      ? ariaLabelledby\n      : joinIds(titleId, hasSecondaryLabel && secondaryLabelId);\n    const describedBy = joinIds(\n      ariaDescribedby,\n      !!children && additionalContentId,\n      readOnly && readOnlyDescriptionId,\n    );\n    const forceUpdate = useForceUpdate();\n\n    const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n      if (readOnly) {\n        e.preventDefault();\n        return;\n      }\n\n      if (onChange === undefined) {\n        forceUpdate();\n      }\n\n      onChange?.(e);\n    };\n\n    const handleOnClick = (e: React.MouseEvent<HTMLInputElement>) => {\n      if (readOnly) {\n        e.preventDefault();\n        e.stopPropagation();\n      }\n    };\n\n    const handleOnKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n      if (readOnly && (e.key === ' ' || e.key === 'Enter')) {\n        e.preventDefault();\n        e.stopPropagation();\n      }\n    };\n\n    return (\n      <label className={classList} htmlFor={inputPanelId}>\n        <input\n          type={type}\n          name={name}\n          ref={mergeRefs(ref, inputRef)}\n          value={value}\n          checked={checked}\n          onChange={handleOnChange}\n          onClick={handleOnClick}\n          onKeyDown={handleOnKeyDown}\n          id={inputPanelId}\n          disabled={disabled}\n          readOnly={readOnly}\n          aria-label={ariaLabel}\n          aria-labelledby={labelledBy}\n          aria-describedby={describedBy}\n          {...rest}\n        />\n        <div className={panelClassList} style={style}>\n          <div className=\"eds-input-panel__title-wrapper\">\n            <div id={titleId} className=\"eds-input-panel__title\">\n              {title}\n            </div>\n            <div className=\"eds-input-panel__secondary-label-and-icon-wrapper\">\n              {hasSecondaryLabel && (\n                <span id={secondaryLabelId}>{secondaryLabel}</span>\n              )}\n              <span style={{ pointerEvents: 'none' }}>\n                {!hideSelectionIndicator &&\n                  (type === 'radio' ? (\n                    <Radio\n                      name=\"\"\n                      value=\"\"\n                      checked={checked ?? inputRef.current?.checked ?? false}\n                      onChange={() => {\n                        return;\n                      }}\n                      disabled={disabled}\n                      readOnly={readOnly}\n                      aria-hidden=\"true\"\n                      tabIndex={-1}\n                    />\n                  ) : (\n                    <Checkbox\n                      checked={checked ?? inputRef.current?.checked ?? false}\n                      onChange={() => null}\n                      disabled={disabled}\n                      readOnly={readOnly}\n                      aria-hidden=\"true\"\n                      tabIndex={-1}\n                    />\n                  ))}\n              </span>\n            </div>\n          </div>\n          {readOnly && (\n            <VisuallyHidden id={readOnlyDescriptionId}>\n              {readOnlyLabelDescription}\n            </VisuallyHidden>\n          )}\n          {children && (\n            <div\n              id={additionalContentId}\n              className=\"eds-input-panel__additional-content\"\n            >\n              {children}\n            </div>\n          )}\n        </div>\n      </label>\n    );\n  },\n);\n","import React from 'react';\nimport { useRadioGroupContext } from '../RadioGroupContext';\nimport { InputPanelBase } from './InputPanelBase';\n\nexport type RadioPanelProps = {\n  /** Verdien til radio-panelet */\n  value: string;\n  /** Hovedtittelen til radio-panelet */\n  title: React.ReactNode;\n  /** Ektstra label som står høyrestilt, til venstre for radio-button-en */\n  secondaryLabel?: React.ReactNode;\n  /** Ekstra informasjon som legges nederst i radio-panelet */\n  children?: React.ReactNode;\n  /** Størrelse på radio-panelet\n   * @default \"medium\"\n   */\n  size?: 'medium' | 'large';\n  /**Skjuler radio-button-en i radio-panelet\n   * @default false\n   */\n  hideRadioButton?: boolean;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Om radio-panelet er deaktivert eller ikke\n   * @default false\n   */\n  disabled?: boolean;\n  /** Om radio-panelet er skrivebeskyttet (readonly) eller ikke\n   * @default false\n   */\n  readOnly?: boolean;\n  /** Beskrivelse som leses opp av skjermlesere når radio-panelet er skrivebeskyttet (readonly)\n   * @default 'Kan ikke endres'\n   */\n  readOnlyLabelDescription?: string;\n  /** */\n  style?: React.CSSProperties;\n} & Omit<\n  React.DetailedHTMLProps<\n    React.InputHTMLAttributes<HTMLInputElement>,\n    HTMLInputElement\n  >,\n  'title' | 'size'\n>;\n\nexport const RadioPanel = React.forwardRef<HTMLInputElement, RadioPanelProps>(\n  (\n    {\n      className,\n      children,\n      value,\n      title,\n      secondaryLabel,\n      size = 'medium',\n      hideRadioButton = false,\n      style,\n      id,\n      disabled,\n      readOnly,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const {\n      name,\n      value: selected,\n      onChange,\n      readOnly: groupReadOnly,\n      disabled: groupDisabled,\n    } = useRadioGroupContext();\n\n    return (\n      <InputPanelBase\n        type=\"radio\"\n        name={name}\n        title={title}\n        value={value}\n        checked={selected === value}\n        onChange={onChange}\n        className={className}\n        secondaryLabel={secondaryLabel}\n        size={size}\n        hideSelectionIndicator={hideRadioButton}\n        style={style}\n        id={id}\n        disabled={disabled ?? groupDisabled}\n        readOnly={readOnly ?? groupReadOnly}\n        {...rest}\n        ref={ref}\n      >\n        {children}\n      </InputPanelBase>\n    );\n  },\n);\n","import React from 'react';\nimport { InputPanelBase } from './InputPanelBase';\n\nexport type CheckboxPanelProps = {\n  /** Verdien til CheckboxPanel */\n  value: string;\n  /** Om checkbox-panelet skal være valgt eller ikke */\n  checked?: boolean;\n  /** Hovedtittelen til CheckboxPanel */\n  title: React.ReactNode;\n  /** Ektstra label som står høyrestilt mot Checkboxen */\n  secondaryLabel?: React.ReactNode;\n  /** Ekstra informasjon som legges nederst i CheckboxPanel */\n  children?: React.ReactNode;\n  /** Størrelse på CheckboxPanel\n   * @default \"medium\"\n   */\n  size?: 'medium' | 'large';\n  /**Skjuler checkbox-en i CheckboxPanel\n   * @default false\n   */\n  hideCheckbox?: boolean;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Om CheckboxPanel er deaktivert eller ikke\n   * @default false\n   */\n  disabled?: boolean;\n  /** Om CheckboxPanel er skrivebeskyttet (readonly) eller ikke\n   * @default false\n   */\n  readOnly?: boolean;\n  /** Beskrivelse som leses opp av skjermlesere når CheckboxPanel er skrivebeskyttet (readonly)\n   * @default 'Kan ikke endres'\n   */\n  readOnlyLabelDescription?: string;\n  /** */\n  style?: React.CSSProperties;\n} & Omit<\n  React.DetailedHTMLProps<\n    React.InputHTMLAttributes<HTMLInputElement>,\n    HTMLInputElement\n  >,\n  'title' | 'size'\n>;\n\nexport const CheckboxPanel = React.forwardRef<\n  HTMLInputElement,\n  CheckboxPanelProps\n>(\n  (\n    {\n      name,\n      checked,\n      onChange,\n      className,\n      children,\n      value,\n      title,\n      secondaryLabel,\n      size = 'medium',\n      hideCheckbox = false,\n      style,\n      id,\n      disabled = false,\n      readOnly = false,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    return (\n      <InputPanelBase\n        type=\"checkbox\"\n        name={name}\n        title={title}\n        value={value}\n        checked={checked}\n        onChange={onChange}\n        className={className}\n        secondaryLabel={secondaryLabel}\n        size={size}\n        hideSelectionIndicator={hideCheckbox}\n        style={style}\n        id={id}\n        disabled={disabled}\n        readOnly={readOnly}\n        {...rest}\n        ref={ref}\n      >\n        {children}\n      </InputPanelBase>\n    );\n  },\n);\n","import React from 'react';\nimport { RadioGroupContextProvider } from './RadioGroupContext';\nimport { Fieldset } from './Fieldset';\n\nexport type RadioGroupProps = {\n  /** Navnet til radiogruppen. */\n  name: string;\n  /** Overskrift over radiogruppen */\n  label?: string;\n  /** Verdien til den valgte radioknappen */\n  value: string | null;\n  /** Radioknappene sendes inn som children */\n  children: React.ReactNode;\n  /** En callback som blir kalles hver gang en radioknapp klikkes på  */\n  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n  [key: string]: any;\n  /** Sett radiogruppen i readonly-modus */\n  readOnly?: boolean;\n  /** Sett radiogruppen i disabled-modus */\n  disabled?: boolean;\n};\n\nexport const RadioGroup = ({\n  name,\n  value,\n  children,\n  onChange,\n  label,\n  readOnly = false,\n  disabled = false,\n  ...rest\n}: RadioGroupProps) => {\n  const contextValue = React.useMemo(\n    () => ({ name, value, onChange, readOnly, disabled }),\n    [name, value, onChange, readOnly, disabled],\n  );\n  return (\n    <RadioGroupContextProvider value={contextValue}>\n      {label ? (\n        <Fieldset label={label} {...rest}>\n          {children}\n        </Fieldset>\n      ) : (\n        children\n      )}\n    </RadioGroupContextProvider>\n  );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { colors } from '@entur/tokens';\nimport { CheckIcon, CloseSmallIcon } from '@entur/icons';\nimport './Switch.scss';\n\nexport type SwitchProps = {\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Label for Switch-en. */\n  children?: React.ReactNode;\n  /** Posisjonen til label for Switch-en.\n   * @default \"right\"\n   */\n  labelPlacement?: 'right' | 'bottom';\n  /** Om switch-en er checked eller ikke */\n  checked?: boolean;\n  /** Ikonet som skal stå inne i sirkelen på Switch-en */\n  icon?: React.ReactNode;\n  /** Skjul ikonet inne i sikrelen på Switch-en\n   * @default false\n   */\n  hideIcon?: boolean;\n  /** Farge som settes på ikon og bakgrunn når Switch-en er \"checked\"\n   * @default colors.validation.mint\n   */\n  color?: string;\n  /** Farge på bakgrunn når Switch-en er \"checked\" og står i en kontrast-seksjon\n   * @default colors.validation.mintContrast\n   */\n  contrastColor?: string;\n  /** Størrelsen på Switch-en\n   * @default \"medium\"\n   */\n  size?: 'medium' | 'large';\n  /** Callback for når verdien endres */\n  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;\n\nexport const Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n  (\n    {\n      className,\n      children,\n      labelPlacement = 'right',\n      icon,\n      hideIcon = false,\n      color = colors.validation.mint,\n      contrastColor = colors.validation.mintContrast,\n      size = 'medium',\n      checked,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const displayedIcon = () => {\n      if (icon) return icon;\n      if (checked === undefined) return <></>;\n      const iconSize = size === 'large' ? 23 : undefined;\n      return checked ? (\n        <CheckIcon size={iconSize} />\n      ) : (\n        <CloseSmallIcon size={iconSize} />\n      );\n    };\n\n    return (\n      <label\n        className={classNames(\n          'eds-switch',\n          `eds-switch--${labelPlacement}`,\n          className,\n        )}\n        style={{ ...rest.style }}\n      >\n        <input type=\"checkbox\" ref={ref} checked={checked} {...rest} />\n        <span\n          className={classNames(\n            'eds-switch__switch',\n            `eds-switch__switch--${size}`,\n          )}\n          style={\n            {\n              '--eds-switch-color': color,\n              '--eds-switch-contrast-color': contrastColor,\n            } as React.CSSProperties\n          }\n          aria-hidden=\"true\"\n        >\n          <span className=\"eds-switch__circle\">\n            {!hideIcon && displayedIcon()}\n          </span>\n        </span>\n        {children && (\n          <span\n            className={classNames(\n              'eds-switch__label',\n              `eds-switch__label--${size}--${labelPlacement}`,\n            )}\n          >\n            {children}\n          </span>\n        )}\n      </label>\n    );\n  },\n);\n","export function hasValue(value: any): boolean {\n  return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj - Can be a string, an object with a value property (controlled input),\n//              or an HTMLInputElement (uncontrolled input)\n// @param SSR - If true, also checks defaultValue property for SSR/uncontrolled initial state\n// @returns {boolean} False when not present or empty string.\n//                    True when any number or string with length.\nexport function isFilled(obj: any, SSR = false): boolean {\n  if (obj == null) {\n    return false;\n  }\n\n  // Handle string values directly\n  if (typeof obj === 'string') {\n    return obj !== '';\n  }\n\n  // Handle objects with value property (controlled inputs, HTMLInputElement, etc.)\n  if (obj && typeof obj === 'object') {\n    // Check current value (works for both controlled { value: \"...\" } and HTMLInputElement)\n    if (hasValue(obj.value) && obj.value !== '') {\n      return true;\n    }\n\n    // Check defaultValue for SSR or uncontrolled initial state\n    if (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '') {\n      return true;\n    }\n  }\n\n  return false;\n}\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType, mergeRefs, useOnMount } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl, FeedbackAnnouncementProps } from './BaseFormControl';\nimport { useInputGroupContext } from './InputGroupContext';\nimport { isFilled } from './utils';\n\nimport './TextArea.scss';\nimport { Placement } from '@entur/tooltip';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type TextAreaProps = {\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Valideringsvariant */\n  variant?: VariantType | typeof error | typeof info;\n  /** Deaktiverer tekstområdet */\n  disabled?: boolean;\n  /** Setter tekstområdet i read-only modus */\n  readOnly?: boolean;\n  /** Label over TextArea */\n  label: string;\n  /** En tooltip som forklarer labelen til inputfeltet */\n  labelTooltip?: React.ReactNode;\n  /** Forklarende tekst for knappen som åpner labelTooltip */\n  labelTooltipButtonAriaLabel?: string;\n  /** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */\n  labelTooltipPlacement?: Placement;\n  /** Varselmelding, som vil komme under TextArea */\n  feedback?: string;\n  /** Plasserer labelen statisk på toppen av inputfeltet\n   * @default false\n   */\n  disableLabelAnimation?: boolean;\n  /** Kontrollerer resize-oppførselen til tekstområdet\n   * @default \"vertical\"\n   */\n  resize?: 'vertical' | 'none';\n} & FeedbackAnnouncementProps &\n  React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n  (\n    {\n      variant,\n      disabled = false,\n      readOnly = false,\n      className,\n      style,\n      label,\n      feedback,\n      labelTooltip,\n      labelTooltipButtonAriaLabel,\n      labelTooltipPlacement,\n      onChange,\n      disableLabelAnimation,\n      resize,\n      ariaAlertOnFeedback,\n      feedbackProps,\n      ...rest\n    },\n    ref: React.Ref<HTMLTextAreaElement>,\n  ) => {\n    const textAreaId = `eds-textarea${useId()}`;\n    const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n    return (\n      <BaseFormControl\n        className={classNames(className, 'eds-textarea__wrapper')}\n        disabled={disabled}\n        readOnly={readOnly}\n        variant={variant}\n        style={style}\n        label={label}\n        labelId={textAreaId}\n        feedback={feedback}\n        labelTooltip={labelTooltip}\n        labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n        labelTooltipPlacement={labelTooltipPlacement}\n        labelProps={{ className: 'eds-textarea__label' }}\n        disableLabelAnimation={disableLabelAnimation}\n        ariaAlertOnFeedback={ariaAlertOnFeedback}\n        feedbackProps={feedbackProps}\n        onClick={e => {\n          if (e.target === e.currentTarget) textareaRef?.current?.focus();\n        }}\n      >\n        <TextAreaBase\n          readOnly={readOnly}\n          disabled={disabled}\n          ref={mergeRefs(ref, textareaRef)}\n          aria-labelledby={textAreaId}\n          onChange={onChange}\n          variant={variant}\n          resize={resize}\n          {...rest}\n        />\n      </BaseFormControl>\n    );\n  },\n);\n\ntype TextAreaBaseProps = {\n  readOnly?: boolean;\n  disabled?: boolean;\n  variant?: VariantType | typeof error | typeof info;\n  resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n  (\n    { readOnly, disabled, onChange, value, variant, resize, style, ...rest },\n    ref,\n  ) => {\n    const contextVariant = useVariant();\n    const currentVariant = variant || contextVariant;\n    const { isFilled: isInputFilled, setFilled: setFiller } =\n      useInputGroupContext();\n\n    useOnMount(() => {\n      if (value?.toString() || rest.defaultValue) {\n        setFiller && !isInputFilled && setFiller(true);\n      }\n    });\n    React.useEffect(() => {\n      if (value?.toString() && setFiller && !isInputFilled) {\n        setFiller(true);\n      }\n    }, [value, setFiller, isInputFilled]);\n\n    const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n      if (isFilled(event.target)) {\n        setFiller && !isInputFilled && setFiller(true);\n      } else {\n        setFiller && isInputFilled && setFiller(false);\n      }\n      if (onChange) {\n        onChange(event);\n      }\n    };\n\n    return (\n      <textarea\n        className=\"eds-form-control eds-textarea\"\n        ref={ref}\n        readOnly={readOnly}\n        disabled={disabled}\n        onChange={handleChange}\n        value={value}\n        aria-invalid={currentVariant === 'negative' || currentVariant === error}\n        style={resize ? { ...style, resize } : style}\n        {...rest}\n      />\n    );\n  },\n);\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { VariantType, mergeRefs } from '@entur/utils';\n\nimport { BaseFormControl, FeedbackAnnouncementProps } from './BaseFormControl';\nimport { useInputGroupContext } from './InputGroupContext';\nimport { isFilled } from './utils';\nimport { useVariant } from './VariantProvider';\nimport './TextField.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type TextFieldProps = {\n  /** Tekst eller ikon som kommer før inputfeltet */\n  prepend?: React.ReactNode;\n  /** Tekst eller ikon som kommer etter inputfeltet */\n  append?: React.ReactNode;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Label over TextField */\n  label: React.ReactNode;\n  /** En tooltip som forklarer labelen til inputfeltet */\n  labelTooltip?: React.ReactNode;\n  /** Forklarende tekst for knappen som åpner labelTooltip */\n  labelTooltipButtonAriaLabel?: string;\n  /** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */\n  labelTooltipPlacement?: Placement;\n  /** Varselmelding, som vil komme under TextField */\n  feedback?: string;\n  /** Hvilken valideringsfarge som vises*/\n  variant?: VariantType | typeof error | typeof info;\n  /** Deaktiver inputfeltet */\n  disabled?: boolean;\n  /** Setter inputfeltet i read-only modus */\n  readOnly?: boolean;\n  /** Størrelsen på TextField\n   * @default \"medium\"\n   */\n  size?: 'medium' | 'large';\n  /** Plasserer labelen statisk på toppen av inputfeltet\n   * @default false\n   */\n  disableLabelAnimation?: boolean;\n  /** Ekstra props som sendes til label-elementet */\n  labelProps?: React.DetailedHTMLProps<\n    React.LabelHTMLAttributes<HTMLLabelElement>,\n    HTMLLabelElement\n  >;\n  /** Om man skal ha muliget for å nullstille TextField. Viser lukkekryss hvis feltet er fylt.\n   * @default false\n   */\n  clearable?: boolean;\n  /** Callback for clearable */\n  onClear?: () => void;\n  /** Aria-label for clear button\n   * @default \"Tøm felt\"\n   */\n  clearButtonAriaLabel?: string;\n} & FeedbackAnnouncementProps &\n  Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'label'>;\n\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n  (\n    {\n      prepend,\n      append,\n      variant,\n      disabled = false,\n      readOnly = false,\n      className,\n      style,\n      size = 'medium',\n      label,\n      required,\n      labelTooltip,\n      labelTooltipButtonAriaLabel,\n      labelTooltipPlacement,\n      feedback,\n      onChange,\n      disableLabelAnimation,\n      labelProps,\n      clearable = false,\n      onClear,\n      clearButtonAriaLabel = 'Tøm felt',\n      value,\n      ariaAlertOnFeedback,\n      feedbackProps,\n      ...rest\n    },\n    ref: React.Ref<HTMLInputElement>,\n  ) => {\n    const randomId = `eds-textfield${useId()}`;\n    const textFieldId = labelProps && labelProps.id ? labelProps.id : randomId;\n    const textFieldRef = React.useRef<HTMLInputElement>(null);\n    const { setFilled } = useInputGroupContext();\n\n    const handleClear = () => {\n      const inputElement = textFieldRef.current;\n      // Trigger an input event with target value \"\" to\n      // both reset uncontrolled value and send an onChange event\n      // for controlled value\n      if (inputElement) {\n        const setNativeInputValue = Object.getOwnPropertyDescriptor(\n          window.HTMLInputElement.prototype,\n          'value',\n        )?.set;\n        setNativeInputValue?.call(inputElement, '');\n\n        const inputEvent = new Event('input', { bubbles: true });\n        inputElement.dispatchEvent(inputEvent);\n        inputElement.focus();\n        setFilled(false);\n      }\n      onClear?.();\n    };\n\n    const _append = React.useMemo((): React.ReactElement | null => {\n      if (!clearable || disabled || readOnly)\n        return (append as React.ReactElement) ?? null;\n\n      return (\n        <div className=\"eds-textfield__append\">\n          {append}\n          <ClearButton onClear={handleClear} ariaLabel={clearButtonAriaLabel} />\n        </div>\n      );\n    }, [append, clearable, disabled, readOnly]);\n\n    return (\n      <BaseFormControl\n        disabled={disabled}\n        readOnly={readOnly}\n        variant={variant}\n        prepend={prepend}\n        append={_append}\n        className={classNames(className, 'eds-textfield__wrapper')}\n        style={style}\n        size={size}\n        label={label}\n        required={required}\n        labelTooltip={labelTooltip}\n        labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n        labelTooltipPlacement={labelTooltipPlacement}\n        labelId={textFieldId}\n        feedback={feedback}\n        disableLabelAnimation={disableLabelAnimation}\n        labelProps={labelProps}\n        ariaAlertOnFeedback={ariaAlertOnFeedback}\n        feedbackProps={feedbackProps}\n        onClick={e => {\n          if (e.target === e.currentTarget) textFieldRef?.current?.focus();\n        }}\n      >\n        <TextFieldBase\n          disabled={disabled}\n          readOnly={readOnly}\n          ref={mergeRefs(ref, textFieldRef)}\n          aria-labelledby={textFieldId}\n          onChange={onChange}\n          value={value}\n          variant={variant}\n          {...rest}\n        />\n      </BaseFormControl>\n    );\n  },\n);\n\ntype TextFieldBaseProps = {\n  /** Deaktiver inputfeltet */\n  disabled?: boolean;\n  /** Setter inputfeltet i read-only modus */\n  readOnly?: boolean;\n  variant?: VariantType | typeof error | typeof info;\n} & React.DetailedHTMLProps<\n  React.InputHTMLAttributes<HTMLInputElement>,\n  HTMLInputElement\n>;\n\nconst TextFieldBase = React.forwardRef<HTMLInputElement, TextFieldBaseProps>(\n  (\n    { disabled, readOnly, placeholder, onChange, value, variant, ...rest },\n    forwardRef,\n  ) => {\n    const contextVariant = useVariant();\n    const currentVariant = variant || contextVariant;\n    const { isFilled: isInputFilled, setFilled: setFiller } =\n      useInputGroupContext();\n    const inputRef = React.useRef<HTMLInputElement>(null);\n\n    React.useEffect(() => {\n      if (setFiller) {\n        const filled = isFilled({ value }) || isFilled(inputRef.current, true);\n        if (filled !== isInputFilled) {\n          setFiller(filled);\n        }\n      }\n    }, [value, setFiller, isInputFilled]);\n\n    const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n      if (setFiller && value === undefined) {\n        const filled = isFilled(event.target);\n        if (filled !== isInputFilled) {\n          setFiller(filled);\n        }\n      }\n      if (onChange) {\n        onChange(event);\n      }\n    };\n\n    return (\n      <input\n        aria-invalid={currentVariant === 'negative' || currentVariant === error}\n        className=\"eds-form-control\"\n        disabled={disabled}\n        readOnly={readOnly}\n        ref={mergeRefs(forwardRef, inputRef)}\n        placeholder={placeholder}\n        onChange={handleChange}\n        value={value}\n        {...rest}\n      />\n    );\n  },\n);\n\nconst ClearButton = ({\n  onClear,\n  ariaLabel,\n}: {\n  onClear: () => void;\n  ariaLabel: string;\n}) => {\n  const { isFilled } = useInputGroupContext();\n  if (isFilled) {\n    return (\n      <>\n        <div className=\"eds-textfield__divider\" />\n        <IconButton\n          className=\"eds-textfield__clear-button\"\n          type=\"button\"\n          aria-label={ariaLabel}\n          onClick={onClear}\n        >\n          <CloseSmallIcon aria-hidden />\n        </IconButton>\n      </>\n    );\n  }\n  return null;\n};\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { ExtendableProps } from '@entur/utils';\nimport './SegmentedControl.scss';\n\ntype SegmentedContextProps = {\n  name: string;\n  onChange: (value: string | null) => void;\n  value: string | null;\n  size: 'medium' | 'large';\n  focusedValue: string | null;\n  setFocusedValue: (value: string | null) => void;\n};\n\nconst SegmentedContext = React.createContext<SegmentedContextProps | null>(\n  null,\n);\n\nexport const useSegmentedContext = (): SegmentedContextProps => {\n  const context = React.useContext(SegmentedContext);\n  if (!context) {\n    throw new Error(\n      'You need to wrap your SegmentedChoice in SegmentedControl',\n    );\n  }\n  return context;\n};\n\nexport type SegmentedControlProps = ExtendableProps<\n  React.HTMLAttributes<HTMLDivElement>,\n  {\n    /** Navn på input-elementene */\n    name?: string;\n    /** Beskrivende tekst */\n    label?: string;\n    /** En eller flere SegmentedChoice-komponenter */\n    children: React.ReactNode;\n    /**\n     * Den valgte verdien (kontrollert modus).\n     * Bruk `value` for kontrollert eller evt. `defaultValue` for ukontrollert komponent.\n     */\n    value?: string | null;\n    /**\n     * Standard verdi (ukontrollert modus).\n     * Brukes når komponenten skal håndtere sin egen tilstand.\n     */\n    defaultValue?: string | null;\n    /**\n     * Callback for når det gjøres et valg.\n     * Påkrevd for kontrollert modus (`value` eller `selectedValue`).\n     */\n    onChange?: (value: string | null) => void;\n    /** Størrelsen på SegmentedChoice-komponentene */\n    size?: 'medium' | 'large';\n    /** Ekstra klassenavn */\n    className?: string;\n    /** @deprecated Bruk `value` for kontrollert eller `defaultValue` for ukontrollert oppførsel i stedet.\n     *\n     * Vi beveger oss gradvis mot å standardisere props for å følge\n     * HTML-standarder. Derfor vil vi etter hvert avvikle `selectedValue` og lignende props over tid. */\n    selectedValue?: string | null;\n  }\n>;\n\nexport const SegmentedControl = React.forwardRef<\n  HTMLDivElement,\n  SegmentedControlProps\n>(\n  (\n    {\n      children,\n      label,\n      name,\n      onChange,\n      value,\n      defaultValue,\n      size = 'medium',\n      className,\n      selectedValue: deprecatedValue,\n      ...rest\n    },\n    ref,\n  ) => {\n    const [internalValue, setInternalValue] = React.useState<string | null>(\n      defaultValue ?? null,\n    );\n    const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n    const id = `eds-segmented-control${useId()}`;\n\n    const isControlled = deprecatedValue !== undefined || value !== undefined;\n    const currentValue =\n      deprecatedValue !== undefined\n        ? deprecatedValue\n        : value !== undefined\n        ? value\n        : internalValue;\n\n    const handleChange = React.useCallback(\n      (newValue: string | null) => {\n        if (!isControlled) {\n          setInternalValue(newValue);\n        }\n\n        onChange?.(newValue);\n      },\n      [isControlled, onChange],\n    );\n\n    const contextValue = React.useMemo(\n      () => ({\n        name: name ?? label ?? id,\n        onChange: handleChange,\n        value: currentValue,\n        size,\n        focusedValue,\n        setFocusedValue,\n      }),\n      [id, name, handleChange, currentValue, size, focusedValue, label],\n    );\n\n    const labelId = `${id}-label`;\n\n    return (\n      <SegmentedContext.Provider value={contextValue}>\n        <div\n          className={classNames('eds-segmented-control', className)}\n          role=\"radiogroup\"\n          aria-labelledby={label ? labelId : undefined}\n          ref={ref}\n          {...rest}\n        >\n          {label !== undefined && (\n            <Label htmlFor={id} id={labelId}>\n              {label}\n            </Label>\n          )}\n          <input\n            name={name ?? label ?? id}\n            value={currentValue ?? undefined}\n            type=\"hidden\"\n            id={id}\n          />\n          <div className=\"eds-segmented-control__choices\">\n            {React.Children.map(children, (child, index) => {\n              if (index === 0 && React.isValidElement(child))\n                return React.cloneElement(child, {\n                  'data-first-child': true,\n                } as any);\n\n              return child;\n            })}\n          </div>\n        </div>\n      </SegmentedContext.Provider>\n    );\n  },\n);\n","export const getNextWithDataValue = (\n  el: HTMLElement | null,\n): HTMLElement | null => {\n  let current = el?.nextElementSibling as HTMLElement | null;\n  while (current) {\n    if (current.hasAttribute('data-value')) return current;\n    current = current.nextElementSibling as HTMLElement | null;\n  }\n  return null;\n};\n\nexport const getPrevWithDataValue = (\n  el: HTMLElement | null,\n): HTMLElement | null => {\n  let current = el?.previousElementSibling as HTMLElement | null;\n  while (current) {\n    if (current.hasAttribute('data-value')) return current;\n    current = current.previousElementSibling as HTMLElement | null;\n  }\n  return null;\n};\n\nexport const getFirstWithDataValue = (\n  parent: HTMLElement | null,\n): HTMLElement | null => {\n  let current = parent?.firstElementChild as HTMLElement | null;\n  while (current) {\n    if (current.hasAttribute('data-value')) return current;\n    current = current.nextElementSibling as HTMLElement | null;\n  }\n  return null;\n};\n\nexport const getLastWithDataValue = (\n  parent: HTMLElement | null,\n): HTMLElement | null => {\n  let current = parent?.lastElementChild as HTMLElement | null;\n  while (current) {\n    if (current.hasAttribute('data-value')) return current;\n    current = current.previousElementSibling as HTMLElement | null;\n  }\n  return null;\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { useSegmentedContext } from './SegmentedControl';\nimport {\n  PolymorphicComponentPropsWithRef,\n  PolymorphicRef,\n  forwardRefPolymorphic,\n} from '@entur/utils';\nimport {\n  getFirstWithDataValue,\n  getLastWithDataValue,\n  getNextWithDataValue,\n  getPrevWithDataValue,\n} from './utils';\n\nimport './SegmentedChoice.scss';\n\nexport type SegmentedChoiceOwnProps = {\n  /** Verdien til valget */\n  value: string;\n  /** Innhold som beskriver valget */\n  children: React.ReactNode;\n  /** Ekstra klassenavn */\n  className?: string;\n  /** Callback for når valget endres */\n  onChange?: (value: string) => void;\n};\n\nexport type SegmentedChoiceProps<T extends React.ElementType> =\n  PolymorphicComponentPropsWithRef<T, SegmentedChoiceOwnProps>;\n\nexport type SegmentedChoiceComponent = <\n  T extends React.ElementType = typeof defaultElement,\n>(\n  props: SegmentedChoiceProps<T>,\n) => React.ReactElement | null;\n\nconst defaultElement = 'button';\n\nexport const SegmentedChoice = forwardRefPolymorphic<SegmentedChoiceComponent>(\n  function SegmentedChoice<E extends React.ElementType = typeof defaultElement>(\n    {\n      children,\n      className,\n      style,\n      value,\n      as,\n      onChange,\n      'data-first-child': isFirstChild,\n      ...rest\n    }: SegmentedChoiceProps<E>,\n    ref?: PolymorphicRef<E>,\n  ): React.ReactElement | null {\n    const Element: React.ElementType = as || defaultElement;\n\n    const {\n      value: selectedValue,\n      onChange: contextOnChange,\n      size,\n      focusedValue,\n      setFocusedValue,\n    } = useSegmentedContext();\n\n    const isChecked = selectedValue === value;\n\n    const tabIndex = React.useMemo(() => {\n      if (selectedValue !== null) return isChecked ? 0 : -1;\n      return isFirstChild ? 0 : -1;\n    }, [isChecked, selectedValue, isFirstChild]);\n\n    const handleSelection = () => {\n      contextOnChange(value);\n      onChange?.(value);\n    };\n\n    const handleKeyDown = (e: React.KeyboardEvent) => {\n      const current = e.currentTarget as HTMLElement;\n\n      const focusChoice = (el: HTMLElement | null) => {\n        if (!el) return;\n        el.focus();\n        setFocusedValue(el.getAttribute('data-value') || null);\n      };\n\n      switch (e.key) {\n        case 'ArrowLeft':\n        case 'ArrowUp': {\n          e.preventDefault();\n          focusChoice(getPrevWithDataValue(current));\n          break;\n        }\n        case 'ArrowRight':\n        case 'ArrowDown': {\n          e.preventDefault();\n          focusChoice(getNextWithDataValue(current));\n          break;\n        }\n        case 'Home': {\n          e.preventDefault();\n          const parent = current.parentElement as HTMLElement | null;\n          focusChoice(getFirstWithDataValue(parent));\n          break;\n        }\n        case 'End': {\n          e.preventDefault();\n          const parent = current.parentElement as HTMLElement | null;\n          focusChoice(getLastWithDataValue(parent));\n          break;\n        }\n        case ' ':\n          e.preventDefault();\n          if (as === 'a') {\n            handleSelection();\n            const linkElement = e.currentTarget as HTMLAnchorElement;\n            if (linkElement.href) {\n              // Delay click until state update is complete\n              queueMicrotask(() => {\n                linkElement.click();\n              });\n            }\n          } else {\n            handleSelection();\n          }\n          break;\n        case 'Enter':\n          handleSelection();\n          break;\n        case 'Escape':\n          e.preventDefault();\n          setFocusedValue(null);\n          break;\n      }\n    };\n\n    const onFocus = React.useCallback(() => {\n      setFocusedValue(value);\n    }, [setFocusedValue, value]);\n\n    const onBlur = React.useCallback(() => {\n      if (focusedValue === value) {\n        setFocusedValue(null);\n      }\n    }, [focusedValue, value, setFocusedValue]);\n\n    const elementProps = {\n      className: classNames(\n        'eds-segmented-choice',\n        {\n          'eds-segmented-choice--large': size === 'large',\n        },\n        className,\n      ),\n      style: style,\n      'aria-checked': isChecked,\n      'data-value': value,\n      ref: ref,\n      tabIndex: tabIndex,\n      onClick: handleSelection,\n      onKeyDown: handleKeyDown,\n      onFocus: onFocus,\n      onBlur: onBlur,\n      role: 'radio',\n\n      // For defaultElement button we override type submit\n      ...(as === undefined && { type: 'button' }),\n      ...rest,\n    };\n\n    return <Element {...elementProps}>{children}</Element>;\n  },\n);\n","import { SegmentedControl as SegmentedControlParent } from './SegmentedControl';\nimport { SegmentedChoice } from './SegmentedChoice';\n\ntype SegmentedControl = typeof SegmentedControlParent & {\n  /**\n   * Et valg i en SegmentedControl.\n   *\n   * @example\n   * <SegmentedControl.Item value='1'>Item 1</SegmentedControl.Item>\n   */\n  Item: typeof SegmentedChoice & { displayName?: string };\n};\n\n/**\n * Vis en gruppe med nært beslektede valg som påvirker et objekt, en tilstand eller en visning.\n *\n * @example\n * <SegmentedControl onChange={(value) => console.log(value)}>\n *   <SegmentedControl.Item value='1'>Item 1</SegmentedControl.Item>\n *   <SegmentedControl.Item value='2'>Item 2</SegmentedControl.Item>\n *   <SegmentedControl.Item value='3'>Item 3</SegmentedControl.Item>\n * </SegmentedControl>\n */\nexport const SegmentedControlComponent: SegmentedControl = Object.assign(\n  SegmentedControlParent,\n  {\n    Item: SegmentedChoice,\n  },\n);\n\nSegmentedControlComponent.Item.displayName = 'SegmentedControl.Item';\n\nexport type { SegmentedControlProps } from './SegmentedControl';\nexport type { SegmentedChoiceProps } from './SegmentedChoice';\nexport { SegmentedControlComponent as SegmentedControl, SegmentedChoice };\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('form', 'icons', 'typography');\n\nexport * from './BaseFormControl';\nexport * from './Checkbox';\nexport * from './FeedbackText';\nexport * from './Fieldset';\nexport * from './InputGroupLabel';\nexport * from './InputGroupContext';\nexport * from './inputPanel';\nexport * from './Radio';\nexport * from './RadioGroup';\nexport * from './Switch';\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './VariantProvider';\nexport * from './variants';\nexport * from './utils';\nexport * from './segmentedControl';\n"],"names":["error","jsx","ValidationSuccessFilledIcon","ValidationErrorFilledIcon","ValidationExclamationFilledIcon","jsxs","SubLabel","React","isFilled","Tooltip","IconButton","QuestionIcon","cx","mergeRefs","Paragraph","Heading5","useRef","useId","useForceUpdate","VisuallyHidden","colors","Fragment","CheckIcon","CloseSmallIcon","useOnMount","Label","forwardRefPolymorphic","SegmentedChoice","SegmentedControlParent","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAAY,CAAC;AAAA,EACjB;AACF,MAEM;AACJ,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACEC,2BAAAA,IAACC,MAAAA,6BAAA,EAA4B,eAAY,QAAO,WAAW,WAAW;AAAA,IAE1E,KAAK;AACH,aACED,2BAAAA,IAACE,MAAAA,2BAAA,EAA0B,eAAY,QAAO,WAAW,WAAW;AAAA,IAExE,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aACEF,2BAAAA;AAAAA,QAACG,MAAAA;AAAAA,QAAA;AAAA,UACC,eAAY;AAAA,UACZ,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAKJ;AACH,aACEC,2BAA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