@oslokommune/punkt-react 12.16.0 → 12.17.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 +36 -0
- package/README.md +2 -2
- package/dist/index.d.ts +21 -37
- package/dist/punkt-react.es.js +7906 -7968
- package/dist/punkt-react.umd.js +297 -296
- package/package.json +4 -4
- package/src/components/datepicker/Datepicker.tsx +16 -14
- package/src/components/inputwrapper/InputWrapper.tsx +30 -139
- package/src/components/select/Select.test.tsx +12 -7
- package/src/components/select/Select.tsx +1 -1
- package/src/components/textarea/Textarea.tsx +16 -12
- package/src/components/textinput/Textinput.tsx +16 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,42 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.17.1](https://github.com/oslokommune/punkt/compare/12.17.0...12.17.1) (2025-01-15)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* Div bugfikser (typer i React og månedsnavigasjon i Datepicker) (#2127).
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [12.17.0](https://github.com/oslokommune/punkt/compare/12.16.0...12.17.0) (2025-01-13)
|
|
27
|
+
|
|
28
|
+
### ⚠ BREAKING CHANGES
|
|
29
|
+
Ingen
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
* PktInputWrapper => pkt-input-wrapper (Elements migrering) (#2125).
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
Ingen
|
|
37
|
+
|
|
38
|
+
### Chores
|
|
39
|
+
Ingen
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
|
|
8
44
|
## [12.16.0](https://github.com/oslokommune/punkt/compare/12.15.0...12.16.0) (2025-01-09)
|
|
9
45
|
|
|
10
46
|
### ⚠ BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -26,11 +26,11 @@ npm add @oslokommune/punkt-react
|
|
|
26
26
|
```js
|
|
27
27
|
// src/App.tsx
|
|
28
28
|
|
|
29
|
-
import { PktButton,
|
|
29
|
+
import { PktButton, PktTextInput } from "@oslokommune/punkt-react";
|
|
30
30
|
|
|
31
31
|
...
|
|
32
32
|
|
|
33
|
-
<
|
|
33
|
+
<PktTextInput label="First name" id="firstName" />
|
|
34
34
|
<PktButton skin="primary" variant="icon-left" iconName="user">
|
|
35
35
|
Testbutton
|
|
36
36
|
</PktButton>
|
package/dist/index.d.ts
CHANGED
|
@@ -7,16 +7,16 @@ import { FocusEventHandler } from 'react';
|
|
|
7
7
|
import { ForwardRefExoticComponent } from 'react';
|
|
8
8
|
import { HTMLAttributes } from 'react';
|
|
9
9
|
import { HTMLProps } from 'react';
|
|
10
|
+
import { InputHTMLAttributes } from 'react';
|
|
10
11
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
12
|
import { LegacyRef } from 'react';
|
|
12
|
-
import {
|
|
13
|
-
import { PktTextarea as PktTextarea_2 } from '@oslokommune/punkt-elements';
|
|
14
|
-
import { PktTextinput as PktTextinput_2 } from '@oslokommune/punkt-elements';
|
|
13
|
+
import { PktInputWrapper as PktInputWrapper_2 } from '@oslokommune/punkt-elements';
|
|
15
14
|
import * as React_2 from 'react';
|
|
16
15
|
import { ReactElement } from 'react';
|
|
17
16
|
import { ReactNode } from 'react';
|
|
18
17
|
import { RefAttributes } from 'react';
|
|
19
18
|
import { SelectHTMLAttributes } from 'react';
|
|
19
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
20
20
|
|
|
21
21
|
declare type Booleanish = boolean | 'true' | 'false';
|
|
22
22
|
|
|
@@ -134,37 +134,32 @@ declare interface IPktCheckbox extends default_2.InputHTMLAttributes<HTMLInputEl
|
|
|
134
134
|
value?: string;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
declare interface IPktDatepicker extends
|
|
137
|
+
declare interface IPktDatepicker extends InputHTMLAttributes<HTMLInputElement> {
|
|
138
138
|
value?: string | string[];
|
|
139
139
|
label?: string;
|
|
140
|
-
name?: string;
|
|
141
140
|
dateformat?: string;
|
|
142
141
|
multiple?: boolean;
|
|
143
142
|
maxlength?: number;
|
|
144
|
-
disabled?: boolean;
|
|
145
143
|
range?: boolean;
|
|
146
144
|
weeknumbers?: boolean;
|
|
147
145
|
withcontrols?: boolean;
|
|
148
146
|
fullwidth?: boolean;
|
|
149
|
-
min?: string | number | undefined;
|
|
150
|
-
max?: string | number | undefined;
|
|
151
147
|
excludedates?: string[];
|
|
152
148
|
excludeweekdays?: string[];
|
|
153
149
|
currentmonth?: string;
|
|
154
150
|
calendarOpen?: boolean;
|
|
155
|
-
required?: boolean;
|
|
156
151
|
requiredTag?: boolean;
|
|
157
152
|
requiredText?: string;
|
|
158
153
|
optionalTag?: boolean;
|
|
159
154
|
optionalText?: string;
|
|
160
155
|
useWrapper?: boolean;
|
|
161
|
-
helptext?: string;
|
|
162
|
-
helptextDropdown?: string;
|
|
156
|
+
helptext?: string | ReactNode | ReactNode[];
|
|
157
|
+
helptextDropdown?: string | ReactNode | ReactNode[];
|
|
163
158
|
helptextDropdownButton?: string;
|
|
164
159
|
hasError?: boolean;
|
|
165
|
-
errorMessage?: string;
|
|
160
|
+
errorMessage?: string | ReactNode | ReactNode[];
|
|
166
161
|
strings?: any;
|
|
167
|
-
ref?: LegacyRef<
|
|
162
|
+
ref?: LegacyRef<HTMLInputElement>;
|
|
168
163
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
169
164
|
onInput?: ChangeEventHandler<HTMLInputElement>;
|
|
170
165
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
@@ -217,7 +212,7 @@ declare interface IPktIcon extends PktElType {
|
|
|
217
212
|
'aria-hidden'?: Booleanish | undefined;
|
|
218
213
|
}
|
|
219
214
|
|
|
220
|
-
declare interface IPktInputWrapper extends
|
|
215
|
+
declare interface IPktInputWrapper extends Omit<PktElType, 'ref'> {
|
|
221
216
|
forId: string;
|
|
222
217
|
label: string;
|
|
223
218
|
helptext?: string | ReactNode | ReactNode[];
|
|
@@ -236,9 +231,9 @@ declare interface IPktInputWrapper extends RefAttributes<HTMLElement> {
|
|
|
236
231
|
inline?: boolean;
|
|
237
232
|
ariaDescribedby?: string;
|
|
238
233
|
useWrapper?: boolean;
|
|
239
|
-
children?: ReactNode | ReactNode[];
|
|
240
|
-
className?: string;
|
|
241
234
|
hasFieldset?: boolean;
|
|
235
|
+
ref?: LegacyRef<PktInputWrapper_2>;
|
|
236
|
+
onToggleHelpText?: (e: CustomEvent) => void;
|
|
242
237
|
}
|
|
243
238
|
|
|
244
239
|
declare interface IPktLink extends Omit<PktElType, 'onClick'> {
|
|
@@ -397,13 +392,11 @@ declare interface IPktTag extends PktElType {
|
|
|
397
392
|
onClose?: (e: CustomEvent) => void;
|
|
398
393
|
}
|
|
399
394
|
|
|
400
|
-
declare interface IPktTextarea extends
|
|
401
|
-
id: string;
|
|
395
|
+
declare interface IPktTextarea extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
402
396
|
ariaDescribedby?: string;
|
|
403
397
|
ariaLabelledby?: string;
|
|
404
398
|
counter?: boolean;
|
|
405
399
|
counterMaxLength?: number;
|
|
406
|
-
disabled?: boolean;
|
|
407
400
|
errorMessage?: string | ReactNode | ReactNode[];
|
|
408
401
|
hasError?: boolean;
|
|
409
402
|
helptext?: string | ReactNode | ReactNode[];
|
|
@@ -411,17 +404,14 @@ declare interface IPktTextarea extends Omit<PktElType, 'ref'> {
|
|
|
411
404
|
helptextDropdownButton?: string;
|
|
412
405
|
inline?: boolean;
|
|
413
406
|
fullwidth?: boolean;
|
|
414
|
-
label
|
|
415
|
-
name?: string;
|
|
407
|
+
label?: string;
|
|
416
408
|
optionalTag?: boolean;
|
|
417
409
|
optionalText?: string;
|
|
418
410
|
requiredTag?: boolean;
|
|
419
411
|
requiredText?: string;
|
|
420
|
-
placeholder?: string;
|
|
421
|
-
rows?: number;
|
|
422
412
|
useWrapper?: boolean;
|
|
423
413
|
value?: string;
|
|
424
|
-
ref?: LegacyRef<
|
|
414
|
+
ref?: LegacyRef<HTMLTextAreaElement>;
|
|
425
415
|
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
426
416
|
onInput?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
427
417
|
onBlur?: FocusEventHandler<HTMLTextAreaElement>;
|
|
@@ -430,13 +420,10 @@ declare interface IPktTextarea extends Omit<PktElType, 'ref'> {
|
|
|
430
420
|
onToggleHelpText?: (e: CustomEvent) => void;
|
|
431
421
|
}
|
|
432
422
|
|
|
433
|
-
declare interface IPktTextinput extends
|
|
434
|
-
id: string;
|
|
423
|
+
declare interface IPktTextinput extends InputHTMLAttributes<HTMLInputElement> {
|
|
435
424
|
ariaLabelledby?: string;
|
|
436
|
-
autocomplete?: string;
|
|
437
425
|
counter?: boolean;
|
|
438
426
|
counterMaxLength?: number;
|
|
439
|
-
disabled?: boolean;
|
|
440
427
|
errorMessage?: string | ReactNode | ReactNode[];
|
|
441
428
|
hasError?: boolean;
|
|
442
429
|
helptext?: string | ReactNode | ReactNode[];
|
|
@@ -445,20 +432,17 @@ declare interface IPktTextinput extends Omit<PktElType, 'ref'> {
|
|
|
445
432
|
iconNameRight?: string;
|
|
446
433
|
inline?: boolean;
|
|
447
434
|
fullwidth?: boolean;
|
|
448
|
-
label
|
|
449
|
-
name?: string;
|
|
435
|
+
label?: string;
|
|
450
436
|
optionalTag?: boolean;
|
|
451
437
|
optionalText?: string;
|
|
452
438
|
requiredTag?: boolean;
|
|
453
439
|
requiredText?: string;
|
|
454
|
-
placeholder?: string;
|
|
455
440
|
prefix?: string;
|
|
456
441
|
suffix?: string;
|
|
457
|
-
type?: string;
|
|
458
442
|
useWrapper?: boolean;
|
|
459
443
|
value?: string;
|
|
460
444
|
omitSearchIcon?: boolean;
|
|
461
|
-
ref?: LegacyRef<
|
|
445
|
+
ref?: LegacyRef<HTMLInputElement>;
|
|
462
446
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
463
447
|
onInput?: ChangeEventHandler<HTMLInputElement>;
|
|
464
448
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
@@ -578,7 +562,7 @@ export declare const PktCard: FC<IPktCard>;
|
|
|
578
562
|
|
|
579
563
|
export declare const PktCheckbox: default_2.ForwardRefExoticComponent<IPktCheckbox & default_2.RefAttributes<HTMLInputElement>>;
|
|
580
564
|
|
|
581
|
-
export declare const PktDatepicker: ForwardRefExoticComponent<IPktDatepicker>;
|
|
565
|
+
export declare const PktDatepicker: default_2.ForwardRefExoticComponent<IPktDatepicker>;
|
|
582
566
|
|
|
583
567
|
declare interface PktElType extends default_2.HTMLAttributes<HTMLElement> {
|
|
584
568
|
className?: string;
|
|
@@ -610,7 +594,7 @@ export declare const PktIcon: FC<IPktIcon>;
|
|
|
610
594
|
*/
|
|
611
595
|
export declare const PktInput: default_2.ForwardRefExoticComponent<InputProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
612
596
|
|
|
613
|
-
export declare const PktInputWrapper:
|
|
597
|
+
export declare const PktInputWrapper: FC<IPktInputWrapper>;
|
|
614
598
|
|
|
615
599
|
export declare const PktLink: FC<IPktLink>;
|
|
616
600
|
|
|
@@ -652,9 +636,9 @@ export declare const PktTabs: default_2.ForwardRefExoticComponent<ITabs & defaul
|
|
|
652
636
|
|
|
653
637
|
export declare const PktTag: FC<IPktTag>;
|
|
654
638
|
|
|
655
|
-
export declare const PktTextarea: ForwardRefExoticComponent<IPktTextarea>;
|
|
639
|
+
export declare const PktTextarea: default_2.ForwardRefExoticComponent<IPktTextarea>;
|
|
656
640
|
|
|
657
|
-
export declare const PktTextinput: ForwardRefExoticComponent<IPktTextinput>;
|
|
641
|
+
export declare const PktTextinput: default_2.ForwardRefExoticComponent<IPktTextinput>;
|
|
658
642
|
|
|
659
643
|
declare interface PreviewProps {
|
|
660
644
|
children?: ReactNode;
|