@oslokommune/punkt-react 16.25.1 → 16.26.3

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.
Files changed (156) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/components/accordion/Accordion.d.ts +21 -0
  5. package/dist/components/accordion/Accordion.test.d.ts +0 -0
  6. package/dist/components/accordion/AccordionItem.d.ts +17 -0
  7. package/dist/components/alert/Alert.d.ts +14 -0
  8. package/dist/components/alert/Alert.test.d.ts +0 -0
  9. package/dist/components/backlink/BackLink.d.ts +14 -0
  10. package/dist/components/backlink/BackLink.test.d.ts +0 -0
  11. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +16 -0
  12. package/dist/components/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
  13. package/dist/components/button/Button.d.ts +24 -0
  14. package/dist/components/button/Button.test.d.ts +0 -0
  15. package/dist/components/calendar/Calendar.accessibility.test.d.ts +0 -0
  16. package/dist/components/calendar/Calendar.constraints.test.d.ts +0 -0
  17. package/dist/components/calendar/Calendar.core.test.d.ts +0 -0
  18. package/dist/components/calendar/Calendar.d.ts +3 -0
  19. package/dist/components/calendar/Calendar.interaction.test.d.ts +0 -0
  20. package/dist/components/calendar/Calendar.selection.test.d.ts +0 -0
  21. package/dist/components/calendar/CalendarGrid.d.ts +4 -0
  22. package/dist/components/calendar/CalendarNav.d.ts +2 -0
  23. package/dist/components/calendar/calendar-utils.d.ts +20 -0
  24. package/dist/components/calendar/types.d.ts +104 -0
  25. package/dist/components/calendar/useCalendarState.d.ts +2 -0
  26. package/dist/components/card/Card.d.ts +37 -0
  27. package/dist/components/card/Card.test.d.ts +0 -0
  28. package/dist/components/checkbox/Checkbox.d.ts +23 -0
  29. package/dist/components/checkbox/Checkbox.test.d.ts +0 -0
  30. package/dist/components/combobox/Combobox.accessibility.test.d.ts +0 -0
  31. package/dist/components/combobox/Combobox.core.test.d.ts +0 -0
  32. package/dist/components/combobox/Combobox.d.ts +3 -0
  33. package/dist/components/combobox/Combobox.interaction.test.d.ts +0 -0
  34. package/dist/components/combobox/Combobox.selection.test.d.ts +0 -0
  35. package/dist/components/combobox/ComboboxInput.d.ts +6 -0
  36. package/dist/components/combobox/ComboboxTags.d.ts +11 -0
  37. package/dist/components/combobox/Listbox.d.ts +6 -0
  38. package/dist/components/combobox/types.d.ts +104 -0
  39. package/dist/components/combobox/useComboboxState.d.ts +2 -0
  40. package/dist/components/consent/Consent.d.ts +51 -0
  41. package/dist/components/consent/Consent.test.d.ts +0 -0
  42. package/dist/components/consent/strings.d.ts +85 -0
  43. package/dist/components/datepicker/DateTags.d.ts +10 -0
  44. package/dist/components/datepicker/Datepicker.accessibility.test.d.ts +0 -0
  45. package/dist/components/datepicker/Datepicker.core.test.d.ts +0 -0
  46. package/dist/components/datepicker/Datepicker.d.ts +3 -0
  47. package/dist/components/datepicker/Datepicker.input.test.d.ts +0 -0
  48. package/dist/components/datepicker/Datepicker.selection.test.d.ts +0 -0
  49. package/dist/components/datepicker/Datepicker.validation.test.d.ts +0 -0
  50. package/dist/components/datepicker/DatepickerInputs.d.ts +4 -0
  51. package/dist/components/datepicker/DatepickerPopup.d.ts +21 -0
  52. package/dist/components/datepicker/types.d.ts +109 -0
  53. package/dist/components/datepicker/useDatepickerState.d.ts +2 -0
  54. package/dist/components/fileupload/DropZone.d.ts +42 -0
  55. package/dist/components/fileupload/FileUpload.d.ts +84 -0
  56. package/dist/components/fileupload/FileUpload.test.d.ts +0 -0
  57. package/dist/components/fileupload/QueueDisplay.d.ts +19 -0
  58. package/dist/components/fileupload/QueueDisplay.test.d.ts +0 -0
  59. package/dist/components/fileupload/QueueItemContent.d.ts +44 -0
  60. package/dist/components/fileupload/Subcomponents.d.ts +36 -0
  61. package/dist/components/fileupload/Truncate.d.ts +20 -0
  62. package/dist/components/fileupload/Truncate.test.d.ts +0 -0
  63. package/dist/components/fileupload/extensions/Comments.d.ts +6 -0
  64. package/dist/components/fileupload/extensions/Remove.d.ts +2 -0
  65. package/dist/components/fileupload/extensions/Rename.d.ts +2 -0
  66. package/dist/components/fileupload/hooks/index.d.ts +4 -0
  67. package/dist/components/fileupload/hooks/useFileAttributes.d.ts +10 -0
  68. package/dist/components/fileupload/hooks/useImagePreview.d.ts +9 -0
  69. package/dist/components/fileupload/hooks/useOperationState.d.ts +6 -0
  70. package/dist/components/fileupload/hooks/useRequiredFormValidation.d.ts +16 -0
  71. package/dist/components/fileupload/hooks.d.ts +4 -0
  72. package/dist/components/fileupload/types.d.ts +88 -0
  73. package/dist/components/fileupload/utils.d.ts +5 -0
  74. package/dist/components/footer/Footer.d.ts +36 -0
  75. package/dist/components/footer/Footer.test.d.ts +0 -0
  76. package/dist/components/footerSimple/FooterSimple.d.ts +21 -0
  77. package/dist/components/footerSimple/FooterSimple.test.d.ts +0 -0
  78. package/dist/components/header/Header.d.ts +15 -0
  79. package/dist/components/header/Header.test.d.ts +0 -0
  80. package/dist/components/header/HeaderService.d.ts +9 -0
  81. package/dist/components/header/HeaderService.test.d.ts +0 -0
  82. package/dist/components/header/types.d.ts +93 -0
  83. package/dist/components/header-menu/HeaderMenu.d.ts +26 -0
  84. package/dist/components/header-menu/HeaderMenu.test.d.ts +0 -0
  85. package/dist/components/headerUserMenu/UserMenu.d.ts +11 -0
  86. package/dist/components/headerUserMenu/UserMenu.test.d.ts +0 -0
  87. package/dist/components/heading/Heading.d.ts +14 -0
  88. package/dist/components/heading/Heading.test.d.ts +0 -0
  89. package/dist/components/helptext/Helptext.d.ts +9 -0
  90. package/dist/components/helptext/Helptext.test.d.ts +0 -0
  91. package/dist/components/icon/Icon.d.ts +10 -0
  92. package/dist/components/icon/Icon.test.d.ts +9 -0
  93. package/dist/components/index.d.ts +50 -0
  94. package/dist/components/input/Input.d.ts +21 -0
  95. package/dist/components/inputwrapper/InputWrapper.d.ts +28 -0
  96. package/dist/components/interfaces.d.ts +30 -0
  97. package/dist/components/link/Link.d.ts +17 -0
  98. package/dist/components/link/Link.test.d.ts +1 -0
  99. package/dist/components/linkcard/LinkCard.d.ts +14 -0
  100. package/dist/components/linkcard/LinkCard.test.d.ts +0 -0
  101. package/dist/components/loader/Loader.d.ts +41 -0
  102. package/dist/components/loader/Loader.test.d.ts +0 -0
  103. package/dist/components/messagebox/Messagebox.d.ts +11 -0
  104. package/dist/components/messagebox/Messagebox.test.d.ts +1 -0
  105. package/dist/components/modal/Modal.d.ts +17 -0
  106. package/dist/components/modal/Modal.test.d.ts +0 -0
  107. package/dist/components/progressbar/Progressbar.d.ts +21 -0
  108. package/dist/components/progressbar/Progressbar.test.d.ts +0 -0
  109. package/dist/components/radio/RadioButton.d.ts +20 -0
  110. package/dist/components/radio/RadioButton.test.d.ts +0 -0
  111. package/dist/components/searchinput/SearchInput.d.ts +36 -0
  112. package/dist/components/searchinput/SearchInput.test.d.ts +0 -0
  113. package/dist/components/select/Select.d.ts +30 -0
  114. package/dist/components/select/Select.test.d.ts +0 -0
  115. package/dist/components/stepper/Step.d.ts +21 -0
  116. package/dist/components/stepper/Stepper.d.ts +32 -0
  117. package/dist/components/stepper/Stepper.test.d.ts +0 -0
  118. package/dist/components/table/Table.d.ts +11 -0
  119. package/dist/components/table/Table.test.d.ts +0 -0
  120. package/dist/components/table/TableBody.d.ts +7 -0
  121. package/dist/components/table/TableData.d.ts +7 -0
  122. package/dist/components/table/TableDataCell.d.ts +8 -0
  123. package/dist/components/table/TableHeader.d.ts +7 -0
  124. package/dist/components/table/TableHeaderCell.d.ts +7 -0
  125. package/dist/components/table/TableRow.d.ts +7 -0
  126. package/dist/components/tabs/TabItem.d.ts +15 -0
  127. package/dist/components/tabs/Tabs.d.ts +33 -0
  128. package/dist/components/tabs/Tabs.test.d.ts +0 -0
  129. package/dist/components/tag/Tag.d.ts +24 -0
  130. package/dist/components/tag/Tag.test.d.ts +0 -0
  131. package/dist/components/textarea/Textarea.d.ts +35 -0
  132. package/dist/components/textarea/Textarea.test.d.ts +0 -0
  133. package/dist/components/textinput/Textinput.d.ts +44 -0
  134. package/dist/components/textinput/Textinput.test.d.ts +0 -0
  135. package/dist/components/timepicker/Timepicker.d.ts +3 -0
  136. package/dist/components/timepicker/Timepicker.test.d.ts +0 -0
  137. package/dist/components/timepicker/types.d.ts +81 -0
  138. package/dist/components/timepicker/useTimepickerState.d.ts +58 -0
  139. package/dist/components/types.d.ts +2 -0
  140. package/dist/index.d.ts +1 -1366
  141. package/dist/punkt-react.cjs +1 -1
  142. package/dist/punkt-react.js +698 -684
  143. package/package.json +33 -32
  144. package/src/components/calendar/types.ts +1 -1
  145. package/src/components/card/Card.tsx +1 -1
  146. package/src/components/combobox/types.ts +5 -5
  147. package/src/components/datepicker/types.ts +5 -5
  148. package/src/components/fileupload/FileUpload.tsx +1 -1
  149. package/src/components/fileupload/Subcomponents.tsx +1 -1
  150. package/src/components/fileupload/Truncate.tsx +1 -1
  151. package/src/components/fileupload/hooks/useRequiredFormValidation.ts +1 -1
  152. package/src/components/header/HeaderService.tsx +1 -1
  153. package/src/components/tabs/Tabs.tsx +1 -0
  154. package/src/components/tag/Tag.tsx +1 -1
  155. package/src/components/timepicker/Timepicker.tsx +1 -2
  156. package/src/components/timepicker/types.ts +2 -5
package/CHANGELOG.md CHANGED
@@ -5,6 +5,34 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [16.25.3](https://github.com/oslokommune/punkt/compare/16.25.2...16.25.3) (2026-06-18)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ * Massiv oppdatering av avhengigheter, pluss følgende fikser (#3519). - Testing utils bruker nå vitest, akkurat som alle andre
18
+ - Docs har nå fungerende prettier og linting
19
+ - Bruker Astro 7 beta, fordi versjon 6 ikke støtter Vite 8
20
+ - Fjernet onInput i Timepicker. Denne var uansett ikke dokumentert og funket ikke
21
+ - Oppdatert node-krav (kjører 24 i build, krever 22 i konsum av pakker)
22
+ - Fjernet absolutt alle sikkerhetsvarsler
23
+ - Fikset en del feil syntaks i docs
24
+ - Fikset bygging av typescript
25
+ - npm run build gir ikke lenger noen advarsler
26
+
27
+ Et lite aber, som er verdt å nevne men som ikke kommer fra denne PR: Playwright rapporterer en del feil. Og man må kjøre en npm playwright install for å oppdatere browser. Men det er forventet og urelatert. Kommer fra andre endringer og fra oppdatering av Playwright-avhengighet.
28
+
29
+
30
+ ### Chores
31
+ Ingen
32
+
33
+ ---
34
+
35
+
8
36
  ## [16.25.1](https://github.com/oslokommune/punkt/compare/16.25.0...16.25.1) (2026-06-16)
9
37
 
10
38
  ### ⚠ BREAKING CHANGES
package/CONTRIBUTING.md CHANGED
@@ -8,7 +8,7 @@ er at vi høflig ber deg endre på noe. **Vi setter pris på alle hyggelige bidr
8
8
 
9
9
  ## 📝 Forutsetninger
10
10
 
11
- - nodejs 20.19.1
11
+ - nodejs 24.16.0
12
12
  - Kunnskap om [Sass (SCSS)](https://sass-lang.com/) og [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS).
13
13
  - Forståelse av [BEM-navnekonvensjoner](http://getbem.com/) som designsystemet følger.
14
14
  - Noen skal ha designet komponenten i [Figma](https://www.figma.com/file/Eej5jm3jIUjeMfzLE0aOTB/Punkt---Origo-designsystem?node-id=0%3A1&t=VDbEaltk80wYiYn3-0) (Krever innlogging og tilgang).
package/README.md CHANGED
@@ -8,7 +8,7 @@ Dette repoet inneholder Punkt sine UI-komponenter for React. Komponentene er lag
8
8
 
9
9
  Peer dependencies:
10
10
 
11
- - nodejs `20.19.1`
11
+ - nodejs `24.16.0`
12
12
  - react `>= 18`
13
13
  - @oslokommune/punkt-assets `*`
14
14
  - @oslokommune/punkt-css `*`
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import { TAccordionSkin } from '../../shared-types';
3
+ export type TPktAccordionSkin = TAccordionSkin;
4
+ export interface IPktAccordion {
5
+ compact?: boolean;
6
+ /**
7
+ * @default skin: "borderless"
8
+ */
9
+ skin?: TPktAccordionSkin;
10
+ /**
11
+ * @description A unique identifier to connect the accordion with a heading
12
+ */
13
+ ariaLabelledBy?: string;
14
+ children?: ReactNode;
15
+ name?: string;
16
+ className?: string;
17
+ }
18
+ export declare const useAccordionContext: () => {
19
+ name?: string;
20
+ };
21
+ export declare const PktAccordion: import('react').ForwardRefExoticComponent<IPktAccordion & import('react').RefAttributes<HTMLDivElement>>;
File without changes
@@ -0,0 +1,17 @@
1
+ import { MouseEvent, ReactNode, SyntheticEvent } from 'react';
2
+ import { TAccordionSkin } from '../../shared-types';
3
+ export type TPktAccordionSkin = TAccordionSkin;
4
+ export interface IPktAccordionItem {
5
+ defaultOpen?: boolean;
6
+ id: string;
7
+ title: string | ReactNode;
8
+ skin?: TPktAccordionSkin;
9
+ compact?: boolean;
10
+ isOpen?: boolean;
11
+ children?: ReactNode;
12
+ name?: string;
13
+ className?: string;
14
+ onClick?: (e: MouseEvent<HTMLDetailsElement>) => void;
15
+ onToggle?: (e: SyntheticEvent<HTMLDetailsElement>) => void;
16
+ }
17
+ export declare const PktAccordionItem: import('react').ForwardRefExoticComponent<IPktAccordionItem & import('react').RefAttributes<HTMLDetailsElement>>;
@@ -0,0 +1,14 @@
1
+ import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import { TAlertRole, TAlertSkin, TAriaLive } from '../../shared-types';
3
+ export interface IPktAlert extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
+ skin?: TAlertSkin;
5
+ closeAlert?: boolean;
6
+ title?: ReactNode;
7
+ date?: string;
8
+ ariaLive?: TAriaLive;
9
+ compact?: boolean;
10
+ role?: TAlertRole;
11
+ onClose?: (e: CustomEvent) => void;
12
+ }
13
+ export type { TAlertSkin };
14
+ export declare const PktAlert: FC<IPktAlert>;
File without changes
@@ -0,0 +1,14 @@
1
+ import { AnchorHTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface IPktBackLink extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
3
+ href?: string;
4
+ text?: string;
5
+ ariaLabel?: string;
6
+ renderLink?: (args: {
7
+ href: string;
8
+ className: string;
9
+ children: ReactNode;
10
+ props: AnchorHTMLAttributes<HTMLAnchorElement>;
11
+ }) => ReactNode;
12
+ ref?: Ref<HTMLElement>;
13
+ }
14
+ export declare const PktBackLink: import('react').ForwardRefExoticComponent<Omit<IPktBackLink, "ref"> & import('react').RefAttributes<HTMLElement>>;
File without changes
@@ -0,0 +1,16 @@
1
+ import { AnchorHTMLAttributes, ReactNode } from 'react';
2
+ export interface IBreadcrumbs {
3
+ text: string;
4
+ href: string;
5
+ }
6
+ export interface IPktBreadcrumbs extends AnchorHTMLAttributes<HTMLAnchorElement> {
7
+ breadcrumbs: IBreadcrumbs[];
8
+ navigationType?: 'router' | 'anchor';
9
+ renderLink?: (args: {
10
+ href: string;
11
+ className: string;
12
+ children: ReactNode;
13
+ props: AnchorHTMLAttributes<HTMLAnchorElement>;
14
+ }) => ReactNode;
15
+ }
16
+ export declare const PktBreadcrumbs: import('react').ForwardRefExoticComponent<IPktBreadcrumbs & import('react').RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ declare global {
3
+ interface Window {
4
+ pktAnimationPath?: string;
5
+ }
6
+ }
7
+ export interface IPktButton extends ButtonHTMLAttributes<HTMLButtonElement> {
8
+ iconName?: string;
9
+ secondIconName?: string;
10
+ iconPath?: string;
11
+ secondIconPath?: string;
12
+ mode?: 'light' | 'dark';
13
+ size?: 'small' | 'medium' | 'large';
14
+ fullWidth?: boolean;
15
+ fullWidthOnMobile?: boolean;
16
+ color?: 'blue' | 'blue-outline' | 'green' | 'green-outline' | 'green-dark' | 'green-dark-outline' | 'beige-light' | 'beige-dark-outline' | 'yellow' | 'yellow-outline' | 'red' | 'red-outline';
17
+ skin?: 'primary' | 'secondary' | 'tertiary';
18
+ variant?: 'label-only' | 'icon-left' | 'icon-right' | 'icon-only' | 'icons-right-and-left';
19
+ state?: 'normal' | 'focus' | 'hover' | 'active';
20
+ type?: 'button' | 'submit' | 'reset';
21
+ isLoading?: boolean;
22
+ loadingAnimationPath?: string;
23
+ }
24
+ export declare const PktButton: import('react').ForwardRefExoticComponent<IPktButton & import('react').RefAttributes<HTMLButtonElement>>;
File without changes
@@ -0,0 +1,3 @@
1
+ import { IPktCalendar, PktCalendarHandle } from './types';
2
+ export type { IPktCalendar, IPktCalendarStrings, PktCalendarHandle } from './types';
3
+ export declare const PktCalendar: import('react').ForwardRefExoticComponent<IPktCalendar & import('react').RefAttributes<PktCalendarHandle>>;
@@ -0,0 +1,4 @@
1
+ import { ICalendarState } from './types';
2
+ export declare const CalendarGrid: ({ state }: {
3
+ state: ICalendarState;
4
+ }) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ICalendarNavProps } from './types';
2
+ export declare const CalendarNav: ({ componentId, strings, year, month, earliest, latest, withcontrols, prevMonth, nextMonth, changeMonth, }: ICalendarNavProps) => import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { TDateRangeMap } from '../../shared-types/calendar';
2
+ import { TDayViewData } from './types';
3
+ export interface IDayViewContext {
4
+ year: number;
5
+ month: number;
6
+ activeSelected: string[];
7
+ focusedDate: string | null;
8
+ tabIndexSetRef: React.MutableRefObject<number>;
9
+ isDayDisabled: (date: Date, isSelected: boolean) => boolean;
10
+ }
11
+ export interface IDayCellClassContext {
12
+ range: boolean;
13
+ activeSelected: string[];
14
+ rangeHovered: Date | null;
15
+ inRange: TDateRangeMap;
16
+ isExcluded: (date: Date) => boolean;
17
+ }
18
+ export declare function getDayViewData(dayCounter: number, today: Date, ctx: IDayViewContext): TDayViewData;
19
+ export declare function getDayCellClasses(data: TDayViewData, ctx: IDayCellClassContext): string;
20
+ export declare function getDayButtonClasses(data: TDayViewData, ctx: IDayCellClassContext): string;
@@ -0,0 +1,104 @@
1
+ import { IDateConstraints, TDateRangeMap } from '../../shared-types/calendar';
2
+ export declare const DEFAULT_STRINGS: Required<IPktCalendarStrings>;
3
+ export interface IPktCalendarStrings {
4
+ month?: string;
5
+ year?: string;
6
+ days?: string[];
7
+ daysShort?: string[];
8
+ months?: string[];
9
+ week?: string;
10
+ prevMonth?: string;
11
+ nextMonth?: string;
12
+ }
13
+ export interface PktCalendarHandle {
14
+ handleDateSelect: (selectedDate: Date | null) => void;
15
+ addToSelected: (selectedDate: Date) => void;
16
+ removeFromSelected: (selectedDate: Date) => void;
17
+ toggleSelected: (selectedDate: Date) => void;
18
+ focusOnCurrentDate: () => void;
19
+ close: () => void;
20
+ }
21
+ export interface IPktCalendar {
22
+ selected?: string[];
23
+ multiple?: boolean;
24
+ maxMultiple?: number;
25
+ range?: boolean;
26
+ earliest?: string | null;
27
+ latest?: string | null;
28
+ excludedates?: Date[] | string[];
29
+ excludeweekdays?: string[];
30
+ weeknumbers?: boolean;
31
+ withcontrols?: boolean;
32
+ currentmonth?: Date | string | null;
33
+ today?: string;
34
+ strings?: IPktCalendarStrings;
35
+ onDateSelected?: (selected: string[]) => void;
36
+ onClose?: () => void;
37
+ id?: string;
38
+ className?: string;
39
+ }
40
+ export type TDayViewData = {
41
+ currentDate: Date;
42
+ currentDateISO: string;
43
+ isToday: boolean;
44
+ isSelected: boolean;
45
+ isDisabled: boolean;
46
+ ariaLabel: string;
47
+ tabindex: string;
48
+ };
49
+ export interface ICalendarState {
50
+ componentId: string;
51
+ strings: Required<IPktCalendarStrings>;
52
+ year: number;
53
+ month: number;
54
+ activeSelected: string[];
55
+ _selected: Date[];
56
+ inRange: TDateRangeMap;
57
+ rangeHovered: Date | null;
58
+ focusedDate: string | null;
59
+ todayDate: Date;
60
+ range: boolean;
61
+ multiple: boolean;
62
+ weeknumbers: boolean;
63
+ withcontrols: boolean;
64
+ earliest: string | null;
65
+ latest: string | null;
66
+ excludedates: Date[];
67
+ excludeweekdays: string[];
68
+ className?: string;
69
+ dateConstraints: IDateConstraints;
70
+ calendarRef: React.RefObject<HTMLDivElement | null>;
71
+ selectableDatesRef: React.MutableRefObject<{
72
+ currentDateISO: string;
73
+ isDisabled: boolean;
74
+ tabindex: string;
75
+ }[]>;
76
+ tabIndexSetRef: React.MutableRefObject<number>;
77
+ prevMonth: () => void;
78
+ nextMonth: () => void;
79
+ changeMonth: (newYear: number, newMonth: number) => void;
80
+ handleDateSelect: (selectedDate: Date | null) => void;
81
+ addToSelected: (selectedDate: Date) => void;
82
+ removeFromSelected: (selectedDate: Date) => void;
83
+ toggleSelectedDate: (selectedDate: Date) => void;
84
+ handleRangeHover: (date: Date) => void;
85
+ isExcluded: (date: Date) => boolean;
86
+ isDayDisabled: (date: Date, isSelected: boolean) => boolean;
87
+ focusOnCurrentDate: () => void;
88
+ handleKeydown: (e: React.KeyboardEvent) => void;
89
+ handleFocusOut: (e: React.FocusEvent) => void;
90
+ close: () => void;
91
+ setFocusedDate: (date: string | null) => void;
92
+ }
93
+ export interface ICalendarNavProps {
94
+ componentId: string;
95
+ strings: Required<IPktCalendarStrings>;
96
+ year: number;
97
+ month: number;
98
+ earliest: string | null;
99
+ latest: string | null;
100
+ withcontrols: boolean;
101
+ prevMonth: () => void;
102
+ nextMonth: () => void;
103
+ changeMonth: (newYear: number, newMonth: number) => void;
104
+ }
@@ -0,0 +1,2 @@
1
+ import { IPktCalendar, ICalendarState } from './types';
2
+ export declare function useCalendarState(props: IPktCalendar): ICalendarState;
@@ -0,0 +1,37 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import { TCardSkin, TLayout, TTagSkin } from '../../shared-types';
3
+ export type { TCardSkin, TLayout };
4
+ type TCardPadding = 'none' | 'default';
5
+ type TCardImageShape = 'square' | 'round';
6
+ type TCardTagPosition = 'top' | 'bottom';
7
+ type THeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
8
+ interface ICardTag {
9
+ skin?: TTagSkin;
10
+ iconName?: string;
11
+ ariaLabel?: string;
12
+ text: string;
13
+ }
14
+ export interface IPktCard extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
15
+ ariaLabel?: string;
16
+ metaLead?: string | null;
17
+ borderOnHover?: boolean;
18
+ metaTrail?: string | null;
19
+ layout?: TLayout;
20
+ heading?: string;
21
+ headingLevel?: THeadingLevel;
22
+ image?: {
23
+ src: string;
24
+ alt: string;
25
+ };
26
+ imageShape?: TCardImageShape;
27
+ clickCardLink?: string | null;
28
+ padding?: TCardPadding;
29
+ openLinkInNewTab?: boolean;
30
+ skin?: TCardSkin;
31
+ subheading?: string;
32
+ tagPosition?: TCardTagPosition;
33
+ tags?: ICardTag[];
34
+ children?: ReactNode;
35
+ ref?: Ref<HTMLDivElement>;
36
+ }
37
+ export declare const PktCard: import('react').ForwardRefExoticComponent<Omit<IPktCard, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
File without changes
@@ -0,0 +1,23 @@
1
+ import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
2
+ export interface IPktCheckbox extends InputHTMLAttributes<HTMLInputElement> {
3
+ id: string;
4
+ hasTile?: boolean;
5
+ disabled?: boolean;
6
+ label?: string;
7
+ checkHelptext?: ReactNode | ReactNode[] | string;
8
+ hasError?: boolean;
9
+ defaultChecked?: boolean;
10
+ checked?: boolean;
11
+ indeterminate?: boolean;
12
+ value?: string;
13
+ isSwitch?: boolean;
14
+ hideLabel?: boolean;
15
+ labelPosition?: 'right' | 'left';
16
+ optionalTag?: boolean;
17
+ optionalText?: string;
18
+ requiredTag?: boolean;
19
+ requiredText?: string;
20
+ tagText?: string | null;
21
+ onChange?: ChangeEventHandler<HTMLInputElement>;
22
+ }
23
+ export declare const PktCheckbox: import('react').ForwardRefExoticComponent<IPktCheckbox & import('react').RefAttributes<HTMLInputElement>>;
File without changes
@@ -0,0 +1,3 @@
1
+ import { IPktCombobox } from './types';
2
+ export type { IPktCombobox } from './types';
3
+ export declare const PktCombobox: import('react').ForwardRefExoticComponent<IPktCombobox & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,6 @@
1
+ import { IComboboxState } from './types';
2
+ interface IComboboxInputProps {
3
+ state: IComboboxState;
4
+ }
5
+ export declare const ComboboxInput: ({ state }: IComboboxInputProps) => import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IComboboxState } from './types';
2
+ interface IComboboxTagsProps {
3
+ state: IComboboxState;
4
+ outside?: boolean;
5
+ }
6
+ export declare const ComboboxTags: ({ state, outside }: IComboboxTagsProps) => import("react").JSX.Element | null;
7
+ interface ISingleValueDisplayProps {
8
+ state: IComboboxState;
9
+ }
10
+ export declare const SingleValueDisplay: ({ state }: ISingleValueDisplayProps) => import("react").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ import { IComboboxState } from './types';
2
+ interface IListboxProps {
3
+ state: IComboboxState;
4
+ }
5
+ export declare const Listbox: ({ state }: IListboxProps) => import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,104 @@
1
+ import { ChangeEvent, ChangeEventHandler, FocusEvent, KeyboardEvent, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent, ReactNode, RefObject } from 'react';
2
+ import { IPktComboboxOption, TPktComboboxDisplayValue, TPktComboboxTagPlacement } from '../../shared-types/combobox';
3
+ export interface IPktCombobox {
4
+ value?: string | string[];
5
+ defaultValue?: string | string[];
6
+ options?: IPktComboboxOption[];
7
+ defaultOptions?: IPktComboboxOption[];
8
+ multiple?: boolean;
9
+ maxlength?: number;
10
+ typeahead?: boolean;
11
+ includeSearch?: boolean;
12
+ allowUserInput?: boolean;
13
+ displayValueAs?: TPktComboboxDisplayValue;
14
+ tagPlacement?: TPktComboboxTagPlacement;
15
+ searchPlaceholder?: string;
16
+ name?: string;
17
+ id?: string;
18
+ disabled?: boolean;
19
+ required?: boolean;
20
+ placeholder?: string;
21
+ label?: string;
22
+ helptext?: string | ReactNode;
23
+ helptextDropdown?: string | ReactNode;
24
+ helptextDropdownButton?: string;
25
+ hasError?: boolean;
26
+ errorMessage?: string | ReactNode;
27
+ fullwidth?: boolean;
28
+ requiredTag?: boolean;
29
+ requiredText?: string;
30
+ optionalTag?: boolean;
31
+ optionalText?: string;
32
+ tagText?: string;
33
+ useWrapper?: boolean;
34
+ onChange?: ChangeEventHandler<HTMLInputElement>;
35
+ onValueChange?: (values: string[]) => void;
36
+ className?: string;
37
+ children?: ReactNode;
38
+ }
39
+ export interface IComboboxState {
40
+ id: string;
41
+ inputId: string;
42
+ listboxId: string;
43
+ values: string[];
44
+ inputValue: string;
45
+ searchValue: string;
46
+ options: IPktComboboxOption[];
47
+ filteredOptions: IPktComboboxOption[];
48
+ isOpen: boolean;
49
+ userInfoMessage: string;
50
+ addValueText: string | null;
51
+ maxIsReached: boolean;
52
+ editingSingleValue: boolean;
53
+ inputFocus: boolean;
54
+ focusedTagIndex: number;
55
+ label?: string;
56
+ multiple: boolean;
57
+ maxlength?: number;
58
+ typeahead: boolean;
59
+ includeSearch: boolean;
60
+ allowUserInput: boolean;
61
+ displayValueAs: TPktComboboxDisplayValue;
62
+ tagPlacement?: TPktComboboxTagPlacement;
63
+ searchPlaceholder?: string;
64
+ placeholder?: string;
65
+ disabled: boolean;
66
+ required: boolean;
67
+ fullwidth: boolean;
68
+ hasError: boolean;
69
+ errorMessage?: string | ReactNode;
70
+ helptext?: string | ReactNode;
71
+ helptextDropdown?: string | ReactNode;
72
+ helptextDropdownButton?: string;
73
+ optionalTag: boolean;
74
+ optionalText?: string;
75
+ requiredTag: boolean;
76
+ requiredText?: string;
77
+ tagText?: string;
78
+ useWrapper: boolean;
79
+ name?: string;
80
+ className?: string;
81
+ hasCounter: boolean;
82
+ inputRef: RefObject<HTMLInputElement | null>;
83
+ changeInputRef: RefObject<HTMLInputElement | null>;
84
+ triggerRef: RefObject<HTMLDivElement | null>;
85
+ listboxRef: RefObject<HTMLDivElement | null>;
86
+ wrapperRef: RefObject<HTMLDivElement | null>;
87
+ handleInputChange: (e: ChangeEvent<HTMLInputElement>) => void;
88
+ handleInputKeydown: (e: KeyboardEvent<HTMLInputElement>) => void;
89
+ handleInputFocus: () => void;
90
+ handleInputBlur: () => void;
91
+ handleFocusOut: (e: FocusEvent) => void;
92
+ handleInputClick: (e: ReactMouseEvent) => void;
93
+ handlePlaceholderClick: (e: ReactMouseEvent) => void;
94
+ handleSelectOnlyKeydown: (e: ReactKeyboardEvent) => void;
95
+ handleOptionClick: (value: string) => void;
96
+ handleOptionKeydown: (e: KeyboardEvent<HTMLLIElement>, value: string) => void;
97
+ handleTagRemove: (value: string) => void;
98
+ handleTagKeydown: (e: ReactKeyboardEvent, index: number) => void;
99
+ handleSearchInput: (e: ChangeEvent<HTMLInputElement>) => void;
100
+ handleSearchKeydown: (e: KeyboardEvent<HTMLInputElement>) => void;
101
+ handleNewOptionClick: (value: string) => void;
102
+ handleNewOptionKeydown: (e: KeyboardEvent<HTMLDivElement>) => void;
103
+ onChange?: ChangeEventHandler<HTMLInputElement>;
104
+ }
@@ -0,0 +1,2 @@
1
+ import { IPktCombobox, IComboboxState } from './types';
2
+ export declare function useComboboxState(props: IPktCombobox, ref: React.ForwardedRef<HTMLDivElement>): IComboboxState;
@@ -0,0 +1,51 @@
1
+ import { HTMLAttributes } from 'react';
2
+ interface ConsentItem {
3
+ name: string;
4
+ consent: boolean;
5
+ }
6
+ interface ConsentValue {
7
+ items: ConsentItem[];
8
+ }
9
+ interface CookieConsentEvent {
10
+ value: string | ConsentValue;
11
+ }
12
+ type ConsentDetailsMap = Record<string, boolean>;
13
+ type CookieEventHandler = (consent: CookieConsentEvent) => void;
14
+ interface CookieEvents {
15
+ on(eventName: string, handler: CookieEventHandler): void;
16
+ off(eventName: string, handler: CookieEventHandler): void;
17
+ }
18
+ interface CookieBannerApi {
19
+ cookieConsent: {
20
+ validateConsentCookie(): Promise<boolean>;
21
+ getConsentCookie(): string | ConsentValue;
22
+ };
23
+ openCookieModal(): void;
24
+ }
25
+ declare global {
26
+ interface Window {
27
+ cookieBanner_devMode?: boolean;
28
+ cookieBanner_cookieDomain?: string | null;
29
+ cookieBanner_cookieSecure?: string | null;
30
+ cookieBanner_cookieExpiryDays?: string | null;
31
+ cookieBanner_googleAnalyticsId?: string | null;
32
+ cookieBanner_hotjarId?: string | null;
33
+ cookieBanner?: CookieBannerApi;
34
+ __cookieEvents?: CookieEvents;
35
+ }
36
+ }
37
+ export type TPktConsentTriggerType = 'button' | 'link' | 'footerlink' | 'icon';
38
+ export interface IPktConsent extends HTMLAttributes<HTMLElement> {
39
+ devMode?: boolean;
40
+ cookieDomain?: string | null;
41
+ cookieSecure?: string | null;
42
+ cookieExpiryDays?: string | null;
43
+ hotjarId?: string | null;
44
+ googleAnalyticsId?: string | null;
45
+ i18nLanguage?: string;
46
+ triggerType?: TPktConsentTriggerType | null;
47
+ triggerText?: string | null;
48
+ onToggleConsent?: (e: CustomEvent<ConsentDetailsMap>) => void;
49
+ }
50
+ export declare const PktConsent: import('react').ForwardRefExoticComponent<IPktConsent & import('react').RefAttributes<HTMLElement>>;
51
+ export {};
File without changes