@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,6 +1,6 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
3
3
  children: React.ReactNode;
4
4
  }
5
- export default function Table({ children }: Props): JSX.Element;
5
+ export default function Table({ children, ...props }: Props): JSX.Element;
6
6
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  }
6
- export default function TableBody({ children, className }: Props): JSX.Element;
6
+ export default function TableBody({ children, className, ...props }: Props): JSX.Element;
7
7
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  condensed?: true;
6
6
  }
7
- export default function TableCell({ children, className, condensed }: Props): JSX.Element;
7
+ export default function TableCell({ children, className, condensed, ...props }: Props): JSX.Element;
8
8
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  }
6
- export default function TableHead({ children, className }: Props): JSX.Element;
6
+ export default function TableHead({ children, className, ...props }: Props): JSX.Element;
7
7
  export {};
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  textAlign?: 'left' | 'right' | 'center';
6
6
  sort?: string;
7
7
  condensed?: true;
8
8
  }
9
- export default function TableHeader({ children, className, sort, textAlign, condensed, }: Props): JSX.Element;
9
+ export default function TableHeader({ children, className, sort, textAlign, condensed, ...props }: Props): JSX.Element;
10
10
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  onClick?: () => void;
6
6
  }
7
- export default function TableRow({ children, className, onClick }: Props): JSX.Element;
7
+ export default function TableRow({ children, className, onClick, ...props }: Props): JSX.Element;
8
8
  export {};
@@ -721,6 +721,21 @@ function _extends() {
721
721
  return _extends.apply(this, arguments);
722
722
  }
723
723
 
724
+ function _objectWithoutPropertiesLoose(source, excluded) {
725
+ if (source == null) return {};
726
+ var target = {};
727
+ var sourceKeys = Object.keys(source);
728
+ var key, i;
729
+
730
+ for (i = 0; i < sourceKeys.length; i++) {
731
+ key = sourceKeys[i];
732
+ if (excluded.indexOf(key) >= 0) continue;
733
+ target[key] = source[key];
734
+ }
735
+
736
+ return target;
737
+ }
738
+
724
739
  var initialData = {
725
740
  id: undefined,
726
741
  status: 'new',
@@ -1150,7 +1165,7 @@ function Card(_ref) {
1150
1165
  var className = _ref.className,
1151
1166
  children = _ref.children;
1152
1167
  return React__default.createElement("div", {
1153
- className: (className != null ? className : '') + " flex flex-col items-start bg-white rounded-md shadow border border-gray-200 p-4 md:p-6"
1168
+ className: (className != null ? className : '') + " flex flex-col items-start bg-white rounded-md shadow-sm border border-gray-300 p-4 md:p-6"
1154
1169
  }, children);
1155
1170
  }
1156
1171
 
@@ -1457,17 +1472,20 @@ function Modal(_ref) {
1457
1472
  })))), React__default.createElement("div", null, children))))));
1458
1473
  }
1459
1474
 
1475
+ var _excluded = ["children"];
1460
1476
  function Table(_ref) {
1461
- var children = _ref.children;
1477
+ var children = _ref.children,
1478
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
1479
+
1462
1480
  return React__default.createElement("div", {
1463
1481
  className: "-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8 text-sm"
1464
1482
  }, React__default.createElement("div", {
1465
1483
  className: "inline-block min-w-full py-2 align-middle md:px-6 lg:px-8"
1466
1484
  }, React__default.createElement("div", {
1467
1485
  className: "overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg"
1468
- }, React__default.createElement("table", {
1486
+ }, React__default.createElement("table", Object.assign({}, props, {
1469
1487
  className: "min-w-full divide-y divide-gray-300"
1470
- }, children))));
1488
+ }), children))));
1471
1489
  }
1472
1490
 
1473
1491
  function TableActions(_ref) {
@@ -1479,35 +1497,43 @@ function TableActions(_ref) {
1479
1497
  }, children);
1480
1498
  }
1481
1499
 
1500
+ var _excluded$1 = ["children", "className"];
1482
1501
  function TableBody(_ref) {
1483
1502
  var children = _ref.children,
1484
- _ref$className = _ref.className,
1485
- className = _ref$className === void 0 ? '' : _ref$className;
1486
- return React__default.createElement("tbody", {
1487
- className: (className != null ? className : '') + " divide-y divide-gray-200 bg-white"
1488
- }, children);
1503
+ className = _ref.className,
1504
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1505
+
1506
+ return React__default.createElement("tbody", Object.assign({}, props, {
1507
+ className: cn(className, 'divide-y divide-gray-200 bg-white')
1508
+ }), children);
1489
1509
  }
1490
1510
 
1511
+ var _excluded$2 = ["children", "className", "condensed"];
1491
1512
  function TableCell(_ref) {
1492
1513
  var children = _ref.children,
1493
1514
  className = _ref.className,
1494
- condensed = _ref.condensed;
1495
- return React__default.createElement("td", {
1515
+ condensed = _ref.condensed,
1516
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1517
+
1518
+ return React__default.createElement("td", Object.assign({}, props, {
1496
1519
  className: cn(className, 'px-3 py-3 text-sm text-gray-500', {
1497
1520
  'w-0 whitespace-nowrap': condensed
1498
1521
  })
1499
- }, children);
1522
+ }), children);
1500
1523
  }
1501
1524
 
1525
+ var _excluded$3 = ["children", "className"];
1502
1526
  function TableHead(_ref) {
1503
1527
  var children = _ref.children,
1504
- _ref$className = _ref.className,
1505
- className = _ref$className === void 0 ? '' : _ref$className;
1506
- return React__default.createElement("thead", {
1507
- className: className + " px-3 py-4 text-sm text-white bg-gray-600"
1508
- }, children);
1528
+ className = _ref.className,
1529
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1530
+
1531
+ return React__default.createElement("thead", Object.assign({}, props, {
1532
+ className: cn(className, 'px-3 py-4 text-sm text-white bg-gray-600')
1533
+ }), children);
1509
1534
  }
1510
1535
 
1536
+ var _excluded$4 = ["children", "className", "sort", "textAlign", "condensed"];
1511
1537
  function TableHeader(_ref) {
1512
1538
  var children = _ref.children,
1513
1539
  _ref$className = _ref.className,
@@ -1515,7 +1541,8 @@ function TableHeader(_ref) {
1515
1541
  sort = _ref.sort,
1516
1542
  _ref$textAlign = _ref.textAlign,
1517
1543
  textAlign = _ref$textAlign === void 0 ? 'left' : _ref$textAlign,
1518
- condensed = _ref.condensed;
1544
+ condensed = _ref.condensed,
1545
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
1519
1546
 
1520
1547
  var _React$useState = React__default.useState(''),
1521
1548
  sortLink = _React$useState[0],
@@ -1538,11 +1565,11 @@ function TableHeader(_ref) {
1538
1565
  }
1539
1566
  }, []);
1540
1567
  var textAlignClass = textAlign === 'center' && 'text-center justify-center' || textAlign === 'right' && 'text-right justify-end' || 'text-left justify-between';
1541
- return React__default.createElement("th", {
1568
+ return React__default.createElement("th", Object.assign({}, props, {
1542
1569
  className: cn(className, 'py-3.5 px-3 text-sm font-semibold text-left', {
1543
1570
  'w-0 whitespace-nowrap': condensed
1544
1571
  })
1545
- }, React__default.createElement("div", {
1572
+ }), React__default.createElement("div", {
1546
1573
  className: "flex items-center gap-3 " + textAlignClass
1547
1574
  }, children, sort && React__default.createElement(react.Link, {
1548
1575
  href: sortLink
@@ -1560,17 +1587,20 @@ function TableHeader(_ref) {
1560
1587
  })))));
1561
1588
  }
1562
1589
 
1590
+ var _excluded$5 = ["children", "className", "onClick"];
1563
1591
  function TableRow(_ref) {
1564
1592
  var children = _ref.children,
1565
1593
  _ref$className = _ref.className,
1566
1594
  className = _ref$className === void 0 ? '' : _ref$className,
1567
1595
  _ref$onClick = _ref.onClick,
1568
- onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick;
1596
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
1597
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1598
+
1569
1599
  var bgClass = className.includes('bg') ? '' : 'bg-white even:bg-gray-50';
1570
- return React__default.createElement("tr", {
1571
- className: className + " " + bgClass + " hover:bg-gray-100",
1600
+ return React__default.createElement("tr", Object.assign({}, props, {
1601
+ className: cn(className, bgClass, 'hover:bg-gray-100'),
1572
1602
  onClick: onClick
1573
- }, children);
1603
+ }), children);
1574
1604
  }
1575
1605
 
1576
1606
  function DateOfBirthField(_ref) {