@oslokommune/punkt-react 12.41.0 → 12.42.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 +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/punkt-react.es.js +1450 -1427
- package/dist/punkt-react.umd.js +78 -78
- package/package.json +3 -3
- package/src/components/alert/Alert.test.tsx +16 -0
- package/src/components/alert/Alert.tsx +1 -0
- package/src/components/combobox/Combobox.tsx +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.42.0",
|
|
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.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.42.0",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "fdb019a20d3a46f588a23a1648fce810c54578a8"
|
|
116
116
|
}
|
|
@@ -33,6 +33,22 @@ describe('PktAlert', () => {
|
|
|
33
33
|
expect(onClose).toHaveBeenCalledTimes(1)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
+
test('renders with default role', async () => {
|
|
37
|
+
const { getByRole } = render(<PktAlert>Alert text</PktAlert>)
|
|
38
|
+
await window.customElements.whenDefined('pkt-alert')
|
|
39
|
+
const alert = getByRole('status')
|
|
40
|
+
expect(alert).toBeInTheDocument()
|
|
41
|
+
expect(alert).toHaveAttribute('role', 'status')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('renders with alert as role prop', async () => {
|
|
45
|
+
const { getByRole } = render(<PktAlert role="alert">Alert text</PktAlert>)
|
|
46
|
+
await window.customElements.whenDefined('pkt-alert')
|
|
47
|
+
const alert = getByRole('alert')
|
|
48
|
+
expect(alert).toBeInTheDocument()
|
|
49
|
+
expect(alert).toHaveAttribute('role', 'alert')
|
|
50
|
+
})
|
|
51
|
+
|
|
36
52
|
describe('accessibility', () => {
|
|
37
53
|
test('renders with no wcag errors with axe', async () => {
|
|
38
54
|
const { container } = render(<PktAlert title="Error" skin="error"></PktAlert>)
|
|
@@ -9,9 +9,10 @@ import React, {
|
|
|
9
9
|
FC,
|
|
10
10
|
LegacyRef,
|
|
11
11
|
forwardRef,
|
|
12
|
+
MouseEventHandler,
|
|
12
13
|
} from 'react'
|
|
13
14
|
import { PktCombobox as PktElCombobox } from '@oslokommune/punkt-elements'
|
|
14
|
-
import type { IPktCombobox as IPktElCombobox
|
|
15
|
+
import type { IPktCombobox as IPktElCombobox } from '@oslokommune/punkt-elements'
|
|
15
16
|
import { createComponent, EventName } from '@lit/react'
|
|
16
17
|
import { PktEventWithTarget } from '@/interfaces/IPktElements'
|
|
17
18
|
|
|
@@ -20,6 +21,7 @@ type ExtendedCombobox = Omit<IPktElCombobox, 'helptext'> & SelectHTMLAttributes<
|
|
|
20
21
|
export interface IPktCombobox extends ExtendedCombobox {
|
|
21
22
|
helptext?: string | ReactNode | ReactNode[]
|
|
22
23
|
ref?: LegacyRef<HTMLSelectElement>
|
|
24
|
+
onClick?: MouseEventHandler<HTMLSelectElement>
|
|
23
25
|
onChange?: ChangeEventHandler<HTMLSelectElement>
|
|
24
26
|
onInput?: ChangeEventHandler<HTMLSelectElement>
|
|
25
27
|
onBlur?: FocusEventHandler<HTMLSelectElement>
|
|
@@ -34,6 +36,7 @@ export const LitComponent = createComponent({
|
|
|
34
36
|
react: React,
|
|
35
37
|
displayName: 'PktCombobox',
|
|
36
38
|
events: {
|
|
39
|
+
onClick: 'click' as EventName<PktEventWithTarget>,
|
|
37
40
|
onChange: 'change' as EventName<PktEventWithTarget>,
|
|
38
41
|
onInput: 'input' as EventName<PktEventWithTarget>,
|
|
39
42
|
onBlur: 'blur' as EventName<FocusEvent>,
|