@oslokommune/punkt-react 12.40.5 → 12.40.7
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 +18 -0
- package/dist/index.d.ts +4 -4
- package/dist/punkt-react.es.js +2908 -2902
- package/dist/punkt-react.umd.js +255 -252
- package/package.json +4 -4
- package/src/components/textarea/Textarea.tsx +5 -6
- package/src/components/textinput/Textinput.tsx +13 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.40.
|
|
3
|
+
"version": "12.40.7",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.40.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.40.7",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
51
51
|
"@oslokommune/punkt-assets": "^12.39.2",
|
|
52
|
-
"@oslokommune/punkt-css": "^12.40.
|
|
52
|
+
"@oslokommune/punkt-css": "^12.40.7",
|
|
53
53
|
"@testing-library/jest-dom": "^6.5.0",
|
|
54
54
|
"@testing-library/react": "^16.0.1",
|
|
55
55
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "629308f7b56cbf42acb6305048ff3e363e25632b"
|
|
116
116
|
}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import React, {
|
|
4
4
|
ForwardRefExoticComponent,
|
|
5
|
-
LegacyRef,
|
|
6
5
|
ChangeEventHandler,
|
|
7
6
|
FocusEventHandler,
|
|
8
7
|
ReactNode,
|
|
9
8
|
TextareaHTMLAttributes,
|
|
10
|
-
FC,
|
|
11
9
|
forwardRef,
|
|
10
|
+
ForwardedRef,
|
|
12
11
|
} from 'react'
|
|
13
12
|
import { createComponent, EventName } from '@lit/react'
|
|
14
13
|
import { PktTextarea as PktEl } from '@oslokommune/punkt-elements'
|
|
@@ -33,7 +32,7 @@ export interface IPktTextarea extends TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
33
32
|
requiredText?: string
|
|
34
33
|
useWrapper?: boolean
|
|
35
34
|
value?: string
|
|
36
|
-
ref?:
|
|
35
|
+
ref?: ForwardedRef<HTMLTextAreaElement | IPktTextarea>
|
|
37
36
|
onChange?: ChangeEventHandler<HTMLTextAreaElement>
|
|
38
37
|
onInput?: ChangeEventHandler<HTMLTextAreaElement>
|
|
39
38
|
onBlur?: FocusEventHandler<HTMLTextAreaElement>
|
|
@@ -51,7 +50,7 @@ export const LitComponent = createComponent({
|
|
|
51
50
|
displayName: 'PktTextarea',
|
|
52
51
|
events: {
|
|
53
52
|
onChange: 'change' as EventName<PktEventWithTarget>,
|
|
54
|
-
onInput: '
|
|
53
|
+
onInput: 'input' as EventName<PktEventWithTarget>,
|
|
55
54
|
onBlur: 'blur' as EventName<FocusEvent>,
|
|
56
55
|
onFocus: 'focus' as EventName<FocusEvent>,
|
|
57
56
|
onValueChange: 'valueChange' as EventName<CustomEvent>,
|
|
@@ -59,8 +58,8 @@ export const LitComponent = createComponent({
|
|
|
59
58
|
},
|
|
60
59
|
}) as ForwardRefExoticComponent<IPktTextarea>
|
|
61
60
|
|
|
62
|
-
export const PktTextarea
|
|
63
|
-
({ helptext, ...props }, ref
|
|
61
|
+
export const PktTextarea = forwardRef<HTMLTextAreaElement | IPktTextarea, IPktTextarea>(
|
|
62
|
+
({ helptext, ...props }, ref) => {
|
|
64
63
|
return (
|
|
65
64
|
<LitComponent {...props} ref={ref}>
|
|
66
65
|
{helptext && (
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import React, {
|
|
4
4
|
ForwardRefExoticComponent,
|
|
5
|
-
LegacyRef,
|
|
6
5
|
ChangeEventHandler,
|
|
7
6
|
FocusEventHandler,
|
|
8
7
|
ReactNode,
|
|
9
8
|
InputHTMLAttributes,
|
|
10
|
-
FC,
|
|
11
9
|
forwardRef,
|
|
10
|
+
ForwardedRef,
|
|
12
11
|
} from 'react'
|
|
13
12
|
import { createComponent, EventName } from '@lit/react'
|
|
14
13
|
import { PktTextinput as PktEl } from '@oslokommune/punkt-elements'
|
|
@@ -36,7 +35,7 @@ export interface IPktTextinput extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
36
35
|
useWrapper?: boolean
|
|
37
36
|
value?: string
|
|
38
37
|
omitSearchIcon?: boolean
|
|
39
|
-
ref?:
|
|
38
|
+
ref?: ForwardedRef<HTMLInputElement>
|
|
40
39
|
onChange?: ChangeEventHandler<HTMLInputElement>
|
|
41
40
|
onInput?: ChangeEventHandler<HTMLInputElement>
|
|
42
41
|
onBlur?: FocusEventHandler<HTMLInputElement>
|
|
@@ -62,18 +61,16 @@ export const LitComponent = createComponent({
|
|
|
62
61
|
},
|
|
63
62
|
}) as ForwardRefExoticComponent<IPktTextinput>
|
|
64
63
|
|
|
65
|
-
export const PktTextinput
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
)
|
|
64
|
+
export const PktTextinput = forwardRef<HTMLInputElement, IPktTextinput>(({ helptext, ...props }, ref) => {
|
|
65
|
+
return (
|
|
66
|
+
<LitComponent {...props} ref={ref}>
|
|
67
|
+
{helptext && (
|
|
68
|
+
<div slot="helptext" className="pkt-contents">
|
|
69
|
+
{helptext}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
</LitComponent>
|
|
73
|
+
)
|
|
74
|
+
})
|
|
78
75
|
|
|
79
76
|
PktTextinput.displayName = 'PktTextinput'
|