@norges-domstoler/dds-components 0.0.8 → 0.0.12

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/dist/assets/fonts/IBMPlexSans-Italic.woff +0 -0
  2. package/dist/assets/fonts/IBMPlexSans-Italic.woff2 +0 -0
  3. package/dist/assets/fonts/IBMPlexSans-Light.woff +0 -0
  4. package/dist/assets/fonts/IBMPlexSans-Light.woff2 +0 -0
  5. package/dist/assets/fonts/IBMPlexSans-LightItalic.woff +0 -0
  6. package/dist/assets/fonts/IBMPlexSans-LightItalic.woff2 +0 -0
  7. package/dist/assets/fonts/IBMPlexSans-Regular.woff +0 -0
  8. package/dist/assets/fonts/IBMPlexSans-Regular.woff2 +0 -0
  9. package/dist/assets/fonts/IBMPlexSans-SemiBold.woff +0 -0
  10. package/dist/assets/fonts/IBMPlexSans-SemiBold.woff2 +0 -0
  11. package/dist/assets/fonts/IBMPlexSans-SemiBoldItalic.woff +0 -0
  12. package/dist/assets/fonts/IBMPlexSans-SemiBoldItalic.woff2 +0 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
  14. package/dist/components/Button/Button.styles.d.ts +0 -1
  15. package/dist/components/Card/Card.d.ts +0 -1
  16. package/dist/components/Card/CardAccordion/CardAccordionBody.d.ts +0 -1
  17. package/dist/components/Card/CardAccordion/CardAccordionHeader.d.ts +0 -1
  18. package/dist/components/Checkbox/Checkbox.styles.d.ts +0 -1
  19. package/dist/components/Datepicker/Datepicker.d.ts +8 -0
  20. package/dist/components/Datepicker/index.d.ts +1 -0
  21. package/dist/components/DescriptionList/DescriptionListDesc.d.ts +0 -1
  22. package/dist/components/DescriptionList/DescriptionListTerm.d.ts +0 -1
  23. package/dist/components/GlobalMessage/GlobalMessage.d.ts +0 -1
  24. package/dist/components/List/List.d.ts +0 -1
  25. package/dist/components/LocalMessage/LocalMessage.d.ts +0 -1
  26. package/dist/components/Pagination/Pagination.d.ts +2 -0
  27. package/dist/components/RadioButton/RadioButton.styles.d.ts +0 -1
  28. package/dist/components/Search/Search.d.ts +0 -1
  29. package/dist/components/Select/Select.styles.d.ts +0 -1
  30. package/dist/components/Table/Row.d.ts +0 -1
  31. package/dist/components/TextInput/TextInput.d.ts +5 -4
  32. package/dist/components/TextInput/TextInput.styles.d.ts +6 -10
  33. package/dist/components/TextInput/TextInput.tokens.d.ts +2 -38
  34. package/dist/components/TextInput/TextInput.types.d.ts +2 -6
  35. package/dist/components/Typography/Typography.d.ts +0 -1
  36. package/dist/helpers/Input/Input.styles.d.ts +8 -0
  37. package/dist/helpers/Input/Input.tokens.d.ts +71 -0
  38. package/dist/helpers/Input/Input.types.d.ts +10 -0
  39. package/dist/helpers/Input/index.d.ts +3 -0
  40. package/dist/helpers/{inputFieldStylingBase.d.ts → Input/inputFieldStylingBase.d.ts} +0 -0
  41. package/dist/helpers/InputMessage/InputMessage.d.ts +0 -1
  42. package/dist/index.css +20 -354
  43. package/dist/index.d.ts +2 -0
  44. package/dist/index.es.css +20 -354
  45. package/dist/index.es.js +551 -444
  46. package/dist/index.js +551 -443
  47. package/dist/styles/fontStyles.css +60 -0
  48. package/package.json +2 -1
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type BreadcrumbsProps = {
4
3
  smallScreen?: boolean;
5
4
  } & HTMLAttributes<HTMLElement>;
@@ -2,7 +2,6 @@ import { ButtonAppearance, ButtonPurpose, ButtonProps } from './Button.types';
2
2
  import { OverridableComponent } from '@material-ui/core/OverridableComponent';
3
3
  import { IconWrapper } from '../../helpers/IconWrapper';
4
4
  import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
5
- import '../../styles/fontStyles.css';
6
5
  export declare const buttonContentStyle: (purpose: ButtonPurpose, appearance: ButtonAppearance, label?: string | undefined, Icon?: OverridableComponent<SvgIconTypeMap<Record<string, unknown>, "svg">> | undefined) => import("styled-components").FlattenSimpleInterpolation;
7
6
  declare type ButtonContentProps = Pick<ButtonProps, 'purpose' | 'appearance' | 'size' | 'label' | 'Icon' | 'iconPosition' | 'fullWidth' | 'loading'>;
8
7
  export declare const ButtonContent: import("styled-components").StyledComponent<"span", any, ButtonContentProps, never>;
@@ -1,5 +1,4 @@
1
1
  import { AnchorHTMLAttributes, HTMLAttributes } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type CardColor = 'filledDark' | 'filledLight' | 'strokeDark' | 'strokeLight';
4
3
  export declare type CardType = 'info' | 'navigation';
5
4
  export declare type CardProps = {
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../../styles/fontStyles.css';
3
2
  export declare type CardAccordionBodyProps = {
4
3
  isExpanded?: boolean;
5
4
  headerId?: string;
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../../styles/fontStyles.css';
3
2
  export declare type CardAccordionHeaderProps = {
4
3
  isExpanded?: boolean;
5
4
  toggleExpanded?: () => void;
@@ -1,5 +1,4 @@
1
1
  import { CheckboxProps } from './Checkbox.types';
2
- import '../../styles/fontStyles.css';
3
2
  export declare const CustomCheckbox: import("styled-components").StyledComponent<"span", any, {}, never>;
4
3
  export declare const Input: import("styled-components").StyledComponent<"input", any, {
5
4
  type: import("react").HTMLInputTypeAttribute;
@@ -0,0 +1,8 @@
1
+ import { InputProps } from '../../helpers/Input';
2
+ export declare type DatepickerProps = InputProps;
3
+ export declare const Datepicker: import("react").ForwardRefExoticComponent<{
4
+ label?: string | undefined;
5
+ width?: string | undefined;
6
+ tip?: string | undefined;
7
+ errorMessage?: string | undefined;
8
+ } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './Datepicker';
@@ -1,7 +1,6 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  import { OverridableComponent } from '@material-ui/core/OverridableComponent';
3
3
  import { SvgIconTypeMap } from '@material-ui/core';
4
- import '../../styles/fontStyles.css';
5
4
  export declare type DescriptionListDescProps = {
6
5
  Icon?: OverridableComponent<SvgIconTypeMap<Record<string, unknown>, 'svg'>>;
7
6
  } & HTMLAttributes<HTMLElement>;
@@ -1,4 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type DescriptionListTermProps = HTMLAttributes<HTMLElement>;
4
3
  export declare const DescriptionListTerm: import("react").ForwardRefExoticComponent<DescriptionListTermProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type GlobalMessagePurpose = 'info' | 'warning' | 'danger';
4
3
  export declare type GlobalMessageProps = {
5
4
  message?: string;
@@ -1,6 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  import { TypographyBodyType } from '../Typography';
3
- import '../../styles/fontStyles.css';
4
3
  export declare type ListType = 'ordered' | 'unordered';
5
4
  export declare type ListTypographyType = TypographyBodyType | 'inherit';
6
5
  export declare type ListProps = {
@@ -1,6 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  import * as CSS from 'csstype';
3
- import '../../styles/fontStyles.css';
4
3
  export declare type LocalMessagePurpose = 'info' | 'warning' | 'danger' | 'confidential' | 'success' | 'tips';
5
4
  export declare type LocalMessageLayout = 'horisontal' | 'vertical';
6
5
  export declare type LocalMessageProps = {
@@ -8,6 +8,7 @@ export declare type PaginationProps = {
8
8
  withCounter?: boolean;
9
9
  withSelect?: boolean;
10
10
  selectOptions?: SelectOption[];
11
+ onSelectOptionChange?: (option: SelectOption | null) => void;
11
12
  smallScreen?: boolean;
12
13
  onChange?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, page: number) => void;
13
14
  } & Omit<HTMLAttributes<HTMLElement>, 'onChange'>;
@@ -19,6 +20,7 @@ export declare const Pagination: import("react").ForwardRefExoticComponent<{
19
20
  withCounter?: boolean | undefined;
20
21
  withSelect?: boolean | undefined;
21
22
  selectOptions?: SelectOption[] | undefined;
23
+ onSelectOptionChange?: ((option: SelectOption | null) => void) | undefined;
22
24
  smallScreen?: boolean | undefined;
23
25
  onChange?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>, page: number) => void) | undefined;
24
26
  } & Omit<HTMLAttributes<HTMLElement>, "onChange"> & import("react").RefAttributes<HTMLElement>>;
@@ -1,5 +1,4 @@
1
1
  import { RadioButtonProps } from './RadioButton.types';
2
- import '../../styles/fontStyles.css';
3
2
  export declare const CustomRadioButton: import("styled-components").StyledComponent<"span", any, {}, never>;
4
3
  export declare const Input: import("styled-components").StyledComponent<"input", any, {
5
4
  type: import("react").HTMLInputTypeAttribute;
@@ -1,5 +1,4 @@
1
1
  import React, { ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type SearchSize = 'small' | 'medium' | 'large';
4
3
  declare type ButtonProps = {
5
4
  onClick: (event: MouseEvent<HTMLButtonElement>) => void;
@@ -1,6 +1,5 @@
1
1
  import { Styles } from 'react-select';
2
2
  import { IconWrapper } from '../../helpers/IconWrapper';
3
- import '../../styles/fontStyles.css';
4
3
  export declare const prefix = "dds-select";
5
4
  export declare const Label: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
6
5
  declare type StyledContainerProps = {
@@ -1,5 +1,4 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import '../../styles/fontStyles.css';
3
2
  export declare type TableRowType = 'body' | 'head';
4
3
  export declare type RowMode = 'normal' | 'sum';
5
4
  export declare type TableRowProps = {
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  export declare const TextInput: React.ForwardRefExoticComponent<{
3
- label?: string | undefined;
4
3
  multiline?: boolean | undefined;
5
- tip?: string | undefined;
6
- width?: string | undefined;
7
- errorMessage?: string | undefined;
8
4
  className?: string | undefined;
9
5
  style?: React.CSSProperties | undefined;
6
+ } & {
7
+ label?: string | undefined;
8
+ width?: string | undefined;
9
+ tip?: string | undefined;
10
+ errorMessage?: string | undefined;
10
11
  } & React.InputHTMLAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLInputElement>>;
@@ -1,13 +1,9 @@
1
1
  import { TextInputProps } from './TextInput.types';
2
- import '../../styles/fontStyles.css';
3
- declare type GeneralInputProps = Pick<TextInputProps, 'readOnly' | 'errorMessage' | 'label' | 'disabled'>;
4
- export declare const Input: import("styled-components").StyledComponent<"input", any, GeneralInputProps, never>;
5
- export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, GeneralInputProps, never>;
6
- export declare const FlexContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ import { StyledInputProps } from '../../helpers/Input';
3
+ export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, StyledInputProps, never>;
4
+ export declare const MessageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
7
5
  declare type LabelProps = Pick<TextInputProps, 'multiline' | 'disabled' | 'readOnly'>;
8
- export declare const Label: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, LabelProps, never>;
9
- declare type InputFieldWrapperProps = Pick<TextInputProps, 'width'>;
10
- export declare const InputFieldWrapper: import("styled-components").StyledComponent<"div", any, InputFieldWrapperProps, never>;
11
- declare type InputFieldContainerProps = Pick<TextInputProps, 'multiline' | 'label'>;
12
- export declare const InputFieldContainer: import("styled-components").StyledComponent<"div", any, InputFieldContainerProps, never>;
6
+ 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>;
7
+ declare type InputContainerProps = Pick<TextInputProps, 'multiline' | 'label'>;
8
+ export declare const InputContainer: import("styled-components").StyledComponent<"div", any, InputContainerProps, never>;
13
9
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSObject } from 'styled-components';
2
- export declare const inputTokens: {
2
+ export declare const textInputTokens: {
3
3
  general: {
4
4
  input: {
5
5
  borderRadius: string;
@@ -33,20 +33,7 @@ export declare const inputTokens: {
33
33
  };
34
34
  };
35
35
  };
36
- base: CSSObject;
37
36
  focusColor: string;
38
- withLabel: {
39
- base: CSSObject;
40
- };
41
- noLabel: {
42
- base: CSSObject;
43
- };
44
- readOnly: {
45
- base: CSSObject;
46
- };
47
- disabled: {
48
- base: CSSObject;
49
- };
50
37
  multiline: {
51
38
  base: CSSObject;
52
39
  withLabel: {
@@ -56,32 +43,9 @@ export declare const inputTokens: {
56
43
  base: CSSObject;
57
44
  };
58
45
  };
59
- error: {
60
- base: CSSObject;
61
- hover: {
62
- base: CSSObject;
63
- };
64
- focus: {
65
- base: CSSObject;
66
- };
67
- };
68
46
  label: {
69
- base: CSSObject;
70
47
  multiline: {
71
- base: {
72
- backgroundColor: string;
73
- padding: string;
74
- };
75
- };
76
- hover: {
77
- base: {
78
- color: string;
79
- };
80
- };
81
- focus: {
82
- base: {
83
- color: string;
84
- };
48
+ base: CSSObject;
85
49
  };
86
50
  };
87
51
  wrapper: {
@@ -1,11 +1,7 @@
1
1
  import React, { InputHTMLAttributes } from 'react';
2
- import * as CSS from 'csstype';
2
+ import { InputProps } from '../../helpers/Input';
3
3
  export declare type TextInputProps = {
4
- label?: string;
5
4
  multiline?: boolean;
6
- tip?: string;
7
- width?: CSS.WidthProperty<string>;
8
- errorMessage?: string;
9
5
  className?: string;
10
6
  style?: React.CSSProperties;
11
- } & InputHTMLAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLTextAreaElement>;
7
+ } & InputProps & InputHTMLAttributes<HTMLTextAreaElement>;
@@ -1,7 +1,6 @@
1
1
  import { HTMLAttributes, ElementType, AnchorHTMLAttributes, LabelHTMLAttributes } from 'react';
2
2
  import { CSSObject } from 'styled-components';
3
3
  import { TypographyType } from './Typography.types';
4
- import '../../styles/fontStyles.css';
5
4
  export declare function isTextColor(color: string): color is TextColor;
6
5
  export declare const getTextColor: (color: TextColor | string) => string;
7
6
  export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
@@ -0,0 +1,8 @@
1
+ import { InputProps, StyledInputProps, StyledLabelProps } from './Input.types';
2
+ export declare const inputStyling: ({ readOnly, errorMessage, label, disabled }: StyledInputProps) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
3
+ export declare const Input: import("styled-components").StyledComponent<"input", any, StyledInputProps, never>;
4
+ export declare const SingleLineLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../components/Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, StyledLabelProps, never>;
5
+ export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ declare type OuterInputContainerProps = Pick<InputProps, 'width'>;
7
+ export declare const OuterInputContainer: import("styled-components").StyledComponent<"div", any, OuterInputContainerProps, never>;
8
+ export {};
@@ -0,0 +1,71 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const inputTokens: {
3
+ general: {
4
+ input: {
5
+ borderRadius: string;
6
+ borderWidth: string;
7
+ borderColor: string;
8
+ textColor: string;
9
+ font: {
10
+ lineHeight: any;
11
+ fontSize: string;
12
+ letterSpacing: any;
13
+ fontFamily: any;
14
+ fontWeight: any;
15
+ fontStyle: any;
16
+ };
17
+ hover: {
18
+ backgroundColor: string;
19
+ borderColor: string;
20
+ borderWidth: string;
21
+ };
22
+ focus: {
23
+ borderColor: string;
24
+ borderWidth: string;
25
+ };
26
+ };
27
+ label: {
28
+ hover: {
29
+ textColor: string;
30
+ };
31
+ focus: {
32
+ textColor: string;
33
+ };
34
+ };
35
+ };
36
+ base: CSSObject;
37
+ focusColor: string;
38
+ withLabel: {
39
+ base: CSSObject;
40
+ };
41
+ noLabel: {
42
+ base: CSSObject;
43
+ };
44
+ readOnly: {
45
+ base: CSSObject;
46
+ };
47
+ disabled: {
48
+ base: CSSObject;
49
+ };
50
+ error: {
51
+ base: CSSObject;
52
+ hover: {
53
+ base: CSSObject;
54
+ };
55
+ focus: {
56
+ base: CSSObject;
57
+ };
58
+ };
59
+ label: {
60
+ base: CSSObject;
61
+ hover: {
62
+ base: CSSObject;
63
+ };
64
+ focus: {
65
+ base: CSSObject;
66
+ };
67
+ disabled: {
68
+ base: CSSObject;
69
+ };
70
+ };
71
+ };
@@ -0,0 +1,10 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import * as CSS from 'csstype';
3
+ export declare type InputProps = {
4
+ label?: string;
5
+ width?: CSS.WidthProperty<string>;
6
+ tip?: string;
7
+ errorMessage?: string;
8
+ } & InputHTMLAttributes<HTMLInputElement>;
9
+ export declare type StyledInputProps = Pick<InputProps, 'readOnly' | 'errorMessage' | 'label' | 'disabled'>;
10
+ export declare type StyledLabelProps = Pick<InputProps, 'disabled'>;
@@ -0,0 +1,3 @@
1
+ export * from './Input.styles';
2
+ export * from './Input.types';
3
+ export * from './Input.tokens';
@@ -1,5 +1,4 @@
1
1
  import * as CSS from 'csstype';
2
- import '../../styles/fontStyles.css';
3
2
  declare type MessageType = 'error' | 'tip';
4
3
  declare type Props = {
5
4
  message: string;