@flytedan/flytebot-design-system 0.4.0 → 0.5.0
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 +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -352,9 +352,14 @@ declare function Tabs({ tabs, value, onChange, className, ...rest }: TabsProps):
|
|
|
352
352
|
|
|
353
353
|
/** 60px app header: breadcrumb left, actions right, and a 2px route loader along its top edge. */
|
|
354
354
|
interface TopbarProps {
|
|
355
|
+
/** A non-last crumb with `onClick` calls it (via `preventDefault`) instead of following
|
|
356
|
+
* `href` — for a crumb that needs to run a side effect (e.g. clearing some selection)
|
|
357
|
+
* before/instead of navigating. `href` still works on its own for a plain link crumb;
|
|
358
|
+
* the two aren't mutually exclusive, but `onClick` wins when both are present. */
|
|
355
359
|
crumbs?: Array<{
|
|
356
360
|
label: string;
|
|
357
361
|
href?: string;
|
|
362
|
+
onClick?: () => void;
|
|
358
363
|
}>;
|
|
359
364
|
actions?: React.ReactNode;
|
|
360
365
|
/** Shows the indeterminate route loader on the top edge. */
|
package/dist/index.d.ts
CHANGED
|
@@ -352,9 +352,14 @@ declare function Tabs({ tabs, value, onChange, className, ...rest }: TabsProps):
|
|
|
352
352
|
|
|
353
353
|
/** 60px app header: breadcrumb left, actions right, and a 2px route loader along its top edge. */
|
|
354
354
|
interface TopbarProps {
|
|
355
|
+
/** A non-last crumb with `onClick` calls it (via `preventDefault`) instead of following
|
|
356
|
+
* `href` — for a crumb that needs to run a side effect (e.g. clearing some selection)
|
|
357
|
+
* before/instead of navigating. `href` still works on its own for a plain link crumb;
|
|
358
|
+
* the two aren't mutually exclusive, but `onClick` wins when both are present. */
|
|
355
359
|
crumbs?: Array<{
|
|
356
360
|
label: string;
|
|
357
361
|
href?: string;
|
|
362
|
+
onClick?: () => void;
|
|
358
363
|
}>;
|
|
359
364
|
actions?: React.ReactNode;
|
|
360
365
|
/** Shows the indeterminate route loader on the top edge. */
|
package/dist/index.js
CHANGED
|
@@ -806,7 +806,17 @@ function Topbar({ crumbs = [], actions, loading = false, onMenu, className = "",
|
|
|
806
806
|
onMenu ? /* @__PURE__ */ jsx16("button", { type: "button", className: "fd-btn-icon", "aria-label": "Menu", onClick: onMenu, children: /* @__PURE__ */ jsx16("i", { className: "ph ph-list" }) }) : null,
|
|
807
807
|
/* @__PURE__ */ jsx16("nav", { className: "fd-crumb", "aria-label": "Breadcrumb", children: crumbs.map((c, i) => /* @__PURE__ */ jsxs12(React5.Fragment, { children: [
|
|
808
808
|
i > 0 ? /* @__PURE__ */ jsx16("i", { className: "ph ph-caret-right", style: { fontSize: 11, opacity: 0.6 }, "aria-hidden": "true" }) : null,
|
|
809
|
-
i === crumbs.length - 1 ? /* @__PURE__ */ jsx16("span", { className: "fd-crumb-current", children: c.label }) : /* @__PURE__ */ jsx16(
|
|
809
|
+
i === crumbs.length - 1 ? /* @__PURE__ */ jsx16("span", { className: "fd-crumb-current", children: c.label }) : /* @__PURE__ */ jsx16(
|
|
810
|
+
"a",
|
|
811
|
+
{
|
|
812
|
+
href: c.href || "#",
|
|
813
|
+
onClick: c.onClick ? (e) => {
|
|
814
|
+
e.preventDefault();
|
|
815
|
+
c.onClick();
|
|
816
|
+
} : void 0,
|
|
817
|
+
children: c.label
|
|
818
|
+
}
|
|
819
|
+
)
|
|
810
820
|
] }, i)) }),
|
|
811
821
|
/* @__PURE__ */ jsx16("span", { style: { flex: 1 } }),
|
|
812
822
|
actions,
|