@star-insure/sdk 2.0.6 → 2.0.8

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.
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- interface Props {
4
+ interface Props extends React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement> {
5
5
  children: React.ReactNode;
6
6
  className?: string;
7
7
  condensed?: true;
8
8
  }
9
9
 
10
- export default function TableCell({ children, className, condensed }: Props) {
10
+ export default function TableCell({ children, className, condensed, ...props }: Props) {
11
11
  return (
12
- <td className={cn(className, 'px-3 py-3 text-sm text-gray-500', {
12
+ <td {...props} className={cn(className, 'px-3 py-3 text-sm text-gray-500', {
13
13
  'w-0 whitespace-nowrap': condensed,
14
14
  })}>
15
15
  {children}
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
+ import cn from 'classnames';
2
3
 
3
- interface Props {
4
+ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
4
5
  children: React.ReactNode;
5
6
  className?: string;
6
7
  }
7
8
 
8
- export default function TableHead({ children, className = '' }: Props) {
9
+ export default function TableHead({ children, className, ...props }: Props) {
9
10
  return (
10
- <thead className={`${className} px-3 py-4 text-sm text-white bg-gray-600`}>
11
+ <thead {...props} className={cn(className, 'px-3 py-4 text-sm text-white bg-gray-600')}>
11
12
  {children}
12
13
  </thead>
13
14
  )
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Link } from '@inertiajs/react';
3
3
  import cn from 'classnames';
4
4
 
5
- interface Props {
5
+ interface Props extends React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement> {
6
6
  children: React.ReactNode;
7
7
  className?: string;
8
8
  textAlign?: 'left' | 'right' | 'center';
@@ -16,6 +16,7 @@ export default function TableHeader({
16
16
  sort,
17
17
  textAlign = 'left',
18
18
  condensed,
19
+ ...props
19
20
  }: Props) {
20
21
  const [sortLink, setSortLink] = React.useState<string>('');
21
22
 
@@ -42,7 +43,7 @@ export default function TableHeader({
42
43
  'text-left justify-between';
43
44
 
44
45
  return (
45
- <th className={cn(className, 'py-3.5 px-3 text-sm font-semibold text-left', {
46
+ <th {...props} className={cn(className, 'py-3.5 px-3 text-sm font-semibold text-left', {
46
47
  'w-0 whitespace-nowrap': condensed,
47
48
  })}>
48
49
  <div className={`flex items-center gap-3 ${textAlignClass}`}>
@@ -1,16 +1,17 @@
1
1
  import React from 'react';
2
+ import cn from 'classnames';
2
3
 
3
- interface Props {
4
+ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
4
5
  children: React.ReactNode;
5
6
  className?: string;
6
7
  onClick?: () => void;
7
8
  }
8
9
 
9
- export default function TableRow({ children, className = '', onClick = () => {} }: Props) {
10
+ export default function TableRow({ children, className = '', onClick = () => {}, ...props }: Props) {
10
11
  const bgClass = className.includes('bg') ? '' : 'bg-white even:bg-gray-50'
11
12
 
12
13
  return (
13
- <tr className={`${className} ${bgClass} hover:bg-gray-100`} onClick={onClick}>
14
+ <tr {...props} className={cn(className, bgClass, 'hover:bg-gray-100')} onClick={onClick}>
14
15
  {children}
15
16
  </tr>
16
17
  )