@oslokommune/punkt-react 14.5.0 → 14.5.2
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 +16 -19
- package/dist/punkt-react.es.js +1308 -1382
- package/dist/punkt-react.umd.js +154 -182
- package/package.json +9 -3
- package/src/components/accordion/Accordion.test.tsx +4 -2
- package/src/components/accordion/Accordion.tsx +1 -1
- package/src/components/accordion/AccordionItem.tsx +3 -3
- package/src/components/alert/Alert.test.tsx +4 -5
- package/src/components/alert/Alert.tsx +5 -4
- package/src/components/backlink/BackLink.tsx +3 -3
- package/src/components/breadcrumbs/Breadcrumbs.test.tsx +4 -1
- package/src/components/breadcrumbs/Breadcrumbs.tsx +3 -5
- package/src/components/button/Button.test.tsx +5 -3
- package/src/components/button/Button.tsx +1 -2
- package/src/components/card/Card.tsx +6 -3
- package/src/components/checkbox/Checkbox.test.tsx +1 -1
- package/src/components/checkbox/Checkbox.tsx +10 -2
- package/src/components/combobox/Combobox.tsx +9 -8
- package/src/components/consent/Consent.tsx +3 -3
- package/src/components/datepicker/Datepicker.test.tsx +3 -1
- package/src/components/datepicker/Datepicker.tsx +11 -8
- package/src/components/footer/Footer.test.tsx +1 -1
- package/src/components/footer/Footer.tsx +3 -3
- package/src/components/footerSimple/FooterSimple.test.tsx +1 -1
- package/src/components/footerSimple/FooterSimple.tsx +3 -3
- package/src/components/header/Header.test.tsx +0 -1
- package/src/components/header/Header.tsx +1 -0
- package/src/components/header/HeaderService.test.tsx +2 -2
- package/src/components/header/HeaderService.tsx +34 -15
- package/src/components/header/types.ts +8 -8
- package/src/components/headerUserMenu/UserMenu.test.tsx +3 -3
- package/src/components/headerUserMenu/UserMenu.tsx +6 -2
- package/src/components/heading/Heading.test.tsx +4 -2
- package/src/components/heading/Heading.tsx +6 -5
- package/src/components/helptext/Helptext.tsx +3 -2
- package/src/components/icon/Icon.test.tsx +0 -1
- package/src/components/icon/Icon.tsx +4 -5
- package/src/components/input/Input.tsx +4 -5
- package/src/components/inputwrapper/InputWrapper.tsx +2 -1
- package/src/components/interfaces.ts +1 -1
- package/src/components/loader/Loader.test.tsx +0 -1
- package/src/components/loader/Loader.tsx +6 -4
- package/src/components/messagebox/Messagebox.tsx +1 -1
- package/src/components/modal/Modal.test.tsx +5 -6
- package/src/components/modal/Modal.tsx +4 -2
- package/src/components/progressbar/Progressbar.test.tsx +5 -3
- package/src/components/progressbar/Progressbar.tsx +6 -4
- package/src/components/radio/RadioButton.tsx +9 -3
- package/src/components/searchinput/SearchInput.test.tsx +3 -3
- package/src/components/searchinput/SearchInput.tsx +5 -1
- package/src/components/select/Select.test.tsx +0 -1
- package/src/components/select/Select.tsx +2 -0
- package/src/components/stepper/Step.tsx +2 -1
- package/src/components/stepper/Stepper.test.tsx +5 -3
- package/src/components/stepper/Stepper.tsx +5 -3
- package/src/components/table/Table.test.tsx +6 -6
- package/src/components/table/Table.tsx +2 -3
- package/src/components/table/TableBody.tsx +2 -3
- package/src/components/table/TableData.tsx +2 -3
- package/src/components/table/TableDataCell.tsx +2 -3
- package/src/components/table/TableHeader.tsx +2 -3
- package/src/components/table/TableHeaderCell.tsx +2 -3
- package/src/components/table/TableRow.tsx +2 -3
- package/src/components/tabs/TabItem.tsx +4 -4
- package/src/components/tabs/Tabs.test.tsx +5 -4
- package/src/components/tabs/Tabs.tsx +8 -5
- package/src/components/textarea/Textarea.test.tsx +0 -1
- package/src/components/textarea/Textarea.tsx +9 -4
- package/src/components/textinput/Textinput.tsx +11 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
4
|
ChangeEvent,
|
|
5
5
|
ChangeEventHandler,
|
|
6
6
|
ForwardedRef,
|
|
@@ -79,7 +79,7 @@ export const PktTextarea = forwardRef(
|
|
|
79
79
|
autoComplete = 'off',
|
|
80
80
|
minLength,
|
|
81
81
|
maxLength,
|
|
82
|
-
readOnly
|
|
82
|
+
readOnly,
|
|
83
83
|
skipForwardTestid = false,
|
|
84
84
|
...props
|
|
85
85
|
}: IPktTextarea,
|
|
@@ -94,9 +94,11 @@ export const PktTextarea = forwardRef(
|
|
|
94
94
|
const [counterCurrent, setCounterCurrent] = useState(0)
|
|
95
95
|
|
|
96
96
|
const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
|
97
|
-
|
|
97
|
+
if (counter) {
|
|
98
|
+
setCounterCurrent(e.currentTarget?.value?.length || 0)
|
|
99
|
+
}
|
|
98
100
|
if (onChange) {
|
|
99
|
-
|
|
101
|
+
onChange(e)
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
@@ -148,9 +150,12 @@ export const PktTextarea = forwardRef(
|
|
|
148
150
|
autoComplete={autoComplete}
|
|
149
151
|
minLength={minLength}
|
|
150
152
|
maxLength={maxLength}
|
|
153
|
+
readOnly={readOnly}
|
|
151
154
|
data-skip-forward-testid={skipForwardTestid ? 'true' : undefined}
|
|
152
155
|
/>
|
|
153
156
|
</PktInputWrapper>
|
|
154
157
|
)
|
|
155
158
|
},
|
|
156
159
|
)
|
|
160
|
+
|
|
161
|
+
PktTextarea.displayName = 'PktTextarea'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
ChangeEvent,
|
|
5
|
+
ChangeEventHandler,
|
|
4
6
|
ForwardedRef,
|
|
5
7
|
forwardRef,
|
|
6
8
|
InputHTMLAttributes,
|
|
9
|
+
ReactNode,
|
|
7
10
|
useEffect,
|
|
8
11
|
useState,
|
|
9
|
-
ChangeEvent,
|
|
10
|
-
ReactNode,
|
|
11
|
-
ChangeEventHandler,
|
|
12
12
|
} from 'react'
|
|
13
13
|
|
|
14
14
|
import { PktIcon } from '../icon/Icon'
|
|
@@ -96,7 +96,7 @@ export const PktTextinput = forwardRef(
|
|
|
96
96
|
max,
|
|
97
97
|
step,
|
|
98
98
|
size,
|
|
99
|
-
readonly,
|
|
99
|
+
readonly: readOnly,
|
|
100
100
|
required,
|
|
101
101
|
dataTestid,
|
|
102
102
|
onChange,
|
|
@@ -117,7 +117,9 @@ export const PktTextinput = forwardRef(
|
|
|
117
117
|
const labelledBy = ariaLabelledby || labelId
|
|
118
118
|
|
|
119
119
|
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
120
|
-
|
|
120
|
+
if (counter) {
|
|
121
|
+
setCounterCurrent(event.currentTarget?.value?.length || 0)
|
|
122
|
+
}
|
|
121
123
|
if (onChange) {
|
|
122
124
|
onChange(event)
|
|
123
125
|
}
|
|
@@ -181,6 +183,7 @@ export const PktTextinput = forwardRef(
|
|
|
181
183
|
minLength={minLength}
|
|
182
184
|
maxLength={maxLength}
|
|
183
185
|
size={size}
|
|
186
|
+
readOnly={readOnly}
|
|
184
187
|
required={required}
|
|
185
188
|
/>
|
|
186
189
|
{suffix && (
|
|
@@ -198,3 +201,5 @@ export const PktTextinput = forwardRef(
|
|
|
198
201
|
)
|
|
199
202
|
},
|
|
200
203
|
)
|
|
204
|
+
|
|
205
|
+
PktTextinput.displayName = 'PktTextinput'
|