@oslokommune/punkt-react 13.6.8 → 13.6.9

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.6.8",
3
+ "version": "13.6.9",
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",
@@ -110,5 +110,5 @@
110
110
  "url": "https://github.com/oslokommune/punkt/issues"
111
111
  },
112
112
  "license": "MIT",
113
- "gitHead": "79b8e663e5cd8ebdaa23497da8c37fbabf6a4aea"
113
+ "gitHead": "19d5e38b0ec004cae790d92c1b1956f06b6dcfc6"
114
114
  }
@@ -5,7 +5,7 @@ import * as React from 'react'
5
5
 
6
6
  export type TTableSkin = 'basic' | 'zebra-blue'
7
7
 
8
- interface ITableProps {
8
+ interface ITableProps extends React.HTMLAttributes<HTMLTableElement> {
9
9
  compact?: boolean
10
10
  skin?: 'basic' | 'zebra-blue'
11
11
  responsiveView?: boolean
@@ -19,6 +19,7 @@ export const PktTable = ({
19
19
  skin = 'basic',
20
20
  responsiveView = true,
21
21
  children,
22
+ ...props
22
23
  }: ITableProps) => {
23
24
  return (
24
25
  <table
@@ -30,6 +31,7 @@ export const PktTable = ({
30
31
  'pkt-table--zebra-blue': skin === 'zebra-blue',
31
32
  })}
32
33
  role="table"
34
+ {...props}
33
35
  >
34
36
  {children}
35
37
  </table>
@@ -3,13 +3,13 @@
3
3
  import classNames from 'classnames'
4
4
  import * as React from 'react'
5
5
 
6
- interface ITableBodyProps {
6
+ interface ITableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
7
7
  className?: string
8
8
  children: React.ReactNode
9
9
  }
10
10
 
11
- export const PktTableBody = ({ children, className }: ITableBodyProps) => (
12
- <tbody className={classNames(className, 'pkt-table__body', {})} role="rowgroup">
11
+ export const PktTableBody = ({ id, children, className, ...props }: ITableBodyProps) => (
12
+ <tbody id={id} className={classNames(className, 'pkt-table__body', {})} {...props} role="rowgroup">
13
13
  {children}
14
14
  </tbody>
15
15
  )
@@ -1,9 +1,15 @@
1
1
  'use client'
2
2
 
3
+ import classNames from 'classnames'
3
4
  import * as React from 'react'
4
5
 
5
- interface TableDataProps {
6
+ interface TableDataProps extends React.HTMLAttributes<HTMLTableCellElement> {
7
+ className?: string
6
8
  children: React.ReactNode | React.ReactNode[]
7
9
  }
8
10
 
9
- export const PktTableData = ({ children }: TableDataProps) => <td className="pkt-table__th">{children}</td>
11
+ export const PktTableData = ({ children, className, ...props }: TableDataProps) => (
12
+ <td className={classNames(className, 'pkt-table__th')} {...props} role="cell">
13
+ {children}
14
+ </td>
15
+ )
@@ -3,18 +3,19 @@
3
3
  import classNames from 'classnames'
4
4
  import * as React from 'react'
5
5
 
6
- interface ITableDataCellProps {
6
+ interface ITableDataCellProps extends React.HTMLAttributes<HTMLTableCellElement> {
7
7
  className?: string
8
8
  children?: React.ReactNode
9
9
  dataLabel?: string
10
10
  }
11
11
 
12
- export const PktTableDataCell = ({ children, className, dataLabel }: ITableDataCellProps) => (
12
+ export const PktTableDataCell = ({ children, className, dataLabel, ...props }: ITableDataCellProps) => (
13
13
  <td
14
14
  className={classNames(className, 'pkt-table__data-cell', {})}
15
15
  data-label={dataLabel}
16
16
  role="cell"
17
17
  data-testid="pkt-table__data-cell"
18
+ {...props}
18
19
  >
19
20
  {children}
20
21
  </td>
@@ -3,13 +3,13 @@
3
3
  import classNames from 'classnames'
4
4
  import * as React from 'react'
5
5
 
6
- interface ITableHeaderProps {
6
+ interface ITableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
7
7
  className?: string
8
8
  children: React.ReactNode
9
9
  }
10
10
 
11
- export const PktTableHeader = ({ className, children }: ITableHeaderProps) => (
12
- <thead className={classNames(className, 'pkt-table__header', {})} role="rowgroup">
11
+ export const PktTableHeader = ({ className, children, ...props }: ITableHeaderProps) => (
12
+ <thead className={classNames(className, 'pkt-table__header', {})} role="rowgroup" {...props}>
13
13
  {children}
14
14
  </thead>
15
15
  )
@@ -3,13 +3,13 @@
3
3
  import classNames from 'classnames'
4
4
  import * as React from 'react'
5
5
 
6
- interface ITableHeaderCellProps {
6
+ interface ITableHeaderCellProps extends React.HTMLAttributes<HTMLTableCellElement> {
7
7
  className?: string
8
8
  children: React.ReactNode
9
9
  }
10
10
 
11
- export const PktTableHeaderCell = ({ className, children }: ITableHeaderCellProps) => (
12
- <th className={classNames(className, 'pkt-table__header-cell', {})} role="columnheader">
11
+ export const PktTableHeaderCell = ({ className, children, ...props }: ITableHeaderCellProps) => (
12
+ <th className={classNames(className, 'pkt-table__header-cell', {})} role="columnheader" {...props}>
13
13
  {children}
14
14
  </th>
15
15
  )
@@ -3,13 +3,13 @@
3
3
  import classNames from 'classnames'
4
4
  import * as React from 'react'
5
5
 
6
- interface ITableRowProps {
6
+ interface ITableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
7
7
  className?: string
8
8
  children: React.ReactNode
9
9
  }
10
10
 
11
- export const PktTableRow = ({ className, children }: ITableRowProps) => (
12
- <tr className={classNames(className, 'pkt-table__row', {})} role="row">
11
+ export const PktTableRow = ({ className, children, ...props }: ITableRowProps) => (
12
+ <tr className={classNames(className, 'pkt-table__row', {})} role="row" {...props}>
13
13
  {children}
14
14
  </tr>
15
15
  )