@norges-domstoler/dds-components 0.0.28 → 1.0.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/README.md +5 -5
- package/dist/components/Button/Button.styles.d.ts +4 -8
- package/dist/components/Button/Button.tokens.d.ts +12 -0
- package/dist/components/Button/Button.types.d.ts +1 -1
- package/dist/components/Card/CardAccordion/CardAccordionBody.d.ts +3 -0
- package/dist/components/Card/CardAccordion/CardAccordionHeader.d.ts +3 -3
- package/dist/components/Card/CardAccordion/CardAccordionHeader.tokens.d.ts +7 -0
- package/dist/components/Datepicker/Datepicker.tokens.d.ts +9 -0
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +5 -1
- package/dist/components/InternalHeader/InternalHeader.tokens.d.ts +4 -0
- package/dist/components/Modal/Modal.d.ts +15 -0
- package/dist/components/Modal/Modal.tokens.d.ts +19 -0
- package/dist/components/Modal/ModalActions.d.ts +3 -0
- package/dist/components/Modal/ModalBody.d.ts +7 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/helpers/Backdrop/Backdrop.d.ts +5 -0
- package/dist/helpers/Backdrop/Backdrop.utils.d.ts +2 -0
- package/dist/helpers/Backdrop/index.d.ts +2 -0
- package/dist/helpers/Chevron/AnimatedChevronUpDown.d.ts +8 -2
- package/dist/helpers/Chevron/AnimatedChevronUpDown.styles.d.ts +5 -5
- package/dist/helpers/color.d.ts +6 -0
- package/dist/helpers/styling/index.d.ts +1 -0
- package/dist/helpers/styling/visibilityTransition.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useFocusTrap.d.ts +1 -0
- package/dist/hooks/useMountTransition.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1216 -867
- package/dist/index.js +1218 -866
- package/dist/utils/getScrollbarSize.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ React UI komponenter til bruk i Domstolenes tjenester.
|
|
|
6
6
|
|
|
7
7
|
Sjekk ut [Domstolenes designsystem Elsa](https://design.domstol.no/) og [Storybook](https://domstolene.github.io/designsystem) for mer dokumentasjon og demoer.
|
|
8
8
|
|
|
9
|
-
## Installasjon
|
|
9
|
+
## 📦 Installasjon
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm install @norges-domstoler/dds-components
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
## Bruk
|
|
15
|
+
## 🔨 Bruk
|
|
16
16
|
|
|
17
17
|
```js
|
|
18
18
|
import * as React from 'react';
|
|
@@ -30,7 +30,7 @@ const App = () => (
|
|
|
30
30
|
render(<App />, document.getElementById('root'));
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
## Komponenter
|
|
33
|
+
## 📃 Komponenter
|
|
34
34
|
|
|
35
35
|
Sjekk [komponentstatus](https://design.domstol.no/987b33f71/p/438035-komponenter/b/160db9) for oppdatert status.
|
|
36
36
|
|
|
@@ -59,7 +59,7 @@ Tilgjengelige komponenter:
|
|
|
59
59
|
- TextInput
|
|
60
60
|
- Typography
|
|
61
61
|
|
|
62
|
-
## Release av ny versjon
|
|
62
|
+
## ⏫ Release av ny versjon
|
|
63
63
|
|
|
64
64
|
Det brukes en egen workflow for release av ny versjon av `@norges-domstoler/dds-components` som kjører på publisering av ny github release. Her brukes `npm publish` for å publisere en ny versjon av pakken til npm sitt pakkeregister, hvor det nye versjonsnummeret leses fra `package.json`. For å lage en ny release gjøres følgende:
|
|
65
65
|
|
|
@@ -70,6 +70,6 @@ Det brukes en egen workflow for release av ny versjon av `@norges-domstoler/dds-
|
|
|
70
70
|
|
|
71
71
|
For versjonering brukes [_semantisk versjonering_](https://semver.org/) for å holde ting organisert og for å enkelt kommunisere utviklingsløpet til pakken.
|
|
72
72
|
|
|
73
|
-
## For bidragsytere
|
|
73
|
+
## ⌨️ For bidragsytere
|
|
74
74
|
|
|
75
75
|
Sjekk ut [guiden for bidragsytere](https://design.domstol.no/987b33f71/p/34c962-bidra/b/3611d5).
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconWrapper } from '../../helpers/IconWrapper';
|
|
2
1
|
import { ButtonAppearance, ButtonPurpose, ButtonSize, IconPosition } from './Button.types';
|
|
3
2
|
declare type ButtonWrapperProps = {
|
|
4
3
|
appearance: ButtonAppearance;
|
|
@@ -8,16 +7,13 @@ declare type ButtonWrapperProps = {
|
|
|
8
7
|
hasIcon: boolean;
|
|
9
8
|
hasLabel: boolean;
|
|
10
9
|
isLoading: boolean;
|
|
10
|
+
iconPosition?: IconPosition;
|
|
11
11
|
};
|
|
12
12
|
export declare const ButtonWrapper: import("styled-components").StyledComponent<"button", any, ButtonWrapperProps, never>;
|
|
13
|
-
declare type
|
|
14
|
-
iconPosition
|
|
13
|
+
declare type StyledIconWrapperSpanProps = {
|
|
14
|
+
iconPosition?: IconPosition;
|
|
15
15
|
size: ButtonSize;
|
|
16
16
|
};
|
|
17
|
-
export declare const
|
|
18
|
-
declare type JustIconWrapperProps = {
|
|
19
|
-
size: ButtonSize;
|
|
20
|
-
};
|
|
21
|
-
export declare const JustIconWrapper: import("styled-components").StyledComponent<"span", any, JustIconWrapperProps, never>;
|
|
17
|
+
export declare const StyledIconWrapperSpan: import("styled-components").StyledComponent<"span", any, StyledIconWrapperSpanProps, never>;
|
|
22
18
|
export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
23
19
|
export {};
|
|
@@ -42,6 +42,18 @@ export declare const buttonTokens: {
|
|
|
42
42
|
};
|
|
43
43
|
iconWithTextMargin: string;
|
|
44
44
|
};
|
|
45
|
+
tiny: {
|
|
46
|
+
justIcon: {
|
|
47
|
+
base: CSSObject;
|
|
48
|
+
};
|
|
49
|
+
justIconWrapper: {
|
|
50
|
+
base: CSSObject;
|
|
51
|
+
};
|
|
52
|
+
text: {
|
|
53
|
+
base: CSSObject;
|
|
54
|
+
};
|
|
55
|
+
iconWithTextMargin: string;
|
|
56
|
+
};
|
|
45
57
|
};
|
|
46
58
|
appearance: {
|
|
47
59
|
filled: {
|
|
@@ -2,7 +2,7 @@ import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
|
|
|
2
2
|
import { OverridableComponent } from '@material-ui/core/OverridableComponent';
|
|
3
3
|
import React, { ButtonHTMLAttributes } from 'react';
|
|
4
4
|
export declare type ButtonPurpose = 'primary' | 'secondary' | 'danger';
|
|
5
|
-
export declare type ButtonSize = 'small' | 'medium' | 'large';
|
|
5
|
+
export declare type ButtonSize = 'tiny' | 'small' | 'medium' | 'large';
|
|
6
6
|
export declare type ButtonAppearance = 'filled' | 'ghost' | 'rounded' | 'borderless';
|
|
7
7
|
export declare type IconPosition = 'left' | 'right';
|
|
8
8
|
export declare type ButtonProps = {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
+
import * as CSS from 'csstype';
|
|
2
3
|
export declare type CardAccordionBodyProps = {
|
|
3
4
|
isExpanded?: boolean;
|
|
4
5
|
headerId?: string;
|
|
6
|
+
paddingTop?: CSS.PaddingTopProperty<string>;
|
|
5
7
|
} & HTMLAttributes<HTMLDivElement>;
|
|
6
8
|
export declare const CardAccordionBody: import("react").ForwardRefExoticComponent<{
|
|
7
9
|
isExpanded?: boolean | undefined;
|
|
8
10
|
headerId?: string | undefined;
|
|
11
|
+
paddingTop?: string | undefined;
|
|
9
12
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
2
|
export declare type CardAccordionHeaderProps = {
|
|
3
3
|
isExpanded?: boolean;
|
|
4
4
|
toggleExpanded?: () => void;
|
|
5
5
|
bodyId?: string;
|
|
6
|
-
} &
|
|
6
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
7
7
|
export declare const CardAccordionHeader: import("react").ForwardRefExoticComponent<{
|
|
8
8
|
isExpanded?: boolean | undefined;
|
|
9
9
|
toggleExpanded?: (() => void) | undefined;
|
|
10
10
|
bodyId?: string | undefined;
|
|
11
|
-
} &
|
|
11
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { InternalHeaderProps } from './InternalHeader.types';
|
|
2
2
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
|
|
3
|
+
declare type BannerProps = {
|
|
4
|
+
hasContextMenu?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const BannerWrapper: import("styled-components").StyledComponent<"div", any, BannerProps, never>;
|
|
4
7
|
export declare const BannerLeftWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
8
|
export declare const ApplicationNameWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
9
|
export declare const LovisaWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -15,4 +18,5 @@ export declare const ContextMenuList: import("styled-components").StyledComponen
|
|
|
15
18
|
export declare const StyledDivider: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
16
19
|
color?: import("../Divider").DividerColor | undefined;
|
|
17
20
|
} & import("react").HTMLAttributes<HTMLHRElement> & import("react").RefAttributes<HTMLHRElement>>, any, {}, never>;
|
|
21
|
+
export declare const ContextMenuGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
22
|
export {};
|
|
@@ -11,6 +11,7 @@ export declare const internalHeaderTokens: {
|
|
|
11
11
|
};
|
|
12
12
|
banner: {
|
|
13
13
|
base: CSSObject;
|
|
14
|
+
contextMenuSpacing: string;
|
|
14
15
|
};
|
|
15
16
|
bannerLeft: {
|
|
16
17
|
base: CSSObject;
|
|
@@ -55,4 +56,7 @@ export declare const internalHeaderTokens: {
|
|
|
55
56
|
icon: {
|
|
56
57
|
base: CSSObject;
|
|
57
58
|
};
|
|
59
|
+
contextGroup: {
|
|
60
|
+
base: CSSObject;
|
|
61
|
+
};
|
|
58
62
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
export declare type ModalProps = {
|
|
3
|
+
onClose?: () => void;
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
parentElement?: HTMLElement;
|
|
6
|
+
header?: string | ReactNode;
|
|
7
|
+
triggerRef?: RefObject<HTMLElement>;
|
|
8
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
export declare const Modal: import("react").ForwardRefExoticComponent<{
|
|
10
|
+
onClose?: (() => void) | undefined;
|
|
11
|
+
isOpen?: boolean | undefined;
|
|
12
|
+
parentElement?: HTMLElement | undefined;
|
|
13
|
+
header?: string | ReactNode;
|
|
14
|
+
triggerRef?: RefObject<HTMLElement> | undefined;
|
|
15
|
+
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
export declare const modalTokens: {
|
|
3
|
+
base: CSSObject;
|
|
4
|
+
focus: {
|
|
5
|
+
base: CSSObject;
|
|
6
|
+
};
|
|
7
|
+
contentContainer: {
|
|
8
|
+
base: CSSObject;
|
|
9
|
+
};
|
|
10
|
+
actionsContainer: {
|
|
11
|
+
base: CSSObject;
|
|
12
|
+
};
|
|
13
|
+
bodyScrollable: {
|
|
14
|
+
base: CSSObject;
|
|
15
|
+
focus: {
|
|
16
|
+
base: CSSObject;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export declare type ModalBodyProps = {
|
|
3
|
+
scrollable?: boolean;
|
|
4
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
5
|
+
export declare const ModalBody: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
scrollable?: boolean | undefined;
|
|
7
|
+
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
declare type SvgChevronProps = {
|
|
3
|
+
isUp?: boolean;
|
|
4
|
+
height?: CSS.HeightProperty<string>;
|
|
5
|
+
width?: CSS.WidthProperty<string>;
|
|
6
|
+
};
|
|
7
|
+
export declare const AnimatedChevronUpDown: ({ isUp, height, width }: SvgChevronProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare type
|
|
1
|
+
export declare type StyledSvgChevronProps = {
|
|
2
2
|
isUp?: boolean;
|
|
3
3
|
};
|
|
4
|
-
export declare const SvgChevron: import("styled-components").StyledComponent<"svg", any,
|
|
5
|
-
export declare const SvgChevronlGroup: import("styled-components").StyledComponent<"g", any,
|
|
6
|
-
export declare const SvgChevronlLeft: import("styled-components").StyledComponent<"path", any,
|
|
7
|
-
export declare const SvgChevronlRight: import("styled-components").StyledComponent<"path", any,
|
|
4
|
+
export declare const SvgChevron: import("styled-components").StyledComponent<"svg", any, StyledSvgChevronProps, never>;
|
|
5
|
+
export declare const SvgChevronlGroup: import("styled-components").StyledComponent<"g", any, StyledSvgChevronProps, never>;
|
|
6
|
+
export declare const SvgChevronlLeft: import("styled-components").StyledComponent<"path", any, StyledSvgChevronProps, never>;
|
|
7
|
+
export declare const SvgChevronlRight: import("styled-components").StyledComponent<"path", any, StyledSvgChevronProps, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare type ColorAlphaFormat = 'hex8' | 'decimal';
|
|
2
|
+
export declare const convertAlpha: (value: number | string, typeFrom: ColorAlphaFormat, typeTo: ColorAlphaFormat) => string | number | undefined;
|
|
3
|
+
export declare const hexToRGBA: (hex: string) => string;
|
|
4
|
+
export declare const addAlphaToRGB: (rgb: string, alpha: number | string) => string;
|
|
5
|
+
export declare const RGBToHex: (value: string) => string;
|
|
6
|
+
export declare const changeRGBAAlpha: (value: string, alpha: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const visibilityTransition: (open: boolean) => import("styled-components").FlattenSimpleInterpolation;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFocusTrap<T extends HTMLElement>(active: boolean): import("react").RefObject<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMountTransition: (isMounted: boolean, unmountDelay: number) => boolean;
|
package/dist/index.d.ts
CHANGED