@raystack/apsara 0.10.9 → 0.11.0
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/image/image.d.ts +1 -1
- package/dist/image/image.d.ts.map +1 -1
- package/dist/index.cjs +38 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +44 -40
- package/dist/index.js +38 -32
- package/dist/index.js.map +1 -1
- package/dist/table/datatable.d.ts +2 -1
- package/dist/table/datatable.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/themprovider/OSPreference.d.ts +0 -4
- package/dist/themprovider/OSPreference.d.ts.map +0 -1
- package/dist/themprovider/storage.d.ts +0 -5
- package/dist/themprovider/storage.d.ts.map +0 -1
- package/dist/themprovider/themeprovider.d.ts +0 -19
- package/dist/themprovider/themeprovider.d.ts.map +0 -1
package/dist/index.css
CHANGED
|
@@ -1454,39 +1454,6 @@
|
|
|
1454
1454
|
.switch-module_thumb__b4Y8H[data-state="checked"] {
|
|
1455
1455
|
transform: translateX(16px);
|
|
1456
1456
|
}
|
|
1457
|
-
.datatable-module_wrapper__Sxg2d {
|
|
1458
|
-
width: 100%;
|
|
1459
|
-
height: 100%;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
.datatable-module_datatable__z-Th2 {
|
|
1463
|
-
flex: 1;
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
.datatable-module_head__zCfCW {
|
|
1467
|
-
display: flex;
|
|
1468
|
-
flex-direction: row;
|
|
1469
|
-
align-items: center;
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
.datatable-module_toolbar__lO-aI {
|
|
1473
|
-
width: 100%;
|
|
1474
|
-
padding: 16px 24px;
|
|
1475
|
-
border-bottom: 1px solid var(--border-base);
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
.datatable-module_chipWrapper__iz69x {
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
.datatable-module_chip__IiwTD {
|
|
1483
|
-
display: inline-flex;
|
|
1484
|
-
align-items: center;
|
|
1485
|
-
gap: var(--pd-8);
|
|
1486
|
-
border: 1px solid var(--border-base);
|
|
1487
|
-
border-radius: var(--pd-4);
|
|
1488
|
-
padding: var(--pd-4) var(--pd-8);
|
|
1489
|
-
}
|
|
1490
1457
|
.textfield-module_textfield__u4AGg {
|
|
1491
1458
|
appearance: none;
|
|
1492
1459
|
box-sizing: border-box;
|
|
@@ -1559,11 +1526,46 @@
|
|
|
1559
1526
|
.textfield-module_textfield-leading__AE-ld {
|
|
1560
1527
|
padding-left: 32px;
|
|
1561
1528
|
}
|
|
1529
|
+
.datatable-module_wrapper__Sxg2d {
|
|
1530
|
+
width: 100%;
|
|
1531
|
+
height: 100%;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.datatable-module_datatable__z-Th2 {
|
|
1535
|
+
flex: 1;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
.datatable-module_table__x2IkY {
|
|
1539
|
+
height: 100vh;
|
|
1540
|
+
overflow: visible;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.datatable-module_head__zCfCW {
|
|
1544
|
+
display: flex;
|
|
1545
|
+
flex-direction: row;
|
|
1546
|
+
align-items: center;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
.datatable-module_toolbar__lO-aI {
|
|
1550
|
+
width: 100%;
|
|
1551
|
+
padding: 16px 24px;
|
|
1552
|
+
border-bottom: 1px solid var(--border-base);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
.datatable-module_chip__IiwTD {
|
|
1556
|
+
display: inline-flex;
|
|
1557
|
+
align-items: center;
|
|
1558
|
+
gap: var(--pd-8);
|
|
1559
|
+
border: 1px solid var(--border-base);
|
|
1560
|
+
border-radius: var(--pd-4);
|
|
1561
|
+
padding: var(--pd-4) var(--pd-8);
|
|
1562
|
+
}
|
|
1562
1563
|
.table-module_table__mqnXB {
|
|
1563
1564
|
width: 100%;
|
|
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
|
|
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:
|
|
1599
|
+
padding: 14px 0.5rem;
|
|
1596
1600
|
border-bottom: 1px solid var(--border-subtle);
|
|
1597
1601
|
}
|
|
1598
1602
|
|
package/dist/index.js
CHANGED
|
@@ -9281,8 +9281,8 @@ function Grid({ children, align, justify, flow, columns, gap, gapX, gapY, classN
|
|
|
9281
9281
|
var styles$f = {"image":"image-module_image__KDN-Q"};
|
|
9282
9282
|
|
|
9283
9283
|
const image = cva(styles$f.image);
|
|
9284
|
-
function Image({ children, className, ...props }) {
|
|
9285
|
-
return jsxRuntimeExports.jsx("img", { className: image({ className }), ...props });
|
|
9284
|
+
function Image({ alt, children, className, ...props }) {
|
|
9285
|
+
return jsxRuntimeExports.jsx("img", { alt: alt, className: image({ className }), ...props });
|
|
9286
9286
|
}
|
|
9287
9287
|
|
|
9288
9288
|
const InputField = ({ label, children, ...props }) => {
|
|
@@ -15290,8 +15290,6 @@ function DataTableClearFilter({ children, ...props }) {
|
|
|
15290
15290
|
}, style: { width: "100%" }, ...props, children: children || (jsxRuntimeExports.jsxs(Flex, { gap: "small", align: "center", justify: "center", children: ["Clear filters ", jsxRuntimeExports.jsx(Cross2Icon, { width: 12, height: "12" })] })) }));
|
|
15291
15291
|
}
|
|
15292
15292
|
|
|
15293
|
-
var styles$4 = {"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"};
|
|
15294
|
-
|
|
15295
15293
|
function DataTableFilterOptions({ children, ...props }) {
|
|
15296
15294
|
const { table, filteredColumns, addFilterColumn } = useTable();
|
|
15297
15295
|
const availableColumns = table
|
|
@@ -15303,20 +15301,20 @@ function DataTableFilterOptions({ children, ...props }) {
|
|
|
15303
15301
|
})] })) : null] }));
|
|
15304
15302
|
}
|
|
15305
15303
|
|
|
15306
|
-
var styles$
|
|
15304
|
+
var styles$4 = {"textfield":"textfield-module_textfield__u4AGg","textfield-sm":"textfield-module_textfield-sm__OKPic","textfield-md":"textfield-module_textfield-md__e2ayW","textfield-invlid":"textfield-module_textfield-invlid__zo9MF","textfield-valid":"textfield-module_textfield-valid__6rMM9","textfield-leading":"textfield-module_textfield-leading__AE-ld"};
|
|
15307
15305
|
|
|
15308
|
-
const textfield = cva(styles$
|
|
15306
|
+
const textfield = cva(styles$4.textfield, {
|
|
15309
15307
|
variants: {
|
|
15310
15308
|
size: {
|
|
15311
|
-
small: styles$
|
|
15312
|
-
medium: styles$
|
|
15309
|
+
small: styles$4["textfield-sm"],
|
|
15310
|
+
medium: styles$4["textfield-md"],
|
|
15313
15311
|
},
|
|
15314
15312
|
state: {
|
|
15315
|
-
invalid: styles$
|
|
15316
|
-
valid: styles$
|
|
15313
|
+
invalid: styles$4["textfield-invalid"],
|
|
15314
|
+
valid: styles$4["textfield-valid"],
|
|
15317
15315
|
},
|
|
15318
15316
|
leading: {
|
|
15319
|
-
true: styles$
|
|
15317
|
+
true: styles$4["textfield-leading"],
|
|
15320
15318
|
},
|
|
15321
15319
|
},
|
|
15322
15320
|
defaultVariants: {
|
|
@@ -15328,6 +15326,8 @@ const TextField = ({ leading, className, src, size, state, style, ...props }) =>
|
|
|
15328
15326
|
};
|
|
15329
15327
|
TextField.displayName = "TextField";
|
|
15330
15328
|
|
|
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
|
+
|
|
15331
15331
|
const FilteredChip = ({ column }) => {
|
|
15332
15332
|
const { table, removeFilterColumn } = useTable();
|
|
15333
15333
|
const { filterVariant } = column?.columnDef;
|
|
@@ -15361,7 +15361,7 @@ const FilteredChip = ({ column }) => {
|
|
|
15361
15361
|
}
|
|
15362
15362
|
}
|
|
15363
15363
|
};
|
|
15364
|
-
return (jsxRuntimeExports.jsxs(Box, { className: styles$
|
|
15364
|
+
return (jsxRuntimeExports.jsxs(Box, { className: styles$3.chip, children: [jsxRuntimeExports.jsx(Text, { children: column.id }), jsxRuntimeExports.jsx(Text, { children: "is" }), renderInputs(), jsxRuntimeExports.jsx(Flex, { children: jsxRuntimeExports.jsx(Cross1Icon, { height: "12", width: "12", onClick: () => {
|
|
15365
15365
|
column.setFilterValue(undefined);
|
|
15366
15366
|
removeFilterColumn(column.id);
|
|
15367
15367
|
} }) })] }));
|
|
@@ -15374,14 +15374,14 @@ function DataTableFilterChips(props) {
|
|
|
15374
15374
|
.filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide());
|
|
15375
15375
|
if (!filteredColumns.length)
|
|
15376
15376
|
return null;
|
|
15377
|
-
return (jsxRuntimeExports.jsxs(Flex, { gap: "small", align: "center", className: styles$
|
|
15377
|
+
return (jsxRuntimeExports.jsxs(Flex, { gap: "small", align: "center", className: styles$3.chipWrapper, ...props, children: [filteredColumns.map((filter, index) => {
|
|
15378
15378
|
const filteredColumn = table.getColumn(filter);
|
|
15379
|
-
return jsxRuntimeExports.jsx(FilteredChip, { column: filteredColumn });
|
|
15379
|
+
return jsxRuntimeExports.jsx(FilteredChip, { column: filteredColumn }, index);
|
|
15380
15380
|
}), filteredColumns.length < tableColumns.length && (jsxRuntimeExports.jsx(DataTableFilterOptions, { variant: "ghost", style: { border: "none", background: "none" }, children: jsxRuntimeExports.jsx(PlusIcon, { width: 16, height: 16 }) }))] }));
|
|
15381
15381
|
}
|
|
15382
15382
|
|
|
15383
15383
|
function DataTableFooter({ children, }) {
|
|
15384
|
-
return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$
|
|
15384
|
+
return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$3.toolbar, children: children }));
|
|
15385
15385
|
}
|
|
15386
15386
|
|
|
15387
15387
|
function DataTableGloabalSearch(props) {
|
|
@@ -15394,7 +15394,7 @@ function DataTableGloabalSearch(props) {
|
|
|
15394
15394
|
}
|
|
15395
15395
|
|
|
15396
15396
|
function DataTableToolbar({ children, ...props }) {
|
|
15397
|
-
return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$
|
|
15397
|
+
return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$3.toolbar, ...props, children: children }));
|
|
15398
15398
|
}
|
|
15399
15399
|
|
|
15400
15400
|
function DataTableViewOptions({ children, ...props }) {
|
|
@@ -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-","
|
|
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) ||
|
|
15476
|
-
const footer = convertedChildren.find((child) => child.type === DataTableFooter) ||
|
|
15477
|
-
const detail = convertedChildren.find((child) => child.type === TableDetailContainer) ||
|
|
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,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
|
|
|
15486
15487
|
columns,
|
|
15487
15488
|
globalFilterFn: "auto",
|
|
15488
15489
|
enableRowSelection: true,
|
|
15490
|
+
manualPagination: true,
|
|
15489
15491
|
onGlobalFilterChange: setGlobalFilter,
|
|
15490
15492
|
onSortingChange: setSorting,
|
|
15491
15493
|
onColumnFiltersChange: setColumnFilters,
|
|
@@ -15505,7 +15507,8 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
|
|
|
15505
15507
|
rowSelection,
|
|
15506
15508
|
},
|
|
15507
15509
|
});
|
|
15508
|
-
|
|
15510
|
+
console.log(table.getRowModel().rows?.length);
|
|
15511
|
+
return (jsxRuntimeExports.jsx(Flex, { direction: "column", justify: "between", className: styles$3.wrapper, children: jsxRuntimeExports.jsxs(TableContext.Provider, { value: {
|
|
15509
15512
|
table,
|
|
15510
15513
|
globalFilter,
|
|
15511
15514
|
filteredColumns,
|
|
@@ -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$
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
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
|
}
|