@kystverket/styrbord 1.2.9 → 1.3.0

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.
@@ -12,5 +12,15 @@ export interface FileUploaderProps {
12
12
  allowedFileTypes?: string[];
13
13
  required?: boolean | string;
14
14
  optional?: boolean | string;
15
+ existingFilesConfig?: {
16
+ files: FileInfo[];
17
+ translations?: {
18
+ buttonOpen?: string;
19
+ dialogTitle?: string;
20
+ dialogCancel?: string;
21
+ dialogConfirm?: string;
22
+ noFilesAvailable?: string;
23
+ };
24
+ };
15
25
  }
16
- export declare const FileUploader: ({ label, required, optional, buttonLabel, description, error, multiple, files, maxFiles, onChange, allowedFileTypes, }: FileUploaderProps) => React.JSX.Element;
26
+ export declare const FileUploader: ({ label, required, optional, buttonLabel, description, error, multiple, files, maxFiles, onChange, allowedFileTypes, existingFilesConfig, }: FileUploaderProps) => React.JSX.Element;
@@ -15,3 +15,4 @@ export declare const OptionalText: Story;
15
15
  export declare const Required: Story;
16
16
  export declare const RequiredText: Story;
17
17
  export declare const WithError: Story;
18
+ export declare const WithExistingFiles: Story;
@@ -4,6 +4,7 @@ export type FileInfo = {
4
4
  fileName: string;
5
5
  storageId?: string;
6
6
  contentType: string;
7
+ thumbnailUri?: string;
7
8
  status: FileStatus;
8
9
  exif?: Exif;
9
10
  error?: string;
@@ -1,16 +1,14 @@
1
- import { SupportedLanguage } from '~/utils/types';
2
1
  import { ReactNode } from 'react';
3
2
  interface LinkToSite {
4
3
  text: string;
5
4
  url: string;
6
5
  }
7
6
  export type FooterProps = {
8
- language: SupportedLanguage;
9
7
  additionalLogo?: ReactNode;
10
8
  text?: string;
11
9
  copyright?: string;
12
10
  contacts?: LinkToSite[];
13
11
  links?: LinkToSite[] | LinkToSite[][];
14
12
  };
15
- export declare function Footer({ language, additionalLogo, text, copyright, contacts, links, }: FooterProps): React.JSX.Element;
13
+ export declare function Footer({ additionalLogo, text, copyright, contacts, links, }: FooterProps): React.JSX.Element;
16
14
  export {};
@@ -1,4 +1,4 @@
1
- import { LogoVariant, SupportedLanguage } from '~/main';
1
+ import { LogoVariant } from '~/main';
2
2
  import { ReactNode } from 'react';
3
3
  import { IconId } from '../Icon/icon.types';
4
4
  export type HeaderLinkComponentProps = {
@@ -13,10 +13,6 @@ export interface HeaderProps {
13
13
  * @default undefined
14
14
  */
15
15
  children?: ReactNode;
16
- /**
17
- * Spesifiserer språk for headeren.
18
- */
19
- language: SupportedLanguage;
20
16
  /**
21
17
  * Spesifiserer logovarianten som brukes (standard: Kystverket) med en eventuell ekstra undertittel og navigeringslenke ved klikk
22
18
  */
@@ -91,4 +87,4 @@ export interface HeaderProps {
91
87
  };
92
88
  linkComponent?: React.FC<HeaderLinkComponentProps>;
93
89
  }
94
- export declare function Header({ children, language, logo: { title, variant, url }, links, profile, linkComponent: LinkComponent, }: HeaderProps): React.JSX.Element;
90
+ export declare function Header({ children, logo: { title, variant, url }, links, profile, linkComponent: LinkComponent, }: HeaderProps): React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import type { StoryObj } from '@storybook/react';
2
2
  import { Header } from './Header';
3
- import { SupportedLanguage } from '~/main';
4
3
  declare const meta: {
5
4
  title: string;
6
5
  component: typeof Header;
@@ -12,12 +11,6 @@ declare const meta: {
12
11
  type: "object";
13
12
  };
14
13
  };
15
- language: {
16
- control: {
17
- type: "select";
18
- options: SupportedLanguage[];
19
- };
20
- };
21
14
  logo: {
22
15
  control: {
23
16
  type: "object";
@@ -0,0 +1,14 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { BoxProps } from '~/main';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ className, radius, width, gap, wrap, align, grow, shrink, basis, show, hide, container, children, ...props }: BoxProps) => React.JSX.Element;
6
+ decorators: ((Story: import("@storybook/types").PartialStoryFn) => React.JSX.Element)[];
7
+ tags: string[];
8
+ argTypes: {};
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Norsk: Story;
13
+ export declare const Nynorsk: Story;
14
+ export declare const Engelsk: Story;
@@ -1,2 +1,10 @@
1
1
  import { SupportedLanguage } from '~/utils/types';
2
- export declare function useTranslation(language: SupportedLanguage): (key: string) => string;
2
+ export interface TranslationContextProps {
3
+ language: SupportedLanguage;
4
+ }
5
+ export declare const StyrbordTranslationContext: React.Context<TranslationContextProps>;
6
+ export declare const useStyrbordTranslation: () => {
7
+ language: "nb-NO" | "nn-NO" | "en-US";
8
+ t: (key: string) => string;
9
+ at: (prefix: string | null | undefined, alternativeTranslationData: Record<string, unknown> | null | undefined, key: string) => string;
10
+ };
@@ -38,6 +38,7 @@ export { FileUploader, type FileUploaderProps } from './components/kystverket/Fi
38
38
  export { FileUploaderContext, type FileUploaderContextProps, } from './components/kystverket/FileUploader/FileUploader.context';
39
39
  export type * from './components/kystverket/FileUploader/FileUploader.types';
40
40
  export { default as CardTitle, type CardTitleProps } from './components/designsystemet/CardTitle/CardTitle';
41
+ export { StyrbordTranslationContext } from './i18n/translations';
41
42
  export { Button } from './components/designsystemet/Button/Button';
42
43
  export type { ButtonProps } from './components/designsystemet/Button/Button';
43
44
  export { TextInput } from './components/designsystemet/TextInput/TextInput';
@@ -1,2 +1,3 @@
1
1
  export type ScreenSize = 'screen-xxs' | 'screen-xs' | 'screen-sm' | 'screen-md' | 'screen-lg';
2
- export type SupportedLanguage = 'nb-NO' | 'nn-NO' | 'en-US';
2
+ export declare const supportedLanguages: readonly ["nb-NO", "nn-NO", "en-US"];
3
+ export type SupportedLanguage = (typeof supportedLanguages)[number];