@dust-tt/sparkle 0.2.215 → 0.2.217

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/cjs/index.js CHANGED
@@ -129188,12 +129188,14 @@ var ELLIPSIS_STRING = "...";
129188
129188
  function Breadcrumbs(_a) {
129189
129189
  var items = _a.items;
129190
129190
  var components = React.useContext(SparkleContext).components;
129191
+ var Link = components.link;
129191
129192
  var _b = items.reduce(function (acc, item, index) {
129192
129193
  if (items.length <= 5 || index < 2 || index >= items.length - 2) {
129193
129194
  acc.itemsShown.push(item);
129194
129195
  }
129195
129196
  else if (index === 2) {
129196
129197
  acc.itemsShown.push({ label: ELLIPSIS_STRING });
129198
+ acc.itemsHidden.push(item);
129197
129199
  }
129198
129200
  else {
129199
129201
  acc.itemsHidden.push(item);
@@ -129204,21 +129206,18 @@ function Breadcrumbs(_a) {
129204
129206
  return (React.createElement("div", { key: "breadcrumbs-".concat(index), className: "s-flex s-flex-row s-items-center s-gap-1" },
129205
129207
  React.createElement(Icon, { visual: item.icon, className: "s-text-brand" }),
129206
129208
  item.label === ELLIPSIS_STRING ? (React.createElement(DropdownMenu, null,
129207
- React.createElement(DropdownMenu.Button, null,
129208
- "$",
129209
- ELLIPSIS_STRING),
129210
- React.createElement(DropdownMenu.Items, { origin: "topLeft" }, itemsHidden.map(function (item, index) { return (React.createElement(DropdownMenu.Item, { key: "breadcrumbs-hidden-".concat(index), icon: item.icon, label: item.label }, getLinkForItem(item, false, components.link))); })))) : (React.createElement("div", null, getLinkForItem(item, index === itemsShown.length - 1, components.link))),
129209
+ React.createElement(DropdownMenu.Button, null, ELLIPSIS_STRING),
129210
+ React.createElement(DropdownMenu.Items, { origin: "topLeft" }, itemsHidden.map(function (item, index) { return (React.createElement(DropdownMenu.Item, { icon: item.icon, label: item.label, href: item.href || "#", key: "breadcrumbs-hidden-".concat(index) }, truncateWithTooltip(item.label, LABEL_TRUNCATE_LENGTH_MIDDLE))); })))) : (React.createElement("div", null,
129211
+ React.createElement(Link, { href: item.href || "#", className: index === items.length - 1
129212
+ ? "s-text-element-900"
129213
+ : "s-text-element-700" }, index === items.length - 1
129214
+ ? truncateWithTooltip(item.label, LABEL_TRUNCATE_LENGTH_END)
129215
+ : truncateWithTooltip(item.label, LABEL_TRUNCATE_LENGTH_MIDDLE)))),
129211
129216
  index === itemsShown.length - 1 ? null : (React.createElement(SvgChevronRight$1, { className: "s-text-element-500" }))));
129212
129217
  })));
129213
129218
  }
129214
- function getLinkForItem(item, isLast, link) {
129215
- var Link = item.href ? link : noHrefLink;
129216
- return (React.createElement(Link, { href: item.href || "#", className: isLast ? "s-text-element-900" : "s-text-element-700" }, isLast
129217
- ? truncateWithTooltip(item.label, LABEL_TRUNCATE_LENGTH_END)
129218
- : truncateWithTooltip(item.label, LABEL_TRUNCATE_LENGTH_MIDDLE)));
129219
- }
129220
129219
  function truncateWithTooltip(text, length) {
129221
- return text.length > length ? (React.createElement(Tooltip, { label: text }, "".concat(text.substring(0, length - 1), "\u2026"))) : (text);
129220
+ return text.length > length ? (React.createElement(Tooltip, { label: text, position: "below" }, "".concat(text.substring(0, length - 1), "\u2026"))) : (text);
129222
129221
  }
129223
129222
 
129224
129223
  var SvgLogoHorizontalColor = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 96 24" }, props),