@flytedan/flytebot-design-system 0.4.0 → 0.6.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.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. */
@@ -447,11 +452,13 @@ interface TagProps {
447
452
  children?: React.ReactNode;
448
453
  icon?: string;
449
454
  selected?: boolean;
455
+ /** Colors the chip once selected — e.g. a favoured ("success") or excluded ("danger") toggle. No effect while unselected. */
456
+ tone?: "neutral" | "info" | "success" | "warning" | "danger";
450
457
  onRemove?: () => void;
451
458
  onClick?: () => void;
452
459
  className?: string;
453
460
  }
454
- declare function Tag({ children, icon, selected, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
461
+ declare function Tag({ children, icon, selected, tone, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
455
462
 
456
463
  /** Confirmation of something that already happened. Bottom-right, 5s, undo where reversible. */
457
464
  interface ToastProps {
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. */
@@ -447,11 +452,13 @@ interface TagProps {
447
452
  children?: React.ReactNode;
448
453
  icon?: string;
449
454
  selected?: boolean;
455
+ /** Colors the chip once selected — e.g. a favoured ("success") or excluded ("danger") toggle. No effect while unselected. */
456
+ tone?: "neutral" | "info" | "success" | "warning" | "danger";
450
457
  onRemove?: () => void;
451
458
  onClick?: () => void;
452
459
  className?: string;
453
460
  }
454
- declare function Tag({ children, icon, selected, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
461
+ declare function Tag({ children, icon, selected, tone, onRemove, onClick, className, ...rest }: TagProps): React.JSX.Element;
455
462
 
456
463
  /** Confirmation of something that already happened. Bottom-right, 5s, undo where reversible. */
457
464
  interface ToastProps {
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("a", { href: c.href || "#", children: c.label })
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,
@@ -918,12 +928,13 @@ function hasModifier(e) {
918
928
 
919
929
  // src/components/feedback/Tag.tsx
920
930
  import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
921
- function Tag({ children, icon, selected = false, onRemove, onClick, className = "", ...rest }) {
931
+ var TONES2 = { info: "fd-tag-info", success: "fd-tag-success", warning: "fd-tag-warning", danger: "fd-tag-danger" };
932
+ function Tag({ children, icon, selected = false, tone = "neutral", onRemove, onClick, className = "", ...rest }) {
922
933
  return /* @__PURE__ */ jsxs17(
923
934
  "button",
924
935
  {
925
936
  type: "button",
926
- className: ["fd-tag", className].filter(Boolean).join(" "),
937
+ className: ["fd-tag", selected ? TONES2[tone] : null, className].filter(Boolean).join(" "),
927
938
  "aria-pressed": selected,
928
939
  onClick,
929
940
  ...rest,