@norges-domstoler/dds-components 5.2.0-beta.0 → 5.2.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/assets/svg/calendar_today.svg.js +1 -1
- package/dist/cjs/components/DescriptionList/DescriptionList.tokens.d.ts +70 -0
- package/dist/cjs/components/Drawer/DrawerGroup.d.ts +1 -1
- package/dist/cjs/components/Modal/Modal.tokens.d.ts +0 -6
- package/dist/cjs/components/Modal/ModalBody.d.ts +6 -1
- package/dist/cjs/components/OverflowMenu/OverflowMenuGroup.d.ts +1 -1
- package/dist/cjs/components/Popover/PopoverGroup.d.ts +1 -1
- package/dist/cjs/components/RadioButton/RadioButton.d.ts +2 -0
- package/dist/cjs/components/RadioButton/RadioButton.stories.d.ts +2 -0
- package/dist/cjs/components/RadioButton/RadioButton.types.d.ts +2 -2
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.d.ts +7 -0
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.stories.d.ts +15 -0
- package/dist/cjs/components/ScrollableContainer/ScrollableContainer.tokens.d.ts +25 -0
- package/dist/cjs/components/ScrollableContainer/Scrollbar.d.ts +7 -0
- package/dist/cjs/components/ScrollableContainer/index.d.ts +3 -0
- package/dist/cjs/components/ScrollableContainer/scrollbarStyling.d.ts +26 -0
- package/dist/cjs/helpers/Chevron/AnimatedChevronUpDown.d.ts +1 -1
- package/dist/cjs/helpers/styling/index.d.ts +0 -1
- package/dist/cjs/hooks/useRoveFocus.d.ts +2 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +897 -614
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/DescriptionList/DescriptionList.js +6 -3
- package/dist/components/DescriptionList/DescriptionList.tokens.d.ts +70 -0
- package/dist/components/DescriptionList/DescriptionList.tokens.js +60 -0
- package/dist/components/DescriptionList/DescriptionListDesc.js +2 -2
- package/dist/components/DescriptionList/DescriptionListGroup.js +4 -4
- package/dist/components/Drawer/Drawer.js +12 -10
- package/dist/components/Drawer/DrawerGroup.d.ts +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/Modal/Modal.tokens.d.ts +0 -6
- package/dist/components/Modal/Modal.tokens.js +0 -10
- package/dist/components/Modal/ModalBody.d.ts +6 -1
- package/dist/components/Modal/ModalBody.js +13 -13
- package/dist/components/OverflowMenu/OverflowMenu.js +3 -3
- package/dist/components/OverflowMenu/OverflowMenuGroup.d.ts +1 -1
- package/dist/components/Popover/PopoverGroup.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.types.d.ts +2 -2
- package/dist/components/ScrollableContainer/ScrollableContainer.d.ts +7 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.js +47 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.stories.d.ts +15 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.tokens.d.ts +25 -0
- package/dist/components/ScrollableContainer/ScrollableContainer.tokens.js +36 -0
- package/dist/components/ScrollableContainer/Scrollbar.d.ts +7 -0
- package/dist/components/ScrollableContainer/Scrollbar.js +178 -0
- package/dist/components/ScrollableContainer/index.d.ts +3 -0
- package/dist/components/ScrollableContainer/scrollbarStyling.d.ts +26 -0
- package/dist/components/ScrollableContainer/scrollbarStyling.js +40 -0
- package/dist/components/Select/Select.styles.js +3 -3
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Table/TableWrapper.js +3 -3
- package/dist/components/Tabs/TabList.js +2 -2
- package/dist/components/TextInput/TextInput.styles.js +2 -2
- package/dist/components/TextInput/TextInput.tokens.js +1 -1
- package/dist/helpers/Chevron/AnimatedChevronUpDown.d.ts +1 -1
- package/dist/helpers/styling/focusVisible.js +3 -2
- package/dist/helpers/styling/index.d.ts +0 -1
- package/dist/hooks/useRoveFocus.d.ts +2 -1
- package/dist/hooks/useRoveFocus.js +9 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +48 -43
- package/dist/cjs/components/DescriptionList/DescriptionListDesc.tokens.d.ts +0 -7
- package/dist/cjs/components/DescriptionList/DescriptionListGroup.tokens.d.ts +0 -4
- package/dist/cjs/components/DescriptionList/DescriptionListTerm.tokens.d.ts +0 -13
- package/dist/cjs/helpers/styling/scrollbarStyling.d.ts +0 -3
- package/dist/components/DescriptionList/DescriptionListDesc.tokens.d.ts +0 -7
- package/dist/components/DescriptionList/DescriptionListDesc.tokens.js +0 -22
- package/dist/components/DescriptionList/DescriptionListGroup.tokens.d.ts +0 -4
- package/dist/components/DescriptionList/DescriptionListGroup.tokens.js +0 -11
- package/dist/components/DescriptionList/DescriptionListTerm.tokens.d.ts +0 -13
- package/dist/components/DescriptionList/DescriptionListTerm.tokens.js +0 -27
- package/dist/helpers/styling/scrollbarStyling.d.ts +0 -3
- package/dist/helpers/styling/scrollbarStyling.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px'
|
|
1
|
+
var img = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px'%3e%3cpath d='M0 0h24v24H0V0z' fill='none'/%3e%3cpath d='M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V10h16v11zm0-13H4V5h16v3z' fill='%233a4146' /%3e%3c/svg%3e";
|
|
2
2
|
var CalendarIcon = img;
|
|
3
3
|
|
|
4
4
|
export { CalendarIcon as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const descriptionListTokens: {
|
|
2
|
+
term: {
|
|
3
|
+
appearance: {
|
|
4
|
+
small: {
|
|
5
|
+
font: {
|
|
6
|
+
lineHeight: any;
|
|
7
|
+
fontSize: string;
|
|
8
|
+
letterSpacing: any;
|
|
9
|
+
fontFamily: any;
|
|
10
|
+
fontWeight: any;
|
|
11
|
+
fontStyle: any;
|
|
12
|
+
};
|
|
13
|
+
color: string;
|
|
14
|
+
lineHeight: any;
|
|
15
|
+
fontSize: string;
|
|
16
|
+
letterSpacing: any;
|
|
17
|
+
fontFamily: any;
|
|
18
|
+
fontWeight: any;
|
|
19
|
+
fontStyle: any;
|
|
20
|
+
};
|
|
21
|
+
bold: {
|
|
22
|
+
font: {
|
|
23
|
+
lineHeight: any;
|
|
24
|
+
fontSize: string;
|
|
25
|
+
letterSpacing: any;
|
|
26
|
+
fontFamily: any;
|
|
27
|
+
fontWeight: any;
|
|
28
|
+
fontStyle: any;
|
|
29
|
+
};
|
|
30
|
+
lineHeight: any;
|
|
31
|
+
fontSize: string;
|
|
32
|
+
letterSpacing: any;
|
|
33
|
+
fontFamily: any;
|
|
34
|
+
fontWeight: number;
|
|
35
|
+
fontStyle: any;
|
|
36
|
+
color: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
firstOfType: {
|
|
40
|
+
marginTop: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
desc: {
|
|
44
|
+
base: {
|
|
45
|
+
font: {
|
|
46
|
+
lineHeight: any;
|
|
47
|
+
fontSize: string;
|
|
48
|
+
letterSpacing: any;
|
|
49
|
+
fontFamily: any;
|
|
50
|
+
fontWeight: any;
|
|
51
|
+
fontStyle: any;
|
|
52
|
+
};
|
|
53
|
+
gap: string;
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
lastChild: {
|
|
57
|
+
marginBottom: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
list: {
|
|
61
|
+
beforeNextTerm: {
|
|
62
|
+
marginTop: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
group: {
|
|
66
|
+
base: {
|
|
67
|
+
margin: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -9,5 +9,5 @@ declare type DrawerGroupProps = {
|
|
|
9
9
|
/**Ekstra logikk som kjøres når `<Drawer />` lukkes. */
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
};
|
|
12
|
-
export declare const DrawerGroup: ({ children, drawerId, onOpen, onClose }: DrawerGroupProps) => JSX.Element;
|
|
12
|
+
export declare const DrawerGroup: ({ children, drawerId, onOpen, onClose, }: DrawerGroupProps) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { BaseComponentPropsWithChildren } from '../../types';
|
|
2
|
+
import { Property } from 'csstype';
|
|
2
3
|
export declare type ModalBodyProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
3
4
|
/**Gjør at innholdet kan scrolles. Det må eventuelt settes (max)bredde og (max)høyde styling på både denne subkomponenten og `<Modal />`. */
|
|
4
5
|
scrollable?: boolean;
|
|
6
|
+
/**Høyde på container. */
|
|
7
|
+
height?: Property.Height;
|
|
5
8
|
}>;
|
|
6
9
|
export declare const ModalBody: import("react").ForwardRefExoticComponent<{
|
|
7
10
|
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
|
|
8
|
-
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "
|
|
11
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
|
|
9
12
|
/**Gjør at innholdet kan scrolles. Det må eventuelt settes (max)bredde og (max)høyde styling på både denne subkomponenten og `<Modal />`. */
|
|
10
13
|
scrollable?: boolean | undefined;
|
|
14
|
+
/**Høyde på container. */
|
|
15
|
+
height?: Property.Height<0 | (string & {})> | undefined;
|
|
11
16
|
} & {
|
|
12
17
|
children?: import("react").ReactNode;
|
|
13
18
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -11,4 +11,4 @@ export declare type OverflowMenuGroupProps = {
|
|
|
11
11
|
/**Custom id for `<OverflowMenu />`. */
|
|
12
12
|
overflowMenuId?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const OverflowMenuGroup: ({ children, onClose, onToggle, onOpen, overflowMenuId }: OverflowMenuGroupProps) => JSX.Element;
|
|
14
|
+
export declare const OverflowMenuGroup: ({ children, onClose, onToggle, onOpen, overflowMenuId, }: OverflowMenuGroupProps) => JSX.Element;
|
|
@@ -11,4 +11,4 @@ export declare type PopoverGroupProps = {
|
|
|
11
11
|
/** Barna til wrapperen: anchor-element som det første og `<Popover />` so det adnre. */
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare const PopoverGroup: ({ isOpen, onCloseButtonClick, onTriggerClick, children, popoverId }: PopoverGroupProps) => JSX.Element;
|
|
14
|
+
export declare const PopoverGroup: ({ isOpen, onCloseButtonClick, onTriggerClick, children, popoverId, }: PopoverGroupProps) => JSX.Element;
|
|
@@ -12,4 +12,6 @@ export declare const RadioButton: import("react").ForwardRefExoticComponent<{
|
|
|
12
12
|
required?: boolean | undefined;
|
|
13
13
|
onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
|
|
14
14
|
'aria-describedby'?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
children?: import("react").ReactNode;
|
|
15
17
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -15,6 +15,8 @@ declare const _default: {
|
|
|
15
15
|
checked?: boolean | undefined;
|
|
16
16
|
readOnly?: boolean | undefined;
|
|
17
17
|
required?: boolean | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
children?: import("react").ReactNode;
|
|
18
20
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
19
21
|
argTypes: {
|
|
20
22
|
label: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseComponentPropsWithChildren } from '../../types';
|
|
3
3
|
declare type PickedInputHTMLAttributes = Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'readOnly' | 'checked' | 'value' | 'required' | 'onChange' | 'aria-describedby'>;
|
|
4
|
-
export declare type RadioButtonProps =
|
|
4
|
+
export declare type RadioButtonProps = BaseComponentPropsWithChildren<HTMLInputElement, {
|
|
5
5
|
/**Ledetekst for alternativet. */
|
|
6
6
|
label?: string;
|
|
7
7
|
/**Spesifiserer om input er disabled. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponentPropsWithChildren } from '../../types';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
export declare type ScrollableContainerProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
4
|
+
/**Høyde på innholdscontainer. */
|
|
5
|
+
contentHeight?: Property.Height;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const ScrollableContainer: (props: ScrollableContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ScrollableContainerProps } from '.';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: ScrollableContainerProps) => JSX.Element;
|
|
5
|
+
argTypes: {
|
|
6
|
+
contentHeight: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare const Default: (args: ScrollableContainerProps) => JSX.Element;
|
|
15
|
+
export declare const JustScrollbar: () => JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const scrollbarWidthNumberPx = 10;
|
|
2
|
+
export declare const scrollbarTokens: {
|
|
3
|
+
minThumbHeightPx: number;
|
|
4
|
+
track: {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
borderRadius: string;
|
|
7
|
+
width: string;
|
|
8
|
+
};
|
|
9
|
+
thumb: {
|
|
10
|
+
base: {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
borderRadius: string;
|
|
13
|
+
width: string;
|
|
14
|
+
};
|
|
15
|
+
hover: {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
content: {
|
|
20
|
+
paddingRight: string;
|
|
21
|
+
};
|
|
22
|
+
outerContainer: {
|
|
23
|
+
padding: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { BaseComponentProps } from '../../types';
|
|
3
|
+
export declare type ScrollbarProps = BaseComponentProps<HTMLDivElement, {
|
|
4
|
+
/** Ref til container med innholdet som skal scrolles. */
|
|
5
|
+
contentRef?: RefObject<HTMLDivElement>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const Scrollbar: (props: ScrollbarProps) => JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS-in-JS scrollbar styling til bruk der det ikke passer å bruke dedikerte komponenter. Inkluderer styling for webkit pseudo-elementer og for Firefox.
|
|
3
|
+
*/
|
|
4
|
+
export declare const scrollbarStyling: {
|
|
5
|
+
webkit: {
|
|
6
|
+
'&::-webkit-scrollbar': {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
9
|
+
};
|
|
10
|
+
'&::-webkit-scrollbar-track': {
|
|
11
|
+
background: string;
|
|
12
|
+
borderRadius: string;
|
|
13
|
+
};
|
|
14
|
+
'&::-webkit-scrollbar-thumb': {
|
|
15
|
+
background: string;
|
|
16
|
+
borderRadius: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
20
|
+
background: string;
|
|
21
|
+
};
|
|
22
|
+
firefox: {
|
|
23
|
+
scrollbarColor: string;
|
|
24
|
+
scrollbarWidth: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -4,5 +4,5 @@ declare type SvgChevronProps = {
|
|
|
4
4
|
height?: Property.Height<string>;
|
|
5
5
|
width?: Property.Width<string>;
|
|
6
6
|
};
|
|
7
|
-
export declare const AnimatedChevronUpDown: ({ isUp, height, width }: SvgChevronProps) => JSX.Element;
|
|
7
|
+
export declare const AnimatedChevronUpDown: ({ isUp, height, width, }: SvgChevronProps) => JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import { Dispatch, SetStateAction, KeyboardEvent } from 'react';
|
|
2
2
|
import { Direction } from '../types';
|
|
3
|
+
export declare const isKeyboardEvent: (e: Event | KeyboardEvent<Element>) => e is KeyboardEvent<Element>;
|
|
3
4
|
export declare function useRoveFocus(size: number | undefined, reset?: boolean, direction?: Direction): [number, Dispatch<SetStateAction<number>>];
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -33,5 +33,6 @@ export * from './components/Tabs';
|
|
|
33
33
|
export * from './components/Tag';
|
|
34
34
|
export * from './components/Chip';
|
|
35
35
|
export * from './components/VisuallyHidden';
|
|
36
|
+
export * from './components/ScrollableContainer';
|
|
36
37
|
export * from './icons/tsx';
|
|
37
38
|
export * from './components/Stepper';
|