@norges-domstoler/dds-components 0.0.5 → 0.0.6

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.
Files changed (48) hide show
  1. package/README.md +10 -3
  2. package/dist/components/Breadcrumbs/{breadcrumbTokens.d.ts → Breadcrumb.tokens.d.ts} +0 -0
  3. package/dist/components/Button/Button.d.ts +7 -8
  4. package/dist/components/Button/{buttonTokens.d.ts → Button.tokens.d.ts} +0 -0
  5. package/dist/components/Checkbox/{checkboxTokens.d.ts → Checkbox.tokens.d.ts} +0 -0
  6. package/dist/components/Checkbox/{checkboxGroupTokens.d.ts → CheckboxGroup.tokens.d.ts} +0 -0
  7. package/dist/components/DescriptionList/DescriptionList.d.ts +8 -0
  8. package/dist/components/DescriptionList/DescriptionListDesc.d.ts +9 -0
  9. package/dist/components/DescriptionList/DescriptionListDesc.tokens.d.ts +7 -0
  10. package/dist/components/DescriptionList/DescriptionListGroup.d.ts +8 -0
  11. package/dist/components/DescriptionList/DescriptionListGroup.tokens.d.ts +4 -0
  12. package/dist/components/DescriptionList/DescriptionListTerm.d.ts +3 -0
  13. package/dist/components/DescriptionList/DescriptionListTerm.tokens.d.ts +13 -0
  14. package/dist/components/DescriptionList/index.d.ts +4 -0
  15. package/dist/components/Divider/Divider.d.ts +0 -1
  16. package/dist/components/Divider/{dividerTokens.d.ts → Divider.tokens.d.ts} +0 -0
  17. package/dist/components/GlobalMessage/{globalMessageTokens.d.ts → GlobalMessage.tokens.d.ts} +0 -0
  18. package/dist/components/List/List.d.ts +12 -0
  19. package/dist/components/List/List.tokens.d.ts +16 -0
  20. package/dist/components/List/ListItem.d.ts +3 -0
  21. package/dist/components/List/ListItem.tokens.d.ts +5 -0
  22. package/dist/components/List/index.d.ts +2 -0
  23. package/dist/components/LocalMessage/{localMessageTokens.d.ts → LocalMessage.tokens.d.ts} +0 -0
  24. package/dist/components/Pagination/{paginationTokens.d.ts → Pagination.tokens.d.ts} +0 -0
  25. package/dist/components/RadioButton/{radioButtonTokens.d.ts → RadioButton.tokens.d.ts} +0 -0
  26. package/dist/components/RadioButton/{radioButtonGroupTokens.d.ts → RadioButtonGroup.tokens.d.ts} +0 -0
  27. package/dist/components/Search/{searchTokens.d.ts → Search.tokens.d.ts} +0 -0
  28. package/dist/components/Select/{selectTokens.d.ts → Select.tokens.d.ts} +0 -0
  29. package/dist/components/Spinner/Spinner.d.ts +7 -0
  30. package/dist/components/Spinner/Spinner.tokens.d.ts +6 -0
  31. package/dist/components/Spinner/index.d.ts +1 -0
  32. package/dist/components/Table/Cell.d.ts +2 -2
  33. package/dist/components/Table/{cellTokens.d.ts → Cell.tokens.d.ts} +0 -0
  34. package/dist/components/Table/Foot.d.ts +3 -0
  35. package/dist/components/Table/{rowTokens.d.ts → Row.tokens.d.ts} +0 -0
  36. package/dist/components/Table/index.d.ts +1 -0
  37. package/dist/components/TextInput/{charCounterTokens.d.ts → CharCounter.tokens.d.ts} +0 -0
  38. package/dist/components/TextInput/{textInputTokens.d.ts → TextInput.tokens.d.ts} +0 -0
  39. package/dist/components/Typography/Typography.d.ts +11 -2
  40. package/dist/components/Typography/{typographyTokens.d.ts → Typography.tokens.d.ts} +15 -1
  41. package/dist/components/Typography/Typography.types.d.ts +7 -0
  42. package/dist/components/Typography/index.d.ts +1 -0
  43. package/dist/helpers/InputMessage/{inputMessageTokens.d.ts → InputMessage.tokens.d.ts} +0 -0
  44. package/dist/index.d.ts +3 -0
  45. package/dist/index.es.js +989 -669
  46. package/dist/index.js +998 -668
  47. package/package.json +7 -3
  48. package/dist/helpers/Spinner.d.ts +0 -15
package/README.md CHANGED
@@ -6,12 +6,12 @@ _biblioteket er under arbeid_
6
6
 
7
7
  React UI komponenter til bruk i Domstolenes tjenester.
8
8
 
9
- Sjekk ut [Domstolenes designsystem (DDS)](https://design.domstol.no/) og [Storybook](https://domstolene.github.io/designsystem) for mer dokumentasjon og demoer.
9
+ Sjekk ut [Domstolenes designsystem Elsa](https://design.domstol.no/) og [Storybook](https://domstolene.github.io/designsystem) for mer dokumentasjon og demoer.
10
10
 
11
11
  ## Installasjon
12
12
 
13
13
  ```sh
14
- npm install @norges-domstoler/dds-components styled-components
14
+ npm install @norges-domstoler/dds-components
15
15
  ```
16
16
 
17
17
  ## Bruk
@@ -34,17 +34,24 @@ render(<App />, document.getElementById('root'));
34
34
 
35
35
  ## Komponenter
36
36
 
37
- Alle komponenter er under arbeid, ta kontakt for status.
37
+ Sjekk [komponentstatus](https://design.domstol.no/987b33f71/p/438035-komponenter/b/160db9) for oppdatert status.
38
+
39
+ Tilgjengelige komponenter:
38
40
 
39
41
  - Breadcrumbs
40
42
  - Button
41
43
  - Checkbox
44
+ - DescriptionList
45
+ - Divider
42
46
  - GlobalMessage
43
47
  - IconWrapper
48
+ - List
44
49
  - LocalMessage
50
+ - Pagination
45
51
  - RadioButton
46
52
  - Search
47
53
  - Select
54
+ - Spinner
48
55
  - Table
49
56
  - TextInput
50
57
  - Typography
@@ -2,15 +2,15 @@ import React, { ButtonHTMLAttributes } from 'react';
2
2
  import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
3
3
  import { OverridableComponent } from '@material-ui/core/OverridableComponent';
4
4
  export declare type ButtonPurpose = 'primary' | 'secondary' | 'danger';
5
- declare type Size = 'small' | 'medium' | 'large';
6
- declare type Appearance = 'filled' | 'ghost' | 'rounded' | 'borderless';
7
- declare type IconPosition = 'left' | 'right';
5
+ export declare type ButtonSize = 'small' | 'medium' | 'large';
6
+ export declare type ButtonAppearance = 'filled' | 'ghost' | 'rounded' | 'borderless';
7
+ export declare type IconPosition = 'left' | 'right';
8
8
  export declare type ButtonProps = {
9
- size?: Size;
9
+ size?: ButtonSize;
10
10
  label?: string;
11
11
  purpose?: ButtonPurpose;
12
12
  iconPosition?: IconPosition;
13
- appearance?: Appearance;
13
+ appearance?: ButtonAppearance;
14
14
  href?: string;
15
15
  target?: string;
16
16
  loading?: boolean;
@@ -20,11 +20,11 @@ export declare type ButtonProps = {
20
20
  fullWidth?: boolean;
21
21
  } & ButtonHTMLAttributes<HTMLButtonElement>;
22
22
  export declare const Button: React.ForwardRefExoticComponent<{
23
- size?: Size | undefined;
23
+ size?: ButtonSize | undefined;
24
24
  label?: string | undefined;
25
25
  purpose?: ButtonPurpose | undefined;
26
26
  iconPosition?: IconPosition | undefined;
27
- appearance?: Appearance | undefined;
27
+ appearance?: ButtonAppearance | undefined;
28
28
  href?: string | undefined;
29
29
  target?: string | undefined;
30
30
  loading?: boolean | undefined;
@@ -33,4 +33,3 @@ export declare const Button: React.ForwardRefExoticComponent<{
33
33
  Icon?: OverridableComponent<SvgIconTypeMap<{}, "svg">> | undefined;
34
34
  fullWidth?: boolean | undefined;
35
35
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
36
- export {};
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare type DescriptionListAppearance = 'small' | 'bold';
3
+ export declare type DescriptionListProps = {
4
+ appearance?: DescriptionListAppearance;
5
+ } & HTMLAttributes<HTMLDListElement>;
6
+ export declare const DescriptionList: import("react").ForwardRefExoticComponent<{
7
+ appearance?: DescriptionListAppearance | undefined;
8
+ } & HTMLAttributes<HTMLDListElement> & import("react").RefAttributes<HTMLDListElement>>;
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { OverridableComponent } from '@material-ui/core/OverridableComponent';
3
+ import { SvgIconTypeMap } from '@material-ui/core';
4
+ export declare type DescriptionListDescProps = {
5
+ Icon?: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;
6
+ } & HTMLAttributes<HTMLElement>;
7
+ export declare const DescriptionListDesc: import("react").ForwardRefExoticComponent<{
8
+ Icon?: OverridableComponent<SvgIconTypeMap<{}, "svg">> | undefined;
9
+ } & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,7 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const descriptionListDescTokens: {
3
+ base: CSSObject;
4
+ icon: {
5
+ base: CSSObject;
6
+ };
7
+ };
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import * as CSS from 'csstype';
3
+ export declare type DescriptionListGroupProps = {
4
+ margin?: CSS.MarginProperty<string>;
5
+ } & HTMLAttributes<HTMLDivElement>;
6
+ export declare const DescriptionListGroup: import("react").ForwardRefExoticComponent<{
7
+ margin?: string | undefined;
8
+ } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const descriptionListGroupTokens: {
3
+ base: CSSObject;
4
+ };
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare type DescriptionListTermProps = {} & HTMLAttributes<HTMLElement>;
3
+ export declare const DescriptionListTerm: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,13 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const descriptionListTermTokens: {
3
+ appearance: {
4
+ small: {
5
+ base: CSSObject;
6
+ };
7
+ bold: {
8
+ base: CSSObject;
9
+ };
10
+ };
11
+ unwrappedTopAndBottomSpace: string;
12
+ unwrappedBetweenSpace: string;
13
+ };
@@ -0,0 +1,4 @@
1
+ export * from './DescriptionList';
2
+ export * from './DescriptionListTerm';
3
+ export * from './DescriptionListDesc';
4
+ export * from './DescriptionListGroup';
@@ -1,6 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  export declare type DividerColor = 'primary' | 'primaryLighter';
3
- export declare type DividerDirection = 'horisontal' | 'vertical';
4
3
  export declare type DividerProps = {
5
4
  color?: DividerColor;
6
5
  } & HTMLAttributes<HTMLHRElement>;
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { TypographyBodyType } from '../Typography';
3
+ export declare type ListType = 'ordered' | 'unordered';
4
+ export declare type ListTypographyType = TypographyBodyType | 'inherit';
5
+ export declare type ListProps = {
6
+ listType?: ListType;
7
+ typographyType?: ListTypographyType;
8
+ } & HTMLAttributes<HTMLUListElement | HTMLOListElement>;
9
+ export declare const List: import("react").ForwardRefExoticComponent<{
10
+ listType?: ListType | undefined;
11
+ typographyType?: ListTypographyType | undefined;
12
+ } & HTMLAttributes<HTMLUListElement | HTMLOListElement> & import("react").RefAttributes<HTMLUListElement | HTMLOListElement>>;
@@ -0,0 +1,16 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const listTokens: {
3
+ base: CSSObject;
4
+ spaceLeft: string;
5
+ sizes: {
6
+ bodySans01: CSSObject;
7
+ bodySans02: CSSObject;
8
+ bodySans03: CSSObject;
9
+ bodySans04: CSSObject;
10
+ bodySerif01: CSSObject;
11
+ bodySerif02: CSSObject;
12
+ bodySerif03: CSSObject;
13
+ bodySerif04: CSSObject;
14
+ inherit: CSSObject;
15
+ };
16
+ };
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare type ListItemProps = {} & HTMLAttributes<HTMLLIElement>;
3
+ export declare const ListItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & import("react").RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,5 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const listItemTokens: {
3
+ base: CSSObject;
4
+ bulletSpacing: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ export * from './List';
2
+ export * from './ListItem';
@@ -0,0 +1,7 @@
1
+ import * as CSS from 'csstype';
2
+ import { TextColor } from '../Typography';
3
+ export declare type SpinnerProps = {
4
+ color?: TextColor | string;
5
+ size?: CSS.WidthProperty<string>;
6
+ };
7
+ export declare function Spinner({ size, color }: SpinnerProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const spinnerTokens: {
3
+ circle: {
4
+ base: CSSObject;
5
+ };
6
+ };
@@ -0,0 +1 @@
1
+ export * from './Spinner';
@@ -4,5 +4,5 @@ export declare type TableCellLayout = 'left' | 'right' | 'center' | 'text and ic
4
4
  export declare type TableCellProps = {
5
5
  type?: TableCellType;
6
6
  layout?: TableCellLayout;
7
- } & (TdHTMLAttributes<HTMLTableDataCellElement> | ThHTMLAttributes<HTMLTableHeaderCellElement>);
8
- export declare const Cell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableDataCellElement | HTMLTableHeaderCellElement>>;
7
+ } & (TdHTMLAttributes<HTMLTableCellElement> | ThHTMLAttributes<HTMLTableCellElement>);
8
+ export declare const Cell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare type FootProps = {} & HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Foot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -4,3 +4,4 @@ export * from './Head';
4
4
  export * from './Row';
5
5
  export * from './Cell';
6
6
  export * from './SortCell';
7
+ export * from './Foot';
@@ -1,6 +1,13 @@
1
1
  import { HTMLAttributes, ElementType, AnchorHTMLAttributes, LabelHTMLAttributes } from 'react';
2
- export declare type TypographyType = 'a' | 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08' | 'bodySans01' | 'bodySans02' | 'bodySans03' | 'bodySans04' | 'bodySerif01' | 'bodySerif02' | 'bodySerif03' | 'bodySerif04' | 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05' | 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01';
3
- export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'default';
2
+ import { CSSObject } from 'styled-components';
3
+ import { TypographyType } from './Typography.types';
4
+ export declare function isTextColor(color: string): color is TextColor;
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
+ export declare type TypographyInteractionProps = {
8
+ hover?: CSSObject;
9
+ active?: CSSObject;
10
+ };
4
11
  export declare type TypographyProps = {
5
12
  typographyType?: TypographyType;
6
13
  as?: ElementType;
@@ -8,7 +15,9 @@ export declare type TypographyProps = {
8
15
  color?: TextColor | string;
9
16
  bold?: boolean;
10
17
  italic?: boolean;
18
+ underline?: boolean;
11
19
  withMargins?: boolean;
20
+ interactionProps?: TypographyInteractionProps;
12
21
  target?: string;
13
22
  } & (HTMLAttributes<HTMLElement> | LabelHTMLAttributes<HTMLLabelElement> | AnchorHTMLAttributes<HTMLAnchorElement>);
14
23
  export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLElement>>;
@@ -5,8 +5,19 @@ export declare const textColors: {
5
5
  danger: string;
6
6
  success: string;
7
7
  warning: string;
8
- default: string;
8
+ onLight: string;
9
+ onDark: string;
10
+ gray1: string;
11
+ gray2: string;
12
+ gray3: string;
13
+ gray4: string;
14
+ gray5: string;
15
+ gray6: string;
16
+ gray7: string;
17
+ gray8: string;
18
+ gray9: string;
9
19
  };
20
+ export declare const textColorsArray: string[];
10
21
  export declare const typographyTokens: {
11
22
  selection: {
12
23
  base: CSSObject;
@@ -206,5 +217,8 @@ export declare const typographyTokens: {
206
217
  italic: {
207
218
  base: CSSObject;
208
219
  };
220
+ underline: {
221
+ base: CSSObject;
222
+ };
209
223
  };
210
224
  };
@@ -0,0 +1,7 @@
1
+ export declare type TypographyBodySansType = 'bodySans01' | 'bodySans02' | 'bodySans03' | 'bodySans04';
2
+ export declare type TypographyBodySerifType = 'bodySerif01' | 'bodySerif02' | 'bodySerif03' | 'bodySerif04';
3
+ export declare type TypographyBodyType = TypographyBodySansType | TypographyBodySerifType;
4
+ export declare type TypographyHeadingType = 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08';
5
+ export declare type TypographyLeadType = 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05';
6
+ export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01';
7
+ export declare type TypographyType = 'a' | TypographyHeadingType | TypographyBodyType | TypographyLeadType | TypographySupportingType;
@@ -1 +1,2 @@
1
1
  export * from './Typography';
2
+ export * from './Typography.types';
package/dist/index.d.ts CHANGED
@@ -14,3 +14,6 @@ export * from './components/Breadcrumbs';
14
14
  export * from './helpers/IconWrapper';
15
15
  export * from './components/Pagination';
16
16
  export * from './components/Divider';
17
+ export * from './components/List';
18
+ export * from './components/DescriptionList';
19
+ export * from './components/Spinner';