@norges-domstoler/dds-components 0.0.25 → 0.0.28
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/components/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/components/Checkbox/CheckboxGroupContext.d.ts +9 -0
- package/dist/components/InternalHeader/ContextMenuItem.d.ts +17 -0
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +0 -10
- package/dist/components/InternalHeader/InternalHeaderListItem.d.ts +3 -0
- package/dist/components/InternalHeader/NavigationItem.d.ts +14 -0
- package/dist/components/RadioButton/RadioButtonGroupContext.d.ts +1 -0
- package/dist/components/TextInput/CharCounter.d.ts +3 -2
- package/dist/components/TextInput/TextInput.styles.d.ts +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts +18 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.tokens.d.ts +21 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -2
- package/dist/components/Typography/Typography.tokens.d.ts +6 -0
- package/dist/components/Typography/Typography.types.d.ts +2 -1
- package/dist/helpers/IconWrapper/IconWrapper.d.ts +3 -5
- package/dist/helpers/Input/Input.styles.d.ts +4 -2
- package/dist/helpers/Input/Input.types.d.ts +3 -1
- package/dist/helpers/InputMessage/InputMessage.d.ts +6 -6
- package/dist/helpers/styling/index.d.ts +1 -0
- package/dist/helpers/styling/removeButtonStyling.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useReactPopper.d.ts +1 -1
- package/dist/hooks/useRoveFocus.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4538 -3651
- package/dist/index.js +4538 -3650
- package/dist/utils/combineHandlers.d.ts +1 -0
- package/dist/utils/idGenerator.d.ts +3 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +4 -3
|
@@ -5,10 +5,11 @@ export declare type CheckboxGroupProps = {
|
|
|
5
5
|
direction?: Direction;
|
|
6
6
|
groupId?: string;
|
|
7
7
|
errorMessage?: string;
|
|
8
|
+
tip?: string;
|
|
8
9
|
required?: boolean;
|
|
9
10
|
className?: string;
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
style?: React.CSSProperties;
|
|
12
13
|
} & HTMLAttributes<HTMLDivElement>;
|
|
13
|
-
export declare const CheckboxGroup: ({ label, direction, errorMessage, required, groupId, children, className, style, ...rest }: CheckboxGroupProps) => JSX.Element;
|
|
14
|
+
export declare const CheckboxGroup: ({ label, direction, errorMessage, tip, required, groupId, children, className, style, ...rest }: CheckboxGroupProps) => JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CheckboxGroup {
|
|
3
|
+
error?: boolean;
|
|
4
|
+
errorMessageId?: string;
|
|
5
|
+
uniqueGroupId?: string;
|
|
6
|
+
tipId?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CheckboxGroupContext: React.Context<Nullable<CheckboxGroup>>;
|
|
9
|
+
export declare const useCheckboxGroup: () => Nullable<CheckboxGroup>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { OverridableComponent } from '@material-ui/core/OverridableComponent';
|
|
3
|
+
import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
|
|
4
|
+
import { IconWrapper } from '../../helpers/IconWrapper';
|
|
5
|
+
export declare const Element: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
6
|
+
export declare const Link: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
7
|
+
export declare const StyledIconWrapper: import("styled-components").StyledComponent<typeof IconWrapper, any, {}, never>;
|
|
8
|
+
export declare type ContextMenuItemProps = {
|
|
9
|
+
title: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
Icon?: OverridableComponent<SvgIconTypeMap<Record<string, unknown>, 'svg'>>;
|
|
12
|
+
focus?: boolean;
|
|
13
|
+
setFocus?: Dispatch<SetStateAction<number>>;
|
|
14
|
+
index?: number;
|
|
15
|
+
isMenuClosed?: boolean;
|
|
16
|
+
} & (AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement> | HTMLAttributes<HTMLSpanElement>);
|
|
17
|
+
export declare const ContextMenuItem: import("react").ForwardRefExoticComponent<ContextMenuItemProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InternalHeaderProps } from './InternalHeader.types';
|
|
2
|
-
import { IconWrapper } from '../../helpers/IconWrapper';
|
|
3
2
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const BannerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
4
|
export declare const BannerLeftWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -8,21 +7,12 @@ export declare const LovisaWrapper: import("styled-components").StyledComponent<
|
|
|
8
7
|
export declare const Navigation: import("styled-components").StyledComponent<"nav", any, {}, never>;
|
|
9
8
|
declare type NavListProps = Pick<InternalHeaderProps, 'smallScreen'>;
|
|
10
9
|
export declare const NavigationList: import("styled-components").StyledComponent<"ul", any, NavListProps, never>;
|
|
11
|
-
export declare const NavigationListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
12
|
-
declare type StyledNavigationListProps = {
|
|
13
|
-
isCurrent?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare const NavigationLink: import("styled-components").StyledComponent<"a", any, StyledNavigationListProps, never>;
|
|
16
10
|
declare type ContextMenuWrapperProps = {
|
|
17
11
|
closed?: boolean;
|
|
18
12
|
};
|
|
19
13
|
export declare const ContextMenuWrapper: import("styled-components").StyledComponent<"div", any, ContextMenuWrapperProps, never>;
|
|
20
14
|
export declare const ContextMenuList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
21
|
-
export declare const ContextMenuListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
22
|
-
export declare const ContextMenuElement: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
|
-
export declare const ContextMenuLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
24
15
|
export declare const StyledDivider: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
25
16
|
color?: import("../Divider").DividerColor | undefined;
|
|
26
17
|
} & import("react").HTMLAttributes<HTMLHRElement> & import("react").RefAttributes<HTMLHRElement>>, any, {}, never>;
|
|
27
|
-
export declare const StyledIconWrapper: import("styled-components").StyledComponent<typeof IconWrapper, any, {}, never>;
|
|
28
18
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export declare type InternalHeaderListItemProps = HTMLAttributes<HTMLLIElement>;
|
|
3
|
+
export declare const InternalHeaderListItem: import("react").ForwardRefExoticComponent<InternalHeaderListItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
declare type LinkProps = {
|
|
3
|
+
isCurrent?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const Link: import("styled-components").StyledComponent<"a", any, LinkProps, never>;
|
|
6
|
+
export declare type NavigationItemProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
isCurrent?: boolean;
|
|
9
|
+
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
10
|
+
export declare const NavigationItem: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
title: string;
|
|
12
|
+
isCurrent?: boolean | undefined;
|
|
13
|
+
} & AnchorHTMLAttributes<HTMLAnchorElement> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
14
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
1
2
|
declare type Props = {
|
|
2
3
|
current: number;
|
|
3
4
|
max: number;
|
|
4
|
-
}
|
|
5
|
-
declare function CharCounter({ current, max }: Props): JSX.Element;
|
|
5
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
declare function CharCounter({ current, max, id, ...rest }: Props): JSX.Element;
|
|
6
7
|
export default CharCounter;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TextInputProps } from './TextInput.types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, Pick<import("../../helpers/Input").InputProps, "label" | "readOnly" | "disabled"> & {
|
|
3
|
+
hasErrorMessage: boolean;
|
|
4
|
+
}, never>;
|
|
4
5
|
export declare const MessageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
6
|
declare type LabelProps = Pick<TextInputProps, 'multiline' | 'disabled' | 'readOnly'>;
|
|
6
7
|
export declare const Label: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, import("../../helpers/Input").StyledLabelProps & LabelProps, never>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { Placement } from '../../hooks';
|
|
3
|
+
declare type AnchorElement = React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
4
|
+
export declare type TooltipProps = {
|
|
5
|
+
text: string;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
children: AnchorElement;
|
|
8
|
+
delay?: number;
|
|
9
|
+
tooltipId?: string;
|
|
10
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<{
|
|
12
|
+
text: string;
|
|
13
|
+
placement?: Placement | undefined;
|
|
14
|
+
children: AnchorElement;
|
|
15
|
+
delay?: number | undefined;
|
|
16
|
+
tooltipId?: string | undefined;
|
|
17
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SvgArrow: import("styled-components").StyledComponent<"svg", any, {}, never>;
|
|
2
|
+
export declare const ArrowWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
declare type WrapperProps = {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const TooltipWrapper: import("styled-components").StyledComponent<"div", any, WrapperProps, never>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
export declare const tooltipTokens: {
|
|
3
|
+
wrapper: {
|
|
4
|
+
base: CSSObject;
|
|
5
|
+
};
|
|
6
|
+
svgArrow: {
|
|
7
|
+
border: {
|
|
8
|
+
fill: string;
|
|
9
|
+
};
|
|
10
|
+
background: {
|
|
11
|
+
fill: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
arrowPlacementTemplate: {
|
|
15
|
+
top: string;
|
|
16
|
+
bottom: string;
|
|
17
|
+
left: string;
|
|
18
|
+
right: string;
|
|
19
|
+
};
|
|
20
|
+
offset: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tooltip';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes, ElementType, AnchorHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
2
2
|
import { CSSObject } from 'styled-components';
|
|
3
|
-
import { TypographyType } from './Typography.types';
|
|
3
|
+
import { TypographyType, TextColor } from './Typography.types';
|
|
4
4
|
export declare function isTextColor(color: string): color is TextColor;
|
|
5
5
|
export declare const getTextColor: (color: TextColor | string) => string;
|
|
6
|
-
export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
|
|
7
6
|
export declare type TypographyInteractionProps = {
|
|
8
7
|
hover?: CSSObject;
|
|
9
8
|
active?: CSSObject;
|
|
@@ -3,5 +3,6 @@ export declare type TypographyBodySerifType = 'bodySerif01' | 'bodySerif02' | 'b
|
|
|
3
3
|
export declare type TypographyBodyType = TypographyBodySansType | TypographyBodySerifType;
|
|
4
4
|
export declare type TypographyHeadingType = 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08';
|
|
5
5
|
export declare type TypographyLeadType = 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05';
|
|
6
|
-
export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01';
|
|
6
|
+
export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01' | 'supportingStyleTiny02';
|
|
7
7
|
export declare type TypographyType = 'a' | TypographyHeadingType | TypographyBodyType | TypographyLeadType | TypographySupportingType;
|
|
8
|
+
export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
|
|
2
2
|
import { OverridableComponent } from '@material-ui/core/OverridableComponent';
|
|
3
|
-
import {
|
|
3
|
+
import { HTMLAttributes } from 'react';
|
|
4
4
|
import * as CSS from 'csstype';
|
|
5
5
|
export declare type IconSize = 'small' | 'medium' | 'large' | 'inline';
|
|
6
6
|
export declare type IconWrapperProps = {
|
|
7
7
|
Icon: OverridableComponent<SvgIconTypeMap<Record<string, unknown>, 'svg'>>;
|
|
8
8
|
iconSize?: IconSize;
|
|
9
9
|
color?: CSS.ColorProperty;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export declare function IconWrapper({ Icon, iconSize, color, className, style }: IconWrapperProps): JSX.Element;
|
|
10
|
+
} & HTMLAttributes<SVGElement>;
|
|
11
|
+
export declare function IconWrapper({ Icon, iconSize, color, className, style, ...rest }: IconWrapperProps): JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InputProps, StyledInputProps, StyledLabelProps } from './Input.types';
|
|
2
|
-
export declare const inputStyling: ({ readOnly,
|
|
3
|
-
export declare const Input: import("styled-components").StyledComponent<"input", any,
|
|
2
|
+
export declare const inputStyling: ({ readOnly, label, disabled, hasErrorMessage }: StyledInputProps) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
|
3
|
+
export declare const Input: import("styled-components").StyledComponent<"input", any, Pick<InputProps, "readOnly" | "label" | "disabled"> & {
|
|
4
|
+
hasErrorMessage: boolean;
|
|
5
|
+
}, never>;
|
|
4
6
|
export declare const SingleLineLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../components/Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, StyledLabelProps, never>;
|
|
5
7
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
8
|
declare type OuterInputContainerProps = Pick<InputProps, 'width'>;
|
|
@@ -6,5 +6,7 @@ export declare type InputProps = {
|
|
|
6
6
|
tip?: string;
|
|
7
7
|
errorMessage?: string;
|
|
8
8
|
} & InputHTMLAttributes<HTMLInputElement>;
|
|
9
|
-
export declare type StyledInputProps = Pick<InputProps, 'readOnly' | '
|
|
9
|
+
export declare type StyledInputProps = Pick<InputProps, 'readOnly' | 'label' | 'disabled'> & {
|
|
10
|
+
hasErrorMessage: boolean;
|
|
11
|
+
};
|
|
10
12
|
export declare type StyledLabelProps = Pick<InputProps, 'disabled'>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
2
|
declare type MessageType = 'error' | 'tip';
|
|
3
|
-
declare
|
|
3
|
+
export declare const InputMessage: import("react").ForwardRefExoticComponent<{
|
|
4
4
|
message: string;
|
|
5
5
|
messageType: MessageType;
|
|
6
|
-
maxWidth?:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
6
|
+
maxWidth?: string | undefined;
|
|
7
|
+
messageId?: string | undefined;
|
|
8
|
+
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './removeButtonStyling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeButtonStyling: import("styled-components").FlattenSimpleInterpolation;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
export declare type Placement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
3
|
-
export declare const useReactPopper: (referenceElement: HTMLElement, popperElement: HTMLElement, arrowRef?: string | HTMLElement | undefined, placement?: Placement, offset?: number) => {
|
|
3
|
+
export declare const useReactPopper: (referenceElement: HTMLElement, popperElement: HTMLElement, arrowRef?: string | HTMLElement | undefined, placement?: Placement, offset?: number, offsetAlong?: number) => {
|
|
4
4
|
styles: {
|
|
5
5
|
[key: string]: CSSProperties;
|
|
6
6
|
};
|
package/dist/index.d.ts
CHANGED