@entur-partner/common 6.0.0 → 6.0.1

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,9 +1,9 @@
1
1
  import './ActionBar.scss';
2
- import { ReactNode } from 'react';
2
+ import React, { ReactNode } from 'react';
3
3
  export interface ActionBarProps {
4
4
  children: ReactNode;
5
5
  }
6
- declare const ActionBarLeft: ({ children }: ActionBarProps) => JSX.Element;
7
- declare const ActionBarRight: ({ children }: ActionBarProps) => JSX.Element;
8
- declare const ActionBar: ({ children }: ActionBarProps) => JSX.Element;
6
+ declare const ActionBarLeft: ({ children }: ActionBarProps) => React.JSX.Element;
7
+ declare const ActionBarRight: ({ children }: ActionBarProps) => React.JSX.Element;
8
+ declare const ActionBar: ({ children }: ActionBarProps) => React.JSX.Element;
9
9
  export { ActionBar, ActionBarLeft, ActionBarRight };
package/dist/Box.d.ts CHANGED
@@ -1,25 +1,25 @@
1
1
  import './Box.scss';
2
2
  import React, { ReactNode } from 'react';
3
- declare type StyleSpacing = 'none' | 'extraSmall2' | 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'extraLarge7' | 'extraLarge8' | 'extraLarge9';
4
- declare type StyleMargin = StyleSpacing | 'auto';
5
- declare type StyleDisplay = 'block' | 'flex' | 'inline' | 'inline-block';
6
- declare type StyleJustifyContent = 'center' | 'space-between' | 'start' | 'end';
7
- declare type StyleAlignItems = 'center' | 'start' | 'end' | 'stretch' | 'baseline';
8
- declare type StyleMaxWidth = 'none' | 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'full';
9
- declare type StyleWidth = 'auto' | 'full';
10
- export declare type StyleBackground = 'blue' | 'lavender' | 'white' | 'blue70';
11
- export declare type StyleColor = 'blue' | 'lavender' | 'white' | 'black';
12
- declare type StyleFlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
13
- declare type StyleFlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
14
- export declare type ResponsiveStyleSpacing = StyleSpacing | [StyleSpacing?, StyleSpacing?, StyleSpacing?];
15
- export declare type ResponsiveStyleMargin = StyleMargin | [StyleMargin?, StyleMargin?, StyleMargin?];
16
- export declare type ResponsiveStyleDisplay = StyleDisplay | [StyleDisplay?, StyleDisplay?, StyleDisplay?];
17
- export declare type ResponsiveStyleJustifyContent = StyleJustifyContent | [StyleJustifyContent?, StyleJustifyContent?, StyleJustifyContent?];
18
- export declare type ResponsiveStyleAlignItems = StyleAlignItems | [StyleAlignItems?, StyleAlignItems?, StyleAlignItems?];
19
- export declare type ResponsiveStyleMaxWidth = StyleMaxWidth | [StyleMaxWidth?, StyleMaxWidth?, StyleMaxWidth?];
20
- export declare type ResponsiveStyleWidth = StyleWidth | [StyleWidth?, StyleWidth?, StyleWidth?];
21
- export declare type ResponsiveStyleFlexDirection = StyleFlexDirection | [StyleFlexDirection?, StyleFlexDirection?, StyleFlexDirection?];
22
- export declare type ResponsiveStyleFlexWrap = StyleFlexWrap | [StyleFlexWrap?, StyleFlexWrap?, StyleFlexWrap?];
3
+ type StyleSpacing = 'none' | 'extraSmall2' | 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'extraLarge7' | 'extraLarge8' | 'extraLarge9';
4
+ type StyleMargin = StyleSpacing | 'auto';
5
+ type StyleDisplay = 'block' | 'flex' | 'inline' | 'inline-block';
6
+ type StyleJustifyContent = 'center' | 'space-between' | 'start' | 'end';
7
+ type StyleAlignItems = 'center' | 'start' | 'end' | 'stretch' | 'baseline';
8
+ type StyleMaxWidth = 'none' | 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'full';
9
+ type StyleWidth = 'auto' | 'full';
10
+ export type StyleBackground = 'blue' | 'lavender' | 'white' | 'blue70';
11
+ export type StyleColor = 'blue' | 'lavender' | 'white' | 'black';
12
+ type StyleFlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
13
+ type StyleFlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
14
+ export type ResponsiveStyleSpacing = StyleSpacing | [StyleSpacing?, StyleSpacing?, StyleSpacing?];
15
+ export type ResponsiveStyleMargin = StyleMargin | [StyleMargin?, StyleMargin?, StyleMargin?];
16
+ export type ResponsiveStyleDisplay = StyleDisplay | [StyleDisplay?, StyleDisplay?, StyleDisplay?];
17
+ export type ResponsiveStyleJustifyContent = StyleJustifyContent | [StyleJustifyContent?, StyleJustifyContent?, StyleJustifyContent?];
18
+ export type ResponsiveStyleAlignItems = StyleAlignItems | [StyleAlignItems?, StyleAlignItems?, StyleAlignItems?];
19
+ export type ResponsiveStyleMaxWidth = StyleMaxWidth | [StyleMaxWidth?, StyleMaxWidth?, StyleMaxWidth?];
20
+ export type ResponsiveStyleWidth = StyleWidth | [StyleWidth?, StyleWidth?, StyleWidth?];
21
+ export type ResponsiveStyleFlexDirection = StyleFlexDirection | [StyleFlexDirection?, StyleFlexDirection?, StyleFlexDirection?];
22
+ export type ResponsiveStyleFlexWrap = StyleFlexWrap | [StyleFlexWrap?, StyleFlexWrap?, StyleFlexWrap?];
23
23
  export interface BoxProps {
24
24
  className?: string;
25
25
  as?: React.ElementType;
@@ -50,7 +50,7 @@ export interface BoxProps {
50
50
  flexDirection?: ResponsiveStyleFlexDirection;
51
51
  flexWrap?: ResponsiveStyleFlexWrap;
52
52
  }
53
- declare type ResponsiveProp = string | [string?, string?, string?];
53
+ type ResponsiveProp = string | [string?, string?, string?];
54
54
  export declare function responsiveProp(prefix: string, prop: ResponsiveProp): string[];
55
- export declare const Box: ({ as: Component, children, contrast, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingX, paddingY, padding, marginTop, marginRight, marginBottom, marginLeft, marginX, marginY, margin, display, justifyContent, alignItems, maxWidth, width, background, color, flexDirection, flexWrap, className, ...rest }: BoxProps) => JSX.Element;
55
+ export declare const Box: ({ as: Component, children, contrast, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingX, paddingY, padding, marginTop, marginRight, marginBottom, marginLeft, marginX, marginY, margin, display, justifyContent, alignItems, maxWidth, width, background, color, flexDirection, flexWrap, className, ...rest }: BoxProps) => React.JSX.Element;
56
56
  export {};
@@ -22,6 +22,6 @@ interface DefaultConfirmModalHandler extends BaseConfirmModalProps {
22
22
  cancel: string;
23
23
  };
24
24
  }
25
- export declare type ConfirmModalProps = CustomConfirmModalButtons | DefaultConfirmModalHandler;
25
+ export type ConfirmModalProps = CustomConfirmModalButtons | DefaultConfirmModalHandler;
26
26
  export declare const ConfirmModal: FC<ConfirmModalProps>;
27
27
  export {};
@@ -1,15 +1,15 @@
1
1
  import React, { ReactNode, Component, ErrorInfo } from 'react';
2
- declare type FallbackOptions = {
2
+ type FallbackOptions = {
3
3
  retry: () => void;
4
4
  error: Error;
5
5
  };
6
- declare type RenderProp = (options: FallbackOptions) => ReactNode;
7
- declare type Props = {
6
+ type RenderProp = (options: FallbackOptions) => ReactNode;
7
+ type Props = {
8
8
  handleError?: (error: Error, errorInfo: ErrorInfo) => void;
9
9
  fallback: ReactNode | RenderProp;
10
10
  children: ReactNode;
11
11
  };
12
- declare type State = {
12
+ type State = {
13
13
  error: null | Error;
14
14
  };
15
15
  export declare class ErrorBoundary extends Component<Props, State> {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { VariantType } from '@entur/form';
3
3
  import { LanguageKey, LanguageOption } from './LanguageSelect';
4
- export declare type MultiLanguageValues = Record<LanguageKey, string>;
5
- declare type ExpandableMultiLanguageInputProps = {
4
+ export type MultiLanguageValues = Record<LanguageKey, string>;
5
+ type ExpandableMultiLanguageInputProps = {
6
6
  title: string;
7
7
  inputComponent: React.ElementType;
8
8
  languages: LanguageOption[];
@@ -13,5 +13,5 @@ declare type ExpandableMultiLanguageInputProps = {
13
13
  feedback?: (lang: LanguageKey) => string;
14
14
  [key: string]: any;
15
15
  };
16
- export declare const ExpandableMultiLanguageInput: ({ title, inputComponent: InputComponent, languages, values, onChange, name, variant, feedback, ...rest }: ExpandableMultiLanguageInputProps) => JSX.Element;
16
+ export declare const ExpandableMultiLanguageInput: ({ title, inputComponent: InputComponent, languages, values, onChange, name, variant, feedback, ...rest }: ExpandableMultiLanguageInputProps) => React.JSX.Element;
17
17
  export {};
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  /**
3
3
  * Returns true if the provided flag exist in localStorage
4
4
  * or is set as an environment variable.
@@ -22,4 +22,4 @@ export interface FeatureToggleProps {
22
22
  * you can drop the REACT_APP_ prefix. */
23
23
  flag: string;
24
24
  }
25
- export declare const FeatureToggle: ({ children, flag }: FeatureToggleProps) => JSX.Element | null;
25
+ export declare const FeatureToggle: ({ children, flag }: FeatureToggleProps) => React.JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import './LanguageSelect.scss';
2
2
  import { FC } from 'react';
3
- export declare type LanguageKey = 'nob' | 'nno' | 'eng';
3
+ export type LanguageKey = 'nob' | 'nno' | 'eng';
4
4
  export interface LanguageOption {
5
5
  value: LanguageKey;
6
6
  label: string;
@@ -1,8 +1,8 @@
1
1
  import './LinkButton.scss';
2
- import { ReactNode } from 'react';
2
+ import React, { ReactNode } from 'react';
3
3
  export interface LinkButtonProps {
4
4
  children: ReactNode;
5
5
  className?: string;
6
6
  [key: string]: any;
7
7
  }
8
- export declare const LinkButton: ({ children, className, ...rest }: LinkButtonProps) => JSX.Element;
8
+ export declare const LinkButton: ({ children, className, ...rest }: LinkButtonProps) => React.JSX.Element;
@@ -2,7 +2,7 @@ import './MultiLanguageInput.scss';
2
2
  import React, { FC, FocusEvent } from 'react';
3
3
  import { VariantType } from '@entur/form';
4
4
  import { LanguageOption } from './LanguageSelect';
5
- declare type Values = {
5
+ type Values = {
6
6
  [key: string]: string;
7
7
  };
8
8
  export interface MultiLanguageInputProps {
@@ -1,4 +1,5 @@
1
- declare type Props = {
1
+ import React from 'react';
2
+ type Props = {
2
3
  readonly pathname: string;
3
4
  readonly onBreadcrumbLookup: (path: string) => string | undefined;
4
5
  };
@@ -10,5 +11,5 @@ declare type Props = {
10
11
  * @param Props.onBreadcrumbLookup - A function that takes a path and returns a i18n translated string or undefined
11
12
  * @returns A Helmet component with updated title
12
13
  */
13
- export declare function PageTitle({ pathname, onBreadcrumbLookup }: Props): JSX.Element;
14
+ export declare function PageTitle({ pathname, onBreadcrumbLookup }: Props): React.JSX.Element;
14
15
  export {};
package/dist/Stack.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { ResponsiveStyleSpacing } from './Box';
3
3
  export interface StackProps {
4
4
  className?: string;
5
5
  children: ReactNode;
6
6
  space: ResponsiveStyleSpacing;
7
7
  }
8
- export declare const Stack: ({ children, space, className }: StackProps) => JSX.Element;
8
+ export declare const Stack: ({ children, space, className }: StackProps) => React.JSX.Element;
package/dist/Text.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import './Text.scss';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { StyleColor } from './Box';
4
- declare type StyleFontSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4';
5
- declare type StyleFontWeight = 'body' | 'heading';
6
- declare type StyleLineHeight = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'extraLarge7';
7
- export declare type ResponsiveStyleFontSize = StyleFontSize | [StyleFontSize?, StyleFontSize?, StyleFontSize?];
8
- export declare type ResponsiveStyleLineHeight = StyleLineHeight | [StyleLineHeight?, StyleLineHeight?, StyleLineHeight?];
4
+ type StyleFontSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4';
5
+ type StyleFontWeight = 'body' | 'heading';
6
+ type StyleLineHeight = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'extraLarge7';
7
+ export type ResponsiveStyleFontSize = StyleFontSize | [StyleFontSize?, StyleFontSize?, StyleFontSize?];
8
+ export type ResponsiveStyleLineHeight = StyleLineHeight | [StyleLineHeight?, StyleLineHeight?, StyleLineHeight?];
9
9
  export interface TextProps {
10
10
  className?: string;
11
11
  as?: React.ElementType;
@@ -16,5 +16,5 @@ export interface TextProps {
16
16
  fontWeight?: StyleFontWeight;
17
17
  [key: string]: any;
18
18
  }
19
- export declare const Text: ({ as: component, children, fontSize, color, lineHeight, fontWeight, className, ...rest }: TextProps) => JSX.Element;
19
+ export declare const Text: ({ as: component, children, fontSize, color, lineHeight, fontWeight, className, ...rest }: TextProps) => React.JSX.Element;
20
20
  export {};