@oslokommune/punkt-react 13.15.4 → 13.15.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "13.15.4",
3
+ "version": "13.15.6",
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",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@lit-labs/ssr-dom-shim": "^1.2.1",
41
41
  "@lit/react": "^1.0.7",
42
- "@oslokommune/punkt-elements": "^13.15.4",
42
+ "@oslokommune/punkt-elements": "^13.15.6",
43
43
  "classnames": "^2.5.1",
44
44
  "prettier": "^3.3.3",
45
45
  "react-hook-form": "^7.53.0"
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@babel/plugin-transform-private-property-in-object": "^7.25.9",
49
49
  "@oslokommune/punkt-assets": "^13.11.0",
50
- "@oslokommune/punkt-css": "^13.13.2",
50
+ "@oslokommune/punkt-css": "^13.15.6",
51
51
  "@testing-library/jest-dom": "^6.5.0",
52
52
  "@testing-library/react": "^16.0.1",
53
53
  "@testing-library/user-event": "^14.5.2",
@@ -103,5 +103,5 @@
103
103
  "url": "https://github.com/oslokommune/punkt/issues"
104
104
  },
105
105
  "license": "MIT",
106
- "gitHead": "8dfa3ea66ce109be75ef7928d1a9ad6730cb3dd7"
106
+ "gitHead": "23a8027ca807e77008e03ec3d553c87f52db6f81"
107
107
  }
@@ -29,6 +29,7 @@ export const PktAlert: FC<IPktAlert> = ({
29
29
  'aria-live': ariaLiveKebab = 'polite' as TAriaLive,
30
30
  role = 'status',
31
31
  skin = 'info' as TAlertSkin,
32
+ className,
32
33
  ...props
33
34
  }: IPktAlert): ReactElement => {
34
35
  const [isClosed, setIsClosed] = useState(false)
@@ -54,7 +55,7 @@ export const PktAlert: FC<IPktAlert> = ({
54
55
  const ariaLive = ariaLiveCamel || ariaLiveKebab
55
56
 
56
57
  return (
57
- <div {...props} aria-live={ariaLive} role={role} className={classNames(classes)}>
58
+ <div {...props} aria-live={ariaLive} role={role} className={classNames(classes, className)}>
58
59
  <div className={classNames(gridClasses)}>
59
60
  <PktIcon
60
61
  className="pkt-alert__icon"
@@ -47,9 +47,9 @@ describe('Messagebox', () => {
47
47
  expect(titleElement.innerHTML).toEqual('Message<strong>box</strong> title')
48
48
  })
49
49
 
50
- it('should render empty title element when no title specified', async () => {
50
+ it('should not render empty title element when no title specified', async () => {
51
51
  const { messageBox } = render(<PktMessagebox title={''} />)
52
- expect(messageBox.querySelector('.pkt-messagebox__title')).toBeInTheDocument()
52
+ expect(messageBox.querySelector('.pkt-messagebox__title')).not.toBeInTheDocument()
53
53
  })
54
54
 
55
55
  it('closable', async () => {
@@ -47,7 +47,7 @@ export const PktMessagebox: FC<IPktMessagebox> = ({
47
47
  return (
48
48
  <div {...props} className={classNames(classes, className)} ref={componentRootRef}>
49
49
  {closable && (
50
- <div className={'"pkt-messagebox__close"'}>
50
+ <div className={'pkt-messagebox__close'}>
51
51
  <button
52
52
  onClick={close}
53
53
  className={'pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only'}
@@ -57,7 +57,7 @@ export const PktMessagebox: FC<IPktMessagebox> = ({
57
57
  </button>
58
58
  </div>
59
59
  )}
60
- <div className="pkt-messagebox__title">{title}</div>
60
+ {title && <div className="pkt-messagebox__title">{title}</div>}
61
61
  <div className={'pkt-messagebox__text'}>{children}</div>
62
62
  </div>
63
63
  )