@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.
@@ -8,8 +8,11 @@ export declare const DialogContent: import("react").ForwardRefExoticComponent<Di
8
8
  close?: boolean | undefined;
9
9
  overlayStyle?: import("react").CSSProperties | undefined;
10
10
  overlayClassname?: string | undefined;
11
+ overlayBlur?: boolean | undefined;
11
12
  } & import("react").RefAttributes<HTMLDivElement>>;
12
- declare const overlay: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
13
+ declare const overlay: (props?: ({
14
+ blur?: boolean | null | undefined;
15
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
13
16
  export interface OverlayProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>, VariantProps<typeof overlay> {
14
17
  }
15
18
  type CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;
@@ -20,6 +23,7 @@ export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps> & {
20
23
  close?: boolean | undefined;
21
24
  overlayStyle?: import("react").CSSProperties | undefined;
22
25
  overlayClassname?: string | undefined;
26
+ overlayBlur?: boolean | undefined;
23
27
  } & import("react").RefAttributes<HTMLDivElement>>;
24
28
  Close: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
25
29
  Title: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAIf,QAAA,MAAM,aAAa,yFAA4B,CAAC;AAEhD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C,EAC1B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAMlB;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;CAMjB,CAAC"}
package/dist/index.cjs CHANGED
@@ -6676,14 +6676,20 @@ const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f76
6676
6676
  const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
6677
6677
  const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
6678
6678
 
6679
- var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
6679
+ var styles$t = {"dialogContent":"dialog-module_dialogContent__bljTL","overlayBlur":"dialog-module_overlayBlur__-RCHk","overlay":"dialog-module_overlay__t-jUE","close":"dialog-module_close__n9JNt"};
6680
6680
 
6681
6681
  const dialogContent = cva(styles$t.dialogContent);
6682
- const DialogContent = React.forwardRef(({ className, children, close, overlayStyle, overlayClassname, ...props }, forwardedRef) => {
6683
- 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, {}) }))] }) }) }));
6682
+ const DialogContent = React.forwardRef(({ className, children, close, overlayStyle, overlayClassname, overlayBlur, ...props }, forwardedRef) => {
6683
+ 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, {}) }))] }) }) }));
6684
6684
  });
6685
- const overlay$1 = cva(styles$t.overlay);
6686
- const Overlay$1 = React.forwardRef(({ className, ...props }, ref) => (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { ref: ref, className: overlay$1({ className }), ...props })));
6685
+ const overlay$1 = cva(styles$t.overlay, {
6686
+ variants: {
6687
+ blur: {
6688
+ true: styles$t.overlayBlur,
6689
+ },
6690
+ },
6691
+ });
6692
+ const Overlay$1 = React.forwardRef(({ className, blur, ...props }, ref) => (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { ref: ref, className: overlay$1({ className, blur }), ...props })));
6687
6693
  Overlay$1.displayName = $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff.displayName;
6688
6694
  const close$1 = cva(styles$t.close);
6689
6695
  function CloseButton$1({ children, className, ...props }) {
@@ -32249,7 +32255,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32249
32255
  }, { threshold: 0.1 });
32250
32256
  observerRef.current = observer;
32251
32257
  return () => observer.disconnect();
32252
- }, [onLoadMore]);
32258
+ }, [onLoadMore, isLoading]);
32253
32259
  React.useEffect(() => {
32254
32260
  const observer = observerRef.current;
32255
32261
  const lastRow = lastRowRef.current;
@@ -32264,19 +32270,26 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32264
32270
  };
32265
32271
  }, [isLoading]);
32266
32272
  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}`))));
32273
+ const tableData = onLoadMore ? data : (isLoading
32274
+ ? [...new Array(loaderRow)].map((_, i) => ({ id: i }))
32275
+ : data);
32267
32276
  const { filteredColumns, addFilterColumn, removeFilterColumn, resetColumns } = useTableColumn();
32268
32277
  const columnWithCustomFilter = React.useMemo(() => columns.map((col) => {
32269
32278
  const colId = col.id || col?.accessorKey;
32270
32279
  const filterFn = colId && tableCustomFilter.hasOwnProperty(colId)
32271
32280
  ? tableCustomFilter[colId]
32272
32281
  : undefined;
32273
- const { cell } = col;
32282
+ const cell = onLoadMore
32283
+ ? col.cell
32284
+ : (isLoading
32285
+ ? () => (jsxRuntimeExports.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
32286
+ : col.cell);
32274
32287
  return {
32275
32288
  ...col,
32276
32289
  cell,
32277
32290
  filterFn,
32278
32291
  };
32279
- }), [isLoading, columns, tableCustomFilter]);
32292
+ }), [isLoading, columns, tableCustomFilter, onLoadMore]);
32280
32293
  React.useEffect(() => {
32281
32294
  if (onStateChange) {
32282
32295
  onStateChange(tableState);
@@ -32286,7 +32299,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32286
32299
  setTableCustomFilter((old) => ({ ...old, [id]: filterFn }));
32287
32300
  };
32288
32301
  const table = useReactTable({
32289
- data,
32302
+ data: tableData,
32290
32303
  columns: columnWithCustomFilter,
32291
32304
  globalFilterFn: "auto",
32292
32305
  enableRowSelection: true,
@@ -32336,12 +32349,12 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32336
32349
  }) }, headerGroup.id)))
32337
32350
  : 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
32338
32351
  ? ""
32339
- : `${styles$4.tRow} ${onRowClick ? styles$4.tRowClick : ""}`, ref: rowIndex === table.getRowModel().rows.length - 1
32352
+ : `${styles$4.tRow} ${onRowClick ? styles$4.tRowClick : ""}`, ref: onLoadMore && rowIndex === table.getRowModel().rows.length - 1
32340
32353
  ? lastRowRef
32341
32354
  : null, children: row.getVisibleCells().map((cell, index) => (jsxRuntimeExports.jsx(Table.Cell, { style: {
32342
32355
  ...(cell.column.columnDef?.meta?.style ?? {}),
32343
32356
  }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, `${cell.id}_${index}`))) }, row.id)))) : (!isLoading ?
32344
- 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] }) }));
32357
+ 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] }) }));
32345
32358
  }
32346
32359
  const DataTable = Object.assign(DataTableRoot, {
32347
32360
  Toolbar: DataTableToolbar,