@raystack/apsara 0.10.10 → 0.11.1

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/dist/index.css CHANGED
@@ -1535,6 +1535,11 @@
1535
1535
  flex: 1;
1536
1536
  }
1537
1537
 
1538
+ .datatable-module_table__x2IkY {
1539
+ height: 100vh;
1540
+ overflow: visible;
1541
+ }
1542
+
1538
1543
  .datatable-module_head__zCfCW {
1539
1544
  display: flex;
1540
1545
  flex-direction: row;
@@ -1547,10 +1552,6 @@
1547
1552
  border-bottom: 1px solid var(--border-base);
1548
1553
  }
1549
1554
 
1550
- .datatable-module_chipWrapper__iz69x {
1551
-
1552
- }
1553
-
1554
1555
  .datatable-module_chip__IiwTD {
1555
1556
  display: inline-flex;
1556
1557
  align-items: center;
@@ -1564,6 +1565,7 @@
1564
1565
  font-size: 12px;
1565
1566
  line-height: 16px;
1566
1567
  caption-side: bottom;
1568
+ overflow: visible;
1567
1569
  color: var(--foreground-base);
1568
1570
  }
1569
1571
 
@@ -1572,27 +1574,29 @@
1572
1574
  color: var(--foreground-muted);
1573
1575
  }
1574
1576
 
1577
+ .table-module_header__YGJoz {
1578
+ top: 0px;
1579
+ position: sticky;
1580
+ background: var(--background-base);
1581
+ margin: 0 0 0 0;
1582
+ }
1583
+
1575
1584
  .table-module_header__YGJoz tr {
1576
1585
  border-bottom: 1px solid var(--foreground-muted);
1577
1586
  }
1578
1587
 
1579
1588
  .table-module_head__zosk- {
1580
- height: 3rem;
1581
1589
  color: var(--foreground-muted);
1582
1590
  font-weight: 500;
1583
1591
  text-align: left;
1584
- padding-left: 1rem;
1585
- padding-right: 1rem;
1592
+ padding: 0.5rem;
1586
1593
  vertical-align: middle;
1587
1594
  border-bottom: 1px solid var(--border-subtle);
1588
1595
  }
1589
1596
 
1590
- .table-module_row__-1ieK {
1591
- }
1592
-
1593
1597
  .table-module_cell__-FP3s {
1594
1598
  font-weight: 500;
1595
- padding: 1rem;
1599
+ padding: 14px 0.5rem;
1596
1600
  border-bottom: 1px solid var(--border-subtle);
1597
1601
  }
1598
1602
 
package/dist/index.js CHANGED
@@ -15326,7 +15326,7 @@ const TextField = ({ leading, className, src, size, state, style, ...props }) =>
15326
15326
  };
15327
15327
  TextField.displayName = "TextField";
15328
15328
 
15329
- var styles$3 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","head":"datatable-module_head__zCfCW","toolbar":"datatable-module_toolbar__lO-aI","chipWrapper":"datatable-module_chipWrapper__iz69x","chip":"datatable-module_chip__IiwTD"};
15329
+ var styles$3 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","table":"datatable-module_table__x2IkY","head":"datatable-module_head__zCfCW","toolbar":"datatable-module_toolbar__lO-aI","chip":"datatable-module_chip__IiwTD"};
15330
15330
 
15331
15331
  const FilteredChip = ({ column }) => {
15332
15332
  const { table, removeFilterColumn } = useTable();
@@ -15434,7 +15434,7 @@ const useTableColumn = () => {
15434
15434
  };
15435
15435
  };
15436
15436
 
15437
- var styles$2 = {"table":"table-module_table__mqnXB","caption":"table-module_caption__xw-5e","header":"table-module_header__YGJoz","head":"table-module_head__zosk-","row":"table-module_row__-1ieK","cell":"table-module_cell__-FP3s"};
15437
+ var styles$2 = {"table":"table-module_table__mqnXB","caption":"table-module_caption__xw-5e","header":"table-module_header__YGJoz","head":"table-module_head__zosk-","cell":"table-module_cell__-FP3s"};
15438
15438
 
15439
15439
  const table = cva(styles$2.table);
15440
15440
  const TableRoot = React.forwardRef(({ className, ...props }, ref) => (jsxRuntimeExports.jsx("div", { style: { width: "100%", overflow: "auto" }, children: jsxRuntimeExports.jsx("table", { ref: ref, className: table({ className }), ...props }) })));
@@ -15470,11 +15470,12 @@ const Table = Object.assign(TableRoot, {
15470
15470
  Caption: TableCaption,
15471
15471
  });
15472
15472
 
15473
- function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...props }) {
15473
+ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ShouldShowHeader = true, ...props }) {
15474
15474
  const convertedChildren = Children.toArray(children);
15475
- const header = convertedChildren.find((child) => child.type === DataTableToolbar) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15476
- const footer = convertedChildren.find((child) => child.type === DataTableFooter) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15477
- const detail = convertedChildren.find((child) => child.type === TableDetailContainer) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15475
+ const header = convertedChildren.find((child) => child.type === DataTableToolbar) || null;
15476
+ const footer = convertedChildren.find((child) => child.type === DataTableFooter) || null;
15477
+ const detail = convertedChildren.find((child) => child.type === TableDetailContainer) ||
15478
+ null;
15478
15479
  const [sorting, setSorting] = React__default.useState([]);
15479
15480
  const [columnFilters, setColumnFilters] = React__default.useState([]);
15480
15481
  const [columnVisibility, setColumnVisibility] = React__default.useState({});
@@ -15486,6 +15487,8 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
15486
15487
  columns,
15487
15488
  globalFilterFn: "auto",
15488
15489
  enableRowSelection: true,
15490
+ manualPagination: true,
15491
+ pageCount: -1,
15489
15492
  onGlobalFilterChange: setGlobalFilter,
15490
15493
  onSortingChange: setSorting,
15491
15494
  onColumnFiltersChange: setColumnFilters,
@@ -15514,16 +15517,19 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
15514
15517
  resetColumns,
15515
15518
  onGlobalFilterChange: setGlobalFilter,
15516
15519
  onChange: () => ({}),
15517
- }, children: [jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles$3.datatable, children: [header, jsxRuntimeExports.jsxs(Flex, { style: parentStyle, children: [jsxRuntimeExports.jsxs(Table, { ...props, children: [jsxRuntimeExports.jsx(Table.Header, { children: table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports.jsx(Table.Row, { children: headerGroup.headers.map((header) => {
15518
- return (jsxRuntimeExports.jsx(Table.Head, { style: {
15519
- ...(header.column.columnDef?.meta?.style ?? {}),
15520
- }, children: jsxRuntimeExports.jsxs(Text, { className: styles$3.head, children: [header.isPlaceholder
15521
- ? null
15522
- : flexRender(header.column.columnDef.header, header.getContext()), {
15523
- asc: jsxRuntimeExports.jsx(ArrowUpIcon, {}),
15524
- desc: jsxRuntimeExports.jsx(ArrowDownIcon, {}),
15525
- }[header.column.getIsSorted()] ?? null] }) }, header.id));
15526
- }) }, headerGroup.id))) }), jsxRuntimeExports.jsx(Table.Body, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (jsxRuntimeExports.jsx(Table.Row, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (jsxRuntimeExports.jsx(Table.Cell, { style: {
15520
+ }, children: [jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles$3.datatable, children: [header, jsxRuntimeExports.jsxs(Flex, { className: styles$3.tableContainer, style: parentStyle, children: [jsxRuntimeExports.jsxs(Table, { ...props, children: [jsxRuntimeExports.jsx(Table.Header, { children: ShouldShowHeader
15521
+ ? table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports.jsx(Table.Row, { children: headerGroup.headers.map((header) => {
15522
+ return (jsxRuntimeExports.jsx(Table.Head, { style: {
15523
+ ...(header.column.columnDef?.meta?.style ?? {}),
15524
+ }, children: jsxRuntimeExports.jsxs(Text, { className: styles$3.head, children: [header.isPlaceholder
15525
+ ? null
15526
+ : flexRender(header.column.columnDef.header, header.getContext()), {
15527
+ asc: jsxRuntimeExports.jsx(ArrowUpIcon, {}),
15528
+ desc: jsxRuntimeExports.jsx(ArrowDownIcon, {}),
15529
+ }[header.column.getIsSorted()] ??
15530
+ null] }) }, header.id));
15531
+ }) }, headerGroup.id)))
15532
+ : null }), jsxRuntimeExports.jsx(Table.Body, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (jsxRuntimeExports.jsx(Table.Row, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (jsxRuntimeExports.jsx(Table.Cell, { style: {
15527
15533
  ...(cell.column.columnDef?.meta?.style ?? {}),
15528
15534
  }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (jsxRuntimeExports.jsx(Table.Row, { children: jsxRuntimeExports.jsx(Table.Cell, { colSpan: columns.length, children: emptyState || "No results." }) })) })] }), detail] })] }), footer] }) }));
15529
15535
  }