@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.
@@ -2,6 +2,6 @@ import { VariantProps } from "class-variance-authority";
2
2
  import { ImgHTMLAttributes, PropsWithChildren } from "react";
3
3
  declare const image: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
4
4
  declare type ImageProps = PropsWithChildren<VariantProps<typeof image>> & ImgHTMLAttributes<HTMLImageElement>;
5
- export declare function Image({ children, className, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function Image({ alt, children, className, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
7
7
  //# sourceMappingURL=image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../image/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG7D,QAAA,MAAM,KAAK,yFAAoB,CAAC;AAEhC,aAAK,UAAU,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,GAC7D,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAElE"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../image/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG7D,QAAA,MAAM,KAAK,yFAAoB,CAAC;AAEhC,aAAK,UAAU,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,GAC7D,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAEvE"}
package/dist/index.cjs CHANGED
@@ -9301,8 +9301,8 @@ function Grid({ children, align, justify, flow, columns, gap, gapX, gapY, classN
9301
9301
  var styles$f = {"image":"image-module_image__KDN-Q"};
9302
9302
 
9303
9303
  const image = cva(styles$f.image);
9304
- function Image({ children, className, ...props }) {
9305
- return jsxRuntimeExports.jsx("img", { className: image({ className }), ...props });
9304
+ function Image({ alt, children, className, ...props }) {
9305
+ return jsxRuntimeExports.jsx("img", { alt: alt, className: image({ className }), ...props });
9306
9306
  }
9307
9307
 
9308
9308
  const InputField = ({ label, children, ...props }) => {
@@ -15310,8 +15310,6 @@ function DataTableClearFilter({ children, ...props }) {
15310
15310
  }, 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" })] })) }));
15311
15311
  }
15312
15312
 
15313
- 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"};
15314
-
15315
15313
  function DataTableFilterOptions({ children, ...props }) {
15316
15314
  const { table, filteredColumns, addFilterColumn } = useTable();
15317
15315
  const availableColumns = table
@@ -15323,20 +15321,20 @@ function DataTableFilterOptions({ children, ...props }) {
15323
15321
  })] })) : null] }));
15324
15322
  }
15325
15323
 
15326
- var styles$3 = {"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"};
15324
+ 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"};
15327
15325
 
15328
- const textfield = cva(styles$3.textfield, {
15326
+ const textfield = cva(styles$4.textfield, {
15329
15327
  variants: {
15330
15328
  size: {
15331
- small: styles$3["textfield-sm"],
15332
- medium: styles$3["textfield-md"],
15329
+ small: styles$4["textfield-sm"],
15330
+ medium: styles$4["textfield-md"],
15333
15331
  },
15334
15332
  state: {
15335
- invalid: styles$3["textfield-invalid"],
15336
- valid: styles$3["textfield-valid"],
15333
+ invalid: styles$4["textfield-invalid"],
15334
+ valid: styles$4["textfield-valid"],
15337
15335
  },
15338
15336
  leading: {
15339
- true: styles$3["textfield-leading"],
15337
+ true: styles$4["textfield-leading"],
15340
15338
  },
15341
15339
  },
15342
15340
  defaultVariants: {
@@ -15348,6 +15346,8 @@ const TextField = ({ leading, className, src, size, state, style, ...props }) =>
15348
15346
  };
15349
15347
  TextField.displayName = "TextField";
15350
15348
 
15349
+ 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"};
15350
+
15351
15351
  const FilteredChip = ({ column }) => {
15352
15352
  const { table, removeFilterColumn } = useTable();
15353
15353
  const { filterVariant } = column?.columnDef;
@@ -15381,7 +15381,7 @@ const FilteredChip = ({ column }) => {
15381
15381
  }
15382
15382
  }
15383
15383
  };
15384
- return (jsxRuntimeExports.jsxs(Box, { className: styles$4.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: () => {
15384
+ 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: () => {
15385
15385
  column.setFilterValue(undefined);
15386
15386
  removeFilterColumn(column.id);
15387
15387
  } }) })] }));
@@ -15394,14 +15394,14 @@ function DataTableFilterChips(props) {
15394
15394
  .filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide());
15395
15395
  if (!filteredColumns.length)
15396
15396
  return null;
15397
- return (jsxRuntimeExports.jsxs(Flex, { gap: "small", align: "center", className: styles$4.chipWrapper, ...props, children: [filteredColumns.map((filter, index) => {
15397
+ return (jsxRuntimeExports.jsxs(Flex, { gap: "small", align: "center", className: styles$3.chipWrapper, ...props, children: [filteredColumns.map((filter, index) => {
15398
15398
  const filteredColumn = table.getColumn(filter);
15399
- return jsxRuntimeExports.jsx(FilteredChip, { column: filteredColumn });
15399
+ return jsxRuntimeExports.jsx(FilteredChip, { column: filteredColumn }, index);
15400
15400
  }), filteredColumns.length < tableColumns.length && (jsxRuntimeExports.jsx(DataTableFilterOptions, { variant: "ghost", style: { border: "none", background: "none" }, children: jsxRuntimeExports.jsx(PlusIcon, { width: 16, height: 16 }) }))] }));
15401
15401
  }
15402
15402
 
15403
15403
  function DataTableFooter({ children, }) {
15404
- return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$4.toolbar, children: children }));
15404
+ return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$3.toolbar, children: children }));
15405
15405
  }
15406
15406
 
15407
15407
  function DataTableGloabalSearch(props) {
@@ -15414,7 +15414,7 @@ function DataTableGloabalSearch(props) {
15414
15414
  }
15415
15415
 
15416
15416
  function DataTableToolbar({ children, ...props }) {
15417
- return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$4.toolbar, ...props, children: children }));
15417
+ return (jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles$3.toolbar, ...props, children: children }));
15418
15418
  }
15419
15419
 
15420
15420
  function DataTableViewOptions({ children, ...props }) {
@@ -15454,7 +15454,7 @@ const useTableColumn = () => {
15454
15454
  };
15455
15455
  };
15456
15456
 
15457
- 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"};
15457
+ 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"};
15458
15458
 
15459
15459
  const table = cva(styles$2.table);
15460
15460
  const TableRoot = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntimeExports.jsx("div", { style: { width: "100%", overflow: "auto" }, children: jsxRuntimeExports.jsx("table", { ref: ref, className: table({ className }), ...props }) })));
@@ -15490,11 +15490,12 @@ const Table = Object.assign(TableRoot, {
15490
15490
  Caption: TableCaption,
15491
15491
  });
15492
15492
 
15493
- function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...props }) {
15493
+ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ShouldShowHeader = true, ...props }) {
15494
15494
  const convertedChildren = React.Children.toArray(children);
15495
- const header = convertedChildren.find((child) => child.type === DataTableToolbar) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15496
- const footer = convertedChildren.find((child) => child.type === DataTableFooter) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15497
- const detail = convertedChildren.find((child) => child.type === TableDetailContainer) || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
15495
+ const header = convertedChildren.find((child) => child.type === DataTableToolbar) || null;
15496
+ const footer = convertedChildren.find((child) => child.type === DataTableFooter) || null;
15497
+ const detail = convertedChildren.find((child) => child.type === TableDetailContainer) ||
15498
+ null;
15498
15499
  const [sorting, setSorting] = React.useState([]);
15499
15500
  const [columnFilters, setColumnFilters] = React.useState([]);
15500
15501
  const [columnVisibility, setColumnVisibility] = React.useState({});
@@ -15506,6 +15507,7 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
15506
15507
  columns,
15507
15508
  globalFilterFn: "auto",
15508
15509
  enableRowSelection: true,
15510
+ manualPagination: true,
15509
15511
  onGlobalFilterChange: setGlobalFilter,
15510
15512
  onSortingChange: setSorting,
15511
15513
  onColumnFiltersChange: setColumnFilters,
@@ -15525,7 +15527,8 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
15525
15527
  rowSelection,
15526
15528
  },
15527
15529
  });
15528
- return (jsxRuntimeExports.jsx(Flex, { direction: "column", justify: "between", className: styles$4.wrapper, children: jsxRuntimeExports.jsxs(TableContext.Provider, { value: {
15530
+ console.log(table.getRowModel().rows?.length);
15531
+ return (jsxRuntimeExports.jsx(Flex, { direction: "column", justify: "between", className: styles$3.wrapper, children: jsxRuntimeExports.jsxs(TableContext.Provider, { value: {
15529
15532
  table,
15530
15533
  globalFilter,
15531
15534
  filteredColumns,
@@ -15534,16 +15537,19 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, ...pr
15534
15537
  resetColumns,
15535
15538
  onGlobalFilterChange: setGlobalFilter,
15536
15539
  onChange: () => ({}),
15537
- }, children: [jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles$4.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) => {
15538
- return (jsxRuntimeExports.jsx(Table.Head, { style: {
15539
- ...(header.column.columnDef?.meta?.style ?? {}),
15540
- }, children: jsxRuntimeExports.jsxs(Text, { className: styles$4.head, children: [header.isPlaceholder
15541
- ? null
15542
- : flexRender(header.column.columnDef.header, header.getContext()), {
15543
- asc: jsxRuntimeExports.jsx(ArrowUpIcon, {}),
15544
- desc: jsxRuntimeExports.jsx(ArrowDownIcon, {}),
15545
- }[header.column.getIsSorted()] ?? null] }) }, header.id));
15546
- }) }, 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: {
15540
+ }, 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
15541
+ ? table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports.jsx(Table.Row, { children: headerGroup.headers.map((header) => {
15542
+ return (jsxRuntimeExports.jsx(Table.Head, { style: {
15543
+ ...(header.column.columnDef?.meta?.style ?? {}),
15544
+ }, children: jsxRuntimeExports.jsxs(Text, { className: styles$3.head, children: [header.isPlaceholder
15545
+ ? null
15546
+ : flexRender(header.column.columnDef.header, header.getContext()), {
15547
+ asc: jsxRuntimeExports.jsx(ArrowUpIcon, {}),
15548
+ desc: jsxRuntimeExports.jsx(ArrowDownIcon, {}),
15549
+ }[header.column.getIsSorted()] ??
15550
+ null] }) }, header.id));
15551
+ }) }, headerGroup.id)))
15552
+ : 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: {
15547
15553
  ...(cell.column.columnDef?.meta?.style ?? {}),
15548
15554
  }, 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] }) }));
15549
15555
  }