@oslokommune/punkt-react 15.3.1 → 15.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/CHANGELOG.md CHANGED
@@ -5,6 +5,32 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [15.4.0](https://github.com/oslokommune/punkt/compare/15.3.1...15.4.0) (2026-02-20)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ * Fileupload - forbedre preview/demo, format-håndtering og layout(#3260). - Fjern mock items i FileUpload-preview – brukeren laster nå opp egne filer
15
+ - Synk demo/preview tettere med ekte komponent-defaults
16
+ - Normaliser allowedFormats og synk visning av filformater i dropzone
17
+ - Forbedre thumbnail-preview og åpning i docs (form/custom)
18
+ - Sørg for at FileUpload-items forholder seg til container
19
+ - Fiks fullWidth, imageWrapper-sentrering og helpText-visning
20
+ - Betinget visning av props (showIf) og skjul demo-spesifikke props i SpecList
21
+ - Utvid PreviewTypes og forbedre struktur for kodeeksempler
22
+ - Rydd opp i ubrukt kode og eksporter typer korrekt fra React-pakken
23
+
24
+
25
+ ### Bug Fixes
26
+ Ingen
27
+
28
+ ### Chores
29
+ Ingen
30
+
31
+ ---
32
+
33
+
8
34
  ## [15.3.0](https://github.com/oslokommune/punkt/compare/15.2.1...15.3.0) (2026-02-19)
9
35
 
10
36
  ### ⚠ BREAKING CHANGES
package/dist/index.d.ts CHANGED
@@ -80,7 +80,7 @@ declare type ExtendedProgressbar = IPktProgressbar_2 & PktElType;
80
80
  * - A `fileId` is generated automatically if omitted.
81
81
  * - `attributes.targetFilename` is the filename shown in the queue and may be updated by extensions (e.g. rename).
82
82
  */
83
- declare class FileItem implements FileItem {
83
+ export declare class FileItem implements FileItem {
84
84
  fileId: TFileId;
85
85
  file: File;
86
86
  attributes: Record<string, any>;
@@ -857,7 +857,7 @@ declare interface ITableRowProps extends HTMLAttributes<HTMLTableRowElement> {
857
857
  children: ReactNode;
858
858
  }
859
859
 
860
- declare const ItemRenderers: Record<string, TItemRenderer>;
860
+ export declare const ItemRenderers: Record<string, TItemRenderer>;
861
861
 
862
862
  declare interface Link {
863
863
  href: string;
@@ -872,7 +872,7 @@ export declare const PktAccordionItem: ForwardRefExoticComponent<IPktAccordionIt
872
872
 
873
873
  export declare const PktAlert: FC<IPktAlert>;
874
874
 
875
- export declare const PktBackLink: default_2.ForwardRefExoticComponent<IPktBackLink>;
875
+ export declare const PktBackLink: ForwardRefExoticComponent<IPktBackLink>;
876
876
 
877
877
  export declare const PktBreadcrumbs: ForwardRefExoticComponent<IPktBreadcrumbs & RefAttributes<HTMLAnchorElement>>;
878
878
 
@@ -1032,20 +1032,20 @@ declare type TCardPadding = 'none' | 'default';
1032
1032
 
1033
1033
  declare type TCardTagPosition = 'top' | 'bottom';
1034
1034
 
1035
- declare type TFileAndTransfer = FileItem & Pick<TFileTransfer, 'progress' | 'errorMessage' | 'showProgress' | 'lastProgress'>;
1035
+ export declare type TFileAndTransfer = FileItem & Pick<TFileTransfer, 'progress' | 'errorMessage' | 'showProgress' | 'lastProgress'>;
1036
1036
 
1037
- declare type TFileAttribute<T> = {
1037
+ export declare type TFileAttribute<T> = {
1038
1038
  get: (fileId: TFileId) => T | undefined;
1039
1039
  set: (fileId: TFileId, attributeValue: T | undefined) => void;
1040
1040
  };
1041
1041
 
1042
- declare type TFileAttributes = <T>(attributeName: string) => TFileAttribute<T>;
1042
+ export declare type TFileAttributes = <T>(attributeName: string) => TFileAttribute<T>;
1043
1043
 
1044
1044
  /** Unique identifier assigned to each selected file. */
1045
- declare type TFileId = string;
1045
+ export declare type TFileId = string;
1046
1046
 
1047
1047
  /** The value type for `PktFileUpload` (`value` / `defaultValue`). */
1048
- declare type TFileItemList = Array<FileItem>;
1048
+ export declare type TFileItemList = Array<FileItem>;
1049
1049
 
1050
1050
  /**
1051
1051
  * Transfer status for a file when using `uploadStrategy="custom"`.
@@ -1054,7 +1054,7 @@ declare type TFileItemList = Array<FileItem>;
1054
1054
  * - `showProgress`: if false, UI uses indeterminate "Laster opp..." style instead of progress bar
1055
1055
  * - `lastProgress`: used to render a "failed at X%" bar when an upload errors
1056
1056
  */
1057
- declare type TFileTransfer = {
1057
+ export declare type TFileTransfer = {
1058
1058
  fileId: TFileId;
1059
1059
  progress: number | 'done' | 'error' | 'canceled' | 'queued';
1060
1060
  errorMessage?: string;
@@ -1067,7 +1067,7 @@ declare type TFileTransfer = {
1067
1067
  *
1068
1068
  * Must return a renderable React element (or `null`).
1069
1069
  */
1070
- declare type TItemRenderer = (props: {
1070
+ export declare type TItemRenderer = (props: {
1071
1071
  transferItem: TFileAndTransfer;
1072
1072
  queueItemOperations: Array<TQueueItemOperation>;
1073
1073
  onPreviewClick?: () => void;
@@ -1078,7 +1078,7 @@ declare type TPktAccordionSkin = TAccordionSkin;
1078
1078
  declare type TPktAccordionSkin_2 = TAccordionSkin;
1079
1079
 
1080
1080
  /** Factory that produces a queue item operation given access to file attributes. */
1081
- declare type TQueueItemExtension = (attributes: TFileAttributes) => TQueueItemOperation;
1081
+ export declare type TQueueItemExtension = (attributes: TFileAttributes) => TQueueItemOperation;
1082
1082
 
1083
1083
  /**
1084
1084
  * An operation that can be attached to a queue item (rename, comment, remove, etc).
@@ -1089,7 +1089,7 @@ declare type TQueueItemExtension = (attributes: TFileAttributes) => TQueueItemOp
1089
1089
  * - render extended UI (e.g. comments)
1090
1090
  * - render hidden inputs for form submission (`renderHidden`)
1091
1091
  */
1092
- declare type TQueueItemOperation = {
1092
+ export declare type TQueueItemOperation = {
1093
1093
  title: string | ((fileItem: FileItem) => string);
1094
1094
  ariaLabel?: string | ((fileItem: FileItem) => string);
1095
1095
  onClick?: (transferItem: FileItem) => void;
@@ -1106,8 +1106,12 @@ declare type TSkin_2 = IPktTag['skin'];
1106
1106
 
1107
1107
  declare type TStepStatus = 'completed' | 'incomplete' | 'current';
1108
1108
 
1109
+ export declare type TTransferItemInProgress = TFileAndTransfer & {
1110
+ progress: number;
1111
+ };
1112
+
1109
1113
  /** Upload mode: `form` posts the files on submit, `custom` posts file IDs and uploads separately. */
1110
- declare type TUploadStrategy = 'custom' | 'form';
1114
+ export declare type TUploadStrategy = 'custom' | 'form';
1111
1115
 
1112
1116
  /** User object for header components */
1113
1117
  declare interface User {