@dust-tt/sparkle 0.2.240 → 0.2.242

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.
Files changed (49) hide show
  1. package/dist/cjs/index.js +35 -21
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/components/DataTable.d.ts +5 -4
  4. package/dist/esm/components/DataTable.d.ts.map +1 -1
  5. package/dist/esm/components/DataTable.js +17 -21
  6. package/dist/esm/components/DataTable.js.map +1 -1
  7. package/dist/esm/icons/solid/StopSign.d.ts +5 -0
  8. package/dist/esm/icons/solid/StopSign.d.ts.map +1 -0
  9. package/dist/esm/icons/solid/StopSign.js +6 -0
  10. package/dist/esm/icons/solid/StopSign.js.map +1 -0
  11. package/dist/esm/icons/solid/index.d.ts +1 -0
  12. package/dist/esm/icons/solid/index.d.ts.map +1 -1
  13. package/dist/esm/icons/solid/index.js +1 -0
  14. package/dist/esm/icons/solid/index.js.map +1 -1
  15. package/dist/esm/icons/src/solid/stop-sign.svg +3 -0
  16. package/dist/esm/icons/src/stroke/stop-sign.svg +4 -0
  17. package/dist/esm/icons/stroke/StopSign.d.ts +5 -0
  18. package/dist/esm/icons/stroke/StopSign.d.ts.map +1 -0
  19. package/dist/esm/icons/stroke/StopSign.js +7 -0
  20. package/dist/esm/icons/stroke/StopSign.js.map +1 -0
  21. package/dist/esm/icons/stroke/index.d.ts +1 -0
  22. package/dist/esm/icons/stroke/index.d.ts.map +1 -1
  23. package/dist/esm/icons/stroke/index.js +1 -0
  24. package/dist/esm/icons/stroke/index.js.map +1 -1
  25. package/dist/esm/logo/platforms/O1.d.ts +5 -0
  26. package/dist/esm/logo/platforms/O1.d.ts.map +1 -0
  27. package/dist/esm/logo/platforms/O1.js +11 -0
  28. package/dist/esm/logo/platforms/O1.js.map +1 -0
  29. package/dist/esm/logo/platforms/index.d.ts +1 -0
  30. package/dist/esm/logo/platforms/index.d.ts.map +1 -1
  31. package/dist/esm/logo/platforms/index.js +1 -0
  32. package/dist/esm/logo/platforms/index.js.map +1 -1
  33. package/dist/esm/logo/src/platforms/o1.svg +11 -0
  34. package/dist/esm/stories/DataTable.stories.d.ts +1 -0
  35. package/dist/esm/stories/DataTable.stories.d.ts.map +1 -1
  36. package/dist/esm/stories/DataTable.stories.js +24 -4
  37. package/dist/esm/stories/DataTable.stories.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/components/DataTable.tsx +31 -11
  40. package/src/icons/solid/StopSign.tsx +20 -0
  41. package/src/icons/solid/index.ts +1 -0
  42. package/src/icons/src/solid/stop-sign.svg +3 -0
  43. package/src/icons/src/stroke/stop-sign.svg +4 -0
  44. package/src/icons/stroke/StopSign.tsx +21 -0
  45. package/src/icons/stroke/index.ts +1 -0
  46. package/src/logo/platforms/O1.tsx +29 -0
  47. package/src/logo/platforms/index.ts +1 -0
  48. package/src/logo/src/platforms/o1.svg +11 -0
  49. package/src/stories/DataTable.stories.tsx +53 -5
package/dist/cjs/index.js CHANGED
@@ -505,6 +505,9 @@ var SvgStar$1 = function (props) { return (React__namespace.createElement("svg",
505
505
  var SvgStop$1 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
506
506
  React__namespace.createElement("path", { fill: "currentColor", d: "M5 5h14v14H5z" }))); };
507
507
 
508
+ var SvgStopSign$1 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
509
+ React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12s4.48 10 10 10 10-4.48 10-10Zm-4-1.5H6v3h12v-3Z", clipRule: "evenodd" }))); };
510
+
508
511
  var SvgTable$1 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
509
512
  React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2 22h20V2H2v20Zm9-18v4H4V4h7ZM4 14v-4h7v4H4Zm0 2h7v4H4v-4Zm9 0h7v4h-7v-4Zm7-2h-7v-4h7v4Zm0-10v4h-7V4h7Z", clipRule: "evenodd" }))); };
510
513
 
@@ -72535,6 +72538,10 @@ var SvgStar = function (props) { return (React__namespace.createElement("svg", _
72535
72538
  var SvgStop = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
72536
72539
  React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M17 7H7v10h10V7ZM5 5v14h14V5H5Z", clipRule: "evenodd" }))); };
72537
72540
 
72541
+ var SvgStopSign = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
72542
+ React__namespace.createElement("path", { fill: "currentColor", d: "M18 10.5H6v3h12v-3Z" }),
72543
+ React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12s4.48 10 10 10 10-4.48 10-10Zm-2 0c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8 8 3.58 8 8Z", clipRule: "evenodd" }))); };
72544
+
72538
72545
  var SvgTable = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
72539
72546
  React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2 22h20V2H2v20Zm9-18v4H4V4h7ZM4 14v-4h7v4H4Zm0 2h7v4H4v-4Zm9 0h7v4h-7v-4Zm7-2h-7v-4h7v4Zm0-10v4h-7V4h7Z", clipRule: "evenodd" }))); };
72540
72547
 
@@ -99355,6 +99362,14 @@ var SvgNotion = function (props) { return (React__namespace.createElement("svg",
99355
99362
  React__namespace.createElement("path", { fill: "#fff", d: "m3.203 2.863 11.067-.818c1.36-.116 1.709-.038 2.563.584l3.533 2.488c.583.428.777.545.777 1.01v13.65c0 .855-.311 1.36-1.398 1.438l-12.852.778c-.816.039-1.204-.078-1.632-.622L2.66 17.988c-.467-.623-.66-1.089-.66-1.633V4.223c0-.7.31-1.283 1.203-1.36Z" }),
99356
99363
  React__namespace.createElement("path", { fill: "#000", fillRule: "evenodd", d: "m14.77 2.045-11.067.818c-.892.077-1.203.66-1.203 1.36v12.132c0 .544.193 1.01.66 1.633l2.601 3.383c.428.544.816.661 1.632.622l12.852-.778c1.086-.077 1.398-.583 1.398-1.438V6.128c0-.442-.175-.57-.689-.947l-3.62-2.552c-.855-.622-1.205-.7-2.564-.584Zm-7.086 3.86c-1.05.07-1.287.086-1.883-.398L4.285 4.3c-.154-.156-.076-.35.312-.389l10.638-.777c.894-.078 1.359.233 1.708.505l1.825 1.322c.078.04.272.272.039.272L7.82 5.895l-.136.01ZM6.461 19.66V8.073c0-.506.155-.739.62-.778L19.7 6.556c.428-.039.621.233.621.739v11.509c0 .506-.078.934-.776.973l-12.076.7c-.698.038-1.008-.194-1.008-.817ZM18.38 8.695c.077.35 0 .7-.35.74l-.582.115v8.555c-.506.272-.971.427-1.36.427-.621 0-.776-.195-1.242-.777l-3.806-5.988v5.793l1.204.273s0 .7-.971.7l-2.678.155c-.078-.156 0-.545.271-.622l.7-.194v-7.66l-.971-.079c-.078-.35.116-.855.66-.894l2.873-.194 3.96 6.066V9.745l-1.009-.116c-.078-.429.233-.74.62-.778l2.68-.156Z", clipRule: "evenodd" }))); };
99357
99364
 
99365
+ var SvgO1 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
99366
+ React__namespace.createElement("g", { clipPath: "url(#o1_svg__a)" },
99367
+ React__namespace.createElement("path", { fill: "currentColor", d: "M0 4a4 4 0 0 1 4-4h16a4 4 0 0 1 4 4v16a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4Z" }),
99368
+ React__namespace.createElement("path", { fill: "#F8FAFC", d: "M19.813 10.367a4.432 4.432 0 0 0-.39-3.683c-.996-1.71-2.997-2.59-4.95-2.176A4.574 4.574 0 0 0 11.043 3c-1.997-.004-3.77 1.265-4.384 3.14a4.543 4.543 0 0 0-3.04 2.175 4.49 4.49 0 0 0 .566 5.318 4.432 4.432 0 0 0 .39 3.684c.996 1.71 2.997 2.59 4.951 2.175A4.57 4.57 0 0 0 12.955 21c1.999.005 3.772-1.265 4.386-3.142a4.543 4.543 0 0 0 3.04-2.176 4.49 4.49 0 0 0-.567-5.316l-.001.001Zm-6.857 9.457a3.435 3.435 0 0 1-2.188-.781c.028-.015.076-.041.107-.06l3.633-2.07c.186-.104.3-.3.299-.51v-5.054l1.535.875a.053.053 0 0 1 .03.042v4.184c-.003 1.861-1.53 3.37-3.416 3.374Zm-7.344-3.096a3.321 3.321 0 0 1-.408-2.26l.108.064 3.632 2.07a.598.598 0 0 0 .597 0l4.434-2.527v1.75a.056.056 0 0 1-.021.046l-3.672 2.092c-1.635.93-3.724.377-4.67-1.235Zm-.957-7.824a3.396 3.396 0 0 1 1.78-1.479l-.002.124v4.14a.582.582 0 0 0 .298.51l4.435 2.527-1.536.874a.055.055 0 0 1-.051.005L5.906 13.51a3.353 3.353 0 0 1-1.251-4.606Zm12.614 2.897-4.435-2.527L14.37 8.4a.055.055 0 0 1 .051-.005l3.673 2.092a3.35 3.35 0 0 1 1.25 4.61 3.406 3.406 0 0 1-1.778 1.478V12.31a.58.58 0 0 0-.297-.51Zm1.528-2.27a5.022 5.022 0 0 0-.108-.063l-3.633-2.07a.598.598 0 0 0-.596 0l-4.435 2.527v-1.75a.056.056 0 0 1 .022-.046l3.671-2.09c1.636-.932 3.727-.378 4.67 1.237.398.681.543 1.48.407 2.255h.002ZM9.19 12.65l-1.535-.874a.053.053 0 0 1-.03-.042V7.55c.001-1.863 1.533-3.373 3.421-3.372.799 0 1.572.277 2.186.78a2.563 2.563 0 0 0-.108.06L9.49 7.088a.58.58 0 0 0-.298.51l-.003 5.051v.001Zm.834-1.774L12 9.75l1.975 1.125v2.25L12 14.25l-1.976-1.125v-2.25Z" })),
99369
+ React__namespace.createElement("defs", null,
99370
+ React__namespace.createElement("clipPath", { id: "o1_svg__a" },
99371
+ React__namespace.createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" }))))); };
99372
+
99358
99373
  var SvgOffice = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
99359
99374
  React__namespace.createElement("path", { fill: "url(#Office_svg__a)", d: "m10.22 2.465-.102.062a3.636 3.636 0 0 0-.458.328l.294-.207h2.5l.455 3.442-2.273 2.273-2.273 1.58v1.822c0 1.272.665 2.452 1.754 3.11l2.393 1.449-5.056 2.949H6.48l-1.817-1.1a3.637 3.637 0 0 1-1.753-3.111V8.936c0-1.273.665-2.453 1.754-3.112l5.455-3.299.102-.06Z" }),
99360
99375
  React__namespace.createElement("path", { fill: "url(#Office_svg__b)", d: "m10.22 2.465-.102.062a3.636 3.636 0 0 0-.458.328l.294-.207h2.5l.455 3.442-2.273 2.273-2.273 1.58v1.822c0 1.272.665 2.452 1.754 3.11l2.393 1.449-5.056 2.949H6.48l-1.817-1.1a3.637 3.637 0 0 1-1.753-3.111V8.936c0-1.273.665-2.453 1.754-3.112l5.455-3.299.102-.06Z" }),
@@ -103435,38 +103450,34 @@ function shouldRenderColumn(windowWidth, breakpoint) {
103435
103450
  return windowWidth >= breakpoints[breakpoint];
103436
103451
  }
103437
103452
  function DataTable(_a) {
103438
- var data = _a.data, totalRowCount = _a.totalRowCount, columns = _a.columns, className = _a.className, _b = _a.widthClassName, widthClassName = _b === void 0 ? "s-w-full s-max-w-4xl" : _b, filter = _a.filter, filterColumn = _a.filterColumn, initialColumnOrder = _a.initialColumnOrder, _c = _a.columnsBreakpoints, columnsBreakpoints = _c === void 0 ? {} : _c, pagination = _a.pagination, setPagination = _a.setPagination;
103453
+ var data = _a.data, totalRowCount = _a.totalRowCount, columns = _a.columns, className = _a.className, _b = _a.widthClassName, widthClassName = _b === void 0 ? "s-w-full s-max-w-4xl" : _b, filter = _a.filter, filterColumn = _a.filterColumn, _c = _a.columnsBreakpoints, columnsBreakpoints = _c === void 0 ? {} : _c, pagination = _a.pagination, setPagination = _a.setPagination, sorting = _a.sorting, setSorting = _a.setSorting, _d = _a.isServerSideSorting, isServerSideSorting = _d === void 0 ? false : _d;
103439
103454
  var windowSize = useWindowSize();
103440
- var _d = __read(React.useState(initialColumnOrder !== null && initialColumnOrder !== void 0 ? initialColumnOrder : []), 2), sorting = _d[0], setSorting = _d[1];
103441
103455
  var _e = __read(React.useState([]), 2), columnFilters = _e[0], setColumnFilters = _e[1];
103442
103456
  var isServerSidePagination = !!totalRowCount && totalRowCount > data.length;
103457
+ var isClientSideSortingEnabled = !isServerSideSorting && !isServerSidePagination;
103443
103458
  var onPaginationChange = pagination && setPagination
103444
103459
  ? function (updater) {
103445
103460
  var newValue = typeof updater === "function" ? updater(pagination) : updater;
103446
103461
  setPagination(newValue);
103447
103462
  }
103448
103463
  : undefined;
103449
- var table = useReactTable({
103450
- data: data,
103451
- columns: columns,
103452
- rowCount: totalRowCount,
103453
- manualPagination: isServerSidePagination,
103454
- onSortingChange: setSorting,
103455
- getCoreRowModel: getCoreRowModel(),
103464
+ var onSortingChange = sorting && setSorting
103465
+ ? function (updater) {
103466
+ var newValue = typeof updater === "function" ? updater(sorting) : updater;
103467
+ setSorting(newValue);
103468
+ }
103469
+ : undefined;
103470
+ var table = useReactTable(__assign(__assign(__assign(__assign({ data: data, columns: columns, rowCount: totalRowCount, manualPagination: isServerSidePagination, manualSorting: isServerSideSorting }, (isServerSideSorting && {
103471
+ onSortingChange: onSortingChange,
103472
+ })), { getCoreRowModel: getCoreRowModel() }), (!isServerSideSorting && {
103456
103473
  getSortedRowModel: getSortedRowModel(),
103457
- getFilteredRowModel: getFilteredRowModel(),
103458
- getPaginationRowModel: pagination ? getPaginationRowModel() : undefined,
103459
- onColumnFiltersChange: setColumnFilters,
103460
- state: {
103461
- columnFilters: columnFilters,
103462
- sorting: isServerSidePagination ? undefined : sorting,
103463
- pagination: pagination,
103464
- },
103465
- initialState: {
103474
+ enableSorting: isClientSideSortingEnabled,
103475
+ })), { getFilteredRowModel: getFilteredRowModel(), getPaginationRowModel: pagination ? getPaginationRowModel() : undefined, onColumnFiltersChange: setColumnFilters, state: __assign(__assign({ columnFilters: columnFilters }, (isServerSideSorting && {
103476
+ sorting: sorting,
103477
+ })), { pagination: pagination }), initialState: {
103466
103478
  pagination: pagination,
103467
- },
103468
- onPaginationChange: onPaginationChange,
103469
- });
103479
+ sorting: sorting,
103480
+ }, onPaginationChange: onPaginationChange }));
103470
103481
  React.useEffect(function () {
103471
103482
  var _a;
103472
103483
  if (filterColumn) {
@@ -129689,6 +129700,7 @@ exports.MovingMailIcon = SvgMovingMail$1;
129689
129700
  exports.MovingMailStrokeIcon = SvgMovingMail;
129690
129701
  exports.Notification = Notification;
129691
129702
  exports.NotionLogo = SvgNotion;
129703
+ exports.O1Logo = SvgO1;
129692
129704
  exports.OfficeLogo = SvgOffice;
129693
129705
  exports.OpenaiLogo = SvgOpenai;
129694
129706
  exports.OpenaiWhiteLogo = SvgOpenaiWhite;
@@ -129752,6 +129764,8 @@ exports.SquareStrokeIcon = SvgSquare;
129752
129764
  exports.StarIcon = SvgStar$1;
129753
129765
  exports.StarStrokeIcon = SvgStar;
129754
129766
  exports.StopIcon = SvgStop$1;
129767
+ exports.StopSignIcon = SvgStopSign$1;
129768
+ exports.StopSignStrokeIcon = SvgStopSign;
129755
129769
  exports.StopStrokeIcon = SvgStop;
129756
129770
  exports.Tab = Tab;
129757
129771
  exports.TableIcon = SvgTable$1;