@norges-domstoler/dds-components 0.0.11 → 0.0.15

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.
@@ -1,15 +1,23 @@
1
- import { ButtonAppearance, ButtonPurpose, ButtonProps } from './Button.types';
2
- import { OverridableComponent } from '@material-ui/core/OverridableComponent';
3
1
  import { IconWrapper } from '../../helpers/IconWrapper';
4
- import { SvgIconTypeMap } from '@material-ui/core/SvgIcon';
5
- export declare const buttonContentStyle: (purpose: ButtonPurpose, appearance: ButtonAppearance, label?: string | undefined, Icon?: OverridableComponent<SvgIconTypeMap<Record<string, unknown>, "svg">> | undefined) => import("styled-components").FlattenSimpleInterpolation;
6
- declare type ButtonContentProps = Pick<ButtonProps, 'purpose' | 'appearance' | 'size' | 'label' | 'Icon' | 'iconPosition' | 'fullWidth' | 'loading'>;
7
- export declare const ButtonContent: import("styled-components").StyledComponent<"span", any, ButtonContentProps, never>;
8
- declare type ButtonWrapperProps = Pick<ButtonProps, 'fullWidth'>;
2
+ import { ButtonAppearance, ButtonPurpose, ButtonSize, IconPosition } from './Button.types';
3
+ declare type ButtonWrapperProps = {
4
+ appearance: ButtonAppearance;
5
+ purpose: ButtonPurpose;
6
+ size: ButtonSize;
7
+ fullWidth: boolean;
8
+ hasIcon: boolean;
9
+ hasLabel: boolean;
10
+ isLoading: boolean;
11
+ };
9
12
  export declare const ButtonWrapper: import("styled-components").StyledComponent<"button", any, ButtonWrapperProps, never>;
10
- declare type IconWithTextWrapperProps = Pick<ButtonProps, 'iconPosition' | 'size'>;
13
+ declare type IconWithTextWrapperProps = {
14
+ iconPosition: IconPosition;
15
+ size: ButtonSize;
16
+ };
11
17
  export declare const IconWithTextWrapper: import("styled-components").StyledComponent<typeof IconWrapper, any, IconWithTextWrapperProps, never>;
12
- declare type JustIconWrapperProps = Pick<ButtonProps, 'size'>;
18
+ declare type JustIconWrapperProps = {
19
+ size: ButtonSize;
20
+ };
13
21
  export declare const JustIconWrapper: import("styled-components").StyledComponent<"span", any, JustIconWrapperProps, never>;
14
22
  export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
15
23
  export {};
@@ -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';
@@ -4,9 +4,11 @@ export declare type GlobalMessageProps = {
4
4
  message?: string;
5
5
  purpose?: GlobalMessagePurpose;
6
6
  closable?: boolean;
7
+ onClose?: () => void;
7
8
  } & HTMLAttributes<HTMLDivElement>;
8
9
  export declare const GlobalMessage: import("react").ForwardRefExoticComponent<{
9
10
  message?: string | undefined;
10
11
  purpose?: GlobalMessagePurpose | undefined;
11
12
  closable?: boolean | undefined;
13
+ onClose?: (() => void) | undefined;
12
14
  } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -6,6 +6,7 @@ export declare type LocalMessageProps = {
6
6
  message?: string;
7
7
  purpose?: LocalMessagePurpose;
8
8
  closable?: boolean;
9
+ onClose?: () => void;
9
10
  width?: CSS.WidthProperty<string>;
10
11
  layout?: LocalMessageLayout;
11
12
  } & HTMLAttributes<HTMLDivElement>;
@@ -13,6 +14,7 @@ export declare const LocalMessage: import("react").ForwardRefExoticComponent<{
13
14
  message?: string | undefined;
14
15
  purpose?: LocalMessagePurpose | undefined;
15
16
  closable?: boolean | undefined;
17
+ onClose?: (() => void) | undefined;
16
18
  width?: string | undefined;
17
19
  layout?: LocalMessageLayout | undefined;
18
20
  } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
@@ -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,12 +1,9 @@
1
1
  import { TextInputProps } from './TextInput.types';
2
- declare type GeneralInputProps = Pick<TextInputProps, 'readOnly' | 'errorMessage' | 'label' | 'disabled'>;
3
- export declare const Input: import("styled-components").StyledComponent<"input", any, GeneralInputProps, never>;
4
- export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, GeneralInputProps, never>;
5
- 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>;
6
5
  declare type LabelProps = Pick<TextInputProps, 'multiline' | 'disabled' | 'readOnly'>;
7
- export declare const Label: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, LabelProps, never>;
8
- declare type InputFieldWrapperProps = Pick<TextInputProps, 'width'>;
9
- export declare const InputFieldWrapper: import("styled-components").StyledComponent<"div", any, InputFieldWrapperProps, never>;
10
- declare type InputFieldContainerProps = Pick<TextInputProps, 'multiline' | 'label'>;
11
- 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>;
12
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>;
@@ -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';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import 'focus-visible';
1
2
  import './styles/fontStyles.css';
2
3
  export * from './components/RadioButton';
3
4
  export * from './components/Checkbox';
@@ -17,3 +18,4 @@ export * from './components/List';
17
18
  export * from './components/DescriptionList';
18
19
  export * from './components/Spinner';
19
20
  export * from './components/Card';
21
+ export * from './components/Datepicker';