@kystverket/styrbord 1.3.39 → 1.4.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.
- package/README.md +14 -0
- package/dist/src/components/kystverket/FileUploader/FileUploader.d.ts +1 -13
- package/dist/src/components/kystverket/FileUploader/FileUploader.stories.d.ts +0 -2
- package/dist/src/components/kystverket/FileUploader/FileUploaderTranslations.stories.d.ts +13 -0
- package/dist/src/components/kystverket/FileUploader/fileUploadActions/FileUploadActions.d.ts +2 -2
- package/dist/src/main.d.ts +0 -1
- package/dist/src/translations.d.ts +5 -0
- package/dist/style.js +2831 -2863
- package/dist/style.umd.cjs +7 -10
- package/package.json +1 -1
- package/dist/src/components/kystverket/StyrbordTranslationContext/StyrbordTranslationContext.stories.d.ts +0 -14
- package/dist/src/i18n/translations.d.ts +0 -10
package/README.md
CHANGED
|
@@ -41,6 +41,20 @@ Styrbords design tokens hentes fra [@Kystverket/styrbord-tokens](https://github.
|
|
|
41
41
|
|
|
42
42
|
## Endringslogg
|
|
43
43
|
|
|
44
|
+
### 2026-03-10 -- v1.4.0
|
|
45
|
+
|
|
46
|
+
Endret fra StyrbordTranslationContext til å bruke @kystverket/sprak-react.
|
|
47
|
+
|
|
48
|
+
Internt i Styrbord-komponenter kan man bruke følgende for å hente oversettelsesfunksjonen.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import { useStyrbordTranslation } from '~/translations';
|
|
52
|
+
...
|
|
53
|
+
const { t } = useTranslation();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Applikasjoner som bruker Styrbord må wrappe alt med både `<SprakProvider>` (for å velge språk) og `<StyrbordTranslations>` (for å hente oversettelsene til Styrbord).
|
|
57
|
+
|
|
44
58
|
### 2026-01-13 -- v1.3.0
|
|
45
59
|
|
|
46
60
|
#### Knekkende endring
|
|
@@ -19,21 +19,9 @@ export interface FileUploaderProps {
|
|
|
19
19
|
maxSizeInBytes?: number;
|
|
20
20
|
onChange: (files: FileInfo[]) => void;
|
|
21
21
|
allowedFileTypes?: string[];
|
|
22
|
-
/** @deprecated Use translations instead. */
|
|
23
|
-
buttonLabel?: string;
|
|
24
22
|
required?: boolean | string;
|
|
25
23
|
optional?: boolean | string;
|
|
26
|
-
translations?: {
|
|
27
|
-
existingFiles?: {
|
|
28
|
-
buttonOpen?: string;
|
|
29
|
-
dialogTitle?: string;
|
|
30
|
-
dialogCancel?: string;
|
|
31
|
-
dialogConfirm?: string;
|
|
32
|
-
noFilesAvailable?: string;
|
|
33
|
-
};
|
|
34
|
-
buttonLabel?: string;
|
|
35
|
-
};
|
|
36
24
|
existingFilesProvider?: () => Promise<ExistingFilesProviderItem[]>;
|
|
37
25
|
variant?: 'dropzone' | 'buttons';
|
|
38
26
|
}
|
|
39
|
-
export declare const FileUploader: ({ label, maxSizeInBytes, required, optional, description, error, multiple, files,
|
|
27
|
+
export declare const FileUploader: ({ label, maxSizeInBytes, required, optional, description, error, multiple, files, maxFiles, onChange, allowedFileTypes, existingFilesProvider, variant, }: FileUploaderProps) => React.JSX.Element;
|
|
@@ -18,8 +18,6 @@ export declare const Dropzone: Story;
|
|
|
18
18
|
export declare const DropzoneWithExistingFiles: Story;
|
|
19
19
|
export declare const WithError: Story;
|
|
20
20
|
export declare const WithExistingFiles: Story;
|
|
21
|
-
export declare const WithExistingFilesWithTranslations: Story;
|
|
22
21
|
export declare const withFileSizeLimit: Story;
|
|
23
|
-
export declare const WithFileSizeLimitEnglish: Story;
|
|
24
22
|
export declare const withAllowedFileTypes: Story;
|
|
25
23
|
export declare const withFileScanFailed: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FileUploaderProps } from './FileUploader';
|
|
3
|
+
import { PartialStoryFn } from 'storybook/internal/types';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: (props: FileUploaderProps) => React.JSX.Element;
|
|
7
|
+
decorators: ((Story: PartialStoryFn) => React.JSX.Element)[];
|
|
8
|
+
tags: string[];
|
|
9
|
+
argTypes: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const WithExistingFilesWithTranslations: Story;
|
package/dist/src/components/kystverket/FileUploader/fileUploadActions/FileUploadActions.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ type FileUploadActionsProps = {
|
|
|
5
5
|
dialogRef: React.RefObject<ExistingFilesDialogHandle | null>;
|
|
6
6
|
t: (key: string) => string;
|
|
7
7
|
onUploadFile: (uploadedFiles: File[]) => void;
|
|
8
|
-
} & Pick<FileUploaderProps, 'variant' | 'existingFilesProvider'
|
|
9
|
-
export declare function FileUploadActions({ variant, fileInputRef,
|
|
8
|
+
} & Pick<FileUploaderProps, 'variant' | 'existingFilesProvider'>;
|
|
9
|
+
export declare function FileUploadActions({ variant, fileInputRef, onUploadFile, existingFilesProvider, dialogRef, t, }: FileUploadActionsProps): React.JSX.Element;
|
|
10
10
|
export {};
|
package/dist/src/main.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ export { FileUploader, type FileUploaderProps, type ExistingFilesProviderItem, }
|
|
|
40
40
|
export { FileUploaderContext, type FileUploaderContextProps, } from './components/kystverket/FileUploader/FileUploader.context';
|
|
41
41
|
export type * from './components/kystverket/FileUploader/FileUploader.types';
|
|
42
42
|
export { default as CardTitle, type CardTitleProps } from './components/designsystemet/CardTitle/CardTitle';
|
|
43
|
-
export { StyrbordTranslationContext } from './i18n/translations';
|
|
44
43
|
export { Button } from './components/designsystemet/Button/Button';
|
|
45
44
|
export type { ButtonProps } from './components/designsystemet/Button/Button';
|
|
46
45
|
export { TextInput } from './components/designsystemet/TextInput/TextInput';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const STYRBORD_TRANSLATIONS_NAMESPACE = "styrbord";
|
|
2
|
+
export declare const StyrbordTranslations: (props: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}) => React.JSX.Element;
|
|
5
|
+
export declare const useTranslation: () => import("@kystverket/sprak-react").UseTranslationResult;
|