@entur/form 9.2.5-beta.0 → 9.2.6-next.0
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/form.cjs.js +45 -21
- package/dist/form.cjs.js.map +1 -1
- package/dist/form.esm.js +45 -21
- package/dist/form.esm.js.map +1 -1
- package/dist/segmentedControl/utils.d.ts +4 -0
- package/package.json +3 -3
package/dist/form.cjs.js
CHANGED
|
@@ -237,7 +237,7 @@ const BaseFormControl = React.forwardRef(
|
|
|
237
237
|
showCloseButton: false,
|
|
238
238
|
disableFocusListener: true,
|
|
239
239
|
disableHoverListener: true,
|
|
240
|
-
|
|
240
|
+
disableClickListener: false,
|
|
241
241
|
disableKeyboardListener: false,
|
|
242
242
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
243
243
|
button.IconButton,
|
|
@@ -1053,6 +1053,38 @@ const SegmentedControl = React.forwardRef(
|
|
|
1053
1053
|
) });
|
|
1054
1054
|
}
|
|
1055
1055
|
);
|
|
1056
|
+
const getNextWithDataValue = (el) => {
|
|
1057
|
+
let current = el?.nextElementSibling;
|
|
1058
|
+
while (current) {
|
|
1059
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1060
|
+
current = current.nextElementSibling;
|
|
1061
|
+
}
|
|
1062
|
+
return null;
|
|
1063
|
+
};
|
|
1064
|
+
const getPrevWithDataValue = (el) => {
|
|
1065
|
+
let current = el?.previousElementSibling;
|
|
1066
|
+
while (current) {
|
|
1067
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1068
|
+
current = current.previousElementSibling;
|
|
1069
|
+
}
|
|
1070
|
+
return null;
|
|
1071
|
+
};
|
|
1072
|
+
const getFirstWithDataValue = (parent) => {
|
|
1073
|
+
let current = parent?.firstElementChild;
|
|
1074
|
+
while (current) {
|
|
1075
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1076
|
+
current = current.nextElementSibling;
|
|
1077
|
+
}
|
|
1078
|
+
return null;
|
|
1079
|
+
};
|
|
1080
|
+
const getLastWithDataValue = (parent) => {
|
|
1081
|
+
let current = parent?.lastElementChild;
|
|
1082
|
+
while (current) {
|
|
1083
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1084
|
+
current = current.previousElementSibling;
|
|
1085
|
+
}
|
|
1086
|
+
return null;
|
|
1087
|
+
};
|
|
1056
1088
|
const defaultElement = "button";
|
|
1057
1089
|
const SegmentedChoice = React.forwardRef(function SegmentedChoice2({
|
|
1058
1090
|
children,
|
|
@@ -1082,43 +1114,35 @@ const SegmentedChoice = React.forwardRef(function SegmentedChoice2({
|
|
|
1082
1114
|
onChange?.(value);
|
|
1083
1115
|
};
|
|
1084
1116
|
const handleKeyDown = (e) => {
|
|
1117
|
+
const current = e.currentTarget;
|
|
1118
|
+
const focusChoice = (el) => {
|
|
1119
|
+
if (!el) return;
|
|
1120
|
+
el.focus();
|
|
1121
|
+
setFocusedValue(el.getAttribute("data-value") || null);
|
|
1122
|
+
};
|
|
1085
1123
|
switch (e.key) {
|
|
1086
1124
|
case "ArrowLeft":
|
|
1087
1125
|
case "ArrowUp": {
|
|
1088
1126
|
e.preventDefault();
|
|
1089
|
-
|
|
1090
|
-
if (prevSibling && prevSibling instanceof HTMLElement) {
|
|
1091
|
-
prevSibling.focus();
|
|
1092
|
-
setFocusedValue(prevSibling.getAttribute("data-value") || null);
|
|
1093
|
-
}
|
|
1127
|
+
focusChoice(getPrevWithDataValue(current));
|
|
1094
1128
|
break;
|
|
1095
1129
|
}
|
|
1096
1130
|
case "ArrowRight":
|
|
1097
1131
|
case "ArrowDown": {
|
|
1098
1132
|
e.preventDefault();
|
|
1099
|
-
|
|
1100
|
-
if (nextSibling && nextSibling instanceof HTMLElement) {
|
|
1101
|
-
nextSibling.focus();
|
|
1102
|
-
setFocusedValue(nextSibling.getAttribute("data-value") || null);
|
|
1103
|
-
}
|
|
1133
|
+
focusChoice(getNextWithDataValue(current));
|
|
1104
1134
|
break;
|
|
1105
1135
|
}
|
|
1106
1136
|
case "Home": {
|
|
1107
1137
|
e.preventDefault();
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
firstSibling.focus();
|
|
1111
|
-
setFocusedValue(firstSibling.getAttribute("data-value") || null);
|
|
1112
|
-
}
|
|
1138
|
+
const parent = current.parentElement;
|
|
1139
|
+
focusChoice(getFirstWithDataValue(parent));
|
|
1113
1140
|
break;
|
|
1114
1141
|
}
|
|
1115
1142
|
case "End": {
|
|
1116
1143
|
e.preventDefault();
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
lastSibling.focus();
|
|
1120
|
-
setFocusedValue(lastSibling.getAttribute("data-value") || null);
|
|
1121
|
-
}
|
|
1144
|
+
const parent = current.parentElement;
|
|
1145
|
+
focusChoice(getLastWithDataValue(parent));
|
|
1122
1146
|
break;
|
|
1123
1147
|
}
|
|
1124
1148
|
case " ":
|
package/dist/form.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.cjs.js","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/SegmentedChoice.tsx","../src/segmentedControl/index.ts","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ValidationSuccessFilledIcon,\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\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: React.FC<{\n variant: VariantType | typeof info | typeof error;\n}> = ({ variant }) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\n aria-label=\"Suksessmelding\"\n className={iconClass}\n />\n );\n case 'negative':\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case 'information':\n return null;\n case 'warning':\n return (\n <ValidationExclamationFilledIcon\n aria-label=\"Varselmelding\"\n className={iconClass}\n />\n );\n case error:\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case info:\n return null;\n default:\n return null;\n }\n};\n\nexport type FeedbackTextProps = {\n /** Teksten som vises */\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: React.FC<FeedbackTextProps> = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}) => {\n return (\n <SubLabel\n className={classNames(\n 'eds-feedback-text',\n {\n 'eds-feedback-text--information':\n variant === info || variant === 'information',\n },\n className,\n )}\n {...rest}\n >\n {!hideIcon && <AlertIcon variant={variant} />}\n <span className=\"eds-feedback-text__text\">{children}</span>\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: React.FC<{\n children: React.ReactNode;\n}> = ({ children }) => {\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: React.FC<InputGroupLabelProps> = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}) => {\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 variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider: React.FC<VariantProviderProps> = ({\n children,\n variant = null,\n}) => {\n return (\n <VariantContext.Provider value={variant}>\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\nexport type BaseFormControlProps = React.HTMLAttributes<HTMLDivElement> & {\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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ariaLabelOnReadOnly = 'Dette skjemafeltet kan bare leses',\n ...rest\n },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\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 disableClickListner={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 {feedback && currentVariant && (\n <FeedbackText\n variant={currentVariant}\n role={\n ariaAlertOnFeedback === true || ariaAlertOnFeedback === 'alert'\n ? 'alert'\n : ariaAlertOnFeedback === 'status'\n ? 'status'\n : undefined\n }\n >\n {feedback}\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: React.FC<{ indeterminate: boolean }> = ({\n indeterminate = false,\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: React.FC<FieldsetProps> = ({\n children,\n className,\n label,\n ...rest\n}) => (\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, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useRandomId, 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 /** */\n style?: React.CSSProperties;\n} & Omit<\n React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >,\n 'title' | 'size'\n>;\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 type = 'radio',\n onChange,\n checked,\n name,\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 = useRandomId('eds-inputpanel');\n const inputPanelId = id || defaultId;\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 {...rest}\n />\n <div className={panelClassList} style={style}>\n <div className=\"eds-input-panel__title-wrapper\">\n <div className=\"eds-input-panel__title\">{title}</div>\n <div className=\"eds-input-panel__secondary-label-and-icon-wrapper\">\n {secondaryLabel !== undefined && <>{secondaryLabel}</>}\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 {children && (\n <div className=\"eds-input-panel__additional-content\">\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 /** */\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 /** */\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: React.FC<RadioGroupProps> = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}) => {\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","// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\nexport 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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\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 from 'react';\nimport classNames from 'classnames';\n\nimport { useRandomId, useOnMount, mergeRefs, VariantType } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } 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} & 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 ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = useRandomId('eds-textarea');\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 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 {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n ({ readOnly, disabled, onChange, value, variant, ...rest }, ref) => {\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 === 'error'}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { useRandomId, mergeRefs, VariantType } from '@entur/utils';\n\nimport { BaseFormControl } 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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const randomId = useRandomId('eds-textfield');\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) 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]);\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 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 === '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: React.FC<{\n onClear: () => void;\n ariaLabel: string;\n}> = ({ onClear, ariaLabel }) => {\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 from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { useRandomId } 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 = React.HTMLAttributes<HTMLDivElement> & {\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\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 = useRandomId('eds-segmented-control');\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","import React from 'react';\nimport classNames from 'classnames';\nimport { useSegmentedContext } from './SegmentedControl';\nimport { PolymorphicComponentPropsWithRef, PolymorphicRef } from '@entur/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: SegmentedChoiceComponent = React.forwardRef<\n HTMLElement,\n SegmentedChoiceProps<React.ElementType>\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 switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp': {\n e.preventDefault();\n const prevSibling = e.currentTarget.previousElementSibling;\n if (prevSibling && prevSibling instanceof HTMLElement) {\n prevSibling.focus();\n setFocusedValue(prevSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'ArrowRight':\n case 'ArrowDown': {\n e.preventDefault();\n const nextSibling = e.currentTarget.nextElementSibling;\n if (nextSibling && nextSibling instanceof HTMLElement) {\n nextSibling.focus();\n setFocusedValue(nextSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'Home': {\n e.preventDefault();\n const firstSibling = e.currentTarget.parentElement?.firstElementChild;\n if (firstSibling && firstSibling instanceof HTMLElement) {\n firstSibling.focus();\n setFocusedValue(firstSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'End': {\n e.preventDefault();\n const lastSibling = e.currentTarget.parentElement?.lastElementChild;\n if (lastSibling && lastSibling instanceof HTMLElement) {\n lastSibling.focus();\n setFocusedValue(lastSibling.getAttribute('data-value') || null);\n }\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","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","useRandomId","useForceUpdate","colors","Fragment","CheckIcon","CloseSmallIcon","useOnMount","Label","SegmentedChoice","SegmentedControlParent","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAED,CAAC,EAAE,cAAc;AACpB,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACEC,2BAAAA;AAAAA,QAACC,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aACED,2BAAAA;AAAAA,QAACE,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aACEF,2BAAAA;AAAAA,QAACG,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAKJ;AACH,aACEC,2BAAAA;AAAAA,QAACE,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAaO,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACEE,2BAAAA;AAAAA,IAACC,W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,IACtB;AAAA,EACF,GAAG,CAAC,cAAc,OAAO,eAAe,CAAC;AAEzC,QAAM,eAAe;AAAA,IACnB,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,+BAA+B,SAAS;AAAA,MAAA;AAAA,MAE1C;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,MAAM;AAAA;AAAA,IAGN,GAAI,OAAO,UAAa,EAAE,MAAM,SAAA;AAAA,IAChC,GAAG;AAAA,EAAA;AAGL,SAAOxB,2BAAAA,IAAC,SAAA,EAAS,GAAG,cAAe,SAAA,CAAS;AAC9C,CAAC;AChJM,MAAM,4BAA8C,OAAO;AAAA,EAChEyB;AAAAA,EACA;AAAA,IACE,MAAM;AAAA,EAAA;AAEV;AAEA,0BAA0B,KAAK,cAAc;AC3B7CC,MAAAA,uBAAuB,QAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"form.cjs.js","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 ValidationSuccessFilledIcon,\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\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: React.FC<{\n variant: VariantType | typeof info | typeof error;\n}> = ({ variant }) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\n aria-label=\"Suksessmelding\"\n className={iconClass}\n />\n );\n case 'negative':\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case 'information':\n return null;\n case 'warning':\n return (\n <ValidationExclamationFilledIcon\n aria-label=\"Varselmelding\"\n className={iconClass}\n />\n );\n case error:\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case info:\n return null;\n default:\n return null;\n }\n};\n\nexport type FeedbackTextProps = {\n /** Teksten som vises */\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: React.FC<FeedbackTextProps> = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}) => {\n return (\n <SubLabel\n className={classNames(\n 'eds-feedback-text',\n {\n 'eds-feedback-text--information':\n variant === info || variant === 'information',\n },\n className,\n )}\n {...rest}\n >\n {!hideIcon && <AlertIcon variant={variant} />}\n <span className=\"eds-feedback-text__text\">{children}</span>\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: React.FC<{\n children: React.ReactNode;\n}> = ({ children }) => {\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: React.FC<InputGroupLabelProps> = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}) => {\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 variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider: React.FC<VariantProviderProps> = ({\n children,\n variant = null,\n}) => {\n return (\n <VariantContext.Provider value={variant}>\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\nexport type BaseFormControlProps = React.HTMLAttributes<HTMLDivElement> & {\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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ariaLabelOnReadOnly = 'Dette skjemafeltet kan bare leses',\n ...rest\n },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\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 {feedback && currentVariant && (\n <FeedbackText\n variant={currentVariant}\n role={\n ariaAlertOnFeedback === true || ariaAlertOnFeedback === 'alert'\n ? 'alert'\n : ariaAlertOnFeedback === 'status'\n ? 'status'\n : undefined\n }\n >\n {feedback}\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: React.FC<{ indeterminate: boolean }> = ({\n indeterminate = false,\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: React.FC<FieldsetProps> = ({\n children,\n className,\n label,\n ...rest\n}) => (\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, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useRandomId, 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 /** */\n style?: React.CSSProperties;\n} & Omit<\n React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >,\n 'title' | 'size'\n>;\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 type = 'radio',\n onChange,\n checked,\n name,\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 = useRandomId('eds-inputpanel');\n const inputPanelId = id || defaultId;\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 {...rest}\n />\n <div className={panelClassList} style={style}>\n <div className=\"eds-input-panel__title-wrapper\">\n <div className=\"eds-input-panel__title\">{title}</div>\n <div className=\"eds-input-panel__secondary-label-and-icon-wrapper\">\n {secondaryLabel !== undefined && <>{secondaryLabel}</>}\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 {children && (\n <div className=\"eds-input-panel__additional-content\">\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 /** */\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 /** */\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: React.FC<RadioGroupProps> = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}) => {\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","// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\nexport 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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\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 from 'react';\nimport classNames from 'classnames';\n\nimport { useRandomId, useOnMount, mergeRefs, VariantType } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } 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} & 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 ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = useRandomId('eds-textarea');\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 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 {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n ({ readOnly, disabled, onChange, value, variant, ...rest }, ref) => {\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 === 'error'}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { useRandomId, mergeRefs, VariantType } from '@entur/utils';\n\nimport { BaseFormControl } 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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const randomId = useRandomId('eds-textfield');\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) 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]);\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 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 === '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: React.FC<{\n onClear: () => void;\n ariaLabel: string;\n}> = ({ onClear, ariaLabel }) => {\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 from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { useRandomId } 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 = React.HTMLAttributes<HTMLDivElement> & {\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\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 = useRandomId('eds-segmented-control');\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 { PolymorphicComponentPropsWithRef, PolymorphicRef } 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: SegmentedChoiceComponent = React.forwardRef<\n HTMLElement,\n SegmentedChoiceProps<React.ElementType>\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","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","useRandomId","useForceUpdate","colors","Fragment","CheckIcon","CloseSmallIcon","useOnMount","Label","SegmentedChoice","SegmentedControlParent","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAED,CAAC,EAAE,cAAc;AACpB,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACEC,2BAAAA;AAAAA,QAACC,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AAC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AAA,IACA,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,MAAM;AAAA;AAAA,IAGN,GAAI,OAAO,UAAa,EAAE,MAAM,SAAA;AAAA,IAChC,GAAG;AAAA,EAAA;AAGL,SAAOxB,2BAAAA,IAAC,SAAA,EAAS,GAAG,cAAe,SAAA,CAAS;AAC9C,CAAC;AChJM,MAAM,4BAA8C,OAAO;AAAA,EAChEyB;AAAAA,EACA;AAAA,IACE,MAAM;AAAA,EAAA;AAEV;AAEA,0BAA0B,KAAK,cAAc;AC3B7CC,MAAAA,uBAAuB,QAAQ,SAAS,YAAY;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/form.esm.js
CHANGED
|
@@ -219,7 +219,7 @@ const BaseFormControl = React__default.forwardRef(
|
|
|
219
219
|
showCloseButton: false,
|
|
220
220
|
disableFocusListener: true,
|
|
221
221
|
disableHoverListener: true,
|
|
222
|
-
|
|
222
|
+
disableClickListener: false,
|
|
223
223
|
disableKeyboardListener: false,
|
|
224
224
|
children: /* @__PURE__ */ jsx(
|
|
225
225
|
IconButton,
|
|
@@ -1035,6 +1035,38 @@ const SegmentedControl = React__default.forwardRef(
|
|
|
1035
1035
|
) });
|
|
1036
1036
|
}
|
|
1037
1037
|
);
|
|
1038
|
+
const getNextWithDataValue = (el) => {
|
|
1039
|
+
let current = el?.nextElementSibling;
|
|
1040
|
+
while (current) {
|
|
1041
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1042
|
+
current = current.nextElementSibling;
|
|
1043
|
+
}
|
|
1044
|
+
return null;
|
|
1045
|
+
};
|
|
1046
|
+
const getPrevWithDataValue = (el) => {
|
|
1047
|
+
let current = el?.previousElementSibling;
|
|
1048
|
+
while (current) {
|
|
1049
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1050
|
+
current = current.previousElementSibling;
|
|
1051
|
+
}
|
|
1052
|
+
return null;
|
|
1053
|
+
};
|
|
1054
|
+
const getFirstWithDataValue = (parent) => {
|
|
1055
|
+
let current = parent?.firstElementChild;
|
|
1056
|
+
while (current) {
|
|
1057
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1058
|
+
current = current.nextElementSibling;
|
|
1059
|
+
}
|
|
1060
|
+
return null;
|
|
1061
|
+
};
|
|
1062
|
+
const getLastWithDataValue = (parent) => {
|
|
1063
|
+
let current = parent?.lastElementChild;
|
|
1064
|
+
while (current) {
|
|
1065
|
+
if (current.hasAttribute("data-value")) return current;
|
|
1066
|
+
current = current.previousElementSibling;
|
|
1067
|
+
}
|
|
1068
|
+
return null;
|
|
1069
|
+
};
|
|
1038
1070
|
const defaultElement = "button";
|
|
1039
1071
|
const SegmentedChoice = React__default.forwardRef(function SegmentedChoice2({
|
|
1040
1072
|
children,
|
|
@@ -1064,43 +1096,35 @@ const SegmentedChoice = React__default.forwardRef(function SegmentedChoice2({
|
|
|
1064
1096
|
onChange?.(value);
|
|
1065
1097
|
};
|
|
1066
1098
|
const handleKeyDown = (e) => {
|
|
1099
|
+
const current = e.currentTarget;
|
|
1100
|
+
const focusChoice = (el) => {
|
|
1101
|
+
if (!el) return;
|
|
1102
|
+
el.focus();
|
|
1103
|
+
setFocusedValue(el.getAttribute("data-value") || null);
|
|
1104
|
+
};
|
|
1067
1105
|
switch (e.key) {
|
|
1068
1106
|
case "ArrowLeft":
|
|
1069
1107
|
case "ArrowUp": {
|
|
1070
1108
|
e.preventDefault();
|
|
1071
|
-
|
|
1072
|
-
if (prevSibling && prevSibling instanceof HTMLElement) {
|
|
1073
|
-
prevSibling.focus();
|
|
1074
|
-
setFocusedValue(prevSibling.getAttribute("data-value") || null);
|
|
1075
|
-
}
|
|
1109
|
+
focusChoice(getPrevWithDataValue(current));
|
|
1076
1110
|
break;
|
|
1077
1111
|
}
|
|
1078
1112
|
case "ArrowRight":
|
|
1079
1113
|
case "ArrowDown": {
|
|
1080
1114
|
e.preventDefault();
|
|
1081
|
-
|
|
1082
|
-
if (nextSibling && nextSibling instanceof HTMLElement) {
|
|
1083
|
-
nextSibling.focus();
|
|
1084
|
-
setFocusedValue(nextSibling.getAttribute("data-value") || null);
|
|
1085
|
-
}
|
|
1115
|
+
focusChoice(getNextWithDataValue(current));
|
|
1086
1116
|
break;
|
|
1087
1117
|
}
|
|
1088
1118
|
case "Home": {
|
|
1089
1119
|
e.preventDefault();
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1092
|
-
firstSibling.focus();
|
|
1093
|
-
setFocusedValue(firstSibling.getAttribute("data-value") || null);
|
|
1094
|
-
}
|
|
1120
|
+
const parent = current.parentElement;
|
|
1121
|
+
focusChoice(getFirstWithDataValue(parent));
|
|
1095
1122
|
break;
|
|
1096
1123
|
}
|
|
1097
1124
|
case "End": {
|
|
1098
1125
|
e.preventDefault();
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
lastSibling.focus();
|
|
1102
|
-
setFocusedValue(lastSibling.getAttribute("data-value") || null);
|
|
1103
|
-
}
|
|
1126
|
+
const parent = current.parentElement;
|
|
1127
|
+
focusChoice(getLastWithDataValue(parent));
|
|
1104
1128
|
break;
|
|
1105
1129
|
}
|
|
1106
1130
|
case " ":
|
package/dist/form.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.esm.js","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/SegmentedChoice.tsx","../src/segmentedControl/index.ts","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ValidationSuccessFilledIcon,\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\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: React.FC<{\n variant: VariantType | typeof info | typeof error;\n}> = ({ variant }) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\n aria-label=\"Suksessmelding\"\n className={iconClass}\n />\n );\n case 'negative':\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case 'information':\n return null;\n case 'warning':\n return (\n <ValidationExclamationFilledIcon\n aria-label=\"Varselmelding\"\n className={iconClass}\n />\n );\n case error:\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case info:\n return null;\n default:\n return null;\n }\n};\n\nexport type FeedbackTextProps = {\n /** Teksten som vises */\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: React.FC<FeedbackTextProps> = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}) => {\n return (\n <SubLabel\n className={classNames(\n 'eds-feedback-text',\n {\n 'eds-feedback-text--information':\n variant === info || variant === 'information',\n },\n className,\n )}\n {...rest}\n >\n {!hideIcon && <AlertIcon variant={variant} />}\n <span className=\"eds-feedback-text__text\">{children}</span>\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: React.FC<{\n children: React.ReactNode;\n}> = ({ children }) => {\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: React.FC<InputGroupLabelProps> = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}) => {\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 variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider: React.FC<VariantProviderProps> = ({\n children,\n variant = null,\n}) => {\n return (\n <VariantContext.Provider value={variant}>\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\nexport type BaseFormControlProps = React.HTMLAttributes<HTMLDivElement> & {\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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ariaLabelOnReadOnly = 'Dette skjemafeltet kan bare leses',\n ...rest\n },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\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 disableClickListner={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 {feedback && currentVariant && (\n <FeedbackText\n variant={currentVariant}\n role={\n ariaAlertOnFeedback === true || ariaAlertOnFeedback === 'alert'\n ? 'alert'\n : ariaAlertOnFeedback === 'status'\n ? 'status'\n : undefined\n }\n >\n {feedback}\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: React.FC<{ indeterminate: boolean }> = ({\n indeterminate = false,\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: React.FC<FieldsetProps> = ({\n children,\n className,\n label,\n ...rest\n}) => (\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, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useRandomId, 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 /** */\n style?: React.CSSProperties;\n} & Omit<\n React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >,\n 'title' | 'size'\n>;\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 type = 'radio',\n onChange,\n checked,\n name,\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 = useRandomId('eds-inputpanel');\n const inputPanelId = id || defaultId;\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 {...rest}\n />\n <div className={panelClassList} style={style}>\n <div className=\"eds-input-panel__title-wrapper\">\n <div className=\"eds-input-panel__title\">{title}</div>\n <div className=\"eds-input-panel__secondary-label-and-icon-wrapper\">\n {secondaryLabel !== undefined && <>{secondaryLabel}</>}\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 {children && (\n <div className=\"eds-input-panel__additional-content\">\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 /** */\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 /** */\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: React.FC<RadioGroupProps> = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}) => {\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","// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\nexport 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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\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 from 'react';\nimport classNames from 'classnames';\n\nimport { useRandomId, useOnMount, mergeRefs, VariantType } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } 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} & 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 ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = useRandomId('eds-textarea');\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 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 {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n ({ readOnly, disabled, onChange, value, variant, ...rest }, ref) => {\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 === 'error'}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { useRandomId, mergeRefs, VariantType } from '@entur/utils';\n\nimport { BaseFormControl } 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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const randomId = useRandomId('eds-textfield');\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) 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]);\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 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 === '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: React.FC<{\n onClear: () => void;\n ariaLabel: string;\n}> = ({ onClear, ariaLabel }) => {\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 from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { useRandomId } 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 = React.HTMLAttributes<HTMLDivElement> & {\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\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 = useRandomId('eds-segmented-control');\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","import React from 'react';\nimport classNames from 'classnames';\nimport { useSegmentedContext } from './SegmentedControl';\nimport { PolymorphicComponentPropsWithRef, PolymorphicRef } from '@entur/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: SegmentedChoiceComponent = React.forwardRef<\n HTMLElement,\n SegmentedChoiceProps<React.ElementType>\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 switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp': {\n e.preventDefault();\n const prevSibling = e.currentTarget.previousElementSibling;\n if (prevSibling && prevSibling instanceof HTMLElement) {\n prevSibling.focus();\n setFocusedValue(prevSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'ArrowRight':\n case 'ArrowDown': {\n e.preventDefault();\n const nextSibling = e.currentTarget.nextElementSibling;\n if (nextSibling && nextSibling instanceof HTMLElement) {\n nextSibling.focus();\n setFocusedValue(nextSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'Home': {\n e.preventDefault();\n const firstSibling = e.currentTarget.parentElement?.firstElementChild;\n if (firstSibling && firstSibling instanceof HTMLElement) {\n firstSibling.focus();\n setFocusedValue(firstSibling.getAttribute('data-value') || null);\n }\n break;\n }\n case 'End': {\n e.preventDefault();\n const lastSibling = e.currentTarget.parentElement?.lastElementChild;\n if (lastSibling && lastSibling instanceof HTMLElement) {\n lastSibling.focus();\n setFocusedValue(lastSibling.getAttribute('data-value') || null);\n }\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","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","isFilled","React","cx","SegmentedChoice","SegmentedControlParent"],"mappings":";;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAED,CAAC,EAAE,cAAc;AACpB,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAKA;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAaO,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,UACE,kCACE,YAAY,QAAQ,YAA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;AACL,0BAAA;AAAA,QACF;AACA;AAAA,MACF,KAAK;AACH,wBAAA;AACA;AAAA,MACF,KAAK;AACH,UAAE,eAAA;AACF,wBAAgB,IAAI;AACpB;AAAA,IAAA;AAAA,EAEN;AAEA,QAAM,UAAUA,eAAM,YAAY,MAAM;AACtC,oBAAgB,KAAK;AAAA,EACvB,GAAG,CAAC,iBAAiB,KAAK,CAAC;AAE3B,QAAM,SAASA,eAAM,YAAY,MAAM;AACrC,QAAI,iBAAiB,OAAO;AAC1B,sBAAgB,IAAI;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,cAAc,OAAO,eAAe,CAAC;AAEzC,QAAM,eAAe;AAAA,IACnB,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,+BAA+B,SAAS;AAAA,MAAA;AAAA,MAE1C;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,MAAM;AAAA;AAAA,IAGN,GAAI,OAAO,UAAa,EAAE,MAAM,SAAA;AAAA,IAChC,GAAG;AAAA,EAAA;AAGL,SAAO,oBAAC,SAAA,EAAS,GAAG,cAAe,SAAA,CAAS;AAC9C,CAAC;AChJM,MAAM,4BAA8C,OAAO;AAAA,EAChEG;AAAAA,EACA;AAAA,IACE,MAAM;AAAA,EAAA;AAEV;AAEA,0BAA0B,KAAK,cAAc;AC3B7C,uBAAuB,QAAQ,SAAS,YAAY;"}
|
|
1
|
+
{"version":3,"file":"form.esm.js","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 ValidationSuccessFilledIcon,\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\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: React.FC<{\n variant: VariantType | typeof info | typeof error;\n}> = ({ variant }) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\n aria-label=\"Suksessmelding\"\n className={iconClass}\n />\n );\n case 'negative':\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case 'information':\n return null;\n case 'warning':\n return (\n <ValidationExclamationFilledIcon\n aria-label=\"Varselmelding\"\n className={iconClass}\n />\n );\n case error:\n return (\n <ValidationErrorFilledIcon\n aria-label=\"Feilmelding\"\n className={iconClass}\n />\n );\n case info:\n return null;\n default:\n return null;\n }\n};\n\nexport type FeedbackTextProps = {\n /** Teksten som vises */\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: React.FC<FeedbackTextProps> = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}) => {\n return (\n <SubLabel\n className={classNames(\n 'eds-feedback-text',\n {\n 'eds-feedback-text--information':\n variant === info || variant === 'information',\n },\n className,\n )}\n {...rest}\n >\n {!hideIcon && <AlertIcon variant={variant} />}\n <span className=\"eds-feedback-text__text\">{children}</span>\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: React.FC<{\n children: React.ReactNode;\n}> = ({ children }) => {\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: React.FC<InputGroupLabelProps> = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}) => {\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 variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider: React.FC<VariantProviderProps> = ({\n children,\n variant = null,\n}) => {\n return (\n <VariantContext.Provider value={variant}>\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\nexport type BaseFormControlProps = React.HTMLAttributes<HTMLDivElement> & {\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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ariaLabelOnReadOnly = 'Dette skjemafeltet kan bare leses',\n ...rest\n },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\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 {feedback && currentVariant && (\n <FeedbackText\n variant={currentVariant}\n role={\n ariaAlertOnFeedback === true || ariaAlertOnFeedback === 'alert'\n ? 'alert'\n : ariaAlertOnFeedback === 'status'\n ? 'status'\n : undefined\n }\n >\n {feedback}\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: React.FC<{ indeterminate: boolean }> = ({\n indeterminate = false,\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: React.FC<FieldsetProps> = ({\n children,\n className,\n label,\n ...rest\n}) => (\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, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useRandomId, 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 /** */\n style?: React.CSSProperties;\n} & Omit<\n React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >,\n 'title' | 'size'\n>;\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 type = 'radio',\n onChange,\n checked,\n name,\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 = useRandomId('eds-inputpanel');\n const inputPanelId = id || defaultId;\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 {...rest}\n />\n <div className={panelClassList} style={style}>\n <div className=\"eds-input-panel__title-wrapper\">\n <div className=\"eds-input-panel__title\">{title}</div>\n <div className=\"eds-input-panel__secondary-label-and-icon-wrapper\">\n {secondaryLabel !== undefined && <>{secondaryLabel}</>}\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 {children && (\n <div className=\"eds-input-panel__additional-content\">\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 /** */\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 /** */\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: React.FC<RadioGroupProps> = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}) => {\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","// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\nexport 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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- disabled during Yarn upgrade\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 from 'react';\nimport classNames from 'classnames';\n\nimport { useRandomId, useOnMount, mergeRefs, VariantType } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } 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} & 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 ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = useRandomId('eds-textarea');\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 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 {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n ({ readOnly, disabled, onChange, value, variant, ...rest }, ref) => {\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 === 'error'}\n {...rest}\n />\n );\n },\n);\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { useRandomId, mergeRefs, VariantType } from '@entur/utils';\n\nimport { BaseFormControl } 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 /** Setter feedback-tekstens rolle for skjermlesere.\n * 'alert' = aria-live=\"assertive\" (avbryter umiddelbart)\n * 'status' = aria-live=\"polite\" (venter til bruker er ferdig)\n * undefined/false = ingen automatisk annonsering\n */\n ariaAlertOnFeedback?: boolean | 'alert' | 'status';\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 = false,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const randomId = useRandomId('eds-textfield');\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) 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]);\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 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 === '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: React.FC<{\n onClear: () => void;\n ariaLabel: string;\n}> = ({ onClear, ariaLabel }) => {\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 from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { useRandomId } 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 = React.HTMLAttributes<HTMLDivElement> & {\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\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 = useRandomId('eds-segmented-control');\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 { PolymorphicComponentPropsWithRef, PolymorphicRef } 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: SegmentedChoiceComponent = React.forwardRef<\n HTMLElement,\n SegmentedChoiceProps<React.ElementType>\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","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","isFilled","React","cx","SegmentedChoice","SegmentedControlParent"],"mappings":";;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAED,CAAC,EAAE,cAAc;AACpB,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,cAAW;AAA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AACpB;AAAA,IAAA;AAAA,EAEN;AAEA,QAAM,UAAUA,eAAM,YAAY,MAAM;AACtC,oBAAgB,KAAK;AAAA,EACvB,GAAG,CAAC,iBAAiB,KAAK,CAAC;AAE3B,QAAM,SAASA,eAAM,YAAY,MAAM;AACrC,QAAI,iBAAiB,OAAO;AAC1B,sBAAgB,IAAI;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,cAAc,OAAO,eAAe,CAAC;AAEzC,QAAM,eAAe;AAAA,IACnB,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,+BAA+B,SAAS;AAAA,MAAA;AAAA,MAE1C;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,MAAM;AAAA;AAAA,IAGN,GAAI,OAAO,UAAa,EAAE,MAAM,SAAA;AAAA,IAChC,GAAG;AAAA,EAAA;AAGL,SAAO,oBAAC,SAAA,EAAS,GAAG,cAAe,SAAA,CAAS;AAC9C,CAAC;AChJM,MAAM,4BAA8C,OAAO;AAAA,EAChEG;AAAAA,EACA;AAAA,IACE,MAAM;AAAA,EAAA;AAEV;AAEA,0BAA0B,KAAK,cAAc;AC3B7C,uBAAuB,QAAQ,SAAS,YAAY;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getNextWithDataValue: (el: HTMLElement | null) => HTMLElement | null;
|
|
2
|
+
export declare const getPrevWithDataValue: (el: HTMLElement | null) => HTMLElement | null;
|
|
3
|
+
export declare const getFirstWithDataValue: (parent: HTMLElement | null) => HTMLElement | null;
|
|
4
|
+
export declare const getLastWithDataValue: (parent: HTMLElement | null) => HTMLElement | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/form",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.6-next.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/form.cjs.js",
|
|
6
6
|
"module": "dist/form.esm.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@entur/button": "^4.0.2",
|
|
31
31
|
"@entur/icons": "^8.4.2",
|
|
32
32
|
"@entur/tokens": "^3.22.1",
|
|
33
|
-
"@entur/tooltip": "^5.3.
|
|
33
|
+
"@entur/tooltip": "^5.3.6-next.0",
|
|
34
34
|
"@entur/typography": "^2.1.3",
|
|
35
35
|
"@entur/utils": "^0.13.1",
|
|
36
36
|
"classnames": "^2.5.1"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"vite": "^7.1.3",
|
|
49
49
|
"vite-plugin-dts": "^4.5.4"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f49a3d442e0be4be813dc3305c1d1c3d51b7ab71"
|
|
52
52
|
}
|