@dust-tt/sparkle 0.2.217 → 0.2.218-rc-2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.217",
3
+ "version": "0.2.218-rc-2",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
@@ -4,7 +4,7 @@ import {
4
4
  flexRender,
5
5
  getCoreRowModel,
6
6
  getFilteredRowModel,
7
- getSortedRowModel,
7
+ getSortedRowModel, SortingFn,
8
8
  type SortingState,
9
9
  useReactTable,
10
10
  } from "@tanstack/react-table";
@@ -35,6 +35,7 @@ interface DataTableProps<TData extends TBaseData> {
35
35
  filterColumn?: string;
36
36
  initialColumnOrder?: SortingState;
37
37
  columnsBreakpoints?: ColumnBreakpoint;
38
+ sortingFn?: SortingFn<TData>
38
39
  }
39
40
 
40
41
  function shouldRenderColumn(
@@ -147,8 +147,8 @@ Tree.Item = function ({
147
147
  isNavigatable ? treeItemStyleClasses.isNavigatableBase : "",
148
148
  isNavigatable
149
149
  ? size === "sm"
150
- ? "s-gap-1 s-rounded-lg s-py-1 s-pl-1.5 s-pr-3"
151
- : "s-gap-2 s-rounded-lg s-py-2 s-pl-2.5 s-pr-4"
150
+ ? "s-gap-1 s-rounded-lg s-py-1 s-pr-3"
151
+ : "s-gap-2 s-rounded-lg s-py-2 s-pr-4"
152
152
  : size === "sm"
153
153
  ? "s-gap-1 s-py-1"
154
154
  : "s-gap-2 s-py-2",
@@ -156,7 +156,14 @@ Tree.Item = function ({
156
156
  ? isSelected
157
157
  ? treeItemStyleClasses.isNavigatableSelected
158
158
  : treeItemStyleClasses.isNavigatableUnselected
159
- : ""
159
+ : "",
160
+ type === "leaf"
161
+ ? "s-pl-5"
162
+ : isNavigatable
163
+ ? size === "sm"
164
+ ? "s-pl-1.5"
165
+ : "s-pl-2.5"
166
+ : ""
160
167
  )}
161
168
  onClick={onItemClick ? onItemClick : undefined}
162
169
  >
@@ -177,7 +184,6 @@ Tree.Item = function ({
177
184
  }}
178
185
  />
179
186
  )}
180
- {type === "leaf" && <div className="s-w-4"></div>}
181
187
  {checkbox && <Checkbox {...checkbox} size="xs" />}
182
188
  <Icon
183
189
  visual={visual}
@@ -54,6 +54,20 @@ export const DataTableExample = () => {
54
54
  },
55
55
  ],
56
56
  },
57
+ {
58
+ name: "design",
59
+ usedBy: 3,
60
+ addedBy: "User21",
61
+ lastUpdated: "2023-07-09",
62
+ size: "64kb",
63
+ icon: FolderIcon,
64
+ moreMenuItems: [
65
+ {
66
+ label: "Edit",
67
+ onClick: () => console.log("Edit"),
68
+ },
69
+ ],
70
+ },
57
71
  {
58
72
  name: "Development",
59
73
  usedBy: 5,
@@ -81,6 +95,7 @@ export const DataTableExample = () => {
81
95
  {
82
96
  accessorKey: "name",
83
97
  header: "Name",
98
+ sortingFn: "text",
84
99
  cell: (info) => (
85
100
  <DataTable.CellContent
86
101
  avatarUrl={info.row.original.avatarUrl}