@kystverket/styrbord 1.1.15 → 1.1.23

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.
@@ -328,16 +328,16 @@ export declare const Disabled: {
328
328
  list?: string | undefined | undefined;
329
329
  step?: number | string | undefined | undefined;
330
330
  src?: string | undefined | undefined;
331
- accept?: string | undefined | undefined;
332
- alt?: string | undefined | undefined;
333
- autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
334
- capture?: boolean | "user" | "environment" | undefined | undefined;
335
- checked?: boolean | undefined | undefined;
336
331
  formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
337
332
  formEncType?: string | undefined | undefined;
338
333
  formMethod?: string | undefined | undefined;
339
334
  formNoValidate?: boolean | undefined | undefined;
340
335
  formTarget?: string | undefined | undefined;
336
+ accept?: string | undefined | undefined;
337
+ alt?: string | undefined | undefined;
338
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
339
+ capture?: boolean | "user" | "environment" | undefined | undefined;
340
+ checked?: boolean | undefined | undefined;
341
341
  maxLength?: number | undefined | undefined;
342
342
  minLength?: number | undefined | undefined;
343
343
  multiple?: boolean | undefined | undefined;
@@ -643,16 +643,16 @@ export declare const Disabled: {
643
643
  list?: string | undefined | undefined;
644
644
  step?: number | string | undefined | undefined;
645
645
  src?: string | undefined | undefined;
646
- accept?: string | undefined | undefined;
647
- alt?: string | undefined | undefined;
648
- autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
649
- capture?: boolean | "user" | "environment" | undefined | undefined;
650
- checked?: boolean | undefined | undefined;
651
646
  formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
652
647
  formEncType?: string | undefined | undefined;
653
648
  formMethod?: string | undefined | undefined;
654
649
  formNoValidate?: boolean | undefined | undefined;
655
650
  formTarget?: string | undefined | undefined;
651
+ accept?: string | undefined | undefined;
652
+ alt?: string | undefined | undefined;
653
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
654
+ capture?: boolean | "user" | "environment" | undefined | undefined;
655
+ checked?: boolean | undefined | undefined;
656
656
  maxLength?: number | undefined | undefined;
657
657
  minLength?: number | undefined | undefined;
658
658
  multiple?: boolean | undefined | undefined;
@@ -958,16 +958,16 @@ export declare const Disabled: {
958
958
  list?: string | undefined | undefined;
959
959
  step?: number | string | undefined | undefined;
960
960
  src?: string | undefined | undefined;
961
- accept?: string | undefined | undefined;
962
- alt?: string | undefined | undefined;
963
- autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
964
- capture?: boolean | "user" | "environment" | undefined | undefined;
965
- checked?: boolean | undefined | undefined;
966
961
  formAction?: string | ((formData: FormData) => void | Promise<void>) | undefined;
967
962
  formEncType?: string | undefined | undefined;
968
963
  formMethod?: string | undefined | undefined;
969
964
  formNoValidate?: boolean | undefined | undefined;
970
965
  formTarget?: string | undefined | undefined;
966
+ accept?: string | undefined | undefined;
967
+ alt?: string | undefined | undefined;
968
+ autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
969
+ capture?: boolean | "user" | "environment" | undefined | undefined;
970
+ checked?: boolean | undefined | undefined;
971
971
  maxLength?: number | undefined | undefined;
972
972
  minLength?: number | undefined | undefined;
973
973
  multiple?: boolean | undefined | undefined;
@@ -0,0 +1,14 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { FilePreviewRef } from './FilePreviewer-dialog';
3
+ import { FileInfo } from './FilePreviewer.types';
4
+ export declare const FPContext: React.Context<{
5
+ files: FileInfo[];
6
+ ref: Ref<FilePreviewRef> | null;
7
+ setFiles: React.Dispatch<React.SetStateAction<FileInfo[]>>;
8
+ }>;
9
+ export interface FilePreviewerContextProps {
10
+ children?: ReactNode;
11
+ ref?: Ref<FilePreviewRef>;
12
+ files?: FileInfo[];
13
+ }
14
+ export declare const FilePreviewerContext: ({ children, ref, files }: FilePreviewerContextProps) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { FileInfo } from './FilePreviewer.types';
2
+ export type FilePreviewRef = {
3
+ close: () => void;
4
+ showModal: (idx?: number) => void;
5
+ };
6
+ export interface FilePreviewerProps {
7
+ files: FileInfo[];
8
+ startIndex?: number;
9
+ onClose?: () => void;
10
+ }
11
+ export declare const FilePreviewerDialog: React.ForwardRefExoticComponent<FilePreviewerProps & React.RefAttributes<FilePreviewRef>>;
@@ -0,0 +1,10 @@
1
+ import { FileInfo } from './FilePreviewer.types';
2
+ export interface FilePreviewerThumbnailProps {
3
+ file: FileInfo;
4
+ /**
5
+ * The index of the file in the array
6
+ * Needed if it's a child of <FilePreviewer>
7
+ */
8
+ index: number;
9
+ }
10
+ export declare const FilePreviewerThumbnail: ({ file, index }: FilePreviewerThumbnailProps) => React.JSX.Element | undefined;
@@ -0,0 +1,17 @@
1
+ import type { StoryFn } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: (({ children, ref, files }: import("~/main").FilePreviewerProps) => React.JSX.Element) & {
5
+ Thumbnail: typeof import("./FilePreviewer-thumbnail").FilePreviewerThumbnail & {
6
+ displayName?: string;
7
+ };
8
+ displayName?: string;
9
+ };
10
+ decorators: ((Story: import("@storybook/types").PartialStoryFn) => React.JSX.Element)[];
11
+ tags: string[];
12
+ argTypes: {};
13
+ };
14
+ export default meta;
15
+ export declare const withCustomAlignment: StoryFn;
16
+ export declare const withContextAndThumbnails: StoryFn;
17
+ export declare const customWithRef: StoryFn;
@@ -0,0 +1,32 @@
1
+ type ButtonOptions = {
2
+ showDownload?: boolean;
3
+ showOpenInNew?: boolean;
4
+ };
5
+ export type PdfFile = {
6
+ contentType: 'pdf';
7
+ src: string;
8
+ fileName: string;
9
+ fileSize?: string;
10
+ buttons?: ButtonOptions;
11
+ };
12
+ export type ImageFile = {
13
+ contentType: 'image';
14
+ src: string;
15
+ fileName: string;
16
+ fileSize?: string;
17
+ buttons?: ButtonOptions;
18
+ };
19
+ export type JsonFile = {
20
+ contentType: 'json';
21
+ data: Record<string, unknown>;
22
+ fileName: string;
23
+ fileSize?: string;
24
+ buttons?: ButtonOptions;
25
+ };
26
+ export declare const defaultButtonsByType: {
27
+ pdf: ButtonOptions;
28
+ image: ButtonOptions;
29
+ json: ButtonOptions;
30
+ };
31
+ export type FileInfo = PdfFile | ImageFile | JsonFile;
32
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FileInfo } from './FilePreviewer.types';
2
+ export declare const FileRenderer: ({ file, className, mode, }: {
3
+ file: FileInfo;
4
+ mode?: "thumbnail" | "full";
5
+ className?: string;
6
+ }) => React.JSX.Element | undefined;
@@ -0,0 +1,12 @@
1
+ import { FilePreviewerContext } from './FilePreviewer-context';
2
+ import { FilePreviewerThumbnail } from './FilePreviewer-thumbnail';
3
+ type FilePreviewerCompound = typeof FilePreviewerContext & {
4
+ Thumbnail: typeof FilePreviewerThumbnail & {
5
+ displayName?: string;
6
+ };
7
+ displayName?: string;
8
+ };
9
+ declare const FilePreviewer: FilePreviewerCompound;
10
+ export type { FilePreviewerContextProps as FilePreviewerProps } from './FilePreviewer-context';
11
+ export type { FilePreviewerThumbnailProps } from './FilePreviewer-thumbnail';
12
+ export { FilePreviewer };
@@ -1,2 +1,2 @@
1
- export declare const iconIdList: readonly ["add_location_alt", "add_location", "add", "adjust", "anchor", "archive", "arrow_back", "arrow_forward", "arrow_right_alt", "article", "calendar_month", "change_history", "chat", "check_circle", "check", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "content_copy", "data_table", "delete", "description", "directions_boat", "distance", "domain", "download", "edit_document", "edit_location_alt", "edit_location", "edit_square", "edit", "error", "event", "explore_nearby", "explore", "favorite", "file_map", "file_save", "format_align_center", "format_align_left", "format_align_right", "globe_uk", "inbox", "info", "keyboard_arrow_down", "keyboard_arrow_up", "layers", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail", "map_pin_heart", "map", "menu", "mode_cool", "more_vert", "move", "numbers", "open_in_new", "pending_actions", "person_add", "person_pin_circle", "person_pin", "person", "pin_drop", "radio_button_checked", "radio_button_unchecked", "sailing", "send", "settings_input_antenna", "settings", "severe_cold", "source_environment", "stylus", "timeline", "video_library", "videocam", "view_list", "warning", "zoom_in_map", "zoom_out_map"];
1
+ export declare const iconIdList: readonly ["add_location_alt", "add_location", "add", "adjust", "anchor", "archive", "arrow_back", "arrow_forward", "arrow_right_alt", "article", "calendar_month", "change_history", "chat", "check_circle", "check", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "content_copy", "data_table", "delete", "description", "directions_boat", "distance", "domain", "download", "edit_document", "edit_location_alt", "edit_location", "edit_square", "edit", "error", "event", "explore_nearby", "explore", "favorite", "file_map", "file_save", "format_align_center", "format_align_left", "format_align_right", "globe_uk", "inbox", "info", "keyboard_arrow_down", "keyboard_arrow_up", "layers", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail", "map_pin_heart", "map", "menu", "mode_cool", "more_vert", "move", "numbers", "open_in_new", "pending_actions", "person_add", "person_pin_circle", "person_pin", "person", "pin_drop", "radio_button_checked", "radio_button_unchecked", "sailing", "send", "settings_input_antenna", "settings", "severe_cold", "source_environment", "stylus", "timeline", "video_library", "videocam", "view_list", "warning", "zoom_in_map", "zoom_out_map", "picture_as_pdf", "pan_zoom"];
2
2
  export type IconId = (typeof iconIdList)[number];
@@ -0,0 +1,10 @@
1
+ export declare const useHorizontalDragScroll: () => {
2
+ scrollRef: React.RefObject<HTMLDivElement | null>;
3
+ hasMovedRef: React.RefObject<boolean>;
4
+ handlers: {
5
+ onMouseDown: (e: React.MouseEvent) => void;
6
+ onMouseMove: (e: React.MouseEvent) => void;
7
+ onMouseUp: () => void;
8
+ onMouseLeave: () => void;
9
+ };
10
+ };
@@ -5,6 +5,7 @@ export { default as DeprecatedErrorLabel, type ErrorLabelProps as DeprecatedErro
5
5
  export { default as DeprecatedInputLabel, type InputLabelProps as DeprecatedInputLabelProps, } from './components/deprecated/InputLabel/inputLabel';
6
6
  export { Details as DeprecatedDetails, type DetailsProps as DeprecatedDetailsProps, } from './components/deprecated/Details/Details';
7
7
  export { default as DeprecatedCard, type CardProps as DeprecatedCardProps } from './components/deprecated/Card/Card';
8
+ export { FilePreviewer, type FilePreviewerProps } from './components/kystverket/FilePreviewer';
8
9
  export { default as KyvDivider } from './components/kystverket/KyvDivider/kyvDivider';
9
10
  export { default as Alert } from './components/kystverket/Alert/alert';
10
11
  export type { AlertLevel } from './components/kystverket/Alert/alert.types';
@@ -0,0 +1,2 @@
1
+ import { FileInfo } from '~/components/kystverket/FilePreviewer/FilePreviewer.types';
2
+ export declare const handleDownload: (selectedFile: FileInfo) => void;