@oslokommune/punkt-react 12.33.1 → 12.34.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 +26 -0
- package/dist/index.d.ts +26 -29
- package/dist/punkt-react.es.js +7886 -7800
- package/dist/punkt-react.umd.js +272 -240
- package/package.json +4 -4
- package/src/components/accordion/Accordion.test.tsx +66 -36
- package/src/components/accordion/Accordion.tsx +26 -21
- package/src/components/accordion/AccordionItem.tsx +30 -75
- package/src/components/checkbox/Checkbox.tsx +1 -1
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
|
+
## [12.34.0](https://github.com/oslokommune/punkt/compare/12.33.1...12.34.0) (2025-04-16)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Accordion i Punkt Elements (#2327) (#2379). - AccordionItem can now be used standalone 💄📝
|
|
15
|
+
- Use <slot/> in pkt-accordion instead of SlotController
|
|
16
|
+
- Add `aria-labelledBy` to provide opportunity to connect a heading to the accordion.
|
|
17
|
+
- We no longer need to send in `toggleProps: { isOpen, onToggleClick }` as a object. We pull it out into the interface together with other props.
|
|
18
|
+
- Docs and code examples are updated.
|
|
19
|
+
|
|
20
|
+
---------
|
|
21
|
+
|
|
22
|
+
Co-authored-by: Jan Schjetne <jan.schjetne@origo.oslo.kommune.no>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
Ingen
|
|
27
|
+
|
|
28
|
+
### Chores
|
|
29
|
+
Ingen
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
|
|
8
34
|
## [12.33.1](https://github.com/oslokommune/punkt/compare/12.33.0...12.33.1) (2025-04-14)
|
|
9
35
|
|
|
10
36
|
### ⚠ BREAKING CHANGES
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { default as default_2 } from 'react';
|
|
|
7
7
|
import { FC } from 'react';
|
|
8
8
|
import { FocusEventHandler } from 'react';
|
|
9
9
|
import { ForwardedRef } from 'react';
|
|
10
|
-
import { ForwardRefExoticComponent } from 'react';
|
|
11
10
|
import { HTMLAttributes } from 'react';
|
|
12
11
|
import { HTMLProps } from 'react';
|
|
13
12
|
import { InputHTMLAttributes } from 'react';
|
|
@@ -24,9 +23,9 @@ import { PktInputWrapper as PktInputWrapper_2 } from '@oslokommune/punkt-element
|
|
|
24
23
|
import * as React_2 from 'react';
|
|
25
24
|
import { ReactElement } from 'react';
|
|
26
25
|
import { ReactNode } from 'react';
|
|
27
|
-
import { RefAttributes } from 'react';
|
|
28
26
|
import { SelectHTMLAttributes } from 'react';
|
|
29
27
|
import { TextareaHTMLAttributes } from 'react';
|
|
28
|
+
import { TPktAccordionSkin } from '@oslokommune/punkt-elements';
|
|
30
29
|
import { TSelectOption } from '@oslokommune/punkt-elements';
|
|
31
30
|
|
|
32
31
|
declare type Booleanish = boolean | 'true' | 'false';
|
|
@@ -59,37 +58,31 @@ declare interface InputProps extends default_2.InputHTMLAttributes<HTMLInputElem
|
|
|
59
58
|
id: string;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
export declare interface IPktAccordion {
|
|
63
|
-
className?: string;
|
|
64
|
-
children: ReactNode | ReactNode[];
|
|
65
|
-
/**
|
|
66
|
-
* @default compact: "false"
|
|
67
|
-
*/
|
|
61
|
+
export declare interface IPktAccordion extends PktElType {
|
|
68
62
|
compact?: boolean;
|
|
69
63
|
/**
|
|
70
64
|
* @default skin: "borderless"
|
|
71
65
|
*/
|
|
72
|
-
skin?:
|
|
66
|
+
skin?: TPktAccordionSkin;
|
|
67
|
+
/**
|
|
68
|
+
* @description A unique identifier to connect the accordion with a heading
|
|
69
|
+
*/
|
|
70
|
+
ariaLabelledBy?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @description A unique identifier to connect the accordion with a heading
|
|
73
|
+
*/
|
|
74
|
+
ref?: LegacyRef<HTMLElement>;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
export declare interface IPktAccordionItem {
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
export declare interface IPktAccordionItem extends Omit<PktElType, 'onClick'> {
|
|
78
|
+
compact?: boolean;
|
|
79
|
+
skin?: TPktAccordionSkin;
|
|
80
|
+
title?: string;
|
|
78
81
|
defaultOpen?: boolean;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @param toggleProps
|
|
86
|
-
*
|
|
87
|
-
* @description Send in an "isOpen" boolean and "onToggleClick" function
|
|
88
|
-
* to override the automatic toggling
|
|
89
|
-
*/
|
|
90
|
-
declare interface IPktAccordionToggleProps {
|
|
91
|
-
isOpen: boolean;
|
|
92
|
-
onToggleClick: (e: default_2.MouseEvent, id: string) => void;
|
|
82
|
+
isOpen?: boolean;
|
|
83
|
+
id?: string;
|
|
84
|
+
onClick?: (e: PktEventWithTarget) => void;
|
|
85
|
+
ref?: LegacyRef<HTMLElement>;
|
|
93
86
|
}
|
|
94
87
|
|
|
95
88
|
export declare interface IPktAlert extends PktElType {
|
|
@@ -147,7 +140,7 @@ export declare interface IPktCheckbox extends InputHTMLAttributes<HTMLInputEleme
|
|
|
147
140
|
defaultChecked?: boolean;
|
|
148
141
|
disabled?: boolean;
|
|
149
142
|
value?: string;
|
|
150
|
-
checkHelptext?: string |
|
|
143
|
+
checkHelptext?: string | ReactNode | ReactNode[];
|
|
151
144
|
isSwitch?: boolean;
|
|
152
145
|
hideLabel?: boolean;
|
|
153
146
|
labelPosition?: 'right' | 'left';
|
|
@@ -593,9 +586,9 @@ declare interface Link {
|
|
|
593
586
|
openInNewTab?: boolean;
|
|
594
587
|
}
|
|
595
588
|
|
|
596
|
-
export declare const PktAccordion:
|
|
589
|
+
export declare const PktAccordion: FC<IPktAccordion>;
|
|
597
590
|
|
|
598
|
-
export declare const PktAccordionItem:
|
|
591
|
+
export declare const PktAccordionItem: FC<IPktAccordionItem>;
|
|
599
592
|
|
|
600
593
|
export declare const PktAlert: FC<IPktAlert>;
|
|
601
594
|
|
|
@@ -621,6 +614,10 @@ declare interface PktElType extends default_2.HTMLAttributes<HTMLElement> {
|
|
|
621
614
|
id?: string;
|
|
622
615
|
}
|
|
623
616
|
|
|
617
|
+
declare interface PktEventWithTarget extends Event {
|
|
618
|
+
target: EventTarget & HTMLInputElement;
|
|
619
|
+
}
|
|
620
|
+
|
|
624
621
|
export declare const PktFooter: default_2.FC<IPktFooter>;
|
|
625
622
|
|
|
626
623
|
export declare const PktFooterSimple: default_2.FC<IPktFooterSimple>;
|