@raystack/apsara 0.16.2 → 0.17.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.cjs CHANGED
@@ -20093,10 +20093,20 @@ function Text({ children, className, size, weight, ...props }) {
20093
20093
  return (jsxRuntimeExports$1.jsx("span", { className: text$1({ size, className, weight }), ...props, children: children }));
20094
20094
  }
20095
20095
 
20096
- var styles$d = {"content":"select-module_content__X0QJ-","menuitem":"select-module_menuitem__DfVEU","separator":"select-module_separator__2UBNd","menugroup":"select-module_menugroup__zJbzr","trigger":"select-module_trigger__1tSaG","triggerIcon":"select-module_triggerIcon__iaoZ3"};
20096
+ var styles$d = {"content":"select-module_content__X0QJ-","menuitem":"select-module_menuitem__DfVEU","separator":"select-module_separator__2UBNd","menugroup":"select-module_menugroup__zJbzr","trigger":"select-module_trigger__1tSaG","trigger-sm":"select-module_trigger-sm__rcLow","trigger-md":"select-module_trigger-md__iDsne","triggerIcon":"select-module_triggerIcon__iaoZ3"};
20097
20097
 
20098
- const trigger$1 = cva(styles$d.trigger);
20099
- const SelectTrigger = React__namespace.forwardRef(({ className, children, ...props }, ref) => (jsxRuntimeExports$1.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4, { ref: ref, className: trigger$1({ className }), ...props, children: [children, jsxRuntimeExports$1.jsx($cc7e05a45900e73f$export$f04a61298a47a40f, { asChild: true, children: jsxRuntimeExports$1.jsx(ChevronDownIcon, { className: styles$d.triggerIcon }) })] })));
20098
+ const trigger$1 = cva(styles$d.trigger, {
20099
+ variants: {
20100
+ size: {
20101
+ small: styles$d["trigger-sm"],
20102
+ medium: styles$d["trigger-md"],
20103
+ },
20104
+ },
20105
+ defaultVariants: {
20106
+ size: "medium",
20107
+ },
20108
+ });
20109
+ const SelectTrigger = React__namespace.forwardRef(({ size, className, children, ...props }, ref) => (jsxRuntimeExports$1.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4, { ref: ref, className: trigger$1({ size, className }), ...props, children: [children, jsxRuntimeExports$1.jsx($cc7e05a45900e73f$export$f04a61298a47a40f, { asChild: true, children: jsxRuntimeExports$1.jsx(ChevronDownIcon, { className: styles$d.triggerIcon }) })] })));
20100
20110
  SelectTrigger.displayName = $cc7e05a45900e73f$export$41fb9f06171c75f4.displayName;
20101
20111
  const content$1 = cva(styles$d.content);
20102
20112
  const SelectContent = React__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => (jsxRuntimeExports$1.jsx($cc7e05a45900e73f$export$602eac185826482c, { children: jsxRuntimeExports$1.jsx($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { ref: ref, className: content$1({ className }), position: position, ...props, children: children }) })));
@@ -31739,7 +31749,7 @@ function DataTableFilterOptions({ children, ...props }) {
31739
31749
  })] })) : null] }));
31740
31750
  }
31741
31751
 
31742
- var styles$4 = {"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","chipWrapper":"datatable-module_chipWrapper__iz69x","filterOperator":"datatable-module_filterOperator__qtDsH","filterText":"datatable-module_filterText__w00L8","flex1":"datatable-module_flex1__fA-kQ","tRow":"datatable-module_tRow__GrMHh","tRowClick":"datatable-module_tRowClick__7wzkh"};
31752
+ var styles$4 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","table":"datatable-module_table__x2IkY","head":"datatable-module_head__zCfCW","header":"datatable-module_header__7-CAd","toolbar":"datatable-module_toolbar__lO-aI","chip":"datatable-module_chip__IiwTD","chipWrapper":"datatable-module_chipWrapper__iz69x","filterOperator":"datatable-module_filterOperator__qtDsH","filterText":"datatable-module_filterText__w00L8","flex1":"datatable-module_flex1__fA-kQ","tRow":"datatable-module_tRow__GrMHh","tRowClick":"datatable-module_tRowClick__7wzkh"};
31743
31753
 
31744
31754
  const columnTypesMap = {
31745
31755
  select: "select",
@@ -32209,17 +32219,20 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32209
32219
  ? [...new Array(loaderRow)].map((_, i) => ({ id: i }))
32210
32220
  : data;
32211
32221
  const { filteredColumns, addFilterColumn, removeFilterColumn, resetColumns } = useTableColumn();
32212
- const columnWithCustomFilter = columns.map((col) => {
32213
- // @ts-ignore;
32222
+ const columnWithCustomFilter = React.useMemo(() => columns.map((col) => {
32214
32223
  const colId = col.id || col?.accessorKey;
32215
- if (colId && tableCustomFilter.hasOwnProperty(colId)) {
32216
- col.filterFn = tableCustomFilter[colId];
32217
- }
32218
- col.cell = isLoading
32224
+ const filterFn = colId && tableCustomFilter.hasOwnProperty(colId)
32225
+ ? tableCustomFilter[colId]
32226
+ : undefined;
32227
+ const cell = isLoading
32219
32228
  ? () => (jsxRuntimeExports$1.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
32220
32229
  : col.cell;
32221
- return col;
32222
- });
32230
+ return {
32231
+ ...col,
32232
+ cell,
32233
+ filterFn,
32234
+ };
32235
+ }), [isLoading, columns, tableCustomFilter]);
32223
32236
  React.useEffect(() => {
32224
32237
  if (onStateChange) {
32225
32238
  onStateChange(tableState);
@@ -32263,7 +32276,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoa
32263
32276
  tableCustomFilter,
32264
32277
  updateColumnCustomFilter,
32265
32278
  isLoading,
32266
- }, children: [jsxRuntimeExports$1.jsxs(Flex, { direction: "column", className: styles$4.datatable, children: [header, jsxRuntimeExports$1.jsxs(Flex, { className: styles$4.tableContainer, style: parentStyle, children: [jsxRuntimeExports$1.jsxs(Table, { ...props, style: tableStyle, children: [jsxRuntimeExports$1.jsx(Table.Header, { children: ShouldShowHeader
32279
+ }, children: [jsxRuntimeExports$1.jsxs(Flex, { direction: "column", className: styles$4.datatable, children: [header, jsxRuntimeExports$1.jsxs(Flex, { className: styles$4.tableContainer, style: parentStyle, children: [jsxRuntimeExports$1.jsxs(Table, { ...props, style: tableStyle, children: [jsxRuntimeExports$1.jsx(Table.Header, { className: styles$4.header, children: ShouldShowHeader
32267
32280
  ? table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports$1.jsx(Table.Row, { children: headerGroup.headers.map((header, index) => {
32268
32281
  return (jsxRuntimeExports$1.jsx(Table.Head, { style: {
32269
32282
  cursor: "pointer",