@luscii-healthtech/web-ui 0.4.6 → 0.5.2

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.
Files changed (37) hide show
  1. package/dist/components/Table/Table.d.ts +15 -0
  2. package/dist/components/Table/Table.types.d.ts +22 -0
  3. package/dist/components/Table/Table.utils.d.ts +3 -0
  4. package/dist/components/Table/TableBody.d.ts +13 -0
  5. package/dist/components/Table/TableBodyRow.d.ts +10 -0
  6. package/dist/components/Table/TableBodyRowDataCell.d.ts +8 -0
  7. package/dist/components/Table/TableFooter.d.ts +8 -0
  8. package/dist/components/Table/TableHeader.d.ts +7 -0
  9. package/dist/index.d.ts +2 -1
  10. package/dist/web-ui-tailwind.css +77 -34
  11. package/dist/web-ui.cjs.development.js +232 -235
  12. package/dist/web-ui.cjs.development.js.map +1 -1
  13. package/dist/web-ui.cjs.production.min.js +1 -1
  14. package/dist/web-ui.cjs.production.min.js.map +1 -1
  15. package/dist/web-ui.esm.js +232 -235
  16. package/dist/web-ui.esm.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/components/LoadingIndicator/LoadingIndicator.tsx +2 -1
  19. package/src/components/PaginationMenu/PaginationMenu.tsx +7 -1
  20. package/src/components/Table/Table.tsx +87 -0
  21. package/src/components/Table/Table.types.ts +27 -0
  22. package/src/components/Table/Table.utils.ts +23 -0
  23. package/src/components/Table/TableBody.tsx +57 -0
  24. package/src/components/Table/TableBodyRow.tsx +47 -0
  25. package/src/components/Table/TableBodyRowDataCell.tsx +74 -0
  26. package/src/components/Table/TableFooter.tsx +21 -0
  27. package/src/components/Table/TableHeader.tsx +28 -0
  28. package/src/components/Tag/Tag.tsx +2 -2
  29. package/src/index.tsx +6 -5
  30. package/dist/components/ListTable/ListTable.d.ts +0 -34
  31. package/dist/components/ListTable/ListTableCell.d.ts +0 -10
  32. package/dist/components/ListTable/ListTableHeader.d.ts +0 -7
  33. package/dist/components/ListTable/ListTableRow.d.ts +0 -9
  34. package/src/components/ListTable/ListTable.tsx +0 -179
  35. package/src/components/ListTable/ListTableCell.tsx +0 -80
  36. package/src/components/ListTable/ListTableHeader.tsx +0 -33
  37. package/src/components/ListTable/ListTableRow.tsx +0 -46
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
3
+ import { TableFieldConfig } from "./Table.types";
4
+ export interface TableProps<Item> extends React.HTMLAttributes<HTMLTableElement> {
5
+ items?: Item[];
6
+ fieldConfigurations: TableFieldConfig<Item>[];
7
+ emptyRowsText: string;
8
+ emptyFieldContentText?: string;
9
+ isLoading?: boolean;
10
+ showHeader?: boolean;
11
+ paginationMenuProps?: PaginationMenuProps;
12
+ onRowClick?: (item: Item) => void;
13
+ className?: string;
14
+ }
15
+ export declare function Table<Item>({ items, fieldConfigurations, emptyRowsText, emptyFieldContentText, isLoading, showHeader, paginationMenuProps, onRowClick, className, ...otherAttributes }: TableProps<Item>): JSX.Element;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "../Icons/types/IconProps.type";
3
+ import { TagColorTheme } from "../Tag/Tag";
4
+ export interface TableFieldConfig<Item> {
5
+ key: string;
6
+ headerText?: string;
7
+ content: (item: Item) => TableFieldContent<Item>;
8
+ onlyShowContentOnHovering?: boolean;
9
+ }
10
+ export declare type TableFieldContent<Item> = TableFieldText | [TableFieldAction<Item>?, TableFieldAction<Item>?];
11
+ export interface TableFieldText {
12
+ text: string;
13
+ tag?: {
14
+ text: string;
15
+ color: TagColorTheme;
16
+ };
17
+ }
18
+ export interface TableFieldAction<Item> {
19
+ key: string;
20
+ icon: React.FunctionComponent<IconProps>;
21
+ handleClick: (item: Item) => void;
22
+ }
@@ -0,0 +1,3 @@
1
+ import { TableFieldText, TableFieldAction, TableFieldContent } from "./Table.types";
2
+ export declare function isTableFieldText<Item>(content: TableFieldContent<Item>): content is TableFieldText;
3
+ export declare function isTableFieldAction<Item>(content: TableFieldContent<Item>): content is [TableFieldAction<Item>?, TableFieldAction<Item>?];
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { TableFieldConfig } from "./Table.types";
3
+ export interface TableBody<Item> {
4
+ items?: Item[];
5
+ fieldConfigurations: TableFieldConfig<Item>[];
6
+ emptyItemsText: string;
7
+ emptyFieldContentText?: string;
8
+ isLoading: boolean;
9
+ showEmptyView: boolean;
10
+ onRowClick?: (item: Item) => void;
11
+ className?: string;
12
+ }
13
+ export declare function TableBody<Item>(props: TableBody<Item>): JSX.Element;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { TableFieldConfig } from "./Table.types";
3
+ export interface TableBodyRowProps<Item> {
4
+ item: Item;
5
+ fieldConfigurations: TableFieldConfig<Item>[];
6
+ emptyFieldContentText?: string;
7
+ onClick?: (item: Item) => void;
8
+ className?: string;
9
+ }
10
+ export declare function TableBodyRow<Item>(props: TableBodyRowProps<Item>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { TableFieldConfig } from "./Table.types";
3
+ export interface TableBodyRowDataCellProps<Item> {
4
+ item: Item;
5
+ fieldConfig: TableFieldConfig<Item>;
6
+ emptyFieldContentText?: string;
7
+ }
8
+ export declare function TableBodyRowDataCell<Item>(props: TableBodyRowDataCellProps<Item>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
3
+ interface TableFooterProps {
4
+ colSpan: number;
5
+ paginationMenuProps: PaginationMenuProps;
6
+ }
7
+ export declare const TableFooter: (props: TableFooterProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { TableFieldConfig } from "./Table.types";
3
+ export interface TableHeaderProps<Item> {
4
+ fieldConfigurations: TableFieldConfig<Item>[];
5
+ className?: string;
6
+ }
7
+ export declare function TableHeader<Item>(props: TableHeaderProps<Item>): JSX.Element;
package/dist/index.d.ts CHANGED
@@ -17,7 +17,8 @@ export { default as InfoBlock } from "./components/InfoBlock/InfoBlock";
17
17
  export { InfoField } from "./components/InfoField/InfoField";
18
18
  export { INPUT_TYPES, default as Input } from "./components/Input/Input";
19
19
  export { default as Line } from "./components/Line/Line";
20
- export { ListTable, ListTableProps, ListTablePropsConfiguration, ListTablePropsConfigurationField, } from "./components/ListTable/ListTable";
20
+ export { Table, TableProps } from "./components/Table/Table";
21
+ export { TableFieldConfig, TableFieldContent, TableFieldText, TableFieldAction, } from "./components/Table/Table.types";
21
22
  export { LoadingIndicator, LoadingIndicatorProps, } from "./components/LoadingIndicator/LoadingIndicator";
22
23
  export { default as Menu } from "./components/Menu/Menu";
23
24
  export { MultiSelect } from "./components/MultiSelect/MultiSelect";
@@ -751,6 +751,12 @@ video {
751
751
  background-color: rgba(113, 128, 150, var(--bg-opacity));
752
752
  }
753
753
 
754
+ .hover\:bg-blue-50:hover {
755
+ --bg-opacity: 1;
756
+ background-color: #F2FAFD;
757
+ background-color: rgba(242, 250, 253, var(--bg-opacity));
758
+ }
759
+
754
760
  .hover\:bg-blue-900:hover {
755
761
  --bg-opacity: 1;
756
762
  background-color: #045BAA;
@@ -948,6 +954,10 @@ video {
948
954
  border-style: solid;
949
955
  }
950
956
 
957
+ .last\:border-none:last-child {
958
+ border-style: none;
959
+ }
960
+
951
961
  .border-2 {
952
962
  border-width: 2px;
953
963
  }
@@ -972,6 +982,10 @@ video {
972
982
  border-left-width: 1px;
973
983
  }
974
984
 
985
+ .last\:border-r:last-child {
986
+ border-right-width: 1px;
987
+ }
988
+
975
989
  .cursor-default {
976
990
  cursor: default;
977
991
  }
@@ -988,6 +1002,10 @@ video {
988
1002
  display: block;
989
1003
  }
990
1004
 
1005
+ .inline-block {
1006
+ display: inline-block;
1007
+ }
1008
+
991
1009
  .inline {
992
1010
  display: inline;
993
1011
  }
@@ -1096,24 +1114,12 @@ video {
1096
1114
  height: 1.5rem;
1097
1115
  }
1098
1116
 
1099
- .h-8 {
1100
- height: 2rem;
1101
- }
1102
-
1103
1117
  .h-11 {
1104
1118
  height: 2.75rem;
1105
1119
  }
1106
1120
 
1107
- .h-13 {
1108
- height: 3.25rem;
1109
- }
1110
-
1111
- .h-16 {
1112
- height: 4rem;
1113
- }
1114
-
1115
- .h-20 {
1116
- height: 5rem;
1121
+ .h-12 {
1122
+ height: 3rem;
1117
1123
  }
1118
1124
 
1119
1125
  .h-56 {
@@ -1164,6 +1170,10 @@ video {
1164
1170
  font-size: 4rem;
1165
1171
  }
1166
1172
 
1173
+ .leading-5 {
1174
+ line-height: 1.25rem;
1175
+ }
1176
+
1167
1177
  .leading-none {
1168
1178
  line-height: 1;
1169
1179
  }
@@ -1229,6 +1239,10 @@ video {
1229
1239
  margin-left: 0.5rem;
1230
1240
  }
1231
1241
 
1242
+ .mt-3 {
1243
+ margin-top: 0.75rem;
1244
+ }
1245
+
1232
1246
  .mr-3 {
1233
1247
  margin-right: 0.75rem;
1234
1248
  }
@@ -1285,6 +1299,14 @@ video {
1285
1299
  margin-left: 0.625rem;
1286
1300
  }
1287
1301
 
1302
+ .first\:ml-0:first-child {
1303
+ margin-left: 0;
1304
+ }
1305
+
1306
+ .last\:mr-0:last-child {
1307
+ margin-right: 0;
1308
+ }
1309
+
1288
1310
  .max-h-78 {
1289
1311
  max-height: 19.5rem;
1290
1312
  }
@@ -1293,18 +1315,10 @@ video {
1293
1315
  max-height: 100vh;
1294
1316
  }
1295
1317
 
1296
- .max-w-40 {
1297
- max-width: 10rem;
1298
- }
1299
-
1300
1318
  .max-w-3xl {
1301
1319
  max-width: 48rem;
1302
1320
  }
1303
1321
 
1304
- .max-w-full {
1305
- max-width: 100%;
1306
- }
1307
-
1308
1322
  .min-w-24 {
1309
1323
  min-width: 1.5rem;
1310
1324
  }
@@ -1329,6 +1343,10 @@ video {
1329
1343
  opacity: 1;
1330
1344
  }
1331
1345
 
1346
+ .group:hover .group-hover\:opacity-100 {
1347
+ opacity: 1;
1348
+ }
1349
+
1332
1350
  .outline-primary {
1333
1351
  outline: 4px solid rgba(0, 159, 227, 0.3);
1334
1352
  outline-offset: 0;
@@ -1418,6 +1436,11 @@ video {
1418
1436
  padding-right: 1.25rem;
1419
1437
  }
1420
1438
 
1439
+ .py-6 {
1440
+ padding-top: 1.5rem;
1441
+ padding-bottom: 1.5rem;
1442
+ }
1443
+
1421
1444
  .px-6 {
1422
1445
  padding-left: 1.5rem;
1423
1446
  padding-right: 1.5rem;
@@ -1460,6 +1483,14 @@ video {
1460
1483
  padding-bottom: 5rem;
1461
1484
  }
1462
1485
 
1486
+ .first\:pl-6:first-child {
1487
+ padding-left: 1.5rem;
1488
+ }
1489
+
1490
+ .last\:pr-6:last-child {
1491
+ padding-right: 1.5rem;
1492
+ }
1493
+
1463
1494
  .placeholder-gray-500:-ms-input-placeholder {
1464
1495
  --placeholder-opacity: 1;
1465
1496
  color: #a0aec0;
@@ -1572,6 +1603,10 @@ video {
1572
1603
  stroke: currentColor;
1573
1604
  }
1574
1605
 
1606
+ .table-auto {
1607
+ table-layout: auto;
1608
+ }
1609
+
1575
1610
  .text-left {
1576
1611
  text-align: left;
1577
1612
  }
@@ -1750,10 +1785,6 @@ video {
1750
1785
  text-transform: uppercase;
1751
1786
  }
1752
1787
 
1753
- .capitalize {
1754
- text-transform: capitalize;
1755
- }
1756
-
1757
1788
  .underline {
1758
1789
  text-decoration: underline;
1759
1790
  }
@@ -1767,6 +1798,10 @@ video {
1767
1798
  user-select: none;
1768
1799
  }
1769
1800
 
1801
+ .align-top {
1802
+ vertical-align: top;
1803
+ }
1804
+
1770
1805
  .visible {
1771
1806
  visibility: visible;
1772
1807
  }
@@ -1784,6 +1819,10 @@ video {
1784
1819
  overflow-wrap: break-word;
1785
1820
  }
1786
1821
 
1822
+ .break-all {
1823
+ word-break: break-all;
1824
+ }
1825
+
1787
1826
  .truncate {
1788
1827
  overflow: hidden;
1789
1828
  text-overflow: ellipsis;
@@ -1806,20 +1845,16 @@ video {
1806
1845
  width: 1.5rem;
1807
1846
  }
1808
1847
 
1809
- .w-8 {
1810
- width: 2rem;
1811
- }
1812
-
1813
1848
  .w-11 {
1814
1849
  width: 2.75rem;
1815
1850
  }
1816
1851
 
1817
- .w-24 {
1818
- width: 6rem;
1852
+ .w-12 {
1853
+ width: 3rem;
1819
1854
  }
1820
1855
 
1821
- .w-40 {
1822
- width: 10rem;
1856
+ .w-24 {
1857
+ width: 6rem;
1823
1858
  }
1824
1859
 
1825
1860
  .w-46 {
@@ -1893,6 +1928,10 @@ video {
1893
1928
  transition-property: background-color, border-color, color, fill, stroke;
1894
1929
  }
1895
1930
 
1931
+ .transition-opacity {
1932
+ transition-property: opacity;
1933
+ }
1934
+
1896
1935
  .ease-in {
1897
1936
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
1898
1937
  }
@@ -2054,6 +2093,10 @@ video {
2054
2093
  padding-right: 2rem;
2055
2094
  }
2056
2095
 
2096
+ .lg\:last\:pb-2:last-child {
2097
+ padding-bottom: 0.5rem;
2098
+ }
2099
+
2057
2100
  .lg\:relative {
2058
2101
  position: relative;
2059
2102
  }