@norges-domstoler/dds-components 0.0.26 → 0.0.29

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 (27) hide show
  1. package/dist/components/Button/Button.styles.d.ts +4 -8
  2. package/dist/components/Button/Button.tokens.d.ts +12 -0
  3. package/dist/components/Button/Button.types.d.ts +1 -1
  4. package/dist/components/Card/CardAccordion/CardAccordionBody.d.ts +3 -0
  5. package/dist/components/Card/CardAccordion/CardAccordionHeader.d.ts +3 -3
  6. package/dist/components/Card/CardAccordion/CardAccordionHeader.tokens.d.ts +7 -0
  7. package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
  8. package/dist/components/Checkbox/CheckboxGroupContext.d.ts +9 -0
  9. package/dist/components/Datepicker/Datepicker.tokens.d.ts +9 -0
  10. package/dist/components/RadioButton/RadioButtonGroupContext.d.ts +1 -0
  11. package/dist/components/TextInput/CharCounter.d.ts +3 -2
  12. package/dist/components/TextInput/TextInput.styles.d.ts +3 -2
  13. package/dist/components/Typography/Typography.d.ts +1 -2
  14. package/dist/components/Typography/Typography.tokens.d.ts +6 -0
  15. package/dist/components/Typography/Typography.types.d.ts +2 -1
  16. package/dist/helpers/Chevron/AnimatedChevronUpDown.d.ts +8 -2
  17. package/dist/helpers/Chevron/AnimatedChevronUpDown.styles.d.ts +5 -5
  18. package/dist/helpers/Input/Input.styles.d.ts +4 -2
  19. package/dist/helpers/Input/Input.types.d.ts +3 -1
  20. package/dist/helpers/InputMessage/InputMessage.d.ts +6 -6
  21. package/dist/helpers/styling/index.d.ts +1 -0
  22. package/dist/helpers/styling/removeButtonStyling.d.ts +1 -0
  23. package/dist/index.es.js +1202 -577
  24. package/dist/index.js +1202 -577
  25. package/dist/utils/idGenerator.d.ts +3 -0
  26. package/dist/utils/index.d.ts +1 -0
  27. package/package.json +4 -3
@@ -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 IconWithTextWrapperProps = {
14
- iconPosition: IconPosition;
13
+ declare type StyledIconWrapperSpanProps = {
14
+ iconPosition?: IconPosition;
15
15
  size: ButtonSize;
16
16
  };
17
- export declare const IconWithTextWrapper: import("styled-components").StyledComponent<typeof IconWrapper, any, IconWithTextWrapperProps, never>;
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 { HTMLAttributes } from 'react';
1
+ import { ButtonHTMLAttributes } from 'react';
2
2
  export declare type CardAccordionHeaderProps = {
3
3
  isExpanded?: boolean;
4
4
  toggleExpanded?: () => void;
5
5
  bodyId?: string;
6
- } & HTMLAttributes<HTMLDivElement>;
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
- } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
11
+ } & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -7,4 +7,11 @@ export declare const cardAccordionHeaderTokens: {
7
7
  hover: {
8
8
  base: CSSObject;
9
9
  };
10
+ chevronWrapper: {
11
+ base: CSSObject;
12
+ };
13
+ chevron: {
14
+ width: string;
15
+ height: string;
16
+ };
10
17
  };
@@ -5,10 +5,11 @@ export declare type CheckboxGroupProps = {
5
5
  direction?: Direction;
6
6
  groupId?: string;
7
7
  errorMessage?: string;
8
+ tip?: string;
8
9
  required?: boolean;
9
10
  className?: string;
10
11
  children?: React.ReactNode;
11
12
  style?: React.CSSProperties;
12
13
  } & HTMLAttributes<HTMLDivElement>;
13
- export declare const CheckboxGroup: ({ label, direction, errorMessage, required, groupId, children, className, style, ...rest }: CheckboxGroupProps) => JSX.Element;
14
+ export declare const CheckboxGroup: ({ label, direction, errorMessage, tip, required, groupId, children, className, style, ...rest }: CheckboxGroupProps) => JSX.Element;
14
15
  export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface CheckboxGroup {
3
+ error?: boolean;
4
+ errorMessageId?: string;
5
+ uniqueGroupId?: string;
6
+ tipId?: string;
7
+ }
8
+ export declare const CheckboxGroupContext: React.Context<Nullable<CheckboxGroup>>;
9
+ export declare const useCheckboxGroup: () => Nullable<CheckboxGroup>;
@@ -0,0 +1,9 @@
1
+ import { CSSObject } from 'styled-components';
2
+ export declare const datepickerTokens: {
3
+ calendarIndicator: {
4
+ base: CSSObject;
5
+ focus: {
6
+ base: CSSObject;
7
+ };
8
+ };
9
+ };
@@ -5,6 +5,7 @@ export interface RadioButtonGroup {
5
5
  name?: string;
6
6
  value?: string | number | null;
7
7
  error?: boolean;
8
+ errorMessageId?: string;
8
9
  required?: boolean;
9
10
  onChange: (event: ChangeEvent<HTMLInputElement>) => void;
10
11
  }
@@ -1,6 +1,7 @@
1
+ import { HTMLAttributes } from 'react';
1
2
  declare type Props = {
2
3
  current: number;
3
4
  max: number;
4
- };
5
- declare function CharCounter({ current, max }: Props): JSX.Element;
5
+ } & HTMLAttributes<HTMLDivElement>;
6
+ declare function CharCounter({ current, max, id, ...rest }: Props): JSX.Element;
6
7
  export default CharCounter;
@@ -1,6 +1,7 @@
1
1
  import { TextInputProps } from './TextInput.types';
2
- import { StyledInputProps } from '../../helpers/Input';
3
- export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, StyledInputProps, never>;
2
+ export declare const TextArea: import("styled-components").StyledComponent<"textarea", any, Pick<import("../../helpers/Input").InputProps, "label" | "readOnly" | "disabled"> & {
3
+ hasErrorMessage: boolean;
4
+ }, never>;
4
5
  export declare const MessageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
6
  declare type LabelProps = Pick<TextInputProps, 'multiline' | 'disabled' | 'readOnly'>;
6
7
  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>;
@@ -1,9 +1,8 @@
1
1
  import { HTMLAttributes, ElementType, AnchorHTMLAttributes, LabelHTMLAttributes } from 'react';
2
2
  import { CSSObject } from 'styled-components';
3
- import { TypographyType } from './Typography.types';
3
+ import { TypographyType, TextColor } from './Typography.types';
4
4
  export declare function isTextColor(color: string): color is TextColor;
5
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
6
  export declare type TypographyInteractionProps = {
8
7
  hover?: CSSObject;
9
8
  active?: CSSObject;
@@ -209,6 +209,12 @@ export declare const typographyTokens: {
209
209
  base: CSSObject;
210
210
  };
211
211
  };
212
+ supportingStyleTiny02: {
213
+ base: CSSObject;
214
+ margins: {
215
+ base: CSSObject;
216
+ };
217
+ };
212
218
  };
213
219
  style: {
214
220
  bold: {
@@ -3,5 +3,6 @@ export declare type TypographyBodySerifType = 'bodySerif01' | 'bodySerif02' | 'b
3
3
  export declare type TypographyBodyType = TypographyBodySansType | TypographyBodySerifType;
4
4
  export declare type TypographyHeadingType = 'headingSans01' | 'headingSans02' | 'headingSans03' | 'headingSans04' | 'headingSans05' | 'headingSans06' | 'headingSans07' | 'headingSans08';
5
5
  export declare type TypographyLeadType = 'leadSans01' | 'leadSans02' | 'leadSans03' | 'leadSans04' | 'leadSans05';
6
- export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01';
6
+ export declare type TypographySupportingType = 'supportingStyleLabel01' | 'supportingStyleInputText01' | 'supportingStyleInputText02' | 'supportingStyleInputText03' | 'supportingStyleHelperText01' | 'supportingStylePlaceholderText01' | 'supportingStyleTiny01' | 'supportingStyleTiny02';
7
7
  export declare type TypographyType = 'a' | TypographyHeadingType | TypographyBodyType | TypographyLeadType | TypographySupportingType;
8
+ export declare type TextColor = 'interactive' | 'primary' | 'danger' | 'warning' | 'success' | 'onLight' | 'onDark' | 'gray1' | 'gray2' | 'gray3' | 'gray4' | 'gray5' | 'gray6' | 'gray7' | 'gray8' | 'gray9';
@@ -1,2 +1,8 @@
1
- import { SvgChevronProps } from './AnimatedChevronUpDown.styles';
2
- export declare const AnimatedChevronUpDown: ({ isUp }: SvgChevronProps) => JSX.Element;
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 SvgChevronProps = {
1
+ export declare type StyledSvgChevronProps = {
2
2
  isUp?: boolean;
3
3
  };
4
- export declare const SvgChevron: import("styled-components").StyledComponent<"svg", any, SvgChevronProps, never>;
5
- export declare const SvgChevronlGroup: import("styled-components").StyledComponent<"g", any, SvgChevronProps, never>;
6
- export declare const SvgChevronlLeft: import("styled-components").StyledComponent<"path", any, SvgChevronProps, never>;
7
- export declare const SvgChevronlRight: import("styled-components").StyledComponent<"path", any, SvgChevronProps, never>;
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>;
@@ -1,6 +1,8 @@
1
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>;
2
+ export declare const inputStyling: ({ readOnly, label, disabled, hasErrorMessage }: StyledInputProps) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
3
+ export declare const Input: import("styled-components").StyledComponent<"input", any, Pick<InputProps, "readOnly" | "label" | "disabled"> & {
4
+ hasErrorMessage: boolean;
5
+ }, never>;
4
6
  export declare const SingleLineLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../components/Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, StyledLabelProps, never>;
5
7
  export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
6
8
  declare type OuterInputContainerProps = Pick<InputProps, 'width'>;
@@ -6,5 +6,7 @@ export declare type InputProps = {
6
6
  tip?: string;
7
7
  errorMessage?: string;
8
8
  } & InputHTMLAttributes<HTMLInputElement>;
9
- export declare type StyledInputProps = Pick<InputProps, 'readOnly' | 'errorMessage' | 'label' | 'disabled'>;
9
+ export declare type StyledInputProps = Pick<InputProps, 'readOnly' | 'label' | 'disabled'> & {
10
+ hasErrorMessage: boolean;
11
+ };
10
12
  export declare type StyledLabelProps = Pick<InputProps, 'disabled'>;
@@ -1,9 +1,9 @@
1
- import * as CSS from 'csstype';
1
+ import { HTMLAttributes } from 'react';
2
2
  declare type MessageType = 'error' | 'tip';
3
- declare type Props = {
3
+ export declare const InputMessage: import("react").ForwardRefExoticComponent<{
4
4
  message: string;
5
5
  messageType: MessageType;
6
- maxWidth?: CSS.MaxWidthProperty<string>;
7
- };
8
- declare function InputMessage({ message, messageType, maxWidth }: Props): JSX.Element;
9
- export default InputMessage;
6
+ maxWidth?: string | undefined;
7
+ messageId?: string | undefined;
8
+ } & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './removeButtonStyling';
@@ -0,0 +1 @@
1
+ export declare const removeButtonStyling: import("styled-components").FlattenSimpleInterpolation;