@raystack/apsara 0.20.3 → 0.21.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/dialog/dialog.d.ts +5 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/index.cjs +24 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -0
- package/dist/index.js +24 -11
- package/dist/index.js.map +1 -1
- package/dist/table/datatable.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -53,6 +53,24 @@
|
|
|
53
53
|
--fs-500: 0.938rem;
|
|
54
54
|
--fs-600: 1rem;
|
|
55
55
|
|
|
56
|
+
--space-1: 2px;
|
|
57
|
+
--space-2: 4px;
|
|
58
|
+
--space-3: 8px;
|
|
59
|
+
--space-4: 12px;
|
|
60
|
+
--space-5: 16px;
|
|
61
|
+
--space-6: 20px;
|
|
62
|
+
--space-7: 24px;
|
|
63
|
+
--space-8: 28px;
|
|
64
|
+
--space-9: 32px;
|
|
65
|
+
--space-10: 40px;
|
|
66
|
+
--space-11: 48px;
|
|
67
|
+
--space-12: 56px;
|
|
68
|
+
--space-13: 64px;
|
|
69
|
+
--space-14: 72px;
|
|
70
|
+
--space-15: 80px;
|
|
71
|
+
--space-16: 96px;
|
|
72
|
+
--space-17: 120px;
|
|
73
|
+
|
|
56
74
|
--pd-2: 2px;
|
|
57
75
|
--pd-4: 4px;
|
|
58
76
|
--pd-6: 6px;
|
|
@@ -724,6 +742,10 @@ html[data-theme="dark"] {
|
|
|
724
742
|
border: 1px solid var(--border-subtle);
|
|
725
743
|
}
|
|
726
744
|
|
|
745
|
+
.dialog-module_overlayBlur__-RCHk {
|
|
746
|
+
backdrop-filter: blur(2px);
|
|
747
|
+
}
|
|
748
|
+
|
|
727
749
|
.dialog-module_dialogContent__bljTL:focus {
|
|
728
750
|
outline: none;
|
|
729
751
|
}
|
package/dist/index.js
CHANGED
|
@@ -6656,14 +6656,20 @@ const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f76
|
|
|
6656
6656
|
const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
|
|
6657
6657
|
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
|
|
6658
6658
|
|
|
6659
|
-
var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
|
|
6659
|
+
var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlayBlur":"dialog-module_overlayBlur__-RCHk","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
|
|
6660
6660
|
|
|
6661
6661
|
const dialogContent = cva(styles$t.dialogContent);
|
|
6662
|
-
const DialogContent = forwardRef(({ className, children, close, overlayStyle, overlayClassname, ...props }, forwardedRef) => {
|
|
6663
|
-
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$602eac185826482c, { children: jsxRuntimeExports.jsx(Overlay$1, { className: overlayClassname, style: overlayStyle, children: jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ...props, ref: forwardedRef, className: dialogContent({ className }), children: [children, close && (jsxRuntimeExports.jsx(CloseButton$1, { children: jsxRuntimeExports.jsx(Cross1Icon, {}) }))] }) }) }));
|
|
6662
|
+
const DialogContent = forwardRef(({ className, children, close, overlayStyle, overlayClassname, overlayBlur, ...props }, forwardedRef) => {
|
|
6663
|
+
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$602eac185826482c, { children: jsxRuntimeExports.jsx(Overlay$1, { className: overlayClassname, style: overlayStyle, blur: overlayBlur, children: jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ...props, ref: forwardedRef, className: dialogContent({ className }), children: [children, close && (jsxRuntimeExports.jsx(CloseButton$1, { children: jsxRuntimeExports.jsx(Cross1Icon, {}) }))] }) }) }));
|
|
6664
6664
|
});
|
|
6665
|
-
const overlay$1 = cva(styles$t.overlay
|
|
6666
|
-
|
|
6665
|
+
const overlay$1 = cva(styles$t.overlay, {
|
|
6666
|
+
variants: {
|
|
6667
|
+
blur: {
|
|
6668
|
+
true: styles$t.overlayBlur,
|
|
6669
|
+
},
|
|
6670
|
+
},
|
|
6671
|
+
});
|
|
6672
|
+
const Overlay$1 = forwardRef(({ className, blur, ...props }, ref) => (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { ref: ref, className: overlay$1({ className, blur }), ...props })));
|
|
6667
6673
|
Overlay$1.displayName = $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff.displayName;
|
|
6668
6674
|
const close$1 = cva(styles$t.close);
|
|
6669
6675
|
function CloseButton$1({ children, className, ...props }) {
|
|
@@ -32229,7 +32235,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
|
|
|
32229
32235
|
}, { threshold: 0.1 });
|
|
32230
32236
|
observerRef.current = observer;
|
|
32231
32237
|
return () => observer.disconnect();
|
|
32232
|
-
}, [onLoadMore]);
|
|
32238
|
+
}, [onLoadMore, isLoading]);
|
|
32233
32239
|
useEffect(() => {
|
|
32234
32240
|
const observer = observerRef.current;
|
|
32235
32241
|
const lastRow = lastRowRef.current;
|
|
@@ -32244,19 +32250,26 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
|
|
|
32244
32250
|
};
|
|
32245
32251
|
}, [isLoading]);
|
|
32246
32252
|
const getLoader = (loaderRow, columns) => ([...new Array(loaderRow)].map((_, rowIndex) => (jsxRuntimeExports.jsx(Table.Row, { children: columns.map((_, colIndex) => (jsxRuntimeExports.jsx(Table.Cell, { children: jsxRuntimeExports.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }) }, `col_${colIndex}`))) }, `row_${rowIndex}`))));
|
|
32253
|
+
const tableData = onLoadMore ? data : (isLoading
|
|
32254
|
+
? [...new Array(loaderRow)].map((_, i) => ({ id: i }))
|
|
32255
|
+
: data);
|
|
32247
32256
|
const { filteredColumns, addFilterColumn, removeFilterColumn, resetColumns } = useTableColumn();
|
|
32248
32257
|
const columnWithCustomFilter = useMemo(() => columns.map((col) => {
|
|
32249
32258
|
const colId = col.id || col?.accessorKey;
|
|
32250
32259
|
const filterFn = colId && tableCustomFilter.hasOwnProperty(colId)
|
|
32251
32260
|
? tableCustomFilter[colId]
|
|
32252
32261
|
: undefined;
|
|
32253
|
-
const
|
|
32262
|
+
const cell = onLoadMore
|
|
32263
|
+
? col.cell
|
|
32264
|
+
: (isLoading
|
|
32265
|
+
? () => (jsxRuntimeExports.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
|
|
32266
|
+
: col.cell);
|
|
32254
32267
|
return {
|
|
32255
32268
|
...col,
|
|
32256
32269
|
cell,
|
|
32257
32270
|
filterFn,
|
|
32258
32271
|
};
|
|
32259
|
-
}), [isLoading, columns, tableCustomFilter]);
|
|
32272
|
+
}), [isLoading, columns, tableCustomFilter, onLoadMore]);
|
|
32260
32273
|
useEffect(() => {
|
|
32261
32274
|
if (onStateChange) {
|
|
32262
32275
|
onStateChange(tableState);
|
|
@@ -32266,7 +32279,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
|
|
|
32266
32279
|
setTableCustomFilter((old) => ({ ...old, [id]: filterFn }));
|
|
32267
32280
|
};
|
|
32268
32281
|
const table = useReactTable({
|
|
32269
|
-
data,
|
|
32282
|
+
data: tableData,
|
|
32270
32283
|
columns: columnWithCustomFilter,
|
|
32271
32284
|
globalFilterFn: "auto",
|
|
32272
32285
|
enableRowSelection: true,
|
|
@@ -32316,12 +32329,12 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
|
|
|
32316
32329
|
}) }, headerGroup.id)))
|
|
32317
32330
|
: null }), jsxRuntimeExports.jsxs(Table.Body, { children: [table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row, rowIndex) => (jsxRuntimeExports.jsx(Table.Row, { "data-state": row.getIsSelected() && "selected", onClick: () => onRowClick?.(row.original), className: isLoading
|
|
32318
32331
|
? ""
|
|
32319
|
-
: `${styles$4.tRow} ${onRowClick ? styles$4.tRowClick : ""}`, ref: rowIndex === table.getRowModel().rows.length - 1
|
|
32332
|
+
: `${styles$4.tRow} ${onRowClick ? styles$4.tRowClick : ""}`, ref: onLoadMore && rowIndex === table.getRowModel().rows.length - 1
|
|
32320
32333
|
? lastRowRef
|
|
32321
32334
|
: null, children: row.getVisibleCells().map((cell, index) => (jsxRuntimeExports.jsx(Table.Cell, { style: {
|
|
32322
32335
|
...(cell.column.columnDef?.meta?.style ?? {}),
|
|
32323
32336
|
}, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, `${cell.id}_${index}`))) }, row.id)))) : (!isLoading ?
|
|
32324
|
-
jsxRuntimeExports.jsx(Table.Row, { children: jsxRuntimeExports.jsx(Table.Cell, { colSpan: columns.length, children: emptyState || "No results." }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})), isLoading && getLoader(loaderRow, columns)] })] }), detail] })] }), footer] }) }));
|
|
32337
|
+
jsxRuntimeExports.jsx(Table.Row, { children: jsxRuntimeExports.jsx(Table.Cell, { colSpan: columns.length, children: emptyState || "No results." }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})), isLoading && onLoadMore && getLoader(loaderRow, columns)] })] }), detail] })] }), footer] }) }));
|
|
32325
32338
|
}
|
|
32326
32339
|
const DataTable = Object.assign(DataTableRoot, {
|
|
32327
32340
|
Toolbar: DataTableToolbar,
|