@flytedan/flytebot-design-system 0.48.0 → 0.48.1

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
@@ -1095,28 +1095,28 @@ function Card({
1095
1095
  interactive ? "fd-card-interactive" : "",
1096
1096
  className
1097
1097
  ].filter(Boolean).join(" ");
1098
- const head = title ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "fd-card-head", children: [
1098
+ const titleOnlyHead = title ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "fd-card-head", children: [
1099
1099
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "fd-card-head-title", title: truncationTitle(title), children: title }),
1100
- action
1100
+ !interactive && action
1101
1101
  ] }) : null;
1102
1102
  const body = padded ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "fd-card-body", children }) : children;
1103
1103
  const foot = footer ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "fd-card-foot", children: footer }) : null;
1104
- if (href != null) {
1105
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("a", { href, onClick, className: cls, role, tabIndex, ...rest, children: [
1106
- head,
1107
- body,
1108
- foot
1104
+ if (interactive) {
1105
+ const inner = href != null ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("a", { href, onClick, className: cls, role, tabIndex, ...rest, children: [
1106
+ titleOnlyHead,
1107
+ body
1108
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick, className: cls, role, tabIndex, ...rest, children: [
1109
+ titleOnlyHead,
1110
+ body
1109
1111
  ] });
1110
- }
1111
- if (onClick != null) {
1112
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick, className: cls, role, tabIndex, ...rest, children: [
1113
- head,
1114
- body,
1112
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "fd-card-shell", children: [
1113
+ inner,
1114
+ action ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "fd-card-shell-action", children: action }) : null,
1115
1115
  foot
1116
1116
  ] });
1117
1117
  }
1118
1118
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cls, role, tabIndex, ...rest, children: [
1119
- head,
1119
+ titleOnlyHead,
1120
1120
  body,
1121
1121
  foot
1122
1122
  ] });
@@ -1290,8 +1290,21 @@ function ScreenHead({ kicker, title, lede, actions }) {
1290
1290
  // src/components/layout/CardGrid.tsx
1291
1291
  var React8 = __toESM(require("react"), 1);
1292
1292
  var import_jsx_runtime12 = require("react/jsx-runtime");
1293
+ function flattenFragments(children) {
1294
+ const out = [];
1295
+ React8.Children.forEach(children, (child) => {
1296
+ if (child === null || child === void 0 || typeof child === "boolean") return;
1297
+ if (React8.isValidElement(child) && child.type === React8.Fragment) {
1298
+ const fragmentChildren = child.props.children;
1299
+ out.push(...flattenFragments(fragmentChildren));
1300
+ return;
1301
+ }
1302
+ out.push(child);
1303
+ });
1304
+ return out;
1305
+ }
1293
1306
  function CardGrid({ children, minCardWidth = 280, gap = "lg", className = "", style }) {
1294
- const items = React8.Children.toArray(children);
1307
+ const items = flattenFragments(children);
1295
1308
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1296
1309
  "div",
1297
1310
  {
@@ -1299,10 +1312,12 @@ function CardGrid({ children, minCardWidth = 280, gap = "lg", className = "", st
1299
1312
  className: ["fd-card-grid", "fd-gap-" + gap, className].filter(Boolean).join(" "),
1300
1313
  style: { ["--card-grid-min"]: minCardWidth + "px", ...style },
1301
1314
  children: items.map((child, i) => {
1302
- if (!React8.isValidElement(child)) return child;
1303
- const existingProps = child.props;
1304
- if (existingProps.role) return child;
1305
- return React8.cloneElement(child, { role: "listitem", key: child.key ?? i });
1315
+ if (React8.isValidElement(child)) {
1316
+ const existingRole = child.props.role;
1317
+ if (existingRole) return child;
1318
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { role: "listitem", children: child }, child.key ?? i);
1319
+ }
1320
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { role: "listitem", children: child }, i);
1306
1321
  })
1307
1322
  }
1308
1323
  );