@flytedan/flytebot-design-system 0.67.3 → 0.67.4

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
@@ -4993,8 +4993,8 @@ function splitForMiddleEllipsis(text) {
4993
4993
  if (chars.length <= TAIL_CHARS) return { head: text, tail: "" };
4994
4994
  return { head: chars.slice(0, -TAIL_CHARS).join(""), tail: chars.slice(-TAIL_CHARS).join("") };
4995
4995
  }
4996
- function MiddleEllipsis({ text }) {
4997
- const { head, tail } = splitForMiddleEllipsis(text);
4996
+ function MiddleEllipsis({ text, middle = true }) {
4997
+ const { head, tail } = middle ? splitForMiddleEllipsis(text) : { head: text, tail: "" };
4998
4998
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "fd-mid-ellipsis", children: [
4999
4999
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-mid-ellipsis-head", children: head }),
5000
5000
  tail ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "fd-mid-ellipsis-tail", children: tail }) : null
@@ -5131,6 +5131,9 @@ function assertValidFieldDefinition(field) {
5131
5131
  );
5132
5132
  }
5133
5133
  }
5134
+ function joinsLabels(field, value) {
5135
+ return field.type === "multiSelect" && value?.values.length === 2;
5136
+ }
5134
5137
  function chipLabel(field, value) {
5135
5138
  switch (field.type) {
5136
5139
  case "text":
@@ -5885,7 +5888,7 @@ function FilterBar({ fields = [], filters, onFilterChange, onFilterRemove, align
5885
5888
  const valueText = set ? chipLabel(field, value) : "";
5886
5889
  const chipText = set ? field.label + ": " + valueText : field.label;
5887
5890
  const paintedText = field.icon && set ? valueText : chipText;
5888
- const chip = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tag, { icon: field.icon, selected: true, onClick: toggleOrClose, onRemove: remove, title: chipText, "aria-label": chipText, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MiddleEllipsis, { text: paintedText }) });
5891
+ const chip = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tag, { icon: field.icon, selected: true, onClick: toggleOrClose, onRemove: remove, title: chipText, "aria-label": chipText, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MiddleEllipsis, { text: paintedText, middle: !joinsLabels(field, value) }) });
5889
5892
  if (field.type === "text") {
5890
5893
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "fd-filterbar-chip", children: chip }, field.key);
5891
5894
  }