@entur/form 9.3.7 → 10.0.0-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/FeedbackText.d.ts +1 -1
- package/dist/Fieldset.d.ts +1 -1
- package/dist/InputGroupContext.d.ts +2 -2
- package/dist/InputGroupLabel.d.ts +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/VariantProvider.d.ts +2 -1
- package/dist/form.cjs.js +14 -7
- package/dist/form.cjs.js.map +1 -1
- package/dist/form.esm.js +16 -9
- package/dist/form.esm.js.map +1 -1
- package/dist/styles.css +12 -12
- package/package.json +11 -11
package/dist/FeedbackText.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export type FeedbackTextProps = {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
[key: string]: any;
|
|
17
17
|
};
|
|
18
|
-
export declare const FeedbackText:
|
|
18
|
+
export declare const FeedbackText: ({ children, hideIcon, variant, className, ...rest }: FeedbackTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export {};
|
package/dist/Fieldset.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type FieldsetProps = {
|
|
|
8
8
|
label?: React.ReactNode;
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
};
|
|
11
|
-
export declare const Fieldset:
|
|
11
|
+
export declare const Fieldset: ({ children, className, label, ...rest }: FieldsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,8 +3,8 @@ type InputGroupContextType = {
|
|
|
3
3
|
isFilled: boolean;
|
|
4
4
|
setFilled: (e: boolean) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare const InputGroupContextProvider:
|
|
6
|
+
export declare const InputGroupContextProvider: ({ children, }: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
}
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const useInputGroupContext: () => InputGroupContextType;
|
|
10
10
|
export {};
|
|
@@ -7,4 +7,4 @@ export type InputGroupLabelProps = {
|
|
|
7
7
|
isFilled?: boolean;
|
|
8
8
|
staticAnimation?: boolean;
|
|
9
9
|
} & React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
|
|
10
|
-
export declare const InputGroupLabel:
|
|
10
|
+
export declare const InputGroupLabel: ({ label, required, labelId, staticAnimation, className, isFilled: forceIsFilled, ...rest }: InputGroupLabelProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -16,4 +16,4 @@ export type RadioGroupProps = {
|
|
|
16
16
|
/** Sett radiogruppen i disabled-modus */
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
};
|
|
19
|
-
export declare const RadioGroup:
|
|
19
|
+
export declare const RadioGroup: ({ name, value, children, onChange, label, readOnly, disabled, ...rest }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,9 @@ declare const info = "info";
|
|
|
5
5
|
/** @deprecated use variant="negative" instead */
|
|
6
6
|
declare const error = "error";
|
|
7
7
|
export type VariantProviderProps = {
|
|
8
|
+
children: React.ReactNode;
|
|
8
9
|
variant?: VariantType | typeof error | typeof info;
|
|
9
10
|
};
|
|
10
|
-
export declare const VariantProvider:
|
|
11
|
+
export declare const VariantProvider: ({ children, variant, }: VariantProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export declare const useVariant: () => VariantType | typeof error | typeof info | null;
|
|
12
13
|
export {};
|
package/dist/form.cjs.js
CHANGED
|
@@ -28,7 +28,9 @@ function _interopNamespaceDefault(e) {
|
|
|
28
28
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
29
29
|
const info = "info";
|
|
30
30
|
const error$1 = "error";
|
|
31
|
-
const AlertIcon = ({
|
|
31
|
+
const AlertIcon = ({
|
|
32
|
+
variant
|
|
33
|
+
}) => {
|
|
32
34
|
const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;
|
|
33
35
|
switch (variant) {
|
|
34
36
|
case "success":
|
|
@@ -100,7 +102,9 @@ const InputGroupContext = React__namespace.createContext({
|
|
|
100
102
|
isFilled: false,
|
|
101
103
|
setFilled: () => null
|
|
102
104
|
});
|
|
103
|
-
const InputGroupContextProvider = ({
|
|
105
|
+
const InputGroupContextProvider = ({
|
|
106
|
+
children
|
|
107
|
+
}) => {
|
|
104
108
|
const [filled, setFilled] = React__namespace.useState(false);
|
|
105
109
|
const value = React__namespace.useMemo(
|
|
106
110
|
() => ({ isFilled: filled, setFilled }),
|
|
@@ -459,7 +463,7 @@ const InputPanelBase = React.forwardRef(
|
|
|
459
463
|
`eds-input-panel--${size}`
|
|
460
464
|
);
|
|
461
465
|
const inputRef = React.useRef(null);
|
|
462
|
-
const defaultId =
|
|
466
|
+
const defaultId = `eds-inputpanel${React.useId()}`;
|
|
463
467
|
const inputPanelId = id || defaultId;
|
|
464
468
|
const forceUpdate = utils.useForceUpdate();
|
|
465
469
|
const handleOnChange = (e) => {
|
|
@@ -740,7 +744,7 @@ const TextArea = React.forwardRef(
|
|
|
740
744
|
resize,
|
|
741
745
|
...rest
|
|
742
746
|
}, ref) => {
|
|
743
|
-
const textAreaId =
|
|
747
|
+
const textAreaId = `eds-textarea${React.useId()}`;
|
|
744
748
|
const textareaRef = React.useRef(null);
|
|
745
749
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
746
750
|
BaseFormControl,
|
|
@@ -845,7 +849,7 @@ const TextField = React.forwardRef(
|
|
|
845
849
|
ariaAlertOnFeedback = false,
|
|
846
850
|
...rest
|
|
847
851
|
}, ref) => {
|
|
848
|
-
const randomId =
|
|
852
|
+
const randomId = `eds-textfield${React.useId()}`;
|
|
849
853
|
const textFieldId = labelProps && labelProps.id ? labelProps.id : randomId;
|
|
850
854
|
const textFieldRef = React.useRef(null);
|
|
851
855
|
const { setFilled } = useInputGroupContext();
|
|
@@ -954,7 +958,10 @@ const TextFieldBase = React.forwardRef(
|
|
|
954
958
|
);
|
|
955
959
|
}
|
|
956
960
|
);
|
|
957
|
-
const ClearButton = ({
|
|
961
|
+
const ClearButton = ({
|
|
962
|
+
onClear,
|
|
963
|
+
ariaLabel
|
|
964
|
+
}) => {
|
|
958
965
|
const { isFilled: isFilled2 } = useInputGroupContext();
|
|
959
966
|
if (isFilled2) {
|
|
960
967
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -1002,7 +1009,7 @@ const SegmentedControl = React.forwardRef(
|
|
|
1002
1009
|
defaultValue ?? null
|
|
1003
1010
|
);
|
|
1004
1011
|
const [focusedValue, setFocusedValue] = React.useState(null);
|
|
1005
|
-
const id =
|
|
1012
|
+
const id = `eds-segmented-control${React.useId()}`;
|
|
1006
1013
|
const isControlled = deprecatedValue !== void 0 || value !== void 0;
|
|
1007
1014
|
const currentValue = deprecatedValue !== void 0 ? deprecatedValue : value !== void 0 ? value : internalValue;
|
|
1008
1015
|
const handleChange = React.useCallback(
|
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/utils.ts","../src/segmentedControl/SegmentedChoice.tsx","../src/segmentedControl/index.ts","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\n ValidationSuccessFilledIcon,\n} from '@entur/icons';\nimport { SubLabel } from '@entur/typography';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport './FeedbackText.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst AlertIcon: 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, useForceUpdate, useRandomId } 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","export function hasValue(value: any): boolean {\n return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj - Can be a string, an object with a value property (controlled input),\n// or an HTMLInputElement (uncontrolled input)\n// @param SSR - If true, also checks defaultValue property for SSR/uncontrolled initial state\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\nexport function isFilled(obj: any, SSR = false): boolean {\n if (obj == null) {\n return false;\n }\n\n // Handle string values directly\n if (typeof obj === 'string') {\n return obj !== '';\n }\n\n // Handle objects with value property (controlled inputs, HTMLInputElement, etc.)\n if (obj && typeof obj === 'object') {\n // Check current value (works for both controlled { value: \"...\" } and HTMLInputElement)\n if (hasValue(obj.value) && obj.value !== '') {\n return true;\n }\n\n // Check defaultValue for SSR or uncontrolled initial state\n if (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '') {\n return true;\n }\n }\n\n return false;\n}\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType, mergeRefs, useOnMount, useRandomId } 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 /** Kontrollerer resize-oppførselen til tekstområdet\n * @default \"vertical\"\n */\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n variant,\n disabled = false,\n readOnly = false,\n className,\n style,\n label,\n feedback,\n labelTooltip,\n labelTooltipButtonAriaLabel,\n labelTooltipPlacement,\n onChange,\n disableLabelAnimation,\n resize,\n ...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 resize={resize}\n {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n (\n { readOnly, disabled, onChange, value, variant, resize, style, ...rest },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\n const { isFilled: isInputFilled, setFilled: setFiller } =\n useInputGroupContext();\n\n useOnMount(() => {\n if (value?.toString() || rest.defaultValue) {\n setFiller && !isInputFilled && setFiller(true);\n }\n });\n React.useEffect(() => {\n if (value?.toString() && setFiller && !isInputFilled) {\n setFiller(true);\n }\n }, [value, setFiller, isInputFilled]);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isFilled(event.target)) {\n setFiller && !isInputFilled && setFiller(true);\n } else {\n setFiller && isInputFilled && setFiller(false);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <textarea\n className=\"eds-form-control eds-textarea\"\n ref={ref}\n readOnly={readOnly}\n disabled={disabled}\n onChange={handleChange}\n value={value}\n aria-invalid={currentVariant === 'error'}\n style={resize ? { ...style, resize } : style}\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 { VariantType, mergeRefs, useRandomId } 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 || disabled || readOnly)\n return (append as React.ReactElement) ?? null;\n\n return (\n <div className=\"eds-textfield__append\">\n {append}\n <ClearButton onClear={handleClear} ariaLabel={clearButtonAriaLabel} />\n </div>\n );\n }, [append, clearable, disabled, readOnly]);\n\n return (\n <BaseFormControl\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n prepend={prepend}\n append={_append}\n className={classNames(className, 'eds-textfield__wrapper')}\n style={style}\n size={size}\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelId={textFieldId}\n feedback={feedback}\n disableLabelAnimation={disableLabelAnimation}\n labelProps={labelProps}\n ariaAlertOnFeedback={ariaAlertOnFeedback}\n 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 { ExtendableProps, 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 = ExtendableProps<\n React.HTMLAttributes<HTMLDivElement>,\n {\n /** Navn på input-elementene */\n name?: string;\n /** Beskrivende tekst */\n label?: string;\n /** En eller flere SegmentedChoice-komponenter */\n children: React.ReactNode;\n /**\n * Den valgte verdien (kontrollert modus).\n * Bruk `value` for kontrollert eller evt. `defaultValue` for ukontrollert komponent.\n */\n value?: string | null;\n /**\n * Standard verdi (ukontrollert modus).\n * Brukes når komponenten skal håndtere sin egen tilstand.\n */\n defaultValue?: string | null;\n /**\n * Callback for når det gjøres et valg.\n * Påkrevd for kontrollert modus (`value` eller `selectedValue`).\n */\n onChange?: (value: string | null) => void;\n /** Størrelsen på SegmentedChoice-komponentene */\n size?: 'medium' | 'large';\n /** Ekstra klassenavn */\n className?: string;\n /** @deprecated Bruk `value` for kontrollert eller `defaultValue` for ukontrollert oppførsel i stedet.\n *\n * Vi beveger oss gradvis mot å standardisere props for å følge\n * HTML-standarder. Derfor vil vi etter hvert avvikle `selectedValue` og lignende props over tid. */\n selectedValue?: string | null;\n }\n>;\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(\n (\n {\n children,\n label,\n name,\n onChange,\n value,\n defaultValue,\n size = 'medium',\n className,\n selectedValue: deprecatedValue,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultValue ?? null,\n );\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n const id = 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;A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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 ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\n ValidationSuccessFilledIcon,\n} from '@entur/icons';\nimport { SubLabel } from '@entur/typography';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport './FeedbackText.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst AlertIcon = ({\n variant,\n}: {\n variant: VariantType | typeof info | typeof error;\n}) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\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 = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}: FeedbackTextProps) => {\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 = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const [filled, setFilled] = React.useState(false);\n\n const value = React.useMemo(\n () => ({ isFilled: filled, setFilled }),\n [filled, setFilled],\n );\n\n return (\n <InputGroupContext.Provider value={value}>\n {children}\n </InputGroupContext.Provider>\n );\n};\n\nexport const useInputGroupContext = (): InputGroupContextType =>\n React.useContext(InputGroupContext);\n","import classNames from 'classnames';\nimport React from 'react';\nimport { useInputGroupContext } from './InputGroupContext';\nimport './InputGroupLabel.scss';\n\nexport type InputGroupLabelProps = {\n label?: React.ReactNode;\n required?: boolean;\n labelTooltip?: string;\n labelId: string;\n isFilled?: boolean;\n staticAnimation?: boolean;\n} & React.DetailedHTMLProps<\n React.LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n>;\n\nexport const InputGroupLabel = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}: InputGroupLabelProps) => {\n const { isFilled } = useInputGroupContext();\n const filler = staticAnimation || (forceIsFilled ?? isFilled);\n return (\n <label\n className={classNames(className, {\n 'eds-input-group-label-wrapper--filled': filler,\n 'eds-input-group-label-wrapper--controlled-label-position':\n forceIsFilled !== undefined,\n })}\n id={labelId}\n {...rest}\n >\n <span\n className={classNames('eds-input-group__label', {\n 'eds-input-group__label--filled': filler,\n })}\n >\n {label} {required && <span>*</span>}\n </span>\n </label>\n );\n};\n","import React from 'react';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst VariantContext = React.createContext<\n VariantType | typeof error | typeof info | null\n>(null);\n\nexport type VariantProviderProps = {\n children: React.ReactNode;\n variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider = ({\n children,\n variant = null,\n}: VariantProviderProps) => {\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 = ({\n indeterminate = false,\n}: {\n indeterminate: boolean;\n}) => {\n return (\n <svg\n className=\"eds-checkbox-icon\"\n width=\"11px\"\n height=\"9px\"\n viewBox=\"6 11 37 33\"\n aria-hidden={true}\n >\n {indeterminate ? (\n <rect x=\"10\" y=\"25\" width=\"28\" height=\"5\" fill=\"white\" />\n ) : (\n <path d=\"M14.1 27.2l7.1 7.2 14.6-14.8\" fill=\"none\" />\n )}\n </svg>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { Heading5 } from '@entur/typography';\nimport './Fieldset.scss';\n\nexport type FieldsetProps = {\n /** Innholdet i felt-gruppen. */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Labelen til felt-gruppen. */\n label?: React.ReactNode;\n [key: string]: any;\n};\n\nexport const Fieldset = ({\n children,\n className,\n label,\n ...rest\n}: FieldsetProps) => (\n <fieldset className={classNames('eds-fieldset', className)} {...rest}>\n {label && <Heading5 as=\"legend\">{label}</Heading5>}\n {children}\n </fieldset>\n);\n","import React from 'react';\n\ntype RadioGroupContextProps = {\n name: string;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n value: string | null;\n readOnly?: boolean;\n disabled?: boolean;\n};\n\nconst RadioGroupContext = React.createContext<RadioGroupContextProps | null>(\n null,\n);\n\nexport const RadioGroupContextProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext: () => RadioGroupContextProps = () => {\n const context = React.useContext(RadioGroupContext);\n if (!context) {\n throw new Error(\n 'You need to wrap your RadioButtons in a RadioGroup component',\n );\n }\n return context;\n};\n","import React from 'react';\nimport cx from 'classnames';\nimport { Paragraph } from '@entur/typography';\nimport { useRadioGroupContext } from './RadioGroupContext';\nimport './Radio.scss';\n\nexport type RadioProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Label til radio-button. Vises ved høyre side. */\n children?: React.ReactNode;\n /** Verdien til radioknappen */\n value: string;\n /** Om radiobutton er disabled eller ikke\n * @default false\n */\n disabled?: boolean;\n /** Beskrivelse som leses opp av skjermlesere når radiobutton er readonly */\n readOnlyLabelDescription?: string;\n} & React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n (\n { className, children, value, disabled, readOnlyLabelDescription, ...rest },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const {\n name,\n value: selectedValue,\n onChange,\n readOnly,\n } = useRadioGroupContext();\n\n const classList = cx(className, 'eds-form-component--radio__radio', {\n 'eds-form-component--radio__radio--disabled': disabled,\n 'eds-form-component--radio__radio--readonly': readOnly,\n });\n\n return (\n <label className=\"eds-form-component--radio__container\">\n <input\n type=\"radio\"\n name={rest.name ?? name}\n ref={ref}\n value={value}\n checked={rest.checked ?? selectedValue === value}\n onChange={e => {\n if (readOnly) {\n e.preventDefault();\n return;\n }\n (rest.onChange ?? onChange)?.(e);\n }}\n onClick={e => {\n if (readOnly) {\n e.preventDefault();\n }\n }}\n disabled={disabled}\n aria-label={\n readOnly\n ? `${children?.toString()}. ${\n readOnlyLabelDescription ?? 'Kan ikke endres'\n }`\n : undefined\n }\n {...rest}\n />\n <span className={classList}>\n <span className=\"eds-form-component--radio__circle\"></span>\n </span>\n {children && (\n <Paragraph\n margin=\"none\"\n as=\"span\"\n className=\"eds-form-component--radio__label\"\n >\n {children}\n </Paragraph>\n )}\n </label>\n );\n },\n);\n","import React, { useId, useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useForceUpdate } from '@entur/utils';\nimport { Checkbox } from '../Checkbox';\nimport { Radio } from '../Radio';\n\nimport './InputPanelBase.scss';\n\nexport type InputPanelProps = {\n /** Om det er en radio- eller checkbox-variant */\n type: string;\n /** Verdien til input-panelet */\n value: string;\n /** Om input-panelet skal være valgt eller ikke */\n checked?: boolean;\n /** Hovedtittelen til input-panelet */\n title: React.ReactNode;\n /** Ektstra label som står høyrestilt, til venstre for Checkboxen/Radio-button-en */\n secondaryLabel?: React.ReactNode;\n /** Ekstra informasjon som legges nederst i input-panelet */\n children?: React.ReactNode;\n /** Størrelse på input-panelet\n * @default \"medium\"\n */\n size?: 'medium' | 'large';\n /**Skjuler checkbox-/radio-button-en i input-panelet\n * @default false\n */\n hideSelectionIndicator?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n /** Om input-panelet er deaktivert eller ikke\n * @default false\n */\n disabled?: boolean;\n /** Om input-panelet er skrivebeskyttet (readonly) eller ikke\n * @default false\n */\n readOnly?: boolean;\n /** */\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 = `eds-inputpanel${useId()}`;\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 = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}: RadioGroupProps) => {\n const contextValue = React.useMemo(\n () => ({ name, value, onChange, readOnly, disabled }),\n [name, value, onChange, readOnly, disabled],\n );\n return (\n <RadioGroupContextProvider value={contextValue}>\n {label ? (\n <Fieldset label={label} {...rest}>\n {children}\n </Fieldset>\n ) : (\n children\n )}\n </RadioGroupContextProvider>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { colors } from '@entur/tokens';\nimport { CheckIcon, CloseSmallIcon } from '@entur/icons';\nimport './Switch.scss';\n\nexport type SwitchProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Label for Switch-en. */\n children?: React.ReactNode;\n /** Posisjonen til label for Switch-en.\n * @default \"right\"\n */\n labelPlacement?: 'right' | 'bottom';\n /** Om switch-en er checked eller ikke */\n checked?: boolean;\n /** Ikonet som skal stå inne i sirkelen på Switch-en */\n icon?: React.ReactNode;\n /** Skjul ikonet inne i sikrelen på Switch-en\n * @default false\n */\n hideIcon?: boolean;\n /** Farge som settes på ikon og bakgrunn når Switch-en er \"checked\"\n * @default colors.validation.mint\n */\n color?: string;\n /** Farge på bakgrunn når Switch-en er \"checked\" og står i en kontrast-seksjon\n * @default colors.validation.mintContrast\n */\n contrastColor?: string;\n /** Størrelsen på Switch-en\n * @default \"medium\"\n */\n size?: 'medium' | 'large';\n /** Callback for når verdien endres */\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;\n\nexport const Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n className,\n children,\n labelPlacement = 'right',\n icon,\n hideIcon = false,\n color = colors.validation.mint,\n contrastColor = colors.validation.mintContrast,\n size = 'medium',\n checked,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const displayedIcon = () => {\n if (icon) return icon;\n if (checked === undefined) return <></>;\n const iconSize = size === 'large' ? 23 : undefined;\n return checked ? (\n <CheckIcon size={iconSize} />\n ) : (\n <CloseSmallIcon size={iconSize} />\n );\n };\n\n return (\n <label\n className={classNames(\n 'eds-switch',\n `eds-switch--${labelPlacement}`,\n className,\n )}\n style={{ ...rest.style }}\n >\n <input type=\"checkbox\" ref={ref} checked={checked} {...rest} />\n <span\n className={classNames(\n 'eds-switch__switch',\n `eds-switch__switch--${size}`,\n )}\n style={\n {\n '--eds-switch-color': color,\n '--eds-switch-contrast-color': contrastColor,\n } as React.CSSProperties\n }\n aria-hidden=\"true\"\n >\n <span className=\"eds-switch__circle\">\n {!hideIcon && displayedIcon()}\n </span>\n </span>\n {children && (\n <span\n className={classNames(\n 'eds-switch__label',\n `eds-switch__label--${size}--${labelPlacement}`,\n )}\n >\n {children}\n </span>\n )}\n </label>\n );\n },\n);\n","export function hasValue(value: any): boolean {\n return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj - Can be a string, an object with a value property (controlled input),\n// or an HTMLInputElement (uncontrolled input)\n// @param SSR - If true, also checks defaultValue property for SSR/uncontrolled initial state\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\nexport function isFilled(obj: any, SSR = false): boolean {\n if (obj == null) {\n return false;\n }\n\n // Handle string values directly\n if (typeof obj === 'string') {\n return obj !== '';\n }\n\n // Handle objects with value property (controlled inputs, HTMLInputElement, etc.)\n if (obj && typeof obj === 'object') {\n // Check current value (works for both controlled { value: \"...\" } and HTMLInputElement)\n if (hasValue(obj.value) && obj.value !== '') {\n return true;\n }\n\n // Check defaultValue for SSR or uncontrolled initial state\n if (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '') {\n return true;\n }\n }\n\n return false;\n}\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType, mergeRefs, useOnMount } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } from './BaseFormControl';\nimport { useInputGroupContext } from './InputGroupContext';\nimport { isFilled } from './utils';\n\nimport './TextArea.scss';\nimport { Placement } from '@entur/tooltip';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type TextAreaProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Valideringsvariant */\n variant?: VariantType | typeof error | typeof info;\n /** Deaktiverer tekstområdet */\n disabled?: boolean;\n /** Setter tekstområdet i read-only modus */\n readOnly?: boolean;\n /** Label over TextArea */\n label: string;\n /** En tooltip som forklarer labelen til inputfeltet */\n labelTooltip?: React.ReactNode;\n /** Forklarende tekst for knappen som åpner labelTooltip */\n labelTooltipButtonAriaLabel?: string;\n /** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */\n labelTooltipPlacement?: Placement;\n /** Varselmelding, som vil komme under TextArea */\n feedback?: string;\n /** Plasserer labelen statisk på toppen av inputfeltet\n * @default false\n */\n disableLabelAnimation?: boolean;\n /** Kontrollerer resize-oppførselen til tekstområdet\n * @default \"vertical\"\n */\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n variant,\n disabled = false,\n readOnly = false,\n className,\n style,\n label,\n feedback,\n labelTooltip,\n labelTooltipButtonAriaLabel,\n labelTooltipPlacement,\n onChange,\n disableLabelAnimation,\n resize,\n ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = `eds-textarea${useId()}`;\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n return (\n <BaseFormControl\n className={classNames(className, 'eds-textarea__wrapper')}\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n style={style}\n label={label}\n labelId={textAreaId}\n feedback={feedback}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelProps={{ className: 'eds-textarea__label' }}\n disableLabelAnimation={disableLabelAnimation}\n onClick={e => {\n if (e.target === e.currentTarget) textareaRef?.current?.focus();\n }}\n >\n <TextAreaBase\n readOnly={readOnly}\n disabled={disabled}\n ref={mergeRefs(ref, textareaRef)}\n aria-labelledby={textAreaId}\n onChange={onChange}\n variant={variant}\n resize={resize}\n {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n (\n { readOnly, disabled, onChange, value, variant, resize, style, ...rest },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\n const { isFilled: isInputFilled, setFilled: setFiller } =\n useInputGroupContext();\n\n useOnMount(() => {\n if (value?.toString() || rest.defaultValue) {\n setFiller && !isInputFilled && setFiller(true);\n }\n });\n React.useEffect(() => {\n if (value?.toString() && setFiller && !isInputFilled) {\n setFiller(true);\n }\n }, [value, setFiller, isInputFilled]);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isFilled(event.target)) {\n setFiller && !isInputFilled && setFiller(true);\n } else {\n setFiller && isInputFilled && setFiller(false);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <textarea\n className=\"eds-form-control eds-textarea\"\n ref={ref}\n readOnly={readOnly}\n disabled={disabled}\n onChange={handleChange}\n value={value}\n aria-invalid={currentVariant === 'error'}\n style={resize ? { ...style, resize } : style}\n {...rest}\n />\n );\n },\n);\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { VariantType, mergeRefs } from '@entur/utils';\n\nimport { BaseFormControl } 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 = `eds-textfield${useId()}`;\n const textFieldId = labelProps && labelProps.id ? labelProps.id : randomId;\n const textFieldRef = React.useRef<HTMLInputElement>(null);\n const { setFilled } = useInputGroupContext();\n\n const handleClear = () => {\n const inputElement = textFieldRef.current;\n // Trigger an input event with target value \"\" to\n // both reset uncontrolled value and send an onChange event\n // for controlled value\n if (inputElement) {\n const setNativeInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value',\n )?.set;\n setNativeInputValue?.call(inputElement, '');\n\n const inputEvent = new Event('input', { bubbles: true });\n inputElement.dispatchEvent(inputEvent);\n inputElement.focus();\n setFilled(false);\n }\n onClear?.();\n };\n\n const _append = React.useMemo((): React.ReactElement | null => {\n if (!clearable || disabled || readOnly)\n return (append as React.ReactElement) ?? null;\n\n return (\n <div className=\"eds-textfield__append\">\n {append}\n <ClearButton onClear={handleClear} ariaLabel={clearButtonAriaLabel} />\n </div>\n );\n }, [append, clearable, disabled, readOnly]);\n\n return (\n <BaseFormControl\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n prepend={prepend}\n append={_append}\n className={classNames(className, 'eds-textfield__wrapper')}\n style={style}\n size={size}\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelId={textFieldId}\n feedback={feedback}\n disableLabelAnimation={disableLabelAnimation}\n labelProps={labelProps}\n ariaAlertOnFeedback={ariaAlertOnFeedback}\n 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 = ({\n onClear,\n ariaLabel,\n}: {\n onClear: () => void;\n ariaLabel: string;\n}) => {\n const { isFilled } = useInputGroupContext();\n if (isFilled) {\n return (\n <>\n <div className=\"eds-textfield__divider\" />\n <IconButton\n className=\"eds-textfield__clear-button\"\n type=\"button\"\n aria-label={ariaLabel}\n onClick={onClear}\n >\n <CloseSmallIcon aria-hidden />\n </IconButton>\n </>\n );\n }\n return null;\n};\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { ExtendableProps } from '@entur/utils';\nimport './SegmentedControl.scss';\n\ntype SegmentedContextProps = {\n name: string;\n onChange: (value: string | null) => void;\n value: string | null;\n size: 'medium' | 'large';\n focusedValue: string | null;\n setFocusedValue: (value: string | null) => void;\n};\n\nconst SegmentedContext = React.createContext<SegmentedContextProps | null>(\n null,\n);\n\nexport const useSegmentedContext = (): SegmentedContextProps => {\n const context = React.useContext(SegmentedContext);\n if (!context) {\n throw new Error(\n 'You need to wrap your SegmentedChoice in SegmentedControl',\n );\n }\n return context;\n};\n\nexport type SegmentedControlProps = ExtendableProps<\n React.HTMLAttributes<HTMLDivElement>,\n {\n /** Navn på input-elementene */\n name?: string;\n /** Beskrivende tekst */\n label?: string;\n /** En eller flere SegmentedChoice-komponenter */\n children: React.ReactNode;\n /**\n * Den valgte verdien (kontrollert modus).\n * Bruk `value` for kontrollert eller evt. `defaultValue` for ukontrollert komponent.\n */\n value?: string | null;\n /**\n * Standard verdi (ukontrollert modus).\n * Brukes når komponenten skal håndtere sin egen tilstand.\n */\n defaultValue?: string | null;\n /**\n * Callback for når det gjøres et valg.\n * Påkrevd for kontrollert modus (`value` eller `selectedValue`).\n */\n onChange?: (value: string | null) => void;\n /** Størrelsen på SegmentedChoice-komponentene */\n size?: 'medium' | 'large';\n /** Ekstra klassenavn */\n className?: string;\n /** @deprecated Bruk `value` for kontrollert eller `defaultValue` for ukontrollert oppførsel i stedet.\n *\n * Vi beveger oss gradvis mot å standardisere props for å følge\n * HTML-standarder. Derfor vil vi etter hvert avvikle `selectedValue` og lignende props over tid. */\n selectedValue?: string | null;\n }\n>;\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(\n (\n {\n children,\n label,\n name,\n onChange,\n value,\n defaultValue,\n size = 'medium',\n className,\n selectedValue: deprecatedValue,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultValue ?? null,\n );\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n const id = `eds-segmented-control${useId()}`;\n\n const isControlled = deprecatedValue !== undefined || value !== undefined;\n const currentValue =\n deprecatedValue !== undefined\n ? deprecatedValue\n : value !== undefined\n ? value\n : internalValue;\n\n const handleChange = React.useCallback(\n (newValue: string | null) => {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n\n onChange?.(newValue);\n },\n [isControlled, onChange],\n );\n\n const contextValue = React.useMemo(\n () => ({\n name: name ?? label ?? id,\n onChange: handleChange,\n value: currentValue,\n size,\n focusedValue,\n setFocusedValue,\n }),\n [id, name, handleChange, currentValue, size, focusedValue, label],\n );\n\n const labelId = `${id}-label`;\n\n return (\n <SegmentedContext.Provider value={contextValue}>\n <div\n className={classNames('eds-segmented-control', className)}\n role=\"radiogroup\"\n aria-labelledby={label ? labelId : undefined}\n ref={ref}\n {...rest}\n >\n {label !== undefined && (\n <Label htmlFor={id} id={labelId}>\n {label}\n </Label>\n )}\n <input\n name={name ?? label ?? id}\n value={currentValue ?? undefined}\n type=\"hidden\"\n id={id}\n />\n <div className=\"eds-segmented-control__choices\">\n {React.Children.map(children, (child, index) => {\n if (index === 0 && React.isValidElement(child))\n return React.cloneElement(child, {\n 'data-first-child': true,\n } as any);\n\n return child;\n })}\n </div>\n </div>\n </SegmentedContext.Provider>\n );\n },\n);\n","export const getNextWithDataValue = (\n el: HTMLElement | null,\n): HTMLElement | null => {\n let current = el?.nextElementSibling as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.nextElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getPrevWithDataValue = (\n el: HTMLElement | null,\n): HTMLElement | null => {\n let current = el?.previousElementSibling as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.previousElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getFirstWithDataValue = (\n parent: HTMLElement | null,\n): HTMLElement | null => {\n let current = parent?.firstElementChild as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.nextElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getLastWithDataValue = (\n parent: HTMLElement | null,\n): HTMLElement | null => {\n let current = parent?.lastElementChild as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.previousElementSibling as HTMLElement | null;\n }\n return null;\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { useSegmentedContext } from './SegmentedControl';\nimport { 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","useId","useForceUpdate","colors","Fragment","CheckIcon","CloseSmallIcon","useOnMount","Label","SegmentedChoice","SegmentedControlParent","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,OAAO;AAEb,MAAMA,UAAQ;AAEd,MAAM,YAAY,CAAC;AAAA,EACjB;AACF,MAEM;AACJ,QAAM,YAAY,oDAAoD,OAAO;AAC7E,UAAQ,SAAA;AAAA,IACN,KAAK;AACH,aACEC,2BAAAA;AAAAA,QAACC,MAAAA;AAAAA,QAAA;AAAA,UACC,cAAW;AAAA,UACX,W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AAgB,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,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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { mergeRefs,
|
|
1
|
+
import { mergeRefs, useForceUpdate, useOnMount, warnAboutMissingStyles } from "@entur/utils";
|
|
2
2
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import React__default, { useRef } from "react";
|
|
4
|
+
import React__default, { useRef, useId } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { ValidationErrorFilledIcon, ValidationExclamationFilledIcon, ValidationSuccessFilledIcon, QuestionIcon, CheckIcon, CloseSmallIcon } from "@entur/icons";
|
|
7
7
|
import { Tooltip } from "@entur/tooltip";
|
|
@@ -10,7 +10,9 @@ import { SubLabel, Paragraph, Heading5, Label } from "@entur/typography";
|
|
|
10
10
|
import { colors } from "@entur/tokens";
|
|
11
11
|
const info = "info";
|
|
12
12
|
const error$1 = "error";
|
|
13
|
-
const AlertIcon = ({
|
|
13
|
+
const AlertIcon = ({
|
|
14
|
+
variant
|
|
15
|
+
}) => {
|
|
14
16
|
const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;
|
|
15
17
|
switch (variant) {
|
|
16
18
|
case "success":
|
|
@@ -82,7 +84,9 @@ const InputGroupContext = React.createContext({
|
|
|
82
84
|
isFilled: false,
|
|
83
85
|
setFilled: () => null
|
|
84
86
|
});
|
|
85
|
-
const InputGroupContextProvider = ({
|
|
87
|
+
const InputGroupContextProvider = ({
|
|
88
|
+
children
|
|
89
|
+
}) => {
|
|
86
90
|
const [filled, setFilled] = React.useState(false);
|
|
87
91
|
const value = React.useMemo(
|
|
88
92
|
() => ({ isFilled: filled, setFilled }),
|
|
@@ -441,7 +445,7 @@ const InputPanelBase = React__default.forwardRef(
|
|
|
441
445
|
`eds-input-panel--${size}`
|
|
442
446
|
);
|
|
443
447
|
const inputRef = useRef(null);
|
|
444
|
-
const defaultId =
|
|
448
|
+
const defaultId = `eds-inputpanel${useId()}`;
|
|
445
449
|
const inputPanelId = id || defaultId;
|
|
446
450
|
const forceUpdate = useForceUpdate();
|
|
447
451
|
const handleOnChange = (e) => {
|
|
@@ -722,7 +726,7 @@ const TextArea = React__default.forwardRef(
|
|
|
722
726
|
resize,
|
|
723
727
|
...rest
|
|
724
728
|
}, ref) => {
|
|
725
|
-
const textAreaId =
|
|
729
|
+
const textAreaId = `eds-textarea${useId()}`;
|
|
726
730
|
const textareaRef = React__default.useRef(null);
|
|
727
731
|
return /* @__PURE__ */ jsx(
|
|
728
732
|
BaseFormControl,
|
|
@@ -827,7 +831,7 @@ const TextField = React__default.forwardRef(
|
|
|
827
831
|
ariaAlertOnFeedback = false,
|
|
828
832
|
...rest
|
|
829
833
|
}, ref) => {
|
|
830
|
-
const randomId =
|
|
834
|
+
const randomId = `eds-textfield${useId()}`;
|
|
831
835
|
const textFieldId = labelProps && labelProps.id ? labelProps.id : randomId;
|
|
832
836
|
const textFieldRef = React__default.useRef(null);
|
|
833
837
|
const { setFilled } = useInputGroupContext();
|
|
@@ -936,7 +940,10 @@ const TextFieldBase = React__default.forwardRef(
|
|
|
936
940
|
);
|
|
937
941
|
}
|
|
938
942
|
);
|
|
939
|
-
const ClearButton = ({
|
|
943
|
+
const ClearButton = ({
|
|
944
|
+
onClear,
|
|
945
|
+
ariaLabel
|
|
946
|
+
}) => {
|
|
940
947
|
const { isFilled: isFilled2 } = useInputGroupContext();
|
|
941
948
|
if (isFilled2) {
|
|
942
949
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -984,7 +991,7 @@ const SegmentedControl = React__default.forwardRef(
|
|
|
984
991
|
defaultValue ?? null
|
|
985
992
|
);
|
|
986
993
|
const [focusedValue, setFocusedValue] = React__default.useState(null);
|
|
987
|
-
const id =
|
|
994
|
+
const id = `eds-segmented-control${useId()}`;
|
|
988
995
|
const isControlled = deprecatedValue !== void 0 || value !== void 0;
|
|
989
996
|
const currentValue = deprecatedValue !== void 0 ? deprecatedValue : value !== void 0 ? value : internalValue;
|
|
990
997
|
const handleChange = React__default.useCallback(
|
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/utils.ts","../src/segmentedControl/SegmentedChoice.tsx","../src/segmentedControl/index.ts","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\n ValidationSuccessFilledIcon,\n} from '@entur/icons';\nimport { SubLabel } from '@entur/typography';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport './FeedbackText.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst AlertIcon: 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, useForceUpdate, useRandomId } 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","export function hasValue(value: any): boolean {\n return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj - Can be a string, an object with a value property (controlled input),\n// or an HTMLInputElement (uncontrolled input)\n// @param SSR - If true, also checks defaultValue property for SSR/uncontrolled initial state\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\nexport function isFilled(obj: any, SSR = false): boolean {\n if (obj == null) {\n return false;\n }\n\n // Handle string values directly\n if (typeof obj === 'string') {\n return obj !== '';\n }\n\n // Handle objects with value property (controlled inputs, HTMLInputElement, etc.)\n if (obj && typeof obj === 'object') {\n // Check current value (works for both controlled { value: \"...\" } and HTMLInputElement)\n if (hasValue(obj.value) && obj.value !== '') {\n return true;\n }\n\n // Check defaultValue for SSR or uncontrolled initial state\n if (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '') {\n return true;\n }\n }\n\n return false;\n}\n","import React from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType, mergeRefs, useOnMount, useRandomId } 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 /** Kontrollerer resize-oppførselen til tekstområdet\n * @default \"vertical\"\n */\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n variant,\n disabled = false,\n readOnly = false,\n className,\n style,\n label,\n feedback,\n labelTooltip,\n labelTooltipButtonAriaLabel,\n labelTooltipPlacement,\n onChange,\n disableLabelAnimation,\n resize,\n ...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 resize={resize}\n {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n (\n { readOnly, disabled, onChange, value, variant, resize, style, ...rest },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\n const { isFilled: isInputFilled, setFilled: setFiller } =\n useInputGroupContext();\n\n useOnMount(() => {\n if (value?.toString() || rest.defaultValue) {\n setFiller && !isInputFilled && setFiller(true);\n }\n });\n React.useEffect(() => {\n if (value?.toString() && setFiller && !isInputFilled) {\n setFiller(true);\n }\n }, [value, setFiller, isInputFilled]);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isFilled(event.target)) {\n setFiller && !isInputFilled && setFiller(true);\n } else {\n setFiller && isInputFilled && setFiller(false);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <textarea\n className=\"eds-form-control eds-textarea\"\n ref={ref}\n readOnly={readOnly}\n disabled={disabled}\n onChange={handleChange}\n value={value}\n aria-invalid={currentVariant === 'error'}\n style={resize ? { ...style, resize } : style}\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 { VariantType, mergeRefs, useRandomId } 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 || disabled || readOnly)\n return (append as React.ReactElement) ?? null;\n\n return (\n <div className=\"eds-textfield__append\">\n {append}\n <ClearButton onClear={handleClear} ariaLabel={clearButtonAriaLabel} />\n </div>\n );\n }, [append, clearable, disabled, readOnly]);\n\n return (\n <BaseFormControl\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n prepend={prepend}\n append={_append}\n className={classNames(className, 'eds-textfield__wrapper')}\n style={style}\n size={size}\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelId={textFieldId}\n feedback={feedback}\n disableLabelAnimation={disableLabelAnimation}\n labelProps={labelProps}\n ariaAlertOnFeedback={ariaAlertOnFeedback}\n 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 { ExtendableProps, 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 = ExtendableProps<\n React.HTMLAttributes<HTMLDivElement>,\n {\n /** Navn på input-elementene */\n name?: string;\n /** Beskrivende tekst */\n label?: string;\n /** En eller flere SegmentedChoice-komponenter */\n children: React.ReactNode;\n /**\n * Den valgte verdien (kontrollert modus).\n * Bruk `value` for kontrollert eller evt. `defaultValue` for ukontrollert komponent.\n */\n value?: string | null;\n /**\n * Standard verdi (ukontrollert modus).\n * Brukes når komponenten skal håndtere sin egen tilstand.\n */\n defaultValue?: string | null;\n /**\n * Callback for når det gjøres et valg.\n * Påkrevd for kontrollert modus (`value` eller `selectedValue`).\n */\n onChange?: (value: string | null) => void;\n /** Størrelsen på SegmentedChoice-komponentene */\n size?: 'medium' | 'large';\n /** Ekstra klassenavn */\n className?: string;\n /** @deprecated Bruk `value` for kontrollert eller `defaultValue` for ukontrollert oppførsel i stedet.\n *\n * Vi beveger oss gradvis mot å standardisere props for å følge\n * HTML-standarder. Derfor vil vi etter hvert avvikle `selectedValue` og lignende props over tid. */\n selectedValue?: string | null;\n }\n>;\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(\n (\n {\n children,\n label,\n name,\n onChange,\n value,\n defaultValue,\n size = 'medium',\n className,\n selectedValue: deprecatedValue,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultValue ?? null,\n );\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n const id = 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;AAAA,UACX,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAGjB,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,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I;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 ValidationErrorFilledIcon,\n ValidationExclamationFilledIcon,\n ValidationSuccessFilledIcon,\n} from '@entur/icons';\nimport { SubLabel } from '@entur/typography';\nimport { VariantType } from '@entur/utils';\n\nimport classNames from 'classnames';\nimport './FeedbackText.scss';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst AlertIcon = ({\n variant,\n}: {\n variant: VariantType | typeof info | typeof error;\n}) => {\n const iconClass = `eds-feedback-text__icon eds-feedback-text__icon--${variant}`;\n switch (variant) {\n case 'success':\n return (\n <ValidationSuccessFilledIcon\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 = ({\n children,\n hideIcon = false,\n variant,\n className,\n ...rest\n}: FeedbackTextProps) => {\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 = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const [filled, setFilled] = React.useState(false);\n\n const value = React.useMemo(\n () => ({ isFilled: filled, setFilled }),\n [filled, setFilled],\n );\n\n return (\n <InputGroupContext.Provider value={value}>\n {children}\n </InputGroupContext.Provider>\n );\n};\n\nexport const useInputGroupContext = (): InputGroupContextType =>\n React.useContext(InputGroupContext);\n","import classNames from 'classnames';\nimport React from 'react';\nimport { useInputGroupContext } from './InputGroupContext';\nimport './InputGroupLabel.scss';\n\nexport type InputGroupLabelProps = {\n label?: React.ReactNode;\n required?: boolean;\n labelTooltip?: string;\n labelId: string;\n isFilled?: boolean;\n staticAnimation?: boolean;\n} & React.DetailedHTMLProps<\n React.LabelHTMLAttributes<HTMLLabelElement>,\n HTMLLabelElement\n>;\n\nexport const InputGroupLabel = ({\n label,\n required,\n labelId,\n staticAnimation = false,\n className,\n isFilled: forceIsFilled,\n ...rest\n}: InputGroupLabelProps) => {\n const { isFilled } = useInputGroupContext();\n const filler = staticAnimation || (forceIsFilled ?? isFilled);\n return (\n <label\n className={classNames(className, {\n 'eds-input-group-label-wrapper--filled': filler,\n 'eds-input-group-label-wrapper--controlled-label-position':\n forceIsFilled !== undefined,\n })}\n id={labelId}\n {...rest}\n >\n <span\n className={classNames('eds-input-group__label', {\n 'eds-input-group__label--filled': filler,\n })}\n >\n {label} {required && <span>*</span>}\n </span>\n </label>\n );\n};\n","import React from 'react';\nimport { VariantType } from '@entur/utils';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nconst VariantContext = React.createContext<\n VariantType | typeof error | typeof info | null\n>(null);\n\nexport type VariantProviderProps = {\n children: React.ReactNode;\n variant?: VariantType | typeof error | typeof info;\n};\nexport const VariantProvider = ({\n children,\n variant = null,\n}: VariantProviderProps) => {\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 = ({\n indeterminate = false,\n}: {\n indeterminate: boolean;\n}) => {\n return (\n <svg\n className=\"eds-checkbox-icon\"\n width=\"11px\"\n height=\"9px\"\n viewBox=\"6 11 37 33\"\n aria-hidden={true}\n >\n {indeterminate ? (\n <rect x=\"10\" y=\"25\" width=\"28\" height=\"5\" fill=\"white\" />\n ) : (\n <path d=\"M14.1 27.2l7.1 7.2 14.6-14.8\" fill=\"none\" />\n )}\n </svg>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { Heading5 } from '@entur/typography';\nimport './Fieldset.scss';\n\nexport type FieldsetProps = {\n /** Innholdet i felt-gruppen. */\n children: React.ReactNode;\n /** Ekstra klassenavn */\n className?: string;\n /** Labelen til felt-gruppen. */\n label?: React.ReactNode;\n [key: string]: any;\n};\n\nexport const Fieldset = ({\n children,\n className,\n label,\n ...rest\n}: FieldsetProps) => (\n <fieldset className={classNames('eds-fieldset', className)} {...rest}>\n {label && <Heading5 as=\"legend\">{label}</Heading5>}\n {children}\n </fieldset>\n);\n","import React from 'react';\n\ntype RadioGroupContextProps = {\n name: string;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n value: string | null;\n readOnly?: boolean;\n disabled?: boolean;\n};\n\nconst RadioGroupContext = React.createContext<RadioGroupContextProps | null>(\n null,\n);\n\nexport const RadioGroupContextProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext: () => RadioGroupContextProps = () => {\n const context = React.useContext(RadioGroupContext);\n if (!context) {\n throw new Error(\n 'You need to wrap your RadioButtons in a RadioGroup component',\n );\n }\n return context;\n};\n","import React from 'react';\nimport cx from 'classnames';\nimport { Paragraph } from '@entur/typography';\nimport { useRadioGroupContext } from './RadioGroupContext';\nimport './Radio.scss';\n\nexport type RadioProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Label til radio-button. Vises ved høyre side. */\n children?: React.ReactNode;\n /** Verdien til radioknappen */\n value: string;\n /** Om radiobutton er disabled eller ikke\n * @default false\n */\n disabled?: boolean;\n /** Beskrivelse som leses opp av skjermlesere når radiobutton er readonly */\n readOnlyLabelDescription?: string;\n} & React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n (\n { className, children, value, disabled, readOnlyLabelDescription, ...rest },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const {\n name,\n value: selectedValue,\n onChange,\n readOnly,\n } = useRadioGroupContext();\n\n const classList = cx(className, 'eds-form-component--radio__radio', {\n 'eds-form-component--radio__radio--disabled': disabled,\n 'eds-form-component--radio__radio--readonly': readOnly,\n });\n\n return (\n <label className=\"eds-form-component--radio__container\">\n <input\n type=\"radio\"\n name={rest.name ?? name}\n ref={ref}\n value={value}\n checked={rest.checked ?? selectedValue === value}\n onChange={e => {\n if (readOnly) {\n e.preventDefault();\n return;\n }\n (rest.onChange ?? onChange)?.(e);\n }}\n onClick={e => {\n if (readOnly) {\n e.preventDefault();\n }\n }}\n disabled={disabled}\n aria-label={\n readOnly\n ? `${children?.toString()}. ${\n readOnlyLabelDescription ?? 'Kan ikke endres'\n }`\n : undefined\n }\n {...rest}\n />\n <span className={classList}>\n <span className=\"eds-form-component--radio__circle\"></span>\n </span>\n {children && (\n <Paragraph\n margin=\"none\"\n as=\"span\"\n className=\"eds-form-component--radio__label\"\n >\n {children}\n </Paragraph>\n )}\n </label>\n );\n },\n);\n","import React, { useId, useRef } from 'react';\nimport classNames from 'classnames';\nimport { mergeRefs, useForceUpdate } from '@entur/utils';\nimport { Checkbox } from '../Checkbox';\nimport { Radio } from '../Radio';\n\nimport './InputPanelBase.scss';\n\nexport type InputPanelProps = {\n /** Om det er en radio- eller checkbox-variant */\n type: string;\n /** Verdien til input-panelet */\n value: string;\n /** Om input-panelet skal være valgt eller ikke */\n checked?: boolean;\n /** Hovedtittelen til input-panelet */\n title: React.ReactNode;\n /** Ektstra label som står høyrestilt, til venstre for Checkboxen/Radio-button-en */\n secondaryLabel?: React.ReactNode;\n /** Ekstra informasjon som legges nederst i input-panelet */\n children?: React.ReactNode;\n /** Størrelse på input-panelet\n * @default \"medium\"\n */\n size?: 'medium' | 'large';\n /**Skjuler checkbox-/radio-button-en i input-panelet\n * @default false\n */\n hideSelectionIndicator?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n /** Om input-panelet er deaktivert eller ikke\n * @default false\n */\n disabled?: boolean;\n /** Om input-panelet er skrivebeskyttet (readonly) eller ikke\n * @default false\n */\n readOnly?: boolean;\n /** */\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 = `eds-inputpanel${useId()}`;\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 = ({\n name,\n value,\n children,\n onChange,\n label,\n readOnly = false,\n disabled = false,\n ...rest\n}: RadioGroupProps) => {\n const contextValue = React.useMemo(\n () => ({ name, value, onChange, readOnly, disabled }),\n [name, value, onChange, readOnly, disabled],\n );\n return (\n <RadioGroupContextProvider value={contextValue}>\n {label ? (\n <Fieldset label={label} {...rest}>\n {children}\n </Fieldset>\n ) : (\n children\n )}\n </RadioGroupContextProvider>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { colors } from '@entur/tokens';\nimport { CheckIcon, CloseSmallIcon } from '@entur/icons';\nimport './Switch.scss';\n\nexport type SwitchProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Label for Switch-en. */\n children?: React.ReactNode;\n /** Posisjonen til label for Switch-en.\n * @default \"right\"\n */\n labelPlacement?: 'right' | 'bottom';\n /** Om switch-en er checked eller ikke */\n checked?: boolean;\n /** Ikonet som skal stå inne i sirkelen på Switch-en */\n icon?: React.ReactNode;\n /** Skjul ikonet inne i sikrelen på Switch-en\n * @default false\n */\n hideIcon?: boolean;\n /** Farge som settes på ikon og bakgrunn når Switch-en er \"checked\"\n * @default colors.validation.mint\n */\n color?: string;\n /** Farge på bakgrunn når Switch-en er \"checked\" og står i en kontrast-seksjon\n * @default colors.validation.mintContrast\n */\n contrastColor?: string;\n /** Størrelsen på Switch-en\n * @default \"medium\"\n */\n size?: 'medium' | 'large';\n /** Callback for når verdien endres */\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;\n\nexport const Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n className,\n children,\n labelPlacement = 'right',\n icon,\n hideIcon = false,\n color = colors.validation.mint,\n contrastColor = colors.validation.mintContrast,\n size = 'medium',\n checked,\n ...rest\n },\n ref: React.Ref<HTMLInputElement>,\n ) => {\n const displayedIcon = () => {\n if (icon) return icon;\n if (checked === undefined) return <></>;\n const iconSize = size === 'large' ? 23 : undefined;\n return checked ? (\n <CheckIcon size={iconSize} />\n ) : (\n <CloseSmallIcon size={iconSize} />\n );\n };\n\n return (\n <label\n className={classNames(\n 'eds-switch',\n `eds-switch--${labelPlacement}`,\n className,\n )}\n style={{ ...rest.style }}\n >\n <input type=\"checkbox\" ref={ref} checked={checked} {...rest} />\n <span\n className={classNames(\n 'eds-switch__switch',\n `eds-switch__switch--${size}`,\n )}\n style={\n {\n '--eds-switch-color': color,\n '--eds-switch-contrast-color': contrastColor,\n } as React.CSSProperties\n }\n aria-hidden=\"true\"\n >\n <span className=\"eds-switch__circle\">\n {!hideIcon && displayedIcon()}\n </span>\n </span>\n {children && (\n <span\n className={classNames(\n 'eds-switch__label',\n `eds-switch__label--${size}--${labelPlacement}`,\n )}\n >\n {children}\n </span>\n )}\n </label>\n );\n },\n);\n","export function hasValue(value: any): boolean {\n return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj - Can be a string, an object with a value property (controlled input),\n// or an HTMLInputElement (uncontrolled input)\n// @param SSR - If true, also checks defaultValue property for SSR/uncontrolled initial state\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\nexport function isFilled(obj: any, SSR = false): boolean {\n if (obj == null) {\n return false;\n }\n\n // Handle string values directly\n if (typeof obj === 'string') {\n return obj !== '';\n }\n\n // Handle objects with value property (controlled inputs, HTMLInputElement, etc.)\n if (obj && typeof obj === 'object') {\n // Check current value (works for both controlled { value: \"...\" } and HTMLInputElement)\n if (hasValue(obj.value) && obj.value !== '') {\n return true;\n }\n\n // Check defaultValue for SSR or uncontrolled initial state\n if (SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '') {\n return true;\n }\n }\n\n return false;\n}\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { VariantType, mergeRefs, useOnMount } from '@entur/utils';\n\nimport { useVariant } from './VariantProvider';\nimport { BaseFormControl } from './BaseFormControl';\nimport { useInputGroupContext } from './InputGroupContext';\nimport { isFilled } from './utils';\n\nimport './TextArea.scss';\nimport { Placement } from '@entur/tooltip';\n\n/** @deprecated use variant=\"information\" instead */\nconst info = 'info';\n/** @deprecated use variant=\"negative\" instead */\nconst error = 'error';\n\nexport type TextAreaProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Valideringsvariant */\n variant?: VariantType | typeof error | typeof info;\n /** Deaktiverer tekstområdet */\n disabled?: boolean;\n /** Setter tekstområdet i read-only modus */\n readOnly?: boolean;\n /** Label over TextArea */\n label: string;\n /** En tooltip som forklarer labelen til inputfeltet */\n labelTooltip?: React.ReactNode;\n /** Forklarende tekst for knappen som åpner labelTooltip */\n labelTooltipButtonAriaLabel?: string;\n /** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */\n labelTooltipPlacement?: Placement;\n /** Varselmelding, som vil komme under TextArea */\n feedback?: string;\n /** Plasserer labelen statisk på toppen av inputfeltet\n * @default false\n */\n disableLabelAnimation?: boolean;\n /** Kontrollerer resize-oppførselen til tekstområdet\n * @default \"vertical\"\n */\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(\n (\n {\n variant,\n disabled = false,\n readOnly = false,\n className,\n style,\n label,\n feedback,\n labelTooltip,\n labelTooltipButtonAriaLabel,\n labelTooltipPlacement,\n onChange,\n disableLabelAnimation,\n resize,\n ...rest\n },\n ref: React.Ref<HTMLTextAreaElement>,\n ) => {\n const textAreaId = `eds-textarea${useId()}`;\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n return (\n <BaseFormControl\n className={classNames(className, 'eds-textarea__wrapper')}\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n style={style}\n label={label}\n labelId={textAreaId}\n feedback={feedback}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelProps={{ className: 'eds-textarea__label' }}\n disableLabelAnimation={disableLabelAnimation}\n onClick={e => {\n if (e.target === e.currentTarget) textareaRef?.current?.focus();\n }}\n >\n <TextAreaBase\n readOnly={readOnly}\n disabled={disabled}\n ref={mergeRefs(ref, textareaRef)}\n aria-labelledby={textAreaId}\n onChange={onChange}\n variant={variant}\n resize={resize}\n {...rest}\n />\n </BaseFormControl>\n );\n },\n);\n\ntype TextAreaBaseProps = {\n readOnly?: boolean;\n disabled?: boolean;\n variant?: VariantType | typeof error | typeof info;\n resize?: 'vertical' | 'none';\n} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextAreaBase = React.forwardRef<HTMLTextAreaElement, TextAreaBaseProps>(\n (\n { readOnly, disabled, onChange, value, variant, resize, style, ...rest },\n ref,\n ) => {\n const contextVariant = useVariant();\n const currentVariant = variant || contextVariant;\n const { isFilled: isInputFilled, setFilled: setFiller } =\n useInputGroupContext();\n\n useOnMount(() => {\n if (value?.toString() || rest.defaultValue) {\n setFiller && !isInputFilled && setFiller(true);\n }\n });\n React.useEffect(() => {\n if (value?.toString() && setFiller && !isInputFilled) {\n setFiller(true);\n }\n }, [value, setFiller, isInputFilled]);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isFilled(event.target)) {\n setFiller && !isInputFilled && setFiller(true);\n } else {\n setFiller && isInputFilled && setFiller(false);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <textarea\n className=\"eds-form-control eds-textarea\"\n ref={ref}\n readOnly={readOnly}\n disabled={disabled}\n onChange={handleChange}\n value={value}\n aria-invalid={currentVariant === 'error'}\n style={resize ? { ...style, resize } : style}\n {...rest}\n />\n );\n },\n);\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\n\nimport { IconButton } from '@entur/button';\nimport { CloseSmallIcon } from '@entur/icons';\nimport { Placement } from '@entur/tooltip';\nimport { VariantType, mergeRefs } from '@entur/utils';\n\nimport { BaseFormControl } 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 = `eds-textfield${useId()}`;\n const textFieldId = labelProps && labelProps.id ? labelProps.id : randomId;\n const textFieldRef = React.useRef<HTMLInputElement>(null);\n const { setFilled } = useInputGroupContext();\n\n const handleClear = () => {\n const inputElement = textFieldRef.current;\n // Trigger an input event with target value \"\" to\n // both reset uncontrolled value and send an onChange event\n // for controlled value\n if (inputElement) {\n const setNativeInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value',\n )?.set;\n setNativeInputValue?.call(inputElement, '');\n\n const inputEvent = new Event('input', { bubbles: true });\n inputElement.dispatchEvent(inputEvent);\n inputElement.focus();\n setFilled(false);\n }\n onClear?.();\n };\n\n const _append = React.useMemo((): React.ReactElement | null => {\n if (!clearable || disabled || readOnly)\n return (append as React.ReactElement) ?? null;\n\n return (\n <div className=\"eds-textfield__append\">\n {append}\n <ClearButton onClear={handleClear} ariaLabel={clearButtonAriaLabel} />\n </div>\n );\n }, [append, clearable, disabled, readOnly]);\n\n return (\n <BaseFormControl\n disabled={disabled}\n readOnly={readOnly}\n variant={variant}\n prepend={prepend}\n append={_append}\n className={classNames(className, 'eds-textfield__wrapper')}\n style={style}\n size={size}\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n labelTooltipButtonAriaLabel={labelTooltipButtonAriaLabel}\n labelTooltipPlacement={labelTooltipPlacement}\n labelId={textFieldId}\n feedback={feedback}\n disableLabelAnimation={disableLabelAnimation}\n labelProps={labelProps}\n ariaAlertOnFeedback={ariaAlertOnFeedback}\n 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 = ({\n onClear,\n ariaLabel,\n}: {\n onClear: () => void;\n ariaLabel: string;\n}) => {\n const { isFilled } = useInputGroupContext();\n if (isFilled) {\n return (\n <>\n <div className=\"eds-textfield__divider\" />\n <IconButton\n className=\"eds-textfield__clear-button\"\n type=\"button\"\n aria-label={ariaLabel}\n onClick={onClear}\n >\n <CloseSmallIcon aria-hidden />\n </IconButton>\n </>\n );\n }\n return null;\n};\n","import React, { useId } from 'react';\nimport classNames from 'classnames';\nimport { Label } from '@entur/typography';\nimport { ExtendableProps } from '@entur/utils';\nimport './SegmentedControl.scss';\n\ntype SegmentedContextProps = {\n name: string;\n onChange: (value: string | null) => void;\n value: string | null;\n size: 'medium' | 'large';\n focusedValue: string | null;\n setFocusedValue: (value: string | null) => void;\n};\n\nconst SegmentedContext = React.createContext<SegmentedContextProps | null>(\n null,\n);\n\nexport const useSegmentedContext = (): SegmentedContextProps => {\n const context = React.useContext(SegmentedContext);\n if (!context) {\n throw new Error(\n 'You need to wrap your SegmentedChoice in SegmentedControl',\n );\n }\n return context;\n};\n\nexport type SegmentedControlProps = ExtendableProps<\n React.HTMLAttributes<HTMLDivElement>,\n {\n /** Navn på input-elementene */\n name?: string;\n /** Beskrivende tekst */\n label?: string;\n /** En eller flere SegmentedChoice-komponenter */\n children: React.ReactNode;\n /**\n * Den valgte verdien (kontrollert modus).\n * Bruk `value` for kontrollert eller evt. `defaultValue` for ukontrollert komponent.\n */\n value?: string | null;\n /**\n * Standard verdi (ukontrollert modus).\n * Brukes når komponenten skal håndtere sin egen tilstand.\n */\n defaultValue?: string | null;\n /**\n * Callback for når det gjøres et valg.\n * Påkrevd for kontrollert modus (`value` eller `selectedValue`).\n */\n onChange?: (value: string | null) => void;\n /** Størrelsen på SegmentedChoice-komponentene */\n size?: 'medium' | 'large';\n /** Ekstra klassenavn */\n className?: string;\n /** @deprecated Bruk `value` for kontrollert eller `defaultValue` for ukontrollert oppførsel i stedet.\n *\n * Vi beveger oss gradvis mot å standardisere props for å følge\n * HTML-standarder. Derfor vil vi etter hvert avvikle `selectedValue` og lignende props over tid. */\n selectedValue?: string | null;\n }\n>;\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(\n (\n {\n children,\n label,\n name,\n onChange,\n value,\n defaultValue,\n size = 'medium',\n className,\n selectedValue: deprecatedValue,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = React.useState<string | null>(\n defaultValue ?? null,\n );\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n const id = `eds-segmented-control${useId()}`;\n\n const isControlled = deprecatedValue !== undefined || value !== undefined;\n const currentValue =\n deprecatedValue !== undefined\n ? deprecatedValue\n : value !== undefined\n ? value\n : internalValue;\n\n const handleChange = React.useCallback(\n (newValue: string | null) => {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n\n onChange?.(newValue);\n },\n [isControlled, onChange],\n );\n\n const contextValue = React.useMemo(\n () => ({\n name: name ?? label ?? id,\n onChange: handleChange,\n value: currentValue,\n size,\n focusedValue,\n setFocusedValue,\n }),\n [id, name, handleChange, currentValue, size, focusedValue, label],\n );\n\n const labelId = `${id}-label`;\n\n return (\n <SegmentedContext.Provider value={contextValue}>\n <div\n className={classNames('eds-segmented-control', className)}\n role=\"radiogroup\"\n aria-labelledby={label ? labelId : undefined}\n ref={ref}\n {...rest}\n >\n {label !== undefined && (\n <Label htmlFor={id} id={labelId}>\n {label}\n </Label>\n )}\n <input\n name={name ?? label ?? id}\n value={currentValue ?? undefined}\n type=\"hidden\"\n id={id}\n />\n <div className=\"eds-segmented-control__choices\">\n {React.Children.map(children, (child, index) => {\n if (index === 0 && React.isValidElement(child))\n return React.cloneElement(child, {\n 'data-first-child': true,\n } as any);\n\n return child;\n })}\n </div>\n </div>\n </SegmentedContext.Provider>\n );\n },\n);\n","export const getNextWithDataValue = (\n el: HTMLElement | null,\n): HTMLElement | null => {\n let current = el?.nextElementSibling as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.nextElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getPrevWithDataValue = (\n el: HTMLElement | null,\n): HTMLElement | null => {\n let current = el?.previousElementSibling as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.previousElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getFirstWithDataValue = (\n parent: HTMLElement | null,\n): HTMLElement | null => {\n let current = parent?.firstElementChild as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.nextElementSibling as HTMLElement | null;\n }\n return null;\n};\n\nexport const getLastWithDataValue = (\n parent: HTMLElement | null,\n): HTMLElement | null => {\n let current = parent?.lastElementChild as HTMLElement | null;\n while (current) {\n if (current.hasAttribute('data-value')) return current;\n current = current.previousElementSibling as HTMLElement | null;\n }\n return null;\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { useSegmentedContext } from './SegmentedControl';\nimport { 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,YAAY,CAAC;AAAA,EACjB;AACF,MAEM;AACJ,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,K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;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;"}
|
package/dist/styles.css
CHANGED
|
@@ -831,9 +831,9 @@
|
|
|
831
831
|
padding:0;
|
|
832
832
|
}
|
|
833
833
|
.eds-textarea__label .eds-form-control-wrapper--is-filled .eds-input-group__label{
|
|
834
|
-
-webkit-box-shadow:
|
|
835
|
-
-moz-box-shadow:
|
|
836
|
-
box-shadow:
|
|
834
|
+
-webkit-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
835
|
+
-moz-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
836
|
+
box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
837
837
|
background:var(--textarea-label-background);
|
|
838
838
|
width:-webkit-calc(100% - 1rem - 1rem - 4px);
|
|
839
839
|
width:-moz-calc(100% - 1rem - 1rem - 4px);
|
|
@@ -858,9 +858,9 @@
|
|
|
858
858
|
padding:0;
|
|
859
859
|
}
|
|
860
860
|
.eds-textarea__label .eds-input-group__label--filled{
|
|
861
|
-
-webkit-box-shadow:
|
|
862
|
-
-moz-box-shadow:
|
|
863
|
-
box-shadow:
|
|
861
|
+
-webkit-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
862
|
+
-moz-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
863
|
+
box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
864
864
|
background:var(--textarea-label-background);
|
|
865
865
|
width:-webkit-calc(100% - 1rem - 1rem - 4px);
|
|
866
866
|
width:-moz-calc(100% - 1rem - 1rem - 4px);
|
|
@@ -881,9 +881,9 @@
|
|
|
881
881
|
padding:0;
|
|
882
882
|
}
|
|
883
883
|
.eds-textarea__label .eds-form-control-wrapper:focus-within :not(.eds-input-group-label-wrapper--controlled-label-position) .eds-input-group__label{
|
|
884
|
-
-webkit-box-shadow:
|
|
885
|
-
-moz-box-shadow:
|
|
886
|
-
box-shadow:
|
|
884
|
+
-webkit-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
885
|
+
-moz-box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
886
|
+
box-shadow:0 -2px 0 4px var(--textarea-label-background);
|
|
887
887
|
background:var(--textarea-label-background);
|
|
888
888
|
width:-webkit-calc(100% - 1rem - 1rem - 4px);
|
|
889
889
|
width:-moz-calc(100% - 1rem - 1rem - 4px);
|
|
@@ -1858,9 +1858,9 @@
|
|
|
1858
1858
|
-webkit-border-radius:1.5rem;
|
|
1859
1859
|
-moz-border-radius:1.5rem;
|
|
1860
1860
|
border-radius:1.5rem;
|
|
1861
|
-
-webkit-box-shadow:inset
|
|
1862
|
-
-moz-box-shadow:inset
|
|
1863
|
-
box-shadow:inset
|
|
1861
|
+
-webkit-box-shadow:inset 0 2px 2px -1px rgba(0, 0, 0, 0.1);
|
|
1862
|
+
-moz-box-shadow:inset 0 2px 2px -1px rgba(0, 0, 0, 0.1);
|
|
1863
|
+
box-shadow:inset 0 2px 2px -1px rgba(0, 0, 0, 0.1);
|
|
1864
1864
|
}
|
|
1865
1865
|
.eds-contrast .eds-switch__switch{
|
|
1866
1866
|
background-color:var(--components-form-switch-contrast-fill-false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-next.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/form.cjs.js",
|
|
6
6
|
"module": "dist/form.esm.js",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"test": "jest"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"react": ">=
|
|
26
|
-
"react-dom": ">=
|
|
25
|
+
"react": ">=18.0.0",
|
|
26
|
+
"react-dom": ">=18.0.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@entur/button": "^
|
|
30
|
-
"@entur/icons": "^
|
|
31
|
-
"@entur/tokens": "^3.24.0",
|
|
32
|
-
"@entur/tooltip": "^
|
|
33
|
-
"@entur/typography": "^
|
|
34
|
-
"@entur/utils": "^0.
|
|
29
|
+
"@entur/button": "^5.0.0-next.0",
|
|
30
|
+
"@entur/icons": "^10.0.0-next.0",
|
|
31
|
+
"@entur/tokens": "^3.24.1-next.0",
|
|
32
|
+
"@entur/tooltip": "^6.0.0-next.0",
|
|
33
|
+
"@entur/typography": "^3.0.0-next.0",
|
|
34
|
+
"@entur/utils": "^1.0.0-next.0",
|
|
35
35
|
"classnames": "^2.5.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@testing-library/jest-dom": "^5.17.0",
|
|
39
|
-
"@testing-library/react": "^
|
|
39
|
+
"@testing-library/react": "^16.3.0",
|
|
40
40
|
"@testing-library/user-event": "14.6.1",
|
|
41
41
|
"@vitejs/plugin-react": "^5.0.1",
|
|
42
42
|
"jest": "^29.0.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vite": "^7.3.2",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0f435bdeec98cc3cea1db7434b13b1f771a39a18"
|
|
50
50
|
}
|