@norges-domstoler/dds-components 21.15.0 → 21.16.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/index.css +16 -16
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +40 -42
- package/dist/index.d.ts +40 -42
- package/dist/index.js +94 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -18
package/dist/index.d.mts
CHANGED
|
@@ -430,6 +430,16 @@ declare function useReturnFocusOnBlur<T extends HTMLElement>(active: boolean, on
|
|
|
430
430
|
|
|
431
431
|
type Direction$1 = 'row' | 'column';
|
|
432
432
|
|
|
433
|
+
interface CommonComponentProps<THTMLProps extends object, TRef extends Ref<unknown>> {
|
|
434
|
+
/**HTML id. */
|
|
435
|
+
id?: string;
|
|
436
|
+
/**HTML klassenavn. */
|
|
437
|
+
className?: string;
|
|
438
|
+
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
439
|
+
htmlProps?: THTMLProps;
|
|
440
|
+
/**Ref til komponenten. */
|
|
441
|
+
ref?: TRef;
|
|
442
|
+
}
|
|
433
443
|
/**
|
|
434
444
|
* Basetype for props som eksponeres til konsumenter av designsystemet.
|
|
435
445
|
* Lager en intersection-type med props som sendes inn og `id` og `htmlProps`
|
|
@@ -441,16 +451,7 @@ type Direction$1 = 'row' | 'column';
|
|
|
441
451
|
* @template TOtherProps Andre props komponenten skal eksponere til konsumenter.
|
|
442
452
|
* @template THTMLAttributesProps Standard `HTMLAttributes<T>` men kan overstyres for f.eks knapper hvis man trenger en annen basetype for `htmlProps`.
|
|
443
453
|
*/
|
|
444
|
-
type BaseComponentProps<TElement extends Element, TOtherProps extends object = object, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = Omit<THTMLAttributesProps, 'id' | 'className'> & TOtherProps &
|
|
445
|
-
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
446
|
-
htmlProps?: THTMLAttributesProps;
|
|
447
|
-
/**Ref til komponenten. */
|
|
448
|
-
ref?: Ref<TElement>;
|
|
449
|
-
/**HTML id. */
|
|
450
|
-
id?: string;
|
|
451
|
-
/**Klassenavn. */
|
|
452
|
-
className?: string;
|
|
453
|
-
};
|
|
454
|
+
type BaseComponentProps<TElement extends Element, TOtherProps extends object = object, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = Omit<THTMLAttributesProps, 'id' | 'className'> & TOtherProps & CommonComponentProps<THTMLAttributesProps, Ref<TElement>>;
|
|
454
455
|
/**
|
|
455
456
|
* Basetype for polymorfe props som eksponeres til konsumenter av designsystemet.
|
|
456
457
|
* Lager en intersection-type med props som sendes inn og `id` og `htmlProps`
|
|
@@ -461,17 +462,9 @@ type BaseComponentProps<TElement extends Element, TOtherProps extends object = o
|
|
|
461
462
|
* @template TOtherProps Andre props komponenten skal eksponere til konsumenter.
|
|
462
463
|
* @template TComponentProps Standard `ComponentPropsWithoutRef<E>` som kan overstyres hvis man trenger en annen basetype for `htmlProps`, f.eks. for å støtte ofte brukte attributter på roten.
|
|
463
464
|
*/
|
|
464
|
-
type PolymorphicBaseComponentProps<E extends ElementType, TOtherProps extends object = object, TComponentProps extends object = ComponentPropsWithoutRef<E>> = Omit<TComponentProps, 'id' | 'className' | 'style' | 'ref'> & TOtherProps & {
|
|
465
|
+
type PolymorphicBaseComponentProps<E extends ElementType, TOtherProps extends object = object, TComponentProps extends object = ComponentPropsWithoutRef<E>> = Omit<TComponentProps, 'id' | 'className' | 'style' | 'ref'> & TOtherProps & CommonComponentProps<TComponentProps, ComponentPropsWithRef<E>['ref']> & {
|
|
465
466
|
/**HTML- eller React-element som returneres. */
|
|
466
467
|
as?: E;
|
|
467
|
-
/**Ref til komponenten. */
|
|
468
|
-
ref?: ComponentPropsWithRef<E>['ref'];
|
|
469
|
-
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` og `style` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
470
|
-
htmlProps?: TComponentProps;
|
|
471
|
-
/**HTML id. */
|
|
472
|
-
id?: string;
|
|
473
|
-
/**Klassenavn. */
|
|
474
|
-
className?: string;
|
|
475
468
|
/**Inline style. */
|
|
476
469
|
style?: CSSProperties;
|
|
477
470
|
};
|
|
@@ -2313,6 +2306,8 @@ declare const Typography: {
|
|
|
2313
2306
|
interface CommonInputProps {
|
|
2314
2307
|
/**Ledetekst. */
|
|
2315
2308
|
label?: string;
|
|
2309
|
+
/** Innhold etter ledetekst, f.eks. knapp som viser ekstra info e.l. */
|
|
2310
|
+
afterLabelContent?: ReactNode;
|
|
2316
2311
|
/**Bredde for inputfeltet. Kan settes per brekkpunkt, manglende brekkpunter får da default bredde. */
|
|
2317
2312
|
width?: ResponsiveProps['width'];
|
|
2318
2313
|
/**Hjelpetekst. */
|
|
@@ -2364,10 +2359,12 @@ interface BaseLabelProps {
|
|
|
2364
2359
|
showRequiredStyling?: boolean;
|
|
2365
2360
|
/** Om input knyttet til ledeteksten er `read-only`; påvirker styling. */
|
|
2366
2361
|
readOnly?: boolean;
|
|
2362
|
+
/**Innhold som står etter ledeteksten (knapp med ekstra info e.l.). */
|
|
2363
|
+
afterLabelContent?: ReactNode;
|
|
2367
2364
|
}
|
|
2368
2365
|
type LabelProps = BaseComponentPropsWithChildren<HTMLLabelElement, BaseLabelProps & BaseTypographyProps & PickedHTMLAttributes$4, Omit<LabelHTMLAttributes<HTMLLabelElement>, keyof PickedHTMLAttributes$4 | 'color'>>;
|
|
2369
2366
|
declare const Label: {
|
|
2370
|
-
({ showRequiredStyling, readOnly, id, className, htmlProps, children, ...rest }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
2367
|
+
({ showRequiredStyling, readOnly, id, className, htmlProps, children, afterLabelContent, ...rest }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
2371
2368
|
displayName: string;
|
|
2372
2369
|
};
|
|
2373
2370
|
|
|
@@ -2381,16 +2378,16 @@ declare const Legend: {
|
|
|
2381
2378
|
};
|
|
2382
2379
|
|
|
2383
2380
|
type PickedHTMLAttributes$3 = Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick' | 'href' | 'target'>;
|
|
2384
|
-
type LinkProps =
|
|
2381
|
+
type LinkProps<T extends ElementType = 'a'> = PolymorphicBaseComponentProps<T, {
|
|
2385
2382
|
/**Spesifiserer om lenken fører til et eksternt nettsted eller åpnes i nytt vindu. Påvirker styling og setter `target` prop. */
|
|
2386
2383
|
external?: boolean;
|
|
2387
2384
|
/**Om lenken kan få `:visited`-styling. */
|
|
2388
2385
|
withVisited?: boolean;
|
|
2389
2386
|
/**Spesifiserer typografistil basert på utvalget for brødtekst. Arver hvis ikke oppgitt. */
|
|
2390
2387
|
typographyType?: TypographyBodyType;
|
|
2391
|
-
} & BaseTypographyProps & PickedHTMLAttributes$3, Omit<
|
|
2388
|
+
} & BaseTypographyProps & PickedHTMLAttributes$3, Omit<ComponentPropsWithoutRef<T>, keyof PickedHTMLAttributes$3 | 'color'>>;
|
|
2392
2389
|
declare const Link: {
|
|
2393
|
-
({ id, className, htmlProps, children, typographyType, withMargins, withVisited, external, target, style, color, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
2390
|
+
<T extends ElementType = "a">({ id, className, htmlProps, children, typographyType, withMargins, withVisited, external, target, style, color, as: propAs, ...rest }: LinkProps<T>): react_jsx_runtime.JSX.Element;
|
|
2394
2391
|
displayName: string;
|
|
2395
2392
|
};
|
|
2396
2393
|
|
|
@@ -2425,9 +2422,13 @@ type BackLinkProps = {
|
|
|
2425
2422
|
* Ledetekst.
|
|
2426
2423
|
*/
|
|
2427
2424
|
label: string;
|
|
2425
|
+
/**
|
|
2426
|
+
* Custom HTML- eller React-element som returneres. Brukes ved klient-side ruting o.l.
|
|
2427
|
+
*/
|
|
2428
|
+
as?: ElementType;
|
|
2428
2429
|
} & Pick<ComponentPropsWithRef<'a'>, 'onClick' | 'href' | 'ref'>;
|
|
2429
2430
|
declare const BackLink: {
|
|
2430
|
-
({ label, ref, ...rest }: BackLinkProps): react_jsx_runtime.JSX.Element;
|
|
2431
|
+
({ label, ref, as, ...rest }: BackLinkProps): react_jsx_runtime.JSX.Element;
|
|
2431
2432
|
displayName: string;
|
|
2432
2433
|
};
|
|
2433
2434
|
|
|
@@ -3069,8 +3070,6 @@ type FileUploaderHookProps = {
|
|
|
3069
3070
|
type FileUploaderProps = {
|
|
3070
3071
|
/**Id til filopplasteren. */
|
|
3071
3072
|
id?: string;
|
|
3072
|
-
/**Ledetekst for filopplaster. */
|
|
3073
|
-
label?: string;
|
|
3074
3073
|
/**Ledetekst for slippsonen. Denne teksten skal, av UU-hensyn, henge sammen med den usynlige teksten: "velg fil med påfølgende knapp"
|
|
3075
3074
|
* @default Dra og slipp filer her eller
|
|
3076
3075
|
*/
|
|
@@ -3089,7 +3088,7 @@ type FileUploaderProps = {
|
|
|
3089
3088
|
withDragAndDrop?: boolean;
|
|
3090
3089
|
/**Om listen med opplastede filer skal skjules. Brukes kun hvis listen blir vist på egen måte. */
|
|
3091
3090
|
hideFileList?: boolean;
|
|
3092
|
-
} & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip'>;
|
|
3091
|
+
} & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip' | 'label' | 'afterLabelContent'>;
|
|
3093
3092
|
declare const FileUploader: {
|
|
3094
3093
|
(props: FileUploaderProps): react_jsx_runtime.JSX.Element;
|
|
3095
3094
|
displayName: string;
|
|
@@ -3160,8 +3159,13 @@ declare const GlobalMessage: {
|
|
|
3160
3159
|
displayName: string;
|
|
3161
3160
|
};
|
|
3162
3161
|
|
|
3163
|
-
type InlineButtonProps =
|
|
3164
|
-
|
|
3162
|
+
type InlineButtonProps = {
|
|
3163
|
+
/**
|
|
3164
|
+
* Enestående ikon; bruk av denne propen sørge for riktig visning av ikonet.
|
|
3165
|
+
*/
|
|
3166
|
+
icon?: SvgIcon;
|
|
3167
|
+
} & Pick<BaseTypographyProps, 'color'> & Omit<ComponentPropsWithRef<'button'>, 'color'>;
|
|
3168
|
+
declare const InlineButton: ({ className, color, icon, children, ...rest }: InlineButtonProps) => react_jsx_runtime.JSX.Element;
|
|
3165
3169
|
|
|
3166
3170
|
interface InlineEditContextType {
|
|
3167
3171
|
onChange: (e: ChangeEvent<EditElement>) => void;
|
|
@@ -3535,9 +3539,9 @@ type PhoneInputProps = {
|
|
|
3535
3539
|
* @default "Landskode og telefonnummer"
|
|
3536
3540
|
*/
|
|
3537
3541
|
groupLabel?: string;
|
|
3538
|
-
} & Pick<InputProps, 'readOnly' | 'disabled' | 'width' | 'componentSize' | 'errorMessage' | 'label' | 'tip' | 'required' | 'className' | 'style' | 'aria-required' | 'aria-describedby' | 'ref'>;
|
|
3542
|
+
} & Pick<InputProps, 'readOnly' | 'disabled' | 'width' | 'componentSize' | 'errorMessage' | 'label' | 'afterLabelContent' | 'tip' | 'required' | 'className' | 'style' | 'aria-required' | 'aria-describedby' | 'ref'>;
|
|
3539
3543
|
declare const PhoneInput: {
|
|
3540
|
-
({ label, readOnly, errorMessage, tip, required, width, componentSize, name, className, style, value, selectLabel, selectRef, onChange, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, groupLabel, ref, ...props }: PhoneInputProps): react_jsx_runtime.JSX.Element;
|
|
3544
|
+
({ label, readOnly, errorMessage, tip, required, width, componentSize, name, className, style, value, selectLabel, selectRef, onChange, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, groupLabel, afterLabelContent, ref, ...props }: PhoneInputProps): react_jsx_runtime.JSX.Element;
|
|
3541
3545
|
displayName: string;
|
|
3542
3546
|
};
|
|
3543
3547
|
|
|
@@ -3758,8 +3762,6 @@ interface SelectOption<TValue = unknown> {
|
|
|
3758
3762
|
}
|
|
3759
3763
|
type WrappedReactSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = WithRequiredIf<Option extends SelectOption ? false : true, Props<Option, IsMulti, Group>, 'getOptionLabel' | 'getOptionValue'>;
|
|
3760
3764
|
type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
3761
|
-
/**Ledetekst for nedtrekkslisten. */
|
|
3762
|
-
label?: string;
|
|
3763
3765
|
/**Størrelsen på komponenten.
|
|
3764
3766
|
* @default "medium"
|
|
3765
3767
|
*/
|
|
@@ -3768,10 +3770,6 @@ type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
|
3768
3770
|
icon?: SvgIcon;
|
|
3769
3771
|
/**Nedtrekkslisten blir `readonly` og får readOnly styling. */
|
|
3770
3772
|
readOnly?: boolean;
|
|
3771
|
-
/**Meldingen som vises ved valideringsfeil. */
|
|
3772
|
-
errorMessage?: string;
|
|
3773
|
-
/**Hjelpetekst. */
|
|
3774
|
-
tip?: string;
|
|
3775
3773
|
/** CSS klassenavn. */
|
|
3776
3774
|
className?: string;
|
|
3777
3775
|
/** Inline styling. */
|
|
@@ -3784,9 +3782,9 @@ type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
|
3784
3782
|
'data-testid'?: string;
|
|
3785
3783
|
/**Ref til komponenten. */
|
|
3786
3784
|
ref?: SelectForwardRefType<Option, IsMulti>;
|
|
3787
|
-
} & Pick<HTMLAttributes<HTMLInputElement>, 'aria-required'> &
|
|
3785
|
+
} & CommonInputProps & Pick<HTMLAttributes<HTMLInputElement>, 'aria-required'> & WrappedReactSelectProps<Option, IsMulti, GroupBase<Option>>;
|
|
3788
3786
|
type SelectForwardRefType<Option, IsMulti extends boolean> = Ref<SelectInstance<Option, IsMulti, GroupBase<Option>>>;
|
|
3789
|
-
declare function Select<Option = unknown, IsMulti extends boolean = false>({ id, label, componentSize, errorMessage, tip, 'aria-required': ariaRequired, readOnly, options, isMulti, value, icon, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, menuPortalTarget, customOptionElement, customSingleValueElement, 'data-testid': dataTestId, onKeyDown, openMenuOnClick, ref, instanceId, ...rest }: SelectProps<Option, IsMulti>): react_jsx_runtime.JSX.Element;
|
|
3787
|
+
declare function Select<Option = unknown, IsMulti extends boolean = false>({ id, label, componentSize, errorMessage, tip, 'aria-required': ariaRequired, readOnly, options, isMulti, value, icon, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, menuPortalTarget, customOptionElement, customSingleValueElement, 'data-testid': dataTestId, onKeyDown, openMenuOnClick, ref, instanceId, afterLabelContent, ...rest }: SelectProps<Option, IsMulti>): react_jsx_runtime.JSX.Element;
|
|
3790
3788
|
declare namespace Select {
|
|
3791
3789
|
var displayName: string;
|
|
3792
3790
|
}
|
|
@@ -3797,7 +3795,7 @@ type NativeSelectProps = {
|
|
|
3797
3795
|
/** Implementerer `readOnly` oppførsel etter standard for `<input>` og setter `readOnly` styling. */
|
|
3798
3796
|
readOnly?: InputProps['readOnly'];
|
|
3799
3797
|
} & CommonInputProps & Pick<InputProps, 'componentSize'> & ComponentPropsWithRef<'select'>;
|
|
3800
|
-
declare const NativeSelect: ({ ref, id, children, componentSize, label, multiple, readOnly, errorMessage, tip, required, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, width, className, style, onKeyDown, onMouseDown, clearable, onChange, ...rest }: NativeSelectProps) => react_jsx_runtime.JSX.Element;
|
|
3798
|
+
declare const NativeSelect: ({ ref, id, children, componentSize, label, multiple, readOnly, errorMessage, tip, required, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, width, className, style, onKeyDown, onMouseDown, clearable, afterLabelContent, onChange, ...rest }: NativeSelectProps) => react_jsx_runtime.JSX.Element;
|
|
3801
3799
|
type NativeSelectPlaceholderProps = ComponentPropsWithRef<'option'>;
|
|
3802
3800
|
declare const NativeSelectPlaceholder: {
|
|
3803
3801
|
({ children, value, ...rest }: NativeSelectPlaceholderProps): react_jsx_runtime.JSX.Element;
|
|
@@ -4183,7 +4181,7 @@ interface TextAffixProps {
|
|
|
4183
4181
|
}
|
|
4184
4182
|
|
|
4185
4183
|
declare const TextInput: {
|
|
4186
|
-
({ label, disabled, readOnly, errorMessage, tip, required, maxLength, onChange, id, width, componentSize, type, withCharacterCounter, className, style, value, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, icon, prefix, suffix, ref, ...rest }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
4184
|
+
({ label, afterLabelContent, disabled, readOnly, errorMessage, tip, required, maxLength, onChange, id, width, componentSize, type, withCharacterCounter, className, style, value, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, icon, prefix, suffix, ref, ...rest }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
4187
4185
|
displayName: string;
|
|
4188
4186
|
};
|
|
4189
4187
|
|
|
@@ -4212,7 +4210,7 @@ type ToggleProps = BaseComponentProps<HTMLElement, {
|
|
|
4212
4210
|
*/
|
|
4213
4211
|
readOnly?: boolean;
|
|
4214
4212
|
/**
|
|
4215
|
-
* Indikerer at verdien prosesseres; viser loading-tilstand og setter `
|
|
4213
|
+
* Indikerer at verdien prosesseres; viser loading-tilstand og setter `disabled`.
|
|
4216
4214
|
*/
|
|
4217
4215
|
isLoading?: boolean;
|
|
4218
4216
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -430,6 +430,16 @@ declare function useReturnFocusOnBlur<T extends HTMLElement>(active: boolean, on
|
|
|
430
430
|
|
|
431
431
|
type Direction$1 = 'row' | 'column';
|
|
432
432
|
|
|
433
|
+
interface CommonComponentProps<THTMLProps extends object, TRef extends Ref<unknown>> {
|
|
434
|
+
/**HTML id. */
|
|
435
|
+
id?: string;
|
|
436
|
+
/**HTML klassenavn. */
|
|
437
|
+
className?: string;
|
|
438
|
+
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
439
|
+
htmlProps?: THTMLProps;
|
|
440
|
+
/**Ref til komponenten. */
|
|
441
|
+
ref?: TRef;
|
|
442
|
+
}
|
|
433
443
|
/**
|
|
434
444
|
* Basetype for props som eksponeres til konsumenter av designsystemet.
|
|
435
445
|
* Lager en intersection-type med props som sendes inn og `id` og `htmlProps`
|
|
@@ -441,16 +451,7 @@ type Direction$1 = 'row' | 'column';
|
|
|
441
451
|
* @template TOtherProps Andre props komponenten skal eksponere til konsumenter.
|
|
442
452
|
* @template THTMLAttributesProps Standard `HTMLAttributes<T>` men kan overstyres for f.eks knapper hvis man trenger en annen basetype for `htmlProps`.
|
|
443
453
|
*/
|
|
444
|
-
type BaseComponentProps<TElement extends Element, TOtherProps extends object = object, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = Omit<THTMLAttributesProps, 'id' | 'className'> & TOtherProps &
|
|
445
|
-
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
446
|
-
htmlProps?: THTMLAttributesProps;
|
|
447
|
-
/**Ref til komponenten. */
|
|
448
|
-
ref?: Ref<TElement>;
|
|
449
|
-
/**HTML id. */
|
|
450
|
-
id?: string;
|
|
451
|
-
/**Klassenavn. */
|
|
452
|
-
className?: string;
|
|
453
|
-
};
|
|
454
|
+
type BaseComponentProps<TElement extends Element, TOtherProps extends object = object, THTMLAttributesProps extends HTMLAttributes<TElement> = HTMLAttributes<TElement>> = Omit<THTMLAttributesProps, 'id' | 'className'> & TOtherProps & CommonComponentProps<THTMLAttributesProps, Ref<TElement>>;
|
|
454
455
|
/**
|
|
455
456
|
* Basetype for polymorfe props som eksponeres til konsumenter av designsystemet.
|
|
456
457
|
* Lager en intersection-type med props som sendes inn og `id` og `htmlProps`
|
|
@@ -461,17 +462,9 @@ type BaseComponentProps<TElement extends Element, TOtherProps extends object = o
|
|
|
461
462
|
* @template TOtherProps Andre props komponenten skal eksponere til konsumenter.
|
|
462
463
|
* @template TComponentProps Standard `ComponentPropsWithoutRef<E>` som kan overstyres hvis man trenger en annen basetype for `htmlProps`, f.eks. for å støtte ofte brukte attributter på roten.
|
|
463
464
|
*/
|
|
464
|
-
type PolymorphicBaseComponentProps<E extends ElementType, TOtherProps extends object = object, TComponentProps extends object = ComponentPropsWithoutRef<E>> = Omit<TComponentProps, 'id' | 'className' | 'style' | 'ref'> & TOtherProps & {
|
|
465
|
+
type PolymorphicBaseComponentProps<E extends ElementType, TOtherProps extends object = object, TComponentProps extends object = ComponentPropsWithoutRef<E>> = Omit<TComponentProps, 'id' | 'className' | 'style' | 'ref'> & TOtherProps & CommonComponentProps<TComponentProps, ComponentPropsWithRef<E>['ref']> & {
|
|
465
466
|
/**HTML- eller React-element som returneres. */
|
|
466
467
|
as?: E;
|
|
467
|
-
/**Ref til komponenten. */
|
|
468
|
-
ref?: ComponentPropsWithRef<E>['ref'];
|
|
469
|
-
/**Native HTML-attributter som vil settes på elementet som genereres. Untatt `id`, `className` og `style` (og eventuelle andre attributter spesifisert i dokumentasjonen) som settes på toppnivå. */
|
|
470
|
-
htmlProps?: TComponentProps;
|
|
471
|
-
/**HTML id. */
|
|
472
|
-
id?: string;
|
|
473
|
-
/**Klassenavn. */
|
|
474
|
-
className?: string;
|
|
475
468
|
/**Inline style. */
|
|
476
469
|
style?: CSSProperties;
|
|
477
470
|
};
|
|
@@ -2313,6 +2306,8 @@ declare const Typography: {
|
|
|
2313
2306
|
interface CommonInputProps {
|
|
2314
2307
|
/**Ledetekst. */
|
|
2315
2308
|
label?: string;
|
|
2309
|
+
/** Innhold etter ledetekst, f.eks. knapp som viser ekstra info e.l. */
|
|
2310
|
+
afterLabelContent?: ReactNode;
|
|
2316
2311
|
/**Bredde for inputfeltet. Kan settes per brekkpunkt, manglende brekkpunter får da default bredde. */
|
|
2317
2312
|
width?: ResponsiveProps['width'];
|
|
2318
2313
|
/**Hjelpetekst. */
|
|
@@ -2364,10 +2359,12 @@ interface BaseLabelProps {
|
|
|
2364
2359
|
showRequiredStyling?: boolean;
|
|
2365
2360
|
/** Om input knyttet til ledeteksten er `read-only`; påvirker styling. */
|
|
2366
2361
|
readOnly?: boolean;
|
|
2362
|
+
/**Innhold som står etter ledeteksten (knapp med ekstra info e.l.). */
|
|
2363
|
+
afterLabelContent?: ReactNode;
|
|
2367
2364
|
}
|
|
2368
2365
|
type LabelProps = BaseComponentPropsWithChildren<HTMLLabelElement, BaseLabelProps & BaseTypographyProps & PickedHTMLAttributes$4, Omit<LabelHTMLAttributes<HTMLLabelElement>, keyof PickedHTMLAttributes$4 | 'color'>>;
|
|
2369
2366
|
declare const Label: {
|
|
2370
|
-
({ showRequiredStyling, readOnly, id, className, htmlProps, children, ...rest }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
2367
|
+
({ showRequiredStyling, readOnly, id, className, htmlProps, children, afterLabelContent, ...rest }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
2371
2368
|
displayName: string;
|
|
2372
2369
|
};
|
|
2373
2370
|
|
|
@@ -2381,16 +2378,16 @@ declare const Legend: {
|
|
|
2381
2378
|
};
|
|
2382
2379
|
|
|
2383
2380
|
type PickedHTMLAttributes$3 = Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick' | 'href' | 'target'>;
|
|
2384
|
-
type LinkProps =
|
|
2381
|
+
type LinkProps<T extends ElementType = 'a'> = PolymorphicBaseComponentProps<T, {
|
|
2385
2382
|
/**Spesifiserer om lenken fører til et eksternt nettsted eller åpnes i nytt vindu. Påvirker styling og setter `target` prop. */
|
|
2386
2383
|
external?: boolean;
|
|
2387
2384
|
/**Om lenken kan få `:visited`-styling. */
|
|
2388
2385
|
withVisited?: boolean;
|
|
2389
2386
|
/**Spesifiserer typografistil basert på utvalget for brødtekst. Arver hvis ikke oppgitt. */
|
|
2390
2387
|
typographyType?: TypographyBodyType;
|
|
2391
|
-
} & BaseTypographyProps & PickedHTMLAttributes$3, Omit<
|
|
2388
|
+
} & BaseTypographyProps & PickedHTMLAttributes$3, Omit<ComponentPropsWithoutRef<T>, keyof PickedHTMLAttributes$3 | 'color'>>;
|
|
2392
2389
|
declare const Link: {
|
|
2393
|
-
({ id, className, htmlProps, children, typographyType, withMargins, withVisited, external, target, style, color, ...rest }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
2390
|
+
<T extends ElementType = "a">({ id, className, htmlProps, children, typographyType, withMargins, withVisited, external, target, style, color, as: propAs, ...rest }: LinkProps<T>): react_jsx_runtime.JSX.Element;
|
|
2394
2391
|
displayName: string;
|
|
2395
2392
|
};
|
|
2396
2393
|
|
|
@@ -2425,9 +2422,13 @@ type BackLinkProps = {
|
|
|
2425
2422
|
* Ledetekst.
|
|
2426
2423
|
*/
|
|
2427
2424
|
label: string;
|
|
2425
|
+
/**
|
|
2426
|
+
* Custom HTML- eller React-element som returneres. Brukes ved klient-side ruting o.l.
|
|
2427
|
+
*/
|
|
2428
|
+
as?: ElementType;
|
|
2428
2429
|
} & Pick<ComponentPropsWithRef<'a'>, 'onClick' | 'href' | 'ref'>;
|
|
2429
2430
|
declare const BackLink: {
|
|
2430
|
-
({ label, ref, ...rest }: BackLinkProps): react_jsx_runtime.JSX.Element;
|
|
2431
|
+
({ label, ref, as, ...rest }: BackLinkProps): react_jsx_runtime.JSX.Element;
|
|
2431
2432
|
displayName: string;
|
|
2432
2433
|
};
|
|
2433
2434
|
|
|
@@ -3069,8 +3070,6 @@ type FileUploaderHookProps = {
|
|
|
3069
3070
|
type FileUploaderProps = {
|
|
3070
3071
|
/**Id til filopplasteren. */
|
|
3071
3072
|
id?: string;
|
|
3072
|
-
/**Ledetekst for filopplaster. */
|
|
3073
|
-
label?: string;
|
|
3074
3073
|
/**Ledetekst for slippsonen. Denne teksten skal, av UU-hensyn, henge sammen med den usynlige teksten: "velg fil med påfølgende knapp"
|
|
3075
3074
|
* @default Dra og slipp filer her eller
|
|
3076
3075
|
*/
|
|
@@ -3089,7 +3088,7 @@ type FileUploaderProps = {
|
|
|
3089
3088
|
withDragAndDrop?: boolean;
|
|
3090
3089
|
/**Om listen med opplastede filer skal skjules. Brukes kun hvis listen blir vist på egen måte. */
|
|
3091
3090
|
hideFileList?: boolean;
|
|
3092
|
-
} & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip'>;
|
|
3091
|
+
} & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip' | 'label' | 'afterLabelContent'>;
|
|
3093
3092
|
declare const FileUploader: {
|
|
3094
3093
|
(props: FileUploaderProps): react_jsx_runtime.JSX.Element;
|
|
3095
3094
|
displayName: string;
|
|
@@ -3160,8 +3159,13 @@ declare const GlobalMessage: {
|
|
|
3160
3159
|
displayName: string;
|
|
3161
3160
|
};
|
|
3162
3161
|
|
|
3163
|
-
type InlineButtonProps =
|
|
3164
|
-
|
|
3162
|
+
type InlineButtonProps = {
|
|
3163
|
+
/**
|
|
3164
|
+
* Enestående ikon; bruk av denne propen sørge for riktig visning av ikonet.
|
|
3165
|
+
*/
|
|
3166
|
+
icon?: SvgIcon;
|
|
3167
|
+
} & Pick<BaseTypographyProps, 'color'> & Omit<ComponentPropsWithRef<'button'>, 'color'>;
|
|
3168
|
+
declare const InlineButton: ({ className, color, icon, children, ...rest }: InlineButtonProps) => react_jsx_runtime.JSX.Element;
|
|
3165
3169
|
|
|
3166
3170
|
interface InlineEditContextType {
|
|
3167
3171
|
onChange: (e: ChangeEvent<EditElement>) => void;
|
|
@@ -3535,9 +3539,9 @@ type PhoneInputProps = {
|
|
|
3535
3539
|
* @default "Landskode og telefonnummer"
|
|
3536
3540
|
*/
|
|
3537
3541
|
groupLabel?: string;
|
|
3538
|
-
} & Pick<InputProps, 'readOnly' | 'disabled' | 'width' | 'componentSize' | 'errorMessage' | 'label' | 'tip' | 'required' | 'className' | 'style' | 'aria-required' | 'aria-describedby' | 'ref'>;
|
|
3542
|
+
} & Pick<InputProps, 'readOnly' | 'disabled' | 'width' | 'componentSize' | 'errorMessage' | 'label' | 'afterLabelContent' | 'tip' | 'required' | 'className' | 'style' | 'aria-required' | 'aria-describedby' | 'ref'>;
|
|
3539
3543
|
declare const PhoneInput: {
|
|
3540
|
-
({ label, readOnly, errorMessage, tip, required, width, componentSize, name, className, style, value, selectLabel, selectRef, onChange, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, groupLabel, ref, ...props }: PhoneInputProps): react_jsx_runtime.JSX.Element;
|
|
3544
|
+
({ label, readOnly, errorMessage, tip, required, width, componentSize, name, className, style, value, selectLabel, selectRef, onChange, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, groupLabel, afterLabelContent, ref, ...props }: PhoneInputProps): react_jsx_runtime.JSX.Element;
|
|
3541
3545
|
displayName: string;
|
|
3542
3546
|
};
|
|
3543
3547
|
|
|
@@ -3758,8 +3762,6 @@ interface SelectOption<TValue = unknown> {
|
|
|
3758
3762
|
}
|
|
3759
3763
|
type WrappedReactSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = WithRequiredIf<Option extends SelectOption ? false : true, Props<Option, IsMulti, Group>, 'getOptionLabel' | 'getOptionValue'>;
|
|
3760
3764
|
type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
3761
|
-
/**Ledetekst for nedtrekkslisten. */
|
|
3762
|
-
label?: string;
|
|
3763
3765
|
/**Størrelsen på komponenten.
|
|
3764
3766
|
* @default "medium"
|
|
3765
3767
|
*/
|
|
@@ -3768,10 +3770,6 @@ type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
|
3768
3770
|
icon?: SvgIcon;
|
|
3769
3771
|
/**Nedtrekkslisten blir `readonly` og får readOnly styling. */
|
|
3770
3772
|
readOnly?: boolean;
|
|
3771
|
-
/**Meldingen som vises ved valideringsfeil. */
|
|
3772
|
-
errorMessage?: string;
|
|
3773
|
-
/**Hjelpetekst. */
|
|
3774
|
-
tip?: string;
|
|
3775
3773
|
/** CSS klassenavn. */
|
|
3776
3774
|
className?: string;
|
|
3777
3775
|
/** Inline styling. */
|
|
@@ -3784,9 +3782,9 @@ type SelectProps<Option = unknown, IsMulti extends boolean = false> = {
|
|
|
3784
3782
|
'data-testid'?: string;
|
|
3785
3783
|
/**Ref til komponenten. */
|
|
3786
3784
|
ref?: SelectForwardRefType<Option, IsMulti>;
|
|
3787
|
-
} & Pick<HTMLAttributes<HTMLInputElement>, 'aria-required'> &
|
|
3785
|
+
} & CommonInputProps & Pick<HTMLAttributes<HTMLInputElement>, 'aria-required'> & WrappedReactSelectProps<Option, IsMulti, GroupBase<Option>>;
|
|
3788
3786
|
type SelectForwardRefType<Option, IsMulti extends boolean> = Ref<SelectInstance<Option, IsMulti, GroupBase<Option>>>;
|
|
3789
|
-
declare function Select<Option = unknown, IsMulti extends boolean = false>({ id, label, componentSize, errorMessage, tip, 'aria-required': ariaRequired, readOnly, options, isMulti, value, icon, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, menuPortalTarget, customOptionElement, customSingleValueElement, 'data-testid': dataTestId, onKeyDown, openMenuOnClick, ref, instanceId, ...rest }: SelectProps<Option, IsMulti>): react_jsx_runtime.JSX.Element;
|
|
3787
|
+
declare function Select<Option = unknown, IsMulti extends boolean = false>({ id, label, componentSize, errorMessage, tip, 'aria-required': ariaRequired, readOnly, options, isMulti, value, icon, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, menuPortalTarget, customOptionElement, customSingleValueElement, 'data-testid': dataTestId, onKeyDown, openMenuOnClick, ref, instanceId, afterLabelContent, ...rest }: SelectProps<Option, IsMulti>): react_jsx_runtime.JSX.Element;
|
|
3790
3788
|
declare namespace Select {
|
|
3791
3789
|
var displayName: string;
|
|
3792
3790
|
}
|
|
@@ -3797,7 +3795,7 @@ type NativeSelectProps = {
|
|
|
3797
3795
|
/** Implementerer `readOnly` oppførsel etter standard for `<input>` og setter `readOnly` styling. */
|
|
3798
3796
|
readOnly?: InputProps['readOnly'];
|
|
3799
3797
|
} & CommonInputProps & Pick<InputProps, 'componentSize'> & ComponentPropsWithRef<'select'>;
|
|
3800
|
-
declare const NativeSelect: ({ ref, id, children, componentSize, label, multiple, readOnly, errorMessage, tip, required, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, width, className, style, onKeyDown, onMouseDown, clearable, onChange, ...rest }: NativeSelectProps) => react_jsx_runtime.JSX.Element;
|
|
3798
|
+
declare const NativeSelect: ({ ref, id, children, componentSize, label, multiple, readOnly, errorMessage, tip, required, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, width, className, style, onKeyDown, onMouseDown, clearable, afterLabelContent, onChange, ...rest }: NativeSelectProps) => react_jsx_runtime.JSX.Element;
|
|
3801
3799
|
type NativeSelectPlaceholderProps = ComponentPropsWithRef<'option'>;
|
|
3802
3800
|
declare const NativeSelectPlaceholder: {
|
|
3803
3801
|
({ children, value, ...rest }: NativeSelectPlaceholderProps): react_jsx_runtime.JSX.Element;
|
|
@@ -4183,7 +4181,7 @@ interface TextAffixProps {
|
|
|
4183
4181
|
}
|
|
4184
4182
|
|
|
4185
4183
|
declare const TextInput: {
|
|
4186
|
-
({ label, disabled, readOnly, errorMessage, tip, required, maxLength, onChange, id, width, componentSize, type, withCharacterCounter, className, style, value, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, icon, prefix, suffix, ref, ...rest }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
4184
|
+
({ label, afterLabelContent, disabled, readOnly, errorMessage, tip, required, maxLength, onChange, id, width, componentSize, type, withCharacterCounter, className, style, value, defaultValue, "aria-required": ariaRequired, "aria-describedby": ariaDescribedby, icon, prefix, suffix, ref, ...rest }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
4187
4185
|
displayName: string;
|
|
4188
4186
|
};
|
|
4189
4187
|
|
|
@@ -4212,7 +4210,7 @@ type ToggleProps = BaseComponentProps<HTMLElement, {
|
|
|
4212
4210
|
*/
|
|
4213
4211
|
readOnly?: boolean;
|
|
4214
4212
|
/**
|
|
4215
|
-
* Indikerer at verdien prosesseres; viser loading-tilstand og setter `
|
|
4213
|
+
* Indikerer at verdien prosesseres; viser loading-tilstand og setter `disabled`.
|
|
4216
4214
|
*/
|
|
4217
4215
|
isLoading?: boolean;
|
|
4218
4216
|
/**
|