@oslokommune/punkt-react 19.3.0 → 19.3.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.
- package/CHANGELOG.md +8 -0
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/datepicker/types.d.ts +1 -1
- package/dist/components/fileupload/extensions/Comments.d.ts +2 -1
- package/dist/components/fileupload/extensions/Remove.d.ts +2 -1
- package/dist/components/fileupload/extensions/Rename.d.ts +2 -1
- package/dist/components/fileupload/hooks/index.d.ts +1 -0
- package/dist/components/fileupload/hooks/useImageObjectUrl.d.ts +1 -0
- package/dist/components/fileupload/hooks.d.ts +1 -0
- package/dist/components/fileupload/types.d.ts +2 -0
- package/dist/components/header-menu/HeaderMenu.d.ts +3 -2
- package/dist/components/messagebox/Messagebox.d.ts +2 -1
- package/dist/components/modal/Modal.d.ts +2 -1
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +1981 -1954
- package/dist/shared-strings/nb.d.ts +34 -0
- package/package.json +2 -2
- package/src/components/alert/Alert.test.tsx +5 -5
- package/src/components/alert/Alert.tsx +2 -4
- package/src/components/breadcrumbs/Breadcrumbs.tsx +15 -12
- package/src/components/calendar/Calendar.core.test.tsx +22 -16
- package/src/components/calendar/CalendarNav.tsx +11 -6
- package/src/components/calendar/useCalendarState.ts +42 -55
- package/src/components/card/Card.tsx +17 -5
- package/src/components/combobox/ComboboxTags.tsx +3 -3
- package/src/components/combobox/Listbox.tsx +7 -5
- package/src/components/combobox/useComboboxState.ts +22 -18
- package/src/components/consent/Consent.tsx +4 -1
- package/src/components/datepicker/DatepickerInputs.tsx +3 -9
- package/src/components/datepicker/types.ts +1 -1
- package/src/components/datepicker/useDatepickerState.ts +22 -17
- package/src/components/fileupload/DropZone.tsx +10 -10
- package/src/components/fileupload/FileUpload.tsx +9 -14
- package/src/components/fileupload/Subcomponents.tsx +78 -84
- package/src/components/fileupload/extensions/Comments.tsx +56 -50
- package/src/components/fileupload/extensions/Remove.tsx +8 -3
- package/src/components/fileupload/extensions/Rename.tsx +12 -8
- package/src/components/fileupload/hooks/index.ts +1 -0
- package/src/components/fileupload/hooks/useImageObjectUrl.ts +15 -0
- package/src/components/fileupload/hooks/useOperationState.ts +9 -16
- package/src/components/fileupload/hooks.ts +1 -0
- package/src/components/fileupload/types.ts +7 -1
- package/src/components/formAttribute.test.tsx +1 -0
- package/src/components/header/HeaderGlobal.tsx +8 -2
- package/src/components/header/HeaderService.test.tsx +5 -2
- package/src/components/header/HeaderService.tsx +5 -5
- package/src/components/header-menu/HeaderMenu.tsx +8 -3
- package/src/components/headerUserMenu/UserMenu.tsx +3 -2
- package/src/components/inputwrapper/InputWrapper.tsx +20 -27
- package/src/components/loader/Loader.tsx +12 -9
- package/src/components/messagebox/Messagebox.tsx +6 -2
- package/src/components/modal/Modal.tsx +13 -9
- package/src/components/searchinput/SearchInput.tsx +10 -6
- package/src/components/tabs/Tabs.test.tsx +1 -1
- package/src/components/tabs/Tabs.tsx +30 -35
- package/src/components/tag/Tag.tsx +7 -6
- package/src/components/textarea/Textarea.test.tsx +9 -0
- package/src/components/textarea/Textarea.tsx +6 -10
- package/src/components/textinput/Textinput.tsx +3 -9
- package/src/components/timepicker/useTimepickerState.ts +25 -21
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [19.3.1](https://github.com/oslokommune/punkt/compare/19.3.0...19.3.1) (2026-09-29)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
* Ryddesjau på shared-string og linting-varsler (#3679).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
8
16
|
## [19.3.0](https://github.com/oslokommune/punkt/compare/19.2.0...19.3.0) (2026-09-29)
|
|
9
17
|
|
|
10
18
|
---
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { IPktStringsProps } from '../../shared-strings';
|
|
2
3
|
import { IPktCardBase, TCardSkin, TLayout } from '../../shared-types';
|
|
3
4
|
export type { TCardSkin, TLayout };
|
|
4
|
-
export interface IPktCard extends IPktCardBase, Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
5
|
+
export interface IPktCard extends IPktCardBase, Omit<HTMLAttributes<HTMLElement>, 'title'>, IPktStringsProps<'card'> {
|
|
5
6
|
children?: ReactNode;
|
|
6
7
|
ref?: Ref<HTMLElement>;
|
|
7
8
|
}
|
|
@@ -92,7 +92,7 @@ export interface IDatepickerState {
|
|
|
92
92
|
isInputDisabled: boolean;
|
|
93
93
|
hasCounter: boolean;
|
|
94
94
|
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
95
|
-
|
|
95
|
+
inputToRef: React.RefObject<HTMLInputElement | null>;
|
|
96
96
|
changeInputRef: React.RefObject<HTMLInputElement | null>;
|
|
97
97
|
btnRef: React.RefObject<HTMLButtonElement | null>;
|
|
98
98
|
wrapperRef: React.RefObject<HTMLDivElement | null>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { TPktStrings } from '../../../shared-strings';
|
|
1
2
|
import { TQueueItemOperation } from '../types';
|
|
2
3
|
export interface IComment {
|
|
3
4
|
text: string;
|
|
4
5
|
timestamp: string;
|
|
5
6
|
}
|
|
6
|
-
export declare const addCommentOperation: TQueueItemOperation;
|
|
7
|
+
export declare const addCommentOperation: (strings: TPktStrings["fileupload"]) => TQueueItemOperation;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { TPktStrings } from '../../../shared-strings';
|
|
1
2
|
import { TFileId, TQueueItemOperation } from '../types';
|
|
2
|
-
export declare const removeFileOperation: (onFileRemoved: (fileId: TFileId) => void) => TQueueItemOperation;
|
|
3
|
+
export declare const removeFileOperation: (onFileRemoved: (fileId: TFileId) => void, strings: TPktStrings["fileupload"]) => TQueueItemOperation;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { TPktStrings } from '../../../shared-strings';
|
|
1
2
|
import { TQueueItemOperation } from '../types';
|
|
2
|
-
export declare const renameFileOperation: TQueueItemOperation;
|
|
3
|
+
export declare const renameFileOperation: (strings: TPktStrings["fileupload"]) => TQueueItemOperation;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useFileAttributes } from './useFileAttributes';
|
|
2
2
|
export { useImagePreview } from './useImagePreview';
|
|
3
|
+
export { useImageObjectUrl } from './useImageObjectUrl';
|
|
3
4
|
export { useOperationState } from './useOperationState';
|
|
4
5
|
export { useRequiredFormValidation } from './useRequiredFormValidation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useImageObjectUrl: (file: File | undefined) => string | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useFileAttributes } from './hooks/useFileAttributes';
|
|
2
2
|
export { useImagePreview } from './hooks/useImagePreview';
|
|
3
|
+
export { useImageObjectUrl } from './hooks/useImageObjectUrl';
|
|
3
4
|
export { useOperationState } from './hooks/useOperationState';
|
|
4
5
|
export { useRequiredFormValidation } from './hooks/useRequiredFormValidation';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { IFileItem, IFileTransfer, IFileValidateDetail, TFileUploadStrategy, TTransferProgress } from '../../shared-types';
|
|
3
|
+
import { TPktStrings } from '../../shared-strings';
|
|
3
4
|
/** Unique identifier assigned to each selected file. */
|
|
4
5
|
export type TFileId = string;
|
|
5
6
|
/**
|
|
@@ -24,6 +25,7 @@ export type TPktFileUploadContext = {
|
|
|
24
25
|
name?: string;
|
|
25
26
|
multiple: boolean;
|
|
26
27
|
id?: string;
|
|
28
|
+
strings: TPktStrings['fileupload'];
|
|
27
29
|
};
|
|
28
30
|
export declare const PktFileUploadContext: import('react').Context<TPktFileUploadContext>;
|
|
29
31
|
/** The value type for `PktFileUpload` (`value` / `defaultValue`). */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { IHeaderMenuButton, IHeaderMenuLink, IHeaderMenuSection, IHeaderMenuServices, IPktHeaderMenu as ISharedPktHeaderMenu, THeaderFooterApi, THeaderMenuLocale } from '../../shared-types';
|
|
3
|
+
import { IPktStringsProps } from '../../shared-strings';
|
|
3
4
|
export type { THeaderFooterApi, THeaderMenuLocale, IHeaderMenuLink, IHeaderMenuButton, IHeaderMenuSection, IHeaderMenuServices, };
|
|
4
|
-
export interface IPktHeaderMenu extends Omit<HTMLAttributes<HTMLElement>, 'onError'>, ISharedPktHeaderMenu {
|
|
5
|
+
export interface IPktHeaderMenu extends Omit<HTMLAttributes<HTMLElement>, 'onError'>, ISharedPktHeaderMenu, IPktStringsProps<'header'> {
|
|
5
6
|
/** Forwarded to the host element. */
|
|
6
7
|
ref?: Ref<HTMLElement>;
|
|
7
8
|
/** Fired when the payload has been fetched (or `data` was supplied). */
|
|
@@ -21,4 +22,4 @@ export interface IPktHeaderMenu extends Omit<HTMLAttributes<HTMLElement>, 'onErr
|
|
|
21
22
|
* the parent header is expected to control `open` and own focus
|
|
22
23
|
* management.
|
|
23
24
|
*/
|
|
24
|
-
export declare const PktHeaderMenu: ({ dataUrl, data, locale, open, mobileBreakpoint, className, onDataLoaded, onDataError, ref, ...rest }: IPktHeaderMenu) => import("react").JSX.Element;
|
|
25
|
+
export declare const PktHeaderMenu: ({ dataUrl, data, locale, open, mobileBreakpoint, className, onDataLoaded, onDataError, ref, strings, ...rest }: IPktHeaderMenu) => import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { IPktStringsProps } from '../../shared-strings';
|
|
2
3
|
import { TMessageboxSkin } from '../../shared-types';
|
|
3
4
|
export type { TMessageboxSkin };
|
|
4
|
-
export interface IPktMessagebox extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
export interface IPktMessagebox extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, IPktStringsProps<'generic'> {
|
|
5
6
|
skin?: TMessageboxSkin;
|
|
6
7
|
title?: ReactNode;
|
|
7
8
|
compact?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
-
|
|
2
|
+
import { IPktStringsProps } from '../../shared-strings';
|
|
3
|
+
export interface IPktModal extends Omit<HTMLAttributes<HTMLDialogElement>, 'onClose' | 'open'>, IPktStringsProps<'generic'> {
|
|
3
4
|
open?: boolean;
|
|
4
5
|
headingText?: string;
|
|
5
6
|
hideCloseButton?: boolean;
|