@oslokommune/punkt-react 12.4.3 → 12.5.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,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [12.5.0](https://github.com/oslokommune/punkt/compare/12.4.3...12.5.0) (2024-10-23)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ * Ny PktIcon og endelig dokumentasjon på komponenten (#1980).
15
+
16
+
17
+ ### Bug Fixes
18
+ Ingen
19
+
20
+ ### Chores
21
+ Ingen
22
+
23
+ ---
24
+
25
+
8
26
  ## [12.3.15](https://github.com/oslokommune/punkt/compare/12.3.14...12.3.15) (2024-10-18)
9
27
 
10
28
  ### ⚠ BREAKING CHANGES
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
 
3
- import { Context } from 'react';
4
3
  import { default as default_2 } from 'react';
5
4
  import { FC } from 'react';
6
5
  import { ForwardRefExoticComponent } from 'react';
@@ -16,6 +15,8 @@ import { RefAttributes } from 'react';
16
15
  import { SelectHTMLAttributes } from 'react';
17
16
  import { TextareaHTMLAttributes } from 'react';
18
17
 
18
+ declare type Booleanish = boolean | 'true' | 'false';
19
+
19
20
  declare interface Column {
20
21
  title: string;
21
22
  links?: Link[];
@@ -27,10 +28,6 @@ declare interface IBreadcrumbs {
27
28
  href: string;
28
29
  }
29
30
 
30
- declare type IconFetcher = {
31
- fetchIcon: (name: string, path: string | undefined) => Promise<string | null>;
32
- };
33
-
34
31
  declare interface InputProps extends default_2.InputHTMLAttributes<HTMLInputElement> {
35
32
  /** The input's label */
36
33
  label?: string;
@@ -212,6 +209,12 @@ declare interface IPktHeader extends HTMLAttributes<HTMLDivElement> {
212
209
  children?: default_2.ReactNode | default_2.ReactNode[];
213
210
  }
214
211
 
212
+ declare interface IPktIcon extends PktElType {
213
+ name?: string;
214
+ path?: string;
215
+ 'aria-hidden'?: Booleanish | undefined;
216
+ }
217
+
215
218
  declare interface IPktInputWrapper extends RefAttributes<HTMLElement> {
216
219
  forId: string;
217
220
  label: string;
@@ -550,7 +553,7 @@ export declare const PktDatepicker: FC<IPktDatepicker>;
550
553
  declare interface PktElType {
551
554
  className?: string;
552
555
  children?: default_2.ReactNode | default_2.ReactNode[];
553
- ref?: default_2.RefObject<HTMLElement> | default_2.LegacyRef<HTMLElement>;
556
+ ref?: default_2.LegacyRef<HTMLElement>;
554
557
  }
555
558
 
556
559
  declare interface PktEventWithTarget extends Event {
@@ -563,14 +566,7 @@ export declare const PktFooterSimple: default_2.FC<IPktFooterSimple>;
563
566
 
564
567
  export declare const PktHeader: default_2.ForwardRefExoticComponent<IPktHeader & default_2.RefAttributes<HTMLDivElement>>;
565
568
 
566
- export declare const PktIcon: default_2.FC<PktIconProps>;
567
-
568
- export declare const PktIconContext: Context<IconFetcher>;
569
-
570
- declare interface PktIconProps extends default_2.HTMLAttributes<HTMLSpanElement> {
571
- name?: string;
572
- path?: string;
573
- }
569
+ export declare const PktIcon: FC<IPktIcon>;
574
570
 
575
571
  /**
576
572
  * Input component
@@ -702,3 +698,14 @@ declare interface UserMenuItem {
702
698
  }
703
699
 
704
700
  export { }
701
+
702
+
703
+ declare global {
704
+ interface Window {
705
+ pktFetch: () => Promise<{
706
+ ok: boolean;
707
+ text: () => Promise<string>;
708
+ }>;
709
+ pktIconPath: string;
710
+ }
711
+ }